// Copyright 2018-2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

[[video-decode-operations]]
== Video Decode Operations

[[decode-output-picture]]
Video decode operations consume compressed video data from a video bitstream
buffer and zero or more reference pictures, and produce a _decode output
picture_ and an optional <<reconstructed-picture,reconstructed picture>>.

[NOTE]
.Note
====
Such decode output pictures can be shared with the <<dpb,Decoded Picture
Buffer>>, and can also be used
ifdef::VK_KHR_video_encode_queue[]
as the <<encode-input-picture,input>> of video encode operations,
endif::VK_KHR_video_encode_queue[]
with graphics or compute operations,
ifdef::VK_KHR_surface[]
or with <<wsi,Window System Integration>> APIs,
endif::VK_KHR_surface[]
depending on the capabilities of the implementation.
====

Video decode operations may: access the following resources in the
ename:VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR stage:

  * The source video bitstream buffer range and the image subregions
    corresponding to the list of <<decode-active-reference-picture-info,
    active reference pictures>> with access
    ename:VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR.
  * The image subregions corresponding to the target
    <<decode-output-picture-info,decode output picture>> and
    <<decode-reconstructed-picture-info,reconstructed picture>> with access
    ename:VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR.

The image subresource of each <<video-picture-resources,video picture
resource>> accessed by the video decode operation is specified using a
corresponding slink:VkVideoPictureResourceInfoKHR structure.
Each such image subresource must: be in the appropriate image layout as
follows:

  * If the image subresource is used in the video decode operation only as
    <<decode-output-picture,decode output picture>>, then it must: be in the
    ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR layout.
  * If the image subresource is used in the video decode operation both as
    <<decode-output-picture,decode output picture>> and
    <<reconstructed-picture,reconstructed picture>>, then it must: be in the
    ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout.
  * If the image subresource is used in the video decode operation only as
    <<reconstructed-picture,reconstructed picture>>, then it must: be in the
    ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout.
  * If the image subresource is used in the video decode operation as a
    <<reference-picture,reference picture>>, then it must: be in the
    ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout.

[[decode-unsuccessful]]
A video decode operation may: complete unsuccessfully.
In this case the <<decode-output-picture,decode output picture>> will have
undefined: contents.
Similarly, if <<decode-ref-pic-setup,reference picture setup>> is requested,
the <<reconstructed-picture,reconstructed picture>> will also have
undefined: contents, and the activated DPB slot will have an
<<dpb-slot-states,invalid picture reference>>.


[[decode-codec-specific-semantics]]
=== Codec-Specific Semantics

The following aspects of video decode operations are codec-specific:

  * The interpretation of the contents of the source video bitstream buffer
    range.
  * The construction and interpretation of the list of
    <<decode-active-reference-picture-info,active reference pictures>> and
    the interpretation of the picture data referred to by the corresponding
    image subregions.
  * The construction and interpretation of information related to the
    <<decode-output-picture-info,decode output picture>> and the generation
    of picture data to the corresponding image subregion.
  * The decision on <<decode-ref-pic-setup,reference picture setup>>.
  * The construction and interpretation of information related to the
    optional <<decode-reconstructed-picture-info,reconstructed picture>> and
    the generation of picture data to the corresponding image subregion.

These codec-specific behaviors are defined for each video codec operation
separately.

ifdef::VK_KHR_video_decode_h264[]
  * If the used video codec operation is
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the
    codec-specific aspects of the video decoding process are performed as
    defined in the <<decode-h264,H.264 Decode Operations>> section.
endif::VK_KHR_video_decode_h264[]
ifdef::VK_KHR_video_decode_h265[]
  * If the used video codec operation is
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the
    codec-specific aspects of the video decoding process are performed as
    defined in the <<decode-h265,H.265 Decode Operations>> section.
endif::VK_KHR_video_decode_h265[]


[[decode-operation-steps]]
=== Video Decode Operation Steps

Each video decode operation performs the following steps in the
ename:VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR stage:

  1. Reads the encoded video data from the source video bitstream buffer
     range.
  2. Performs picture reconstruction of the encoded video data according to
     the <<decode-codec-specific-semantics,codec-specific semantics>>,
     applying any prediction data read from the <<active-reference-pictures,
     active reference pictures>> in the process;
  3. Writes the decoded picture data to the <<decode-output-picture,decode
     output picture>>, and optionally to the <<reconstructed-picture,
     reconstructed picture>>, if one is specified and is different from the
     decode output picture, according to the
     <<decode-codec-specific-semantics,codec-specific semantics>>;
  4. If <<decode-ref-pic-setup,reference picture setup>> is requested, the
     <<dpb-slot,DPB slot index>> specified in the
     <<decode-reconstructed-picture-info,reconstructed picture information>>
     is <<dpb-slot-states,activated>> with the
     <<reconstructed-picture,reconstructed picture>>.

When <<decode-reconstructed-picture-info,reconstructed picture information>>
is provided, the specified <<dpb-slot,DPB slot>> index is associated with
the corresponding <<bound-reference-picture-resources,bound reference
picture resource>>, indifferent of whether <<decode-ref-pic-setup,reference
picture setup>> is requested.


