How AV1 Intrablock Copy Compresses AVIF Patterns
This article explains the Intrablock Copy (IBC) mode used in the AV1 video codec and its still-image derivative, AVIF. It covers the technical mechanics of how IBC repurposes motion compensation within a single frame, why this approach is critical for compressing repeating patterns and screen content, and the resulting efficiency gains for web graphics and typography.
What is Intrablock Copy (IBC)?
Traditional intra-frame prediction relies on directional extrapolation, where an encoder predicts the contents of a block using the reconstructed boundary pixels of immediately adjacent neighbor blocks. While this works well for continuous photographic gradients, it struggles with sharp, distinct, and spatially separated duplicates across an image.
Intrablock Copy (IBC)—often referred to as Intra Block Copy or Current Picture Referencing—bridges the gap between intra-frame coding and inter-frame motion estimation. Originally standardized for screen content coding, IBC allows a block within a single frame to be predicted directly from previously decoded pixels located elsewhere in that exact same frame.
Instead of generating a prediction from adjacent borders, the encoder uses a two-dimensional displacement vector, known as a Block Vector (BV). This vector points to an already reconstructed reference block within the image buffer, functioning identically to motion compensation in video, but restricted to the boundaries of the current image.
How IBC Handles Repeating Patterns in AVIF
The AVIF image format stores still images as AV1 intra-frames (keyframes). When an AVIF image contains repetitive elements—such as UI components, digital illustrations, fonts, icons, or repeating geometric patterns—IBC provides high-density data reduction through the following process:
1. Pattern Matching via Block Vectors
When the encoder evaluates a block, it scans previously reconstructed areas of the image to locate an identical or closely matching pixel structure. If a match is found, the encoder does not re-encode the pixel data. Instead, it records a Block Vector that specifies the horizontal and vertical offset to the matching source block.
2. Residual Data Minimization
If the target pattern perfectly matches the referenced block (common in synthetic graphics, text, and flat design), the prediction error—known as the residual—is zero. The encoder only needs to write the Block Vector into the bitstream, skipping transform and quantization stages entirely for that block. If the pattern differs slightly (such as a repeating element under a slight lighting variance), only the minimal residual difference between the two blocks is transformed and stored.
3. Vector Prediction and Entropy Coding
Block Vectors themselves are compressed. AV1 maintains a history of recently used Block Vectors, allowing subsequent vectors pointing to the same relative distance to be coded using small difference values (delta vectors). This makes repeating sequences of icons or text characters exceptionally lightweight in the final file.
Why IBC Outperforms Standard Intra Prediction
Standard intra prediction cannot model non-local redundancy. If an icon appears in the top-left corner and again in the bottom-right corner, standard intra coding must encode both instances independently from scratch.
With IBC enabled, AVIF achieves:
- Massive Bitrate Reductions in Screen Content: Repeated glyphs, UI elements, and tiled textures require only a few bytes of vector data rather than full spatial representations.
- Sharp Edge Preservation: Traditional spatial transforms often blur high-contrast edges or introduce ringing artifacts around text at lower bitrates. IBC copies reconstructed pixels directly, maintaining pixel-perfect edges without ringing.
- Optimized Storage for Mixed Media: In graphics that combine photographic backgrounds with repeated vector-like overlays, AV1 dynamically switches between standard directional intra modes for the photos and IBC for the repeating graphic elements.