Expand description
GPU-accelerated motion estimation for AV1 and VP9 video codecs.
This module provides compute-shader-based motion estimation pipelines suitable for AV1 and VP9 intra/inter frame encoding. The GPU kernels exploit massively parallel block matching to evaluate Sum of Absolute Differences (SAD) and Sum of Squared Differences (SSD) across many candidate motion vectors simultaneously.
§Architecture
The pipeline is divided into three GPU dispatch stages:
- Hierarchical downscale – build a Gaussian pyramid (up to 4 levels) so that large motion is found at low resolution first.
- Block-match sweep – for every block in the current frame, evaluate all candidate motion vectors within the search window using parallel SAD/SSD kernels dispatched with workgroup-local shared memory (reducing global-memory bandwidth by ~8×).
- Refinement – perform ±1 / ±½ pixel sub-pixel refinement around the best integer candidate found in stage 2.
§Status
The GPU shader dispatch plumbing is present but the WGSL shaders for AV1/VP9-specific block partitions (superblock, transform units, etc.) are stubs. The CPU reference path is fully functional and used for testing / CI.
Structs§
- Block
MvResult - Motion estimation result for a single block.
- Frame
MvResult - Full-frame motion estimation result.
- Motion
Estimation Config - Configuration for a motion-estimation pass.
- Motion
Estimator - GPU-accelerated motion estimator.
- Motion
Vector - A 2-D integer motion vector (pixel precision).
- Subpixel
Mv - A 2-D sub-pixel motion vector (1/4-pixel precision, values are in units of 1/4 pixel).
Enums§
- Block
Partition - Block partition mode used during motion search.
- Motion
Metric - Cost metric for evaluating motion-vector candidates.
- Target
Codec - Codec the motion-estimation result will be used for.