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

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

?? lpc.c

?? G.729 coder and decoder, ANSI C, for windows, unix, DSP, etc.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
   ITU-T G.729 Speech Coder with Annex B    ANSI-C Source Code
   Version 1.3    Last modified: August 1997

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

/*-----------------------------------------------------*
 * Function Autocorr()                                 *
 *                                                     *
 *   Compute autocorrelations of signal with windowing *
 *                                                     *
 *-----------------------------------------------------*/

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

#include "ld8k.h"
#include "tab_ld8k.h"

void Autocorr(
  Word16 x[],      /* (i)    : Input signal                      */
  Word16 m,        /* (i)    : LPC order                         */
  Word16 r_h[],    /* (o)    : Autocorrelations  (msb)           */
  Word16 r_l[],    /* (o)    : Autocorrelations  (lsb)           */
  Word16 *exp_R0
)
{
  Word16 i, j, norm;
  Word16 y[L_WINDOW];
  Word32 sum;

  extern Flag Overflow;

  /* Windowing of signal */

  for(i=0; i<L_WINDOW; i++)
  {
    y[i] = mult_r(x[i], hamwindow[i]);
  }

  /* Compute r[0] and test for overflow */

  /* should exp_R0 be initialized to 2 ??? */
  *exp_R0 = 1;    

  do {
    Overflow = 0;
    sum = 1;                   /* Avoid case of all zeros */
    for(i=0; i<L_WINDOW; i++)
      sum = L_mac(sum, y[i], y[i]);

    /* If overflow divide y[] by 4 */

    if(Overflow != 0)
    {
      for(i=0; i<L_WINDOW; i++)
      {
        y[i] = shr(y[i], 2);
      }
      *exp_R0 = add((*exp_R0), 4);
      Overflow = 1;
    }
  }while (Overflow != 0);

  /* Normalization of r[0] */

  norm = norm_l(sum);
  sum  = L_shl(sum, norm);
  L_Extract(sum, &r_h[0], &r_l[0]);     /* Put in DPF format (see oper_32b) */
  *exp_R0 = sub(*exp_R0, norm);

  /* r[1] to r[m] */

  for (i = 1; i <= m; i++)
  {
    sum = 0;
    for(j=0; j<L_WINDOW-i; j++)
      sum = L_mac(sum, y[j], y[j+i]);

    sum = L_shl(sum, norm);
    L_Extract(sum, &r_h[i], &r_l[i]);
  }
  return;
}


/*-------------------------------------------------------*
 * Function Lag_window()                                 *
 *                                                       *
 * Lag_window on autocorrelations.                       *
 *                                                       *
 * r[i] *= lag_wind[i]                                   *
 *                                                       *
 *  r[i] and lag_wind[i] are in special double precision.*
 *  See "oper_32b.c" for the format                      *
 *                                                       *
 *-------------------------------------------------------*/

void Lag_window(
  Word16 m,         /* (i)     : LPC order                        */
  Word16 r_h[],     /* (i/o)   : Autocorrelations  (msb)          */
  Word16 r_l[]      /* (i/o)   : Autocorrelations  (lsb)          */
)
{
  Word16 i;
  Word32 x;

  for(i=1; i<=m; i++)
  {
     x  = Mpy_32(r_h[i], r_l[i], lag_h[i-1], lag_l[i-1]);
     L_Extract(x, &r_h[i], &r_l[i]);
  }
  return;
}


