1// Copyright 2018-2023 The Khronos Group Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[[video-coding]] 6= Video Coding 7 8Vulkan implementations may: expose one or more queue families supporting 9video coding operations. 10These operations are performed by recording them into a command buffer 11within a <<video-coding-scope,video coding scope>>, and submitting them to 12queues with compatible video coding capabilities. 13 14The Vulkan video functionalities are designed to be made available through a 15set of APIs built on top of each other, consisting of: 16 17 * A core API providing common video coding functionalities, 18 * APIs providing codec-independent video decode and video encode related 19 functionalities, respectively, 20 * Additional codec-specific APIs built on top of those. 21 22This chapter details the fundamental components and operations of these. 23 24 25[[video-picture-resources]] 26== Video Picture Resources 27 28In the context of video coding, multidimensional arrays of image data that 29can: be used as the source or target of video coding operations are referred 30to as _video picture resources_. 31They may: store additional metadata that includes implementation-private 32information used during the execution of video coding operations, as 33discussed later. 34 35Video picture resources are backed by slink:VkImage objects. 36Individual subregions of slink:VkImageView objects created from such 37resources can: be used as 38ifdef::VK_KHR_video_decode_queue[] 39<<decode-output-picture,decode output pictures>>, 40endif::VK_KHR_video_decode_queue[] 41ifdef::VK_KHR_video_encode_queue[] 42<<encode-input-picture,encode input pictures>>, 43endif::VK_KHR_video_encode_queue[] 44<<reconstructed-picture,reconstructed pictures>>, and/or 45<<reference-picture, reference pictures>>. 46 47The parameters of a video picture resource are specified using a 48sname:VkVideoPictureResourceInfoKHR structure. 49 50[open,refpage='VkVideoPictureResourceInfoKHR',desc='Structure specifying the parameters of a video picture resource',type='structs'] 51-- 52The sname:VkVideoPictureResourceInfoKHR structure is defined as: 53 54include::{generated}/api/structs/VkVideoPictureResourceInfoKHR.adoc[] 55 56 * pname:sType is a elink:VkStructureType value identifying this structure. 57 * pname:pNext is `NULL` or a pointer to a structure extending this 58 structure. 59 * pname:codedOffset is the offset in texels of the image subregion to use. 60 * pname:codedExtent is the size in pixels of the coded image data. 61 * pname:baseArrayLayer is the array layer of the image view specified in 62 pname:imageViewBinding to use as the video picture resource. 63 * pname:imageViewBinding is an image view representing the video picture 64 resource. 65 66[[video-image-subresource-reference]] 67The image subresource referred to by such a structure is defined as the 68image array layer index specified in pname:baseArrayLayer relative to the 69image subresource range the image view specified in pname:imageViewBinding 70was created with. 71 72The meaning of the pname:codedOffset and pname:codedExtent depends on the 73command and context the video picture resource is used in, as well as on the 74used <<video-profiles,video profile>> and corresponding codec-specific 75semantics, as described later. 76 77[[video-picture-resource-uniqueness]] 78A video picture resource is uniquely defined by the image subresource 79referred to by an instance of this structure, together with the 80pname:codedOffset and pname:codedExtent members that identify the image 81subregion within the image subresource referenced corresponding to the video 82picture resource according to the particular codec-specific semantics. 83 84Accesses to image data within a video picture resource happen at the 85granularity indicated by 86slink:VkVideoCapabilitiesKHR::pname:pictureAccessGranularity, as returned by 87flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used <<video-profiles, 88video profile>>. 89As a result, given an effective image subregion corresponding to a video 90picture resource, the actual image subregion accessed may: be larger than 91that as it may: include additional padding texels due to the picture access 92granularity. 93Any writes performed by video coding operations to such padding texels will 94result in undefined: texel values. 95 96[[video-picture-resource-matching]] 97Two video picture resources match if they refer to the same image 98subresource and they specify identical pname:codedOffset and 99pname:codedExtent values. 100 101.Valid Usage 102**** 103 * [[VUID-VkVideoPictureResourceInfoKHR-baseArrayLayer-07175]] 104 pname:baseArrayLayer must: be less than the 105 slink:VkImageViewCreateInfo::pname:subresourceRange.layerCount specified 106 when the image view pname:imageViewBinding was created 107**** 108 109include::{generated}/validity/structs/VkVideoPictureResourceInfoKHR.adoc[] 110-- 111 112 113[[dpb]] 114== Decoded Picture Buffer 115 116[[reconstructed-picture]] 117An integral part of video coding pipelines is the reconstruction of pictures 118from a compressed video bitstream. 119A _reconstructed picture_ is a <<video-picture-resources,video picture 120resource>> resulting from this process. 121 122[[reference-picture]] 123Such reconstructed pictures can: be used as _reference pictures_ in 124subsequent video coding operations to provide predictions of the values of 125samples of subsequently decoded or encoded pictures. 126The correct use of such reconstructed pictures as reference pictures is 127driven by the video compression standard, the implementation, and the 128application-specific use cases. 129 130[[active-reference-pictures]] 131The list of reference pictures used to provide such predictions within a 132single video coding operation is referred to as the list of _active 133reference pictures_. 134 135The _decoded picture buffer (DPB)_ is an indexed data structure that 136maintains the set of reference pictures available to be used in video coding 137operations. 138[[dpb-slot]] Individual indexed entries of the DPB are referred to as the 139_decoded picture buffer (DPB) slots_. 140[[dpb-capacity]] The range of valid DPB slot indices is between zero and 141`N-1`, where `N` is the capacity of the DPB. 142Each DPB slot can: refer to a reference picture containing a _video frame_ 143ifdef::VK_KHR_video_decode_h264[] 144or can: refer to up to two reference pictures containing the top and/or 145bottom _fields_ that, when both present, together represent a full _video 146frame_ 147endif::VK_KHR_video_decode_h264[] 148. 149 150[[dpb-state-and-backing-store]] 151In Vulkan, the state and the backing store of the DPB is separated as 152follows: 153 154 * The state of individual DPB slots is maintained by <<video-session,video 155 session>> objects. 156 * The backing store of DPB slots is provided by subregions of 157 slink:VkImage objects used as <<video-picture-resources,video picture 158 resources>>. 159 160In addition, the implementation may: also maintain opaque metadata 161associated with DPB slots, including: 162 163 * [[reference-metadata]] _Reference picture metadata_ corresponding to the 164 video picture resource associated with the DPB slot. 165 166Such metadata may: be stored by the implementation as part of the DPB slot 167state maintained by the video session, or as part of the video picture 168resource backing the DPB slot. 169 170Any metadata stored in the video picture resources backing DPB slots are 171independent of the video session used to store it, hence such video picture 172resources can: be shared with other video sessions. 173Correspondingly, any metadata that is dependent on the video session will 174always be stored as part of the DPB slot state maintained by that video 175session. 176 177The responsibility of managing the DPB is split between the application and 178the implementation as follows: 179 180 * The application maintains the association between <<dpb-slot,DPB slot>> 181 indices and corresponding <<video-picture-resources,video picture 182 resources>>. 183 * The implementation maintains global and per-slot opaque 184 <<reference-metadata,reference picture metadata>>. 185 186In addition, the application is also responsible for managing the mapping 187between the codec-specific picture IDs and DPB slots, and any other 188codec-specific states unless otherwise specified. 189 190[[dpb-slot-states]] 191=== DPB Slot States 192 193At a given time, each DPB slot is either in _active_ or _inactive_ state. 194Initially, all DPB slots managed by a <<video-session,video session>> are in 195_inactive_ state. 196 197A DPB slot can: be _activated_ by using it as the target of picture 198reconstruction within a video coding operation, changing its state to 199_active_. 200 201As part of the picture reconstruction, the implementation may: also generate 202<<reference-metadata,reference picture metadata>>. 203 204If such a video coding operation completes successfully, the activated DPB 205slot will have a _valid picture reference_ and the <<reconstructed-picture, 206reconstructed picture>> is associated with the DPB slot. 207ifdef::VK_KHR_video_decode_h264[] 208This is true even if the DPB slot is used as the target of a picture 209reconstruction that only sets up a top field or bottom field reference 210picture and thus does not yet refer to a complete frame. 211endif::VK_KHR_video_decode_h264[] 212However, if any data provided as input to such a video coding operation is 213not compliant to the video compression standard used, that video coding 214operation may: complete unsuccessfully, in which case the activated DPB slot 215will have an _invalid picture reference_. 216ifdef::VK_KHR_video_decode_h264[] 217This is true even if the DPB slot previously had a valid picture reference 218to a top field or bottom field reference picture, but the reconstruction of 219the other field corresponding to the DPB slot failed. 220endif::VK_KHR_video_decode_h264[] 221 222The application can: use <<queries,queries>> to get feedback about the 223outcome of video coding operations and use the resulting 224elink:VkQueryResultStatusKHR value to determine whether the video coding 225operation completed successfully (result status is positive) or 226unsuccessfully (result status is negative). 227 228Using a <<reference-picture,reference picture>> associated with a DPB slot 229that has an _invalid picture reference_ as an <<active-reference-pictures, 230active reference picture>> in subsequent video coding operations is legal, 231however, the contents of the outputs of such operations are undefined:, and 232any DPB slots activated by such video coding operations will also have an 233_invalid picture reference_. 234This is true even if such video coding operations may: otherwise complete 235successfully. 236 237A DPB slot can: also be _deactivated_ by the application, changing its state 238to _inactive_ and invalidating any picture references and 239<<reference-metadata,reference picture metadata>> associated with the DPB 240slot. 241 242A DPB slot can: be activated with a new frame even if it is already active. 243In this case all previous associations of the DPB slots with 244<<reference-picture,reference pictures>> are replaced with an association 245with the <<reconstructed-picture,reconstructed picture>> used to activate 246it. 247ifdef::VK_KHR_video_decode_h264[] 248If an already active DPB slot is activated with a reconstructed field 249picture, then the behavior is as follows: 250 251 * If the DPB slot is currently associated with a frame, then that 252 association is replaced with an association with the reconstructed field 253 picture used to activate it. 254 * If the DPB slot is not currently associated with a top field picture and 255 the DPB slot is activated with a top field picture, or if the DPB slot 256 is not currently associated with a bottom field picture and the DPB slot 257 is activated with a bottom field picture, then the DPB slot is 258 associated with the reconstructed field picture used to activate it, 259 without disturbing the other field picture association, if any. 260 * If the DPB slot is currently associated with a top field picture and the 261 DPB slot is activated with a new top field picture, or if the DPB slot 262 is currently associated with a bottom field picture and the DPB slot is 263 activated with a new bottom field picture, then that association is 264 replaced with an association with the reconstructed field picture used 265 to activate it, without disturbing the other field picture association, 266 if any. 267endif::VK_KHR_video_decode_h264[] 268 269 270[[video-profiles]] 271== Video Profiles 272 273[open,refpage='VkVideoProfileInfoKHR',desc='Structure specifying a video profile',type='structs'] 274-- 275The sname:VkVideoProfileInfoKHR structure is defined as follows: 276 277include::{generated}/api/structs/VkVideoProfileInfoKHR.adoc[] 278 279 * pname:sType is a elink:VkStructureType value identifying this structure. 280 * pname:pNext is `NULL` or a pointer to a structure extending this 281 structure. 282 * pname:videoCodecOperation is a elink:VkVideoCodecOperationFlagBitsKHR 283 value specifying a video codec operation. 284 * pname:chromaSubsampling is a bitmask of 285 elink:VkVideoChromaSubsamplingFlagBitsKHR specifying video chroma 286 subsampling information. 287 * pname:lumaBitDepth is a bitmask of 288 elink:VkVideoComponentBitDepthFlagBitsKHR specifying video luma bit 289 depth information. 290 * pname:chromaBitDepth is a bitmask of 291 elink:VkVideoComponentBitDepthFlagBitsKHR specifying video chroma bit 292 depth information. 293 294Video profiles are provided as input to video capability queries such as 295flink:vkGetPhysicalDeviceVideoCapabilitiesKHR or 296flink:vkGetPhysicalDeviceVideoFormatPropertiesKHR, as well as when creating 297resources to be used by video coding operations such as images, buffers, 298query pools, and video sessions. 299 300The full description of a video profile is specified by an instance of this 301structure, and the codec-specific and auxiliary structures provided in its 302pname:pNext chain. 303 304[[video-profile-error-codes]] 305When this structure is specified as an input parameter to 306flink:vkGetPhysicalDeviceVideoCapabilitiesKHR, or through the 307pname:pProfiles member of an slink:VkVideoProfileListInfoKHR structure in 308the pname:pNext chain of the input parameter of a query command such as 309flink:vkGetPhysicalDeviceVideoFormatPropertiesKHR or 310flink:vkGetPhysicalDeviceImageFormatProperties2, the following error codes 311indicate specific causes of the failure of the query operation: 312 313 * ename:VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR indicates that the 314 requested video picture layout 315ifdef::VK_KHR_video_decode_h264[] 316 (e.g. through the pname:pictureLayout member of a 317 slink:VkVideoDecodeH264ProfileInfoKHR structure included in the 318 pname:pNext chain of sname:VkVideoProfileInfoKHR) 319endif::VK_KHR_video_decode_h264[] 320 is not supported. 321 * ename:VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR indicates that 322 a video profile operation specified by pname:videoCodecOperation is not 323 supported. 324 * ename:VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR indicates that 325 video format parameters specified by pname:chromaSubsampling, 326 pname:lumaBitDepth, or pname:chromaBitDepth are not supported. 327 * ename:VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR indicates that the 328 codec-specific parameters corresponding to the video codec operation are 329 not supported. 330 331.Valid Usage 332**** 333 * [[VUID-VkVideoProfileInfoKHR-chromaSubsampling-07013]] 334 pname:chromaSubsampling must: have a single bit set 335 * [[VUID-VkVideoProfileInfoKHR-lumaBitDepth-07014]] 336 pname:lumaBitDepth must: have a single bit set 337 * [[VUID-VkVideoProfileInfoKHR-chromaSubsampling-07015]] 338 If pname:chromaSubsampling is not 339 ename:VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR, then 340 pname:chromaBitDepth must: have a single bit set 341ifdef::VK_KHR_video_decode_h264[] 342 * [[VUID-VkVideoProfileInfoKHR-videoCodecOperation-07179]] 343 If pname:videoCodecOperation is 344 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the pname:pNext 345 chain must: include a slink:VkVideoDecodeH264ProfileInfoKHR structure 346endif::VK_KHR_video_decode_h264[] 347ifdef::VK_KHR_video_decode_h265[] 348 * [[VUID-VkVideoProfileInfoKHR-videoCodecOperation-07180]] 349 If pname:videoCodecOperation is 350 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the pname:pNext 351 chain must: include a slink:VkVideoDecodeH265ProfileInfoKHR structure 352endif::VK_KHR_video_decode_h265[] 353ifdef::VK_EXT_video_encode_h264[] 354 * [[VUID-VkVideoProfileInfoKHR-videoCodecOperation-07181]] 355 If pname:videoCodecOperation is 356 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT, then the pname:pNext 357 chain must: include a slink:VkVideoEncodeH264ProfileInfoEXT structure 358endif::VK_EXT_video_encode_h264[] 359ifdef::VK_EXT_video_encode_h265[] 360 * [[VUID-VkVideoProfileInfoKHR-videoCodecOperation-07182]] 361 If pname:videoCodecOperation is 362 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT, then the pname:pNext 363 chain must: include a slink:VkVideoEncodeH265ProfileInfoEXT structure 364endif::VK_EXT_video_encode_h265[] 365**** 366 367include::{generated}/validity/structs/VkVideoProfileInfoKHR.adoc[] 368-- 369 370[open,refpage='VkVideoCodecOperationFlagBitsKHR',desc='Video codec operation bits',type='enums'] 371-- 372Possible values of slink:VkVideoProfileInfoKHR::pname:videoCodecOperation, 373specifying the type of video coding operation and video compression standard 374used by a video profile, are: 375 376include::{generated}/api/enums/VkVideoCodecOperationFlagBitsKHR.adoc[] 377 378 * ename:VK_VIDEO_CODEC_OPERATION_NONE_KHR indicates no support for any 379 video codec operations. 380ifdef::VK_KHR_video_decode_h264[] 381 * ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR specifies support for 382 H.264 video decode operations. 383endif::VK_KHR_video_decode_h264[] 384ifdef::VK_KHR_video_decode_h265[] 385 * ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR specifies support for 386 H.265 video decode operations. 387endif::VK_KHR_video_decode_h265[] 388ifdef::VK_EXT_video_encode_h264[] 389 * ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT specifies support for 390 H.264 video encode operations. 391endif::VK_EXT_video_encode_h264[] 392ifdef::VK_EXT_video_encode_h265[] 393 * ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT specifies support for 394 H.265 video encode operations. 395endif::VK_EXT_video_encode_h265[] 396-- 397 398[open,refpage='VkVideoCodecOperationFlagsKHR',desc='Bitmask of VkVideoCodecOperationFlagBitsKHR',type='flags'] 399-- 400include::{generated}/api/flags/VkVideoCodecOperationFlagsKHR.adoc[] 401 402tname:VkVideoCodecOperationFlagsKHR is a bitmask type for setting a mask of 403zero or more elink:VkVideoCodecOperationFlagBitsKHR. 404-- 405 406[open,refpage='VkVideoChromaSubsamplingFlagBitsKHR',desc='Video format chroma subsampling bits',type='enums'] 407-- 408The video format chroma subsampling is defined with the following enums: 409 410include::{generated}/api/enums/VkVideoChromaSubsamplingFlagBitsKHR.adoc[] 411 412 * ename:VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR specifies that the 413 format is monochrome. 414 * ename:VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR specified that the format 415 is 4:2:0 chroma subsampled, i.e. the two chroma components are sampled 416 horizontally and vertically at half the sample rate of the luma 417 component. 418 * ename:VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR - the format is 4:2:2 419 chroma subsampled, i.e. the two chroma components are sampled 420 horizontally at half the sample rate of luma component. 421 * ename:VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR - the format is 4:4:4 422 chroma sampled, i.e. all three components of the {YCbCr} format are 423 sampled at the same rate, thus there is no chroma subsampling. 424-- 425 426Chroma subsampling is described in more detail in the 427<<textures-chroma-reconstruction,Chroma Reconstruction>> section. 428 429[open,refpage='VkVideoChromaSubsamplingFlagsKHR',desc='Bitmask of VkVideoChromaSubsamplingFlagBitsKHR',type='flags'] 430-- 431include::{generated}/api/flags/VkVideoChromaSubsamplingFlagsKHR.adoc[] 432 433tname:VkVideoChromaSubsamplingFlagsKHR is a bitmask type for setting a mask 434of zero or more elink:VkVideoChromaSubsamplingFlagBitsKHR. 435-- 436 437[open,refpage='VkVideoComponentBitDepthFlagBitsKHR',desc='Video format component bit depth',type='enums'] 438-- 439Possible values for the video format component bit depth are: 440 441include::{generated}/api/enums/VkVideoComponentBitDepthFlagBitsKHR.adoc[] 442 443 * ename:VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR specifies a component bit 444 depth of 8 bits. 445 * ename:VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR specifies a component bit 446 depth of 10 bits. 447 * ename:VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR specifies a component bit 448 depth of 12 bits. 449-- 450 451[open,refpage='VkVideoComponentBitDepthFlagsKHR',desc='Bitmask of VkVideoComponentBitDepthFlagBitsKHR',type='flags'] 452-- 453include::{generated}/api/flags/VkVideoComponentBitDepthFlagsKHR.adoc[] 454 455tname:VkVideoComponentBitDepthFlagsKHR is a bitmask type for setting a mask 456of zero or more elink:VkVideoComponentBitDepthFlagBitsKHR. 457-- 458 459ifdef::VK_KHR_video_decode_queue[] 460[open,refpage='VkVideoDecodeUsageInfoKHR',desc='Structure specifying video decode usage information',type='structs'] 461-- 462Additional information about the video decode use case can: be provided by 463adding a sname:VkVideoDecodeUsageInfoKHR structure to the pname:pNext chain 464of slink:VkVideoProfileInfoKHR. 465 466The sname:VkVideoDecodeUsageInfoKHR structure is defined as: 467 468include::{generated}/api/structs/VkVideoDecodeUsageInfoKHR.adoc[] 469 470 * pname:sType is a elink:VkStructureType value identifying this structure. 471 * pname:pNext is `NULL` or a pointer to a structure extending this 472 structure. 473 * pname:videoUsageHints is a bitmask of 474 elink:VkVideoDecodeUsageFlagBitsKHR specifying hints about the intended 475 use of the video decode profile. 476 477include::{generated}/validity/structs/VkVideoDecodeUsageInfoKHR.adoc[] 478-- 479 480[open,refpage='VkVideoDecodeUsageFlagBitsKHR',desc='Video decode usage flags',type='enums'] 481-- 482The following bits can: be specified in 483slink:VkVideoDecodeUsageInfoKHR::pname:videoUsageHints as a hint about the 484video decode use case: 485 486include::{generated}/api/enums/VkVideoDecodeUsageFlagBitsKHR.adoc[] 487 488 * ename:VK_VIDEO_DECODE_USAGE_TRANSCODING_BIT_KHR specifies that video 489 decoding is intended to be used in conjunction with video encoding to 490 transcode a video bitstream with the same and/or different codecs. 491 * ename:VK_VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR specifies that video 492 decoding is intended to be used to consume a local video bitstream. 493 * ename:VK_VIDEO_DECODE_USAGE_STREAMING_BIT_KHR specifies that video 494 decoding is intended to be used to consume a video bitstream received as 495 a continuous flow over network. 496 497[NOTE] 498.Note 499==== 500There are no restrictions on the combination of bits that can: be specified 501by the application. 502However, applications should: use reasonable combinations in order for the 503implementation to be able to select the most appropriate mode of operation 504for the particular use case. 505==== 506-- 507 508[open,refpage='VkVideoDecodeUsageFlagsKHR',desc='Bitmask specifying the video decode usage flags',type='flags'] 509-- 510include::{generated}/api/flags/VkVideoDecodeUsageFlagsKHR.adoc[] 511 512tname:VkVideoDecodeUsageFlagsKHR is a bitmask type for setting a mask of 513zero or more elink:VkVideoDecodeUsageFlagBitsKHR. 514-- 515endif::VK_KHR_video_decode_queue[] 516 517ifdef::VK_KHR_video_encode_queue[] 518[open,refpage='VkVideoEncodeUsageInfoKHR',desc='Structure specifying video encode usage information',type='structs'] 519-- 520Additional information about the video encode use case can: be provided by 521adding a sname:VkVideoEncodeUsageInfoKHR structure to the pname:pNext chain 522of slink:VkVideoProfileInfoKHR. 523 524The sname:VkVideoEncodeUsageInfoKHR structure is defined as: 525 526include::{generated}/api/structs/VkVideoEncodeUsageInfoKHR.adoc[] 527 528 * pname:sType is a elink:VkStructureType value identifying this structure. 529 * pname:pNext is `NULL` or a pointer to a structure extending this 530 structure. 531 * pname:videoUsageHints is a bitmask of 532 elink:VkVideoEncodeUsageFlagBitsKHR specifying hints about the intended 533 use of the video encode profile. 534 * pname:videoContentHints is a bitmask of 535 elink:VkVideoEncodeContentFlagBitsKHR specifying hints about the content 536 to be encoded using the video encode profile. 537 * pname:tuningMode is a elink:VkVideoEncodeTuningModeKHR value specifying 538 the tuning mode to use when encoding with the video profile. 539 540include::{generated}/validity/structs/VkVideoEncodeUsageInfoKHR.adoc[] 541-- 542 543[open,refpage='VkVideoEncodeUsageFlagBitsKHR',desc='Video encode usage flags',type='enums'] 544-- 545The following bits can: be specified in 546slink:VkVideoEncodeUsageInfoKHR::pname:videoUsageHints as a hint about the 547video encode use case: 548 549include::{generated}/api/enums/VkVideoEncodeUsageFlagBitsKHR.adoc[] 550 551 * ename:VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR specifies that video 552 encoding is intended to be used in conjunction with video decoding to 553 transcode a video bitstream with the same and/or different codecs. 554 * ename:VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR specifies that video 555 encoding is intended to be used to produce a video bitstream that is 556 expected to be sent as a continuous flow over network. 557 * ename:VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR specifies that video 558 encoding is intended to be used for real-time recording for offline 559 consumption. 560 * ename:VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR specifies that video 561 encoding is intended to be used in a video conferencing scenario. 562 563[NOTE] 564.Note 565==== 566There are no restrictions on the combination of bits that can: be specified 567by the application. 568However, applications should: use reasonable combinations in order for the 569implementation to be able to select the most appropriate mode of operation 570for the particular use case. 571==== 572-- 573 574[open,refpage='VkVideoEncodeUsageFlagsKHR',desc='Bitmask specifying the video encode usage flags',type='flags'] 575-- 576include::{generated}/api/flags/VkVideoEncodeUsageFlagsKHR.adoc[] 577 578tname:VkVideoEncodeUsageFlagsKHR is a bitmask type for setting a mask of 579zero or more elink:VkVideoEncodeUsageFlagBitsKHR. 580-- 581 582[open,refpage='VkVideoEncodeContentFlagBitsKHR',desc='Video encode content flags',type='enums'] 583-- 584The following bits can: be specified in 585slink:VkVideoEncodeUsageInfoKHR::pname:videoContentHints as a hint about the 586encoded video content: 587 588include::{generated}/api/enums/VkVideoEncodeContentFlagBitsKHR.adoc[] 589 590 * ename:VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR specifies that video 591 encoding is intended to be used to encode camera content. 592 * ename:VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR specifies that video 593 encoding is intended to be used to encode desktop content. 594 * ename:VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR specified that video 595 encoding is intended to be used to encode rendered (e.g. game) content. 596 597[NOTE] 598.Note 599==== 600There are no restrictions on the combination of bits that can: be specified 601by the application. 602However, applications should: use reasonable combinations in order for the 603implementation to be able to select the most appropriate mode of operation 604for the particular content type. 605==== 606-- 607 608[open,refpage='VkVideoEncodeContentFlagsKHR',desc='Bitmask specifying the video encode content flags',type='flags'] 609-- 610include::{generated}/api/flags/VkVideoEncodeContentFlagsKHR.adoc[] 611 612tname:VkVideoEncodeContentFlagsKHR is a bitmask type for setting a mask of 613zero or more elink:VkVideoEncodeContentFlagBitsKHR. 614-- 615 616[open,refpage='VkVideoEncodeTuningModeKHR',desc='Video encode tuning mode',type='enums'] 617-- 618Possible video encode tuning mode values are as follows: 619 620include::{generated}/api/enums/VkVideoEncodeTuningModeKHR.adoc[] 621 622 * ename:VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR specifies the default 623 tuning mode. 624 * ename:VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR specifies that video 625 encoding is tuned for high quality. 626 When using this tuning mode, the implementation may: compromise the 627 latency of video encoding operations to improve quality. 628 * ename:VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR specifies that video 629 encoding is tuned for low latency. 630 When using this tuning mode, the implementation may: compromise quality 631 to increase the performance and lower the latency of video encode 632 operations. 633 * ename:VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR specifies that 634 video encoding is tuned for ultra-low latency. 635 When using this tuning mode, the implementation may: compromise quality 636 to maximize the performance and minimize the latency of video encoding 637 operations. 638 * ename:VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR specifies that video 639 encoding is tuned for lossless encoding. 640 When using this tuning mode, video encode operations produce lossless 641 output. 642 643-- 644endif::VK_KHR_video_encode_queue[] 645 646[open,refpage='VkVideoProfileListInfoKHR',desc='Structure specifying one or more video profiles used in conjunction',type='structs'] 647-- 648The sname:VkVideoProfileListInfoKHR structure is defined as: 649 650include::{generated}/api/structs/VkVideoProfileListInfoKHR.adoc[] 651 652 * pname:sType is a elink:VkStructureType value identifying this structure. 653 * pname:pNext is `NULL` or a pointer to a structure extending this 654 structure. 655 * pname:profileCount is the number of elements in the pname:pProfiles 656 array. 657 * pname:pProfiles is a pointer to an array of slink:VkVideoProfileInfoKHR 658 structures. 659 660[NOTE] 661.Note: 662==== 663Video transcoding is an example of a use case that necessitates the 664specification of multiple profiles in various contexts. 665==== 666 667When the application provides a video decode profile and one or more video 668encode profiles in the profile list, the implementation ensures that any 669capabilitities returned or resources created are suitable for the video 670transcoding use cases without the need for manual data transformations. 671 672.Valid Usage 673**** 674 * [[VUID-VkVideoProfileListInfoKHR-pProfiles-06813]] 675 pname:pProfiles must: not contain more than one element whose 676 pname:videoCodecOperation member specifies a decode operation 677**** 678 679include::{generated}/validity/structs/VkVideoProfileListInfoKHR.adoc[] 680-- 681 682 683[[video-capabilities]] 684== Video Capabilities 685 686 687[[video-coding-capabilities]] 688=== Video Coding Capabilities 689 690[open,refpage='vkGetPhysicalDeviceVideoCapabilitiesKHR',desc='Query video coding capabilities',type='protos'] 691-- 692To query video coding capabilities for a specific video profile, call: 693 694include::{generated}/api/protos/vkGetPhysicalDeviceVideoCapabilitiesKHR.adoc[] 695 696 * pname:physicalDevice is the physical device from which to query the 697 video decode or encode capabilities. 698 * pname:pVideoProfile is a pointer to a slink:VkVideoProfileInfoKHR 699 structure. 700 * pname:pCapabilities is a pointer to a slink:VkVideoCapabilitiesKHR 701 structure in which the capabilities are returned. 702 703[[video-profile-support]] 704If the <<video-profiles,video profile>> described by pname:pVideoProfile is 705supported by the implementation, then this command returns ename:VK_SUCCESS 706and pname:pCapabilities is filled with the capabilities supported with the 707specified video profile. 708Otherwise, one of the <<video-profile-error-codes, video-profile-specific 709error codes>> are returned. 710 711.Valid Usage 712**** 713ifdef::VK_KHR_video_decode_queue[] 714 * [[VUID-vkGetPhysicalDeviceVideoCapabilitiesKHR-pVideoProfile-07183]] 715 If pname:pVideoProfile->videoCodecOperation specifies a decode 716 operation, then the pname:pNext chain of pname:pCapabilities must: 717 include a slink:VkVideoDecodeCapabilitiesKHR structure 718endif::VK_KHR_video_decode_queue[] 719ifdef::VK_KHR_video_decode_h264[] 720 * [[VUID-vkGetPhysicalDeviceVideoCapabilitiesKHR-pVideoProfile-07184]] 721 If pname:pVideoProfile->videoCodecOperation is 722 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the pname:pNext 723 chain of pname:pCapabilities must: include a 724 slink:VkVideoDecodeH264CapabilitiesKHR structure 725endif::VK_KHR_video_decode_h264[] 726ifdef::VK_KHR_video_decode_h265[] 727 * [[VUID-vkGetPhysicalDeviceVideoCapabilitiesKHR-pVideoProfile-07185]] 728 If pname:pVideoProfile->videoCodecOperation is 729 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the pname:pNext 730 chain of pname:pCapabilities must: include a 731 slink:VkVideoDecodeH265CapabilitiesKHR structure 732endif::VK_KHR_video_decode_h265[] 733ifdef::VK_KHR_video_encode_queue[] 734 * [[VUID-vkGetPhysicalDeviceVideoCapabilitiesKHR-pVideoProfile-07186]] 735 If pname:pVideoProfile->videoCodecOperation specifies an encode 736 operation, then the pname:pNext chain of pname:pCapabilities must: 737 include a slink:VkVideoEncodeCapabilitiesKHR structure 738endif::VK_KHR_video_encode_queue[] 739ifdef::VK_EXT_video_encode_h264[] 740 * [[VUID-vkGetPhysicalDeviceVideoCapabilitiesKHR-pVideoProfile-07187]] 741 If pname:pVideoProfile->videoCodecOperation is 742 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT, then the pname:pNext 743 chain of pname:pCapabilities must: include a 744 slink:VkVideoEncodeH264CapabilitiesEXT structure 745endif::VK_EXT_video_encode_h264[] 746ifdef::VK_EXT_video_encode_h265[] 747 * [[VUID-vkGetPhysicalDeviceVideoCapabilitiesKHR-pVideoProfile-07188]] 748 If pname:pVideoProfile->videoCodecOperation is 749 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT, then the pname:pNext 750 chain of pname:pCapabilities must: include a 751 slink:VkVideoEncodeH265CapabilitiesEXT structure 752endif::VK_EXT_video_encode_h265[] 753**** 754 755include::{generated}/validity/protos/vkGetPhysicalDeviceVideoCapabilitiesKHR.adoc[] 756-- 757 758 759[open,refpage='VkVideoCapabilitiesKHR',desc='Structure describing general video capabilities for a video profile',type='structs'] 760-- 761The sname:VkVideoCapabilitiesKHR structure is defined as: 762 763include::{generated}/api/structs/VkVideoCapabilitiesKHR.adoc[] 764 765 * pname:sType is a elink:VkStructureType value identifying this structure. 766 * pname:pNext is `NULL` or a pointer to a structure extending this 767 structure. 768 * pname:flags is a bitmask of elink:VkVideoCapabilityFlagBitsKHR 769 specifying capability flags. 770 * pname:minBitstreamBufferOffsetAlignment is the minimum alignment for 771 bitstream buffer offsets. 772 * pname:minBitstreamBufferSizeAlignment is the minimum alignment for 773 bitstream buffer range sizes. 774 * pname:pictureAccessGranularity is the granularity at which image access 775 to video picture resources happen. 776 * pname:minCodedExtent is the minimum width and height of the coded 777 frames. 778 * pname:maxCodedExtent is the maximum width and height of the coded 779 frames. 780 * pname:maxDpbSlots is the maximum number of <<dpb-slot,DPB slots>> 781 supported by a single video session. 782 * pname:maxActiveReferencePictures is the maximum number of 783 <<active-reference-pictures,active reference pictures>> a single video 784 coding operation can: use. 785 * [[video-std-header-version]] pname:stdHeaderVersion is a 786 slink:VkExtensionProperties structure reporting the Video Std header 787 name and version supported for the video profile. 788 789ifdef::VK_KHR_video_decode_queue[] 790[NOTE] 791.Note: 792==== 793It is common for video compression standards to allow using all reference 794pictures associated with active DPB slots as active reference pictures, 795hence for video decode profiles the values returned in pname:maxDpbSlots and 796pname:maxActiveReferencePictures are often equal. 797ifdef::VK_KHR_video_decode_h264[] 798Similarly, in case of video decode profiles supporting field pictures the 799value of pname:maxActiveReferencePictures often equals 800[eq]#pname:maxDpbSlots {times} 2#. 801endif::VK_KHR_video_decode_h264[] 802==== 803endif::VK_KHR_video_decode_queue[] 804 805include::{generated}/validity/structs/VkVideoCapabilitiesKHR.adoc[] 806-- 807 808[open,refpage='VkVideoCapabilityFlagBitsKHR',desc='Video decode and encode capability bits',type='enums'] 809-- 810Bits which can: be set in slink:VkVideoCapabilitiesKHR::pname:flags are: 811 812include::{generated}/api/enums/VkVideoCapabilityFlagBitsKHR.adoc[] 813 814 * ename:VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR specifies that video 815 sessions support producing and consuming protected content. 816 * [[separate-reference-images]] 817 ename:VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR specifies 818 that the <<video-picture-resources,video picture resources>> associated 819 with the <<dpb-slot,DPB slots>> of a video session can: be backed by 820 separate sname:VkImage objects. 821 If this capability flag is not present, then all DPB slots of a video 822 session must: be associated with video picture resources backed by the 823 same sname:VkImage object (e.g. using different layers of the same 824 image). 825-- 826 827[open,refpage='VkVideoCapabilityFlagsKHR',desc='Bitmask of VkVideoCapabilitiesFlagBitsKHR',type='flags'] 828-- 829include::{generated}/api/flags/VkVideoCapabilityFlagsKHR.adoc[] 830 831tname:VkVideoCapabilityFlagsKHR is a bitmask type for setting a mask of zero 832or more elink:VkVideoCapabilityFlagBitsKHR. 833-- 834 835 836[[video-format-capabilities]] 837=== Video Format Capabilities 838 839[open,refpage='vkGetPhysicalDeviceVideoFormatPropertiesKHR',desc='Query supported video decode and encode image formats and capabilities',type='protos'] 840-- 841To enumerate the supported output, input and DPB image formats and 842corresponding capabilities for a specific video profile, call: 843 844include::{generated}/api/protos/vkGetPhysicalDeviceVideoFormatPropertiesKHR.adoc[] 845 846 * pname:physicalDevice is the physical device from which to query the 847 video format properties. 848 * pname:pVideoFormatInfo is a pointer to a 849 slink:VkPhysicalDeviceVideoFormatInfoKHR structure specifying the usage 850 and video profiles for which supported image formats and capabilities 851 are returned. 852 * pname:pVideoFormatPropertyCount is a pointer to an integer related to 853 the number of video format properties available or queried, as described 854 below. 855 * pname:pVideoFormatProperties is a pointer to an array of 856 slink:VkVideoFormatPropertiesKHR structures in which supported image 857 formats and capabilities are returned. 858 859If pname:pVideoFormatProperties is `NULL`, then the number of video format 860properties supported for the given pname:physicalDevice is returned in 861pname:pVideoFormatPropertyCount. 862Otherwise, pname:pVideoFormatPropertyCount must: point to a variable set by 863the user to the number of elements in the pname:pVideoFormatProperties 864array, and on return the variable is overwritten with the number of values 865actually written to pname:pVideoFormatProperties. 866If the value of pname:pVideoFormatPropertyCount is less than the number of 867video format properties supported, at most pname:pVideoFormatPropertyCount 868values will be written to pname:pVideoFormatProperties, and 869ename:VK_INCOMPLETE will be returned instead of ename:VK_SUCCESS, to 870indicate that not all the available values were returned. 871 872Video format properties are always queried with respect to a specific set of 873video profiles. 874These are specified by chaining the slink:VkVideoProfileListInfoKHR 875structure to pname:pVideoFormatInfo. 876 877For most use cases, the images are used by a single video session and a 878single video profile is provided. 879For a use case such as video transcoding, where a decode session output 880image can: be used as encode input in one or more encode sessions, multiple 881video profiles corresponding to the video sessions that will share the image 882must: be provided. 883 884If any of the <<video-profiles,video profiles>> specified via 885slink:VkVideoProfileListInfoKHR::pname:pProfiles are not supported, then 886this command returns one of the <<video-profile-error-codes, 887video-profile-specific error codes>>. 888Furthermore, if slink:VkPhysicalDeviceVideoFormatInfoKHR::pname:imageUsage 889includes any image usage flags not supported by the specified video 890profiles, then this command returns 891ename:VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR. 892 893ifdef::VK_KHR_video_decode_queue[] 894This command also returns ename:VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR if 895slink:VkPhysicalDeviceVideoFormatInfoKHR::pname:imageUsage does not include 896the appropriate flags as dictated by the decode capability flags returned in 897slink:VkVideoDecodeCapabilitiesKHR::pname:flags for any of the profiles 898specified in the slink:VkVideoProfileListInfoKHR structure provided in the 899pname:pNext chain of pname:pVideoFormatInfo. 900 901If the decode capability flags include 902ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR but not 903ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR, then in 904order to query video format properties for decode DPB and output usage, 905slink:VkPhysicalDeviceVideoFormatInfoKHR::pname:imageUsage must: include 906both ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR and 907ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR. 908Otherwise, the call will fail with 909ename:VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR. 910 911If the decode capability flags include 912ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR but not 913ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR, then in 914order to query video format properties for decode DPB usage, 915slink:VkPhysicalDeviceVideoFormatInfoKHR::pname:imageUsage must: include 916ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR, but not 917ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR. 918Otherwise, the call will fail with 919ename:VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR. 920Similarly, to query video format properties for decode output usage, 921slink:VkPhysicalDeviceVideoFormatInfoKHR::pname:imageUsage must: include 922ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR, but not 923ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR. 924Otherwise, the call will fail with 925ename:VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR. 926endif::VK_KHR_video_decode_queue[] 927 928The pname:imageUsage member of the slink:VkPhysicalDeviceVideoFormatInfoKHR 929structure specifies the expected video usage flags that the returned video 930formats must: support. 931Correspondingly, the pname:imageUsageFlags member of each 932slink:VkVideoFormatPropertiesKHR structure returned will contain at least 933the same set of image usage flags. 934 935If the implementation supports using video input, output, or DPB images of a 936particular format in operations other than video decode/encode then the 937pname:imageUsageFlags member of the corresponding 938slink:VkVideoFormatPropertiesKHR structure returned will include additional 939image usage flags indicating that. 940 941[NOTE] 942.Note: 943==== 944For most use cases, only decode or encode related usage flags are going to 945be specified. 946For a use case such as transcode, if the image were to be shared between 947decode and encode session(s), then both decode and encode related usage 948flags can: be set. 949==== 950 951Multiple sname:VkVideoFormatPropertiesKHR entries may: be returned with the 952same pname:format member with different pname:componentMapping, 953pname:imageType, or pname:imageTiling values, as described later. 954 955In addition, a different set of sname:VkVideoFormatPropertiesKHR entries 956may: be returned depending on the pname:imageUsage member of the 957sname:VkPhysicalDeviceVideoFormatInfoKHR structure, even for the same set of 958video profiles, for example, based on whether encode input, encode DPB, 959decode output, and/or decode DPB usage is requested. 960 961The application can: select the parameters returned in the 962sname:VkVideoFormatPropertiesKHR entries and use compatible parameters when 963creating the input, output, and DPB images. 964The implementation will report all image creation and usage flags that are 965valid for images used with the requested video profiles but applications 966should: create images only with those that are necessary for the particular 967use case. 968 969Before creating an image, the application can: obtain the complete set of 970supported image format features by calling 971flink:vkGetPhysicalDeviceImageFormatProperties2 using parameters derived 972from the members of one of the reported sname:VkVideoFormatPropertiesKHR 973entries and adding the same slink:VkVideoProfileListInfoKHR structure to the 974pname:pNext chain of slink:VkPhysicalDeviceImageFormatInfo2. 975 976The following applies to all sname:VkVideoFormatPropertiesKHR entries 977returned by fname:vkGetPhysicalDeviceVideoFormatPropertiesKHR: 978 979 * flink:vkGetPhysicalDeviceFormatProperties2 must: succeed when called 980 with sname:VkVideoFormatPropertiesKHR::pname:format 981 * If sname:VkVideoFormatPropertiesKHR::pname:imageTiling is 982 ename:VK_IMAGE_TILING_OPTIMAL, then the pname:optimalTilingFeatures 983 returned by flink:vkGetPhysicalDeviceFormatProperties2 must: include all 984 format features required by the image usage flags reported in 985 sname:VkVideoFormatPropertiesKHR::pname:imageUsageFlags for the format, 986 as indicated in the <<format-feature-dependent-usage-flags,Format 987 Feature Dependent Usage Flags>> section. 988 * If sname:VkVideoFormatPropertiesKHR::pname:imageTiling is 989 ename:VK_IMAGE_TILING_LINEAR, then the pname:linearTilingFeatures 990 returned by flink:vkGetPhysicalDeviceFormatProperties2 must: include all 991 format features required by the image usage flags reported in 992 sname:VkVideoFormatPropertiesKHR::pname:imageUsageFlags for the format, 993 as indicated in the <<format-feature-dependent-usage-flags,Format 994 Feature Dependent Usage Flags>> section. 995 * flink:vkGetPhysicalDeviceImageFormatProperties2 must: succeed when 996 called with a slink:VkPhysicalDeviceImageFormatInfo2 structure 997 containing the following information: 998 ** The pname:pNext chain including the same 999 slink:VkVideoProfileListInfoKHR structure used to call 1000 fname:vkGetPhysicalDeviceVideoFormatPropertiesKHR. 1001 ** pname:format set to the value of 1002 sname:VkVideoFormatPropertiesKHR::pname:format. 1003 ** pname:type set to the value of 1004 sname:VkVideoFormatPropertiesKHR::pname:imageType. 1005 ** pname:tiling set to the value of 1006 sname:VkVideoFormatPropertiesKHR::pname:imageTiling. 1007 ** pname:usage set to the value of 1008 sname:VkVideoFormatPropertiesKHR::pname:imageUsageFlags. 1009 ** pname:flags set to the value of 1010 sname:VkVideoFormatPropertiesKHR::pname:imageCreateFlags. 1011 1012The pname:componentMapping member of sname:VkVideoFormatPropertiesKHR 1013defines the ordering of the {YCbCr} color channels from the perspective of 1014the video codec operations specified in slink:VkVideoProfileListInfoKHR. 1015For example, if the implementation produces video decode output with the 1016format ename:VK_FORMAT_G8_B8R8_2PLANE_420_UNORM where the blue and red 1017chrominance channels are swapped then the pname:componentMapping member of 1018the corresponding sname:VkVideoFormatPropertiesKHR structure will have the 1019following member values: 1020 1021[source,c++] 1022---- 1023components.r = VK_COMPONENT_SWIZZLE_B; // Cb component 1024components.g = VK_COMPONENT_SWIZZLE_IDENTITY; // Y component 1025components.b = VK_COMPONENT_SWIZZLE_R; // Cr component 1026components.a = VK_COMPONENT_SWIZZLE_IDENTITY; // unused, defaults to 1.0 1027---- 1028 1029.Valid Usage 1030**** 1031 * [[VUID-vkGetPhysicalDeviceVideoFormatPropertiesKHR-pNext-06812]] 1032 The pname:pNext chain of pname:pVideoFormatInfo must: include a 1033 slink:VkVideoProfileListInfoKHR structure with pname:profileCount 1034 greater than `0` 1035**** 1036 1037include::{generated}/validity/protos/vkGetPhysicalDeviceVideoFormatPropertiesKHR.adoc[] 1038-- 1039 1040[open,refpage='VkPhysicalDeviceVideoFormatInfoKHR',desc='Structure specifying the codec video format',type='structs'] 1041-- 1042The sname:VkPhysicalDeviceVideoFormatInfoKHR structure is defined as: 1043 1044include::{generated}/api/structs/VkPhysicalDeviceVideoFormatInfoKHR.adoc[] 1045 1046 * pname:sType is a elink:VkStructureType value identifying this structure. 1047 * pname:pNext is `NULL` or a pointer to a structure extending this 1048 structure. 1049 * pname:imageUsage is a bitmask of elink:VkImageUsageFlagBits specifying 1050 the intended usage of the video images. 1051 1052include::{generated}/validity/structs/VkPhysicalDeviceVideoFormatInfoKHR.adoc[] 1053-- 1054 1055[open,refpage='VkVideoFormatPropertiesKHR',desc='Structure enumerating the video image formats',type='structs'] 1056-- 1057The sname:VkVideoFormatPropertiesKHR structure is defined as: 1058 1059include::{generated}/api/structs/VkVideoFormatPropertiesKHR.adoc[] 1060 1061 * pname:sType is a elink:VkStructureType value identifying this structure. 1062 * pname:pNext is `NULL` or a pointer to a structure extending this 1063 structure. 1064 * pname:format is a elink:VkFormat that specifies the format that can: be 1065 used with the specified video profiles and image usages. 1066 * pname:componentMapping defines the color channel order used for the 1067 format. 1068 pname:format along with pname:componentMapping describe how the color 1069 channels are ordered when producing video decoder output or are expected 1070 to be ordered in video encoder input, when applicable. 1071 If the pname:format reported does not require component swizzling then 1072 all members of pname:componentMapping will be set to 1073 ename:VK_COMPONENT_SWIZZLE_IDENTITY. 1074 * pname:imageCreateFlags is a bitmask of elink:VkImageCreateFlagBits 1075 specifying the supported image creation flags for the format. 1076 * pname:imageType is a elink:VkImageType that specifies the image type the 1077 format can: be used with. 1078 * pname:imageTiling is a elink:VkImageTiling that specifies the image 1079 tiling the format can: be used with. 1080 * pname:imageUsageFlags is a bitmask of elink:VkImageUsageFlagBits 1081 specifying the supported image usage flags for the format. 1082 1083include::{generated}/validity/structs/VkVideoFormatPropertiesKHR.adoc[] 1084-- 1085 1086[[video-session]] 1087== Video Sessions 1088 1089[open,refpage='VkVideoSessionKHR',desc='Opaque handle to a video session object',type='handles'] 1090-- 1091Video sessions are objects that represent and maintain the state needed to 1092perform video decode or encode operations using a specific video profile. 1093 1094Video sessions are represented by sname:VkVideoSessionKHR handles: 1095 1096include::{generated}/api/handles/VkVideoSessionKHR.adoc[] 1097-- 1098 1099 1100[[video-session-creation]] 1101=== Creating a Video Session 1102 1103[open,refpage='vkCreateVideoSessionKHR',desc='Creates a video session object',type='protos'] 1104-- 1105To create a video session object, call: 1106 1107include::{generated}/api/protos/vkCreateVideoSessionKHR.adoc[] 1108 1109 * pname:device is the logical device that creates the video session. 1110 * pname:pCreateInfo is a pointer to a slink:VkVideoSessionCreateInfoKHR 1111 structure containing parameters to be used to create the video session. 1112 * pname:pAllocator controls host memory allocation as described in the 1113 <<memory-allocation, Memory Allocation>> chapter. 1114 * pname:pVideoSession is a pointer to a slink:VkVideoSessionKHR handle in 1115 which the resulting video session object is returned. 1116 1117The resulting video session object is said to be created with the video 1118codec operation specified in 1119pname:pCreateInfo->pVideoProfile->videoCodecOperation. 1120 1121The name and version of the codec-specific Video Std header to be used with 1122the video session is specified by the slink:VkExtensionProperties structure 1123pointed to by pname:pCreateInfo->pStdHeaderVersion. 1124If a non-existent or unsupported Video Std header version is specified in 1125pname:pCreateInfo->pStdHeaderVersion->specVersion, then this command returns 1126ename:VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR. 1127 1128[[video-session-uninitialized]] 1129Video session objects are created in _uninitialized_ state. 1130In order to transition the video session into _initial_ state, the 1131application must: issue a flink:vkCmdControlVideoCodingKHR command with 1132slink:VkVideoCodingControlInfoKHR::pname:flags including 1133ename:VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR. 1134 1135Video session objects also maintain the 1136<<dpb-state-and-backing-store,state>> of the DPB. 1137The number of DPB slots usable with the created video session is specified 1138in pname:pCreateInfo->maxDpbSlots, and each slot is initially in the 1139<<dpb-slot-states,inactive state>>. 1140 1141Each <<dpb-slot,DPB slot>> maintained by the created video session can: 1142refer to a <<reference-picture,reference picture>> representing a video 1143frame. 1144 1145ifdef::VK_KHR_video_decode_h264[] 1146[[decode-h264-interlaced-support]] 1147In addition, if the pname:videoCodecOperation member of the 1148slink:VkVideoProfileInfoKHR structure pointed to by 1149pname:pCreateInfo->pVideoProfile is 1150ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and the 1151pname:pictureLayout member of the slink:VkVideoDecodeH264ProfileInfoKHR 1152structure provided in the slink:VkVideoProfileInfoKHR::pname:pNext chain is 1153not ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR, then the 1154created video session supports _interlaced_ frames and each <<dpb-slot,DPB 1155slot>> maintained by the created video session can: instead refer to 1156separate top field and bottom field <<reference-picture,reference pictures>> 1157that together can: represent a full video frame. 1158In this case, it is up to the application, driven by the video content, 1159whether it associates any individual DPB slot with separate top and/or 1160bottom field pictures or a single picture representing a full frame. 1161endif::VK_KHR_video_decode_h264[] 1162 1163The created video session can: be used to perform video coding operations 1164using video frames up to the maximum size specified in 1165pname:pCreateInfo->maxCodedExtent. 1166The minimum frame size allowed is implicitly derived from 1167slink:VkVideoCapabilitiesKHR::pname:minCodedExtent, as returned by 1168flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video profile 1169specified by pname:pCreateInfo->pVideoProfile. 1170Accordingly, the created video session is said to be created with a 1171pname:minCodedExtent equal to that. 1172 1173ifdef::VK_KHR_video_encode_queue[] 1174In case of video session objects created with a video encode operation, 1175implementations may: return the 1176ename:VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR error if any of the 1177specified Video Std parameters do not adhere to the syntactic or semantic 1178requirements of the used video compression standard, or if values derived 1179from parameters according to the rules defined by the used video compression 1180standard do not adhere to the capabilities of the video compression standard 1181or the implementation. 1182 1183[NOTE] 1184.Note 1185==== 1186Applications should: not rely on the 1187ename:VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR error being returned by any 1188command as a means to verify Video Std parameters, as implementations are 1189not required to report the error in any specific set of cases. 1190==== 1191endif::VK_KHR_video_encode_queue[] 1192 1193include::{generated}/validity/protos/vkCreateVideoSessionKHR.adoc[] 1194-- 1195 1196[open,refpage='VkVideoSessionCreateInfoKHR',desc='Structure specifying parameters of a newly created video session',type='structs'] 1197-- 1198The slink:VkVideoSessionCreateInfoKHR structure is defined as: 1199 1200include::{generated}/api/structs/VkVideoSessionCreateInfoKHR.adoc[] 1201 1202 * pname:sType is a elink:VkStructureType value identifying this structure. 1203 * pname:pNext is `NULL` or a pointer to a structure extending this 1204 structure. 1205 * pname:queueFamilyIndex is the index of the queue family the created 1206 video session will be used with. 1207 * pname:flags is a bitmask of elink:VkVideoSessionCreateFlagBitsKHR 1208 specifying creation flags. 1209 * pname:pVideoProfile is a pointer to a slink:VkVideoProfileInfoKHR 1210 structure specifying the video profile the created video session will be 1211 used with. 1212 * pname:pictureFormat is the image format the created video session will 1213 be used with. 1214ifdef::VK_KHR_video_decode_queue[] 1215 If pname:pVideoProfile->videoCodecOperation specifies a decode 1216 operation, then pname:pictureFormat is the image format of 1217 <<decode-output-picture, decode output pictures>> usable with the 1218 created video session. 1219endif::VK_KHR_video_decode_queue[] 1220ifdef::VK_KHR_video_encode_queue[] 1221 If pname:pVideoProfile->videoCodecOperation specifies an encode 1222 operation, then pname:pictureFormat is the image format of 1223 <<encode-input-picture, encode input pictures>> usable with the created 1224 video session. 1225endif::VK_KHR_video_encode_queue[] 1226 * pname:maxCodedExtent is the maximum width and height of the coded frames 1227 the created video session will be used with. 1228 * pname:referencePictureFormat is the image format of 1229 <<reference-picture,reference pictures>> stored in the <<dpb,DPB>> the 1230 created video session will be used with. 1231 * pname:maxDpbSlots is the maximum number of <<dpb-slot,DPB Slots>> that 1232 can: be used with the created video session. 1233 * pname:maxActiveReferencePictures is the maximum number of 1234 <<active-reference-pictures,active reference pictures>> that can: be 1235 used in a single video coding operation using the created video session. 1236 * pname:pStdHeaderVersion is a pointer to a slink:VkExtensionProperties 1237 structure requesting the Video Std header version to use for the 1238 pname:videoCodecOperation specified in pname:pVideoProfile. 1239 1240.Valid Usage 1241**** 1242 * [[VUID-VkVideoSessionCreateInfoKHR-protectedMemory-07189]] 1243 If the <<features-protectedMemory, pname:protectedMemory>> feature is 1244 not enabled or if slink:VkVideoCapabilitiesKHR::pname:flags does not 1245 include ename:VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR, as returned 1246 by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video profile 1247 specified by pname:pVideoProfile, then pname:flags must: not include 1248 ename:VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR 1249 * [[VUID-VkVideoSessionCreateInfoKHR-pVideoProfile-04845]] 1250 pname:pVideoProfile must: be a <<video-profile-support, supported video 1251 profile>> 1252 * [[VUID-VkVideoSessionCreateInfoKHR-maxDpbSlots-04847]] 1253 pname:maxDpbSlots must: be less than or equal to 1254 slink:VkVideoCapabilitiesKHR::pname:maxDpbSlots, as returned by 1255 flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video profile 1256 specified by pname:pVideoProfile 1257 * [[VUID-VkVideoSessionCreateInfoKHR-maxActiveReferencePictures-04849]] 1258 pname:maxActiveReferencePictures must: be less than or equal to 1259 slink:VkVideoCapabilitiesKHR::pname:maxActiveReferencePictures, as 1260 returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video 1261 profile specified by pname:pVideoProfile 1262 * [[VUID-VkVideoSessionCreateInfoKHR-maxDpbSlots-04850]] 1263 If either pname:maxDpbSlots or pname:maxActiveReferencePictures is `0`, 1264 then both must: be `0` 1265 * [[VUID-VkVideoSessionCreateInfoKHR-maxCodedExtent-04851]] 1266 pname:maxCodedExtent must: be between 1267 slink:VkVideoCapabilitiesKHR::pname:minCodedExtent and 1268 slink:VkVideoCapabilitiesKHR::pname:maxCodedExtent, inclusive, as 1269 returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video 1270 profile specified by pname:pVideoProfile 1271ifdef::VK_KHR_video_decode_queue[] 1272 * [[VUID-VkVideoSessionCreateInfoKHR-referencePictureFormat-04852]] 1273 If pname:pVideoProfile->videoCodecOperation specifies a decode operation 1274 and pname:maxActiveReferencePictures is greater than `0`, then 1275 pname:referencePictureFormat must: be one of the supported decode DPB 1276 formats, as returned by 1277 flink:vkGetPhysicalDeviceVideoFormatPropertiesKHR in 1278 slink:VkVideoFormatPropertiesKHR::pname:format when called with the 1279 pname:imageUsage member of its pname:pVideoFormatInfo parameter 1280 containing ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR, and with a 1281 slink:VkVideoProfileListInfoKHR structure specified in the pname:pNext 1282 chain of its pname:pVideoFormatInfo parameter whose pname:pProfiles 1283 member contains an element matching pname:pVideoProfile 1284endif::VK_KHR_video_decode_queue[] 1285ifdef::VK_KHR_video_encode_queue[] 1286 * [[VUID-VkVideoSessionCreateInfoKHR-referencePictureFormat-06814]] 1287 If pname:pVideoProfile->videoCodecOperation specifies an encode 1288 operation and pname:maxActiveReferencePictures is greater than `0`, then 1289 pname:referencePictureFormat must: be one of the supported decode DPB 1290 formats, as returned by then pname:referencePictureFormat must: be one 1291 of the supported encode DPB formats, as returned by 1292 flink:vkGetPhysicalDeviceVideoFormatPropertiesKHR in 1293 slink:VkVideoFormatPropertiesKHR::pname:format when called with the 1294 pname:imageUsage member of its pname:pVideoFormatInfo parameter 1295 containing ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR, and with a 1296 slink:VkVideoProfileListInfoKHR structure specified in the pname:pNext 1297 chain of its pname:pVideoFormatInfo parameter whose pname:pProfiles 1298 member contains an element matching pname:pVideoProfile 1299endif::VK_KHR_video_encode_queue[] 1300ifdef::VK_KHR_video_decode_queue[] 1301 * [[VUID-VkVideoSessionCreateInfoKHR-pictureFormat-04853]] 1302 If pname:pVideoProfile->videoCodecOperation specifies a decode 1303 operation, then pname:pictureFormat must: be one of the supported decode 1304 output formats, as returned by 1305 flink:vkGetPhysicalDeviceVideoFormatPropertiesKHR in 1306 slink:VkVideoFormatPropertiesKHR::pname:format when called with the 1307 pname:imageUsage member of its pname:pVideoFormatInfo parameter 1308 containing ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR, and with a 1309 slink:VkVideoProfileListInfoKHR structure specified in the pname:pNext 1310 chain of its pname:pVideoFormatInfo parameter whose pname:pProfiles 1311 member contains an element matching pname:pVideoProfile 1312endif::VK_KHR_video_decode_queue[] 1313ifdef::VK_KHR_video_encode_queue[] 1314 * [[VUID-VkVideoSessionCreateInfoKHR-pictureFormat-04854]] 1315 If pname:pVideoProfile->videoCodecOperation specifies an encode 1316 operation, then pname:pictureFormat must: be one of the supported encode 1317 input formats, as returned by 1318 flink:vkGetPhysicalDeviceVideoFormatPropertiesKHR in 1319 slink:VkVideoFormatPropertiesKHR::pname:format when called with the 1320 pname:imageUsage member of its pname:pVideoFormatInfo parameter 1321 containing ename:VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR, and with a 1322 slink:VkVideoProfileListInfoKHR structure specified in the pname:pNext 1323 chain of its pname:pVideoFormatInfo parameter whose pname:pProfiles 1324 member contains an element matching pname:pVideoProfile 1325endif::VK_KHR_video_encode_queue[] 1326 * [[VUID-VkVideoSessionCreateInfoKHR-pStdHeaderVersion-07190]] 1327 pname:pStdHeaderVersion->extensionName must: match 1328 slink:VkVideoCapabilitiesKHR::pname:stdHeaderVersion.extensionName, as 1329 returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video 1330 profile specified by pname:pVideoProfile 1331 * [[VUID-VkVideoSessionCreateInfoKHR-pStdHeaderVersion-07191]] 1332 pname:pStdHeaderVersion->specVersion must: be less than or equal to 1333 slink:VkVideoCapabilitiesKHR::pname:stdHeaderVersion.specVersion, as 1334 returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video 1335 profile specified by pname:pVideoProfile 1336**** 1337 1338include::{generated}/validity/structs/VkVideoSessionCreateInfoKHR.adoc[] 1339-- 1340 1341[open,refpage='VkVideoSessionCreateFlagBitsKHR',desc='Video session creation flags',type='enums'] 1342-- 1343Bits which can: be set in slink:VkVideoSessionCreateInfoKHR::pname:flags 1344are: 1345 1346include::{generated}/api/enums/VkVideoSessionCreateFlagBitsKHR.adoc[] 1347 1348 * ename:VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR specifies that 1349 the video session uses protected video content. 1350ifdef::VK_KHR_video_encode_queue[] 1351 * ename:VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_PARAMETER_OPTIMIZATIONS_BIT_KHR 1352 specifies that the implementation is allowed to override video session 1353 parameters and other codec-specific encoding parameters to optimize 1354 video encode operations based on the specific use case defined by the 1355 <<video-profiles,video profile>> and the used video encode quality 1356 level. 1357endif::VK_KHR_video_encode_queue[] 1358-- 1359 1360[open,refpage='VkVideoSessionCreateFlagsKHR',desc='Bitmask of VkVideoSessionCreateFlagBitsKHR',type='flags'] 1361-- 1362include::{generated}/api/flags/VkVideoSessionCreateFlagsKHR.adoc[] 1363 1364tname:VkVideoSessionCreateFlagsKHR is a bitmask type for setting a mask of 1365zero or more elink:VkVideoSessionCreateFlagBitsKHR. 1366-- 1367 1368 1369[[video-session-destruction]] 1370=== Destroying a Video Session 1371 1372[open,refpage='vkDestroyVideoSessionKHR',desc='Destroy video session object',type='protos'] 1373-- 1374To destroy a video session, call: 1375 1376include::{generated}/api/protos/vkDestroyVideoSessionKHR.adoc[] 1377 1378 * pname:device is the logical device that destroys the video session. 1379 * pname:videoSession is the video session to destroy. 1380 * pname:pAllocator controls host memory allocation as described in the 1381 <<memory-allocation, Memory Allocation>> chapter. 1382 1383.Valid Usage 1384**** 1385 * [[VUID-vkDestroyVideoSessionKHR-videoSession-07192]] 1386 All submitted commands that refer to pname:videoSession must: have 1387 completed execution 1388 * [[VUID-vkDestroyVideoSessionKHR-videoSession-07193]] 1389 If sname:VkAllocationCallbacks were provided when pname:videoSession was 1390 created, a compatible set of callbacks must: be provided here 1391 * [[VUID-vkDestroyVideoSessionKHR-videoSession-07194]] 1392 If no sname:VkAllocationCallbacks were provided when pname:videoSession 1393 was created, pname:pAllocator must: be `NULL` 1394**** 1395 1396include::{generated}/validity/protos/vkDestroyVideoSessionKHR.adoc[] 1397-- 1398 1399 1400[[video-session-memory-association]] 1401=== Video Session Memory Association 1402 1403After creating a video session object, and before the object can: be used to 1404record video coding operations into command buffers using it, the 1405application must: allocate and bind device memory to the video session. 1406Device memory is allocated separately (see <<memory-device>>) and then 1407associated with the video session. 1408 1409Video sessions may: have multiple memory bindings identified by unique 1410unsigned integer values. 1411Appropriate device memory must: be bound to each such memory binding before 1412using the video session to record command buffer commands with it. 1413 1414[open,refpage='vkGetVideoSessionMemoryRequirementsKHR',desc='Get the memory requirements for a video session',type='protos'] 1415-- 1416To determine the memory requirements for a video session object, call: 1417 1418include::{generated}/api/protos/vkGetVideoSessionMemoryRequirementsKHR.adoc[] 1419 1420 * pname:device is the logical device that owns the video session. 1421 * pname:videoSession is the video session to query. 1422 * pname:pMemoryRequirementsCount is a pointer to an integer related to the 1423 number of memory binding requirements available or queried, as described 1424 below. 1425 * pname:pMemoryRequirements is `NULL` or a pointer to an array of 1426 slink:VkVideoSessionMemoryRequirementsKHR structures in which the memory 1427 binding requirements of the video session are returned. 1428 1429If pname:pMemoryRequirements is `NULL`, then the number of memory bindings 1430required for the video session is returned in 1431pname:pMemoryRequirementsCount. 1432Otherwise, pname:pMemoryRequirementsCount must: point to a variable set by 1433the user with the number of elements in the pname:pMemoryRequirements array, 1434and on return the variable is overwritten with the number of memory binding 1435requirements actually written to pname:pMemoryRequirements. 1436If pname:pMemoryRequirementsCount is less than the number of memory bindings 1437required for the video session, then at most pname:pMemoryRequirementsCount 1438elements will be written to pname:pMemoryRequirements, and 1439ename:VK_INCOMPLETE will be returned, instead of ename:VK_SUCCESS, to 1440indicate that not all required memory binding requirements were returned. 1441 1442include::{generated}/validity/protos/vkGetVideoSessionMemoryRequirementsKHR.adoc[] 1443-- 1444 1445 1446[open,refpage='VkVideoSessionMemoryRequirementsKHR',desc='Structure describing video session memory requirements',type='structs'] 1447-- 1448The sname:VkVideoSessionMemoryRequirementsKHR structure is defined as: 1449 1450include::{generated}/api/structs/VkVideoSessionMemoryRequirementsKHR.adoc[] 1451 1452 * pname:sType is a elink:VkStructureType value identifying this structure. 1453 * pname:pNext is `NULL` or a pointer to a structure extending this 1454 structure. 1455 * pname:memoryBindIndex is the index of the memory binding. 1456 * pname:memoryRequirements is a slink:VkMemoryRequirements structure in 1457 which the requested memory binding requirements for the binding index 1458 specified by pname:memoryBindIndex are returned. 1459 1460include::{generated}/validity/structs/VkVideoSessionMemoryRequirementsKHR.adoc[] 1461-- 1462 1463 1464[open,refpage='vkBindVideoSessionMemoryKHR',desc='Bind Video Memory',type='protos'] 1465-- 1466To attach memory to a video session object, call: 1467 1468include::{generated}/api/protos/vkBindVideoSessionMemoryKHR.adoc[] 1469 1470 * pname:device is the logical device that owns the video session. 1471 * pname:videoSession is the video session to be bound with device memory. 1472 * pname:bindSessionMemoryInfoCount is the number of elements in 1473 pname:pBindSessionMemoryInfos. 1474 * pname:pBindSessionMemoryInfos is a pointer to an array of 1475 pname:bindSessionMemoryInfoCount slink:VkBindVideoSessionMemoryInfoKHR 1476 structures specifying memory regions to be bound to specific memory 1477 bindings of the video session. 1478 1479The valid usage statements below refer to the slink:VkMemoryRequirements 1480structure corresponding to a specific element of 1481pname:pBindSessionMemoryInfos, which is defined as follows: 1482 1483 * If the pname:memoryBindIndex member of the element of 1484 pname:pBindSessionMemoryInfos in question matches the 1485 pname:memoryBindIndex member of one of the elements returned in 1486 pname:pMemoryRequirements when 1487 flink:vkGetVideoSessionMemoryRequirementsKHR is called with the same 1488 pname:videoSession and with pname:pMemoryRequirementsCount equal to 1489 pname:bindSessionMemoryInfoCount, then the pname:memoryRequirements 1490 member of that element of pname:pMemoryRequirements is the 1491 slink:VkMemoryRequirements structure corresponding to the element of 1492 pname:pBindSessionMemoryInfos in question. 1493 * Otherwise the element of pname:pBindSessionMemoryInfos in question is 1494 said to not have a corresponding slink:VkMemoryRequirements structure. 1495 1496.Valid Usage 1497**** 1498 * [[VUID-vkBindVideoSessionMemoryKHR-videoSession-07195]] 1499 The memory binding of pname:videoSession identified by the 1500 pname:memoryBindIndex member of any element of 1501 pname:pBindSessionMemoryInfos must: not already be backed by a memory 1502 object 1503 * [[VUID-vkBindVideoSessionMemoryKHR-memoryBindIndex-07196]] 1504 The pname:memoryBindIndex member of each element of 1505 pname:pBindSessionMemoryInfos must: be unique within 1506 pname:pBindSessionMemoryInfos 1507 * [[VUID-vkBindVideoSessionMemoryKHR-pBindSessionMemoryInfos-07197]] 1508 Each element of pname:pBindSessionMemoryInfos must: have a corresponding 1509 slink:VkMemoryRequirements structure 1510 * [[VUID-vkBindVideoSessionMemoryKHR-pBindSessionMemoryInfos-07198]] 1511 If an element of pname:pBindSessionMemoryInfos has a corresponding 1512 slink:VkMemoryRequirements structure, then the pname:memory member of 1513 that element of pname:pBindSessionMemoryInfos must: have been allocated 1514 using one of the memory types allowed in the pname:memoryTypeBits member 1515 of the corresponding slink:VkMemoryRequirements structure 1516 * [[VUID-vkBindVideoSessionMemoryKHR-pBindSessionMemoryInfos-07199]] 1517 If an element of pname:pBindSessionMemoryInfos has a corresponding 1518 slink:VkMemoryRequirements structure, then the pname:memoryOffset member 1519 of that element of pname:pBindSessionMemoryInfos must: be an integer 1520 multiple of the pname:alignment member of the corresponding 1521 slink:VkMemoryRequirements structure 1522 * [[VUID-vkBindVideoSessionMemoryKHR-pBindSessionMemoryInfos-07200]] 1523 If an element of pname:pBindSessionMemoryInfos has a corresponding 1524 slink:VkMemoryRequirements structure, then the pname:memorySize member 1525 of that element of pname:pBindSessionMemoryInfos must: equal the 1526 pname:size member of the corresponding slink:VkMemoryRequirements 1527 structure 1528**** 1529 1530include::{generated}/validity/protos/vkBindVideoSessionMemoryKHR.adoc[] 1531-- 1532 1533[open,refpage='VkBindVideoSessionMemoryInfoKHR',desc='Structure specifying memory bindings for a video session object',type='structs'] 1534-- 1535The sname:VkBindVideoSessionMemoryInfoKHR structure is defined as: 1536 1537include::{generated}/api/structs/VkBindVideoSessionMemoryInfoKHR.adoc[] 1538 1539 * pname:sType is a elink:VkStructureType value identifying this structure. 1540 * pname:pNext is `NULL` or a pointer to a structure extending this 1541 structure. 1542 * pname:memoryBindIndex is the memory binding index to bind memory to. 1543 * pname:memory is the allocated device memory to be bound to the video 1544 session's memory binding with index pname:memoryBindIndex. 1545 * pname:memoryOffset is the start offset of the region of pname:memory 1546 which is to be bound. 1547 * pname:memorySize is the size in bytes of the region of pname:memory, 1548 starting from pname:memoryOffset bytes, to be bound. 1549 1550.Valid Usage 1551**** 1552 * [[VUID-VkBindVideoSessionMemoryInfoKHR-memoryOffset-07201]] 1553 pname:memoryOffset must: be less than the size of pname:memory 1554 * [[VUID-VkBindVideoSessionMemoryInfoKHR-memorySize-07202]] 1555 pname:memorySize must: be less than or equal to the size of pname:memory 1556 minus pname:memoryOffset 1557**** 1558 1559include::{generated}/validity/structs/VkBindVideoSessionMemoryInfoKHR.adoc[] 1560-- 1561 1562 1563[[video-profile-compatibility]] 1564== Video Profile Compatibility 1565 1566Resources and query pools used with a particular video session must: be 1567compatible with the <<video-profiles,video profile>> the video session was 1568created with. 1569 1570A slink:VkBuffer is compatible with a video profile if it was created with 1571the slink:VkBufferCreateInfo::pname:pNext chain including a 1572slink:VkVideoProfileListInfoKHR structure with its pname:pProfiles member 1573containing an element matching the slink:VkVideoProfileInfoKHR structure 1574chain describing the video profile, and 1575slink:VkBufferCreateInfo::pname:usage including at least one bit specific to 1576video coding usage. 1577 1578ifdef::VK_KHR_video_decode_queue[] 1579 * ename:VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR 1580 * ename:VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR 1581endif::VK_KHR_video_decode_queue[] 1582ifdef::VK_KHR_video_encode_queue[] 1583 * ename:VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR 1584 * ename:VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR 1585endif::VK_KHR_video_encode_queue[] 1586 1587A slink:VkImage is compatible with a video profile if it was created with 1588the slink:VkImageCreateInfo::pname:pNext chain including a 1589slink:VkVideoProfileListInfoKHR structure with its pname:pProfiles member 1590containing an element matching the slink:VkVideoProfileInfoKHR structure 1591chain describing the video profile, and slink:VkImageCreateInfo::pname:usage 1592including at least one bit specific to video coding usage. 1593 1594ifdef::VK_KHR_video_decode_queue[] 1595 * ename:VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR 1596 * ename:VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR 1597 * ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR 1598endif::VK_KHR_video_decode_queue[] 1599ifdef::VK_KHR_video_encode_queue[] 1600 * ename:VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR 1601 * ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR 1602 * ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR 1603endif::VK_KHR_video_encode_queue[] 1604 1605A slink:VkImageView is compatible with a video profile if the slink:VkImage 1606it was created from is also compatible with that video profile. 1607 1608A slink:VkQueryPool is compatible with a video profile if it was created 1609with the slink:VkQueryPoolCreateInfo::pname:pNext chain including a 1610slink:VkVideoProfileInfoKHR structure chain describing the same video 1611profile, and slink:VkQueryPoolCreateInfo::pname:queryType having one of the 1612following values: 1613 1614 * ename:VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR 1615ifdef::VK_KHR_video_encode_queue[] 1616 * ename:VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR 1617endif::VK_KHR_video_encode_queue[] 1618 1619 1620[[video-session-parameters]] 1621== Video Session Parameters 1622 1623Video session parameters objects can: store preprocessed codec-specific 1624parameters used with a compatible video session, and enable reducing the 1625number of parameters needed to be provided and processed by the 1626implementation while recording video coding operations into command buffers. 1627 1628Parameters stored in such objects are _immutable_ to facilitate the 1629concurrent use of the stored parameters in multiple threads. 1630At the same time, new parameters can: be added to existing objects using the 1631flink:vkUpdateVideoSessionParametersKHR command. 1632 1633In order to support concurrent use of the stored immutable parameters while 1634also allowing the video session parameters object to be extended with new 1635parameters, each video session parameters object maintains an _update 1636sequence counter_ that is set to `0` at object creation time and must: be 1637incremented by each subsequent update operation. 1638 1639Certain video sequences that adhere to particular video compression 1640standards permit updating previously supplied parameters. 1641If a parameter update is necessary, the application has the following 1642options: 1643 1644 * Cache the set of parameters on the application side and create a new 1645 video session parameters object adding all the parameters with 1646 appropriate changes, as necessary; or 1647 * Create a new video session parameters object providing only the updated 1648 parameters and the previously used object as the template, which ensures 1649 that parameters not specified at creation time will be copied unmodified 1650 from the template object. 1651 1652The actual types of parameters that can: be stored and the capacity for 1653individual parameter types, and the methods of initializing, updating, and 1654referring to individual parameters are specific to the video codec operation 1655the video session parameters object was created with. 1656 1657ifdef::VK_KHR_video_decode_h264[] 1658 * For ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR these are defined 1659 in the <<decode-h264-parameter-sets,H.264 Decode Parameter Sets>> 1660 section. 1661endif::VK_KHR_video_decode_h264[] 1662ifdef::VK_KHR_video_decode_h265[] 1663 * For ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR these are defined 1664 in the <<decode-h265-parameter-sets,H.265 Decode Parameter Sets>> 1665 section. 1666endif::VK_KHR_video_decode_h265[] 1667 1668 1669[open,refpage='VkVideoSessionParametersKHR',desc='Opaque handle to a video session parameters object',type='handles'] 1670-- 1671Video session parameters are represented by 1672sname:VkVideoSessionParametersKHR handles: 1673 1674include::{generated}/api/handles/VkVideoSessionParametersKHR.adoc[] 1675-- 1676 1677 1678[[creating-video-session-parameters]] 1679=== Creating Video Session Parameters 1680 1681[open,refpage='vkCreateVideoSessionParametersKHR',desc='Creates video session parameters object',type='protos'] 1682-- 1683To create a video session parameters object, call: 1684 1685include::{generated}/api/protos/vkCreateVideoSessionParametersKHR.adoc[] 1686 1687 * pname:device is the logical device that creates the video session 1688 parameters object. 1689 * pname:pCreateInfo is a pointer to 1690 slink:VkVideoSessionParametersCreateInfoKHR structure containing 1691 parameters to be used to create the video session parameters object. 1692 * pname:pAllocator controls host memory allocation as described in the 1693 <<memory-allocation, Memory Allocation>> chapter. 1694 * pname:pVideoSessionParameters is a pointer to a 1695 slink:VkVideoSessionParametersKHR handle in which the resulting video 1696 session parameters object is returned. 1697 1698The resulting video session parameters object is said to be created with the 1699video codec operation pname:pCreateInfo->videoSession was created with. 1700 1701If pname:pCreateInfo->videoSessionParametersTemplate is not 1702dname:VK_NULL_HANDLE, then it will be used as a template for constructing 1703the new video session parameters object. 1704This happens by first adding any parameters according to the additional 1705creation parameters provided in the pname:pCreateInfo->pNext chain, followed 1706by adding any parameters from the template object that have a key that does 1707not match the key of any of the already added parameters. 1708 1709ifdef::VK_KHR_video_decode_h264[] 1710If pname:pCreateInfo->videoSession was created with the video codec 1711operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the 1712created video session parameters object will initially contain the following 1713sets of parameter entries: 1714 1715 * code:StdVideoH264SequenceParameterSet structures representing 1716 <<decode-h264-sps,H.264 SPS>> entries, as follows: 1717 ** If the pname:pParametersAddInfo member of the 1718 slink:VkVideoDecodeH264SessionParametersCreateInfoKHR structure 1719 provided in the pname:pCreateInfo->pNext chain is not `NULL`, then the 1720 set of code:StdVideoH264SequenceParameterSet entries specified in 1721 pname:pParametersAddInfo->pStdSPSs are added first; 1722 ** If pname:pCreateInfo->videoSessionParametersTemplate is not 1723 dname:VK_NULL_HANDLE, then each code:StdVideoH264SequenceParameterSet 1724 entry stored in it is copied to the created video session parameters 1725 object if the created object does not already contain such an entry 1726 with the same pname:seq_parameter_set_id. 1727 * code:StdVideoH264PictureParameterSet structures representing 1728 <<decode-h264-pps,H.264 PPS>> entries, as follows: 1729 ** If the pname:pParametersAddInfo member of the 1730 slink:VkVideoDecodeH264SessionParametersCreateInfoKHR structure 1731 provided in the pname:pCreateInfo->pNext chain is not `NULL`, then the 1732 set of code:StdVideoH264PictureParameterSet entries specified in 1733 pname:pParametersAddInfo->pStdPPSs are added first; 1734 ** If pname:pCreateInfo->videoSessionParametersTemplate is not 1735 dname:VK_NULL_HANDLE, then each code:StdVideoH264PictureParameterSet 1736 entry stored in it is copied to the created video session parameters 1737 object if the created object does not already contain such an entry 1738 with the same pname:seq_parameter_set_id and 1739 pname:pic_parameter_set_id. 1740endif::VK_KHR_video_decode_h264[] 1741 1742ifdef::VK_KHR_video_decode_h265[] 1743If pname:pCreateInfo->videoSession was created with the video codec 1744operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the 1745created video session parameters object will initially contain the following 1746sets of parameter entries: 1747 1748 * code:StdVideoH265VideoParameterSet structures representing 1749 <<decode-h265-vps,H.265 VPS>> entries, as follows: 1750 ** If the pname:pParametersAddInfo member of the 1751 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure 1752 provided in the pname:pCreateInfo->pNext chain is not `NULL`, then the 1753 set of code:StdVideoH265VideoParameterSet entries specified in 1754 pname:pParametersAddInfo->pStdVPSs are added first; 1755 ** If pname:pCreateInfo->videoSessionParametersTemplate is not 1756 dname:VK_NULL_HANDLE, then each code:StdVideoH265VideoParameterSet 1757 entry stored in it is copied to the created video session parameters 1758 object if the created object does not already contain such an entry 1759 with the same pname:vps_video_parameter_set_id. 1760 * code:StdVideoH265SequenceParameterSet structures representing 1761 <<decode-h265-sps,H.265 SPS>> entries, as follows: 1762 ** If the pname:pParametersAddInfo member of the 1763 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure 1764 provided in the pname:pCreateInfo->pNext chain is not `NULL`, then the 1765 set of code:StdVideoH265SequenceParameterSet entries specified in 1766 pname:pParametersAddInfo->pStdSPSs are added first; 1767 ** If pname:pCreateInfo->videoSessionParametersTemplate is not 1768 dname:VK_NULL_HANDLE, then each code:StdVideoH265SequenceParameterSet 1769 entry stored in it is copied to the created video session parameters 1770 object if the created object does not already contain such an entry 1771 with the same pname:sps_video_parameter_set_id and 1772 pname:sps_seq_parameter_set_id. 1773 * code:StdVideoH265PictureParameterSet structures representing 1774 <<decode-h265-pps,H.265 PPS>> entries, as follows: 1775 ** If the pname:pParametersAddInfo member of the 1776 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure 1777 provided in the pname:pCreateInfo->pNext chain is not `NULL`, then the 1778 set of code:StdVideoH265PictureParameterSet entries specified in 1779 pname:pParametersAddInfo->pStdPPSs are added first; 1780 ** If pname:pCreateInfo->videoSessionParametersTemplate is not 1781 dname:VK_NULL_HANDLE, then each code:StdVideoH265PictureParameterSet 1782 entry stored in it is copied to the created video session parameters 1783 object if the created object does not already contain such an entry 1784 with the same pname:sps_video_parameter_set_id, 1785 pname:pps_seq_parameter_set_id, and pname:pps_pic_parameter_set_id. 1786endif::VK_KHR_video_decode_h265[] 1787 1788ifdef::VK_KHR_video_encode_queue[] 1789In case of video session parameters objects created with a video encode 1790operation, implementations may: return the 1791ename:VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR error if any of the 1792specified Video Std parameters do not adhere to the syntactic or semantic 1793requirements of the used video compression standard, or if values derived 1794from parameters according to the rules defined by the used video compression 1795standard do not adhere to the capabilities of the video compression standard 1796or the implementation. 1797 1798[NOTE] 1799.Note 1800==== 1801Applications should: not rely on the 1802ename:VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR error being returned by any 1803command as a means to verify Video Std parameters, as implementations are 1804not required to report the error in any specific set of cases. 1805==== 1806endif::VK_KHR_video_encode_queue[] 1807 1808include::{generated}/validity/protos/vkCreateVideoSessionParametersKHR.adoc[] 1809-- 1810 1811[open,refpage='VkVideoSessionParametersCreateInfoKHR',desc='Structure specifying parameters of a newly created video session parameters object',type='structs'] 1812-- 1813The sname:VkVideoSessionParametersCreateInfoKHR structure is defined as: 1814 1815include::{generated}/api/structs/VkVideoSessionParametersCreateInfoKHR.adoc[] 1816 1817 * pname:sType is a elink:VkStructureType value identifying this structure. 1818 * pname:pNext is `NULL` or a pointer to a structure extending this 1819 structure. 1820 * pname:flags is reserved for future use. 1821 * pname:videoSessionParametersTemplate is dname:VK_NULL_HANDLE or a valid 1822 handle to a slink:VkVideoSessionParametersKHR object used as a template 1823 for constructing the new video session parameters object. 1824 * pname:videoSession is the video session object against which the video 1825 session parameters object is going to be created. 1826 1827Limiting values are defined below that are referenced by the relevant valid 1828usage statements of this structure. 1829 1830ifdef::VK_KHR_video_decode_h264[] 1831 * If pname:videoSession was created with the codec operation 1832 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then let 1833 `StdVideoH264SequenceParameterSet spsAddList[]` be the list of 1834 <<decode-h264-sps,H.264 SPS>> entries to add to the created video 1835 session parameters object, defined as follows: 1836 ** If the pname:pParametersAddInfo member of the 1837 slink:VkVideoDecodeH264SessionParametersCreateInfoKHR structure 1838 provided in the pname:pNext chain is not `NULL`, then the set of 1839 code:StdVideoH264SequenceParameterSet entries specified in 1840 pname:pParametersAddInfo->pStdSPSs are added to pname:spsAddList; 1841 ** If pname:videoSessionParametersTemplate is not dname:VK_NULL_HANDLE, 1842 then each code:StdVideoH264SequenceParameterSet entry stored in it with 1843 pname:seq_parameter_set_id not matching any of the entries already in 1844 pname:spsAddList is added to pname:spsAddList. 1845 * If pname:videoSession was created with the codec operation 1846 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then let 1847 `StdVideoH264PictureParameterSet ppsAddList[]` be the list of 1848 <<decode-h264-pps,H.264 PPS>> entries to add to the created video 1849 session parameters object, defined as follows: 1850 ** If the pname:pParametersAddInfo member of the 1851 slink:VkVideoDecodeH264SessionParametersCreateInfoKHR structure 1852 provided in the pname:pNext chain is not `NULL`, then the set of 1853 code:StdVideoH264PictureParameterSet entries specified in 1854 pname:pParametersAddInfo->pStdPPSs are added to pname:ppsAddList; 1855 ** If pname:videoSessionParametersTemplate is not dname:VK_NULL_HANDLE, 1856 then each code:StdVideoH264PictureParameterSet entry stored in it with 1857 pname:seq_parameter_set_id or pname:pic_parameter_set_id not matching 1858 any of the entries already in pname:ppsAddList is added to 1859 pname:ppsAddList. 1860endif::VK_KHR_video_decode_h264[] 1861ifdef::VK_KHR_video_decode_h265[] 1862 * If pname:videoSession was created with the codec operation 1863 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then let 1864 `StdVideoH265VideoParameterSet vpsAddList[]` be the list of 1865 <<decode-h265-vps,H.265 VPS>> entries to add to the created video 1866 session parameters object, defined as follows: 1867 ** If the pname:pParametersAddInfo member of the 1868 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure 1869 provided in the pname:pNext chain is not `NULL`, then the set of 1870 code:StdVideoH265VideoParameterSet entries specified in 1871 pname:pParametersAddInfo->pStdVPSs are added to pname:vpsAddList; 1872 ** If pname:videoSessionParametersTemplate is not dname:VK_NULL_HANDLE, 1873 then each code:StdVideoH265VideoParameterSet entry stored in it with 1874 pname:vps_video_parameter_set_id not matching any of the entries 1875 already in pname:vpsAddList is added to pname:vpsAddList. 1876 * If pname:videoSession was created with the codec operation 1877 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then let 1878 `StdVideoH265SequenceParameterSet spsAddList[]` be the list of 1879 <<decode-h265-sps,H.265 SPS>> entries to add to the created video 1880 session parameters object, defined as follows: 1881 ** If the pname:pParametersAddInfo member of the 1882 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure 1883 provided in the pname:pNext chain is not `NULL`, then the set of 1884 code:StdVideoH265SequenceParameterSet entries specified in 1885 pname:pParametersAddInfo->pStdSPSs are added to pname:spsAddList; 1886 ** If pname:videoSessionParametersTemplate is not dname:VK_NULL_HANDLE, 1887 then each code:StdVideoH265SequenceParameterSet entry stored in it with 1888 pname:sps_video_parameter_set_id or pname:sps_seq_parameter_set_id not 1889 matching any of the entries already in pname:spsAddList is added to 1890 pname:spsAddList. 1891 * If pname:videoSession was created with the codec operation 1892 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then let 1893 `StdVideoH265PictureParameterSet ppsAddList[]` be the list of 1894 <<decode-h265-pps,H.265 PPS>> entries to add to the created video 1895 session parameters object, defined as follows: 1896 ** If the pname:pParametersAddInfo member of the 1897 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure 1898 provided in the pname:pNext chain is not `NULL`, then the set of 1899 code:StdVideoH265PictureParameterSet entries specified in 1900 pname:pParametersAddInfo->pStdPPSs are added to pname:ppsAddList; 1901 ** If pname:videoSessionParametersTemplate is not dname:VK_NULL_HANDLE, 1902 then each code:StdVideoH265PictureParameterSet entry stored in it with 1903 pname:sps_video_parameter_set_id, pname:pps_seq_parameter_set_id, or 1904 pname:pps_pic_parameter_set_id not matching any of the entries already 1905 in pname:ppsAddList is added to pname:ppsAddList. 1906endif::VK_KHR_video_decode_h265[] 1907 1908.Valid Usage 1909**** 1910 * [[VUID-VkVideoSessionParametersCreateInfoKHR-videoSessionParametersTemplate-04855]] 1911 If pname:videoSessionParametersTemplate represents a valid handle, it 1912 must: have been created against pname:videoSession 1913ifdef::VK_KHR_video_decode_h264[] 1914 * [[VUID-VkVideoSessionParametersCreateInfoKHR-videoSession-07203]] 1915 If pname:videoSession was created with the video codec operation 1916 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the pname:pNext 1917 chain must: include a 1918 slink:VkVideoDecodeH264SessionParametersCreateInfoKHR structure 1919 * [[VUID-VkVideoSessionParametersCreateInfoKHR-videoSession-07204]] 1920 If pname:videoSession was created with the video codec operation 1921 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the number of 1922 elements of pname:spsAddList must: be less than or equal to the 1923 pname:maxStdSPSCount specified in the 1924 slink:VkVideoDecodeH264SessionParametersCreateInfoKHR structure included 1925 in the pname:pNext chain 1926 * [[VUID-VkVideoSessionParametersCreateInfoKHR-videoSession-07205]] 1927 If pname:videoSession was created with the video codec operation 1928 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the number of 1929 elements of pname:ppsAddList must: be less than or equal to the 1930 pname:maxStdPPSCount specified in the 1931 slink:VkVideoDecodeH264SessionParametersCreateInfoKHR structure included 1932 in the pname:pNext chain 1933endif::VK_KHR_video_decode_h264[] 1934ifdef::VK_KHR_video_decode_h265[] 1935 * [[VUID-VkVideoSessionParametersCreateInfoKHR-videoSession-07206]] 1936 If pname:videoSession was created with the video codec operation 1937 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the pname:pNext 1938 chain must: include a 1939 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure 1940 * [[VUID-VkVideoSessionParametersCreateInfoKHR-videoSession-07207]] 1941 If pname:videoSession was created with the video codec operation 1942 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the number of 1943 elements of pname:vpsAddList must: be less than or equal to the 1944 pname:maxStdVPSCount specified in the 1945 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure included 1946 in the pname:pNext chain 1947 * [[VUID-VkVideoSessionParametersCreateInfoKHR-videoSession-07208]] 1948 If pname:videoSession was created with the video codec operation 1949 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the number of 1950 elements of pname:spsAddList must: be less than or equal to the 1951 pname:maxStdSPSCount specified in the 1952 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure included 1953 in the pname:pNext chain 1954 * [[VUID-VkVideoSessionParametersCreateInfoKHR-videoSession-07209]] 1955 If pname:videoSession was created with the video codec operation 1956 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the number of 1957 elements of pname:ppsAddList must: be less than or equal to the 1958 pname:maxStdPPSCount specified in the 1959 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure included 1960 in the pname:pNext chain 1961endif::VK_KHR_video_decode_h265[] 1962ifdef::VK_EXT_video_encode_h264[] 1963 * [[VUID-VkVideoSessionParametersCreateInfoKHR-videoSession-07210]] 1964 If pname:videoSession was created with the video codec operation 1965 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT, then the pname:pNext 1966 chain must: include a 1967 slink:VkVideoEncodeH264SessionParametersCreateInfoEXT structure 1968endif::VK_EXT_video_encode_h264[] 1969ifdef::VK_EXT_video_encode_h265[] 1970 * [[VUID-VkVideoSessionParametersCreateInfoKHR-videoSession-07211]] 1971 If pname:videoSession was created with the video codec operation 1972 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT, then the pname:pNext 1973 chain must: include a 1974 slink:VkVideoEncodeH265SessionParametersCreateInfoEXT structure 1975endif::VK_EXT_video_encode_h265[] 1976**** 1977 1978include::{generated}/validity/structs/VkVideoSessionParametersCreateInfoKHR.adoc[] 1979-- 1980 1981[open,refpage='VkVideoSessionParametersCreateFlagsKHR',desc='Reserved for future use',type='flags'] 1982-- 1983include::{generated}/api/flags/VkVideoSessionParametersCreateFlagsKHR.adoc[] 1984 1985tname:VkVideoSessionParametersCreateFlagsKHR is a bitmask type for setting a 1986mask, but is currently reserved for future use. 1987-- 1988 1989 1990[[destroying-video-session-parameters]] 1991=== Destroying Video Session Parameters 1992 1993[open,refpage='vkDestroyVideoSessionParametersKHR',desc='Destroy video session parameters object',type='protos'] 1994-- 1995To destroy a video session parameters object, call: 1996 1997include::{generated}/api/protos/vkDestroyVideoSessionParametersKHR.adoc[] 1998 1999 * pname:device is the logical device that destroys the video session 2000 parameters object. 2001 * pname:videoSessionParameters is the video session parameters object to 2002 destroy. 2003 * pname:pAllocator controls host memory allocation as described in the 2004 <<memory-allocation, Memory Allocation>> chapter. 2005 2006.Valid Usage 2007**** 2008 * [[VUID-vkDestroyVideoSessionParametersKHR-videoSessionParameters-07212]] 2009 All submitted commands that refer to pname:videoSessionParameters must: 2010 have completed execution 2011 * [[VUID-vkDestroyVideoSessionParametersKHR-videoSessionParameters-07213]] 2012 If sname:VkAllocationCallbacks were provided when 2013 pname:videoSessionParameters was created, a compatible set of callbacks 2014 must: be provided here 2015 * [[VUID-vkDestroyVideoSessionParametersKHR-videoSessionParameters-07214]] 2016 If no sname:VkAllocationCallbacks were provided when 2017 pname:videoSessionParameters was created, pname:pAllocator must: be 2018 `NULL` 2019**** 2020 2021include::{generated}/validity/protos/vkDestroyVideoSessionParametersKHR.adoc[] 2022-- 2023 2024 2025[[video-session-parameters-update]] 2026=== Updating Video Session Parameters 2027 2028[open,refpage='vkUpdateVideoSessionParametersKHR',desc='Update video session parameters object',type='protos'] 2029-- 2030To update video session parameters object with new parameters, call: 2031 2032include::{generated}/api/protos/vkUpdateVideoSessionParametersKHR.adoc[] 2033 2034 * pname:device is the logical device that updates the video session 2035 parameters. 2036 * pname:videoSessionParameters is the video session parameters object to 2037 update. 2038 * pname:pUpdateInfo is a pointer to a 2039 slink:VkVideoSessionParametersUpdateInfoKHR structure specifying the 2040 parameter update information. 2041 2042After a successful call to this command, the 2043<<video-session-parameters,update sequence counter>> of 2044pname:videoSessionParameters is changed to the value specified in 2045pname:pUpdateInfo->updateSequenceCount. 2046 2047[NOTE] 2048.Note: 2049==== 2050As each update issued to a video session parameters object needs to specify 2051the next available update sequence count value, concurrent updates of the 2052same video session parameters object are inherently disallowed. 2053However, recording video coding operations to command buffers referring to 2054parameters previously added to the video session parameters object is 2055allowed, even if there is a concurrent update in progress adding some new 2056entries to the object. 2057==== 2058 2059ifdef::VK_KHR_video_decode_h264[] 2060If pname:videoSessionParameters was created with the video codec operation 2061ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and the 2062pname:pUpdateInfo->pNext chain includes a 2063slink:VkVideoDecodeH264SessionParametersAddInfoKHR structure, then this 2064command adds the following parameter entries to 2065pname:videoSessionParameters: 2066 2067 * The <<decode-h264-sps,H.264 SPS>> entries specified in 2068 slink:VkVideoDecodeH264SessionParametersAddInfoKHR::pname:pStdSPSs. 2069 * The <<decode-h264-pps,H.264 PPS>> entries specified in 2070 slink:VkVideoDecodeH264SessionParametersAddInfoKHR::pname:pStdPPSs. 2071endif::VK_KHR_video_decode_h264[] 2072 2073ifdef::VK_KHR_video_decode_h265[] 2074If pname:videoSessionParameters was created with the video codec operation 2075ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR and the 2076pname:pUpdateInfo->pNext chain includes a 2077slink:VkVideoDecodeH265SessionParametersAddInfoKHR structure, then this 2078command adds the following parameter entries to 2079pname:videoSessionParameters: 2080 2081 * The <<decode-h265-vps,H.265 VPS>> entries specified in 2082 slink:VkVideoDecodeH265SessionParametersAddInfoKHR::pname:pStdVPSs. 2083 * The <<decode-h265-sps,H.265 SPS>> entries specified in 2084 slink:VkVideoDecodeH265SessionParametersAddInfoKHR::pname:pStdSPSs. 2085 * The <<decode-h265-pps,H.265 PPS>> entries specified in 2086 slink:VkVideoDecodeH265SessionParametersAddInfoKHR::pname:pStdPPSs. 2087endif::VK_KHR_video_decode_h265[] 2088 2089ifdef::VK_KHR_video_encode_queue[] 2090In case of video session parameters objects created with a video encode 2091operation, implementations may: return the 2092ename:VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR error if any of the 2093specified Video Std parameters do not adhere to the syntactic or semantic 2094requirements of the used video compression standard, or if values derived 2095from parameters according to the rules defined by the used video compression 2096standard do not adhere to the capabilities of the video compression standard 2097or the implementation. 2098 2099[NOTE] 2100.Note 2101==== 2102Applications should: not rely on the 2103ename:VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR error being returned by any 2104command as a means to verify Video Std parameters, as implementations are 2105not required to report the error in any specific set of cases. 2106==== 2107endif::VK_KHR_video_encode_queue[] 2108 2109.Valid Usage 2110**** 2111 * [[VUID-vkUpdateVideoSessionParametersKHR-pUpdateInfo-07215]] 2112 pname:pUpdateInfo->updateSequenceCount must: equal the current 2113 <<video-session-parameters,update sequence counter>> of 2114 pname:videoSessionParameters plus one 2115ifdef::VK_KHR_video_decode_h264[] 2116 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07216]] 2117 If pname:videoSessionParameters was created with the video codec 2118 operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and the 2119 pname:pNext chain of pname:pUpdateInfo includes a 2120 slink:VkVideoDecodeH264SessionParametersAddInfoKHR structure, then 2121 pname:videoSessionParameters must: not already contain a 2122 code:StdVideoH264SequenceParameterSet entry with 2123 pname:seq_parameter_set_id matching any of the elements of 2124 slink:VkVideoDecodeH264SessionParametersAddInfoKHR::pname:pStdSPSs 2125 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07217]] 2126 If pname:videoSessionParameters was created with the video codec 2127 operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the 2128 number of code:StdVideoH264SequenceParameterSet entries already stored 2129 in it plus the value of the pname:stdSPSCount member of the 2130 slink:VkVideoDecodeH264SessionParametersAddInfoKHR structure included in 2131 the pname:pUpdateInfo->pNext chain must: be less than or equal to the 2132 slink:VkVideoDecodeH264SessionParametersCreateInfoKHR::pname:maxStdSPSCount 2133 pname:videoSessionParameters was created with 2134 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07218]] 2135 If pname:videoSessionParameters was created with the video codec 2136 operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and the 2137 pname:pNext chain of pname:pUpdateInfo includes a 2138 slink:VkVideoDecodeH264SessionParametersAddInfoKHR structure, then 2139 pname:videoSessionParameters must: not already contain a 2140 code:StdVideoH264PictureParameterSet entry with both 2141 pname:seq_parameter_set_id and pname:pic_parameter_set_id matching any 2142 of the elements of 2143 slink:VkVideoDecodeH264SessionParametersAddInfoKHR::pname:pStdPPSs 2144 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07219]] 2145 If pname:videoSessionParameters was created with the video codec 2146 operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then the 2147 number of code:StdVideoH264PictureParameterSet entries already stored in 2148 it plus the value of the pname:stdPPSCount member of the 2149 slink:VkVideoDecodeH264SessionParametersAddInfoKHR structure included in 2150 the pname:pUpdateInfo->pNext chain must: be less than or equal to the 2151 slink:VkVideoDecodeH264SessionParametersCreateInfoKHR::pname:maxStdPPSCount 2152 pname:videoSessionParameters was created with 2153endif::VK_KHR_video_decode_h264[] 2154ifdef::VK_KHR_video_decode_h265[] 2155 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07220]] 2156 If pname:videoSessionParameters was created with the video codec 2157 operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR and the 2158 pname:pNext chain of pname:pUpdateInfo includes a 2159 slink:VkVideoDecodeH265SessionParametersAddInfoKHR structure, then 2160 pname:videoSessionParameters must: not already contain a 2161 code:StdVideoH265VideoParameterSet entry with 2162 pname:vps_video_parameter_set_id matching any of the elements of 2163 slink:VkVideoDecodeH265SessionParametersAddInfoKHR::pname:pStdVPSs 2164 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07221]] 2165 If pname:videoSessionParameters was created with the video codec 2166 operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the 2167 number of code:StdVideoH265VideoParameterSet entries already stored in 2168 it plus the value of the pname:stdVPSCount member of the 2169 slink:VkVideoDecodeH265SessionParametersAddInfoKHR structure included in 2170 the pname:pUpdateInfo->pNext chain must: be less than or equal to the 2171 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR::pname:maxStdVPSCount 2172 pname:videoSessionParameters was created with 2173 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07222]] 2174 If pname:videoSessionParameters was created with the video codec 2175 operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR and the 2176 pname:pNext chain of pname:pUpdateInfo includes a 2177 slink:VkVideoDecodeH265SessionParametersAddInfoKHR structure, then 2178 pname:videoSessionParameters must: not already contain a 2179 code:StdVideoH265SequenceParameterSet entry with both 2180 pname:sps_video_parameter_set_id and pname:sps_seq_parameter_set_id 2181 matching any of the elements of 2182 slink:VkVideoDecodeH265SessionParametersAddInfoKHR::pname:pStdSPSs 2183 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07223]] 2184 If pname:videoSessionParameters was created with the video codec 2185 operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the 2186 number of code:StdVideoH265SequenceParameterSet entries already stored 2187 in it plus the value of the pname:stdSPSCount member of the 2188 slink:VkVideoDecodeH265SessionParametersAddInfoKHR structure included in 2189 the pname:pUpdateInfo->pNext chain must: be less than or equal to the 2190 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR::pname:maxStdSPSCount 2191 pname:videoSessionParameters was created with 2192 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07224]] 2193 If pname:videoSessionParameters was created with the video codec 2194 operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR and the 2195 pname:pNext chain of pname:pUpdateInfo includes a 2196 slink:VkVideoDecodeH265SessionParametersAddInfoKHR structure, then 2197 pname:videoSessionParameters must: not already contain a 2198 code:StdVideoH265PictureParameterSet entry with 2199 pname:sps_video_parameter_set_id, pname:pps_seq_parameter_set_id, and 2200 pname:pps_pic_parameter_set_id all matching any of the elements of 2201 slink:VkVideoDecodeH265SessionParametersAddInfoKHR::pname:pStdPPSs 2202 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07225]] 2203 If pname:videoSessionParameters was created with the video codec 2204 operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then the 2205 number of code:StdVideoH265PictureParameterSet entries already stored in 2206 it plus the value of the pname:stdPPSCount member of the 2207 slink:VkVideoDecodeH265SessionParametersAddInfoKHR structure included in 2208 the pname:pUpdateInfo->pNext chain must: be less than or equal to the 2209 slink:VkVideoDecodeH265SessionParametersCreateInfoKHR::pname:maxStdPPSCount 2210 pname:videoSessionParameters was created with 2211endif::VK_KHR_video_decode_h265[] 2212ifdef::VK_EXT_video_encode_h264[] 2213 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07226]] 2214 If pname:videoSessionParameters was created with the video codec 2215 operation ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT and the 2216 pname:pNext chain of pname:pUpdateInfo includes a 2217 slink:VkVideoEncodeH264SessionParametersAddInfoEXT structure, then 2218 pname:videoSessionParameters must: not already contain a 2219 code:StdVideoH264SequenceParameterSet entry with 2220 pname:seq_parameter_set_id matching any of the elements of 2221 slink:VkVideoEncodeH264SessionParametersAddInfoEXT::pname:pStdSPSs 2222 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07227]] 2223 If pname:videoSessionParameters was created with the video codec 2224 operation ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT and the 2225 pname:pNext chain of pname:pUpdateInfo includes a 2226 slink:VkVideoEncodeH264SessionParametersAddInfoEXT structure, then 2227 pname:videoSessionParameters must: not already contain a 2228 code:StdVideoH264PictureParameterSet entry with both 2229 pname:seq_parameter_set_id and pname:pic_parameter_set_id matching any 2230 of the elements of 2231 slink:VkVideoEncodeH264SessionParametersAddInfoEXT::pname:pStdPPSs 2232endif::VK_EXT_video_encode_h264[] 2233ifdef::VK_EXT_video_encode_h265[] 2234 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07228]] 2235 If pname:videoSessionParameters was created with the video codec 2236 operation ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT and the 2237 pname:pNext chain of pname:pUpdateInfo includes a 2238 slink:VkVideoEncodeH265SessionParametersAddInfoEXT structure, then 2239 pname:videoSessionParameters must: not already contain a 2240 code:StdVideoH265VideoParameterSet entry with 2241 pname:vps_video_parameter_set_id matching any of the elements of 2242 slink:VkVideoEncodeH265SessionParametersAddInfoEXT::pname:pStdVPSs 2243 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07229]] 2244 If pname:videoSessionParameters was created with the video codec 2245 operation ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT and the 2246 pname:pNext chain of pname:pUpdateInfo includes a 2247 slink:VkVideoEncodeH265SessionParametersAddInfoEXT structure, then 2248 pname:videoSessionParameters must: not already contain a 2249 code:StdVideoH265SequenceParameterSet entry with both 2250 pname:sps_video_parameter_set_id and pname:sps_seq_parameter_set_id 2251 matching any of the elements of 2252 slink:VkVideoEncodeH265SessionParametersAddInfoEXT::pname:pStdSPSs 2253 * [[VUID-vkUpdateVideoSessionParametersKHR-videoSessionParameters-07230]] 2254 If pname:videoSessionParameters was created with the video codec 2255 operation ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT and the 2256 pname:pNext chain of pname:pUpdateInfo includes a 2257 slink:VkVideoEncodeH265SessionParametersAddInfoEXT structure, then 2258 pname:videoSessionParameters must: not already contain a 2259 code:StdVideoH265PictureParameterSet entry with 2260 pname:sps_video_parameter_set_id, pname:pps_seq_parameter_set_id, and 2261 pname:pps_pic_parameter_set_id all matching any of the elements of 2262 slink:VkVideoEncodeH265SessionParametersAddInfoEXT::pname:pStdPPSs 2263endif::VK_EXT_video_encode_h265[] 2264**** 2265 2266include::{generated}/validity/protos/vkUpdateVideoSessionParametersKHR.adoc[] 2267-- 2268 2269[open,refpage='VkVideoSessionParametersUpdateInfoKHR',desc='Structure specifying video session parameters update information',type='structs'] 2270-- 2271The sname:VkVideoSessionParametersUpdateInfoKHR structure is defined as: 2272 2273include::{generated}/api/structs/VkVideoSessionParametersUpdateInfoKHR.adoc[] 2274 2275 * pname:sType is a elink:VkStructureType value identifying this structure. 2276 * pname:pNext is `NULL` or a pointer to a structure extending this 2277 structure. 2278 * pname:updateSequenceCount is the new <<video-session-parameters,update 2279 sequence count>> to set for the video session parameters object. 2280 2281include::{generated}/validity/structs/VkVideoSessionParametersUpdateInfoKHR.adoc[] 2282-- 2283 2284 2285[[video-coding-scope]] 2286== Video Coding Scope 2287 2288Applications can: record video coding commands for a video session only 2289within a video coding scope. 2290 2291[open,refpage='vkCmdBeginVideoCodingKHR',desc='Begin video coding scope',type='protos'] 2292-- 2293To begin a video coding scope, call: 2294 2295include::{generated}/api/protos/vkCmdBeginVideoCodingKHR.adoc[] 2296 2297 * pname:commandBuffer is the command buffer in which to record the 2298 command. 2299 * pname:pBeginInfo is a pointer to a slink:VkVideoBeginCodingInfoKHR 2300 structure specifying the parameters of the video coding scope, including 2301 the video session and video session parameters object to use. 2302 2303After beginning a video coding scope, the video session object specified in 2304pname:pBeginInfo->videoSession is _bound_ to the command buffer, and the 2305command buffer is ready to record video coding operations. 2306Similarly, if pname:pBeginInfo->videoSessionParameters is not 2307dname:VK_NULL_HANDLE, it is also _bound_ to the command buffer, and video 2308coding operations can: refer to the codec-specific parameters stored in it. 2309 2310[[bound-reference-picture-resources]] 2311This command also establishes the set of _bound reference picture resources_ 2312that can: be used as <<reconstructed-picture,reconstructed pictures>> or 2313<<reference-picture,reference pictures>> within the video coding scope. 2314Each element of this set consists of a <<video-picture-resources,video 2315picture resource>> and the <<dpb-slot,DPB slot>> index associated with it, 2316if there is one. 2317 2318The set of bound reference picture resources is immutable within a video 2319coding scope, however, the DPB slot index associated with any of the bound 2320reference picture resources can: change during the video coding scope in 2321response to video coding operations. 2322 2323The slink:VkVideoReferenceSlotInfoKHR structures provided as the elements of 2324pname:pBeginInfo->pReferenceSlots are interpreted by this command as 2325follows: 2326 2327 * If pname:slotIndex is non-negative and pname:pPictureResource is not 2328 `NULL`, then the <<video-picture-resources,video picture resource>> 2329 defined by the slink:VkVideoPictureResourceInfoKHR structure pointed to 2330 by pname:pPictureResource is added to the set of bound reference picture 2331 resources and is associated with the DPB slot index specified in 2332 pname:slotIndex. 2333 * If pname:slotIndex is non-negative and pname:pPictureResource is `NULL`, 2334 then the DPB slot with index pname:slotIndex is <<dpb-slot-states, 2335 deactivated>> by this command. 2336 * If pname:slotIndex is negative and pname:pPictureResource is not `NULL`, 2337 then the <<video-picture-resources,video picture resource>> defined by 2338 the slink:VkVideoPictureResourceInfoKHR structure pointed to by 2339 pname:pPictureResource is added to the set of bound reference picture 2340 resources without an associated DPB slot. 2341 Such a picture resource can: be subsequently used as a 2342 <<reconstructed-picture,reconstructed picture>> to associate it with a 2343 DPB slot. 2344 * If pname:slotIndex is negative and pname:pPictureResource is `NULL`, 2345 then the element is ignored. 2346 2347ifdef::VK_KHR_video_decode_h264[] 2348[NOTE] 2349.Note: 2350==== 2351It is possible for multiple bound reference picture resources to be 2352associated with the same DPB slot index, or for a single bound reference 2353picture to refer to multiple separate reference pictures. 2354For example, in case of an <<decode-h264-profile,H.264 decode profile>> with 2355<<decode-h264-interlaced-support,interlaced frame support>> a single DPB 2356slot can refer to two separate pictures for the top and bottom fields. 2357Depending on the picture layout used by the <<decode-h264-profile,H.264 2358decode profile>>, the following special cases may: arise: 2359 2360 * If the picture layout is 2361 ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR, 2362 then the top and bottom field pictures are physically co-located in the 2363 same video picture resource with even scanlines corresponding to the top 2364 field and odd scanlines corresponding to the bottom field, respectively. 2365 * If the picture layout is 2366 ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR, 2367 then the top and bottom field pictures are stored in separate video 2368 picture resources (in separate subregions of the same image layer, in 2369 separate layers of the same image, or in entirely separate images), 2370 hence two elements of 2371 slink:VkVideoBeginCodingInfoKHR::pname:pReferenceSlots can: contain the 2372 same pname:slotIndex but specify different video picture resources in 2373 their pname:pPictureResource members. 2374 2375==== 2376endif::VK_KHR_video_decode_h264[] 2377 2378All non-negative pname:slotIndex values specified in the elements of 2379pname:pBeginInfo->pReferenceSlots must: identify DPB slots of the video 2380session that are in the <<dpb-slot-states,active state>> at the time this 2381command is executed on the device. 2382 2383[NOTE] 2384.Note: 2385==== 2386The application does not have to specify an entry in 2387pname:pBeginInfo->pReferenceSlots corresponding to all active DPB slots of 2388the video session, but only for those which are intended to be used in the 2389video coding scope. 2390This way the application can avoid any potential runtime cost associated 2391with binding the corresponding picture resources to the command buffer. 2392==== 2393 2394.Valid Usage 2395**** 2396 * [[VUID-vkCmdBeginVideoCodingKHR-commandBuffer-07231]] 2397 The sname:VkCommandPool that pname:commandBuffer was allocated from 2398 must: support the video codec operation pname:pBeginInfo->videoSession 2399 was created with, as returned by 2400 flink:vkGetPhysicalDeviceQueueFamilyProperties2 in 2401 slink:VkQueueFamilyVideoPropertiesKHR::pname:videoCodecOperations 2402 * [[VUID-vkCmdBeginVideoCodingKHR-None-07232]] 2403 There must: be no <<queries-operation-active,active>> queries 2404 * [[VUID-vkCmdBeginVideoCodingKHR-commandBuffer-07233]] 2405 If pname:commandBuffer is an unprotected command buffer and 2406 <<limits-protectedNoFault, pname:protectedNoFault>> is not supported, 2407 then pname:pBeginInfo->videoSession must: not have been created with 2408 ename:VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR 2409 * [[VUID-vkCmdBeginVideoCodingKHR-commandBuffer-07234]] 2410 If pname:commandBuffer is a protected command buffer and 2411 <<limits-protectedNoFault, pname:protectedNoFault>> is not supported, 2412 then pname:pBeginInfo->videoSession must: have been created with 2413 ename:VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR 2414 * [[VUID-vkCmdBeginVideoCodingKHR-commandBuffer-07235]] 2415 If pname:commandBuffer is an unprotected command buffer, 2416 <<limits-protectedNoFault, pname:protectedNoFault>> is not supported, 2417 and the pname:pPictureResource member of any element of 2418 pname:pBeginInfo->pReferenceSlots is not `NULL`, then 2419 pname:pPictureResource->imageViewBinding for that element must: not 2420 specify an image view created from a protected image 2421 * [[VUID-vkCmdBeginVideoCodingKHR-commandBuffer-07236]] 2422 If pname:commandBuffer is a protected command buffer 2423 <<limits-protectedNoFault, pname:protectedNoFault>> is not supported, 2424 and the pname:pPictureResource member of any element of 2425 pname:pBeginInfo->pReferenceSlots is not `NULL`, then 2426 pname:pPictureResource->imageViewBinding for that element must: specify 2427 an image view created from a protected image 2428 * [[VUID-vkCmdBeginVideoCodingKHR-slotIndex-07239]] 2429 If the pname:slotIndex member of any element of 2430 pname:pBeginInfo->pReferenceSlots is not negative, then it must: specify 2431 the index of a DPB slot that is in the <<dpb-slot-states,active state>> 2432 in pname:pBeginInfo->videoSession at the time the command is executed on 2433 the device 2434 * [[VUID-vkCmdBeginVideoCodingKHR-pPictureResource-07265]] 2435 Each video picture resource specified by any non-`NULL` 2436 pname:pPictureResource member specified in the elements of 2437 pname:pBeginInfo->pReferenceSlots for which pname:slotIndex is not 2438 negative must: <<video-picture-resource-matching,match>> one of the 2439 video picture resources currently associated with the DPB slot index of 2440 pname:pBeginInfo->videoSession specified by pname:slotIndex at the time 2441 the command is executed on the device 2442**** 2443 2444include::{generated}/validity/protos/vkCmdBeginVideoCodingKHR.adoc[] 2445-- 2446 2447[open,refpage='VkVideoBeginCodingInfoKHR',desc='Structure specifying video coding scope begin information',type='structs'] 2448-- 2449The slink:VkVideoBeginCodingInfoKHR structure is defined as: 2450 2451include::{generated}/api/structs/VkVideoBeginCodingInfoKHR.adoc[] 2452 2453 * pname:sType is a elink:VkStructureType value identifying this structure. 2454 * pname:pNext is `NULL` or a pointer to a structure extending this 2455 structure. 2456 * pname:flags is reserved for future use. 2457 * pname:videoSession is the video session object to be bound for the 2458 processing of the video commands. 2459 * pname:videoSessionParameters is dname:VK_NULL_HANDLE or a handle of a 2460 slink:VkVideoSessionParametersKHR object to be used for the processing 2461 of the video commands. 2462 If dname:VK_NULL_HANDLE, then no video session parameters object is 2463 bound for the duration of the video coding scope. 2464 * pname:referenceSlotCount is the number of elements in the 2465 pname:pReferenceSlots array. 2466 * pname:pReferenceSlots is a pointer to an array of 2467 slink:VkVideoReferenceSlotInfoKHR structures specifying the information 2468 used to determine the set of <<bound-reference-picture-resources,bound 2469 reference picture resources>> for the video coding scope and their 2470 initial association with <<dpb-slot,DPB slot>> indices. 2471 2472Limiting values are defined below that are referenced by the relevant valid 2473usage statements of this structure. 2474 2475 * Let `VkOffset2D codedOffsetGranularity` be the minimum alignment 2476 requirement for the coded offset of video picture resources. 2477 Unless otherwise defined, the value of the pname:x and pname:y members 2478 of pname:codedOffsetGranularity are `0`. 2479ifdef::VK_KHR_video_decode_h264[] 2480 ** If pname:videoSession was created with an <<decode-h264-profile,H.264 2481 decode profile>> with a 2482 slink:VkVideoDecodeH264ProfileInfoKHR::pname:pictureLayout of 2483 ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR, 2484 then pname:codedOffsetGranularity is equal to 2485 slink:VkVideoDecodeH264CapabilitiesKHR::pname:fieldOffsetGranularity, 2486 as returned by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for that 2487 video profile. 2488endif::VK_KHR_video_decode_h264[] 2489 2490.Valid Usage 2491**** 2492 * [[VUID-VkVideoBeginCodingInfoKHR-videoSession-07237]] 2493 pname:videoSession must: have memory bound to all of its memory bindings 2494 returned by flink:vkGetVideoSessionMemoryRequirementsKHR for 2495 pname:videoSession 2496 * [[VUID-VkVideoBeginCodingInfoKHR-slotIndex-04856]] 2497 Each non-negative slink:VkVideoReferenceSlotInfoKHR::pname:slotIndex 2498 specified in the elements of pname:pReferenceSlots must: be less than 2499 the slink:VkVideoSessionCreateInfoKHR::pname:maxDpbSlots specified when 2500 pname:videoSession was created 2501 * [[VUID-VkVideoBeginCodingInfoKHR-pPictureResource-07238]] 2502 Each video picture resource corresponding to any non-`NULL` 2503 pname:pPictureResource member specified in the elements of 2504 pname:pReferenceSlots must: be <<video-picture-resource-uniqueness, 2505 unique>> within pname:pReferenceSlots 2506 * [[VUID-VkVideoBeginCodingInfoKHR-pPictureResource-07240]] 2507 If the pname:pPictureResource member of any element of 2508 pname:pReferenceSlots is not `NULL`, then the image view specified in 2509 pname:pPictureResource->imageViewBinding for that element must: be 2510 <<video-profile-compatibility,compatible>> with the video profile 2511 pname:videoSession was created with 2512 * [[VUID-VkVideoBeginCodingInfoKHR-pPictureResource-07241]] 2513 If the pname:pPictureResource member of any element of 2514 pname:pReferenceSlots is not `NULL`, then the format of the image view 2515 specified in pname:pPictureResource->imageViewBinding for that element 2516 must: match the 2517 slink:VkVideoSessionCreateInfoKHR::pname:referencePictureFormat 2518 pname:videoSession was created with 2519 * [[VUID-VkVideoBeginCodingInfoKHR-pPictureResource-07242]] 2520 If the pname:pPictureResource member of any element of 2521 pname:pReferenceSlots is not `NULL`, then its pname:codedOffset member 2522 must: be an integer multiple of pname:codedOffsetGranularity 2523 * [[VUID-VkVideoBeginCodingInfoKHR-pPictureResource-07243]] 2524 If the pname:pPictureResource member of any element of 2525 pname:pReferenceSlots is not `NULL`, then its pname:codedExtent member 2526 must: be between pname:minCodedExtent and pname:maxCodedExtent, 2527 inclusive, pname:videoSession was created with 2528 * [[VUID-VkVideoBeginCodingInfoKHR-flags-07244]] 2529 If slink:VkVideoCapabilitiesKHR::pname:flags does not include 2530 ename:VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR, as returned 2531 by flink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the video profile 2532 pname:videoSession was created with, then 2533 pname:pPictureResource->imageViewBinding of all elements of 2534 pname:pReferenceSlots with a non-`NULL` pname:pPictureResource member 2535 must: specify image views created from the same image 2536ifdef::VK_KHR_video_decode_queue[] 2537 * [[VUID-VkVideoBeginCodingInfoKHR-slotIndex-07245]] 2538 If pname:videoSession was created with a decode operation and the 2539 pname:slotIndex member of any element of pname:pReferenceSlots is not 2540 negative, then the image view specified in 2541 pname:pPictureResource->imageViewBinding for that element must: have 2542 been created with ename:VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR 2543endif::VK_KHR_video_decode_queue[] 2544ifdef::VK_KHR_video_encode_queue[] 2545 * [[VUID-VkVideoBeginCodingInfoKHR-slotIndex-07246]] 2546 If pname:videoSession was created with an encode operation and the 2547 pname:slotIndex member of any element of pname:pReferenceSlots is not 2548 negative, then the image view specified in 2549 pname:pPictureResource->imageViewBinding for that element must: have 2550 been created with ename:VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR 2551endif::VK_KHR_video_encode_queue[] 2552ifdef::VK_KHR_video_decode_h264[] 2553 * [[VUID-VkVideoBeginCodingInfoKHR-videoSession-07247]] 2554 If pname:videoSession was created with the video codec operation 2555 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then 2556 pname:videoSessionParameters must: not be dname:VK_NULL_HANDLE 2557endif::VK_KHR_video_decode_h264[] 2558ifdef::VK_KHR_video_decode_h265[] 2559 * [[VUID-VkVideoBeginCodingInfoKHR-videoSession-07248]] 2560 If pname:videoSession was created with the video codec operation 2561 ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then 2562 pname:videoSessionParameters must: not be dname:VK_NULL_HANDLE 2563endif::VK_KHR_video_decode_h265[] 2564ifdef::VK_EXT_video_encode_h264[] 2565 * [[VUID-VkVideoBeginCodingInfoKHR-videoSession-07249]] 2566 If pname:videoSession was created with the video codec operation 2567 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT, then 2568 pname:videoSessionParameters must: not be dname:VK_NULL_HANDLE 2569endif::VK_EXT_video_encode_h264[] 2570ifdef::VK_EXT_video_encode_h265[] 2571 * [[VUID-VkVideoBeginCodingInfoKHR-videoSession-07250]] 2572 If pname:videoSession was created with the video codec operation 2573 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT, then 2574 pname:videoSessionParameters must: not be dname:VK_NULL_HANDLE 2575endif::VK_EXT_video_encode_h265[] 2576 * [[VUID-VkVideoBeginCodingInfoKHR-videoSessionParameters-04857]] 2577 If pname:videoSessionParameters is not dname:VK_NULL_HANDLE, it must: 2578 have been created with pname:videoSession specified in 2579 slink:VkVideoSessionParametersCreateInfoKHR::pname:videoSession 2580**** 2581 2582include::{generated}/validity/structs/VkVideoBeginCodingInfoKHR.adoc[] 2583-- 2584 2585[open,refpage='VkVideoBeginCodingFlagsKHR',desc='Reserved for future use',type='flags'] 2586-- 2587include::{generated}/api/flags/VkVideoBeginCodingFlagsKHR.adoc[] 2588 2589tname:VkVideoBeginCodingFlagsKHR is a bitmask type for setting a mask, but 2590is currently reserved for future use. 2591-- 2592 2593[open,refpage='VkVideoReferenceSlotInfoKHR',desc='Structure specifying information about a reference picture slot',type='structs'] 2594-- 2595The sname:VkVideoReferenceSlotInfoKHR structure is defined as: 2596 2597include::{generated}/api/structs/VkVideoReferenceSlotInfoKHR.adoc[] 2598 2599 * pname:sType is a elink:VkStructureType value identifying this structure. 2600 * pname:pNext is `NULL` or a pointer to a structure extending this 2601 structure. 2602 * pname:slotIndex is the index of the <<dpb-slot, DPB slot>> or a negative 2603 integer value. 2604 * pname:pPictureResource is `NULL` or a pointer to a 2605 slink:VkVideoPictureResourceInfoKHR structure describing the 2606 <<video-picture-resources,video picture resource>> associated with the 2607 DPB slot index specified by pname:slotIndex. 2608 2609include::{generated}/validity/structs/VkVideoReferenceSlotInfoKHR.adoc[] 2610-- 2611 2612[open,refpage='vkCmdEndVideoCodingKHR',desc='End video coding scope',type='protos'] 2613-- 2614To end a video coding scope, call: 2615 2616include::{generated}/api/protos/vkCmdEndVideoCodingKHR.adoc[] 2617 2618 * pname:commandBuffer is the command buffer in which to record the 2619 command. 2620 * pname:pEndCodingInfo is a pointer to a slink:VkVideoEndCodingInfoKHR 2621 structure specifying the parameters for ending the video coding scope. 2622 2623After ending a video coding scope, the video session object, the optional 2624video session parameters object, and all 2625<<bound-reference-picture-resources, reference picture resources>> 2626previously bound by the corresponding flink:vkCmdBeginVideoCodingKHR command 2627are _unbound_. 2628 2629.Valid Usage 2630**** 2631 * [[VUID-vkCmdEndVideoCodingKHR-None-07251]] 2632 There must: be no <<queries-operation-active,active>> queries 2633**** 2634 2635include::{generated}/validity/protos/vkCmdEndVideoCodingKHR.adoc[] 2636-- 2637 2638[open,refpage='VkVideoEndCodingInfoKHR',desc='Structure specifying video coding scope end information',type='structs'] 2639-- 2640The sname:VkVideoEndCodingInfoKHR structure is defined as: 2641 2642include::{generated}/api/structs/VkVideoEndCodingInfoKHR.adoc[] 2643 2644 * pname:sType is a elink:VkStructureType value identifying this structure. 2645 * pname:pNext is `NULL` or a pointer to a structure extending this 2646 structure. 2647 * pname:flags is reserved for future use. 2648 2649include::{generated}/validity/structs/VkVideoEndCodingInfoKHR.adoc[] 2650-- 2651 2652[open,refpage='VkVideoEndCodingFlagsKHR',desc='Reserved for future use',type='flags'] 2653-- 2654include::{generated}/api/flags/VkVideoEndCodingFlagsKHR.adoc[] 2655 2656tname:VkVideoEndCodingFlagsKHR is a bitmask type for setting a mask, but is 2657currently reserved for future use. 2658-- 2659 2660 2661[[video-coding-control]] 2662== Video Coding Control 2663 2664[open,refpage='vkCmdControlVideoCodingKHR',desc='Control video coding parameters',type='protos'] 2665-- 2666To apply dynamic controls to the currently bound video session object, call: 2667 2668include::{generated}/api/protos/vkCmdControlVideoCodingKHR.adoc[] 2669 2670 * pname:commandBuffer is the command buffer in which to record the 2671 command. 2672 * pname:pCodingControlInfo is a pointer to a 2673 slink:VkVideoCodingControlInfoKHR structure specifying the control 2674 parameters. 2675 2676The control parameters provided in this call are applied to the video 2677session at the time the command executes on the device and are in effect 2678until a subsequent call to this command with the same video session bound 2679changes the corresponding control parameters. 2680 2681A newly created video session must: be reset before performing video coding 2682operations using it by including ename:VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR 2683in pname:pCodingControlInfo->flags. 2684The reset operation also returns all DPB slots of the video session to the 2685<<dpb-slot-states,inactive state>>. 2686Correspondingly, any DPB slot index associated with the 2687<<bound-reference-picture-resources,bound reference picture resources>> is 2688removed. 2689 2690ifdef::VK_KHR_video_encode_queue[] 2691For encode sessions, the reset operation returns rate control configuration 2692to implementation default settings and sets the video encode quality level 2693to zero. 2694endif::VK_KHR_video_encode_queue[] 2695 2696After video coding operations are performed using a video session, the reset 2697operation can: be used to return the video session to the same _initial_ 2698state as after the reset of a newly created video session. 2699This can: be used, for example, when different video sequences are needed to 2700be processed with the same video session object. 2701 2702.Valid Usage 2703**** 2704 * [[VUID-vkCmdControlVideoCodingKHR-flags-07017]] 2705 If pname:pCodingControlInfo->flags does not include 2706 ename:VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR, then the bound video 2707 session must: not be in <<video-session-uninitialized,uninitialized>> 2708 state at the time the command is executed on the device 2709**** 2710 2711include::{generated}/validity/protos/vkCmdControlVideoCodingKHR.adoc[] 2712-- 2713 2714[open,refpage='VkVideoCodingControlInfoKHR',desc='Structure specifying video coding control parameters',type='structs'] 2715-- 2716The sname:VkVideoCodingControlInfoKHR structure is defined as: 2717 2718include::{generated}/api/structs/VkVideoCodingControlInfoKHR.adoc[] 2719 2720 * pname:sType is a elink:VkStructureType value identifying this structure. 2721 * pname:pNext is `NULL` or a pointer to a structure extending this 2722 structure. 2723 * pname:flags is a bitmask of tlink:VkVideoCodingControlFlagsKHR 2724 specifying control flags. 2725 2726.Valid Usage 2727**** 2728ifdef::VK_KHR_video_encode_queue[] 2729 * [[VUID-VkVideoCodingControlInfoKHR-flags-07018]] 2730 If pname:flags includes 2731 ename:VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR, then the 2732 pname:pNext chain must: include a slink:VkVideoEncodeRateControlInfoKHR 2733 structure 2734endif::VK_KHR_video_encode_queue[] 2735ifdef::VK_EXT_video_encode_h264[] 2736 * [[VUID-VkVideoCodingControlInfoKHR-flags-07021]] 2737 If pname:flags includes 2738 ename:VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR, the 2739 pname:rateControlMode member of slink:VkVideoEncodeRateControlInfoKHR 2740 included in the pname:pNext chain is not 2741 ename:VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR or 2742 ename:VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR, and the bound 2743 video session was created with the video codec operation 2744 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT, then the pname:pNext 2745 chain must: include a slink:VkVideoEncodeH264RateControlInfoEXT 2746 structure 2747 * [[VUID-VkVideoCodingControlInfoKHR-pNext-07022]] 2748 If the pname:pNext chain includes a 2749 slink:VkVideoEncodeRateControlInfoKHR, and 2750 slink:VkVideoEncodeRateControlInfoKHR::pname:layerCount is greater than 2751 `1`, then 2752 slink:VkVideoEncodeH264RateControlInfoEXT::pname:temporalLayerCount 2753 must: be equal to pname:layerCount 2754endif::VK_EXT_video_encode_h264[] 2755ifdef::VK_EXT_video_encode_h265[] 2756 * [[VUID-VkVideoCodingControlInfoKHR-flags-07024]] 2757 If pname:flags includes 2758 ename:VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR, the 2759 pname:rateControlMode member of slink:VkVideoEncodeRateControlInfoKHR 2760 included in the pname:pNext chain is not 2761 ename:VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR or 2762 ename:VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR, and the bound 2763 video session was created with the video codec operation 2764 ename:VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT, then the pname:pNext 2765 chain must: include a slink:VkVideoEncodeH265RateControlInfoEXT 2766 structure 2767 * [[VUID-VkVideoCodingControlInfoKHR-pNext-07025]] 2768 If the pname:pNext chain includes a 2769 slink:VkVideoEncodeRateControlInfoKHR, and 2770 slink:VkVideoEncodeRateControlInfoKHR::pname:layerCount is greater than 2771 `1`, then slink:VkVideoEncodeH265RateControlInfoEXT::pname:subLayerCount 2772 must: be equal to pname:layerCount 2773endif::VK_EXT_video_encode_h265[] 2774**** 2775 2776include::{generated}/validity/structs/VkVideoCodingControlInfoKHR.adoc[] 2777-- 2778 2779[open,refpage='VkVideoCodingControlFlagBitsKHR',desc='Video coding control flags',type='enums'] 2780-- 2781Bits which can: be set in slink:VkVideoCodingControlInfoKHR::pname:flags, 2782specifying the video coding control parameters to be modified, are: 2783 2784include::{generated}/api/enums/VkVideoCodingControlFlagBitsKHR.adoc[] 2785 2786 * ename:VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR indicates a request for the 2787 bound video session to be reset before other coding control parameters 2788 are applied. 2789ifdef::VK_KHR_video_encode_queue[] 2790 * ename:VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR indicates that 2791 the coding control parameters include video encode rate control 2792 parameters (see slink:VkVideoEncodeRateControlInfoKHR). 2793 * ename:VK_VIDEO_CODING_CONTROL_ENCODE_QUALITY_LEVEL_BIT_KHR indicates 2794 that the coding control parameters include video encode quality level 2795 parameters (see slink:VkVideoEncodeQualityLevelInfoKHR). 2796endif::VK_KHR_video_encode_queue[] 2797-- 2798 2799[open,refpage='VkVideoCodingControlFlagsKHR',desc='Bitmask of VkVideoCodingControlFlagBitsKHR',type='flags'] 2800-- 2801include::{generated}/api/flags/VkVideoCodingControlFlagsKHR.adoc[] 2802 2803tname:VkVideoCodingControlFlagsKHR is a bitmask type for setting a mask of 2804zero or more elink:VkVideoCodingControlFlagBitsKHR. 2805-- 2806 2807 2808ifdef::VK_KHR_video_decode_queue[] 2809include::{chapters}/video_decode_extensions.adoc[] 2810endif::VK_KHR_video_decode_queue[] 2811 2812ifdef::VK_KHR_video_decode_h264[] 2813include::{chapters}/video_decode_h264_extensions.adoc[] 2814endif::VK_KHR_video_decode_h264[] 2815 2816ifdef::VK_KHR_video_decode_h265[] 2817include::{chapters}/video_decode_h265_extensions.adoc[] 2818endif::VK_KHR_video_decode_h265[] 2819 2820ifdef::VK_KHR_video_encode_queue[] 2821include::{chapters}/video_encode_extensions.adoc[] 2822endif::VK_KHR_video_encode_queue[] 2823 2824ifdef::VK_EXT_video_encode_h264[] 2825include::{chapters}/video_encode_h264_extensions.adoc[] 2826endif::VK_EXT_video_encode_h264[] 2827 2828ifdef::VK_EXT_video_encode_h265[] 2829include::{chapters}/video_encode_h265_extensions.adoc[] 2830endif::VK_EXT_video_encode_h265[] 2831