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

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

?? cod_ld8k.c

?? 語音編碼的原程序,是在國外的網站下來的,沒有改動可以直接在軟電話下使用!
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* Version 3.3    Last modified: December 26, 1995 */

/*-----------------------------------------------------------------*
 *   Functions Coder_ld8k and Init_Coder_ld8k                      *
 *             ~~~~~~~~~~     ~~~~~~~~~~~~~~~                      *
 *-----------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>

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

static void update_exc_err(Word16 gain_pit, Word16 t0);
static Word16 test_err(Word16 t0, Word16 t0_frac);

/*-----------------------------------------------------------*
 *    Coder constant parameters (defined in "ld8k.h")        *
 *-----------------------------------------------------------*
 *   L_WINDOW    : LPC analysis window size.                 *
 *   L_NEXT      : Samples of next frame needed for autocor. *
 *   L_FRAME     : Frame size.                               *
 *   L_SUBFR     : Sub-frame size.                           *
 *   M           : LPC order.                                *
 *   MP1         : LPC order+1                               *
 *   L_TOTAL     : Total size of speech buffer.              *
 *   PIT_MIN     : Minimum pitch lag.                        *
 *   PIT_MAX     : Maximum pitch lag.                        *
 *   L_INTERPOL  : Length of filter for interpolation        *
 *-----------------------------------------------------------*/

/*--------------------------------------------------------*
 *         Static memory allocation.                      *
 *--------------------------------------------------------*/

        /* Speech vector */

 static Word16 old_speech[L_TOTAL];
 static Word16 *speech, *p_window;
 Word16 *new_speech;                    /* Global variable */

                /* Weighted speech vector */

 static Word16 old_wsp[L_FRAME+PIT_MAX];
 static Word16 *wsp;

                /* Excitation vector */

 static Word16 old_exc[L_FRAME+PIT_MAX+L_INTERPOL];
 static Word16 *exc;

        /* Zero vector */

 static Word16 ai_zero[L_SUBFR+MP1];
 static Word16 *zero;

                /* Lsp (Line spectral pairs) */

 static Word16 lsp_old[M]={
                          30000, 26000, 21000, 15000, 8000, 0, -8000,-15000,-21000,-26000};
 static Word16 lsp_old_q[M];

        /* Filter's memory */

 static Word16 mem_syn[M], mem_w0[M], mem_w[M];
 static Word16 mem_err[M+L_SUBFR], *error;
 static Word16 sharp;

 /* to tame the coder */
 static Word32 L_exc_err[4];

/*-----------------------------------------------------------------*
 *   Function  Init_Coder_ld8k                                     *
 *            ~~~~~~~~~~~~~~~                                      *
 *                                                                 *
 *  Init_Coder_ld8k(void);                                         *
 *                                                                 *
 *   ->Initialization of variables for the coder section.          *
 *       - initialize pointers to speech buffer                    *
 *       - initialize static  pointers                             *
 *       - set static vectors to zero                              *
 *                                                                 *
 *-----------------------------------------------------------------*/

void Init_Coder_ld8k(void)
{

 int i;
  /*----------------------------------------------------------------------*
  *      Initialize pointers to speech vector.                            *
  *                                                                       *
  *                                                                       *
  *   |--------------------|-------------|-------------|------------|     *
  *     previous speech           sf1           sf2         L_NEXT        *
  *                                                                       *
  *   <----------------  Total speech vector (L_TOTAL)   ----------->     *
  *   <----------------  LPC analysis window (L_WINDOW)  ----------->     *
  *   |                   <-- present frame (L_FRAME) -->                 *
  * old_speech            |              <-- new speech (L_FRAME) -->     *
  * p_window              |              |                                *
  *                     speech           |                                *
  *                             new_speech                                *
  *-----------------------------------------------------------------------*/

  new_speech = old_speech + L_TOTAL - L_FRAME;         /* New speech     */
  speech     = new_speech - L_NEXT;                    /* Present frame  */
  p_window   = old_speech + L_TOTAL - L_WINDOW;        /* For LPC window */

  /* Initialize static pointers */

  wsp    = old_wsp + PIT_MAX;
  exc    = old_exc + PIT_MAX + L_INTERPOL;
  zero   = ai_zero + MP1;
  error  = mem_err + M;

  /* Static vectors to zero */

  Set_zero(old_speech, L_TOTAL);
  Set_zero(old_exc, PIT_MAX+L_INTERPOL);
  Set_zero(old_wsp, PIT_MAX);
  Set_zero(mem_syn, M);
  Set_zero(mem_w,   M);
  Set_zero(mem_w0,  M);
  Set_zero(mem_err, M);
  Set_zero(zero, L_SUBFR);
  sharp = SHARPMIN;

  /* Initialize lsp_old_q[] */

  Copy(lsp_old, lsp_old_q, M);


  Lsp_encw_reset();

  for(i=0; i<4; i++) L_exc_err[i] = 0x00004000L;   /* Q14 */

 return;
}