=== Capabilities

[open,refpage='VkVideoDecodeCapabilitiesKHR',desc='Structure describing general video decode capabilities for a video profile',type='structs']
--
When calling flink:vkGetPhysicalDeviceVideoCapabilitiesKHR with
pname:pVideoProfile->videoCodecOperation specifying a decode operation, the
sname:VkVideoDecodeCapabilitiesKHR structure must: be included in the
pname:pNext chain of the slink:VkVideoCapabilitiesKHR structure to retrieve
capabilities specific to video decoding.

The sname:VkVideoDecodeCapabilitiesKHR structure is defined as:

include::{generated}/api/structs/VkVideoDecodeCapabilitiesKHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:flags is a bitmask of elink:VkVideoDecodeCapabilityFlagBitsKHR
    describing the supported video decoding capabilities.

include::{generated}/validity/structs/VkVideoDecodeCapabilitiesKHR.adoc[]
--

[open,refpage='VkVideoDecodeCapabilityFlagBitsKHR',desc='Video decode capability flags',type='enums']
--
Bits which may: be set in slink:VkVideoDecodeCapabilitiesKHR::pname:flags,
indicating the decoding capabilities supported, are:

include::{generated}/api/enums/VkVideoDecodeCapabilityFlagBitsKHR.adoc[]

  * ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR
    indicates support for using the same video picture resource as the
    <<reconstructed-picture,reconstructed picture>> and
    <<decode-output-picture,decode output picture>> in a video decode
    operation.
  * ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR
    indicates support for using distinct video picture resources as the
    <<reconstructed-picture,reconstructed picture>> and
    <<decode-output-picture,decode output picture>> in a video decode
    operation.

Implementations are only required: to support one of
ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR and
ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR.
Accordingly, applications should: handle both cases to maximize portability.

[NOTE]
.Note
====
If both ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR and
ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR are
supported, an application can choose to create separate images for decode
DPB and decode output.
E.g. in cases when linear tiling is preferred (and supported) for the decode
output picture and the DPB requires optimal tiling, this avoids the need for
a separate copy at the expense of additional memory bandwidth requirements
during decoding.
====
--

[open,refpage='VkVideoDecodeCapabilityFlagsKHR',desc='Bitmask of VkVideoDecodeCapabilityFlagBitsKHR',type='flags']
--
include::{generated}/api/flags/VkVideoDecodeCapabilityFlagsKHR.adoc[]

tname:VkVideoDecodeCapabilityFlagsKHR is a bitmask type for setting a mask
of zero or more elink:VkVideoDecodeCapabilityFlagBitsKHR.
--


=== Video Decode Commands

[open,refpage='vkCmdDecodeVideoKHR',desc='Launch a video decode operation',type='protos']
--
To launch video decode operations, call:

include::{generated}/api/protos/vkCmdDecodeVideoKHR.adoc[]

  * pname:commandBuffer is the command buffer in which to record the
    command.
  * pname:pDecodeInfo is a pointer to a slink:VkVideoDecodeInfoKHR structure
    specifying the parameters of the video decode operations.

Each call issues one or more video decode operations.
The implicit parameter pname:opCount corresponds to the number of video
decode operations issued by the command.
After calling this command, the
<<queries-operation-active-query-index,active query index>> of each
<<queries-operation-active,active>> query is incremented by pname:opCount.

Currently each call to this command results in the issue of a single video
decode operation.

ifdef::VK_KHR_video_maintenance1[]
If the bound video session was created with
ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR and the pname:pNext
chain of pname:pDecodeInfo includes a slink:VkVideoInlineQueryInfoKHR
structure with its pname:queryPool member specifying a valid
sname:VkQueryPool handle, then this command will execute a query for each
video decode operation issued by it.
endif::VK_KHR_video_maintenance1[]

[[decode-active-reference-picture-info]]
Active Reference Picture Information::

The list of <<active-reference-pictures,active reference pictures>> used by
a video decode operation is a list of image subregions used as the source of
<<reference-picture,reference picture>> data and related parameters, and is
derived from the slink:VkVideoReferenceSlotInfoKHR structures provided as
the elements of the pname:pDecodeInfo->pReferenceSlots array.
For each element of pname:pDecodeInfo->pReferenceSlots, one or more elements
are added to the active reference picture list, as defined by the
<<decode-codec-specific-semantics,codec-specific semantics>>.
Each element of this list contains the following information:

  * The image subregion within the image subresource
    <<video-image-subresource-reference,referred>> to by the
    <<video-picture-resources,video picture resource>> used as the reference
    picture.
  * The <<dpb-slot,DPB slot>> index the reference picture is associated
    with.
  * The codec-specific reference information related to the reference
    picture.

[[decode-reconstructed-picture-info]]
Reconstructed Picture Information::

