gsm0610_encode.c File Reference

#include <assert.h>
#include <inttypes.h>
#include "floating_fudge.h"
#include <stdlib.h>
#include <memory.h>
#include "spandsp/telephony.h"
#include "spandsp/bitstream.h"
#include "spandsp/saturated.h"
#include "spandsp/gsm0610.h"
#include "gsm0610_local.h"

Functions

gsm0610_state_tgsm0610_init (gsm0610_state_t *s, int packing)
int gsm0610_set_packing (gsm0610_state_t *s, int packing)
int gsm0610_release (gsm0610_state_t *s)
int gsm0610_pack_none (uint8_t c[], const gsm0610_frame_t *s)
int gsm0610_pack_wav49 (uint8_t c[], const gsm0610_frame_t *s)
int gsm0610_pack_voip (uint8_t c[33], const gsm0610_frame_t *s)
int gsm0610_encode (gsm0610_state_t *s, uint8_t code[], const int16_t amp[], int len)

Detailed Description


Function Documentation

int gsm0610_encode ( gsm0610_state_t s,
uint8_t  code[],
const int16_t  amp[],
int  len 
)

Encode a buffer of linear PCM data to GSM 06.10.

Parameters:
s The GSM 06.10 context.
code The GSM 06.10 data produced.
amp The audio sample buffer.
len The number of samples in the buffer.
Returns:
The number of bytes of GSM 06.10 data produced.

References gsm0610_pack_wav49(), and gsm0610_state_t::packing.

gsm0610_state_t* gsm0610_init ( gsm0610_state_t s,
int  packing 
)

Initialise a GSM 06.10 encode or decode context.

Parameters:
s The GSM 06.10 context
packing One of the GSM0610_PACKING_xxx options.
Returns:
A pointer to the GSM 06.10 context, or NULL for error.

int gsm0610_pack_wav49 ( uint8_t  c[],
const gsm0610_frame_t s 
)

Pack a pair of GSM 06.10 frames in the format used for wave files (wave type 49).

Parameters:
c The buffer for the packed data. This must be at least 65 bytes long.
s A pointer to the frames to be packed.
Returns:
The number of bytes generated.

References gsm0610_frame_t::bc, gsm0610_frame_t::LARc, gsm0610_frame_t::Mc, gsm0610_frame_t::Nc, gsm0610_frame_t::xmaxc, and gsm0610_frame_t::xMc.

Referenced by gsm0610_encode().

int gsm0610_release ( gsm0610_state_t s  ) 

Release a GSM 06.10 encode or decode context.

Parameters:
s The GSM 06.10 context
Returns:
0 for success, else -1.

int gsm0610_set_packing ( gsm0610_state_t s,
int  packing 
)

Set the packing format for a GSM 06.10 encode or decode context.

Parameters:
s The GSM 06.10 context
packing One of the GSM0610_PACKING_xxx options.
Returns:
0 for success, else -1.

References gsm0610_state_t::packing.


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