A video sequence may be coded in Frame mode only, with no special coding of fields or interlaced video, or in Frame/Field mode, using special coding tools for interlaced video. If frame/field coding is enabled, each frame of video, a pair of fields, may be coded as a complete frame, i.e. one picture = one frame, or as two separate fields, i.e. one picture = one field. The syntax element field_pic_flag in Slice Header indicates whether the current coded picture is a frame or a field. This gives rise to the following two cases:
- Picture is coded as a complete frame: The complete frame include two fields. A frame is coded as one or more slices, each containing an integral number of macroblocks. Reference picture list(s), used for motion compensated prediction of P– or B-macroblocks, are constructed from previously coded frames. Macroblocks are optionally coded as macroblock pairs in Macroblock Adaptive Frame Field Mode.
- Picture contains one field: The current top or bottom field is coded as one or more slices, each containing a number of macroblocks. Reference picture list(s) are constructed from previously coded fields, i.e. each reference picture is a coded field.
Picture Adaptive Frame Field Coding
An encoder may choose to switch adaptively between frame and field coding during a sequence. For example to improve the compression performance for interlaced video or for progressive video that was converted from an interlaced source. For an interlaced video sequence, field coding tends to be more efficient when there is significant motion in the scene which tends to give larger changes between successive fields. Whereas frame coding tends to be more efficient in more static areas of the scene where there is less change between successive fields. Switching between frame and field coding at the picture level is known as Picture Adaptive Frame Field Coding (PAFF).
Macroblock Adaptive Frame Field Coding
Macroblock Adaptive Frame Field Coding (MBAFF) is a coding mode that is enabled in the Sequence Parameter Set. It is available thereafter in any slice coded in Frame mode. MBAFF makes it possible to adaptively switch between frame and field coding within a single frame. Macroblocks are handled in pairs consisting of two vertically adjacent macroblocks (as shown in below figure). For each macroblock pair, mb_field_decoding_flag indicates whether the pair is coded as a frame macroblock pair or a field macroblock pair. If it is a frame MB pair, then the top and bottom macroblocks are coded separately as frame macroblocks. If it is a field MB pair, alternate lines of the MB pair are mapped to top and bottom field macroblocks as shown in the figure.