EMBEDDED TO LOSSLESS IMAGE CODING (ELIC) - Semantic Scholar

1 downloads 0 Views 31KB Size Report
coded using adaptive quad tree splitting based on the prediction of a sub band ... certain bit rate and followed by context based coding of the residual to make ...
EMBEDDED TO LOSSLESS IMAGE CODING (ELIC) G. C. K. Abhayaratne and D. M. Monro Department of Electronic and Electrical Engineering, University of Bath, Bath, BA2 7AY, United Kingdom. e-mail: [email protected] [email protected] Fax: +44 1225 826073 Internet: http://dmsun4.bath.ac.uk ABSTRACT In this paper, a novel approach for Embedded to Lossless Image Coding (ELIC) is presented. With embedded to lossless coding, lossy encodings of the image at all lower bit rates are embedded in the lossless bit stream. This algorithm uses wavelet transforms that map integers to integers with embedded coding. The coding is based on bit significance criteria in which coefficients that become significant in each bit plane are identified using a significant switch mask. The significance switches are coded using adaptive quad tree splitting based on the prediction of a sub band from its previously coded ‘parent’ sub band. Context based adaptive arithmetic coding is used for both switching and data refinement. Usually prediction based lossless coding techniques outperform wavelet based lossless coding methods. The lossless performance of ELIC is comparable to both JPEG-LS, a non embedded algorithm, and SPIHT. For high bit rate coding at near lossless levels, ELIC shows a better performance than of SPIHT.

the Embedded Lossless Image Coder (ELIC) presented here, by which an image can be decoded at any bit rate up to the lossless level. With embedded lossless coding it is possible to compress a master copy of the image losslessly and thereby to retrieve the image at any desired bit rate from the losslessly compressed master copy. In this paper we discuss a novel approach for coding the wavelet coefficients with context based arithmetic coding to achieve an embedded lossless bit stream. The rest of the paper is organised as below: In section 2, details of embedded coding of integer wavelet coefficients can be found. Sections 3 and 4 describe a novel scanning technique for wavelet transformed coefficients and context selection for adaptive arithmetic coding. Finally, section 5 compares performance of ELIC with JPEG-LS and SPIHT in both lossless and near lossless cases. 2. EMBEDDED CODING

1. INTRODUCTION Lossless Image coding is important in applications where no information loss is allowed during compression. Three main approaches for lossless coding can be found in recently published literature. Prediction based techniques are used in most lossless coding methods such as CALIC [1], JPEG-LS [2] and LOCO-I [3]. Other schemes are based on lossy compression up to a certain bit rate and followed by context based coding of the residual to make the compression lossless [4]. With the introduction of wavelet transforms that map integers into integers using lifting [5, 6], wavelet transform based methods have been used in recent work for lossless coding. Normally local prediction based lossless coding techniques outperform global prediction based wavelet transform techniques. But the advantage of wavelet based techniques is the ability to achieve an embedded bit stream as in EZW [7] and SPIHT [8]. In an embedded coder, all encodings of the same image at lower bit rates are embedded in the bit stream for the targetted bit rate. This is also achieved in

Coding is based on the ‘bit significance’ criteria as in EZW and SPIHT. The wavelet coefficients are coded by scanning from the most significant bit (msb) plane to the least significant (lsb) plane. Wavelet transforms (4,4) (4,4) (2,4) (2,2) [all from 5] and S+P [6] were tested with the new algorithm. A five scale wavelet transform was used throughout. To achieve exact integer representation, the lifting steps in the transforms are not normalised. In order to adjust the relative significance (according to PSNR) of the coefficients in different sub bands, the wavelet coefficients have to be normalised. This is usually done by multiplying the coefficients in low pass sub band by 2 and dividing the coefficients in high sub band by 2 after each one dimensional (1-D) transform. In order to preserve the integer nature of the coefficients this can be performed by four extra lifting steps [9]. But additional lifting steps result an increase in the dynamic range of the coefficients in low pass sub bands. In order to avoid that, the overall result of normalising can be applied to each sub band respectively. The overall effect

LL 2

HL 2

LH 2

HH 2

HL 1

LH 1

HH 1

WBP #

LL 2

HL 2

LH 2

HH 2

HL 1

LH 1

HH 1

I

7 6 5 4 3 2 1 0

7 6 5 4 3 2 1

7 6 5 4 3 2 1

7 6 5 4 3 2

7 6 5 4 3 2

7 6 5 4 3 2

7 6 5 4 3

0

0

II III

7 6 5 4 3 2

7 6 5 4 3 2

7 6 5 4 3 2

7 6 5 4 3 2

7 6 5 4 3 2

7 6 5 4 3 2

7 6 5 4 3 2

VIII

1

1

1

1

1

1

1

IX

0

0

0

0

0

0

0

X

IV V VI VII

1

1

1

2

0

0

0

1

XI

Sub bands before bit plane sliding

0

Sub bands after bit plane sliding

Figure 1. Vertically slid bit planes in sub bands (three scales shown)

