Inferensys

Glossary

Motion Vectors

Motion vectors are per-pixel 2D vectors that describe the screen-space motion of objects between two consecutive frames, essential for temporal effects like TAA and frame interpolation.
Engineer reviewing vector database search results on laptop, embeddings visualization on screen, home office coding session.
COMPUTER VISION & GRAPHICS

What are Motion Vectors?

Motion vectors are a fundamental data structure in video processing and real-time rendering, providing a per-pixel description of object movement between frames.

Motion vectors are per-pixel 2D displacement vectors that describe the screen-space movement of scene elements between two consecutive video frames or rendered images. They are a dense optical flow representation, typically calculated during rendering by comparing world-space positions or via specialized neural networks for video. These vectors are essential for temporal coherence, enabling algorithms to track objects over time rather than treating each frame in isolation. Their primary technical function is to establish correspondence between pixels across the temporal domain.

In real-time graphics, motion vectors are a critical input for Temporal Anti-Aliasing (TAA) and reprojection techniques, which reuse data from previous frames to reduce noise and aliasing. They are equally vital for frame interpolation (e.g., DLSS 3 Frame Generation) and temporal super-resolution, where they guide the warping and synthesis of new image data. For dynamic neural radiance fields, a deformation field often produces motion vectors to model non-rigid scene changes, linking traditional graphics pipelines with neural rendering methodologies.

COMPUTER VISION & GRAPHICS

Key Characteristics of Motion Vectors

Motion vectors are fundamental 2D data structures used in video processing and real-time rendering to describe pixel movement between frames, enabling advanced temporal effects.

01

Definition and Core Function

A motion vector is a per-pixel or per-block 2D displacement vector that quantifies the screen-space movement of scene content between two consecutive video frames or rendered images. It answers the question: "Where did this pixel come from in the previous frame?"

  • Primary Role: Enables temporal coherence by linking corresponding scene points across time.
  • Representation: Typically stored as a two-channel image (Δx, Δy) with sub-pixel precision.
  • Core Use: The foundational data for motion estimation, a key step in video compression (e.g., H.264/HEVC), Temporal Anti-Aliasing (TAA), and frame interpolation.
02

Generation: Block Matching vs. Optical Flow

Motion vectors are generated through algorithms that analyze frame pairs. The two primary methodologies are:

  • Block-Based Motion Estimation: Divides the current frame into macroblocks (e.g., 16x16 pixels). For each block, it searches the previous frame within a defined search window to find the most similar block, using metrics like Sum of Absolute Differences (SAD). This is the standard for video codecs.
  • Dense Optical Flow: Calculates a motion vector for every pixel by assuming brightness constancy and solving for pixel-wise motion, often using deep learning models like RAFT (Recurrent All-Pairs Field Transforms). This yields higher accuracy but is more computationally expensive.

Trade-off: Block matching is fast and hardware-friendly; optical flow is precise but slower.

03

Critical Role in Temporal Anti-Aliasing (TAA)

In real-time rendering, motion vectors are the most important input for Temporal Anti-Aliasing. TAA works by accumulating samples across multiple frames to smooth jagged edges.

  • Process: The current frame's color is blended with the reprojected color from the previous frame. Motion vectors tell the shader exactly how to reposition (reproject) each previous-frame pixel into the current frame's coordinate space.
  • Challenge: Must account for both camera motion and object motion. Incorrect vectors cause ghosting or smearing artifacts.
  • Implementation: The graphics pipeline (e.g., in Unity URP/HDRP or Unreal Engine) renders a dedicated motion vector pass alongside the color and depth passes.
04

Applications in Frame Interpolation & Super-Resolution

Motion vectors enable the synthesis of new, in-between visual data, powering two key upscaling techniques:

  • Frame Interpolation (e.g., DLSS 3 Frame Generation): To create a new Frame A→B, motion vectors are used to warp Frame A and Frame B toward the intermediate time step. A neural network then synthesizes the final interpolated frame, resolving disocclusions and complex motion.
  • Temporal Super-Resolution (e.g., DLSS 2, FSR 2, TAAU): Renders the scene at a lower internal resolution. Multiple consecutive low-res frames are aligned using their motion vectors and combined by a neural network or heuristic algorithm to reconstruct a high-resolution output. This provides a superior quality/performance trade-off than spatial upscaling alone.
05

Representation and Precision

