Every VCL NAL unit (types 0 to 31) holds one slice segment: a header, the slice data and the trailing bits. A slice is an independent slice segment followed by any dependent slice segments, which borrow most of its header. Many fields depend on the PPS and SPS that the header names, so a reader must parse those first.
Fields
| Name | Coding | Condition | Description |
|---|---|---|---|
first_slice_segment_in_pic_flag | u(1) | 1 for the first slice segment of a picture, so it marks picture boundaries | |
no_output_of_prior_pics_flag | u(1) | IRAP picture (types 16 to 23) | 1: pictures still in the buffer are discarded rather than shown |
slice_pic_parameter_set_id | ue(v) | the PPS in use; 0 to 63 | |
dependent_slice_segment_flag | u(1) | not first, and enabled in the PPS | 1: a dependent slice segment; the fields up to the entry points are taken from the slice’s independent segment |
slice_segment_address | u(v) | not first | address of its first CTB in raster order; ⌈log2(PicSizeInCtbsY)⌉ bits |
The fields from here to slice_loop_filter_across_slices_enabled_flag are present only in independent slice segments. | |||
slice_reserved_flag[i] | u(1) | num_extra_slice_header_bits times | reserved; ignored |
slice_type | ue(v) | 0 B, 1 P, 2 I; see slice types | |
pic_output_flag | u(1) | enabled in the PPS | 0: the picture is decoded but not output; 1 when absent |
colour_plane_id | u(2) | separate colour planes | 0 Y, 1 Cb, 2 Cr |
slice_pic_order_cnt_lsb | u(v) | not IDR | picture order count modulo 2bits; log2_max_pic_order_cnt_lsb_minus4 + 4 bits. 0 for IDR pictures |
short_term_ref_pic_set_sps_flag | u(1) | not IDR | 1: use a reference picture set from the SPS; 0: one follows here |
st_ref_pic_set(num_short_term_ref_pic_sets) | flag above is 0 | see the SPS page | |
short_term_ref_pic_set_idx | u(v) | flag is 1 and the SPS has more than one set | which SPS set; ⌈log2(num_short_term_ref_pic_sets)⌉ bits |
num_long_term_sps | ue(v) | long-term pictures enabled and the SPS lists candidates | long-term pictures taken from the SPS candidates |
num_long_term_pics | ue(v) | long-term pictures enabled | long-term pictures given directly |
lt_idx_sps[i] | u(v) | per SPS candidate used, when there is more than one | index into the SPS candidates; ⌈log2(num_long_term_ref_pics_sps)⌉ bits |
poc_lsb_lt[i] | u(v) | per direct picture | its picture order count LSBs, same width as slice_pic_order_cnt_lsb |
used_by_curr_pic_lt_flag[i] | u(1) | per direct picture | 1: used for reference by this picture |
delta_poc_msb_present_flag[i] | u(1) | per long-term picture | 1: the MSBs are given too, to tell apart pictures with the same LSBs |
delta_poc_msb_cycle_lt[i] | ue(v) | flag above is 1 | difference of the MSB cycle, accumulated over the list |
slice_temporal_mvp_enabled_flag | u(1) | not IDR, enabled in the SPS | 1: temporal motion vector predictors may be used; the same in every slice of a picture |
slice_sao_luma_flag | u(1) | SAO enabled | 1: SAO is applied to luma in this slice |
slice_sao_chroma_flag | u(1) | SAO enabled and not monochrome | 1: SAO is applied to chroma |
num_ref_idx_active_override_flag | u(1) | P or B | 1: list sizes follow; 0: the PPS defaults apply |
num_ref_idx_l0_active_minus1 | ue(v) | override | size of list 0, minus 1; 0 to 14 |
num_ref_idx_l1_active_minus1 | ue(v) | override, B | size of list 1, minus 1; 0 to 14 |
ref_pic_lists_modification() | enabled in the PPS and more than one reference picture | see list modification | |
mvd_l1_zero_flag | u(1) | B | 1: list 1 motion vector differences are zero for bi-predicted blocks and not sent |
cabac_init_flag | u(1) | P or B, enabled in the PPS | 1: P slices use the B context tables and B slices the P tables |
collocated_from_l0_flag | u(1) | temporal MVP, B | 1: the collocated picture is in list 0; 0: in list 1. 1 when absent |
collocated_ref_idx | ue(v) | temporal MVP, and that list has more than one entry | index of the collocated picture; the same picture in every slice |
pred_weight_table() | P with weighted_pred_flag, or B with weighted_bipred_flag | see weighted prediction | |
five_minus_max_num_merge_cand | ue(v) | P or B | 5 minus the number of merge candidates (1 to 5) |
use_integer_mv_flag | u(1) | P or B, motion_vector_resolution_control_idc is 2 | 1: motion vectors are in whole samples |
slice_qp_delta | se(v) | slice quantiser = 26 + init_qp_minus26 + this; −QpBdOffsetY to +51 | |
slice_cb_qp_offset, slice_cr_qp_offset | se(v) × 2 | enabled in the PPS | −12 to +12, added to the PPS offsets (the sum also −12 to +12) |
slice_act_y_qp_offset, …cb…, …cr… | se(v) × 3 | enabled in the PPS (screen content) | colour transform QP offsets; −12 to +12 |
cu_chroma_qp_offset_enabled_flag | u(1) | chroma QP offset lists enabled | 1: coding units in this slice may pick a chroma offset |
deblocking_filter_override_flag | u(1) | override enabled in the PPS | 1: deblocking settings follow |
slice_deblocking_filter_disabled_flag | u(1) | override | 1: no deblocking in this slice |
slice_beta_offset_div2, slice_tc_offset_div2 | se(v) × 2 | override, deblocking on | −6 to 6 |
slice_loop_filter_across_slices_enabled_flag | u(1) | enabled in the PPS, and SAO or deblocking on | 1: filters may cross the left and upper boundary of this slice |
| The rest is present in every slice segment. | |||
num_entry_point_offsets | ue(v) | tiles or wavefronts enabled | number of further tiles or CTB rows starting in this segment |
offset_len_minus1 | ue(v) | entry points present | bits per offset, minus 1; 0 to 31 |
entry_point_offset_minus1[i] | u(v) | per entry point | size in bytes of each subset, minus 1; see entry points |
slice_segment_header_extension_length | ue(v) | enabled in the PPS | 0 to 256 bytes |
slice_segment_header_extension_data_byte[i] | u(8) | repeated | ignored by single-layer decoders |
byte_alignment() | a 1 bit and zeros to the byte boundary; the slice data starts on a byte | ||
Fields from slice_pic_order_cnt_lsb to
slice_temporal_mvp_enabled_flag, and slice_pic_parameter_set_id,
have the same value in every slice segment of a picture.
Slice types
slice_type | Name | Prediction |
|---|---|---|
| 0 | B | intra, or inter from up to two references per block, lists 0 and 1 |
| 1 | P | intra, or inter from one reference per block, list 0 |
| 2 | I | intra only |
Unlike H.264 there are no SP and SI types and no 5 to 9 range. Slices of IRAP pictures in layer 0 are always I, unless the picture may reference itself (screen content coding).
Reference list modification
| Name | Coding | Condition | Description |
|---|---|---|---|
ref_pic_list_modification_flag_l0 | u(1) | 1: list 0 is given explicitly | |
list_entry_l0[i] | u(v) | flag above is 1, one per list 0 entry | index into the initial list of current-picture references; ⌈log2(NumPicTotalCurr)⌉ bits |
ref_pic_list_modification_flag_l1 | u(1) | B | 1: list 1 is given explicitly |
list_entry_l1[i] | u(v) | flag above is 1, one per list 1 entry | the same for list 1 |
NumPicTotalCurr is the number of short-term and long-term pictures marked as
used by the current picture (plus 1 when it can reference itself); the levels limit it to
8.
Weighted prediction
| Name | Coding | Condition | Description |
|---|---|---|---|
luma_log2_weight_denom | ue(v) | 0 to 7 | |
delta_chroma_log2_weight_denom | se(v) | not monochrome | chroma denominator = luma + this, 0 to 7 |
luma_weight_l0_flag[i] | u(1) | per list 0 entry, unless it is the current picture | 1: a luma weight and offset follow |
chroma_weight_l0_flag[i] | u(1) | the same, not monochrome | 1: chroma weights and offsets follow |
delta_luma_weight_l0[i] | se(v) | luma flag | weight = 2denom + this; −128 to 127 |
luma_offset_l0[i] | se(v) | luma flag | −128 to 127 (wider with high-precision offsets) |
delta_chroma_weight_l0[i][j] | se(v) | chroma flag, j = Cb, Cr | weight = 2chroma denom + this |
delta_chroma_offset_l0[i][j] | se(v) | chroma flag | offset, coded relative to a value predicted from the weight |
For B slices the same four flags and values repeat for list 1 (…_l1). | |||
A slice may carry at most 24 weight flags in total, counting each chroma flag twice.
Entry points
When tiles or wavefronts are used, the slice data is split into subsets: one per tile, or
one per CTB row. Subset 0 starts at the first byte of the slice data; subset k starts
entry_point_offset_minus1[k − 1] + 1 bytes after subset k − 1. The offsets
count bytes as they are in the NAL unit, including any emulation prevention bytes, so a
decoder can start each subset on a separate thread.