+ All Categories
Home > Documents > Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn...

Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn...

Date post: 03-Feb-2020
Category:
Upload: others
View: 10 times
Download: 0 times
Share this document with a friend
30
RMF Based EZW Image Compression Method Tao Tao, Kunal Mukherjee and Amar Mukherjee School of Electrical Engineering and Computer Science University of Central Florida Orlando, Fl.32816 Email: (amar+ttao)@cs.ucf.edu Abstract In this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image Coding Using Zero-trees of Wavelet Coefficients) image compression method. We propose this method based on two works, one is the EZW algorithm [1] and the other one is a new DWT (Discrete Wavelet Transform) algorithm called RMF algorithm [2, 3]. The EZW algorithm, which is a very successful wavelet based image compression method, has two main limitations – the sub-image level encoding is not possible and the computational complexity is high. The RMF algorithm, which has the same computation result as FWT (Fast Wavelet Transform) but has a different data flow, has the advantage that it maintains the spatial locality property of wavelet coefficients which are computed in a bottom up fashion. In our method, we replace the FWT algorithm with the RMF algorithm in the EZW algorithm so that the sub-image level coding is provided in the RMF based EZW compression method. This also allows an efficient recursive computation of the maximal absolute values called band_max values of the sub-images. The band_max values are used to improve the execution time of the EZW coding process. The experimental results show that our new algorithm improves the computation time by 11% to 55% depending on the image size. 1.Introduction 1
Transcript
Page 1: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

RMF Based EZW Image Compression MethodTao Tao, Kunal Mukherjee and Amar Mukherjee

School of Electrical Engineering and Computer ScienceUniversity of Central Florida

Orlando, Fl.32816Email: (amar+ttao)@cs.ucf.edu

Abstract

In this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image Coding Using Zero-trees of Wavelet Coefficients) image compression method. We propose this method based on two works, one is the EZW algorithm [1] and the other one is a new DWT (Discrete Wavelet Transform) algorithm called RMF algorithm [2, 3]. The EZW algorithm, which is a very successful wavelet based image compression method, has two main limitations – the sub-image level encoding is not possible and the computational complexity is high. The RMF algorithm, which has the same computation result as FWT (Fast Wavelet Transform) but has a different data flow, has the advantage that it maintains the spatial locality property of wavelet coefficients which are computed in a bottom up fashion. In our method, we replace the FWT algorithm with the RMF algorithm in the EZW algorithm so that the sub-image level coding is provided in the RMF based EZW compression method. This also allows an efficient recursive computation of the maximal absolute values called band_max values of the sub-images. The band_max values are used to improve the execution time of the EZW coding process. The experimental results show that our new algorithm improves the computation time by 11% to 55% depending on the image size.

1. Introduction

The DWT (Discrete Wavelet Transform) has recently emerged as a powerful technique for image compression because of its multi-resolution and locality properties [4, 5, 6]. The advantages of using DWT over the DCT (Discrete Cosine Transform) lies in the fact that the DWT projects high-detail image components onto shorter basis functions with higher resolution, while lower detail component are projected onto larger basis functions, which correspond to narrower sub-bands, establishing a trade-off between time and frequency resolution [4]. The JPEG sequential DCT-based mode has a high degree of artificial blocking in the reconstructed image [7] for low bit rates so that many wavelet based image compression have been proposed to overcome this problem. Among these wavelet based image compression methods, a very successful method is the EZW algorithm, which was proposed in [1]. The EZW algorithm, which effectively overcomes the blocking artifacts problem in JPEG DCT-based mode and compresses the image in a progressive way, has two main limitations. One is that the sub-image level encoding is not possible and the other one is that the computational complexity is too high. These

1

Page 2: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

limitations are due to the FWT used in the EZW algorithm. Figure 1 shows the FWT computation of an 8-element one-dimensional vector. The coefficients at any intermediate stage of computation do not maintain any spatial sub-image relation. For example, at the end of second stage, the coefficients (S1,D1,S2,D2) do not constitute a complete wavelet transform for the sub-image (x1,x2,x3,x4). Therefore, the EZW encoding, which needs the complete wavelet transform for the sub-image, cannot be applied on the sub-images and the EZW encoding cannot be pipelined with the transform stage.

In this paper, we discuss a new RMF based EZW compression method, which overcomes these limitations. The sub-image level encoding is provided in our algorithm. We also produced an improvement of execution time by 11% to 55% depending on the image size. The proposed algorithm has been implemented and inserted into the PVRG (Portable Video Research Group)-JPEG coder as an additional coding mode. In Section 2, we give a brief introduction of the EZW algorithm. We then give the analysis of this method and point out its limitations. In Section 3, we present the RMF algorithm with the analysis of its data flow and properties. We discuss how these properties could be used to overcome the limitations of the EZW algorithm. In Section 4, we present our new RMF based EZW compression method. The experimental results and the conclusions are presented in Section 5.

2. The EZW Algorithm

The EZW algorithm is a successful algorithm that exploits the spatial redundancy relationship between wavelet coefficients. EZW is specifically developed for low bit rates, and is based on a special scheme of encoding wavelet coefficients using scalar quantization.

2

Page 3: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

How the EZW algorithm works

The EZW algorithm has the following three major steps:1. The entire input image is input into the discrete wavelet transform. After this step,

the complete DWT coefficients will be generated. The wavelet transform decomposes the image into several octaves or levels. A lower octave means a higher resolution. At each octave, except the highest octave, there are three sub-bands, namely HL sub-band, LH sub-band and HH sub-band, as shown in Figure

2. The highest octave has only one sub-band, LL, which is the only LL sub-band among all the sub-bands. Sub-bands HLi (i = 1, 2, … , max_oct, max_oct = the number of the octaves) are said to have the same spatial location or the same orientation. The statement is also true for the LHi and HHi (i = 1, 2, … , max_oct) sub-bands. With the exception of the wavelet coefficient at the upper-left corner and all the coefficients in the lowest octave, each coefficient in octave k (1 < k < max_oct) has four children in the next lower octave k-1 in the same spatial orientation. The relationship between wavelet coefficients that are in different octaves but in the same spatial location can be represented by a quad-tree, as shown in Figure 3.

3

HL1

HH1LH1

HL2

HH2LH2

LH3 HH3

HL3LL3

Figure 2 Sub-band representation of the wavelet coefficients

Page 4: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

Figure 3 Quad-tree representation of the wavelet coefficients

2. The wavelet coefficients then are encoded by the EZW encoding algorithm as described in the following pseudo code:

threshold = initial_threshold; do { dominant_pass(image); subordinate_pass(image); threshold = threshold/2; } while (threshold > minimum_threshold);

The algorithm starts by computing an initial threshold t0, which is determined by the following equation.

Where MAX denotes the maximum and (x, y) denotes the wavelet coefficients. The algorithm then goes into a loop that has two main process, dominant pass and subordinate pass. In the dominant pass, the wavelet coefficients of the image are scanned in a special order shown in Figure 4. If the absolute value of the wavelet coefficient is larger than the threshold, it will be encoded as POS (positive) or NEG (negative) depends on its sign. If the absolute value of the wavelet coefficient is smaller than the threshold, we then compare all its descendants with the threshold. If any of its descendants has a larger absolute value than the threshold, it will be encoded as IZ (isolated zero). If all its descendants are insignificant with respect to the threshold, the quad-tree rooted from it is called a zero-tree. The root of the zero-tree will be encoded as ZTR (zero-tree root) and none of its descendants needs to be encoded. When the decoder reconstructs the data, all the wavelet coefficients in a zero-tree will be reconstructed as 0. Obviously, if there are a many zero-trees in the DWTs of an image, this image will be compressed efficiently. The following theory called zero-tree hypothesis is true for most actual images.

If a wavelet coefficient c at a higher octave is insignificant with respect to a given threshold T, i.e. |c|<T then all wavelet coefficients of the same orientation at lower octaves are also likely to be insignificant with respect to T.

4

Page 5: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

At the end of the dominant pass, all the coefficients that are encoded as POS or NEG will be extracted and placed without their sign in a subordinate list and their positions in the image are filled with zeroes. This will prevent them from being coded again. The subordinate pass is the refinement process for the coefficients in the subordinate list and it outputs the next most significant bit of these coefficients.The threshold is then decreased by dividing the initial threshold by 2. The dominant pass and sub-ordinate pass are repeated at the new threshold level thus the encoder does a finer encoding of the coefficients. The main loop ends when the threshold reaches a minimum value, which could be specified to control the encoding performance – a “0” minimum value gives the loss-less reconstruction of the image.

3. Finally, the Arithmetic coding is used to entropy encode the symbols generated from step2 because the Arithmetic coding encodes the symbols in a progressive way which is compatible with step 2.

This encoding of the zero-tree produces significant compression because gray level images resulting from natural sources typically result in DWTs with many ZTR symbols. Each ZTR indicates that no more bits are needed for encoding the descendants of the corresponding coefficient

The limitations of EZW algorithm

The EZW algorithm has two main limitations. The first limitation is that the sub-image level encoding is not possible. Since the EZW algorithm uses the FWT, which does not maintain the spatial locality property, to compute the wavelet coefficients, we could not get the complete wavelet transform of the sub-images. Therefore, the EZW encoding, which needs the complete wavelet transform, cannot be applied on the sub-images. The second limitation is that the computational complexity is too high. The EZW encoding cannot start until the whole image has been transformed since the FWT does not maintain the spatial locality property. Therefore, the encoding stage and the transform stage are de-

5

Figure 3 Raster scan order of the wavelet coefficients

Page 6: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

coupled and they cannot be pipelined. The zero-tree checking, which needs a large amount of comparisons, is one main reason that increases the computation time.

3. The RMF Algorithm

Mukherjee proposed a new discrete wavelet transform algorithm, which is called Recursive Merge Filter (RMF) algorithm [2, 3]. This algorithm, which exploits the “locality property” of wavelets, overcomes the limitations of FWT and ensures that intermediate results can be used for sub-image coding. Stronger coupling and pipelining between the transform and the coding stages is made possible because the wavelet transform of the entire image is constructed in a bottom-up fashion, by merging smaller DWTs into larger ones. The RMF algorithm has the same computational results as the FWT algorithm at the same complexity, but the data flow is different.The 1-D RMF computation using Haar filter is shown in Figure 5.

We are assuming that the filter is separable, which is true for both the Haar filter and Daubechies filter. It proceeds through a succession of merger and filter steps. The initial step of RMF is exact the same as the first step of FWT, after that, RMF applies logN-1 (merge, filter) steps on the coefficients. Obviously, each (merger, filter) step includes two

operations: merge and filter. In the first merge operation, instead of permuting all the high pass coefficients to the bottom half of the array, we merge the coefficients between adjacent pairs of groups, here each group has a length of 2i (i is the operation number). For example, for the first merge operation, the length of a group is 2. After the first merge, we re-group the coefficients into groups of length of 4, such that the first two coefficients are low pass coefficients and the last two are high pass coefficients.

The algorithm then proceeds to the filter operation, by applying the Haar filter matrix interleaved with identity matrix of size 2 by 2. After that, we have computed the second octave coefficients. An important observation here is that the first half elements we got so far are exactly the DWTs of first half elements of the original input. The second half elements are exactly the DWTs of the second half elements of the original input. This is a very important property of RMF algorithm, since the spatial coherence is maintained.

We then apply the second (merge, filter) step on the coefficient. This time we merge adjacent pairs of groups and each group has a length of 4. Then we apply Haar filter. We repeat this (merge, filter) step and after i steps, the intermediate coefficients are the N/2 i

complete DWTs of successive sub-sequences (each of length 2i) of the original input. The intermediate arrays of wavelet coefficient have spatial coherence with the original input,

6

Figure 5 The computation of RMF algorithm

Page 7: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

as we have talked above. So the locality property of wavelet is exploited. The DWT coefficients are built from a bottom-up fashion. Two arbitrary DWTs of length of N can be efficiently combined to form a DWT of length of 2N. Figure 6 shows an example with an input of length of 8.

In the 2-D case, the RMF algorithm could generate a DWT of size 2i+1*2i+1 from four “smaller” DWTs, each of size 2i*2i. Each of the four DWTs is divided into four sub-bands, named HH, HL, LH and LL sub-bands. The RMF 2D operator first concatenates the sub-bands according to their type, i.e. the LL sub-bands from each DWT are concatenated as one larger LL sub-band, the HL sub-bands from each DWT are concatenated as one larger HL sub-bands, etc.. In concatenation, the relative coordinate position of the four small DWTs is maintained.

After that, the RMF 2D operator is recursively applied on the new LL sub-band, until the size of the matrix is 2 by 2 thus we apply the filter operation directly on it. For the new LH sub-band and the new HL sub-band, we then apply column-wise 1-D RMF operator and row-wise 1-D RMF operator on them, respectively. A column-wise 1-D RMF operation means, for each column, the generation of a complete DWT is from the first half and second half of that column. The row-wise 1-D RMF operation is similar. For the new HH sub-band, nothing needs to do. The RMF-2D operation is shown in Figure 7.

