libspandsp 0.0.4

g722_decode.c File Reference

#include <inttypes.h>
#include <memory.h>
#include <stdlib.h>
#include "spandsp/telephony.h"
#include "spandsp/dc_restore.h"
#include "spandsp/g722.h"

Functions

g722_decode_state_tg722_decode_init (g722_decode_state_t *s, int rate, int options)
int g722_decode_release (g722_decode_state_t *s)
int g722_decode (g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[], int len)

Detailed Description


Function Documentation

int g722_decode ( g722_decode_state_t s,
int16_t  amp[],
const uint8_t  g722_data[],
int  len 
)

Decode a buffer of G.722 data to linear PCM.

Parameters:
sThe G.722 context.
ampThe audio sample buffer.
g722_data
len
Returns:
The number of samples returned.

References g722_decode_state_t::bits_per_sample, g722_decode_state_t::eight_k, g722_decode_state_t::itu_test_mode, g722_decode_state_t::packed, and g722_decode_state_t::x.

g722_decode_state_t* g722_decode_init ( g722_decode_state_t s,
int  rate,
int  options 
)

Initialise an G.722 decode context.

Parameters:
sThe G.722 decode context.
rateThe bit rate of the G.722 data. The valid rates are 64000, 56000 and 48000.
options
Returns:
A pointer to the G.722 decode context, or NULL for error.

References g722_decode_state_t::bits_per_sample, g722_decode_state_t::eight_k, and g722_decode_state_t::packed.