1e5c31af7Sopenharmony_ci// Copyright 2018-2021 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_ciBefore the application can start recording Vulkan command buffers for the
9e5c31af7Sopenharmony_ciVideo Decode Operations, it must: do the following, beforehand:
10e5c31af7Sopenharmony_ci
11e5c31af7Sopenharmony_ci  . Ensure that the implementation can decode the Video Content by querying
12e5c31af7Sopenharmony_ci    the supported codec operations and profiles using
13e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceQueueFamilyProperties2.
14e5c31af7Sopenharmony_ci  . By using flink:vkGetPhysicalDeviceVideoFormatPropertiesKHR and providing
15e5c31af7Sopenharmony_ci    one or more video profiles, choose the Vulkan formats supported by the
16e5c31af7Sopenharmony_ci    implementation.
17e5c31af7Sopenharmony_ci    The formats for <<decoded-output-picture,output>> and
18e5c31af7Sopenharmony_ci    <<reference-picture,reference>> pictures must: be queried and chosen
19e5c31af7Sopenharmony_ci    separately.
20e5c31af7Sopenharmony_ci    Refer to the section on
21e5c31af7Sopenharmony_ci    <<supported-video-input-output-dpb-formats-enumeration,enumeration of
22e5c31af7Sopenharmony_ci    supported video formats>>.
23e5c31af7Sopenharmony_ci  . Before creating an image to be used as a video picture resource, obtain
24e5c31af7Sopenharmony_ci    the supported image creation parameters by querying with
25e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceFormatProperties2 and
26e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceImageFormatProperties2 using one of the
27e5c31af7Sopenharmony_ci    reported formats and adding slink:VkVideoProfilesKHR to the pname:pNext
28e5c31af7Sopenharmony_ci    chain of slink:VkFormatProperties2.
29e5c31af7Sopenharmony_ci    When querying the parameters with
30e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceImageFormatProperties2 for images targeting
31e5c31af7Sopenharmony_ci    decoded <<decoded-output-picture,output>> and
32e5c31af7Sopenharmony_ci    <<reference-picture,reference (DPB)>> pictures, the
33e5c31af7Sopenharmony_ci    slink:VkPhysicalDeviceImageFormatInfo2::pname:usage field should contain
34e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR and
35e5c31af7Sopenharmony_ci    ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR, respectively.
36e5c31af7Sopenharmony_ci  . Create none, some, or all of the required <<VkImage,images>> for the
37e5c31af7Sopenharmony_ci    <<decoded-output-picture,decoded output>> and
38e5c31af7Sopenharmony_ci    <<reference-picture,reference>> pictures.
39e5c31af7Sopenharmony_ci    More Video Picture Resources can: be created at some later point if
40e5c31af7Sopenharmony_ci    needed while processing the decoded content.
41e5c31af7Sopenharmony_ci    Also, if the decoded picture size is expected to change, the images can:
42e5c31af7Sopenharmony_ci    be created based on the maximum decoded content size required.
43e5c31af7Sopenharmony_ci  . Create the <<video-session,video session>> to be used for video decode
44e5c31af7Sopenharmony_ci    operations.
45e5c31af7Sopenharmony_ci    Before creating the Decode Video Session, the decode capabilities
46e5c31af7Sopenharmony_ci    should: be queried with flink:vkGetPhysicalDeviceVideoCapabilitiesKHR to
47e5c31af7Sopenharmony_ci    obtain the limits of the parameters allowed by the implementation for a
48e5c31af7Sopenharmony_ci    particular codec profile.
49e5c31af7Sopenharmony_ci  . Bind memory resources with the decode video session by calling
50e5c31af7Sopenharmony_ci    flink:vkBindVideoSessionMemoryKHR.
51e5c31af7Sopenharmony_ci    The video session cannot: be used until memory resources are allocated
52e5c31af7Sopenharmony_ci    and bound to it.
53e5c31af7Sopenharmony_ci    In order to determine the required memory sizes and heap types of the
54e5c31af7Sopenharmony_ci    device memory allocations, flink:vkGetVideoSessionMemoryRequirementsKHR
55e5c31af7Sopenharmony_ci    should: be called.
56e5c31af7Sopenharmony_ci  . Create one or more <<video-session-parameters-introduction,Session
57e5c31af7Sopenharmony_ci    Parameter objects>> for use across command buffer recording operations,
58e5c31af7Sopenharmony_ci    if required by the codec extension in use.
59e5c31af7Sopenharmony_ci    These objects must: be created against a <<video-session,video session>>
60e5c31af7Sopenharmony_ci    with the parameters required by the codec.
61e5c31af7Sopenharmony_ci    Each <<video-session-parameters-introduction,Session Parameter object>>
62e5c31af7Sopenharmony_ci    created is a child object of the associated <<video-session, Session
63e5c31af7Sopenharmony_ci    object>> and cannot: be bound in the command buffer with any other
64e5c31af7Sopenharmony_ci    <<video-session,Session Object>>.
65e5c31af7Sopenharmony_ci
66e5c31af7Sopenharmony_ciThe recording of Video Decode Commands against a Vulkan command buffer
67e5c31af7Sopenharmony_ciconsists of the following sequence:
68e5c31af7Sopenharmony_ci
69e5c31af7Sopenharmony_ci  . flink:vkCmdBeginVideoCodingKHR starts the recording of one or more Video
70e5c31af7Sopenharmony_ci    Decode operations in the command buffer.
71e5c31af7Sopenharmony_ci    For each Video Decode Command operation, a Video Session must: be bound
72e5c31af7Sopenharmony_ci    to the command buffer within this command.
73e5c31af7Sopenharmony_ci    This command establishes a Vulkan Video Decode Context that consists of
74e5c31af7Sopenharmony_ci    the bound Video Session Object, Session Parameters Object, and the
75e5c31af7Sopenharmony_ci    required Video Picture Resources.
76e5c31af7Sopenharmony_ci    The established Video Decode Context is in effect until the
77e5c31af7Sopenharmony_ci    flink:vkCmdEndVideoCodingKHR command is recorded.
78e5c31af7Sopenharmony_ci    If more Video Decode operations are to be required after the
79e5c31af7Sopenharmony_ci    flink:vkCmdEndVideoCodingKHR command, another Video Decode Context can:
80e5c31af7Sopenharmony_ci    be started with the flink:vkCmdBeginVideoCodingKHR command.
81e5c31af7Sopenharmony_ci  . flink:vkCmdDecodeVideoKHR specifies one or more compressed data buffers
82e5c31af7Sopenharmony_ci    to be decoded.
83e5c31af7Sopenharmony_ci    The slink:VkVideoDecodeInfoKHR parameters, and the codec extension
84e5c31af7Sopenharmony_ci    structures chained to this, specify the details of the decode operation.
85e5c31af7Sopenharmony_ci  . flink:vkCmdControlVideoCodingKHR records operations against the decoded
86e5c31af7Sopenharmony_ci    data, decoding device, or the Video Session state.
87e5c31af7Sopenharmony_ci  . flink:vkCmdEndVideoCodingKHR signals the end of the recording of the
88e5c31af7Sopenharmony_ci    Vulkan Video Decode Context, as established by
89e5c31af7Sopenharmony_ci    flink:vkCmdBeginVideoCodingKHR.
90e5c31af7Sopenharmony_ci
91e5c31af7Sopenharmony_ciIn addition to the above, the following commands can: be recorded between
92e5c31af7Sopenharmony_ciflink:vkCmdBeginVideoCodingKHR and flink:vkCmdEndVideoCodingKHR:
93e5c31af7Sopenharmony_ci
94e5c31af7Sopenharmony_ci  * Query operations
95e5c31af7Sopenharmony_ci  * Global Memory Barriers
96e5c31af7Sopenharmony_ci  * Buffer Memory Barriers
97e5c31af7Sopenharmony_ci  * Image Memory Barriers (these must: be used to transition the Video
98e5c31af7Sopenharmony_ci    Picture Resources to the proper
99e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR and
100e5c31af7Sopenharmony_ci    ename:VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR layouts).
101e5c31af7Sopenharmony_ci  * Pipeline Barriers
102e5c31af7Sopenharmony_ci  * Events
103e5c31af7Sopenharmony_ci  * Timestamps
104e5c31af7Sopenharmony_ci  * Device Groups (device mask)
105e5c31af7Sopenharmony_ci
106e5c31af7Sopenharmony_ciThe following Video Decode related commands must: be recorded *outside* the
107e5c31af7Sopenharmony_ciVulkan Video Decode Context established with the
108e5c31af7Sopenharmony_ciflink:vkCmdBeginVideoCodingKHR and flink:vkCmdEndVideoCodingKHR commands:
109e5c31af7Sopenharmony_ci
110e5c31af7Sopenharmony_ci  * Sparse Memory Binding
111e5c31af7Sopenharmony_ci  * Copy Commands
112e5c31af7Sopenharmony_ci  * Clear Commands
113e5c31af7Sopenharmony_ci
114e5c31af7Sopenharmony_ci
115e5c31af7Sopenharmony_ci[[video-picture-decode-modes]]
116e5c31af7Sopenharmony_ci=== Video Picture Decode Modes
117e5c31af7Sopenharmony_ci
118e5c31af7Sopenharmony_ciThere are a few ways that the flink:vkCmdDecodeVideoKHR can be configured
119e5c31af7Sopenharmony_cifor the Video Picture Decode Operations, based on:
120e5c31af7Sopenharmony_ci
121e5c31af7Sopenharmony_ci  * if the <<decoded-output-picture, output resource>> would need to be used
122e5c31af7Sopenharmony_ci    as <<reference-picture,Reference Picture>> for subsequent decode
123e5c31af7Sopenharmony_ci    operations and;
124e5c31af7Sopenharmony_ci  * if <<dpb-slot,DPB Slots>> are required for use as
125e5c31af7Sopenharmony_ci    <<reference-picture,Reference Pictures>> indexes.
126e5c31af7Sopenharmony_ci
127e5c31af7Sopenharmony_ci[[video-picture-decode-no-reference-picture-no-slot-update]]
128e5c31af7Sopenharmony_ciThe most basic Video Picture Decode operation with the
129e5c31af7Sopenharmony_ciflink:vkCmdDecodeVideoKHR command is to output the decoded pixel data
130e5c31af7Sopenharmony_ciwithout using any DPB <<reference-picture,Reference Pictures>> and without
131e5c31af7Sopenharmony_ciupdating any <<dpb-slot,DPB Slot's>> indexes.
132e5c31af7Sopenharmony_ci
133e5c31af7Sopenharmony_ciIn this case, the following slink:VkVideoDecodeInfoKHR parameters must: be
134e5c31af7Sopenharmony_ciset:
135e5c31af7Sopenharmony_ci
136e5c31af7Sopenharmony_ci  * slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->pPictureResource->imageViewBinding
137e5c31af7Sopenharmony_ci    must: be a valid slink:VkImageView.
138e5c31af7Sopenharmony_ci    This slink:VkImageView represents the <<decoded-output-picture, output
139e5c31af7Sopenharmony_ci    resource>> where the decoded pixels will be populated after a successful
140e5c31af7Sopenharmony_ci    decode operation.
141e5c31af7Sopenharmony_ci  * slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->slotIndex must:
142e5c31af7Sopenharmony_ci    be an invalid <<dpb-slot,DPB Slot>> index (-1) since the decoded picture
143e5c31af7Sopenharmony_ci    is not intended to be used as a reference picture with subsequent video
144e5c31af7Sopenharmony_ci    decode operations.
145e5c31af7Sopenharmony_ci  * The value of the slink:VkVideoDecodeInfoKHR::pname:referenceSlotCount
146e5c31af7Sopenharmony_ci    can: be `0` and slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots can:
147e5c31af7Sopenharmony_ci    be `NULL`.
148e5c31af7Sopenharmony_ci  * If slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots is not `NULL`, it
149e5c31af7Sopenharmony_ci    can: still have entries representing <<dpb-slot,DPB Slot>> indexes with
150e5c31af7Sopenharmony_ci    a <<video-session-dpb-slot-states, Valid Picture Reference>>.
151e5c31af7Sopenharmony_ci    The codec extension selects the actual use of the
152e5c31af7Sopenharmony_ci    <<reference-picture,Reference Pictures>> by referring to a
153e5c31af7Sopenharmony_ci    <<dpb-slot,DPB Slot>> index with a <<video-session-dpb-slot-states,
154e5c31af7Sopenharmony_ci    Valid Picture Reference>>.
155e5c31af7Sopenharmony_ci
156e5c31af7Sopenharmony_ci[[video-picture-decode-with-references-no-slot-update]]
157e5c31af7Sopenharmony_ci
158e5c31af7Sopenharmony_ciVideo Picture Decode operations with the flink:vkCmdDecodeVideoKHR command,
159e5c31af7Sopenharmony_cirequiring one or more <<reference-picture,Reference Pictures>> for the
160e5c31af7Sopenharmony_cipredictions of the values of samples for the <<decoded-output-picture,
161e5c31af7Sopenharmony_cidecoded output picture>> would require <<dpb-slot,DPB Slots>> with
162e5c31af7Sopenharmony_ci<<video-session-dpb-slot-states, Valid Picture Reference>>.
163e5c31af7Sopenharmony_ci
164e5c31af7Sopenharmony_ciIn this case, the following slink:VkVideoDecodeInfoKHR parameters must: be
165e5c31af7Sopenharmony_ciset:
166e5c31af7Sopenharmony_ci
167e5c31af7Sopenharmony_ci  * slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->pPictureResource->imageViewBinding
168e5c31af7Sopenharmony_ci    must: be a valid slink:VkImageView.
169e5c31af7Sopenharmony_ci    This slink:VkImageView represents the <<decoded-output-picture, output
170e5c31af7Sopenharmony_ci    resource>> where the decoded pixels will be populated after a successful
171e5c31af7Sopenharmony_ci    decode operation.
172e5c31af7Sopenharmony_ci  * slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->slotIndex must:
173e5c31af7Sopenharmony_ci    be an invalid <<dpb-slot,DPB Slot>> index (-1) since the decoded picture
174e5c31af7Sopenharmony_ci    is not intended to be used as a reference picture with subsequent video
175e5c31af7Sopenharmony_ci    decode operations.
176e5c31af7Sopenharmony_ci  * The value of the slink:VkVideoDecodeInfoKHR::pname:referenceSlotCount
177e5c31af7Sopenharmony_ci    must: not be `0` and slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots
178e5c31af7Sopenharmony_ci    should represent at least the number of the reference slots required for
179e5c31af7Sopenharmony_ci    the decode operation.
180e5c31af7Sopenharmony_ci    The codec extension selects the actual use of the
181e5c31af7Sopenharmony_ci    <<reference-picture,Reference Pictures>> by referring to a
182e5c31af7Sopenharmony_ci    <<dpb-slot,DPB Slot>> index with a <<video-session-dpb-slot-states,
183e5c31af7Sopenharmony_ci    Valid Picture Reference>>.
184e5c31af7Sopenharmony_ci    If the implementation does not use an opaque DPB, each <<dpb-slot,DPB
185e5c31af7Sopenharmony_ci    slot>> representing a <<reference-picture,reference picture>> must:
186e5c31af7Sopenharmony_ci    refer to a valid <<VkImageView,image view>>.
187e5c31af7Sopenharmony_ci    The <<VkImageView,image views>> must: represent the same
188e5c31af7Sopenharmony_ci    <<resources-images, image resources>> that were used to create the
189e5c31af7Sopenharmony_ci    <<reference-picture,reference picture>> for the corresponding
190e5c31af7Sopenharmony_ci    <<dpb-slot,DPB Slot>> index.
191e5c31af7Sopenharmony_ci  * slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots can: still have
192e5c31af7Sopenharmony_ci    entries representing <<dpb-slot,DPB Slot>> indexes with a
193e5c31af7Sopenharmony_ci    <<video-session-dpb-slot-states, Valid Picture Reference>>.
194e5c31af7Sopenharmony_ci
195e5c31af7Sopenharmony_ciAfter the flink:vkCmdDecodeVideoKHR operation is completed successfully, the
196e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->pPictureResource->imageViewBinding
197e5c31af7Sopenharmony_cipixel data will be updated with the decoded content.
198e5c31af7Sopenharmony_ciThe operation will not update any <<dpb-slot,DPB Slot>> with
199e5c31af7Sopenharmony_ci<<reference-picture,Reference Pictures>> data.
200e5c31af7Sopenharmony_ciHowever, any <<dpb-slot,DPB Slot>> activation, invalidation, or deactivation
201e5c31af7Sopenharmony_cioperations requested via slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots
202e5c31af7Sopenharmony_ciare still going to be performed.
203e5c31af7Sopenharmony_ci
204e5c31af7Sopenharmony_ciimage::images/DecodeSessionDpbDecodeWithOutputToVkImageViewNoReferencePictureSlotUpdate.svg[align="center",title="Decoding a Frame to VkImageView without a slot update for a *Reference Picture*",opts="{imageopts}"]
205e5c31af7Sopenharmony_ci
206e5c31af7Sopenharmony_ci
207e5c31af7Sopenharmony_ci[[video-picture-decode-with-reference-picture-and-slot-update]]
208e5c31af7Sopenharmony_ci==== Video Picture Decode with a <<reference-picture,Reference Picture>> slot update and using optional <<reference-picture,Reference Pictures>>
209e5c31af7Sopenharmony_ci
210e5c31af7Sopenharmony_ciWhen it is known that the picture to be decoded will be used as a
211e5c31af7Sopenharmony_ci<<reference-picture,reference picture>> for subsequent decode operations,
212e5c31af7Sopenharmony_cione of the available <<dpb-slot,DPB Slots>> needs to be selected for
213e5c31af7Sopenharmony_ci<<video-session-activating-dpb-slot, activation and update>> operations as
214e5c31af7Sopenharmony_cipart of the flink:vkCmdDecodeVideoKHR command.
215e5c31af7Sopenharmony_ci
216e5c31af7Sopenharmony_ciBased on whether a decode operation
217e5c31af7Sopenharmony_ci<<video-picture-decode-with-references-no-slot-update, with reference
218e5c31af7Sopenharmony_cipictures>> or <<video-picture-decode-no-reference-picture-no-slot-update,
219e5c31af7Sopenharmony_ciwithout reference pictures>> is required, the flink:vkCmdDecodeVideoKHR
220e5c31af7Sopenharmony_cishould be configured with parameters as described in the previous sections.
221e5c31af7Sopenharmony_ciIn addition, one of the available <<dpb-slot,DPB Slots>> must: be selected
222e5c31af7Sopenharmony_ciby the application, activated with resources and then set-up for an update
223e5c31af7Sopenharmony_ciwith the decode operation.
224e5c31af7Sopenharmony_ci
225e5c31af7Sopenharmony_ciIn this case, the following slink:VkVideoDecodeInfoKHR parameters must: be
226e5c31af7Sopenharmony_ciset:
227e5c31af7Sopenharmony_ci
228e5c31af7Sopenharmony_ci  * slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->pPictureResource->imageViewBinding
229e5c31af7Sopenharmony_ci    must: be a valid slink:VkImageView.
230e5c31af7Sopenharmony_ci    This slink:VkImageView represents the <<decoded-output-picture, output
231e5c31af7Sopenharmony_ci    resource>> where the decoded pixels will be populated after a successful
232e5c31af7Sopenharmony_ci    decode operation.
233e5c31af7Sopenharmony_ci    If the implementation does not use an opaque DPB, both the
234e5c31af7Sopenharmony_ci    <<decoded-output-picture, output>> and <<reference-picture,reference
235e5c31af7Sopenharmony_ci    picture>> resource coincide.
236e5c31af7Sopenharmony_ci  * slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->slotIndex must:
237e5c31af7Sopenharmony_ci    be a valid <<dpb-slot,DPB Slot>> index selected by the application,
238e5c31af7Sopenharmony_ci    based on the currently available slots.
239e5c31af7Sopenharmony_ci  * slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots can: still have
240e5c31af7Sopenharmony_ci    entries representing <<dpb-slot,DPB Slot>> indexes with a
241e5c31af7Sopenharmony_ci    <<video-session-dpb-slot-states, Valid Picture Reference>>.
242e5c31af7Sopenharmony_ci
243e5c31af7Sopenharmony_ciAfter the flink:vkCmdDecodeVideoKHR operation has completed successfully,
244e5c31af7Sopenharmony_cithe decoded content will be available in the resource provided for
245e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->pPictureResource->imageViewBinding.
246e5c31af7Sopenharmony_ciIn addition, this operation will update the selected <<dpb-slot,DPB Slot>>
247e5c31af7Sopenharmony_ciwith <<reference-picture,Reference Pictures>> data.
248e5c31af7Sopenharmony_ciAny other <<dpb-slot,DPB Slot>> activation,invalidation, or deactivation
249e5c31af7Sopenharmony_cioperation requested via the
250e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pReferenceSlots are going to be performed
251e5c31af7Sopenharmony_cias well.
252e5c31af7Sopenharmony_ci
253e5c31af7Sopenharmony_ciimage::images/DecodeSessionDpbDecodeWithOutputToReferencePictureSlot.svg[align="center",title="Decoding a Frame to VkImageView with an update to a <<reference-picture,Reference Pictures>> DPB Slot",opts="{imageopts}"]
254e5c31af7Sopenharmony_ci
255e5c31af7Sopenharmony_ci
256e5c31af7Sopenharmony_ci=== Video Decode Command Buffer Commands
257e5c31af7Sopenharmony_ci
258e5c31af7Sopenharmony_ci[open,refpage='vkCmdDecodeVideoKHR',desc='Decode a frame',type='protos']
259e5c31af7Sopenharmony_ci--
260e5c31af7Sopenharmony_ciTo decode a frame, call:
261e5c31af7Sopenharmony_ci
262e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdDecodeVideoKHR.txt[]
263e5c31af7Sopenharmony_ci
264e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer to be filled with this
265e5c31af7Sopenharmony_ci    function for decode frame command.
266e5c31af7Sopenharmony_ci  * pname:pFrameInfo is a pointer to a slink:VkVideoDecodeInfoKHR structure.
267e5c31af7Sopenharmony_ci
268e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdDecodeVideoKHR.txt[]
269e5c31af7Sopenharmony_ci--
270e5c31af7Sopenharmony_ci
271e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeInfoKHR',desc='Structure specifying parameters of decoding a frame',type='structs']
272e5c31af7Sopenharmony_ci--
273e5c31af7Sopenharmony_ciThe slink:VkVideoDecodeInfoKHR structure is defined as:
274e5c31af7Sopenharmony_ci
275e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeInfoKHR.txt[]
276e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
277e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
278e5c31af7Sopenharmony_ci    structure.
279e5c31af7Sopenharmony_ci    All the codec specific structures related to each frame(picture
280e5c31af7Sopenharmony_ci    parameters, quantization matrix, etc.) must: be chained here and pass to
281e5c31af7Sopenharmony_ci    decode session with the function call flink:vkCmdDecodeVideoKHR.
282e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkVideoDecodeFlagBitsKHR specifying
283e5c31af7Sopenharmony_ci    decode flags, reserved for future versions of this specification.
284e5c31af7Sopenharmony_ci  * pname:codedOffset is the coded offset of the decode operations.
285e5c31af7Sopenharmony_ci    The purpose of this field is interpreted based on the codec extension.
286e5c31af7Sopenharmony_ciifdef::VK_EXT_video_decode_h264[]
287e5c31af7Sopenharmony_ci    When decoding content in H.264 field mode, the pname:codedOffset
288e5c31af7Sopenharmony_ci    specifies the line or picture field's offset within the image.
289e5c31af7Sopenharmony_ciendif::VK_EXT_video_decode_h264[]
290e5c31af7Sopenharmony_ci  * pname:codedExtent is the coded size of the decode operations.
291e5c31af7Sopenharmony_ci  * pname:srcBuffer is the source buffer that holds the encoded bitstream.
292e5c31af7Sopenharmony_ci  * pname:srcBufferOffset is the buffer offset where the valid encoded
293e5c31af7Sopenharmony_ci    bitstream starts in srcBuffer.
294e5c31af7Sopenharmony_ci    It must: meet the alignment requirement
295e5c31af7Sopenharmony_ci    pname:minBitstreamBufferOffsetAlignment within
296e5c31af7Sopenharmony_ci    slink:VkVideoCapabilitiesKHR queried with the
297e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceVideoCapabilitiesKHR function.
298e5c31af7Sopenharmony_ci  * pname:srcBufferRange is the size of the srcBuffer with valid encoded
299e5c31af7Sopenharmony_ci    bitstream, starting from pname:srcBufferOffset.
300e5c31af7Sopenharmony_ci    It must: meet the alignment requirement
301e5c31af7Sopenharmony_ci    pname:minBitstreamBufferSizeAlignment within
302e5c31af7Sopenharmony_ci    slink:VkVideoCapabilitiesKHR queried with the
303e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceVideoCapabilitiesKHR function.
304e5c31af7Sopenharmony_ci  * pname:dstPictureResource is the destination
305e5c31af7Sopenharmony_ci    <<decoded-output-picture,Decoded Output Picture>> Resource.
306e5c31af7Sopenharmony_ci  * pname:pSetupReferenceSlot is `NULL` or a pointer to a
307e5c31af7Sopenharmony_ci    slink:VkVideoReferenceSlotKHR structure used for generating a DPB
308e5c31af7Sopenharmony_ci    reference slot and Picture Resource.
309e5c31af7Sopenharmony_ci    pname:pSetupReferenceSlot->slotIndex specifies the slot index number to
310e5c31af7Sopenharmony_ci    use as a target for producing the DPB data.
311e5c31af7Sopenharmony_ci    pname:slotIndex must: reference a valid entry as specified in
312e5c31af7Sopenharmony_ci    slink:VkVideoBeginCodingInfoKHR via the pname:pReferenceSlots within the
313e5c31af7Sopenharmony_ci    flink:vkCmdBeginVideoCodingKHR command that established the Vulkan Video
314e5c31af7Sopenharmony_ci    Decode Context for this command.
315e5c31af7Sopenharmony_ci  * pname:referenceSlotCount is the number of the DPB Reference Pictures
316e5c31af7Sopenharmony_ci    that will be used when this decoding operation is executing.
317e5c31af7Sopenharmony_ci  * pname:pReferenceSlots is a pointer to an array of
318e5c31af7Sopenharmony_ci    slink:VkVideoReferenceSlotKHR structures specifying the DPB Reference
319e5c31af7Sopenharmony_ci    pictures that will be used when this decoding operation is executing.
320e5c31af7Sopenharmony_ci
321e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeInfoKHR.txt[]
322e5c31af7Sopenharmony_ci--
323e5c31af7Sopenharmony_ci
324e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeFlagBitsKHR',desc='Video Decode Command Flags',type='enums']
325e5c31af7Sopenharmony_ci--
326e5c31af7Sopenharmony_ciThe flink:vkCmdDecodeVideoKHR flags are defined with the following
327e5c31af7Sopenharmony_cienumeration:
328e5c31af7Sopenharmony_ci
329e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkVideoDecodeFlagBitsKHR.txt[]
330e5c31af7Sopenharmony_ci
331e5c31af7Sopenharmony_ci  * ename:VK_VIDEO_DECODE_RESERVED_0_BIT_KHR The current version of the
332e5c31af7Sopenharmony_ci    specification has reserved this value for future use.
333e5c31af7Sopenharmony_ci--
334e5c31af7Sopenharmony_ci
335e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeFlagsKHR',desc='Bitmask specifying the video decode flink:vkCmdDecodeVideoKHR flags',type='flags']
336e5c31af7Sopenharmony_ci--
337e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkVideoDecodeFlagsKHR.txt[]
338e5c31af7Sopenharmony_ci
339e5c31af7Sopenharmony_citlink:VkVideoDecodeFlagsKHR is a bitmask type for setting a mask of zero or
340e5c31af7Sopenharmony_cimore elink:VkVideoDecodeFlagBitsKHR.
341e5c31af7Sopenharmony_ci--
342