The video parameter set, NAL unit type 32, is new in H.265. It describes the whole coded video sequence across all its layers and temporal sub-layers: the profile and level, the buffer sizes and the timing. A single-layer decoder needs nothing in it to decode the pictures and may ignore it, but each SPS names a VPS and it must be present. The fields are bit-packed; the coding column shows how each is read.
Fields
| Name | Coding | Condition | Description |
|---|---|---|---|
vps_video_parameter_set_id | u(4) | 0 to 15; referred to by sps_video_parameter_set_id | |
vps_base_layer_internal_flag | u(1) | see base layer | |
vps_base_layer_available_flag | u(1) | see base layer | |
vps_max_layers_minus1 | u(6) | maximum number of layers, minus 1; 0 for single-layer video; 63 reserved | |
vps_max_sub_layers_minus1 | u(3) | maximum number of temporal sub-layers, minus 1; 0 to 6 | |
vps_temporal_id_nesting_flag | u(1) | 1 means switching up to any higher sub-layer is always possible; must be 1 when there is one sub-layer | |
vps_reserved_0xffff_16bits | u(16) | FF FF; decoders ignore it | |
profile_tier_level(1, vps_max_sub_layers_minus1) | the profile, tier and level, with profile information present | ||
vps_sub_layer_ordering_info_present_flag | u(1) | 1: the next three fields are given for every sub-layer; 0: only for the highest, which then applies to all | |
vps_max_dec_pic_buffering_minus1[i] | ue(v) | per sub-layer | decoded picture buffer size in pictures, minus 1, when decoding up to sub-layer i |
vps_max_num_reorder_pics[i] | ue(v) | per sub-layer | most pictures that can come before a picture in decoding order and after it in output order |
vps_max_latency_increase_plus1[i] | ue(v) | per sub-layer | 0: no limit; otherwise the latency limit is max_num_reorder_pics + this − 1 pictures |
vps_max_layer_id | u(6) | largest nuh_layer_id used; 63 reserved | |
vps_num_layer_sets_minus1 | ue(v) | number of layer sets, minus 1; 0 to 1023. Layer set 0 is always layer 0 alone | |
layer_id_included_flag[i][j] | u(1) | for each layer set i from 1, each layer j up to vps_max_layer_id | 1 when layer j belongs to layer set i |
vps_timing_info_present_flag | u(1) | 1 means the timing fields follow | |
vps_num_units_in_tick | u(32) | timing | clock units per tick; greater than 0 |
vps_time_scale | u(32) | timing | clock units per second; greater than 0. One tick is num_units_in_tick ÷ time_scale seconds |
vps_poc_proportional_to_timing_flag | u(1) | timing | 1 means picture order count grows in proportion to output time |
vps_num_ticks_poc_diff_one_minus1 | ue(v) | flag above is 1 | clock ticks per picture order count step, minus 1; up to 232 − 2 |
vps_num_hrd_parameters | ue(v) | timing | number of HRD structures that follow, up to the number of layer sets |
hrd_layer_set_idx[i] | ue(v) | per HRD structure | the layer set it applies to; each layer set at most once |
cprms_present_flag[i] | u(1) | per HRD structure after the first | 1: the common HRD fields are present; 0: they are copied from the previous structure. Always 1 for the first |
hrd_parameters(cprms_present_flag[i], vps_max_sub_layers_minus1) | per HRD structure | see HRD parameters | |
vps_extension_flag | u(1) | 1 means extension data follows | |
vps_extension_data_flag | u(1), repeated | flag above is 1 | up to the trailing bits; multi-layer streams carry vps_extension() of Annex F here, which single-layer decoders ignore |
rbsp_trailing_bits | see the byte stream page |
The VPS can be read without knowing anything else from the stream: none of its fields depend on another parameter set.
Base layer flags
internal | available | Meaning |
|---|---|---|
| 1 | 1 | the base layer is in this bitstream (every ordinary stream) |
| 0 | 1 | the base layer is supplied by external means, outside this bitstream |
| 1 | 0 | the base layer is not available, but the VPS describes it as if it were in the bitstream |
| 0 | 0 | the base layer is not available, but the VPS describes it as if it were external |
Every profile of Annex A requires both flags to be 1. When the internal flag is 0, the sub-layer ordering fields must be 0 and are ignored.
Worked example
The first payload bytes of a single-layer VPS:
40 01 0C 01 FF FF 01 …
| Bits | Field | Value |
|---|---|---|
0000 | vps_video_parameter_set_id | 0 |
1, 1 | base layer internal, available | 1, 1 |
000000 | vps_max_layers_minus1 | 0: one layer |
000 | vps_max_sub_layers_minus1 | 0: one sub-layer |
1 | vps_temporal_id_nesting_flag | 1 |
FF FF | vps_reserved_0xffff_16bits |
The profile, tier and level structure starts at the next byte, so
general_profile_idc is always in the low five bits of the seventh byte of
the VPS NAL unit, counting its two header bytes: here 01, Main.