亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美色偷偷大香| 99久久伊人久久99| 日韩欧美美女一区二区三区| 日本成人在线视频网站| 日韩区在线观看| 国产成人免费在线观看不卡| 亚洲女爱视频在线| 欧美日韩国产乱码电影| 黄色小说综合网站| 国产精品不卡在线观看| 欧美日韩国产a| 国产一区二区电影| 中文字幕亚洲在| 精品少妇一区二区三区在线播放 | 日韩精品91亚洲二区在线观看| 欧美精品 日韩| 国产盗摄视频一区二区三区| 亚洲美女免费视频| 欧美一区2区视频在线观看| 丁香啪啪综合成人亚洲小说 | 在线不卡的av| 国产成人免费视| 亚洲午夜视频在线观看| 欧美变态tickling挠脚心| 成人18视频在线播放| 日韩不卡一区二区三区| 国产精品亲子伦对白| 欧美一区二区三区视频免费播放| 成人污污视频在线观看| 亚欧色一区w666天堂| 国产精品嫩草影院av蜜臀| 欧美日韩精品一区视频| 成人自拍视频在线观看| 奇米亚洲午夜久久精品| 亚洲视频狠狠干| 精品美女一区二区三区| 欧美天堂一区二区三区| 成人在线视频一区二区| 免费观看91视频大全| 尤物在线观看一区| 久久久久97国产精华液好用吗| 欧美日韩国产综合久久| 成人aaaa免费全部观看| 黄色日韩网站视频| 午夜欧美电影在线观看| 中文字幕乱码久久午夜不卡| 欧美大片顶级少妇| 欧美三级欧美一级| 91一区二区在线| 国产精品18久久久久| 青青国产91久久久久久| 亚洲va欧美va人人爽| 亚洲激情六月丁香| 国产精品不卡在线| 亚洲国产精品黑人久久久| 精品处破学生在线二十三| 欧美理论片在线| 欧美性猛交一区二区三区精品| 波多野结衣91| 国产精品一区专区| 色综合天天综合网国产成人综合天| 国产精品91一区二区| 精品一区二区三区免费毛片爱| 日韩精品1区2区3区| 亚洲一级不卡视频| 亚洲精品日韩综合观看成人91| 日本一区二区三区dvd视频在线| 精品少妇一区二区三区日产乱码 | wwwwww.欧美系列| 欧美电影免费观看高清完整版在线| 欧美日产国产精品| 欧美色图12p| 欧美剧情电影在线观看完整版免费励志电影 | 亚洲欧美电影一区二区| 国产精品女主播在线观看| 久久精品欧美日韩| 国产精品视频九色porn| 中文字幕av不卡| 亚洲国产成人午夜在线一区| 国产欧美1区2区3区| 久久精品人人做人人爽97| 欧美精品一区二区三区在线播放| 欧美大片一区二区三区| 国产日韩精品一区二区浪潮av| 精品国产乱码久久久久久图片| 欧美大片日本大片免费观看| 久久午夜免费电影| 国产精品欧美一级免费| 亚洲蜜臀av乱码久久精品| 亚洲国产日日夜夜| 蜜桃91丨九色丨蝌蚪91桃色| 国产精品77777| 91丨porny丨户外露出| 欧美日韩精品是欧美日韩精品| 91精品国产综合久久蜜臀| 日韩免费视频一区| 日本一区二区三区四区| 亚洲激情自拍视频| 免费xxxx性欧美18vr| 成人性生交大片免费看视频在线 | 久久国内精品自在自线400部| 国产综合一区二区| 99热这里都是精品| 欧美剧在线免费观看网站| 26uuu亚洲| 亚洲女同一区二区| 老司机午夜精品| 成人精品gif动图一区| 欧美视频一区二区三区在线观看| 91精品国产91久久久久久一区二区 | 日精品一区二区| 国产精品一区二区久激情瑜伽| 亚洲图片欧美色图| 美洲天堂一区二卡三卡四卡视频| 国产麻豆精品视频| 91福利在线播放| 欧美不卡一区二区三区四区| 成人欧美一区二区三区1314| 亚洲成人午夜影院| 国产一区二区三区香蕉| 在线观看一区二区视频| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲精品一卡二卡| 国产美女精品人人做人人爽| 在线亚洲精品福利网址导航| 久久亚洲二区三区| 综合分类小说区另类春色亚洲小说欧美 | 国产亚洲制服色| 亚洲国产成人精品视频| 成人妖精视频yjsp地址| 制服.丝袜.亚洲.另类.中文 | 欧洲色大大久久| 国产日韩一级二级三级| 性做久久久久久| 99精品视频一区二区| 精品国产一区二区精华| 日韩影院免费视频| 97久久精品人人做人人爽| 亚洲精品一区二区三区在线观看| 夜夜操天天操亚洲| 福利电影一区二区三区| 国产精品第四页| 精品一区二区久久久| 欧美日韩电影在线播放| 亚洲精品日韩综合观看成人91| 高清国产一区二区| 亚洲精品在线观看视频| 日本中文字幕不卡| 在线观看日韩电影| 亚洲精品一二三区| 91免费视频网| 国产精品不卡在线| 国产91综合一区在线观看| 久久久影院官网| 国产真实乱子伦精品视频| 日韩欧美一级精品久久| 午夜私人影院久久久久| 欧美亚洲一区二区三区四区| 亚洲同性同志一二三专区| 成人午夜电影久久影院| 国产午夜精品理论片a级大结局 | 国产精品一区二区视频| 欧美mv日韩mv| 黄页视频在线91| 精品久久国产字幕高潮| 另类成人小视频在线| 精品久久久久av影院| 久久97超碰国产精品超碰| 日韩免费看的电影| 精品在线亚洲视频| 久久奇米777| 成人av集中营| 亚洲黄色尤物视频| 欧美老肥妇做.爰bbww视频| 视频一区免费在线观看| 日韩免费看的电影| 国内精品伊人久久久久av影院 | 国产成人在线色| 欧美国产欧美综合| 99v久久综合狠狠综合久久| 亚洲欧美日韩系列| 欧美三级欧美一级| 老司机免费视频一区二区三区| 精品国产伦一区二区三区免费| 国产精品亚洲视频| 日韩精品乱码免费| 久久综合久久久久88| 国产91色综合久久免费分享| 亚洲天堂2016| 91精品视频网| 国产成人av电影| 一区二区三区在线看| 在线播放日韩导航| 国产一区二区精品久久99| 亚洲日本电影在线| 日韩欧美一区二区免费| 成人app在线观看| 日韩精品乱码免费| 欧美国产丝袜视频| 欧美日韩另类一区|