Information related to the optional <<reconstructed-picture,reconstructed
picture>> used by a video decode operation is derived from the
slink:VkVideoReferenceSlotInfoKHR structure pointed to by
pname:pDecodeInfo->pSetupReferenceSlot, if not `NULL`, as defined by the
<<decode-codec-specific-semantics,codec-specific semantics>>, and consists
of the following:

  * The image subregion within the image subresource
    <<video-image-subresource-reference,referred>> to by the
    <<video-picture-resources,video picture resource>> used as the
    reconstructed picture.
  * The <<dpb-slot,DPB slot>> index to use for picture reconstruction.
  * The codec-specific reference information related to the reconstructed
    picture.

[[decode-ref-pic-setup]]
Specifying a valid slink:VkVideoReferenceSlotInfoKHR structure in
pname:pDecodeInfo->pSetupReferenceSlot is always required, unless the video
session was created with slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlot
equal to zero.
However, the DPB slot identified by
pname:pDecodeInfo->pSetupReferenceSlot->slotIndex is only
<<dpb-slot-states,activated>> with the <<reconstructed-picture,reconstructed
picture>> specified in
pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource if reference
picture setup is requested according to the
<<decode-codec-specific-semantics,codec-specific semantics>>.

If reconstructed picture information is specified, and
pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource refers to a
<<video-picture-resources,video picture resource>> different than that of
the <<decode-output-picture,decode output picture>>, but reference picture
setup is not requested, the contents of the <<video-picture-resources,video
picture resource>> corresponding to the reconstructed picture will be
undefined: after the video decode operation.

[NOTE]
.Note
====
Some implementations may always output the reconstructed picture or use it
as temporary storage during the video decode operation even when the
reconstructed picture is not marked for future reference.
====

[[decode-output-picture-info]]
Decode Output Picture Information::

Information related to the <<decode-output-picture,decode output picture>>
used by a video decode operation is derived from
pname:pDecodeInfo->dstPictureResource and any codec-specific parameters
provided in the pname:pDecodeInfo->pNext chain, as defined by the
<<decode-codec-specific-semantics,codec-specific semantics>>, and consists
of the following:

  * The image subregion within the image subresource
    <<video-image-subresource-reference,referred>> to by the
    <<video-picture-resources,video picture resource>> used as the decode
    output picture.
  * The codec-specific picture information related to the decode output
    picture.

Several limiting values are defined below that are referenced by the
relevant valid usage statements of this command.

  * Let `uint32_t activeReferencePictureCount` be the size of the list of
    active reference pictures used by the video decode operation.
    Unless otherwise defined, pname:activeReferencePictureCount is set to
    the value of pname:pDecodeInfo->referenceSlotCount.
ifdef::VK_KHR_video_decode_h264[]
  ** If the bound video session was created with an <<decode-h264-profile,
     H.264 decode profile>>, then let pname:activeReferencePictureCount be
     the value of pname:pDecodeInfo->referenceSlotCount plus the number of
     elements of the pname:pDecodeInfo->pReferenceSlots array that have a
     slink:VkVideoDecodeH264DpbSlotInfoKHR structure included in their
     pname:pNext chain with both
     pname:pStdReferenceInfo->flags.top_field_flag and
     pname:pStdReferenceInfo->flags.bottom_field_flag set.
+
[NOTE]
.Note
====
This means that the elements of pname:pDecodeInfo->pReferenceSlots that
include both a top and bottom field reference are counted as two separate
active reference pictures, as described in the
<<decode-h264-active-reference-picture-info,active reference picture list
construction rules for H.264 decode operations>>.
====
endif::VK_KHR_video_decode_h264[]
  * Let `VkOffset2D codedOffsetGranularity` be the minimum alignment
    requirement for the coded offset of video picture resources.
    Unless otherwise defined, the value of the pname:x and pname:y members
    of pname:codedOffsetGranularity are `0`.
ifdef::VK_KHR_video_decode_h264[]
  ** If the bound video session was created with an <<decode-h264-profile,
     H.264 decode profile>> with a
     slink:VkVideoDecodeH264ProfileInfoKHR::pname:pictureLayout of
     ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR,
     then pname:codedOffsetGranularity is equal to
     slink:VkVideoDecodeH264CapabilitiesKHR::pname:fieldOffsetGranularity,
     as returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for that
     video profile.
endif::VK_KHR_video_decode_h264[]
  * Let `uint32_t dpbFrameUseCount[]` be an array of size pname:maxDpbSlots,
    where pname:maxDpbSlots is the
    slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots the bound video
    session was created with, with each element indicating the number of
    times a frame associated with the corresponding DPB slot index is
    referred to by the video coding operation.
    Let the initial value of each element of the array be `0`.
  ** If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then
     `dpbFrameUseCount[i]` is incremented by one, where pname:i equals
     pname:pDecodeInfo->pSetupReferenceSlot->slotIndex.
ifdef::VK_KHR_video_decode_h264[]
     If the bound video session object was created with an
     <<decode-h264-profile,H.264 decode profile>>, then
     `dpbFrameUseCount[i]` is decremented by one if either
     pname:pStdReferenceInfo->flags.top_field_flag or
     pname:pStdReferenceInfo->flags.bottom_field_flag is set in the
     slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the
     pname:pDecodeInfo->pSetupReferenceSlot->pNext chain.
