Image data compression with pdf-adaptive ...

3 downloads 0 Views 278KB Size Report
2] Antonini, Marc; Barlaud, Michel; Mathieu, Pierre; Daubechies, Ingrid: "Image Coding ... 9] Pall, Michael: Einsatz von Subbandcodierung und Wavelets bei derĀ ...
Image data compression with pdf-adaptive reconstruction of wavelet coecients Tilo Strutz and Erika Muller University of Rostock Department of Electrical Engineering 18119 Rostock, Germany [email protected]

ABSTRACT The present contribution proposes a new remarkably ecient image compression algorithm for graylevel images based on dyadic wavelet transformation. In order to achieve perfect reconstruction, orthogonal decomposition is applied. Scalar quantization of wavelet coecients is combined with run-length coding. Code word assignment is performed by semi-adaptive Hu man coding (determined by validity tables). To improve the reconstruction quality of images a new technique of pdf-adaptive reconstruction of wavelet coecients (PAR) is used. Keywords: image compression, wavelet transformation, scalar quantization, pdf-adaptive reconstruction

1 INTRODUCTION A fundamental goal of image compression is the reduction of the bitrate for transmission or storage while maintaining an acceptable delity or high subjective image quality. In last few years dyadic wavelet transformation (DWT) has become well-known as powerful tool for multiresolution signal decomposition in image data compression. Recent publications have shown that transformation-coding algorithms with DWT are more ecient, compared with conventional methods or today's standards such as JPEG.10 The compression techniques for still images introduced up to now di ers in the choice of wavelet lters, quantization techniques, and coding algorithms. The fundamental quantization strategies are divided in scalar- and vector-based procedures. Investigation results of image compression with DWT and vector quantization are given in several publications.2,3,8,16 Due to high computation complexity of vector quantization methods, scalar (uniform) quantization is very often used.4{6,9,11,13 Furthermore, a so-called multilayer quantizer14 or a successive-approximation quantizer12 is applied. The methods of coding of transformation-coecients are subdivided into subband coding algorithms, which combine all coecients of a subband (spectral connection) before coding1,6,9,11,13 and such algorithms which at rst connect coecients with spatial correlation.12,14,15 We present a compression algorithm with spectral connection of wavelet coecients, scalar quantization and new features. A run-length coder produces data symbols which are coded with a semi-adaptive Hu man coding algorithm determined by validity tables. These tables contain data symbols with the greatest probability of occurence. Furthermore, an improvement of image quality can be achieved with pdf-adaptive reconstruction (PAR) of wavelet coecients. The basic encoding algorithm is described in section 2. In section 3, modeling of probabilty density function is discussed by means of three di erent model functions. Afterwards, the use of pdf-model for adaptive reconstruction of coecients is explained in section 4. The last section includes the representation of compression results and a conclusion.

2 TRANSFORM AND ENCODING ALGORITHM 2.1 Dyadic wavelet transformation Dyadic wavelet transformation (DWT) can be executed with di erent types of wavelets. For application in image data compression, the advantage of perfect reconstruction should be used. Orthogonal and biorthogonal wavelets possess this property. Our investigations have shown that the use of Daubechies-8-tap- lters leads to the best compression results. Furtheremore, they are compactly supported and the amount of computation is relatively small. Another parameter is depth of decomposition. The side length of the remaining low-pass image should not be smaller than 16 pixels. For instance, a decomposition with ve decomposition levels can be performed for 512x512 images.

2.2 Quantization of transformation coecients

The coding algorithm is based on a uniform quantizer. As wavelet coecients are distributed symmetrically around zero, only absolute values are taken in consideration. Figure 1 shows an example of a uniform quantizer. A quality parameter determines the resolution (size of quantizing intervals) of the lowest subband, excluding the low-pass band. The number of intervals for other subbands is calculated by division by 2. For example, for ve decomposition levels and 32 intervals for the fth subband, the other subbands are devided into 16, 8, 4 and 2 quantization intervals. The interval length also depends on the domain of de nition of wavelet coecients, i.e. the smaller the domain of de nition, the more exact the quantization itself. Mathematically, the quantization can be described by  s ? 1 qi = jxi j  x + 0:5 with xmax = max(jxi j) max 

(1)

The operator bxc produces the greatest integer lower than or equal to x. Every coecient xi is assigned to a quantization index qi . s complies with the number of quantization intervals. xmax and s have to be included in the bitstream as side information for every subband, in order to make reconstruction of coecients from quantization indices possible.

q 7 6 5 4 3 2 1 0

