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

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

?? pitch.c

?? ITU-T G.729B標準源代碼編碼端
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
   ITU-T G.729 Speech Coder ANSI-C Source Code
   Version 3.3    Last modified: December 26, 1995

   Copyright (c) 1996,
   AT&T, France Telecom, NTT, Universite de Sherbrooke, Lucent Technologies
   All rights reserved.
*/

/*---------------------------------------------------------------------------*
 * procedure Pitch_ol                                                        *
 * ~~~~~~~~~~~~~~~~~~                                                        *
 * Compute the open loop pitch lag.                                          *
 *                                                                           *
 *---------------------------------------------------------------------------*/

#include "typedef.h"
#include "basic_op.h"
#include "oper_32b.h"
#include "ld8k.h"
#include "tab_ld8k.h"

/* local function */

static Word16 Lag_max(        /* output: lag found                           */
  Word16 signal[],     /* input : signal used to compute the open loop pitch */
  Word16 L_frame,      /* input : length of frame to compute pitch           */
  Word16 lag_max,      /* input : maximum lag                                */
  Word16 lag_min,      /* input : minimum lag                                */
  Word16 *cor_max);    /* output: normalized correlation of selected lag     */


Word16 Pitch_ol(       /* output: open loop pitch lag                        */
   Word16 signal[],    /* input : signal used to compute the open loop pitch */
                       /*     signal[-pit_max] to signal[-1] should be known */
   Word16   pit_min,   /* input : minimum pitch lag                          */
   Word16   pit_max,   /* input : maximum pitch lag                          */
   Word16   L_frame    /* input : length of frame to compute pitch           */
)
{
  Word16  i, j;
  Word16  max1, max2, max3;
  Word16  p_max1, p_max2, p_max3;
  Word32  t0, L_temp;

  /* Scaled signal */

  Word16 scaled_signal[L_FRAME+PIT_MAX];
  Word16 *scal_sig;

  scal_sig = &scaled_signal[pit_max];

  /*--------------------------------------------------------*
   *  Verification for risk of overflow.                    *
   *--------------------------------------------------------*/

   Overflow = 0;
   t0 = 0;

   for(i= -pit_max; i< L_frame; i++)
     t0 = L_mac(t0, signal[i], signal[i]);

  /*--------------------------------------------------------*
   * Scaling of input signal.                               *
   *                                                        *
   *   if Overflow        -> scal_sig[i] = signal[i]>>3     *
   *   else if t0 < 1^20  -> scal_sig[i] = signal[i]<<3     *
   *   else               -> scal_sig[i] = signal[i]        *
   *--------------------------------------------------------*/

   if(Overflow == 1)
   {
     for(i=-pit_max; i<L_frame; i++)
       scal_sig[i] = shr(signal[i], 3);
   }
   else {
     L_temp = L_sub(t0, (Word32)1048576L);
     if ( L_temp < (Word32)0 )  /* if (t0 < 2^20) */
     {
        for(i=-pit_max; i<L_frame; i++)
          scal_sig[i] = shl(signal[i], 3);
     }
     else
     {
       for(i=-pit_max; i<L_frame; i++)
         scal_sig[i] = signal[i];
     }
   }
  /*--------------------------------------------------------------------*
   *  The pitch lag search is divided in three sections.                *
   *  Each section cannot have a pitch multiple.                        *
   *  We find a maximum for each section.                               *
   *  We compare the maximum of each section by favoring small lag.     *
   *                                                                    *
   *  First section:  lag delay = pit_max     downto 4*pit_min          *
   *  Second section: lag delay = 4*pit_min-1 downto 2*pit_min          *
   *  Third section:  lag delay = 2*pit_min-1 downto pit_min            *
   *--------------------------------------------------------------------*/


   j = shl(pit_min, 2);
   p_max1 = Lag_max(scal_sig, L_frame, pit_max, j, &max1);

   i = sub(j, 1); j = shl(pit_min, 1);
   p_max2 = Lag_max(scal_sig, L_frame, i, j, &max2);

   i = sub(j, 1);
   p_max3 = Lag_max(scal_sig, L_frame, i, pit_min , &max3);

  /*--------------------------------------------------------------------*
   * Compare the 3 sections maximum, and favor small lag.               *
   *--------------------------------------------------------------------*/

  if( sub(mult(max1, THRESHPIT), max2)  < 0)
  {
    max1 = max2;
    p_max1 = p_max2;
  }

  if( sub(mult(max1, THRESHPIT), max3)  < 0)
  {
    p_max1 = p_max3;
  }


  return (p_max1);
}

