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++)
163 static inline short R16(
const unsigned char*
src)
165 return (
short)((
unsigned short)
src[0] | ((
unsigned short)
src[1] << 8));
173 static inline void W16(
unsigned char*
dst,
short s)
184 static 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);
#define WAVE_FORMAT_UNKNOWN
static void ADPCM_Reset(PACMDRVSTREAMINSTANCE adsi, AcmAdpcmData *aad)
static void process_nibble(unsigned char code, int *stepIndex, int *sample)
#define ACM_STREAMSIZEF_DESTINATION
WCHAR szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS]
static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC
#define ACM_STREAMCONVERTF_BLOCKALIGN
struct tagAcmAdpcmData AcmAdpcmData
LRESULT CALLBACK ADPCM_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
static void clamp_sample(int *sample)
static void cvtMM16imaK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD nsrc, unsigned char *dst, LPDWORD ndst)
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
static void cvtSSima16K(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD nsrc, unsigned char *dst, LPDWORD ndst)
IMAADPCMWAVEFORMAT * LPIMAADPCMWAVEFORMAT
#define ACMDM_STREAM_RESET
static const unsigned IMA_StepTable[89]
#define ACM_FORMATSUGGESTF_WFORMATTAG
WINE_DEFAULT_DEBUG_CHANNEL(adpcm)
#define ACMDM_STREAM_OPEN
static void init_wfx_ima_adpcm(IMAADPCMWAVEFORMAT *awfx)
#define ACMDM_FORMATTAG_DETAILS
static const Format ADPCM_Formats[]
#define ACMDM_STREAM_PREPARE
struct pcmwaveformat_tag PCMWAVEFORMAT
#define ACM_STREAMCONVERTF_END
#define ACMDM_STREAM_CLOSE
#define DRV_QUERYCONFIGURE
int WINAPI MessageBoxA(_In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_ UINT)
static unsigned char generate_nibble(int in, int *stepIndex, int *sample)
#define ACMDM_DRIVER_NOTIFY
#define ACMDM_FORMAT_SUGGEST
static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
static unsigned char bytes[4]
#define ACM_FORMATDETAILSF_FORMAT
WCHAR szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS]
#define ACMDM_DRIVER_DETAILS
#define ACMDM_STREAM_CONVERT
static const int IMA_IndexTable[16]
#define ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
#define ACM_FORMATSUGGESTF_NCHANNELS
static void cvtMMimaK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD nsrc, unsigned char *dst, LPDWORD ndst)
#define ACMDM_HARDWARE_WAVE_CAPS_OUTPUT
#define ACMDM_HARDWARE_WAVE_CAPS_INPUT
static LRESULT ADPCM_DriverDetails(PACMDRIVERDETAILSW add)
void(* convert)(PACMDRVSTREAMINSTANCE adsi, const unsigned char *, LPDWORD, unsigned char *, LPDWORD)
#define ACM_FORMATTAGDETAILSF_FORMATTAG
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static void W16(unsigned char *dst, short s)
#define WAVE_FORMAT_IMA_ADPCM
#define ACM_STREAMSIZEF_SOURCE
#define ACM_FORMATTAGDETAILSF_INDEX
static LRESULT ADPCM_StreamClose(PACMDRVSTREAMINSTANCE adsi)
WCHAR szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS]
#define ACM_STREAMOPENF_ASYNC
static void cvtSS16imaK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD nsrc, unsigned char *dst, LPDWORD ndst)
#define MMSYSERR_NOTSUPPORTED
#define MM_MSFT_ACM_IMAADPCM
#define ACMDM_FILTERTAG_DETAILS
static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
static void clamp_step_index(int *stepIndex)
#define ACM_FORMATTAGDETAILSF_LARGESTSIZE
#define ACMERR_NOTPOSSIBLE
#define ACMDM_STREAM_UNPREPARE
static void W8(unsigned char *dst, short s)
struct ima_adpcmwaveformat_tag IMAADPCMWAVEFORMAT
static LRESULT ADPCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
#define ACM_STREAMCONVERTF_START
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
#define MMSYSERR_INVALPARAM
static LRESULT ADPCM_drvClose(DWORD_PTR dwDevID)
static const Format PCM_Formats[]
static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX *wfx)
#define MultiByteToWideChar
#define ACM_FORMATDETAILSF_INDEX
static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
WCHAR szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS]
WCHAR szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS]
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
static short R16(const unsigned char *src)
static LRESULT ADPCM_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSIZE adss)
#define HeapFree(x, y, z)
#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE
#define ACMDM_FORMAT_DETAILS
static unsigned(__cdecl *hash_bstr)(bstr_t s)
static void W8_16(unsigned char *dst, short s, int bytes)
#define ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char * Format
#define ACMDM_STREAM_SIZE
#define ACMDM_FILTER_DETAILS