AV1 Spatial Motion Vector Prediction Explained
This article explores how the AOMedia Video 1 (AV1) video codec optimizes compression efficiency through advanced motion vector prediction, focusing specifically on spatial motion vector candidates. By analyzing the motion trajectories of previously encoded neighboring blocks within the same frame, AV1 accurately predicts the motion of the current block. This process minimizes the amount of motion data that must be explicitly signaled in the bitstream, leading to superior coding efficiency compared to predecessor codecs.
The Role of Spatial Candidates in Motion Vector Prediction
In inter-frame video coding, transmitting full motion vectors for every block consumes a substantial portion of the overall bitrate. AV1 mitigates this overhead by relying on motion vector prediction (MVP), which calculates a predicted motion vector (PV) and transmits only the difference (motion vector difference, or MVD) between the actual vector and the predicted vector. In cases where the prediction is exact, no difference data is sent at all.
Spatial motion vector candidates are derived from adjacent, previously decoded blocks within the current picture. Because physical objects typically span multiple blocks, adjacent blocks frequently share identical or highly correlated motion paths, making spatial neighbors ideal candidate sources.
Neighboring Block Scanning and Selection
AV1 defines a comprehensive set of spatial neighbor locations to evaluate for motion information. When constructing the candidate list for a target block, the encoder and decoder check specific adjacent positions:
- Left columns: The blocks directly adjacent to the left edge of the current block, including the bottom-left neighbor.
- Top rows: The blocks directly adjacent to the top edge of the current block, including the top-right neighbor.
- Corner positions: The top-left diagonal neighbor.
AV1 evaluates these neighboring blocks in a strictly defined order. The scanning process traverses the boundary blocks, extracting their reference frames and associated motion vectors to populate a dynamic motion vector candidate pool.
Candidate Sorting and Filtering
Not all spatial neighbors provide equally useful predictions. AV1 applies specialized logic to sort, filter, and prioritize spatial candidates:
- Reference Picture Matching: AV1 heavily prioritizes spatial neighbors that reference the exact same picture (or pair of pictures in compound prediction) as the current block. Vectors pointing to matching reference frames are placed at the top of the candidate list.
- Motion Vector Scaling: If a neighboring block uses a different reference frame, its motion vector can be scaled based on the temporal distance between the current frame and the respective reference frames.
- Deduplication: Redundant motion vectors are pruned from the candidate list. If two neighboring blocks yield identical motion trajectories, only one instance is retained to preserve indexing efficiency.
- Compound Motion Handling: For compound prediction—where a block uses two reference frames—AV1 identifies spatial neighbors that also utilize compound prediction, combining their vector pairs into unified compound candidates.
Integration into AV1 Motion Modes
Once the spatial candidates are collected and sorted, they directly inform AV1's motion vector modes:
- NEARESTMV: Selects the highest-priority candidate from the list, typically representing the most immediate and relevant spatial neighbor, requiring minimal signaling overhead.
- NEARMV: Allows the encoder to select secondary or tertiary candidates from the sorted candidate list when the primary candidate is not optimal.
- NEWMV: Uses a candidate from the list as a baseline predictor, signaling an explicit motion vector difference to refine the final motion trajectory.
By structuring spatial motion vector candidate derivation into an ordered, deduplicated, and reference-aware pipeline, AV1 extracts maximum predictive accuracy from spatial correlations, significantly driving down the bitrate required for motion representation.