ReactOS 0.4.15-dev-7918-g2a2556c
msg711.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "msacm.h"
#include "msacmdrv.h"
#include "wine/debug.h"
Include dependency graph for msg711.c:

Go to the source code of this file.

Classes

struct  tagAcmG711Data
 
struct  Format
 

Macros

#define SIGN_BIT   (0x80) /* Sign bit for an A-law byte. */
 
#define QUANT_MASK   (0xf) /* Quantization field mask. */
 
#define NSEGS   (8) /* Number of A-law segments. */
 
#define SEG_SHIFT   (4) /* Left shift for segment number. */
 
#define SEG_MASK   (0x70) /* Segment field mask. */
 
#define BIAS   (0x84) /* Bias for linear code. */
 
#define CLIP   8159
 

Typedefs

typedef struct tagAcmG711Data AcmG711Data
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (g711)
 
static LRESULT G711_drvOpen (LPCSTR str)
 
static LRESULT G711_drvClose (DWORD_PTR dwDevID)
 
static DWORD G711_GetFormatIndex (const WAVEFORMATEX *wfx)
 
static short R16 (const unsigned char *src)
 
static void W16 (unsigned char *dst, short s)
 
static short search (int val, const short *table, int size)
 
static unsigned char linear2alaw (int pcm_val)
 
static int alaw2linear (unsigned char a_val)
 
static unsigned char linear2ulaw (short pcm_val)
 
static short ulaw2linear (unsigned char u_val)
 
static unsigned char alaw2ulaw (unsigned char aval)
 
static unsigned char ulaw2alaw (unsigned char uval)
 
