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

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

?? exc2.cpp

?? G711語音壓縮源碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
//#include "stdafx.h"
#include <math.h>
#include <memory.h>
#include <float.h>

#include "LanAudio.h"
#include "Global.h"

/*
**
** File:    exc2.c
**
** Description: Functions that implement adaptive and fixed codebook
**       operations.
**
** Functions:
**
**  Computing Open loop Pitch lag:
**
**      Estim_Pitch()
**
**  Harmonic noise weighting:
**
**      Comp_Pw()
**      Filt_Pw()
**
**  Fixed Cobebook computation:
**
**      Find_Fcbk()
**      Gen_Trn()
**      Find_Best()
**      Fcbk_Pack()
**      Fcbk_Unpk()
**      ACELP_LBC_code()
**      Cor_h()
**      Cor_h_X()
**      reset_max_time()
**      D4i64_LBC()
**      G_code()
**      search_T0()
**
**  Adaptive Cobebook computation:
**
**      Find_Acbk()
**      Get_Rez()
**      Decod_Acbk()
**
**  Pitch postfilter:
**      Comp_Lpf()
**      Find_B()
**      Find_F()
**      Filt_Lpf()
**
**  Residual interpolation:
**
**      Comp_Info()
**      Regen()
**
** Functions used to avoid possible explosion of the decoder
** excitation in case of series of long term unstable filters
** and when the encoder and the decoder are de-synchronized
**
**      Update_Err()
**      Test_Err()
*/

/*
**
** Function:        Estim_Pitch()
**
** Description: Open loop pitch estimation made twice per frame (one for
**              the first two subframes and one for the last two).
**              The method is based on the maximization of the
**              crosscorrelation of the speech.
**
** Links to text:   Section 2.9
**
** Arguments:
**
**  float *Dpnt    Perceptually weighted speech
**  int   Start    Starting index defining the subframes under study
**
** Outputs:
**
** Return value:
**
**  int      Open loop pitch period
**
*/
/*int Estim_Pitch(float *Dpnt, int Start)
{
    int     i;

    int     Pr,Indx = PitchMin;
    float   MaxE = (float)1.0;
    float   MaxC = (float)0.0;
    float   E,C,C2,Diff;

    Pr = Start - PitchMin + 1;

    /* Init the energy estimate */

//    E = DotProd(&Dpnt[Pr],&Dpnt[Pr],2*SubFrLen);
  /*  E = DotProd10(&Dpnt[Pr],&Dpnt[Pr],2*SubFrLen);

    /* Main Open loop pitch search loop */

 /*   for (i=PitchMin; i <= PitchMax-3; i++)
    {
        Pr--;

        /* Update energy, compute cross */

  /*      E = E - Dpnt[Pr+2*SubFrLen]*Dpnt[Pr+2*SubFrLen] + Dpnt[Pr]*Dpnt[Pr];
//        C = DotProd(&Dpnt[Start],&Dpnt[Pr],2*SubFrLen);
        C = DotProd10(&Dpnt[Start],&Dpnt[Pr],2*SubFrLen);
        C2 = C*C;

        /* Check for new maximum */

    /*    Diff = C2*MaxE - E*MaxC;
        if (E > (float)0.0 && C > (float)0.0)
        {
            if ((Diff > (float)0.0 && ((i - Indx) < PitchMin))
                 || (Diff > (float)0.25*C2*MaxE))
            {
                Indx = i;
                MaxE = E;
                MaxC = C2;
            }
        }
    }
    return Indx;
}*/
int Estim_Pitch(float *Dpnt, int Start)
{
    int     i;

    int     Pr,Indx = PitchMin,Indx2;
    float   MaxE = (float)1.0;
    float   MaxC = (float)0.0;
    float   E,C,C2,Diff;
	float	EARR[144];
	;//Pr = Start - PitchMin + 1;
    Pr = Start - PitchMin + 1;

    /* Init the energy estimate */

    E = DotProd10(&Dpnt[Pr],&Dpnt[Pr],2*SubFrLen);
	for(i=PitchMin;i<=PitchMax-3;i++)
	{
		E=E - Dpnt[Start-i+2*SubFrLen]*Dpnt[Start-i+2*SubFrLen] + Dpnt[Start-i]*Dpnt[Start-i];
		EARR[i]=E;
	}
    /* Main Open loop pitch search loop */
    for (i=PitchMin+1; i <= PitchMax-3; i+=2)
    {
        Pr-=2;

        /* Update energy, compute cross */

		E=EARR[i];
        C = DotProd10(&Dpnt[Start],&Dpnt[Start-i],2*SubFrLen);     ;//not allign
        C2 = C*C;
        /* Check for new maximum */
        Diff = C2*MaxE - E*MaxC;
        if (E > (float)0.0 && C > (float)0.0)
        {
            if ((Diff > (float)0.0 && ((i - Indx) < PitchMin))
                 || (Diff > (float)0.25*C2*MaxE))
            {
                Indx = i;
                MaxE = E;
                MaxC = C2;
            }
        }
    }
    Indx2=Indx;
	C = DotProd10(&Dpnt[Start],&Dpnt[Start-(Indx-1)],2*SubFrLen);     
	E=EARR[Indx-1];
	C2=C*C;
	Diff = C2*MaxE - E*MaxC;
    if (E > (float)0.0 && C > (float)0.0)
    {
        if (Diff > (float)0.0)
               
        {
            Indx2 = Indx-1;
            MaxE = E;
            MaxC = C2;
        }
     }
	C = DotProd10(&Dpnt[Start],&Dpnt[Start-(Indx+1)],2*SubFrLen);     
	E=EARR[Indx+1];
	C2=C*C;
	Diff = C2*MaxE - E*MaxC;
    if (E > (float)0.0 && C > (float)0.0)
    {
        if (Diff > (float)0.0)
            
        {
            Indx2 = Indx+1;
            MaxE = E;
            MaxC = C2;
        }
     }
	return Indx2;
}

/*
**
** Function:        Comp_Pw()
**
** Description:     Computes harmonic noise filter coefficients.
**                  For each subframe, the optimal lag is searched around the
**                  open loop pitch lag based on only positive correlation
**                  maximization.
**
** Links to text:   Section 2.11
**
** Arguments:
**
**  float *Dpnt    Formant perceptually weighted speech
**  int   Start
**  int   Olp      Open loop pitch lag
**
** Outputs:         None
**
** Return value:
**
**  PWDEF   short  Indx  lag of the harmonic noise shaping filter
**          float   Gain  gain of the harmonic noise shaping filter
**
*/
PWDEF Comp_Pw(float *Dpnt, int Start, int Olp)
{

    int     i, k;
    float   Energy,C,E,C2,MaxE,MaxC2,MaxC,Gopt;
    PWDEF   Pw;

    /* Compute target energy */

//    Energy = DotProd(&Dpnt[Start],&Dpnt[Start],SubFrLen);
    Energy = DotProd10(&Dpnt[Start],&Dpnt[Start],SubFrLen);

    /* Find position with maximum C2/E value */

    MaxE = (float)1.0;
    MaxC = (float)0.0;
    MaxC2 = (float)0.0;
    Pw.Indx = -1;
    Pw.Gain = (float)0.0;
    k = Start - (Olp-PwRange);

    for (i=0; i <= 2*PwRange; i++)
    {
//        C = DotProd(&Dpnt[Start],&Dpnt[k],SubFrLen);
//        E = DotProd(&Dpnt[k],&Dpnt[k],SubFrLen);
        C = DotProd10(&Dpnt[Start],&Dpnt[k],SubFrLen);
        E = DotProd10(&Dpnt[k],&Dpnt[k],SubFrLen);
        k--;

        if (E > (float)0.0 && C > (float)0.0)
        {
            C2 = C*C;
            if (C2*MaxE > E*MaxC2)
            {
                Pw.Indx = i;
                MaxE = E;
                MaxC = C;
                MaxC2 = C2;
            }
        }
    }

    if ( Pw.Indx == -1 )
    {
        Pw.Indx = Olp ;
        return Pw ;
    }

    Pw.Gain = (float)0.0;
    if (MaxC2 > MaxE*Energy*(float)0.375)
    {
        if (MaxC > MaxE || MaxE == (float)0.0)
            Gopt = (float)1.0;
        else
            Gopt = MaxC/MaxE;

        Pw.Gain = (float)0.3125*Gopt;
    }
    Pw.Indx = Olp - PwRange + Pw.Indx;
    return Pw;
}

/*
**
** Function:        Filt_Pw()
**
** Description:     Applies harmonic noise shaping filter.
**                  Lth order FIR filter on each subframe (L: filter lag).
**
** Links to text:   Section 2.11
**
** Arguments:
**
**  float *DataBuff     Target vector
**  float *Dpnt         Formant perceptually weighted speech
**  int   Start
**  PWDEF Pw            Parameters of the harmonic noise shaping filter
**
** Outputs:
**
**  float *DataBuff     Target vector
**
** Return value:        None
**
*/
void  Filt_Pw(float *DataBuff, float *Dpnt, int Start, PWDEF Pw)
{
    int i;

    /* Perform the harmonic weighting */

    for (i=0; i < SubFrLen; i++)
        DataBuff[Start+i] = Dpnt[PitchMax+Start+i] -
                            Pw.Gain*Dpnt[PitchMax+Start-Pw.Indx+i];
    return;
}

/*
**
** Function:        Gen_Trn()
**
** Description:     Generation of a train of Dirac functions with the period
**                  Olp.
**
** Links to text:   Section 2.15
**
** Arguments:
**
**  float  *Dst     Fixed codebook excitation vector with  train of Dirac
**  float  *Src     Fixed codebook excitation vector without train of Dirac
**  int    Olp      Closed-loop pitch lag of subframe 0 (for subframes 0 & 1)
**                  Closed-loop pitch lag of subframe 2 (for subframes 2 & 3)
**
** Outputs:
**
**  float  *Dst     excitation vector
**
** Return value:    None
**
*/
void  Gen_Trn(float *Dst, float *Src, int Olp)
{
    int    i;
    int    Tmp0;
    float  Tmp[SubFrLen];

    Tmp0 = Olp;

    for (i=0; i < SubFrLen; i++) {
        Tmp[i] = Src[i];
        Dst[i] = Src[i];
    }

    while (Tmp0 < SubFrLen) {
        for (i=Tmp0; i < SubFrLen; i++)
            Dst[i] += Tmp[i-Tmp0];

        Tmp0 += Olp;
    }
    return;
}


/*
**
** Function:        Find_Best()
**
** Description:     Fixed codebook search for the high rate encoder.
**                  It performs the quantization of the residual signal.
**                  The excitation made of Np positive or negative pulses
**                  multiplied by a gain and whose positions on the grid are
**                  either all odd or all even, should approximate as best as
**                  possible the residual signal (perceptual criterion).
**
** Links to text:   Section 2.15
**
** Arguments:
**
**  BESTDEF *Best   Parameters of the best excitation model
**  float  *Tv      Target vector
**  float  *ImpResp Impulse response of the combined filter
**  int    Np       Number of pulses (6 for even subframes, 5 for odd)
**  int    Olp      Closed-loop pitch lag of subframe 0 (for subframes 0 & 1)
**                  Closed-loop pitch lag of subframe 2 (for subframes 2 & 3)
**
** Outputs:
**
**  BESTDEF *Best
**
** Return value:    None
**
*/
void  Find_Best(BESTDEF *Best, float *Tv, float *ImpResp,int Np,int Olp)
{

    int     i,j,k,l;
    BESTDEF  Temp;

    int     MaxAmpId;
    float   MaxAmp;
    float   Acc0,Acc1,Acc2;

    float   Imr[SubFrLen];
    float   OccPos[SubFrLen];
    float   ImrCorr[SubFrLen];
    float   ErrBlk[SubFrLen];
    float   WrkBlk[SubFrLen];


    /* Update Impulse responce */

    if (Olp < (SubFrLen-2)) {
        Temp.UseTrn = 1;
        Gen_Trn(Imr, ImpResp, Olp);
    }
    else {
        Temp.UseTrn = 0;
        for (i = 0; i < SubFrLen; i++)
            Imr[i] = ImpResp[i];
    }

    /* Copy Imr */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜视频在线观看一区| 午夜精品福利一区二区三区蜜桃| 欧美色综合网站| 在线视频一区二区三| 在线观看免费亚洲| 欧美色国产精品| 欧美电影一区二区| 日韩亚洲欧美高清| 欧美xxxxx牲另类人与| 精品国产乱子伦一区| 精品国产三级a在线观看| 欧美精品一区二区三区很污很色的| 精品99一区二区| 国产日韩v精品一区二区| 国产精品久久福利| 亚洲欧美色图小说| 视频在线在亚洲| 国产一区二区三区久久悠悠色av| 国产91在线看| 91九色02白丝porn| 欧美一区二区播放| 欧美国产在线观看| 亚洲色图清纯唯美| 蜜桃视频免费观看一区| 国产成人aaa| 欧美日韩免费电影| 国产日韩欧美激情| 五月天丁香久久| 国产精品99久久久久久久vr| 91女厕偷拍女厕偷拍高清| 在线观看91av| 国产精品每日更新| 丝袜美腿亚洲色图| 777久久久精品| 久久久久久久综合日本| 亚洲人成小说网站色在线 | 精久久久久久久久久久| 懂色av中文一区二区三区| 色哟哟日韩精品| 久久久久久久久岛国免费| 亚洲自拍与偷拍| 丁香婷婷深情五月亚洲| 日韩一区国产二区欧美三区| 日韩理论片中文av| 精品一区二区免费视频| 日本丶国产丶欧美色综合| 久久综合九色综合97_久久久| 亚洲自拍另类综合| 风间由美一区二区av101| 日韩亚洲欧美一区二区三区| 亚洲久草在线视频| 国产mv日韩mv欧美| 久久午夜色播影院免费高清| 青草国产精品久久久久久| 91色视频在线| 一区精品在线播放| 国产99精品国产| 久久久久久综合| 美洲天堂一区二卡三卡四卡视频 | 免费成人av在线播放| 91老师国产黑色丝袜在线| 欧美精品一区二区久久久| 五月天婷婷综合| 欧美日韩国产一级片| 亚洲欧美激情插| 成人app在线| 国产拍揄自揄精品视频麻豆| 精品在线视频一区| 精品人伦一区二区色婷婷| 亚洲成av人片在线观看| 欧美影片第一页| 性久久久久久久久久久久| 在线视频欧美精品| 亚洲chinese男男1069| 91国产成人在线| 亚洲一卡二卡三卡四卡五卡| 91久久精品一区二区三区| 国产精品资源在线观看| 久久日韩粉嫩一区二区三区| 麻豆精品在线播放| 国产亚洲成aⅴ人片在线观看| 国产高清在线精品| 中文字幕亚洲精品在线观看| 色综合久久久久综合体桃花网| 亚洲欧美国产高清| 欧美在线999| 日韩高清国产一区在线| 精品国产一区二区三区忘忧草 | 国产精品理论在线观看| 毛片av一区二区三区| 日韩一级成人av| 狠狠色狠狠色综合日日91app| 久久久一区二区三区捆绑**| 成人黄色电影在线 | 欧美精品v国产精品v日韩精品| 日韩国产一区二| 国产亚洲综合在线| 成人av资源站| 亚洲成人午夜电影| 久久这里只有精品视频网| www.一区二区| 轻轻草成人在线| 国产日产精品1区| 国产色爱av资源综合区| av男人天堂一区| 日本午夜一本久久久综合| 国产亲近乱来精品视频| 欧美丝袜丝交足nylons图片| 精品一区二区三区欧美| 日韩毛片在线免费观看| 91精品免费在线观看| 国产999精品久久久久久| 亚洲午夜激情网页| 中文字幕欧美激情一区| 欧美电影影音先锋| www.欧美色图| 久久91精品国产91久久小草| 国产精品久久三区| 欧美变态tickling挠脚心| 91麻豆免费观看| 国产高清精品网站| 免费成人av在线播放| 亚洲免费av在线| 国产欧美精品一区| 欧美一级日韩免费不卡| 一本色道久久加勒比精品| 国产在线视视频有精品| 天使萌一区二区三区免费观看| 中文字幕一区二区三区四区不卡 | 精品日韩成人av| 欧美日韩高清一区二区不卡| www.爱久久.com| 国产精品69久久久久水密桃| 日韩国产在线一| 亚洲综合久久久| 1000部国产精品成人观看| 久久中文字幕电影| 日韩精品一区二区三区四区视频| 欧美性大战久久久久久久| 91在线观看高清| 国产成人精品一区二区三区四区| 精品亚洲国内自在自线福利| 日本成人在线不卡视频| 日韩精品午夜视频| 亚洲一区二区在线观看视频| 一区二区在线免费观看| 18涩涩午夜精品.www| 亚洲欧洲国产日韩| 亚洲国产高清aⅴ视频| 国产午夜精品福利| 欧美激情在线观看视频免费| 久久久高清一区二区三区| 欧美一级黄色片| 精品国产3级a| 国产日韩一级二级三级| 国产亚洲精品福利| 中文字幕一区二区5566日韩| 国产精品久久久久久久久动漫 | 日韩久久久久久| 91精品国产一区二区| 日韩一区二区三区四区五区六区| 5858s免费视频成人| 日韩欧美的一区| 国产婷婷一区二区| 国产精品久久久久一区二区三区共| 最新久久zyz资源站| 亚洲精品亚洲人成人网| 午夜a成v人精品| 精品亚洲国产成人av制服丝袜 | 99热国产精品| 91国偷自产一区二区使用方法| 欧美性生活大片视频| 欧美成人激情免费网| 国产精品亲子乱子伦xxxx裸| 亚洲色图都市小说| 亚洲chinese男男1069| 国产一区二区三区不卡在线观看| 成人中文字幕合集| 日本精品视频一区二区三区| 91精品蜜臀在线一区尤物| 国产网站一区二区三区| 亚洲激情自拍偷拍| 精品一区二区三区蜜桃| 国产91丝袜在线18| 欧美精品一级二级| 国产精品免费人成网站| 亚洲午夜久久久久久久久电影网| 精品一区二区三区香蕉蜜桃| 91在线视频播放地址| 宅男在线国产精品| 国产精品激情偷乱一区二区∴| 亚洲一区二区三区视频在线| 国产精品一区一区三区| 欧美在线高清视频| 欧美激情在线观看视频免费| 日产欧产美韩系列久久99| 91在线观看污| 国产亚洲一区二区三区在线观看 | 91久久香蕉国产日韩欧美9色| 日韩你懂的在线播放|