nb_celp.c File Reference

#include <math.h>
#include "nb_celp.h"
#include "lpc.h"
#include "lsp.h"
#include "ltp.h"
#include "quant_lsp.h"
#include "cb_search.h"
#include "filters.h"
#include "stack_alloc.h"
#include "vq.h"
#include <speex/speex_bits.h>
#include "vbr.h"
#include "misc.h"
#include <speex/speex_callbacks.h>

Include dependency graph for nb_celp.c:


Defines

#define M_PI   3.14159265358979323846
#define NULL   0
#define SUBMODE(x)   st->submodes[st->submodeID]->x
#define NB_ENC_STACK   (8000*sizeof(spx_sig_t))
#define NB_DEC_STACK   (4000*sizeof(spx_sig_t))
#define LSP_MARGIN   .002
#define LSP_DELTA1   .2
#define LSP_DELTA2   .05
#define EXTRA_BUFFER   0
#define sqr(x)   ((x)*(x))
#define median3(a, b, c)   ((a) < (b) ? ((b) < (c) ? (b) : ((a) < (c) ? (c) : (a))) : ((c) < (b) ? (b) : ((c) < (a) ? (c) : (a))))

Functions

void * nb_encoder_init (const SpeexMode *m)
void nb_encoder_destroy (void *state)
int nb_encode (void *state, void *vin, SpeexBits *bits)
void * nb_decoder_init (const SpeexMode *m)
void nb_decoder_destroy (void *state)
int nb_decode (void *state, SpeexBits *bits, void *vout)
int nb_encoder_ctl (void *state, int request, void *ptr)
int nb_decoder_ctl (void *state, int request, void *ptr)

Variables

const float exc_gain_quant_scal3_bound [7] = {0.112338, 0.236980, 0.369316, 0.492054, 0.637471, 0.828874, 1.132784}
const float exc_gain_quant_scal3 [8] = {0.061130, 0.163546, 0.310413, 0.428220, 0.555887, 0.719055, 0.938694, 1.326874}
const float exc_gain_quant_scal1_bound [1] = {0.87798}
const float exc_gain_quant_scal1 [2] = {0.70469, 1.05127}
const spx_word16_t attenuation [10] = {1., 0.961, 0.852, 0.698, 0.527, 0.368, 0.237, 0.141, 0.077, 0.039}

Define Documentation

#define EXTRA_BUFFER   0

Referenced by nb_encode(), and nb_encoder_init().

#define LSP_DELTA1   .2

Referenced by nb_encode(), and sb_encode().

#define LSP_DELTA2   .05

Referenced by nb_encode(), and sb_encode().

#define LSP_MARGIN   .002

#define M_PI   3.14159265358979323846

#define median3 ( a,
b,
 )     ((a) < (b) ? ((b) < (c) ? (b) : ((a) < (c) ? (c) : (a))) : ((c) < (b) ? (b) : ((c) < (a) ? (c) : (a))))

#define NB_DEC_STACK   (4000*sizeof(spx_sig_t))

Referenced by nb_decoder_init().

#define NB_ENC_STACK   (8000*sizeof(spx_sig_t))

Referenced by nb_encoder_init().

#define NULL   0

#define sqr (  )     ((x)*(x))

#define SUBMODE (  )     st->submodes[st->submodeID]->x


Function Documentation

int nb_decode ( void *  state,
SpeexBits *  bits,
void *  out 
)

int nb_decoder_ctl ( void *  state,
int  request,
void *  ptr 
)

void nb_decoder_destroy ( void *  state  ) 

void* nb_decoder_init ( const SpeexMode *  m  ) 

int nb_encode ( void *  state,
void *  in,
SpeexBits *  bits 
)

int nb_encoder_ctl ( void *  state,
int  request,
void *  ptr 
)

void nb_encoder_destroy ( void *  state  ) 

void* nb_encoder_init ( const SpeexMode *  m  ) 

Initializes encoder state

References EncState::abr_drift, EncState::abr_enabled, EncState::autocorr, EncState::bounded_pitch, EncState::bw_lpc1, EncState::bw_lpc2, EncState::complexity, SpeexNBMode::defaultSubmode, EncState::dtx_count, EncState::dtx_enabled, EncState::encode_submode, EncState::exc, EncState::excBuf, EXTRA_BUFFER, EncState::first, EncState::frame, SpeexNBMode::frameSize, EncState::frameSize, SpeexNBMode::gamma1, EncState::gamma1, SpeexNBMode::gamma2, EncState::gamma2, EncState::inBuf, EncState::innov, EncState::interp_lpc, EncState::interp_lsp, EncState::interp_qlpc, EncState::interp_qlsp, SpeexNBMode::lag_factor, EncState::lag_factor, EncState::lagWindow, EncState::lpc, SpeexNBMode::lpc_floor, EncState::lpc_floor, SpeexNBMode::lpcSize, EncState::lpcSize, EncState::lsp, LSP_SCALING, M_PI, EncState::max_pitch, EncState::mem_exc, EncState::mem_sp, EncState::mem_sw, EncState::mem_sw_whole, EncState::min_pitch, EncState::mode, NB_ENC_STACK, EncState::nbSubframes, NULL, EncState::old_lsp, EncState::old_qlsp, EncState::pi_gain, EncState::pitch, SpeexNBMode::pitchEnd, SpeexNBMode::pitchStart, EncState::plc_tuning, EncState::qlsp, EncState::sampling_rate, SIG_SCALING, speex_alloc(), speex_alloc_scratch(), sqr, EncState::stack, EncState::subframeSize, SpeexNBMode::subframeSize, EncState::submodeID, SpeexNBMode::submodes, EncState::submodes, EncState::submodeSelect, EncState::sw, EncState::swBuf, EncState::vad_enabled, EncState::vbr, EncState::vbr_enabled, vbr_init(), EncState::vbr_quality, EncState::window, and EncState::windowSize.


Variable Documentation

const spx_word16_t attenuation[10] = {1., 0.961, 0.852, 0.698, 0.527, 0.368, 0.237, 0.141, 0.077, 0.039}

const float exc_gain_quant_scal1[2] = {0.70469, 1.05127}

Referenced by nb_decode().

const float exc_gain_quant_scal1_bound[1] = {0.87798}

const float exc_gain_quant_scal3[8] = {0.061130, 0.163546, 0.310413, 0.428220, 0.555887, 0.719055, 0.938694, 1.326874}

Referenced by nb_decode().

const float exc_gain_quant_scal3_bound[7] = {0.112338, 0.236980, 0.369316, 0.492054, 0.637471, 0.828874, 1.132784}


Generated on Wed May 7 21:15:05 2008 for speex by  doxygen 1.5.5