NAL unit types 1, 5 and 19 hold a slice: a header and the macroblock data. The slice data itself is entropy coded and is not documented here; this page covers the header up to where the data starts.
Fields
| Name | Coding | Condition | Description |
|---|---|---|---|
first_mb_in_slice | ue(v) | the macroblock address where the slice starts | |
slice_type | ue(v) | see slice types | |
pic_parameter_set_id | ue(v) | 0 to 255 | |
colour_plane_id | u(2) | separate_colour_plane_flag is 1 | 0 to 2 |
frame_num | u(v) | log2_max_frame_num_minus4 + 4 bits | |
field_pic_flag | u(1) | frame_mbs_only_flag is 0 | 1 for a field picture |
bottom_field_flag | u(1) | field_pic_flag is 1 | 1 for the bottom field |
idr_pic_id | ue(v) | IDR slice | 0 to 65535 |
pic_order_cnt_lsb | u(v) | POC type 0 | log2_max_pic_order_cnt_lsb_minus4 + 4 bits |
delta_pic_order_cnt_bottom | se(v) | POC type 0, flag set and not a field | |
delta_pic_order_cnt[0] | se(v) | POC type 1, not always zero | |
delta_pic_order_cnt[1] | se(v) | as above, flag set and not a field | |
redundant_pic_cnt | ue(v) | the PPS enables it | 0 to 127 |
direct_spatial_mv_pred_flag | u(1) | B slice | |
num_ref_idx_active_override_flag | u(1) | P, SP or B | |
num_ref_idx_l0_active_minus1 | ue(v) | override flag 1 | 0 to 31 |
num_ref_idx_l1_active_minus1 | ue(v) | override flag 1, B slice | 0 to 31 |
| ref_pic_list_modification | |||
| pred_weight_table | weighted prediction in use | ||
| dec_ref_pic_marking | nal_ref_idc not 0 | ||
cabac_init_idc | ue(v) | CABAC, not I or SI | 0 to 2 |
slice_qp_delta | se(v) | ||
sp_for_switch_flag | u(1) | SP slice | |
slice_qs_delta | se(v) | SP or SI slice | −51 to +51 |
disable_deblocking_filter_idc | ue(v) | PPS flag is 1 | 0 on, 1 off, 2 off at slice boundaries |
slice_alpha_c0_offset_div2 | se(v) | above is not 1 | −6 to +6 |
slice_beta_offset_div2 | se(v) | above is not 1 | −6 to +6 |
slice_group_change_cycle | u(v) | slice group map type 3, 4 or 5 | width depends on the picture size |
cabac_alignment_one_bit | f(1) | CABAC | 1 bits, until byte aligned |
Slice types
| Value | Type | Meaning |
|---|---|---|
| 0, 5 | P | predicted from earlier pictures |
| 1, 6 | B | predicted from two reference pictures |
| 2, 7 | I | intra coded |
| 3, 8 | SP | switching P |
| 4, 9 | SI | switching I |
Values 5 to 9 mean the same types as 0 to 4, and say that every slice of the picture has that type.
Reference list modification
Present for all slice types except I and SI, for list 0, and for list 1 in B slices.
| Name | Coding | Condition |
|---|---|---|
ref_pic_list_modification_flag_l0 | u(1) | |
modification_of_pic_nums_idc | ue(v) | repeated until 3 |
abs_diff_pic_num_minus1 | ue(v) | idc 0 or 1 |
long_term_pic_num | ue(v) | idc 2 |
ref_pic_list_modification_flag_l1, and the same loop | B slice |
| idc | Meaning |
|---|---|
| 0 | subtract the difference from the short-term picture number |
| 1 | add the difference |
| 2 | use the named long-term picture |
| 3 | end of the list |
Prediction weight table
Present for P and SP slices when weighted_pred_flag is set, and for B
slices when weighted_bipred_idc is 1.
| Name | Coding | Condition |
|---|---|---|
luma_log2_weight_denom | ue(v) | 0 to 7 |
chroma_log2_weight_denom | ue(v) | 0 to 7, when chroma is present |
luma_weight_l0_flag | u(1) | for each entry of list 0 |
luma_weight_l0, luma_offset_l0 | se(v) × 2 | flag 1, −128 to +127 |
chroma_weight_l0_flag | u(1) | when chroma is present |
chroma_weight_l0[j], chroma_offset_l0[j] | se(v) × 2 | flag 1, for j = 0 and 1 |
| the same fields for list 1 | B slice |
Decoded reference picture marking
For an IDR picture:
| Name | Coding | Description |
|---|---|---|
no_output_of_prior_pics_flag | u(1) | |
long_term_reference_flag | u(1) | 1 marks this picture as long-term |
Otherwise:
| Name | Coding | Condition |
|---|---|---|
adaptive_ref_pic_marking_mode_flag | u(1) | |
memory_management_control_operation | ue(v) | repeated until 0 |
difference_of_pic_nums_minus1 | ue(v) | operation 1 or 3 |
long_term_pic_num | ue(v) | operation 2 |
long_term_frame_idx | ue(v) | operation 3 or 6 |
max_long_term_frame_idx_plus1 | ue(v) | operation 4 |
| Operation | Meaning |
|---|---|
| 0 | end of the list |
| 1 | mark a short-term picture as unused |
| 2 | mark a long-term picture as unused |
| 3 | convert a short-term picture to long-term |
| 4 | set the maximum long-term index |
| 5 | mark all reference pictures as unused |
| 6 | mark the current picture as long-term |