ulaw.h File Reference

This graph shows which files directly or indirectly include this file:

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)
 Init the ulaw conversion stuff.

Variables

unsigned char __ast_lin2mu [16384]
 converts signed linear to mulaw
short __ast_mulaw [256]
 help


Define Documentation

#define AST_LIN2MU (  )     (__ast_lin2mu[((unsigned short)(a)) >> 2])

Definition at line 31 of file ulaw.h.

#define AST_MULAW (  )     (__ast_mulaw[(a)])

Definition at line 32 of file ulaw.h.


Function Documentation

void ast_ulaw_init ( void   ) 

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.

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 }


Variable Documentation

unsigned char __ast_lin2mu[16384]

converts signed linear to mulaw

Definition at line 20 of file ulaw.c.

short __ast_mulaw[256]

help

Definition at line 21 of file ulaw.c.


Generated on Wed Oct 28 17:01:03 2009 for Asterisk by  doxygen 1.5.6