B-prediction

ISO/IEC MPEG-1 bi-directional prediction reproduced with the original np1/np2/np3 frames and faithful block-matching logic.

Sequence setup

Frames n−1, n, and n+1 act as the fixed reference inputs for the matching and residual workflow.

Prediction logic

  • Forward/Backward: Motion search compares the current frame against the previous or future frame to minimize the sum of absolute differences.
  • Bi-directional: A dual search selects the best block from either neighbor and marks whether the past (red) or future (blue) frame was chosen.
  • Entropy readout: Residual entropy follows the following: values are normalized to 256 bins across the −1…1 range.
Video sequence from provided frames
Frame n−1
Previous frame
Frame n
Current frame
Frame n+1
Next frame
Prediction error maps (block size 8×8, search range ±32 pixels)

Residuals follow the following block search with grayscale differences centered at 0 and remapped to 0…255 for display.

Bi-directional residual
Bi-directional residual
Entropy: bit/pixel
From previous frame
Forward residual
Entropy: bit/pixel
From subsequent frame
Backward residual
Entropy: bit/pixel
Residual histograms

Bins span 256 uniformly spaced levels between −1 and 1

Bi-directional
From previous
From subsequent
Reference support for each block

Blocks predicted from the previous frame are tinted warm; those matched to the subsequent frame are tinted cool.

Reference blend map
Block from previous frame
Block from subsequent frame