Class VkVideoEncodeCapabilitiesKHR

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkVideoEncodeCapabilitiesKHR>
org.lwjgl.vulkan.VkVideoEncodeCapabilitiesKHR
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class VkVideoEncodeCapabilitiesKHR extends org.lwjgl.system.Struct<VkVideoEncodeCapabilitiesKHR> implements org.lwjgl.system.NativeResource
Structure specifying encode capabilities.
Description

Implementations must include support for at least VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR and VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR in supportedEncodeFeedbackFlags.

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 for the purposes of encoding, which is reported in encodeInputPictureGranularity. For example, if an implementation reports 1x1 in encodeInputPictureGranularity, 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 encodeInputPictureGranularity, then it is the application’s responsibility to fill any unaligned pixels, if desired. When the application does not fill these unaligned pixels, there may be an impact on the encoding efficiency but there will be no effect on the validity of the generated bitstream. If the implementation reports 8x8 in encodeInputPictureGranularity, 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)
See Also

VkExtent2D

Layout


 struct VkVideoEncodeCapabilitiesKHR {
     VkStructureType sType();
     void * pNext();
     VkVideoEncodeCapabilityFlagsKHR flags();
     VkVideoEncodeRateControlModeFlagsKHR rateControlModes();
     uint32_t maxRateControlLayers();
     uint64_t maxBitrate();
     uint32_t maxQualityLevels();
     VkExtent2D encodeInputPictureGranularity();
     VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags();
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • STYPE

      public static final int STYPE
      The struct member offsets.
    • PNEXT

      public static final int PNEXT
      The struct member offsets.
    • FLAGS

      public static final int FLAGS
      The struct member offsets.
    • RATECONTROLMODES

      public static final int RATECONTROLMODES
      The struct member offsets.
    • MAXRATECONTROLLAYERS

      public static final int MAXRATECONTROLLAYERS
      The struct member offsets.
    • MAXBITRATE

      public static final int MAXBITRATE
      The struct member offsets.
    • MAXQUALITYLEVELS

      public static final int MAXQUALITYLEVELS
      The struct member offsets.
    • ENCODEINPUTPICTUREGRANULARITY

      public static final int ENCODEINPUTPICTUREGRANULARITY
      The struct member offsets.
    • SUPPORTEDENCODEFEEDBACKFLAGS

      public static final int SUPPORTEDENCODEFEEDBACKFLAGS
      The struct member offsets.
  • Constructor Details

    • VkVideoEncodeCapabilitiesKHR

      public VkVideoEncodeCapabilitiesKHR(ByteBuffer container)
      Creates a VkVideoEncodeCapabilitiesKHR instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<VkVideoEncodeCapabilitiesKHR>
    • sType

      public int sType()
      a VkStructureType value identifying this structure.
    • pNext

      public long pNext()
      NULL or a pointer to a structure extending this structure.
    • flags

      public int flags()
      a bitmask of VkVideoEncodeCapabilityFlagBitsKHR describing supported encoding features.
    • rateControlModes

      public int rateControlModes()
      a bitmask of VkVideoEncodeRateControlModeFlagBitsKHR indicating supported rate control modes.
    • maxRateControlLayers

      public int maxRateControlLayers()
      indicates the maximum number of rate control layers supported.
    • maxBitrate

      public long maxBitrate()
      indicates the maximum supported bitrate.
    • maxQualityLevels

      public int maxQualityLevels()
      indicates the number of discrete video encode quality levels supported. Implementations must report at least 1.
    • encodeInputPictureGranularity

      public VkExtent2D encodeInputPictureGranularity()
      indicates the granularity at which encode input picture data is encoded.
    • supportedEncodeFeedbackFlags

      public int supportedEncodeFeedbackFlags()
      a bitmask of VkVideoEncodeFeedbackFlagBitsKHR values specifying the supported flags for video encode feedback queries.
    • sType

      public VkVideoEncodeCapabilitiesKHR sType(int value)
      Sets the specified value to the sType() field.
    • sType$Default

      public VkVideoEncodeCapabilitiesKHR sType$Default()
    • pNext

      public VkVideoEncodeCapabilitiesKHR pNext(long value)
      Sets the specified value to the pNext() field.
    • set

      public VkVideoEncodeCapabilitiesKHR set(int sType, long pNext)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static VkVideoEncodeCapabilitiesKHR malloc()
      Returns a new VkVideoEncodeCapabilitiesKHR instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static VkVideoEncodeCapabilitiesKHR calloc()
      Returns a new VkVideoEncodeCapabilitiesKHR instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static VkVideoEncodeCapabilitiesKHR create()
      Returns a new VkVideoEncodeCapabilitiesKHR instance allocated with BufferUtils.
    • create

      public static VkVideoEncodeCapabilitiesKHR create(long address)
      Returns a new VkVideoEncodeCapabilitiesKHR instance for the specified memory address.
    • createSafe

      @Nullable public static VkVideoEncodeCapabilitiesKHR createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static VkVideoEncodeCapabilitiesKHR.Buffer malloc(int capacity)
      Returns a new VkVideoEncodeCapabilitiesKHR.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static VkVideoEncodeCapabilitiesKHR.Buffer calloc(int capacity)
      Returns a new VkVideoEncodeCapabilitiesKHR.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkVideoEncodeCapabilitiesKHR.Buffer create(int capacity)
      Returns a new VkVideoEncodeCapabilitiesKHR.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkVideoEncodeCapabilitiesKHR.Buffer create(long address, int capacity)
      Create a VkVideoEncodeCapabilitiesKHR.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      @Nullable public static VkVideoEncodeCapabilitiesKHR.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static VkVideoEncodeCapabilitiesKHR malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkVideoEncodeCapabilitiesKHR instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static VkVideoEncodeCapabilitiesKHR calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkVideoEncodeCapabilitiesKHR instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static VkVideoEncodeCapabilitiesKHR.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkVideoEncodeCapabilitiesKHR.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static VkVideoEncodeCapabilitiesKHR.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkVideoEncodeCapabilitiesKHR.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nsType

      public static int nsType(long struct)
      Unsafe version of sType().
    • npNext

      public static long npNext(long struct)
      Unsafe version of pNext().
    • nflags

      public static int nflags(long struct)
      Unsafe version of flags().
    • nrateControlModes

      public static int nrateControlModes(long struct)
      Unsafe version of rateControlModes().
    • nmaxRateControlLayers

      public static int nmaxRateControlLayers(long struct)
      Unsafe version of maxRateControlLayers().
    • nmaxBitrate

      public static long nmaxBitrate(long struct)
      Unsafe version of maxBitrate().
    • nmaxQualityLevels

      public static int nmaxQualityLevels(long struct)
      Unsafe version of maxQualityLevels().
    • nencodeInputPictureGranularity

      public static VkExtent2D nencodeInputPictureGranularity(long struct)
    • nsupportedEncodeFeedbackFlags

      public static int nsupportedEncodeFeedbackFlags(long struct)
    • nsType

      public static void nsType(long struct, int value)
      Unsafe version of sType.
    • npNext

      public static void npNext(long struct, long value)
      Unsafe version of pNext.