DIGITAL IMAGE COMPRESSION APPROACH BASED ON DISCRETE COSINE TRANSFORM AND SPIHT SK ABDUL MUTHALIB, DR T RAMASHRI M Tech Sri Venkateswara University College Of Engineering Tirupathi Associate Professor, Sri Venkateswara University College Of Engineering, Tirupathi Abstract Although tremendous progress has been made in the past years on the digital image compression but still it is consider as area of concern in the field of digital image processing. Digital image compression based on transform techniques is the most successful than other approaches. In this paper new image compression mechanism based on Discrete cosine transform (DCT) and SPHIT is proposed which yields better efficiency and performance compared to traditional compression techniques. Image compression, the technology of reducing the amount of data required to represent an image, is one of the most important application in the field of digital processing. In this tutorial, we introduce the theory and practice of digital image compression. We examine the most frequently used compression techniques and describe the industry standards that make them useful. KEYWORDS: Digital image compression, DCT, SPHIT I.INTRODUCTION Uncompressed multimedia (graphics, audio and video) data requires considerable storage capacity and transmission bandwidth. Despite rapid progress in massstorage density, processor speeds, and digital communication system performance, demand for data storage capacity and datatransmission bandwidth continues to outstrip the capabilities of available technologies. The recent growth of data intensive multimedia-based web applications have not only sustained the need for more efficient ways to encode signals and images but have made compression of such signals central to storage and communication technology. To enable Modern High Bandwidth required in wireless data services such as mobile multimedia, email, mobile, internet access, mobile commerce, mobile data sensing in sensor networks, Home and Medical Monitoring Services and Mobile Conferencing, there is a growing demand for rich Content Cellular Data Communication, including Voice, Text, Image and Video.
One of the major challenges in enabling mobile multimedia data services will be the need to process and wirelessly transmit very large volume of this rich content data. This will impose severe demands on the battery resources of multimedia mobile appliances as well as the bandwidth of the wireless network. While significant improvements in achievable bandwidth are expected with future wireless access technology, improvements in battery technology will lag the rapidly growing energy requirements of the 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 technique such as JPEG, JPEG2000 and MPEG. These approaches concentrate on achieving higher compression ratio without sacrificing the quality of the Image. However these Multimedia data Compression Technique ignore the energy consumption during the compression and RF transmission. Here one more factor, which is not considered, is the processing power requirement at both the ends i.e. at the Server/Mobile to Mobile/Server. Thus in this paper we have considered all of these parameters like the processing power required in the mobile handset which is limited and also the processing time considerations at the server/mobile ends which will handle all the loads. Since images will constitute a large part of future wireless data, we focus in this paper on developing energy efficient, computing efficient and adaptive image compression and communication techniques. Based on a popular image compression algorithm, namely, wavelet image compression, we present an Implementation of Advanced Image Compression Algorithm Using Wavelet Transform. 1.1 Why compression is needed? In the last decade, there has been a lot of technological transformation in the way we communicate. This transformation includes the ever present, ever growing internet, the explosive development in mobile communication and ever increasing importance of video communication. Data Compression is one of the technologies for each of the aspect of this multimedia revolution. Cellular phones would not be able to provide communication with increasing clarity without data compression. Data compression is art and science of representing information in compact form. Despite rapid progress in massstorage density, processor speeds, and digital communication system performance,
demand for data storage capacity and datatransmission bandwidth continues to outstrip the capabilities of available technologies. In a distributed environment large image files remain a major bottleneck within systems. Image Compression is an important component of the solutions available for creating image file sizes of manageable and transmittable dimensions. Platform portability and performance are important in the selection of the compression/decompression technique to be employed. 1.2 Principle behind Image Compression Images have considerably higher storage requirement than text; Audio and Video Data require more demanding properties for data storage. An image stored in an uncompressed file format, such as the popular BMP format, can be huge. An image with a pixel resolution of 640 by 480 pixels and 24-bit colour resolution will take up 640 * 480 * 24/8 = 921,600 bytes in an uncompressed format. The huge amount of storage space is not only the consideration but also the data transmission rates for communication of continuous media are also significantly large. An image, 1024 pixel x 1024 pixel x 24 bit, without compression, would require 3 MB of storage and 7 minutes for transmission, utilizing a high speed, 64 Kbits /s, ISDN line. Image data compression becomes still more important because of the fact that the transfer of uncompressed graphical data requires far more bandwidth and data transfer rate. For example, throughput in a multimedia system can be as high as 140 Mbits/s, which must be transferred between systems. This kind of data transfer rate is not realizable with today s technology, or in near the future with reasonably priced hardware. II. PROPOSED METHOD Discrete Cosine Transform (DCT) Based on the concept of KLT, DCT, a generic transform that does not need to be computed for each image can be derived. Based on the derivation in Eq. (25), the auto-covariance matrix of any transform block of size N can be represented by C (1) xxmodel 2 N 1 2 N 2 N 1 N 2 which is in a Toeplitz matrix form. This means that the KLT can be decided only by
one parameter ρ, but the parameter ρ is still called DCT coefficients) which are in terms data dependent. Therefore, by setting the of the 64 unique orthogonal twodimensional parameter ρ as 0.90 to 0.98 such that ρ 1, spatial frequencies or we can obtain the extreme condition of KLT. That is, as ρ approaches to 1, the KLT is no longer optimal, but fortunately the KLT at this extreme condition can still efficiently remove the correlation between pixels. The 2-D DCT is expressed as spectrum shown in Fig. 3.3. The DCT coefficient values are the relative amounts of the 64 spatial frequencies present in the original 64-point input. The element in the upper most left corresponding to zero frequency in both directions is the DC N N 2 C( u) C( v) (2i 1)( u 1) coefficient (2 j 1)( v 1) and the rest are called AC F( u, v) f ( i, j)cos cos N i1 j1 2N coefficients. 2N N 1 N1 2 C( u) C( v) (2i 1) u (2 j 1) v f ( i, j)cos cos N i0 j0 2N 2N (2) where 0 u, v N-1 1 / N ( n 0) C( n) 2 ( n 0) N (3) The discrete cosine transform shown is closely related to the Discrete Fourier Transform (DFT). Both take a set of points from the spatial domain and transform them into an equivalent representation in the frequency domain. The difference is that while the DFT takes a discrete signal in one spatial dimension and transforms it into a set of points in one frequency dimension and the Discrete Cosine Transform (for an 8x8 block of values) takes a 64-point discrete signal, which can be thought of as a function of two spatial dimensions x and y, and turns them into 64 basis-signal amplitudes (also Fig. 2.1: 64 two-dimensional spatial frequencies Calculating the coefficient matrix this way is rather inefficient. The two summations will require N 2 calculations where N is the length (or width) of the matrix. A more efficient way to calculate the matrix is with matrix operations. Set C equal to
C i. j 1 / N if i 0 2 (2 j 1) i cos if i 0 N 2N (4) Because pixel values typically change vary slowly from point to point across an image, the FDCT processing step lays the foundation for achieving data compression by concentrating most of the signal in the lower spatial frequencies. For a typical 8x8 sample block from a typical source image, most of the spatial frequencies have zero or near-zero amplitude and need not be encoded. At the decoder the IDCT reverses this processing step. It takes the 64 DCT coefficients and reconstructs a 64-point output image signal by summing the basis signals. Mathematically, the DCT is one-toone mapping for 64-point vectors between the image and the frequency domains. In principle, the DCT introduces no loss to the source image samples; it merely transforms them to a domain in which they can be more efficiently encoded. Quantization Since we always deal with 8x8 matrices when dealing with JPEG compression, the DCT matrix C can be calculated in Eq. (31). Using C, the FDCT can be found by FDCT ( u, v) C P Transpose [ C] (5) where P is the matrix of values from the image being compressed. We should subtract 128 from every element in P before deriving FDCT coefficient..3536.3536.3536.3536.3536.3536.3536.3536.4904.4157.2778.0975 -.0975.2778.4157.4904.4619.1913.1913.4619.4619.1913.1913.4619.4157.0975.4904.2778.2778.4904.0975.4157 C.3536.3536.3536.3536.3536.3536.3536.3536.2778.4904.0975.4157.4157.0975.4904.2778.1913.4619.4619.1913.1913.4619.4619.1913.0975.2778.4157.4904.4904.4157.2778.0975 (6) After output of FDCT, we haven t really accomplished any compression. In fact the matrix FDCT takes up more space than P because it has the same number of elements but each element is a floating point number with a range of [ 1023, 1023] instead of an integer with range [0, 255]. However, the human vision is more sensitive to low frequencies than high and most image data is relatively low frequency. Low frequency data carries more important information than the higher frequency. The data in the FDCT matrix is organized from lowest frequency in the upper left to highest frequency in the lower right. Quantization is the step where we actually throw away data. The DCT is a lossless procedure. The data can be precisely
recovered through the IDCT without chrominance quantization matrix (Eq. 36). If considering computational implementing. During Quantization, every element in the the user wants better quality at the price of compression he can lower the values in the 8x8 FDCT matrix is divided by a Q matrix. If he wants higher compression corresponding step size in a quantization matrix Q to yield a matrix QFDCT followed with less image quality he can raise the values in the matrix. by rounding to the nearest integer shown in Eq. (33): 16 11 10 16 24 40 51 61 FDCT ( u, v) 12 12 14 19 26 58 60 55 QFDCT ( u, v) round Q( u, v) 14 13 16 24 40 57 69 56 (7) 14 17 22 29 51 87 80 62 Ql ( u, v) 18 22 37 56 68 109 103 77 This output value is normalized by the quantizer step size. Dequantization is the 24 35 55 64 81 104 113 77 49 64 78 87 103 121 120 101 inverse function, which in this case means 72 92 95 98 112 100 103 99 simply that the normalization is removed by (9) multiplying by the step size, which returns the result to a representation appropriate for 17 18 24 47 99 99 99 99 input to the IDCT: 18 21 26 66 99 99 99 99 ' Q 24 26 56 99 99 99 99 99 FDCT ( u, v) QFDCT ( u, v) Q( u, v ) 47 66 99 99 99 99 99 99 (8) Qc( u, v) 99 99 99 99 99 99 99 99 The goal of quantization is to reduce most of 99 99 99 99 99 99 99 99 the less important high frequency 99 99 99 99 99 99 99 99 coefficients to zero, the more zeros we can 99 99 99 99 99 99 99 99 generate the better the image will compress. (10) The matrix Q generally has lower numbers in the upper left that increase in magnitude as they get closer to the lower right. While Q could be any matrix, there are actually two quantization tables specified by the JPEG According to Eq. (33), those values that were reduced to zero are gone forever and cannot be reconstructed, and this is what we call lossy. However, the coefficients we standard for reference: the luminance have lost were the higher frequency, less quantization matrix (Eq. 35) and the important ones. We have succeeded in
turning most of the higher frequency coefficients into zeros. Actually, it s how many zeros we can get in a row that determines how much we can compress the data. Fig 3.4(a) is an 8x8 block of 8-bit samples, arbitrarily extracted from a real image. The small variations from sample to sample indicate the predominance of low spatial frequencies. After subtracting 128 from each sample for the required levelshift, the 8x8 block is input to the FDCT, Eq. (31). Figure 3.4(b) shows the resulting DCT coefficients. Except for a few of the lowest frequency coefficients, the amplitudes are quite small. Fig. 3.4(c) is the example quantization table for luminance (grayscale) components. Fig. 3.4(d) shows the quantized DCT coefficients, normalized by their quantization table entries. At the decoder these numbers are denormalized according to Eq. (34), and input to the IDCT. Finally, Fig. 3.4(f) shows the reconstructed sample values, remarkably similar to the originals in Fig. 3.4(a). Of course, the numbers in Fig. 3.4(d) must be Huffman-encoded before transmission to the decoder. Fig. 2.2: DCT and Quantization Examples. SPIHT ALGORITHM Description of the Algorithm Image data through the wavelet decomposition, the coefficient of the distribution turn into a tree. According to this feature, defining a data structure:
spatial orientation tree. 4-level wavelet decomposition of the spatial orientation trees structure are shown in Figure1.We can see that each coefficient has four children except the red marked coefficients in the LL sub band and the coefficients in the highest sub bands (HL1;LH1; HH1). The following sets of coordinates of coefficients are used to represent set partitioning method in SPIHT algorithm. The location of coefficient is notated by (i,j),where i and j indicate row and column indices, respectively. H: Roots of the all spatial orientation trees O(i, j) :Set of offspring of the coefficient (i, j), O(i, j) = {(2i, 2j), (2i, 2j + 1),(2i + 1, 2j), (2i + 1, 2j + 1)}, except (i, j) is in LL; When (i,j) is in LL sub band, O(i; j) is defined as: O(i, j) = {(i, j + wll), (i + hll, j), (i +hll, j + wll)}, where wll and hll is the width and height of the LL sub band, respectively. D (i, j): Set of all descendants of the coefficient (i, j), A significance function Sn (τ) which decides the Significance of the set of coordinates, τ, with respect to the threshold 2n is defined by: Sn(τ) = 1, if max i,j τ ci,j 2n 0, else Where ci,j is the wavelet coefficient. In this algorithm, three ordered lists are used to store the significance information during set partitioning. List of insignificant sets (LIS), list of insignificant pixels (LIP), and list of significant pixels (LSP) are those three lists. Note that the term pixel is actually indicating wavelet coeffcient if the set partitioning algorithm is applied to a wavelet transformed image. Algorithm: SPIHT 1).Initialization: 1. output n= [log2 max{ (ci,j ) }] 2. set LSP = ; 3. set LIP = (i,j) H; 4. set LIS = (i,j) H, where D(i; j) and set each entry in LIS as type A ; 2) Sorting Pass: 1. for each(i, j) LIP do: (a) output Sn (i, j) (b) if Sn (i, j) = 1 then move (i, j) to LSP and output Sign ( ci,j ) 2. for each (i, j) LIS do: (a) if (i, j) is type A then i. output Sn (D(i, j))
ii. if thensn (D i, j ) = 1 then A. for each (k, l) O(i, j). output Sn (k, l). if Sn (k, l) = 1 then append (k, l) to LSP, output Sign(ck,l),and ck,l = ck,l 2n sign(ck,l).else append (k; l) to LIP B. move (i, j) to the end of LIS as type B (b) if (i, j) is type B then i. output Sn (L i, j ) ii. if Sn (L i, j ) = 1 then. append each (k, l) O(i, j) to the end of LIS as type A. remove (i,j) from LSP 3) Refinement Pass: 1. for each (i,j) in LSP, except those included in the last sorting pass. output the n-th MSB of ci,j 4) Quantization Pass: 1. decrement n by 1 2. goto step 2) B. Analyses of SPIHT Algorithm Here a concrete example to analyze the output binary stream of SPIHT encoding. The following is 3-level wavelet decomposition coefficients of SPIHT encoding. n = [log2 max { c(i,j) }] = 5, so, The initial threshold value:to = 25, for To, the output binary stream: 11100011100010000001010110000, 29 bits in all. By the SPIHT encoding results, we can see that the output bit stream with a large number of seriate "0" situation, and along with the gradual deepening of quantification, the situation will become much more severity, so there will have a great of redundancy when we direct output. C. Modified SPIHT Algorithm For the output bit stream of SPIHT encoding with a large number of seriate "0" situation, we obtain a conclusion by a lot of statistical analysis: 000 appears with the greatest probability value, usually will be about 1/4.Therefore, divide the binary output stream of SPIHT every 3 bits as a group, every group recorded as a symbol, a total of eight kinds of symbols, statistical probability that they appear, and then encoded using variable-length encoding naturally reached the further compressed, in this paper, variable-length encoding is Huffman encoding. Using the output bit
stream of above example to introduce the new encoding method process. 1) First, divide the binary output stream every 3 bits as a group: 111 000 111 000 100 000 010 101 100 00. In this Process, there will be remain 0, 1, 2 bits can not participate. So, in order to unity, in the head of the output bit stream of Huffman encoding cost two bits to record the number of bits that do not participate in group and those remainder bits direct output in end. 2) The emergence of statistical probability of each symbol grouping results are as follows: P( 000 )= 0.3333 P( 001 )= 0 P( 010 )= 0.1111 P( 011 )= 0 P( 100 )= 0.2222 P( 101 )= 0.1111 P( 110 )= 0 P( 111 )= 0.2222 III. SIMULATION RESULTS Digital image compression based on transform techniques is the most successful than other approaches. In this paper new image compression mechanism based on Discrete cosine transform (DCT) and SPHIT is proposed which yields better efficiency and performance compared to traditional compression techniques. Image compression, the technology of reducing the amount of data required to represent an image, is one of the most important application in the field of digital processing. In this tutorial, we introduce the theory and practice of digital image compression. We examine the most frequently used compression techniques and describe the industry standards that make them useful. Table 1: Quality Vs PSNR for Lena Image Quality JPEG Modified SPIHT 20 41.57 42.15 40 38.13 38.78 60 36.35 36.59 80 35.14 35.20 100 34.28 34.12 Table 2: Quality Vs Compression Ratio for Lena Image Quality JPEG Modified SPIHT 20 3.98 3.98 40 5.34 5.34 60 6.67 6.67 80 7.85 7.85 100 8.90 8.90 IV. CONCLUSION This paper explains about the implementation of modified SPIHT
algorithm and its comparison against the standard JPEG image compression. From the experimental results it is clear that at the same amount of compression ration the perceptual quality of the reconstructed image is far better for the proposed approach when compared with JPEG. This algorithm can be further extended with natural color images and videos. REFERENCES [1] Xin Tian, Lin Wu, Yi-Hua Tan, and Jin- Wen Tian, Efficient Multi-Input/Multi- Output VLSI Architecture for Two- Dimensional Lifting-Based Discrete Wavelet Transform IEEE TRANSACTIONS ON COMPUTERS, VOL. 60, NO. 8, AUGUST 2011 [2] C. Christopoulos, A. Skodras, and T. Ebrahimi, The JPEG2000 Still Image Coding System: An Overview, IEEE Trans. Consumer Electronics, vol. 46,no. 4, pp. 1103-1127, Nov. 2000. [3] C. Chrysafis and A. Ortega, Line- Based, Reduced Memory, Wavelet Image Compression, IEEE Trans. Image Processing., vol. 9, no. 3, pp. 378-389, Mar.2000. [4] P. Wu and L. Chen, An Efficient Architecture for Two-Dimensional Discrete Wavelet Transform, IEEE Trans. Circuits and Systems for Video Technology, vol. 11, no. 4, pp. 536-545, Apr. 2001. [5] I. Daubechies and W. Sweldens, Factoring Wavelet Transforms into Lifting Steps, J. Fourier Analysis and Applications, vol. 4, no. 3, pp. 247-269, 1998. [6] M. Grangetto, E. Magli, M. Martina, and G. Olmo, Optimization and Implementation of the Integer Wavelet Transform for Image Coding, IEEE Trans. Image Processing, vol. 11, no. 6, pp. 596-604, June 2002. [7] H. Liao, M.K. Mandal, and B.F. Cockburn, Efficient Architectures for 1D
and 2D Lifting-Based Wavelet Transform, IEEE Trans. Signal Processing, vol. 52, no. 5, pp. 1315-1326, May 2004. [8] C.T. Huang, P.C. Tseng, and L.G. Chen, Flipping Structure: An Efficient VLSI Architecture for Lifting Based Discrete Wavelet Transform, IEEE Trans. Signal Processing, vol. 52, no. 4, pp. 1080-1089, Apr. 2004. [9] C. Wang and W.S. Gan, Efficient VLSI Architecture for Lifting-Based Discrete Wavelet Packet Transform, IEEE Trans. Circuits and Systems II: Express Briefs, vol. 54, no. 5, pp. 422-426, May 2007. [10] G.-M. Shi, W.-F. Liu, L. Zhang, and F. Li, An Efficient Folded Architecture for Lifting-Based Discrete Wavelet Transform, IEEE Trans. Circuits and Systems II: Express Briefs, vol. 56, no. 4, pp. 290-294, Apr. 2009. [11] G. Dillen et al., Combined Line-Based Architecture for the 5-3 and 9-7 Wavelet Transform of JPEG2000, IEEE Trans. Circuits and Systems for Video Technology, vol. 13, no. 9, pp. 944-950, Sept. 2003. [12] S. Barua, J.E. Carletta, K.A. Kotteri, and A.E. Bell, An Efficient Architecture for Lifting-Based Two-Dimensional Discrete Wavelet Transform, Integration, the VLSI J., vol. 38, no. 3, pp. 341-352, 2005. [13] C. Cheng and K.K. Parhi, High-Speed VLSI Implementation of 2D Discrete Wavelet Transform, IEEE Trans. Signal Processing, vol. 56, no. 1, pp. 393-403, Jan. 2008. [14] S.Narasimhulu, Dr.T.Ramashri / International Journal of Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 4, July-August 2012, pp.902-905 902 Page Gray-Scale Image Compression Using DWT-SPIHT Algorithm [15] Ahmed,N.; Natarajan,T.; Rao,K.R. Discrete Cosine Transform, IEEE Trans. on Computers, vol. C-32, pp. 90-93, Jan. 1974. [16] Liu,C.P.; Poularikas,A.D. A New Subband Coding Technique Using (JPEG) DCT for Image Compression, IEEE Trans. on Image processing, pp.317-321,1996. [17] Antonini,M.; Barlaud,M.; Mathieu, P.; Daubechies,I. Image Coding Using Wavelet Tssransform, IEEE Trans. on Ima ge Processing, Vol. 1, No. 2, pp.205-220.1992.