endif::VK_KHR_video_decode_h264[]
  ** For each element of pname:pDecodeInfo->pReferenceSlots,
     `dpbFrameUseCount[i]` is incremented by one, where pname:i equals the
     pname:slotIndex member of the corresponding element.
ifdef::VK_KHR_video_decode_h264[]
     If the bound video session object was created with an
     <<decode-h264-profile,H.264 decode profile>>, then
     `dpbFrameUseCount[i]` is decremented by one if either
     pname:pStdReferenceInfo->flags.top_field_flag or
     pname:pStdReferenceInfo->flags.bottom_field_flag is set in the
     slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the pname:pNext
     chain of the corresponding element of
     pname:pDecodeInfo->pReferenceSlots.
  * Let `uint32_t dpbTopFieldUseCount[]` and `uint32_t
    dpbBottomFieldUseCount[]` be arrays of size pname:maxDpbSlots, where
    pname:maxDpbSlots is the
    slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots the bound video
    session was created with, with each element indicating the number of
    times the top field or the bottom field, respectively, associated with
    the corresponding DPB slot index is referred to by the video coding
    operation.
    Let the initial value of each element of the arrays be `0`.
  ** If the bound video session object was created with an
     <<decode-h264-profile,H.264 decode profile>> and
     pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then perform the
     following:
  *** If pname:pStdReferenceInfo->flags.top_field_flag is set in the
      slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the
      pname:pDecodeInfo->pSetupReferenceSlot->pNext chain, then
      `dpbTopFieldUseCount[i]` is incremented by one, where pname:i equals
      pname:pDecodeInfo->pSetupReferenceSlot->slotIndex.
  *** If pname:pStdReferenceInfo->flags.bottom_field_flag is set in the
      slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the
      pname:pDecodeInfo->pSetupReferenceSlot->pNext chain, then
      `dpbBottomFieldUseCount[i]` is incremented by one, where pname:i
      equals pname:pDecodeInfo->pSetupReferenceSlot->slotIndex.
  ** If the bound video session object was created with an
     <<decode-h264-profile,H.264 decode profile>>, then perform the
     following for each element of pname:pDecodeInfo->pReferenceSlots:
  *** If pname:pStdReferenceInfo->flags.top_field_flag is set in the
      slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the pname:pNext
      chain of the element, then `dpbTopFieldUseCount[i]` is incremented by
      one, where pname:i equals the pname:slotIndex member of the element.
  *** If pname:pStdReferenceInfo->flags.bottom_field_flag is set in the
      slink:VkVideoDecodeH264DpbSlotInfoKHR structure in the pname:pNext
      chain of the element, then `dpbBottomFieldUseCount[i]` is incremented
      by one, where pname:i equals the pname:slotIndex member of the
      element.
endif::VK_KHR_video_decode_h264[]

.Valid Usage
****
  * [[VUID-vkCmdDecodeVideoKHR-None-08249]]
    The bound video session must: have been created with a decode operation
  * [[VUID-vkCmdDecodeVideoKHR-None-07011]]
    The bound video session must: not be in <<video-session-uninitialized,
    uninitialized>> state at the time the command is executed on the device
  * [[VUID-vkCmdDecodeVideoKHR-opCount-07134]]
    For each <<queries-operation-active,active>> query, the
    <<queries-operation-active-query-index,active query index>>
    corresponding to the query type of that query plus pname:opCount must:
    be less than or equal to the
    <<queries-operation-last-activatable-query-index,last activatable query
    index>> corresponding to the query type of that query plus one
ifdef::VK_KHR_video_maintenance1[]
  * [[VUID-vkCmdDecodeVideoKHR-pNext-08365]]
    If the bound video session was created with
    ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR, and the
    pname:pNext chain of pname:pDecodeInfo includes a
    slink:VkVideoInlineQueryInfoKHR structure with its pname:queryPool
    member specifying a valid sname:VkQueryPool handle, then
    slink:VkVideoInlineQueryInfoKHR::queryCount must: equal ename:opCount
  * [[VUID-vkCmdDecodeVideoKHR-pNext-08366]]
    If the bound video session was created with
    ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR, and the
    pname:pNext chain of pname:pDecodeInfo includes a
    slink:VkVideoInlineQueryInfoKHR structure with its pname:queryPool
    member specifying a valid sname:VkQueryPool handle, then all the queries
    used by the command, as specified by the slink:VkVideoInlineQueryInfoKHR
    structure, must: be _unavailable_
  * [[VUID-vkCmdDecodeVideoKHR-queryType-08367]]
    If the bound video session was created with
    ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR, then the
    pname:queryType used to create the pname:queryPool specified in the
    slink:VkVideoInlineQueryInfoKHR structure included in the pname:pNext
    chain of pname:pDecodeInfo must: be
    ename:VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR
  * [[VUID-vkCmdDecodeVideoKHR-queryPool-08368]]
    If the bound video session was created with
    ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR, then the
    pname:queryPool specified in the slink:VkVideoInlineQueryInfoKHR
    structure included in the pname:pNext chain of pname:pDecodeInfo must:
    have been created with a slink:VkVideoProfileInfoKHR structure included
    in the pname:pNext chain of slink:VkQueryPoolCreateInfo identical to the
    one specified in slink:VkVideoSessionCreateInfoKHR::pname:pVideoProfile
    the bound video session was created with
  * [[VUID-vkCmdDecodeVideoKHR-queryType-08369]]
    If the bound video session was created with
    ename:VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR, and the
    pname:queryType used to create the pname:queryPool specified in the
    slink:VkVideoInlineQueryInfoKHR structure included in the pname:pNext
    chain of pname:pDecodeInfo is
    ename:VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, then the sname:VkCommandPool
    that pname:commandBuffer was allocated from must: have been created with
    a queue family index that supports <<queries-result-status-only,result
    status queries>>, as indicated by
    slink:VkQueueFamilyQueryResultStatusPropertiesKHR::pname:queryResultStatusSupport
