VkVideoEncodeCapabilitiesKHR(3)

# VkVideoEncodeCapabilitiesKHR(3) Manual Page

## Name

VkVideoEncodeCapabilitiesKHR - Structure specifying encode capabilities

Loading… please wait.

## C Specification

When calling vkGetPhysicalDeviceVideoCapabilitiesKHR with `pVideoProfile->videoCodecOperation` specified as one of the encode operation bits, the VkVideoEncodeCapabilitiesKHR structure must be included in the `pNext` chain of the VkVideoCapabilitiesKHR structure to retrieve capabilities specific to video encoding.

The `VkVideoEncodeCapabilitiesKHR` structure is defined as:

    // Provided by VK_KHR_video_encode_queue
    typedef struct VkVideoEncodeCapabilitiesKHR {
        VkStructureType                         sType;
        void*                                   pNext;
        VkVideoEncodeCapabilityFlagsKHR         flags;
        VkVideoEncodeRateControlModeFlagsKHR    rateControlModes;
        uint8_t                                 rateControlLayerCount;
        uint8_t                                 qualityLevelCount;
        VkExtent2D                              inputImageDataFillAlignment;
    } VkVideoEncodeCapabilitiesKHR;

## Members

- `sType` is the type of this structure.

- `pNext` is `NULL` or a pointer to a structure extending this structure.

- `flags` is a bitmask of VkVideoEncodeCapabilityFlagBitsKHR describing supported encoding features.

- `rateControlModes` is a bitmask of VkVideoEncodeRateControlModeFlagBitsKHR describing supported rate control modes. All implementations must support `VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR`.

- `rateControlLayerCount` reports the maximum number of rate control layers supported. Implementations must report at least 1.

- `qualityLevelCount` is the number of discrete quality levels supported. Implementations must report at least 1.

- `inputImageDataFillAlignment` reports alignment of data that should be filled in the input image horizontally and vertically in pixels before encode operations are performed on the input image.

## Description

The input content and encode resolution (specified in VkVideoEncodeInfoKHR::`codedExtent`) may not be aligned with the codec-specific coding block size. For example, the input content may be 1920x1080 and the coding block size may be 16x16 pixel blocks. In this example, the content is horizontally aligned with the coding block size, but not vertically aligned with the coding block size. Encoding of the last row of blocks may be impacted by contents of the input image in pixel rows 1081 to 1088 (the next vertical alignment with the coding block size). In general, to ensure efficient encoding for the last row/column of blocks, and/or to ensure consistent encoding results between repeated encoding of the same input content, these extra pixel rows/columns should be filled to known values up to the coding block size alignment before encoding operations are performed. Some implementations support performing auto-fill of unaligned pixels beyond a specific alignment, which is reported in `inputImageDataFillAlignment`. For example, if an implementation reports 1x1 in `inputImageDataFillAlignment`, then the implementation will perform auto-fill for any unaligned pixels beyond the encode resolution up to the next coding block size. For a coding block size of 16x16, if the implementation reports 16x16 in `inputImageDataFillAlignment`, then it is the application’s responsibility to fill any unaligned pixels, if desired. If not, it may impact the encoding efficiency, but it will not affect the validity of the generated bitstream. If the implementation reports 8x8 in `inputImageDataFillAlignment`, then for the 1920x1080 example, since the content is aligned to 8 pixels vertically, the implementation will auto-fill pixel rows 1081 to 1088 (up to the 16x16 coding block size in the example). The auto-fill value(s) are implementation-specific. The auto-fill value(s) are not written to the input image memory, but are used as part of the encoding operation on the input image.

Valid Usage (Implicit)

- VUID-VkVideoEncodeCapabilitiesKHR-sType-sType
  `sType` must be `VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR`

## See Also

VK_KHR_video_encode_queue, VkExtent2D, VkStructureType, VkVideoEncodeCapabilityFlagsKHR, VkVideoEncodeRateControlModeFlagsKHR

## 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.

## Copyright

Copyright 2014-2022 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0