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

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

?? pitch.c

?? ITU-T G.729B標準源代碼編碼端
?? C
?? 第 1 頁 / 共 2 頁
字號:
 *     t_min    : minimum value of pitch lag.                                *
 *     t_max    : maximum value of pitch lag.                                *
 *                                                                           *
 * Output arguments:                                                         *
 *     corr_norm[]:  normalized correlation (correlation between target and  *
 *                   filtered excitation divided by the square root of       *
 *                   energy of filtered excitation)                          *
 *--------------------------------------------------------------------------*/

static void Norm_Corr(Word16 exc[], Word16 xn[], Word16 h[], Word16 L_subfr,
               Word16 t_min, Word16 t_max, Word16 corr_norm[])
{
  Word16 i,j,k;
  Word16 corr_h, corr_l, norm_h, norm_l;
  Word32 s, L_temp;

  Word16 excf[L_SUBFR];
  Word16 scaling, h_fac, *s_excf, scaled_excf[L_SUBFR];


  k =  negate(t_min);

  /* compute the filtered excitation for the first delay t_min */

  Convolve(&exc[k], h, excf, L_subfr);

  /* scaled "excf[]" to avoid overflow */

  for(j=0; j<L_subfr; j++)
    scaled_excf[j] = shr(excf[j], 2);

  /* Compute energy of excf[] for danger of overflow */

  s = 0;
  for (j = 0; j < L_subfr; j++)
    s = L_mac(s, excf[j], excf[j]);

  L_temp = L_sub(s, 67108864L);
  if (L_temp <= 0L)      /* if (s <= 2^26) */
  {
    s_excf = excf;
    h_fac = 15-12;               /* h in Q12 */
    scaling = 0;
  }
  else {
    s_excf = scaled_excf;        /* "excf[]" is divide by 2 */
    h_fac = 15-12-2;             /* h in Q12, divide by 2 */
    scaling = 2;
  }

  /* loop for every possible period */

  for (i = t_min; i <= t_max; i++)
  {
    /* Compute 1/sqrt(energy of excf[]) */

    s = 0;
    for (j = 0; j < L_subfr; j++)
      s = L_mac(s, s_excf[j], s_excf[j]);

    s = Inv_sqrt(s);                     /* Result in Q30 */
    L_Extract(s, &norm_h, &norm_l);

    /* Compute correlation between xn[] and excf[] */

    s = 0;
    for (j = 0; j < L_subfr; j++)
      s = L_mac(s, xn[j], s_excf[j]);

    L_Extract(s, &corr_h, &corr_l);

    /* Normalize correlation = correlation * (1/sqrt(energy)) */

    s = Mpy_32(corr_h, corr_l, norm_h, norm_l);

    corr_norm[i] = extract_h(L_shl(s, 16));   /* Result is on 16 bits */

    /* modify the filtered excitation excf[] for the next iteration */

    if( sub(i, t_max) != 0)
    {
      k=sub(k,1);
      for (j = L_subfr-(Word16)1; j > 0; j--)
      {
        s = L_mult(exc[k], h[j]);
        s = L_shl(s, h_fac);             /* h is in Q(12-scaling) */
        s_excf[j] = add(extract_h(s), s_excf[j-1]);
      }
      s_excf[0] = shr(exc[k], scaling);
    }
  }
  return;
}

/*---------------------------------------------------------------------*
 * Function  G_pitch:                                                  *
 *           ~~~~~~~~                                                  *
 *---------------------------------------------------------------------*
 * Compute correlations <xn,y1> and <y1,y1> to use in gains quantizer. *
 * Also compute the gain of pitch. Result in Q14                       *
 *  if (gain < 0)  gain =0                                             *
 *  if (gain >1.2) gain =1.2                                           *
 *---------------------------------------------------------------------*/


