summaryrefslogtreecommitdiff
path: root/chapters/video/decode.adoc
blob: 482bce9ff0b800c2615959dd322511ee5df89ee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
// 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.
--