..................................................................................... ... ... ... ... ... ... ... ... ... ... ... ... ... ...

xmax

0

coecients x Figure 1: characteristic line with 8 quantization intervals The transformation coecients of the approximation signal are processed separately. They are merely rounded to integers and are transmitted as bytes without coding.

2

2.3 Coding of wavelet coecients Because of characteristic distribution of wavelet coecients, many coecients get a quantization index equal to zero. This can be utilized for run-length coding. All adjacent zero-indices and the following index unequal to zero are connected to a data symbol. A semi-adaptive Hu man coder assigns codewords to these data symbols. A Hu man code table has to be inserted into the bitstream for every subband. In practice, the number of zero-run/index combinations can attain high values dependent on the number of quantizer intervals. For an ecient Hu man coding, it is necessary to reduce the number of combinations. So a validity table is generated containing the most frequent data symbols. The decoder has an identical validity table. All symbols not included in this table have to be transmitted in escape sequences, using an extra escape symbol.

3 MODELING OF PROBABILITY DENSITY FUNCTION 3.1 Distribution of wavelet coecients The empiric probability density h(k) of wavelet coecients is determined by the number nk of coecients belonging to the interval I [gk ; gk+1 ): k = 0; 1; 2; : : :; K ? 1 (2) h(k) = nkN with  = gk+1 ? gk as normalizing factor. The total number of wavelet coecients is given by N . For modeling of the probability density function (pdf) an equidistant discretization of model p(x) has to be realized: p(x) ) p(xk ) with xk = (k + 0:5) The choice of a suitable model function is xed by the following considerations:  The model function has to t the real distribution of coecients very well.  The model function has to be integrable.  The model parameters should be computable without iteration-based approximation methods.  The model parameters should be as few as possible.  The domain of de nition of paramters has to be codable with a small number of bits.  Use of choosen model has to lead to an image quality improvement. Because of symmetric distribution of wavelet coecients, functional discription of the pdf can be limited to a range of 0 < x  xmax . That is why x always implies jxj in the following investigations ! The real pdf of wavelet coecients shows a high concentration around zero. Frequency at rst falls o rapidly, and then more slowly as coecient values increase. From the set of practicable models, three functions with di erent types are selected.

3.2 Approximation setup The setup for approximation is given by h(k) = p(xk ) + ek k = 0; 1; 2; : : :; K ? 1 (3) h(k) is the real distribution function and p(xk ) the discretized pdf-model function. The error signal ek has to be minimized using the method of least mean square errors as quality criterion. The setup is: X fh(k) ? p(xk )g2 ) Min (4) k

3

The number K of intervals determines the interval length , because the domain of de nition is xed by xmax . Therefore, K in uences the approximation quality. The smaller the intervals, the more detailed the distribution function. Of course, the number of coecients is nite, and if the intervals are too small, the functional connection is lost. A good choice is obtained with

K = 10  lg(total number of coecients)

:

(5)

3.3 Approximation by modi ed hyberbolic function The model function

a

a; b; c > 0 a; b; c 2 R (6) (x + c)b is a non-linear function and the parameters a, b and c can be computed only by iterative solutions. There are estimation methods to get estimated values in shorter times, but these methods are not ecient. Most of them are based on transitions of p(x) to a quasi-linear function. In this case, linearization is only posssible for a and b. Using transitions Hk = ln [h(k)] ; Pk = ln [p(xk )] and A = ln[a] one obtains Pk = A ? b  ln(xk + c) : (7) It remains to solve X fHk ? [A ? b  ln(xk + c)]g2 ) Min : (8) p(x) =

k

The partial derivatives of a and b lead to a set of equations with the solutions X

b= k

Hk 

X

k

and

X

A= k

X

1

k

ln(xk + c) ?

X

k

Hk + b 

X

k

1

ln2 (xk + c) ?

k X k

ln(xk + c)

1

k X



X

X

k

;

fHk ln(xk + c)g ln(xk + c)

!2

a = exp(A) :

(9)

(10)

Unfortunately, a and b depend on c. One way to solve this problem is to set c to several values in an iteration loop, to calculate a and b and to check which c leads to the least mean square error. Because of high computation cost, this method is not very practicable. It would be useful to nd an explicit expression between the real probability distribution h(k) and parameter c. The variance of wavelet coecients has not proven suitable, because no direct connection between variance and c could be found. Furthermore, it should be noted that linearization of a function means a transition to a new model. One does not get the exact parameter values. If b and c are known, one can improve the result for a by approximation without linearization:

