MPEG Video Compression Standard

Figure 10.25 gives pseudocode for the block(i) function. The block(i) function only codes coefficients for blocks with pattern_code [i] nonzero. If the block is intra coded (determined by macroblock_intra set to one), then for the first four macroblocks ( i less than 4) the number of bits needed to code the luminance DC coefficient, dct_dc_size_luminance, is coded using Table 10.24. If the number of bits is greater than zero, the dct_dc_differential is sent with that many bits. For chrominance blocks the number of bits needed to code the chrominance DC coefficient, dct_dc_size_ chrominance, is coded using Table 10.25. If dct_dct_size_chrominance is nonzero, that many bits is used to code dct_dc_differential.
block(i) { /* from IS0 13818--2 6.2.6 */ if (pattern_coded[i]) { /* if ith block coded */ if (macroblock_intra) { /* if intra-coded */ ...