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
-
sTypeis a VkStructureType value identifying this structure. -
pNextis 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. -
flagsis reserved for future use. -
dstBufferis the destination video bitstream buffer to write the encoded bitstream to. -
dstBufferOffsetis the starting offset in bytes from the start ofdstBufferto write the encoded bitstream to.dstBufferOffset’s value must be aligned to VkVideoCapabilitiesKHR::minBitstreamBufferOffsetAlignment, as reported by the implementation. -
dstBufferRangeis 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. -
srcPictureResourceis the Picture Resource of the Input Picture to be encoded by the operation. -
pSetupReferenceSlotis a pointer to a VkVideoReferenceSlotInfoKHR structure used for generating a reconstructed reference slot and Picture Resource.pSetupReferenceSlot->slotIndexspecifies the slot index number to use as a target for producing the Reconstructed (DPB) data.pSetupReferenceSlotmust be one of the entries provided in VkVideoBeginCodingInfoKHR via thepReferenceSlotswithin the vkCmdBeginVideoCodingKHR command that established the Vulkan Video Encode Context for this command. -
referenceSlotCountis the number of Reconstructed Reference Pictures that will be used when this encoding operation is executing. -
pReferenceSlotsisNULLor a pointer to an array of VkVideoReferenceSlotInfoKHR structures that will be used when this encoding operation is executing. Each entry inpReferenceSlotsmust be one of the entries provided in VkVideoBeginCodingInfoKHR via thepReferenceSlotswithin the vkCmdBeginVideoCodingKHR command that established the Vulkan Video Encode Context for this command. -
precedingExternallyEncodedBytesis 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 ofVkVideoEncodeInfoKHRbelongs 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.