Maximum Reference Frames for Animated AVIF

This article examines the structural limits of reference frames in animated AVIF images. Because animated AVIF files are built on top of the AV1 video coding format wrapped within the ISO Base Media File Format (ISOBMFF), their temporal prediction capabilities strictly mirror the AV1 specification. Readers will learn the precise maximum number of reference frames maintained in memory, the active reference limits per frame, and how these parameters govern frame prediction across animation sequences.

AV1 Architecture and the Reference Buffer Limit

Animated AVIF files do not define their own independent video compression scheme; instead, they encapsulate an AV1 bitstream as an image sequence track. Consequently, the maximum number of reference frames an animated AVIF can utilize across sequence items is governed entirely by the AV1 Decoded Picture Buffer (DPB).

Under the AV1 specification, the Decoded Picture Buffer maintains a fixed pool size defined by the constant NUM_REF_FRAMES, which is set to 8. This means an animated AVIF decoder can store a maximum of 8 distinct reference frames in memory at any point in the playback sequence.

Maximum References Per Single Frame

While 8 frame slots exist in the decoded buffer pool, AV1 allows an inter-coded frame to reference up to 7 of those frames for prediction:

Although a sequence can update, shift, and refresh which images occupy the 8 buffer slots using reference frame update flags, no individual inter-frame can draw from more than 7 directional references simultaneously.

Sequence Mechanics in Animated AVIF

Across the lifetime of an animated AVIF sequence, reference frame management functions as follows:

  1. Intra Frames (Keyframes): Sequence items flagged as keyframes decode independently of prior frames and reset or selectively update the 8 buffer slots.
  2. Inter Frames: Subsequent animation frames reference up to 7 previously decoded frames currently resident within the 8 DPB slots.
  3. Buffer Slot Updates: The encoder chooses which of the 8 slots to overwrite with newly decoded frames using a bitmask. This allows non-consecutive frames (such as static background elements in a looping animation) to persist across hundreds of frames without being discarded.

In summary, an animated AVIF can retain at most 8 reference frames simultaneously within its sequence buffer, drawing from a maximum of 7 active reference frames to predict any given frame.