Word16 G_pitch(      /* (o) Q14 : Gain of pitch lag saturated to 1.2       */
  Word16 xn[],       /* (i)     : Pitch target.                            */
  Word16 y1[],       /* (i)     : Filtered adaptive codebook.              */
  Word16 g_coeff[],  /* (i)     : Correlations need for gain quantization. */
  Word16 L_subfr     /* (i)     : Length of subframe.                      */
)
{
   Word16 i;
   Word16 xy, yy, exp_xy, exp_yy, gain;
   Word32 s;

   Word16 scaled_y1[L_SUBFR];

   /* divide "y1[]" by 4 to avoid overflow */

   for(i=0; i<L_subfr; i++)
     scaled_y1[i] = shr(y1[i], 2);

   /* Compute scalar product <y1[],y1[]> */

   Overflow = 0;
   s = 1;                    /* Avoid case of all zeros */
   for(i=0; i<L_subfr; i++)
     s = L_mac(s, y1[i], y1[i]);

   if (Overflow == 0) {
     exp_yy = norm_l(s);
     yy     = round( L_shl(s, exp_yy) );
   }
   else {
     s = 1;                  /* Avoid case of all zeros */
     for(i=0; i<L_subfr; i++)
       s = L_mac(s, scaled_y1[i], scaled_y1[i]);
     exp_yy = norm_l(s);
     yy     = round( L_shl(s, exp_yy) );
     exp_yy = sub(exp_yy, 4);
   }

   /* Compute scalar product <xn[],y1[]> */

   Overflow = 0;
   s = 0;
   for(i=0; i<L_subfr; i++)
     s = L_mac(s, xn[i], y1[i]);

   if (Overflow == 0) {
     exp_xy = norm_l(s);
     xy     = round( L_shl(s, exp_xy) );
   }
   else {
     s = 0;
     for(i=0; i<L_subfr; i++)
       s = L_mac(s, xn[i], scaled_y1[i]);
     exp_xy = norm_l(s);
     xy     = round( L_shl(s, exp_xy) );
     exp_xy = sub(exp_xy, 2);
   }

   g_coeff[0] = yy;
   g_coeff[1] = sub(15, exp_yy);
   g_coeff[2] = xy;
   g_coeff[3] = sub(15, exp_xy);

   /* If (xy <= 0) gain = 0 */


   if (xy <= 0)
   {
      g_coeff[3] = -15;   /* Force exp_xy to -15 = (15-30) */
      return( (Word16) 0);
   }

   /* compute gain = xy/yy */

   xy = shr(xy, 1);             /* Be sure xy < yy */
   gain = div_s( xy, yy);

   i = sub(exp_xy, exp_yy);
   gain = shr(gain, i);         /* saturation if > 1.99 in Q14 */

   /* if(gain >1.2) gain = 1.2  in Q14 */

   if( sub(gain, 19661) > 0)
   {
     gain = 19661;
   }


   return(gain);
}

/*----------------------------------------------------------------------*
 *    Function Enc_lag3                                                 *
 *             ~~~~~~~~                                                 *
 *   Encoding of fractional pitch lag with 1/3 resolution.              *
 *----------------------------------------------------------------------*
 * The pitch range for the first subframe is divided as follows:        *
 *   19 1/3  to   84 2/3   resolution 1/3                               *
 *   85      to   143      resolution 1                                 *
 *                                                                      *
 * The period in the first subframe is encoded with 8 bits.             *
 * For the range with fractions:                                        *
 *   index = (T-19)*3 + frac - 1;   where T=[19..85] and frac=[-1,0,1]  *
 * and for the integer only range                                       *
 *   index = (T - 85) + 197;        where T=[86..143]                   *
 *----------------------------------------------------------------------*
 * For the second subframe a resolution of 1/3 is always used, and the  *
 * search range is relative to the lag in the first subframe.           *
 * If t0 is the lag in the first subframe then                          *
 *  t_min=t0-5   and  t_max=t0+4   and  the range is given by           *
 *       t_min - 2/3   to  t_max + 2/3                                  *
 *                                                                      *
 * The period in the 2nd subframe is encoded with 5 bits:               *
 *   index = (T-(t_min-1))*3 + frac - 1;    where T[t_min-1 .. t_max+1] *
 *----------------------------------------------------------------------*/