endif::VK_KHR_video_maintenance1[]
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07135]]
    pname:pDecodeInfo->srcBuffer must: be <<video-profile-compatibility,
    compatible>> with the video profile the bound video session was created
    with
  * [[VUID-vkCmdDecodeVideoKHR-commandBuffer-07136]]
    If pname:commandBuffer is an unprotected command buffer and
    <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
    then pname:pDecodeInfo->srcBuffer must: not be a protected buffer
  * [[VUID-vkCmdDecodeVideoKHR-commandBuffer-07137]]
    If pname:commandBuffer is a protected command buffer and
    <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
    then pname:pDecodeInfo->srcBuffer must: be a protected buffer
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07138]]
    pname:pDecodeInfo->srcBufferOffset must: be an integer multiple of
    slink:VkVideoCapabilitiesKHR::pname:minBitstreamBufferOffsetAlignment,
    as returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the
    video profile the bound video session was created with
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07139]]
    pname:pDecodeInfo->srcBufferRange must: be an integer multiple of
    slink:VkVideoCapabilitiesKHR::pname:minBitstreamBufferSizeAlignment, as
    returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video
    profile the bound video session was created with
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07140]]
    If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL` and
    slink:VkVideoDecodeCapabilitiesKHR::pname:flags does not include
    ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR, as
    returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video
    profile the bound video session was created with, then the video picture
    resources specified by pname:pDecodeInfo->dstPictureResource and
    pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource must: not
    <<video-picture-resource-matching,match>>
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07141]]
    If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL` and
    slink:VkVideoDecodeCapabilitiesKHR::pname:flags does not include
    ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR, as
    returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video
    profile the bound video session was created with, then the video picture
    resources specified by pname:pDecodeInfo->dstPictureResource and
    pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource must:
    <<video-picture-resource-matching,match>>
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07142]]
    pname:pDecodeInfo->dstPictureResource.imageViewBinding must: be
    <<video-profile-compatibility,compatible>> with the video profile the
    bound video session was created with
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07143]]
    The format of pname:pDecodeInfo->dstPictureResource.imageViewBinding
    must: match the slink:VkVideoSessionCreateInfoKHR::pname:pictureFormat
    the bound video session was created with
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07144]]
    pname:pDecodeInfo->dstPictureResource.codedOffset must: be an integer
    multiple of pname:codedOffsetGranularity
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07145]]
    pname:pDecodeInfo->dstPictureResource.codedExtent must: be between
    pname:minCodedExtent and pname:maxCodedExtent, inclusive, the bound
    video session was created with
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07146]]
    pname:pDecodeInfo->dstPictureResource.imageViewBinding must: have been
    created with ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR
  * [[VUID-vkCmdDecodeVideoKHR-commandBuffer-07147]]
    If pname:commandBuffer is an unprotected command buffer and
    <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
    then pname:pDecodeInfo->dstPictureResource.imageViewBinding must: not
    have been created from a protected image
  * [[VUID-vkCmdDecodeVideoKHR-commandBuffer-07148]]
    If pname:commandBuffer is a protected command buffer and
    <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
    then pname:pDecodeInfo->dstPictureResource.imageViewBinding must: have
    been created from a protected image
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-08376]]
    pname:pDecodeInfo->pSetupReferenceSlot must: not be `NULL` unless the
    bound video session was created with
    slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots equal to zero
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07170]]
    If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then
    pname:pDecodeInfo->pSetupReferenceSlot->slotIndex must: be less than the
    slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots specified when the
    bound video session was created
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07173]]
    If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then
    pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource->codedOffset
    must: be an integer multiple of pname:codedOffsetGranularity
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07149]]
    If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then
    pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource must:
    <<video-picture-resource-matching,match>> one of the
    <<bound-reference-picture-resources,bound reference picture resource>>
  * [[VUID-vkCmdDecodeVideoKHR-activeReferencePictureCount-07150]]
    pname:activeReferencePictureCount must: be less than or equal to the
    slink:VkVideoSessionCreateInfoKHR::pname:maxActiveReferencePictures
    specified when the bound video session was created
  * [[VUID-vkCmdDecodeVideoKHR-slotIndex-07256]]
    The pname:slotIndex member of each element of
    pname:pDecodeInfo->pReferenceSlots must: be less than the
    slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots specified when the
    bound video session was created
  * [[VUID-vkCmdDecodeVideoKHR-codedOffset-07257]]
    The pname:codedOffset member of the slink:VkVideoPictureResourceInfoKHR
    structure pointed to by the pname:pPictureResource member of each
    element of pname:pDecodeInfo->pReferenceSlots must: be an integer
    multiple of pname:codedOffsetGranularity
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07151]]
    The pname:pPictureResource member of each element of
    pname:pDecodeInfo->pReferenceSlots must:
    <<video-picture-resource-matching,match>> one of the
    <<bound-reference-picture-resources,bound reference picture resource>>
    associated with the DPB slot index specified in the pname:slotIndex
    member of that element
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07264]]
    Each video picture resource corresponding to the pname:pPictureResource
    member specified in the elements of pname:pDecodeInfo->pReferenceSlots
    must: be <<video-picture-resource-uniqueness,unique>> within
    pname:pDecodeInfo->pReferenceSlots
  * [[VUID-vkCmdDecodeVideoKHR-dpbFrameUseCount-07176]]
    All elements of pname:dpbFrameUseCount must: be less than or equal to
    `1`
