www.vcodex.com H.264 / MPEG-4 Part 10 : Intra Prediction
© Iain E G Richardson 30/04/03 Page 1 of 6
H.264 / MPEG-4 Part 10 White Paper
Revised April 03
Prediction of Intra Macroblocks
1. Introduction
The Joint Video Team (JVT) of ISO/IEC MPEG and ITU-T VCEG are finalising a new standard for
the coding (compression) of natural video images. The new standard [1,2] will be known as H.264 and
also MPEG-4 Part 10, “Advanced Video Coding”. This document describes the methods of predicting
intra-coded macroblocks in an H.264 CODEC.
If a block or macroblock is encoded in intra mode, a prediction block is formed based on previously
encoded and reconstructed (but un-filtered) blocks. This prediction block P is subtracted from the
current block prior to encoding. For the luminance (luma) samples, P may be formed for each 4x4 sub-
block or for a 16x16 macroblock. There are a total of 9 optional prediction modes for each 4x4 luma
block; 4 optional modes for a 16x16 luma block; and one mode that is always applied to each 4x4
chroma block.
2. 4x4 luma prediction modes
Figure 1 shows a luminance macroblock in a QCIF frame and a 4x4 luma block that is required to be
predicted. The samples above and to the left have previously been encoded and reconstructed and are
therefore available in the encoder and decoder to form a prediction reference. The prediction block P
is calculated based on the samples labelled A-M in Figure 2, as follows. Note that in some cases, not
all of the samples A-M are available within the current slice: in order to preserve independent
decoding of slices, only samples within the current slice are available for prediction. DC prediction
(mode 0) is modified depending on which samples A-M are available; the other modes (1-8) may only
be used if all of the required prediction samples are available (except that, if E, F, G and H are not
available, their value is copied from sample D).
The arrows in Figure 3 indicate the direction of prediction in each mode. For modes 3-8, the predicted
samples are formed from a weighted average of the prediction samples A-Q. The encoder may select
the prediction mode for each block that minimizes the residual between P and the block to be encoded.