Maximum Reference Frames in AV1 Codec
This article provides a concise overview of the reference frame architecture in the AV1 video codec. It details the exact limits on reference frames an inter frame can access, explains how the reference buffer pool operates, and highlights how AV1 handles frame-level versus block-level motion compensation.
In the AV1 video specification, an inter frame can access a maximum of 7 reference frames for inter-prediction. While the decoder maintains a Decoded Picture Buffer (DPB) holding up to 8 candidate frames at any given time, an individual inter frame selects and maps up to 7 of those stored frames to active reference slots.
The 8-Frame Reference Buffer Pool
AV1 decoders maintain an internal pool of 8 frame buffers. As new frames are decoded, the bitstream indicates which buffer slots should be refreshed and updated. This pool acts as a library of past and future (temporally reordered) decoded pictures that future frames can draw upon.
The 7 Active Reference Frame Slots
When encoding or decoding a specific inter frame, up to 7 distinct reference frames can be actively assigned from the 8-frame buffer pool. These 7 references are categorized directionally into past and future references to optimize motion estimation:
- Past References (4 frames):
LAST_FRAME,LAST2_FRAME,LAST3_FRAME, andGOLDEN_FRAME. - Future/Backward References (3 frames):
BWDREF_FRAME,ALTREF2_FRAME, andALTREF_FRAME.
By allowing up to 7 active reference frames, AV1 significantly expands upon VP9 (which supported only 3 reference frames: Last, Golden, and AltRef). This expansion allows AV1 to achieve much higher compression efficiency, particularly in scenes with complex motion, occlusions, and repetitive background elements.
Block-Level Prediction Limits
Although a frame can reference up to 7 different frames across its entire surface, individual blocks within the frame are subject to narrower limits:
- Single Prediction (Uni-prediction): An individual block predicts motion from 1 of the 7 available reference frames.
- Compound Prediction (Bi-prediction): An individual block combines prediction data from 2 different reference frames simultaneously.
In compound mode, the encoder selects valid combinations (such as one past frame and one future frame, or two past frames) to synthesize a more accurate prediction block, reducing residual data.
In summary, while individual coding blocks utilize at most 2 reference frames for compound prediction, the inter frame as a whole can access up to 7 active reference frames selected from the decoder's 8-frame buffer pool.