LOW MEMORY COLOR IMAGE ZEROTREE CODING ... - CiteSeerX

4 downloads 58 Views 874KB Size Report
Wen-Kuo Lin and Neil Burgess. Department of Electrical and Electronic Engineering. The University of Adelaide. Adelaide, SA, Australia 5005 wklin,neilb¡ ...
LOW MEMORY COLOR IMAGE ZEROTREE CODING Wen-Kuo Lin and Neil Burgess Department of Electrical and Electronic Engineering The University of Adelaide Adelaide, SA, Australia 5005 wklin,neilb @eleceng.adelaide.edu.au



ABSTRACT Said and Pearlman’s Set Partitioning In Hierarchical Trees (SPIHT) algorithm [5] is a well-known and efficient zerotree coding algorithm. However SPIHT’s high memory requirement is a major drawback for hardware implementation. In this paper we present a color image coding algorithm which requires much less memory during coding. Consequently the implementation complexity and hardware cost can be reduced significantly. Our experimental results show only a minor reduction of PSNR values when compared with the those obtained by the SPIHT codec illustrating well the trade-off between memory requirement and hardware simplicity. 1. INTRODUCTION One well-known image coding method for coding a discrete wavelet transformed (DWT) image is the zerotree wavelet image coding technique, introduced by Shapiro [6]. Since its introduction, several other coding algorithms have been developed based on zerotree theory. SPIHT is the most significant of these algorithms because it demonstrates a very simple and efficient way to code a DWT image. During coding, SPIHT needs to maintain three lists to store temporarily the image’s zerotree structure and significance information. However, these three lists represent a major drawback for hardware implementation because a large amount of memory is needed to maintain these lists. For example, for a 512x512 color image, each entry of the list needs 18 bits of memory to store the row and column coordinates. Given that the total number of list entries of a single color element is approximately twice the total number of coefficients, the total memory required is 3.375 MBytes and the required memory will increase if the bit rate increases. This high memory requirement means that SPIHT is not a cost effective compression algorithm for VLSI implementation. In this paper we present a zerotree coding algorithm for color image coding called Listless Zerotree Coding (LZC). The advantage of LZC over SPIHT is that no lists

are needed during coding and decoding. Instead, a color coefficient only needs a 3-bit flag if the coefficient is in the first wavelet transform level and a 6-bit flag if it is in any other transform level. Consequently, the amount of memory that required by a LZC codec is only a fraction of the amount needed by a SPIHT codec. In common with SPIHT, LZC is a progressive coding algorithm. The color components are coded in the order Y tree, V tree, U tree, and the coding can be stopped at any point to give a precise bit-rate control. The coding algorithm of LZC is presented in section 2. Advantages of LZC over other coding algorithms are discussed in section 3. Our experiments are shown in section 4. A possible improvement of the LZC algorithm is discussed in section 5. Finally, this paper is concluded in section 6. 2. CODING ALGORITHM The LZC coding algorithm and SPIHT are quite similar except that, since the LZC abandons the use of lists, a different tree structure and coding procedure had to be developed for LZC. The tree symbols of LZC zerotree are as follows:

 

C(i,j) wavelet coefficient at the coordinate (i,j);



O(i,j) set of child coefficients of C(i,j), ie. coefficients at coordinates (2i,2j), (2i,2j+1), (2i+1,2j), (2i+1,2j+1); except at the finest transform level (ie. Level 1);



D(i,j) set of descendant coefficients of C(i,j), ie. all offsprings of C(i,j);

 18(bits)x512(pixels)x512(lines)x3(colors)x2/8bits/1K/1K

3.375MB

=

  

(i,j) significant map of coefficient C(i,j); (i,j) significant map of set D(i,j);

R(i,j) set of root coefficients at LL band.

The significant coefficients and significant descendant sets in the LZC algorithm are identified by the function

