#include <stdio.h>
#include <inttypes.h>
#include <memory.h>
#include <stdlib.h>
#include <tgmath.h>
#include "spandsp/telephony.h"
#include "spandsp/dc_restore.h"
#include "spandsp/alaw_ulaw.h"
#include "spandsp/g726.h"
Functions | |
g726_state_t * | g726_init (g726_state_t *s, int bit_rate, int ext_coding, int packed) |
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 samples) |
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.
s | The G.726 context. | |
amp | ||
g726_data | ||
g726_bytes |
int g726_encode | ( | g726_state_t * | s, | |
uint8_t | g726_data[], | |||
const int16_t | amp[], | |||
int | samples | |||
) |
Encode a buffer of linear PCM data to G.726 ADPCM.
s | The G.726 context. | |
g726_data | ||
amp | ||
samples |
g726_state_t* g726_init | ( | g726_state_t * | s, | |
int | bit_rate, | |||
int | ext_coding, | |||
int | packed | |||
) |
Initialise a G.726 encode or decode context.
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. | |
packed | TRUE to use packed G.726. Otherwise G.726 will be expected as one code per octet. |
int g726_release | ( | g726_state_t * | s | ) |
Free a G.726 encode or decode context.
s | The G.726 context. |