Advanced in Information Sciences and Service Sciences Volume 2, Number 3, September 2010
Cost Effective Block Truncation Coding for Color Image Compression J. Wang, K.Y. Min, J.W. Chong Dept. of Electronics and Computer Engineering, Hanyang University, Seoul 133-791, Korea
[email protected],
[email protected],
[email protected] doi: 10.4156/aiss.vol2.issue3.12
Abstract In this paper, a cost effective block truncation coding (CE-BTC) using low cost approach is presented for color image compression. To reduce the bit rate of the basic BTC, selected single bit-map is employed to represent the edge information of the coding block in the proposed CE-BTC. Moreover, a previous proposed algorithm, adaptive quantization coding (AQC), is used to compress the two representative levels further. In order to achieve low cost, the CE-BTC reduces the line buffer memory usage to a half with the limited PSNR losing of 0.02dB compared with the optimal approach. Simulation results show that the proposed CE-BTC outperforms vector quantization-BTC up to 3 dB in PSNR. The comparison with our previous research AHIC also shows that an improvement of 0.425 dB in average PSNR is achieved by the CE-BTC.
Keywords: Block truncation coding, Color image compression, Adaptive quantization coding 1. Introduction Block truncation coding (BTC) was introduced by Delp and Mitchell in 1979 [1]. The algorithm divides an image into non-overlapped blocks and represents each pixel in a block by its high mean or low mean. It is a simple and efficient image compression algorithm [2]. The bit rate of the BTC is limited, because the image quality decreases rapidly when bit rate is decreased. In the literature, many studies have been done to improve the computational complexity, bit rate, and visual quality of the BTC. Such as variable block truncation coding with optimal threshold, where the image is divided into variable size blocks rather than fixed size, and an optimal threshold is adopted to minimize the mean square error [3]; adopting universal hamming codes and a differential pulse code modulation (PCM) to the bit plane and the side information of the BTC to reduce bit rate and preserving the low computational complexity [4]; using optimization techniques for searching of better initial and iterative thresholds to enhance the performance in visual quality of BTC [5]; using a set of predefined bit planes to independently encode image, where the huffman coding is also adopted to further reduce the bit rate [6]. These studies proposed good solutions in quality or coding gain improvement. However, the complexity is increased as well. Some more recent works are proposed for other applications: Han et al., [7] proposed a color compression method based on VQ-BTC to reduce the response time of Liquid-Crystal (LC) and minimize the motion blur on LC Displays (LCD). Wang et al., [8] proposed an advanced hybrid image codec based on the human visual system to improve the overdrive performance in LCD. These works effectively adapt the BTC to various value-added applications. To reduce the bit rate of BTC while maintaining good visual quality and low computational complexity, we propose a cost effective block truncation coding (CE-BTC) using low cost approach for color image compression.
2. Background overview 2.1 Basic BTC In the BTC algorithm the input image is divided into non-overlapping blocks of size m×n pixels. Figure 1 shows the diagram of BTC algorithm for grayscale image compression. Each data block is separately encoded as follows:
91
Cost Effective Block Truncation Coding for Color Image Compression J. Wang, K.Y. Min, J.W. Chong
Figure 1. Image compression using BTC algorithm Let P(i, j) be the grey-level of the pixel at position (i, j), i = 1, 2, …, m and j= 1, 2, …, n. The pixels are then divided into high intensity pixels and low intensity pixels using a local threshold (t) which is the mean of the block. The relative positions of the high and low intensity pixels are specified by the bit-map, B(i, j): 1 if P (i, j ) > t (1) B (i , j ) = 0 otherwise
{
At the decoder, the reconstructed pixel grey-level Q(i, j) is formed as Q (i , j ) =
where a and b are calculated as
{
b a
if B (i, j ) = 1 otherwise
a = ∑ P (i, j )[1 − B (i, j )] / ∑ [1 − B (i, j )]
b = ∑ P (i , j ) B (i , j ) / ∑ B ( i , j )
(2)
(3)
The summation is taken over all pixels in the data block. The BTC algorithm compresses the input image only by transmitting or storing the bit-map, B(i, j) (1 bit/pixel) and the pair of representative levels (a and b, 16 bits per block). This gives an overall bit rate of 2.00 bits per pixel (bpp) in case of block size 4×4 for grayscale image.
2.2 Adaptive quantization coding (AQC) In this section, we briefly describe the AQC algorithm which is developed in our previous research [9]. The AQC algorithm divides the input image into non-overlapping blocks of size m×n pixels, adapts the quantization step to the difference of the block, and quantizes these data, which have been subtracted by the minimum of the block, with three-bit-codes. The image can be reconstructed by the minimum, the quantization step and the three-bit-codes. Each data block is separately encoded and decoded as follows: Let P(i, j) be the grey-level of the pixel at position (i, j), i = 1, 2, …, m, j = 1, 2, …, n. MIN is minimum of P(i, j) and MAX is maximum of P(i, j). The quantization step (qstep) and the quantized three-bit-code (3 bit/pixel), Qcode(i, j), are formed as qstep = ( MAX − MIN ) / 8 Qcode (i, j ) = {P (i, j ) − MIN }/ qstep
(4)
The decoded pixel grey-level Q(i, j) is formed as
Q(i, j ) = MIN + Qcode (i, j ) × qstep
92
(5)
Advanced in Information Sciences and Service Sciences Volume 2, Number 3, September 2010
Compared with the BTC, the AQC algorithm has some characteristics. The AQC uses more bits per pixel than the BTC, so that the bit rate will be higher than the BTC at the same level of block size. But the coding performance of AQC has been proved much better than that of the BTC at the same level of bit rate, especially when the variety of the block is low [9].
3. Proposed CE-BTC 3.1 Algorithm of cost effective BTC As described above, we try to propose a cost effective BTC (CE-BTC), which can improve not only bit rate but also the performance of BTC while maintains a low hardware implementation cost. How to achieve both the low-cost target and reasonably high performance? We first reduce the size of coding block because coding method of BTC with smaller block size tends to obtain higher coding performance and need less line buffers, which leads to lower hardware implementation cost. The remained key problem is how to improve the bit rate. To achieve it there are two possible approaches. One is to compress the bit-maps, and the other is to compress the representative values. The proposed algorithm optimally integrates the two approaches. The block diagram of CE-BTC algorithm can be expressed in Fig. 2. Macro-block consist of four 3x3 blocks Block0
BY0
BY1
Block1
Block2
Block3
aR0 aR1 aR2 aR3 bR0 bR1 bR2 bR3 aG0 aG1 aG2 aG3 bG0bG1bG2bG3 aB0 aB1 aB2 aB3 bB0 bB1 bB2 bB3 Representative R, G, B bit-maps values (RVs) AQC encoder BY2 BY3 single (Y) bit-map encoded RVs
Figure 2. Block diagram of the cost effective codec As shown in Fig. 2, the CE-BTC employ coding block size of 3×3. In terms of three pairs of representative values (aR, bR), (aG, bG) and (aB, bB), we try to compress them by an efficient compression method. Although the correlation among these values is very low, the representative values (e.g.: aR0, aR1, aR2, aR3) of neighboring blocks are highly correlated. Neighboring four blocks form a macro-block. We select the previously proposed algorithm of AQC [9] to compress the representative values of the macro-block as shown in Fig. 2. In terms of three color bit-maps, we take advantage of the correlation of them and generate a single bit-map to efficiently represent them. The detail for compressing the bit-maps is described in the next subsection, and that for the three pairs of representative values is in the following subsection.
3.2 Compressing the bit-maps Three bit-maps (BR, BG, BB) are generated when BTC is used to compress a color image. Each bitmap represents the texture information of each color component. Since there is a texture in a block, it is not necessary to employ three bit-maps to represent the texture information in the block. The key problem is determining how to generate a single bit-map that represents the texture information more exactly. Considering that luminance can be represented by R, G, and B components and that it reflects the sensitivity of the human visual system, we employ the luminance as the first candidate to generate the single bit-map and denote this method by BTC_Y. The luminance bit-map, BY(i, j), is calculated as
93
Cost Effective Block Truncation Coding for Color Image Compression J. Wang, K.Y. Min, J.W. Chong
BY (i, j ) =
{
if Y (i, j ) > T otherwise
1 0
(4)
Y = α × R + β ×G +γ × B where Y(i, j) is luminance in a coding block, T is local threshold which is the average of the block, and α, β, and γ are conversion parameters which is set to 1, 2, and 1, respectively. The aR, G, B and bR, G, B, which are low and high representative values (RVs) of R, G, and B, respectively, can be calculated by the luminance bit-map as aR ,G , B = ∑ PR ,G , B (i, j )[1 − BY (i, j )] / ∑ [1 − BY (i, j )] (5) bR ,G , B = ∑ PR ,G , B (i, j ) BY (i, j ) / ∑ BY (i, j )
Then, the reconstructed pixel QR,G,B is calculated as
⎧b QR ,G , B (i, j ) = ⎨ R ,G , B ⎩ aR ,G , B
if BY (i, j ) = 1 otherwise
(6)
Two other candidates to be used to generate the single bit-map are also considered. The one denoted by BTC_A averages the R, G, and B values of each pixel as A = ( R + G + B) / 3
(7)
The other one denoted by BTC_M averages the minimum and maximum of R, G, and B for each pixel as M = [min .( R, G, B) + max .( R, G, B )] / 2 (8) They generate bit-maps as the same as BTC_Y does. The RVs of R, G, and B may not be calculated by using the luminance bit-map, but using R, G, and B bit-maps, respectively. This method is denoted by BTC_Ync.
(a)
(d)
(b)
(f)
(e)
(c)
(g)
Figure 3. The subjective visual qualities of different methods: (a) original image, (b) original enlarged pixels, (c) BTC, (d) BTC_Y, (e) BTC_Ync, (f) BTC_A, (g) BTC_M. The enlarged pixels are 120×120 from [580, 220].
94
Advanced in Information Sciences and Service Sciences Volume 2, Number 3, September 2010
Comparisons of coding performances in PSNR and the visual qualities are shown in Table 1 and Fig. 3, respectively. Table 1 shows that BTC_Y performs best in PSNR except for basic BTC and that BTC_Ync performs worst among the candidate methods. Regarding image visual quality in Fig. 3, obvious artifacts can be observed in the images produced by BTC_Ync, BTC_A and BTC_M. In contrast, the image produced by BTC_Y exhibits good visual quality and its quality is comparable to that produced by basic BTC. The results of PSNR and visual quality show that the luminance bit-map is the best candidate for the single bit-map approximation, and that using the single bit-map to calculate the two RVs effectively improves the coding performance. Therefore, the luminance bit-map is employed to represent the three bit-maps and calculate the RVs. Table 1. Coding performances of the candidate methods Coding methods
Bit rate (bpp)
PSNR (dB)
Subject artifacts
4×4 BTC BTC_Y BTC_Ync BTC_A BTC_M
6 4 4 4 4
31.049 30.914 29.800 30.891 30.738
not obvious not obvious obvious obvious obvious
3.3 Compressing the representative values As mentioned in subsection 3.1, we exploit the correlation of RVs from neighboring blocks and try to compress them by AQC. The following considers the problem of optimizing the sub-block size, the macro-block size, and the block size of AQC. Among the potential options, an optimal approach could be 6×6 CE-BTC with a sub-block size of 3×3, because the method using square sub- and macro-blocks tends to achieve the best coding performance. One cost effective approach is 12×3 CE-BTC with subblock size 3×3, because the usage of line buffer memory in 12×3 CE-BTC is only half that of 6×6 CEBTC. The AQC block size might be 4×1, 4×2, or 4×3, and these schemes are denoted by 6×6 CE-BTC Scheme 1 (S1), S2, and S3, respectively. The representative values are classified into 6 groups in S1, 3 groups in S2, and 2 groups in S3, as shown in Fig. 4. The coding performances of these methods are reported in Table 2.
Figure 4. Three classification schemes for using AQC to compress the representative values Table 2. Performances of different schemes Coding methods
Bit rate (bpp)
6×6 CE-BTC S1 6×6 CE-BTC S2 6×6 CE-BTC S3 12×3 CE-BTC S2 3×3 BTC 8×6 BTC
5.16 4.00 3.72 4.00 8.33 4.00
PSNR (dB) 32.91 32.83 32.55 32.81 33.25 29.77
Experiment results show that S1 and S2 perform better in PSNR compared with S3. Although S1 shows a litter better performance than S2, the bit rate of S1 is much higher than that of S2. As a tradeoff option of bit rate and PSNR performance, S2 can be regarded as the optimal scheme for 6×6 CEBTC and 12×3 CE-BTC. When the CE-BTC algorithm is implemented in hardware, line buffer usage
95
Cost Effective Block B Truncationn Coding for Coolor Image Comppression J. Wang, K.Y Y. Min, J.W. Chhong
is crittical to the cosst of the codec system. The line buffer usagge of the 12×33 CE-BTC is half the usage of thee 6×6 CE-BTC C. Although the 6×6 CE-BTC C obtains optim mal performance in PSNR, thhe 12×3 CEBTC achieves a lo ow-cost target and reasonablly high perform mance at a lim mited perform mance loss of 0.02ddB in PSNR.
4. Siimulation reesults mages (one in 1368×768 andd others in 5122×512) were used to evaluatte the coding Fivve still test im perfoormance of thee proposed CE-BTC algorithm. The simulaation was perfo formed using four f methods for coomparison: pro oposed methodd of 12×3 CE-B BTC, conventiional method of o 4×4 BTC, 4×4 VQ-BTC [7], and a 32×4 AH HIC [8], whichh have bit rattes of 4, 6, 4, 4 and 4 bpp, respectively. The coding perfoormance is evalluated by utilizzing the peak signal-to-noise s v quality ratio (PSNR).. The subject visual resultts are also giveen in the follow wing. 35.0
BTC
VQ Q‐BTC
AHIC
CE‐BTC
34.0 33.0 32.0 31.0 30.0 29.0 Couple
F‐16
Flower
House
Lena
Figgure 5. Comparrison of the PS SNR results
(a) Origin nal
(b)) Original
(d) VQ-BT TC
(e) AHIC
(c) BTC C
(f) CE-B BTC
Fiigure 6. The su ubjective visuaal qualities (Thhe 400% enlargged pixels are 50×50 5 from [2339, 244].)
96
Advanced in Information Sciences and Service Sciences Volume 2, Number 3, September 2010
(a)
(b)
(c)
(d)
(e)
(f)
Figure 7. Comparison of the subjective visual quality: (a) and (b) Original, (c) BTC, (d) VQ-BTC, (e) AHIC, (f) CE-BTC. The 400% enlarged pixels are 20×50 from [340, 200].
The PSNR results of the proposed CE-BTC and the other compared methods are presented in Fig. 5. The CE-BTC obtains 32.693 dB on average and the best performance (34.513 dB) in Lena. It improves the conventional BTC significantly in PSNR up to 1.779 dB and in bit rate from 6 to 4 bpp. Compared with VQ-BTC [7], the CE-BTC achieves 1.673 dB higher average performances in PSNR, especially in Couple the improvement is up to 3.020 dB. The CE-BTC also performs slight better by 0.425 dB on average than the most competitive method of AHIC [8]. The subjective visual quality is compared using Lena and House, as shown in Fig. 6 and Fig. 7, respectively. In the BTC, the edge of the cap is damaged as shown in Fig. 6 (c) by color and block artifacts. Fig. 6 (d) shows less block artifact than resulted image by BTC in Fig. 6 (c) due to different representative vectors in every sub-block in the VQ-BTC, though color artifact also can be found in Fig. 6 (d). In Fig. 6 (e) resulted by AHIC, good visual quality can be observed in edge, but several color artifacts are noticeable in the area changed gradually. In Fig. 6(f), the proposed method generates less color artifact than the others while preserving the curved edge well, and shows best visual quality in the mass. The comparison of visual quality with House in Fig. 7 shows that the proposed CE-BTC achieves better visual quality than other methods do due to smaller core coding block and optimal combination for the compression of bit-maps and RVs.
5. Conclusions In this paper, we present a cost effective block truncation coding (CE-BTC) using low cost approach for color image compression. The usage of line buffer memory in low cost approach CE-BTC is only a half of that in the optimal approach in CE-BTC. Therefore, the low cost approach CE-BTC can be suit to apply to some resource restrained applications such as frame memory reduction in LCD overdrive. Simulation results show that the proposed CE-BTC outperforms the VQ-BTC in PSNR up to 3 dB and much better subject visual quality. Compared with our previous research AHIC, the CE-BTC also performs a litter better in subjective visual quality and in PSNR by 0.425 dB on average.
6. Acknowledgement This research was sponsored by Seoul R&BD Program and ETRI SoC Industry Promotion Center, Human Resource Development Project for IT-SoC Architect. This research was also supported by the MKE (Ministry of Knowledge Economy), Korea, under the ITRC (Information Technology Research Center) support program supervised by the NIPA (National IT Industry Promotion Agency) (NIPA2010-C1090-1011-0007). The IDEC provide research facilities for this study.
7. References [1] E.J. Delp and O.R. Mitchell, “Image compression using block truncation coding”, IEEE Trans. Commun., Vol. 27, No. 9, pp. 1335-1342, 1979.
97
Cost Effective Block B Truncationn Coding for Coolor Image Comppression J. Wang, K.Y Y. Min, J.W. Chhong
[2] JJ. Guo and M. Wu, “Improvved Block trunncation coding based on the void-and-clusster dithering a approach”, IEE EE Transactionns on image proocessing, Vol. 18, No. 1, pp. 211-213, 2 20099. [3] M. M Kamel, C. Sun, and L. Guan, G “Image compression by b variable bloock truncation coding with o optimal thresho old”, IEEE Traans. Signal Proccessing, Vol. 39, 3 No. 1, pp. 208–212, 2 1991.. [4] C. C Huang and Y. Lin, “Hybrrid block trunccation coding”, IEEE Signal Processing Leetter, Vol. 4, N 12, pp. 328 No. 8–330, 1997. [5] K.W. K Chan, and a K.L. Chan, “Optimizattion of multi-level block trruncation codding”, Signal P Processing: Imaage Communiccation 16 (1), pp. p 445-459, 2001. 2 [6] T.M. T Amarunn nishad, V.K. Goovindan, and T.M. T Abraham m, “Block trunccation coding using u a set of p predefined bitt planes”, Inn Proc. Int. Conf. Compuutational Intelligence and Multimedia A Applications (ICCIMA 2007)), Dec. 2007, Sivakasi, S Tamill Nadu, India, pp. p 73–78, IEE EE, 2007. [7] J. J Han, Y. Yoon, T. Wang, M. M Hwang, and S. Ko, “Vectorr quantizer bassed block trunccation coding f color imagee compression in LCD overddrive”, IEEE Trrans. Consumeer Electronics, Vol. 54, No. for 4 pp. 1839-184 4, 45, 2008. [8] J. J Wang, and J. J Chong, “Higgh performancce overdrive ussing improvedd motion adapttive codec in L LCD”, IEEE Trrans. Consumeer Electronics, Vol. 55, No. 1, pp. 20-26, 20009. [9] J. J Wang, K. Min, and J. Chonng, “A hybrid image coding in overdrive foor motion blur reduction in L LCD”, In Proc. of 6th Int. Computer Enterrtainment Com mputing (ICEC’07), Sep. 20007, Shanghai, C China, 263 – 27 70, Springer, 2007. 2 Jun Wangg received his BS degree from fr Wuhan University U of Technology, Wuhan, China, in 2001. He H has been puursuing his PhhD degree since Sept. 2006 mputer Engineeering, Hanyangg University, in the Deparrtment of Electtronic and Com Seoul, Korrea. His reseaarch interests are image annd video proocessing, the hardware design d of the real-time r imagge and video processing, p annd embedded image proceessing. Kyeong-yu uk Min (M’022) was born inn Nonsan, Korea, on Sept. 26, 2 1966. He received thee B.S degree inn physics from m Korea Univerrsity, Seoul, Koorea in 1992. He receivedd the M.S. annd the Ph.D. degree in electronics enginneering from Hanyang University, U Seouul, Korea in 19996, and 2010 respectively. He H became a Member (M M) of IEEE in 2002. 2 His currrent research innterests the diggital Cinema, the hardwaare design off real-time H.264 H encoderr/decoder andd JPEG2000 encoder/deccoder. Jong-Wha Chong received his B.S.. and the M..S. degree in Electronics Engineeringg from Hanyyang Universitty, Seoul, Koorea, in 19755, and 1979 respectivelyy. He receivedd his Ph.D. degree in Electtronics & Com mmunication Engineeringg from Wasedda University, Japan, in 1981. From 1983 to 1984, he was a reseaarcher at the Korean K Institutte of Electroniics & Technollogy (KIET). From 1986 to 1987, he was w a visiting professor p at thhe University of o California, U From 1993 to 1994, hee served as chaairperson of CAD & VLSI Berkeley, USA. society at the t Institute of the Electronnic Engineers of o KOREA (IEEK). From 1995 to 19997, he was a visiting v professsor at the Univversity of Newccastle UponTyne, England and from 1997 to 1999, 1 he was thhe Dean of thee Information and a Communiccation Center, y. He has beenn a professor of o the Departm ment of Electronnics Engineerinng, Hanyang Hanyyang University Univeersity, Seoul, Korea since 1981, and has been the Vicee chairman of the IEEK sincce 2002. His currennt research in nterests are the t design off ASIC emulaation systems,, CAD for VLSI, V H.264 encodder/decoder deesign, JPEG20000 encoder dessign, and comm munication cirrcuit design, paarticularly in UWB B modem desig gn.
98