/*---------------------------------------------------------------------------*
 * procedure Lag_max                                                         *
 * ~~~~~~~~~~~~~~~~~                                                         *
 * Find the lag that has maximum correlation with scal_sig[]                 *
 *                                                                           *
 *---------------------------------------------------------------------------*
 * arguments:                                                                *
 *                                                                           *
 *   signal[]   :Signal used to compute the open loop pitch.                 *
 *   L_frame    :Length of frame to compute pitch.                           *
 *   lag_max    :Maximum lag                                                 *
 *   lag_min    :Minimum lag                                                 *
 *   *cor_max   ;Maximum of normalized correlation of lag found.             *
 *                                                                           *
 *   Return lag found.                                                       *
 *--------------------------------------------------------------------------*/

static Word16 Lag_max( /* output: lag found                                  */
  Word16 signal[],     /* input : signal used to compute the open loop pitch */
  Word16 L_frame,      /* input : length of frame to compute pitch           */
  Word16 lag_max,      /* input : maximum lag                                */
  Word16 lag_min,      /* input : minimum lag                                */
  Word16 *cor_max)     /* output: normalized correlation of selected lag     */
{
  Word16  i, j;
  Word16  *p, *p1;
  Word32  max, t0, L_temp;
  Word16  max_h, max_l, ener_h, ener_l;
  Word16  p_max;

  max = MIN_32;

   /* initialization used only to suppress Microsoft Visual C++  warnings */

  p_max = lag_max;

  for (i = lag_max; i >= lag_min; i--)
  {
    p  = signal;
    p1 = &signal[-i];
    t0 = 0;

    for (j=0; j<L_frame; j++, p++, p1++)
      t0 = L_mac(t0, *p, *p1);

    L_temp = L_sub(t0,max);
    if (L_temp >= 0L)
    {
      max    = t0;
      p_max = i;
    }
  }

  /* compute energy */

  t0 = 0;
  p = &signal[-p_max];
  for(i=0; i<L_frame; i++, p++)
    t0 = L_mac(t0, *p, *p);

  /* 1/sqrt(energy),    result in Q30 */

  t0 = Inv_sqrt(t0);

  /* max = max/sqrt(energy)                   */
  /* This result will always be on 16 bits !! */

  L_Extract(max, &max_h, &max_l);
  L_Extract(t0, &ener_h, &ener_l);

  t0 = Mpy_32(max_h, max_l, ener_h, ener_l);
  *cor_max = extract_l(t0);

  return(p_max);
}

/*--------------------------------------------------------------------------*
 * Function  Pitch_fr3()                                                    *
 * ~~~~~~~~~~~~~~~~~~~~~                                                    *
 * Find the pitch period with 1/3 subsample resolution.                     *
 *--------------------------------------------------------------------------*/

        /* Local functions */

static void Norm_Corr(Word16 exc[], Word16 xn[], Word16 h[], Word16 L_subfr,
                      Word16 t_min, Word16 t_max, Word16 corr_norm[]);


