How AVIF Uses AV1 Intra-Frame Coding Tools

The AV1 Image File Format (AVIF) leverages the still-image capabilities of the open-source AV1 video codec by encapsulating its intra-frame coding toolset within the standardized HEIF (High Efficiency Image File Format) container. Rather than inventing a standalone compression scheme, AVIF treats a still image as an AV1 intra-frame (also known as a keyframe or I-frame), allowing it to inherit modern spatial compression algorithms that significantly outperform traditional formats like JPEG and WebP.

Intra-Frame Prediction

Intra-frame coding relies solely on spatial redundancy within a single image, without referencing past or future frames. AVIF inherits AV1's advanced spatial intra-prediction tools, which predict the content of a target block using previously decoded boundary pixels from adjacent blocks:

Flexible Block Partitioning

AVIF organizes image data using AV1's recursive block-partitioning tree. Images are divided into large base units called Superblocks—up to 128×128 pixels in size.

Each Superblock can be recursively subdivided down to blocks as small as 4×4 pixels. Unlike older codecs that rely primarily on square quad-tree divisions, AV1 supports horizontal and vertical splits (1:2, 2:1, 1:4, and 4:1 ratios). This structural flexibility allows AVIF to assign large blocks to uniform regions like clear skies, while isolating fine textures and sharp borders into tiny, localized partitions to prevent wasteful bit allocation.

Adaptive Transform Coding

Once prediction is complete, the remaining prediction error (residual) is converted from the spatial domain into the frequency domain:

Advanced In-Loop Filtering

To eliminate visual artifacts without blurring essential details, AVIF applies AV1's sequential three-stage in-loop restoration pipeline directly to the reconstructed image:

  1. Deblocking Filter: Smoothes unnatural step-edges that appear along block boundaries at lower bitrates.
  2. Constrained Directional Enhancement Filter (CDEF): Analyzes the dominant direction of edges within each block to suppress ringing artifacts and mosquito noise while sharpening primary boundaries.
  3. Loop Restoration: Employs separable Wiener filters and dual-subspace self-guided filters to reverse blur and restore high-frequency details across large image segments.

Film Grain Synthesis

High-frequency visual elements such as analog film grain or digital sensor noise typically require massive amounts of data to preserve. AVIF overcomes this using AV1's film grain synthesis tool. The encoder analyzes the grain, discards the raw noise, and transmits mathematical parameters describing its frequency and distribution. The decoder then reconstructs and overlays the synthetic grain onto the image during rendering, dramatically reducing file size while preserving photographic texture.