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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? lsp.c

?? 這是國(guó)際電信聯(lián)盟頒布的G723標(biāo)準(zhǔn)
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/*
**
** File:    lsp.c
**
** Description: Functions that implement line spectral pair 
**      (LSP) operations.  
**
** Functions:
**
**  Converting between linear predictive coding (LPC) coefficients
**  and LSP frequencies:
**
**      AtoLsp()
**      LsptoA()
**
**  Vector quantization (VQ) of LSP frequencies:
**
**      Lsp_Qnt()
**      Lsp_Svq()
**      Lsp_Inq()
**
**  Interpolation of LSP frequencies:
**
**      Lsp_Int()
*/

/*
    ITU-T G.723 Speech Coder   ANSI-C Source Code     Version 5.00
    copyright (c) 1995, AudioCodes, DSP Group, France Telecom,
    Universite de Sherbrooke.  All rights reserved.
*/



/*
**
** Function:            AtoLsp()
**
** Description:     Transforms 10 LPC coefficients to the 10
**          corresponding LSP frequencies for a subframe.
**          This transformation is done once per frame,
**          for subframe 3 only.  The transform algorithm
**          generates sum and difference polynomials from
**          the LPC coefficients.  It then evaluates the
**          sum and difference polynomials at uniform
**          intervals of pi/256 along the unit circle.
**          Intervals where a sign change occurs are
**          interpolated to find the zeros of the
**          polynomials, which are the LSP frequencies.
**
** Links to text:   Section 2.5
**
** Arguments:       
**
**  Word16 *LspVect     Empty Buffer
**  Word16 Lpc[]        Unquantized LPC coefficients (10 words)
**  Word16 PrevLsp[]    LSP frequencies from the previous frame (10 words)
**
** Outputs:
**
**  Word16 LspVect[]    LSP frequencies for the current frame (10 words)
**
** Return value:        None
**
**/
void AtoLsp( Word16 *LspVect, Word16 *Lpc, Word16 *PrevLsp )
{

    int   i,j,k ;

    Word32   Lpq[LpcOrder+2] ;
    Word16   Spq[LpcOrder+2] ;

    Word16   Exp   ;
    Word16   LspCnt ;

    Word32   PrevVal,CurrVal   ;
    Word32   Acc0,Acc1   ;


 /*
  * Perform a bandwidth expansion on the LPC coefficients.  This
  * scales the poles of the LPC synthesis filter by a factor of
  * 0.994.
  */
    for ( i = 0 ; i < LpcOrder ; i ++ )
        LspVect[i] = mult_r( Lpc[i], BandExpTable[i] ) ;


 /*
  * Compute the sum and difference polynomials with the roots at z =
  * -1 (sum) or z = +1 (difference) removed.  Let these polynomials
  * be P(z) and Q(z) respectively, and let their coefficients be
  * {p_i} amd {q_i}.  The coefficients are stored in the array Lpq[]
  * as follows: p_0, q_0, p_1, q_1, ..., p_5, q_5.  There is no need
  * to store the other coefficients because of symmetry.
  */


 /*
  * Set p_0 = q_0 = 1.  The LPC coefficients are already scaled by
  *  1/4.  P(z) and Q(z) are scaled by an additional scaling factor of
  *  1/16, for an overall factor of 1/64 = 0x02000000L.
  */

    Lpq[0] = Lpq[1] = (Word32) 0x02000000L ;

 /*
  * This loop computes the coefficients of P(z) and Q(z).  The long
  * division (to remove the real zeros) is done recursively.
  */
    for ( i = 0 ; i < LpcOrder/2 ; i ++ ) {

        /* P(z) */
        Acc0 = L_negate( Lpq[2*i+0] ) ;
        Acc1 = L_deposit_h( LspVect[i] ) ;
        Acc1 = L_shr( Acc1, (Word16) 4 ) ;
        Acc0 = L_sub( Acc0, Acc1 ) ;
        Acc1 = L_deposit_h( LspVect[LpcOrder-1-i] ) ;
        Acc1 = L_shr( Acc1, (Word16) 4 ) ;
        Acc0 = L_sub( Acc0, Acc1 ) ;
        Lpq[2*i+2] = Acc0 ;

        /* Q(z) */
        Acc0 = Lpq[2*i+1] ;
        Acc1 = L_deposit_h( LspVect[i] ) ;
        Acc1 = L_shr( Acc1, (Word16) 4 ) ;

        Acc0 = L_sub( Acc0, Acc1 ) ;
        Acc1 = L_deposit_h( LspVect[LpcOrder-1-i] ) ;
        Acc1 = L_shr( Acc1, (Word16) 4 ) ;
        Acc0 = L_add( Acc0, Acc1 ) ;
        Lpq[2*i+3] = Acc0 ;
    }

 /*
  * Divide p_5 and q_5 by 2 for proper weighting during polynomial
  * evaluation.
  */
    Lpq[LpcOrder+0] = L_shr( Lpq[LpcOrder+0], (Word16) 1 ) ;
    Lpq[LpcOrder+1] = L_shr( Lpq[LpcOrder+1], (Word16) 1 ) ;

 /*
  * Normalize the polynomial coefficients and convert to shorts
  */

    /* Find the maximum */
    Acc1 = L_abs( Lpq[0] ) ;
    for ( i = 1 ; i < LpcOrder+2 ; i ++ ) {
        Acc0 = L_abs( Lpq[i] ) ;
        if ( Acc0 > Acc1 )
            Acc1 = Acc0 ;
    }

    /* Compute the normalization factor */
    Exp = norm_l( Acc1 ) ;


    /* Normalize and convert to shorts */
    for ( i = 0 ; i < LpcOrder+2 ; i ++ ) {
        Acc0 = L_shl( Lpq[i], Exp ) ;
        Spq[i] = round( Acc0 ) ;
    }

 /*
  * Initialize the search loop
  */

 /*
  * The variable k is a flag that indicates which polynomial (sum or
  * difference) the algorithm is currently evaluating.  Start with
  * the sum.
  */
    k = 0 ;

    /* Evaluate the sum polynomial at frequency zero */
    PrevVal = (Word32) 0 ;
    for ( j = 0 ; j <= LpcOrder/2 ; j ++ )
        PrevVal = L_mac( PrevVal, Spq[2*j], CosineTable[0] ) ;


 /*
  * Search loop.  Evaluate P(z) and Q(z) at uniform intervals of
  * pi/256 along the unit circle.  Check for zero crossings.  The
  * zeros of P(w) and Q(w) alternate, so only one of them need by
  * evaluated at any given step.
  */
    LspCnt = (Word16) 0 ;
    for ( i = 1 ; i < CosineTableSize/2 ; i ++ ) {

        /* Evaluate the selected polynomial */
        CurrVal = (Word32) 0 ;
        for ( j = 0 ; j <= LpcOrder/2 ; j ++ )
            CurrVal = L_mac( CurrVal, Spq[LpcOrder-2*j+k],
                                    CosineTable[i*j%CosineTableSize] ) ;

        /* Check for a sign change, indicating a zero crossing */
        if ( (CurrVal ^ PrevVal) < (Word32) 0 ) {

 /*
  * Interpolate to find the bottom 7 bits of the
  * zero-crossing frequency
  */
            Acc0 = L_abs( CurrVal ) ;
            Acc1 = L_abs( PrevVal ) ;
            Acc0 = L_add( Acc0, Acc1 ) ;

            /* Normalize the sum */
            Exp = norm_l( Acc0 ) ;
            Acc0 = L_shl( Acc0, Exp ) ;
            Acc1 = L_shl( Acc1, Exp ) ;

            Acc1 = L_shr( Acc1, (Word16) 8 ) ;

            LspVect[LspCnt] = div_l( Acc1, extract_h( Acc0 ) ) ;

 /*
  * Add the upper part of the zero-crossing frequency,
  * i.e. bits 7-15
  */
            Exp = shl( (Word16) (i-1), (Word16) 7 ) ;
            LspVect[LspCnt] = add( LspVect[LspCnt], Exp ) ;
            LspCnt ++ ;

            /* Check if all zeros have been found */
            if ( LspCnt == (Word16) LpcOrder )
                break ;

 /*
  * Switch the pointer between sum and difference polynomials
  */
            k ^= 1 ;

 /*
  * Evaluate the new polynomial at the current frequency
  */
            CurrVal = (Word32) 0 ;
            for ( j = 0 ; j <= LpcOrder/2 ; j ++ )
                CurrVal = L_mac( CurrVal, Spq[LpcOrder-2*j+k],
                                    CosineTable[i*j%CosineTableSize] ) ;
        }

        /* Update the previous value */
        PrevVal = CurrVal ;
    }


 /*
  * Check if all 10 zeros were found.  If not, ignore the results of
  * the search and use the previous frame's LSP frequencies instead.
  */
    if ( LspCnt != (Word16) LpcOrder ) {
        for ( j = 0 ; j < LpcOrder ; j ++ )
            LspVect[j] = PrevLsp[j] ;
    }

    return ;
}

/*
**
** Function:            Lsp_Qnt()
**
** Description:     Vector quantizes the LSP frequencies.  The LSP
**          vector is divided into 3 sub-vectors, or
**          bands, of dimension 3, 3, and 4.  Each band is
**          quantized separately using a different VQ
**          table.  Each table has 256 entries, so the
**          quantization generates three indices of 8 bits
**          each.  (Only the LSP vector for subframe 3 is
**          quantized per frame.)
**
** Links to text:   Section 2.5
**
** Arguments:       
**
**  Word16 CurrLsp[]    Unquantized LSP frequencies for the current frame (10 words)
**  Word16 PrevLsp[]    LSP frequencies from the previous frame (10 words)
**
** Outputs:             Quantized LSP frequencies for the current frame (10 words)
**
** Return value:
**
**  Word32      Long word packed with the 3 VQ indices.  Band 0
**          corresponds to bits [23:16], band 1 corresponds
**          to bits [15:8], and band 2 corresponds to bits [7:0].
**          (Bit 0 is the least significant.)
**
*/
Word32   Lsp_Qnt( Word16 *CurrLsp, Word16 *PrevLsp )
{
    int   i ;

    Word16   Wvect[LpcOrder] ;

    Word16   Tmp0,Tmp1   ;
    Word16   Exp   ;


 /*
  * Compute the VQ weighting vector.  The weights assign greater
  * precision to those frequencies that are closer together.
  */

    /* Compute the end differences */
    Wvect[0] = sub( CurrLsp[1], CurrLsp[0] ) ;
    Wvect[LpcOrder-1] = sub( CurrLsp[LpcOrder-1], CurrLsp[LpcOrder-2] ) ;

    /* Compute the rest of the differences */
    for ( i = 1 ; i < LpcOrder-1 ; i ++ ) {
        Tmp0 = sub( CurrLsp[i+1], CurrLsp[i] ) ;
        Tmp1 = sub( CurrLsp[i], CurrLsp[i-1] ) ;
        if ( Tmp0 > Tmp1 )
            Wvect[i] = Tmp1 ;
        else
            Wvect[i] = Tmp0 ;
    }

    /* Invert the differences */
    Tmp0 = (Word16) 0x0020 ;
    for ( i = 0 ; i < LpcOrder ; i ++ ) {

        if ( Wvect[i] > Tmp0 )
            Wvect[i] = div_s( Tmp0, Wvect[i] ) ;
        else
            Wvect[i] = MAX_16 ;
    }

    /* Normalize the weight vector */
    Tmp0 = (Word16) 0 ;
    for ( i = 0 ; i < LpcOrder ; i ++ )
        if ( Wvect[i] > Tmp0 )
            Tmp0 = Wvect[i] ;

    Exp = norm_s( Tmp0 ) ;
    for ( i = 0 ; i < LpcOrder ; i ++ )
        Wvect[i] = shl( Wvect[i], Exp ) ;


 /*
  * Compute the VQ target vector.  This is the residual that remains
  * after subtracting both the DC and predicted
  * components.
  */

 /*
  * Subtract the DC component from both the current and previous LSP
  * vectors.
  */
    for ( i = 0 ; i < LpcOrder ; i ++ ) {
        CurrLsp[i] = sub( CurrLsp[i], LspDcTable[i] ) ;
        PrevLsp[i] = sub( PrevLsp[i], LspDcTable[i] ) ;
    }

 /*
  * Generate the prediction vector and subtract it.  Use a constant
  * first-order predictor based on the previous (DC-free) LSP
  * vector.
  */
    for ( i = 0 ; i < LpcOrder ; i ++ ) {
        Tmp0 = mult_r( PrevLsp[i], (Word16) LspPrd0 ) ;
        CurrLsp[i] = sub( CurrLsp[i], Tmp0 ) ;
    }

 /*
  * Add the DC component back to the previous LSP vector.  This
  * vector is needed in later routines.
  */
    for ( i = 0 ; i < LpcOrder ; i ++ )
        PrevLsp[i] = add( PrevLsp[i], LspDcTable[i] ) ;

 /*
  * Do the vector quantization for all three bands
  */
    return Lsp_Svq( CurrLsp, Wvect ) ;
}

/*
**
** Function:            Lsp_Svq()
**
** Description:     Performs the search of the VQ tables to find
**          the optimum LSP indices for all three bands.
**          For each band, the search finds the index which 
**          minimizes the weighted squared error between 
**          the table entry and the target.
**
** Links to text:   Section 2.5
**
** Arguments:       
**
**  Word16 Tv[]     VQ target vector (10 words)
**  Word16 Wvect[]      VQ weight vector (10 words)
**
** Outputs:         None
**
** Return value:    
**
**  Word32      Long word packed with the 3 VQ indices.  Band 0
**          corresponds to bits [23:16], band 1 corresponds
**          to bits [15:8], and band 2 corresponds to bits [7:0].
**              
*/
Word32   Lsp_Svq( Word16 *Tv, Word16 *Wvect )
{
    int   i,j,k ;

    Word32   Rez,Indx    ;
    Word32   Acc0,Acc1   ;

    Word16   Tmp[LpcOrder] ;
    Word16  *LspQntPnt  ;


 /*
  * Initialize the return value
  */
    Rez = (Word32) 0 ;

 /*
  * Quantize each band separately
  */
    for ( k = 0 ; k < LspQntBands ; k ++ ) {

 /*
  * Search over the entire VQ table to find the index that
  * minimizes the error.
  */

        /* Initialize the search */
        Acc1 = (Word32) -1 ;
        Indx = (Word32) 0 ;
        LspQntPnt = BandQntTable[k] ;

        for ( i = 0 ; i < LspCbSize ; i ++ ) {

 /*
  * Generate the metric, which is the negative error with the
  * constant component removed.
  */
            for ( j = 0 ; j < BandInfoTable[k][1] ; j ++ )
                Tmp[j] = mult_r( Wvect[BandInfoTable[k][0]+j],
                                                            LspQntPnt[j] ) ;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久亚洲一区二区三区青草| 色综合久久综合网| 亚洲人吸女人奶水| 欧美一区二区三区不卡| www.欧美日韩国产在线| 免费在线看一区| 亚洲免费色视频| 国产亚洲一区字幕| 4438亚洲最大| 91看片淫黄大片一级在线观看| 麻豆国产精品777777在线| 一区二区三区在线观看网站| 久久久久久久久久久电影| 欧美日韩三级在线| 99在线热播精品免费| 韩国午夜理伦三级不卡影院| 亚洲成av人片在线观看无码| 中文字幕一区在线观看视频| 精品国产髙清在线看国产毛片| 欧美三级资源在线| 99精品视频免费在线观看| 国产乱人伦精品一区二区在线观看| 丝袜美腿高跟呻吟高潮一区| 亚洲美女免费在线| 最新中文字幕一区二区三区 | 91精品国产综合久久婷婷香蕉| 99综合电影在线视频| 国产九九视频一区二区三区| 免费人成在线不卡| 三级精品在线观看| 亚洲制服丝袜av| 一区二区三区欧美激情| 中文字幕中文字幕一区| 国产色一区二区| 久久影音资源网| 26uuu成人网一区二区三区| 日韩女优电影在线观看| 91精品福利在线一区二区三区 | 日韩国产高清影视| 青青草视频一区| 美女精品一区二区| 日本 国产 欧美色综合| 免费观看30秒视频久久| 美女一区二区在线观看| 看电视剧不卡顿的网站| 九一九一国产精品| 国产一区二区三区精品欧美日韩一区二区三区| 六月丁香综合在线视频| 久久99精品一区二区三区| 久99久精品视频免费观看| 日本不卡视频在线| 黄色日韩三级电影| 成人国产电影网| 色综合视频在线观看| 欧美日本一道本| 久久在线免费观看| 国产精品美女一区二区| 一区二区三区中文字幕| 视频一区二区三区在线| 国内外成人在线| 成人精品国产一区二区4080| 91原创在线视频| 欧美性感一类影片在线播放| 欧美精品黑人性xxxx| 精品国产免费人成电影在线观看四季| 久久综合五月天婷婷伊人| 欧美激情一区不卡| 亚洲日本乱码在线观看| 亚洲成人av福利| 国产毛片精品视频| 色婷婷精品久久二区二区蜜臀av| 欧美日韩国产精品自在自线| 在线免费观看不卡av| 欧美精品 国产精品| 久久久久国产精品麻豆ai换脸| 亚洲天堂精品视频| 蜜桃91丨九色丨蝌蚪91桃色| 成人美女视频在线看| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 69久久夜色精品国产69蝌蚪网| 久久久久久免费毛片精品| 有坂深雪av一区二区精品| 人人超碰91尤物精品国产| 成人精品视频.| 911国产精品| 国产精品久久久99| 美女www一区二区| 色av综合在线| 久久精品视频在线看| 亚洲一区二区成人在线观看| 国产原创一区二区三区| 欧美日韩免费观看一区三区| 国产日本亚洲高清| 日韩成人一区二区三区在线观看| 懂色中文一区二区在线播放| 欧美日韩国产系列| 中文字幕在线不卡一区二区三区| 精品一区二区三区免费毛片爱| 色综合天天视频在线观看 | 伊人一区二区三区| 国产精品主播直播| 欧美高清hd18日本| 亚洲色图另类专区| 国产精品一区在线| 日韩欧美国产综合在线一区二区三区| 亚洲欧洲日韩一区二区三区| 国产一区999| 日韩欧美一二区| 午夜精品福利视频网站| 色婷婷久久久久swag精品| 国产欧美一区二区精品性| 日本在线播放一区二区三区| 91豆麻精品91久久久久久| 国产欧美一区二区三区鸳鸯浴| 久久电影国产免费久久电影| 欧美日韩高清一区| 一区二区三区精密机械公司| 成人av网站在线| 亚洲国产另类精品专区| 欧美日韩黄视频| 日韩一二三四区| 亚洲成人一区二区在线观看| 色天天综合色天天久久| 18成人在线观看| 99视频一区二区| 中文字幕高清不卡| 国产成人aaaa| 国产三级一区二区| 国产精品一区二区在线看| 欧美tk—视频vk| 久久99精品国产.久久久久| 日韩视频一区在线观看| 日本 国产 欧美色综合| 日韩欧美国产不卡| 美女视频免费一区| 久久综合成人精品亚洲另类欧美| 激情av综合网| 国产喷白浆一区二区三区| 国产一区 二区 三区一级| 国产日韩av一区| 99久久精品情趣| 一区二区三区免费看视频| 91久久精品国产91性色tv| 亚洲精品成人少妇| 欧美日韩中文精品| 日本亚洲三级在线| 日韩一级二级三级| 国内精品伊人久久久久影院对白| 精品国产免费人成电影在线观看四季| 国内精品免费**视频| 亚洲国产激情av| 一本色道久久综合精品竹菊| 亚洲高清久久久| 欧美一区二区三区视频免费 | 欧美精品一区二区三区视频| 国产伦精一区二区三区| 国产精品久久夜| 欧美午夜精品一区二区蜜桃| 亚洲成av人片在线| 精品国产免费久久| 成人av综合在线| 性久久久久久久久久久久| 日韩一级二级三级精品视频| 国产电影精品久久禁18| 一区二区三区在线观看国产| 欧美一级片免费看| www.欧美日韩国产在线| 午夜视频一区在线观看| 久久综合色一综合色88| 94色蜜桃网一区二区三区| 日欧美一区二区| 国产欧美一区二区三区在线看蜜臀| 日本韩国欧美在线| 免费观看在线色综合| 中文字幕一区二区三区在线不卡| 欧美性感一区二区三区| 国产乱码精品一区二区三区忘忧草 | 2024国产精品视频| 91视频在线看| 久久国内精品视频| 亚洲欧美乱综合| 精品国产乱码久久久久久久久| 91一区二区在线| 久久黄色级2电影| 亚洲制服丝袜在线| 久久你懂得1024| 欧美色老头old∨ideo| 成人综合婷婷国产精品久久蜜臀 | 亚洲成av人综合在线观看| 国产亚洲精品aa午夜观看| 欧美亚洲动漫制服丝袜| 国产精品自拍毛片| 天天影视网天天综合色在线播放 | 日本一区二区成人在线| 69av一区二区三区| 91日韩在线专区| 国产一区在线精品| 奇米777欧美一区二区| 亚洲三级在线看| 国产无一区二区|