Exponential-Golomb coding

This is an old revision of this page, as edited by X264hack (talk | contribs) at 19:47, 26 September 2006 (mention golomb, more links). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Exponential-Golomb code (or just Exp-Golomb) is a universal code encoding the positive integers. To code a number:

  1. Write the number plus 1 in binary.
  2. Count the bits, subtract one, and write that number of starting zero bits preceding the previous bit string.

The code begins:

 0 => 1 => 1
 1 => 10 => 010
 2 => 11 => 011
 3 => 100 => 00100
 4 => 101 => 00101
 5 => 110 => 00110
 6 => 111 => 00111
 7 => 1000 => 0001000
 8 => 1001 => 0001001
...

Exp-Golomb coding is used in the MPEG-4 video compression standard, as well as in the Dirac video codec.

Exp-Golomb is identical to the Elias gamma code of the same number plus one. Thus it can encode zero, whereas Elias gamma can only encode numbers greater than zero.

Despite the similar name, Exp-Golomb is not related to Golomb coding, which is a type of entropy coding but not a universal code.

See also: Elias gamma coding, Elias delta coding, Elias omega coding