> exp | golomb | h264 <
// Exponential-Golomb - Standard variable-length code in video compression
Video Standard
Used in H.264/AVC and H.265/HEVC codecs.
Multiple Orders
Different k values for different distributions.
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.