A sequence parameter set, NAL unit type 33, holds the settings for a coded video
sequence: picture size, chroma format, bit depth, block sizes and the coding tools that
are switched on. A stream can hold up to 16 sets, numbered by
sps_seq_parameter_set_id. The fields are bit-packed; the
coding column shows how each is
read.
Fields
| Name | Coding | Condition | Description |
|---|---|---|---|
sps_video_parameter_set_id | u(4) | the VPS it refers to | |
sps_max_sub_layers_minus1 | u(3) | temporal sub-layers, minus 1; 0 to 6, and no more than in the VPS | |
sps_temporal_id_nesting_flag | u(1) | as in the VPS; 1 when there is one sub-layer | |
profile_tier_level(1, sps_max_sub_layers_minus1) | the profile, tier and level | ||
sps_seq_parameter_set_id | ue(v) | 0 to 15 | |
chroma_format_idc | ue(v) | see chroma formats; 0 to 3 | |
separate_colour_plane_flag | u(1) | chroma_format_idc is 3 | 1: the three colour planes are coded as separate monochrome pictures |
pic_width_in_luma_samples | ue(v) | coded width; not 0, and a multiple of the minimum coding block size | |
pic_height_in_luma_samples | ue(v) | coded height; the same rule | |
conformance_window_flag | u(1) | 1 means the four cropping offsets follow | |
conf_win_left_offset, …right…, …top…, …bottom… | ue(v) × 4 | flag is 1 | output cropping, in chroma sample units; see picture size |
bit_depth_luma_minus8 | ue(v) | luma bit depth minus 8; 0 to 8 (8 to 16 bits) | |
bit_depth_chroma_minus8 | ue(v) | chroma bit depth minus 8; 0 to 8 | |
log2_max_pic_order_cnt_lsb_minus4 | ue(v) | 0 to 12: the slice header’s picture order count field has this + 4 bits | |
sps_sub_layer_ordering_info_present_flag | u(1) | 1: the next three fields per sub-layer; 0: only for the highest | |
sps_max_dec_pic_buffering_minus1[i] | ue(v) | per sub-layer | decoded picture buffer size in pictures, minus 1; below the level’s MaxDpbSize |
sps_max_num_reorder_pics[i] | ue(v) | per sub-layer | maximum reordering depth |
sps_max_latency_increase_plus1[i] | ue(v) | per sub-layer | 0: no latency limit; otherwise limit = reorder + this − 1 pictures |
log2_min_luma_coding_block_size_minus3 | ue(v) | smallest coding block: 8 × 8 when 0 | |
log2_diff_max_min_luma_coding_block_size | ue(v) | the coding tree block (CTB) is this many doublings larger | |
log2_min_luma_transform_block_size_minus2 | ue(v) | smallest transform: 4 × 4 when 0; must be smaller than the smallest coding block | |
log2_diff_max_min_luma_transform_block_size | ue(v) | largest transform; at most 32 × 32 and no larger than the CTB | |
max_transform_hierarchy_depth_inter | ue(v) | how many times an inter coding unit’s transform tree may split | |
max_transform_hierarchy_depth_intra | ue(v) | the same for intra coding units | |
scaling_list_enabled_flag | u(1) | 1: quantisation uses scaling lists | |
sps_scaling_list_data_present_flag | u(1) | scaling lists enabled | 1: scaling list data follows; 0: the default lists are used unless a PPS sends its own |
amp_enabled_flag | u(1) | 1 allows asymmetric motion partitions (2N×nU, 2N×nD, nL×2N, nR×2N) | |
sample_adaptive_offset_enabled_flag | u(1) | 1 allows the SAO filter after deblocking | |
pcm_enabled_flag | u(1) | 1 allows coding units of raw PCM samples | |
pcm_sample_bit_depth_luma_minus1 | u(4) | PCM | bits per PCM luma sample, minus 1; no more than the luma bit depth |
pcm_sample_bit_depth_chroma_minus1 | u(4) | PCM | bits per PCM chroma sample, minus 1 |
log2_min_pcm_luma_coding_block_size_minus3 | ue(v) | PCM | smallest PCM block |
log2_diff_max_min_pcm_luma_coding_block_size | ue(v) | PCM | largest PCM block, at most 32 × 32 |
pcm_loop_filter_disabled_flag | u(1) | PCM | 1: deblocking and SAO are not applied to PCM blocks |
num_short_term_ref_pic_sets | ue(v) | 0 to 64 | |
st_ref_pic_set(i) | repeated | see short-term reference picture sets | |
long_term_ref_pics_present_flag | u(1) | 1: long-term reference pictures may be used | |
num_long_term_ref_pics_sps | ue(v) | flag above is 1 | candidate long-term pictures listed here; 0 to 32 |
lt_ref_pic_poc_lsb_sps[i] | u(v) | repeated | picture order count LSBs of each candidate, log2_max_pic_order_cnt_lsb_minus4 + 4 bits |
used_by_curr_pic_lt_sps_flag[i] | u(1) | repeated | 1: the candidate is used for reference by the current picture |
sps_temporal_mvp_enabled_flag | u(1) | 1: slice headers may switch on temporal motion vector prediction | |
strong_intra_smoothing_enabled_flag | u(1) | 1: bilinear smoothing of reference samples may be used for 32 × 32 intra blocks | |
vui_parameters_present_flag | u(1) | 1: VUI parameters follow | |
sps_extension_present_flag | u(1) | 1: the next five fields follow | |
sps_range_extension_flag | u(1) | extension | 1: the range extension follows |
sps_multilayer_extension_flag | u(1) | extension | 1: sps_multilayer_extension() of Annex F follows (multi-layer streams) |
sps_3d_extension_flag | u(1) | extension | 1: sps_3d_extension() of Annex I follows (3D-HEVC) |
sps_scc_extension_flag | u(1) | extension | 1: the screen content coding extension follows |
sps_extension_4bits | u(4) | extension | 0 in current streams; otherwise sps_extension_data_flag bits follow, which decoders ignore |
rbsp_trailing_bits | see the byte stream page |
The multi-layer extension of Annex F and the 3D extension of Annex I are used only by the multiview, scalable and 3D profiles. Their fields are not listed on these pages.
Chroma formats
chroma_format_idc | separate_colour_plane_flag | Format | SubWidthC | SubHeightC |
|---|---|---|---|---|
| 0 | 0 | monochrome | 1 | 1 |
| 1 | 0 | 4:2:0 | 2 | 2 |
| 2 | 0 | 4:2:2 | 2 | 1 |
| 3 | 0 | 4:4:4 | 1 | 1 |
| 3 | 1 | 4:4:4, planes coded separately | 1 | 1 |
ChromaArrayType equals chroma_format_idc, or 0 when the planes
are coded separately; each plane is then decoded like a monochrome picture and slices
carry a colour_plane_id.
Picture and block sizes
MinCbSizeY = 1 << (log2_min_luma_coding_block_size_minus3 + 3)
CtbSizeY = MinCbSizeY << log2_diff_max_min_luma_coding_block_size
PicWidthInCtbsY = ceil(pic_width_in_luma_samples ÷ CtbSizeY)
PicHeightInCtbsY = ceil(pic_height_in_luma_samples ÷ CtbSizeY)
The CTB is 16 × 16, 32 × 32 or 64 × 64 in every Annex A profile (and 32 or 64 from level 5 up). Unlike H.264, the coded size need only be a multiple of the minimum coding block, and the last row and column of CTBs may be partial. The output picture is the conformance window:
Width = pic_width_in_luma_samples − SubWidthC × (conf_win_left_offset + conf_win_right_offset)
Height = pic_height_in_luma_samples − SubHeightC × (conf_win_top_offset + conf_win_bottom_offset)
So a 1920 × 1080 stream with an 8 × 8 minimum coding block is coded at exactly
1920 × 1080 with no cropping, using 30 × 17 CTBs of 64 × 64, the last row only partly
filled. With a 16 × 16 minimum the coded height is 1088 and
conf_win_bottom_offset is 4 (4:2:0).
Scaling list data
scaling_list_data() appears in the SPS and may be overridden in the PPS. It
holds 20 lists: six each for 4 × 4, 8 × 8 and 16 × 16 transforms, and two for 32 × 32.
| Name | Coding | Condition | Description |
|---|---|---|---|
scaling_list_pred_mode_flag[sizeId][matrixId] | u(1) | per list | 0: copy a list; 1: the list is sent |
scaling_list_pred_matrix_id_delta[sizeId][matrixId] | ue(v) | flag is 0 | 0: use the default list; otherwise copy list matrixId − delta (× 3 for 32 × 32) of the same size |
scaling_list_dc_coef_minus8[sizeId − 2][matrixId] | se(v) | flag is 1, 16 × 16 and 32 × 32 | the DC factor minus 8; −7 to 247 |
scaling_list_delta_coef | se(v) | flag is 1; 16 or 64 times | −128 to 127. Each entry = (previous + delta + 256) mod 256, starting from 8 (or from the DC value); entries are in up-right diagonal order |
sizeId | Transform | matrixId |
|---|---|---|
| 0 | 4 × 4 (16 entries) | 0 intra Y, 1 intra Cb, 2 intra Cr, 3 inter Y, 4 inter Cb, 5 inter Cr |
| 1 | 8 × 8 (64 entries) | |
| 2 | 16 × 16 (64 entries, each used for a 2 × 2 block, plus DC) | |
| 3 | 32 × 32 (64 entries, each for a 4 × 4 block, plus DC) | 0 intra Y, 3 inter Y; chroma 32 × 32 (4:4:4 only) reuses the 16 × 16 chroma lists |
The default 4 × 4 list is flat 16. The default 8 × 8 (and 16 × 16, 32 × 32) lists, in diagonal order:
Intra: 16 16 16 16 16 16 16 16 16 16 17 16 17 16 17 18
17 18 18 17 18 21 19 20 21 20 19 21 24 22 22 24
24 22 22 24 25 25 27 30 27 25 25 29 31 35 35 31
29 36 41 44 41 36 47 54 54 47 65 70 65 88 88 115
Inter: 16 16 16 16 16 16 16 16 16 16 17 17 17 17 17 18
18 18 18 18 18 20 20 20 20 20 20 20 24 24 24 24
24 24 24 24 25 25 25 25 25 25 25 28 28 28 28 28
28 33 33 33 33 33 41 41 41 41 54 54 54 71 71 91
The DC value of a default or copied-from-default 16 × 16 or 32 × 32 list is 16.
Short-term reference picture sets
A reference picture set lists, by picture order count difference, the pictures kept for
reference. The SPS holds num_short_term_ref_pic_sets of them; a slice header
picks one by index or sends its own, with index num_short_term_ref_pic_sets.
| Name | Coding | Condition | Description |
|---|---|---|---|
inter_ref_pic_set_prediction_flag | u(1) | not the first set | 1: this set is predicted from an earlier one |
delta_idx_minus1 | ue(v) | predicted, and the set is in a slice header | which earlier set: the current index − (this + 1) |
delta_rps_sign | u(1) | predicted | sign of the difference: 0 positive, 1 negative |
abs_delta_rps_minus1 | ue(v) | predicted | magnitude of the picture order count shift, minus 1 |
used_by_curr_pic_flag[j] | u(1) | predicted, for each entry of the reference set plus one | 1: the shifted picture is used by the current picture |
use_delta_flag[j] | u(1) | flag above is 0 | 1: the shifted picture is kept in the set but not used now; 0: it is left out |
num_negative_pics | ue(v) | not predicted | pictures before the current one in output order |
num_positive_pics | ue(v) | not predicted | pictures after it |
delta_poc_s0_minus1[i] | ue(v) | per negative picture | gap from the previous entry, minus 1, going backwards |
used_by_curr_pic_s0_flag[i] | u(1) | per negative picture | 1: used for reference by the current picture |
delta_poc_s1_minus1[i] | ue(v) | per positive picture | gap from the previous entry, minus 1, going forwards |
used_by_curr_pic_s1_flag[i] | u(1) | per positive picture | 1: used for reference by the current picture |
For example, negative entries with delta_poc_s0_minus1 0 and 1 mean the
pictures at −1 and −3.
Range extension
Used by the format range extensions profiles (4:2:2, 4:4:4, high bit depths). Every flag is 0 when absent.
| Name | Coding | Description |
|---|---|---|
transform_skip_rotation_enabled_flag | u(1) | rotate the residual of 4 × 4 intra blocks coded with transform skip |
transform_skip_context_enabled_flag | u(1) | use a separate context for significance flags of transform-skip blocks |
implicit_rdpcm_enabled_flag | u(1) | allow residual DPCM for intra blocks with transform bypass or skip |
explicit_rdpcm_enabled_flag | u(1) | allow signalled residual DPCM for inter blocks |
extended_precision_processing_flag | u(1) | extended dynamic range for coefficients and transforms |
intra_smoothing_disabled_flag | u(1) | never filter neighbouring samples for intra prediction |
high_precision_offsets_enabled_flag | u(1) | weighted prediction offsets use bit-depth-dependent precision |
persistent_rice_adaptation_enabled_flag | u(1) | the Rice parameter for coefficient levels starts from statistics of earlier sub-blocks |
cabac_bypass_alignment_enabled_flag | u(1) | align the arithmetic decoder before bypass-coded sign and level bins |
Screen content coding extension
| Name | Coding | Condition | Description |
|---|---|---|---|
sps_curr_pic_ref_enabled_flag | u(1) | a picture may be a reference for itself (intra block copy) | |
palette_mode_enabled_flag | u(1) | palette coding may be used for intra blocks | |
palette_max_size | ue(v) | palette | largest palette |
delta_palette_max_predictor_size | ue(v) | palette | largest palette predictor minus palette_max_size |
sps_palette_predictor_initializers_present_flag | u(1) | palette | 1: initial predictor entries follow |
sps_num_palette_predictor_initializers_minus1 | ue(v) | flag above is 1 | number of entries, minus 1 |
sps_palette_predictor_initializer[comp][i] | u(v) | per component (1, or 3 unless monochrome), per entry | luma bit depth bits for component 0, chroma bit depth for 1 and 2 |
motion_vector_resolution_control_idc | u(2) | 0: quarter-sample motion vectors; 1: integer motion vectors only; 2: each slice says which (use_integer_mv_flag); 3 reserved | |
intra_boundary_filtering_disabled_flag | u(1) | never apply the intra boundary filters |