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

📄 calc_en.h

📁 arm音频编解码库
💻 H
字号:
/***********************************************************************************      GSM AMR-NB speech codec   R98   Version 7.6.0   December 12, 2001*                                R99   Version 3.3.0                *                                REL-4 Version 4.1.0                ***********************************************************************************      File             : calc_en.h*      Purpose          : calculation of energy coefficients for quantizers**********************************************************************************/#ifndef calc_en_h#define calc_en_h "$Id $" /**********************************************************************************                         INCLUDE FILES*********************************************************************************/#include "typedef.h"#include "mode.h"/**********************************************************************************                         DECLARATION OF PROTOTYPES*********************************************************************************//************************************************************************* * * FUNCTION: calc_unfilt_energies * * PURPOSE:  calculation of several energy coefficients for unfiltered *           excitation signals and the LTP coding gain * *       frac_en[0]*2^exp_en[0] = <res res>   // LP residual energy *       frac_en[1]*2^exp_en[1] = <exc exc>   // LTP residual energy *       frac_en[2]*2^exp_en[2] = <exc code>  // LTP/CB innovation dot product *       frac_en[3]*2^exp_en[3] = <lres lres> // LTP residual energy *                                            // (lres = res - gain_pit*exc) *       ltpg = log2(LP_res_en / LTP_res_en) * *************************************************************************/voidcalc_unfilt_energies(    Word16 res[],     /* i  : LP residual,                               Q0  */    Word16 exc[],     /* i  : LTP excitation (unfiltered),               Q0  */    Word16 code[],    /* i  : CB innovation (unfiltered),                Q13 */    Word16 gain_pit,  /* i  : pitch gain,                                Q14 */    Word16 L_subfr,   /* i  : Subframe length                                */    Word16 frac_en[], /* o  : energy coefficients (3), fraction part,    Q15 */    Word16 exp_en[],  /* o  : energy coefficients (3), exponent part,    Q0  */    Word16 *ltpg      /* o  : LTP coding gain (log2()),                  Q13 */);/************************************************************************* * * FUNCTION: calc_filt_energies * * PURPOSE:  calculation of several energy coefficients for filtered *           excitation signals * *     Compute coefficients need for the quantization and the optimum *     codebook gain gcu (for MR475 only). * *      coeff[0] =    y1 y1 *      coeff[1] = -2 xn y1 *      coeff[2] =    y2 y2 *      coeff[3] = -2 xn y2 *      coeff[4] =  2 y1 y2 * * *      gcu = <xn2, y2> / <y2, y2> (0 if <xn2, y2> <= 0) * *     Product <y1 y1> and <xn y1> have been computed in G_pitch() and *     are in vector g_coeff[]. * *************************************************************************/voidcalc_filt_energies(    enum Mode mode,     /* i  : coder mode                                   */    Word16 xn[],        /* i  : LTP target vector,                       Q0  */    Word16 xn2[],       /* i  : CB target vector,                        Q0  */    Word16 y1[],        /* i  : Adaptive codebook,                       Q0  */    Word16 Y2[],        /* i  : Filtered innovative vector,              Q12 */    Word16 g_coeff[],   /* i  : Correlations <xn y1> <y1 y1>                 */                        /*      computed in G_pitch()                        */    Word16 frac_coeff[],/* o  : energy coefficients (5), fraction part,  Q15 */    Word16 exp_coeff[], /* o  : energy coefficients (5), exponent part,  Q0  */    Word16 *cod_gain_frac,/* o: optimum codebook gain (fraction part),   Q15 */    Word16 *cod_gain_exp  /* o: optimum codebook gain (exponent part),   Q0  */);/************************************************************************* * * FUNCTION: calc_target_energy * * PURPOSE:  calculation of target energy * *      en = <xn, xn> * *************************************************************************/voidcalc_target_energy(    Word16 xn[],     /* i: LTP target vector,                       Q0  */    Word16 *en_exp,  /* o: optimum codebook gain (exponent part),   Q0  */    Word16 *en_frac  /* o: optimum codebook gain (fraction part),   Q15 */);#endif

⌨️ 快捷键说明

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