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 describing general video encode capabilities for a video profile.
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.

encodeInputPictureGranularity provides information about the way encode input picture data is used as input to video encode operations. In particular, some implementations may not be able to limit the set of texels used to encode the output video bitstream to the image subregion specified in the VkVideoPictureResourceInfoKHR structure corresponding to the encode input picture (i.e. to the resolution of the image data to encode specified in its codedExtent member).

Note

For example, the application requests the coded extent to be 1920x1080, but the implementation is only able to source the encode input picture data at the granularity of the codec-specific coding block size which is 16x16 pixels (or as otherwise indicated in encodeInputPictureGranularity). In this example, the content is horizontally aligned with the coding block size, but not vertically aligned with it. Thus encoding of the last row of coding blocks will be impacted by the contents of the input image at texel rows 1080 to 1087 (the latter being the next row which is vertically aligned with the coding block size, assuming a zero-based texel row index).

If codedExtent rounded up to the next integer multiple of encodeInputPictureGranularity is greater than the extent of the image subresource specified for the encode input picture, then the texel values corresponding to texel coordinates outside of the bounds of the image subresource may be undefined. However, implementations should use well-defined default values for such texels in order to maximize the encoding efficiency for the last coding block row/column, and/or to ensure consistent encoding results across repeated encoding of the same input content. Nonetheless, the values used for such texels must not have an effect on whether the video encode operation produces a compliant bitstream, and must not have any other effects on the encoded picture data beyond what may otherwise result from using these texel values as input to any compression algorithm, as defined in the used video compression standard.

Note

While not required, it is generally a good practice for applications to make sure that the image subresource used for the encode input picture has an extent that is an integer multiple of the codec-specific coding block size (or at least encodeInputPictureGranularity) and that this padding area is filled with known values in order to improve encoding efficiency, portability, and reproducibility.

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 support at least one quality level.
    • encodeInputPictureGranularity

      public VkExtent2D encodeInputPictureGranularity()
      indicates the granularity at which encode input picture data is encoded and may indicate a texel granularity up to the size of the largest supported codec-specific coding block. This capability does not impose any valid usage constraints on the application, however, depending on the contents of the encode input picture, it may have effects on the encoded bitstream, as described in more detail below.
    • 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

      public static @Nullable 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

      public static @Nullable 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.