How AV1 Signals Zero Coefficients Using EOB Markers
This article explains how the AV1 video codec efficiently signals trailing zero transform coefficients using End-Of-Block (EOB) markers. In transform coding, quantizing residual data produces sparse coefficient blocks with large clusters of zeros, particularly in higher frequencies. Rather than transmitting each zero individual coefficient, AV1 identifies the position of the last non-zero coefficient along a predetermined scan path, allowing decoders to infer that all subsequent values are zero.
The Role of End-Of-Block (EOB) in Transform Coding
During video compression, spatial residuals are converted into frequency domain coefficients using transforms such as the Discrete Cosine Transform (DCT) or the Asymmetric Discrete Sine Transform (ADST). After quantization, most energy concentrates in the low-frequency positions, leaving high frequencies populated almost entirely by zeros.
To convert the two-dimensional transform matrix into a one-dimensional array for entropy coding, AV1 arranges coefficients using specific scan orders. The End-Of-Block (EOB) marker represents the 1D index of the final non-zero coefficient along this scan path. All indices beyond the EOB contain only zero-value coefficients.
Signaling EOB Position
AV1 avoids coding trailing zeros by determining and transmitting the EOB index before decoding the individual coefficient magnitudes. The signaling process follows a structured syntax:
- All-Zero Block Check: If an entire transform block contains no non-zero values, this is signaled immediately at the block level (often via a transform skip or coded block flag). In this scenario, the EOB is zero, and no further transform data is processed.
- EOB Prefix (
eob_pt): When non-zero coefficients exist, AV1 splits the EOB position into a prefix category (eob_pt) and extra bits. Theeob_ptdefines a logarithmic range or bucket for the EOB index (for instance, whether the index falls in ranges like 1, 2, 3, 4–7, 8–15, etc.). - Context-Adaptive Entropy Coding: The
eob_ptsyntax element is encoded using AV1's multi-symbol arithmetic coder. Contexts for modelingeob_ptprobabilities are derived from transform block size, plane type (luma vs. chroma), and transform type. - Extra Bits (
eob_extra): If the bucket defined byeob_ptcontains more than one possible index, explicit offset bits are read to resolve the exact index within that range.
Decoding Trailing Zeros
Once the decoder reconstructs the exact EOB index:
- Implicit Zeros: All positions from index
EOBup to the total block capacity (\(N \times M\) coefficients) are automatically set to zero without reading any entropy-coded data from the bitstream. - Active Decoding: The decoder processes only the
coefficients located from index
0up toEOB - 1.
AV1 decodes these active coefficients in reverse scan order (from
EOB - 1 down to 0). Because the coefficient at
EOB - 1 is guaranteed to be non-zero by definition, the
codec saves additional signaling overhead by bypassing the zero/non-zero
classification flag for that specific terminal position.
Compression Efficiency
In medium to high quantization scenarios, trailing zeros frequently constitute over 80% of a transform block's coefficients. By encapsulating these redundant values into a single parameterized EOB symbol, AV1 minimizes bitstream overhead and reduces the computational complexity required to parse sparse frequency blocks.