C Specification
The VkVideoEncodeInfoKHR
structure is defined as:
// Provided by VK_KHR_video_encode_queue
typedef struct VkVideoEncodeInfoKHR {
VkStructureType sType;
const void* pNext;
VkVideoEncodeFlagsKHR flags;
VkBuffer dstBuffer;
VkDeviceSize dstBufferOffset;
VkDeviceSize dstBufferRange;
VkVideoPictureResourceInfoKHR srcPictureResource;
const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot;
uint32_t referenceSlotCount;
const VkVideoReferenceSlotInfoKHR* pReferenceSlots;
uint32_t precedingExternallyEncodedBytes;
} VkVideoEncodeInfoKHR;
Members
-
sType
is a VkStructureType value identifying this structure. -
pNext
is a pointer to a structure extending this structure. A codec-specific extension structure must be chained to specify what bitstream unit to generate with this encode operation. -
flags
is reserved for future use. -
dstBuffer
is the destination video bitstream buffer to write the encoded bitstream to. -
dstBufferOffset
is the starting offset in bytes from the start ofdstBuffer
to write the encoded bitstream to.dstBufferOffset
’s value must be aligned to VkVideoCapabilitiesKHR::minBitstreamBufferOffsetAlignment
, as reported by the implementation. -
dstBufferRange
is the maximum size in bytes of the encoded bitstream written todstBuffer
, starting fromdstBufferOffset
.dstBufferRange
’s value must be aligned to VkVideoCapabilitiesKHR::minBitstreamBufferSizeAlignment
, as reported by the implementation. -
srcPictureResource
is the Picture Resource of the Input Picture to be encoded by the operation. -
pSetupReferenceSlot
is a pointer to a VkVideoReferenceSlotInfoKHR structure used for generating a reconstructed reference slot and Picture Resource.pSetupReferenceSlot->slotIndex
specifies the slot index number to use as a target for producing the Reconstructed (DPB) data.pSetupReferenceSlot
must be one of the entries provided in VkVideoBeginCodingInfoKHR via thepReferenceSlots
within the vkCmdBeginVideoCodingKHR command that established the Vulkan Video Encode Context for this command. -
referenceSlotCount
is the number of Reconstructed Reference Pictures that will be used when this encoding operation is executing. -
pReferenceSlots
isNULL
or a pointer to an array of VkVideoReferenceSlotInfoKHR structures that will be used when this encoding operation is executing. Each entry inpReferenceSlots
must be one of the entries provided in VkVideoBeginCodingInfoKHR via thepReferenceSlots
within the vkCmdBeginVideoCodingKHR command that established the Vulkan Video Encode Context for this command. -
precedingExternallyEncodedBytes
is the number of bytes externally encoded for insertion in the active video encode session overall bitstream prior to the bitstream that will be generated by the implementation for this instance ofVkVideoEncodeInfoKHR
. The value provided is used to update the implementation’s rate control algorithm for the rate control layer this instance ofVkVideoEncodeInfoKHR
belongs to, by accounting for the bitrate budget consumed by these externally encoded bytes. See VkVideoEncodeRateControlInfoKHR for additional information about encode rate control.
Description
The coded size of the encode operation is specified in codedExtent
of
srcPictureResource
.
Multiple vkCmdEncodeVideoKHR commands may be recorded within a Vulkan
Video Encode Context.
The execution of each vkCmdEncodeVideoKHR command will result in
generating codec-specific bitstream units.
These bitstream units are generated consecutively into the bitstream buffer
specified in dstBuffer
of a VkVideoEncodeInfoKHR
structure
within the vkCmdBeginVideoCodingKHR command.
The produced bitstream is the sum of all these bitstream units, including
any padding between the bitstream units.
Any bitstream padding must be filled with data compliant to the codec
standard so as not to cause any syntax errors during decoding of the
bitstream units with the padding included.
The range of the bitstream buffer written can be queried via
video encode feedback queries.
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.