/*-----------------------------------------------------------------*
 *   Functions Coder_ld8k                                          *
 *            ~~~~~~~~~~                                           *
 *  Coder_ld8k(Word16 ana[], Word16 synth[]);                      *
 *                                                                 *
 *   ->Main coder function.                                        *
 *                                                                 *
 *                                                                 *
 *  Input:                                                         *
 *                                                                 *
 *   80 speech data should have been copied to vector new_speech[].*
 *   This vector is global and is declared in this function.       *
 *                                                                 *
 *  Ouputs:                                                        *
 *                                                                 *
 *    ana[]      ->analysis parameters.                            *
 *    synth[]    ->Local synthesis (for debug purpose)             *
 *                                                                 *
 *-----------------------------------------------------------------*/

void Coder_ld8k(
     Word16 ana[],      /* output  : Analysis parameters */
     Word16 synth[]     /* output  : Local synthesis     */
)
{

  /* LPC analysis */

  Word16 r_l[MP1], r_h[MP1];       /* Autocorrelations low and hi          */
  Word16 rc[M];                    /* Reflection coefficients.             */
  Word16 A_t[(MP1)*2];             /* A(z) unquantized for the 2 subframes */
  Word16 Aq_t[(MP1)*2];            /* A(z)   quantized for the 2 subframes */
  Word16 Ap1[MP1];                 /* A(z) with spectral expansion         */
  Word16 Ap2[MP1];                 /* A(z) with spectral expansion         */
  Word16 *A, *Aq;                  /* Pointer on A_t and Aq_t              */
  Word16 lsp_new[M], lsp_new_q[M]; /* LSPs at 2th subframe                 */
  Word16 lsf_int[M];               /* Interpolated LSF 1st subframe.       */
  Word16 lsf_new[M];
  Word16 gamma1[2], gamma2[2];     /* Weighting factor for the 2 subframes */

  /* Other vectors */

  Word16 h1[L_SUBFR];            /* Impulse response h1[]              */
  Word16 xn[L_SUBFR];            /* Target vector for pitch search     */
  Word16 xn2[L_SUBFR];           /* Target vector for codebook search  */
  Word16 code[L_SUBFR];          /* Fixed codebook excitation          */
  Word16 y1[L_SUBFR];            /* Filtered adaptive excitation       */
  Word16 y2[L_SUBFR];            /* Filtered fixed codebook excitation */
  Word16 g_coeff[4];             /* Correlations between xn & y1       */

  Word16 g_coeff_cs[5];
  Word16 exp_g_coeff_cs[5];      /* Correlations between xn, y1, & y2
                                     <y1,y1>, -2<xn,y1>,
                                          <y2,y2>, -2<xn,y2>, 2<y1,y2> */
  /* Scalars */

  Word16 i, j, k, i_subfr, i_gamma;
  Word16 T_op, T0, T0_min, T0_max, T0_frac;
  Word16 gain_pit, gain_code, index;
  Word16 temp;
  Word32 L_temp;

/*------------------------------------------------------------------------*
 *  - Perform LPC analysis:                                               *
 *       * autocorrelation + lag windowing                                *
 *       * Levinson-durbin algorithm to find a[]                          *
 *       * convert a[] to lsp[]                                           *
 *       * quantize and code the LSPs                                     *
 *       * find the interpolated LSPs and convert to a[] for the 2        *
 *         subframes (both quantized and unquantized)                     *
 *------------------------------------------------------------------------*/

  /* LP analysis */

  Autocorr(p_window, M, r_h, r_l);              /* Autocorrelations */
  Lag_window(M, r_h, r_l);                      /* Lag windowing    */
  Levinson(r_h, r_l, &A_t[MP1],rc);             /* Levinson Durbin  */
  Az_lsp(&A_t[MP1], lsp_new, lsp_old);          /* From A(z) to lsp */

  /* LSP quantization */

  Qua_lsp(lsp_new, lsp_new_q, ana);
  ana += 2;                         /* Advance analysis parameters pointer */

  /*--------------------------------------------------------------------*
   * Find interpolated LPC parameters in all subframes (both quantized  *
   * and unquantized).                                                  *
   * The interpolated parameters are in array A_t[] of size (M+1)*4     *
   * and the quantized interpolated parameters are in array Aq_t[]      *
   *--------------------------------------------------------------------*/

  Int_lpc(lsp_old, lsp_new, lsf_int, lsf_new,  A_t);
  Int_qlpc(lsp_old_q, lsp_new_q, Aq_t);

  /* update the LSPs for the next frame */

  for(i=0; i<M; i++)
  {
    lsp_old[i]   = lsp_new[i];
    lsp_old_q[i] = lsp_new_q[i];
  }

 /*----------------------------------------------------------------------*
  * - Find the weighting factors                                         *
  *----------------------------------------------------------------------*/

  perc_var(gamma1, gamma2, lsf_int, lsf_new, rc);

 /*----------------------------------------------------------------------*
  * - Find the weighted input speech w_sp[] for the whole speech frame   *
  * - Find the open-loop pitch delay                                     *
  *----------------------------------------------------------------------*/

  Weight_Az(&A_t[0], gamma1[0], M, Ap1);
  Weight_Az(&A_t[0], gamma2[0], M, Ap2);
  Residu(Ap1, &speech[0], &wsp[0], L_SUBFR);
  Syn_filt(Ap2, &wsp[0], &wsp[0], L_SUBFR, mem_w, 1);

  Weight_Az(&A_t[MP1], gamma1[1], M, Ap1);
  Weight_Az(&A_t[MP1], gamma2[1], M, Ap2);
  Residu(Ap1, &speech[L_SUBFR], &wsp[L_SUBFR], L_SUBFR);
  Syn_filt(Ap2, &wsp[L_SUBFR], &wsp[L_SUBFR], L_SUBFR, mem_w, 1);

  /* Find open loop pitch lag */

  T_op = Pitch_ol(wsp, PIT_MIN, PIT_MAX, L_FRAME);

  /* Range for closed loop pitch search in 1st subframe */

  T0_min = sub(T_op, 3);
  if (sub(T0_min,PIT_MIN)<0) {
    T0_min = PIT_MIN;
  }

  T0_max = add(T0_min, 6);
  if (sub(T0_max ,PIT_MAX)>0)
  {
     T0_max = PIT_MAX;
     T0_min = sub(T0_max, 6);
  }

 /*------------------------------------------------------------------------*
  *          Loop for every subframe in the analysis frame                 *
  *------------------------------------------------------------------------*
  *  To find the pitch and innovation parameters. The subframe size is     *
  *  L_SUBFR and the loop is repeated 2 times.                             *
  *     - find the weighted LPC coefficients                               *
  *     - find the LPC residual signal res[]                               *
  *     - compute the target signal for pitch search                       *
  *     - compute impulse response of weighted synthesis filter (h1[])     *
  *     - find the closed-loop pitch parameters                            *
  *     - encode the pitch delay                                           *
  *     - update the impulse response h1[] by including fixed-gain pitch   *
  *     - find target vector for codebook search                           *
  *     - codebook search                                                  *
  *     - encode codebook address                                          *
  *     - VQ of pitch and codebook gains                                   *
  *     - find synthesis speech                                            *
  *     - update states of weighting filter                                *
  *------------------------------------------------------------------------*/

  A  = A_t;     /* pointer to interpolated LPC parameters           */
  Aq = Aq_t;    /* pointer to interpolated quantized LPC parameters */

  i_gamma = 0;
  for (i_subfr = 0;  i_subfr < L_FRAME; i_subfr += L_SUBFR)
  {

    /*---------------------------------------------------------------*
     * Find the weighted LPC coefficients for the weighting filter.  *
     *---------------------------------------------------------------*/

    Weight_Az(A, gamma1[i_gamma], M, Ap1);
    Weight_Az(A, gamma2[i_gamma], M, Ap2);
    i_gamma = add(i_gamma,1);

    /*---------------------------------------------------------------*
     * Compute impulse response, h1[], of weighted synthesis filter  *
     *---------------------------------------------------------------*/

    for (i = 0; i <= M; i++) {
        ai_zero[i] = Ap1[i];
    }

    Syn_filt(Aq, ai_zero, h1, L_SUBFR, zero, 0);
    Syn_filt(Ap2, h1, h1, L_SUBFR, zero, 0);

   /*------------------------------------------------------------------------*
    *                                                                        *
    *          Find the target vector for pitch search:                      *
    *          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                       *
    *                                                                        *
    *              |------|  res[n]                                          *
    *  speech[n]---| A(z) |--------                                          *
    *              |------|       |   |--------| error[n]  |------|          *
    *                    zero -- (-)--| 1/A(z) |-----------| W(z) |-- target *
    *                    exc          |--------|           |------|          *
    *                                                                        *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本韩国欧美在线| 蜜臀va亚洲va欧美va天堂| 一二三四社区欧美黄| 亚洲成人三级小说| 久久精品二区亚洲w码| 国产99精品在线观看| 在线观看一区不卡| 欧美一二三区在线观看| 国产精品丝袜一区| 亚洲精品菠萝久久久久久久| 免费欧美在线视频| 99视频精品在线| 欧美精品乱码久久久久久| 久久色成人在线| 亚洲另类在线制服丝袜| 日韩国产欧美三级| 成人一道本在线| 在线播放91灌醉迷j高跟美女| 久久日一线二线三线suv| 亚洲欧美成aⅴ人在线观看| 日韩va欧美va亚洲va久久| 成人免费看片app下载| 欧美年轻男男videosbes| 中文字幕+乱码+中文字幕一区| 亚洲一区二区中文在线| 国产精品一二三四五| 综合久久综合久久| 日韩在线播放一区二区| 狠狠色伊人亚洲综合成人| 美女视频黄频大全不卡视频在线播放| 免费av网站大全久久| 欧美xingq一区二区| 欧美群妇大交群的观看方式| 亚洲精品国产a久久久久久| 日本女优在线视频一区二区 | 夜色激情一区二区| 久久精品久久久精品美女| 国产成人av福利| 日韩一级大片在线| 亚洲人吸女人奶水| 亚洲麻豆国产自偷在线| 亚洲大片精品永久免费| 成人开心网精品视频| 91麻豆精品国产91久久久使用方法| 国产无遮挡一区二区三区毛片日本| 日本成人在线网站| 欧美人体做爰大胆视频| 午夜不卡在线视频| 欧美日韩高清不卡| 一区二区三区 在线观看视频| 欧美日韩三级在线| 日韩在线卡一卡二| 亚洲精品ww久久久久久p站| 国产成人av一区二区三区在线| 欧美日韩中文字幕一区二区| 午夜精品福利视频网站| 99久久夜色精品国产网站| 中文字幕字幕中文在线中不卡视频| 国产二区国产一区在线观看| 久久这里只有精品首页| 91小视频在线观看| 日韩一区中文字幕| 从欧美一区二区三区| 国产亚洲福利社区一区| 国产福利不卡视频| 日韩一级黄色大片| 五月婷婷另类国产| 日韩一区二区三区电影| 麻豆免费精品视频| 在线播放91灌醉迷j高跟美女 | 亚洲自拍另类综合| 欧美精品一卡二卡| 国产一区高清在线| 亚洲大片一区二区三区| 国产欧美一区二区精品性色| 波多野结衣中文一区| 国产麻豆成人精品| 国产白丝网站精品污在线入口| 韩国精品在线观看| 亚洲福利视频一区二区| 亚洲自拍偷拍av| 蜜桃视频在线一区| 欧美一卡二卡在线| 美女一区二区在线观看| 亚洲精品在线网站| 国产最新精品免费| 国产无一区二区| www.久久精品| 一区二区三区四区国产精品| 在线看国产日韩| 五月天欧美精品| 宅男在线国产精品| 美女一区二区三区| 国产午夜精品一区二区三区嫩草| 国产1区2区3区精品美女| 国产精品国产三级国产普通话99 | 欧美亚一区二区| 污片在线观看一区二区| 日韩精品最新网址| 国产盗摄一区二区| 亚洲青青青在线视频| 在线观看视频一区二区欧美日韩| 午夜国产精品一区| 日韩你懂的电影在线观看| 国产99久久久国产精品潘金网站| 亚洲色图欧洲色图| 欧美精品一二三区| 国产一区二区电影| 亚洲色图在线看| 欧美一区二区三区免费| 国产黄色91视频| 亚洲精品一卡二卡| 日韩一区二区电影在线| 成人精品免费网站| 午夜天堂影视香蕉久久| 久久精品一区八戒影视| 91亚洲精品久久久蜜桃| 男人的天堂久久精品| 欧美国产日韩一二三区| 欧美狂野另类xxxxoooo| 成人综合在线视频| 污片在线观看一区二区| 中文字幕成人av| 欧美精品xxxxbbbb| 成人一区二区三区视频| 日韩va欧美va亚洲va久久| 国产精品午夜免费| 欧美一卡2卡三卡4卡5免费| a美女胸又www黄视频久久| 天天操天天综合网| 国产精品毛片无遮挡高清| 欧美一区二区三区四区视频| 99国产麻豆精品| 精品亚洲国产成人av制服丝袜| 亚洲最大色网站| 日本一区二区三区电影| 51精品久久久久久久蜜臀| 成人免费毛片app| 麻豆国产一区二区| 亚洲精品ww久久久久久p站| 久久精品日韩一区二区三区| 精品视频在线视频| 成人黄色在线网站| 久久精品国产秦先生| 一区二区三区视频在线看| 国产精品网站导航| 日韩欧美国产1| 欧美日韩国产系列| 91在线国产观看| 国产91高潮流白浆在线麻豆| 青草国产精品久久久久久| 亚洲精品久久久久久国产精华液| 国产欧美一区二区在线| 精品91自产拍在线观看一区| 欧美人伦禁忌dvd放荡欲情| 不卡在线视频中文字幕| 国产一区二区美女诱惑| 日韩av一区二| 亚洲成人三级小说| 亚洲综合久久久久| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲一区二区精品视频| 中文字幕一区二区三区四区| 久久精品在这里| 26uuu另类欧美| 日韩欧美亚洲一区二区| 欧美日韩精品欧美日韩精品| 在线影视一区二区三区| av成人免费在线| 丁香激情综合五月| 福利一区福利二区| 国产精品一二一区| 国产一区二区在线免费观看| 久久狠狠亚洲综合| 免费av网站大全久久| 日本欧美大码aⅴ在线播放| 日韩高清不卡一区二区| 午夜精品久久久久| 午夜免费欧美电影| 亚洲曰韩产成在线| 亚洲午夜羞羞片| 亚洲国产精品久久人人爱| 亚洲一二三区视频在线观看| 亚洲精品国产高清久久伦理二区| 亚洲精品五月天| 亚洲综合一区在线| 亚洲一区二区三区中文字幕在线| 一区二区三区日本| 亚洲高清免费在线| 日本午夜精品视频在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎 | 亚洲精品在线免费播放| 精品久久久久久久久久久院品网| 精品国产91乱码一区二区三区| 欧美变态tickle挠乳网站| 久久一二三国产| 国产蜜臀97一区二区三区| 成人免费一区二区三区在线观看| 亚洲乱码国产乱码精品精可以看| 亚洲第一福利视频在线|