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;
uint32_t qualityLevel;
VkBuffer dstBitstreamBuffer;
VkDeviceSize dstBitstreamBufferOffset;
VkDeviceSize dstBitstreamBufferMaxRange;
VkVideoPictureResourceKHR srcPictureResource;
const VkVideoReferenceSlotKHR* pSetupReferenceSlot;
uint32_t referenceSlotCount;
const VkVideoReferenceSlotKHR* pReferenceSlots;
uint32_t precedingExternallyEncodedBytes;
} VkVideoEncodeInfoKHR;
Members
-
sType
is the type of 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 a bitmask of VkVideoEncodeFlagBitsKHR specifying encode flags, and is reserved for future versions of this specification. -
qualityLevel
is the coding quality level of the encoding. It is defined by the codec-specific extensions. -
dstBitstreamBuffer
is the buffer where the encoded bitstream output will be produced. -
dstBitstreamBufferOffset
is the offset in thedstBitstreamBuffer
where the encoded bitstream output will start.dstBitstreamBufferOffset
’s value must be aligned to VkVideoCapabilitiesKHR::minBitstreamBufferOffsetAlignment
, as reported by the implementation. -
dstBitstreamBufferMaxRange
is the maximum size of thedstBitstreamBuffer
that can be used while the encoded bitstream output is produced.dstBitstreamBufferMaxRange
’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 VkVideoReferenceSlotKHR 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 VkVideoReferenceSlotKHR 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
. Valid when VkVideoEncodeRateControlInfoKHR::rateControlMode
is notVK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR
. 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 dstBitstreamBuffer
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 bitstream buffer
range 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.