The basic transform process of H.264/AVC is based on the 16×16 pixel luma macroblock (MB). The luma macroblock is divided into 4×4 blocks, each block consists of 4×4 pixels. Each block is transformed using an integer DCT (also called an integer cosine transform – ICT), then scaled and quantized to produce a 4×4 bock of quantized transform coefficients. The coefficient blocks are coded and transmitted. The order of block coding within the macroblock is shown in Fig. 1.
For the integer DCT transform encoding process, each block is transformed by the following matrix:
If the macroblock is predicted using 16×16 intra prediction, a second stage transform is applied to only the DC coefficients. From each integer DCT block of the macroblock, the DC coefficient is extracted. The coefficients from all blocks form a 4×4 matrix. The Hadamard transform is applied to the DC matrix:
For the high profile, an optional 8×8 transform may be enabled for macroblocks that are coded using 8×8 intra prediction or any inter prediction. The 16×16 macroblock is split into 2×2 blocks, where each block size is 8×8 pixels. Then transformed coefficients are scaled, quantized and transmitted. The 8×8 ICT matrix is:
The size of chroma macroblocks may be different from luma macroblocks depending on the color space used. For 4:0:0, each 8×8 Cr and Cb chroma macroblock corresponds to a 16×16 luma macroblock. For 4:2:2, each 8×16 Cr and Cb chroma macroblock corresponds to a 16×16 luma macroblock. For 4:4:4, each 16×16 Cr and Cb chroma macroblock corresponds to a 16×16 luma macroblock.