Enum

VkVideoEncodeFeedbackFlagBitsKHR

Bits specifying queried video encode feedback values

Bits which can be set in VkQueryPoolVideoEncodeFeedbackCreateInfoKHR::encodeFeedbackFlags for video encode feedback query pools are:

typedef enum VkVideoEncodeFeedbackFlagBitsKHR {
    VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR = 0x00000001,
    VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR = 0x00000002,
    VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR = 0x00000004,
    // Provided by extensions
    VK_VIDEO_ENCODE_FEEDBACK_AVERAGE_QUANTIZATION_BIT_KHR = 0x00000008,
    VK_VIDEO_ENCODE_FEEDBACK_MIN_QUANTIZATION_BIT_KHR = 0x00000010,
    VK_VIDEO_ENCODE_FEEDBACK_MAX_QUANTIZATION_BIT_KHR = 0x00000020,
    VK_VIDEO_ENCODE_FEEDBACK_INTRA_PIXELS_BIT_KHR = 0x00000040,
    VK_VIDEO_ENCODE_FEEDBACK_INTER_PIXELS_BIT_KHR = 0x00000080,
    VK_VIDEO_ENCODE_FEEDBACK_SKIPPED_PIXELS_BIT_KHR = 0x00000100,
    VK_VIDEO_ENCODE_FEEDBACK_PICTURE_PARTITION_COUNT_BIT_KHR = 0x00000200,
} VkVideoEncodeFeedbackFlagBitsKHR;
  • VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR specifies that queries managed by the pool will capture the byte offset of the bitstream data written by the video encode operation to the bitstream buffer specified in VkVideoEncodeInfoKHR::dstBuffer relative to the offset specified in VkVideoEncodeInfoKHR::dstBufferOffset. For the first video encode operation issued by any video encode command, this value will always be zero, meaning that bitstream data is always written to the buffer specified in VkVideoEncodeInfoKHR::dstBuffer starting from the offset specified in VkVideoEncodeInfoKHR::dstBufferOffset.
  • VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR specifies that queries managed by the pool will capture the number of bytes written by the video encode operation to the bitstream buffer specified in VkVideoEncodeInfoKHR::dstBuffer.
  • VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR specifies that queries managed by the pool will capture a boolean value indicating that the data written to the bitstream buffer specified in VkVideoEncodeInfoKHR::dstBuffer contains overridden parameters.
  • VK_VIDEO_ENCODE_FEEDBACK_AVERAGE_QUANTIZATION_BIT_KHR specifies that queries managed by the pool will capture the average quantization used across the encoded coding blocks.
  • VK_VIDEO_ENCODE_FEEDBACK_MIN_QUANTIZATION_BIT_KHR specifies that queries managed by the pool will capture the minimum quantization used across the encoded coding blocks.
  • VK_VIDEO_ENCODE_FEEDBACK_MAX_QUANTIZATION_BIT_KHR specifies that queries managed by the pool will capture the maximum quantization used across the encoded coding blocks.
  • VK_VIDEO_ENCODE_FEEDBACK_INTRA_PIXELS_BIT_KHR specifies that queries managed by the pool will capture the number of pixels encoded as intra blocks, including or excluding any skipped blocks, as described below.
  • VK_VIDEO_ENCODE_FEEDBACK_INTER_PIXELS_BIT_KHR specifies that queries managed by the pool will capture the number of pixels encoded as inter blocks, including or excluding any skipped blocks, as described below.
  • VK_VIDEO_ENCODE_FEEDBACK_SKIPPED_PIXELS_BIT_KHR specifies that queries managed by the pool will capture the number of pixels encoded as skipped blocks.
  • VK_VIDEO_ENCODE_FEEDBACK_PICTURE_PARTITION_COUNT_BIT_KHR specifies that queries managed by the pool will capture the number of encoded picture partitions.

The average, minimum, and maximum quantization values captured when VK_VIDEO_ENCODE_FEEDBACK_AVERAGE_QUANTIZATION_BIT_KHR, VK_VIDEO_ENCODE_FEEDBACK_MIN_QUANTIZATION_BIT_KHR, and/or VK_VIDEO_ENCODE_FEEDBACK_MAX_QUANTIZATION_BIT_KHR are specified, respectively, depend on the used video profile:

  • In case of H.264 encode profiles, this value is a signed integer indicating the average, minimum, or maximum QP used across the encoded coding blocks, respectively.
  • In case of H.265 encode profiles this value is a signed integer indicating the average, minimum, or maximum QP used across the encoded coding blocks, respectively.
  • In case of AV1 encode profiles this value is an unsigned integer indicating the average, minimum, or maximum quantizer index used across the encoded coding blocks, respectively.

