📄 wlift_inv_bior3_5_jpeg2000.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_inv_bior3_5_JPEG2000.asm
Label Name : __wlift_inv_bior3_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 wavelet synthesis using the integer
lifting principle. The wavelet chosen for this function is the
bior3.5, which is used in reversible WT scheme of JPEG2000
Let y(0:n-1) be the sequence to be analyzed, Yext is a
periodic repetition of Y. For bior3.5 wavelet, Yext is
Yext(-2:n+1)=[y(2) y(1) y(0) y(1) .... y(n-1) y(n-2) y(n-3)]
The extension sequence is required to compute the boundary
pixels.
Y(2n+1) <- Y(2n+1) + floor((Y(2n) + Y(2n+2)) / 2)
Y(2n) <- Y(2n) - floor((Y(2n-1) + Y(2n+1)+2) / 4)
Prototype : void _wlift_inv_bior3_5_JPEG2000(short im, int N);
im -> address of the input vector to be inverse lifted.
N -> length of the vector (k)
Registers used : R0-R3, R7, I0, M0, L0, P0, LC0.
Performance :
Code Size : 236 Bytes
Cycle Count : 787 Cycles (For 256 Samples)
Core : 12 * (N/4)
*******************************************************************************/
.section L1_code;
.global __wlift_inv_bior3_5_JPEG2000;
.align 8;
__wlift_inv_bior3_5_JPEG2000:
[--SP] = R7;
I0 = R0; //Address of the input
L0 = 0;
R1 += -4; //k-4
R3.H = 1;
M0 = 6;
R1 = R1 >> 1 || R0.L = W[I0++] ;
//k/2-2. Fetch y(0)
P0 = R1;
R0.H = W[I0++] || NOP; //Fetch y(1)
R2 = R0+|+R3, R7 = R0-|-R3 (ASR) || R1.L = W[I0++];
//Fetch y(2)
R3.H = R0.L - R2.H (S)|| R1.H = W[I0] || I0 -= M0;
//x(0). Fetch y(3). Point to y(0)
R3.L = 2;
//R0.H -> y(1). R1.L -> y(2). R1.H -> y(3)
R7.L = R0.H+R1.H (S) || W[I0] = R3.H || I0+= 4;
//Store x(0)
R7.L = R7.L+R3.L (S)|| NOP;
LSETUP($1LOOP_ST,$1LOOP_END) LC0 = P0 >> 1;
$1LOOP_ST:
R7 = R7 >>> 2 (V) || R1.L = W[I0] || I0+= M0;
//y(2), y(6)
R2.H = R1.L-R7.L (S) ;
//x(2).
R7 = R2 +|+ R3, R1 = R2-|-R3 (ASR) || R2.L = W[I0] || I0-= 4;
//Read y(5), y(9)
R3.H = R0.H + R7.H (S) || R0.H = W[I0--];
//Read y(3), y(7)
R7.L = R0.H + R3.L (S) || W[I0--] = R2.H;
//Store x(2), x(6)
R7.L = R2.L + R7.L (S) || W[I0] = R3.H || I0+= M0;
//Store x(1), x(5)
R7 = R7 >>> 2 (V) || R1.L = W[I0] || I0+= M0;
//y(4)
R3.H = R1.L - R7.L (S) ;
//x(4).
R7 = R2 +|+ R3, R1 = R2-|-R3 (ASR) || R2.L = W[I0] || I0-= 4;
//Read y(7)
R2.H = R0.H + R7.H (S) || R0.H = W[I0--];
//Read y(5), y(9)
R7.L = R0.H + R3.L (S) || W[I0--] = R3.H;
//Store x(4), x(8)
$1LOOP_END:
R7.L = R2.L + R7.L (S) || W[I0] = R2.H || I0+= M0;
//Store x(3), x(7)
//Preserve y(k-3), y(k-2)
R2 = R7 >>> 2 (V) || R1.L = W[I0++];
//y(k-2)
R7.H = R1.L - R2.L (S) ;
R2 = R7 +|+ R3, R1 = R7-|-R3 (ASR) ;
R3.H = R0.H + R2.H (S) || R0.H = W[I0] || I0-= 4;
//Read y(k-1),
R2.L = R0.H + R3.L (S) || R1.H = W[I0++];
//Read y(k-3)
// R1.H -> y(k-3), R0.H -> y(k-1), R3.H -> x(k-3), R7.H -> x(k-2)
R2.L = R2.L + R1.H (S) || R1.L = W[I0--];
//Read y(k-2)
R2 = R2 >>> 2 (V) || W[I0++] = R3.H ;
//Store x(k-3)
R2.H = R1.L - R2.L (S) || W[I0++] = R7.H;
//x(k). Store x(k-2).
R2 = R2 +|+ R7, R7 = R2 -|- R7 (ASR);
R3.H = R0.H + R2.H (S); //x(k-1)
W[I0] = R3.H;
R7 = [SP++];
RTS;
NOP; //to avoid one stall if LINK or UNLINK happens to be
//the next instruction after RTS in the memory.
__wlift_inv_bior3_5_JPEG2000.end:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -