#include <asterisk/ulaw.h>
Go to the source code of this file.
Defines | |
#define | ZEROTRAP |
#define | BIAS 0x84 |
#define | CLIP 32635 |
Functions | |
void | ast_ulaw_init (void) |
Init the ulaw conversion stuff. | |
Variables | |
unsigned char | __ast_lin2mu [16384] |
converts signed linear to mulaw | |
short | __ast_mulaw [256] |
help |
|
|
|
|
|
|
|
Init the ulaw conversion stuff. To init the ulaw to slinear conversion stuff, this needs to be run. Definition at line 62 of file ulaw.c. References __ast_lin2mu, and __ast_mulaw. Referenced by main(). 00063 { 00064 int i; 00065 /* 00066 * Set up mu-law conversion table 00067 */ 00068 for(i = 0;i < 256;i++) 00069 { 00070 short mu,e,f,y; 00071 static short etab[]={0,132,396,924,1980,4092,8316,16764}; 00072 00073 mu = 255-i; 00074 e = (mu & 0x70)/16; 00075 f = mu & 0x0f; 00076 y = f * (1 << (e + 3)); 00077 y += etab[e]; 00078 if (mu & 0x80) y = -y; 00079 __ast_mulaw[i] = y; 00080 } 00081 /* set up the reverse (mu-law) conversion table */ 00082 for(i = -32768; i < 32768; i++) 00083 { 00084 __ast_lin2mu[((unsigned short)i) >> 2] = linear2ulaw(i); 00085 } 00086 00087 }
|
|
converts signed linear to mulaw
Definition at line 20 of file ulaw.c. Referenced by ast_ulaw_init(). |
|
help
Definition at line 21 of file ulaw.c. Referenced by ast_ulaw_init(). |