static void cvtXXalaw16K (PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
 
static void cvtXX16alawK (PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
 
static void cvtXXulaw16K (PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
 
static void cvtXX16ulawK (PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
 
static void cvtXXalawulawK (PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
 
static void cvtXXulawalawK (PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
 
static LRESULT G711_DriverDetails (PACMDRIVERDETAILSW add)
 
static LRESULT G711_FormatTagDetails (PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
 
static LRESULT G711_FormatDetails (PACMFORMATDETAILSW afd, DWORD dwQuery)
 
static LRESULT G711_FormatSuggest (PACMDRVFORMATSUGGEST adfs)
 
static void G711_Reset (PACMDRVSTREAMINSTANCE adsi, AcmG711Data *aad)
 
static LRESULT G711_StreamOpen (PACMDRVSTREAMINSTANCE adsi)
 
static LRESULT G711_StreamClose (PACMDRVSTREAMINSTANCE adsi)
 
static LRESULT G711_StreamSize (const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSIZE adss)
 
static LRESULT G711_StreamConvert (PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
 
LRESULT CALLBACK G711_DriverProc (DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
 

Variables

static const Format PCM_Formats []
 
static const Format ALaw_Formats []
 
static const Format ULaw_Formats []
 
static const short seg_aend [8] = {0x1F, 0x3F, 0x7F, 0x0FF, 0x1FF, 0x3FF, 0x7FF, 0x0FFF}
 
static const short seg_uend [8] = {0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF}
 
static const unsigned char _u2a [128]
 
static const unsigned char _a2u [128]
 
static const unsigned short _a2l []
 
static const unsigned short _u2l []
 

Macro Definition Documentation

◆ BIAS

#define BIAS   (0x84) /* Bias for linear code. */

Definition at line 395 of file msg711.c.

◆ CLIP

#define CLIP   8159

Definition at line 396 of file msg711.c.

◆ NSEGS

#define NSEGS   (8) /* Number of A-law segments. */

Definition at line 203 of file msg711.c.

◆ QUANT_MASK

#define QUANT_MASK   (0xf) /* Quantization field mask. */

Definition at line 202 of file msg711.c.

◆ SEG_MASK

#define SEG_MASK   (0x70) /* Segment field mask. */

Definition at line 205 of file msg711.c.

◆ SEG_SHIFT

#define SEG_SHIFT   (4) /* Left shift for segment number. */

Definition at line 204 of file msg711.c.

◆ SIGN_BIT

#define SIGN_BIT   (0x80) /* Sign bit for an A-law byte. */

Definition at line 201 of file msg711.c.

Typedef Documentation

◆ AcmG711Data

Function Documentation

◆ alaw2linear()

static int alaw2linear ( unsigned char  a_val)
inlinestatic

Definition at line 389 of file msg711.c.

390{
391 return (short)_a2l[a_val];
392}
static const unsigned short _a2l[]
Definition: msg711.c:354

Referenced by cvtXXalaw16K().

◆ alaw2ulaw()

static unsigned char alaw2ulaw ( unsigned char  aval)
inlinestatic

Definition at line 533 of file msg711.c.

534{
535 aval &= 0xff;
536 return (unsigned char) ((aval & 0x80) ? (0xFF ^ _a2u[aval ^ 0xD5]) :
537 (0x7F ^ _a2u[aval ^ 0x55]));
538}
static const unsigned char _a2u[128]
Definition: msg711.c:232

Referenced by cvtXXalawulawK().

◆ cvtXX16alawK()

static void cvtXX16alawK ( PACMDRVSTREAMINSTANCE  adsi,
const unsigned char src,
LPDWORD  srcsize,
unsigned char dst,
LPDWORD  dstsize 
)
static

Definition at line 567 of file msg711.c.

570{
571 DWORD len = min(*srcsize / 2, *dstsize);
572 DWORD i;
573
574 *srcsize = len * 2;
575 *dstsize = len;
576 for (i = 0; i < len; i++)
577 {
578 *dst++ = linear2alaw(R16(src)); src += 2;
579 }
580}
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
GLenum GLsizei len
Definition: glext.h:6722
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
Definition: glfuncs.h:248
#define min(a, b)
Definition: monoChain.cc:55
static unsigned char linear2alaw(int pcm_val)
Definition: msg711.c:289
static short R16(const unsigned char *src)
Definition: msg711.c:132

Referenced by G711_StreamOpen().

◆ cvtXX16ulawK()

static void cvtXX16ulawK ( PACMDRVSTREAMINSTANCE  adsi,
const unsigned char src,
LPDWORD  srcsize,
unsigned char dst,
LPDWORD  dstsize 
)
static

Definition at line 599 of file msg711.c.

602{
603 DWORD len = min(*srcsize / 2, *dstsize);
604 DWORD i;
605
606 *srcsize = len * 2;
607 *dstsize = len;
608 for (i = 0; i < len; i++)
609 {
610 *dst++ = linear2ulaw(R16(src)); src += 2;
611 }
612}
static unsigned char linear2ulaw(short pcm_val)
Definition: msg711.c:428

Referenced by G711_StreamOpen().

◆ cvtXXalaw16K()

static void cvtXXalaw16K ( PACMDRVSTREAMINSTANCE  adsi,
const unsigned char src,
LPDWORD  srcsize,
unsigned char dst,
LPDWORD  dstsize 
)
static

Definition at line 550 of file msg711.c.

553{
554 DWORD len = min(*srcsize, *dstsize / 2);
555 DWORD i;
556 short w;
557
558 *srcsize = len;
559 *dstsize = len * 2;
560 for (i = 0; i < len; i++)
561 {
562 w = alaw2linear(*src++);
563 W16(dst, w); dst += 2;
564 }
565}
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
static int alaw2linear(unsigned char a_val)
Definition: msg711.c:389
static void W16(unsigned char *dst, short s)
Definition: msg711.c:142

Referenced by G711_StreamOpen().

◆ cvtXXalawulawK()

static void cvtXXalawulawK ( PACMDRVSTREAMINSTANCE  adsi,
const unsigned char src,
LPDWORD  srcsize,
unsigned char dst,
LPDWORD  dstsize 
)
static

Definition at line 614 of file msg711.c.

617{
618 DWORD len = min(*srcsize, *dstsize);
619 DWORD i;
620
621 *srcsize = len;
622 *dstsize = len;
623
624 for (i = 0; i < len; i++)
625 *dst++ = alaw2ulaw(*src++);
626}
static unsigned char alaw2ulaw(unsigned char aval)
Definition: msg711.c:533

Referenced by G711_StreamOpen().

◆ cvtXXulaw16K()

static void cvtXXulaw16K ( PACMDRVSTREAMINSTANCE  adsi,
const unsigned char src,
LPDWORD  srcsize,
unsigned char dst,
LPDWORD  dstsize 
)
static

Definition at line 582 of file msg711.c.

585{
586 DWORD len = min(*srcsize, *dstsize / 2);
587 DWORD i;
588 short w;
589
590 *srcsize = len;
591 *dstsize = len * 2;
592 for (i = 0; i < len; i++)
593 {
594 w = ulaw2linear(*src++);
595 W16(dst, w); dst += 2;
596 }
597}
static short ulaw2linear(unsigned char u_val)
Definition: msg711.c:525

Referenced by G711_StreamOpen().

◆ cvtXXulawalawK()

static void cvtXXulawalawK ( PACMDRVSTREAMINSTANCE  adsi,
const unsigned char src,
LPDWORD  srcsize,
unsigned char dst,
LPDWORD  dstsize 
)
static

Definition at line 629 of file msg711.c.

632{
633 DWORD len = min(*srcsize, *dstsize);
634 DWORD i;
635
636 *srcsize = len;
637 *dstsize = len;
638
639 for (i = 0; i < len; i++)
640 *dst++ = ulaw2alaw(*src++);
641}
static unsigned char ulaw2alaw(unsigned char uval)
Definition: msg711.c:542

Referenced by G711_StreamOpen().

◆ G711_DriverDetails()

static LRESULT G711_DriverDetails ( PACMDRIVERDETAILSW  add)
static

Definition at line 647 of file msg711.c.

648{
651 add->wMid = MM_MICROSOFT;
652 add->wPid = MM_MSFT_ACM_G711;
653 add->vdwACM = 0x01000000;
654 add->vdwDriver = 0x01000000;
656 add->cFormatTags = 3; /* PCM, G711 A-LAW & MU-LAW */
657 add->cFilterTags = 0;
658 add->hicon = NULL;
659 MultiByteToWideChar( CP_ACP, 0, "Microsoft CCITT G.711", -1,
660 add->szShortName, ARRAY_SIZE( add->szShortName ));
661 MultiByteToWideChar( CP_ACP, 0, "Wine G711 converter", -1,
662 add->szLongName, ARRAY_SIZE( add->szLongName ));
663 MultiByteToWideChar( CP_ACP, 0, "Brought to you by the Wine team...", -1,
664 add->szCopyright, ARRAY_SIZE( add->szCopyright ));
665 MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1,
666 add->szLicensing, ARRAY_SIZE( add->szLicensing ));
667 add->szFeatures[0] = 0;
668
669 return MMSYSERR_NOERROR;
670}
#define ARRAY_SIZE(A)
Definition: main.h:33
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
#define MM_MSFT_ACM_G711
Definition: mmreg.h:149
#define MM_MICROSOFT
Definition: mmreg.h:144
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
Definition: msacm.h:59
#define ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC
Definition: msacm.h:58
#define ACMDRIVERDETAILS_SUPPORTF_CODEC
Definition: msacm.h:61
DWORD cFilterTags
Definition: msacm.h:311
WCHAR szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS]
Definition: msacm.h:317
WCHAR szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS]
Definition: msacm.h:316
WCHAR szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS]
Definition: msacm.h:315
FOURCC fccComp
Definition: msacm.h:301
WCHAR szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS]
Definition: msacm.h:318
FOURCC fccType
Definition: msacm.h:300
WCHAR szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS]
Definition: msacm.h:319
DWORD cFormatTags
Definition: msacm.h:310
DWORD fdwSupport
Definition: msacm.h:309
DWORD vdwDriver
Definition: msacm.h:307

Referenced by G711_DriverProc().

◆ G711_DriverProc()

LRESULT CALLBACK G711_DriverProc ( DWORD_PTR  dwDevID,
HDRVR  hDriv,
UINT  wMsg,
LPARAM  dwParam1,
LPARAM  dwParam2 
)

Definition at line 1078 of file msg711.c.

1080{
1081 TRACE("(%08lx %p %04x %08lx %08lx);\n",
1082 dwDevID, hDriv, wMsg, dwParam1, dwParam2);
1083
1084 switch (wMsg)
1085 {
1086 case DRV_LOAD: return 1;
1087 case DRV_FREE: return 1;
1088 case DRV_OPEN: return G711_drvOpen((LPSTR)dwParam1);
1089 case DRV_CLOSE: return G711_drvClose(dwDevID);
1090 case DRV_ENABLE: return 1;
1091 case DRV_DISABLE: return 1;
1092 case DRV_QUERYCONFIGURE: return 1;
1093 case DRV_CONFIGURE: MessageBoxA(0, "MS G711 (a-Law & mu-Law) filter !", "Wine Driver", MB_OK); return 1;
1094 case DRV_INSTALL: return DRVCNF_RESTART;
1095 case DRV_REMOVE: return DRVCNF_RESTART;
1096
1098 /* no caching from other ACM drivers is done so far */
1099 return MMSYSERR_NOERROR;
1100
1102 return G711_DriverDetails((PACMDRIVERDETAILSW)dwParam1);
1103
1105 return G711_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2);
1106
1108 return G711_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2);
1109
1111 return G711_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1);
1112
1113 case ACMDM_STREAM_OPEN:
1114 return G711_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1);
1115
1116 case ACMDM_STREAM_CLOSE:
1117 return G711_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1);
1118
1119 case ACMDM_STREAM_SIZE:
1120 return G711_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2);
1121
1124
1127 /* this converter is not a hardware driver */
1130 /* this converter is not a filter */
1131 case ACMDM_STREAM_RESET:
1132 /* only needed for asynchronous driver... we aren't, so just say it */
1133 return MMSYSERR_NOTSUPPORTED;
1136 /* nothing special to do here... so don't do anything */
1137 return MMSYSERR_NOERROR;
1138
1139 default:
1140 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
1141 }
1142}
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
Definition: driver.c:554
#define DRV_LOAD(x)
#define DRV_CLOSE
Definition: mmsystem.h:122
#define DRV_QUERYCONFIGURE
Definition: mmsystem.h:126
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define DRVCNF_RESTART
Definition: mmsystem.h:135
#define DRV_REMOVE
Definition: mmsystem.h:128
#define DRV_ENABLE
Definition: mmsystem.h:120
#define DRV_CONFIGURE
Definition: mmsystem.h:125
#define DRV_OPEN
Definition: mmsystem.h:121
#define DRV_INSTALL
Definition: mmsystem.h:127
#define DRV_FREE
Definition: mmsystem.h:124
#define DRV_DISABLE
Definition: mmsystem.h:123
#define ACMDM_STREAM_PREPARE
Definition: msacmdrv.h:63
#define ACMDM_STREAM_CLOSE
Definition: msacmdrv.h:59
#define ACMDM_STREAM_CONVERT
Definition: msacmdrv.h:61
#define ACMDM_FORMAT_SUGGEST
Definition: msacmdrv.h:53
#define ACMDM_FILTER_DETAILS
Definition: msacmdrv.h:56
#define ACMDM_HARDWARE_WAVE_CAPS_INPUT
Definition: msacmdrv.h:48
#define ACMDM_DRIVER_NOTIFY
Definition: msacmdrv.h:45
#define ACMDM_FORMAT_DETAILS
Definition: msacmdrv.h:52
#define ACMDM_STREAM_SIZE
Definition: msacmdrv.h:60
#define ACMDM_FILTERTAG_DETAILS
Definition: msacmdrv.h:55
#define ACMDM_HARDWARE_WAVE_CAPS_OUTPUT
Definition: msacmdrv.h:49
#define ACMDM_FORMATTAG_DETAILS
Definition: msacmdrv.h:51
#define ACMDM_STREAM_UNPREPARE
Definition: msacmdrv.h:64
#define ACMDM_STREAM_OPEN
Definition: msacmdrv.h:58
#define ACMDM_DRIVER_DETAILS
Definition: msacmdrv.h:46
#define ACMDM_STREAM_RESET
Definition: msacmdrv.h:62
static LRESULT G711_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
Definition: msg711.c:793
static LRESULT G711_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
Definition: msg711.c:858
static LRESULT G711_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSIZE adss)
Definition: msg711.c:978
static LRESULT G711_drvOpen(LPCSTR str)
Definition: msg711.c:41
static LRESULT G711_DriverDetails(PACMDRIVERDETAILSW add)
Definition: msg711.c:647
static LRESULT G711_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
Definition: msg711.c:1045
static LRESULT G711_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
Definition: msg711.c:676
static LRESULT G711_StreamClose(PACMDRVSTREAMINSTANCE adsi)
Definition: msg711.c:968
static LRESULT G711_drvClose(DWORD_PTR dwDevID)
Definition: msg711.c:49
static LRESULT G711_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
Definition: msg711.c:737
#define TRACE(s)
Definition: solgame.cpp:4
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
#define MB_OK
Definition: winuser.h:790
char * LPSTR
Definition: xmlstorage.h:182

