⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ld8k.h

📁 语音编码G.729 语音编码G.729
💻 H
📖 第 1 页 / 共 2 页
字号:
#define LONG_H_ST       20      /* impulse response length                   */#define GAMMA3_PLUS     (F)0.2     /* tilt weighting factor when k1>0        */#define GAMMA3_MINUS    (F)0.9     /* tilt weighting factor when k1<0        *//* long term pst parameters :   */#define L_SUBFRP1 (L_SUBFR + 1) /* Sub-frame size + 1                        */#define F_UP_PST        8       /* resolution for fractionnal delay          */#define LH2_S           4       /* length of INT16 interp. subfilters        */#define LH2_L           16      /* length of long interp. subfilters         */#define THRESCRIT       (F)0.5     /* threshold LT pst switch off            */#define GAMMA_G         (F)0.5     /* LT weighting factor                    */#define AGC_FAC         (F)0.9875  /* gain adjustment factor                 */#define AGC_FAC1         ((F)1. - AGC_FAC)    /* gain adjustment factor                 */#define LH_UP_S         (LH2_S/2)#define LH_UP_L         (LH2_L/2)#define LH2_L_P1    (LH2_L + 1)#define MIN_GPLT    ((F)1. / ((F)1. + GAMMA_G))  /* LT gain minimum          *//* Array sizes */#define MEM_RES2 (PIT_MAX + 1 + LH_UP_L)#define SIZ_RES2 (MEM_RES2 + L_SUBFR)#define SIZ_Y_UP  ((F_UP_PST-1) * L_SUBFRP1)#define SIZ_TAB_HUP_L ((F_UP_PST-1) * LH2_L)#define SIZ_TAB_HUP_S ((F_UP_PST-1) * LH2_S)/*--------------------------------------------------------------------------* * Pre and post-process functions                                           * *--------------------------------------------------------------------------*/struct preproc_state_t{	FLOAT x0, x1;         /* high-pass fir memory          */	FLOAT y1, y2;         /* high-pass iir memory          */};void init_pre_process(struct preproc_state_t *);void pre_process(struct preproc_state_t *, FLOAT signal[], int lg);void init_post_process(struct preproc_state_t *);void post_process(struct preproc_state_t *, FLOAT signal[], int lg);/*--------------------------------------------------------------------------* * LPC analysis and filtering                                               * *--------------------------------------------------------------------------*/void autocorr(FLOAT *x, int m, FLOAT *r);void lag_window(int m, FLOAT r[]);void az_lsp(FLOAT a[], FLOAT lsp[], FLOAT old_lsp[]);INLINE_PREFIX void lsf_lsp(const FLOAT *lsf, FLOAT *lsp, int m);INLINE_PREFIX void lsp_lsf(const FLOAT *lsp, FLOAT *lsf, int m);void int_lpc(FLOAT lsp_old[], FLOAT lsp_new[], FLOAT lsf_int[],		FLOAT lsf_new[], FLOAT A_t[]);void int_qlpc( FLOAT lsp_old[], FLOAT lsp_new[], FLOAT Az[]);/*--------------------------------------------------------------------------* * Prototypes of LSP VQ functions                                           * *--------------------------------------------------------------------------*/void lsp_expand_1(FLOAT buf[], FLOAT c);void lsp_expand_2(FLOAT buf[], FLOAT c);void lsp_expand_1_2(FLOAT buf[], FLOAT c);void lsp_prev_update(FLOAT lsp_ele[M], FLOAT freq_prev[MA_NP][M]);void lsp_prev_extract(FLOAT lsp[M], FLOAT lsp_ele[M], const FLOAT fg[MA_NP][M],		FLOAT freq_prev[MA_NP][M], const FLOAT fg_sum_inv[M]);/*--------------------------------------------------------------------------* *       PWF prototypes                                                     * *--------------------------------------------------------------------------*/struct pwf_state_t{	int   smooth;	FLOAT lar_old[2];};void init_pwf(struct pwf_state_t *);void perc_var(struct pwf_state_t *,				FLOAT *gamma1, FLOAT *gamma2, FLOAT *lsfint, FLOAT *lsfnew,				FLOAT *r_c);void weight_az(FLOAT *a, FLOAT gamma, int m, FLOAT *ap );/*------------------------------------------------------------------------- * Prototypes of general signal processing routines. *------------------------------------------------------------------------- */void convolve(FLOAT x[], FLOAT h[], FLOAT y[], int L);/*--------------------------------------------------------------------------* *       LTP prototypes                                                     * *--------------------------------------------------------------------------*//*int   pitch_fr3(FLOAT exc[], FLOAT xn[], FLOAT h[], int l_subfr,		int t0_min, int t0_max, int i_subfr, int *pit_frac);int   enc_lag3( int T0, int T0_frac, int *T0_min, int *T0_max, int pit_min,		int pit_max, int pit_flag);void  dec_lag3( int index, int pit_min, int pit_max, int i_subfr,		int *T0, int *T0_frac);*/int   pitch_ol(FLOAT signal[], int pit_min, int pit_max, int L_frame);void  pred_lt_3(FLOAT exc[], int t0, int frac, int L);int   parity_pitch(int pitch_i);int   check_parity_pitch(int pitch_i, int parity);FLOAT g_pitch(FLOAT xn[], FLOAT y1[], FLOAT g_coeff[], int L_subfr);/*--------------------------------------------------------------------------* * fixed codebook excitation.                                               * *--------------------------------------------------------------------------*/void cor_h_x(FLOAT h[], FLOAT X[], FLOAT D[]);int  ACELP_codebook(FLOAT x[], FLOAT h[], int T0, FLOAT pitch_sharp,		int i_subfr, FLOAT code[], FLOAT y[], int *sign, int *d4i40_17_extra);void decod_ACELP(int signs, int positions, FLOAT cod[]);/*--------------------------------------------------------------------------* * gain VQ functions.                                                       * *--------------------------------------------------------------------------*/struct gain_state_t{	FLOAT past_qua_en[4];};void gain_past_reset(struct gain_state_t *);int  qua_gain(struct gain_state_t *,		FLOAT code[], FLOAT *coeff, int lcode, FLOAT *gain_pit,		FLOAT *gain_code, int taming);void  dec_gain(struct gain_state_t *,			   int indice, FLOAT code[], int lcode, int bfi, FLOAT *gain_pit,               FLOAT *gain_code);void gain_predict(FLOAT past_qua_en[], FLOAT code[], int l_subfr,		FLOAT *gcode0);void gain_update(FLOAT past_qua_en[], FLOAT g_code);void gain_update_erasure(FLOAT *past_qua_en);void corr_xy2(FLOAT xn[], FLOAT y1[], FLOAT y2[], FLOAT g_coeff[]);/*--------------------------------------------------------------------------* * bitstream packing VQ functions.                                          * *--------------------------------------------------------------------------*/void  prm2bits_ld8k(int prm[], INT16 bits[]);void  bits2prm_ld8k(INT16 bits[], int prm[]);int  read_frame(FILE *f_serial, int *parm);/*--------------------------------------------------------------------------* * postfilter  functions.                                                   * *--------------------------------------------------------------------------*/struct postfilt_state_t;void init_post_filter(struct postfilt_state_t *);/*------------------------------------------------------------* * prototypes for taming procedure.                           * *------------------------------------------------------------*/void init_exc_err(FLOAT exc_err[4]);void update_exc_err(FLOAT exc_err[4], FLOAT gain_pit, int t0);int  test_err(FLOAT exc_err[4], int t0, int t0_frac);/*--------------------------------------------------------------------------* * Prototypes for auxiliary functions                                       * *--------------------------------------------------------------------------*/INLINE_PREFIX void set_zero(FLOAT x[], int L);INLINE_PREFIX void copy(const FLOAT x[], FLOAT y[], int L);#ifdef INLINE_FUNCS#	include "utilinl.c"#	include "lpcfinl.c"#endif#endif /* _LD8K_H_INCL */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -