encode | decode | compress

> exp | golomb | h264 <

// Exponential-Golomb - Standard variable-length code in video compression

0 chars
0 chars

>> features

[H.264/H.265]

Video Standard

Used in H.264/AVC and H.265/HEVC codecs.

[ADAPTIVE]

Multiple Orders

Different k values for different distributions.

[SIGNED]

Signed Support

Built-in mapping for signed integers.

>> technical info

How Exp-Golomb Coding Works

Exponential-Golomb codes of order k encode non-negative integer n as: 1) Add 1 to n to get codeNum, 2) Divide by 2^k to get quotient q and remainder r, 3) Write q zeros, then 1, then r in k bits. For k=0, this equals Elias Gamma. Signed integers map: positive n โ†’ 2n-1, non-positive n โ†’ -2n.

Exp-Golomb Examples

Order k=0 (standard):
0 โ†’ 1
1 โ†’ 010
2 โ†’ 011
3 โ†’ 00100

Order k=1:
0 โ†’ 10
1 โ†’ 11
2 โ†’ 010
3 โ†’ 011

Signed mode (k=0):
0 โ†’ 1 (maps to 0)
1 โ†’ 010 (maps to 1)
-1 โ†’ 011 (maps to 2)
2 โ†’ 00100 (maps to 3)

Why Use Exp-Golomb

  • โ–ธ H.264/H.265 syntax elements
  • โ–ธ Motion vector coding
  • โ–ธ Coefficient levels
  • โ–ธ Simple hardware implementation
  • โ–ธ Adaptive to data distribution

>> frequently asked questions

What is Exp-Golomb coding?

Exponential-Golomb coding is a universal variable-length code used extensively in video compression standards like H.264 and H.265. It generalizes Elias Gamma coding with a parameter k that allows adaptation to different data distributions.

How to choose order k?

k=0 (standard Exp-Golomb) works well for small integers with exponential distribution. Higher k values are better for larger integers or more uniform distributions. Video codecs often use k=0 for syntax elements and adaptive k for residuals.

Why is it used in video?

Exp-Golomb is ideal for video because: 1) Simple to implement in hardware, 2) No lookup tables needed, 3) Good for the statistical distribution of video data, 4) Provides good compression for motion vectors and transform coefficients.

Exp-Golomb vs other codes?

Compared to Huffman: simpler, no tables, but less optimal. Compared to arithmetic coding: much simpler, lower compression. Exp-Golomb strikes a balance between simplicity and efficiency, perfect for real-time video encoding.