AV1 Segments for Localized Parameter Adaptation
This article provides an overview of the segmentation capabilities in the AV1 video codec, focusing on the maximum number of unique segments supported per frame for localized parameter adaptation. It explains the technical limits defined by the AV1 specification, the specific encoding parameters that can be adjusted on a per-segment basis, and the practical benefits segmentation offers for video compression efficiency and visual quality.
Maximum Number of Segments in AV1
Under the AV1 specification, a single frame can support up to 8 unique segments (indexed from 0 to 7) for localized parameter adaptation.
Segmentation allows the encoder to partition a frame into distinct regions and apply custom coding parameters to each region, rather than relying strictly on global, frame-level settings. Every block within the frame can be assigned to one of these eight segment IDs via a segmentation map.
Parameters Controlled Per Segment
Each of the 8 segments can independently enable or disable specific features and apply relative or absolute parameter offsets. The primary parameters governed by AV1 segmentation include:
- Quantization Offsets (ALT_Q): Applies an alternate quantizer index to individual segments. This allows higher fidelity (lower quantization) on critical areas and heavier compression on less important background areas.
- Loop Filter Strength: Adjusts the deblocking loop filter level per segment, preventing over-smoothing in sharp, high-detail regions or reducing blocking artifacts in flat regions.
- Reference Frame Selection: Restricts or biases motion prediction to specific reference frames for blocks belonging to a given segment.
- Skip Mode: Forces blocks within a segment to skip transform coding and residual signaling, which is useful for static backgrounds or uniform areas.
- Global Motion/In-Loop Processing: Influences how specific in-loop restoration and motion vector predictions are handled across different spatial regions.
How AV1 Signals Segmentation
The segmentation framework in AV1 operates through two primary components:
- Segment Feature Data: Defined in the frame header, this data specifies which features are active across the segments and sets the quantitative values (such as delta values for quantization or loop filter levels) for each active segment ID.
- Segmentation Map: Assigns each coding unit (down to the block level) to one of the 8 segment IDs. AV1 can transmit an entirely new map, update the map differentially, or reuse the segmentation map from a previous reference frame to conserve bitrate.
Practical Applications
Supporting up to 8 unique segments allows AV1 encoders to implement advanced optimizations, including:
- Region of Interest (ROI) Encoding: Prioritizing faces or text by assigning them to lower-quantization segments while allocating fewer bits to peripheral areas.
- Background Subtraction: Flagging static background elements for skip modes and reduced filtering.
- Temporal Consistency: Carrying segment structures across frames to prevent flickering and maintain uniform quality across successive scenes.