/*___________________________________________________________________________
 |                                                                           |
 |      LEVINSON-DURBIN algorithm in double precision                        |
 |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                        |
 |---------------------------------------------------------------------------|
 |                                                                           |
 | Algorithm                                                                 |
 |                                                                           |
 |       R[i]    autocorrelations.                                           |
 |       A[i]    filter coefficients.                                        |
 |       K       reflection coefficients.                                    |
 |       Alpha   prediction gain.                                            |
 |                                                                           |
 |       Initialization:                                                     |
 |               A[0] = 1                                                    |
 |               K    = -R[1]/R[0]                                           |
 |               A[1] = K                                                    |
 |               Alpha = R[0] * (1-K**2]                                     |
 |                                                                           |
 |       Do for  i = 2 to M                                                  |
 |                                                                           |
 |            S =  SUM ( R[j]*A[i-j] ,j=1,i-1 ) +  R[i]                      |
 |                                                                           |
 |            K = -S / Alpha                                                 |
 |                                                                           |
 |            An[j] = A[j] + K*A[i-j]   for j=1 to i-1                       |
 |                                      where   An[i] = new A[i]             |
 |            An[i]=K                                                        |
 |                                                                           |
 |            Alpha=Alpha * (1-K**2)                                         |
 |                                                                           |
 |       END                                                                 |
 |                                                                           |
 | Remarks on the dynamics of the calculations.                              |
 |                                                                           |
 |       The numbers used are in double precision in the following format :  |
 |       A = AH <<16 + AL<<1.  AH and AL are 16 bit signed integers.         |
 |       Since the LSB's also contain a sign bit, this format does not       |
 |       correspond to standard 32 bit integers.  We use this format since   |
 |       it allows fast execution of multiplications and divisions.          |
 |                                                                           |
 |       "DPF" will refer to this special format in the following text.      |
 |       See oper_32b.c                                                      |
 |                                                                           |
 |       The R[i] were normalized in routine AUTO (hence, R[i] < 1.0).       |
 |       The K[i] and Alpha are theoretically < 1.0.                         |
 |       The A[i], for a sampling frequency of 8 kHz, are in practice        |
 |       always inferior to 16.0.                                            |
 |                                                                           |
 |       These characteristics allow straigthforward fixed-point             |
 |       implementation.  We choose to represent the parameters as           |
 |       follows :                                                           |
 |                                                                           |
 |               R[i]    Q31   +- .99..                                      |
 |               K[i]    Q31   +- .99..                                      |
 |               Alpha   Normalized -> mantissa in Q31 plus exponent         |
 |               A[i]    Q27   +- 15.999..                                   |
 |                                                                           |
 |       The additions are performed in 32 bit.  For the summation used      |
 |       to calculate the K[i], we multiply numbers in Q31 by numbers        |
 |       in Q27, with the result of the multiplications in Q27,              |
 |       resulting in a dynamic of +- 16.  This is sufficient to avoid       |
 |       overflow, since the final result of the summation is                |
 |       necessarily < 1.0 as both the K[i] and Alpha are                    |
 |       theoretically < 1.0.                                                |
 |___________________________________________________________________________|
*/


/* Last A(z) for case of unstable filter */

static Word16 old_A[M+1]={4096,0,0,0,0,0,0,0,0,0,0};
static Word16 old_rc[2]={0,0};