The RMF computation generates the complete DWT in a bottom to up fashion. At each intermediate step, the DWTs are spatially coherent with the original data. These advantages make RMF a very useful tool for many DWT based image compression methods and we will use RMF to overcome the first limitation of the FWT based compression method we mentioned in Section 2.

7

filter

x1

x2

x3

x4

x5

x6

x7

x8

s1

d1

s2

d2

s3

d3

s4

d4

S1

D1

D1

D2

d1

d2

d3

d4

S1

D1

d1

d2

S2

D2

d3

d4

Merge & filter

Merge & filter

Merge & filter

Figure 6 A 1-D RMF data flow example

Page 8: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

RMF

Figure 7 One RMF-2D Operation Example

4. The RMF based EZW Compression Method

The general description of the method

Based on the work we discussed in Section 2 and Section 3, we propose an RMF-based EZW compression method, which effectively eliminates the limitations of the original EZW algorithm. First, it improves the execution time of the EZW algorithm by allowing a tighter coupling between the DWT computation stage and the zero-tree checking stage. The maximal absolute values of the sub-bands can be generated as a by-product of the transform. When we approach to coding stage, these maximal absolute values will help to improve the time of checking the zero-trees. These maximal absolute values are called band_max values and we will describe the computation of band_max in the following discussions. Secondly, the RMF-based EZW algorithm enables the sub-image level encoding. The sub-image could have any size from 2 by 2 to the full image size. The

8

Page 9: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

encoding at a higher sub-image level is based on the encoding at the next lower sub-image level encoding thus the image is encoded in a bottom-up fashionFigure 8 shows the architecture of the RMF based EZW compression method.

The RMF based EZW compression method has the following steps:1 Specify the sub-image size, which decides the number of steps of the RMF

computation. The sub-image level coding is one main difference between the original EZW algorithm and the RMF-based EZW algorithm. The sub-image size could be any size from the smallest block 2 by 2 to the full image size. For example, a 512 by 512 image has four sub-images, each has a size of 256 by 256, or it has 16 sub-images, each has a size of 128 by 128. Each sub-image is coded and transferred individually. An alternative method to do the sub-image level coding is that, we can divide the image into sub-images and then apply the original EZW algorithm on each of

9

Figure 8 The architecture of the RMF based EZW compression method

Apply RMF computation on each 2*2 block. Initialize the band_max construction

Input Image

Does it reach the specified sub-image size or image size?

Arithmetic coding and sending the dataNo

yes

end

Compute RMF for the larger blocks. Build band_max values.

Sub-images

……

For each sub-image, set the initial threshold. Initialize the EZW coding

At a particular threshold:Dominant_pass(sub_image)

Subordinate_pass(sub_image)threshold = threhold/2

Does the threshold reach the minimum?

yes

No

Page 10: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

these sub-images. The limitation of this method is, once the sub-image size is decided, we can only do the compression on this sub-image level. If a larger size of sub-image is needed (this could happen when the user is not satisfied with the reconstructed image quality at a particular sub-image level), we have to re-divide the image, re-compute the DWTs and re-encode the wavelet coefficients. The computation we have done at the previous sub-image level is discarded! In our RMF based EZW algorithm, if we want to do a larger sub-image size coding, we simply compute the DWT for the larger sub-images based on the DWTs of the smaller sub-images. The EZW encoding for the larger sub-image could also be computed from the EZW encoding for the smaller sub-images. Thus, the RMF based EZW compression method can dynamically adjust the sub-image size.

2 Then we apply the 2-D RMF algorithm on the image to get the complete wavelet coefficients for each 2 by 2 block. The band_max values are built from this step and they will be used to improve the time of the zero-tree checking. The idea of the band_max value is presented as followings. In the EZW algorithm, if the absolute value of a coefficient c is smaller than the current threshold, we then check whether c is the root of a zero-tree or not. We test whether there is any descendant of c that has a larger absolute value than the threshold. If there is no such descendant, coefficient c will be encoded as a zero-tree root (ZTR) and none of its descendants needs to be sent; Otherwise c is encoded as isolated zero (IZ). In the original EZW algorithm, we do this by comparing every descendant of the current coefficient with the threshold. However, if we know the maximal absolute value among these descendants, we only need to compare this maximum absolute value with the threshold. If the maximum absolute value is smaller than the threshold, we can claim that there is no descendant of the current coefficient has an absolute value that is larger than the threshold and the current node is a zero-tree root. Obviously, the maximal absolute value for each sub-band should be maintained, we call this maximal absolute value band_max value. Each sub-band has two band_max values: The current_band_max value of each sub-band is the maximal absolute value

