Databases Reference
In-Depth Information
F I GU R E 19 . 2
Difference between the two frames.
In order to use a previous frame to predict the pixel values in the frame being encoded,
we have to take the motion of objects in the image into account. Although a number of
approaches have been investigated, the method that has worked best in practice is a simple
approach called block-based motion compensation . In this approach, the frame being encoded
is divided into blocks of size M
×
M . For each block, we search the previous reconstructed
frame for the block of size M
M that most closely matches the block being encoded. We
can measure the closeness of a match, or distance, between two blocks by the sum of absolute
differences between corresponding pixels in the two blocks. We would obtain the same results
if we used the sum of squared differences between the corresponding pixels as a measure
of distance. Generally, if the distance from the block being encoded to the closest block
in the previous reconstructed frame is greater than some prespecified threshold, the block is
declared uncompensable and is encoded without the benefit of prediction. This decision is
also transmitted to the receiver. If the distance is below the threshold, then a motion vector is
transmitted to the receiver. The motion vector is the relative location of the block to be used for
prediction obtained by subtracting the coordinates of the upper-left corner pixel of the block
being encoded from the coordinates of the upper-left corner pixel of the block being used for
prediction.
Suppose the block being encoded is an 8
×
8 block between pixel locations (24, 40) and
(31, 47); that is, the upper-left corner pixel of the 8
×
8 block is at location (24, 40). If the
block that best matches it in the previous frame is located between pixels at location (21, 43)
and (28, 50), then the motion vector would be (
×
3, 3). The motion vector was obtained by
subtracting the location of the upper-left corner of the block being encoded from the location
of the upper-left corner of the best matching block. Note that the blocks are numbered starting
from the top-left corner. Therefore, a positive x component means that the best matching block
in the previous frame is to the right of the location of the block being encoded. Similarly, a
positive y component means that the best matching block is at a location below that of the
location of the block being encoded.
Search WWH ::




Custom Search