void Levinson(
  Word16 Rh[],      /* (i)     : Rh[M+1] Vector of autocorrelations (msb) */
  Word16 Rl[],      /* (i)     : Rl[M+1] Vector of autocorrelations (lsb) */
  Word16 A[],       /* (o) Q12 : A[M]    LPC coefficients  (m = 10)       */
  Word16 rc[],      /* (o) Q15 : rc[M]   Reflection coefficients.         */
  Word16 *Err       /* (o)     : Residual energy                          */
)
{
 Word16 i, j;
 Word16 hi, lo;
 Word16 Kh, Kl;                /* reflection coefficient; hi and lo           */
 Word16 alp_h, alp_l, alp_exp; /* Prediction gain; hi lo and exponent         */
 Word16 Ah[M+1], Al[M+1];      /* LPC coef. in double prec.                   */
 Word16 Anh[M+1], Anl[M+1];    /* LPC coef.for next iteration in double prec. */
 Word32 t0, t1, t2;            /* temporary variable                          */


/* K = A[1] = -R[1] / R[0] */

  t1  = L_Comp(Rh[1], Rl[1]);           /* R[1] in Q31      */
  t2  = L_abs(t1);                      /* abs R[1]         */
  t0  = Div_32(t2, Rh[0], Rl[0]);       /* R[1]/R[0] in Q31 */
  if(t1 > 0) t0= L_negate(t0);          /* -R[1]/R[0]       */
  L_Extract(t0, &Kh, &Kl);              /* K in DPF         */
  rc[0] = Kh;
  t0 = L_shr(t0,4);                     /* A[1] in Q27      */
  L_Extract(t0, &Ah[1], &Al[1]);        /* A[1] in DPF      */

/*  Alpha = R[0] * (1-K**2) */

  t0 = Mpy_32(Kh ,Kl, Kh, Kl);          /* K*K      in Q31 */
  t0 = L_abs(t0);                       /* Some case <0 !! */
  t0 = L_sub( (Word32)0x7fffffffL, t0 ); /* 1 - K*K  in Q31 */
  L_Extract(t0, &hi, &lo);              /* DPF format      */
  t0 = Mpy_32(Rh[0] ,Rl[0], hi, lo);    /* Alpha in Q31    */

/* Normalize Alpha */

  alp_exp = norm_l(t0);
  t0 = L_shl(t0, alp_exp);
  L_Extract(t0, &alp_h, &alp_l);         /* DPF format    */

/*--------------------------------------*
 * ITERATIONS  I=2 to M                 *
 *--------------------------------------*/

  for(i= 2; i<=M; i++)
  {

    /* t0 = SUM ( R[j]*A[i-j] ,j=1,i-1 ) +  R[i] */

    t0 = 0;
    for(j=1; j<i; j++)
      t0 = L_add(t0, Mpy_32(Rh[j], Rl[j], Ah[i-j], Al[i-j]));

    t0 = L_shl(t0,4);                  /* result in Q27 -> convert to Q31 */
                                       /* No overflow possible            */
    t1 = L_Comp(Rh[i],Rl[i]);
    t0 = L_add(t0, t1);                /* add R[i] in Q31                 */

    /* K = -t0 / Alpha */

    t1 = L_abs(t0);
    t2 = Div_32(t1, alp_h, alp_l);     /* abs(t0)/Alpha                   */
    if(t0 > 0) t2= L_negate(t2);       /* K =-t0/Alpha                    */
    t2 = L_shl(t2, alp_exp);           /* denormalize; compare to Alpha   */
    L_Extract(t2, &Kh, &Kl);           /* K in DPF                        */
    rc[i-1] = Kh;

    /* Test for unstable filter. If unstable keep old A(z) */

    if (sub(abs_s(Kh), 32750) > 0)
    {
      for(j=0; j<=M; j++)
      {
        A[j] = old_A[j];
      }
      rc[0] = old_rc[0];        /* only two rc coefficients are needed */
      rc[1] = old_rc[1];
      return;
    }

    /*------------------------------------------*
     *  Compute new LPC coeff. -> An[i]         *
     *  An[j]= A[j] + K*A[i-j]     , j=1 to i-1 *
     *  An[i]= K                                *
     *------------------------------------------*/


    for(j=1; j<i; j++)
    {
      t0 = Mpy_32(Kh, Kl, Ah[i-j], Al[i-j]);
      t0 = L_add(t0, L_Comp(Ah[j], Al[j]));
      L_Extract(t0, &Anh[j], &Anl[j]);
    }
    t2 = L_shr(t2, 4);                  /* t2 = K in Q31 ->convert to Q27  */
    L_Extract(t2, &Anh[i], &Anl[i]);    /* An[i] in Q27                    */

    /*  Alpha = Alpha * (1-K**2) */

    t0 = Mpy_32(Kh ,Kl, Kh, Kl);          /* K*K      in Q31 */
    t0 = L_abs(t0);                       /* Some case <0 !! */
    t0 = L_sub( (Word32)0x7fffffffL, t0 ); /* 1 - K*K  in Q31 */
    L_Extract(t0, &hi, &lo);              /* DPF format      */
    t0 = Mpy_32(alp_h , alp_l, hi, lo);   /* Alpha in Q31    */

    /* Normalize Alpha */

    j = norm_l(t0);
    t0 = L_shl(t0, j);
    L_Extract(t0, &alp_h, &alp_l);         /* DPF format    */
    alp_exp = add(alp_exp, j);             /* Add normalization to alp_exp */

    /* A[j] = An[j] */

    for(j=1; j<=i; j++)
    {
      Ah[j] =Anh[j];
      Al[j] =Anl[j];
    }
  }

  *Err = shr(alp_h, alp_exp);

  /* Truncate A[i] in Q27 to Q12 with rounding */

  A[0] = 4096;
  for(i=1; i<=M; i++)
  {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一级片网址| 99亚偷拍自图区亚洲| 2023国产精品自拍| 人人精品人人爱| 日韩一级片网站| 国产精品一线二线三线精华| 国产清纯白嫩初高生在线观看91 | 天堂一区二区在线免费观看| 欧美自拍偷拍一区| 视频一区视频二区中文| 日韩精品在线网站| 国产成人综合自拍| 精品国产凹凸成av人导航| 国产精品资源站在线| 中文字幕乱码亚洲精品一区| 99久久精品国产网站| 亚洲成人激情av| 精品久久五月天| 99久久精品情趣| 天天综合色天天综合色h| 精品日韩在线观看| 97久久精品人人澡人人爽| 亚洲va在线va天堂| 久久久国产一区二区三区四区小说| √…a在线天堂一区| 色系网站成人免费| 青青草国产精品97视觉盛宴| 国产午夜亚洲精品理论片色戒 | 秋霞电影一区二区| 2024国产精品| 色婷婷一区二区三区四区| 偷拍一区二区三区四区| 久久天堂av综合合色蜜桃网| 91网站最新网址| 免费一级欧美片在线观看| 欧美国产精品专区| 制服丝袜中文字幕一区| 国产二区国产一区在线观看| 亚洲一区二区三区四区在线免费观看 | 在线观看日韩一区| 国产一区 二区 三区一级| 亚洲精品视频在线观看免费| 欧美久久久一区| 成人高清在线视频| 日韩av在线发布| 日韩理论电影院| 精品国产乱码久久久久久牛牛| 美女国产一区二区三区| 国产精品久久久久久久岛一牛影视 | 97久久人人超碰| 看电视剧不卡顿的网站| 亚洲男人的天堂一区二区| 日韩免费视频一区| 欧美三级电影在线观看| 不卡区在线中文字幕| 久久精品国产秦先生| 亚洲一区二区免费视频| 国产精品不卡在线观看| 久久精品欧美一区二区三区不卡| 精品一区二区免费在线观看| 五月激情综合网| 亚洲精品videosex极品| 国产精品网站在线观看| 欧美电影免费观看高清完整版在线观看 | 久久一夜天堂av一区二区三区| 狠狠色综合日日| 日本成人在线不卡视频| 亚洲国产欧美另类丝袜| 一区二区在线观看视频在线观看| 欧美视频一区二区三区| 成人自拍视频在线| 九九精品视频在线看| 青青草国产成人99久久| 性做久久久久久| 亚洲国产日韩av| 亚洲一区二区三区爽爽爽爽爽 | 中文字幕一区免费在线观看 | 久久9热精品视频| 亚洲a一区二区| 日韩精彩视频在线观看| 午夜欧美大尺度福利影院在线看| 欧美一级精品在线| 欧美一二三四区在线| 日韩免费视频线观看| 精品精品国产高清a毛片牛牛| 国产成人免费在线观看不卡| 久久99精品一区二区三区| 日韩精品电影在线| 麻豆精品一区二区综合av| 久久国产生活片100| 激情丁香综合五月| 成人久久久精品乱码一区二区三区 | 26uuu久久综合| 久久众筹精品私拍模特| 精品sm在线观看| 国产欧美日韩一区二区三区在线观看| 色噜噜狠狠成人网p站| 97成人超碰视| 欧美视频在线一区二区三区| 91麻豆精品国产无毒不卡在线观看| 国产成人丝袜美腿| 91麻豆精品秘密| 欧美日韩午夜影院| 久久先锋资源网| 一区二区中文字幕在线| 亚洲综合激情网| 麻豆精品一区二区三区| 国产高清精品在线| 91视频一区二区| 91麻豆精品国产91久久久 | 国产精品免费久久久久| 最新国产成人在线观看| 亚洲最新在线观看| 天天操天天干天天综合网| 老司机午夜精品| 91网页版在线| 欧美一个色资源| 国产精品国模大尺度视频| 午夜私人影院久久久久| 国内不卡的二区三区中文字幕| 偷拍与自拍一区| 国产成都精品91一区二区三| 91国模大尺度私拍在线视频| 精品三级在线看| 亚洲激情图片qvod| 久久精品72免费观看| 99精品欧美一区二区三区小说 | 免费不卡在线观看| 国产成人免费9x9x人网站视频| 国产一区在线不卡| 色天使色偷偷av一区二区| 日韩一级视频免费观看在线| 亚洲女人小视频在线观看| 国模无码大尺度一区二区三区| 日韩国产欧美三级| 一本色道久久综合狠狠躁的推荐| 国产99久久久久久免费看农村| 久久av老司机精品网站导航| 欧美自拍偷拍午夜视频| 中文字幕中文字幕在线一区 | 亚洲猫色日本管| 久久国产成人午夜av影院| 色猫猫国产区一区二在线视频| 99r精品视频| 久久久亚洲精品一区二区三区| 久久综合色之久久综合| 亚洲成人手机在线| 播五月开心婷婷综合| 精品国产91乱码一区二区三区| 亚洲精品在线免费播放| 午夜视频一区二区| 欧洲人成人精品| 国产精品理论在线观看| 国产精品一区二区三区四区| 日韩三级在线免费观看| 首页综合国产亚洲丝袜| 一本色道综合亚洲| 亚洲视频一区在线| 成人一区在线看| 国产精品毛片久久久久久久| 国产一区二区三区av电影| 欧美乱熟臀69xxxxxx| 亚洲欧美日韩一区二区| 一区二区三区中文在线| 国产成人在线观看| 精品国产乱码91久久久久久网站| 中文字幕中文字幕一区二区| 国产成人午夜视频| 久久久久成人黄色影片| 国内精品伊人久久久久av影院 | 日韩欧美国产高清| 青青草原综合久久大伊人精品优势 | 日韩欧美激情一区| 奇米影视一区二区三区| 91精品国产乱| 蜜桃精品视频在线| 精品成人私密视频| 成人网男人的天堂| 中文字幕视频一区二区三区久| 亚洲第一二三四区| 欧美亚州韩日在线看免费版国语版| 日韩一区二区精品| 精品一区二区影视| 精品裸体舞一区二区三区| 激情综合五月天| 久久综合狠狠综合久久综合88| 最新国产精品久久精品| 91成人看片片| 日韩电影一区二区三区四区| 欧美日韩一区二区三区在线| 日本中文在线一区| 精品1区2区在线观看| 成人久久久精品乱码一区二区三区| 欧美一区二区在线不卡| 精品一区二区三区影院在线午夜| 色噜噜狠狠成人中文综合| 午夜国产不卡在线观看视频| 欧美电视剧免费全集观看| 成人午夜激情片| 亚洲一区二区三区中文字幕 |