1// Copyright 2018-2024 The Khronos Group Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[[encode-h265]] 6== H.265 Encode Operations 7 8Video encode operations using an <<encode-h265-profile,H.265 encode 9profile>> can: be used to encode 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 <<encode-operation-steps,video 21encode operation steps>> with the codec-specific semantics defined in 22section 8 of the <<itu-t-h265,ITU-T H.265 Specification>> as follows: 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 <<encode-h265-active-vps,active VPS>> specifying the <<encode-h265-vps, 28 H.265 video parameter set>>. 29 ** The code:StdVideoH265SequenceParameterSet structure corresponding to 30 the <<encode-h265-active-sps,active SPS>> specifying the 31 <<encode-h265-sps, H.265 sequence parameter set>>. 32 ** The code:StdVideoH265PictureParameterSet structure corresponding to the 33 <<encode-h265-active-pps,active PPS>> specifying the <<encode-h265-pps, 34 H.265 picture parameter set>>. 35 ** The code:StdVideoEncodeH265PictureInfo structure specifying the 36 <<encode-h265-picture-info,H.265 picture information>>. 37 ** The code:StdVideoEncodeH265SliceSegmentHeader structures specifying the 38 <<encode-h265-slice-segment-header-params,H.265 slice segment header 39 parameters>> for each encoded H.265 slice segment. 40 ** The code:StdVideoEncodeH265ReferenceInfo structures specifying the 41 <<encode-h265-reference-info,H.265 reference information>> 42 corresponding to the optional <<reconstructed-picture,reconstructed 43 picture>> and any <<active-reference-pictures,active reference 44 pictures>>. 45 * The encoded bitstream data is written to the destination video bitstream 46 buffer range as defined in the 47 <<encode-h265-bitstream-data-access,H.265 Encode Bitstream Data 48 Access>> section. 49 * Picture data in the <<video-picture-resources,video picture resources>> 50 corresponding to the used <<encode-input-picture,encode input 51 picture>>, <<active-reference-pictures,active reference pictures>>, and 52 optional <<reconstructed-picture,reconstructed picture>> is accessed as 53 defined in the <<encode-h265-picture-data-access,H.265 Encode Picture 54 Data Access>> section. 55 * The decision on <<encode-ref-pic-setup,reference picture setup>> is made 56 according to the parameters specified in the 57 <<encode-h265-ref-pic-setup,H.265 picture information>>. 58 59If the parameters adhere to the syntactic and semantic requirements defined 60in the corresponding sections of the <<itu-t-h265,ITU-T H.265 61Specification>>, as described above, and the <<dpb-slot,DPB slots>> 62associated with the <<active-reference-pictures,active reference pictures>> 63all refer to <<dpb-slot-states,valid picture references>>, then the video 64encode operation will complete successfully. 65Otherwise, the video encode operation may: complete 66<<encode-unsuccessful,unsuccessfully>>. 67 68 69[[encode-h265-overrides]] 70=== H.265 Encode Parameter Overrides 71 72Implementations may: override, unless otherwise specified, any of the H.265 73encode parameters specified in the following Video Std structures: 74 75 * code:StdVideoH265VideoParameterSet 76 * code:StdVideoH265SequenceParameterSet 77 * code:StdVideoH265PictureParameterSet 78 * code:StdVideoEncodeH265PictureInfo 79 * code:StdVideoEncodeH265SliceSegmentHeader 80 * code:StdVideoEncodeH265ReferenceInfo 81 82All such H.265 encode parameter overrides must: fulfill the conditions 83defined in the <<encode-overrides,Video Encode Parameter Overrides>> 84section. 85 86In addition, implementations must: not override any of the following H.265 87encode parameters: 88 89 * code:StdVideoEncodeH265PictureInfo::code:pic_type 90 * code:StdVideoEncodeH265SliceSegmentHeader::code:slice_type 91 92In case of H.265 encode parameters stored in 93<<encode-h265-parameter-sets,video session parameters>> objects, 94applications need to use the flink:vkGetEncodedVideoSessionParametersKHR 95command to determine whether any implementation overrides happened. 96If the query indicates that implementation overrides were applied, then the 97application needs to retrieve and use the encoded H.265 parameter sets in 98the bitstream in order to be able to produce a compliant H.265 video 99bitstream using the H.265 encode parameters stored in the video session 100parameters object. 101 102In case of any H.265 encode parameters stored in the encoded bitstream 103produced by video encode operations, if the implementation supports the 104ename:VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR 105<<queries-video-encode-feedback,video encode feedback query>> flag, the 106application can: use such queries to retrieve feedback about whether any 107implementation overrides have been applied to those H.265 encode parameters. 108 109 110[[encode-h265-bitstream-data-access]] 111=== H.265 Encode Bitstream Data Access 112 113Each video encode operation writes one or more VCL NAL units comprising of 114slice segment headers and data of the encoded picture, in the format defined 115in sections 7.3.6 and 7.3.8, according to the semantics defined in sections 1167.4.7 and 7.4.9 of the <<itu-t-h265,ITU-T H.265 Specification>>, 117respectively. 118The number of VCL NAL units written is specified by 119slink:VkVideoEncodeH265PictureInfoKHR::pname:naluSliceSegmentEntryCount. 120 121 122[[encode-h265-picture-data-access]] 123=== H.265 Encode Picture Data Access 124 125Accesses to image data within a video picture resource happen at the 126granularity indicated by 127slink:VkVideoCapabilitiesKHR::pname:pictureAccessGranularity, as returned by 128flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used <<video-profiles, 129video profile>>. 130Accordingly, the complete image subregion of a <<encode-input-picture,encode 131input picture>>, <<reference-picture,reference picture>>, or 132<<reconstructed-picture,reconstructed picture>> accessed by video coding 133operations using an <<encode-h265-profile,H.265 encode profile>> is defined 134as the set of texels within the coordinate range: 135 136 {empty}:: [eq]#([0,pname:endX),[0,pname:endY))# 137 138Where: 139 140 * [eq]#pname:endX# equals [eq]#pname:codedExtent.width# rounded up to the 141 nearest integer multiple of pname:pictureAccessGranularity.width and 142 clamped to the width of the image subresource 143 <<video-image-subresource-reference,referred>> to by the corresponding 144 slink:VkVideoPictureResourceInfoKHR structure; 145 * [eq]#endY# equals [eq]#pname:codedExtent.height# rounded up to the 146 nearest integer multiple of pname:pictureAccessGranularity.height and 147 clamped to the height of the image subresource 148 <<video-image-subresource-reference,referred>> to by the corresponding 149 slink:VkVideoPictureResourceInfoKHR structure; 150 151Where pname:codedExtent is the member of the 152slink:VkVideoPictureResourceInfoKHR structure corresponding to the picture. 153 154In case of video encode operations using an <<encode-h265-profile,H.265 155encode profile>>, any access to a picture at the coordinates 156[eq]#(pname:x,pname:y)#, as defined by the <<itu-t-h265,ITU-T H.265 157Specification>>, is an access to the image subresource 158<<video-image-subresource-reference,referred>> to by the corresponding 159slink:VkVideoPictureResourceInfoKHR structure at the texel coordinates 160[eq]#(pname:x,pname:y)#. 161 162Implementations may: choose not to access some or all texels within 163particular <<reference-picture,reference pictures>> available to a video 164encode operation (e.g. due to <<encode-overrides,video encode parameter 165overrides>> restricting the effective set of used reference pictures, or if 166the encoding algorithm chooses not to use certain subregions of the 167reference picture data for sample prediction). 168 169 170[[encode-h265-frame-picture-slice-type]] 171=== H.265 Frame, Picture, Slice Segments, and Tiles 172 173H.265 pictures consist of one or more slices, slice segments, and tiles, as 174defined in section 6.3.1 of the <<itu-t-h265,ITU-T H.265 Specification>>. 175 176Video encode operations using an <<encode-h265-profile,H.265 encode 177profile>> can: encode slice segments of different types, as defined in 178section 7.4.7.1 of the <<itu-t-h265,ITU-T H.265 Specification>>, by 179specifying the corresponding enumeration constant value in 180code:StdVideoEncodeH265SliceSegmentHeader::code:slice_type in the 181<<encode-h265-slice-segment-header-params,H.265 slice segment header 182parameters>> from the Video Std enumeration type code:StdVideoH265SliceType: 183 184 * [[encode-h265-b-slice]] code:STD_VIDEO_H265_SLICE_TYPE_B indicates that 185 the slice segment is part of a _B slice_ as defined in section 3.12 of 186 the <<itu-t-h265,ITU-T H.265 Specification>>. 187 * [[encode-h265-p-slice]] code:STD_VIDEO_H265_SLICE_TYPE_P indicates that 188 the slice segment is part of a _P slice_ as defined in section 3.111 of 189 the <<itu-t-h265, ITU-T H.265 Specification>>. 190 * [[encode-h265-i-slice]] code:STD_VIDEO_H265_SLICE_TYPE_I indicates that 191 the slice segment is part of an _I slice_ as defined in section 3.74 of 192 the <<itu-t-h265, ITU-T H.265 Specification>>. 193 194Pictures constructed from such slice segments can: be of different types, as 195defined in section 7.4.3.5 of the <<itu-t-h265,ITU-T H.265 Specification>>. 196Video encode operations using an <<encode-h265-profile,H.265 encode 197profile>> can: encode pictures of a specific type by specifying the 198corresponding enumeration constant value in 199code:StdVideoEncodeH265PictureInfo::code:pic_type in the 200<<encode-h265-picture-info,H.265 picture information>> from the Video Std 201enumeration type code:StdVideoH265PictureType: 202 203 * [[encode-h265-p-pic]] code:STD_VIDEO_H265_PICTURE_TYPE_P indicates that 204 the picture is a _P picture_. 205 A frame consisting of a P picture is also referred to as a _P frame_. 206 * [[encode-h265-b-pic]] code:STD_VIDEO_H265_PICTURE_TYPE_B indicates that 207 the picture is a _B picture_. 208 A frame consisting of a B picture is also referred to as a _B frame_. 209 * [[encode-h265-i-pic]] code:STD_VIDEO_H265_PICTURE_TYPE_I indicates that 210 the picture is an _I picture_. 211 A frame consisting of an I picture is also referred to as an _I frame_. 212 * [[encode-h265-idr-pic]] code:STD_VIDEO_H265_PICTURE_TYPE_IDR indicates 213 that the picture is a special type of I picture called an _IDR picture_ 214 as defined in section 3.67 of the <<itu-t-h265,ITU-T H.265 215 Specification>>. 216 A frame consisting of an IDR picture is also referred to as an _IDR 217 frame_. 218 219 220[[encode-h265-profile]] 221=== H.265 Encode Profile 222 223[open,refpage='VkVideoEncodeH265ProfileInfoKHR',desc='Structure specifying H.265 encode-specific video profile parameters',type='structs'] 224-- 225A video profile supporting H.265 video encode operations is specified by 226setting slink:VkVideoProfileInfoKHR::pname:videoCodecOperation to 227ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR and adding a 228sname:VkVideoEncodeH265ProfileInfoKHR structure to the 229slink:VkVideoProfileInfoKHR::pname:pNext chain. 230 231The sname:VkVideoEncodeH265ProfileInfoKHR structure is defined as: 232 233include::{generated}/api/structs/VkVideoEncodeH265ProfileInfoKHR.adoc[] 234 235 * pname:sType is a elink:VkStructureType value identifying this structure. 236 * pname:pNext is `NULL` or a pointer to a structure extending this 237 structure. 238 * pname:stdProfileIdc is a code:StdVideoH265ProfileIdc value specifying 239 the H.265 codec profile IDC, as defined in section A.3 of the 240 <<itu-t-h265,ITU-T H.265 Specification>>. 241 242include::{generated}/validity/structs/VkVideoEncodeH265ProfileInfoKHR.adoc[] 243-- 244 245 246=== H.265 Encode Capabilities 247 248[open,refpage='VkVideoEncodeH265CapabilitiesKHR',desc='Structure describing H.265 encode capabilities',type='structs'] 249-- 250When calling flink:vkGetPhysicalDeviceVideoCapabilitiesKHR to query the 251capabilities for an <<encode-h265-profile,H.265 encode profile>>, the 252slink:VkVideoCapabilitiesKHR::pname:pNext chain must: include a 253sname:VkVideoEncodeH265CapabilitiesKHR structure that will be filled with 254the profile-specific capabilities. 255 256The sname:VkVideoEncodeH265CapabilitiesKHR structure is defined as: 257 258include::{generated}/api/structs/VkVideoEncodeH265CapabilitiesKHR.adoc[] 259 260 * pname:sType is a elink:VkStructureType value identifying this structure. 261 * pname:pNext is `NULL` or a pointer to a structure extending this 262 structure. 263 * pname:flags is a bitmask of elink:VkVideoEncodeH265CapabilityFlagBitsKHR 264 indicating supported H.265 encoding capabilities. 265 * pname:maxLevelIdc is a code:StdVideoH265LevelIdc value indicating the 266 maximum H.265 level supported by the profile, where enum constant 267 `STD_VIDEO_H265_LEVEL_IDC_<major>_<minor>` identifies H.265 level 268 `<major>.<minor>` as defined in section A.4 of the <<itu-t-h265,ITU-T 269 H.265 Specification>>. 270 * pname:maxSliceSegmentCount indicates the maximum number of slice 271 segments that can: be encoded for a single picture. 272 Further restrictions may: apply to the number of slice segments that 273 can: be encoded for a single picture depending on other capabilities and 274 codec-specific rules. 275 * pname:maxTiles indicates the maximum number of H.265 tile columns and 276 rows, as defined in sections 3.175 and 3.176 of the <<itu-t-h265,ITU-T 277 H.265 Specification>> that can: be encoded for a single picture. 278 Further restrictions may: apply to the number of H.265 tiles that can: 279 be encoded for a single picture depending on other capabilities and 280 codec-specific rules. 281 * pname:ctbSizes is a bitmask of elink:VkVideoEncodeH265CtbSizeFlagBitsKHR 282 describing the supported CTB sizes. 283 * pname:transformBlockSizes is a bitmask of 284 elink:VkVideoEncodeH265TransformBlockSizeFlagBitsKHR describing the 285 supported transform block sizes. 286 * pname:maxPPictureL0ReferenceCount indicates the maximum number of 287 reference pictures the implementation supports in the reference list L0 288 for <<encode-h265-p-pic,P pictures>>. 289+ 290[NOTE] 291.Note 292==== 293As implementations may: <<encode-overrides,override>> the reference lists, 294pname:maxPPictureL0ReferenceCount does not limit the number of elements that 295the application can: specify in the L0 reference list for P pictures. 296However, if pname:maxPPictureL0ReferenceCount is zero, then the use of P 297pictures is not allowed. 298In case of H.265 encoding, backward-only predictive pictures can: be encoded 299even if P pictures are not supported, as the <<itu-t-h265,ITU-T H.265 300Specification>> supports _generalized P & B frames_ (also known as low delay 301B frames) whereas B frames can: refer to past frames through both the L0 and 302L1 reference lists. 303==== 304 * pname:maxBPictureL0ReferenceCount indicates the maximum number of 305 reference pictures the implementation supports in the reference list L0 306 for <<encode-h265-b-pic,B pictures>>. 307 * pname:maxL1ReferenceCount indicates the maximum number of reference 308 pictures the implementation supports in the reference list L1 if 309 encoding of <<encode-h265-b-pic,B pictures>> is supported. 310+ 311[NOTE] 312.Note 313==== 314As implementations may: <<encode-overrides,override>> the reference lists, 315pname:maxBPictureL0ReferenceCount and pname:maxL1ReferenceCount does not 316limit the number of elements that the application can: specify in the L0 and 317L1 reference lists for B pictures. 318However, if pname:maxBPictureL0ReferenceCount and pname:maxL1ReferenceCount 319are both zero, then the use of B pictures is not allowed. 320==== 321 * pname:maxSubLayerCount indicates the maximum number of H.265 sub-layers 322 supported by the implementation. 323 * pname:expectDyadicTemporalSubLayerPattern indicates that the 324 implementation's rate control algorithms expect the application to use a 325 <<encode-h265-layer-pattern-dyadic,dyadic temporal sub-layer pattern>> 326 when encoding multiple temporal sub-layers. 327 * pname:minQp indicates the minimum QP value supported. 328 * pname:maxQp indicates the maximum QP value supported. 329 * pname:prefersGopRemainingFrames indicates that the implementation's rate 330 control algorithm prefers the application to specify the number of 331 frames of each type <<encode-h265-gop-remaining-frames,remaining>> in 332 the current <<encode-h265-gop,group of pictures>> when beginning a 333 <<video-coding-scope,video coding scope>>. 334 * pname:requiresGopRemainingFrames indicates that the implementation's 335 rate control algorithm requires the application to specify the number of 336 frames of each type <<encode-h265-gop-remaining-frames,remaining>> in 337 the current <<encode-h265-gop,group of pictures>> when beginning a 338 <<video-coding-scope,video coding scope>>. 339 * pname:stdSyntaxFlags is a bitmask of 340 elink:VkVideoEncodeH265StdFlagBitsKHR indicating capabilities related to 341 H.265 syntax elements. 342 343include::{generated}/validity/structs/VkVideoEncodeH265CapabilitiesKHR.adoc[] 344-- 345 346 347[open,refpage='VkVideoEncodeH265CapabilityFlagBitsKHR',desc='Video encode H.265 capability flags',type='enums'] 348-- 349Bits which may: be set in 350slink:VkVideoEncodeH265CapabilitiesKHR::pname:flags, indicating the H.265 351encoding capabilities supported, are: 352 353include::{generated}/api/enums/VkVideoEncodeH265CapabilityFlagBitsKHR.adoc[] 354 355 * ename:VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_KHR indicates 356 if the implementation may: be able to generate HRD compliant bitstreams 357 if any of the code:nal_hrd_parameters_present_flag, 358 code:vcl_hrd_parameters_present_flag, or 359 code:sub_pic_hrd_params_present_flag members of 360 code:StdVideoH265HrdFlags are set to `1` in the HRD parameters of the 361 <<encode-h265-active-vps,active VPS>> or <<encode-h265-active-sps,active 362 SPS>>, or if 363 code:StdVideoH265SpsVuiFlags::code:vui_hrd_parameters_present_flag is 364 set to `1` in the <<encode-h265-active-sps,active SPS>>. 365 * ename:VK_VIDEO_ENCODE_H265_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR 366 indicates that if the code:weighted_pred_flag or the 367 code:weighted_bipred_flag member of code:StdVideoH265PpsFlags is set to 368 `1` in the <<encode-h265-active-pps,active PPS>> when encoding a 369 <<encode-h265-p-pic,P picture>> or <<encode-h265-b-pic,B picture>>, 370 respectively, then the implementation is able to internally decide 371 syntax for code:pred_weight_table, as defined in section 7.4.7.3 of the 372 <<itu-t-h265,ITU-T H.265 Specification>>, and the application is not 373 required: to provide a weight table in the 374 <<encode-h265-slice-segment-header-params,H.265 slice segment header 375 parameters>>. 376 * ename:VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_KHR 377 indicates that each slice segment in a frame with a single or multiple 378 tiles per slice may begin or finish at any offset in a CTB row. 379 If not supported, all slice segments in such a frame must: begin at the 380 start of a CTB row (and hence each slice segment must: finish at the end 381 of a CTB row). 382 Also indicates that each slice segment in a frame with multiple slices 383 per tile may begin or finish at any offset within the enclosing tile's 384 CTB row. 385 If not supported, slice segments in such a frame must: begin at the 386 start of the enclosing tile's CTB row (and hence each slice segment 387 must: finish at the end of the enclosing tile's CTB row). 388 * ename:VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_SEGMENT_TYPE_BIT_KHR 389 indicates that when a frame is encoded with multiple slice segments, the 390 implementation allows encoding each slice segment with a different 391 code:StdVideoEncodeH265SliceSegmentHeader::code:slice_type specified in 392 the <<encode-h265-slice-segment-header-params,H.265 slice segment header 393 parameters>>. 394 If not supported, all slice segments of the frame must: be encoded with 395 the same code:slice_type which corresponds to the picture type of the 396 frame. 397 * ename:VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR 398 indicates support for using a <<encode-h265-b-pic,B frame>> as L0 399 reference, as specified in 400 code:StdVideoEncodeH265ReferenceListsInfo::code:RefPicList0 in the 401 <<encode-h265-picture-info,H.265 picture information>>. 402 * ename:VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR 403 indicates support for using a <<encode-h265-b-pic,B frame>> as L1 404 reference, as specified in 405 code:StdVideoEncodeH265ReferenceListsInfo::code:RefPicList1 in the 406 <<encode-h265-picture-info,H.265 picture information>>. 407 * ename:VK_VIDEO_ENCODE_H265_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR 408 indicates support for specifying different QP values in the members of 409 slink:VkVideoEncodeH265QpKHR. 410 * ename:VK_VIDEO_ENCODE_H265_CAPABILITY_PER_SLICE_SEGMENT_CONSTANT_QP_BIT_KHR 411 indicates support for specifying different constant QP values for each 412 slice segment. 413 * ename:VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILES_PER_SLICE_SEGMENT_BIT_KHR 414 indicates if encoding multiple tiles per slice segment, as defined in 415 section 6.3.1 of the <<itu-t-h265,ITU-T H.265 Specification>>, is 416 supported. 417 If this capability flag is not present, then the implementation is only 418 able to encode a single tile for each slice segment. 419 * ename:VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_SEGMENTS_PER_TILE_BIT_KHR 420 indicates if encoding multiple slice segments per tile, as defined in 421 section 6.3.1 of the <<itu-t-h265,ITU-T H.265 Specification>>, is 422 supported. 423 If this capability flag is not present, then the implementation is only 424 able to encode a single slice segment for each tile. 425-- 426 427[open,refpage='VkVideoEncodeH265CapabilityFlagsKHR',desc='Bitmask of VkVideoEncodeH265CapabilityFlagBitsKHR',type='flags'] 428-- 429include::{generated}/api/flags/VkVideoEncodeH265CapabilityFlagsKHR.adoc[] 430 431tname:VkVideoEncodeH265CapabilityFlagsKHR is a bitmask type for setting a 432mask of zero or more elink:VkVideoEncodeH265CapabilityFlagBitsKHR. 433-- 434 435[open,refpage='VkVideoEncodeH265StdFlagBitsKHR',desc='Video encode H.265 syntax capability flags',type='enums'] 436-- 437Bits which may: be set in 438slink:VkVideoEncodeH265CapabilitiesKHR::pname:stdSyntaxFlags, indicating the 439capabilities related to the H.265 syntax elements, are: 440 441include::{generated}/api/enums/VkVideoEncodeH265StdFlagBitsKHR.adoc[] 442 443 * ename:VK_VIDEO_ENCODE_H265_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR 444 indicates whether the implementation supports using the 445 application-provided value for 446 code:StdVideoH265SpsFlags::code:separate_colour_plane_flag in the 447 <<encode-h265-sps,SPS>> when that value is `1`. 448 * ename:VK_VIDEO_ENCODE_H265_STD_SAMPLE_ADAPTIVE_OFFSET_ENABLED_FLAG_SET_BIT_KHR 449 indicates whether the implementation supports using the 450 application-provided value for 451 code:StdVideoH265SpsFlags::code:sample_adaptive_offset_enabled_flag in 452 the <<encode-h265-sps,SPS>> when that value is `1`. 453 * ename:VK_VIDEO_ENCODE_H265_STD_SCALING_LIST_DATA_PRESENT_FLAG_SET_BIT_KHR 454 indicates whether the implementation supports using the 455 application-provided value for the code:scaling_list_enabled_flag and 456 code:sps_scaling_list_data_present_flag members of 457 code:StdVideoH265SpsFlags in the <<encode-h265-sps,SPS>>, and the 458 application-provided value for 459 code:StdVideoH265PpsFlags::code:pps_scaling_list_data_present_flag in 460 the <<encode-h265-pps,PPS>> when those values are `1`. 461 * ename:VK_VIDEO_ENCODE_H265_STD_PCM_ENABLED_FLAG_SET_BIT_KHR indicates 462 whether the implementation supports using the application-provided value 463 for code:StdVideoH265SpsFlags::code:pcm_enable_flag in the 464 <<encode-h265-sps,SPS>> when that value is `1`. 465 * ename:VK_VIDEO_ENCODE_H265_STD_SPS_TEMPORAL_MVP_ENABLED_FLAG_SET_BIT_KHR 466 indicates whether the implementation supports using the 467 application-provided value for 468 code:StdVideoH265SpsFlags::code:sps_temporal_mvp_enabled_flag in the 469 <<encode-h265-sps,SPS>> when that value is `1`. 470 * ename:VK_VIDEO_ENCODE_H265_STD_INIT_QP_MINUS26_BIT_KHR indicates whether 471 the implementation supports using the application-provided value for 472 code:StdVideoH265PictureParameterSet::code:init_qp_minus26 in the 473 <<encode-h265-pps,PPS>> when that value is non-zero. 474 * ename:VK_VIDEO_ENCODE_H265_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR indicates 475 whether the implementation supports using the application-provided value 476 for code:StdVideoH265PpsFlags::code:weighted_pred_flag in the 477 <<encode-h265-pps,PPS>> when that value is `1`. 478 * ename:VK_VIDEO_ENCODE_H265_STD_WEIGHTED_BIPRED_FLAG_SET_BIT_KHR 479 indicates whether the implementation supports using the 480 application-provided value for 481 code:StdVideoH265PpsFlags::code:weighted_bipred_flag in the 482 <<encode-h265-pps,PPS>> when that value is `1`. 483 * ename:VK_VIDEO_ENCODE_H265_STD_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_KHR 484 indicates whether the implementation supports using the 485 application-provided value for 486 code:StdVideoH265PictureParameterSet::code:log2_parallel_merge_level_minus2 487 in the <<encode-h265-pps,PPS>> when that value is non-zero. 488 * ename:VK_VIDEO_ENCODE_H265_STD_SIGN_DATA_HIDING_ENABLED_FLAG_SET_BIT_KHR 489 indicates whether the implementation supports using the 490 application-provided value for 491 code:StdVideoH265PpsFlags::code:sign_data_hiding_enabled_flag in the 492 <<encode-h265-pps,PPS>> when that value is `1`. 493 * ename:VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_SET_BIT_KHR 494 indicates whether the implementation supports using the 495 application-provided value for 496 code:StdVideoH265PpsFlags::code:transform_skip_enabled_flag in the 497 <<encode-h265-pps,PPS>> when that value is `1`. 498 * ename:VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_UNSET_BIT_KHR 499 indicates whether the implementation supports using the 500 application-provided value for 501 code:StdVideoH265PpsFlags::code:transform_skip_enabled_flag in the 502 <<encode-h265-pps,PPS>> when that value is `0`. 503 * ename:VK_VIDEO_ENCODE_H265_STD_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_FLAG_SET_BIT_KHR 504 indicates whether the implementation supports using the 505 application-provided value for 506 code:StdVideoH265PpsFlags::code:pps_slice_chroma_qp_offsets_present_flag 507 in the <<encode-h265-pps,PPS>> when that value is `1`. 508 * ename:VK_VIDEO_ENCODE_H265_STD_TRANSQUANT_BYPASS_ENABLED_FLAG_SET_BIT_KHR 509 indicates whether the implementation supports using the 510 application-provided value for 511 code:StdVideoH265PpsFlags::code:transquant_bypass_enabled_flag in the 512 <<encode-h265-pps,PPS>> when that value is `1`. 513 * ename:VK_VIDEO_ENCODE_H265_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR 514 indicates whether the implementation supports using the 515 application-provided value for 516 code:StdVideoH265PpsFlags::code:constrained_intra_pred_flag in the 517 <<encode-h265-pps,PPS>> when that value is `1`. 518 * ename:VK_VIDEO_ENCODE_H265_STD_ENTROPY_CODING_SYNC_ENABLED_FLAG_SET_BIT_KHR 519 indicates whether the implementation supports using the 520 application-provided value for 521 code:StdVideoH265PpsFlags::code:entropy_coding_sync_enabled_flag in the 522 <<encode-h265-pps,PPS>> when that value is `1`. 523 * ename:VK_VIDEO_ENCODE_H265_STD_DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_SET_BIT_KHR 524 indicates whether the implementation supports using the 525 application-provided value for 526 code:StdVideoH265PpsFlags::code:deblocking_filter_override_enabled_flag 527 in the <<encode-h265-pps,PPS>> when that value is `1`. 528 * ename:VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG_SET_BIT_KHR 529 indicates whether the implementation supports using the 530 application-provided value for 531 code:StdVideoH265PpsFlags::code:dependent_slice_segments_enabled_flag in 532 the <<encode-h265-pps,PPS>> when that value is `1`. 533 * ename:VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_KHR 534 indicates whether the implementation supports using the 535 application-provided value for 536 code:StdVideoEncodeH265SliceSegmentHeader::code:dependent_slice_segment_flag 537 in the <<encode-h265-slice-segment-header-params,H.265 slice segment 538 header parameters>> when that value is `1`. 539 * ename:VK_VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_KHR indicates whether 540 the implementation supports using the application-provided value for 541 code:StdVideoEncodeH265SliceSegmentHeader::code:slice_qp_delta in the 542 <<encode-h265-slice-segment-header-params,H.265 slice segment header 543 parameters>> when that value is identical across the slice segments of 544 the encoded frame. 545 * ename:VK_VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR 546 indicates whether the implementation supports using the 547 application-provided value for 548 code:StdVideoEncodeH265SliceSegmentHeader::code:slice_qp_delta in the 549 <<encode-h265-slice-segment-header-params,H.265 slice segment header 550 parameters>> when that value is different across the slice segments of 551 the encoded frame. 552 553These capability flags provide information to the application about specific 554H.265 syntax element values that the implementation supports without having 555to <<encode-h265-overrides,override>> them and do not otherwise restrict the 556values that the application can: specify for any of the mentioned H.265 557syntax elements. 558-- 559 560[open,refpage='VkVideoEncodeH265StdFlagsKHR',desc='Bitmask of VkVideoEncodeH265StdFlagBitsKHR',type='flags'] 561-- 562include::{generated}/api/flags/VkVideoEncodeH265StdFlagsKHR.adoc[] 563 564tname:VkVideoEncodeH265StdFlagsKHR is a bitmask type for setting a mask of 565zero or more elink:VkVideoEncodeH265StdFlagBitsKHR. 566-- 567 568[open,refpage='VkVideoEncodeH265CtbSizeFlagBitsKHR',desc='Supported CTB sizes for H.265 video encode',type='enums'] 569-- 570Bits which may: be set in 571slink:VkVideoEncodeH265CapabilitiesKHR::pname:ctbSizes, indicating the CTB 572sizes supported by the implementation, are: 573 574include::{generated}/api/enums/VkVideoEncodeH265CtbSizeFlagBitsKHR.adoc[] 575 576 * ename:VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_KHR specifies that a CTB size 577 of 16x16 is supported. 578 * ename:VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR specifies that a CTB size 579 of 32x32 is supported. 580 * ename:VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR specifies that a CTB size 581 of 64x64 is supported. 582-- 583 584[open,refpage='VkVideoEncodeH265CtbSizeFlagsKHR',desc='Bitmask of VkVideoEncodeH265CtbSizeFlagBitsKHR',type='flags'] 585-- 586include::{generated}/api/flags/VkVideoEncodeH265CtbSizeFlagsKHR.adoc[] 587 588tname:VkVideoEncodeH265CtbSizeFlagsKHR is a bitmask type for setting a mask 589of zero or more elink:VkVideoEncodeH265CtbSizeFlagBitsKHR. 590 591Implementations must: support at least one of 592ename:VkVideoEncodeH265CtbSizeFlagBitsKHR. 593-- 594 595[open,refpage='VkVideoEncodeH265TransformBlockSizeFlagBitsKHR',desc='Supported transform block sizes for H.265 video encode',type='enums'] 596-- 597Bits which may: be set in 598slink:VkVideoEncodeH265CapabilitiesKHR::pname:transformBlockSizes, 599indicating the transform block sizes supported by the implementation, are: 600 601include::{generated}/api/enums/VkVideoEncodeH265TransformBlockSizeFlagBitsKHR.adoc[] 602 603 * ename:VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_KHR specifies that 604 a transform block size of 4x4 is supported. 605 * ename:VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_KHR specifies that 606 a transform block size of 8x8 is supported. 607 * ename:VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_KHR specifies 608 that a transform block size of 16x16 is supported. 609 * ename:VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_KHR specifies 610 that a transform block size of 32x32 is supported. 611-- 612 613[open,refpage='VkVideoEncodeH265TransformBlockSizeFlagsKHR',desc='Bitmask of VkVideoEncodeH265TransformBlockSizeFlagBitsKHR',type='flags'] 614-- 615include::{generated}/api/flags/VkVideoEncodeH265TransformBlockSizeFlagsKHR.adoc[] 616 617tname:VkVideoEncodeH265TransformBlockSizeFlagsKHR is a bitmask type for 618setting a mask of zero or more 619elink:VkVideoEncodeH265TransformBlockSizeFlagBitsKHR. 620 621Implementations must: support at least one of 622ename:VkVideoEncodeH265TransformBlockSizeFlagBitsKHR. 623-- 624 625 626=== H.265 Encode Quality Level Properties 627 628[open,refpage='VkVideoEncodeH265QualityLevelPropertiesKHR',desc='Structure describing the H.265 encode quality level properties',type='structs'] 629-- 630When calling flink:vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR 631with pname:pVideoProfile->videoCodecOperation specified as 632ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR, the 633slink:VkVideoEncodeH265QualityLevelPropertiesKHR structure must: be included 634in the pname:pNext chain of the slink:VkVideoEncodeQualityLevelPropertiesKHR 635structure to retrieve additional video encode quality level properties 636specific to H.265 encoding. 637 638The slink:VkVideoEncodeH265QualityLevelPropertiesKHR structure is defined 639as: 640 641include::{generated}/api/structs/VkVideoEncodeH265QualityLevelPropertiesKHR.adoc[] 642 643 * pname:sType is a elink:VkStructureType value identifying this structure. 644 * pname:pNext is `NULL` or a pointer to a structure extending this 645 structure. 646 * pname:preferredRateControlFlags is a bitmask of 647 elink:VkVideoEncodeH265RateControlFlagBitsKHR values indicating the 648 preferred flags to use for 649 slink:VkVideoEncodeH265RateControlInfoKHR::pname:flags. 650 * pname:preferredGopFrameCount indicates the preferred value to use for 651 slink:VkVideoEncodeH265RateControlInfoKHR::pname:gopFrameCount. 652 * pname:preferredIdrPeriod indicates the preferred value to use for 653 slink:VkVideoEncodeH265RateControlInfoKHR::pname:idrPeriod. 654 * pname:preferredConsecutiveBFrameCount indicates the preferred value to 655 use for 656 slink:VkVideoEncodeH265RateControlInfoKHR::pname:consecutiveBFrameCount. 657 * pname:preferredSubLayerCount indicates the preferred value to use for 658 slink:VkVideoEncodeH265RateControlInfoKHR::pname:subLayerCount. 659 * pname:preferredConstantQp indicates the preferred values to use for 660 slink:VkVideoEncodeH265NaluSliceSegmentInfoKHR::pname:constantQp for 661 each picture type when using <<encode-rate-control-modes,rate control 662 mode>> ename:VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR. 663 * pname:preferredMaxL0ReferenceCount indicates the preferred maximum 664 number of reference pictures to use in the reference list L0. 665 * pname:preferredMaxL1ReferenceCount indicates the preferred maximum 666 number of reference pictures to use in the reference list L1. 667 668include::{generated}/validity/structs/VkVideoEncodeH265QualityLevelPropertiesKHR.adoc[] 669-- 670 671 672=== H.265 Encode Session 673 674Additional parameters can be specified when creating a video session with an 675H.265 encode profile by including an instance of the 676slink:VkVideoEncodeH265SessionCreateInfoKHR structure in the pname:pNext 677chain of slink:VkVideoSessionCreateInfoKHR. 678 679[open,refpage='VkVideoEncodeH265SessionCreateInfoKHR',desc='Structure specifies H.265 encode session parameters',type='structs'] 680-- 681The sname:VkVideoEncodeH265SessionCreateInfoKHR structure is defined as: 682 683include::{generated}/api/structs/VkVideoEncodeH265SessionCreateInfoKHR.adoc[] 684 685 * pname:sType is a elink:VkStructureType value identifying this structure. 686 * pname:pNext is `NULL` or a pointer to a structure extending this 687 structure. 688 * pname:useMaxLevelIdc indicates whether the value of pname:maxLevelIdc 689 should be used by the implementation. 690 When it is set to ename:VK_FALSE, the implementation ignores the value 691 of pname:maxLevelIdc and uses the value of 692 slink:VkVideoEncodeH265CapabilitiesKHR::pname:maxLevelIdc, as reported 693 by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video profile. 694 * pname:maxLevelIdc is a code:StdVideoH265LevelIdc value specifying the 695 upper bound on the H.265 level for the video bitstreams produced by the 696 created video session, where enum constant 697 `STD_VIDEO_H265_LEVEL_IDC_<major>_<minor>` identifies H.265 level 698 `<major>.<minor>` as defined in section A.4 of the <<itu-t-h265,ITU-T 699 H.265 Specification>>. 700 701include::{generated}/validity/structs/VkVideoEncodeH265SessionCreateInfoKHR.adoc[] 702-- 703 704 705[[encode-h265-parameter-sets]] 706=== H.265 Encode Parameter Sets 707 708<<video-session-parameters,Video session parameters>> objects created with 709the video codec operation ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR 710can: contain the following types of parameters: 711 712:operationType: encode 713include::{chapters}/video/h265_parameter_sets.adoc[] 714 715Implementations may: override any of these parameters according to the 716semantics defined in the <<encode-overrides,Video Encode Parameter 717Overrides>> section before storing the resulting H.265 parameter sets into 718the video session parameters object. 719Applications need to use the flink:vkGetEncodedVideoSessionParametersKHR 720command to determine whether any implementation overrides happened and to 721retrieve the encoded H.265 parameter sets in order to be able to produce a 722compliant H.265 video bitstream. 723 724Such H.265 parameter set overrides may: also have cascading effects on the 725implementation overrides applied to the encoded bitstream produced by video 726encode operations. 727If the implementation supports the 728ename:VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR 729<<queries-video-encode-feedback,video encode feedback query>> flag, then the 730application can: use such queries to retrieve feedback about whether any 731implementation overrides have been applied to the encoded bitstream. 732 733[open,refpage='VkVideoEncodeH265SessionParametersCreateInfoKHR',desc='Structure specifies H.265 encoder parameter set information',type='structs'] 734-- 735When a <<video-session-parameters,video session parameters>> object is 736created with the codec operation 737ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR, the 738slink:VkVideoSessionParametersCreateInfoKHR::pname:pNext chain must: include 739a sname:VkVideoEncodeH265SessionParametersCreateInfoKHR structure specifying 740the capacity and initial contents of the object. 741 742The sname:VkVideoEncodeH265SessionParametersCreateInfoKHR structure is 743defined as: 744 745include::{generated}/api/structs/VkVideoEncodeH265SessionParametersCreateInfoKHR.adoc[] 746 747 * pname:sType is a elink:VkStructureType value identifying this structure. 748 * pname:pNext is `NULL` or a pointer to a structure extending this 749 structure. 750 * pname:maxStdVPSCount is the maximum number of <<encode-h265-vps,H.265 751 VPS>> entries the created sname:VkVideoSessionParametersKHR can: 752 contain. 753 * pname:maxStdSPSCount is the maximum number of <<encode-h265-sps,H.265 754 SPS>> entries the created sname:VkVideoSessionParametersKHR can: 755 contain. 756 * pname:maxStdPPSCount is the maximum number of <<encode-h265-pps,H.265 757 PPS>> entries the created sname:VkVideoSessionParametersKHR can: 758 contain. 759 * pname:pParametersAddInfo is `NULL` or a pointer to a 760 slink:VkVideoEncodeH265SessionParametersAddInfoKHR structure specifying 761 H.265 parameters to add upon object creation. 762 763include::{generated}/validity/structs/VkVideoEncodeH265SessionParametersCreateInfoKHR.adoc[] 764-- 765 766[open,refpage='VkVideoEncodeH265SessionParametersAddInfoKHR',desc='Structure specifies H.265 encoder parameter set information',type='structs'] 767-- 768The sname:VkVideoEncodeH265SessionParametersAddInfoKHR structure is defined 769as: 770 771include::{generated}/api/structs/VkVideoEncodeH265SessionParametersAddInfoKHR.adoc[] 772 773 * pname:sType is a elink:VkStructureType value identifying this structure. 774 * pname:pNext is `NULL` or a pointer to a structure extending this 775 structure. 776 * pname:stdVPSCount is the number of elements in the pname:pStdVPSs array. 777 * pname:pStdVPSs is a pointer to an array of 778 code:StdVideoH265VideoParameterSet structures describing the 779 <<encode-h265-vps,H.265 VPS>> entries to add. 780 * pname:stdSPSCount is the number of elements in the pname:pStdSPSs array. 781 * pname:pStdSPSs is a pointer to an array of 782 code:StdVideoH265SequenceParameterSet structures describing the 783 <<encode-h265-sps,H.265 SPS>> entries to add. 784 * pname:stdPPSCount is the number of elements in the pname:pStdPPSs array. 785 * pname:pStdPPSs is a pointer to an array of 786 code:StdVideoH265PictureParameterSet structures describing the 787 <<encode-h265-pps,H.265 PPS>> entries to add. 788 789This structure can: be specified in the following places: 790 791 * In the pname:pParametersAddInfo member of the 792 slink:VkVideoEncodeH265SessionParametersCreateInfoKHR structure 793 specified in the pname:pNext chain of 794 slink:VkVideoSessionParametersCreateInfoKHR used to create a 795 <<video-session-parameters,video session parameters>> object. 796 In this case, if the video codec operation the video session parameters 797 object is created with is 798 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR, then it defines the 799 set of initial parameters to add to the created object (see 800 <<creating-video-session-parameters,Creating Video Session 801 Parameters>>). 802 * In the pname:pNext chain of slink:VkVideoSessionParametersUpdateInfoKHR. 803 In this case, if the video codec operation the 804 <<video-session-parameters,video session parameters>> object to be 805 updated was created with is 806 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR, then it defines the 807 set of parameters to add to it (see 808 <<video-session-parameters-update,Updating Video Session Parameters>>). 809 810include::{generated}/validity/structs/VkVideoEncodeH265SessionParametersAddInfoKHR.adoc[] 811 812.Valid Usage 813**** 814 * [[VUID-VkVideoEncodeH265SessionParametersAddInfoKHR-None-06438]] 815 The pname:vps_video_parameter_set_id member of each 816 code:StdVideoH265VideoParameterSet structure specified in the elements 817 of pname:pStdVPSs must: be unique within pname:pStdVPSs 818 * [[VUID-VkVideoEncodeH265SessionParametersAddInfoKHR-None-06439]] 819 The pair constructed from the pname:sps_video_parameter_set_id and 820 pname:sps_seq_parameter_set_id members of each 821 code:StdVideoH265SequenceParameterSet structure specified in the 822 elements of pname:pStdSPSs must: be unique within pname:pStdSPSs 823 * [[VUID-VkVideoEncodeH265SessionParametersAddInfoKHR-None-06440]] 824 The triplet constructed from the pname:sps_video_parameter_set_id, 825 pname:pps_seq_parameter_set_id, and pname:pps_pic_parameter_set_id 826 members of each code:StdVideoH265PictureParameterSet structure specified 827 in the elements of pname:pStdPPSs must: be unique within pname:pStdPPSs 828**** 829-- 830 831[open,refpage='VkVideoEncodeH265SessionParametersGetInfoKHR',desc='Structure specifying parameters for retrieving encoded H.265 parameter set data',type='structs'] 832-- 833The sname:VkVideoEncodeH265SessionParametersGetInfoKHR structure is defined 834as: 835 836include::{generated}/api/structs/VkVideoEncodeH265SessionParametersGetInfoKHR.adoc[] 837 838 * pname:sType is a elink:VkStructureType value identifying this structure. 839 * pname:pNext is `NULL` or a pointer to a structure extending this 840 structure. 841 * pname:writeStdVPS indicates whether the encoded <<encode-h265-vps,H.265 842 video parameter set>> identified by pname:stdVPSId is requested to be 843 retrieved. 844 * pname:writeStdSPS indicates whether the encoded <<encode-h265-sps,H.265 845 sequence parameter set>> identified by the pair constructed from 846 pname:stdVPSId and pname:stdSPSId is requested to be retrieved. 847 * pname:writeStdPPS indicates whether the encoded <<encode-h265-pps,H.265 848 picture parameter set>> identified by the triplet constructed from 849 pname:stdVPSId, pname:stdSPSId, and pname:stdPPSId is requested to be 850 retrieved. 851 * pname:stdVPSId specifies the H.265 video parameter set ID used to 852 identify the retrieved H.265 video, sequence, and/or picture parameter 853 set(s). 854 * pname:stdSPSId specifies the H.265 sequence parameter set ID used to 855 identify the retrieved H.265 sequence and/or picture parameter set(s) 856 when pname:writeStdSPS and/or pname:writeStdPPS is set to ename:VK_TRUE. 857 * pname:stdPPSId specifies the H.265 picture parameter set ID used to 858 identify the retrieved H.265 picture parameter set when 859 pname:writeStdPPS is set to ename:VK_TRUE. 860 861When this structure is specified in the pname:pNext chain of the 862slink:VkVideoEncodeSessionParametersGetInfoKHR structure passed to 863flink:vkGetEncodedVideoSessionParametersKHR, the command will write encoded 864parameter data to the output buffer in the following order: 865 866 . The <<encode-h265-vps,H.265 video parameter set>> identified by 867 pname:stdVPSId, if pname:writeStdVPS is set to ename:VK_TRUE. 868 . The <<encode-h265-sps,H.265 sequence parameter set>> identified by the 869 pair constructed from pname:stdVPSId and pname:stdSPSId, if 870 pname:writeStdSPS is set to ename:VK_TRUE. 871 . The <<encode-h265-pps,H.265 picture parameter set>> identified by the 872 triplet constructed from pname:stdVPSId, pname:stdSPSId, and 873 pname:stdPPSId, if pname:writeStdPPS is set to ename:VK_TRUE. 874 875.Valid Usage 876**** 877 * [[VUID-VkVideoEncodeH265SessionParametersGetInfoKHR-writeStdVPS-08290]] 878 At least one of pname:writeStdVPS, pname:writeStdSPS, and 879 pname:writeStdPPS must: be set to ename:VK_TRUE 880**** 881 882include::{generated}/validity/structs/VkVideoEncodeH265SessionParametersGetInfoKHR.adoc[] 883-- 884 885[open,refpage='VkVideoEncodeH265SessionParametersFeedbackInfoKHR',desc='Structure providing feedback about the requested H.265 video session parameters',type='structs'] 886-- 887The sname:VkVideoEncodeH265SessionParametersFeedbackInfoKHR structure is 888defined as: 889 890include::{generated}/api/structs/VkVideoEncodeH265SessionParametersFeedbackInfoKHR.adoc[] 891 892 * pname:sType is a elink:VkStructureType value identifying this structure. 893 * pname:pNext is `NULL` or a pointer to a structure extending this 894 structure. 895 * pname:hasStdVPSOverrides indicates whether any of the parameters of the 896 requested <<encode-h265-vps,H.265 video parameter set>>, if one was 897 requested via 898 slink:VkVideoEncodeH265SessionParametersGetInfoKHR::pname:writeStdVPS, 899 were <<encode-overrides,overridden>> by the implementation. 900 * pname:hasStdSPSOverrides indicates whether any of the parameters of the 901 requested <<encode-h265-sps,H.265 sequence parameter set>>, if one was 902 requested via 903 slink:VkVideoEncodeH265SessionParametersGetInfoKHR::pname:writeStdSPS, 904 were <<encode-overrides,overridden>> by the implementation. 905 * pname:hasStdPPSOverrides indicates whether any of the parameters of the 906 requested <<encode-h265-pps,H.265 picture parameter set>>, if one was 907 requested via 908 slink:VkVideoEncodeH265SessionParametersGetInfoKHR::pname:writeStdPPS, 909 were <<encode-overrides,overridden>> by the implementation. 910 911include::{generated}/validity/structs/VkVideoEncodeH265SessionParametersFeedbackInfoKHR.adoc[] 912-- 913 914=== H.265 Encoding Parameters 915 916[open,refpage='VkVideoEncodeH265PictureInfoKHR',desc='Structure specifies H.265 encode frame parameters',type='structs'] 917-- 918The slink:VkVideoEncodeH265PictureInfoKHR structure is defined as: 919 920include::{generated}/api/structs/VkVideoEncodeH265PictureInfoKHR.adoc[] 921 922 * pname:sType is a elink:VkStructureType value identifying this structure. 923 * pname:pNext is `NULL` or a pointer to a structure extending this 924 structure. 925 * pname:naluSliceSegmentEntryCount is the number of elements in 926 pname:pNaluSliceSegmentEntries. 927 * pname:pNaluSliceSegmentEntries is a pointer to an array of 928 pname:naluSliceSegmentEntryCount 929 slink:VkVideoEncodeH265NaluSliceSegmentInfoKHR structures specifying the 930 parameters of the individual H.265 slice segments to encode for the 931 input picture. 932 * pname:pStdPictureInfo is a pointer to a 933 code:StdVideoEncodeH265PictureInfo structure specifying 934 <<encode-h265-picture-info,H.265 picture information>>. 935 936This structure is specified in the pname:pNext chain of the 937slink:VkVideoEncodeInfoKHR structure passed to flink:vkCmdEncodeVideoKHR to 938specify the codec-specific picture information for an <<encode-h265,H.265 939encode operation>>. 940 941[[encode-h265-input-picture-info]] 942Encode Input Picture Information:: 943 944When this structure is specified in the pname:pNext chain of the 945slink:VkVideoEncodeInfoKHR structure passed to flink:vkCmdEncodeVideoKHR, 946the information related to the <<encode-input-picture-info,encode input 947picture>> is defined as follows: 948 949 * The image subregion used is determined according to the 950 <<encode-h265-picture-data-access,H.265 Encode Picture Data Access>> 951 section. 952 * The encode input picture is associated with the 953 <<encode-h265-picture-info,H.265 picture information>> provided in 954 pname:pStdPictureInfo. 955 956[[encode-h265-picture-info]] 957Std Picture Information:: 958 959The members of the code:StdVideoEncodeH265PictureInfo structure pointed to 960by pname:pStdPictureInfo are interpreted as follows: 961 962 * code:flags.reserved and code:reserved1 are used only for padding 963 purposes and are otherwise ignored; 964 * code:flags.is_reference as defined in section 3.132 of the <<itu-t-h265, 965 ITU-T H.265 Specification>>; 966 * code:flags.IrapPicFlag as defined in section 3.73 of the <<itu-t-h265, 967 ITU-T H.265 Specification>>; 968 * code:flags.used_for_long_term_reference is used to indicate whether the 969 picture is marked as "`used for long-term reference`" as defined in 970 section 8.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>; 971 * code:flags.discardable_flag and code:cross_layer_bla_flag as defined in 972 section F.7.4.7.1 of the <<itu-t-h265,ITU-T H.265 Specification>>; 973 * code:pic_type as defined in section 7.4.3.5 of the <<itu-t-h265,ITU-T 974 H.265 Specification>>; 975 * code:sps_video_parameter_set_id, code:pps_seq_parameter_set_id, and 976 code:pps_pic_parameter_set_id are used to identify the active parameter 977 sets, as described below; 978 * code:PicOrderCntVal as defined in section 8.3.1 of the 979 <<itu-t-h265,ITU-T H.265 Specification>>; 980 * code:TemporalId as defined in section 7.4.2.2 of the <<itu-t-h265,ITU-T 981 H.265 Specification>>; 982 * if code:pRefLists is not `NULL`, then it is a pointer to a 983 code:StdVideoEncodeH265ReferenceListsInfo structure that is interpreted 984 as follows: 985 ** code:flags.reserved is used only for padding purposes and is otherwise 986 ignored; 987 ** code:ref_pic_list_modification_flag_l0 and 988 code:ref_pic_list_modification_flag_l1 as defined in section 7.4.7.2 of 989 the <<itu-t-h265,ITU-T H.265 Specification>>; 990 ** code:num_ref_idx_l0_active_minus1 and code:num_ref_idx_l1_active_minus1 991 as defined in section 7.4.7.1 of the <<itu-t-h265, ITU-T H.265 992 Specification>>; 993 ** code:RefPicList0 and code:RefPicList1 as defined in section 8.3.4 of 994 the <<itu-t-h265, ITU-T H.265 Specification>> where each element of 995 these arrays either identifies an 996 <<encode-active-reference-picture-info,active reference picture>> using 997 its <<dpb-slot,DPB slot>> index or contains the value 998 code:STD_VIDEO_H265_NO_REFERENCE_PICTURE to indicate "`no reference 999 picture`"; 1000 ** code:list_entry_l0 and code:list_entry_l1 as defined in section 7.4.7.2 1001 of the <<itu-t-h265, ITU-T H.265 Specification>>; 1002 * if code:flags.short_term_ref_pic_set_sps_flag is set, then the 1003 code:StdVideoH265ShortTermRefPicSet structure pointed to by 1004 code:pShortTermRefPicSet is interpreted as defined for the elements of 1005 the code:pShortTermRefPicSet array specified in <<encode-h265-sps,H.265 1006 sequence parameter sets>>. 1007 * if code:flags.long_term_ref_pics_present_flag is set in the 1008 <<encode-h265-active-sps,active SPS>>, then the 1009 code:StdVideoEncodeH265LongTermRefPics structure pointed to by 1010 code:pLongTermRefPics is interpreted as follows: 1011 ** code:used_by_curr_pic_lt_flag is a bitmask where bit index [eq]#i# 1012 corresponds to `used_by_curr_pic_lt_flag[i]` as defined in section 1013 7.4.7.1 of the <<itu-t-h265,ITU-T H.265 Specification>>; 1014 ** all other members of code:StdVideoEncodeH265LongTermRefPics are 1015 interpreted as defined in section 7.4.7.1 of the <<itu-t-h265,ITU-T 1016 H.265 Specification>>; 1017 * all other members are interpreted as defined in section 7.4.7.1 of the 1018 <<itu-t-h265,ITU-T H.265 Specification>>. 1019 1020[[encode-h265-ref-pic-setup]] 1021Reference picture setup is controlled by the value of 1022code:StdVideoEncodeH265PictureInfo::pname:flags.is_reference. 1023If it is set and a <<encode-reconstructed-picture-info,reconstructed 1024picture>> is specified, then the latter is used as the target of picture 1025reconstruction to <<dpb-slot-states,activate>> the <<dpb-slot,DPB slot>> 1026specified in pname:pEncodeInfo->pSetupReferenceSlot->slotIndex. 1027If code:StdVideoEncodeH265PictureInfo::pname:flags.is_reference is not set, 1028but a <<encode-reconstructed-picture-info,reconstructed picture>> is 1029specified, then the corresponding picture reference associated with the 1030<<dpb-slot,DPB slot>> is invalidated, as described in the 1031<<dpb-slot-states,DPB Slot States>> section. 1032 1033Active Parameter Sets:: 1034 1035The members of the code:StdVideoEncodeH265PictureInfo structure pointed to 1036by pname:pStdPictureInfo are used to select the active parameter sets to use 1037from the bound video session parameters object, as follows: 1038 1039 * [[encode-h265-active-vps]] The _active VPS_ is the 1040 <<encode-h265-vps,VPS>> identified by the key specified in 1041 code:StdVideoEncodeH265PictureInfo::code:sps_video_parameter_set_id. 1042 * [[encode-h265-active-sps]] The _active SPS_ is the 1043 <<encode-h265-sps,SPS>> identified by the key specified by the pair 1044 constructed from 1045 code:StdVideoEncodeH265PictureInfo::code:sps_video_parameter_set_id and 1046 code:StdVideoEncodeH265PictureInfo::code:pps_seq_parameter_set_id. 1047 * [[encode-h265-active-pps]] The _active PPS_ is the 1048 <<encode-h265-pps,PPS>> identified by the key specified by the triplet 1049 constructed from 1050 code:StdVideoEncodeH265PictureInfo::code:sps_video_parameter_set_id, 1051 code:StdVideoEncodeH265PictureInfo::code:pps_seq_parameter_set_id, and 1052 code:StdVideoEncodeH265PictureInfo::code:pps_pic_parameter_set_id. 1053 1054[[encode-h265-weighted-pred]] 1055H.265 encoding uses _explicit weighted sample prediction_ for a slice 1056segment, as defined in section 8.5.3.3.4 of the <<itu-t-h265,ITU-T H.265 1057Specification>>, if any of the following conditions are true for the active 1058<<encode-h265-pps,PPS>> and the pname:pStdSliceSegmentHeader member of the 1059corresponding element of pname:pNaluSliceSegmentEntries: 1060 1061 * pname:pStdSliceSegmentHeader->slice_type is 1062 code:STD_VIDEO_H265_SLICE_TYPE_P and code:weighted_pred_flag is enabled 1063 in the active PPS. 1064 * pname:pStdSliceSegmentHeader->slice_type is 1065 code:STD_VIDEO_H265_SLICE_TYPE_B and code:weighted_bipred_flag is 1066 enabled in the active PPS. 1067 1068[[encode-h265-tile-count]] 1069The number of H.265 tiles, as defined in section 3.174 of the <<itu-t-h265, 1070ITU-T H.265 Specification>>, is derived from the 1071code:num_tile_columns_minus1 and code:num_tile_rows_minus1 members of the 1072active <<encode-h265-pps,PPS>> as follows: 1073 1074 {empty}:: [eq]#(code:num_tile_columns_minus1 {plus} 1) {times} 1075 (code:num_tile_rows_minus1 {plus} 1)# 1076 1077.Valid Usage 1078**** 1079 * [[VUID-VkVideoEncodeH265PictureInfoKHR-naluSliceSegmentEntryCount-08306]] 1080 pname:naluSliceSegmentEntryCount must: be between `1` and 1081 slink:VkVideoEncodeH265CapabilitiesKHR::pname:maxSliceSegmentCount, 1082 inclusive, as returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR 1083 for the used video profile 1084 * [[VUID-VkVideoEncodeH265PictureInfoKHR-flags-08323]] 1085 If slink:VkVideoEncodeH265CapabilitiesKHR::pname:flags, as returned by 1086 flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video 1087 profile, does not include 1088 ename:VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILES_PER_SLICE_SEGMENT_BIT_KHR, 1089 then pname:naluSliceSegmentEntryCount must: be greater than or equal to 1090 the <<encode-h265-tile-count,number of H.265 tiles in the picture>> 1091 * [[VUID-VkVideoEncodeH265PictureInfoKHR-flags-08324]] 1092 If slink:VkVideoEncodeH265CapabilitiesKHR::pname:flags, as returned by 1093 flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video 1094 profile, does not include 1095 ename:VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_SEGMENTS_PER_TILE_BIT_KHR, 1096 then pname:naluSliceSegmentEntryCount must: be less than or equal to the 1097 <<encode-h265-tile-count,number of H.265 tiles in the picture>> 1098 * [[VUID-VkVideoEncodeH265PictureInfoKHR-flags-08316]] 1099 If slink:VkVideoEncodeH265CapabilitiesKHR::pname:flags, as returned by 1100 flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video 1101 profile, does not include 1102 ename:VK_VIDEO_ENCODE_H265_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR 1103 and the slice segment corresponding to any element of 1104 pname:pNaluSliceSegmentEntries uses <<encode-h265-weighted-pred,explicit 1105 weighted sample prediction>>, then 1106 slink:VkVideoEncodeH265NaluSliceSegmentInfoKHR::pname:pStdSliceSegmentHeader->pWeightTable 1107 must: not be `NULL` for that element of pname:pNaluSliceSegmentEntries 1108 * [[VUID-VkVideoEncodeH265PictureInfoKHR-flags-08317]] 1109 If slink:VkVideoEncodeH265CapabilitiesKHR::pname:flags, as returned by 1110 flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video 1111 profile, does not include 1112 ename:VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_SEGMENT_TYPE_BIT_KHR, 1113 then 1114 slink:VkVideoEncodeH265NaluSliceSegmentInfoKHR::pname:pStdSliceSegmentHeader->slice_type 1115 must: be identical for all elements of pname:pNaluSliceSegmentEntries 1116**** 1117 1118include::{generated}/validity/structs/VkVideoEncodeH265PictureInfoKHR.adoc[] 1119-- 1120 1121[open,refpage='VkVideoEncodeH265NaluSliceSegmentInfoKHR',desc='Structure specifies H.265 encode slice segment NALU parameters',type='structs'] 1122-- 1123The slink:VkVideoEncodeH265NaluSliceSegmentInfoKHR structure is defined as: 1124 1125include::{generated}/api/structs/VkVideoEncodeH265NaluSliceSegmentInfoKHR.adoc[] 1126 1127 * pname:sType is a elink:VkStructureType value identifying this structure. 1128 * pname:pNext is `NULL` or a pointer to a structure extending this 1129 structure. 1130 * pname:constantQp is the QP to use for the slice segment if the current 1131 <<encode-rate-control-modes,rate control mode>> configured for the video 1132 session is ename:VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR. 1133 * pname:pStdSliceSegmentHeader is a pointer to a 1134 code:StdVideoEncodeH265SliceSegmentHeader structure specifying 1135 <<encode-h265-slice-segment-header-params,H.265 slice segment header 1136 parameters>> for the slice segment. 1137 1138[[encode-h265-slice-segment-header-params]] 1139Std Slice Segment Header Parameters:: 1140 1141The members of the code:StdVideoEncodeH265SliceSegmentHeader structure 1142pointed to by pname:pStdSliceSegmentHeader are interpreted as follows: 1143 1144 * code:flags.reserved and code:reserved1 are used only for padding 1145 purposes and are otherwise ignored; 1146 * if pname:pWeightTable is not `NULL`, then it is a pointer to a 1147 code:StdVideoEncodeH265WeightTable that is interpreted as follows: 1148 ** code:flags.luma_weight_l0_flag, code:flags.chroma_weight_l0_flag, 1149 code:flags.luma_weight_l1_flag, and code:flags.chroma_weight_l1_flag 1150 are bitmasks where bit index [eq]#i# corresponds to 1151 `luma_weight_l0_flag[i]`, `chroma_weight_l0_flag[i]`, 1152 `luma_weight_l1_flag[i]`, and `chroma_weight_l1_flag[i]`, respectively, 1153 as defined in section 7.4.7.3 of the <<itu-t-h265,ITU-T H.265 1154 Specification>>; 1155 ** all other members of code:StdVideoEncodeH265WeightTable are interpreted 1156 as defined in section 7.4.7.3 of the <<itu-t-h265,ITU-T H.265 1157 Specification>>; 1158 * all other members are interpreted as defined in section 7.4.7.1 of the 1159 <<itu-t-h265,ITU-T H.265 Specification>>. 1160 1161include::{generated}/validity/structs/VkVideoEncodeH265NaluSliceSegmentInfoKHR.adoc[] 1162-- 1163 1164[open,refpage='VkVideoEncodeH265DpbSlotInfoKHR',desc='Structure specifies H.265 encode DPB picture information',type='structs'] 1165-- 1166The slink:VkVideoEncodeH265DpbSlotInfoKHR structure is defined as: 1167 1168include::{generated}/api/structs/VkVideoEncodeH265DpbSlotInfoKHR.adoc[] 1169 1170 * pname:sType is a elink:VkStructureType value identifying this structure. 1171 * pname:pNext is `NULL` or a pointer to a structure extending this 1172 structure. 1173 * pname:pStdReferenceInfo is a pointer to a 1174 code:StdVideoEncodeH265ReferenceInfo structure specifying 1175 <<encode-h265-reference-info,H.265 reference information>>. 1176 1177This structure is specified in the pname:pNext chain of 1178slink:VkVideoEncodeInfoKHR::pname:pSetupReferenceSlot, if not `NULL`, and 1179the pname:pNext chain of the elements of 1180slink:VkVideoEncodeInfoKHR::pname:pReferenceSlots to specify the 1181codec-specific reference picture information for an <<encode-h265,H.265 1182encode operation>>. 1183 1184[[encode-h265-active-reference-picture-info]] 1185Active Reference Picture Information:: 1186 1187When this structure is specified in the pname:pNext chain of the elements of 1188slink:VkVideoEncodeInfoKHR::pname:pReferenceSlots, one element is added to 1189the list of <<encode-active-reference-picture-info,active reference 1190pictures>> used by the video encode operation for each element of 1191slink:VkVideoEncodeInfoKHR::pname:pReferenceSlots as follows: 1192 1193 * The image subregion used is determined according to the 1194 <<encode-h265-picture-data-access,H.265 Encode Picture Data Access>> 1195 section. 1196 * The reference picture is associated with the <<dpb-slot,DPB slot>> index 1197 specified in the pname:slotIndex member of the corresponding element of 1198 slink:VkVideoEncodeInfoKHR::pname:pReferenceSlots. 1199 * The reference picture is associated with the 1200 <<encode-h265-reference-info,H.265 reference information>> provided in 1201 pname:pStdReferenceInfo. 1202 1203[[encode-h265-reconstructed-picture-info]] 1204Reconstructed Picture Information:: 1205 1206When this structure is specified in the pname:pNext chain of 1207slink:VkVideoEncodeInfoKHR::pname:pSetupReferenceSlot, the information 1208related to the <<encode-reconstructed-picture-info,reconstructed picture>> 1209is defined as follows: 1210 1211 * The image subregion used is determined according to the 1212 <<encode-h265-picture-data-access,H.265 Encode Picture Data Access>> 1213 section. 1214 * If <<encode-h265-ref-pic-setup,reference picture setup>> is requested, 1215 then the reconstructed picture is used to <<dpb-slot-states,activate>> 1216 the <<dpb-slot,DPB slot>> with the index specified in 1217 slink:VkVideoEncodeInfoKHR::pname:pSetupReferenceSlot->slotIndex. 1218 * The reconstructed picture is associated with the 1219 <<encode-h265-reference-info,H.265 reference information>> provided in 1220 pname:pStdReferenceInfo. 1221 1222[[encode-h265-reference-info]] 1223Std Reference Information:: 1224 1225The members of the code:StdVideoEncodeH265ReferenceInfo structure pointed to 1226by pname:pStdReferenceInfo are interpreted as follows: 1227 1228 * code:flags.reserved is used only for padding purposes and is otherwise 1229 ignored; 1230 * code:flags.used_for_long_term_reference is used to indicate whether the 1231 picture is marked as "`used for long-term reference`" as defined in 1232 section 8.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>; 1233 * code:flags.unused_for_reference is used to indicate whether the picture 1234 is marked as "`unused for reference`" as defined in section 8.3.2 of the 1235 <<itu-t-h265,ITU-T H.265 Specification>>; 1236 * code:pic_type as defined in section 7.4.3.5 of the <<itu-t-h265,ITU-T 1237 H.265 Specification>>; 1238 * code:PicOrderCntVal as defined in section 8.3.1 of the 1239 <<itu-t-h265,ITU-T H.265 Specification>>; 1240 * code:TemporalId as defined in section 7.4.2.2 of the <<itu-t-h265,ITU-T 1241 H.265 Specification>>. 1242 1243include::{generated}/validity/structs/VkVideoEncodeH265DpbSlotInfoKHR.adoc[] 1244-- 1245 1246 1247[[encode-h265-rate-control]] 1248=== H.265 Encode Rate Control 1249 1250[[encode-h265-gop]] 1251==== Group of Pictures 1252 1253In case of H.265 encoding it is common practice to follow a regular pattern 1254of different picture types in display order when encoding subsequent frames. 1255This pattern is referred to as the _group of pictures_ (GOP). 1256 1257[[encode-h265-regular-gop]] 1258A regular GOP is defined by the following parameters: 1259 1260 * The number of frames in the GOP; 1261 * The number of consecutive B frames between I and/or P frames in display 1262 order. 1263 1264GOPs are further classified as _open_ and _closed_ GOPs. 1265 1266Frame types in an open GOP follow each other in display order according to 1267the following algorithm: 1268 1269 1. The first frame is always an I frame. 1270 2. This is followed by a number of consecutive B frames, as defined above. 1271 3. If the number of frames in the GOP is not reached yet, then the next 1272 frame is a P frame and the algorithm continues from step 2. 1273 1274[[encode-h265-open-gop]] 1275image::{images}/h26x_open_gop.svg[align="center",title="H.265 open GOP",opts="{imageopts}"] 1276 1277[[encode-h265-idr-period]] 1278In case of a closed GOP, an <<encode-h265-idr-pic,IDR frame>> is used at a 1279certain period. 1280 1281[[encode-h265-closed-gop]] 1282image::{images}/h26x_closed_gop.svg[align="center",title="H.265 closed GOP",opts="{imageopts}"] 1283 1284It is also typical for H.265 encoding to use specific reference picture 1285usage patterns across the frames of the GOP. 1286The two most common reference patterns used are as follows: 1287 1288[[encode-h265-ref-pattern-flat]] 1289Flat Reference Pattern:: 1290 1291 * Each P frame uses the last non-B frame, in display order, as reference. 1292 * Each B frame uses the last non-B frame, in display order, as its 1293 backward reference, and uses the next non-B frame, in display order, as 1294 its forward reference. 1295 1296image::{images}/h26x_ref_pattern_flat.svg[align="center",title="H.265 flat reference pattern",opts="{imageopts}"] 1297 1298[[encode-h265-ref-pattern-dyadic]] 1299Dyadic Reference Pattern:: 1300 1301 * Each P frame uses the last non-B frame, in display order, as reference. 1302 * The following algorithm is applied to the sequence of consecutive B 1303 frames between I and/or P frames in display order: 1304 1305 . The B frame in the middle of this sequence uses the frame preceding the 1306 sequence as its backward reference, and uses the frame following the 1307 sequence as its forward reference. 1308 . The algorithm is executed recursively for the following frame sequences: 1309 ** The B frames of the original sequence preceding the frame in the 1310 middle, if any. 1311 ** The B frames of the original sequence following the frame in the 1312 middle, if any. 1313 1314image::{images}/h26x_ref_pattern_dyadic.svg[align="center",title="H.265 dyadic reference pattern",opts="{imageopts}"] 1315 1316The application can: provide guidance to the implementation's rate control 1317algorithm about the structure of the GOP used by the application. 1318Any such guidance about the GOP and its structure does not mandate that 1319specific GOP structure to be used by the application, as the picture type of 1320individual encoded pictures is still application-controlled, however, any 1321deviation from the provided guidance may: result in undesired rate control 1322behavior including, but not limited, to the implementation not being able to 1323conform to the expected average or target bitrates, or other rate control 1324parameters specified by the application. 1325 1326When an H.265 encode session is used to encode multiple temporal sub-layers, 1327it is also common practice to follow a regular pattern for the H.265 1328temporal ID for the encoded pictures in display order when encoding 1329subsequent frames. 1330This pattern is referred to as the _temporal GOP_. 1331The most common temporal layer pattern used is as follows: 1332 1333[[encode-h265-layer-pattern-dyadic]] 1334Dyadic Temporal Sub-Layer Pattern:: 1335 1336 * The number of frames in the temporal GOP is [eq]#2^n-1^#, where [eq]#n# 1337 is the number of temporal sub-layers. 1338 * The [eq]#i#^th^ frame in the temporal GOP uses temporal ID [eq]#t#, if 1339 and only if the index of the least significant bit set in [eq]#i# equals 1340 [eq]#n-t-1#, except for the first frame, which is the only frame in the 1341 temporal GOP using temporal ID zero. 1342 * The [eq]#i#^th^ frame in the temporal GOP uses the [eq]#r#^th^ frame as 1343 reference, where [eq]#r# is calculated from [eq]#i# by clearing the 1344 least significant bit set in it, except for the first frame in the 1345 temporal GOP, which uses the first frame of the previous temporal GOP, 1346 if any, as reference. 1347 1348image::{images}/h26x_layer_pattern_dyadic.svg[align="center",title="H.265 dyadic temporal sub-layer pattern",opts="{imageopts}"] 1349 1350[NOTE] 1351.Note 1352==== 1353Multi-layer rate control and multi-layer coding are typically used for 1354streaming cases where low latency is expected, hence B pictures with forward 1355prediction are usually not used. 1356==== 1357 1358[open,refpage='VkVideoEncodeH265RateControlInfoKHR',desc='Structure describing H.265 stream rate control parameters',type='structs'] 1359-- 1360The sname:VkVideoEncodeH265RateControlInfoKHR structure is defined as: 1361 1362include::{generated}/api/structs/VkVideoEncodeH265RateControlInfoKHR.adoc[] 1363 1364 * pname:sType is a elink:VkStructureType value identifying this structure. 1365 * pname:pNext is `NULL` or a pointer to a structure extending this 1366 structure. 1367 * pname:flags is a bitmask of 1368 elink:VkVideoEncodeH265RateControlFlagBitsKHR specifying H.265 rate 1369 control flags. 1370 * pname:gopFrameCount is the number of frames within a <<encode-h265-gop, 1371 group of pictures (GOP)>> intended to be used by the application. 1372 If it is set to 0, the rate control algorithm may: assume an 1373 implementation-dependent GOP length. 1374 If it is set to code:UINT32_MAX, the GOP length is treated as infinite. 1375 * pname:idrPeriod is the interval, in terms of number of frames, between 1376 two <<encode-h265-idr-pic,IDR frames>> (see <<encode-h265-idr-period,IDR 1377 period>>). 1378 If it is set to 0, the rate control algorithm may: assume an 1379 implementation-dependent IDR period. 1380 If it is set to code:UINT32_MAX, the IDR period is treated as infinite. 1381 * pname:consecutiveBFrameCount is the number of consecutive B frames 1382 between I and/or P frames within the <<encode-h265-gop,GOP>>. 1383 * pname:temporalLayerCount specifies the number of H.265 sub-layers that 1384 the application intends to use. 1385 1386When an instance of this structure is included in the pname:pNext chain of 1387the slink:VkVideoCodingControlInfoKHR structure passed to the 1388flink:vkCmdControlVideoCodingKHR command, and 1389slink:VkVideoCodingControlInfoKHR::pname:flags includes 1390ename:VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR, the parameters in 1391this structure are used as guidance for the implementation's rate control 1392algorithm (see <<video-coding-control,Video Coding Control>>). 1393 1394If pname:flags includes 1395ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_KHR, then 1396the rate control state is reset to an initial state to meet HRD compliance 1397requirements. 1398Otherwise the new rate control state may: be applied without a reset 1399depending on the implementation and the specified rate control parameters. 1400 1401[NOTE] 1402.Note 1403==== 1404It would be possible to infer the picture type to be used when encoding a 1405frame, on the basis of the values provided for pname:consecutiveBFrameCount, 1406pname:idrPeriod, and pname:gopFrameCount, but this inferred picture type 1407will not be used by implementations to override the picture type provided to 1408the video encode operation. 1409==== 1410 1411.Valid Usage 1412**** 1413 * [[VUID-VkVideoEncodeH265RateControlInfoKHR-flags-08291]] 1414 If slink:VkVideoEncodeH265CapabilitiesKHR::pname:flags, as returned by 1415 flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video 1416 profile, does not include 1417 ename:VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_KHR, then 1418 pname:flags must: not contain 1419 ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_KHR 1420 * [[VUID-VkVideoEncodeH265RateControlInfoKHR-flags-08292]] 1421 If pname:flags contains 1422 ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_KHR 1423 or 1424 ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_KHR, 1425 then it must: also contain 1426 ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_REGULAR_GOP_BIT_KHR 1427 * [[VUID-VkVideoEncodeH265RateControlInfoKHR-flags-08293]] 1428 If pname:flags contains 1429 ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_KHR, 1430 then it must: not also contain 1431 ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_KHR 1432 * [[VUID-VkVideoEncodeH265RateControlInfoKHR-flags-08294]] 1433 If pname:flags contains 1434 ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_REGULAR_GOP_BIT_KHR, then 1435 pname:gopFrameCount must: be greater than `0` 1436 * [[VUID-VkVideoEncodeH265RateControlInfoKHR-idrPeriod-08295]] 1437 If pname:idrPeriod is not `0`, then it must: be greater than or equal to 1438 pname:gopFrameCount 1439 * [[VUID-VkVideoEncodeH265RateControlInfoKHR-consecutiveBFrameCount-08296]] 1440 If pname:consecutiveBFrameCount is not `0`, then it must: be less than 1441 pname:gopFrameCount 1442**** 1443 1444include::{generated}/validity/structs/VkVideoEncodeH265RateControlInfoKHR.adoc[] 1445-- 1446 1447 1448[open,refpage='VkVideoEncodeH265RateControlFlagBitsKHR',desc='H.265 encode rate control bits',type='enums'] 1449-- 1450Bits which can: be set in 1451slink:VkVideoEncodeH265RateControlInfoKHR::pname:flags, specifying H.265 1452rate control flags, are: 1453 1454include::{generated}/api/enums/VkVideoEncodeH265RateControlFlagBitsKHR.adoc[] 1455 1456 * ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_KHR 1457 specifies that rate control should: attempt to produce an HRD compliant 1458 bitstream, as defined in annex C of the <<itu-t-h265,ITU-T H.265 1459 Specification>>. 1460 * ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_REGULAR_GOP_BIT_KHR specifies 1461 that the application intends to use a <<encode-h265-regular-gop, regular 1462 GOP structure>> according to the parameters specified in the 1463 pname:gopFrameCount, pname:idrPeriod, and pname:consecutiveBFrameCount 1464 members of the slink:VkVideoEncodeH265RateControlInfoKHR structure. 1465 * ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_KHR 1466 specifies that the application intends to follow a 1467 <<encode-h265-ref-pattern-flat,flat reference pattern>> in the GOP. 1468 * ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_KHR 1469 specifies that the application intends to follow a 1470 <<encode-h265-ref-pattern-dyadic,dyadic reference pattern>> in the GOP. 1471 * ename:VK_VIDEO_ENCODE_H265_RATE_CONTROL_TEMPORAL_SUB_LAYER_PATTERN_DYADIC_BIT_KHR 1472 specifies that the application intends to follow a 1473 <<encode-h265-layer-pattern-dyadic,dyadic temporal sub-layer pattern>>. 1474-- 1475 1476 1477[open,refpage='VkVideoEncodeH265RateControlFlagsKHR',desc='Bitmask specifying H.265 encode rate control flags',type='flags'] 1478-- 1479include::{generated}/api/flags/VkVideoEncodeH265RateControlFlagsKHR.adoc[] 1480 1481tname:VkVideoEncodeH265RateControlFlagsKHR is a bitmask type for setting a 1482mask of zero or more elink:VkVideoEncodeH265RateControlFlagBitsKHR. 1483-- 1484 1485 1486[[encode-h265-rate-control-layer]] 1487==== Rate Control Layers 1488 1489[open,refpage='VkVideoEncodeH265RateControlLayerInfoKHR',desc='Structure describing H.265 per-layer rate control parameters',type='structs'] 1490-- 1491The sname:VkVideoEncodeH265RateControlLayerInfoKHR structure is defined as: 1492 1493include::{generated}/api/structs/VkVideoEncodeH265RateControlLayerInfoKHR.adoc[] 1494 1495 * pname:sType is a elink:VkStructureType value identifying this structure. 1496 * pname:pNext is `NULL` or a pointer to a structure extending this 1497 structure. 1498 * pname:useMinQp indicates whether the QP values determined by rate 1499 control will be clamped to the lower bounds on the QP values specified 1500 in pname:minQp. 1501 * pname:minQp specifies the lower bounds on the QP values, for each 1502 picture type, that the implementation's rate control algorithm will use 1503 when pname:useMinQp is set to ename:VK_TRUE. 1504 * pname:useMaxQp indicates whether the QP values determined by rate 1505 control will be clamped to the upper bounds on the QP values specified 1506 in pname:maxQp. 1507 * pname:maxQp specifies the upper bounds on the QP values, for each 1508 picture type, that the implementation's rate control algorithm will use 1509 when pname:useMaxQp is set to ename:VK_TRUE. 1510 * pname:useMaxFrameSize indicates whether the implementation's rate 1511 control algorithm should: use the values specified in pname:maxFrameSize 1512 as the upper bounds on the encoded frame size for each picture type. 1513 * pname:maxFrameSize specifies the upper bounds on the encoded frame size, 1514 for each picture type, when pname:useMaxFrameSize is set to 1515 ename:VK_TRUE. 1516 1517When used, the values in pname:minQp and pname:maxQp guarantee that the 1518effective QP values used by the implementation will respect those lower and 1519upper bounds, respectively. 1520However, limiting the range of QP values that the implementation is able to 1521use will also limit the capabilities of the implementation's rate control 1522algorithm to comply to other constraints. 1523In particular, the implementation may: not be able to comply to the 1524following: 1525 1526 * The average and/or peak <<encode-bitrate,bitrate>> values to be used for 1527 the encoded bitstream specified in the pname:averageBitrate and 1528 pname:maxBitrate members of the 1529 slink:VkVideoEncodeRateControlLayerInfoKHR structure. 1530 * The upper bounds on the encoded frame size, for each picture type, 1531 specified in the pname:maxFrameSize member of 1532 sname:VkVideoEncodeH265RateControlLayerInfoKHR. 1533 1534[NOTE] 1535.Note 1536==== 1537In general, applications need to configure rate control parameters 1538appropriately in order to be able to get the desired rate control behavior, 1539as described in the <<encode-rate-control,Video Encode Rate Control>> 1540section. 1541==== 1542 1543When an instance of this structure is included in the pname:pNext chain of a 1544slink:VkVideoEncodeRateControlLayerInfoKHR structure specified in one of the 1545elements of the pname:pLayers array member of the 1546slink:VkVideoEncodeRateControlInfoKHR structure passed to the 1547flink:vkCmdControlVideoCodingKHR command, 1548slink:VkVideoCodingControlInfoKHR::pname:flags includes 1549ename:VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR, and the bound 1550video session was created with the video codec operation 1551ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR, it specifies the 1552H.265-specific rate control parameters of the rate control layer 1553corresponding to that element of pname:pLayers. 1554 1555.Valid Usage 1556**** 1557 * [[VUID-VkVideoEncodeH265RateControlLayerInfoKHR-useMinQp-08297]] 1558 If pname:useMinQp is ename:VK_TRUE, then the pname:qpI, pname:qpP, and 1559 pname:qpB members of pname:minQp must: all be between 1560 slink:VkVideoEncodeH265CapabilitiesKHR::pname:minQp and 1561 slink:VkVideoEncodeH265CapabilitiesKHR::pname:maxQp, as returned by 1562 flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video profile 1563 * [[VUID-VkVideoEncodeH265RateControlLayerInfoKHR-useMaxQp-08298]] 1564 If pname:useMaxQp is ename:VK_TRUE, then the pname:qpI, pname:qpP, and 1565 pname:qpB members of pname:maxQp must: all be between 1566 slink:VkVideoEncodeH265CapabilitiesKHR::pname:minQp and 1567 slink:VkVideoEncodeH265CapabilitiesKHR::pname:maxQp, as returned by 1568 flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video profile 1569 * [[VUID-VkVideoEncodeH265RateControlLayerInfoKHR-useMinQp-08299]] 1570 If pname:useMinQp is ename:VK_TRUE and 1571 slink:VkVideoEncodeH265CapabilitiesKHR::pname:flags, as returned by 1572 flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video 1573 profile, does not include 1574 ename:VK_VIDEO_ENCODE_H265_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR, 1575 then the pname:qpI, pname:qpP, and pname:qpB members of pname:minQp 1576 must: all specify the same value 1577 * [[VUID-VkVideoEncodeH265RateControlLayerInfoKHR-useMaxQp-08300]] 1578 If pname:useMaxQp is ename:VK_TRUE and 1579 slink:VkVideoEncodeH265CapabilitiesKHR::pname:flags, as returned by 1580 flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used video 1581 profile, does not include 1582 ename:VK_VIDEO_ENCODE_H265_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR, 1583 then the pname:qpI, pname:qpP, and pname:qpB members of pname:maxQp 1584 must: all specify the same value 1585 * [[VUID-VkVideoEncodeH265RateControlLayerInfoKHR-useMinQp-08375]] 1586 If pname:useMinQp and pname:useMaxQp are both ename:VK_TRUE, then the 1587 pname:qpI, pname:qpP, and pname:qpB members of pname:minQp must: all be 1588 less than or equal to the respective members of pname:maxQp 1589**** 1590 1591include::{generated}/validity/structs/VkVideoEncodeH265RateControlLayerInfoKHR.adoc[] 1592-- 1593 1594[open,refpage='VkVideoEncodeH265QpKHR',desc='Structure describing H.265 QP values per picture type',type='structs'] 1595-- 1596The sname:VkVideoEncodeH265QpKHR structure is defined as: 1597 1598include::{generated}/api/structs/VkVideoEncodeH265QpKHR.adoc[] 1599 1600 * pname:qpI is the QP to be used for <<encode-h265-i-pic,I pictures>>. 1601 * pname:qpP is the QP to be used for <<encode-h265-p-pic,P pictures>>. 1602 * pname:qpB is the QP to be used for <<encode-h265-b-pic,B pictures>>. 1603 1604include::{generated}/validity/structs/VkVideoEncodeH265QpKHR.adoc[] 1605-- 1606 1607[open,refpage='VkVideoEncodeH265FrameSizeKHR',desc='Structure describing frame size values per H.265 picture type',type='structs'] 1608-- 1609The sname:VkVideoEncodeH265FrameSizeKHR structure is defined as: 1610 1611include::{generated}/api/structs/VkVideoEncodeH265FrameSizeKHR.adoc[] 1612 1613 * pname:frameISize is the size in bytes to be used for 1614 <<encode-h265-i-pic,I frames>>. 1615 * pname:framePSize is the size in bytes to be used for 1616 <<encode-h265-p-pic,P frames>>. 1617 * pname:frameBSize is the size in bytes to be used for 1618 <<encode-h265-b-pic,B frames>>. 1619 1620include::{generated}/validity/structs/VkVideoEncodeH265FrameSizeKHR.adoc[] 1621-- 1622 1623 1624[[encode-h265-gop-remaining-frames]] 1625==== GOP Remaining Frames 1626 1627Besides session level rate control configuration, the application can: 1628specify the number of frames per frame type remaining in the 1629<<encode-h265-gop,group of pictures (GOP)>>. 1630 1631[open,refpage='VkVideoEncodeH265GopRemainingFrameInfoKHR',desc='Structure specifying H.265 encode rate control GOP remaining frame counts',type='structs'] 1632-- 1633The sname:VkVideoEncodeH265GopRemainingFrameInfoKHR structure is defined as: 1634 1635include::{generated}/api/structs/VkVideoEncodeH265GopRemainingFrameInfoKHR.adoc[] 1636 1637 * pname:sType is a elink:VkStructureType value identifying this structure. 1638 * pname:pNext is `NULL` or a pointer to a structure extending this 1639 structure. 1640 * pname:useGopRemainingFrames indicates whether the implementation's rate 1641 control algorithm should: use the values specified in 1642 pname:gopRemainingI, pname:gopRemainingP, and pname:gopRemainingB. 1643 If pname:useGopRemainingFrames is ename:VK_FALSE, then the values of 1644 pname:gopRemainingI, pname:gopRemainingP, and pname:gopRemainingB are 1645 ignored. 1646 * pname:gopRemainingI specifies the number of <<encode-h265-i-pic,I 1647 frames>> the implementation's rate control algorithm should: assume to 1648 be remaining in the <<encode-h265-gop,GOP>> prior to executing the video 1649 encode operation. 1650 * pname:gopRemainingP specifies the number of <<encode-h265-p-pic,P 1651 frames>> the implementation's rate control algorithm should: assume to 1652 be remaining in the <<encode-h265-gop,GOP>> prior to executing the video 1653 encode operation. 1654 * pname:gopRemainingB specifies the number of <<encode-h265-b-pic,B 1655 frames>> the implementation's rate control algorithm should: assume to 1656 be remaining in the <<encode-h265-gop,GOP>> prior to executing the video 1657 encode operation. 1658 1659Setting pname:useGopRemainingFrames to ename:VK_TRUE and including this 1660structure in the pname:pNext chain of slink:VkVideoBeginCodingInfoKHR is 1661only mandatory if the 1662slink:VkVideoEncodeH265CapabilitiesKHR::pname:requiresGopRemainingFrames 1663reported for the used <<video-profiles,video profile>> is ename:VK_TRUE. 1664However, implementations may: use these remaining frame counts, when 1665specified, even when it is not required. 1666In particular, when the application does not use a 1667<<encode-h265-regular-gop,regular GOP structure>>, these values may: provide 1668additional guidance for the implementation's rate control algorithm. 1669 1670The slink:VkVideoEncodeH265CapabilitiesKHR::pname:prefersGopRemainingFrames 1671capability is also used to indicate that the implementation's rate control 1672algorithm may: operate more accurately if the application specifies the 1673remaining frame counts using this structure. 1674 1675As with other rate control guidance values, if the effective order and 1676number of frames encoded by the application are not in line with the 1677remaining frame counts specified in this structure at any given point, then 1678the behavior of the implementation's rate control algorithm may: deviate 1679from the one expected by the application. 1680 1681include::{generated}/validity/structs/VkVideoEncodeH265GopRemainingFrameInfoKHR.adoc[] 1682-- 1683 1684 1685[[encode-h265-requirements]] 1686=== H.265 Encode Requirements 1687 1688This section described the required: H.265 encoding capabilities for 1689physical devices that have at least one queue family that supports the video 1690codec operation ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR, as 1691returned by flink:vkGetPhysicalDeviceQueueFamilyProperties2 in 1692slink:VkQueueFamilyVideoPropertiesKHR::pname:videoCodecOperations. 1693 1694.Required <<video-std-header-version,Video Std Header Versions>> 1695[options="header"] 1696|==== 1697| Video Std Header Name | Version 1698| `vulkan_video_codec_h265std_encode` | 1.0.0 1699|==== 1700 1701.Required Video Capabilities 1702[width="100%",cols="<35,<14,<11",options="header"] 1703|==== 1704| Video Capability | Requirement | Requirement Type^1^ 1705| **slink:VkVideoCapabilitiesKHR** | | 1706| pname:flags | - | min 1707| pname:minBitstreamBufferOffsetAlignment | 4096 | max 1708| pname:minBitstreamBufferSizeAlignment | 4096 | max 1709| pname:pictureAccessGranularity | (64,64) | max 1710| pname:minCodedExtent | - | max 1711| pname:maxCodedExtent | - | min 1712| pname:maxDpbSlots | 0 | min 1713| pname:maxActiveReferencePictures | 0 | min 1714| **slink:VkVideoEncodeCapabilitiesKHR** | | 1715| pname:flags | - | min 1716| pname:rateControlModes | - | min 1717| pname:maxBitrate | 128000 | min 1718| pname:maxQualityLevels | 1 | min 1719| pname:encodeInputPictureGranularity | (64,64) | max 1720| pname:supportedEncodeFeedbackFlags | ename:VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR + 1721 ename:VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR | min 1722| **slink:VkVideoEncodeH265CapabilitiesKHR** | | 1723| pname:flags | - | min 1724| pname:maxLevelIdc | code:STD_VIDEO_H265_LEVEL_IDC_1_0 | min 1725| pname:maxSliceSegmentCount | 1 | min 1726| pname:maxTiles | (1,1) | min 1727| pname:ctbSizes | at least one bit set | implementation-dependent 1728| pname:transformBlockSizes | at least one bit set | implementation-dependent 1729| pname:maxPPictureL0ReferenceCount | 0 | min 1730| pname:maxBPictureL0ReferenceCount | 0 | min 1731| pname:maxL1ReferenceCount | 0 | min 1732| pname:maxSubLayerCount | 1 | min 1733| pname:expectDyadicTemporalSubLayerPattern | - | implementation-dependent 1734| pname:minQp | - | max 1735| pname:maxQp | - | min 1736| pname:prefersGopRemainingFrames | - | implementation-dependent 1737| pname:requiresGopRemainingFrames | - | implementation-dependent 1738| pname:stdSyntaxFlags | - | min 1739|==== 1740 17411:: 1742 The *Requirement Type* column specifies the requirement is either the 1743 minimum value all implementations must: support, the maximum value all 1744 implementations must: support, or the exact value all implementations 1745 must: support. 1746 For bitmasks a minimum value is the least bits all implementations must: 1747 set, but they may: have additional bits set beyond this minimum. 1748