Word16 Pitch_fr3(    /* (o)     : pitch period.                          */
  Word16 exc[],      /* (i)     : excitation buffer                      */
  Word16 xn[],       /* (i)     : target vector                          */
  Word16 h[],        /* (i) Q12 : impulse response of filters.           */
  Word16 L_subfr,    /* (i)     : Length of subframe                     */
  Word16 t0_min,     /* (i)     : minimum value in the searched range.   */
  Word16 t0_max,     /* (i)     : maximum value in the searched range.   */
  Word16 i_subfr,    /* (i)     : indicator for first subframe.          */
  Word16 *pit_frac   /* (o)     : chosen fraction.                       */
)
{
  Word16 i;
  Word16 t_min, t_max;
  Word16 max, lag, frac;
  Word16 *corr;
  Word16 corr_int;
  Word16 corr_v[40];           /* Total length = t0_max-t0_min+1+2*L_INTER */


  /* Find interval to compute normalized correlation */

  t_min = sub(t0_min, L_INTER4);
  t_max = add(t0_max, L_INTER4);

  corr = &corr_v[-t_min];

  /* Compute normalized correlation between target and filtered excitation */

  Norm_Corr(exc, xn, h, L_subfr, t_min, t_max, corr);

  /* Find integer pitch */

  max = corr[t0_min];
  lag = t0_min;

  for(i= t0_min+(Word16)1; i<=t0_max; i++)
  {
    if( sub(corr[i], max) >= 0)
    {
      max = corr[i];
      lag = i;
    }
  }

  /* If first subframe and lag > 84 do not search fractional pitch */

  if( (i_subfr == 0) && (sub(lag, 84) > 0) )
  {
    *pit_frac = 0;
    return(lag);
  }

  /* Test the fractions around T0 and choose the one which maximizes   */
  /* the interpolated normalized correlation.                          */

  max  = Interpol_3(&corr[lag], -2);
  frac = -2;

  for (i = -1; i <= 2; i++)
  {
    corr_int = Interpol_3(&corr[lag], i);
    if (sub(corr_int, max) > 0)
    {
      max = corr_int;
      frac = i;
    }
  }

  /* limit the fraction value between -1 and 1 */

  if (sub(frac, -2) == 0)
  {
    frac = 1;
    lag = sub(lag, 1);
  }
  if (sub(frac, 2) == 0)
  {
    frac = -1;
    lag = add(lag, 1);
  }

  *pit_frac = frac;


  return(lag);
}