() which is defined as:



) if any  !"$#% " &('  otherwise.

n LL bands

(1)

LZC’s zerotree relations adopt Shapiro’s zerotree relation as shown in Figure 1(a). The positions of significant pixels are encoded by symbols and . The maps used to indicate the significance of and are called the map and the map, respectively, as shown in Figure 1(b). The size of the map is the same size as the image, whereas the map is only a quarter of the image size because coefficients in level 1 do not have any descendants. Therefore, for a 512x512 color image, the total memory required to store the zerotree structure is only 120KBytes for all bit rates. When compared with the 3.375 MBytes memory requirement for SPIHT, the memory requirement for LZC has been reduced significantly. The LZC codec performs three tasks: initialization,

+/.

*

+-.

+,

*

+-,

Y

U

n-1 Tree branches

V

Y

U

LL bands

V

Y

U

n-2 Tree branches

V

Y

U

V

n-3 Tree branches

U

V

LL bands Y

U

Y

U

V

Y

n-4 Tree branches

V

LL bands

Y

U

V

LL bands Y

U

Tree branches

V

Y

U

V

...

Figure 3: LZC coded bitstream.

0

Level 1 Level 2

Level 3

Level 3 Level 2 Level 1

C(i,j)

Fd Map

O(i,j) D(i,j)

Fc Map

(a)

(b)

+,

+-.

Figure 1: (a) LZC tree structures at different wavelet transform levels. (b) Sizes of map and map.

Figure 4: LZC tree coding procedure diagram.

1

>



The tree-coding procedure performs two tasks: coding individual tree nodes and coding descendant sets. During the coding process the codec checks whether a tree node has been encoded as a significant coefficient or not in the previous coding run according to the flag map . If is significant (ie. ) from the previous coding run, then the codec outputs the refinement bit of . Otherwise the codec compares with the current threshold, given by Equation 1. If is insignificant (ie. ) then the codec outputs . If is significant (ie. ), then the codec outputs the most significant bit (MSB) and sign bit of , and sets the flag map entry to . After coding the tree node , the codec checks the significance of ’s descendant set . If the descendant set was not significant in the previous run, the LZC codec then checks the significance of . If is also insignificant, then the LZC codec outputs and finishes the current tree branch coding procedure. Otherwise, if is significant, then to , partitions the LZC codec sets the map into different tree branches, and codes the partitioned trees separately. The new partitioned tree nodes are the coefficients in the offspring set as indicated in Figure 4. The new partitioned descendant sets of the new tree nodes are also indicated in the this figure. The partitioning and coding processes of the tree branches continue until all the tree branches are partitioned into individual tree nodes. Finally, in the case of the map at position being set to , ie. was significant in the previous coding run, the LZC codec partitions and codes directly without performing the the descendant set significance test.

> + . >?!

  >

> ?! >

1) 1

1 1

+ . > ?! 

 @ )

* !"

 AB  +-. !"



  * > * )  11

>?! >?!

* >

* 

*     +-, 1 1 C >

+, 1  1 *  * >?!

>

3. ADVANTAGES OF LZC Although Su and Wu’s Embedded Recursive Zerotree (ERZ) coding scheme [7] was the first algorithm to demonstrate the use of flag maps to reduce the memory requirements of DWT image coding, there are still some aspects of ERZ that make it more complicated for hardware implementation than LZC. Firstly, the representation of ERZ zerotree symbols is not efficient. At coordinates the tree structure of the ERZ algorithm is represented by a tree root and its descendant set . The root and the set are further grouped together to form a spatial tree . This tree structure is good only at very low bit-rates when and are likely to be insignificant, so that the insignificant tree can just be coded by a single symbol . However, at moderate bit-rates, when and are likely to be significant, the symbol becomes redundant. Hence, the bit budget will be wasted in coding the symbol . In LZC, the tree only consists of the tree root and its descendant set , as shown previously in Figure 1(a). As a result, this two-

  * >?! 

*

>

D>*  



*

*

