# Arithmetic Coding

Arithmetic coding (AC) is a special kind of entropy coding. Unlike Huffman coding, arithmetic coding doesn´t use a discrete number of bits for each symbol to compress. It reaches for every source almost the optimum compression in the sense of the Shannon theorem and is well suitable for adaptive models. The biggest drawbak of the arithmetic coding is it´s low speed since of several needed multiplications and divisions for each symbol. The main idea behind arithmetic coding is to assign to each symbol an interval. Starting with the interval [0..1), each interval is devided in several subintervals, which sizes are proportional to the current probability of the corresponding symbols of the alphabet. The subinterval from the coded symbol is then taken as the interval for the next symbol. The output is the interval of the last symbol. Implementations write bits of this interval sequence as soon as they are certain.

A fast variant of arithmetic coding, which uses less multiplications and divisions, is a range coder, which works byte oriented. The compression rate of a range coder is only a little bit less than pure arithmetic coding, and the difference in many real implementation is not noticeable.

Some useful link as following:

Arithmetic Coding + Statistical Modeling = Data Compression

http://www.dogma.net/markn/articles/arith/part1.htm

The Arithmetic Coding Page

http://www.cs.mu.oz.au/~alistair/arith_coder/

http://www.arturocampos.com/ac_arithmetic.html

http://www.data-compression.info/Algorithms/AC/

## Leave a Reply