The images are segmented in macroblocks, which comprise six
pel blocks,
four for Y values and one for each of their respective Cr, Cb values.
There are two types of frames in H.261. The first frame and specific frames in
the sequence inserted for stability and resynchronisation, are encoded
independent of their adjacent frames, i.e. intra-coded. All the other
frames are inter-coded, that is, they are predicted using motion compensation
from the previous frame.
Intra coding is DCT transformation of the
blocks of luminance and
chrominance values, quantisation, and run-length encoding of the coefficients.
An inverse quantisation and decoding procedure is also performed, in order to
provide a local copy of the non-identical reconstructed image. The latter is
used as a reference for prediction, rather than the original input. Therefore,
for
error-free transmission, the same prediction will be formed to the decoder and
the encoder.
Inter coding applies block matching to the
luminance values of
each macroblock, and determines the respective motion vectors, which are
differentially encoded and transmitted. The motion compensation procedure is
performed locally in order to calculate the prediction error, which, if above a
threshold, is DCT encoded and transmitted. If the prediction error is very high,
the motion vectors are ignored, and the corresponding macroblock is intra-coded.
As in intra-frames, the new reference for prediction is the locally
reconstructed motion
compensated frame, which is stored in a buffer for this task. Inter coding
achieves much higher compression efficiency than intra coding, in other words,
the quality of inter-coded pictures is much better than that of intra-coded, for
the same number of bits.
The resulting bitstream has a hierarchical structure. Blocks of variable length coded coefficients are collected together to form macroblocks, which are collected to form Group of Blocks (GOB), and a complete frame is made up of several GOB, see also Figure 2.5.
It is worth mentioning that the output bitrate of H.261 is variable, depending highly on the amount of motion in the encoded scene. As H.261 is using ISDN connections, which are constant bit rate, there is a rate control mechanism used, which changes the quantisation parameters when buffer overflows due to increased scene activity are imminent [RR96].