◆ G711_drvClose()

static LRESULT G711_drvClose ( DWORD_PTR  dwDevID)
static

Definition at line 49 of file msg711.c.

50{
51 return 1;
52}

Referenced by G711_DriverProc().

◆ G711_drvOpen()

static LRESULT G711_drvOpen ( LPCSTR  str)
static

Definition at line 41 of file msg711.c.

42{
43 return 1;
44}

Referenced by G711_DriverProc().

◆ G711_FormatDetails()

static LRESULT G711_FormatDetails ( PACMFORMATDETAILSW  afd,
DWORD  dwQuery 
)
static

Definition at line 737 of file msg711.c.

738{
739 switch (dwQuery)
740 {
742 if (G711_GetFormatIndex(afd->pwfx) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
743 break;
745 afd->pwfx->wFormatTag = afd->dwFormatTag;
746 switch (afd->dwFormatTag)
747 {
748 case WAVE_FORMAT_PCM:
753 afd->pwfx->nBlockAlign = afd->pwfx->nChannels * 2;
755 break;
756 case WAVE_FORMAT_ALAW:
763 afd->pwfx->cbSize = 0;
764 break;
772 afd->pwfx->cbSize = 0;
773 break;
774 default:
775 WARN("Unsupported tag %08x\n", afd->dwFormatTag);
776 return MMSYSERR_INVALPARAM;
777 }
778 break;
779 default:
780 WARN("Unsupported query %08x\n", dwQuery);
782 }
784 afd->szFormat[0] = 0; /* let MSACM format this for us... */
785
786 return MMSYSERR_NOERROR;
787}
#define WAVE_FORMAT_MULAW
Definition: constants.h:428
#define WAVE_FORMAT_ALAW
Definition: constants.h:427
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define WARN(fmt,...)
Definition: debug.h:112
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define ACMERR_NOTPOSSIBLE
Definition: msacm.h:36
#define ACM_FORMATDETAILSF_FORMAT
Definition: msacm.h:161
#define ACM_FORMATDETAILSF_INDEX
Definition: msacm.h:160
static const Format ULaw_Formats[]
Definition: msg711.c:84
static DWORD G711_GetFormatIndex(const WAVEFORMATEX *wfx)
Definition: msg711.c:93
static const Format ALaw_Formats[]
Definition: msg711.c:78
static const Format PCM_Formats[]
Definition: msg711.c:70
int nChannels
Definition: imaadp32.c:63
int nBits
Definition: imaadp32.c:64
int rate
Definition: imaadp32.c:65
WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]
Definition: msacm.h:509
DWORD dwFormatTag
Definition: msacm.h:505
DWORD dwFormatIndex
Definition: msacm.h:504
DWORD fdwSupport
Definition: msacm.h:506
PWAVEFORMATEX pwfx
Definition: msacm.h:507
WORD nBlockAlign
Definition: mmreg.h:82
WORD cbSize
Definition: mmreg.h:84
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nChannels
Definition: mmreg.h:79
WORD wFormatTag
Definition: mmreg.h:78
WORD wBitsPerSample
Definition: mmreg.h:83