The storage and precision of motion vectors are engineered for performance and quality.

  • Precision: Modern renderers use at least 16-bit floating-point (half-float) per channel to store sub-pixel motion. Integer pixel motion is insufficient for high-quality temporal accumulation.
  • Coordinate Spaces:
    • Screen-Space: Most common. Vectors are in 2D pixel/displacement units.
    • World-Space: Sometimes used for more stable reprojection under complex camera projection changes. Requires rendering a world-position buffer.
  • Velocity Buffer: In graphics APIs, the rendered motion vector output is typically called a velocity buffer. This buffer must be carefully managed to handle motion from skinned animation, particle systems, and camera jitter.
06

Limitations and Artifact Mitigation

Incorrect or missing motion vectors are a primary source of visual artifacts in temporal techniques.

  • Common Artifacts:
    • Ghosting: Trailing remnants of fast-moving objects caused by incorrect vector assignment or blending over disoccluded regions.
    • Motion Blur Mismatch: If object motion blur in the color buffer doesn't match the sharp vectors in the velocity buffer, smearing can occur.
    • Under/Overflow: Vectors pointing outside the screen bounds must be handled.
  • Mitigation Strategies:
    • Neighborhood Clamping: In TAA, the history sample is clamped to the color range of the current pixel's neighbors to reject outliers.
    • Vector Validation: Using depth and normal buffers to reject vectors that imply impossible scene motion (e.g., a vector connecting two unrelated surfaces).
    • Fallback Samples: Using spatial-only filtering when temporal data is deemed unreliable.
DEFINITIONS AND USE CASES

Motion Vectors vs. Related Motion Data

A comparison of per-pixel motion vectors with other forms of motion data used in computer vision, graphics, and neural rendering, highlighting their distinct representations, sources, and primary applications.

Feature / MetricMotion VectorsOptical FlowScene FlowDeformation Fields

Primary Definition

Per-pixel 2D vectors describing screen-space displacement between two consecutive video frames.

Dense per-pixel 2D vector field estimating apparent motion between two images, often from a computer vision algorithm.

3D vector field describing the motion of points in world space between two time steps, combining geometry and 2D motion.

A continuous function (often neural) that maps 3D points from a canonical space to deformed positions at a given time.

Dimensionality & Domain

2D; Screen/Pixel Space

2D; Image Plane

3D; World/Scene Space

3D; World/Canonical Space

Primary Data Source

Calculated by video codec (e.g., H.264) or graphics engine during rasterization.

Estimated from raw pixel intensities using algorithms (e.g., Lucas-Kanade, RAFT, FlowNet).

Fused from depth maps, camera poses, and 2D optical flow or motion vectors.

Optimized from multi-view video or 4D capture data using a neural network.

Relation to 3D Geometry

Implied but indirect; derived from projected 3D motion and camera movement.

Purely 2D; can result from camera motion, object motion, or a combination (aperture problem).

Explicit; requires known 3D geometry (e.g., point cloud, mesh) at each time step.

Explicit; defines non-rigid transformations applied to an underlying 3D representation.

Key Use Cases in Rendering

Temporal Anti-Aliasing (TAA), frame interpolation (DLSS 3 Frame Gen), motion blur.

Video stabilization, video frame interpolation, action recognition, object tracking.

Dynamic 3D scene reconstruction, 4D capture, autonomous vehicle perception.

Animating dynamic neural radiance fields (DyNeRF), modeling soft-body or non-rigid motion.

Real-Time Generation

Accuracy for Reprojection

High for rigid, rasterized geometry; can fail for disocclusions and transparent objects.

Varies; can be noisy, especially in textureless regions or with complex motion.

Theoretically high if geometry is accurate; computationally expensive to compute.

High within the trained sequence; generalizes poorly to unseen motions without retraining.

Storage/Transmission

Extremely compact; integral part of standard video compression codecs.

Large; stored as separate per-frame vector fields, not typically compressed.

Very large; requires dense 3D geometry per frame or a time-varying model.

Compact; represented by the weights of a neural network after training.

MOTION VECTORS

Frequently Asked Questions

Motion vectors are a fundamental data structure in real-time graphics and neural rendering, describing per-pixel screen-space motion between frames. This FAQ addresses their core mechanics, applications, and integration within modern rendering pipelines.

A motion vector is a per-pixel 2D vector that describes the displacement of a surface point from one video frame to the next in screen-space coordinates. It works by being computed during the geometry rendering pass. For each pixel, the GPU calculates the world-space position of the visible surface in the current frame and then projects that same 3D point into the previous frame's camera view. The difference between the current pixel coordinate and this reprojected coordinate is the motion vector. This calculation requires knowledge of the previous frame's view-projection matrix and is typically stored in a dedicated render target (e.g., an RG16F texture) for use in subsequent post-processing passes.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.