Main Page | Compound List | File List | Compound Members | File Members

modes.c File Reference

#include "modes.h"
#include "ltp.h"
#include "quant_lsp.h"
#include "cb_search.h"
#include "sb_celp.h"
#include "nb_celp.h"
#include "vbr.h"
#include "misc.h"

Defines

#define NULL   0

Functions

void * speex_encoder_init (SpeexMode *mode)
void * speex_decoder_init (SpeexMode *mode)
void speex_encoder_destroy (void *state)
int speex_encode (void *state, float *in, SpeexBits *bits)
void speex_decoder_destroy (void *state)
int speex_decode (void *state, SpeexBits *bits, float *out)
int speex_encoder_ctl (void *state, int request, void *ptr)
int speex_decoder_ctl (void *state, int request, void *ptr)
int speex_mode_query (SpeexMode *mode, int request, void *ptr)

Variables

SpeexModespeex_mode_list [SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode}
signed char gain_cdbk_nb []
signed char gain_cdbk_lbr []
signed char hexc_table []
signed char exc_5_256_table []
signed char exc_5_64_table []
signed char exc_8_128_table []
signed char exc_10_32_table []
signed char exc_10_16_table []
signed char exc_20_32_table []
signed char hexc_10_32_table []
SpeexMode speex_nb_mode
SpeexMode speex_wb_mode
SpeexMode speex_uwb_mode

Define Documentation

#define NULL   0
 


Function Documentation

int speex_decode void *  state,
SpeexBits bits,
float *  out
 

Uses an existing decoder state to decode one frame of speech from bit-stream bits. The output speech is saved written to out.

Parameters:
state Decoder state
bits Bit-stream from which to decode the frame (NULL if the packet was lost)
out Where to write the decoded frame
Returns:
return status (0 for no error, -1 for end of stream, -2 other)

int speex_decoder_ctl void *  state,
int  request,
void *  ptr
 

Used like the ioctl function to control the encoder parameters

Parameters:
state Decoder state
request ioctl-type request (one of the SPEEX_* macros)
ptr Data exchanged to-from function
Returns:
0 for no error, 1 if a terminator is reached, 2 for another error

void speex_decoder_destroy void *  state  ) 
 

Frees all resources associated to an existing decoder state.

Parameters:
state State to be destroyed

void* speex_decoder_init SpeexMode mode  ) 
 

Returns a handle to a newly created decoder state structure. For now, the mode argument can be &nb_mode or &wb_mode . In the future, more modes may be added. Note that for now if you have more than one channels to decode, you need one state per channel.

Parameters:
mode Speex mode (one of speex_nb_mode or speex_wb_mode)
Returns:
A newly created decoder state

int speex_encode void *  state,
float *  in,
SpeexBits bits
 

Uses an existing encoder state to encode one frame of speech pointed to by "in". The encoded bit-stream is saved in "bits".

Parameters:
state Encoder state
in Frame that will be encoded with a +-2^16 range
bits Bit-stream where the data will be written

int speex_encoder_ctl void *  state,
int  request,
void *  ptr
 

Used like the ioctl function to control the encoder parameters

Parameters:
state Encoder state
request ioctl-type request (one of the SPEEX_* macros)
ptr Data exchanged to-from function
Returns:
0 if frame needs not be transmitted (DTX only), 1 otherwise

void speex_encoder_destroy void *  state  ) 
 

Frees all resources associated to an existing Speex encoder state.

Parameters:
state Encoder state to be destroyed

void* speex_encoder_init SpeexMode mode  ) 
 

Returns a handle to a newly created Speex encoder state structure. For now, the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes may be added. Note that for now if you have more than one channels to encode, you need one state per channel.

Parameters:
mode The mode to use (either speex_nb_mode or speex_wb.mode)
Returns:
A newly created encoder

int speex_mode_query SpeexMode mode,
int  request,
void *  ptr
 

Query function for mode information

Parameters:
mode Speex mode
request ioctl-type request (one of the SPEEX_* macros)
ptr Data exchanged to-from function


Variable Documentation

signed char exc_10_16_table[]
 

signed char exc_10_32_table[]
 

signed char exc_20_32_table[]
 

signed char exc_5_256_table[]
 

signed char exc_5_64_table[]
 

signed char exc_8_128_table[]
 

signed char gain_cdbk_lbr[]
 

signed char gain_cdbk_nb[]
 

signed char hexc_10_32_table[]
 

signed char hexc_table[]
 

SpeexMode* speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode}
 

List of all modes available

SpeexMode speex_nb_mode
 

Initial value:

Default narrowband mode

SpeexMode speex_uwb_mode
 

Initial value:

 {
   &sb_uwb_mode,
   wb_mode_query,
   "ultra-wideband (sub-band CELP)",
   2,
   4,
   &sb_encoder_init,
   &sb_encoder_destroy,
   &sb_encode,
   &sb_decoder_init,
   &sb_decoder_destroy,
   &sb_decode,
   &sb_encoder_ctl,
   &sb_decoder_ctl,
}
Default "ultra-wideband" mode

SpeexMode speex_wb_mode
 

Initial value:

 {
   &sb_wb_mode,
   wb_mode_query,
   "wideband (sub-band CELP)",
   1,
   4,
   &sb_encoder_init,
   &sb_encoder_destroy,
   &sb_encode,
   &sb_decoder_init,
   &sb_decoder_destroy,
   &sb_decode,
   &sb_encoder_ctl,
   &sb_decoder_ctl,
}
Default wideband mode


Generated on Sun Sep 21 16:07:09 2003 for speex by doxygen 1.3.2