Lossless Bitplane Compression of Images with Context Tree
Lossless Bit-plane Compression of Images with Context Tree Modeling University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Bit-plane coding • Bit-plane coding has been widely used in lossless compression of gray-scale images or color palette images • Progressive transmission can be used in bit -plane coding strategy University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Bit-plane coding (cont. ) Step 1: decomposition into binary layers • simple bit-plane separation (BPS) • gray code separation (GCS) • prediction error separation (PCS) • gray code prediction error separation (GCPES). University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Bit-plane separation • simple bit-plane separation (BPS) • Not all the bit-plane is needed for encoding. This is implemented by pre-calculating the histogram of the image • For example, if we know a pixel with value x 7, x 6, x 5, x 4 in four MSBs, its possible value for this pixel is x 727+x 626+x 525+x 424+[0, 24 -1]. When in image’s histogram there’s only one value in this range, encoding for this pixel for following LSBs can be omitted University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Bit-plane coding (cont. ) Step 2: Lossless compression Coding binary layers separately • JBIG • Context tree modeling Consider the correlation of binary layers • Multi-layer context tree modeling • Expectation-based bit-plane coding University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Bit-plane coding (example) University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Problem of bit-plane coding • Only efficient for the most significant bitplanes (MSB). • Low correlation of the pixels on the less significant bit-planes (LSB) and the bitrate is close to 1 bit/pixel. University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Multi-layer context tree modeling Proposed by Kopylov etal. on IEEE Trans. on Image Processing (2005) • The value of previous encoding layers can be used in probability estimation, • The algorithm has higher time complexity University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Expectation-based bit-plane coding (EBC) • Suppose simple bit-plane separation (BPS) is used. x =(x 7, x 6, x 5, x 4, x 3, x 2, x 1, x 0), xi: value at bit-plane i. When the nth bit-plane is encoded, expectation values are calculated by: • The context value of neighbor pixels is then determined by: University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Expectation-based bit-plane coding (EBC) • Fixed template was used and the number of template pixels is decreased to 8, 7, 6 and 5 for four LSBs • Future pixel can also be used in context Proposed by Kikuchi etal. on Picture Coding Symposium (PCS’ 09) University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Expectation-based bit-plane coding (EBC) (example) Encoding pixel fragment of original image bit-plane 4 64 66 Poor probablity estimation if value of current bit-plane is used as context expectation value 5097 73 • Better performance by EBC • The distribution of this context means that image is homogeneous in local region University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Improvement of EBC • Context weighting • Probability estimation • Context tree modeling University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Expectation-based bit-plane coding weighted (EBCW) • Two context template are used: • Context weighting is then considered in probability estimation: • α and β are the weight of two context model, updated by: μ 2 =0. 975 is the forgetting factor Context weighting is proposed by Xiao etal. on IEEE Trans. on Image Processing (2006) University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Probability estimation by BACIC • A forgetting factor μ is incorporated which gives higher influence for recently encoded pixels in probability estimation. rc and sc are updated by: Δ is a bias factor (Δ = 0. 006) rc(0) = 1 and sc(0)=2. • When μ=1, it is the common probability estimation method based on global statistics BACIC is proposed by Reavy etal. on IEEE Int. Conf. on Image Processing (1997) University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Example of BACIC Sample image Probability estimation Context template Bit-rate University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Optimize context template by context tree modeling • Calculate the order of context template A greedy context reordering process is used proposed by Martins etal. [1998] in each bit-plane • Tree pruning process Tree pruning starts from the leaves of the full grown and reordered tree, evaluating a recursively defined cost by bottom-up strategy, by Mrak etal. [2003] • For gray-scale image, a pre-calculated context tree is used, for color palette image, context tree is optimized by its only statistics University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Calculate the order of context template • Given a predefined search area, recursively search the context minimizing the sum of adaptive code lengths after splitting. 6 predefined search area 7 3 5 1 2 7 4 8 6 2 1 5 4 5 3 3 1 4 2 optimized context order on bit-plane 7 on bit-plane 3 on bit-plane 0 University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Tree pruning ottom-up Using a strategy, determined pruning is by evaluating cost value J. Suppose a d-depth context tree with node s at depth d 0, it has two child node sch 0 and sch 1: Pruning is done No Pruning where mc(d 0) = log 2(d - d 0 + 1) is the model cost. l is the total coding cost by arithmetic coding University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Result Gray-scale image Image JBIG JPEG-LS MCT Proposed airplane 4. 24 3. 81 4. 12 3. 80 bridge 5. 04 5. 50 4. 93 3. 51 couple 5. 07 4. 26 4. 64 4. 37 crowd 4. 45 3. 91 4. 17 3. 95 lena 4. 91 4. 23 4. 49 4. 27 Color palette image Image JBIG JPEG-LS MCT Proposed benjerry 2. 06 1. 91 0. 85 1. 05 books 3. 27 5. 60 1. 12 1. 20 ccit 01 0. 21 0. 07 0. 02 cmpndd 1. 83 3. 04 2. 44 1. 14 sea_dusk 0. 12 0. 21 0. 05 0. 04 sunset 2. 42 2. 18 1. 96 1. 68 University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Result (cont. ) Significance of every component. Forgetting factor (BACIC), context weighting (CW) and context tree modeling (CT). University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Conclusion • Expectation-based bit-plane coding algorithm is improved in three aspects: context weighting, probability estimation and context tree modeling • Similar performance with JPEG-LS on gray -scale images, better performance on color palette images • Progressive transmission is also available University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
Reference • H. Kikuchi, K. Funahashi, and S. Muramatsu, "Simple bit-plane coding for lossless image compression and extended functionalities", Picture Coding Symposium (PCS’ 09), Chicago, USA, May 2009. • H. Xiao and C. G. Boncelet, “On the Use of Context-Weighting in Lossless Bilevel Image Compression”, IEEE Trans. Image Processing, 15(11), 3253 – 3260, 2006. • M. D. Reavy and C. G. Boncelet, “BACIC: a new method for lossless bi-level and grayscale image compression”, IEEE Int. Conf. on Image Processing, vol. 2, 282285, 1997. • B. Martins and S. Forchhammer, “Bi-level image compression with tree coding, ” IEEE Trans. Image Process. , vol. 7, no. 4, 517 -528, Apr. 1998. • M. Mrak, D. Marpe and T. Wiegand, “A context modeling algorithm and its application in video compression”, Proc. of IEEE Int. Conf. on Image Processing, vol. 3, 845 -848, 2003. • P. Kopylov and P. Fränti, "Compression of map images by multilayer context tree modeling", IEEE Trans. on Image Processing, 14 (1), 1 -11, January 2005. • A. Podlasov, P. Fränti, "Lossless image compression via bit-plane separation and multi-layer context tree modeling", Journal of Electronic Imaging, 14 (5), 043009, October-December 2006. University of Eastern Finland School of Computing P. O. Box 111 FIN- 80101 Joensuu Tel. +358 13 251 7959 fax +358 13 251 7955 cs. joensuu. fi
- Slides: 22