Transforms in AVIF Intra-Prediction
This article provides a concise technical overview of the transforms utilized during the intra-prediction stage of an AVIF (AV1 Image File Format) encode. Because AVIF is derived from the AV1 video standard, it relies on AV1's prediction and transform pipelines. Below, we break down the directional modeling, intra-specific prediction transforms, and the primary 2D separable frequency transforms applied to intra-coded residual blocks.
Predictive Modeling Transforms
Before residual transform coding takes place, AVIF applies mathematical operations to reconstruct boundary pixels and synthesize the predicted block.
- Filter Intra Predictors: AV1 includes a "Filter Intra" mode that applies an implicit matrix-based transform. It passes boundary samples through a series of recursive 7-tap filtering transforms, acting as a small neural-like linear filter bank to generate smooth gradient predictions across the block.
- Chroma from Luma (CfL): For color channels, AVIF utilizes a linear model transform (\(y = \alpha \cdot x + \beta\)) that projects reconstructed luma samples directly into the chroma plane to predict color details from luminance edges.
- Directional Subpixel Interpolation: For directional angles (ranging between 45 and 207 degrees), 2-tap bilinear or multi-tap interpolation transforms project boundary pixels along fractional angle vectors.
Primary Residual Transforms
Once the intra-prediction phase estimates the image block, the predicted values are subtracted from the source pixels to produce an intra-residual signal. This residual is then mapped to the frequency domain using 2D separable transforms consisting of vertical and horizontal 1D basis functions.
AVIF uses three core transform families for intra-residual blocks:
Discrete Cosine Transform (DCT):
- Primarily based on DCT-II and DCT-4/DCT-8 formulations.
- Best suited for residuals where signal boundaries exhibit symmetric or evenly distributed error variance.
Asymmetric Discrete Sine Transform (ADST):
- Based on DST-VII (and its reversed counterpart, FLIPADST).
- Why it matters for Intra-prediction: In intra coding, reference pixels are taken from the top and left boundaries. Consequently, the prediction residual tends to have near-zero error close to those boundaries and higher error variance further away. The ADST enforces a zero-boundary condition at the known reference edge, making it mathematically superior to the DCT for modeling directional intra residuals.
Identity Transform (IDTX):
- Passes the spatial residual directly to the quantizer without frequency-domain projection in one or both directions.
- Useful for sharp synthetic edges, text, or screen content where frequency transforms cause ringing artifacts.
2D Transform Combinations
AVIF combines these 1D horizontal (\(H\)) and vertical (\(V\)) transforms into 16 possible combinations for intra-residual blocks, sized from \(4\times4\) up to \(64\times64\):
- DCT / DCT: Standard bidirectional energy compaction.
- ADST / DCT & DCT / ADST: Combines directional decay in one direction with symmetric compaction in the other.
- ADST / ADST: Handles intra residuals expanding out from top-left reconstructed boundaries.
- FLIPADST Combinations: (FLIPADST/DCT, DCT/FLIPADST, FLIPADST/FLIPADST, ADST/FLIPADST) Designed for prediction modes anchored at right or bottom boundaries.
- 1D Transform Hybrids: 1D DCT or ADST applied strictly in one direction paired with an Identity transform in the orthogonal direction (e.g., \(V\_DCT\), \(H\_ADST\)) to capture strictly horizontal or vertical stripe patterns.