An Algorithm for Compression of Bilevel Images Authors: Maire D. Reavy and Charles G. Boncelet Source: IEEE Transactions on Image Processing, Vol. 10, No. 5, May 2001 Speaker: Guu-In Chen Date: 2001/9/13
INTRODUCTION Algorithm for lossless bilevel image compression: G3: 1980 Run lengthmodified Huffman encoder Suitable for business documents Not for halftone images JBIG (JBIG1): 1993 An arithmetic coder (IBM QM-coder) & halftone images Not been implemented commercially More than 24 patents
INTRODUCTION (cont.) BACIC (Block Arithmetic Coding for Image Compression): 1997 Block arithmetic coder (BAC) Suitable for business documents & halftone images Compression ratio: Documents:~JBIG, 2.4xG3 halftone images:>JBIG, 6.1xG3
Documents
Halftone Image - by Floyd-Steinberg error diffusion Grayscale Image
Halftone Image - by dispersed-dot ordered dither
Halftone Image - by clustered-dot ordered dither
BAC predeterminiate the number of codewords K K is as large as possible to maximize BAC’s coding efficiency. calculate the overall p0 (p1=1- p0) p0 :the probability of a bit equaling zero build BAC coding tree BAC codebook raster-scan the image From the root of BAC coding tree, one bit one node moves forward till a leaf and outputs its number (ie, codeword). The coding tree is small and constant, the encoder and decoder can each store a copy of this tree.
For example: K=16 (0-15 or 0000-1111) p0 =0.8 BAC coding tree: K0=[p0K] K1=K-K0 [•]:rounded to the nearest integer unless [p0K]=KK0 =K-1 , K1=1 or [p0K]=1 K0 =1, K1= K-1 K K1 K0
BAC coding tree: K=16 (0-15), p0 =0.8
Bitstream: 11 0011 101 00011 010 Code: 15 9 14 7 10 or 11 (with the size of image in the header)
BACIC BASIC propose an adaptive BAC coding tree: p0 (p1=1- p0) is no longer constant; using a three-line or five-line template to estimate p0 (p1); constructing only that portion of the tree that is needed to generate a codeword.
The template used by BACIC For documents & error diffusion halftone The essences: ri counts the previously coded pixels equaling one. si counts all the previously coded pixels. For a context, the estamate of p1: For ordered dither halftone
The template used by BACIC (cont.) For every context: ri (0)=1.0 ri (n+1) = px+ 0.985 *ri (n) si (0)=2.0 si (n+1) = 1.0+ 0.985 *si (n) n : the sequence no. px: the value of the current pixel 0.985: the weight to make the recent pixels have greater influence on the probability estimate of the current pixel than earlier pixels do. 0.006: to correct the overestimate p1 when si (n) reach its upper limit
The example for adaptive BAC coding tree p0={0.80, 0.90, 0.25, 0.90 …….}, K=16 Input stream : 0 0 0 1……. Output: 2
Decoding: p0 of the first pixel is 0.80 and K=16. The according index is 2. 16*0.80=13, (13-1)>=2, so go down the lower path from the root of BAC coding tree. p0 of the second pixel is 0.90, 13*0.90=12, (12-1)>=2, so go down the lower path . p0 of the third pixel is 0.25, 12*0.25=3, (3-1)>=2, so go down the lower path . p0 of the forth pixel is 0.90, 3*0.90=2, (2-1)<2, so go down the upper path, and the node is a leaf, so this index 2 decoded to be 0001.
Experimental results
ordered dither halftone