Referenced by G711_DriverProc().

◆ G711_FormatSuggest()

static LRESULT G711_FormatSuggest ( PACMDRVFORMATSUGGEST  adfs)
static

Definition at line 793 of file msg711.c.

794{
795 /* some tests ... */
796 if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
797 adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
798 G711_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
799 /* FIXME: should do those tests against the real size (according to format tag */
800
801 /* If no suggestion for destination, then copy source value */
803 adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels;
806
808 {
809 if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM)
810 adfs->pwfxDst->wBitsPerSample = 8;
811 else
812 adfs->pwfxDst->wBitsPerSample = 16;
813 }
815 {
816 switch (adfs->pwfxSrc->wFormatTag)
817 {
821 }
822 }
823 /* check if result is ok */
824 if (G711_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
825
826 /* recompute other values */
827 switch (adfs->pwfxDst->wFormatTag)
828 {
829 case WAVE_FORMAT_PCM:
830 adfs->pwfxDst->nBlockAlign = adfs->pwfxDst->nChannels * 2;
832 break;
833 case WAVE_FORMAT_ALAW:
834 adfs->pwfxDst->nBlockAlign = adfs->pwfxDst->nChannels;
836 break;
838 adfs->pwfxDst->nBlockAlign = adfs->pwfxDst->nChannels;
840 break;
841 }
842
843 return MMSYSERR_NOERROR;
844}
#define ACM_FORMATSUGGESTF_WFORMATTAG
Definition: msacm.h:174
#define ACM_FORMATSUGGESTF_NCHANNELS
Definition: msacm.h:175
#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE
Definition: msacm.h:177
#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC
Definition: msacm.h:176
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:151
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:153

