Adaptive Lossless Image Coding
Adaptive Lossless Image Coding
Adaptive Lossless Image Coding
4, APRIL 1997
437
I. INTRODUCTION
wu.
>8
438
439
(1)
meaning north, west, northeast, northwest, northnorth,
westwest, and northnortheast, respectively. The locations
of these pixels with respect to
are given in Fig. 2.
We estimate the gradient of the intensity function at the
current pixel
by the following quantities3:
(2)
Clearly,
and
are estimates, within a scaling factor,
of the gradients of the intensity function near pixel
in the horizontal and vertical directions. The values of
and
are used to detect the magnitude and orientation of
edges in the input image, and make necessary adjustments
in the prediction in order to get improved performance in
the presence of local edges. Three absolute differences are
used for in each direction. This gave the best compression
results in our experiments. Two or one absolute differences
can be used here for lower complexity with a small loss
in performance. The reason for using absolute rather than
algebraic differences in (2) is to prevent cancellation of values
of opposite signs. Efficient incremental and/or parallel schemes
for evaluating
and
are straightforward. For instance, to
avoid unnecessary repeated computations, one can store the
values of
associated with preceding pixels for
3 For the sake of clarity, we only consider sequential coding of interior
pixels. Many possible treatments of boundary pixels are possible, and they do
not make a significant difference in the final compression ratio.
IF
ELSE IF
ELSE
IF
ELSE IF
ELSE IF
ELSE IF
AND
QUANTIZATION
The prediction step does not completely remove the statistical redundancy in the image. It is observed that the variance
strongly correlates to the
of prediction errors
.
smoothness of the image around the predicted pixel
To model this correlation at a small computational cost, we
define an error energy estimator
(3)
and
are defined in (2) and
is the previous prediction error.
is included in
because large errors tend to occur consecutively. One can,
in . This
of course, include
makes a slightly better error energy estimator, but requires
buffering of an extra row of errors. We decided not to use
. Note that (3) has only two independent parameters since
can be scaled arbitrarily. The coefficients
, and can
be determined in an off-line design process by standard linear
is the least-squares estimator
regression technique so that
based on
. For algorithm
of the error strength
and
in (3).
efficiency, we recommend
By conditioning the error distribution on , we can separate the prediction errors into classes of different variances.
Thus, entropy coding of errors using estimated conditional
improves coding efficiency over using
.
probability
to
levels.
For time and space efficiency, we quantize
where
440
Fig. 3. Convexity relationship between GAP predictor I^ and the neighboring pixels.
In practice,
is found to be sufficient. Denote the
quantizer by , i.e.,
. The quantization
criterion is to minimize the conditional entropy of the errors. In
pairs
an off-line design process, we get a training set of
from test images, and use dynamic programming to choose
to partition
into
intervals such that
(4)
quantizer using
is minimized. We designed an optimal
a training set consisting of all ISO test images and with
and
to minimize (4). This quantizer, whose
bins are
(5)
worked almost as well as the optimal individual-imagedependent quantizer. Quantizing the error energy estimator
or the activity level in error modeling was used earlier by
many authors, for example, in [1], [8]. But we optimized the
quantizer under a conditional entropy criterion.
Estimating
conditional error probabilities
requires only a modest amount of memory during entropy
coding. Furthermore, the small number of conditional error
probabilities involved means that even small images will
provide enough samples for context modeling to learn
quickly in adaptive entropy coding.
V. CONTEXT MODELING
OF
PREDICTION ERRORS
(6)
is then quantized to an -b binary number
using the prediction value as the threshold, namely,
if
if
(7)
different
and
441
442
(10)
(11)
which are quantized to get a 6-b binary number
if
(12)
if
represents the texture
As in the continous-tone mode,
pattern around
. Note that, because
can be ignored from the context . Thus, there are only
different modeling contexts in the binary mode.
Consequently, we use 32 conditional probabilities
to
drive an adaptive arithmetic coder of three symbols. For the
context modeling in the binary mode, only
frequency counts need to be maintained. Of course, we can
use higher order contexts in binary mode like in JBIG for
slightly higher compression. For compound-type images of
large portions of binary texts, the JBIGs order-10 contexts can
yield up to 2% more compression than our order-6 contexts.
But for other images, high-order binary contexts can hurt
compression because they make the condition for entering
the binary mode more restrictive. To balance out the two
conflicting situations and for easy implementation, we let the
modeling context be the same as the template in which the
binary mode is determined.
The incorporation of the binary mode into the compression
system adds little to the system complexity, while greatly enhancing the coding performance on bilevel images, compound
images, and images with large uniform areas. An important
feature of our design is that the switch between continuoustone and binary modes is context-dependent, automatic, and
completely transparent to the user.
VII. ENTROPY CODING
OF
PREDICTION ERRORS
443
444
TABLE I
BIT RATES (BITS PER PIXEL) OF CALC ON ISO TEST
SET AND COMPARISON WITH A FEW SELECTED SCHEMES
not require the support of complex data structures (only onedimensional arrays are used), their hardware implementations
should not be difficult. The space complexity of CALIC was
already discussed at the end of Section V-C.
REFERENCES
TABLE II
COUNTS OF DIFFERENT OPERATIONS PER PIXEL INVOLVED IN CONTEXT
ERROR MODELING AND CONTEXT-BASED ADAPTIVE PREDICTION
Nasir Memon (S91M92) received the B.E. degree in chemical engineering and the M.Sc. degree
in mathematics from the Birla Institute of Technology, Pilani, India, in 1981 and 1982 respectively.
He received his M.S. and Ph.D. degrees from the
University of Nebraska, Lincoln, both in Computer
Science, in 1989 and 1992 respectively.
He was an Assistant Professor in the Department
of Computer Science, Mathematics and Physics at
Arkansas State University from 1992 to July 1994.
He joined the Computer Science Department at
Northern Illinois University, De Kalb, in August 1994, where he is currently
an Assistant Professor. His research interests include data compression, data
encryption and communication networks.