g726.c File Reference

#include <inttypes.h>
#include <memory.h>
#include <stdlib.h>
#include "spandsp/telephony.h"
#include "spandsp/dc_restore.h"
#include "spandsp/bitstream.h"
#include "spandsp/bit_operations.h"
#include "spandsp/g711.h"
#include "spandsp/g726.h"

Functions

g726_state_t * g726_init (g726_state_t *s, int bit_rate, int ext_coding, int packing)
int g726_release (g726_state_t *s)
int g726_decode (g726_state_t *s, int16_t amp[], const uint8_t g726_data[], int g726_bytes)
int g726_encode (g726_state_t *s, uint8_t g726_data[], const int16_t amp[], int len)

Detailed Description


Function Documentation

int g726_decode ( g726_state_t *  s,
int16_t  amp[],
const uint8_t  g726_data[],
int  g726_bytes 
)

Decode a buffer of G.726 ADPCM data to linear PCM, a-law or u-law.

Parameters:
s The G.726 context.
amp The audio sample buffer.
g726_data 
g726_bytes 
Returns:
The number of samples returned.

int g726_encode ( g726_state_t *  s,
uint8_t  g726_data[],
const int16_t  amp[],
int  len 
)

Encode a buffer of linear PCM data to G.726 ADPCM.

Parameters:
s The G.726 context.
g726_data The G.726 data produced.
amp The audio sample buffer.
len The number of samples in the buffer.
Returns:
The number of bytes of G.726 data produced.

g726_state_t* g726_init ( g726_state_t *  s,
int  bit_rate,
int  ext_coding,
int  packing 
)

Initialise a G.726 encode or decode context.

Parameters:
s The G.726 context.
bit_rate The required bit rate for the ADPCM data. The valid rates are 16000, 24000, 32000 and 40000.
ext_coding The coding used outside G.726.
packing One of the G.726_PACKING_xxx options.
Returns:
A pointer to the G.726 context, or NULL for error.

int g726_release ( g726_state_t *  s  ) 

Free a G.726 encode or decode context.

Parameters:
s The G.726 context.
Returns:
0 for OK.


Generated on Tue Jul 24 11:29:29 2007 for libspandsp by  doxygen 1.5.2