Image Coding Algorithm Based on All Phase Walsh Biorthogonal ransform Chengyou Wang, Zhengxin Hou, Aiping Yang (chool of Electronic Information Engineering, ianin University, ianin 72 China) wangchengyou@tu.edu.cn, zhengxinhou@6.com, yangaiping@tu.edu.cn Abstract: his paper proposes new concepts of the All Phase Walsh Biorthogonal ransform (APWB) and the dual biorthogonal basis vectors based on the Walsh-Hadamard transform. he matrices of APWB are deduced. hey can be used in image compression instead of the Discrete Cosine ransform (DC). Compared with DC in JPEG image compression algorithm, the PRs of the reconstructed images using the transform are the same as DC s at the same bit rates, but the advantage is that the quantization is very simple. he transform coefficients can be quantized uniformly. herefore the computational complexity is reduced and it is much easier to realize with the hardware. Keywords: image coding; All Phase Walsh Biorthogonal ransform (APWB); dual biorthogonal basis vectors; JPEG compression algorithm; Discrete Cosine ransform (DC); Pea ignal to oise Ratio (PR) Introduction In order to be convenient for image storage and transmission, the development of multimedia and Internet requires adopting a suitable method for image compression and encoding. Discrete Cosine ransform (DC) is a method of transform coding in common use. DC has been adopted widely in the domain of image compression. International standards, for example, JPEG, MPEG and H.264, introduce the compression encoding algorithm based on DC. Quantization table, which is used in the image compression encoding method based on DC, is determined by the vision characteristics of human eyes. Adopting different quantization steps for different DC coefficients maes the quantization table more complex; in particular, adusting bit rate requires more complex multiplications. All Phase Walsh Biorthogonal ransform (APWB) brought forward in this paper is a new transform which can apply to image compression successfully instead of DC. he most strongpoint of the method is that the quantization table is simpler, and transform coefficients can be quantized uniformly, so maing computation simpler, shortening computation time, it is also simpler to implement using hardware. Besides, it can achieve the same image compression effect as DC, outgoing DC at low bit rates especially. his paper is organized as follows. ection 2 explains the All Phase Walsh Biorthogonal ransform. And then in ection, JPEG image compression algorithm is introduced. he application of APWB in image compression is fully described in ection 4. In ection 5, experimental results and comparisons with JPEG algorithm are given and rate distortion curves are plotted. ome reconstructed images are also displayed. he conclusion of the paper is in ection 6. 2 All phase Walsh biorthogonal transform When applying Walsh-Hadamard ransform (WH) to sequency filtering, ( mn, ) Q ( mn, ), ( mn, ) Q ( mn, ), Q( mn, ) Q ( nm, ),where 2,,, 2,, Q is the WH matrix. uppose H is the matrix of -4244-45-2/7/$25. 27 IEEE. - 8 -
sequency filtering, according to reference [], [2], the elements of are where F H H ( mn, ) Q ( ml, ) Q ( ln, ) F ( l) l Q( m n, l) F ( l) l F ( m n) () is the WH transform of the response vector F, and the symbol means dyadic sum. From (), we now that the sequency filtering matrix is symmetric. now uppose h [ h () h () h ( )], if we h, we can get { h ( n)} by symmetry. According to reference [], [2] and (), we have h( ) ( il, ) ( li, ) ( l) Q Q F i l Q (, il) Q(, li ) F() l l i l ( l, ) F ( l) F (2) where is the 2 -D respected response vector and is F 2 2 matrix of All Phase WH. It s easy to prove that has full ran and denotes its (, l) Q ( i, l) Q ( l, i ) i + For example, when, Q ( i, l) Q ( l, i) () i 8 8 8 8 8 8 8 8 7 5 5 7 6 2 2 6 6 2 2 6 5 5 64 4 4 4 4 4 4 4 4. 2 2 2 2 2 2 2 2 From we now that the column vector of has sequency properties. We deduce has sequency properties too. o can be regarded as a new sequency transform matrix, and can be used in image compression instead of DC matrix in JPEG. Definition 2: X is -D vector which length is 2. he APWB of X using is Y X and accordingly its inverse transform is X Y. We suppose f is 2-D vector. Its APWB is F f and the inverse APWB is f ( ) F, where f is the image matrix and F is the transform coefficients matrix. he row vectors of vectors of are the decomposition X, while the column vectors of are the reconstruction vectors. Fig. shows the basis inverse matrix. ince, that is, the resolution vectors of and. vector and the resultant vector are different, but they are dual vectors. he according transform is defined as Walsh Biorthogonal ransform. Definition : and are the APWB matrices, where the row vectors of and the column vectors of mae up of dual biorthogonal basis vectors. According to (2), Fig. he basis vectors of and - 9 -
he decomposition basis images and the reconstruction basis images of 2-D APWB are shown in Fig. 2. C C, we use f C FC to reconstruct image. he decomposition basis vectors are the same as the reconstruction basis vectors. 4 Application of APWB in image coding Fig. 2 he decomposition and reconstruction basis images of 2-D APWB JPEG image compression algorithm [], [4] In all inds of image compression algorithm based on DC, firstly, the source image samples are grouped into 8 8 blocs, and input to the Forward DC (FDC). he output of the FDC is the set of 64 basis-signal amplitudes or DC coefficients whose values are uniquely determined by the particular 64-point input signal. After output from the FDC, each of the 64 DC coefficients is uniformly quantized in conunction with a 64-element quantization table. he goal of this processing step is to discard information which is not visually significant. Finally, all of the quantized coefficients are ordered into the zigzag sequence. his ordering helps to facilitate entropy coding by placing low-frequency coefficients (which are more liely to be nonzero) before high-frequency coefficients. he final DC-based encoder processing step is Variable Length Coding (VLC) and Huffman entropy coding. On the contrary, at the output from the decoder, Huffman entropy decoding, inverse quantization and the Inverse DC (IDC) are processed in a sequence. he Inverse DC outputs 8 8 sample blocs to form the reconstructed image. 2-D DC can be expressed by F CfC, where C is 8 8 DC matrix and C is the transpose matrix of C. ince DC is orthogonal transform, i.e. APWB, ust lie DC, can be used in image compression. It can transform the image from spatial domain to frequency domain too. he similarity between the matrices of APWB and the matrix C of DC is that the sequency increased with the increase of the row number. he difference between them is that all basis vectors of C have the same norm, but the norm of basis vectors in decrease with the increase of the sequency. his maes the coefficients of APWB have high-frequency characteristics. When the transform coefficients are quantized by the same step size, it equals to the quantization of low-frequency coefficients by small step sizes and high-frequency coefficients by big step sizes. he quantization effects are ust lie in DC which uses the complex quantization table. Other steps of image compression algorithm are the same as JPEG. 5 he experimental results and comparisons 5.. Image compression using Matlab We have done simulation experiments using Matlab 6.5 [5], [6], implementing the image compression, encoding and reconstruction for gray image based on DC and APWB. he steps of experiments are as follows: First a set of gray image is segmented into pixel blocs by 8 8, doing DC and APWB for it respectively, so the transform coefficients matrix is got. In the case of DC, we quantize the coefficient matrix using quantization table; In the case of APWB, we adopt uniform quantization step, and then carry through zigzag scan and VLC encoding. Carry out Huffman encoding [], - 2 -
[7] for DC coefficient and AC coefficients respectively. hen compute image encoding compression ratio and encoding bit rate. Afterwards, according to the above contrary process we reconstruct images, and compute PRs of reconstructed images. 5.2. electing and optimizing of APWB matrix Let Q V, V, the equation () can be rewritten as 7 V( l, ) V ( i+ l, ) V ( li, ) (4) 8 i hen we can expand to the following expressions: 7 Vm( l, ) Vm ( i+ l, ) Vm ( li, ) (5) 8 i After four iterative, then we have 8. 8. 8. 8. 8. 8. 8. 8. 7. 5.8.62 2.2.7 4.82 4.58 9.4 6. 2.46.97 4.6 6.26.4 2.5 8.55 5..8 4.5.42.96 4.8 6. 6.2 V5 64 4..82.94.9 4.2.2 5.2...6.2 2.2.4.5.57.6 2..9.98.76 2.6 2.8..2. 2.2.84.5.4.4.8.8 We respectively use V and V5 as APWB matrices. 9 pairs of original images by 52 52 are encoded and reconstructed using the described experimentation steps above. et quantization step as, which equals to set transform coefficient as round integers. It can be used in the case of transmitting image directly not quantized. able shows both of the results of compression ratio () and PR. As able shows, image compression ratio and PR are larger by using V 5 as transform matrix than by using V. Experimentations indicate that when we adopt uniform quantization step, compression effects can be better by using V 5 as APWB matrix than other Vm. o we choose V5 as APWB matrix. In the above experiments, we don t quantize the transform coefficients. Considering with control for bit rate needed in the practice applications, quantizing the transform coefficients is needed, when requiring different image qualities in different applications. Hence, we adopt the improved transform matrix V / 5 V 5 to transform images, so that we can satisfy the demand of controlling bit rate. When 8, V V /8. 5 5 est images able. Comparisons of V V PR/dB V and V5 V 5 V 5 PR/dB Lena 2.6.77.8 5.7 Mill 6.68 25.5 6.46 29.62 Bridge 6.4 25.6 6.26 29. Announcer 6.7 4. 6.76 7.8 Mandrill 5.86 24. 5.64 28.4 Einstein 4. 2.9.96 6. Model 9.8 4.79 9.99 9.9 Mildrop 7. 4.27 7.2 7.58 Cablecar...42 5.66 5.. Comparisons with DC at the same bit rates In order to mae comparisons of DC and APWB expediently, we need compare the PRs of the reconstructed images. After several experiments, we use 6 as the uniformly quantized step of APWB, and DC uses quantization matrix Q [] in JPEG standard. able 2 shows the encoding and reconstructed experimentation results of 9 pairs of original images by 52 52 using both methods of DC and APWB. est images able 2. Comparisons of DC and APDW Bitrate (bpp) DC PR (db) Bitrate (bpp) APDWB PR (db) Lena.6 2.8 5.8.64 2.5 5.7 Mill.2 6.68 29.79.29 6.2 29.89 Bridge.24 6.45 29.54. 5.99 29.55 Announcer.5 5.9 8.27.5 6.9 8. Mandrill.8 5.82 28.2.48 5.4 28.4 Einstein.62 2.9 6.84.6. 6.22 Model.42 9.6 4.65.42 9.2 4.7 Mildrop.49 6.25 8.8.49 6.42 7.79 Cablecar.74.8 6.52.7.99 5.94-2 -
Fig. and Fig. 4 are the reconstructed images of DC and APWB (Q6) respectively. According to subective effects, two images are reconstructed well and the differences of them can be ignored. When we adopt APWB matrix, we can leave out the quantization step for transform coefficients, saving much computing time. However, the present image compression ratio has already exceeded that of JPEG. Besides, it s little difference between the reconstructed image and the original image in PR, so that human eyes can not distinguish them on the whole. Although the bit rate is not adustable, it also can satisfy multitude demands. V m compression using APWB and DC are the same on the whole. 5.4. Rate distortion curves of Announcer image In order to compare with DC further, we change the quantization matrix of APWB to do different quantization for the same image. o we get different compression ratios, encoding bit rates and PRs of the reconstructed images. he experimental results of the Announcer image using DC and APWB respectively are shown in able. Based on the data in able, we plot rate distortion curves of the Announcer image using the two transforms, as shown in Fig. 5. able. Experimental results of Announcer image Fig. Reconstructed Lena images of DC and APWB DC APWB matrix Bitrate PR tep Bitrate PR Q (bpp) (db) Q (bpp) (db) multiply Q*8. 46.4.7 29.45 6 49.29.6 29.46 Q*5. 7.87.2.7 8.2.2 2.24 Q*2.5 26.9. 4.77 5 27.4.29 4.9 Q*2. 2.68.4 5.67 2 24.. 5.7 Q*.5 2.2.4 6.84 9 2.52.9 6.7 Q*. 5.9.5 8.27 6 6.9.5 8. Q*.5.4.79 4.5.4.79 4.22 Q*.5 8.7. 4.72 2 7.68.4 4.72 Q*.24 6.42.24 4.4 5 6..27 42.8 Fig. 4 Reconstructed Announcer images of DC and APWB When we adopt the improved matrix V m of APWB, we can quantize all coefficients by adopting uniform quantization step, adusting this quantization step means adusting the bit rate. Comparing with DC, the computation of quantization is simpler, when the quantization step is 6, and the qualities of reconstructed images in the close bit rates are clearly better than the results of adopting DC. As shown in able 2, the effects of image Fig. 5 Rate distortion curves of Announcer image - 22 -
From Fig. 5, we can see that it s better to do APWB than DC when the encoding bit rate is smaller (compression ratio larger). But when encoding bit rate is larger (compression ratio smaller), the effect of APWB is a little worse. But the two are similar on the whole. Due to adopting only one quantization step and saving memory space of the quantization table using APWB, when adusting bit rates, each image bloc can save 6 multiplication operations between quantization factor and quantization table. 6 Conclusion In this paper, the matrices of the All Phase Walsh Biorthogonal ransform were deduced. Based on the Walsh-Hadamard ransform theory in signal processing and blending the All Phase thining, we triumphantly achieve the compression and reconstruction images by the APWB transform replacing DC commonly used in image compression, and get the same effects as DC in JPEG. Compared with DC, the best merit of this method is the simple quantization by doing uniform quantization for transform coefficients. o the image compression algorithm is much simpler. And what s more, much multiplication operations are saved when adusting bit rates. It is easier to implement by using hardware too. We can foresee that this method will be widely used in the fields of image and video compression. Acnowledgements his wor was supported by the Research Fund for the Doctoral Program of Higher Education (26565). he authors would lie to than Master Xia Pan, Dr. Yingchun Guo and Dr. Xuing Guo for help and valuable suggestions. References [] Zhengxin Hou, Zhaohua Wang, Xi Yang, Design and implementation of all phase DF digital filter, Acta Electronic inica, Vol., o. 4, pp. 59-54, Apr. 2. [2] Zhengxin Hou, Design and Application of the Discrete Cosine equency Filters, Journal of ianin University, Vol. 2, o., pp. 24-28, May 999. [] IO/IEC, IO/IEC 98- IU- Rec..8., Information technology-digital compression and coding of continuous-tone still images-part : Requirements and guidelines, 994. [4] G.K. Wallace, he JPEG still picture compression standard, IEEE ransactions on Consumer Electronics, Vol. 8, o., pp.8-4, Feb. 992. [5] R.C. Gonzalez, R.E. Woods, and.l. Eddins, Digital Image Processing Using MALAB, Prentice-Hall Inc., ew Jersey, 24. [6] Zhiyong Zhang, Master Matlab 6.5 edition, Beiing Aeronautics and Astronautics University Press, Beiing, 2. [7] D. alomon, Data Compression: he Complete Reference (econd Edition), pringer-verlag Inc., ew Yor, 2. Author Biographies Chengyou Wang was born in handong province, China in 979. He received the M.. degree in signal & information processing from ianin University, China, in 27. ow he is a Ph.D. student in chool of Electronic Information Engineering, ianin University. His research fields are mainly in digital image & video processing, wavelet analysis and its applications. Zhengxin Hou was born in ianin, China in 945. He received the B.E. degree in electrical engineering from Peing University, China, in 969 and the M.. degree from ianin University, China, in 982. ow he is a professor and supervisor of the Ph.D. students in the chool of Electronic Information Engineering, ianin University, China. His research interests include digital filtering theory, image processing, wavelet analysis, video coding, etc. Aiping Yang was born in handong province China in 977. he received the M.. degree in applied mathematics from ianin University. ow she is a Ph.D. student as well as a teacher in chool of Electronic Information Engineering, ianin University. Her research fields are mainly in digital image processing, super-resolution image reconstruction and wavelet analysis. - 2 -