International Journal of Engineering Trends and Technology (IJETT) – Volume23 Number 5- May 2015 Design and Implementation of High Throughput Memory Efficient Arithmetic Coder for Image Compression Using SPIHT Rabiya Khanum1, Asha R2 PG student (VLSI Design and Embedded systems), SIET, Tumkur, Karnataka, India. Assistant Prof., Dept. of E&C, SIET, Tumkur, Karnataka, India. Abstract-- A design is proposed based on the new coding scheme for a novel image compression algorithm SPIHT (Set Partitioning in Hierarchical tree) using wavelet transform and arithmetic coder that provide an embedded code word. Image compression using SPIHT attracts more interest due its low memory requirement to represent an image. Due to its inherent redundancy the algorithm is suitable for both color and gray images. SPIHT display several important properties over other image compression algorithm like fast coding and decoding, high compression ratio, application in lossless image compression, good image quality, high PSNR value and it has a capability to code for exact bit rate. The speed of the SPIHT algorithm is increased by using Arithmetic Coder. High speed architecture of arithmetic coder is design to meet the throughput requirement in order to achieve high performance gain. The design has been implemented on Spartan 3 FPGA. Keywords: Image Compression, Wavelet Transform, Arithmetic Coder, Set Partitioning in Hierarchical Trees, Peak Signal to Noise Ratio. I. INTRODUCTION As the demand for wireless communication and multimedia product has been growing very fast, and the high resolution images contain large amount information which intern consume large amount of storage space and longer transmission time. Therefore the theory of compression becomes more important in the field of communication and information industry for reducing the memory and transmission time. Image Compression is the process reducing the size of an image without much affecting the quality of an image. The main objective of image compression is to reduce redundancy of the image data in order to store or to transmit the data in an efficient form. Uncompressed form of multimedia data it may be audio or video data requires considerable amount of storage space and transmission time. The main objective of compression is to provide sufficient storage space, less transmission time and wider transmission bandwidth for video and audio data. Image compression points at rejecting redundancy in image. By dismissing the redundant information in an image help image. Redundancy is nothing but dismissing or removing the duplication in the image pixel. Compression techniques are generally classified into two types namely I) lossy compression and II) lossless compression technique, in ISSN: 2231-5381 lossy compression technique there is loss of information hence after compression/ decompression the data is lost forever, and recovered data (image) is not identical to its original data (image). In this technique higher level of compression can be achieved. This technique is useful in some applications like television broadcasting, you tube, video conferencing etc where certain amount of data loss can be acceptable. Whereas in the lossless image compression technique helps in providing compressed\decompressed form of image which is digitally identical to original image. The recovered data after decompression is identical to its original data. This technique finds its application in medical field and in technical drawings. There are several different ways in which image files can be compressed. For Internet use, the two most common compressed graphic image formats are the JPEG format and the GIF format. The JPEG method is more often used for photographs, while the GIF method is commonly used for line art and other images in which geometric shapes are relatively simple. The rest of the paper is organized as fallows, section II gives brief review on literature survey, section III gives review on motivation and proposed methodology, section IV description, section V. tests and results, and finally the conclusion and future work of the paper is presented in section VI and VII. II. LITERATURE SURVEY For many years, various architectures have been proposed in order to achieve high compression ratio, high PSNR ratio less transmission time, deal with such difficulties. Andra’s [4] proposes a QM coder in JPEG which decreases operation for the more probable symbol (MPS) and used a non-overlap window style for the speedup purpose. In, the probability interval partition’s accelerated by exchange of the less probable symbol (LPS) interval with the MPS interval. Thus the amount of operations is reduced by 60% to 70% compared with other coders. Wheeler proposed a modified SPIHT algorithm [5] which does not use any list. Because of no search operations for list, the speed of algorithm can be improved greatly. Wiseman proposed [6] hardware architecture for a quasi AC which is a simple version of AC. In this AC uses a pipeline processing to compute each stage, http://www.ijettjournal.org Page 242 International Journal of Engineering Trends and Technology (IJETT) – Volume23 Number 5- May 2015 which eliminates an internal high frequency clock and utilizes fast since [5] uses the pipeline processing, a fast lookup table is utilized and also the high frequency clock is eliminated. Although this architecture can improve the speed, it cannot offer supports for multi-context processing in image compression fields. A context based SPIHT method was introduced by Ansari [9]. In [9], it is focused on achieving better results in medical images not on hardware implementation. III. MOTIVATION & PROPOSED SYSTEM One of the major challenges in enabling mobile, multimedia data services will be the need to process and wirelessly transmit a very large volume of data. While significant improvements in bandwidth are expected with future wireless access technologies, improvement in battery technology will lag the rapidly growing energy requirements of future wireless data services. One approach to mitigate this problem is to reduce the volume of multimedia data transmitted over the wireless channel via data compression techniques. Proposed methodology reduces the volume of data to greater extent. Methods involved in proposed system are Discrete Wavelet Transform, SPIHT Algorithm, and Arithmetic Coding. IV. DESCRIPTION A. Discrete Wavelet Transforms Discrete Wavelet Transform is a wavelet transform in which wavelets are discretely sampled. “Discrete Wavelet Transform”, transforms discrete signal from time domain into time-frequency domain. Since the input signal (e.g., a digital image) is processed by a digital computing machine, it is prudent to define the discrete version of the wavelet transform. A two-dimensional digital data can be represented by a two-dimensional array A [X, Y] with X rows and Y columns, where X and Y are nonnegative integers. The simple approach for two-dimensional implementation of the DWT is to perform the one-dimensional DWT row-wise to produce an intermediate result and then perform the same onedimensional DWT column-wise on this intermediate result to produce the final result. This is shown in Fig.2. Fig. 2 Block diagram 2- D DWT Fig. 1 Block diagram of proposed system with input and output The block diagram of the SPIHT encoding for a proposed system is described here. The input image is gray scale image of size 512x512 each pixel of 8 bits. Input image is converted to pixel values in MATLAB. The obtained Pixel values are given as input to the Line based wavelet lifting module which produces wavelet coefficients. The transformed wavelet coefficients are placed in a buffer and they are accessed in a SPIHT-Breadth First Search way. Processor dispatcher dispatches the transformed wavelet coefficients to the arithmetic coder through internal bus. Output of arithmetic coder is provided to the internal bus and sent to the code FIFO. The Read FIFO and Truncate module are responsible for the final code stream formation, which reads each code FIFO from top to bottom and truncates the code stream according to the bit rate requirement. As shown in Fig 1. ISSN: 2231-5381 Fig. 3 Block diagram of Lifting-based Algorithm Folded architecture for (9, 7) wavelet with line based lifting wavelet engine is as shown in Fig .3. The z−1 blocks are for delay; α, β, γ, δ, δ are lifting coefficients, and the shaded blocks are registers to store the wavelet co efficient. B. SPIHT Algorithm SPIHT is the wavelet based image compression method. It provides the Highest Image Quality, Progressive image transmission. SPIHT makes use of three lists – the List of Significant Pixels (LSP), List of Insignificant Pixels (LIP) and List of Insignificant Sets (LIS). All the pixel values in the list LIS are tested for their significant state. Significant state of the wavelet coefficients are tested using the equation (1) http://www.ijettjournal.org Page 243 International Journal of Engineering Trends and Technology (IJETT) – Volume23 Number 5- May 2015 which is as given below. Hence SPIHT algorithm has fewer bits to code after the discrete wavelet transform. [4]. Where Ci,j represents the coefficient value for the position i, j in the wavelet sub-band. Г represents set of coefficients and Sn (Г) represents the significant state of the set Sn ( ) 1, max (i , j ) ci , j 2n (1) 0, otherwise efficiency and more flexibility compared to the popular Huffman coding. The arithmetic coding algorithm is explained here with an example. Consider a four-symbol alphabet A = {a, b, c, d} with the fixed symbol probabilities p (b) = 0.3, p (a) = 0.2, p(c) = 0.4, and p (d) = 0.1 respectively. The symbol probabilities can be expressed in terms of partition of the half-open range [0.0, 1.0), as shown in Table 2. C. Flow Chart of SPIHT algorithm Table 2 Probability Model In this flow chart shown in Fig.4 the first method is to perform wavelet decomposition on the loaded image of 512x512, the wavelet decomposition output is in the form of sub bands. The sub band coefficients are given as the input encoding stage. The encoding stage is divided into two parts. The sorting pass The refinement pass In the first step that is sorting pass, we first initialize List if significant pixel (LSP) to be empty and add the all coordinates to List of insignificant pixel (LIP) and all the decedents to List of insignificant set (LIS). Magnitude test is Performed using equation (1); if the value is greater than threshold moved that value to LSP else keep in LIS. After the initialization, the algorithm takes two steps for each level. The sorting pass (in which lists are organized) and the refinement pass. The result obtained is in the form of a bit stream. Original image Index Symbol Probability 1 2 3 4 b a c d 0.3 0.2 0.4 0.1 Cumulative probability 0.3 0.5 0.9 1.0 Range 0.0 0.3-0.5 0.5-0.9 0.9-0.1 “c b c a” is the new message to be encoded using the above fixed arithmetic model. The first symbol of the message is c, the range is first narrowed down to the halfopen interval R(c) = [0.5, 0.9). This range is again partitioned into exactly the same proportions as the original one, giving the four half-open intervals [0.5, 0.62). [0.62, 0.70), [0.70, 0.86), and [0.86, 0.90) corresponding to a, b, c. As a result, the range is narrowed down to R(c b) = [0.5, 0.62) when the second symbol a in the message is processed. The new range [0.5, 0.62) is now partitioned into four equal intervals [0.5, 0.536), [0.536, 0.560), [0.560, 0.608), and [0.608, 0.62). After the third symbol, is c processing, the range is accordingly narrowed down to R(c b c) = [0.560, 0.608), like this way the arithmetic coding is done. Wavelet transform The Architecture of Arithmetic Coder is shown in Fig.5 arithmetic coder consists of three main parts, upper and lower bound update, and common bit detector. For updating the initial intervals to 0 and 1, upper bound and lower bound update of arithmetic coder is used. The values are multiplied with cumulative probabilities and updated high and low values are given as input to common bit detector unit. Output is then passed to the code stream output unit in arithmetic coder. Cumulative probability part will hold the frequency of occurrence of wavelet coefficient. Sorting pass Refinement pass Entropy coding Figure 4: Flow Chart of SPIHT algorithm D. Architecture of Arithmetic Coder Arithmetic coding is a variable-length source encoding technique. In traditional entropy encoding techniques such as Huffman coding, each input symbol in a message is substituted by a specific code specified by an integer number of bits. Arithmetic coding deviates from this. In arithmetic coding a sequence of input symbols is represented by an interval of real numbers between 0.0 and 1.0. The longer the message, the smaller the interval to represent the message becomes. More probable symbols reduce the interval less than the less probable symbols and hence add fewer bits in the encoded message. Arithmetic coding offers superior ISSN: 2231-5381 http://www.ijettjournal.org Fig.5. Architecture of Arithmetic Coder Page 244 International Journal of Engineering Trends and Technology (IJETT) – Volume23 Number 5- May 2015 The obtained new bound values are given as input to the common bit detector (CBD) part which checks the internal loop and records the duplicate bits from the MSB to the LSB between two registers. [7] After that the same bits are collected to code stream which is in the form of bits. These bytes are supplied directly to the Code Stream Output part for generating final code word. V. TESTS AND RESULTS. The Fig.8 shows the simulation results of arithmetic coder. The design for arithmetic coder is done in verilog and simulated using Xilinx ISI simulator. In the experimental results first PSNR values for different images is recorded using SPIHT with arithmetic coder and it is compared with the existing system as shown in the Table 2 using MATLAB. Table 2. PSNR values of different images Index Images 512x512 PSNR value of existing system 1 2 3 4 Lena Barbara Woman Airport 38.39 36.01 37.37 33.27 PSNR value of proposed system 39.85 36.64 38.48 34.45 Probability Range The design of DWT is described in verilog and testing of this module has been carried out and simulation results of DWT are shown in Fig.7. The input to this module is the pixel values and output from this is the wavelet coefficient. The RTL view of DWT is shown in Fig. 6. Encoded data Output Fig.8 simulation results of arithmetic coder The encoding is done for four symbols with the predefined probability. The range is calculated for each symbol using that predefined probability, and the encoded data is as shown in the Fig.8. The Fig.9 shows the results of SPIHT-Arithmetic coder. The PSNR value of the Lena image is given below. Fig.6 shows RTL View of DWT PSNR value of Lena image Fig.9 MATLAB results of entire design Output Input Fig.7. Simulation results of DWT ISSN: 2231-5381 Figure 10 shows the simulation output of image compression using DWT in MATLAB software. Gray scale image of 512X512 is given as input.2-D DWT is first applied on rows and then on the columns. http://www.ijettjournal.org Page 245 International Journal of Engineering Trends and Technology (IJETT) – Volume23 Number 5- May 2015 Fig. 12 Output obtained on Chipscope Pro window of Xilinx 14.5 ISE VI. CONCLUSION Fig.10 MATLAB results image compression The design is implemented on Spartan 3 FPGA and the design is described using verilog and MATLAB software and it is synthesized and the output is observed on Chipscope Pro Window, the option available in Xilinx ISE 14.5 software for analyzing the hardware results Fig. 12 shows output of the design obtained on Chipscope Pro Window. An effective VLSI implementation of image compression is proposed in this design. The hardware is realized on Spartan 3 FPGA kit. Output of the design is observed on ChipScope Pro window in Xilinx ISE 14.2. The results make the following conclusions as given below:1) The combination of DWT and SPIHT gives better image quality at low bit rate and at the same time performance of the design is improved. 2) Around 76.8% of compression ratio can be obtained using this design. Hence the memory required for the storing the data will be less. 3) The SPIHT with arithmetic coder improves the peak signal to noise ratio. From the above observation the proposed design can be concluded as smaller storage space is needed to store the encoded bit-stream and it is easy to transmit encoded bitstream in lesser transmission bandwidth. VII. FUTURE WORK Fig. 11 Simulated output of DWT For improvement of throughput purpose SPIHT algorithm without lists can be implemented. A simple context scheme can be employed. A simple context scheme can be used in future especially to reduce the power required by multimedia data while transferring data from one end to another end, control module can reduce the power dissipation efficiently as the reduction in power consumption leads to higher battery life in the portable devices. ACKNOWLEDGMENT I am thankful to Dr. Nalini. N, Principal, SIET, Tumkur for her valuable guidance was a source of inspiration. I express my gratitude to Dr M.N Eshwarappa professor and HOD Dept of E&C SIET, Tumkur, for providing motivation ISSN: 2231-5381 http://www.ijettjournal.org Page 246 International Journal of Engineering Trends and Technology (IJETT) – Volume23 Number 5- May 2015 and required support for completing this project. I am grateful to Mrs. ASHA.R Assistant professor Dept of E&C SIET Tumkur, for her esteemed and valuable guidance and encouragement and lending every support at every stage of this project work and accepting to be my internal guide. REFERENCES [1] J. Rissanen, “Generalized kraft inequality and arithmetic coding,” IBM J Res. Developm., vol. 20, no. 3, pp. 198–203, May 1976. [2] J. Rissanen and G. G. Langdon, “Arithmetic coding,” IBM J. Res. Develop. vol. 23, no. 2, pp. 149–162, Mar. 1979. [3] ISO/IEC JTC1 Information Technology-Digital Compression and Coding of Continuous-Tone Still Images-Part 1: Requirements and Guidelines, ISO/IEC International Standard 10918-1, ITU-T Rec. T.81, 1993. [4] K. Andra, T. Acharya, and C. Chakrabarti, “A multi-bit binary arithmetic coding technique,” in Proc. Int. Conf. Image Process., Vancouver, BC, Canada, Sep. 2000, vol. 1, pp. 928–931. [5] F. W. Wheeler and W. A. Pearlman, “SPIHT image compression without lists,” in Proc. IEEE Int. Conf. Acoust., Speech, Signal [6] Y. Wiseman, “A pipeline chip for quasi arithmetic coding,” IEICE Trans. Fundamentals, vol. E84-A, no. 4, pp. 1034–1041, Apr. 2001. [7] Draft ITU-T Recommendation and Final Draft International Standard of Joint Video Specification (ITU-T Rec. H.264 ISO/IEC 14496-10 AVC), JVT-G050, Joint Video Team of ITU-T and ISO/IEC JTC 1, Joint Video Team (JVT) of ISO/IEC MPEG and ITU-T VCEG, Mar. 2003. [8] D. Marpe, H. Schwarz, and T. Wiegand, “Context-based adaptive binary arithmetic coding in the H.264/AVC video compression standard,” IEEE Trans. Circuits Syst. for Video Technol., vol. 13, no. 7, pp. 620–636, Jul. 2003. [9] M. A. Ansari and R. S. Ananda, “Context based medical image compression for ultrasound images with contextual set partitioning in hierarchical trees algorithm,” Adv. Eng. Softw., vol. 40, no. 7, pp. 487– 496, Jul. 2009. [10] J. Jyotheswar and S. Mahapatra, “Efficient FPGA implementation of DWT and modified SPIHT for lossless image compression,” J. Syst. Arch., vol. 53, no. 7, pp. 369–378, Jul. 2007. [11] P. Corsonello, S. Perri, P. Zicari, and G. Cocorullob, “Microprocessor based FPGA implementation of SPIHT image compression subsystems,” Microprocess. Microsyst., vol. 29, no. 6, pp. 299–305, Aug. 2005. [12] R. Stefo, J. L. Núñez, C. Feregrino, S. Mahapatra, and S. Jones, “FPGA-Based modelling unit for high speed lossless arithmetic coding,” Field-Program. Logic Appl. Lecture Notes Comput. Sci., vol. 2147/2001, pp. 643–647, 2001. [13] K. M. Marks, “A JBIG-ABIC compression engine for digital document processing,” IBM J. Res. Developm., vol. 42, no. 6, pp. 753–758, Jun. 1998. [14] M. Akter, M. B. I. Reaz, F. Mohd-Yasin, and F. Choong, “A modifiedset partitioning in hierarchical trees algorithm for real-time image compression,” J. Commun. Technol. Electron., vol. 53, no. 6, pp. 642– 650, Jun. 2008. [15] K.Harika, K.V.Ramana Reddy by “Design and Implementation of Arithmetic Coder Used in SPIHT” Volume-3, Issue-3, August 2013 ISSN: 2231-5381 http://www.ijettjournal.org Page 247