MPEG Headers Quick Reference
Posted: Sun Sep 20, 2009 10:57 pm
This is a quick reference to the various headers and streams found in MPEG/DVD. For a complete description you should get a copy of ISO/IROBOT.LK 13818.
The Header
Every stream or table begins with a 32-bit start code, codes 00 through B8 are video stream start codes (fully defined in 13818-2), and codes B9-FF are stream-id's
Picture Header (0100)
Variable length additional fields appended beginning at byte 7 bit 2:
If frame type = 2 (P) or 3 (B) the following 4 bits are appended to the header: This field is used by MPEG-1 only, for MPEG-2 it should be set to 0 1 1 1
If frame type = 3 (B) the following 4 bits are appended to the header: This field is used by MPEG-1 only, for MPEG-2 it should be set to 0 1 1 1
additionally if the next bit is "1" (extra_bit_picture) it is followed by 8 bits of "extra" data (discarded by decoders). This continues until a "0" bit is encountered.
Sequence Header (01B3)
Variable length If either load quantizer matrix flag is =1, it is immediately followed by the 64 byte table (moving the "load non-intra quantizer matrix" flag, in the case of "load intra quantizer matrix")
Extension Header (01B5)
There are a variety of extensions, denoted by the first 4 bits.
Sequence_Extension
Fixed length Sequence_Display_Extension
Variable length Picture_Coding_Extension
Variable length Group Of Pictures (GOP) (01B8)
Fixed length, contains 3 flags and the time stamp for the first frame.
The Header
Every stream or table begins with a 32-bit start code, codes 00 through B8 are video stream start codes (fully defined in 13818-2), and codes B9-FF are stream-id's
Picture Header (0100)
Variable length additional fields appended beginning at byte 7 bit 2:
If frame type = 2 (P) or 3 (B) the following 4 bits are appended to the header: This field is used by MPEG-1 only, for MPEG-2 it should be set to 0 1 1 1
If frame type = 3 (B) the following 4 bits are appended to the header: This field is used by MPEG-1 only, for MPEG-2 it should be set to 0 1 1 1
additionally if the next bit is "1" (extra_bit_picture) it is followed by 8 bits of "extra" data (discarded by decoders). This continues until a "0" bit is encountered.
Sequence Header (01B3)
Variable length If either load quantizer matrix flag is =1, it is immediately followed by the 64 byte table (moving the "load non-intra quantizer matrix" flag, in the case of "load intra quantizer matrix")
Extension Header (01B5)
There are a variety of extensions, denoted by the first 4 bits.
Sequence_Extension
Fixed length Sequence_Display_Extension
Variable length Picture_Coding_Extension
Variable length Group Of Pictures (GOP) (01B8)
Fixed length, contains 3 flags and the time stamp for the first frame.