of wavelet coefficients in that sub-band and its descendant sub-bands. For example, if max1 is the maximal absolute value in the sub-band HH1, then current_band_max(HH1) = max1. (sub-band HH1 has no descendant sub-band). If max2 is the maximal absolute value in the sub-band HH2 and max1>

max2, then current_band_max(HH2) = max(max1, max2) = max1. The previous_band_max value is the value that is propagated to the next step

of the RMF computation in order to efficiently generate the new current_band_max value. In the 2D-RMF computation, when we compute the wavelet coefficients for a larger DWT from four smaller DWTs, we found that part of the wavelet coefficients in the larger DWT are new wavelet coefficients and part of the wavelet coefficients in the larger DWT are old wavelet coefficients that are inherited from the four smaller DWTs. Therefore, in each of the four smaller DWTs, we compute the maximal absolute value of the wavelet coefficients that will be inherited by the larger

10

Page 11: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

DWT and pass this maximal absolute value to the larger DWT. This maximum absolute value is called previous_band_max. When we compute the current_band_max values for the larger DWT, instead of comparing all the wavelet coefficients to find out the maximal absolute values, we only use the previous_band_max values from each of the four small DWTs and the newly generated wavelet coefficients.

We now give the computations of current_band_max and previous_band_max for HH, HL and LH sub-band. To let the reads have a better understanding of the computation, we also give an example with reference to Figure 9. This example has been chosen since its result is exact the same as that obtained in a worked example in [2] to illustrate the EZW algorithm. Thus, we are able to verify the input/output equivalence with the original EZW algorithm.

Figure 9 illustrates that how the DWT coefficients for a 8 by 8 block are generated from four smaller 4 by 4 DWTs. The figure also shows the computation of the band_max values of the 8 by 8 block from the previous_band_max values of the four smaller DWTs, the new coefficients of the 8 by 8 block and the current_band_max values in the descent sub-bands.

1) In the HHi sub-band, current_band_max(HHi) is simply the maximum of the previous_band_max(HHi) values of the four smaller DWTs and current_band_max(HHi-1). This is obvious because the HHi band is simply the concatenation of the HHi sub-bands of the four DWTs participating in the RMF-2D operation, as shown in Figure 7. For example, in Figure 9, the previous_band_max values of the HH1 sub-band in the four smaller DWTs are 6, 4, 6 and 6, respectively. Thus, the current_band_max of HH1 sub-band in the 8 by 8 block is 6, which is the maximum of 6, 4, 6 and 6 (the HH1 sub-band has no descendant sub-band since it is in the lowest octave). The previous_band_max values of the HH2 sub-band in the four smaller DWTs are 3, 12, 14 and 8, respectively. Thus, the current_band_max of HH2 sub-band in the 8 by 8 block is 14, which is the maximum of 3, 12, 14, 8 and the current_band_max value (which is 6) of HH1 in the 8 by 8 block.The previous_band_max of HHi is the same as the current_band_max of HHi, i.e. previous_band_max(HHi) = current_band_max(HHi). This is because all the wavelet coefficients in the smaller DWTs will be inherited by the larger DWT. For example, in Figure 9, the previous_band_max of HHi for the four smaller DWTs are 6, 4, 6, 6, respectively. They are the same as their current_band_max values.

11

Page 12: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

12

Figure 9 An example of the bottom-up band_max computation

Page 13: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

2) In the HLi sub-band, current_band_max(HLi) is the maximum of the four previous_band_max(HLi) values, the new coefficients generated in the first two rows of the HLi sub-band by the column-wise 1-D RMF operations and current_band_max(HLi-1). From Figure 7, we know that the HLi sub-band is generated by first concatenating the four smaller HLi sub-bands then applying the 1-D column-wise 1-D RMF operation. We also know from Figure 6 that only the first two coefficients are new generated coefficients when we compute the complete 1-D DWT of length 2n from two complete 1-D DWTs, each has a length of n. Therefore, only the coefficients in the first two rows of the new HLi

