亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sp_dec.c

?? GSM中半速率語音編解碼源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/***************************************************************************
 *
 *   File Name:  sp_dec.c
 *
 *   Purpose:
 *      Contains all functions for decoding speech.  It does not
 *      include those routines needed to decode channel information.
 *
 *      Since the GSM half-rate speech coder is an analysis-by-synthesis
 *      coder, many of the routines in this file are also called by the
 *      encoder.  Functions are included for coded-parameter lookup,
 *      LPC filter coefficient interpolation, excitation vector lookup
 *      and construction, vector quantized gain lookup, and LPC synthesis
 *      filtering.  In addition, some post-processing functions are
 *      included.
 *
 *     Below is a listing of all the functions appearing in the file.
 *     The functions are arranged according to their purpose.  Under
 *     each heading, the ordering is hierarchical.
 *
 *     The entire speech decoder, under which all these routines fall,
 *     except were noted:
 *     speechDecoder()
 *
 *     Spectral Smoothing of LPC:
 *       a_sst()
 *         aFlatRcDp()
 *         rcToCorrDpL()
 *         aToRc()
 *         rcToADp()
 *     VSELP codevector construction:
 *       b_con()
 *       v_con()
 *     LTP vector contruction:
 *       fp_ex()
 *         get_ipjj()
 *       lagDecode()
 *     LPC contruction
 *       getSfrmLpc()
 *         interpolateCheck()
 *         res_eng()
 *       lookupVq()
 *     Excitation scaling:
 *       rs_rr()
 *         g_corr1() (no scaling)
 *       rs_rrNs()
 *         g_corr1s() (g_corr1 with scaling)
 *       scaleExcite()
 *     Post filtering:
 *       pitchPreFilt()
 *         agcGain()
 *         lpcIir()
 *       r0BasedEnergyShft()
 *       spectralPostFilter()
 *         lpcFir()
 *
 *
 *     Routines not referenced by speechDecoder()
 *     Filtering routines:
 *       lpcIrZsIir()
 *       lpcZiIir()
 *       lpcZsFir()
 *       lpcZsIir()
 *       lpcZsIirP()
 *     Square root:
 *       sqroot()
 *
 **************************************************************************/

/*_________________________________________________________________________
 |                                                                         |
 |                            Include Files                                |
 |_________________________________________________________________________|
*/

#include "typedefs.h"
#include "mathhalf.h"
#include "sp_rom.h"
#include "sp_dec.h"
#include "err_conc.h"
#include "dtx.h"


/*_________________________________________________________________________
 |                                                                         |
 |            Local Functions (scope is limited to this file)              |
 |_________________________________________________________________________|
*/

static void a_sst(Shortword swAshift, Shortword swAscale,
                         Shortword pswDirectFormCoefIn[],
                         Shortword pswDirectFormCoefOut[]);

  static short aToRc(Shortword swAshift, Shortword pswAin[],
                            Shortword pswRc[]);

  static Shortword agcGain(Shortword pswStateCurr[],
                                  struct NormSw snsInSigEnergy,
                                  Shortword swEngyRShft);

  static Shortword lagDecode(Shortword swDeltaLag);

  static void lookupVq(Shortword pswVqCodeWds[], Shortword pswRCOut[]);

  static void pitchPreFilt(Shortword pswExcite[],
                                  Shortword swRxGsp0,
                                  Shortword swRxLag,
                                  Shortword swUvCode,
                                  Shortword swSemiBeta,
                                  struct NormSw snsSqrtRs,
                                  Shortword pswExciteOut[],
                                  Shortword pswPPreState[]);

  static void spectralPostFilter(Shortword pswSPFIn[],
                           Shortword pswNumCoef[], Shortword pswDenomCoef[],
                                        Shortword pswSPFOut[]);

/*_________________________________________________________________________
 |                                                                         |
 |                              Local Defines                              |
 |_________________________________________________________________________|
*/

#define  P_INT_MACS   10
#define  ASCALE       0x0800
#define  ASHIFT       4
#define  DELTA_LEVELS 16
#define  GSP0_SCALE   1
#define  C_BITS_V     9                /* number of bits in any voiced VSELP
                                        * codeword */