ifdef::VK_KHR_video_decode_h264[]
  * [[VUID-vkCmdDecodeVideoKHR-dpbTopFieldUseCount-07177]]
    All elements of pname:dpbTopFieldUseCount must: be less than or equal to
    `1`
  * [[VUID-vkCmdDecodeVideoKHR-dpbBottomFieldUseCount-07178]]
    All elements of pname:dpbBottomFieldUseCount must: be less than or equal
    to `1`
endif::VK_KHR_video_decode_h264[]
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07252]]
    If pname:pDecodeInfo->pSetupReferenceSlot is `NULL` or
    pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource does not
    <<video-image-subresource-reference,refer>> to the same image
    subresource as pname:pDecodeInfo->dstPictureResource, then the image
    subresource <<video-image-subresource-reference,referred>> to by
    pname:pDecodeInfo->dstPictureResource must: be in the
    ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR layout at the time the video
    decode operation is executed on the device
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07253]]
    If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL` and
    pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource
    <<video-image-subresource-reference,refers>> to the same image
    subresource as pname:pDecodeInfo->dstPictureResource, then the image
    subresource <<video-image-subresource-reference,referred>> to by
    pname:pDecodeInfo->dstPictureResource must: be in the
    ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout at the time the video
    decode operation is executed on the device
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07254]]
    If pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then the image
    subresource <<video-image-subresource-reference,referred>> to by
    pname:pDecodeInfo->pSetupReferenceSlot->pPictureResource must: be in the
    ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout at the time the video
    decode operation is executed on the device
  * [[VUID-vkCmdDecodeVideoKHR-pPictureResource-07255]]
    The image subresource <<video-image-subresource-reference,referred>> to
    by the pname:pPictureResource member of each element of
    pname:pDecodeInfo->pReferenceSlots must: be in the
    ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR layout at the time the video
    decode operation is executed on the device
ifdef::VK_KHR_video_decode_h264[]
  * [[VUID-vkCmdDecodeVideoKHR-pNext-07152]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the pname:pNext
    chain of pname:pDecodeInfo must: include a
    slink:VkVideoDecodeH264PictureInfoKHR structure
  * [[VUID-vkCmdDecodeVideoKHR-None-07258]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR but was not created
    with <<decode-h264-interlaced-support,interlaced frame support>>, then
    the <<decode-h264-output-picture-info,decode output picture>> must:
    represent a frame
  * [[VUID-vkCmdDecodeVideoKHR-pSliceOffsets-07153]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then all elements of
    the pname:pSliceOffsets member of the
    slink:VkVideoDecodeH264PictureInfoKHR structure included in the
    pname:pNext chain of pname:pDecodeInfo must: be less than
    pname:pDecodeInfo->srcBufferRange
  * [[VUID-vkCmdDecodeVideoKHR-StdVideoH264SequenceParameterSet-07154]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the bound video
    session parameters object must: contain a
    code:StdVideoH264SequenceParameterSet entry with
    pname:seq_parameter_set_id matching
    code:StdVideoDecodeH264PictureInfo::pname:seq_parameter_set_id that is
    provided in the pname:pStdPictureInfo member of the
    slink:VkVideoDecodeH264PictureInfoKHR structure included in the
    pname:pNext chain of pname:pDecodeInfo
  * [[VUID-vkCmdDecodeVideoKHR-StdVideoH264PictureParameterSet-07155]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the bound video
    session parameters object must: contain a
    code:StdVideoH264PictureParameterSet entry with
    pname:seq_parameter_set_id and pname:pic_parameter_set_id matching
    code:StdVideoDecodeH264PictureInfo::pname:seq_parameter_set_id and
    code:StdVideoDecodeH264PictureInfo::pname:pic_parameter_set_id,
    respectively, that are provided in the pname:pStdPictureInfo member of
    the slink:VkVideoDecodeH264PictureInfoKHR structure included in the
    pname:pNext chain of pname:pDecodeInfo
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07156]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and
    pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then the
    pname:pNext chain of pname:pDecodeInfo->pSetupReferenceSlot must:
    include a slink:VkVideoDecodeH264DpbSlotInfoKHR structure
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07259]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR but was not created
    with <<decode-h264-interlaced-support,interlaced frame support>>, and
    pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then the
    <<decode-h264-reconstructed-picture-info,reconstructed picture>> must:
    represent a frame
  * [[VUID-vkCmdDecodeVideoKHR-pNext-07157]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the pname:pNext
    chain of each element of pname:pDecodeInfo->pReferenceSlots must:
    include a slink:VkVideoDecodeH264DpbSlotInfoKHR structure
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07260]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR but was not created
    with <<decode-h264-interlaced-support,interlaced frame support>>, then
    each <<decode-h264-active-reference-picture-info,active reference
    picture>> corresponding to the elements of
    pname:pDecodeInfo->pReferenceSlots must: represent a frame
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07261]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR,
    pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, and the
    <<decode-h264-output-picture-info,decode output picture>> represents a
    frame, then the <<decode-h264-reconstructed-picture-info,reconstructed
    picture>> must: also represent a frame
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07262]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR,
    pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, and the
    <<decode-h264-output-picture-info,decode output picture>> represents a
    top field, then the
    <<decode-h264-reconstructed-picture-info,reconstructed picture>> must:
    also represent a top field
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07263]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR,
    pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, and the
    <<decode-h264-output-picture-info,decode output picture>> represents a
    bottom field, then the <<decode-h264-reconstructed-picture-info,
    reconstructed picture>> must: also represent a bottom field
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07266]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and an
    <<decode-h264-active-reference-picture-info,active reference picture>>
    corresponding to any element of pname:pDecodeInfo->pReferenceSlots
    represents a frame, then the DPB slot index of the bound video session
    specified by the pname:slotIndex member of that element must: be
    currently associated with a frame picture
    <<video-picture-resource-matching, matching>> the video picture resource
    specified by the pname:pPictureResource member of the same element at
    the time the command is executed on the device
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07267]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and an
    <<decode-h264-active-reference-picture-info,active reference picture>>
    corresponding to any element of pname:pDecodeInfo->pReferenceSlots
    represents a top field, then the DPB slot index of the bound video
    session specified by the pname:slotIndex member of that element must: be
    currently associated with a top field picture
    <<video-picture-resource-matching, matching>> the video picture resource
    specified by the pname:pPictureResource member of the same element at
    the time the command is executed on the device
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07268]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and an
    <<decode-h264-active-reference-picture-info,active reference picture>>
    corresponding to any element of pname:pDecodeInfo->pReferenceSlots
    represents a bottom field, then the DPB slot index of the bound video
    session specified by the pname:slotIndex member of that element must: be
    currently associated with a bottom field picture
    <<video-picture-resource-matching,matching>> the video picture resource
    specified by the pname:pPictureResource member of the same element at
    the time the command is executed on the device
endif::VK_KHR_video_decode_h264[]
ifdef::VK_KHR_video_decode_h265[]
  * [[VUID-vkCmdDecodeVideoKHR-pNext-07158]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the pname:pNext
    chain of pname:pDecodeInfo must: include a
    slink:VkVideoDecodeH265PictureInfoKHR structure
  * [[VUID-vkCmdDecodeVideoKHR-pSliceSegmentOffsets-07159]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then all elements of
    the pname:pSliceSegmentOffsets member of the
    slink:VkVideoDecodeH265PictureInfoKHR structure included in the
    pname:pNext chain of pname:pDecodeInfo must: be less than
    pname:pDecodeInfo->srcBufferRange
  * [[VUID-vkCmdDecodeVideoKHR-StdVideoH265VideoParameterSet-07160]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the bound video
    session parameters object must: contain a
    code:StdVideoH265VideoParameterSet entry with
    pname:vps_video_parameter_set_id matching
    code:StdVideoDecodeH265PictureInfo::pname:sps_video_parameter_set_id
    that is provided in the pname:pStdPictureInfo member of the
    slink:VkVideoDecodeH265PictureInfoKHR structure included in the
    pname:pNext chain of pname:pDecodeInfo
  * [[VUID-vkCmdDecodeVideoKHR-StdVideoH265SequenceParameterSet-07161]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the bound video
    session parameters object must: contain a
    code:StdVideoH265SequenceParameterSet entry with
    pname:sps_video_parameter_set_id and pname:sps_seq_parameter_set_id
    matching
    code:StdVideoDecodeH265PictureInfo::pname:sps_video_parameter_set_id and
    code:StdVideoDecodeH265PictureInfo::pname:pps_seq_parameter_set_id,
    respectively, that are provided in the pname:pStdPictureInfo member of
    the slink:VkVideoDecodeH265PictureInfoKHR structure included in the
    pname:pNext chain of pname:pDecodeInfo
  * [[VUID-vkCmdDecodeVideoKHR-StdVideoH265PictureParameterSet-07162]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the bound video
    session parameters object must: contain a
    code:StdVideoH265PictureParameterSet entry with
    pname:sps_video_parameter_set_id, pname:pps_seq_parameter_set_id, and
    pname:pps_pic_parameter_set_id matching
    code:StdVideoDecodeH265PictureInfo::pname:sps_video_parameter_set_id,
    code:StdVideoDecodeH265PictureInfo::pname:pps_seq_parameter_set_id, and
    code:StdVideoDecodeH265PictureInfo::pname:pps_pic_parameter_set_id,
    respectively, that are provided in the pname:pStdPictureInfo member of
    the slink:VkVideoDecodeH265PictureInfoKHR structure included in the
    pname:pNext chain of pname:pDecodeInfo
  * [[VUID-vkCmdDecodeVideoKHR-pDecodeInfo-07163]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR and
    pname:pDecodeInfo->pSetupReferenceSlot is not `NULL`, then the
    pname:pNext chain of pname:pDecodeInfo->pSetupReferenceSlot must:
    include a slink:VkVideoDecodeH265DpbSlotInfoKHR structure
  * [[VUID-vkCmdDecodeVideoKHR-pNext-07164]]
    If the bound video session was created with the video codec operation
    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the pname:pNext
    chain of each element of pname:pDecodeInfo->pReferenceSlots must:
    include a slink:VkVideoDecodeH265DpbSlotInfoKHR structure
endif::VK_KHR_video_decode_h265[]
****

include::{generated}/validity/protos/vkCmdDecodeVideoKHR.adoc[]
--

[open,refpage='VkVideoDecodeInfoKHR',desc='Structure specifying video decode parameters',type='structs']
--
The sname:VkVideoDecodeInfoKHR structure is defined as:

include::{generated}/api/structs/VkVideoDecodeInfoKHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:flags is reserved for future use.
  * pname:srcBuffer is the source video bitstream buffer to read the encoded
    bitstream from.
  * pname:srcBufferOffset is the starting offset in bytes from the start of
    pname:srcBuffer to read the encoded bitstream from.
  * pname:srcBufferRange is the size in bytes of the encoded bitstream to
    decode from pname:srcBuffer, starting from pname:srcBufferOffset.
  * pname:dstPictureResource is the video picture resource to use as the
    <<decode-output-picture,decode output picture>>.
  * pname:pSetupReferenceSlot is `NULL` or a pointer to a
    slink:VkVideoReferenceSlotInfoKHR structure specifying the
    <<decode-reconstructed-picture-info,reconstructed picture information>>.
  * pname:referenceSlotCount is the number of elements in the
    pname:pReferenceSlots array.
  * pname:pReferenceSlots is `NULL` or a pointer to an array of
    slink:VkVideoReferenceSlotInfoKHR structures describing the DPB slots
    and corresponding <<reference-picture,reference picture>> resources to
    use in this video decode operation (the set of
    <<active-reference-pictures, active reference pictures>>).

.Valid Usage
****
  * [[VUID-VkVideoDecodeInfoKHR-srcBuffer-07165]]
    pname:srcBuffer must: have been created with
    ename:VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR set
  * [[VUID-VkVideoDecodeInfoKHR-srcBufferOffset-07166]]
    pname:srcBufferOffset must: be less than the size of pname:srcBuffer
  * [[VUID-VkVideoDecodeInfoKHR-srcBufferRange-07167]]
    pname:srcBufferRange must: be less than or equal to the size of
    pname:srcBuffer minus pname:srcBufferOffset
  * [[VUID-VkVideoDecodeInfoKHR-pSetupReferenceSlot-07168]]
    If pname:pSetupReferenceSlot is not `NULL`, then its pname:slotIndex
    member must: not be negative
  * [[VUID-VkVideoDecodeInfoKHR-pSetupReferenceSlot-07169]]
    If pname:pSetupReferenceSlot is not `NULL`, then its
    pname:pPictureResource must: not be `NULL`
  * [[VUID-VkVideoDecodeInfoKHR-slotIndex-07171]]
    The pname:slotIndex member of each element of pname:pReferenceSlots
    must: not be negative
  * [[VUID-VkVideoDecodeInfoKHR-pPictureResource-07172]]
    The pname:pPictureResource member of each element of
    pname:pReferenceSlots must: not be `NULL`
****

include::{generated}/validity/structs/VkVideoDecodeInfoKHR.adoc[]
--

[open,refpage='VkVideoDecodeFlagsKHR',desc='Reserved for future use',type='flags']
--
include::{generated}/api/flags/VkVideoDecodeFlagsKHR.adoc[]

tname:VkVideoDecodeFlagsKHR is a bitmask type for setting a mask, but is
currently reserved for future use.
--
