A sequence parameter set, NAL unit type 7, holds the settings for a whole coded video
sequence. The fields are bit-packed, so they have no fixed offsets; the
coding column shows how each is
read. A file can hold up to 32 sets, numbered by seq_parameter_set_id.
Fields
| Name | Coding | Condition | Description |
|---|---|---|---|
profile_idc | u(8) | the profile | |
constraint_set0_flag … constraint_set5_flag | u(1) × 6 | narrow the profile, see constraint flags | |
reserved_zero_2bits | u(2) | 0 | |
level_idc | u(8) | the level × 10 | |
seq_parameter_set_id | ue(v) | 0 to 31 | |
chroma_format_idc | ue(v) | high profiles | see chroma formats; 1 (4:2:0) when absent |
separate_colour_plane_flag | u(1) | chroma_format_idc is 3 | 1 means the three planes are coded separately |
bit_depth_luma_minus8 | ue(v) | high profiles | luma bit depth minus 8, 0 to 6 |
bit_depth_chroma_minus8 | ue(v) | high profiles | chroma bit depth minus 8, 0 to 6 |
qpprime_y_zero_transform_bypass_flag | u(1) | high profiles | 1 allows lossless transform bypass at QP′ = 0 |
seq_scaling_matrix_present_flag | u(1) | high profiles | 1 means scaling lists follow |
seq_scaling_list_present_flag[i], scaling list | u(1) | the flag above is 1 | for i below 8, or below 12 when chroma_format_idc is 3 |
log2_max_frame_num_minus4 | ue(v) | 0 to 12: frame_num has this + 4 bits | |
pic_order_cnt_type | ue(v) | 0 to 2, see picture order count | |
log2_max_pic_order_cnt_lsb_minus4 | ue(v) | type 0 | 0 to 12 |
delta_pic_order_always_zero_flag | u(1) | type 1 | |
offset_for_non_ref_pic | se(v) | type 1 | |
offset_for_top_to_bottom_field | se(v) | type 1 | |
num_ref_frames_in_pic_order_cnt_cycle | ue(v) | type 1 | 0 to 255 |
offset_for_ref_frame[i] | se(v) | type 1, repeated | |
max_num_ref_frames | ue(v) | 0 to 16 | |
gaps_in_frame_num_value_allowed_flag | u(1) | ||
pic_width_in_mbs_minus1 | ue(v) | width in macroblocks, minus 1 | |
pic_height_in_map_units_minus1 | ue(v) | height in slice-group map units, minus 1 | |
frame_mbs_only_flag | u(1) | 1 means progressive frames only | |
mb_adaptive_frame_field_flag | u(1) | frame_mbs_only_flag is 0 | 1 enables MBAFF |
direct_8x8_inference_flag | u(1) | ||
frame_cropping_flag | u(1) | 1 means the four offsets follow | |
frame_crop_left_offset, …right…, …top…, …bottom… | ue(v) × 4 | flag is 1 | see picture size |
vui_parameters_present_flag | u(1) | 1 means VUI parameters follow | |
rbsp_trailing_bits | see the byte stream page |
The high profile fields appear when profile_idc is 100, 110, 122, 244,
44, 83, 86, 118, 128 or 138.
Chroma formats
chroma_format_idc | Format |
|---|---|
| 0 | monochrome |
| 1 | 4:2:0 |
| 2 | 4:2:2 |
| 3 | 4:4:4 |
Scaling lists
Lists 0 to 5 are 4 × 4 lists of 16 entries; the rest are 8 × 8 lists of 64 entries. Each is coded as a run of differences:
| Name | Coding | Description |
|---|---|---|
delta_scale | se(v) | −128 to +127. The value is next = (last + delta_scale + 256) mod 256. A value of 0 stops the list early, and remaining entries repeat the last value |
Picture order count
pic_order_cnt_type | Method |
|---|---|
| 0 | each slice header carries pic_order_cnt_lsb, and an optional delta for the bottom field |
| 1 | order is calculated from frame_num and a repeating cycle of offsets; slices may carry deltas |
| 2 | display order is the same as decoding order; B pictures are not possible |
Picture size
Width = (pic_width_in_mbs_minus1 + 1) × 16
Height = (2 − frame_mbs_only_flag) × (pic_height_in_map_units_minus1 + 1) × 16
Cropping subtracts from these. Each offset is in crop units: 1 for monochrome or for
4:4:4 with separate planes, otherwise the chroma subsampling factor, and vertical
offsets are doubled when frame_mbs_only_flag is 0. So for 4:2:0:
Width −= 2 × (left + right)
Height −= 2 × (2 − frame_mbs_only_flag) × (top + bottom)
A 1920 × 1080 progressive 4:2:0 stream has 120 macroblocks across and 68 down, a coded size of 1920 × 1088, and a bottom crop offset of 4.
SPS extension
NAL unit type 13 gives alpha plane information for auxiliary coded pictures:
| Name | Coding | Condition | Description |
|---|---|---|---|
seq_parameter_set_id | ue(v) | the SPS this extends | |
aux_format_idc | ue(v) | 0 to 3; 0 means no auxiliary pictures | |
bit_depth_aux_minus8 | ue(v) | above not 0 | 0 to 4 |
alpha_incr_flag | u(1) | above not 0 | |
alpha_opaque_value | u(v) | above not 0 | bit_depth_aux_minus8 + 9 bits |
alpha_transparent_value | u(v) | above not 0 | same width |
additional_extension_flag | u(1) |
Subset SPS units (type 15) for SVC and MVC, and their further extensions, are not documented here; they could not be confirmed from a public source.