#define  C_BITS_UV    7                /* number of bits in a unvoiced VSELP
                                        * codeword */
#define  MAXBITS      C_BITS_V         /* max number of bits in any VSELP
                                        * codeword */
#define  LTP_LEN      147              /* 147==0x93 length of LTP history */
#define  SQRT_ONEHALF 0x5a82           /* the 0.5 ** 0.5 */
#define  LPC_ROUND    0x00000800L      /* 0x8000 >> ASHIFT */
#define  AFSHIFT      2                /* number of right shifts to be
                                        * applied to the autocorrelation
                                        * sequence in aFlatRcDp     */

/*_________________________________________________________________________
 |                                                                         |
 |                         State variables (globals)                       |
 |_________________________________________________________________________|
*/

  Shortword gswPostFiltAgcGain,
         gpswPostFiltStateNum[NP],
         gpswPostFiltStateDenom[NP],
         swPostEmphasisState,
         pswSynthFiltState[NP],
         pswOldFrmKsDec[NP],
         pswOldFrmAsDec[NP],
         pswOldFrmPFNum[NP],
         pswOldFrmPFDenom[NP],
         swOldR0Dec,
         pswLtpStateBaseDec[LTP_LEN + S_LEN],
         pswPPreState[LTP_LEN + S_LEN];


  Shortword swMuteFlagOld;             /* error concealment */


 /* DTX state variables */
 /* ------------------- */

  Shortword swRxDTXState = CNINTPER - 1;        /* DTX State at the rx.
                                                 * Modulo */

 /* counter [0,11].             */

  Shortword swDecoMode = SPEECH;
  Shortword swDtxMuting = 0;
  Shortword swDtxBfiCnt = 0;

  Shortword swOldR0IndexDec = 0;

  Shortword swRxGsHistPtr = 0;
  Longword pL_RxGsHist[(OVERHANG - 1) * N_SUB];


/*_________________________________________________________________________
 |                                                                         |
 |                               Global Data                               |
 |                     (scope is global to this file)                      |
 |_________________________________________________________________________|
*/

  Shortword swR0Dec;

  Shortword swVoicingMode,             /* MODE */
         pswVq[3],                     /* LPC1, LPC2, LPC3 */
         swSi,                         /* INT_LPC */
         swEngyRShift;                 /* for use by spectral postfilter */


  Shortword swR0NewCN;                 /* DTX mode */

  extern LongwordRom ppLr_gsTable[4][32];       /* DTX mode */