h(k) ( x k + c)b a = Xk 1 2b k (xk + c) X

4

(11)

3.4 Approximation by exponential function Very often in signal processing, an exponential function is applied. A practicable form for pdf-modeling is found by

a; b > 0 a; b 2 R :

p(x) = a  exp(?bx)

(12)

Linearization is possible by the following transitions:

Hk = lg [h(k)] ;

B = b  lg[e] and A = lg[a]

Pk = lg [p(xk )] ;

From which

X

k

fHk ? [A ? B  xk ]g ) Min

(13)

2

follows. The resulting set of equations leads to X

B= k

Hk  X

k

a is calculated without transitions:

X

k

1

X

k

xk ?

X

k

X

k

1

X

k

X

x2k ?

k

fHk xk g

xk

!2

b = lg(Be) :

;

fh(k) ? a  exp(?bxk )g ) Min 2

X

h(k)  exp(?bxk )

a = kX k

exp(?2bxk )

:

(14)

(15) (16)

3.5 Approximation by rational function The third model is based on a second order rational function

p(x) = a + xb + xc2

x > 0; a; b 2 R :

(17)

This model function is quasi-linear and no linearization is necessary. The minimizing problem X



k

2 c b h(k) ? a + x + x2 ) Min k k 

(18)

leads to the solution

