Intra-Prediction Modes: VP9 vs HEVC vs AV1 in AVIF
This article examines the technical differences in intra-prediction techniques between VP9, High Efficiency Video Coding (HEVC), and AOMedia Video 1 (AV1)—the codec powering the AVIF still-image format. It details how the progression from VP9's basic spatial tools and HEVC's 35-mode structure to AV1's 56 directional modes, recursive filtering, and cross-channel modeling drives AVIF’s superior still-image compression efficiency.
Overview of Intra-Prediction in Image Formats
Intra-prediction reconstructs image blocks using previously decoded neighboring boundary pixels within the same frame. While VP9 provided foundational intra-coding for WebM and HEVC formed the basis for Apple's HEIC format, AV1’s intra-prediction toolset defines the performance of the AVIF image standard. With each generation, codecs have increased angular granularity, added complex non-directional spatial predictors, and developed cross-plane correlation tools.
Directional Prediction Granularity
The primary differentiator between these codecs is the number and precision of directional (angular) prediction modes used to trace straight edges.
- VP9: Features eight directional modes alongside two non-directional modes, totaling 10 intra-prediction modes. The directional angles (D45, D135, D117, D153, D207, and D63) cover only coarse spatial trajectories, often failing to accurately align with subtle gradients or diagonal edges.
- HEVC: Expands directional modeling significantly by providing 33 angular modes, plus DC and Planar modes, for a total of 35 modes. This denser angular sampling allows HEVC to capture lines and edges far more precisely than VP9, reducing residual energy sent to the transform stage.
- AV1 (AVIF): Employs eight nominal directional modes, but introduces an angular delta mechanism. Each nominal angle can be fine-tuned with offsets ranging from -3 to +3 in increments of roughly 3 degrees. This system yields 56 directional modes, allowing AVIF to align with fine contours and organic curves that neither VP9 nor HEVC can match without spending bits on high-frequency transform residuals.
Non-Directional and Complex Spatial Tools
Natural images contain smooth gradients, textures, and diffuse lighting that directional prediction cannot cleanly represent.
- VP9: Utilizes a standard DC mode (averaging neighboring pixels) and a legacy TrueMotion (TM) mode, which extrapolates boundary differences across the block.
- HEVC: Replaces legacy approaches with a sophisticated Planar mode alongside DC mode. Planar prediction calculates a bi-linear surface using four corner references, virtually eliminating boundary blocking artifacts in smooth gradients (like skies or skin tones).
- AV1 (AVIF): Significantly expands non-directional
modeling:
- Smooth Modes: Provides three distinct smooth predictors: standard Smooth, Smooth Horizontal (Smooth-H), and Smooth Vertical (Smooth-V), which apply directional weights to linear interpolations.
- Recursive Filter Intra Prediction: Defines five pre-trained recursive filtering modes that treat neighboring pixels as input to a 2D filter, creating complex spatial patterns and multi-directional textures within the block.
- Palette Mode: Treats a block as an indexed color map (up to 8 colors per plane), making it exceptionally efficient for computer graphics, text, and flat-color illustrations in AVIF files.
Chroma from Luma (CfL) Prediction
A fundamental architectural leap in AV1 compared to both VP9 and HEVC is cross-component spatial prediction.
- VP9 and HEVC: Predict chroma components (Cb and Cr) largely independent of reconstructed luma data. While HEVC allows chroma blocks to inherit the prediction mode selected by the corresponding luma block (Derived Mode), the actual predicted pixel values are calculated entirely from neighboring chroma boundary pixels.
- AV1 (AVIF): Implements Chroma from Luma (CfL). Because the human visual system is sensitive to luma details and color boundaries strictly follow luminance edges, CfL models chroma pixels as a linear transformation of the reconstructed luma plane (\(Chroma = \alpha \times Luma + DC\)). This eliminates redundant edge-coding in chroma planes and accounts for a significant portion of AVIF's compression advantage over HEIC and VP9-based formats.
Block Partitioning Flexibility
Intra-prediction capabilities are constrained by the underlying block sizes permitted for spatial analysis.
- VP9: Supports square partitions from 64x64 down to 4x4, with limited rectangular splits (e.g., 1:2 and 2:1 ratios).
- HEVC: Operates within a Quadtree structure from 64x64 Coding Tree Units (CTUs) down to 8x8 Coding Units, running intra transforms at block sizes from 32x32 down to 4x4.
- AV1 (AVIF): Employs 128x128 Superblocks and a 10-way partition tree. AV1 allows intra-prediction across square blocks, 1:2/2:1 rectangles, and extreme 1:4/4:1 aspect ratio blocks ranging from 4x4 up to 64x64. This enables AVIF to isolate long, narrow image features (such as horizons or architectural lines) inside specialized prediction blocks that require fewer boundary signaling bits.