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

📄 wlift_bior_3_5_jpeg2000.asm

📁 利用ADI公司 Blackfin dsp实现 jpeg2
💻 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     : wlift_bior_3_5_JPEG2000.asm
Label Name      : __wlift_bior_3_5_JPEG2000
Version         :   1.3
Change History  :

                Version     Date          Author        Comments
                1.3         11/18/2002    Swarnalatha   Tested with VDSP++ 3.0
                                                        compiler 6.2.2 on 
                                                        ADSP-21535 Rev.0.2
                1.2         11/13/2002    Swarnalatha   Tested with VDSP++ 3.0
                                                        on ADSP-21535 Rev. 0.2
                1.1         03/06/2002    Manoj         Modified to match
                                                        silicon cycle count
                1.0         06/29/2001    Manoj         Original 

Description     : This function performs inplace wavelet analysis using the 
                  integer lifting principle. The wavelet chosen for this 
                  function is the bior3.5, which is used in reversible FWT 
                  scheme of JPEG2000

                  Let x(0:n-1) be the sequence to be analyzed, Xext is a 
                  periodic repetition of x. For bior3.5 wavelet, Xext is 

                  Xext(-2:n+1)=[x(2) x(1) x(0) x(1) .... x(n-1) x(n-2) x(n-3)]. 

                  The extension sequence is required to compute the boundary 
                  pixels.

                  X(2n+1) <- X(2n+1) - floor((X(2n) + X(2n+2)) / 2)
                  X(2n) <- X(2n) + floor((X(2n-1) + X(2n+1)+2) / 4)

Prototype       : void _wlift_bior_3_5_JPEG2000(short im,int N);

                           im -> address of the input vector to be lifted. 
                            N -> length of the vector (k)  

Registers used  : R0-R3, R7, I0, M0, L0, P0, LC0.

Performance     :
                Code Size   : 172 Bytes.

                Cycle Count : 784 Cycles (For 256 Samples).
                Core        : 6 * (N/2) Cycles,
                              where N is the number of input samples
*******************************************************************************/
.section L1_code;
.global __wlift_bior_3_5_JPEG2000;
.align 8;

__wlift_bior_3_5_JPEG2000:
    
    [--SP] = R7;
    I0 = R0;                //Address of the input
    L0 = 0;
    R1 += -4;               //k-4
    R3 = 1;
    M0 = 6;
    R1 = R1 >> 1 || R0.L = W[I0] || I0 += 4;
                            //x(0);
                            //k/2-2 
    
    P0 = R1;        
    
//R0.L -> x(0), R0.H -> x(1), R1.L -> x(2), R1.H ->x(4)
    
    /*Read first input*/

    MNOP;
    R1.L = W[I0--];         //x(2)
    R2 = R0 +|+ R1,R7 = R0 -|- R1 (ASR) || R0.H = W[I0] || I0+= M0;
                            //x(1). 
    R2.L = R0.H - R2.L (S) || R1.H = W[I0] || I0-= M0;
                            //y(1). Fetch x(4) 
    R2 = R2 +|+ R3, R7 = R2 -|- R3 (ASR)  || W[I0] = R2.L || I0+= M0;
                            //Store y(1) 
    R0.L = R0.L+R2.L (S) || R7.L = W[I0--];
                            //y(0) 
    R3.L = 2;
    
//R1.L -> x(2)  R1.H -> x(4) I0 -> points to x(0)
    
    LSETUP ($1LOOP_ST,$1LOOP_END) LC0 = P0;
                            //k/2-2 
$1LOOP_ST:
        R2 = R1 +|+ R7, R7 = R1-|-R7 (ASR) || R0.H = W[I0] || I0-= 4;
                            //Read y(1). Point to x(3) 
        R0.H = R0.H - R2.L (S)  ||R3.H = W[I0--] ;
                            //y(3). Store y(0). Point to y(3) 
        R3.H = R3.H + R0.H (S) || W[I0] = R0.L || I0 += M0;
                            //Store y(3). Point to x(6) 
        R2.L = R3.H + R3.L (S)   || W[I0] = R0.H || I0 += M0;
                            //Read x(6) 
        R2 = R2 >>> 2 (V)   || R7.L = W[I0] || I0 -= 4; 
$1LOOP_END: R0.L = R1.L + R2.L (S)  || R1.L = W[I0++];
                            //y(2). Read x(4). Point to y(3) 
    
                            //R1.L -> x(k)
    
    R2.L = R1.L + R7.L (S)  ||  R0.H = W[I0] || I0-= 4;
                            //Read y(1). Point to x(3) 
    R0.H = R0.H - R1.L (S)  || R3.H = W[I0--] ;
                            //y(3). Store y(0). Point to y(3) 
    R3.H = R3.H + R0.H (S)  || W[I0] = R0.L || I0+= M0;
                            //Store y(3). Point to x(6) 
    R2.L = R3.H + R3.L (S)  || W[I0++] = R0.H;
                            //Read x(6) 
    R2 = R2 >>> 2 (V)    ;
    R0.L = R1.L + R2.L (S)  || I0 -= 4;
                            //y(2). Read x(4). Point to y(3) 
    W[I0] = R0.L ;          //Store y(0). Point to x(3)
    
    R7 = [SP++];
    RTS;
    NOP;                    //to avoid one stall if LINK or UNLINK happens to be
                            //the next instruction after RTS in the memory.
                            
__wlift_bior_3_5_JPEG2000.end:
                            

⌨️ 快捷键说明

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