Arithmetic Coding
Arithmetic Coding
1
Pr[ ]
s
i
i
Gabriele Monfardini - Corso di Basi di Dati Multimediali a.a. 2005-2006 28
Implementing arithmetic coding
As mentioned early, arithmetic coding uses
binary fractional number with unlimited
arithmetic precision
Working with finite precision (16 or 32 bits)
causes compression be a little worser than
entropy bound
It is possible also to build coders based on
integer arithmetic, with another little
degradation of compression
29
Arithmetic coding vs. Huffman coding
In tipical English text, the space character is
the most common, with a probability of about
18%, so Huffman redundancy is quite small.
Moreover this is an upper bound
On the contrary, in black and white images,
arithmetic coding is much better than Huffman
coding, unless a blocking technique is used
A A. coding requires less memory, as symbol
representation is calculated on the fly
A A. coding is more suitable for high
performance models, where there are
confident predictions
Gabriele Monfardini - Corso di Basi di Dati Multimediali a.a. 2005-2006 30
Arithmetic coding vs. Huffman coding
H H. decoding is generally faster than a.
decoding
H In a. coding it is not easy to start decoding in
the middle of the stream, while in H. coding
we can use starting points
In large collections of text and images,
Huffman coding is likely to be used for the
text, and arithmeting coding for the images