is multiplying coefficients in each sub band, namely LL, LH, HL and HH by 2,1,1 and 0.5 respectively. The bit planes (in sign and magnitude binary representation of the coefficients) are vertically slid in sub bands according to above multiplication factors to obtain weighted bit planes (WBP) (Figure 1). With WBP representation, the original bit space after normalising can be efficiently identified. In figure 1, it has been assumed that all the sub bands contain a maximum dynamic range of 8 bits. The original bit space can be optimised by sending the maximum dynamic range for each sub band as side information. Each WBP is coded in two different passes, the Refinement Pass (RP) and the Switching Pass (SP). Refinement of already switched coefficients is done in the RP. In the SP, coefficients, which become significant in the current pass, are switched on followed by their signs. This is achieved by using a Significance Switching Mask (SSM) with three symbols: (S) - Coefficients switched on in current plane. (N) - Coefficients which are yet to be switched on. (X) - Coefficients switched on in previous planes. Within a bit plane, sub bands are visited from the lowest frequency to the highest (LL, LH, HL, HH) and from the highest scale to the lowest. 3. SIGNIFICANCE SWITCHING MASK (SSM) CODING Significance switching mask coding exploits the multiresolution properties of the wavelet coefficient

hierarchy. For each sub band, a feature block size, which depends on the scale in which the sub band belongs, is defined. The feature block size for a sub band in the s 1

s 1

wavelet scale si is 2 i  2 i . Since the feature sizes for the top two (lowest frequency) scales are 1 and 2, sub bands in these scales are coded without any prediction between sub bands. For other scales, coding is performed with reference to the corresponding feature block in the parent sub band. A quad tree algorithm is applied to each feature block with a feature size greater than two. Two quad tree algorithms (QT1 and QT2) are used. QT1 is same as the traditional quad tree coding, in which quad tree splitting is performed until a predefined minimum block size is met. In a min block, the S and N bits are coded individually, followed by the sign for S symbols. The best min block size is found as 2, with our experiments. In SSM there are three symbols: S, N and X. The traditional quad tree coding is expensive when the probabilities of S and N are similar. This is common in the lower bit planes due to the random nature of S symbols and the increased number of X. In these conditions, raster scan coding outperforms quad tree coding. To overcome this problem, a second version of quad tree coding (QT2) is used which adaptively changes the coding method from quad tree to raster coding depending on the occurrence of X bits within a block. In this, if a block contains at least one X symbol, the block is split into 4 sub blocks without sending any quad tree symbols (i.e. 0 for an all zero block and 1 for otherwise) for the block. If the block does not contain any X bits, QT1 is used. This is repeated until the min block size is met. The S and N bits in a min block are coded as in QT1.

QT2 is the more important algorithm in this coder since it can adaptively change from quad tree coding to raster scan coding. If a block consists of no Ss, but with Xs and Ns, then QT2 is costly. In this case QT1 outperforms QT2. The coder is designed to choose the better quad tree algorithm adaptively for each block. This is achieved by predicting the current block from the corresponding block in the parent sub band, which has already been coded. If a pixel in the parent sub band is N, then there is a higher probability that all the corresponding children are N as well. The algorithm predicts four children of a parent as follows: If parent is N then child bits are N, If parent is S then child bits are either S or N (called type A) and If parent is X then child bits are either S or N or X (called type B) (1) A predicted block consists of N, A, B and a priori known X symbols from the current block. If the predicted block consists of only N symbols, QT1 is used and otherwise QT2 is used. For the sub bands with feature block sizes of 1 and 2 which are smaller than the min block size, prediction based quad tree is not performed. Instead the whole sub band is considered as the feature block. These sub bands are coded using QT2. 4. CONTEXT BASED ARITHMETIC CODING Each weighted bit plane consists of its own inter bit correlation within a sub band. Symbols result from both switching and refinement pass are binary. Better performance can be obtained by performing adaptive binary arithmetic coding on each symbol based on a context in which the symbol appears [10, 11]. The switching pass and refinement pass bits are coded within the contexts as modelled and selected by the criteria described below. In SSM coding two separate contexts are defined for quad tree symbols in QT1 and QT2 respectively. Sign bits for significant coefficients are also coded using a separate single context. In the quad tree algorithms, individual bits in min blocks contain inter bit correlation from the neighbouring bits and the corresponding bit from the parent sub band. Thus, the contexts for min block bits are selected as below: Context of Biti =f (Parent prediction, Biti-1 )

(2)

The predicted value from the parent can be either type N, A or B according to the rule (1). A previously visited neighbour (Biti-1) can be either N, S or X type. In this

case in each WBP, individual bits in min blocks are coded in one of the nine contexts, formed as above. This context modelling helps to exploit context and conditioning in the source symbols. A single context has been used in highest two scales to avoid context dilution. For a given WBP, the refinement pass is performed before the switching pass for that plane. Therefore, for a given bit in the refinement pass, neighbouring bits from the WBP are not known unless those coefficients have become significant in the previous planes. Therefore, data refinement bit contexts are defined using already coded bits from the current coefficient with reference to the original bit positioning in the wavelet domain before bit sliding. Context Ci for the biti is selected using biti-1 and biti-2 as in table 1. Ci 1 2 3

Biti-1 0 1 1

Biti-2 0 0 1/0

Table 1. Context Selection for data refinement bits The actual coding context is selected by referring to a look up table with two input parameters, namely inititial context Ci and the original bit plane number for biti. 5. CODING RESULTS AND CONCLUSIONS Results (Table 2) at lossless level for ELIC (with (4,4) wavelet) are compared with JPEG-LS, which is a prediction based method, and SPIHT lossless, which is based on S+P with embedded coding up to a certain bit rate and then progressive coding (ProgCode). In Table 2, all test images are of size 576 x 704 and of 8 bits per pixel (BPP) grayscale images.

Goldhill Barbara 1 Barbara 2 Boats Black board

JPEG-LS

SPIHT (ProgCode)

ELIC

4.557 4.720 4.777 3.946 3.684

4.630 4.580 4.792 4.053 3.809

4.621 4.555 4.800 4.054 3.811

Table 2. Lossless Performance (in BPP) JPEG-LS gives the best compression for most of the images. But the disadvantage of JPEG-LS is the coded image can only be decoded to the lossless level since it is not an embedded coding technique. On the other hand both SPIHT and ELIC can be decoded to other compression levels. ELIC performs within 0.7% of JPEG-LS and

Near Lossless Performance for Goldhill 576x704

Near Lossless Performance for Barbara1 576x704

5

5 ELIC SPIHT - Progcode

4

4

3.5

3.5

3

3

2.5

2.5

2

2

1.5

1.5

1

1 0

0.5

1

1.5 2 RMS Error

2.5

3

ELIC SPIHT - Progcode

4.5

BPP

BPP

4.5

3.5

0

0.5

1

1.5 2 RMS Error

2.5

3

3.5

Figure 2. Lossless and Near Lossless Performances

0.1% better than SPIHT Progcode, on average at the lossless level. In JPEG-LS, a maximum pixel error can be specified, which is not possible in wavelet based methods since coding is performed in the wavelet domain. With wavelets global metrics like rms error can be more easily controlled, although this is only exact with orthonormal wavelets. Therefore rms error is used as the performance metric for ELIC at near lossless levels. In figure 2, we show near lossless coding up to an rms error of 3.5 for Goldhill and Barbara1 images, compared with SPIHT Progcode. At near lossless levels, up to an rms error of 2, ELIC outperforms SPIHT. In conclusion, ELIC performs better than SPIHT in lossless and near lossless levels for most of the test images and has comparable performance with JPEGLS with an added feature of embedding in the lossless bit stream.

[4]

[5]

[6]

[7]

[8]

6. ACKNOWLEDGEMENTS The sponsorship of Tandberg Television Ltd. for G.C.K. Abhayaratne is gratefully acknowledged.

[9]

7. REFERENCES

[10]

[1] X. Wu and N. Memon, "Context-based, adaptive, lossless image coding", IEEE Trans. Communications, Vol. 45, No. 4, pp. 437-444, 1997. [2] ISO / IEC JTC1 SC29 WG1 (JPEG / JBIG), “ FCD 14495, Lossless and near-lossless coding of continuous tone still images (JPEG-LS)”. [3] M. J. Weinberger, G. Seroussi and G. Sapiro, "LOCO-I: A low complexity, context based, lossless

[11]

image compression algorithm", Proc. Data Compression Conference, pp. 141-150, Snowbird, Utah, 1996. V. N. Ramaswamy, K. R. Namuduri and N. Ranganathan, "Lossless image compression using wavelets and variable block size segmentation", Proc. IEEESP International Symposium on Time-Frequency and Time Scale Analysis, pp. 113-116, Paris, France, 1996. A. R. Calderbank, I. Daubechies, W. Sweldens and B. Yeo, "Lossless image compression using integer to integer wavelet transforms", Proc. ICIP, Vol. 1, pp. 596-599, Santa Barbara, CA, 1997. A. Said and W. A. Pearlman, "Image multiresolution representation for lossless and lossy compression", IEEE Trans. Image Processing, Vol. 5, No. 9, pp. 1303-1310, 1996. J. Shapiro, "Embedded image coding using zero trees of wavelet coefficients", IEEE Trans. Signal Processing, Vol. 41, No. 12, pp. 3445-3462, 1993. A. Said and W. Pearlman, "A new fast and efficient image codec based on set partitioning in hierarchical trees", IEEE Trans. Circuits and Systems for Video Technology, Vol. 6, No. 3, pp. 243-250, 1996. I. Daubechies and W. Sweldens “Factoring wavelet transforms into lifting steps”, Journal of Fourier Analysis Applications, Vol. 4, No. 3, pp. 247-269, 1998. M. J. Weinberger, J.J. Rissanen, R.B. Arps, "Application of universal context modelling to lossless compression of gray-scale images", IEEE Trans. Image Processing, Vol. 5, No. 4, pp. 575-586, 1996. M. Nelson and J. Gailly, The Data Compression Book, 2nd ed., pp. 153-163, M&T Books, New York, 1996.

Suggest Documents