AV1 Dynamic Resolution Switching Dependencies
AV1 features native internal resolution switching, also known as dynamic resolution switching or reference frame scaling, allowing the encoder to alter the spatial resolution of a video stream without inserting a keyframe. This mechanism avoids the severe bitrate spikes associated with intra-only refresh points during bandwidth fluctuations. This article outlines the structural dependencies governing internal resolution switching in AV1, detailing how reference buffers, motion vectors, spatial resampling, and in-loop filtering interact when frame dimensions change.
Reference Frame Buffer Management
In traditional codecs, changing the frame resolution typically
requires an Instantaneous Decoder Refresh (IDR) frame, which clears the
Decoded Picture Buffer (DPB). AV1 avoids this by establishing
sequence-level maximum dimensions. The sequence header defines
max_frame_width_minus_1 and
max_frame_height_minus_1, prompting the decoder to allocate
memory capable of housing the maximum allowed dimensions across all
eight reference frame slots.
When a frame changes resolution, it does not evict existing reference frames or invalidate the buffer. An inter-frame can designate any of the active reference frames (such as LAST, BWDREF, or ALTREF) as prediction sources, regardless of whether their stored dimensions match the current frame's dimensions.
Normative Reference Scaling
When a dependency is established between a current frame and a reference frame of a different resolution, AV1 applies a normative scaling process:
- Scale Factors: Horizontal and vertical scale factors are calculated based on the ratio between the reference frame’s dimensions and the current frame’s dimensions using fixed-point arithmetic.
- Pixel Interpolation: AV1 uses normative 8-tap filtering to upscale or downscale reference picture sample blocks during motion compensation. The prediction is computed directly from the resampled reference samples.
Because the scaling is normative and integrated into the motion compensation pipeline, reference frames remain stored in their original decoded resolutions within the DPB rather than being globally resampled and re-buffered.
Motion Vector and Temporal Motion Field Scaling
Motion vector (MV) prediction relies heavily on spatial and temporal correlation. When resolution changes, standard pixel displacements between frames are no longer directly compatible, requiring mathematical transformation:
- Block Coordinate Mapping: Spatial coordinates in the current frame are mapped to the reference frame coordinate system using the scale factors before fetching prediction data.
- Motion Field Motion Vector (MFMV): AV1 uses temporal motion vector prediction, projecting motion vectors from previously decoded reference frames onto the current frame. When resolution switching occurs, the coordinates of the motion field and the vectors themselves are linearly scaled to align with the current frame's resolution grid.
- Precision Limits: Scaling is bounded by minimum and maximum scaling ratios (typically between 1/2 to 2x per step in standardized profiles) to maintain motion vector accuracy and limit interpolation filter degradation.
Entropy Contexts and Cumulative Distribution Functions (CDFs)
Resolution changes alter the block partitioning tree and the number of blocks within a frame. However, the probability models used for entropy coding—the Cumulative Distribution Functions (CDFs)—do not reset across resolution switches.
The frame header determines whether CDFs are inherited from a previous frame. If enabled, the current frame inherits the updated probability states from the designated reference frame, allowing the entropy engine to maintain compression efficiency despite the spatial grid structural shift.
Tile Grids and In-Loop Filters
Unlike reference frame resampling, which bridges two different dimensions, in-loop filters function entirely within the current frame's spatial domain:
- Tile Partitions: Tile boundaries and uniform/non-uniform grids are defined strictly by the current frame's dimensions. A change in resolution recalculates tile widths and heights.
- Deblocking and CDEF: The Deblocking Filter and Constrained Directional Enhancement Filter (CDEF) operate on the 8x8 and 64x64/32x32 block structures of the current frame, completely decoupled from the reference frame's past grid.
- Loop Restoration: The loop restoration grid (Wiener or Subspace filters) is laid out according to the current frame size, ensuring post-processing filtering operates without structural cross-resolution dependencies.