Skip to content
KinPilot™Learn & Explore
Menu

Grades 9–12 · Computing

How can a video reuse an earlier picture?

Successive video pictures often contain much of the same scene. Instead of independently describing every picture, a video encoder can reuse parts of a picture the decoder already knows. Motion-compensated prediction identifies reference samples that resemble a block in the current picture.

D36 visual explanationA known reference row supplies four predicted samples starting at offset +1. The current samples minus prediction form a signed residual; adding it back reconstructs the current samples exactly. No entropy coding, quantization or compression ratio is modeled.Reuse a prediction, then add the differenceReference row already known to the decoder102030405060Prediction20304050Current20304150Residual0010Rebuilt20304150Offset +1Exact residual; no quantization or bitrate estimate

In the diagramReuse a prediction, then add the differenceReference row already known to the decoder102030405060PredictionCurrent41Residual01RebuiltOffset +1Exact residual; no quantization or bitrate estimate

Offset +1 predicts [20,30,40,50]; adding the exact residual [0,0,1,0] reconstructs [20,30,41,50].

The reference must be the reconstructed version also available to the decoder, not an unavailable original. In the tiny example, the known reference row is [10,20,30,40,50,60]. The current four-sample block is [20,30,41,50]. Starting one sample to the right of the reference row's beginning gives a prediction of [20,30,40,50]. This offset is the example's motion information.

Subtracting prediction from current samples gives the residual [0,0,1,0]. A decoder obtains the same prediction from the reference and offset, then adds the transmitted residual. The result is exactly [20,30,41,50]. The one-sample difference has not been guessed away.

A good prediction can produce a residual with many zeros or small values, which later coding stages may represent economically. But the motion information also costs bits. A smaller residual does not, by itself, prove that a complete file is smaller.

Real video codecs search over blocks, references and motion choices; many also transform and quantize residuals, trading exactness for lower bitrate. Our arithmetic leaves residuals unchanged so the reconstruction principle is visible. A motion vector is a useful correspondence between image regions, not a guarantee that a physical object really moved by that amount.

About this explanation

Starting knowledge: Read pixel sample values, indexed arrays, signed differences and vector offsets.

Sources

  • Vcodex — H.264/AVC Inter Prediction
← Grades 9–12 topics