The rounding mode used to calculate the average value captured when VK_VIDEO_ENCODE_FEEDBACK_AVERAGE_QUANTIZATION_BIT_KHR is specified is undefined.

The number of pixels captured when VK_VIDEO_ENCODE_FEEDBACK_INTRA_PIXELS_BIT_KHR, VK_VIDEO_ENCODE_FEEDBACK_INTER_PIXELS_BIT_KHR, and/or VK_VIDEO_ENCODE_FEEDBACK_SKIPPED_PIXELS_BIT_KHR are specified include padding pixels beyond the requested coded extent that are part of the complete coding blocks encoded for the picture.

If VK_VIDEO_ENCODE_FEEDBACK_SKIPPED_PIXELS_BIT_KHR is not supported for a video encode profile, then the results captured for VK_VIDEO_ENCODE_FEEDBACK_INTRA_PIXELS_BIT_KHR and VK_VIDEO_ENCODE_FEEDBACK_INTER_PIXELS_BIT_KHR will always include pixels in any intra or inter blocks, respectively, that are encoded as skipped blocks. Otherwise, the behavior depends on the used video profile:

  • In case of H.264 encode profiles, skipped blocks are always inter blocks and the results captured for VK_VIDEO_ENCODE_FEEDBACK_INTER_PIXELS_BIT_KHR will always include pixels encoded as skipped blocks.
    Implementations that would otherwise not count skipped pixels as inter pixels can simply sum the captured non-skipped inter pixel count and skipped pixel counts in the reported value for VK_VIDEO_ENCODE_FEEDBACK_INTER_PIXELS_BIT_KHR.
  • In case of H.265 encode profiles, skipped blocks are always inter blocks and the results captured for VK_VIDEO_ENCODE_FEEDBACK_INTER_PIXELS_BIT_KHR will always include pixels encoded as skipped blocks.
    Implementations that would otherwise not count skipped pixels as inter pixels can simply sum the captured non-skipped inter pixel count and skipped pixel counts in the reported value for VK_VIDEO_ENCODE_FEEDBACK_INTER_PIXELS_BIT_KHR.
  • In case of AV1 encode profiles, both inter and intra blocks can be skipped blocks. Implementations should include any pixels encoded as skipped intra or inter blocks in the results captured for VK_VIDEO_ENCODE_FEEDBACK_INTRA_PIXELS_BIT_KHR and VK_VIDEO_ENCODE_FEEDBACK_INTER_PIXELS_BIT_KHR, respectively, if possible. However, some implementations may not be able to do so if they do not differentiate between skipped intra and inter blocks. Therefore, in case of AV1 encode profiles that do support VK_VIDEO_ENCODE_FEEDBACK_SKIPPED_PIXELS_BIT_KHR implementations must either include skipped pixels part of intra and inter blocks in both or neither of the results captured by VK_VIDEO_ENCODE_FEEDBACK_INTRA_PIXELS_BIT_KHR and VK_VIDEO_ENCODE_FEEDBACK_INTER_PIXELS_BIT_KHR, respectively.
    Applications can detect whether the reported intra and inter pixel counts include the skipped pixels or not, by checking whether the sum of the intra and pixel pixels adds up to the coded extent padded to entire coding blocks.

When retrieving the results of video encode feedback queries, the values corresponding to each enabled video encode feedback are written in the order of the bits defined above, followed by an optional value indicating availability or result status if VK_QUERY_RESULT_WITH_AVAILABILITY_BIT or VK_QUERY_RESULT_WITH_STATUS_BIT_KHR is specified, respectively. If per picture partition feedback is enabled, this is followed by the values corresponding to each enabled per picture partition video encode feedback for each encoded picture partition but at most for VkQueryPoolVideoEncodePerPartitionFeedbackCreateInfoKHR::maxPerPartitionFeedbackEntries number of picture partitions, in picture-partition-major order.

If the result status of a video encode feedback query is negative, then the results of all enabled video encode feedback values will be undefined.

Applications should always specify VK_QUERY_RESULT_WITH_STATUS_BIT_KHR when retrieving the results of video encode feedback queries and ignore such undefined video encode feedback values for any unsuccessfully completed video encode operations.