f2  f5 )  (f0  f2 ? f1  f1 ) + (f1  f2 ? f0  f3 )  (f0  f6 ? f1  f5 ) c = ((ff00  ff74 ? ? f2  f2 )  (f0  f2 ? f1  f1 ) + (f1  f2 ? f0  f3 )  (f1  f2 ? f0  f3 ) b = (f0  f6 ? f1 f0f5 )f2+?c f 1(f1f1 f2 ? f0  f3 )

a = f5 ? b  ff10 ? c  f2

5

(19)

with

f0 = f4 =

P

f1 = k P 1 x4k ; f5 = k

1;

P

f2 = h(k) ; f6 =

1 xk ; k P

k

P

x2k ; k P h(k) ; k xk 1

f3 = f7 =

P

1

3

k xk P h(k) 2 k xk

Using this model setup, a good approximation quality of real distribution is obtained, but one has to notice that possible zeros at r

crop up.

2 x1;2 = ? 2ba  4ba2 ? ac :

3.6 Comparison of model performance Figures 2 and 3 show the eciency of approximation for di erent subbands. Remember, only absolute coecients values are taken into consideration, because of symmetric distribution around zero. In each case, the left diagram contains the whole domain of de nition, whereas the right is an enlarged section from the left. It can be seen that the best t is attained by the hyperbolic model function. But the exponential model and the rational model also enable a good approximation. The rational function doesn't conform to the x-axis in every case, because of possible zeros. The disadvantage of modeling by the hyberbolic function is a higher number of arithmetic operations resulting from iterative parameter computation.

4 PDF-ADAPTIVE RECONSTRUCTION OF WAVELET COEFFICIENTS 4.1 Modi cation of uniform quantizer In uniform quantizers, all decision intervals are of the same length and the reconstruction values are the midpoints of the decision intervals.7 Furthermore, sucient small decision intervals with uniform pdf of input source are assumed. These assumptions are not full lled in quantization of wavelet coecients. For low bitrates, large intervals are especially necessary for extra-high frequency subbands, and the distribution of their wavelet coecients di ers distinctly from uniform pdf. Therefore, we determine the reconstruction values dependent on the pdf of the coecients. The formula for calculation of reconstruction values is given by Z gk+1

p(x)  x dx

vk = gZk gk+1 gk

p(x) dx

;

where vk corresponds to mean value of all wavelet coecients belonging to interval I [gk ; gk+1 ).

6

(20)

? ?       ? ?      

Figure 2: Approximation quality for rst subband: real distribution (solid), hyberbolic model (dashed), rational model (dotted), exponential model (dot dash)

Figure 3: Approximation quality for third subband: real distribution (solid), hyberbolic model (dashed), rational model (dotted), exponential model (dot dash)

7

4.2 Computation of reconstruction values Hyperbolic function: Insertion from (6) into (20) leads to

and

Z gk+1

x dx ( x + c)b vk = Zgkgk+1 1 a dx gk (x + c)b a

(21) 

 



b?1 b?1 b?2 b?2 vk = (gk+1 + c)b?1 ? (gk + c)b?1   (b ? 1)(gk+1 + c)b?2  (gk + c)b?2  ? c : (gk+1 + c) ? (gk + c)  (b ? 2)(gk+1 + c)  (gk + c) One can see that the parameter a is unimportant for computation of vk .

(22)

Exponential function: From (12) and (20) we obtain: vk = and

a

Z gk+1

a

gZk

exp(?bx)  x dx

gk+1

gk

(23)

exp(?bx) dx

?bgk ) ? (bgk+1 + 1)  exp(?bgk+1 ) : vk = 1b  (bgk + 1)  exp( exp(?bg ) ? exp(?bg )

Using this model, only one parameter is necessary.

k

k+1

(24)

Rational function: Using (17) and (20), the reconstruction value vk now reads: gZk+1

and further

 a + xb + xc2  x dx

ax2 + bx + c ln(x) gk+1 7 6 2 7 6 = vk = gkgZk+1 c 5 4  ax + b ln( x ) ? c b x gk a + x + x2 dx

(25)

a  g 2 ? g 2 + b  (g ? g ) + ln (g ) ? ln (g ) k k+1 k 2 c k+1 k  k+1 : vk = c a 1 1 b g k +1 c  (gk+1 ? gk ) + c  ln g + g ? g

(26)

3

2

gk

?



If the model function shows real non-negative zeros at

k

r

k

k+1

2 x1;2 = ? 2ba  4ba2 ? ac ; one has to use an approximate solution for all intervals Ik [gk ; gk+1 ) with gk+1 > x1;2 , for example ? gk ; vk = ln (ggk+1) ? k+1 ln (gk )

based on hyperbolic function

p(x) = x1

x>0 :

8

(27) (28)

4.3 Modi cations The sections up to this point have shown that it is possible to model frequency distribution of wavelet coecients and to calculate reconstruction values adaptively. Using the PAR, one should de ne the domain of de nition adaptivly as well. All coecients obtaining an index equal to zero during quantization process can be taken out of consideration, because PAR is useless for them. That leads to a more exact approximation for all other intervals. Strictly speaking, calculation of vk is not directly dependent on absolute pdf, but depends rather on descent i.e. on rst derivation of pdf. If the process of approximation is modi ed in this way, a slightly better computation of descent-relevant model parameters is possible. In practice, the improvement of reconstruction quality is so small that it is not worth making this additional computation.

5 RESULTS AND CONCLUSION A new algorithm for image data compression based on wavelet transformation was introduced. Using scalar quantization with PAR of wavelet coecients combined with a semi-adaptive Hu man code, one can achieve high compression rates. We have applied our method to standard monochrome test images. Table 1 displays the performance dependent upon model function used, compared to its eciency without use of PAR, for . Best results are attained with the hyperbolic model function excluding those attained for quality 1 and 2. For these bitrates the exponential function gives highest peak-signal-to-noise-ratio (PSNR). Figure 5 shows performance of new algorithm (with exponential model) in comparison with JPEG and a published result.14 Table 2 contains results for several test images. Future development of this work will concentrate on using arithmetic coder to increase the eciency of entropy coding. Lena

PSNR [dB]

quality

bpp

without hyperbolic exponential rational PAR function function function

1

0.078

28.34

28.50

28.52

2

0.173

31.50

31.81

31.85

31.77

3

0.269

33.69

34.07

34.03

34.05

4

0.363

35.29

35.62

35.58

35.59

5

0.456

36.48

36.80

36.78

36.77

6

0.548

37.43

37.73

37.72

37.70

7

0.645

38.25

38.57

38.55

38.52

8

0.740

38.97

39.29

39.27

39.24

9

0.838

39.58

39.90

39.88

39.86

10

0.938

40.15

40.47

40.45

40.43

11

1.043

40.68

41.03

40.98

41.00

12

1.148

41.17

41.55

41.49

41.50

Table 1: Codec performance for

'Lena' (512x512)

9

28.49

using di erent model functions

'Peppers' (512x512)

bpp

PSNR [dB]

'Baboon' (512x512)

bpp

PSNR [dB]

bpp

PSNR [dB]

2

0.173

30.16

0.333

24.48

0.2603

29.36

4

0.358

32.23

0.878

29.03

0.5001

33.05

6

0.619

33.71

1.356

31.87

0.7432

35.21

8

0.927

35.34

1.751

34.03

1.0027

36.83

10

1.212

36.85

2.080

35.79

1.2645

38.24

quality

'Girl' (256x256)

Table 2: Codec performance for several test images using hyperbolic model function

Figure 4:

'Lena' (512x512, H=7.218)

10

with compression rate about 46:1

?     !" #$%&'() *+,-./0

Figure 5: Comparison of di erent compression algorithms: introduced algorithm with PAR (solid) and without PAR (dashed), results from Taubman et al.14 (dotted) and JPEG (dot dash)

11

6 REFERENCES [1] Ansari, A. C.; Gertner, I.; Zeevi, Y.-Y., Tanenhaus, M. F: "Image compression: wavelet-type transform along generalized scan". Proceedings of SPIE (Synthetic Aperture Radar), Los Angeles, USA, 20.-21. January 1992, Vol. 1630, pp.99-107, 1992 [2] Antonini, Marc; Barlaud, Michel; Mathieu, Pierre; Daubechies, Ingrid: "Image Coding Using Wavelet Transform". IEEE Transactions on Image Processing, Vol. 1, No. 2, pp.205-220, April 1992 [3] Barlaud, M.; Sole, P.; Gaidon, T.; Antonini, M.; Mathieu, P.: "Pyramidal Lattice Vector Quantization for Multiscale Image Coding". IEEE Transactions on Image Processing, Vol. 3, No. 4, pp.367-381, July 1994 [4] Chen, Jie; Itoh, Shuichi; Hashimoto, Takeshi: "Scalar quantization noise analysis and optimal bit allocation for wavelet pyramid image coding". IEICE Transactions on Fundamentals of Electronics, Communications and Computer Science, Vol. E76-A No. 9, pp.1502-1514, Sept. 1993 [5] Cheong, Cha Keon; Aizawa K.; Saito, T.; Hatori, M.: "Subband image coding with biorthogonal wavelets". IEICE Transactions on Fundamentals of Electronics, Communications and Computer Science, Vol. E75-A No. 7, pp.871-881, 1993 [6] Efstradiadis, Sera m N.; Rouchouze, Bruno; Kunt, Murat: "Image compression using subband/wavelet transform and adaptive multiple-distribution entropy coding". Proceedings of SPIE-The International Society for Optical Engineering, Vol. 1818 (Visual Communications and Image Processing), pp.753-764, 1992 [7] Jayant, N.S.; Noll, Peter: Digital Coding of Waveforms. Prentice-Hall, Inc., Englewood Cli s, NJ, 1984 [8] Orchard, Michael T.; Ramchandran, Kannan: "An investigation of wavelet-based image coding using an entropyconstrained quantization framework". Proceedings of Data Compression Conference, J.A.Storer and M.Cohn, Eds. (Snowbird, Utah), pp.341-350, 1994 [9] Pall, Michael: Einsatz von Subbandcodierung und Wavelets bei der Kompression von Bilddaten. Diplomarbeit, Universitat Karlsruhe (TH), Fakultat fur Informatik, Institut fur Algorithmen und Kognitive Systeme, 1993 [10] Pennebaker, William B.; Mitchell, Joan L.: JPEG Still Image Data Compression Standard. Published by Van Nostrand Reinhold, 1993 [11] Planinsic, P.; Mohorko, J.; Cucej, Z,; Donlagic, D.; Filip, P.: "Image compression based on the discrete wavelet transform". ITI '93 Proceedings of the 15th International Conference on Information Technology Interfaces, pp.477-481, 1993 [12] Shapiro, Jerome M.: "Embedded Image Coding Using Zerotrees of Wavelet Coecients". IEEE Transactions on Signal Processing, Vol. 41, No. 12, pp.3445-3462, December 1993 [13] Strutz, Tilo.: Untersuchungen zur Bilddatenkompression mit Wavelet-Transformation. Diplomarbeit, Institut fur Nachrichtentechnik und Informationselektronik, Universitat Rostock, July 1994 [14] Taubman, David; Zakhor, Avideh: "Multirate 3-D Subband Coding of Video". IEEE Transactions on Image Processing, Vol. 3, No. 5, pp.572-588, Sept. 1994 [15] Xiong, Zixiang; Ramchandran, Kannan; Orchard, Michael T.: "Joint optimization of scalar and tree-structured quantization of wavelet image decompositions". Conference Record of the Asilomar Conference on Signals, Systems & Computers, Vol. 2, pp.891-895, published by IEEE Computer Society Press, Los Alamitos, CA, USA, 1993 [16] Zhong, Sheng; Shi, Qing-yun; Cheng, Min-Teh: "High Compression Ratio Image Compression". Proceedings - IEEE International Symposium on Circuits and Systems, Vol. 1, pp.275-278, Publ. by IEEE, IEEE Service Center, Piscataway, NJ, USA, 1993

12