Below the sequence level a stream is organised into optional groups of pictures, then pictures, then slices. All fields are big-endian bit fields, straight after the start code.
Group of pictures header
Start code 00 00 01 B8. It is optional in MPEG-2.
| Bits | Name | Description |
|---|---|---|
| 1 | drop_frame_flag | part of the time code: 1 for NTSC drop-frame counting |
| 5 | hours | 0 to 23 |
| 6 | minutes | 0 to 59 |
| 1 | marker_bit | 1 |
| 6 | seconds | 0 to 59 |
| 6 | pictures | the frame number within the second, 0 to 59 |
| 1 | closed_gop | 1 if the first B pictures use only references inside this group |
| 1 | broken_link | 1 if the first B pictures cannot be decoded after an edit |
The time code is the 25 bits from drop_frame_flag to pictures. The header
ends with 5 zero bits to reach a byte boundary, so it takes 8 bytes including the start
code.
Picture header
Start code 00 00 01 00.
| Bits | Name | Condition | Description |
|---|---|---|---|
| 10 | temporal_reference | the display position of this picture within its group, modulo 1024 | |
| 3 | picture_coding_type | see below | |
| 16 | vbv_delay | the buffer delay in 90 kHz ticks; 0xFFFF means variable | |
| 1 | full_pel_forward_vector | type 2 or 3 | MPEG-1: 1 if forward vectors are in whole pixels. MPEG-2: 0 |
| 3 | forward_f_code | type 2 or 3 | MPEG-1: forward vector range. MPEG-2: 7, unused |
| 1 | full_pel_backward_vector | type 3 | as for forward |
| 3 | backward_f_code | type 3 | as for forward |
| 1 | extra_bit_picture | if 1, followed by 8 bits of extra_information_picture and another flag, repeating |
| Code | Picture type |
|---|---|
| 0 | forbidden |
| 1 | I, intra coded |
| 2 | P, predicted from an earlier picture |
| 3 | B, predicted from earlier and later pictures |
| 4 | D, DC coefficients only (MPEG-1) |
| 5–7 | reserved |
In MPEG-2 a picture coding extension follows every picture header and holds the real motion vector ranges.
Slice header
Start codes 00 00 01 01 to 00 00 01 AF. The last byte gives
the row of the slice, with 1 for the top row of macroblocks, unless the height is over
2800.
| Bits | Name | Condition | Description |
|---|---|---|---|
| 3 | slice_vertical_position_extension | height over 2800 | high bits of the row number |
| 7 | priority_breakpoint | data partitioning | |
| 5 | quantiser_scale_code | the quantiser for this slice | |
| 1 | slice_extension_flag | 1 means the next three fields follow | |
| 1 | intra_slice | extension flag 1 | 1 if every macroblock in the slice is intra |
| 1 | slice_picture_id_enable | extension flag 1 | |
| 6 | slice_picture_id | extension flag 1 | |
| 1 | extra_bit_slice | if 1, followed by 8 bits of extra_information_slice and another flag, repeating |
The macroblock data follows, running to the next start code. It uses variable-length codes and is not described field by field here.