Image Processing Reference
Macroblocks duplicated between frames
Figure 10-20 Macroblock motion compensation.
similar. Then only the residual changes need to be stored. Macroblocks that are offset by
some distance other than an integer multiple of the size of a macroblock are also candi-
dates for this technique. Imagine an object moving through the scene (see Figure 10-20).
Pixels that cover the area of the moving object should appear elsewhere in the image
but located in a spatially different position. This relocation is very unlikely to coincide
with macroblock boundaries and therefore will not be spotted by the earlier identical-mac-
Describing our macroblock in terms of a previous image with some sub-macroblock
movement should improve the compression if the extra deductive logic is implemented in
the encoder. The accuracy of this depends on the codec. The most modern codecs support
In the sequence of images shown in Figure 10-21 a car is moving through the scene.
In the I-frame it is not there at all and in the P-frame it is partway across. The intervening
frames gradually reveal more of the car.
The macroblocks in the P-frame that describe the car are already available when all
the B-frames are being constructed. So those parts of the B-frame images that contain parts
of the car will be taken from the P-frame while the background macroblocks will come
from the I-frame. The background blocks in the P-frame will have also come from the
I-frame originally. Figure 10-22 shows how the B-frame is composed from I- and P-based
macroblocks. Motion vectors are applied in order to move the contents of the macroblocks
by some small increment. Any residual errors that must be corrected are all that is coded
So our macroblock might be reduced to a reference to another macroblock-sized area
in an image, plus a vector that indicates the movement necessary to reconstruct it after
which any residual errors are corrected. Properly encoding the residuals leads to better