Arithmetic coding

Juan Francisco Rodríguez Herrera
Vicente González Ruiz

September 12, 2016

Contents

1 Limits of the Huffman code
2 Achivements
3 The ideal encoder
4 Incremental transmission
5 The ideal decoder

1 Limits of the Huffman code

PIC

2 Achivements

3 The ideal encoder

  1. Let [L,H) [0.0,1.0) an interval of real numbers.
  2. While the input is not exhausted:
    1. Split [L,H) into so many sub-intervals as different symbols are in the alphabet. The size of each sub-interval is proportional to the probability of the corresponding symbol.
    2. Select the sub-interval [L,H) associated with the encoded symbol.
    3. [L,H) [L,H).
  3. Output a real number x [L,H) (the arithmetic code-stream). The number of decimals of x should be large enough to distinguish the final sub-interval [L,H) from the rest of possibilities.

Example

Imagine a binary sequence, where p(A) = 34 and p(B) = 14. Compute the arithmetic code of the sequences A, B, AA, AB, BA y BB.

PIC

4 Incremental transmission

5 The ideal decoder

  1. Let [L,H) [0.0,1.0) the initial interval.
  2. While the input is not exhausted:
    1. Split [L,H) into so many sub-intervals as different symbols are in the alphabet. The size of each sub-interval is proportional to the probability of the corresponding symbol.
    2. Input so many bits of x as they are needed to:
      1. Select the sub-interval [L,H) that contains x.
      2. Output the symbol that [L,H) represents.
      3. [L,H) [L,H).