oki_adpcm.c File Reference

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

Functions

oki_adpcm_state_toki_adpcm_init (oki_adpcm_state_t *s, int bit_rate)
int oki_adpcm_release (oki_adpcm_state_t *s)
int oki_adpcm_to_linear (oki_adpcm_state_t *s, int16_t *amp, const uint8_t *oki_data, int oki_bytes)
int oki_linear_to_adpcm (oki_adpcm_state_t *s, uint8_t *oki_data, const int16_t *amp, int samples)

Detailed Description


Function Documentation

oki_adpcm_state_t* oki_adpcm_init ( oki_adpcm_state_t s,
int  bit_rate 
)

Initialise an Oki ADPCM encode or decode context.

Parameters:
s The Oki ADPCM context.
bit_rate The required bit rate for the ADPCM data. The valid rates are 24000 and 32000.
Returns:
A pointer to the Oki ADPCM context, or NULL for error.

int oki_adpcm_release ( oki_adpcm_state_t s  ) 

Free an Oki ADPCM encode or decode context.

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

int oki_adpcm_to_linear ( oki_adpcm_state_t s,
int16_t *  amp,
const uint8_t *  oki_data,
int  oki_bytes 
)

Decode a buffer of Oki ADPCM data to linear PCM.

Parameters:
s The Oki ADPCM context.
amp 
oki_data 
oki_bytes 
Returns:
The number of samples returned.

int oki_linear_to_adpcm ( oki_adpcm_state_t s,
uint8_t *  oki_data,
const int16_t *  amp,
int  samples 
)

Encode a buffer of linear PCM data to Oki ADPCM.

Parameters:
s The Oki ADPCM context.
oki_data 
amp 
samples 
Returns:
The number of bytes of Oki ADPCM data produced.


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