Golomb Coding Shopping
Coding
Website Links For
Coding
 

Information About

Golomb Coding




that is, when small values are vastly more common than large values.

It uses a tunable parameter ''b'' to divide an input value into two parts: q, the result of a division by ''b'', and r, the remainder. The quotient is sent in Unary Coding , followed by the remainder in Truncated Binary Encoding . When b=1 Golomb coding is equivalent to unary coding.

Formally, the two parts are given by the following expression, where x is the number being encoded:

q = \left \lfloor rac{\left (x-1 ight )}{b} ight floor

and

r = x-qb-1

The final result looks like:

\left (q+1 ight ) r

Note that r can be of a varying number of bits.

The parameter b is a function of the corresponding Bernoulli Process , which is parameterized by p=P(X=0) the probability of success in a given Bernoulli Trial . b and p are related by these inequalities:

(1-p)^b + (1-p)^{b+1} \leq 1 < (1-p)^{b-1} + (1-p)^b

The Golomb code for this distribution is equivalent to the Huffman Code for the same probabilities, if it were possible to compute the Huffman code.

Rice coding is a special case of Golomb coding first described by Robert Rice. It is equivalent to Golomb coding where the tunable parameter is a power of two. This makes it extremely efficient for use on Computer s, since the division operation becomes a Bitshift operation and the remainder operation becomes a Bitmask operation.


APPLICATIONS

The FLAC Audio Codec uses Rice coding to represent linear prediction residues.

Apple 's ALAC Audio Codec uses modfied Rice coding after its Adaptive FIR filter.


REFERENCES

  • Golomb, S.W. (1966). Run-length encodings. IEEE Transactions on Information Theory, IT--12(3):399--401 {Link without Title}

  • R. F. Rice, "Some Practical Universal Noiseless Coding Techniques, " Jet Propulsion Laboratory, Pasadena, California, JPL Publication 79--22, Mar. 1979.

  • Witten, Ian Moffat, Alistair Bell, Timothy. "Managing Gigabytes: Compressing and Indexing Documents and Images." Second Edition. Morgan Kaufmann Publishers, San Francisco CA. 1999 ISBN 1-55860-570-3