Comparison of EBCOT Technique Using HAAR Wavelet and Hadamard Transform S. Aruna Deepthi, Vibha D. Kulkarni, Dr.K. Jaya Sankar Department of Electronics and Communication Engineering, Vasavi College of Engineering, Hyderabad Abstract: Transform coding forms an integral part of compression techniques. In transform coding a reversible linear transform is used to map the image into a set of coefficients which are then quantized and coded. The advantage of using a transform is that it packs the data into a lesser number of coefficients. The main purpose of using the transform is thus to achieve energy compaction. In this paper, an Embedded Block Code with Optimized Truncation (EBCOT) Encoder is developed with Haar and Hadamard transforms with a sparse matrix, is implemented and the performance of EBCOT encoder is compared for both transforms. The Haar transform is well suited for the data compression of non-stationary signals.haar transform uses a method of manipulating matrices called averaging and differencing. Hadamard and Haar Transforms are implemented using both MATLAB and modelsim softwares. MATLAB is used for image decomposing and reconstructing and modelsim is used for compressing and decompressing. MSE and PSNR for different images are calculated. Keywords: EBCOT, HAAR transform, Hadamard transform, MSE, PSNR. 1. Introduction Image compression [1] is an important technique used to assist in data storage and transmission. Compressing an image is significantly different than compressing raw binary data. Of course, general purpose compression programs can be used to compress images, but the result is less than optimal. This is because images have certain statistical properties which can be exploited by encoders specifically designed for them. Also, some of the finer details in the image can be sacrificed for the sake of saving a little more bandwidth or storage space. This also means that lossy compression techniques can be used in this area.the idea is to represent an image with a smaller amount of information while still being able to recover the original image. Lossless compression involves with compressing data which, when decompressed, will be an exact replica of the original data. This is the case when binary data such as executables, documents etc. are compressed. They need to be exactly reproduced when decompressed. On the other hand, images (and music too) need not be reproduced 'exactly'. An approximation of the original image is enough for most purposes, as long as the error between the original and the compressed image is tolerable. Lossy compression techniques like transform coding is used in this paper. The wavelet coefffients are encoded using techniques like EZW (Embedded Zero Wavelet Trees), SPIHT (Set Partitioning In Hierarchical Trees) and EBCOT. EZW [8] algorithm was introduced by Shapiro and EBCOT [9] was introduced by Taubman Embedded block coding with optimized truncation EBCOT is wavelet-based coding algorithm that has the capability of embedding many advanced features in a single bit stream while exhibiting state-of-the-art compression performance.block Coding (EBCOT) :Embedded block coding with optimized truncation code Translates blocks of wavelet samples into a compressed data stream to be stored..ezw and EBCOT methods offer hierarchical decomposition and utilize space/frequency localization of sub band image data for energy compaction. Embedded block coding with optimized truncation (EBCOT) is the most important technology in the latest image-coding standard, JPEG 2000. JPEG, a traditional but popular algorithm, has performed very well for natural image compression in the past. JPEG 2000 is a newly proposed next-generation still- 7
image-compression standard. It was finalized at the end of 2000 as an international standard, ISO/IEC 15 444-1: 2000. The context formation process in EBCOT is used to get an insight into the characteristics of the operation. EBCOT technique with wavelet transform is used to achieve high-performance in image compression. JPEG2000 entropy coder is EBCOT contextual coder. It is a bit-plane coder. On each bit-plane, there are three coding passes: a pass of Significant Propagation, a pass of Magnitude Refinement and a Cleanup pass. EBCOT is wavelet-based coding algorithm that has the capability of embedding many advanced features in a single bit stream while exhibiting state-of-the-art compression performance. EBCOT is mostly used for JPEG images and also used for higher compression and as layers increases efficiency also decreases. There are many modified codes for improving the quality of the image. A black and white input image TIFF and JPEG is taken and HAAR transform and Hadamard transform is applied toebcot algorithm, and reconstructed output is shown in Fig.3, Fig.4, and Fig.5. Input is given through MATLAB and verilog is combined with MATLAB and output is obtained and a layout is generated using Cadence tools and the timing and power area report is generated. PSNR of various images, obtained by using MATLAB, is shown in Table 1. 2. HADAMARD Transform The elements of the basis vectors of the Hadamard transform take only the binary values ±1, hence are well sutited for digital signal processing.the Hadamard transform matrices, H n, are N*N matrices, where N=2 n, n=1,2,3 etc. The core matrix of hadamard transform is H 1 =(1/ 2) * 1 1 1-1 the Kronecker product recursion is H n = H n-1 H 1 = H 1 H n-1 =(1/ 2)* H n-1 H n-1 H n-1 -H n-1 as an example, for n=3, the Hadamard martix becomes H 3 =H 1 H 2 ; H 2 = H 1 H 1. The command hadamard produces the 4-by-4 matrix: 1 1 1 1 1-1 1-1 1 1-1 -1 1-1 -1 1 Since Hadamard transform contains only ±1 values, no multiplications are required in the transform calculations. Moreover, the number of additions or subtractions required can be 8
reduced from N 2 to about Nlog 2 N. This is due to the fact that H n can be written as a product of n sparse matrices, that is H=H n =Ĥ n, n=log 2 N. Where * Ĥ n = Since Ĥ contains only two nonzero terms per row, the transformation n v= Ĥ n u= Ĥ Ĥ. Ĥu, n=log 2 N. nterms can be accomplished by operationg Ĥ n times on u. due to the structure of Ĥ only N additions or subtractions are required each time Ĥ operates on a vector, giving a total of N n =N log 2 N. additions and subractions. The Hadamard transfrom has good to very good energy compaction for highly correlated images. 3. Haar Wavelet Haar wavelet involves simple mathematical operations, averaging and differencing. By applying the Haar wavelet transform the image can be represented in terms of two sets of coefficients, transformed and detail coefficients. These detailed coefficients are used in the reconstruction of the image. In 2D wavelet transformation, structures are defined in 2D and the transformation algorithm is applied in x-direction first, and then in the y-direction. The array sizes are expressed in powers of two. The Haar transform separates the image into high frequency and low frequency components. For the first cycle, the transformation algorithm is first run along the x-direction. After transforming the image in the x-direction, the image is then transformed along the y-direction. 4. Flow Chart of Coding: 9
5. Results and Discussion A MATLAB code is written and combined with Modelsim using Verilog. An attempt is made to combine the MATLAB and Modelsim where power area and timing can also be obtained and lay out can be generated. Even other algorithms like WDR, and ASWDR can be used for image compression BMP and other types of images can be used. EZW is better suited for Tiff image and JPEG for EBCOT.EBCOT encoder is designed by using HAAR transform and Hadamard transform and PSNR and MSE are compared for both transforms Two of the error metrics used to compare the various image compression techniques are the Mean Square Error (MSE) and the Peak Signal to Noise Ratio (PSNR). The MSE is the cumulative squared error between the compressed and the original image, whereas PSNR is a measure of the peak error. A lower value for MSE means lesser error, and as seen from the inverse relation between the MSE and PSNR, this translates to a high value of PSNR. Logically, a higher value of PSNR is good because it means that the ratio of Signal to Noise is higher. Here, the 'signal' is the original image, and the 'noise' is the error in reconstruction. So, a compression scheme having a lower MSE (and a high PSNR) is a better one. 6. Simulation result The PSNR for EBCOT using Haar and Hadamard transform for various images have been calculated for a 256*256 image by using MATLAB and the Verilog Program can be called in MATLAB Code using the keyword Socket 4900 along with compilation command Vlog"filename.v". Fig 1. Input image given to EBCOT Encoders 10
Fig 2: Intermediate output Fig 3. Output of the EBCOT Encoder applying HAAR transform Fig 4. Intermediate output of EBCOT after applying HAAR transforms. Fig5. Output of the EBCOT encoder applying Hadamard transforms. Table 1.PSNR for various Images Image HAAR transform Hadamard transform Hopetounfall.jpg 22.12db 24.07db Camerama.jpg 27.18db 25.54db Lena.jpg 28db 29.24db 11
7. Synthesis results The result of synthesis will be a gate level net list that contains interconnection of standard cells. By using logic synthesis tools the RTL functionality is transferred into an equivalent gate level net list with constraints on timing and area. The layout is generated for the EBCOT encoder using Haar and Hadamard transform. The Prototype is synthesized using Xilinx 8. Conclusion The HAAR wavelet transform and Hadamard transform with the EBCOT coding techniques are used to compress various images.the peak signal to noise ratio for Haar and Hadamard are compared and taken as measuring figures to quantify the compression capability. An attempt is made to combine the MATLAB and Modelsim where power area and timing are obtained. The design has been successfully simulated, verified and synthesized The design has met all the desired constraints like timing, power, area etc and the prototype has been synthesized using Xilinx. The PSNR and compression ratio are compared and viewed using MATLAB. 9. REFERENCES [1] Rafael C Gonzalez & Richard E woods, Digital Image Processing, Pearson Education. [2] Robi Polikar The Wavelet Tutorial, second edition 1996. [3] Samir Palnitkar, Verilog HDL-A Guide to Digital Design and synthesis, Pearson Education. [4] High Performance Scalable Image Compression with EBCOT David Taubman, Member, IEEE transactions on image processing, vol 9.no7, July 2000 [5] EBCOT: Embedded Block Coding with Optimized Truncation, ISO/IEC JTC1/SC29/WG1 N1020R, Oct. 1998 [6]. A. Said and W. Pearlman, A new, fast and efficient image codec Based on set partitioning, IEEE Trans. Circuits Syst. Video Technol., vol. 6, pp. 243-250, June 1996. 12