Go to the source code of this file.
Defines | |
#define | AST_LIN2MU(a) (__ast_lin2mu[((unsigned short)(a)) >> 2]) |
#define | AST_MULAW(a) (__ast_mulaw[(a)]) |
Functions | |
void | ast_ulaw_init (void) |
Set up mu-law conversion table. | |
Variables | |
unsigned char | __ast_lin2mu [16384] |
short | __ast_mulaw [256] |
Definition in file ulaw.h.
#define AST_LIN2MU | ( | a | ) | (__ast_lin2mu[((unsigned short)(a)) >> 2]) |
Definition at line 40 of file ulaw.h.
Referenced by fill_rxgain(), fill_txgain(), lintoulaw_framein(), load_module(), and make_tone_burst().
#define AST_MULAW | ( | a | ) | (__ast_mulaw[(a)]) |
Definition at line 41 of file ulaw.h.
Referenced by ast_dsp_process(), fill_rxgain(), fill_txgain(), load_module(), tdd_feed(), and ulawtolin_framein().
void ast_ulaw_init | ( | void | ) |
Set up mu-law conversion table.
Init the ulaw conversion stuff
To init the ulaw to slinear conversion stuff, this needs to be run.
Definition at line 85 of file ulaw.c.
References f, and linear2ulaw().
Referenced by main().
00086 { 00087 int i; 00088 for (i = 0; i < 256; i++) { 00089 short mu, e, f, y; 00090 static short etab[] = {0,132,396,924,1980,4092,8316,16764}; 00091 00092 mu = 255 - i; 00093 e = (mu & 0x70) / 16; 00094 f = mu & 0x0f; 00095 y = f * (1 << (e + 3)); 00096 y += etab[e]; 00097 if (mu & 0x80) 00098 y = -y; 00099 __ast_mulaw[i] = y; 00100 } 00101 /* set up the reverse (mu-law) conversion table */ 00102 for (i = -32768; i < 32768; i++) { 00103 __ast_lin2mu[((unsigned short)i) >> 2] = linear2ulaw(i); 00104 } 00105 }
unsigned char __ast_lin2mu[16384] |
short __ast_mulaw[256] |