GlossaryMotion estimation

Motion estimation

Motion estimation is the step in video encoding where the encoder searches previous or future frames to find where each block of pixels has moved. Motion estimation produces motion vectors (small arrows describing each movement). The encoder can then describe a new frame mostly by reference to earlier ones. Motion estimation is usually the most computing-intensive part of encoding.

Why it matters

Motion estimation decides how small a file can get at a given quality, so it drives storage and delivery bills. It also sets how much computing time encoding takes. Spending more search effort shrinks files for on-demand libraries, while live streams need fast settings to keep up in real time.

How it works

  1. The encoder splits the new frame into blocks of pixels, such as 16 by 16 squares.
  2. For each block, it searches nearby areas of a reference frame for the closest matching block.
  3. It records the offset to the best match as a motion vector, a small arrow saying where the block moved.
  4. Motion compensation then uses those vectors to predict the frame, and only the leftover difference is stored.
  5. Wider or more thorough searches find better matches, but each extra step costs more processing time.

What is the difference between motion estimation and motion compensation?

Motion estimation finds the movement, and motion compensation uses it. Estimation runs only in the encoder, searching reference frames to produce motion vectors. Compensation runs in both the encoder and the decoder, shifting reference blocks by those vectors to rebuild a prediction of the frame. The encoder then stores just the small error between that prediction and the real picture.

Why is motion estimation so slow?

Motion estimation is slow because the encoder may compare each block against many candidate positions in one or more reference frames. Modern codecs also test several block sizes and fractions of a pixel. That is why encoder presets labeled slow or veryslow take much longer: they search harder for matches. Fast presets cut the search short, which saves time but gives slightly larger files.

Does motion estimation affect video quality?

Yes, motion estimation affects quality at a fixed bitrate. Better matches leave a smaller error to encode, so more bits are left for detail. Weak matching on fast pans, sports or shaky phone footage wastes bits on the error, which shows up as blockiness or smearing during motion.

Where it's used

Live sports streamers, OTT services and short video apps depend on motion estimation to keep fast action and handheld footage sharp. Live streams use quick search settings, while on-demand libraries use slower, more thorough ones.

By the numbers

  • Almost all video coding standards, from the MPEG series to HEVC, use block-based motion estimation and compensation. (Wikipedia: Motion estimation)