70 {1, 8, 8000}, {2, 8, 8000}, {1, 16, 8000}, {2, 16, 8000},
71 {1, 8, 11025}, {2, 8, 11025}, {1, 16, 11025}, {2, 16, 11025},
72 {1, 8, 22050}, {2, 8, 22050}, {1, 16, 22050}, {2, 16, 22050},
73 {1, 8, 44100}, {2, 8, 44100}, {1, 16, 44100}, {2, 16, 44100},
78 {1, 4, 8000}, {2, 4, 8000}, {1, 4, 11025}, {2, 4, 11025},
79 {1, 4, 22050}, {2, 4, 22050}, {1, 4, 44100}, {2, 4, 44100},
104 for (
i = 0;
i < hi;
i++)
163static inline short R16(
const unsigned char*
src)
165 return (
short)((
unsigned short)
src[0] | ((
unsigned short)
src[1] << 8));
173static inline void W16(
unsigned char*
dst,
short s)
184static inline void W8(
unsigned char*
dst,
short s)
186 dst[0] = (
unsigned char)((
s + 32768) >> 8);
202 7, 8, 9, 10, 11, 12, 13, 14,
203 16, 17, 19, 21, 23, 25, 28, 31,
204 34, 37, 41, 45, 50, 55, 60, 66,
205 73, 80, 88, 97, 107, 118, 130, 143,
206 157, 173, 190, 209, 230, 253, 279, 307,
207 337, 371, 408, 449, 494, 544, 598, 658,
208 724, 796, 876, 963, 1060, 1166, 1282, 1411,
209 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024,
210 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484,
211 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
212 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794,
218 -1, -1, -1, -1, 2, 4, 6, 8,
219 -1, -1, -1, -1, 2, 4, 6, 8
224 if (*stepIndex < 0 ) *stepIndex = 0;
225 if (*stepIndex > 88) *stepIndex = 88;
230 if (*sample < -32768) *sample = -32768;
231 if (*sample > 32767) *sample = 32767;
243 if (
code & 1) diff += step >> 2;
244 if (
code & 2) diff += step >> 1;
245 if (
code & 4) diff += step;
246 if (
code & 8) *sample -= diff;
247 else *sample += diff;
255 int effdiff, diff =
in - *sample;
270 effdiff = (step >> 3);
290 if (
code & 8) *sample -= effdiff;
291 else *sample += effdiff;
303 int sampleL, sampleR;
304 int stepIndexL, stepIndexR;
312 *ndst / (nsamp_blk * 2 * 2));
315 *ndst = nblock * (nsamp_blk * 2 * 2);
318 for (; nblock > 0; nblock--)
320 const unsigned char* in_src =
src;
335 for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 8)
337 for (
i = 0;
i < 4;
i++)
340 W16(
dst + (2 *
i + 0) * 4 + 0, sampleL);
342 W16(
dst + (2 *
i + 1) * 4 + 0, sampleL);
344 for (
i = 0;
i < 4;
i++)
347 W16(
dst + (2 *
i + 0) * 4 + 2, sampleR);
349 W16(
dst + (2 *
i + 1) * 4 + 2, sampleR);
374 *ndst = nblock * nsamp_blk * bytesPerSample;
377 for (; nblock > 0; nblock--)
379 const unsigned char* in_src =
src;
386 W8_16(
dst, sample, bytesPerSample);
dst += bytesPerSample;
388 for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2)
391 W8_16(
dst, sample, bytesPerSample);
dst += bytesPerSample;
393 W8_16(
dst, sample, bytesPerSample);
dst += bytesPerSample;
404 int stepIndexL, stepIndexR;
405 int sampleL, sampleR;
413 DWORD nblock =
min(*nsrc / (nsamp_blk * 2 * 2),
416 *nsrc = nblock * (nsamp_blk * 2 * 2);
424 for (; nblock > 0; nblock--)
426 unsigned char* in_dst =
dst;
437 for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 8)
439 for (
i = 0;
i < 4;
i++)
442 &stepIndexL, &sampleL);
444 &stepIndexL, &sampleL);
445 *
dst++ = (code2 << 4) | code1;
447 for (
i = 0;
i < 4;
i++)
450 &stepIndexR, &sampleR);
452 &stepIndexR, &sampleR);
453 *
dst++ = (code2 << 4) | code1;
476 DWORD nblock =
min(*nsrc / (nsamp_blk * 2),
479 *nsrc = nblock * (nsamp_blk * 2);
485 for (; nblock > 0; nblock--)
487 unsigned char* in_dst =
dst;
500 *
dst = (
unsigned char)(
unsigned)stepIndex;
503 for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2)
509 *
dst++ = (code2 << 4) | code1;
551 static const WCHAR szPcm[]={
'P',
'C',
'M',0};
552 static const WCHAR szImaAdPcm[]={
'I',
'M',
'A',
' ',
'A',
'D',
'P',
'C',
'M',0};
575 WARN(
"Unsupported query %08x\n", dwQuery);
639 WARN(
"Unsupported query %08x\n", dwQuery);
753 TRACE(
"spb=%u\n", nspb);
759 if (((nspb - 1) & 3) != 0)
goto theEnd;
783 TRACE(
"spb=%u\n", nspb);
789 if (((nspb - 1) & 3) != 0)
goto theEnd;
904 FIXME(
"Unsupported fdwConvert (%08x), ignoring it\n", adsh->
fdwConvert);
929 TRACE(
"(%08lx %p %04x %08lx %08lx);\n",
930 dwDevID, hDriv, wMsg, dwParam1, dwParam2);
988 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
static unsigned char bytes[4]
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define HeapFree(x, y, z)
#define MultiByteToWideChar
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static void clamp_step_index(int *stepIndex)
LRESULT CALLBACK ADPCM_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
static void W8_16(unsigned char *dst, short s, int bytes)
static const unsigned IMA_StepTable[89]
struct tagAcmAdpcmData AcmAdpcmData
static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
static LRESULT ADPCM_StreamClose(PACMDRVSTREAMINSTANCE adsi)
static const Format ADPCM_Formats[]
static void cvtMMimaK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD nsrc, unsigned char *dst, LPDWORD ndst)
static void init_wfx_ima_adpcm(IMAADPCMWAVEFORMAT *awfx)
static void cvtSSima16K(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD nsrc, unsigned char *dst, LPDWORD ndst)
static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
static void ADPCM_Reset(PACMDRVSTREAMINSTANCE adsi, AcmAdpcmData *aad)
static void W8(unsigned char *dst, short s)
static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
static void clamp_sample(int *sample)
static void W16(unsigned char *dst, short s)
static const int IMA_IndexTable[16]
static void process_nibble(unsigned char code, int *stepIndex, int *sample)
static unsigned char generate_nibble(int in, int *stepIndex, int *sample)
static void cvtMM16imaK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD nsrc, unsigned char *dst, LPDWORD ndst)
static LRESULT ADPCM_DriverDetails(PACMDRIVERDETAILSW add)
static void cvtSS16imaK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD nsrc, unsigned char *dst, LPDWORD ndst)
static LRESULT ADPCM_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSIZE adss)
static LRESULT ADPCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX *wfx)
static LRESULT ADPCM_drvClose(DWORD_PTR dwDevID)
static const Format PCM_Formats[]
static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
static short R16(const unsigned char *src)
IMAADPCMWAVEFORMAT * LPIMAADPCMWAVEFORMAT
#define WAVE_FORMAT_UNKNOWN
#define WAVE_FORMAT_IMA_ADPCM
struct ima_adpcmwaveformat_tag IMAADPCMWAVEFORMAT
#define MM_MSFT_ACM_IMAADPCM
#define DRV_QUERYCONFIGURE
#define MMSYSERR_NOTSUPPORTED
struct pcmwaveformat_tag PCMWAVEFORMAT
#define MMSYSERR_INVALPARAM
static unsigned(__cdecl *hash_bstr)(bstr_t s)
#define ACM_STREAMCONVERTF_START
#define ACM_FORMATTAGDETAILSF_FORMATTAG
#define ACM_STREAMCONVERTF_BLOCKALIGN
#define ACM_STREAMOPENF_ASYNC
#define ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
#define ACM_FORMATSUGGESTF_WFORMATTAG
#define ACM_FORMATSUGGESTF_NCHANNELS
#define ACMERR_NOTPOSSIBLE
#define ACM_FORMATDETAILSF_FORMAT
#define ACM_STREAMSIZEF_SOURCE
#define ACM_FORMATTAGDETAILSF_LARGESTSIZE
#define ACM_STREAMSIZEF_DESTINATION
#define ACM_FORMATDETAILSF_INDEX
#define ACM_FORMATTAGDETAILSF_INDEX
#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE
#define ACM_STREAMCONVERTF_END
#define ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC
#define ACMDM_STREAM_PREPARE
#define ACMDM_STREAM_CLOSE
#define ACMDM_STREAM_CONVERT
#define ACMDM_FORMAT_SUGGEST
#define ACMDM_FILTER_DETAILS
#define ACMDM_HARDWARE_WAVE_CAPS_INPUT
#define ACMDM_DRIVER_NOTIFY
#define ACMDM_FORMAT_DETAILS
#define ACMDM_STREAM_SIZE
#define ACMDM_FILTERTAG_DETAILS
#define ACMDM_HARDWARE_WAVE_CAPS_OUTPUT
#define ACMDM_FORMATTAG_DETAILS
#define ACMDM_STREAM_UNPREPARE
#define ACMDM_STREAM_OPEN
#define ACMDM_DRIVER_DETAILS
#define ACMDM_STREAM_RESET
WCHAR szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS]
WCHAR szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS]
WCHAR szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS]
WCHAR szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS]
WCHAR szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS]
void(* convert)(PACMDRVSTREAMINSTANCE adsi, const unsigned char *, LPDWORD, unsigned char *, LPDWORD)
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)