Class VkVideoEncodeRateControlLayerInfoKHR
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkVideoEncodeRateControlLayerInfoKHR
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkVideoEncodeRateControlLayerInfoKHR extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure to set encode per-layer rate control parameters.Description
A codec-specific structure specifying additional per-layer rate control settings must be chained to
VkVideoEncodeRateControlLayerInfoKHR. If multiple rate control layers are enabled (VkVideoEncodeRateControlInfoKHR::layerCountis greater than 1), then the chained codec-specific extension structure also identifies the specific video coding layer its parentVkVideoEncodeRateControlLayerInfoKHRapplies to. If multiple rate control layers are enabled, the number of rate control layers must match the number of video coding layers. The specification for an encode codec-specific extension would describe how multiple video coding layers are enabled for the corresponding codec.Per-layer rate control settings for all enabled rate control layers must be initialized or re-initialized whenever stream rate control settings are provided via
VkVideoEncodeRateControlInfoKHR. This is done by specifying settings for all enabled rate control layers inVkVideoEncodeRateControlInfoKHR::pLayerConfigs.To adjust rate control settings for an individual layer at runtime, add a
VkVideoEncodeRateControlLayerInfoKHRstructure to thepNextchain of theVkVideoCodingControlInfoKHRstructure passed to theCmdControlVideoCodingKHRcommand. This adjustment only impacts the specified layer without impacting the rate control settings or implementation rate control algorithm behavior for any other enabled rate control layers. The adjustment takes effect whenever the correspondingCmdControlVideoCodingKHRis executed, and only impactsCmdEncodeVideoKHRoperations pertaining to the corresponding video coding layer that follow in execution order.It is possible for an application to enable multiple video coding layers (via codec-specific extensions to encoding operations) while only enabling a single layer of rate control for the entire video stream. To achieve this,
layerCountinVkVideoEncodeRateControlInfoKHRmust be set to 1, and the singleVkVideoEncodeRateControlLayerInfoKHRprovided inpLayerConfigswould apply to all encoded segments of the video stream, regardless of which codec-defined video coding layer they belong to. In this case, the implementation decides bitrate distribution across video coding layers (if applicable to the specified stream rate control mode).Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR
See Also
VkVideoEncodeRateControlInfoKHRLayout
struct VkVideoEncodeRateControlLayerInfoKHR { VkStructureTypesType(); void const *pNext(); uint32_taverageBitrate(); uint32_tmaxBitrate(); uint32_tframeRateNumerator(); uint32_tframeRateDenominator(); uint32_tvirtualBufferSizeInMs(); uint32_tinitialVirtualBufferSizeInMs(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkVideoEncodeRateControlLayerInfoKHR.BufferAn array ofVkVideoEncodeRateControlLayerInfoKHRstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intAVERAGEBITRATE
FRAMERATEDENOMINATOR
FRAMERATENUMERATOR
INITIALVIRTUALBUFFERSIZEINMS
MAXBITRATE
PNEXTThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSTYPE
VIRTUALBUFFERSIZEINMSThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkVideoEncodeRateControlLayerInfoKHR(java.nio.ByteBuffer container)Creates aVkVideoEncodeRateControlLayerInfoKHRinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intaverageBitrate()the average bitrate in bits/second.VkVideoEncodeRateControlLayerInfoKHRaverageBitrate(int value)Sets the specified value to theaverageBitrate()field.static VkVideoEncodeRateControlLayerInfoKHRcalloc()Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance allocated withmemCalloc.static VkVideoEncodeRateControlLayerInfoKHR.Buffercalloc(int capacity)Returns a newVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance allocated withmemCalloc.static VkVideoEncodeRateControlLayerInfoKHR.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkVideoEncodeRateControlLayerInfoKHRcalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkVideoEncodeRateControlLayerInfoKHRcreate()Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance allocated withBufferUtils.static VkVideoEncodeRateControlLayerInfoKHR.Buffercreate(int capacity)Returns a newVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance allocated withBufferUtils.static VkVideoEncodeRateControlLayerInfoKHRcreate(long address)Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance for the specified memory address.static VkVideoEncodeRateControlLayerInfoKHR.Buffercreate(long address, int capacity)Create aVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance at the specified memory.static VkVideoEncodeRateControlLayerInfoKHRcreateSafe(long address)static VkVideoEncodeRateControlLayerInfoKHR.BuffercreateSafe(long address, int capacity)intframeRateDenominator()the denominator of the frame rate.VkVideoEncodeRateControlLayerInfoKHRframeRateDenominator(int value)Sets the specified value to theframeRateDenominator()field.intframeRateNumerator()the numerator of the frame rate.VkVideoEncodeRateControlLayerInfoKHRframeRateNumerator(int value)Sets the specified value to theframeRateNumerator()field.intinitialVirtualBufferSizeInMs()the initial occupancy in milliseconds of the virtual buffer in the leaky bucket model.VkVideoEncodeRateControlLayerInfoKHRinitialVirtualBufferSizeInMs(int value)Sets the specified value to theinitialVirtualBufferSizeInMs()field.static VkVideoEncodeRateControlLayerInfoKHRmalloc()Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance allocated withmemAlloc.static VkVideoEncodeRateControlLayerInfoKHR.Buffermalloc(int capacity)Returns a newVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance allocated withmemAlloc.static VkVideoEncodeRateControlLayerInfoKHR.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.static VkVideoEncodeRateControlLayerInfoKHRmalloc(org.lwjgl.system.MemoryStack stack)Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance allocated on the specifiedMemoryStack.intmaxBitrate()the peak bitrate in bits/second.VkVideoEncodeRateControlLayerInfoKHRmaxBitrate(int value)Sets the specified value to themaxBitrate()field.static intnaverageBitrate(long struct)Unsafe version ofaverageBitrate().static voidnaverageBitrate(long struct, int value)Unsafe version ofaverageBitrate.static intnframeRateDenominator(long struct)Unsafe version offrameRateDenominator().static voidnframeRateDenominator(long struct, int value)Unsafe version offrameRateDenominator.static intnframeRateNumerator(long struct)Unsafe version offrameRateNumerator().static voidnframeRateNumerator(long struct, int value)Unsafe version offrameRateNumerator.static intninitialVirtualBufferSizeInMs(long struct)Unsafe version ofinitialVirtualBufferSizeInMs().static voidninitialVirtualBufferSizeInMs(long struct, int value)Unsafe version ofinitialVirtualBufferSizeInMs.static intnmaxBitrate(long struct)Unsafe version ofmaxBitrate().static voidnmaxBitrate(long struct, int value)Unsafe version ofmaxBitrate.static longnpNext(long struct)Unsafe version ofpNext().static voidnpNext(long struct, long value)Unsafe version ofpNext.static intnsType(long struct)Unsafe version ofsType().static voidnsType(long struct, int value)Unsafe version ofsType.static intnvirtualBufferSizeInMs(long struct)Unsafe version ofvirtualBufferSizeInMs().static voidnvirtualBufferSizeInMs(long struct, int value)Unsafe version ofvirtualBufferSizeInMs.longpNext()a pointer to a structure extending this structure.VkVideoEncodeRateControlLayerInfoKHRpNext(long value)Sets the specified value to thepNext()field.VkVideoEncodeRateControlLayerInfoKHRpNext(VkVideoEncodeH264RateControlLayerInfoEXT value)Prepends the specifiedVkVideoEncodeH264RateControlLayerInfoEXTvalue to thepNextchain.VkVideoEncodeRateControlLayerInfoKHRpNext(VkVideoEncodeH265RateControlLayerInfoEXT value)Prepends the specifiedVkVideoEncodeH265RateControlLayerInfoEXTvalue to thepNextchain.VkVideoEncodeRateControlLayerInfoKHRset(int sType, long pNext, int averageBitrate, int maxBitrate, int frameRateNumerator, int frameRateDenominator, int virtualBufferSizeInMs, int initialVirtualBufferSizeInMs)Initializes this struct with the specified values.VkVideoEncodeRateControlLayerInfoKHRset(VkVideoEncodeRateControlLayerInfoKHR src)Copies the specified struct data to this struct.intsizeof()intsType()the type of this structure.VkVideoEncodeRateControlLayerInfoKHRsType(int value)Sets the specified value to thesType()field.VkVideoEncodeRateControlLayerInfoKHRsType$Default()Sets theSTRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHRvalue to thesType()field.static voidvalidate(long struct)Validates pointer members that should not beNULL.intvirtualBufferSizeInMs()the leaky bucket model virtual buffer size in milliseconds, with respect to peak bitrate.VkVideoEncodeRateControlLayerInfoKHRvirtualBufferSizeInMs(int value)Sets the specified value to thevirtualBufferSizeInMs()field.
-
-
-
Constructor Detail
-
VkVideoEncodeRateControlLayerInfoKHR
public VkVideoEncodeRateControlLayerInfoKHR(java.nio.ByteBuffer container)
Creates aVkVideoEncodeRateControlLayerInfoKHRinstance at the current position of the specifiedByteBuffercontainer. 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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
sType
public int sType()
the type of this structure.
-
pNext
public long pNext()
a pointer to a structure extending this structure.
-
averageBitrate
public int averageBitrate()
the average bitrate in bits/second. Valid when rate control mode is notVIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR.
-
maxBitrate
public int maxBitrate()
the peak bitrate in bits/second. Valid when rate control mode isVIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR.
-
frameRateNumerator
public int frameRateNumerator()
the numerator of the frame rate. Valid when rate control mode is notVIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR.
-
frameRateDenominator
public int frameRateDenominator()
the denominator of the frame rate. Valid when rate control mode is notVIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR.
-
virtualBufferSizeInMs
public int virtualBufferSizeInMs()
the leaky bucket model virtual buffer size in milliseconds, with respect to peak bitrate. Valid when rate control mode is notVIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR. For example, virtual buffer size is (virtualBufferSizeInMs*maxBitrate/ 1000).
-
initialVirtualBufferSizeInMs
public int initialVirtualBufferSizeInMs()
the initial occupancy in milliseconds of the virtual buffer in the leaky bucket model. Valid when the rate control mode is notVIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR.
-
sType
public VkVideoEncodeRateControlLayerInfoKHR sType(int value)
Sets the specified value to thesType()field.
-
sType$Default
public VkVideoEncodeRateControlLayerInfoKHR sType$Default()
Sets theSTRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHRvalue to thesType()field.
-
pNext
public VkVideoEncodeRateControlLayerInfoKHR pNext(long value)
Sets the specified value to thepNext()field.
-
pNext
public VkVideoEncodeRateControlLayerInfoKHR pNext(VkVideoEncodeH264RateControlLayerInfoEXT value)
Prepends the specifiedVkVideoEncodeH264RateControlLayerInfoEXTvalue to thepNextchain.
-
pNext
public VkVideoEncodeRateControlLayerInfoKHR pNext(VkVideoEncodeH265RateControlLayerInfoEXT value)
Prepends the specifiedVkVideoEncodeH265RateControlLayerInfoEXTvalue to thepNextchain.
-
averageBitrate
public VkVideoEncodeRateControlLayerInfoKHR averageBitrate(int value)
Sets the specified value to theaverageBitrate()field.
-
maxBitrate
public VkVideoEncodeRateControlLayerInfoKHR maxBitrate(int value)
Sets the specified value to themaxBitrate()field.
-
frameRateNumerator
public VkVideoEncodeRateControlLayerInfoKHR frameRateNumerator(int value)
Sets the specified value to theframeRateNumerator()field.
-
frameRateDenominator
public VkVideoEncodeRateControlLayerInfoKHR frameRateDenominator(int value)
Sets the specified value to theframeRateDenominator()field.
-
virtualBufferSizeInMs
public VkVideoEncodeRateControlLayerInfoKHR virtualBufferSizeInMs(int value)
Sets the specified value to thevirtualBufferSizeInMs()field.
-
initialVirtualBufferSizeInMs
public VkVideoEncodeRateControlLayerInfoKHR initialVirtualBufferSizeInMs(int value)
Sets the specified value to theinitialVirtualBufferSizeInMs()field.
-
set
public VkVideoEncodeRateControlLayerInfoKHR set(int sType, long pNext, int averageBitrate, int maxBitrate, int frameRateNumerator, int frameRateDenominator, int virtualBufferSizeInMs, int initialVirtualBufferSizeInMs)
Initializes this struct with the specified values.
-
set
public VkVideoEncodeRateControlLayerInfoKHR set(VkVideoEncodeRateControlLayerInfoKHR src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkVideoEncodeRateControlLayerInfoKHR malloc()
Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkVideoEncodeRateControlLayerInfoKHR calloc()
Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkVideoEncodeRateControlLayerInfoKHR create()
Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance allocated withBufferUtils.
-
create
public static VkVideoEncodeRateControlLayerInfoKHR create(long address)
Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance for the specified memory address.
-
createSafe
@Nullable public static VkVideoEncodeRateControlLayerInfoKHR createSafe(long address)
-
malloc
public static VkVideoEncodeRateControlLayerInfoKHR.Buffer malloc(int capacity)
Returns a newVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkVideoEncodeRateControlLayerInfoKHR.Buffer calloc(int capacity)
Returns a newVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkVideoEncodeRateControlLayerInfoKHR.Buffer create(int capacity)
Returns a newVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkVideoEncodeRateControlLayerInfoKHR.Buffer create(long address, int capacity)
Create aVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkVideoEncodeRateControlLayerInfoKHR.Buffer createSafe(long address, int capacity)
-
malloc
public static VkVideoEncodeRateControlLayerInfoKHR malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VkVideoEncodeRateControlLayerInfoKHR calloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkVideoEncodeRateControlLayerInfoKHRinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkVideoEncodeRateControlLayerInfoKHR.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static VkVideoEncodeRateControlLayerInfoKHR.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkVideoEncodeRateControlLayerInfoKHR.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nsType
public static int nsType(long struct)
Unsafe version ofsType().
-
npNext
public static long npNext(long struct)
Unsafe version ofpNext().
-
naverageBitrate
public static int naverageBitrate(long struct)
Unsafe version ofaverageBitrate().
-
nmaxBitrate
public static int nmaxBitrate(long struct)
Unsafe version ofmaxBitrate().
-
nframeRateNumerator
public static int nframeRateNumerator(long struct)
Unsafe version offrameRateNumerator().
-
nframeRateDenominator
public static int nframeRateDenominator(long struct)
Unsafe version offrameRateDenominator().
-
nvirtualBufferSizeInMs
public static int nvirtualBufferSizeInMs(long struct)
Unsafe version ofvirtualBufferSizeInMs().
-
ninitialVirtualBufferSizeInMs
public static int ninitialVirtualBufferSizeInMs(long struct)
Unsafe version ofinitialVirtualBufferSizeInMs().
-
nsType
public static void nsType(long struct, int value)Unsafe version ofsType.
-
npNext
public static void npNext(long struct, long value)Unsafe version ofpNext.
-
naverageBitrate
public static void naverageBitrate(long struct, int value)Unsafe version ofaverageBitrate.
-
nmaxBitrate
public static void nmaxBitrate(long struct, int value)Unsafe version ofmaxBitrate.
-
nframeRateNumerator
public static void nframeRateNumerator(long struct, int value)Unsafe version offrameRateNumerator.
-
nframeRateDenominator
public static void nframeRateDenominator(long struct, int value)Unsafe version offrameRateDenominator.
-
nvirtualBufferSizeInMs
public static void nvirtualBufferSizeInMs(long struct, int value)Unsafe version ofvirtualBufferSizeInMs.
-
ninitialVirtualBufferSizeInMs
public static void ninitialVirtualBufferSizeInMs(long struct, int value)Unsafe version ofinitialVirtualBufferSizeInMs.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-