/* Whole-Sample Symmetric Lifting: Prediction Step wslpredict( u[], N, dq, coeff ): [0] Let i=dq [1] While i0, then do [1] and [2] [1] Compute wsl42filter( u[], N, dq ) [2] Compute wsl42dwt( u[], N, 2*dq, J-1 ) [3] Return Whole-Sample Symmetric Lifting 4,2-Biorthogonal Inverse Discrete Wavelet Transform wsl42idwt( u[], N, dq, J ): [0] If J>0, then do [1] and [2] [1] Compute wsl42idwt( u[], N, 2*dq, J-1 ) [2] Compute wsl42ifilter( u[], N, dq ) [3] Return */ void wsl42dwt( float u[], int N, int dq, int J) { if(J>0) { wsl42filter( u, N, dq); wsl42dwt( u, N, 2*dq, J-1); } return; } void wsl42idwt( float u[], int N, int dq, int J) { if(J>0) { wsl42idwt( u, N, 2*dq, J-1); wsl42ifilter( u, N, dq); } return; } /* Whole-Sample Symmetric Lifting: 9,7 Biorthogonal Filter Transform wsl97filter( u[], N, dq ): [0] Compute wslpredict ( u[], N, dq, alpha97 ) [1] Compute wslupdate ( u[], N, dq, beta97 ) [2] Compute wslpredict ( u[], N, dq, gamma97 ) [3] Compute wslupdate ( u[], N, dq, delta97 ) [4] Compute lnormalize ( u[], N, dq, zeta97 ) [5] Return Whole-Sample Symmetric Lifting: Inverse 9,7 Biorthogonal Filter Transform wsl97ifilter( u[], N, dq ): [0] Compute lnormalize ( u[], N, dq, 1/zeta97 ) [2] Compute wslupdate ( u[], N, dq, -delta97 ) [1] Compute wslpredict ( u[], N, dq, -gamma97 ) [2] Compute wslupdate ( u[], N, dq, -beta97 ) [3] Compute wslpredict ( u[], N, dq, -alpha97 ) [4] Return */ /* Lifting coefficients for 9,7-biorthogonal DWT (approximate values) */ const float alpha97 = { (float) -1.5861343420599235584283154513374 }, beta97 = { (float) -0.0529801185729614146241295675035 }, gamma97 = { (float) 0.882911075530933295919790099003 }, delta97 = { (float) 0.4435068520439711521156042151689 }, zeta97 = { (float) 1.149604398860241159795075642191 }; void wsl97filter(float u[], int N, int dq ) { wslpredict ( u, N, dq, alpha97 ); wslupdate ( u, N, dq, beta97 ); wslpredict ( u, N, dq, gamma97 ); wslupdate ( u, N, dq, delta97 ); lnormalize ( u, N, dq, zeta97 ); return; } void wsl97ifilter(float u[], int N, int dq ) { lnormalize ( u, N, dq, 1/zeta97 ); wslupdate ( u, N, dq, -delta97 ); wslpredict ( u, N, dq, -gamma97 ); wslupdate ( u, N, dq, -beta97 ); wslpredict ( u, N, dq, -alpha97 ); return; } /* Whole-Sample Symmetric Lifting 9,7-Biorthogonal Discrete Wavelet Transform wsl97dwt( u[], N, dq, J ): [0] If J>0, then do [1] and [2] [1] Compute wsl97filter( u[], N, dq ) [2] Compute wsl97dwt( u[], N, 2*dq, J-1 ) [3] Return Whole-Sample Symmetric Lifting 9,7-Biorthogonal Inverse Discrete Wavelet Transform wsl97idwt( u[], N, dq, J ): [0] If J>0, then do [1] and [2] [1] Compute wsl97idwt( u[], N, 2*dq, J-1 ) [2] Compute wsl97ifilter( u[], N, dq ) [3] Return */ void wsl97dwt( float u[], int N, int dq, int J) { if(J>0) { wsl97filter( u, N, dq); wsl97dwt( u, N, 2*dq, J-1); } return; } void wsl97idwt( float u[], int N, int dq, int J) { if(J>0) { wsl97idwt( u, N, 2*dq, J-1); wsl97ifilter( u, N, dq); } return; }