sub-band are new. For example, in Figure 9, the previous_band_max values of the HL1 sub-band in the four smaller DWTs are 7, 9, 4 and 3, respectively. Therefore, the current_band_max value of the HL1 sub-band in the 8 by 8 block is 13, which is the maximum of these previous_band_max values and the new coefficients in the first two rows of the new HL1 sub-band. The previous_band_max of HLi is the maximum of the four previous_band_max(HLi) values, the new coefficients generated in the second row of the HLi sub-band by the column-wise 1-D RMF operations and current_band_max(HLi-1). One may notice that we don’t take the coefficients in the first row into account. The reason is that these coefficients, when take part into the 1-D column-wise computation in the next step of RMF-2D, will be replaced by the new generated coefficients. For example, in Figure 9, the current_band_max values of the HL1 sub-band in the four smaller DWTs are 17, 9, 9 and 4, respectively, but the previous_band_max values for them are 7, 9, 4 and 3, respectively. The data in the first row is not taken into account when we calculate the previous_band_max.

3) Similarly, in the new LHi sub-band, current_band_max(LHi) is the maximum of the four previous_band_max(LHi) values, the new coefficients generated in the first two columns of the LHi sub-band by the row-wise 1-D RMF operations, and current_band_max(LHi-1). previous_band_max(LHi-1) is the maximum of the four previous_band_max(LHi) values, the new coefficients generated in the second column of the LHi sub-band by the column-wise 1-D RMF operations and current_band_max(LHi-1).

The band_max computation is initialized at the 2 by 2 sub-image level, as shown in the following.

previous_band_max_HH[1]=abs(RMF[1][1]); previous_band_max_HL[1]=0; previous_band_max_LH[1]=0;

Here RMF[1][1] means the HH coefficient in the 2 by 2 block.The pseudo of the band_max computation is given in Figure 10.

13

Page 14: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

3 We then apply the 2D-RMF operation on each 4 by 4 block and the complete DWT of each 4 by 4 block is generated from the four 2 by 2 blocks participating in the RMF-2D computation. The band_max values are then constructed from the new wavelet coefficients, the previous band_max values and the band_max values of the descendant sub-bands, as we have discussed in step 2. We repeat this step until the sub-image size reaches to the sub-image size we specified in step 1 or the full image size. Then the RMF computation has done.

4 After the RMF computation, we start the following EZW coding for each sub-image. Like in the original EZW algorithm, we scan the wavelet coefficients in a special order. For each coefficient, we compare the absolute value of the coefficient with current threshold. For coefficient that has a larger absolute value than the threshold, the processing is the same as in the original EZW algorithm. For coefficient that has a smaller absolute value than the threshold and needs to test that it is a zero-tree root or not, the processing is different. Since the maximum absolute value for each sub-band has been maintained as band_max value, we only need to compare the current_band_max of the child sub-band of the current coefficient with the threshold. For example, if the threshold is 32, the current wavelet coefficient in sub-band HLk is 28. Since 28 is insignificant with respect to the threshold, we need to test if or not it is a zero-tree root. We simply compare the current_band_max(HLk-1) with the threshold. Suppose current_band_max(HLk-1) is 24, which is also smaller than the threshold, the wavelet coefficient will be coded as zero-tree root. By using the band_max value, the speed of the scanning process is improved significantly, especially for very large image. For example, if coefficient c is a zero-tree root in the highest octave of a 512 by 512 image, in the original EZW algorithm, we need 87380 comparisons but in our new method, we only need to compare once!The remaining process is the same as in the original EZW algorithm.

The pseudo code of the RMF based EZW algorithm is shown in Figure 11.

14

Page 15: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

15

Algorithm Bottom Up band_max constructionInput: band_max values of four 2-D DWTs, DWT1, DWT2, DWT3 and DWT4, each has size 2k by 2k.Output: band_max values of 2-D DWT that is computed from DWT1, DWT2, DWT3 and DWT4.

Start:For octave=1 to octave< k+1 do

current_band_max_HH[octave]=max(max(previous_band_max_HH[octave] of DWT1,

previous_band_max_HH[octave] of DWT2, previous_band_max_HH[octave] of DWT3, previous_band_max_HH[octave] of DWT4),current_band_max_HH[octave-1]);

previous_band_max_HH[octave]=current_band_max_HH[octave];

current_band_max_HL[octave]=max(max(previous_band_max_HL[octave] of DWT1,

previous_band_max_HL[octave] of DWT2, previous_band_max_HL[octave] of DWT3, previous_band_max_HL[octave] of DWT4),current_band_max_HL[octave-1],max(the first two rows in HL octave));

previous_band_max_HL[octave]=max(max(previous_band_max_HL[octave] of DWT1,

previous_band_max_HL[octave] of DWT2, previous_band_max_HL[octave] of DWT3, previous_band_max_HL[octave] of DWT4),max(second row in HL octave));

current_band_max_LH[octave]=max(max(previous_band_max_LH[octave] of DWT1,

previous_band_max_LH[octave] of DWT2, previous_band_max_LH[octave] of DWT3, previous_band_max_LH[octave] of DWT4),current_band_max_LH[octave-1],max(the first two columns in the LH octave));

previous_band_max_LH[octave]=max(max(previous_band_max_LH[octave] of DWT1,

previous_band_max_LH[octave] of DWT2, previous_band_max_LH[octave] of DWT3, previous_band_max_LH[octave] of DWT4),max(the second column in LH octave));

endfor

previous_band_max_HH[octave]=abs(the wavelet coefficient at position [1,1]);previous_band_max_HL[octave]=0;previous_band_max_LH[octave]=0;

End;

Figure 10 The bottom-up band_max construction Algorithm

Page 16: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

An RMF-EZW compression example

We now show how to encode the wavelet coefficients in the 8 by 8 block in Figure 9 use the current_band_max values. When we scan the wavelet coefficients in the 8 by 8 block in the raster scan order, we start from the data on the left-upper corner, 63. Suppose the current threshold is 32, we code 63 as POS. Then we code –34, which will be coded as NEG. For these two coefficients, we don’t take the advantage from the current_band_max values. When we approach to 23, we find that 23 is smaller than the threshold. We need to check whether 23 is a zero-tree root or not. The child sub-band of 23 is HH2 and the current_band_max(HH2) = 14, which is also smaller than 32. Thus, we can decide that 23 is a zero-tree root and it is encoded as ZTR. If we don’t use the current_band_max value, we will have to check all the coefficients in HH2 and HH1 and we need 19 more comparisons! Figure 12 shows the symbols generated for the

16

Algorithm RMF based EZW algorithm

Input: Sub_image_Size, Image data, Image_Size

Output: RMF-EZW coded image.

Start:

Initialize the band_max computation;

/*Now start to do RMF, it stops when Sub_Image_Size is reached,

then we do EZW*/

For dim=2; dim<=Sub_Image_Size; dim*=2 do

/*the following loop does RMF_2D for each block in image*/

for(j=0;j<(Image_Size/dim);j++)

for(i=0;i<(Image_Size/dim);i++) do

do RMF_2D for each dim*dim block in the image;

band_max computation for each dim*dim block;

If(dim==Sub_Image_Size)

EncodeEZW(sub-images, current_band_max);

Endif

Endfor

Endfor

End;

Figure 11 The RMF-EZW Algorithm

Page 17: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

coefficients when the threshold is 32. Coefficients without a symbol associated with them are the nodes in some zero-tree and these coefficient need not to be encoded at the current threshold level.

5. The experimental Results and Conclusion

Experimental results:In Figure 13, we display a series of reconstructed images at different sub-image level using our method. The test image is a 128 by 128 grayscale image babara. Figure 12 (a), (b), (c), (d) are the reconstructed images when the sub-image size are 128 by 128 (the full image size), 64 by 64, 32 by 32 and 16 by 16, respectively. The minimum threshold for the compression is 0. (This is considered as lossless compression). Table 1 gives the sub-image level, sub-image size, compressed image size, MSE and PSNR for these images. We noticed that the size of the compressed image increases when the sub-image size decrease, this is because large sub-image has larger zero trees than the small sub-image. This point will be illustrated more clearly in Figure 14. One thing that is confusing here is the MSE and PSNR values. We can see the lower sub-image level encoding has better quality than the higher level encoding in terms of both MSE and PSNR. (Actually, we can also observe this from the reconstructed images in Figure 13). Since our experiments used lossless mode, all the MSE values should be zero and all the PSNR values should be

17

63POS

-34NEG

49POS

10ZTR

70

130

-12 7

-31IZ

23ZTR

14ZTR

-13ZTR

30

40

6 -1

15ZTR

14IZ

3 -12 5 -7 3 9

-9ZTR

-7ZTR

-14 8 4 -2 3 2

--5 9 -10

47POS

4 6 -2 2

3 0 -30

20

3 -2 0 4

2 -3 6 -4 3 6 3 6

5 11 5 6 0 3 -4 4

