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

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

?? sp_frm.c

?? GSM半數率源代碼(VSELP) GSM半數率源代碼(VSELP)
?? C
?? 第 1 頁 / 共 5 頁
字號:
/***************************************************************************
 *
 *   File Name:  sp_frm.c
 *
 *   Purpose:  Contains all functions for frame-based processing in the
 *      speech encoder.  The frame-based processing yields the following:
 *      energy in the speech signal, LPC filter coefficients, perceptually-
 *      weighted filter coefficients (for H(z) and C(z)), perceptually-
 *      weighted speech, voicing level, and constrained adaptive-codebook
 *      (long-term predictor) choices.
 *
 *     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.
 *
 *     High pass filtering:
 *       filt4_2nd()
 *         iir_d()
 *
 *     AFLAT, vector quantization of LPC coefficients:
 *       aflat()
 *         aflatNewBarRecursionL()
 *         aflatRecursion()
 *         findBestInQuantList()
 *         getNextVec()
 *         initPBarVBarFullL()
 *         initPBarVBarL()
 *         setupPreQ()
 *         setupQuant()
 *
 *     FLAT:  derivation of the unquantized LPC coefficients:
 *       flat()
 *         cov32()
 *         r0Quant()
 *
 *
 *     Generation of LPC filters for each subframe:
 *       getSfrmLpcTx()
 *         compResidEnergy()
 *
 *     Perceptual weighting:
 *       weightSpeechFrame()
 *
 *     Generation of the noise weighting filter:
 *       getNWCoefs()
 *
 *     Open loop lag search:
 *       openLoopLagSearch()
 *         bestDelta()
 *           maxCCOverGWithSign()
 *         getCCThreshold()
 *           fnExp2()
 *           fnLog2()
 *         pitchLags()
 *           CGInterp()
 *           CGInterpValid()
 *           findPeak()
 *           fnBest_CG()
 *           quantLag()
 *
 **************************************************************************/

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

#include "mathhalf.h"
#include "mathdp31.h"
#include "sp_rom.h"
#include "sp_dec.h"
#include "sp_frm.h"
#include "sp_sfrm.h"
#include "vad.h"
#include "dtx.h"

/*_________________________________________________________________________
 |                                                                         |
 |                            Local Constants                              |
 |_________________________________________________________________________|
*/

#define ASCALE  0x0800
#define ASHIFT 4
#define CG_INT_MACS     6
#define CG_TERMS        (LSMAX - LSMIN + 1)
#define CVSHIFT 2                      /* Number of right shifts to be
                                        * applied to the normalized Phi
                                        * array in cov32, also used in flat
                                        * to shift down normalized F, B, C
                                        * matrices.                        */
#define C_FRAME_LEN     (N_SUB * CG_TERMS)
#define DELTA_LEVELS    16
#define G_FRAME_LEN     (LSMAX + (N_SUB-1) * S_LEN - LSMIN  + 1)
#define HIGH 1
#define INV_OS_FCTR     0x1555         /* 1.0/6.0 */
#define LAG_TABLE_LEN   (1 << L_BITS)
#define LMAX            142
#define LMAX_FR         (LMAX * OS_FCTR)
#define LMIN            21
#define LMIN_FR         (LMIN * OS_FCTR)
#define LOW 0
#define LPC_VQ_SEG 3
#define LSMAX           (LMAX + CG_INT_MACS/2)
#define LSMIN           (LMIN - CG_INT_MACS/2)
#define LSP_MASK  0xffff
#define L_BITS          8
#define L_ROUND (Longword)0x8000       /* Preload accumulator value for
                                        * rounding  */
#define NP_AFLAT     4
#define NUM_CLOSED      3
#define NUM_TRAJ_MAX    2
#define ONE_EIGHTH      0x1000
#define ONE_HALF        0x4000
#define ONE_QUARTER     0x2000
#define PEAK_VICINITY   3
#define PGAIN_CLAMP    0x0021          /* 0.001 */
#define PGAIN_SCALE    0x6000          /* 0.75 */
#define PW_FRAC         0x3333         /* 0.4 */
#define R0BITS 5
#define RSHIFT  2
#define S_SH    6                      /* Shift offset for computing frame
                                        * energy */
