6.2.1 Start codes
Start codes are specific bit patterns that do not otherwise occur in the video stream.
Each start code consists of a start code prefix followed by a start code value. The start code prefix is a string of twenty three bits with the value zero followed by a single bit with the value one. The start code prefix is thus the bit string ‘0000 0000 0000 0000 0000 0001’.
The start code value is an eight bit integer which identifies the type of start code. Most types of start code have just one start code value. However slice_start_code is represented by many start code values, in this case the start code value is the slice_vertical_position for the slice.
All start codes shall be byte aligned. This shall be achieved by inserting bits with the value zero before the start code prefix such that the first bit of the start code prefix is the first (most significant) bit of a byte.
Table 6-1 defines the slice start code values for the start codes used in the video bitstream.
Table 6-1 — Start code values
name
|
start code value
(hexadecimal)
|
picture_start_code
|
00
|
slice_start_code
|
01 through AF
|
reserved
|
B0
|
system start codes (see note)
|
B9 through FF
|
NOTE - system start codes are defined in Part 1 of this specification
|
|
The use of the start codes is defined in the following syntax description with the exception of the sequence_error_code. The sequence_error_code has been allocated for use by a media interface to indicate where uncorrectable errors have been detected.
6.2.2 Video Sequence
video_sequence() {
|
No. of bits
|
Mnemonic
|
next_start_code()
|
|
|
sequence_extension()
|
|
|
}
|
|
|
} while ( nextbits() != sequence_end_code )
|
|
|
} else {
|
|
|
/* ISO/IEC 11172-2 */
|
|
|
}
|
|
|
sequence_header() {
|
No. of bits
|
Mnemonic
|
sequence_header_code
|
32
|
bslbf
|
non_intra_quantiser_matrix[64]
|
8*64
|
uimsbf
|
}
|
|
|
6.2.2.2 Extension and user data
extension_and_user_data( i ) {
|
No. of bits
|
Mnemonic
|
while ( ( nextbits()== extension_start_code ) ||
|
|
|
}
|
|
|
extension_data( i ) {
|
No. of bits
|
Mnemonic
|
while ( nextbits()== extension_start_code ) {
|
|
|
}
|
|
|
6.2.2.2.2 User data
user_data() {
|
No. of bits
|
Mnemonic
|
user_data_start_code
|
32
|
bslbf
|
}
|
|
|
sequence_extension() {
|
No. of bits
|
Mnemonic
|
extension_start_code
|
32
|
bslbf
|
}
|
|
|
6.2.2.4 Sequence display extension
sequence_display_extension() {
|
No. of bits
|
Mnemonic
|
extension_start_code_identifier
|
4
|
uimsbf
|
}
|
|
|
sequence_scalable_extension() {
|
No. of bits
|
Mnemonic
|
extension_start_code_identifier
|
4
|
uimsbf
|
}
|
|
|
6.2.2.6 Group of pictures header
group_of_pictures_header() {
|
No. of bits
|
Mnemonic
|
group_start_code
|
32
|
bslbf
|
}
|
|
|
picture_header() {
|
No. of bits
|
Mnemonic
|
picture_start_code
|
32
|
bslbf
|
}
|
|
|
6.2.3.1 Picture coding extension
picture_coding_extension() {
|
No . of bits
|
Mnemonic
|
extension_start_code
|
32
|
bslbf
|
chroma_420_type
|
1
|
uimsbf
|
}
|
|
|
quant_matrix_extension() {
|
No. of bits
|
Mnemonic
|
extension_start_code_identifier
|
4
|
uimsbf
|
}
|
|
|
6.2.3.3 Picture display extension
picture_display_extension() {
|
No. of bits
|
Mnemonic
|
extension_start_code_identifier
|
4
|
uimsbf
|
}
|
|
|
picture_temporal_scalable_extension() {
|
No. of bits
|
Mnemonic
|
extension_start_code_identifier
|
4
|
uimsbf
|
}
|
|
|
6.2.3.5 Picture spatial scalable extension
picture_spatial_scalable_extension() {
|
No. of bits
|
Mnemonic
|
extension_start_code_identifier
|
4
|
uimsbf
|
}
|
|
|
copyright_extension() {
|
No. of bits
|
Mnemonic
|
extension_start_code_identifier
|
4
|
uimsbf
|
}
|
|
|
6.2.3.7 Picture data
picture_data() {
|
No. of bits
|
Mnemonic
|
do {
|
|
|
}
|
|
|
6.2.4 Slice
slice() {
|
No. of bits
|
Mnemonic
|
slice_start_code
|
32
|
bslbf
|
macroblock()
|
|
|
}
|
|
|
6.2.5 Macroblock
macroblock() {
|
No. of bits
|
Mnemonic
|
while ( nextbits() == ‘0000 0001 000’ )
|
|
|
}
|
|
|
macroblock_modes() {
|
No. of bits
|
Mnemonic
|
macroblock_type
|
1-9
|
vlclbf
|
}
|
|
|
6.2.5.2 Motion vectors
motion_vectors ( s ) {
|
No. of bits
|
Mnemonic
|
if ( motion_vector_count == 1 ) {
|
|
|
}
|
|
|
motion_vector ( r, s ) {
|
No. of bits
|
Mnemonic
|
motion_code[r][s][0]
|
1-11
|
vlclbf
|
}
|
|
|
6.2.5.3 Coded block pattern
coded_block_pattern () {
|
No. of bits
|
Mnemonic
|
coded_block_pattern_420
|
3-9
|
vlclbf
|
}
|
|
| 6.2.6 Block
The detailed syntax for the terms “First DCT coefficient”, “Subsequent DCT coefficient” and “End of Block” is fully described in 7.2.
This clause does not adequately document the block layer syntax when data partitioning is used. See 7.10.
block( i ) {
|
No. of bits
|
Mnemonic
|
if ( pattern_code[i] ) {
|
|
|
}
|
|
|
|