symbol tree representation allows more coefficients to be coded at higher bit-rates. In addition, the reduction in the number of tree symbols makes LZC a simpler coding algorithm so that the hardware implementation of a LZC codec is simpler than an ERZ codec. Secondly, the zerotree relation of ERZ is not well assigned. In the ERZ algorithm, coefficients in the LL quadrant are considered as isolated tree roots and do not have any descendants in high frequency bands. Therefore, for good coding results, the ERZ algorithm requires as few coefficients as possible in the LL band. This implies that the image being coded by ERZ algorithm should be wavelet transformed to the highest possible dyadic transform level. Consequently, a more complicated discrete wavelet transform circuit is needed for the higher wavelet transform levels. Also, depending on the image size, there may only be a few dyadic wavelet transform levels available with the result that many coefficients may remain in the LL band, resulting in poor coding results. By contrast, the LZC algorithm adopts Shapiro’s zerotree relation. That is, a coefficient in the LL band has one child in each of the high frequency bands, ie. LH, HL and HH. Moreover, a coefficient in a high frequency band has four children in the same spatial location of the finer transform level. By using this tree relation in LZC, the image can be wavelet transformed to several levels, leaving many coefficients in LL band, but the coding results can still be good. Hence, LZC is a better algorithm than ERZ for images that have relatively few dyadic wavelet transform levels. In addition, for this tree relation, LZC is also better than SPIHT because LZC does not require the dimension of the frequency bands in the highest wavelet transform level to be even, whereas SPIHT needs even size frequency bands in the highest transform level. Therefore, when coding QCIF (quarter common intermediate format) video frames, the size of the chrominance frames needs to be adjusted to allow even size frequency bands in the highest transform level [4]. As a result, additional circuits are needed by a SPIHT codec for image size adjustment. Moreover, the coding procedure of SPIHT is divided into a sorting pass and a refinement pass. The control flow when switching between these two passes can be easily accommodated in software, but is not nearly so easy to achieve in a hardware implementation. Therefore, in LZC, the sorting and refinement passes are merged into one single pass which in turn results in a simpler control flow implementation than SPIHT. As well as its advantages for hardware implementation, LZC algorithm is also more suitable for incorporation into a plug-in program for internet browsers than SPIHT. Since LZC requires less memory during encoding and decoding but has a comparable source code complexity, the program footprint is relatively smaller than SPIHT. That is, the working memory used to store program code and to process data is smaller than SPIHT. This is clearly a good feature from the user’s

point of view. 4. EXPERIMENTAL RESULTS Our test LZC codec was written in ANSI C. The wavelet filter used in the test was the Daubechies’ 9/7 filter [1]. The color images were transformed to YUV color space before coding. After LZC, the bit-stream was further coded using Witten, Neal and Cleary’s Arithmetic Coding method [12]. The number of wavelet transform levels varied from image to image, depending on their sizes. The test results were compared with results obtained using the SPIHT color codec downloaded from the SPIHT Web Site. The test color images are various sizes and patterns as shown in Figure 6. The test PSNR results (in dB) obtained by Equation 2 are shown in Figure 5. In addition, examples of compressed girls images at different ratios are presented in Figure 7.

E FHGI  K) JMLON M RS TB>GU VRS W'QTBPK>P9XY0 /VZRS WT[>\AA]9^

Figure 6: Original 24-bit color test images.

(2)

F

The MSE is the mean-square-error and is obtained from the following equation, where is the lines of an image, is the number of pixels per line, and the functions and represent the original and the reconstructed images respectively.

R

_

`_

RS WTB _   aF  R cdfeb c e _  !" :k`_ !"ml 0 ah g ji

(3)

The results in Figure 5 show that at low bit-rates LZC’s PSNR results are up to 1 dB lower than SPIHT’s, but for some images the differences get closer as the bit-rate increases. At high bit-rates, LZC’s results are very close to SPIHT’s in some cases, or even better. On average, the results obtained from LZC coding are about 0.7 dB lower than those obtained from SPIHT. The coding results could be improved by using alternative color coding sequences to the Y, U, V sequence. For example, sometimes the V component appears to be more important than the U component, but since V is encoded after U, important information maybe discarded at the end of the coding process. Therefore, by adding an additional

bpp 0.10 0.25 0.50 1.00 2.00 2.66

Girls LZC SPIHT 28.55 29.40 31.22 32.05 33.94 34.57 37.17 38.04 41.72 42.31 43.57 43.70

Cacti LZC SPIHT 17.29 18.08 18.93 19.72 21.08 21.73 23.77 24.67 28.42 28.90 31.43 31.19

