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