1e5c31af7Sopenharmony_ci// Copyright 2018-2024 The Khronos Group Inc. 2e5c31af7Sopenharmony_ci// 3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0 4e5c31af7Sopenharmony_ci 5e5c31af7Sopenharmony_ci[[video-decode-operations]] 6e5c31af7Sopenharmony_ci== Video Decode Operations 7e5c31af7Sopenharmony_ci 8e5c31af7Sopenharmony_ci[[decode-output-picture]] 9e5c31af7Sopenharmony_ciVideo decode operations consume compressed video data from a video bitstream 10e5c31af7Sopenharmony_cibuffer and zero or more reference pictures, and produce a _decode output 11e5c31af7Sopenharmony_cipicture_ and an optional <<reconstructed-picture,reconstructed picture>>. 12e5c31af7Sopenharmony_ci 13e5c31af7Sopenharmony_ci[NOTE] 14e5c31af7Sopenharmony_ci.Note 15e5c31af7Sopenharmony_ci==== 16e5c31af7Sopenharmony_ciSuch decode output pictures can be shared with the <<dpb,Decoded Picture 17e5c31af7Sopenharmony_ciBuffer>>, and can also be used 18e5c31af7Sopenharmony_ciifdef::VK_KHR_video_encode_queue[] 19e5c31af7Sopenharmony_cias the <<encode-input-picture,input>> of video encode operations, 20e5c31af7Sopenharmony_ciendif::VK_KHR_video_encode_queue[] 21e5c31af7Sopenharmony_ciwith graphics or compute operations, 22e5c31af7Sopenharmony_ciifdef::VK_KHR_surface[] 23e5c31af7Sopenharmony_cior with <<wsi,Window System Integration>> APIs, 24e5c31af7Sopenharmony_ciendif::VK_KHR_surface[] 25e5c31af7Sopenharmony_cidepending on the capabilities of the implementation. 26e5c31af7Sopenharmony_ci==== 27e5c31af7Sopenharmony_ci 28e5c31af7Sopenharmony_ciVideo decode operations may: access the following resources in the 29e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR stage: 30e5c31af7Sopenharmony_ci 31e5c31af7Sopenharmony_ci * The source video bitstream buffer range and the image subregions 32e5c31af7Sopenharmony_ci corresponding to the list of <<decode-active-reference-picture-info, 33e5c31af7Sopenharmony_ci active reference pictures>> with access 34e5c31af7Sopenharmony_ci ename:VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR. 35e5c31af7Sopenharmony_ci * The image subregions corresponding to the target 36e5c31af7Sopenharmony_ci <<decode-output-picture-info,decode output picture>> and 37e5c31af7Sopenharmony_ci <<decode-reconstructed-picture-info,reconstructed picture>> with access 38e5c31af7Sopenharmony_ci ename:VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR. 39e5c31af7Sopenharmony_ci 40e5c31af7Sopenharmony_ciThe image subresource of each <<video-picture-resources,video picture 41e5c31af7Sopenharmony_ciresource>> accessed by the video decode operation is specified using a 42e5c31af7Sopenharmony_cicorresponding slink:VkVideoPictureResourceInfoKHR structure. 43e5c31af7Sopenharmony_ciEach such image subresource must: be in the appropriate image layout as 44e5c31af7Sopenharmony_cifollows: 45e5c31af7Sopenharmony_ci 46e5c31af7Sopenharmony_ci * If the image subresource is used in the video decode operation only as 47e5c31af7Sopenharmony_ci <<decode-output-picture,decode output picture>>, then it must: be in the 48e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR layout. 49e5c31af7Sopenharmony_ci * If the image subresource is used in the video decode operation both as 50e5c31af7Sopenharmony_ci <<decode-output-picture,decode output picture>> and 51e5c31af7Sopenharmony_ci <<reconstructed-picture,reconstructed picture>>, then it must: be in the 52e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout. 53e5c31af7Sopenharmony_ci * If the image subresource is used in the video decode operation only as 54e5c31af7Sopenharmony_ci <<reconstructed-picture,reconstructed picture>>, then it must: be in the 55e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout. 56e5c31af7Sopenharmony_ci * If the image subresource is used in the video decode operation as a 57e5c31af7Sopenharmony_ci <<reference-picture,reference picture>>, then it must: be in the 58e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout. 59e5c31af7Sopenharmony_ci 60e5c31af7Sopenharmony_ci[[decode-unsuccessful]] 61e5c31af7Sopenharmony_ciA video decode operation may: complete unsuccessfully. 62e5c31af7Sopenharmony_ciIn this case the <<decode-output-picture,decode output picture>> will have 63e5c31af7Sopenharmony_ciundefined: contents. 64e5c31af7Sopenharmony_ciSimilarly, if <<decode-ref-pic-setup,reference picture setup>> is requested, 65e5c31af7Sopenharmony_cithe <<reconstructed-picture,reconstructed picture>> will also have 66e5c31af7Sopenharmony_ciundefined: contents, and the activated DPB slot will have an 67e5c31af7Sopenharmony_ci<<dpb-slot-states,invalid picture reference>>. 68e5c31af7Sopenharmony_ci 69e5c31af7Sopenharmony_ci 70e5c31af7Sopenharmony_ci[[decode-codec-specific-semantics]] 71e5c31af7Sopenharmony_ci=== Codec-Specific Semantics 72e5c31af7Sopenharmony_ci 73e5c31af7Sopenharmony_ciThe following aspects of video decode operations are codec-specific: 74e5c31af7Sopenharmony_ci 75e5c31af7Sopenharmony_ci * The interpretation of the contents of the source video bitstream buffer 76e5c31af7Sopenharmony_ci range. 77e5c31af7Sopenharmony_ci * The construction and interpretation of the list of 78e5c31af7Sopenharmony_ci <<decode-active-reference-picture-info,active reference pictures>> and 79e5c31af7Sopenharmony_ci the interpretation of the picture data referred to by the corresponding 80e5c31af7Sopenharmony_ci image subregions. 81e5c31af7Sopenharmony_ci * The construction and interpretation of information related to the 82e5c31af7Sopenharmony_ci <<decode-output-picture-info,decode output picture>> and the generation 83e5c31af7Sopenharmony_ci of picture data to the corresponding image subregion. 84e5c31af7Sopenharmony_ci * The decision on <<decode-ref-pic-setup,reference picture setup>>. 85e5c31af7Sopenharmony_ci * The construction and interpretation of information related to the 86e5c31af7Sopenharmony_ci optional <<decode-reconstructed-picture-info,reconstructed picture>> and 87e5c31af7Sopenharmony_ci the generation of picture data to the corresponding image subregion. 88e5c31af7Sopenharmony_ci 89e5c31af7Sopenharmony_ciThese codec-specific behaviors are defined for each video codec operation 90e5c31af7Sopenharmony_ciseparately. 91e5c31af7Sopenharmony_ci 92e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_h264[] 93e5c31af7Sopenharmony_ci * If the used video codec operation is 94e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the 95e5c31af7Sopenharmony_ci codec-specific aspects of the video decoding process are performed as 96e5c31af7Sopenharmony_ci defined in the <<decode-h264,H.264 Decode Operations>> section. 97e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_h264[] 98e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_h265[] 99e5c31af7Sopenharmony_ci * If the used video codec operation is 100e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the 101e5c31af7Sopenharmony_ci codec-specific aspects of the video decoding process are performed as 102e5c31af7Sopenharmony_ci defined in the <<decode-h265,H.265 Decode Operations>> section. 103e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_h265[] 104e5c31af7Sopenharmony_ci 105e5c31af7Sopenharmony_ci 106e5c31af7Sopenharmony_ci[[decode-operation-steps]] 107e5c31af7Sopenharmony_ci=== Video Decode Operation Steps 108e5c31af7Sopenharmony_ci 109e5c31af7Sopenharmony_ciEach video decode operation performs the following steps in the 110e5c31af7Sopenharmony_ciename:VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR stage: 111e5c31af7Sopenharmony_ci 112e5c31af7Sopenharmony_ci 1. Reads the encoded video data from the source video bitstream buffer 113e5c31af7Sopenharmony_ci range. 114e5c31af7Sopenharmony_ci 2. Performs picture reconstruction of the encoded video data according to 115e5c31af7Sopenharmony_ci the <<decode-codec-specific-semantics,codec-specific semantics>>, 116e5c31af7Sopenharmony_ci applying any prediction data read from the <<active-reference-pictures, 117e5c31af7Sopenharmony_ci active reference pictures>> in the process; 118e5c31af7Sopenharmony_ci 3. Writes the decoded picture data to the <<decode-output-picture,decode 119e5c31af7Sopenharmony_ci output picture>>, and optionally to the <<reconstructed-picture, 120e5c31af7Sopenharmony_ci reconstructed picture>>, if one is specified and is different from the 121e5c31af7Sopenharmony_ci decode output picture, according to the 122e5c31af7Sopenharmony_ci <<decode-codec-specific-semantics,codec-specific semantics>>; 123e5c31af7Sopenharmony_ci 4. If <<decode-ref-pic-setup,reference picture setup>> is requested, the 124e5c31af7Sopenharmony_ci <<dpb-slot,DPB slot index>> specified in the 125e5c31af7Sopenharmony_ci <<decode-reconstructed-picture-info,reconstructed picture information>> 126e5c31af7Sopenharmony_ci is <<dpb-slot-states,activated>> with the 127e5c31af7Sopenharmony_ci <<reconstructed-picture,reconstructed picture>>. 128e5c31af7Sopenharmony_ci 129e5c31af7Sopenharmony_ciWhen <<decode-reconstructed-picture-info,reconstructed picture information>> 130e5c31af7Sopenharmony_ciis provided, the specified <<dpb-slot,DPB slot>> index is associated with 131e5c31af7Sopenharmony_cithe corresponding <<bound-reference-picture-resources,bound reference 132e5c31af7Sopenharmony_cipicture resource>>, indifferent of whether <<decode-ref-pic-setup,reference 133e5c31af7Sopenharmony_cipicture setup>> is requested. 134e5c31af7Sopenharmony_ci 135e5c31af7Sopenharmony_ci 136e5c31af7Sopenharmony_ci=== Capabilities 137e5c31af7Sopenharmony_ci 138e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeCapabilitiesKHR',desc='Structure describing general video decode capabilities for a video profile',type='structs'] 139e5c31af7Sopenharmony_ci-- 140e5c31af7Sopenharmony_ciWhen calling flink:vkGetPhysicalDeviceVideoCapabilitiesKHR with 141e5c31af7Sopenharmony_cipname:pVideoProfile->videoCodecOperation specifying a decode operation, the 142e5c31af7Sopenharmony_cisname:VkVideoDecodeCapabilitiesKHR structure must: be included in the 143e5c31af7Sopenharmony_cipname:pNext chain of the slink:VkVideoCapabilitiesKHR structure to retrieve 144e5c31af7Sopenharmony_cicapabilities specific to video decoding. 145e5c31af7Sopenharmony_ci 146e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeCapabilitiesKHR structure is defined as: 147e5c31af7Sopenharmony_ci 148e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeCapabilitiesKHR.adoc[] 149e5c31af7Sopenharmony_ci 150e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 151e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 152e5c31af7Sopenharmony_ci structure. 153e5c31af7Sopenharmony_ci * pname:flags is a bitmask of elink:VkVideoDecodeCapabilityFlagBitsKHR 154e5c31af7Sopenharmony_ci describing the supported video decoding capabilities. 155e5c31af7Sopenharmony_ci 156e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeCapabilitiesKHR.adoc[] 157e5c31af7Sopenharmony_ci-- 158e5c31af7Sopenharmony_ci 159e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeCapabilityFlagBitsKHR',desc='Video decode capability flags',type='enums'] 160e5c31af7Sopenharmony_ci-- 161e5c31af7Sopenharmony_ciBits which may: be set in slink:VkVideoDecodeCapabilitiesKHR::pname:flags, 162e5c31af7Sopenharmony_ciindicating the decoding capabilities supported, are: 163e5c31af7Sopenharmony_ci 164e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkVideoDecodeCapabilityFlagBitsKHR.adoc[] 165e5c31af7Sopenharmony_ci 166e5c31af7Sopenharmony_ci * ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR 167e5c31af7Sopenharmony_ci indicates support for using the same video picture resource as the 168e5c31af7Sopenharmony_ci <<reconstructed-picture,reconstructed picture>> and 169e5c31af7Sopenharmony_ci <<decode-output-picture,decode output picture>> in a video decode 170e5c31af7Sopenharmony_ci operation. 171e5c31af7Sopenharmony_ci * ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR 172e5c31af7Sopenharmony_ci indicates support for using distinct video picture resources as the 173e5c31af7Sopenharmony_ci <<reconstructed-picture,reconstructed picture>> and 174e5c31af7Sopenharmony_ci <<decode-output-picture,decode output picture>> in a video decode 175e5c31af7Sopenharmony_ci operation. 176e5c31af7Sopenharmony_ci 177e5c31af7Sopenharmony_ciImplementations are only required: to support one of 178e5c31af7Sopenharmony_ciename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR and 179e5c31af7Sopenharmony_ciename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR. 180e5c31af7Sopenharmony_ciAccordingly, applications should: handle both cases to maximize portability. 181e5c31af7Sopenharmony_ci 182e5c31af7Sopenharmony_ci[NOTE] 183e5c31af7Sopenharmony_ci.Note 184e5c31af7Sopenharmony_ci==== 185e5c31af7Sopenharmony_ciIf both ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR and 186e5c31af7Sopenharmony_ciename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR are 187e5c31af7Sopenharmony_cisupported, an application can choose to create separate images for decode 188e5c31af7Sopenharmony_ciDPB and decode output. 189e5c31af7Sopenharmony_ciE.g. in cases when linear tiling is preferred (and supported) for the decode 190e5c31af7Sopenharmony_cioutput picture and the DPB requires optimal tiling, this avoids the need for 191e5c31af7Sopenharmony_cia separate copy at the expense of additional memory bandwidth requirements 192e5c31af7Sopenharmony_ciduring decoding. 193e5c31af7Sopenharmony_ci==== 194e5c31af7Sopenharmony_ci-- 195e5c31af7Sopenharmony_ci 196e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeCapabilityFlagsKHR',desc='Bitmask of VkVideoDecodeCapabilityFlagBitsKHR',type='flags'] 197e5c31af7Sopenharmony_ci-- 198e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkVideoDecodeCapabilityFlagsKHR.adoc[] 199e5c31af7Sopenharmony_ci 200e5c31af7Sopenharmony_citname:VkVideoDecodeCapabilityFlagsKHR is a bitmask type for setting a mask 201e5c31af7Sopenharmony_ciof zero or more elink:VkVideoDecodeCapabilityFlagBitsKHR. 202e5c31af7Sopenharmony_ci-- 203e5c31af7Sopenharmony_ci 204e5c31af7Sopenharmony_ci 205e5c31af7Sopenharmony_ci=== Video Decode Commands 206e5c31af7Sopenharmony_ci 207e5c31af7Sopenharmony_ci[open,refpage='vkCmdDecodeVideoKHR',desc='Launch a video decode operation',type='protos'] 208e5c31af7Sopenharmony_ci-- 209e5c31af7Sopenharmony_ciTo launch video decode operations, call: 210e5c31af7Sopenharmony_ci 211e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDecodeVideoKHR.adoc[] 212e5c31af7Sopenharmony_ci 213e5c31af7Sopenharmony_ci * pname:commandBuffer is the command buffer in which to record the 214e5c31af7Sopenharmony_ci command. 215e5c31af7Sopenharmony_ci * pname:pDecodeInfo is a pointer to a slink:VkVideoDecodeInfoKHR structure 216e5c31af7Sopenharmony_ci specifying the parameters of the video decode operations. 217e5c31af7Sopenharmony_ci 218e5c31af7Sopenharmony_ciEach call issues one or more video decode operations. 219e5c31af7Sopenharmony_ciThe implicit parameter pname:opCount corresponds to the number of video 220e5c31af7Sopenharmony_cidecode operations issued by the command. 221e5c31af7Sopenharmony_ciAfter calling this command, the 222e5c31af7Sopenharmony_ci<<queries-operation-active-query-index,active query index>> of each 223e5c31af7Sopenharmony_ci<<queries-operation-active,active>> query is incremented by pname:opCount. 224e5c31af7Sopenharmony_ci 225e5c31af7Sopenharmony_ciCurrently each call to this command results in the issue of a single video 226e5c31af7Sopenharmony_cidecode operation. 227e5c31af7Sopenharmony_ci 228e5c31af7Sopenharmony_ciifdef::VK_KHR_video_maintenance1[] 229e5c31af7Sopenharmony_ciIf the bound video session was created with 230e5c31af7Sopenharmony_ciename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR and the pname:pNext 231e5c31af7Sopenharmony_cichain of pname:pDecodeInfo includes a slink:VkVideoInlineQueryInfoKHR 232e5c31af7Sopenharmony_cistructure with its pname:queryPool member specifying a valid 233e5c31af7Sopenharmony_cisname:VkQueryPool handle, then this command will execute a query for each 234e5c31af7Sopenharmony_civideo decode operation issued by it. 235e5c31af7Sopenharmony_ciendif::VK_KHR_video_maintenance1[] 236e5c31af7Sopenharmony_ci 237e5c31af7Sopenharmony_ci[[decode-active-reference-picture-info]] 238e5c31af7Sopenharmony_ciActive Reference Picture Information:: 239e5c31af7Sopenharmony_ci 240e5c31af7Sopenharmony_ciThe list of <<active-reference-pictures,active reference pictures>> used by 241e5c31af7Sopenharmony_cia video decode operation is a list of image subregions used as the source of 242e5c31af7Sopenharmony_ci<<reference-picture,reference picture>> data and related parameters, and is 243e5c31af7Sopenharmony_ciderived from the slink:VkVideoReferenceSlotInfoKHR structures provided as 244e5c31af7Sopenharmony_cithe elements of the pname:pDecodeInfo->pReferenceSlots array. 245e5c31af7Sopenharmony_ciFor each element of pname:pDecodeInfo->pReferenceSlots, one or more elements 246e5c31af7Sopenharmony_ciare added to the active reference picture list, as defined by the 247e5c31af7Sopenharmony_ci<<decode-codec-specific-semantics,codec-specific semantics>>. 248e5c31af7Sopenharmony_ciEach element of this list contains the following information: 249e5c31af7Sopenharmony_ci 250e5c31af7Sopenharmony_ci * The image subregion within the image subresource 251e5c31af7Sopenharmony_ci <<video-image-subresource-reference,referred>> to by the 252e5c31af7Sopenharmony_ci <<video-picture-resources,video picture resource>> used as the reference 253e5c31af7Sopenharmony_ci picture. 254e5c31af7Sopenharmony_ci * The <<dpb-slot,DPB slot>> index the reference picture is associated 255e5c31af7Sopenharmony_ci with. 256e5c31af7Sopenharmony_ci * The codec-specific reference information related to the reference 257e5c31af7Sopenharmony_ci picture. 258e5c31af7Sopenharmony_ci 259e5c31af7Sopenharmony_ci[[decode-reconstructed-picture-info]] 260e5c31af7Sopenharmony_ciReconstructed Picture Information:: 261e5c31af7Sopenharmony_ci 262e5c31af7Sopenharmony_ciInformation related to the optional <<reconstructed-picture,reconstructed 263e5c31af7Sopenharmony_cipicture>> used by a video decode operation is derived from the 264e5c31af7Sopenharmony_cislink:VkVideoReferenceSlotInfoKHR structure pointed to by 265e5c31af7Sopenharmony_cipname:pDecodeInfo->pSetupReferenceSlot, if not `NULL`, as defined by the 266e5c31af7Sopenharmony_ci<<decode-codec-specific-semantics,codec-specific semantics>>, and consists 267e5c31af7Sopenharmony_ciof the following: 268e5c31af7Sopenharmony_ci 269e5c31af7Sopenharmony_ci * The image subregion within the image subresource 270e5c31af7Sopenharmony_ci <<video-image-subresource-reference,referred>> to by the 271e5c31af7Sopenharmony_ci <<video-picture-resources,video picture resource>> used as the 272e5c31af7Sopenharmony_ci reconstructed picture. 273e5c31af7Sopenharmony_ci * The <<dpb-slot,DPB slot>> index to use for picture reconstruction. 274e5c31af7Sopenharmony_ci * The codec-specific reference information related to the reconstructed 275e5c31af7Sopenharmony_ci picture. 276e5c31af7Sopenharmony_ci 277e5c31af7Sopenharmony_ci[[decode-ref-pic-setup]] 278e5c31af7Sopenharmony_ciSpecifying a valid slink:VkVideoReferenceSlotInfoKHR structure in 279e5c31af7Sopenharmony_cipname:pDecodeInfo->pSetupReferenceSlot is always required, unless the video 280e5c31af7Sopenharmony_cisession was created with slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlot 281e5c31af7Sopenharmony_ciequal to zero. 282e5c31af7Sopenharmony_ciHowever, the DPB slot identified by 283e5c31af7Sopenharmony_cipname:pDecodeInfo->pSetupReferenceSlot->slotIndex is only 284e5c31af7Sopenharmony_ci<<dpb-slot-states,activated>> with the <<reconstructed-picture,reconstructed 285e5c31af7Sopenharmony_cipicture>> specified in 286e5c31af7Sopenharmony_cipname:pDecodeInfo->pSetupReferenceSlot->pPictureResource if reference 287e5c31af7Sopenharmony_cipicture setup is requested according to the 288e5c31af7Sopenharmony_ci<<decode-codec-specific-semantics,codec-specific semantics>>. 289e5c31af7Sopenharmony_ci 290e5c31af7Sopenharmony_ciIf reconstructed picture information is specified, and 291e5c31af7Sopenharmony_cipname:pDecodeInfo->pSetupReferenceSlot->pPictureResource refers to a 292e5c31af7Sopenharmony_ci<<video-picture-resources,video picture resource>> different than that of 293e5c31af7Sopenharmony_cithe <<decode-output-picture,decode output picture>>, but reference picture 294e5c31af7Sopenharmony_cisetup is not requested, the contents of the <<video-picture-resources,video 295e5c31af7Sopenharmony_cipicture resource>> corresponding to the reconstructed picture will be 296e5c31af7Sopenharmony_ciundefined: after the video decode operation. 297e5c31af7Sopenharmony_ci 298e5c31af7Sopenharmony_ci[NOTE] 299e5c31af7Sopenharmony_ci.Note 300e5c31af7Sopenharmony_ci==== 301e5c31af7Sopenharmony_ciSome implementations may always output the reconstructed picture or use it 302e5c31af7Sopenharmony_cias temporary storage during the video decode operation even when the 303e5c31af7Sopenharmony_cireconstructed picture is not marked for future reference. 304e5c31af7Sopenharmony_ci==== 305e5c31af7Sopenharmony_ci 306e5c31af7Sopenharmony_ci[[decode-output-picture-info]] 307e5c31af7Sopenharmony_ciDecode Output Picture Information:: 308e5c31af7Sopenharmony_ci 309e5c31af7Sopenharmony_ciInformation related to the <<decode-output-picture,decode output picture>> 310e5c31af7Sopenharmony_ciused by a video decode operation is derived from 311e5c31af7Sopenharmony_cipname:pDecodeInfo->dstPictureResource and any codec-specific parameters 312e5c31af7Sopenharmony_ciprovided in the pname:pDecodeInfo->pNext chain, as defined by the 313e5c31af7Sopenharmony_ci<<decode-codec-specific-semantics,codec-specific semantics>>, and consists 314e5c31af7Sopenharmony_ciof the following: 315e5c31af7Sopenharmony_ci 316e5c31af7Sopenharmony_ci * The image subregion within the image subresource 317e5c31af7Sopenharmony_ci <<video-image-subresource-reference,referred>> to by the 318e5c31af7Sopenharmony_ci <<video-picture-resources,video picture resource>> used as the decode 319e5c31af7Sopenharmony_ci output picture. 320e5c31af7Sopenharmony_ci * The codec-specific picture information related to the decode output 321e5c31af7Sopenharmony_ci picture. 322e5c31af7Sopenharmony_ci 323e5c31af7Sopenharmony_ciSeveral limiting values are defined below that are referenced by the 324e5c31af7Sopenharmony_cirelevant valid usage statements of this command. 325e5c31af7Sopenharmony_ci 326e5c31af7Sopenharmony_ci * Let `uint32_t activeReferencePictureCount` be the size of the list of 327e5c31af7Sopenharmony_ci active reference pictures used by the video decode operation. 328e5c31af7Sopenharmony_ci Unless otherwise defined, pname:activeReferencePictureCount is set to 329e5c31af7Sopenharmony_ci the value of pname:pDecodeInfo->referenceSlotCount. 330e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_h264[] 331e5c31af7Sopenharmony_ci ** If the bound video session was created with an <<decode-h264-profile, 332e5c31af7Sopenharmony_ci H.264 decode profile>>, then let pname:activeReferencePictureCount be 333e5c31af7Sopenharmony_ci the value of pname:pDecodeInfo->referenceSlotCount plus the number of 334e5c31af7Sopenharmony_ci elements of the pname:pDecodeInfo->pReferenceSlots array that have a 335e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264DpbSlotInfoKHR structure included in their 336e5c31af7Sopenharmony_ci pname:pNext chain with both 337e5c31af7Sopenharmony_ci pname:pStdReferenceInfo->flags.top_field_flag and 338e5c31af7Sopenharmony_ci pname:pStdReferenceInfo->flags.bottom_field_flag set. 339e5c31af7Sopenharmony_ci+ 340e5c31af7Sopenharmony_ci[NOTE] 341e5c31af7Sopenharmony_ci.Note 342e5c31af7Sopenharmony_ci==== 343e5c31af7Sopenharmony_ciThis means that the elements of pname:pDecodeInfo->pReferenceSlots that 344e5c31af7Sopenharmony_ciinclude both a top and bottom field reference are counted as two separate 345e5c31af7Sopenharmony_ciactive reference pictures, as described in the 346e5c31af7Sopenharmony_ci<<decode-h264-active-reference-picture-info,active reference picture list 347e5c31af7Sopenharmony_ciconstruction rules for H.264 decode operations>>. 348e5c31af7Sopenharmony_ci==== 349e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_h264[] 350e5c31af7Sopenharmony_ci * Let `VkOffset2D codedOffsetGranularity` be the minimum alignment 351e5c31af7Sopenharmony_ci requirement for the coded offset of video picture resources. 352e5c31af7Sopenharmony_ci Unless otherwise defined, the value of the pname:x and pname:y members 353e5c31af7Sopenharmony_ci of pname:codedOffsetGranularity are `0`. 354e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_h264[] 355e5c31af7Sopenharmony_ci ** If the bound video session was created with an <<decode-h264-profile, 356e5c31af7Sopenharmony_ci H.264 decode profile>> with a 357e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264ProfileInfoKHR::pname:pictureLayout of 358e5c31af7Sopenharmony_ci ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR, 359e5c31af7Sopenharmony_ci then pname:codedOffsetGranularity is equal to 360e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264CapabilitiesKHR::pname:fieldOffsetGranularity, 361e5c31af7Sopenharmony_ci as returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for that 362e5c31af7Sopenharmony_ci video profile. 363e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_h264[] 364e5c31af7Sopenharmony_ci * Let `uint32_t dpbFrameUseCount[]` be an array of size pname:maxDpbSlots, 365e5c31af7Sopenharmony_ci where pname:maxDpbSlots is the 366e5c31af7Sopenharmony_ci slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots the bound video 367e5c31af7Sopenharmony_ci session was created with, with each element indicating the number of 368e5c31af7Sopenharmony_ci times a frame associated with the corresponding DPB slot index is 369e5c31af7Sopenharmony_ci referred to by the video coding operation. 370e5c31af7Sopenharmony_ci Let the initial value of each element of the array be `0`. 371e5c31af7Sopenharmony_ci ** If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then 372e5c31af7Sopenharmony_ci `dpbFrameUseCount[i]` is incremented by one, where pname:i equals 373e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->slotIndex. 374e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_h264[] 375e5c31af7Sopenharmony_ci If the bound video session object was created with an 376e5c31af7Sopenharmony_ci <<decode-h264-profile,H.264 decode profile>>, then 377e5c31af7Sopenharmony_ci `dpbFrameUseCount[i]` is decremented by one if either 378e5c31af7Sopenharmony_ci pname:pStdReferenceInfo->flags.top_field_flag or 379e5c31af7Sopenharmony_ci pname:pStdReferenceInfo->flags.bottom_field_flag is set in the 380e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the 381e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->pNext chain. 382e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_h264[] 383e5c31af7Sopenharmony_ci ** For each element of pname:pDecodeInfo->pReferenceSlots, 384e5c31af7Sopenharmony_ci `dpbFrameUseCount[i]` is incremented by one, where pname:i equals the 385e5c31af7Sopenharmony_ci pname:slotIndex member of the corresponding element. 386e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_h264[] 387e5c31af7Sopenharmony_ci If the bound video session object was created with an 388e5c31af7Sopenharmony_ci <<decode-h264-profile,H.264 decode profile>>, then 389e5c31af7Sopenharmony_ci `dpbFrameUseCount[i]` is decremented by one if either 390e5c31af7Sopenharmony_ci pname:pStdReferenceInfo->flags.top_field_flag or 391e5c31af7Sopenharmony_ci pname:pStdReferenceInfo->flags.bottom_field_flag is set in the 392e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the pname:pNext 393e5c31af7Sopenharmony_ci chain of the corresponding element of 394e5c31af7Sopenharmony_ci pname:pDecodeInfo->pReferenceSlots. 395e5c31af7Sopenharmony_ci * Let `uint32_t dpbTopFieldUseCount[]` and `uint32_t 396e5c31af7Sopenharmony_ci dpbBottomFieldUseCount[]` be arrays of size pname:maxDpbSlots, where 397e5c31af7Sopenharmony_ci pname:maxDpbSlots is the 398e5c31af7Sopenharmony_ci slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots the bound video 399e5c31af7Sopenharmony_ci session was created with, with each element indicating the number of 400e5c31af7Sopenharmony_ci times the top field or the bottom field, respectively, associated with 401e5c31af7Sopenharmony_ci the corresponding DPB slot index is referred to by the video coding 402e5c31af7Sopenharmony_ci operation. 403e5c31af7Sopenharmony_ci Let the initial value of each element of the arrays be `0`. 404e5c31af7Sopenharmony_ci ** If the bound video session object was created with an 405e5c31af7Sopenharmony_ci <<decode-h264-profile,H.264 decode profile>> and 406e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then perform the 407e5c31af7Sopenharmony_ci following: 408e5c31af7Sopenharmony_ci *** If pname:pStdReferenceInfo->flags.top_field_flag is set in the 409e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the 410e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->pNext chain, then 411e5c31af7Sopenharmony_ci `dpbTopFieldUseCount[i]` is incremented by one, where pname:i equals 412e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->slotIndex. 413e5c31af7Sopenharmony_ci *** If pname:pStdReferenceInfo->flags.bottom_field_flag is set in the 414e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the 415e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->pNext chain, then 416e5c31af7Sopenharmony_ci `dpbBottomFieldUseCount[i]` is incremented by one, where pname:i 417e5c31af7Sopenharmony_ci equals pname:pDecodeInfo->pSetupReferenceSlot->slotIndex. 418e5c31af7Sopenharmony_ci ** If the bound video session object was created with an 419e5c31af7Sopenharmony_ci <<decode-h264-profile,H.264 decode profile>>, then perform the 420e5c31af7Sopenharmony_ci following for each element of pname:pDecodeInfo->pReferenceSlots: 421e5c31af7Sopenharmony_ci *** If pname:pStdReferenceInfo->flags.top_field_flag is set in the 422e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the pname:pNext 423e5c31af7Sopenharmony_ci chain of the element, then `dpbTopFieldUseCount[i]` is incremented by 424e5c31af7Sopenharmony_ci one, where pname:i equals the pname:slotIndex member of the element. 425e5c31af7Sopenharmony_ci *** If pname:pStdReferenceInfo->flags.bottom_field_flag is set in the 426e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the pname:pNext 427e5c31af7Sopenharmony_ci chain of the element, then `dpbBottomFieldUseCount[i]` is incremented 428e5c31af7Sopenharmony_ci by one, where pname:i equals the pname:slotIndex member of the 429e5c31af7Sopenharmony_ci element. 430e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_h264[] 431e5c31af7Sopenharmony_ci 432e5c31af7Sopenharmony_ci.Valid Usage 433e5c31af7Sopenharmony_ci**** 434e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-None-08249]] 435e5c31af7Sopenharmony_ci The bound video session must: have been created with a decode operation 436e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-None-07011]] 437e5c31af7Sopenharmony_ci The bound video session must: not be in <<video-session-uninitialized, 438e5c31af7Sopenharmony_ci uninitialized>> state at the time the command is executed on the device 439e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-opCount-07134]] 440e5c31af7Sopenharmony_ci For each <<queries-operation-active,active>> query, the 441e5c31af7Sopenharmony_ci <<queries-operation-active-query-index,active query index>> 442e5c31af7Sopenharmony_ci corresponding to the query type of that query plus pname:opCount must: 443e5c31af7Sopenharmony_ci be less than or equal to the 444e5c31af7Sopenharmony_ci <<queries-operation-last-activatable-query-index,last activatable query 445e5c31af7Sopenharmony_ci index>> corresponding to the query type of that query plus one 446e5c31af7Sopenharmony_ciifdef::VK_KHR_video_maintenance1[] 447e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pNext-08365]] 448e5c31af7Sopenharmony_ci If the bound video session was created with 449e5c31af7Sopenharmony_ci ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR, and the 450e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo includes a 451e5c31af7Sopenharmony_ci slink:VkVideoInlineQueryInfoKHR structure with its pname:queryPool 452e5c31af7Sopenharmony_ci member specifying a valid sname:VkQueryPool handle, then 453e5c31af7Sopenharmony_ci slink:VkVideoInlineQueryInfoKHR::queryCount must: equal ename:opCount 454e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pNext-08366]] 455e5c31af7Sopenharmony_ci If the bound video session was created with 456e5c31af7Sopenharmony_ci ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR, and the 457e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo includes a 458e5c31af7Sopenharmony_ci slink:VkVideoInlineQueryInfoKHR structure with its pname:queryPool 459e5c31af7Sopenharmony_ci member specifying a valid sname:VkQueryPool handle, then all the queries 460e5c31af7Sopenharmony_ci used by the command, as specified by the slink:VkVideoInlineQueryInfoKHR 461e5c31af7Sopenharmony_ci structure, must: be _unavailable_ 462e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-queryType-08367]] 463e5c31af7Sopenharmony_ci If the bound video session was created with 464e5c31af7Sopenharmony_ci ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR, then the 465e5c31af7Sopenharmony_ci pname:queryType used to create the pname:queryPool specified in the 466e5c31af7Sopenharmony_ci slink:VkVideoInlineQueryInfoKHR structure included in the pname:pNext 467e5c31af7Sopenharmony_ci chain of pname:pDecodeInfo must: be 468e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR 469e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-queryPool-08368]] 470e5c31af7Sopenharmony_ci If the bound video session was created with 471e5c31af7Sopenharmony_ci ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR, then the 472e5c31af7Sopenharmony_ci pname:queryPool specified in the slink:VkVideoInlineQueryInfoKHR 473e5c31af7Sopenharmony_ci structure included in the pname:pNext chain of pname:pDecodeInfo must: 474e5c31af7Sopenharmony_ci have been created with a slink:VkVideoProfileInfoKHR structure included 475e5c31af7Sopenharmony_ci in the pname:pNext chain of slink:VkQueryPoolCreateInfo identical to the 476e5c31af7Sopenharmony_ci one specified in slink:VkVideoSessionCreateInfoKHR::pname:pVideoProfile 477e5c31af7Sopenharmony_ci the bound video session was created with 478e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-queryType-08369]] 479e5c31af7Sopenharmony_ci If the bound video session was created with 480e5c31af7Sopenharmony_ci ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR, and the 481e5c31af7Sopenharmony_ci pname:queryType used to create the pname:queryPool specified in the 482e5c31af7Sopenharmony_ci slink:VkVideoInlineQueryInfoKHR structure included in the pname:pNext 483e5c31af7Sopenharmony_ci chain of pname:pDecodeInfo is 484e5c31af7Sopenharmony_ci ename:VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, then the sname:VkCommandPool 485e5c31af7Sopenharmony_ci that pname:commandBuffer was allocated from must: have been created with 486e5c31af7Sopenharmony_ci a queue family index that supports <<queries-result-status-only,result 487e5c31af7Sopenharmony_ci status queries>>, as indicated by 488e5c31af7Sopenharmony_ci slink:VkQueueFamilyQueryResultStatusPropertiesKHR::pname:queryResultStatusSupport 489e5c31af7Sopenharmony_ciendif::VK_KHR_video_maintenance1[] 490e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07135]] 491e5c31af7Sopenharmony_ci pname:pDecodeInfo->srcBuffer must: be <<video-profile-compatibility, 492e5c31af7Sopenharmony_ci compatible>> with the video profile the bound video session was created 493e5c31af7Sopenharmony_ci with 494e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-commandBuffer-07136]] 495e5c31af7Sopenharmony_ci If pname:commandBuffer is an unprotected command buffer and 496e5c31af7Sopenharmony_ci <<limits-protectedNoFault, pname:protectedNoFault>> is not supported, 497e5c31af7Sopenharmony_ci then pname:pDecodeInfo->srcBuffer must: not be a protected buffer 498e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-commandBuffer-07137]] 499e5c31af7Sopenharmony_ci If pname:commandBuffer is a protected command buffer and 500e5c31af7Sopenharmony_ci <<limits-protectedNoFault, pname:protectedNoFault>> is not supported, 501e5c31af7Sopenharmony_ci then pname:pDecodeInfo->srcBuffer must: be a protected buffer 502e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07138]] 503e5c31af7Sopenharmony_ci pname:pDecodeInfo->srcBufferOffset must: be an integer multiple of 504e5c31af7Sopenharmony_ci slink:VkVideoCapabilitiesKHR::pname:minBitstreamBufferOffsetAlignment, 505e5c31af7Sopenharmony_ci as returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the 506e5c31af7Sopenharmony_ci video profile the bound video session was created with 507e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07139]] 508e5c31af7Sopenharmony_ci pname:pDecodeInfo->srcBufferRange must: be an integer multiple of 509e5c31af7Sopenharmony_ci slink:VkVideoCapabilitiesKHR::pname:minBitstreamBufferSizeAlignment, as 510e5c31af7Sopenharmony_ci returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video 511e5c31af7Sopenharmony_ci profile the bound video session was created with 512e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07140]] 513e5c31af7Sopenharmony_ci If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL` and 514e5c31af7Sopenharmony_ci slink:VkVideoDecodeCapabilitiesKHR::pname:flags does not include 515e5c31af7Sopenharmony_ci ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR, as 516e5c31af7Sopenharmony_ci returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video 517e5c31af7Sopenharmony_ci profile the bound video session was created with, then the video picture 518e5c31af7Sopenharmony_ci resources specified by pname:pDecodeInfo->dstPictureResource and 519e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource must: not 520e5c31af7Sopenharmony_ci <<video-picture-resource-matching,match>> 521e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07141]] 522e5c31af7Sopenharmony_ci If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL` and 523e5c31af7Sopenharmony_ci slink:VkVideoDecodeCapabilitiesKHR::pname:flags does not include 524e5c31af7Sopenharmony_ci ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR, as 525e5c31af7Sopenharmony_ci returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video 526e5c31af7Sopenharmony_ci profile the bound video session was created with, then the video picture 527e5c31af7Sopenharmony_ci resources specified by pname:pDecodeInfo->dstPictureResource and 528e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource must: 529e5c31af7Sopenharmony_ci <<video-picture-resource-matching,match>> 530e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07142]] 531e5c31af7Sopenharmony_ci pname:pDecodeInfo->dstPictureResource.imageViewBinding must: be 532e5c31af7Sopenharmony_ci <<video-profile-compatibility,compatible>> with the video profile the 533e5c31af7Sopenharmony_ci bound video session was created with 534e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07143]] 535e5c31af7Sopenharmony_ci The format of pname:pDecodeInfo->dstPictureResource.imageViewBinding 536e5c31af7Sopenharmony_ci must: match the slink:VkVideoSessionCreateInfoKHR::pname:pictureFormat 537e5c31af7Sopenharmony_ci the bound video session was created with 538e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07144]] 539e5c31af7Sopenharmony_ci pname:pDecodeInfo->dstPictureResource.codedOffset must: be an integer 540e5c31af7Sopenharmony_ci multiple of pname:codedOffsetGranularity 541e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07145]] 542e5c31af7Sopenharmony_ci pname:pDecodeInfo->dstPictureResource.codedExtent must: be between 543e5c31af7Sopenharmony_ci pname:minCodedExtent and pname:maxCodedExtent, inclusive, the bound 544e5c31af7Sopenharmony_ci video session was created with 545e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07146]] 546e5c31af7Sopenharmony_ci pname:pDecodeInfo->dstPictureResource.imageViewBinding must: have been 547e5c31af7Sopenharmony_ci created with ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR 548e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-commandBuffer-07147]] 549e5c31af7Sopenharmony_ci If pname:commandBuffer is an unprotected command buffer and 550e5c31af7Sopenharmony_ci <<limits-protectedNoFault, pname:protectedNoFault>> is not supported, 551e5c31af7Sopenharmony_ci then pname:pDecodeInfo->dstPictureResource.imageViewBinding must: not 552e5c31af7Sopenharmony_ci have been created from a protected image 553e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-commandBuffer-07148]] 554e5c31af7Sopenharmony_ci If pname:commandBuffer is a protected command buffer and 555e5c31af7Sopenharmony_ci <<limits-protectedNoFault, pname:protectedNoFault>> is not supported, 556e5c31af7Sopenharmony_ci then pname:pDecodeInfo->dstPictureResource.imageViewBinding must: have 557e5c31af7Sopenharmony_ci been created from a protected image 558e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-08376]] 559e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot must: not be `NULL` unless the 560e5c31af7Sopenharmony_ci bound video session was created with 561e5c31af7Sopenharmony_ci slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots equal to zero 562e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07170]] 563e5c31af7Sopenharmony_ci If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then 564e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->slotIndex must: be less than the 565e5c31af7Sopenharmony_ci slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots specified when the 566e5c31af7Sopenharmony_ci bound video session was created 567e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07173]] 568e5c31af7Sopenharmony_ci If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then 569e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource->codedOffset 570e5c31af7Sopenharmony_ci must: be an integer multiple of pname:codedOffsetGranularity 571e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07149]] 572e5c31af7Sopenharmony_ci If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then 573e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource must: 574e5c31af7Sopenharmony_ci <<video-picture-resource-matching,match>> one of the 575e5c31af7Sopenharmony_ci <<bound-reference-picture-resources,bound reference picture resource>> 576e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-activeReferencePictureCount-07150]] 577e5c31af7Sopenharmony_ci pname:activeReferencePictureCount must: be less than or equal to the 578e5c31af7Sopenharmony_ci slink:VkVideoSessionCreateInfoKHR::pname:maxActiveReferencePictures 579e5c31af7Sopenharmony_ci specified when the bound video session was created 580e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-slotIndex-07256]] 581e5c31af7Sopenharmony_ci The pname:slotIndex member of each element of 582e5c31af7Sopenharmony_ci pname:pDecodeInfo->pReferenceSlots must: be less than the 583e5c31af7Sopenharmony_ci slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots specified when the 584e5c31af7Sopenharmony_ci bound video session was created 585e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-codedOffset-07257]] 586e5c31af7Sopenharmony_ci The pname:codedOffset member of the slink:VkVideoPictureResourceInfoKHR 587e5c31af7Sopenharmony_ci structure pointed to by the pname:pPictureResource member of each 588e5c31af7Sopenharmony_ci element of pname:pDecodeInfo->pReferenceSlots must: be an integer 589e5c31af7Sopenharmony_ci multiple of pname:codedOffsetGranularity 590e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07151]] 591e5c31af7Sopenharmony_ci The pname:pPictureResource member of each element of 592e5c31af7Sopenharmony_ci pname:pDecodeInfo->pReferenceSlots must: 593e5c31af7Sopenharmony_ci <<video-picture-resource-matching,match>> one of the 594e5c31af7Sopenharmony_ci <<bound-reference-picture-resources,bound reference picture resource>> 595e5c31af7Sopenharmony_ci associated with the DPB slot index specified in the pname:slotIndex 596e5c31af7Sopenharmony_ci member of that element 597e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07264]] 598e5c31af7Sopenharmony_ci Each video picture resource corresponding to the pname:pPictureResource 599e5c31af7Sopenharmony_ci member specified in the elements of pname:pDecodeInfo->pReferenceSlots 600e5c31af7Sopenharmony_ci must: be <<video-picture-resource-uniqueness,unique>> within 601e5c31af7Sopenharmony_ci pname:pDecodeInfo->pReferenceSlots 602e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-dpbFrameUseCount-07176]] 603e5c31af7Sopenharmony_ci All elements of pname:dpbFrameUseCount must: be less than or equal to 604e5c31af7Sopenharmony_ci `1` 605e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_h264[] 606e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-dpbTopFieldUseCount-07177]] 607e5c31af7Sopenharmony_ci All elements of pname:dpbTopFieldUseCount must: be less than or equal to 608e5c31af7Sopenharmony_ci `1` 609e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-dpbBottomFieldUseCount-07178]] 610e5c31af7Sopenharmony_ci All elements of pname:dpbBottomFieldUseCount must: be less than or equal 611e5c31af7Sopenharmony_ci to `1` 612e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_h264[] 613e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07252]] 614e5c31af7Sopenharmony_ci If pname:pDecodeInfo->pSetupReferenceSlot is `NULL` or 615e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource does not 616e5c31af7Sopenharmony_ci <<video-image-subresource-reference,refer>> to the same image 617e5c31af7Sopenharmony_ci subresource as pname:pDecodeInfo->dstPictureResource, then the image 618e5c31af7Sopenharmony_ci subresource <<video-image-subresource-reference,referred>> to by 619e5c31af7Sopenharmony_ci pname:pDecodeInfo->dstPictureResource must: be in the 620e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR layout at the time the video 621e5c31af7Sopenharmony_ci decode operation is executed on the device 622e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07253]] 623e5c31af7Sopenharmony_ci If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL` and 624e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource 625e5c31af7Sopenharmony_ci <<video-image-subresource-reference,refers>> to the same image 626e5c31af7Sopenharmony_ci subresource as pname:pDecodeInfo->dstPictureResource, then the image 627e5c31af7Sopenharmony_ci subresource <<video-image-subresource-reference,referred>> to by 628e5c31af7Sopenharmony_ci pname:pDecodeInfo->dstPictureResource must: be in the 629e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout at the time the video 630e5c31af7Sopenharmony_ci decode operation is executed on the device 631e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07254]] 632e5c31af7Sopenharmony_ci If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then the image 633e5c31af7Sopenharmony_ci subresource <<video-image-subresource-reference,referred>> to by 634e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource must: be in the 635e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout at the time the video 636e5c31af7Sopenharmony_ci decode operation is executed on the device 637e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pPictureResource-07255]] 638e5c31af7Sopenharmony_ci The image subresource <<video-image-subresource-reference,referred>> to 639e5c31af7Sopenharmony_ci by the pname:pPictureResource member of each element of 640e5c31af7Sopenharmony_ci pname:pDecodeInfo->pReferenceSlots must: be in the 641e5c31af7Sopenharmony_ci ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout at the time the video 642e5c31af7Sopenharmony_ci decode operation is executed on the device 643e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_h264[] 644e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pNext-07152]] 645e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 646e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the pname:pNext 647e5c31af7Sopenharmony_ci chain of pname:pDecodeInfo must: include a 648e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264PictureInfoKHR structure 649e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-None-07258]] 650e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 651e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR but was not created 652e5c31af7Sopenharmony_ci with <<decode-h264-interlaced-support,interlaced frame support>>, then 653e5c31af7Sopenharmony_ci the <<decode-h264-output-picture-info,decode output picture>> must: 654e5c31af7Sopenharmony_ci represent a frame 655e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pSliceOffsets-07153]] 656e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 657e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then all elements of 658e5c31af7Sopenharmony_ci the pname:pSliceOffsets member of the 659e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264PictureInfoKHR structure included in the 660e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo must: be less than 661e5c31af7Sopenharmony_ci pname:pDecodeInfo->srcBufferRange 662e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-StdVideoH264SequenceParameterSet-07154]] 663e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 664e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the bound video 665e5c31af7Sopenharmony_ci session parameters object must: contain a 666e5c31af7Sopenharmony_ci code:StdVideoH264SequenceParameterSet entry with 667e5c31af7Sopenharmony_ci pname:seq_parameter_set_id matching 668e5c31af7Sopenharmony_ci code:StdVideoDecodeH264PictureInfo::pname:seq_parameter_set_id that is 669e5c31af7Sopenharmony_ci provided in the pname:pStdPictureInfo member of the 670e5c31af7Sopenharmony_ci slink:VkVideoDecodeH264PictureInfoKHR structure included in the 671e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo 672e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-StdVideoH264PictureParameterSet-07155]] 673e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 674e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the bound video 675e5c31af7Sopenharmony_ci session parameters object must: contain a 676e5c31af7Sopenharmony_ci code:StdVideoH264PictureParameterSet entry with 677e5c31af7Sopenharmony_ci pname:seq_parameter_set_id and pname:pic_parameter_set_id matching 678e5c31af7Sopenharmony_ci code:StdVideoDecodeH264PictureInfo::pname:seq_parameter_set_id and 679e5c31af7Sopenharmony_ci code:StdVideoDecodeH264PictureInfo::pname:pic_parameter_set_id, 680e5c31af7Sopenharmony_ci respectively, that are provided in the pname:pStdPictureInfo member of 681e5c31af7Sopenharmony_ci the slink:VkVideoDecodeH264PictureInfoKHR structure included in the 682e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo 683e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07156]] 684e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 685e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and 686e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then the 687e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo->pSetupReferenceSlot must: 688e5c31af7Sopenharmony_ci include a slink:VkVideoDecodeH264DpbSlotInfoKHR structure 689e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07259]] 690e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 691e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR but was not created 692e5c31af7Sopenharmony_ci with <<decode-h264-interlaced-support,interlaced frame support>>, and 693e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then the 694e5c31af7Sopenharmony_ci <<decode-h264-reconstructed-picture-info,reconstructed picture>> must: 695e5c31af7Sopenharmony_ci represent a frame 696e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pNext-07157]] 697e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 698e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the pname:pNext 699e5c31af7Sopenharmony_ci chain of each element of pname:pDecodeInfo->pReferenceSlots must: 700e5c31af7Sopenharmony_ci include a slink:VkVideoDecodeH264DpbSlotInfoKHR structure 701e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07260]] 702e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 703e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR but was not created 704e5c31af7Sopenharmony_ci with <<decode-h264-interlaced-support,interlaced frame support>>, then 705e5c31af7Sopenharmony_ci each <<decode-h264-active-reference-picture-info,active reference 706e5c31af7Sopenharmony_ci picture>> corresponding to the elements of 707e5c31af7Sopenharmony_ci pname:pDecodeInfo->pReferenceSlots must: represent a frame 708e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07261]] 709e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 710e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, 711e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, and the 712e5c31af7Sopenharmony_ci <<decode-h264-output-picture-info,decode output picture>> represents a 713e5c31af7Sopenharmony_ci frame, then the <<decode-h264-reconstructed-picture-info,reconstructed 714e5c31af7Sopenharmony_ci picture>> must: also represent a frame 715e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07262]] 716e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 717e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, 718e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, and the 719e5c31af7Sopenharmony_ci <<decode-h264-output-picture-info,decode output picture>> represents a 720e5c31af7Sopenharmony_ci top field, then the 721e5c31af7Sopenharmony_ci <<decode-h264-reconstructed-picture-info,reconstructed picture>> must: 722e5c31af7Sopenharmony_ci also represent a top field 723e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07263]] 724e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 725e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, 726e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, and the 727e5c31af7Sopenharmony_ci <<decode-h264-output-picture-info,decode output picture>> represents a 728e5c31af7Sopenharmony_ci bottom field, then the <<decode-h264-reconstructed-picture-info, 729e5c31af7Sopenharmony_ci reconstructed picture>> must: also represent a bottom field 730e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07266]] 731e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 732e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and an 733e5c31af7Sopenharmony_ci <<decode-h264-active-reference-picture-info,active reference picture>> 734e5c31af7Sopenharmony_ci corresponding to any element of pname:pDecodeInfo->pReferenceSlots 735e5c31af7Sopenharmony_ci represents a frame, then the DPB slot index of the bound video session 736e5c31af7Sopenharmony_ci specified by the pname:slotIndex member of that element must: be 737e5c31af7Sopenharmony_ci currently associated with a frame picture 738e5c31af7Sopenharmony_ci <<video-picture-resource-matching, matching>> the video picture resource 739e5c31af7Sopenharmony_ci specified by the pname:pPictureResource member of the same element at 740e5c31af7Sopenharmony_ci the time the command is executed on the device 741e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07267]] 742e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 743e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and an 744e5c31af7Sopenharmony_ci <<decode-h264-active-reference-picture-info,active reference picture>> 745e5c31af7Sopenharmony_ci corresponding to any element of pname:pDecodeInfo->pReferenceSlots 746e5c31af7Sopenharmony_ci represents a top field, then the DPB slot index of the bound video 747e5c31af7Sopenharmony_ci session specified by the pname:slotIndex member of that element must: be 748e5c31af7Sopenharmony_ci currently associated with a top field picture 749e5c31af7Sopenharmony_ci <<video-picture-resource-matching, matching>> the video picture resource 750e5c31af7Sopenharmony_ci specified by the pname:pPictureResource member of the same element at 751e5c31af7Sopenharmony_ci the time the command is executed on the device 752e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07268]] 753e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 754e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and an 755e5c31af7Sopenharmony_ci <<decode-h264-active-reference-picture-info,active reference picture>> 756e5c31af7Sopenharmony_ci corresponding to any element of pname:pDecodeInfo->pReferenceSlots 757e5c31af7Sopenharmony_ci represents a bottom field, then the DPB slot index of the bound video 758e5c31af7Sopenharmony_ci session specified by the pname:slotIndex member of that element must: be 759e5c31af7Sopenharmony_ci currently associated with a bottom field picture 760e5c31af7Sopenharmony_ci <<video-picture-resource-matching,matching>> the video picture resource 761e5c31af7Sopenharmony_ci specified by the pname:pPictureResource member of the same element at 762e5c31af7Sopenharmony_ci the time the command is executed on the device 763e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_h264[] 764e5c31af7Sopenharmony_ciifdef::VK_KHR_video_decode_h265[] 765e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pNext-07158]] 766e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 767e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the pname:pNext 768e5c31af7Sopenharmony_ci chain of pname:pDecodeInfo must: include a 769e5c31af7Sopenharmony_ci slink:VkVideoDecodeH265PictureInfoKHR structure 770e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pSliceSegmentOffsets-07159]] 771e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 772e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then all elements of 773e5c31af7Sopenharmony_ci the pname:pSliceSegmentOffsets member of the 774e5c31af7Sopenharmony_ci slink:VkVideoDecodeH265PictureInfoKHR structure included in the 775e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo must: be less than 776e5c31af7Sopenharmony_ci pname:pDecodeInfo->srcBufferRange 777e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-StdVideoH265VideoParameterSet-07160]] 778e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 779e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the bound video 780e5c31af7Sopenharmony_ci session parameters object must: contain a 781e5c31af7Sopenharmony_ci code:StdVideoH265VideoParameterSet entry with 782e5c31af7Sopenharmony_ci pname:vps_video_parameter_set_id matching 783e5c31af7Sopenharmony_ci code:StdVideoDecodeH265PictureInfo::pname:sps_video_parameter_set_id 784e5c31af7Sopenharmony_ci that is provided in the pname:pStdPictureInfo member of the 785e5c31af7Sopenharmony_ci slink:VkVideoDecodeH265PictureInfoKHR structure included in the 786e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo 787e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-StdVideoH265SequenceParameterSet-07161]] 788e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 789e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the bound video 790e5c31af7Sopenharmony_ci session parameters object must: contain a 791e5c31af7Sopenharmony_ci code:StdVideoH265SequenceParameterSet entry with 792e5c31af7Sopenharmony_ci pname:sps_video_parameter_set_id and pname:sps_seq_parameter_set_id 793e5c31af7Sopenharmony_ci matching 794e5c31af7Sopenharmony_ci code:StdVideoDecodeH265PictureInfo::pname:sps_video_parameter_set_id and 795e5c31af7Sopenharmony_ci code:StdVideoDecodeH265PictureInfo::pname:pps_seq_parameter_set_id, 796e5c31af7Sopenharmony_ci respectively, that are provided in the pname:pStdPictureInfo member of 797e5c31af7Sopenharmony_ci the slink:VkVideoDecodeH265PictureInfoKHR structure included in the 798e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo 799e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-StdVideoH265PictureParameterSet-07162]] 800e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 801e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the bound video 802e5c31af7Sopenharmony_ci session parameters object must: contain a 803e5c31af7Sopenharmony_ci code:StdVideoH265PictureParameterSet entry with 804e5c31af7Sopenharmony_ci pname:sps_video_parameter_set_id, pname:pps_seq_parameter_set_id, and 805e5c31af7Sopenharmony_ci pname:pps_pic_parameter_set_id matching 806e5c31af7Sopenharmony_ci code:StdVideoDecodeH265PictureInfo::pname:sps_video_parameter_set_id, 807e5c31af7Sopenharmony_ci code:StdVideoDecodeH265PictureInfo::pname:pps_seq_parameter_set_id, and 808e5c31af7Sopenharmony_ci code:StdVideoDecodeH265PictureInfo::pname:pps_pic_parameter_set_id, 809e5c31af7Sopenharmony_ci respectively, that are provided in the pname:pStdPictureInfo member of 810e5c31af7Sopenharmony_ci the slink:VkVideoDecodeH265PictureInfoKHR structure included in the 811e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo 812e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07163]] 813e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 814e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR and 815e5c31af7Sopenharmony_ci pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then the 816e5c31af7Sopenharmony_ci pname:pNext chain of pname:pDecodeInfo->pSetupReferenceSlot must: 817e5c31af7Sopenharmony_ci include a slink:VkVideoDecodeH265DpbSlotInfoKHR structure 818e5c31af7Sopenharmony_ci * [[VUID-vkCmdDecodeVideoKHR-pNext-07164]] 819e5c31af7Sopenharmony_ci If the bound video session was created with the video codec operation 820e5c31af7Sopenharmony_ci ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the pname:pNext 821e5c31af7Sopenharmony_ci chain of each element of pname:pDecodeInfo->pReferenceSlots must: 822e5c31af7Sopenharmony_ci include a slink:VkVideoDecodeH265DpbSlotInfoKHR structure 823e5c31af7Sopenharmony_ciendif::VK_KHR_video_decode_h265[] 824e5c31af7Sopenharmony_ci**** 825e5c31af7Sopenharmony_ci 826e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDecodeVideoKHR.adoc[] 827e5c31af7Sopenharmony_ci-- 828e5c31af7Sopenharmony_ci 829e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeInfoKHR',desc='Structure specifying video decode parameters',type='structs'] 830e5c31af7Sopenharmony_ci-- 831e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeInfoKHR structure is defined as: 832e5c31af7Sopenharmony_ci 833e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeInfoKHR.adoc[] 834e5c31af7Sopenharmony_ci 835e5c31af7Sopenharmony_ci * pname:sType is a elink:VkStructureType value identifying this structure. 836e5c31af7Sopenharmony_ci * pname:pNext is `NULL` or a pointer to a structure extending this 837e5c31af7Sopenharmony_ci structure. 838e5c31af7Sopenharmony_ci * pname:flags is reserved for future use. 839e5c31af7Sopenharmony_ci * pname:srcBuffer is the source video bitstream buffer to read the encoded 840e5c31af7Sopenharmony_ci bitstream from. 841e5c31af7Sopenharmony_ci * pname:srcBufferOffset is the starting offset in bytes from the start of 842e5c31af7Sopenharmony_ci pname:srcBuffer to read the encoded bitstream from. 843e5c31af7Sopenharmony_ci * pname:srcBufferRange is the size in bytes of the encoded bitstream to 844e5c31af7Sopenharmony_ci decode from pname:srcBuffer, starting from pname:srcBufferOffset. 845e5c31af7Sopenharmony_ci * pname:dstPictureResource is the video picture resource to use as the 846e5c31af7Sopenharmony_ci <<decode-output-picture,decode output picture>>. 847e5c31af7Sopenharmony_ci * pname:pSetupReferenceSlot is `NULL` or a pointer to a 848e5c31af7Sopenharmony_ci slink:VkVideoReferenceSlotInfoKHR structure specifying the 849e5c31af7Sopenharmony_ci <<decode-reconstructed-picture-info,reconstructed picture information>>. 850e5c31af7Sopenharmony_ci * pname:referenceSlotCount is the number of elements in the 851e5c31af7Sopenharmony_ci pname:pReferenceSlots array. 852e5c31af7Sopenharmony_ci * pname:pReferenceSlots is `NULL` or a pointer to an array of 853e5c31af7Sopenharmony_ci slink:VkVideoReferenceSlotInfoKHR structures describing the DPB slots 854e5c31af7Sopenharmony_ci and corresponding <<reference-picture,reference picture>> resources to 855e5c31af7Sopenharmony_ci use in this video decode operation (the set of 856e5c31af7Sopenharmony_ci <<active-reference-pictures, active reference pictures>>). 857e5c31af7Sopenharmony_ci 858e5c31af7Sopenharmony_ci.Valid Usage 859e5c31af7Sopenharmony_ci**** 860e5c31af7Sopenharmony_ci * [[VUID-VkVideoDecodeInfoKHR-srcBuffer-07165]] 861e5c31af7Sopenharmony_ci pname:srcBuffer must: have been created with 862e5c31af7Sopenharmony_ci ename:VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR set 863e5c31af7Sopenharmony_ci * [[VUID-VkVideoDecodeInfoKHR-srcBufferOffset-07166]] 864e5c31af7Sopenharmony_ci pname:srcBufferOffset must: be less than the size of pname:srcBuffer 865e5c31af7Sopenharmony_ci * [[VUID-VkVideoDecodeInfoKHR-srcBufferRange-07167]] 866e5c31af7Sopenharmony_ci pname:srcBufferRange must: be less than or equal to the size of 867e5c31af7Sopenharmony_ci pname:srcBuffer minus pname:srcBufferOffset 868e5c31af7Sopenharmony_ci * [[VUID-VkVideoDecodeInfoKHR-pSetupReferenceSlot-07168]] 869e5c31af7Sopenharmony_ci If pname:pSetupReferenceSlot is not `NULL`, then its pname:slotIndex 870e5c31af7Sopenharmony_ci member must: not be negative 871e5c31af7Sopenharmony_ci * [[VUID-VkVideoDecodeInfoKHR-pSetupReferenceSlot-07169]] 872e5c31af7Sopenharmony_ci If pname:pSetupReferenceSlot is not `NULL`, then its 873e5c31af7Sopenharmony_ci pname:pPictureResource must: not be `NULL` 874e5c31af7Sopenharmony_ci * [[VUID-VkVideoDecodeInfoKHR-slotIndex-07171]] 875e5c31af7Sopenharmony_ci The pname:slotIndex member of each element of pname:pReferenceSlots 876e5c31af7Sopenharmony_ci must: not be negative 877e5c31af7Sopenharmony_ci * [[VUID-VkVideoDecodeInfoKHR-pPictureResource-07172]] 878e5c31af7Sopenharmony_ci The pname:pPictureResource member of each element of 879e5c31af7Sopenharmony_ci pname:pReferenceSlots must: not be `NULL` 880e5c31af7Sopenharmony_ci**** 881e5c31af7Sopenharmony_ci 882e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeInfoKHR.adoc[] 883e5c31af7Sopenharmony_ci-- 884e5c31af7Sopenharmony_ci 885e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeFlagsKHR',desc='Reserved for future use',type='flags'] 886e5c31af7Sopenharmony_ci-- 887e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkVideoDecodeFlagsKHR.adoc[] 888e5c31af7Sopenharmony_ci 889e5c31af7Sopenharmony_citname:VkVideoDecodeFlagsKHR is a bitmask type for setting a mask, but is 890e5c31af7Sopenharmony_cicurrently reserved for future use. 891e5c31af7Sopenharmony_ci-- 892