Cratetlake LZC SPIHT 17.44 18.05 19.47 20.10 22.52 22.92 26.45 27.34 33.45 34.84 37.35 38.16

Figure 5: PSNR Results of LZC and SPIHT

operation into the main coding procedure to decide the coding sequence of the U and V components, the LZC coding results could be improved. 5. ALGORITHM IMPROVEMENT Although our main purpose was to reduce the memory requirement for color image coding, our LZC algorithm only achieves memory reduction in the image coding part and thus leaves scope for the wavelet transform part to be improved. The wavelet transform method used in our algorithm is the traditional filter bank implementation, ie. Mallat’s fast wavelet transform. However, an alternative wavelet transform method called the ”lifted wavelet Transform” has been extensively studied [2], [3], [10], [11], [8], [9]. These studies show that the lifted wavelet method can not only improve the transform speed but also can reduce the memory requirement during transform. Therefore, in our future work we will substitute the filter bank implementation of the wavelet transform with the lifted wavelet transform implementation for further memory reduction. Mandrill LZC SPIHT 20.19 20.63 21.76 22.29 23.51 24.19 26.58 26.83 30.73 30.46 32.48 32.50

Akiyo LZC SPIHT 21.91 23.43 25.83 26.86 29.32 30.03 34.11 34.73 39.38 40.14 42.45 42.91

6. CONCLUSION Although our LZC algorithm was originally developed for hardware implementation, our software test results show that the LZC images have only a slight reduction in PSNR and comparable visual quality when compared with SPIHT’s coding. In some cases LZC compressed images have even better PSNRs than SPIHT’s. That is, our LZC algorithm has provided a good alternative compression method for hardware implementation. This approach illustrates well the trade off that exists between slightly better PSNR values of coded images and the reduced amount of memory and circuitry in a hardware implementation. 7. REFERENCES [1] M. Antonini, M. Barlaud, P. Mathieu, and I. Daubechies. Image Coding Using Wavelet Transform. IEEE Transactions on Image Processing, 1(2):205–220, April 1992. [2] A. R. Calderbank, I. Daubechies, W. Sweldens, and B.L. Yeo. Wavelet transforms that map integers to integers. Appl. Comput. Harmon. Anal., 5(4):332–369, 1998. [3] I. Daubechies and W. Sweldens. Factoring wavelet transforms into lifting steps. J. Fourier Anal. Appl., 4(3):245– 267, 1998. [4] B.-J. Kim, Z. Xiong, and W. Pearlman. Very Low Bit-Rate Embedded Video Coding with 3D Set Partition in Hierarchical Trees (3D SPIHT). IEEE Transactions on Circuit and System for Video Technology, pages ?–?, September 1998. http://ipl.rpi.edu/publications/publications.html. [5] A. Said and W. Pearlman. A New, Fast, and Efficient Image Codec Based on Set Partitioning in Hierarchical Trees. IEEE Transactions on Circuit and System for Video Technology, 6(3):243–250, June 1996. [6] J. Shapiro. Embedded Image Coding Using Zerotrees of Wavelet Coefficients. IEEE Transactions on Signal Processing, 41(12):3445–3462, December 1993. [7] C.-Y. Su and B.-F. Wu. Image Coding Based on Embedded Resursive Zerotree. In ISMIP ’97, pages 387–392, Taipei, Taiwan, December 1997. [8] W. Sweldens. The lifting scheme: A new philosophy in biorthogonal wavelet construction. In Wavelet Applications in Signal and Image Processing III, pages 68–79. Proc. SPIE 2569, 1995. [9] W. Sweldens. The lifting scheme: A custom-design construction of biorthogonal wavelets. Appl. Comput. Harmon. Anal., 3(2):186–200, 1996. [10] W. Sweldens. The lifting scheme: A construction of second generation wavelets. SIAM J. Math. Anal., 29(2):511– 546, 1997. [11] W. Sweldens and Schr¨oder. Building your own wavelets at home. Technical report, University of South Carolina, 1995. Obtained from WWW. [12] I. Witten, R. Neal, and J. Cleary. Arithmetic Coding for Data Compression. Communications of the ACM, 30(6):520–540, June 1987.

Figure 7: LZC compressed Mandrill images.