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++)
132static inline short R16(
const unsigned char*
src)
134 return (
short)((
unsigned short)
src[0] | ((
unsigned short)
src[1] << 8));
142static inline void W16(
unsigned char*
dst,
short s)
201#define SIGN_BIT (0x80)
202#define QUANT_MASK (0xf)
205#define SEG_MASK (0x70)
207static const short seg_aend[8] = {0x1F, 0x3F, 0x7F, 0x0FF, 0x1FF, 0x3FF, 0x7FF, 0x0FFF};
208static const short seg_uend[8] = {0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF};
211static 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};
232static 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};
288static 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);
354static const unsigned short _a2l[] = {
3550xEA80, 0xEB80, 0xE880, 0xE980, 0xEE80, 0xEF80, 0xEC80, 0xED80,
3560xE280, 0xE380, 0xE080, 0xE180, 0xE680, 0xE780, 0xE480, 0xE580,
3570xF540, 0xF5C0, 0xF440, 0xF4C0, 0xF740, 0xF7C0, 0xF640, 0xF6C0,
3580xF140, 0xF1C0, 0xF040, 0xF0C0, 0xF340, 0xF3C0, 0xF240, 0xF2C0,
3590xAA00, 0xAE00, 0xA200, 0xA600, 0xBA00, 0xBE00, 0xB200, 0xB600,
3600x8A00, 0x8E00, 0x8200, 0x8600, 0x9A00, 0x9E00, 0x9200, 0x9600,
3610xD500, 0xD700, 0xD100, 0xD300, 0xDD00, 0xDF00, 0xD900, 0xDB00,
3620xC500, 0xC700, 0xC100, 0xC300, 0xCD00, 0xCF00, 0xC900, 0xCB00,
3630xFEA8, 0xFEB8, 0xFE88, 0xFE98, 0xFEE8, 0xFEF8, 0xFEC8, 0xFED8,
3640xFE28, 0xFE38, 0xFE08, 0xFE18, 0xFE68, 0xFE78, 0xFE48, 0xFE58,
3650xFFA8, 0xFFB8, 0xFF88, 0xFF98, 0xFFE8, 0xFFF8, 0xFFC8, 0xFFD8,
3660xFF28, 0xFF38, 0xFF08, 0xFF18, 0xFF68, 0xFF78, 0xFF48, 0xFF58,
3670xFAA0, 0xFAE0, 0xFA20, 0xFA60, 0xFBA0, 0xFBE0, 0xFB20, 0xFB60,
3680xF8A0, 0xF8E0, 0xF820, 0xF860, 0xF9A0, 0xF9E0, 0xF920, 0xF960,
3690xFD50, 0xFD70, 0xFD10, 0xFD30, 0xFDD0, 0xFDF0, 0xFD90, 0xFDB0,
3700xFC50, 0xFC70, 0xFC10, 0xFC30, 0xFCD0, 0xFCF0, 0xFC90, 0xFCB0,
3710x1580, 0x1480, 0x1780, 0x1680, 0x1180, 0x1080, 0x1380, 0x1280,
3720x1D80, 0x1C80, 0x1F80, 0x1E80, 0x1980, 0x1880, 0x1B80, 0x1A80,
3730x0AC0, 0x0A40, 0x0BC0, 0x0B40, 0x08C0, 0x0840, 0x09C0, 0x0940,
3740x0EC0, 0x0E40, 0x0FC0, 0x0F40, 0x0CC0, 0x0C40, 0x0DC0, 0x0D40,
3750x5600, 0x5200, 0x5E00, 0x5A00, 0x4600, 0x4200, 0x4E00, 0x4A00,
3760x7600, 0x7200, 0x7E00, 0x7A00, 0x6600, 0x6200, 0x6E00, 0x6A00,
3770x2B00, 0x2900, 0x2F00, 0x2D00, 0x2300, 0x2100, 0x2700, 0x2500,
3780x3B00, 0x3900, 0x3F00, 0x3D00, 0x3300, 0x3100, 0x3700, 0x3500,
3790x0158, 0x0148, 0x0178, 0x0168, 0x0118, 0x0108, 0x0138, 0x0128,
3800x01D8, 0x01C8, 0x01F8, 0x01E8, 0x0198, 0x0188, 0x01B8, 0x01A8,
3810x0058, 0x0048, 0x0078, 0x0068, 0x0018, 0x0008, 0x0038, 0x0028,
3820x00D8, 0x00C8, 0x00F8, 0x00E8, 0x0098, 0x0088, 0x00B8, 0x00A8,
3830x0560, 0x0520, 0x05E0, 0x05A0, 0x0460, 0x0420, 0x04E0, 0x04A0,
3840x0760, 0x0720, 0x07E0, 0x07A0, 0x0660, 0x0620, 0x06E0, 0x06A0,
3850x02B0, 0x0290, 0x02F0, 0x02D0, 0x0230, 0x0210, 0x0270, 0x0250,
3860x03B0, 0x0390, 0x03F0, 0x03D0, 0x0330, 0x0310, 0x0370, 0x0350,
391 return (
short)
_a2l[a_val];
427static 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);
491static const unsigned short _u2l[] = {
4920x8284, 0x8684, 0x8A84, 0x8E84, 0x9284, 0x9684, 0x9A84, 0x9E84,
4930xA284, 0xA684, 0xAA84, 0xAE84, 0xB284, 0xB684, 0xBA84, 0xBE84,
4940xC184, 0xC384, 0xC584, 0xC784, 0xC984, 0xCB84, 0xCD84, 0xCF84,
4950xD184, 0xD384, 0xD584, 0xD784, 0xD984, 0xDB84, 0xDD84, 0xDF84,
4960xE104, 0xE204, 0xE304, 0xE404, 0xE504, 0xE604, 0xE704, 0xE804,
4970xE904, 0xEA04, 0xEB04, 0xEC04, 0xED04, 0xEE04, 0xEF04, 0xF004,
4980xF0C4, 0xF144, 0xF1C4, 0xF244, 0xF2C4, 0xF344, 0xF3C4, 0xF444,
4990xF4C4, 0xF544, 0xF5C4, 0xF644, 0xF6C4, 0xF744, 0xF7C4, 0xF844,
5000xF8A4, 0xF8E4, 0xF924, 0xF964, 0xF9A4, 0xF9E4, 0xFA24, 0xFA64,
5010xFAA4, 0xFAE4, 0xFB24, 0xFB64, 0xFBA4, 0xFBE4, 0xFC24, 0xFC64,
5020xFC94, 0xFCB4, 0xFCD4, 0xFCF4, 0xFD14, 0xFD34, 0xFD54, 0xFD74,
5030xFD94, 0xFDB4, 0xFDD4, 0xFDF4, 0xFE14, 0xFE34, 0xFE54, 0xFE74,
5040xFE8C, 0xFE9C, 0xFEAC, 0xFEBC, 0xFECC, 0xFEDC, 0xFEEC, 0xFEFC,
5050xFF0C, 0xFF1C, 0xFF2C, 0xFF3C, 0xFF4C, 0xFF5C, 0xFF6C, 0xFF7C,
5060xFF88, 0xFF90, 0xFF98, 0xFFA0, 0xFFA8, 0xFFB0, 0xFFB8, 0xFFC0,
5070xFFC8, 0xFFD0, 0xFFD8, 0xFFE0, 0xFFE8, 0xFFF0, 0xFFF8, 0x0000,
5080x7D7C, 0x797C, 0x757C, 0x717C, 0x6D7C, 0x697C, 0x657C, 0x617C,
5090x5D7C, 0x597C, 0x557C, 0x517C, 0x4D7C, 0x497C, 0x457C, 0x417C,
5100x3E7C, 0x3C7C, 0x3A7C, 0x387C, 0x367C, 0x347C, 0x327C, 0x307C,
5110x2E7C, 0x2C7C, 0x2A7C, 0x287C, 0x267C, 0x247C, 0x227C, 0x207C,
5120x1EFC, 0x1DFC, 0x1CFC, 0x1BFC, 0x1AFC, 0x19FC, 0x18FC, 0x17FC,
5130x16FC, 0x15FC, 0x14FC, 0x13FC, 0x12FC, 0x11FC, 0x10FC, 0x0FFC,
5140x0F3C, 0x0EBC, 0x0E3C, 0x0DBC, 0x0D3C, 0x0CBC, 0x0C3C, 0x0BBC,
5150x0B3C, 0x0ABC, 0x0A3C, 0x09BC, 0x093C, 0x08BC, 0x083C, 0x07BC,
5160x075C, 0x071C, 0x06DC, 0x069C, 0x065C, 0x061C, 0x05DC, 0x059C,
5170x055C, 0x051C, 0x04DC, 0x049C, 0x045C, 0x041C, 0x03DC, 0x039C,
5180x036C, 0x034C, 0x032C, 0x030C, 0x02EC, 0x02CC, 0x02AC, 0x028C,
5190x026C, 0x024C, 0x022C, 0x020C, 0x01EC, 0x01CC, 0x01AC, 0x018C,
5200x0174, 0x0164, 0x0154, 0x0144, 0x0134, 0x0124, 0x0114, 0x0104,
5210x00F4, 0x00E4, 0x00D4, 0x00C4, 0x00B4, 0x00A4, 0x0094, 0x0084,
5220x0078, 0x0070, 0x0068, 0x0060, 0x0058, 0x0050, 0x0048, 0x0040,
5230x0038, 0x0030, 0x0028, 0x0020, 0x0018, 0x0010, 0x0008, 0x0000,
527 return (
short)
_u2l[u_val];
532static inline unsigned char
536 return (
unsigned char) ((aval & 0x80) ? (0xFF ^
_a2u[aval ^ 0xD5]) :
537 (0x7F ^
_a2u[aval ^ 0x55]));
541static inline unsigned char
545 return (uval & 0x80) ? (0xD5 ^ (
_u2a[0xFF ^ uval] - 1)) : (0x55 ^ (
_u2a[0x7F ^ uval] - 1));
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);
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define WAVE_FORMAT_MULAW
#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)
GLubyte GLubyte GLubyte GLubyte w
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 WAVE_FORMAT_UNKNOWN
#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
static const short seg_uend[8]
static unsigned char ulaw2alaw(unsigned char uval)
static LRESULT G711_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
static void cvtXX16alawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
static LRESULT G711_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
static LRESULT G711_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSIZE adss)
static short search(int val, const short *table, int size)
static const unsigned short _u2l[]
static const unsigned char _a2u[128]
static const unsigned char _u2a[128]
static LRESULT G711_drvOpen(LPCSTR str)
static void cvtXX16ulawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
static int alaw2linear(unsigned char a_val)
static void cvtXXulaw16K(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
static LRESULT G711_DriverDetails(PACMDRIVERDETAILSW add)
static LRESULT G711_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
static void cvtXXulawalawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
static void G711_Reset(PACMDRVSTREAMINSTANCE adsi, AcmG711Data *aad)
static LRESULT G711_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
LRESULT CALLBACK G711_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
static unsigned char linear2ulaw(short pcm_val)
static const Format ULaw_Formats[]
static void cvtXXalawulawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
static void W16(unsigned char *dst, short s)
static void cvtXXalaw16K(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
static DWORD G711_GetFormatIndex(const WAVEFORMATEX *wfx)
static LRESULT G711_StreamClose(PACMDRVSTREAMINSTANCE adsi)
struct tagAcmG711Data AcmG711Data
static short ulaw2linear(unsigned char u_val)
static LRESULT G711_drvClose(DWORD_PTR dwDevID)
static unsigned char alaw2ulaw(unsigned char aval)
static unsigned char linear2alaw(int pcm_val)
static const unsigned short _a2l[]
static const Format ALaw_Formats[]
static LRESULT G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
static const Format PCM_Formats[]
static const short seg_aend[8]
static short R16(const unsigned char *src)
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)