Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Retrieves resource requirements for video encoding, with support for optional metadata. Used with ID3D12VideoDevice::CheckFeatureSupport and the D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS1 feature value.
Syntax
typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS1 {
UINT NodeIndex;
D3D12_VIDEO_ENCODER_CODEC Codec;
D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
DXGI_FORMAT InputFormat;
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution;
BOOL IsSupported;
UINT CompressedBitstreamBufferAccessAlignment;
UINT EncoderMetadataBufferAccessAlignment;
UINT MaxEncoderOutputMetadataBufferSize;
D3D12_VIDEO_ENCODER_OPTIONAL_METADATA_ENABLE_FLAGS OptionalMetadata;
D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration;
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC EncoderOutputMetadataQPMapTextureDimensions;
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC EncoderOutputMetadataSATDMapTextureDimensions;
D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC EncoderOutputMetadataBitAllocationMapTextureDimensions;
UINT EncoderOutputMetadataFramePSNRComponentsNumber;
UINT EncoderOutputMetadataSubregionsPSNRComponentsNumber;
UINT EncoderOutputMetadataSubregionsPSNRResolvedMetadataBufferSize;
} D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS1;
Members
NodeIndex
For single GPU operation, set this to zero. If there are multiple GPU nodes, set a bit to identify the node (one of the device's physical adapters) to which the command queue applies. Each bit in the mask corresponds to a single node. Only one bit must be set.
Codec
A D3D12_VIDEO_ENCODER_CODEC specifying the codec to query.
Profile
A D3D12_VIDEO_ENCODER_PROFILE_DESC specifying the encoder profile.
InputFormat
A DXGI_FORMAT specifying the input format.
PictureTargetResolution
A D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC specifying the target resolution.
IsSupported
Output. Indicates whether the configuration is supported.
CompressedBitstreamBufferAccessAlignment
Output. The required alignment for the compressed bitstream buffer.
EncoderMetadataBufferAccessAlignment
Output. The required alignment for the encoder metadata buffer.
MaxEncoderOutputMetadataBufferSize
Output. The maximum size in bytes of the encoder output metadata buffer.
OptionalMetadata
A D3D12_VIDEO_ENCODER_OPTIONAL_METADATA_ENABLE_FLAGS value indicating which optional metadata is requested.
CodecConfiguration
A D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION specifying the codec configuration. Required when any flags are set in OptionalMetadata; otherwise pass as zeroed/NULL.
EncoderOutputMetadataQPMapTextureDimensions
Output. A D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC indicating the texture dimensions for the QP map output. Valid when D3D12_VIDEO_ENCODER_OPTIONAL_METADATA_ENABLE_FLAG_QP_MAP is set. The block size can be derived by dividing PictureTargetResolution by these dimensions.
EncoderOutputMetadataSATDMapTextureDimensions
Output. A D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC indicating the texture dimensions for the SATD map output. Valid when D3D12_VIDEO_ENCODER_OPTIONAL_METADATA_ENABLE_FLAG_SATD_MAP is set. The block size can be derived by dividing PictureTargetResolution by these dimensions.
EncoderOutputMetadataBitAllocationMapTextureDimensions
Output. A D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC indicating the texture dimensions for the bit allocation map output. Valid when D3D12_VIDEO_ENCODER_OPTIONAL_METADATA_ENABLE_FLAG_RC_BIT_ALLOCATION_MAP is set. The block size can be derived by dividing PictureTargetResolution by these dimensions.
EncoderOutputMetadataFramePSNRComponentsNumber
Output. The number of PSNR components (Y, U, and V in that order) written for frame-level PSNR. Valid when D3D12_VIDEO_ENCODER_OPTIONAL_METADATA_ENABLE_FLAG_FRAME_PSNR is set.
EncoderOutputMetadataSubregionsPSNRComponentsNumber
Output. The number of PSNR components (Y, U, and V in that order) written per subregion. Valid when D3D12_VIDEO_ENCODER_OPTIONAL_METADATA_ENABLE_FLAG_SUBREGIONS_PSNR is set.
EncoderOutputMetadataSubregionsPSNRResolvedMetadataBufferSize
Output. The required Width size of the buffer for subregion PSNR data. Valid when D3D12_VIDEO_ENCODER_OPTIONAL_METADATA_ENABLE_FLAG_SUBREGIONS_PSNR is set.
Remarks
When OptionalMetadata is D3D12_VIDEO_ENCODER_OPTIONAL_METADATA_ENABLE_FLAG_NONE, the outputs that are also present in D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS must report identical values for backward compatibility. Output fields for non-selected optional metadata flags are reported as zero.
Requirements
| Requirement | Value |
|---|---|
| Header | d3d12video.h |