Word16 Enc_lag3(     /* output: Return index of encoding */
  Word16 T0,         /* input : Pitch delay              */
  Word16 T0_frac,    /* input : Fractional pitch delay   */
  Word16 *T0_min,    /* in/out: Minimum search delay     */
  Word16 *T0_max,    /* in/out: Maximum search delay     */
  Word16 pit_min,    /* input : Minimum pitch delay      */
  Word16 pit_max,    /* input : Maximum pitch delay      */
  Word16 pit_flag    /* input : Flag for 1st subframe    */
)
{
  Word16 index, i;

  if (pit_flag == 0)   /* if 1st subframe */
  {
    /* encode pitch delay (with fraction) */

    if (sub(T0, 85) <= 0)
    {
      /* index = t0*3 - 58 + t0_frac   */
      i = add(add(T0, T0), T0);
      index = add(sub(i, 58), T0_frac);
    }
    else {
      index = add(T0, 112);
    }

    /* find T0_min and T0_max for second (or fourth) subframe */

    *T0_min = sub(T0, 5);
    if (sub(*T0_min, pit_min) < 0)
    {
      *T0_min = pit_min;
    }

    *T0_max = add(*T0_min, 9);
    if (sub(*T0_max, pit_max) > 0)
    {
      *T0_max = pit_max;
      *T0_min = sub(*T0_max, 9);
    }
  }
  else      /* if second subframe */
  {

    /* i = t0 - t0_min;               */
    /* index = i*3 + 2 + t0_frac;     */
    i = sub(T0, *T0_min);
    i = add(add(i, i), i);
    index = add(add(i, 2), T0_frac);
  }


  return index;
}


/*---------------------------------------------------------------------------*
 * Procedure Interpol_3()                                                    *
 * ~~~~~~~~~~~~~~~~~~~~~~                                                    *
 * For interpolating the normalized correlation with 1/3 resolution.         *
 *--------------------------------------------------------------------------*/
