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

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

?? sp_dec.c

?? GSM半數率源代碼(VSELP) GSM半數率源代碼(VSELP)
?? 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一区二区三区免费野_久草精品视频
成人一区二区三区中文字幕| 欧美久久一二区| 在线免费观看日韩欧美| 精品国产一区二区三区av性色| 中文字幕一区二区三区色视频| 麻豆国产91在线播放| 欧美最猛性xxxxx直播| 国产欧美日韩亚州综合| 日韩av中文字幕一区二区三区| 成人三级伦理片| 久久伊人中文字幕| 日本美女视频一区二区| 欧美猛男超大videosgay| 亚洲欧美日韩系列| av在线免费不卡| 国产精品乱子久久久久| 国产一区二区三区四区五区美女| 欧美一区二区久久| 日韩高清在线不卡| 制服丝袜日韩国产| 五月天激情小说综合| 欧美肥妇bbw| 日韩国产欧美三级| 亚洲欧美另类在线| 成人高清免费在线播放| 国产欧美一区二区三区在线老狼| 国产精品主播直播| 国产天堂亚洲国产碰碰| 成人免费看的视频| 国产精品对白交换视频| 99久久精品情趣| ...av二区三区久久精品| 一本一道久久a久久精品综合蜜臀| 亚洲人123区| 欧美视频一区在线| 日本aⅴ精品一区二区三区| 日韩一区二区三区在线| 精品一区二区av| 久久蜜桃一区二区| www.欧美色图| 亚洲午夜一区二区三区| 欧美日韩一二三| 久久99国产乱子伦精品免费| 精品美女一区二区三区| 成人免费视频视频在线观看免费| 亚洲图片激情小说| 欧美日本韩国一区二区三区视频| 麻豆免费看一区二区三区| 国产人伦精品一区二区| 色综合咪咪久久| 日韩不卡一区二区三区 | 极品少妇xxxx精品少妇偷拍| 久久久五月婷婷| 91捆绑美女网站| 午夜欧美大尺度福利影院在线看| 欧美一区二区免费视频| 从欧美一区二区三区| 亚洲主播在线观看| 日韩精品中文字幕在线一区| 成人av综合在线| 午夜久久久久久久久| 久久精品一区二区三区不卡牛牛| 99国产精品久久久久| 日本在线不卡一区| 国产精品福利一区| 日韩视频一区二区在线观看| av动漫一区二区| 日本va欧美va精品发布| 亚洲视频免费看| 日韩欧美在线综合网| 91亚洲永久精品| 激情六月婷婷久久| 亚洲成av人片在线| 国产精品久久久久久久久晋中 | 最近日韩中文字幕| 777午夜精品免费视频| 福利一区福利二区| 色婷婷久久一区二区三区麻豆| 日韩精品五月天| 国产精品久久久久久久第一福利| 91精品国产综合久久久久久| 91丨porny丨国产| 国产福利精品导航| 免费成人美女在线观看.| 亚洲资源中文字幕| 国产精品久久影院| 久久久久久一级片| 日韩久久免费av| 欧美日韩电影一区| 在线视频一区二区三| av在线不卡电影| 国产福利视频一区二区三区| 久久丁香综合五月国产三级网站| 亚洲一区二区不卡免费| 亚洲美女免费视频| 欧美国产成人在线| 国产亚洲短视频| 久久夜色精品一区| 精品卡一卡二卡三卡四在线| 欧美日韩不卡在线| 欧美日韩日本视频| 精品1区2区3区| 欧美亚洲综合另类| 欧美日韩一区国产| 337p亚洲精品色噜噜| 欧美高清视频www夜色资源网| 精品视频在线免费看| 欧美日韩精品一区二区在线播放| 色域天天综合网| 在线一区二区三区四区| 色88888久久久久久影院野外| 99久久精品费精品国产一区二区| 成人免费视频免费观看| 成人av在线看| 99久久国产免费看| 日本韩国一区二区三区视频| 91麻豆免费观看| 精品视频一区二区不卡| 6080日韩午夜伦伦午夜伦| 日韩免费看网站| 国产性做久久久久久| 欧美人妇做爰xxxⅹ性高电影| 极品美女销魂一区二区三区| 成人av动漫网站| 天天av天天翘天天综合网色鬼国产 | 91视频xxxx| 国产 日韩 欧美大片| 91在线porny国产在线看| 日本精品视频一区二区| 欧美日韩国产乱码电影| 91精品婷婷国产综合久久竹菊| 欧美一区二区免费视频| 日本一区二区三区免费乱视频| 中文字幕一区二区三区av| 亚洲午夜久久久久久久久电影网| 婷婷久久综合九色综合伊人色| 久久精品国产秦先生| 国产91在线观看| 在线视频综合导航| 欧美va亚洲va| 亚洲精品乱码久久久久久久久 | 精品国产电影一区二区| 国产精品视频一区二区三区不卡| 亚洲婷婷国产精品电影人久久| 亚洲专区一二三| 国产精品99久久不卡二区| 欧美亚洲一区二区在线| 欧美sm美女调教| 亚洲精品欧美二区三区中文字幕| 麻豆精品久久精品色综合| 99久久99久久久精品齐齐| 51久久夜色精品国产麻豆| 亚洲国产电影在线观看| 水野朝阳av一区二区三区| 成人一级视频在线观看| 69堂亚洲精品首页| 中文字幕日本乱码精品影院| 久久99日本精品| 精品视频一区二区三区免费| 国产日韩欧美综合在线| 日韩中文字幕亚洲一区二区va在线 | 欧美一区在线视频| 亚洲视频 欧洲视频| 国内成人免费视频| 91麻豆精品91久久久久久清纯| 亚洲欧洲三级电影| 国产乱码字幕精品高清av| 91精品国产综合久久精品性色| 一区在线中文字幕| 国产成人99久久亚洲综合精品| 91精品欧美久久久久久动漫| 亚洲久草在线视频| 成人性生交大片免费看在线播放 | 一区二区三区中文在线| 国产成人啪午夜精品网站男同| 欧美一区二区三区思思人| 国产精品不卡视频| 顶级嫩模精品视频在线看| 欧美tickling网站挠脚心| 日本va欧美va瓶| 91麻豆精品国产无毒不卡在线观看| 亚洲精品欧美激情| 91老师片黄在线观看| 最新国产成人在线观看| 成年人国产精品| 国产精品系列在线| 成人永久免费视频| 国产精品色噜噜| 高清国产一区二区| 国产精品久久午夜| 久久久亚洲精华液精华液精华液 | 91视频com| 亚洲美女少妇撒尿| 日本伦理一区二区| 亚洲自拍偷拍综合| 制服视频三区第一页精品| 日本亚洲三级在线| 精品国产电影一区二区| 国产精品自拍网站| 中文字幕亚洲电影|