ima_adpcm.h File Reference

Go to the source code of this file.

Classes

struct  ima_adpcm_state_t

Enumerations

enum  { IMA_ADPCM_IMA4 = 0, IMA_ADPCM_DVI4 = 1, IMA_ADPCM_VDVI = 2 }

Functions

ima_adpcm_state_tima_adpcm_init (ima_adpcm_state_t *s, int variant, int chunk_size)
int ima_adpcm_release (ima_adpcm_state_t *s)
int ima_adpcm_encode (ima_adpcm_state_t *s, uint8_t ima_data[], const int16_t amp[], int len)
int ima_adpcm_decode (ima_adpcm_state_t *s, int16_t amp[], const uint8_t ima_data[], int ima_bytes)


Detailed Description


Enumeration Type Documentation

anonymous enum

Enumerator:
IMA_ADPCM_IMA4  IMA4 is the original IMA ADPCM variant
IMA_ADPCM_DVI4  DVI4 is the IMA ADPCM variant defined in RFC3551
IMA_ADPCM_VDVI  VDVI is the variable bit rate IMA ADPCM variant defined in RFC3551


Function Documentation

int ima_adpcm_decode ( ima_adpcm_state_t s,
int16_t  amp[],
const uint8_t  ima_data[],
int  ima_bytes 
)

Decode a buffer of IMA ADPCM data to linear PCM.

Parameters:
s The IMA ADPCM context.
amp The audio sample buffer.
ima_data 
ima_bytes 
Returns:
The number of samples returned.

References ima_adpcm_state_t::bits, ima_adpcm_state_t::chunk_size, IMA_ADPCM_DVI4, IMA_ADPCM_IMA4, IMA_ADPCM_VDVI, ima_adpcm_state_t::last, ima_adpcm_state_t::step_index, and ima_adpcm_state_t::variant.

int ima_adpcm_encode ( ima_adpcm_state_t s,
uint8_t  ima_data[],
const int16_t  amp[],
int  len 
)

Encode a buffer of linear PCM data to IMA ADPCM.

Parameters:
s The IMA ADPCM context.
ima_data The IMA ADPCM data produced.
amp The audio sample buffer.
len The number of samples in the buffer.
Returns:
The number of bytes of IMA ADPCM data produced.

References ima_adpcm_state_t::bits, ima_adpcm_state_t::chunk_size, IMA_ADPCM_DVI4, IMA_ADPCM_IMA4, IMA_ADPCM_VDVI, ima_adpcm_state_t::ima_byte, ima_adpcm_state_t::last, ima_adpcm_state_t::step_index, and ima_adpcm_state_t::variant.

ima_adpcm_state_t* ima_adpcm_init ( ima_adpcm_state_t s,
int  variant,
int  chunk_size 
)

Initialise an IMA ADPCM encode or decode context.

Parameters:
s The IMA ADPCM context
variant ???
chunk_size The size of a chunk, in samples. A chunk size of zero sample samples means treat each encode or decode operation as a chunk.
Returns:
A pointer to the IMA ADPCM context, or NULL for error.

References ima_adpcm_state_t::chunk_size, and ima_adpcm_state_t::variant.

int ima_adpcm_release ( ima_adpcm_state_t s  ) 

Free an IMA ADPCM encode or decode context.

Parameters:
s The IMA ADPCM context.
Returns:
0 for OK.


Generated on Tue Oct 7 20:25:51 2008 for spandsp by  doxygen 1.5.6