/*---------------------------------------------------------------------------*
 * Function Norm_Corr()                                                      *
 * ~~~~~~~~~~~~~~~~~~~~                                                      *
 * Find the normalized correlation between the target vector and the         *
 * filtered past excitation.                                                 *
 *---------------------------------------------------------------------------*
 * Input arguments:                                                          *
 *     exc[]    : excitation buffer                                          *
 *     xn[]     : target vector                                              *
 *     h[]      : impulse response of synthesis and weighting filters (Q12)  *
 *     L_subfr  : Length of subframe                                         *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品在线观看播放| 久久久久久久精| 久久99国产精品尤物| 国产精品蜜臀在线观看| 欧美一卡2卡三卡4卡5免费| 成人福利在线看| 久久激五月天综合精品| 亚洲精品高清在线观看| 国产亚洲精品超碰| 国产日韩欧美一区二区三区综合 | 亚洲色图视频网站| 精品少妇一区二区三区在线视频| 日本大香伊一区二区三区| 国产福利一区二区三区| 日韩av在线免费观看不卡| 国产精品人妖ts系列视频| 欧美不卡激情三级在线观看| 欧美日韩国产综合久久| 99久久久精品免费观看国产蜜| 国产在线播放一区| 蜜臀av一区二区在线免费观看 | 久久国产免费看| 日本午夜一本久久久综合| 亚洲一区二区三区视频在线| 亚洲女同ⅹxx女同tv| 国产精品欧美经典| 日本一区二区免费在线| 久久亚区不卡日本| 久久婷婷国产综合国色天香 | 国产欧美一区二区精品仙草咪| 欧美精品18+| 精品视频1区2区| 在线免费观看一区| 色综合天天性综合| 成人aaaa免费全部观看| 国产毛片一区二区| 国产高清久久久久| 国产经典欧美精品| 懂色av一区二区三区免费看| 国产激情视频一区二区三区欧美 | 在线观看中文字幕不卡| 色老汉av一区二区三区| 91极品视觉盛宴| 欧美最新大片在线看| 欧洲一区在线观看| 欧美男同性恋视频网站| 制服丝袜av成人在线看| 日韩一区二区免费在线电影| 日韩一区二区三区av| 精品久久久久久久久久久久久久久 | 经典三级一区二区| 国产精品综合在线视频| 国产91富婆露脸刺激对白| 成人黄色网址在线观看| 成人免费毛片aaaaa**| 99精品欧美一区| 在线欧美日韩精品| 欧美剧在线免费观看网站| 欧美va亚洲va香蕉在线| 欧美韩国日本不卡| 亚洲精品成人在线| 石原莉奈在线亚洲二区| 精品一区二区三区视频在线观看| 国产一区二区三区视频在线播放| 国产精品综合在线视频| 一本色道久久综合精品竹菊| 欧美日韩免费视频| 精品嫩草影院久久| 亚洲欧美激情在线| 天天综合天天综合色| 国产一区在线观看麻豆| 99久久免费视频.com| 欧美日韩国产系列| 日本一区二区三区国色天香| 亚洲综合小说图片| 韩国视频一区二区| 色婷婷激情综合| 欧美一卡二卡三卡四卡| 国产精品美女一区二区在线观看| 亚洲国产精品久久久男人的天堂| 美日韩黄色大片| 91亚洲国产成人精品一区二区三| 欧美日韩视频在线一区二区| 国产欧美一区二区三区在线看蜜臀| 一区二区三区四区不卡在线| 精品一区二区三区在线播放| 色综合天天视频在线观看| 精品欧美乱码久久久久久1区2区 | 日本在线观看不卡视频| 成人伦理片在线| 欧美高清一级片在线| 亚洲国产成人自拍| 日本特黄久久久高潮| 一本色道久久综合亚洲精品按摩| 精品国产乱码久久久久久浪潮| 亚洲欧美电影一区二区| 国产在线精品一区二区夜色| 欧美三级蜜桃2在线观看| 国产蜜臀97一区二区三区| 日韩国产精品大片| 日本高清不卡在线观看| 国产欧美一区二区三区在线老狼| 日本伊人午夜精品| 在线一区二区三区做爰视频网站| 久久久久久久久久久久电影| 午夜精品久久久久久久99水蜜桃 | 26uuu国产一区二区三区| 亚洲一区二区在线观看视频| 岛国av在线一区| 一区二区成人在线观看| 国产精品亚洲综合一区在线观看| 欧美精品一二三| 夜夜嗨av一区二区三区网页| 懂色av一区二区三区蜜臀| 亚洲精品一线二线三线无人区| 五月综合激情网| 欧美亚洲一区二区三区四区| 国产精品初高中害羞小美女文| 极品少妇xxxx精品少妇偷拍| 欧美日本一区二区| 一区二区三区毛片| 色猫猫国产区一区二在线视频| 国产精品午夜免费| 国产精品996| 久久精品人人做人人综合| 美女国产一区二区| 91精品国产综合久久国产大片| 亚洲最新视频在线播放| 色综合欧美在线视频区| 亚洲精品国产无套在线观| 91亚洲永久精品| 日韩一区在线免费观看| 91原创在线视频| 亚洲另类春色国产| 日本韩国一区二区三区| 一区二区三区日韩精品视频| 色哟哟一区二区三区| 亚洲自拍偷拍麻豆| 欧美四级电影网| 丝袜美腿亚洲综合| 欧美一级免费观看| 久久超级碰视频| 久久久久久久久久久久久久久99 | 人人精品人人爱| 这里只有精品电影| 国产又黄又大久久| 国产欧美精品区一区二区三区| 福利电影一区二区| 亚洲欧美日韩精品久久久久| 色偷偷成人一区二区三区91 | 日韩不卡手机在线v区| 欧美一区二区三区白人 | 欧美丝袜丝nylons| 天天操天天色综合| 欧美成人官网二区| 国产99久久久精品| 亚洲影视在线观看| 日韩欧美123| 国产成人免费在线观看| 亚洲裸体xxx| 在线不卡的av| 国产盗摄视频一区二区三区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 欧美久久久久久蜜桃| 麻豆成人在线观看| 欧美国产1区2区| 欧美日韩一区二区三区高清| 日本美女视频一区二区| 久久久国产精品午夜一区ai换脸| 暴力调教一区二区三区| 石原莉奈在线亚洲三区| 欧美激情自拍偷拍| 欧美三级韩国三级日本三斤| 开心九九激情九九欧美日韩精美视频电影 | 亚洲一区二区三区在线看| 精品成人免费观看| 色菇凉天天综合网| 麻豆成人综合网| 亚洲黄一区二区三区| 欧美电视剧在线观看完整版| a亚洲天堂av| 蜜臀久久99精品久久久画质超高清 | 日韩欧美一级二级三级| 成人免费视频网站在线观看| 午夜av电影一区| 国产精品青草久久| 欧美一区二区免费观在线| jiyouzz国产精品久久| 日韩中文字幕麻豆| 中文字幕一区二区三中文字幕| 欧美精品第1页| 99久久国产综合精品色伊| 美女一区二区视频| 亚洲一区二区在线免费观看视频| 国产色一区二区| 日韩欧美国产精品一区| 日本精品免费观看高清观看| 国产99精品在线观看| 麻豆成人91精品二区三区| 一区二区三区欧美|