/***************************************************************************
 *
 *   FUNCTION NAME: aFlatRcDp
 *
 *   PURPOSE:
 *
 *     Given a Longword autocorrelation sequence, representing LPC
 *     information, aFlatRcDp converts the vector to one of NP
 *     Shortword reflection coefficients.
 *
 *   INPUT:
 *
 *
 *     pL_R[0:NP]    - An input Longword autocorrelation sequence, (pL_R[0] =
 *                     not necessarily 0x7fffffffL).  pL_R is altered in the
 *                     call, by being right shifted by global constant
 *                     AFSHIFT bits.
 *
 *                     The input array pL_R[] should be shifted left as much
 *                     as possible to improve precision.
 *
 *     AFSHIFT       - The number of right shifts to be applied to the
 *                     normalized autocorrelation sequence pL_R.
 *
 *   OUTPUT:
 *
 *     pswRc[0:NP-1] - A Shortword output vector of NP reflection
 *                     coefficients.
 *
 *   RETURN VALUE:
 *
 *     None
 *
 *   DESCRIPTION:
 *
 *     This routine transforms LPC information from one set of
 *     parameters to another.  It is better suited for fixed point
 *     implementations than the Levinson-Dubin recursion.
 *
 *     The function is called by a_sst(), and getNWCoefs().  In a_sst()
 *     direct form coefficients are converted to autocorrelations,
 *     and smoothed in that domain.  Conversion back to direct form
 *     coefficients is done by calling aFlatRc(), followed by rcToADp().
 *
 *     In getNwCoefs() again the conversion back to direct form
 *     coefficients is done by calling aFlatRc(), followed by rcToADp().
 *     In getNwCoefs() an autocorrelation sequence is generated from the
 *     impulse response of the weighting filters.
 *
 *     The fundamental recursion is derived from AFLAT, which is
 *     described in section 4.1.4.1.
 *
 *     Unlike in AFLAT where the reflection coefficients are known, here
 *     they are the unknowns.  PBar and VBar for j==0 are initially
 *     known, as is rSub1.  From this information the next set of P's
 *     and V's are generated.  At the end of the recursion the next,
 *     reflection coefficient rSubj (pswRc[j]) can be calcluated by
 *     dividing Vsubj by Psubj.
 *
 *     Precision is crucial in this routine.  At each stage, a
 *     normalization is performed prior to the reflection coefficient
 *     calculation.  In addition, to prevent overflow, the
 *     autocorrelation sequence is scaled down by ASHIFT (4) right
 *     shifts.
 *
 *
 *   REFERENCES: Sub_Clause 4.1.9 and 4.2.1  of GSM Recomendation 06.20
 *
 *   KEYWORDS: reflection coefficients, AFLAT, aflat, recursion, LPC
 *   KEYWORDS: autocorrelation
 *
 *************************************************************************/

  void   aFlatRcDp(Longword *pL_R, Shortword *pswRc)
{

/*_________________________________________________________________________
 |                                                                         |
 |                            Automatic Variables                          |
 |_________________________________________________________________________|
*/

  Longword pL_pjNewSpace[NP];
  Longword pL_pjOldSpace[NP];
  Longword pL_vjNewSpace[2 * NP - 1];
  Longword pL_vjOldSpace[2 * NP - 1];

  Longword *pL_pjOld;
  Longword *pL_pjNew;
  Longword *pL_vjOld;
  Longword *pL_vjNew;
  Longword *pL_swap;

  Longword L_temp;
  Longword L_sum;
  Shortword swRc,
         swRcSq,
         swTemp,
         swTemp1,
         swAbsTemp1,
         swTemp2;
  int    i,
         j;


/*_________________________________________________________________________
 |                                                                         |
 |                              Executable Code                            |
 |_________________________________________________________________________|
*/

  pL_pjOld = pL_pjOldSpace;
  pL_pjNew = pL_pjNewSpace;
  pL_vjOld = pL_vjOldSpace + NP - 1;
  pL_vjNew = pL_vjNewSpace + NP - 1;


  /* Extract the 0-th reflection coefficient */
  /*-----------------------------------------*/

  swTemp1 = round(pL_R[1]);
  swTemp2 = round(pL_R[0]);
  swAbsTemp1 = abs_s(swTemp1);
  if (swTemp2 <= 0 || sub(swAbsTemp1, swTemp2) >= 0)
  {
    j = 0;
    for (i = j; i < NP; i++)
    {
      pswRc[i] = 0;
    }
    return;
  }

  swRc = divide_s(swAbsTemp1, swTemp2);/* return division result */

  if (sub(swTemp1, swAbsTemp1) == 0)
    swRc = negate(swRc);               /* negate reflection Rc[j] */

  pswRc[0] = swRc;                     /* copy into the output Rc array */

  for (i = 0; i <= NP; i++)
  {
    pL_R[i] = L_shr(pL_R[i], AFSHIFT);
  }

  /* Initialize the pjOld and vjOld recursion arrays */
  /*-------------------------------------------------*/

  for (i = 0; i < NP; i++)
  {
    pL_pjOld[i] = pL_R[i];
    pL_vjOld[i] = pL_R[i + 1];
  }
  for (i = -1; i > -NP; i--)
    pL_vjOld[i] = pL_R[-(i + 1)];


  /* Compute the square of the j=0 reflection coefficient */
  /*------------------------------------------------------*/

  swRcSq = mult_r(swRc, swRc);

  /* Update pjNew and vjNew arrays for lattice stage j=1 */
  /*-----------------------------------------------------*/

  /* Updating pjNew: */
  /*-------------------*/

  for (i = 0; i <= NP - 2; i++)
  {
    L_temp = L_mpy_ls(pL_vjOld[i], swRc);
    L_sum = L_add(L_temp, pL_pjOld[i]);
    L_temp = L_mpy_ls(pL_pjOld[i], swRcSq);
    L_sum = L_add(L_temp, L_sum);
    L_temp = L_mpy_ls(pL_vjOld[-i], swRc);
    pL_pjNew[i] = L_add(L_sum, L_temp);
  }

  /* Updating vjNew: */
  /*-------------------*/

  for (i = -NP + 2; i <= NP - 2; i++)
  {
    L_temp = L_mpy_ls(pL_vjOld[-i - 1], swRcSq);
    L_sum = L_add(L_temp, pL_vjOld[i + 1]);
    L_temp = L_mpy_ls(pL_pjOld[(((i + 1) >= 0) ? i + 1 : -(i + 1))], swRc);
    L_temp = L_shl(L_temp, 1);
    pL_vjNew[i] = L_add(L_temp, L_sum);
  }



  j = 0;

  /* Compute reflection coefficients Rc[1],...,Rc[9] */
  /*-------------------------------------------------*/

  for (j = 1; j < NP; j++)
  {

    /* Swap pjNew and pjOld buffers */
    /*------------------------------*/

    pL_swap = pL_pjNew;
    pL_pjNew = pL_pjOld;
    pL_pjOld = pL_swap;

    /* Swap vjNew and vjOld buffers */
    /*------------------------------*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩欧美a| 毛片av中文字幕一区二区| 亚洲精品日韩综合观看成人91| 亚洲成av人综合在线观看| 国产成人超碰人人澡人人澡| 欧美日韩国产免费一区二区| 中文欧美字幕免费| 精品一区二区久久久| 欧美日韩一区二区欧美激情| 综合在线观看色| 国产激情视频一区二区在线观看| 91麻豆精品91久久久久久清纯| **性色生活片久久毛片| 国产精华液一区二区三区| 日韩欧美资源站| 日本午夜一区二区| 欧美日韩精品电影| 亚洲免费大片在线观看| av一区二区三区黑人| 国产午夜亚洲精品理论片色戒| 美女免费视频一区二区| 91精品国产色综合久久不卡蜜臀 | 精品亚洲成a人| 欧美日本在线观看| 亚洲一区二区三区不卡国产欧美| 97久久精品人人爽人人爽蜜臀| 国产亚洲欧美日韩日本| 国产毛片精品视频| 337p日本欧洲亚洲大胆色噜噜| 青草av.久久免费一区| 91精品国产欧美一区二区| 日韩电影在线看| 欧美一区二区三区不卡| 日本伊人午夜精品| 日韩精品最新网址| 精品一区二区久久| 国产精品私人影院| 91视频精品在这里| 亚洲国产日韩精品| 国产欧美日韩在线观看| 国产二区国产一区在线观看| 国产欧美精品区一区二区三区| 国产91丝袜在线播放0| 国产精品少妇自拍| 91国产福利在线| 午夜精品一区二区三区免费视频 | 欧美日韩高清一区二区三区| 亚洲成精国产精品女| 欧美一区永久视频免费观看| 日韩av一区二区在线影视| 欧美xxx久久| 成人午夜电影网站| 亚洲影视在线播放| 日韩欧美一区中文| 福利91精品一区二区三区| 亚洲视频 欧洲视频| 欧美日韩精品二区第二页| 久久99国产精品久久99果冻传媒| 2021中文字幕一区亚洲| 91免费小视频| 免费成人在线观看| 亚洲欧美在线视频观看| 欧美久久久久久蜜桃| 国产精品亚洲视频| 亚洲精品成人悠悠色影视| 日韩欧美你懂的| av电影在线观看完整版一区二区| 亚洲高清免费在线| 91精品国产乱码久久蜜臀| 久久精品av麻豆的观看方式| 中文字幕日韩一区| 91精品国产入口在线| 成人黄色在线视频| 丝瓜av网站精品一区二区| 久久午夜色播影院免费高清| 一本大道久久a久久精二百| 久久91精品久久久久久秒播| 毛片基地黄久久久久久天堂| 亚洲色图制服丝袜| 久久久影视传媒| 欧美日韩三级在线| 成人动漫一区二区在线| 蜜桃av一区二区| 一区二区激情视频| 国产精品高潮呻吟久久| 欧美v亚洲v综合ⅴ国产v| 91成人网在线| 成人app软件下载大全免费| 久久精品国产精品青草| 亚洲国产色一区| 国产精品久久久久四虎| 2014亚洲片线观看视频免费| 7777精品伊人久久久大香线蕉的| av在线不卡观看免费观看| 国产真实精品久久二三区| 婷婷国产在线综合| 亚洲一区二区在线免费观看视频| 国产精品私房写真福利视频| 久久嫩草精品久久久精品| 91精品国产一区二区三区香蕉| 在线日韩国产精品| 99精品国产热久久91蜜凸| 丰满岳乱妇一区二区三区| 韩国成人在线视频| 精品一区二区三区香蕉蜜桃| 秋霞国产午夜精品免费视频| 性感美女久久精品| 亚洲超碰精品一区二区| 亚洲图片欧美一区| 亚洲国产精品一区二区久久恐怖片| 亚洲视频你懂的| 亚洲欧美色图小说| 一区二区三区日本| 又紧又大又爽精品一区二区| 一区二区三区美女| 亚洲最大成人综合| 婷婷开心久久网| 日本午夜一本久久久综合| 麻豆91在线观看| 国产在线精品一区二区不卡了| 久久电影网电视剧免费观看| 国产在线精品免费| 粉嫩aⅴ一区二区三区四区五区| 丰满白嫩尤物一区二区| 成人免费毛片app| 一本到三区不卡视频| 91国偷自产一区二区开放时间| 在线观看亚洲a| 欧美人伦禁忌dvd放荡欲情| 51精品视频一区二区三区| 日韩精品资源二区在线| 久久美女高清视频 | 欧美人妖巨大在线| 日韩欧美国产一区二区在线播放 | 欧美在线|欧美| 欧美日韩中文一区| 欧美一级片在线看| 国产女同性恋一区二区| 亚洲欧美日韩在线不卡| 亚洲成人精品在线观看| 久久精品国产在热久久| 国产二区国产一区在线观看| 日本高清不卡视频| 日韩美女视频在线| 18欧美亚洲精品| 喷水一区二区三区| 波多野结衣精品在线| 欧美电影一区二区三区| 久久久影视传媒| 亚洲6080在线| 成人一区二区三区在线观看| 欧美性三三影院| 久久久高清一区二区三区| 亚洲综合色自拍一区| 国内精品国产三级国产a久久| 色综合婷婷久久| 欧美电影免费观看高清完整版在| 国产精品视频看| 久久精品国产精品亚洲综合| 色综合一个色综合亚洲| 精品国产乱码久久久久久牛牛| 亚洲精品成人少妇| 国产成人在线观看免费网站| 欧美猛男超大videosgay| 国产日韩欧美不卡| 日本vs亚洲vs韩国一区三区二区 | 欧美综合久久久| 久久中文字幕电影| 日日噜噜夜夜狠狠视频欧美人| 国产不卡视频一区二区三区| 4438x成人网最大色成网站| 亚洲色图欧洲色图婷婷| 国产在线播放一区三区四| 欧美一区二视频| 一区2区3区在线看| 99精品1区2区| 亚洲国产精品传媒在线观看| 麻豆成人av在线| 777色狠狠一区二区三区| 亚洲一区二区三区三| 99精品偷自拍| 国产欧美一区二区三区在线看蜜臀 | 91在线看国产| 中文字幕电影一区| 国产不卡视频一区二区三区| 亚洲一区av在线| youjizz久久| 国产亚洲一区二区三区四区| 美女网站视频久久| 欧美日韩日日夜夜| 亚洲综合一区在线| 欧美亚洲自拍偷拍| 亚洲欧美另类小说视频| 91视频国产资源| 亚洲精品视频一区二区| 色哟哟国产精品| 一区二区三区欧美| 91国偷自产一区二区使用方法| 一区二区三区日韩精品视频| 在线观看视频一区二区|