Exponential-Golomb coding

This is an old revision of this page, as edited by Mulligatawny (talk | contribs) at 20:03, 26 September 2006 (There are two video coding standards in MPEG-4. Exp-Golomb coding is only in one of them.). 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 code) 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 H.264/MPEG-4 AVC video compression standard, in which there is also a variation for the coding of signed numbers by mapping the value 0 to the binary codeword '0' and assigning subsequent codewords to input values of increasing magnitude and alternating sign.

Exp-Golomb coding is also used 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