1// Copyright 2018-2023 The Khronos Group Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[[decode-h265]] 6== H.265 Decode Operations 7 8Video decode operations using an <<decode-h265-profile,H.265 decode 9profile>> can: be used to decode elementary video stream sequences compliant 10to the <<itu-t-h265,ITU-T H.265 Specification>>. 11 12[NOTE] 13.Note 14==== 15Refer to the <<preamble,Preamble>> for information on how the Khronos 16Intellectual Property Rights Policy relates to normative references to 17external materials not created by Khronos. 18==== 19 20This process is performed according to the <<decode-operation-steps,video 21decode operation steps>> with the codec-specific semantics defined in 22section 8 of <<itu-t-h265,ITU-T H.265 Specification>>: 23 24 * Syntax elements, derived values, and other parameters are applied from 25 the following structures: 26 ** The code:StdVideoH265VideoParameterSet structure corresponding to the 27 <<decode-h265-active-vps,active VPS>> specifying the <<decode-h265-vps, 28 H.265 video parameter set>>. 29 ** The code:StdVideoH265SequenceParameterSet structure corresponding to 30 the <<decode-h265-active-sps,active SPS>> specifying the 31 <<decode-h265-sps, H.265 sequence parameter set>>. 32 ** The code:StdVideoH265PictureParameterSet structure corresponding to the 33 <<decode-h265-active-pps,active PPS>> specifying the <<decode-h265-pps, 34 H.265 picture parameter set>>. 35 ** The code:StdVideoDecodeH265PictureInfo structure specifying the 36 <<decode-h265-picture-info,H.265 picture information>>. 37 ** The code:StdVideoDecodeH265ReferenceInfo structures specifying the 38 <<decode-h265-reference-info,H.265 reference information>> 39 corresponding to the optional <<reconstructed-picture,reconstructed 40 picture>> and any <<active-reference-pictures,active reference 41 pictures>>. 42 * The contents of the provided video bitstream buffer range are 43 interpreted as defined in the <<decode-h265-bitstream-data-access,H.265 44 Decode Bitstream Data Access>> section. 45 * Picture data in the <<video-picture-resources,video picture resources>> 46 corresponding to the used <<decode-h265-active-reference-picture-info, 47 active reference pictures>>, <<decode-h265-output-picture-info,decode 48 output picture>>, and optional <<decode-h265-reconstructed-picture-info, 49 reconstructed picture>> is accessed as defined in the 50 <<decode-h265-picture-data-access,H.265 Decode Picture Data Access>> 51 section. 52 53If the parameters and the bitstream adhere to the syntactic and semantic 54requirements defined in the corresponding sections of the <<itu-t-h265,ITU-T 55H.265 Specification>>, as described above, and the <<dpb-slot,DPB slots>> 56associated with the <<active-reference-pictures,active reference pictures>> 57all refer to <<dpb-slot-states,valid picture references>>, then the video 58decode operation will complete successfully. 59Otherwise, the video decode operation may: complete 60<<decode-unsuccessful,unsuccessfully>>. 61 62 63[[decode-h265-bitstream-data-access]] 64=== H.265 Decode Bitstream Data Access 65 66The video bitstream buffer range should: contain a VCL NAL unit comprised of 67the slice segment headers and data of a picture representing a frame, as 68defined in sections 7.3.6 and 7.3.8, and this data is interpreted as defined 69in sections 7.4.7 and 7.4.9 of the <<itu-t-h265, ITU-T H.265 70Specification>>, respectively. 71 72The offsets provided in 73slink:VkVideoDecodeH265PictureInfoKHR::pname:pSliceSegmentOffsets should: 74specify the starting offsets corresponding to each slice segment header 75within the video bitstream buffer range. 76 77 78[[decode-h265-picture-data-access]] 79=== H.265 Decode Picture Data Access 80 81Accesses to image data within a video picture resource happen at the 82granularity indicated by 83slink:VkVideoCapabilitiesKHR::pname:pictureAccessGranularity, as returned by 84flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used <<video-profiles, 85video profile>>. 86Accordingly, the complete image subregion of a 87<<decode-output-picture,decode output picture>>, 88<<reference-picture,reference picture>>, or 89<<reconstructed-picture,reconstructed picture>> accessed by video coding 90operations using an <<decode-h265-profile,H.265 decode profile>> is defined 91as the set of texels within the coordinate range: 92 93 {empty}:: [eq]#([0,pname:endX),[0,pname:endY))# 94 95Where: 96 97 * [eq]#pname:endX# equals [eq]#pname:codedExtent.width# rounded up to the 98 nearest integer multiple of pname:pictureAccessGranularity.width and 99 clamped to the width of the image subresource 100 <<video-image-subresource-reference,referred>> to by the corresponding 101 slink:VkVideoPictureResourceInfoKHR structure; 102 * [eq]#endY# equals [eq]#pname:codedExtent.height# rounded up to the 103 nearest integer multiple of pname:pictureAccessGranularity.height and 104 clamped to the height of the image subresource 105 <<video-image-subresource-reference, referred>> to by the corresponding 106 slink:VkVideoPictureResourceInfoKHR structure; 107 108Where pname:codedExtent is the member of the 109slink:VkVideoPictureResourceInfoKHR structure corresponding to the picture. 110 111In case of video decode operations using an <<decode-h265-profile,H.265 112decode profile>>, any access to a picture at the coordinates 113[eq]#(pname:x,pname:y)#, as defined by the <<itu-t-h265,ITU-T H.265 114Specification>>, is an access to the image subresource 115<<video-image-subresource-reference,referred>> to by the corresponding 116slink:VkVideoPictureResourceInfoKHR structure at the texel coordinates 117[eq]#(pname:x,pname:y)#. 118 119 120[[decode-h265-profile]] 121=== H.265 Decode Profile 122 123[open,refpage='VkVideoDecodeH265ProfileInfoKHR',desc='Structure specifying H.265 decode profile',type='structs'] 124-- 125A video profile supporting H.265 video decode operations is specified by 126setting slink:VkVideoProfileInfoKHR::pname:videoCodecOperation to 127ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR and adding a 128sname:VkVideoDecodeH265ProfileInfoKHR structure to the 129slink:VkVideoProfileInfoKHR::pname:pNext chain. 130 131The sname:VkVideoDecodeH265ProfileInfoKHR structure is defined as: 132 133include::{generated}/api/structs/VkVideoDecodeH265ProfileInfoKHR.adoc[] 134 135 * pname:sType is a elink:VkStructureType value identifying this structure. 136 * pname:pNext is `NULL` or a pointer to a structure extending this 137 structure. 138 * pname:stdProfileIdc is a code:StdVideoH265ProfileIdc value specifying 139 the H.265 codec profile IDC, as defined in section A3 of the 140 <<itu-t-h265,ITU-T H.265 Specification>>. 141 142include::{generated}/validity/structs/VkVideoDecodeH265ProfileInfoKHR.adoc[] 143-- 144 145 146=== H.265 Decode Capabilities 147 148[open,refpage='VkVideoDecodeH265CapabilitiesKHR',desc='Structure describing H.265 decode capabilities',type='structs'] 149-- 150When calling flink:vkGetPhysicalDeviceVideoCapabilitiesKHR to query the 151capabilities for an <<decode-h265-profile,H.265 decode profile>>, the 152slink:VkVideoCapabilitiesKHR::pname:pNext chain must: include a 153sname:VkVideoDecodeH265CapabilitiesKHR structure that will be filled with 154the profile-specific capabilities. 155 156The sname:VkVideoDecodeH265CapabilitiesKHR structure is defined as: 157 158include::{generated}/api/structs/VkVideoDecodeH265CapabilitiesKHR.adoc[] 159 160 * pname:sType is a elink:VkStructureType value identifying this structure. 161 * pname:pNext is `NULL` or a pointer to a structure extending this 162 structure. 163 * pname:maxLevelIdc is a code:StdVideoH265LevelIdc value specifying the 164 maximum H.265 level supported by the profile, where enum constant 165 `STD_VIDEO_H265_LEVEL_IDC_<major>_<minor>` identifies H.265 level 166 `<major>.<minor>` as defined in section A.4 of the <<itu-t-h265,ITU-T 167 H.265 Specification>>. 168 169include::{generated}/validity/structs/VkVideoDecodeH265CapabilitiesKHR.adoc[] 170-- 171 172 173[[decode-h265-parameter-sets]] 174=== H.265 Decode Parameter Sets 175 176<<video-session-parameters,Video session parameters>> objects created with 177the video codec operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR 178can: contain the following types of parameters: 179 180[[decode-h265-vps]] 181H.265 Video Parameter Sets (VPS):: 182 183Represented by code:StdVideoH265VideoParameterSet structures and interpreted 184as follows: 185 186 * code:reserved1, code:reserved2, and code:reserved3 are used only for 187 padding purposes and are otherwise ignored; 188 * code:vps_video_parameter_set_id is used as the key of the VPS entry; 189 * the code:max_latency_increase_plus1, code:max_dec_pic_buffering_minus1, 190 and code:max_num_reorder_pics members of the 191 code:StdVideoH265DecPicBufMgr structure pointed to by code:pDecPicBufMgr 192 correspond to `vps_max_latency_increase_plus1`, 193 `vps_max_dec_pic_buffering_minus1`, and `vps_max_num_reorder_pics`, 194 respectively, as defined in section 7.4.3.1 of the <<itu-t-h265,ITU-T 195 H.265 Specification>>; 196 * the code:StdVideoH265HrdParameters structure pointed to by 197 code:pHrdParameters is interpreted as follows: 198 ** code:reserved is used only for padding purposes and is otherwise 199 ignored; 200 ** code:flags.fixed_pic_rate_general_flag is a bitmask where bit index 201 [eq]#i# corresponds to `fixed_pic_rate_general_flag[i]` as defined in 202 section E.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>; 203 ** code:flags.fixed_pic_rate_within_cvs_flag is a bitmask where bit index 204 [eq]#i# corresponds to `fixed_pic_rate_within_cvs_flag[i]` as defined 205 in section E.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>; 206 ** code:flags.low_delay_hrd_flag is a bitmask where bit index [eq]#i# 207 corresponds to `low_delay_hrd_flag[i]` as defined in section E.3.2 of 208 the <<itu-t-h265,ITU-T H.265 Specification>>; 209 ** if code:flags.nal_hrd_parameters_present_flag is set, then 210 code:pSubLayerHrdParametersNal is a pointer to an array of 211 [eq]#code:vps_max_sub_layers_minus1 + 1# number of 212 code:StdVideoH265SubLayerHrdParameters structures where 213 code:vps_max_sub_layers_minus1 is the corresponding member of the 214 encompassing code:StdVideoH265VideoParameterSet structure and each 215 element is interpreted as follows: 216 *** code:cbr_flag is a bitmask where bit index [eq]#i# corresponds to 217 `cbr_flag[i]` as defined in section E.3.3 of the <<itu-t-h265,ITU-T 218 H.265 Specification>>; 219 *** all other members of the code:StdVideoH265SubLayerHrdParameters 220 structure are interpreted as defined in section E.3.3 of the 221 <<itu-t-h265,ITU-T H.265 Specification>>; 222 ** if code:flags.vcl_hrd_parameters_present_flag is set, then 223 code:pSubLayerHrdParametersVcl is a pointer to an array of 224 [eq]#code:vps_max_sub_layers_minus1 + 1# number of 225 code:StdVideoH265SubLayerHrdParameters structures where 226 code:vps_max_sub_layers_minus1 is the corresponding member of the 227 encompassing code:StdVideoH265VideoParameterSet structure and each 228 element is interpreted as follows: 229 *** code:cbr_flag is a bitmask where bit index [eq]#i# corresponds to 230 `cbr_flag[i]` as defined in section E.3.3 of the <<itu-t-h265,ITU-T 231 H.265 Specification>>; 232 *** all other members of the code:StdVideoH265SubLayerHrdParameters 233 structure are interpreted as defined in section E.3.3 of the 234 <<itu-t-h265,ITU-T H.265 Specification>>; 235 ** all other members of code:StdVideoH265HrdParameters are interpreted as 236 defined in section E.3.2 of the <<itu-t-h265,ITU-T H.265 237 Specification>>; 238 * the code:StdVideoH265ProfileTierLevel structure pointed to by 239 code:pProfileTierLevel are interpreted as follows: 240 ** code:general_level_idc is one of the enum constants 241 `STD_VIDEO_H265_LEVEL_IDC_<major>_<minor>` identifying the H.265 level 242 `<major>.<minor>` as defined in section A.4 of the <<itu-t-h265,ITU-T 243 H.265 Specification>>; 244 ** all other members of code:StdVideoH265ProfileTierLevel are interpreted 245 as defined in section 7.4.4 of the <<itu-t-h265,ITU-T H.265 246 Specification>>; 247 * all other members of code:StdVideoH265VideoParameterSet are interpreted 248 as defined in section 7.4.3.1 of the <<itu-t-h265,ITU-T H.265 249 Specification>>. 250 251[[decode-h265-sps]] 252H.265 Sequence Parameter Sets (SPS):: 253 254Represented by code:StdVideoH265SequenceParameterSet structures and 255interpreted as follows: 256 257 * code:reserved1 and code:reserved2 are used only for padding purposes and 258 are otherwise ignored; 259 * the pair constructed from code:sps_video_parameter_set_id and 260 code:sps_seq_parameter_set_id is used as the key of the SPS entry; 261 * the code:StdVideoH265ProfileTierLevel structure pointed to by 262 code:pProfileTierLevel are interpreted as follows: 263 ** code:general_level_idc is one of the enum constants 264 `STD_VIDEO_H265_LEVEL_IDC_<major>_<minor>` identifying the H.265 level 265 `<major>.<minor>` as defined in section A.4 of the <<itu-t-h265,ITU-T 266 H.265 Specification>>; 267 ** all other members of code:StdVideoH265ProfileTierLevel are interpreted 268 as defined in section 7.4.4 of the <<itu-t-h265,ITU-T H.265 269 Specification>>; 270 * the code:max_latency_increase_plus1, code:max_dec_pic_buffering_minus1, 271 and code:max_num_reorder_pics members of the 272 code:StdVideoH265DecPicBufMgr structure pointed to by code:pDecPicBufMgr 273 correspond to `sps_max_latency_increase_plus1`, 274 `sps_max_dec_pic_buffering_minus1`, and `sps_max_num_reorder_pics`, 275 respectively, as defined in section 7.4.3.2 of the <<itu-t-h265,ITU-T 276 H.265 Specification>>; 277 * if code:flags.sps_scaling_list_data_present_flag is set, then the 278 code:StdVideoH265ScalingLists structure pointed to by code:pScalingLists 279 is interpreted as follows: 280 ** code:ScalingList4x4, code:ScalingList8x8, code:ScalingList16x16, and 281 code:ScalingList32x32 correspond to `ScalingList[0]`, `ScalingList[1]`, 282 `ScalingList[2]`, and `ScalingList[3]`, respectively, as defined in 283 section 7.3.4 of the <<itu-t-h265,ITU-T H.265 Specification>>; 284 ** code:ScalingListDCCoef16x16 and code:ScalingListDCCoef32x32 correspond 285 to `scaling_list_dc_coef_minus8[0]` and 286 `scaling_list_dc_coef_minus8[1]`, respectively, as defined in section 287 7.3.4 of the <<itu-t-h265,ITU-T H.265 Specification>>; 288 * code:pShortTermRefPicSet is a pointer to an array of 289 code:num_short_term_ref_pic_sets number of 290 code:StdVideoH265ShortTermRefPicSet structures where each element is 291 interpreted as follows: 292 ** code:reserved1, code:reserved2, and code:reserved3 are used only for 293 padding purposes and are otherwise ignored; 294 ** code:used_by_curr_pic_flag is a bitmask where bit index [eq]#i# 295 corresponds to `used_by_curr_pic_flag[i]` as defined in section 7.4.8 296 of the <<itu-t-h265,ITU-T H.265 Specification>>; 297 ** code:use_delta_flag is a bitmask where bit index [eq]#i# corresponds to 298 `use_delta_flag[i]` as defined in section 7.4.8 of the <<itu-t-h265, 299 ITU-T H.265 Specification>>; 300 ** code:used_by_curr_pic_s0_flag is a bitmask where bit index [eq]#i# 301 corresponds to `used_by_curr_pic_s0_flag[i]` as defined in section 302 7.4.8 of the <<itu-t-h265,ITU-T H.265 Specification>>; 303 ** code:used_by_curr_pic_s1_flag is a bitmask where bit index [eq]#i# 304 corresponds to `used_by_curr_pic_s1_flag[i]` as defined in section 305 7.4.8 of the <<itu-t-h265,ITU-T H.265 Specification>>; 306 ** all other members of code:StdVideoH265ShortTermRefPicSet are 307 interpreted as defined in section 7.4.8 of the <<itu-t-h265,ITU-T H.265 308 Specification>>; 309 * if code:flags.long_term_ref_pics_present_flag is set then the 310 code:StdVideoH265LongTermRefPicsSps structure pointed to by 311 code:pLongTermRefPicsSps is interpreted as follows: 312 ** code:used_by_curr_pic_lt_sps_flag is a bitmask where bit index [eq]#i# 313 corresponds to `used_by_curr_pic_lt_sps_flag[i]` as defined in section 314 7.4.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>; 315 ** all other members of code:StdVideoH265LongTermRefPicsSps are 316 interpreted as defined in section 7.4.3.2 of the <<itu-t-h265,ITU-T 317 H.265 Specification>>; 318 * if code:flags.vui_parameters_present_flag is set, then the 319 code:StdVideoH265SequenceParameterSetVui structure pointed to by 320 code:pSequenceParameterSetVui is interpreted as follows: 321 ** code:reserved1, code:reserved2, and code:reserved3 are used only for 322 padding purposes and are otherwise ignored; 323 ** the code:StdVideoH265HrdParameters structure pointed to by 324 code:pHrdParameters is interpreted as follows: 325 *** code:flags.fixed_pic_rate_general_flag is a bitmask where bit index 326 [eq]#i# corresponds to `fixed_pic_rate_general_flag[i]` as defined in 327 section E.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>; 328 *** code:flags.fixed_pic_rate_within_cvs_flag is a bitmask where bit index 329 [eq]#i# corresponds to `fixed_pic_rate_within_cvs_flag[i]` as defined 330 in section E.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>; 331 *** code:flags.low_delay_hrd_flag is a bitmask where bit index [eq]#i# 332 corresponds to `low_delay_hrd_flag[i]` as defined in section E.3.2 of 333 the <<itu-t-h265,ITU-T H.265 Specification>>; 334 *** if code:flags.nal_hrd_parameters_present_flag is set, then 335 code:pSubLayerHrdParametersNal is a pointer to an array of 336 [eq]#code:sps_max_sub_layers_minus1 + 1# number of 337 code:StdVideoH265SubLayerHrdParameters structures where 338 code:sps_max_sub_layers_minus1 is the corresponding member of the 339 encompassing code:StdVideoH265SequenceParameterSet structure and each 340 element is interpreted as follows: 341 **** code:cbr_flag is a bitmask where bit index [eq]#i# corresponds to 342 `cbr_flag[i]` as defined in section E.3.3 of the <<itu-t-h265,ITU-T 343 H.265 Specification>>; 344 **** all other members of the code:StdVideoH265SubLayerHrdParameters 345 structure are interpreted as defined in section E.3.3 of the 346 <<itu-t-h265,ITU-T H.265 Specification>>; 347 *** if code:flags.vcl_hrd_parameters_present_flag is set, then 348 code:pSubLayerHrdParametersVcl is a pointer to an array of 349 [eq]#code:sps_max_sub_layers_minus1 + 1# number of 350 code:StdVideoH265SubLayerHrdParameters structures where 351 code:sps_max_sub_layers_minus1 is the corresponding member of the 352 encompassing code:StdVideoH265SequenceParameterSet structure and each 353 element is interpreted as follows: 354 **** code:cbr_flag is a bitmask where bit index [eq]#i# corresponds to 355 `cbr_flag[i]` as defined in section E.3.3 of the <<itu-t-h265,ITU-T 356 H.265 Specification>>; 357 **** all other members of the code:StdVideoH265SubLayerHrdParameters 358 structure are interpreted as defined in section E.3.3 of the 359 <<itu-t-h265,ITU-T H.265 Specification>>; 360 *** all other members of code:StdVideoH265HrdParameters are interpreted as 361 defined in section E.3.2 of the <<itu-t-h265,ITU-T H.265 362 Specification>>; 363 ** all other members of code:pSequenceParameterSetVui are interpreted as 364 defined in section E.3.1 of the <<itu-t-h265,ITU-T H.265 365 Specification>>; 366 * if code:flags.sps_palette_predictor_initializer_present_flag is set, 367 then the code:PredictorPaletteEntries member of the 368 code:StdVideoH265PredictorPaletteEntries structure pointed to by 369 code:pPredictorPaletteEntries is interpreted as defined in section 370 7.4.9.13 of the <<itu-t-h265,ITU-T H.265 Specification>>; 371 * all other members of code:StdVideoH265SequenceParameterSet are 372 interpreted as defined in section 7.4.3.1 of the <<itu-t-h265,ITU-T 373 H.265 Specification>>. 374 375[[decode-h265-pps]] 376H.265 Picture Parameter Sets (PPS):: 377 378Represented by code:StdVideoH265PictureParameterSet structures and 379interpreted as follows: 380 381 * code:reserved1, code:reserved2, and code:reserved3 are used only for 382 padding purposes and are otherwise ignored; 383 * the triplet constructed from code:sps_video_parameter_set_id, 384 code:pps_seq_parameter_set_id, and code:pps_pic_parameter_set_id is used 385 as the key of the PPS entry; 386 * if code:flags.pps_scaling_list_data_present_flag is set, then the 387 code:StdVideoH265ScalingLists structure pointed to by code:pScalingLists 388 is interpreted as follows: 389 ** code:ScalingList4x4, code:ScalingList8x8, code:ScalingList16x16, and 390 code:ScalingList32x32 correspond to `ScalingList[0]`, `ScalingList[1]`, 391 `ScalingList[2]`, and `ScalingList[3]`, respectively, as defined in 392 section 7.3.4 of the <<itu-t-h265,ITU-T H.265 Specification>>; 393 ** code:ScalingListDCCoef16x16 and code:ScalingListDCCoef32x32 correspond 394 to `scaling_list_dc_coef_minus8[0]` and 395 `scaling_list_dc_coef_minus8[1]`, respectively, as defined in section 396 7.3.4 of the <<itu-t-h265,ITU-T H.265 Specification>>; 397 * if code:flags.pps_palette_predictor_initializer_present_flag is set, 398 then the code:PredictorPaletteEntries member of the 399 code:StdVideoH265PredictorPaletteEntries structure pointed to by 400 code:pPredictorPaletteEntries is interpreted as defined in section 401 7.4.9.13 of the <<itu-t-h265,ITU-T H.265 Specification>>; 402 * all other members of code:StdVideoH265PictureParameterSet are 403 interpreted as defined in section 7.4.3.3 of the <<itu-t-h265,ITU-T 404 H.265 Specification>>. 405 406[open,refpage='VkVideoDecodeH265SessionParametersCreateInfoKHR',desc='Structure specifies H.265 decoder parameter set information',type='structs'] 407-- 408When a <<video-session-parameters,video session parameters>> object is 409created with the codec operation 410ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, the 411slink:VkVideoSessionParametersCreateInfoKHR::pname:pNext chain must: include 412a sname:VkVideoDecodeH265SessionParametersCreateInfoKHR structure specifying 413the capacity and initial contents of the object. 414 415The sname:VkVideoDecodeH265SessionParametersCreateInfoKHR structure is 416defined as: 417 418include::{generated}/api/structs/VkVideoDecodeH265SessionParametersCreateInfoKHR.adoc[] 419 420 * pname:sType is a elink:VkStructureType value identifying this structure. 421 * pname:pNext is `NULL` or a pointer to a structure extending this 422 structure. 423 * pname:maxStdVPSCount is the maximum number of <<decode-h265-vps,H.265 424 VPS>> entries the created sname:VkVideoSessionParametersKHR can: 425 contain. 426 * pname:maxStdSPSCount is the maximum number of <<decode-h265-sps,H.265 427 SPS>> entries the created sname:VkVideoSessionParametersKHR can: 428 contain. 429 * pname:maxStdPPSCount is the maximum number of <<decode-h265-pps,H.265 430 PPS>> entries the created sname:VkVideoSessionParametersKHR can: 431 contain. 432 * pname:pParametersAddInfo is `NULL` or a pointer to a 433 slink:VkVideoDecodeH265SessionParametersAddInfoKHR structure specifying 434 H.265 parameters to add upon object creation. 435 436include::{generated}/validity/structs/VkVideoDecodeH265SessionParametersCreateInfoKHR.adoc[] 437-- 438 439[open,refpage='VkVideoDecodeH265SessionParametersAddInfoKHR',desc='Structure specifies H.265 decoder parameter set information',type='structs'] 440-- 441The sname:VkVideoDecodeH265SessionParametersAddInfoKHR structure is defined 442as: 443 444include::{generated}/api/structs/VkVideoDecodeH265SessionParametersAddInfoKHR.adoc[] 445 446 * pname:sType is a elink:VkStructureType value identifying this structure. 447 * pname:pNext is `NULL` or a pointer to a structure extending this 448 structure. 449 * pname:stdVPSCount is the number of elements in the pname:pStdVPSs array. 450 * pname:pStdVPSs is a pointer to an array of 451 code:StdVideoH265VideoParameterSet structures describing the 452 <<decode-h265-vps,H.265 VPS>> entries to add. 453 * pname:stdSPSCount is the number of elements in the pname:pStdSPSs array. 454 * pname:pStdSPSs is a pointer to an array of 455 code:StdVideoH265SequenceParameterSet structures describing the 456 <<decode-h265-sps,H.265 SPS>> entries to add. 457 * pname:stdPPSCount is the number of elements in the pname:pStdPPSs array. 458 * pname:pStdPPSs is a pointer to an array of 459 code:StdVideoH265PictureParameterSet structures describing the 460 <<decode-h265-pps,H.265 PPS>> entries to add. 461 462This structure can: be specified in the following places: 463 464 * In the pname:pParametersAddInfo member of the 465 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure 466 specified in the pname:pNext chain of 467 slink:VkVideoSessionParametersCreateInfoKHR used to create a 468 <<video-session-parameters,video session parameters>> object. 469 In this case, if the video codec operation the video session parameters 470 object is created with is 471 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then it defines the 472 set of initial parameters to add to the created object (see 473 <<creating-video-session-parameters,Creating Video Session 474 Parameters>>). 475 * In the pname:pNext chain of slink:VkVideoSessionParametersUpdateInfoKHR. 476 In this case, if the video codec operation the 477 <<video-session-parameters,video session parameters>> object to be 478 updated was created with is 479 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then it defines the 480 set of parameters to add to it (see 481 <<video-session-parameters-update,Updating Video Session Parameters>>). 482 483.Valid Usage 484**** 485 * [[VUID-VkVideoDecodeH265SessionParametersAddInfoKHR-None-04833]] 486 The pname:vps_video_parameter_set_id member of each 487 code:StdVideoH265VideoParameterSet structure specified in the elements 488 of pname:pStdVPSs must: be unique within pname:pStdVPSs 489 * [[VUID-VkVideoDecodeH265SessionParametersAddInfoKHR-None-04834]] 490 The pair constructed from the pname:sps_video_parameter_set_id and 491 pname:sps_seq_parameter_set_id members of each 492 code:StdVideoH265SequenceParameterSet structure specified in the 493 elements of pname:pStdSPSs must: be unique within pname:pStdSPSs 494 * [[VUID-VkVideoDecodeH265SessionParametersAddInfoKHR-None-04835]] 495 The triplet constructed from the pname:sps_video_parameter_set_id, 496 pname:pps_seq_parameter_set_id, and pname:pps_pic_parameter_set_id 497 members of each code:StdVideoH265PictureParameterSet structure specified 498 in the elements of pname:pStdPPSs must: be unique within pname:pStdPPSs 499**** 500 501include::{generated}/validity/structs/VkVideoDecodeH265SessionParametersAddInfoKHR.adoc[] 502-- 503 504 505=== H.265 Decoding Parameters 506 507[open,refpage='VkVideoDecodeH265PictureInfoKHR',desc='Structure specifies H.265 picture information when decoding a frame',type='structs'] 508-- 509The sname:VkVideoDecodeH265PictureInfoKHR structure is defined as: 510 511include::{generated}/api/structs/VkVideoDecodeH265PictureInfoKHR.adoc[] 512 513 * pname:sType is a elink:VkStructureType value identifying this structure. 514 * pname:pNext is `NULL` or a pointer to a structure extending this 515 structure. 516 * pname:pStdPictureInfo is a pointer to a 517 code:StdVideoDecodeH265PictureInfo structure specifying 518 <<decode-h265-picture-info,H.265 picture information>>. 519 * pname:sliceSegmentCount is the number of elements in 520 pname:pSliceSegmentOffsets. 521 * pname:pSliceSegmentOffsets is a pointer to an array of 522 pname:sliceSegmentCount offsets specifying the start offset of the slice 523 segments of the picture within the video bitstream buffer range 524 specified in slink:VkVideoDecodeInfoKHR. 525 526This structure is specified in the pname:pNext chain of the 527slink:VkVideoDecodeInfoKHR structure passed to flink:vkCmdDecodeVideoKHR to 528specify the codec-specific picture information for an <<decode-h265,H.265 529decode operation>>. 530 531[[decode-h265-output-picture-info]] 532Decode Output Picture Information:: 533 534When this structure is specified in the pname:pNext chain of the 535slink:VkVideoDecodeInfoKHR structure passed to flink:vkCmdDecodeVideoKHR, 536the information related to the <<decode-output-picture-info,decode output 537picture>> is defined as follows: 538 539 * The image subregion used is determined according to the 540 <<decode-h265-picture-data-access,H.265 Decode Picture Data Access>> 541 section. 542 * The decode output picture is associated with the 543 <<decode-h265-picture-info,H.265 picture information>> provided in 544 pname:pStdPictureInfo. 545 546[[decode-h265-picture-info]] 547Std Picture Information:: 548 549The members of the code:StdVideoDecodeH265PictureInfo structure pointed to 550by pname:pStdPictureInfo are interpreted as follows: 551 552 * code:reserved is used only for padding purposes and is otherwise 553 ignored; 554 * code:flags.IrapPicFlag as defined in section 3.73 of the <<itu-t-h265, 555 ITU-T H.265 Specification>>; 556 * code:flags.IdrPicFlag as defined in section 3.67 of the 557 <<itu-t-h265,ITU-T H.265 Specification>>; 558 * code:flags.IsReference as defined in section 3.132 of the <<itu-t-h265, 559 ITU-T H.265 Specification>>; 560 * code:sps_video_parameter_set_id, code:pps_seq_parameter_set_id, and 561 code:pps_pic_parameter_set_id are used to identify the active parameter 562 sets, as described below; 563 * code:PicOrderCntVal as defined in section 8.3.1 of the 564 <<itu-t-h265,ITU-T H.265 Specification>>; 565 * code:NumBitsForSTRefPicSetInSlice is the number of bits used in 566 `st_ref_pic_set` when `short_term_ref_pic_set_sps_flag` is `0`, or `0` 567 otherwise, as defined in sections 7.4.7 and 7.4.8 of the <<itu-t-h265, 568 ITU-T H.265 Specification>>; 569 * code:NumDeltaPocsOfRefRpsIdx is the value of `NumDeltaPocs[RefRpsIdx]` 570 when `short_term_ref_pic_set_sps_flag` is `1`, or `0` otherwise, as 571 defined in sections 7.4.7 and 7.4.8 of the <<itu-t-h265,ITU-T H.265 572 Specification>>; 573 * code:RefPicSetStCurrBefore, code:RefPicSetStCurrAfter, and 574 code:RefPicSetLtCurr are interpreted as defined in section 8.3.2 of the 575 <<itu-t-h265,ITU-T H.265 Specification>> where each element of these 576 arrays either identifies an 577 <<decode-active-reference-picture-info,active reference picture>> using 578 its <<dpb-slot,DPB slot>> index or contains the value 0xFF to indicate 579 "no reference picture"; 580 * all other members are interpreted as defined in section 8.3.2 of the 581 <<itu-t-h265,ITU-T H.265 Specification>>. 582 583Active Parameter Sets:: 584 585The members of the code:StdVideoDecodeH265PictureInfo structure pointed to 586by pname:pStdPictureInfo are used to select the active parameter sets to use 587from the bound video session parameters object, as follows: 588 589 * [[decode-h265-active-vps]] The _active VPS_ is the 590 <<decode-h265-vps,VPS>> identified by the key specified in 591 code:StdVideoDecodeH265PictureInfo::code:sps_video_parameter_set_id. 592 * [[decode-h265-active-sps]] The _active SPS_ is the 593 <<decode-h265-sps,SPS>> identified by the key specified by the pair 594 constructed from 595 code:StdVideoDecodeH265PictureInfo::code:sps_video_parameter_set_id and 596 code:StdVideoDecodeH265PictureInfo::code:pps_seq_parameter_set_id. 597 * [[decode-h265-active-pps]] The _active PPS_ is the 598 <<decode-h265-pps,PPS>> identified by the key specified by the triplet 599 constructed from 600 code:StdVideoDecodeH265PictureInfo::code:sps_video_parameter_set_id, 601 code:StdVideoDecodeH265PictureInfo::code:pps_seq_parameter_set_id, and 602 code:StdVideoDecodeH265PictureInfo::code:pps_pic_parameter_set_id. 603 604include::{generated}/validity/structs/VkVideoDecodeH265PictureInfoKHR.adoc[] 605-- 606 607[open,refpage='VkVideoDecodeH265DpbSlotInfoKHR',desc='Structure specifies H.265 DPB information when decoding a frame',type='structs'] 608-- 609The sname:VkVideoDecodeH265DpbSlotInfoKHR structure is defined as: 610 611include::{generated}/api/structs/VkVideoDecodeH265DpbSlotInfoKHR.adoc[] 612 613 * pname:sType is a elink:VkStructureType value identifying this structure. 614 * pname:pNext is `NULL` or a pointer to a structure extending this 615 structure. 616 * pname:pStdReferenceInfo is a pointer to a 617 code:StdVideoDecodeH265ReferenceInfo structure specifying reference 618 picture information described in section 8.3 of the <<itu-t-h265,ITU-T 619 H.265 Specification>>. 620 621This structure is specified in the pname:pNext chain of 622slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot, if not `NULL`, and 623the pname:pNext chain of the elements of 624slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots to specify the 625codec-specific reference picture information for an <<decode-h265,H.265 626decode operation>>. 627 628[[decode-h265-active-reference-picture-info]] 629Active Reference Picture Information:: 630 631When this structure is specified in the pname:pNext chain of the elements of 632slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots, one element is added to 633the list of <<decode-active-reference-picture-info,active reference 634pictures>> used by the video decode operation for each element of 635slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots as follows: 636 637 * The image subregion used is determined according to the 638 <<decode-h265-picture-data-access,H.265 Decode Picture Data Access>> 639 section. 640 * The reference picture is associated with the <<dpb-slot,DPB slot>> index 641 specified in the pname:slotIndex member of the corresponding element of 642 slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots. 643 * The reference picture is associated with the 644 <<decode-h265-reference-info,H.265 reference information>> provided in 645 pname:pStdReferenceInfo. 646 647[[decode-h265-reconstructed-picture-info]] 648Reconstructed Picture Information:: 649 650When this structure is specified in the pname:pNext chain of 651slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot, the information 652related to the <<decode-reconstructed-picture-info,reconstructed picture>> 653is defined as follows: 654 655 * The image subregion used is determined according to the 656 <<decode-h265-picture-data-access,H.265 Decode Picture Data Access>> 657 section. 658 * The reconstructed picture is used to <<dpb-slot-states,activate>> the 659 <<dpb-slot,DPB slot>> with the index specified in 660 slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->slotIndex. 661 * The reconstructed picture is associated with the 662 <<decode-h265-reference-info,H.265 reference information>> provided in 663 pname:pStdReferenceInfo. 664 665[[decode-h265-reference-info]] 666Std Reference Information:: 667 668The members of the code:StdVideoDecodeH265ReferenceInfo structure pointed to 669by pname:pStdReferenceInfo are interpreted as follows: 670 671 * code:flags.used_for_long_term_reference is used to indicate whether the 672 picture is marked as "`used for long-term reference`" as defined in 673 section 8.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>; 674 * code:flags.unused_for_reference is used to indicate whether the picture 675 is marked as "`unused for reference`" as defined in section 8.3.2 of the 676 <<itu-t-h265,ITU-T H.265 Specification>>; 677 * all other members are interpreted as defined in section 8.3 of the 678 <<itu-t-h265,ITU-T H.265 Specification>>. 679 680include::{generated}/validity/structs/VkVideoDecodeH265DpbSlotInfoKHR.adoc[] 681-- 682 683 684[[decode-h265-requirements]] 685=== H.265 Decode Requirements 686 687This section describes the required: H.265 decoding capabilities for 688physical devices that have at least one queue family that supports the video 689codec operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, as 690returned by flink:vkGetPhysicalDeviceQueueFamilyProperties2 in 691slink:VkQueueFamilyVideoPropertiesKHR::pname:videoCodecOperations. 692 693.Required <<video-std-header-version,Video Std Header Versions>> 694[options="header"] 695|==== 696| Video Std Header Name | Version 697| `vulkan_video_codec_h265std_decode` | 1.0.0 698|==== 699