#define UV_SCALE0       -0x2976
#define UV_SCALE1       -0x46d3
#define UV_SCALE2       -0x6676
#define W_F_BUFF_LEN  (F_LEN + LSMAX)
#define high(x) (shr(x,8) & 0x00ff)
#define low(x) x & 0x00ff              /* This macro will return the low
                                        * byte of a word */
#define odd(x) (x & 0x0001)            /* This macro will determine if an
                                        * integer is odd */

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

Shortword pswAnalysisState[NP];

Shortword pswWStateNum[NP],
       pswWStateDenom[NP];

/*_________________________________________________________________________
 |                                                                         |
 |                         Other External Variables                        |
 |_________________________________________________________________________|
*/

static ShortwordRom *psrTable;         /* points to correct table of
                                        * vectors */
int iLimit;                            /* accessible to all in this file
                                        * and to lpcCorrQntz() in dtx.c */
static int iLow;                       /* the low element in this segment */
static int iThree;                     /* boolean, is this a three element
                                        * vector */
static int iWordHalfPtr;               /* points to the next byte */
static int iWordPtr;                   /* points to the next word to be
                                        * read */

extern Shortword pswCNVSCode1[],       /* comfort noise parameters */
                 pswCNVSCode2[],
                 pswCNGsp0Code[],
                 pswCNLpc[],
                 swCNR0;

/***************************************************************************
 *
 *    FUNCTION NAME: aflat
 *
 *    PURPOSE:  Given a vector of high-pass filtered input speech samples
 *              (A_LEN samples), function aflat computes the NP unquantized
 *              reflection coefficients using the FLAT algorithm, searches
 *              the three segment Rc-VQ based on the AFLAT recursion, and
 *              outputs a quantized set of NP reflection coefficients, along
 *              with the three indices specifying the selected vectors
 *              from the Rc-VQ. The index of the quantized frame energy R0
 *              is also output.
 *
 *
 *    INPUT:
 *
 *        pswSpeechToLpc[0:A_LEN-1]
 *                     A vector of high-pass filtered input speech, from
 *                     which the unquantized reflection coefficients and
 *                     the index of the quantized frame energy are
 *                     computed.
 *
 *    OUTPUTS:
 *
 *        piR0Index[0:0]
 *                     An index into a 5 bit table of quantized frame
 *                     energies.
 *
 *        pswFinalRc[0:NP-1]
 *                     A quantized set of NP reflection coefficients.
 *
 *        piVQCodewds[0:2]
 *                     An array containing the indices of the 3 reflection
 *                     coefficient vectors selected from the three segment
 *                     Rc-VQ.
 *
 *        swPtch
 *                     Flag to indicate a periodic signal component
 *
 *        pswVadFlag
 *                     Voice activity decision flag
 *                      = 1: voice activity
 *                      = 0: no voice activity
 *
 *        pswSP
 *                     Speech flag
 *                      = 1: encoder generates speech frames
 *                      = 0: encoder generate SID frames
 *
 *
 *    RETURN:
 *        None.
 *
 *    REFERENCE:  Sub-clauses 4.1.3, 4.1.4, and 4.1.4.1
 *        of GSM Recommendation 06.20
 *
 *    KEYWORDS: AFLAT,aflat,flat,vectorquantization, reflectioncoefficients
 *
 *************************************************************************/

  void   aflat(Shortword pswSpeechToLPC[],
                      int piR0Index[],
                      Shortword pswFinalRc[],
                      int piVQCodewds[],
                      Shortword swPtch,
                      Shortword *pswVadFlag,
                      Shortword *pswSP)
{

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

  Shortword pswPOldSpace[NP_AFLAT],
         pswPNewSpace[NP_AFLAT],
         pswVOldSpace[2 * NP_AFLAT - 1],
         pswVNewSpace[2 * NP_AFLAT - 1],
        *ppswPAddrs[2],
        *ppswVAddrs[2],
        *pswVBar,
         pswPBar[NP_AFLAT],
         pswVBarSpace[2 * NP_AFLAT - 1],
         pswFlatsRc[NP],               /* Unquantized Rc's computed by FLAT */
         pswRc[NP + 1];                /* Temp list for the converted RC's */
  Longword pL_CorrelSeq[NP + 1],
        *pL_VBarFull,
         pL_PBarFull[NP],
         pL_VBarFullSpace[2 * NP - 1];

  int    i,
         iVec,
         iSeg,
         iCnt;                         /* Loop counter */
  struct QuantList quantList,          /* A list of vectors */
         bestPql[4];                   /* The four best vectors from the
                                        * PreQ */
  struct QuantList bestQl[LPC_VQ_SEG + 1];      /* Best vectors for each of
                                                 * the three segments */
  Shortword swVadScalAuto;
  Shortword pswVadRc[4];
  Longword pL_VadAcf[9];

  Longword L_R0;                       /* Normalized R0 (use swRShifts to 
                                        * unnormalize). This is done prior
                                        * to r0quant(). After this, its is
                                        * a unnormalized number */

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

  /* Setup pointers temporary space */
  /*--------------------------------*/

  pswVBar = pswVBarSpace + NP_AFLAT - 1;
  pL_VBarFull = pL_VBarFullSpace + NP - 1;
  ppswPAddrs[0] = pswPOldSpace;
  ppswPAddrs[1] = pswPNewSpace;
  ppswVAddrs[0] = pswVOldSpace + NP_AFLAT - 1;
  ppswVAddrs[1] = pswVNewSpace + NP_AFLAT - 1;

  /* Given the input speech, compute the optimal reflection coefficients */
  /* using the FLAT algorithm.                                           */
  /*---------------------------------------------------------------------*/

  L_R0 = flat(pswSpeechToLPC, pswFlatsRc, piR0Index, pL_VadAcf, 
              &swVadScalAuto);

  /* Get unquantized reflection coefficients for VAD */      /* DTX mode */
  /* algorithm                                       */      /* DTX mode */
  /* ----------------------------------------------- */      /* DTX mode */

  for (i = 0; i < 4; i++)                                    /* DTX mode */
    pswVadRc[i] = pswFlatsRc[i];                             /* DTX mode */


  /* convert reflection coefficients to correlation */       /* DTX mode */
  /* sequence                                       */       /* DTX mode */
  /* ---------------------------------------------- */       /* DTX mode */

  rcToCorrDpL(ASHIFT, ASCALE, pswFlatsRc, pL_CorrelSeq);     /* DTX mode */


  /* Make the voice activity detection. Only swVadFlag is */ /* DTX mode */
  /*  modified.                                           */ /* DTX mode */
  /* ---------------------------------------------------- */ /* DTX mode */

  vad_algorithm(pL_VadAcf, swVadScalAuto, pswVadRc, swPtch,  /* DTX mode */
                pswVadFlag);


  /* if DTX mode off, then always voice activity */          /* DTX mode */
  /* ------------------------------------------- */          /* DTX mode */
  if (!giDTXon) *pswVadFlag = 1;                             /* DTX mode */


  /* determination of comfort noise parameters */            /* DTX mode */
  /* ----------------------------------------- */            /* DTX mode */

  *pswSP = swComfortNoise(*pswVadFlag,                       /* DTX mode */
                          L_R0,                              /* DTX mode */
                          pL_CorrelSeq);                     /* DTX mode */

  if (*pswSP == 0)                                           /* DTX mode */
  {   /* SID frame generation */                             /* DTX mode */

    /* use unquantized reflection coefficients in the */     /* DTX mode */
    /* encoder, when SID frames are generated         */     /* DTX mode */
    /* ---------------------------------------------- */     /* DTX mode */

    for (i = 0; i < NP; i++)                                 /* DTX mode */
      pswFinalRc[i] = pswFlatsRc[i];                         /* DTX mode */

  }                                                          /* DTX mode */
  else                                                       /* DTX mode */
  { /* speech frame generation */

    /* Set up pL_PBarFull and pL_VBarFull initial conditions, using the   */
    /* autocorrelation sequence derived from the optimal reflection       */
    /* coefficients computed by FLAT. The initial conditions are shifted  */
    /* right by RSHIFT bits. These initial conditions, stored as          */
    /* Longwords, are used to initialize PBar and VBar arrays for the     */
    /* next VQ segment.                                                   */
    /*--------------------------------------------------------------------*/

    initPBarFullVBarFullL(pL_CorrelSeq, pL_PBarFull, pL_VBarFull);

    /* Set up initial PBar and VBar initial conditions, using pL_PBarFull */
    /* and pL_VBarFull arrays initialized above. These are the initial    */
    /* PBar and VBar conditions to be used by the AFLAT recursion at the  */
    /* 1-st Rc-VQ segment.                                                */
    /*--------------------------------------------------------------------*/

    initPBarVBarL(pL_PBarFull, pswPBar, pswVBar);

    for (iSeg = 1; iSeg <= LPC_VQ_SEG; iSeg++)
    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日产精品久久久久久久性色| 国产精品国产三级国产普通话蜜臀 | 国产精品午夜电影| 欧美日韩精品三区| 色中色一区二区| 成人免费观看男女羞羞视频| 秋霞电影网一区二区| 午夜精品免费在线观看| 一区二区免费看| 亚洲女厕所小便bbb| 一区二区三区在线免费| 亚洲综合一区二区精品导航| 亚洲黄色免费网站| 亚洲va在线va天堂| 奇米影视7777精品一区二区| 国产一区视频在线看| 国产精品综合av一区二区国产馆| 经典三级视频一区| 大桥未久av一区二区三区中文| 懂色av一区二区在线播放| 不卡在线视频中文字幕| 91极品视觉盛宴| 日韩一二三区视频| 国产午夜一区二区三区| 中文字幕一区二区三| 一区二区三区在线看| 久色婷婷小香蕉久久| 国产成人免费av在线| 色欧美日韩亚洲| 欧美一区二区精品在线| 国产亚洲精品免费| 一区二区三区四区高清精品免费观看| 天天综合天天做天天综合| 精品一区二区三区香蕉蜜桃| 粉嫩aⅴ一区二区三区四区| 在线观看av不卡| 欧美精品一区二区三区久久久| 亚洲国产精品ⅴa在线观看| 亚洲综合色网站| 狠狠色狠狠色综合| 色婷婷精品久久二区二区蜜臂av | 国产片一区二区三区| 日产欧产美韩系列久久99| 成人在线视频一区二区| 欧美日韩中文精品| 欧美激情一区二区三区| 亚洲va在线va天堂| av资源站一区| 欧美电视剧在线观看完整版| 亚洲人123区| 经典三级一区二区| 欧美在线不卡视频| 久久久精品国产免大香伊| 亚洲午夜在线视频| 成人app软件下载大全免费| 日韩女同互慰一区二区| 亚洲精品欧美在线| 成人久久视频在线观看| 日韩欧美一二三区| 亚洲 欧美综合在线网络| 99麻豆久久久国产精品免费| 精品第一国产综合精品aⅴ| 亚洲影视在线播放| 99精品视频一区| 亚洲国产精品成人综合色在线婷婷| 首页国产欧美久久| 欧美三级电影精品| 亚洲激情五月婷婷| av一区二区久久| 国产精品国产三级国产普通话蜜臀| 国内成人自拍视频| 精品国产91乱码一区二区三区 | 亚洲综合一二三区| 91在线观看美女| 亚洲视频在线观看一区| 国产精品一二三在| 久久亚洲一区二区三区四区| 毛片基地黄久久久久久天堂| 欧美一级艳片视频免费观看| 日本成人在线一区| 91精品国产欧美日韩| 日韩精品一二三| 日韩一级视频免费观看在线| 奇米影视一区二区三区| 欧美不卡一区二区| 国产老肥熟一区二区三区| 久久午夜羞羞影院免费观看| 国模娜娜一区二区三区| 久久九九国产精品| eeuss鲁片一区二区三区在线观看| 国产欧美日韩三级| 99久久免费精品高清特色大片| 亚洲精品少妇30p| 欧美久久久一区| 国内精品免费在线观看| 国产精品久久久久久久久晋中 | 丝袜诱惑制服诱惑色一区在线观看 | 91香蕉视频在线| 亚洲男人电影天堂| 在线不卡中文字幕| 国产在线视频一区二区三区| 欧美激情一区二区三区蜜桃视频 | 欧美撒尿777hd撒尿| 午夜私人影院久久久久| 日韩欧美一区二区不卡| 国产成人综合在线| 亚洲欧美二区三区| 欧美一三区三区四区免费在线看 | 中文字幕一区二区日韩精品绯色| 一道本成人在线| 日韩av一级片| 国产精品久久毛片a| 欧美日韩久久一区| 国产一区二三区好的| 亚洲欧洲日本在线| 91精品国产高清一区二区三区蜜臀| 国产jizzjizz一区二区| 亚洲妇熟xx妇色黄| 中文字幕精品—区二区四季| 欧美丝袜自拍制服另类| 国产在线国偷精品免费看| 国产精品国模大尺度视频| 日韩一区二区三区在线观看| 99久久精品免费看| 久久精品国产99国产| 一区二区三区四区中文字幕| 国产色爱av资源综合区| 欧美日韩激情一区二区| 成人av电影免费在线播放| 日韩**一区毛片| 亚洲国产视频在线| 中文字幕中文在线不卡住| 91精品国产高清一区二区三区蜜臀| 成人黄色大片在线观看| 久久99精品国产麻豆婷婷| 亚洲精品美腿丝袜| 国产精品剧情在线亚洲| 国产婷婷一区二区| 日韩免费成人网| 欧美日韩国产高清一区| 91一区二区三区在线播放| 国产69精品久久99不卡| 九九九精品视频| 日本在线播放一区二区三区| 亚洲va韩国va欧美va精品 | 欧美色老头old∨ideo| 波多野结衣91| 成人avav影音| 成人av电影在线网| av电影一区二区| 成人国产精品免费观看| 成人午夜私人影院| 成人高清免费观看| 成人午夜精品在线| 国产.欧美.日韩| 国产不卡视频一区二区三区| 欧美性欧美巨大黑白大战| 91天堂素人约啪| 91亚洲精品久久久蜜桃网站| 99精品久久99久久久久| 99热这里都是精品| 日本乱码高清不卡字幕| 在线视频一区二区三| 欧美日韩中字一区| 欧美日韩视频第一区| 欧美理论片在线| 欧美精品三级在线观看| 欧美电影一区二区| 精品国产污污免费网站入口| 久久久久高清精品| 国产精品女人毛片| 亚洲男人天堂av| 首页欧美精品中文字幕| 韩国女主播一区二区三区| 国模一区二区三区白浆| 粉嫩蜜臀av国产精品网站| av一二三不卡影片| 在线观看日韩电影| 91精品综合久久久久久| 久久嫩草精品久久久久| 国产精品乱人伦| 亚洲综合在线视频| 麻豆国产91在线播放| 国产超碰在线一区| 欧美特级限制片免费在线观看| 欧美一区三区四区| 国产三级精品三级| 一区二区欧美精品| 国产做a爰片久久毛片| 99精品一区二区| 91麻豆精品国产91久久久更新时间| 久久精品视频网| 亚洲综合成人网| 国产一区二区在线免费观看| 色综合亚洲欧洲| 精品国产凹凸成av人导航| 一区二区三区在线视频免费| 精一区二区三区| 欧美亚洲日本一区| 国产日韩av一区二区|