72 {1, 16, 8000}, {2, 16, 8000},
73 {1, 16, 11025}, {2, 16, 11025},
74 {1, 16, 22050}, {2, 16, 22050},
75 {1, 16, 44100}, {2, 16, 44100},
80 {1, 8, 8000}, {2, 8, 8000}, {1, 8, 11025}, {2, 8, 11025},
81 {1, 8, 22050}, {2, 8, 22050}, {1, 8, 44100}, {2, 8, 44100},
86 {1, 8, 8000}, {2, 8, 8000}, {1, 8, 11025}, {2, 8, 11025},
87 {1, 8, 22050}, {2, 8, 22050}, {1, 8, 44100}, {2, 8, 44100},
116 for (
i = 0;
i < hi;
i++)
132 static inline short R16(
const unsigned char*
src)
134 return (
short)((
unsigned short)
src[0] | ((
unsigned short)
src[1] << 8));
142 static inline void W16(
unsigned char*
dst,
short s)
201 #define SIGN_BIT (0x80) 202 #define QUANT_MASK (0xf) 204 #define SEG_SHIFT (4) 205 #define SEG_MASK (0x70) 207 static const short seg_aend[8] = {0x1F, 0x3F, 0x7F, 0x0FF, 0x1FF, 0x3FF, 0x7FF, 0x0FFF};
208 static const short seg_uend[8] = {0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF};
211 static const unsigned char _u2a[128] = {
212 1, 1, 2, 2, 3, 3, 4, 4,
213 5, 5, 6, 6, 7, 7, 8, 8,
214 9, 10, 11, 12, 13, 14, 15, 16,
215 17, 18, 19, 20, 21, 22, 23, 24,
216 25, 27, 29, 31, 33, 34, 35, 36,
217 37, 38, 39, 40, 41, 42, 43, 44,
218 46, 48, 49, 50, 51, 52, 53, 54,
219 55, 56, 57, 58, 59, 60, 61, 62,
220 64, 65, 66, 67, 68, 69, 70, 71,
221 72, 73, 74, 75, 76, 77, 78, 79,
225 80, 82, 83, 84, 85, 86, 87, 88,
226 89, 90, 91, 92, 93, 94, 95, 96,
227 97, 98, 99, 100, 101, 102, 103, 104,
228 105, 106, 107, 108, 109, 110, 111, 112,
229 113, 114, 115, 116, 117, 118, 119, 120,
230 121, 122, 123, 124, 125, 126, 127, 128};
232 static const unsigned char _a2u[128] = {
233 1, 3, 5, 7, 9, 11, 13, 15,
234 16, 17, 18, 19, 20, 21, 22, 23,
235 24, 25, 26, 27, 28, 29, 30, 31,
236 32, 32, 33, 33, 34, 34, 35, 35,
237 36, 37, 38, 39, 40, 41, 42, 43,
238 44, 45, 46, 47, 48, 48, 49, 49,
239 50, 51, 52, 53, 54, 55, 56, 57,
240 58, 59, 60, 61, 62, 63, 64, 64,
241 65, 66, 67, 68, 69, 70, 71, 72,
245 73, 74, 75, 76, 77, 78, 79, 80,
247 80, 81, 82, 83, 84, 85, 86, 87,
248 88, 89, 90, 91, 92, 93, 94, 95,
249 96, 97, 98, 99, 100, 101, 102, 103,
250 104, 105, 106, 107, 108, 109, 110, 111,
251 112, 113, 114, 115, 116, 117, 118, 119,
252 120, 121, 122, 123, 124, 125, 126, 127};
288 static inline unsigned char 296 pcm_val = pcm_val >> 3;
302 pcm_val = -pcm_val - 1;
311 return (
unsigned char) (0x7F ^
mask);
318 return (aval ^
mask);
354 static const unsigned short _a2l[] = {
355 0xEA80, 0xEB80, 0xE880, 0xE980, 0xEE80, 0xEF80, 0xEC80, 0xED80,
356 0xE280, 0xE380, 0xE080, 0xE180, 0xE680, 0xE780, 0xE480, 0xE580,
357 0xF540, 0xF5C0, 0xF440, 0xF4C0, 0xF740, 0xF7C0, 0xF640, 0xF6C0,
358 0xF140, 0xF1C0, 0xF040, 0xF0C0, 0xF340, 0xF3C0, 0xF240, 0xF2C0,
359 0xAA00, 0xAE00, 0xA200, 0xA600, 0xBA00, 0xBE00, 0xB200, 0xB600,
360 0x8A00, 0x8E00, 0x8200, 0x8600, 0x9A00, 0x9E00, 0x9200, 0x9600,
361 0xD500, 0xD700, 0xD100, 0xD300, 0xDD00, 0xDF00, 0xD900, 0xDB00,
362 0xC500, 0xC700, 0xC100, 0xC300, 0xCD00, 0xCF00, 0xC900, 0xCB00,
363 0xFEA8, 0xFEB8, 0xFE88, 0xFE98, 0xFEE8, 0xFEF8, 0xFEC8, 0xFED8,
364 0xFE28, 0xFE38, 0xFE08, 0xFE18, 0xFE68, 0xFE78, 0xFE48, 0xFE58,
365 0xFFA8, 0xFFB8, 0xFF88, 0xFF98, 0xFFE8, 0xFFF8, 0xFFC8, 0xFFD8,
366 0xFF28, 0xFF38, 0xFF08, 0xFF18, 0xFF68, 0xFF78, 0xFF48, 0xFF58,
367 0xFAA0, 0xFAE0, 0xFA20, 0xFA60, 0xFBA0, 0xFBE0, 0xFB20, 0xFB60,
368 0xF8A0, 0xF8E0, 0xF820, 0xF860, 0xF9A0, 0xF9E0, 0xF920, 0xF960,
369 0xFD50, 0xFD70, 0xFD10, 0xFD30, 0xFDD0, 0xFDF0, 0xFD90, 0xFDB0,
370 0xFC50, 0xFC70, 0xFC10, 0xFC30, 0xFCD0, 0xFCF0, 0xFC90, 0xFCB0,
371 0x1580, 0x1480, 0x1780, 0x1680, 0x1180, 0x1080, 0x1380, 0x1280,
372 0x1D80, 0x1C80, 0x1F80, 0x1E80, 0x1980, 0x1880, 0x1B80, 0x1A80,
373 0x0AC0, 0x0A40, 0x0BC0, 0x0B40, 0x08C0, 0x0840, 0x09C0, 0x0940,
374 0x0EC0, 0x0E40, 0x0FC0, 0x0F40, 0x0CC0, 0x0C40, 0x0DC0, 0x0D40,
375 0x5600, 0x5200, 0x5E00, 0x5A00, 0x4600, 0x4200, 0x4E00, 0x4A00,
376 0x7600, 0x7200, 0x7E00, 0x7A00, 0x6600, 0x6200, 0x6E00, 0x6A00,
377 0x2B00, 0x2900, 0x2F00, 0x2D00, 0x2300, 0x2100, 0x2700, 0x2500,
378 0x3B00, 0x3900, 0x3F00, 0x3D00, 0x3300, 0x3100, 0x3700, 0x3500,
379 0x0158, 0x0148, 0x0178, 0x0168, 0x0118, 0x0108, 0x0138, 0x0128,
380 0x01D8, 0x01C8, 0x01F8, 0x01E8, 0x0198, 0x0188, 0x01B8, 0x01A8,
381 0x0058, 0x0048, 0x0078, 0x0068, 0x0018, 0x0008, 0x0038, 0x0028,
382 0x00D8, 0x00C8, 0x00F8, 0x00E8, 0x0098, 0x0088, 0x00B8, 0x00A8,
383 0x0560, 0x0520, 0x05E0, 0x05A0, 0x0460, 0x0420, 0x04E0, 0x04A0,
384 0x0760, 0x0720, 0x07E0, 0x07A0, 0x0660, 0x0620, 0x06E0, 0x06A0,
385 0x02B0, 0x0290, 0x02F0, 0x02D0, 0x0230, 0x0210, 0x0270, 0x0250,
386 0x03B0, 0x0390, 0x03F0, 0x03D0, 0x0330, 0x0310, 0x0370, 0x0350,
391 return (
short)
_a2l[a_val];
427 static inline unsigned char 435 pcm_val = pcm_val >> 2;
442 if ( pcm_val >
CLIP ) pcm_val =
CLIP;
443 pcm_val += (
BIAS >> 2);
453 return (
unsigned char) (0x7F ^
mask);
455 uval = (
unsigned char) (
seg << 4) | ((pcm_val >> (
seg + 1)) & 0xF);
456 return (uval ^
mask);
491 static const unsigned short _u2l[] = {
492 0x8284, 0x8684, 0x8A84, 0x8E84, 0x9284, 0x9684, 0x9A84, 0x9E84,
493 0xA284, 0xA684, 0xAA84, 0xAE84, 0xB284, 0xB684, 0xBA84, 0xBE84,
494 0xC184, 0xC384, 0xC584, 0xC784, 0xC984, 0xCB84, 0xCD84, 0xCF84,
495 0xD184, 0xD384, 0xD584, 0xD784, 0xD984, 0xDB84, 0xDD84, 0xDF84,
496 0xE104, 0xE204, 0xE304, 0xE404, 0xE504, 0xE604, 0xE704, 0xE804,
497 0xE904, 0xEA04, 0xEB04, 0xEC04, 0xED04, 0xEE04, 0xEF04, 0xF004,
498 0xF0C4, 0xF144, 0xF1C4, 0xF244, 0xF2C4, 0xF344, 0xF3C4, 0xF444,
499 0xF4C4, 0xF544, 0xF5C4, 0xF644, 0xF6C4, 0xF744, 0xF7C4, 0xF844,
500 0xF8A4, 0xF8E4, 0xF924, 0xF964, 0xF9A4, 0xF9E4, 0xFA24, 0xFA64,
501 0xFAA4, 0xFAE4, 0xFB24, 0xFB64, 0xFBA4, 0xFBE4, 0xFC24, 0xFC64,
502 0xFC94, 0xFCB4, 0xFCD4, 0xFCF4, 0xFD14, 0xFD34, 0xFD54, 0xFD74,
503 0xFD94, 0xFDB4, 0xFDD4, 0xFDF4, 0xFE14, 0xFE34, 0xFE54, 0xFE74,
504 0xFE8C, 0xFE9C, 0xFEAC, 0xFEBC, 0xFECC, 0xFEDC, 0xFEEC, 0xFEFC,
505 0xFF0C, 0xFF1C, 0xFF2C, 0xFF3C, 0xFF4C, 0xFF5C, 0xFF6C, 0xFF7C,
506 0xFF88, 0xFF90, 0xFF98, 0xFFA0, 0xFFA8, 0xFFB0, 0xFFB8, 0xFFC0,
507 0xFFC8, 0xFFD0, 0xFFD8, 0xFFE0, 0xFFE8, 0xFFF0, 0xFFF8, 0x0000,
508 0x7D7C, 0x797C, 0x757C, 0x717C, 0x6D7C, 0x697C, 0x657C, 0x617C,
509 0x5D7C, 0x597C, 0x557C, 0x517C, 0x4D7C, 0x497C, 0x457C, 0x417C,
510 0x3E7C, 0x3C7C, 0x3A7C, 0x387C, 0x367C, 0x347C, 0x327C, 0x307C,
511 0x2E7C, 0x2C7C, 0x2A7C, 0x287C, 0x267C, 0x247C, 0x227C, 0x207C,
512 0x1EFC, 0x1DFC, 0x1CFC, 0x1BFC, 0x1AFC, 0x19FC, 0x18FC, 0x17FC,
513 0x16FC, 0x15FC, 0x14FC, 0x13FC, 0x12FC, 0x11FC, 0x10FC, 0x0FFC,
514 0x0F3C, 0x0EBC, 0x0E3C, 0x0DBC, 0x0D3C, 0x0CBC, 0x0C3C, 0x0BBC,
515 0x0B3C, 0x0ABC, 0x0A3C, 0x09BC, 0x093C, 0x08BC, 0x083C, 0x07BC,
516 0x075C, 0x071C, 0x06DC, 0x069C, 0x065C, 0x061C, 0x05DC, 0x059C,
517 0x055C, 0x051C, 0x04DC, 0x049C, 0x045C, 0x041C, 0x03DC, 0x039C,
518 0x036C, 0x034C, 0x032C, 0x030C, 0x02EC, 0x02CC, 0x02AC, 0x028C,
519 0x026C, 0x024C, 0x022C, 0x020C, 0x01EC, 0x01CC, 0x01AC, 0x018C,
520 0x0174, 0x0164, 0x0154, 0x0144, 0x0134, 0x0124, 0x0114, 0x0104,
521 0x00F4, 0x00E4, 0x00D4, 0x00C4, 0x00B4, 0x00A4, 0x0094, 0x0084,
522 0x0078, 0x0070, 0x0068, 0x0060, 0x0058, 0x0050, 0x0048, 0x0040,
523 0x0038, 0x0030, 0x0028, 0x0020, 0x0018, 0x0010, 0x0008, 0x0000,
527 return (
short)
_u2l[u_val];
532 static inline unsigned char 536 return (
unsigned char) ((aval & 0x80) ? (0xFF ^
_a2u[aval ^ 0xD5]) :
537 (0x7F ^
_a2u[aval ^ 0x55]));
541 static inline unsigned char 545 return (uval & 0x80) ? (0xD5 ^ (
_u2a[0xFF ^ uval] - 1)) : (0x55 ^ (
_u2a[0x7F ^ uval] - 1));
653 add->vdwACM = 0x01000000;
654 add->vdwDriver = 0x01000000;
656 add->cFormatTags = 3;
657 add->cFilterTags = 0;
667 add->szFeatures[0] = 0;
678 static const WCHAR szPcm[]={
'P',
'C',
'M',0};
679 static const WCHAR szALaw[]={
'A',
'-',
'L',
'a',
'w',0};
680 static const WCHAR szULaw[]={
'U',
'-',
'L',
'a',
'w',0};
704 WARN(
"Unsupported query %08x\n", dwQuery);
780 WARN(
"Unsupported query %08x\n", dwQuery);
1056 FIXME(
"Unsupported fdwConvert (%08x), ignoring it\n", adsh->
fdwConvert);
1081 TRACE(
"(%08lx %p %04x %08lx %08lx);\n",
1082 dwDevID, hDriv, wMsg, dwParam1, dwParam2);
1140 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
static void cvtXXalaw16K(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
#define WAVE_FORMAT_UNKNOWN
static short search(int val, const short *table, int size)
#define ACM_STREAMSIZEF_DESTINATION
GLubyte GLubyte GLubyte GLubyte w
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC
static void W16(unsigned char *dst, short s)
#define ACM_STREAMCONVERTF_BLOCKALIGN
static const unsigned short _a2l[]
static LRESULT G711_DriverDetails(PACMDRIVERDETAILSW add)
static LRESULT G711_drvClose(DWORD_PTR dwDevID)
static LRESULT G711_StreamClose(PACMDRVSTREAMINSTANCE adsi)
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
#define ACMDM_STREAM_RESET
#define ACM_FORMATSUGGESTF_WFORMATTAG
struct tWAVEFORMATEX WAVEFORMATEX
#define ACMDM_STREAM_OPEN
#define ACMDM_FORMATTAG_DETAILS
#define ACMDM_STREAM_PREPARE
struct pcmwaveformat_tag PCMWAVEFORMAT
static DWORD G711_GetFormatIndex(const WAVEFORMATEX *wfx)
static unsigned char alaw2ulaw(unsigned char aval)
#define ACM_STREAMCONVERTF_END
static void G711_Reset(PACMDRVSTREAMINSTANCE adsi, AcmG711Data *aad)
#define ACMDM_STREAM_CLOSE
#define DRV_QUERYCONFIGURE
int WINAPI MessageBoxA(_In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_ UINT)
#define ACMDM_DRIVER_NOTIFY
#define ACMDM_FORMAT_SUGGEST
static const Format ALaw_Formats[]
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
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 ACM_FORMATDETAILSF_FORMAT
static const unsigned char _a2u[128]
#define ACMDM_DRIVER_DETAILS
#define WAVE_FORMAT_MULAW
#define ACMDM_STREAM_CONVERT
LRESULT CALLBACK G711_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
static void cvtXXulawalawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
#define ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
static LRESULT G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
#define ACM_FORMATSUGGESTF_NCHANNELS
static unsigned char linear2ulaw(short pcm_val)
#define ACMDM_HARDWARE_WAVE_CAPS_OUTPUT
#define ACMDM_HARDWARE_WAVE_CAPS_INPUT
static void cvtXX16ulawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
#define ACM_FORMATTAGDETAILSF_FORMATTAG
struct tagAcmG711Data AcmG711Data
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define ACM_STREAMSIZEF_SOURCE
static void cvtXX16alawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
#define ACM_FORMATTAGDETAILSF_INDEX
#define ACM_STREAMOPENF_ASYNC
static void cvtXXulaw16K(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
static const unsigned char _u2a[128]
static unsigned char ulaw2alaw(unsigned char uval)
#define MMSYSERR_NOTSUPPORTED
static LRESULT G711_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
#define ACMDM_FILTERTAG_DETAILS
static int alaw2linear(unsigned char a_val)
static LRESULT G711_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
#define ACM_FORMATTAGDETAILSF_LARGESTSIZE
static short ulaw2linear(unsigned char u_val)
#define ACMERR_NOTPOSSIBLE
#define ACMDM_STREAM_UNPREPARE
static LRESULT G711_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
static LRESULT G711_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSIZE adss)
static const short seg_aend[8]
#define ACM_STREAMCONVERTF_START
#define MMSYSERR_INVALPARAM
static LRESULT G711_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
static const short seg_uend[8]
#define MultiByteToWideChar
static const Format PCM_Formats[]
static const Format ULaw_Formats[]
static LRESULT G711_drvOpen(LPCSTR str)
#define ACM_FORMATDETAILSF_INDEX
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
static void cvtXXalawulawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
WINE_DEFAULT_DEBUG_CHANNEL(g711)
static short R16(const unsigned char *src)
static const unsigned short _u2l[]
void(* convert)(PACMDRVSTREAMINSTANCE adsi, const unsigned char *, LPDWORD, unsigned char *, LPDWORD)
#define HeapFree(x, y, z)
#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE
#define ACMDM_FORMAT_DETAILS
static unsigned(__cdecl *hash_bstr)(bstr_t s)
static unsigned char linear2alaw(int pcm_val)
#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