AI Glossary / Computer vision and multimodal AI / Intermediate
Motion coding
Definition
Motion coding is the representation of motion-related information in a compressed video stream so that a decoder can predict image content from reference pictures. It can include motion vectors, reference choices, and other prediction parameters. In object-based video discussions, the term also covers extending motion-compensated coding to video objects whose shapes are not restricted to full rectangular frames.
What it means
Successive video pictures often contain much of the same visual content in different positions. Instead of independently encoding every pixel again, an encoder can describe a useful correspondence with previously decoded content and encode what that prediction fails to explain.
Motion coding is therefore about efficient representation, not necessarily accurate physical movement measurement. The chosen vector may be the one that saves bits for an acceptable reconstruction, even if it does not follow a real object perfectly. Motion information is one component of the bitstream; texture residuals, modes, and other information are also needed.
How it works
The encoder searches for prediction candidates in available reference pictures. It chooses a prediction mode and motion representation while balancing reconstruction error against the number of bits required. Motion parameters may themselves be predicted from nearby information, with only their differences coded.
The decoder reconstructs the prediction from the signaled or derived information and combines it with the decoded residual. In object-based approaches, shape information identifies the relevant region, and prediction must handle boundaries as well as interior content. Exact syntax and available tools depend on the codec and profile. A standard can define what a decoder must do without prescribing one particular encoder search algorithm.
Three practical examples
1. A streaming encoder represents a panning scene using motion-compensated predictions. It still needs residual information where detail changes, appears, or cannot be predicted accurately.
2. A video-conferencing system balances motion-search complexity against latency and bandwidth. A more expensive search is useful only if its savings justify the delay and computation.
3. An object-based coding experiment treats a foreground region separately from its background. The object's shape and motion representation must remain consistent for correct reconstruction.
Think of it this way
Think of updating a slide by saying “reuse this rectangle from the previous slide, shifted slightly,” then listing the remaining corrections. The instruction can be shorter than describing the entire new slide. However, reusing a similar-looking rectangle does not prove it represents the same physical object. Video motion coding exploits predictive usefulness in a comparable way, using precisely defined codec rules.
Worked example
Suppose a current four-sample block is [52, 61, 69, 80]. A shifted reference block predicts [50, 60, 70, 80]. The residual, current minus prediction, is [2, 1, −1, 0]. A decoder with the same predictor and an exactly represented residual reconstructs the original values by addition.
Now suppose the motion vector is (5, −2), while a vector predictor already available to the decoder is (4, −2). The vector difference is only (1, 0). Coding a small difference can be efficient when the bitstream's coding scheme favors such values, although the exact bit saving depends on that scheme.
If the residual is quantized, reconstruction may no longer be exact. If a different motion vector makes the residual slightly larger but costs fewer bits to signal, the encoder may prefer it. This demonstrates why the best coding decision is not necessarily the smallest raw prediction error or the most physically accurate motion estimate.
Illustrative case study
Fictional case: A training-video provider compares encoder settings on recordings of a presenter walking in front of detailed slides. One setting spends more time searching for motion matches but gives little benefit during abrupt slide changes. Another uses less computation but loses detail around moving hands at the selected bitrate.
The team evaluates complete decoded sequences, encoding time, and delivery constraints rather than counting motion vectors alone. It includes both slow movement and sudden content changes in the comparison. The final settings reflect the intended viewing conditions; no universal bitrate saving is inferred from one demonstration clip.
Common misconceptions and mistakes
Motion coding is not motion capture, and a codec's vectors are not automatically suitable as ground-truth optical flow. Blocks can contain several objects, and an encoder can choose references or modes for compression reasons rather than physical correspondence.
Do not assume that every predicted picture depends only on the immediately preceding displayed frame. Reference structures vary. Also distinguish encoding motion parameters from coding the residual image: good motion prediction can reduce residual complexity, but both contribute to total bitrate. Arbitrary-shape object coding is a particular context, not a feature that every video format or profile necessarily supports.
Business use
Understanding motion coding helps teams interpret encoder tradeoffs in streaming, conferencing, video storage, and visual analytics. It explains why a sequence's movement, texture, noise, and scene changes can affect the bandwidth required for a chosen quality level.
Compare total bitrate and decoded quality under representative conditions. Include encode and decode costs, latency, random-access needs, and compatibility. When reusing compressed-domain motion information for AI, validate it for the downstream task instead of treating it as a faithful motion measurement. Record codec settings and reference structure so comparisons remain reproducible.
People also ask
Does motion coding eliminate the need to send image differences?
Usually not. Residuals account for what the motion-based prediction does not reproduce.
Must the encoder find the true object movement?
No. It seeks a useful coding decision under its rate and quality objective.
Is one motion-estimation search required by every conforming encoder?
No. Standards commonly specify the decodable representation while allowing different encoder strategies.
Check your understanding
A vector gives the lowest prediction error but needs many extra bits to signal. Must an encoder choose it?
Answer: No. A rate-distortion decision considers both reconstruction quality and coding cost, so another candidate may be preferable overall.
Related terms
- Motion estimation
- Motion compensation
- Motion vector
- inter prediction
- residual coding
- rate-distortion optimization
- reference picture
- video object plane
Learn next
For a short synthetic sequence, compare an unchanged-block predictor with a shifted-block predictor. Calculate the residuals, then account separately for the cost of signaling motion. Explain why reduced residual magnitude is useful but insufficient to establish the total compressed size.
More in Computer vision and multimodal AI
- Morphological image processing - Morphological image processing is a family of operations that analyzes or changes image structures using a small reference shape called a structuring element.
- Motion analysis - Motion analysis is the study of movement over time using observations such as video frames, tracked points, or sensor measurements.
- Motion capture - Motion capture is the recording of a person's or object's movement as digital motion data.
- Motion field - A motion field is a spatial collection of motion vectors.
- Motion-JPEG - Motion-JPEG, often written MJPEG or M-JPEG, represents video as a sequence of separately JPEG-compressed images.
- Moving least squares (MLS) deformation - Moving least squares (MLS) deformation is a way to warp an image or shape from a set of control handles.
Sources
Primary sources: ITU-T H.264 (08/2021), introductory inter-prediction discussion, https://www.itu.int/rec/dologin_pub.asp?id=T-REC-H.264-202108-S!!PDF-E&lang=e&type=items ; MPEG historical MPEG-4 Video overview, https://mpeg.chiariglione.org/standards/mpeg-4/video.html . Relevant returned material on motion-vector differences, residuals, and arbitrary-shaped video objects was reviewed. The numerical block example is original.
Previous: Motion capture Next: Motion compensation