Referenced by G711_DriverProc().

◆ G711_FormatTagDetails()

static LRESULT G711_FormatTagDetails ( PACMFORMATTAGDETAILSW  aftd,
DWORD  dwQuery 
)
static

Definition at line 676 of file msg711.c.

677{
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};
681
682 switch (dwQuery)
683 {
685 if (aftd->dwFormatTagIndex >= 3) return ACMERR_NOTPOSSIBLE;
686 break;
688 if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN)
689 {
690 aftd->dwFormatTagIndex = 1;
691 break;
692 }
693 /* fall through */
695 switch (aftd->dwFormatTag)
696 {
697 case WAVE_FORMAT_PCM: aftd->dwFormatTagIndex = 0; break;
698 case WAVE_FORMAT_ALAW: aftd->dwFormatTagIndex = 1; break;
699 case WAVE_FORMAT_MULAW: aftd->dwFormatTagIndex = 2; break;
700 default: return ACMERR_NOTPOSSIBLE;
701 }
702 break;
703 default:
704 WARN("Unsupported query %08x\n", dwQuery);
706 }
707
709 switch (aftd->dwFormatTagIndex)
710 {
711 case 0:
713 aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
715 lstrcpyW(aftd->szFormatTag, szPcm);
716 break;
717 case 1:
719 aftd->cbFormatSize = sizeof(WAVEFORMATEX);
721 lstrcpyW(aftd->szFormatTag, szALaw);
722 break;
723 case 2:
725 aftd->cbFormatSize = sizeof(WAVEFORMATEX);
727 lstrcpyW(aftd->szFormatTag, szULaw);
728 break;
729 }
730 return MMSYSERR_NOERROR;
731}
#define lstrcpyW
Definition: compat.h:749
#define WAVE_FORMAT_UNKNOWN
Definition: mmreg.h:95
struct pcmwaveformat_tag PCMWAVEFORMAT
#define ACM_FORMATTAGDETAILSF_FORMATTAG
Definition: msacm.h:183
#define ACM_FORMATTAGDETAILSF_LARGESTSIZE
Definition: msacm.h:184
#define ACM_FORMATTAGDETAILSF_INDEX
Definition: msacm.h:182
WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: msacm.h:535
DWORD dwFormatTagIndex
Definition: msacm.h:530
DWORD cStandardFormats
Definition: msacm.h:534
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by G711_DriverProc().

◆ G711_GetFormatIndex()

static DWORD G711_GetFormatIndex ( const WAVEFORMATEX wfx)
static

Definition at line 93 of file msg711.c.

94{
95 int i, hi;
96 const Format* fmts;
97
98 switch (wfx->wFormatTag)
99 {
100 case WAVE_FORMAT_PCM:
103 break;
104 case WAVE_FORMAT_ALAW:
107 break;
111 break;
112 default:
113 return 0xFFFFFFFF;
114 }
115
116 for (i = 0; i < hi; i++)
117 {
118 if (wfx->nChannels == fmts[i].nChannels &&
119 wfx->nSamplesPerSec == fmts[i].rate &&
120 wfx->wBitsPerSample == fmts[i].nBits)
121 return i;
122 }
123
124 return 0xFFFFFFFF;
125}
static struct fmt fmts[]
WORD wBitsPerSample
Definition: audioclient.idl:45
DWORD nSamplesPerSec
Definition: audioclient.idl:42

Referenced by G711_FormatDetails(), G711_FormatSuggest(), and G711_StreamOpen().

◆ G711_Reset()

static void G711_Reset ( PACMDRVSTREAMINSTANCE  adsi,
AcmG711Data aad 
)
static

Definition at line 850 of file msg711.c.

851{
852}

Referenced by G711_StreamConvert(), and G711_StreamOpen().

◆ G711_StreamClose()

static LRESULT G711_StreamClose ( PACMDRVSTREAMINSTANCE  adsi)
static

Definition at line 968 of file msg711.c.

