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

📄 ld8cp.h

📁 语音编码G.729 语音编码G.729
💻 H
📖 第 1 页 / 共 2 页
字号:
  int prm[],          /* (i)     : indexes of the selected LSP */  FLOAT lsp_q[],        /* (o)  : Quantized LSP parameters    */  int erase           /* (i)     : frame erase information     */);void get_freq_prev(const FLOAT freq_prev[MA_NP][M], FLOAT x[MA_NP][M]);void update_freq_prev(FLOAT freq_prev[MA_NP][M], const FLOAT x[MA_NP][M]);/*--------------------------------------------------------------------------* *       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                                                     * *--------------------------------------------------------------------------*/struct postfilt_state_t{	/* Arrays */	FLOAT apond2[LONG_H_ST_E];    /* s.t. numerator coeff.        */	FLOAT mem_stp[M_BWD];         /* s.t. postfilter memory       */	FLOAT mem_zero[M_BWD];        /* null memory to compute h_st  */	FLOAT res2[SIZ_RES2];         /* A(gamma2) residual           */	/* pointers */	FLOAT *res2_ptr;	FLOAT *ptr_mem_stp;	/* Variables */	FLOAT gain_prec;};void poste(struct postfilt_state_t *state, 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(struct gain_state_t *,   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 );struct bwd_state_t{	int count_bwd2;	int count_fwd2;};void init_bwd_dominant(struct bwd_state_t *);void set_lpc_mode(	struct bwd_state_t *state,	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(struct bwd_state_t *, 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                   */	struct gain_state_t *,	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(	struct gain_state_t *,	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                                             * *--------------------------------------------------------------------------*/struct phdisp_state_t{	int prevDispState;	FLOAT gainMem[6];	FLOAT prevCbGain;	int onset;};void Init_PhDisp(struct phdisp_state_t *);void Update_PhDisp(	struct phdisp_state_t *,	FLOAT ltpGain,   /* (i)  : pitch gain                  */	FLOAT cbGain     /* (i)  : codebook gain               */);void PhDisp(	struct phdisp_state_t *,	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);INLINE_PREFIX 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);struct musdet_state_t{	int count_music;	FLOAT Mcount_music;	int count_consc;	FLOAT MeanPgain;	int count_pflag;	FLOAT Mcount_pflag;	int count_consc_pflag;	int count_consc_rflag;	FLOAT mrc[10];	FLOAT MeanSE;};void init_musdetect(struct musdet_state_t *);void musdetect(struct musdet_state_t *,		int rate, FLOAT Energy, FLOAT *rc, int *lags, FLOAT *pgains,		int stat_flg, int frm_count, int prev_vad, int *Vad, 		FLOAT Energy_db);#endif /* _LD8CP_H_INCL */

⌨️ 快捷键说明

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