Figure 12 Symbols generated by the RMF-based EZW method for the example

Page 18: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

infinite. This confusion is due to the loss of data in the RMF computation. A smaller sub-image size means less RMF computation thus less mathematical errors.

Table 2 and Figure 14 compare the execution time of our RMF based EZW encoding method with that of the original method for three images. The test images are Lena, Man and Peppers and we did the experiments on each of them at different size from 32 by 32 to 512 by 512. Again, the minimum threshold for the encoding is 0. It’s obvious our RMF based EZW method significantly improves the execution time. The computation time is improved by 11% to 55% depending on the image size. For larger images, the improvement is more than the smaller images. This is reasonable because a zero tree root in a larger image usually means a bigger zero-tree than in a smaller image thus it saves more computation time.

Conclusions:In this paper, we present a new RMF-based EZW compression method. Our new method replaces the FWT algorithm in the original EZW algorithm by the RMF algorithm, which maintains the spatial locality of the original image, so the sub-image level coding is provided. The new algorithm computes the maximal absolute values called band_max for each sub-band as a by-product of the RMF computation and they could improve the zero-tree checking process. The experimental results show that our new algorithm improves the execution time by about 11% to 55% depending on the image size.

18

Page 19: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

(a) (b) (c) (d)

Figure 13 reconstructed images at different sub-image level

Sub-Image Level 6 5 4 3Sub-Image Size 128 64 32 16Compressed image size 8078 8425 9554 12748MSE 25.05927 18.37933 11.61615 6.611389PSNR 34.14112 35.48751 37.48018 39.92788

Table 1

Image: ManImage Size 32*32 64*64 128*128 256*256 512*512EZW Coding Time (s) 0.09 0.89 9.01 101.239998 1523.650024RMF-EZW Coding Time (s) 0.08 0.77 7.06 64.150002 802.140015Improvement 11.11% 13.48% 21.64% 36.64% 47.35%

Image: LenaImage Size 32*32 64*64 128*128 256*256 512*512EZW Coding Time (s) 0.07 0.61 5.27 51.710003 719.25RMF-EZW Coding Time (s) 0.06 0.49 3.92 30.49 320.420013Improvement 14.29% 19.67% 25.62% 41.04% 55.45%

Image: PeppersImage Size 32*32 64*64 128*128 256*256 512*512EZW Coding Time (s) 0.09 0.78 7.03 61.799999 1165.319946RMF-EZW Coding Time (s) 0.08 0.65 4.78 34.899998 549.470032Improvement 11.11% 16.67% 32.01% 43.53% 52.85%

Table 2 Comparison of the Execution Time by EZW algorithm and RMF-EZW algorithm

19

Page 20: Adaptive Block-wise RMF Compressionvlsi.cs.ucf.edu/datacomp/papers/rmfezw_rev.doc · Web viewIn this paper, we present a new RMF (Recursive Merge Filter) based EZW (Embedded Image

Figure 14 Improvement of the Execution Time by RMF-EZW Algorithm

Reference:

1. Jerome M. Shaprio, Embeded Image Coding Using Zerotrees of Wavelet Coefficients, IEEE Transactions on Signal Processing. Vol. 41, No. 12, December 1993.

2. Kunal Mukherjee, “Image compression and transmission using wavelets and vector quantization”, Ph. D. dissertation, The University of Central Florida, July 1999.

3. P. S. Jamkhandi, A. Mukherjee, K. Mukherjee and R. Franceschini, “Parallel hardware-software for computation of DWT using recursive merge filtering algorithm”, Proceedings of Workshop on Parallel and Distributed Computing in Image Processing, Video Processing, and Multimedia, the 14th International Parallel and Distributed Processing Symposium (IPPS 2000), 1-5 May 2000, Cancun, Mexico.

4. Young Huh, J. J. Hwang, “The new extended JPEG coder with variable quantizer using block wavelet transform”, IEEE Transaction on Consumer Electronics. Vol. 43, No. 3, August 1997.

5. Singh, V.K., “Discrete wavelet transform based image compression”, International Journal of Remote Sensing v 20 n 17 Nov 20 1999. p 3399-3405

6. A.S. Lewis and G. Knowles, “Image compression using the 2-d wavelet transform”, IEEE Transactions on Image Processing, vol. 1, pp244-250, April 1992.

7. William B. Pennebaker, Joan L. Mitchell, “JPEG still image data compression standard”, ISBN 0-442-01272-1

20


Recommended