How Smooth Mode Works in AV1 Intra Coding
This article provides an overview of the Smooth intra prediction modes in the AV1 video codec, explaining how they overcome the limitations of traditional directional and DC modes. You will learn the mechanics behind these predictors, how they utilize adjacent boundary samples to calculate gradual gradients, the differences between the three distinct smooth modes, and why this technique significantly improves coding efficiency for continuous-tone content.
Understanding Intra Prediction in AV1
In video compression, intra prediction predicts the pixels of a target block using previously reconstructed boundary samples from adjacent blocks (primarily from the top and left). While directional modes project boundary pixels across a block at specific angles and DC modes fill a block with a uniform average value, natural video often contains smooth gradients—such as skies, shadows, and subtle lighting changes—that neither method can represent efficiently.
To solve this, the Alliance for Open Media (AOMedia) implemented Smooth Prediction modes (sometimes categorized in research as paired predictors) in AV1.
The Mechanics of Smooth Prediction
Smooth prediction builds a continuous two-dimensional surface over the block by interpolating between opposite edges.
Standard directional modes only propagate boundary information from one direction (e.g., from top to bottom). In contrast, AV1’s smooth predictor pairs a real boundary sample on one side with an estimated boundary sample on the opposite side, interpolating values between them using distance-based weighting.
The algorithm relies on:
- Top Boundary: Reconstructed samples directly above the block.
- Left Boundary: Reconstructed samples directly to the left of the block.
- Bottom-Left Sample: The bottom-most pixel of the reconstructed left boundary, used as an anchor for vertical interpolation.
- Top-Right Sample: The right-most pixel of the reconstructed top boundary, used as an anchor for horizontal interpolation.
The Three Smooth Prediction Modes
AV1 defines three specialized variants of the smooth prediction mode:
1. Smooth Vertical
(SMOOTH_V_PRED)
SMOOTH_V_PRED models vertical gradients. For any pixel
\((x, y)\) inside a block:
- The predictor pairs the reconstructed top boundary pixel directly above column \(x\) with the bottom-most pixel of the left boundary.
- A distance-weighted interpolation is applied between these two values: the weight of the top pixel decreases as the vertical distance \(y\) increases, while the weight of the bottom-left anchor pixel increases.
2. Smooth Horizontal
(SMOOTH_H_PRED)
SMOOTH_H_PRED models horizontal gradients. For any pixel
\((x, y)\):
- The predictor pairs the reconstructed left boundary pixel directly beside row \(y\) with the right-most pixel of the top boundary.
- A distance-weighted interpolation is applied between these two values: the weight of the left pixel decreases as the horizontal distance \(x\) increases, while the weight of the top-right anchor pixel increases.
3. Smooth Bidirectional
(SMOOTH_PRED)
The generalized SMOOTH_PRED mode combines vertical and
horizontal components. It calculates both the vertical smooth prediction
and the horizontal smooth prediction for pixel \((x, y)\) and blends them together:
- The weights assigned to the vertical and horizontal predictions depend on the relative distances to the respective edges.
- This produces a curved, bilinear-like surface that smoothly connects all available boundaries without creating sharp, artificial boundaries within the predicted block.
Weighting Tables and Computational Efficiency
To avoid complex run-time divisions during hardware decoding, AV1 utilizes precomputed lookup tables for weights. These weights follow a quadratic-like decay curve rather than a purely linear slope. This non-linear interpolation accounts for human visual perception, which is more sensitive to banding artifacts near block edges, ensuring that the transition between adjacent blocks remains visually seamless.
Coding Benefits
By pairing boundary pixels to model continuous changes across a block, AV1’s smooth predictors significantly reduce the prediction error (residual energy) in regions with soft gradients. This reduces the bit cost required to encode residual transform coefficients, preventing contouring artifacts and providing superior compression performance over legacy planar modes.