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

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

?? sp_frm.c

?? GSM中半速率語音編解碼源碼
?? 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精品小说| 国产裸体歌舞团一区二区| 精品久久久三级丝袜| 国产成人在线电影| 亚洲三级在线免费观看| 在线视频亚洲一区| 琪琪一区二区三区| 久久精品亚洲乱码伦伦中文| 高清国产一区二区| 一区二区久久久| 91精品一区二区三区在线观看| 蜜桃av一区二区在线观看 | 日本成人在线看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 精品一区二区三区香蕉蜜桃| 久久你懂得1024| 色综合久久久久网| 免费高清不卡av| 国产精品免费aⅴ片在线观看| 欧美自拍偷拍一区| 久国产精品韩国三级视频| 国产精品初高中害羞小美女文| 欧美日韩一级视频| 国产成人在线视频播放| 亚洲国产精品综合小说图片区| 日韩精品影音先锋| 日本久久精品电影| 国产在线日韩欧美| 亚洲国产综合色| 国产欧美日韩综合| 欧美乱熟臀69xxxxxx| 国产乱人伦精品一区二区在线观看| 亚洲日本在线a| 精品国产伦理网| 在线视频一区二区三| 国产成人免费xxxxxxxx| 午夜成人免费视频| 亚洲天堂av一区| 久久久不卡网国产精品二区| 欧美日韩精品电影| 99精品久久99久久久久| 极品少妇xxxx精品少妇| 午夜国产精品影院在线观看| 国产精品入口麻豆原神| 欧美mv日韩mv国产网站app| 色悠悠久久综合| 成人一级黄色片| 狠狠色狠狠色综合| 日韩成人免费看| 亚洲一线二线三线视频| 中文字幕在线不卡国产视频| 精品女同一区二区| 欧美精品一卡两卡| 欧美午夜寂寞影院| 97精品久久久久中文字幕| 成人丝袜18视频在线观看| 黄色小说综合网站| 激情欧美日韩一区二区| 日本成人中文字幕| 无码av中文一区二区三区桃花岛| 亚洲伦在线观看| 国产精品久久久久久久午夜片 | 香蕉久久一区二区不卡无毒影院| 国产精品黄色在线观看| 国产亚洲欧美色| 亚洲精品在线三区| www国产成人| 日韩一区二区电影网| 4438亚洲最大| 欧美一区午夜视频在线观看| 欧美乱妇一区二区三区不卡视频| 91福利区一区二区三区| 91美女在线看| 色94色欧美sute亚洲线路二| 99久久国产综合精品麻豆| 东方欧美亚洲色图在线| 国产sm精品调教视频网站| 粉嫩蜜臀av国产精品网站| 国产成人av电影在线| 国产成+人+日韩+欧美+亚洲| 国产一区二区三区不卡在线观看| 国产真实乱偷精品视频免| 国产一区二区三区观看| 高清国产一区二区| 91在线播放网址| 在线免费观看不卡av| 欧美色老头old∨ideo| 欧美色图在线观看| 日韩午夜在线观看视频| 精品国产乱码久久久久久夜甘婷婷 | 精品久久久久99| 国产亚洲精品免费| 亚洲欧洲中文日韩久久av乱码| 一区二区三区四区五区视频在线观看| 亚洲黄色录像片| 蜜桃传媒麻豆第一区在线观看| 国产一区亚洲一区| 92精品国产成人观看免费| 欧美色综合影院| 日韩精品一区二区三区四区| 日本一区二区综合亚洲| 有码一区二区三区| 久久国内精品视频| 成人aa视频在线观看| 欧美日韩精品系列| 国产女主播在线一区二区| 综合网在线视频| 秋霞午夜av一区二区三区| 国产91精品在线观看| 91欧美一区二区| 日韩欧美国产综合| 亚洲四区在线观看| 美女在线观看视频一区二区| 国产suv一区二区三区88区| 欧美日韩精品一区二区三区蜜桃 | 在线观看视频一区二区| 日韩三级精品电影久久久| 国产精品免费视频网站| 三级影片在线观看欧美日韩一区二区| 国产伦精一区二区三区| 久久精品男人天堂av| 午夜激情综合网| 成人黄色国产精品网站大全在线免费观看| 在线观看欧美精品| 26uuu色噜噜精品一区二区| 一区二区三区在线免费视频| 国内精品免费**视频| 欧美午夜在线观看| 欧美国产日韩在线观看| 日韩高清在线不卡| 91捆绑美女网站| 精品国产91洋老外米糕| 亚洲国产综合视频在线观看| 成人av影视在线观看| 日韩欧美精品在线视频| 亚洲综合色网站| k8久久久一区二区三区| 精品国产不卡一区二区三区| 亚洲福利视频三区| 91在线无精精品入口| 久久蜜桃av一区精品变态类天堂 | 五月婷婷综合在线| 99久久夜色精品国产网站| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 美女视频第一区二区三区免费观看网站| 91网站黄www| 国产精品区一区二区三区| 精品一区二区三区影院在线午夜| 欧美日韩国产高清一区二区 | 91久久久免费一区二区| 国产精品嫩草99a| 国产成人av电影在线| 精品久久久网站| 精品一区二区免费视频| 91精品国产色综合久久| 午夜精品福利在线| 欧美蜜桃一区二区三区| 亚洲国产精品久久久久秋霞影院 | 91麻豆精品国产无毒不卡在线观看| 日韩码欧中文字| 97国产精品videossex| 亚洲视频图片小说| 一本色道久久综合精品竹菊| 亚洲色图欧美在线| 色播五月激情综合网| 亚洲美女淫视频| 欧美在线看片a免费观看| 亚洲精品日产精品乱码不卡| 一本到三区不卡视频| 亚洲综合色噜噜狠狠| 欧美日韩美少妇| 婷婷六月综合网| 日韩你懂的电影在线观看| 久久精品国产久精国产| 精品av综合导航| 成人免费视频caoporn| 国产精品久久久久久久久图文区 | 成人一区二区三区视频| 最新国产の精品合集bt伙计| 91小视频在线免费看| 一二三区精品福利视频| 制服丝袜亚洲播放| 精品一区二区三区av| 国产精品亲子伦对白| 91在线视频免费观看| 亚洲成人激情自拍| 久久影院电视剧免费观看| 成人午夜大片免费观看| 一区二区三区**美女毛片| 欧美精品xxxxbbbb| 国产一区二区按摩在线观看| 国产精品无码永久免费888| 色哟哟在线观看一区二区三区| 亚洲网友自拍偷拍| 亚洲精品在线观看网站| 99re热视频这里只精品| 午夜一区二区三区在线观看| 欧美电影免费观看高清完整版在线观看|