Word16 Interpol_3(      /* (o)  : interpolated value  */
  Word16 *x,            /* (i)  : input vector        */
  Word16 frac           /* (i)  : fraction            */
)
{
  Word16 i, k;
  Word16 *x1, *x2, *c1, *c2;
  Word32 s;

  if(frac < 0)
  {
    frac = add(frac, UP_SAMP);
    x--;
  }

  x1 = &x[0];
  x2 = &x[1];
  c1 = &inter_3[frac];
  c2 = &inter_3[sub(UP_SAMP,frac)];

  s = 0;
  for(i=0, k=0; i< L_INTER4; i++, k+=UP_SAMP)
  {
    s = L_mac(s, x1[-i], c1[k]);
    s = L_mac(s, x2[i],  c2[k]);
  }


  return round(s);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av影院在线| 午夜av区久久| 理论电影国产精品| 中文字幕精品在线不卡| 日本久久电影网| 国产激情一区二区三区| 一区二区三区四区国产精品| 欧美精品久久99| 97精品久久久午夜一区二区三区 | 日韩一级二级三级精品视频| 一本一道久久a久久精品| 国产精品91一区二区| 国产真实乱对白精彩久久| 久久精品国产亚洲aⅴ| 日韩电影免费在线观看网站| 日韩精品一二区| 天堂影院一区二区| 亚洲成人av中文| 午夜视频一区二区| 日本成人中文字幕| 精品在线免费观看| 99视频国产精品| 中文字幕亚洲区| 日本中文一区二区三区| www.成人网.com| 欧美精品一区二区三区蜜桃视频| 精品国产91乱码一区二区三区| 久久久久久久综合色一本| 中文字幕巨乱亚洲| 亚洲一区二区成人在线观看| 免费成人你懂的| 丁香六月综合激情| 色猫猫国产区一区二在线视频| 欧美日本一区二区| 久久久久国产一区二区三区四区| 国产欧美精品在线观看| 婷婷一区二区三区| 蜜臀av一级做a爰片久久| 成人av一区二区三区| 51午夜精品国产| 综合激情成人伊人| 爽好久久久欧美精品| 成人精品国产福利| 欧美浪妇xxxx高跟鞋交| 国产日韩精品一区二区三区| 丝袜脚交一区二区| 成人毛片老司机大片| 2021中文字幕一区亚洲| 亚洲精选在线视频| 国产精品系列在线观看| 6080国产精品一区二区| 亚洲欧美影音先锋| 成人午夜碰碰视频| 亚洲欧美一区二区在线观看| 成人午夜视频在线| 国产精品国产自产拍高清av| zzijzzij亚洲日本少妇熟睡| 亚洲欧美另类在线| 蜜桃视频一区二区三区在线观看 | 国产成人av电影在线| 555夜色666亚洲国产免| 亚洲成人动漫一区| 久久久电影一区二区三区| 国产综合色精品一区二区三区| 欧美一二三区精品| 久久电影网站中文字幕| 日韩一级片网站| 免费在线看一区| 精品免费视频一区二区| 国模少妇一区二区三区| 精品国产不卡一区二区三区| 国产乱国产乱300精品| 国产精品乱码久久久久久| 国产高清在线精品| 亚洲国产成人午夜在线一区 | 国产精品99久久久久久久女警| 欧美成人vps| 成人激情午夜影院| 亚洲人成电影网站色mp4| 欧美日韩中字一区| 婷婷六月综合网| 久久久777精品电影网影网 | 懂色av一区二区夜夜嗨| 亚洲一级不卡视频| 精品久久一二三区| 成人国产一区二区三区精品| 亚洲黄色小说网站| 欧美成人女星排行榜| av中文字幕不卡| 日本不卡高清视频| 亚洲国产精品精华液ab| 欧美日韩国产中文| 成人黄色777网| 狠狠色综合色综合网络| 亚洲男人的天堂网| 国产午夜精品福利| 欧美一区日韩一区| 久久久久久电影| 777精品伊人久久久久大香线蕉| 国产一区二区三区精品视频| 亚洲与欧洲av电影| 中文av一区二区| 久久久美女毛片| 精品sm在线观看| 日韩欧美国产1| 欧美一区二区三区播放老司机| 成人av网站在线| 国产精品一级片| 国产乱子轮精品视频| 久久精品久久综合| 午夜精品福利一区二区蜜股av | 4438x亚洲最大成人网| 91久久精品一区二区三| av爱爱亚洲一区| 99精品视频一区| 99精品在线观看视频| 99久久99久久精品免费观看| 岛国精品在线播放| 99久久久久久| 一本色道久久综合亚洲精品按摩| 99国产精品国产精品久久| www.欧美日韩| 在线亚洲人成电影网站色www| 色婷婷综合五月| 在线不卡一区二区| 欧美日韩久久一区二区| 欧美一区二区福利视频| 26uuu色噜噜精品一区二区| 26uuu国产在线精品一区二区| 久久综合久久鬼色| 日韩一区日韩二区| 日本不卡一区二区三区高清视频| 日本在线不卡一区| 国产精品18久久久久| 色美美综合视频| 日韩欧美电影一二三| 久久伊人中文字幕| 亚洲欧洲成人自拍| 日韩av中文字幕一区二区三区| 国产成人在线影院| 欧美日韩亚洲综合在线 | 美女久久久精品| 9久草视频在线视频精品| 欧美日韩免费一区二区三区 | 免费av成人在线| 91在线精品一区二区| 欧美白人最猛性xxxxx69交| 亚洲香肠在线观看| 国产二区国产一区在线观看| 欧美日韩中字一区| 1024成人网色www| 久久99精品网久久| 欧美欧美欧美欧美首页| 国产精品电影一区二区三区| 日韩电影在线一区二区| 在线欧美日韩国产| 国产精品毛片a∨一区二区三区| 蜜桃av一区二区三区电影| 欧美天堂亚洲电影院在线播放| 国产精品无码永久免费888| 蜜臀久久99精品久久久久久9| 欧美艳星brazzers| 亚洲欧美区自拍先锋| 99久久精品99国产精品| 国产日产欧美一区二区视频| 久久国产生活片100| 久久久久国产一区二区三区四区 | 日韩美女天天操| 蜜桃视频一区二区三区在线观看| 欧美日韩三级在线| 亚洲男女一区二区三区| 91视视频在线观看入口直接观看www | 国产精品电影一区二区| 99re这里只有精品视频首页| 国产精品久久久久久亚洲毛片 | 国产91在线观看| 亚洲国产经典视频| 91久久精品一区二区| 亚洲福利电影网| 欧美日韩日本视频| 老色鬼精品视频在线观看播放| 欧美本精品男人aⅴ天堂| 国产91精品一区二区麻豆亚洲| 国产免费久久精品| 91伊人久久大香线蕉| 亚洲一区在线观看免费观看电影高清 | 国产精品中文字幕日韩精品| 欧美激情中文字幕| 色噜噜夜夜夜综合网| 久久99精品久久只有精品| 国产精品视频看| 欧美日韩国产综合一区二区| 国产麻豆视频精品| 一区二区三区欧美在线观看| 91精品久久久久久久91蜜桃| 成人免费高清在线| 蜜桃视频第一区免费观看| 综合中文字幕亚洲| 日韩欧美国产综合一区 | av网站免费线看精品|