969{
970 HeapFree(GetProcessHeap(), 0, (void*)adsi->dwDriver);
971 return MMSYSERR_NOERROR;
972}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
DWORD_PTR dwDriver
Definition: msacmdrv.h:107

Referenced by G711_DriverProc().

◆ G711_StreamConvert()

static LRESULT G711_StreamConvert ( PACMDRVSTREAMINSTANCE  adsi,
PACMDRVSTREAMHEADER  adsh 
)
static

Definition at line 1045 of file msg711.c.

1046{
1047 AcmG711Data* aad = (AcmG711Data*)adsi->dwDriver;
1048 DWORD nsrc = adsh->cbSrcLength;
1049 DWORD ndst = adsh->cbDstLength;
1050
1051 if (adsh->fdwConvert &
1055 {
1056 FIXME("Unsupported fdwConvert (%08x), ignoring it\n", adsh->fdwConvert);
1057 }
1058 /* ACM_STREAMCONVERTF_BLOCKALIGN
1059 * currently all conversions are block aligned, so do nothing for this flag
1060 * ACM_STREAMCONVERTF_END
1061 * no pending data, so do nothing for this flag
1062 */
1064 {
1065 G711_Reset(adsi, aad);
1066 }
1067
1068 aad->convert(adsi, adsh->pbSrc, &nsrc, adsh->pbDst, &ndst);
1069 adsh->cbSrcLengthUsed = nsrc;
1070 adsh->cbDstLengthUsed = ndst;
1071
1072 return MMSYSERR_NOERROR;
1073}
#define FIXME(fmt,...)
Definition: debug.h:111
if(dx< 0)
Definition: linetemp.h:194
#define ACM_STREAMCONVERTF_START
Definition: msacm.h:206
#define ACM_STREAMCONVERTF_BLOCKALIGN
Definition: msacm.h:205
#define ACM_STREAMCONVERTF_END
Definition: msacm.h:207
static void G711_Reset(PACMDRVSTREAMINSTANCE adsi, AcmG711Data *aad)
Definition: msg711.c:850
void(* convert)(PACMDRVSTREAMINSTANCE adsi, const unsigned char *, LPDWORD, unsigned char *, LPDWORD)
Definition: msg711.c:56

Referenced by G711_DriverProc().

◆ G711_StreamOpen()

static LRESULT G711_StreamOpen ( PACMDRVSTREAMINSTANCE  adsi)
static

Definition at line 858 of file msg711.c.

859{
860 AcmG711Data* aad;
861
863
864 if (G711_GetFormatIndex(adsi->pwfxSrc) == 0xFFFFFFFF ||
865 G711_GetFormatIndex(adsi->pwfxDst) == 0xFFFFFFFF)
866 return ACMERR_NOTPOSSIBLE;
867
868 aad = HeapAlloc(GetProcessHeap(), 0, sizeof(AcmG711Data));
869 if (aad == 0) return MMSYSERR_NOMEM;
870
871 adsi->dwDriver = (DWORD_PTR)aad;
872
873 if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
875 {
876 goto theEnd;
877 }
878 else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW &&
880 {
881 /* resampling or mono <=> stereo not available
882 * G711 algo only define 16 bit per sample output
883 */
884 if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
885 adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels ||
886 adsi->pwfxDst->wBitsPerSample != 16)
887 goto theEnd;
888
889 /* g711 A-Law decoding... */
890 if (adsi->pwfxDst->wBitsPerSample == 16)
891 aad->convert = cvtXXalaw16K;
892 }
893 else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
895 {
896 if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
897 adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels ||
898 adsi->pwfxSrc->wBitsPerSample != 16)
899 goto theEnd;
900
901 /* g711 coding... */
902 if (adsi->pwfxSrc->wBitsPerSample == 16)
903 aad->convert = cvtXX16alawK;
904 }
905 else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW &&
907 {
908 /* resampling or mono <=> stereo not available
909 * G711 algo only define 16 bit per sample output
910 */
911 if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
912 adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels ||
913 adsi->pwfxDst->wBitsPerSample != 16)
914 goto theEnd;
915
916 /* g711 MU-Law decoding... */
917 if (adsi->pwfxDst->wBitsPerSample == 16)
918 aad->convert = cvtXXulaw16K;
919 }
920 else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
922 {
923 if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
924 adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels ||
925 adsi->pwfxSrc->wBitsPerSample != 16)
926 goto theEnd;
927
928 /* g711 coding... */
929 if (adsi->pwfxSrc->wBitsPerSample == 16)
930 aad->convert = cvtXX16ulawK;
931 }
932 else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MULAW &&
934 {
935 if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
936 adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels)
937 goto theEnd;
938
939 /* MU-Law => A-Law... */
940 aad->convert = cvtXXulawalawK;
941 }
942 else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW &&
944 {
945 if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
946 adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels)
947 goto theEnd;
948
949 /* A-Law => MU-Law... */
950 aad->convert = cvtXXalawulawK;
951 }
952 else goto theEnd;
953
954 G711_Reset(adsi, aad);
955
956 return MMSYSERR_NOERROR;
957
958 theEnd:
959 HeapFree(GetProcessHeap(), 0, aad);
960 adsi->dwDriver = 0L;
962}
#define HeapAlloc
Definition: compat.h:733
#define assert(x)
Definition: debug.h:53
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
#define ACM_STREAMOPENF_ASYNC
Definition: msacm.h:214
static void cvtXX16alawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
Definition: msg711.c:567
static void cvtXX16ulawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
Definition: msg711.c:599
static void cvtXXulaw16K(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
Definition: msg711.c:582
static void cvtXXulawalawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
Definition: msg711.c:629
static void cvtXXalawulawK(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
Definition: msg711.c:614
static void cvtXXalaw16K(PACMDRVSTREAMINSTANCE adsi, const unsigned char *src, LPDWORD srcsize, unsigned char *dst, LPDWORD dstsize)
Definition: msg711.c:550
#define L(x)
Definition: ntvdm.h:50
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:100
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:101
#define DWORD_PTR
Definition: treelist.c:76

Referenced by G711_DriverProc().

◆ G711_StreamSize()

static LRESULT G711_StreamSize ( const ACMDRVSTREAMINSTANCE adsi,
PACMDRVSTREAMSIZE  adss 
)
static

Definition at line 978 of file msg711.c.

979{
980 switch (adss->fdwSize)
981 {
983 /* cbDstLength => cbSrcLength */
984 if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
987 {
988 adss->cbSrcLength = adss->cbDstLength * 2;
989 }
990 else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW ||
993 {
994 adss->cbSrcLength = adss->cbDstLength / 2;
995 }
996 else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW ||
1000 {
1001 adss->cbSrcLength = adss->cbDstLength;
1002 }
1003 else
1004 {
1005 return MMSYSERR_NOTSUPPORTED;
1006 }
1007 break;
1009 /* cbSrcLength => cbDstLength */
1010 if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
1011 (adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW ||
1013 {
1014 adss->cbDstLength = adss->cbSrcLength / 2;
1015 }
1016 else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW ||
1019 {
1020 adss->cbDstLength = adss->cbSrcLength * 2;
1021 }
1022 else if ((adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ALAW ||
1024 (adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ALAW ||
1026 {
1027 adss->cbDstLength = adss->cbSrcLength;
1028 }
1029 else
1030 {
1031 return MMSYSERR_NOTSUPPORTED;
1032 }
1033 break;
1034 default:
1035 WARN("Unsupported query %08x\n", adss->fdwSize);
1036 return MMSYSERR_NOTSUPPORTED;
1037 }
1038 return MMSYSERR_NOERROR;
1039}
#define ACM_STREAMSIZEF_SOURCE
Definition: msacm.h:217
#define ACM_STREAMSIZEF_DESTINATION
Definition: msacm.h:218

Referenced by G711_DriverProc().

◆ linear2alaw()

static unsigned char linear2alaw ( int  pcm_val)
inlinestatic

Definition at line 289 of file msg711.c.

291{
292 int mask; /* changed from "short" *drago* */
293 int seg; /* changed from "short" *drago* */
294 unsigned char aval;
295
296 pcm_val = pcm_val >> 3;
297
298 if (pcm_val >= 0) {
299 mask = 0xD5; /* sign (7th) bit = 1 */
300 } else {
301 mask = 0x55; /* sign bit = 0 */
302 pcm_val = -pcm_val - 1;
303 }
304
305 /* Convert the scaled magnitude to segment number. */
306 seg = search(pcm_val, seg_aend, 8);
307
308 /* Combine the sign, segment, and quantization bits. */
309
310 if (seg >= 8) /* out of range, return maximum value. */
311 return (unsigned char) (0x7F ^ mask);
312 else {
313 aval = (unsigned char) seg << SEG_SHIFT;
314 if (seg < 2)
315 aval |= (pcm_val >> 1) & QUANT_MASK;
316 else
317 aval |= (pcm_val >> seg) & QUANT_MASK;
318 return (aval ^ mask);
319 }
320}
unsigned char
Definition: typeof.h:29
GLenum GLint GLuint mask
Definition: glext.h:6028
#define SEG_SHIFT
Definition: msg711.c:204
static short search(int val, const short *table, int size)
Definition: msg711.c:255
#define QUANT_MASK
Definition: msg711.c:202
static const short seg_aend[8]
Definition: msg711.c:207

Referenced by cvtXX16alawK().

◆ linear2ulaw()

static unsigned char linear2ulaw ( short  pcm_val)
inlinestatic

Definition at line 428 of file msg711.c.

429{
430 short mask;
431 short seg;
432 unsigned char uval;
433
434 /* Get the sign and the magnitude of the value. */
435 pcm_val = pcm_val >> 2;
436 if (pcm_val < 0) {
437 pcm_val = -pcm_val;
438 mask = 0x7F;
439 } else {
440 mask = 0xFF;
441 }
442 if ( pcm_val > CLIP ) pcm_val = CLIP; /* clip the magnitude */
443 pcm_val += (BIAS >> 2);
444
445 /* Convert the scaled magnitude to segment number. */
446 seg = search(pcm_val, seg_uend, 8);
447
448 /*
449 * Combine the sign, segment, quantization bits;
450 * and complement the code word.
451 */
452 if (seg >= 8) /* out of range, return maximum value. */
453 return (unsigned char) (0x7F ^ mask);
454 else {
455 uval = (unsigned char) (seg << 4) | ((pcm_val >> (seg + 1)) & 0xF);
456 return (uval ^ mask);
457 }
458}
static const short seg_uend[8]
Definition: msg711.c:208
#define BIAS
Definition: msg711.c:395
#define CLIP
Definition: msg711.c:396
Definition: clipboard.h:4

Referenced by cvtXX16ulawK().

◆ R16()

static short R16 ( const unsigned char src)
inlinestatic

Definition at line 132 of file msg711.c.

133{
134 return (short)((unsigned short)src[0] | ((unsigned short)src[1] << 8));
135}
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94

Referenced by cvtXX16alawK(), and cvtXX16ulawK().

◆ search()

◆ ulaw2alaw()

static unsigned char ulaw2alaw ( unsigned char  uval)
inlinestatic

Definition at line 542 of file msg711.c.

543{
544 uval &= 0xff;
545 return (uval & 0x80) ? (0xD5 ^ (_u2a[0xFF ^ uval] - 1)) : (0x55 ^ (_u2a[0x7F ^ uval] - 1));
546}
static const unsigned char _u2a[128]
Definition: msg711.c:211

Referenced by cvtXXulawalawK().

◆ ulaw2linear()

static short ulaw2linear ( unsigned char  u_val)
inlinestatic

Definition at line 525 of file msg711.c.

526{
527 return (short)_u2l[u_val];
528}
static const unsigned short _u2l[]
Definition: msg711.c:491

Referenced by cvtXXulaw16K().

◆ W16()

static void W16 ( unsigned char dst,
short  s 
)
inlinestatic

Definition at line 142 of file msg711.c.

143{
144 dst[0] = LOBYTE(s);
145 dst[1] = HIBYTE(s);
146}
GLdouble s
Definition: gl.h:2039
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486

Referenced by cvtXXalaw16K(), and cvtXXulaw16K().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( g711  )

Variable Documentation

◆ _a2l

const unsigned short _a2l[]
static

Definition at line 354 of file msg711.c.

Referenced by alaw2linear().

◆ _a2u

const unsigned char _a2u[128]
static
Initial value:
= {
1, 3, 5, 7, 9, 11, 13, 15,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
32, 32, 33, 33, 34, 34, 35, 35,
36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 48, 49, 49,
50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, 64,
65, 66, 67, 68, 69, 70, 71, 72,
73, 74, 75, 76, 77, 78, 79, 80,
80, 81, 82, 83, 84, 85, 86, 87,
88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125, 126, 127}

Definition at line 232 of file msg711.c.

Referenced by alaw2ulaw().

◆ _u2a

const unsigned char _u2a[128]
static
Initial value:
= {
1, 1, 2, 2, 3, 3, 4, 4,
5, 5, 6, 6, 7, 7, 8, 8,
9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24,
25, 27, 29, 31, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44,
46, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, 62,
64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79,
80, 82, 83, 84, 85, 86, 87, 88,
89, 90, 91, 92, 93, 94, 95, 96,
97, 98, 99, 100, 101, 102, 103, 104,
105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120,
121, 122, 123, 124, 125, 126, 127, 128}

Definition at line 211 of file msg711.c.

Referenced by ulaw2alaw().

◆ _u2l

const unsigned short _u2l[]
static

Definition at line 491 of file msg711.c.

Referenced by ulaw2linear().

◆ ALaw_Formats

const Format ALaw_Formats[]
static
Initial value:
=
{
{1, 8, 8000}, {2, 8, 8000}, {1, 8, 11025}, {2, 8, 11025},
{1, 8, 22050}, {2, 8, 22050}, {1, 8, 44100}, {2, 8, 44100},
}

Definition at line 78 of file msg711.c.

Referenced by G711_FormatDetails(), G711_FormatTagDetails(), and G711_GetFormatIndex().

◆ PCM_Formats

const Format PCM_Formats[]
static
Initial value:
=
{
{1, 16, 8000}, {2, 16, 8000},
{1, 16, 11025}, {2, 16, 11025},
{1, 16, 22050}, {2, 16, 22050},
{1, 16, 44100}, {2, 16, 44100},
}

Definition at line 70 of file msg711.c.

Referenced by G711_FormatDetails(), G711_FormatTagDetails(), and G711_GetFormatIndex().

◆ seg_aend

const short seg_aend[8] = {0x1F, 0x3F, 0x7F, 0x0FF, 0x1FF, 0x3FF, 0x7FF, 0x0FFF}
static

Definition at line 207 of file msg711.c.

Referenced by linear2alaw().

◆ seg_uend

const short seg_uend[8] = {0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF}
static

Definition at line 208 of file msg711.c.

Referenced by linear2ulaw().

◆ ULaw_Formats

const Format ULaw_Formats[]
static
Initial value:
=
{
{1, 8, 8000}, {2, 8, 8000}, {1, 8, 11025}, {2, 8, 11025},
{1, 8, 22050}, {2, 8, 22050}, {1, 8, 44100}, {2, 8, 44100},
}

Definition at line 84 of file msg711.c.

Referenced by G711_FormatDetails(), G711_FormatTagDetails(), and G711_GetFormatIndex().