ima_adpcm.c File Reference

#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <string.h>
#include "spandsp/telephony.h"
#include "spandsp/ima_adpcm.h"

Functions

int imaadpcm_encode (ima_adpcm_state_t *state, int16_t linear)
ima_adpcm_state_tima_adpcm_init (ima_adpcm_state_t *s)
int ima_adpcm_release (ima_adpcm_state_t *s)
int ima_adpcm_to_linear (ima_adpcm_state_t *s, int16_t *amp, const uint8_t *ima_data, int ima_bytes)
int ima_linear_to_adpcm (ima_adpcm_state_t *s, uint8_t *ima_data, const int16_t *amp, int samples)

Detailed Description


Function Documentation

ima_adpcm_state_t* ima_adpcm_init ( ima_adpcm_state_t s  ) 

Initialise an IMA ADPCM encode or decode context.

Parameters:
s The IMA ADPCM context
Returns:
A pointer to the IMA ADPCM context, or NULL for error.

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.

int ima_adpcm_to_linear ( 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 
ima_data 
ima_bytes 
Returns:
The number of samples returned.

int ima_linear_to_adpcm ( ima_adpcm_state_t s,
uint8_t *  ima_data,
const int16_t *  amp,
int  samples 
)

Encode a buffer of linear PCM data to IMA ADPCM.

Parameters:
s The IMA ADPCM context.
ima_data 
amp 
samples 
Returns:
The number of bytes of IMA ADPCM data produced.


Generated on Fri Nov 10 09:40:24 2006 for libspandsp by  doxygen 1.5.1