📄 ld8cp.h
字号:
FLOAT fg_sum[], /* (i) : present MA prediction coef. */
FLOAT freq_cur[] /* (i) : present MA prediction coef. */
);
void relspwede(
FLOAT lsp[], /* (i) : unquantized LSP parameters */
FLOAT wegt[], /* (i) norm: weighting coefficients */
FLOAT lspq[], /* (o) : quantized LSP parameters */
FLOAT lspcb1[][M], /* (i) : first stage LSP codebook */
FLOAT lspcb2[][M], /* (i) : Second stage LSP codebook */
FLOAT fg[MODE][MA_NP][M], /* (i) : MA prediction coefficients */
FLOAT freq_prev[MA_NP][M], /* (i) : previous LSP vector */
FLOAT fg_sum[MODE][M], /* (i) : present MA prediction coef.*/
FLOAT fg_sum_inv[MODE][M], /* (i) : inverse coef. */
int code_ana[], /* (o) : codes of the selected LSP */
FLOAT freq_cur[] /* (o) : current LSP MA vector */
);
void get_wegt( FLOAT flsp[], FLOAT wegt[] );
void d_lspe(
int prm[], /* (i) : indexes of the selected LSP */
FLOAT lsp_q[], /* (o) : Quantized LSP parameters */
int erase, /* (i) : frame erase information */
FLOAT freq_prev[MA_NP][M], /* (i/o) : previous LSP MA vector */
FLOAT prev_lsp[], /* (i/o) : previous LSP vector */
int *prev_ma /* (i/o) previous MA prediction coef.*/
);
void lsp_decw_resete(
FLOAT freq_prev[MA_NP][M], /* (o) : previous LSP MA vector */
FLOAT prev_lsp[], /* (o) : previous LSP vector */
int *prev_ma /* previous MA prediction coef.*/
);
/*--------------------------------------------------------------------------*
* LTP prototypes *
*--------------------------------------------------------------------------*/
int pitch_fr3cp(FLOAT exc[], FLOAT xn[], FLOAT h[], int l_subfr,
int t0_min, int t0_max, int i_subfr, int *pit_frac, int rate);
int enc_lag3cp( int T0, int T0_frac, int *T0_min, int *T0_max, int pit_min,
int pit_max, int pit_flag, int rate);
void dec_lag3cp( int index, int pit_min, int pit_max, int i_subfr,
int *T0, int *T0_frac, int rate);
/*--------------------------------------------------------------------------*
* Postfilter functions *
*--------------------------------------------------------------------------*/
void poste(
int t0, /* input : pitch delay given by coder */
FLOAT *signal_ptr, /* input : input signal (pointer to current subframe */
FLOAT *coeff, /* input : LPC coefficients for current subframe */
FLOAT *sig_out, /* output: postfiltered output */
int *vo, /* output: voicing decision 0 = uv, > 0 delay */
FLOAT gamma1, /* input: short term postfilt. den. weighting factor*/
FLOAT gamma2, /* input: short term postfilt. num. weighting factor*/
FLOAT gamma_harm, /* input: long term postfilter weighting factor*/
int long_h_st, /* input: impulse response length*/
int m_pst, /* input: LPC order */
int Vad /* input : VAD information (frame type) */
);
/*--------------------------------------------------------------------------*
* protypes of functions containing G729 source code + specific G729E code *
*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*
* gain VQ functions. *
*--------------------------------------------------------------------------*/
void dec_gaine(
int index, /* (i) :Index of quantization. */
FLOAT code[], /* (i) :Innovative vector. */
int L_subfr, /* (i) :Subframe length. */
int bfi, /* (i) :Bad frame indicator */
FLOAT *gain_pit, /* (o) :Pitch gain. */
FLOAT *gain_cod, /* (o) :Code gain. */
int rate, /* input : rate selector/frame =0 8kbps,= 1 11.8 kbps*/
FLOAT gain_pit_mem,
FLOAT gain_cod_mem,
FLOAT *c_muting,
int count_bfi,
int stationnary
);
/*--------------------------------------------------------------------------*
* functions specific to G729E *
*--------------------------------------------------------------------------*/
/* backward LPC analysis and switch forward/backward */
void autocorr_hyb_window(
FLOAT *x, /* Input speech signal */
FLOAT *r_bwd, /* (out) Autocorrelations */
FLOAT *rexp /* (in/out) */
);
void lag_window_bwd(FLOAT *r_bwd);
void int_bwd(FLOAT *a_bwd, FLOAT *prev_filter, FLOAT *C_int );
void set_lpc_mode(FLOAT *signal_ptr, FLOAT *a_fwd, FLOAT *a_bwd,
int *mode, FLOAT *lsp_new, FLOAT *lsp_old, int *bwd_dominant,
int prev_mode, FLOAT *prev_filter, FLOAT *C_int,
INT16 *glob_stat, INT16 *stat_bwd, INT16 *val_stat_bwd);
void update_bwd(int *mode, /* O Backward / forward Indication */
int *bwd_dominant,/* O Bwd dominant mode indication */
FLOAT *C_int, /*I/O filter interpolation parameter */
INT16 *glob_stat /* I/O Mre of global stationnarity */
);
FLOAT ener_dB(FLOAT *synth, int L);
void tst_bwd_dominant(int *high_stat, int mode);
void perc_vare (
FLOAT *gamma1, /* Bandwidth expansion parameter */
FLOAT *gamma2, /* Bandwidth expansion parameter */
int high_stat /* high_stat indication (see file bwfw.c) */
);
/*--------------------------------------------------------------------------*
* G729E fixed (ACELP) codebook excitation. *
*--------------------------------------------------------------------------*/
void ACELP_12i40_44bits(
FLOAT x[], /* (i) : target vector */
FLOAT cn[], /* (i) : residual after long term prediction */
FLOAT H[], /* (i) : impulse response of weighted synthesis filter */
FLOAT code[], /* (o) : algebraic (fixed) codebook excitation */
FLOAT y[], /* (o) : filtered fixed codebook excitation */
int indx[] /* (o) : index 5 words: 13,10,7,7,7 = 44 bits */
);
void ACELP_10i40_35bits(
FLOAT x[], /* (i) : target vector */
FLOAT cn[], /* (i) : residual after long term prediction */
FLOAT H[], /* (i) : impulse response of weighted synthesis filter */
FLOAT code[], /* (o) : algebraic (fixed) codebook excitation */
FLOAT y[], /* (o) : filtered fixed codebook excitation */
int indx[] /* (o) : index 5 words: 7,7,7,7,7 = 35 bits */
);
void dec_ACELP_12i40_44bits(
int *index, /* (i) : 5 words index (positions & sign) */
FLOAT cod[] /* (o) : algebraic (fixed) codebook excitation */
);
void dec_ACELP_10i40_35bits(
int *index, /* (i) : 5 words index (positions & sign) */
FLOAT cod[] /* (o) : algebraic (fixed) codebook excitation */
);
/* pitch tracking routine */
void track_pit(int *T0, int *T0_frac, int *prev_pitch,
int *stat_pitch, int *pitch_sta, int *frac_sta);
/*--------------------------------------------------------------------------*
* G729D fixed (ACELP) codebook excitation. *
*--------------------------------------------------------------------------*/
int ACELP_codebook64( /* (o) :Index of pulses positions */
FLOAT x[], /* (i) :Target vector */
FLOAT h[], /* (i) :Impulse response of filters */
int t0, /* (i) :Pitch lag */
FLOAT pitch_sharp, /* (i) :Last quantized pitch gain */
FLOAT code[], /* (o) :Innovative codebook */
FLOAT y[], /* (o) :Filtered innovative codebook */
int *sign /* (o) :Signs of 4 pulses */
);
void decod_ACELP64(
int sign, /* input : signs of 2 pulses */
int index, /* input : positions of 2 pulses */
FLOAT cod[] /* output: innovative codevector */
);
/*--------------------------------------------------------------------------*
* G729D gain *
*--------------------------------------------------------------------------*/
int qua_gain_6k( /* output: quantizer index */
FLOAT code[], /* input : fixed codebook vector */
FLOAT *g_coeff, /* input : correlation factors */
int l_subfr, /* input : fcb vector length */
FLOAT *gain_pit, /* output: quantized acb gain */
FLOAT *gain_code, /* output: quantized fcb gain */
int tameflag /* input : flag set to 1 if taming is needed */
);
void dec_gain_6k(
int index, /* input : quantizer index */
FLOAT code[], /* input : fixed code book vector */
int l_subfr, /* input : subframe size */
int bfi, /* input : bad frame indicator good = 0 */
FLOAT *gain_pit, /* output: quantized acb gain */
FLOAT *gain_code /* output: quantized fcb gain */
);
/*--------------------------------------------------------------------------*
* G729D gain phase dispersion *
*--------------------------------------------------------------------------*/
void Update_PhDisp(
FLOAT ltpGain, /* (i) : pitch gain */
FLOAT cbGain /* (i) : codebook gain */
);
void PhDisp(
FLOAT x[], /* input : excitation signal */
FLOAT x_phdisp[],/* output : excitation signal after phase dispersion */
FLOAT cbGain,
FLOAT ltpGainQ,
FLOAT inno[]
);
/*--------------------------------------------------------------------------*
* Prototypes for auxiliary functions *
*--------------------------------------------------------------------------*/
void fwrite16( FLOAT *data, int length, FILE *fp);
INT16 random_g729c(INT16 *seed);
void dvsub(FLOAT *in1, FLOAT *in2, FLOAT *out, INT16 npts);
FLOAT dvdot(FLOAT *in1, FLOAT *in2, INT16 npts);
void dvwadd(FLOAT *in1, FLOAT scalar1, FLOAT *in2, FLOAT scalar2,
FLOAT *out, INT16 npts);
void dvsmul(FLOAT *in, FLOAT scalar, FLOAT *out, INT16 npts);
void musdetect( int rate, FLOAT Energy, FLOAT *rc, int *lags, FLOAT *pgains,
int stat_flg, int frm_count, int prev_vad, int *Vad,
FLOAT Energy_db);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -