⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 get_lsp_pol.asm

📁 ADI BLACKFIN BF533的音频编解码程序
💻 ASM
字号:
/*******************************************************************************
Copyright(c) 2000 - 2002 Analog Devices. All Rights Reserved.
Developed by Joint Development Software Application Team, IPDC, Bangalore, India
for Blackfin DSPs  ( Micro Signal Architecture 1.0 specification).

By using this module you agree to the terms of the Analog Devices License
Agreement for DSP Software. 
********************************************************************************
Module Name     : get_lsp_pol.asm
Label name      :  __get_lsp_pol
Version         :   1.0
Change History  :

                Version     Date          Author      Comments
                1.0         06/26/2001    Srinivas    Original 

Description     :  Finds the sum (f1) or difference (f2) polynomials.
  
                  This is performed by expanding the product polynomials:

                  F1(z) =   product   ( 1 - 2 lsp[i] z^-1 + z^-2 )
                            i=0,2,4,6,8
                  F2(z) =   product   ( 1 - 2 lsp[i] z^-1 + z^-2 )
                            i=1,3,5,7,9

                  where lsp[] is the LSP vector in the cosine domain.

                  The expansion is performed using the following recursion:

                  f[0] = 1
                  b = -2.0 * lsp[0]
                  f[1] = b

                  for i=2 to 5 do
                     b = -2.0 * lsp[2*i-2];
                     f[i] = b*f[i-1] + 2.0*f[i-2];
                     for j=i-1 down to 2 do
                        f[j] = f[j] + b*f[j-1] + f[j-2];
                        f[1] = f[1] + b;

Prototype       : void get_lsp_pol(fract16 lsp, fract32 *f)

Assumptions     : (1) order of the polynomial is assumed to be n = 5

Registers Used  : A1, R0-R3, R7, I2, P0-P5, LC0, LC1.

Performance     :
                    Code size    : 174 bytes.
*****************************************************************************/
.section   L1_code;
.global    __get_lsp_pol;
.align 8;
    
__get_lsp_pol:
    P1 = R0;                //ptr to lsp array
    [--SP] = (R7:7,P5:3);
    
    P3 = 4;
    I2 = R1;                //ptr to f array
    R0.H = 0X100;           //1 in 8.24 format
    R0.L = R0.L-R0.L(S) || R1 = W[P1++P3](X);
                            //load lsp[0] 
    R1 = -R1;               //-lsp[0]
    R1 = R1 << 10 || [I2--] = R0;
                            //f[1] = -2.0 * lsp[0] in 8.24 format, f[0] = 1 
    P4 = 1;                 //inner loop counter
    P5 = -8;
    R2 = W[P1++P3](X) || [I2--] = R1;
                            //load lsp[2], store f[1] 
    R7 = (A1 = R2.L * R1.L)(M);
                            //lsp[2]*f[1] (cross product 32 bit * 16 bit 
                            //multiplication) 
    A1 = A1 >>> 15;
    R7 = (A1 += R1.H * R2.L);
                            //lsp[2]*f[1] 
    R0 = R0 - R7(S);        //f[0]-lsp[2]*f[1]
    R0 = R0 << 1 || NOP;    //2*(f[0]-lsp[2]*f[1])
    R2 = R2 << 10 || [I2--] = R0;
                            //2*lsp[2] in 8.24 format, store f[2] 
    P2 = I2;                //pointing to f[3]
    R7 = R1 - R2 (S) || R1 = W[P1++P3](X);
                            //f[1] = f[1] - 2*lsp[2], load lsp[2*i-2] 
    [P2+8] = R7;            //store f[1]
    P0 = 3;
    LSETUP(LSTART0,LEND0)LC0 = P0;
LSTART0:R3 = [P2+4];
                            //load f[i-1] 
        A1= R1.L * R3.L (M) || R2 = [P2+8];
                            //lsp[2]*f[1], load f[i-2] 
        A1 = A1 >>> 15 || [P2] = R2;
                            //f[i] = f[i-2] 
        P5 += -4;
        P4 += 1;            //increment inner loop counter
    
        LSETUP(LSTART1,LEND1)LC1 = P4;
LSTART1:    R7 = (A1 += R1.L * R3.H) (S2RND) || R0 = [P2];
                            //2*f[j-1]*lsp[2*i-2], load f[j] 
            R0 = R0 + R2 (S)|| R3 = [P2+8];
                            //f[j] + f[j-2], load f[j-1] 
            R0 = R0 - R7;   //f[j] + f[j-2] - f[j-1] * lsp[2*i-2]
            A1= R1.L * R3.L (M) || R2 = [P2+12];
                            //2*f[j-1]*lsp[2*i-2], load f[j-2] 
LEND1:      A1 = A1 >>> 15 || [P2++] = R0;
                            //store f[j] 
    
        R1 = R1 << 10 || R0 = [P2];
                            //2*lsp[2*i-2] in 8.24 format, load f[1] 
        R0 = R0 - R1(S) || R1 = W[P1++P3](X);
                            //f[1] = f[1] - 2 * lsp[2*i-2], load lsp[2*i-2] 
LEND0:  [P2++P5] = R0;
                            //store f[1] 
    (R7:7,P5:3) = [SP++];
    RTS;

__get_lsp_pol.end:        

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -