-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add config attribute to advertise HEVC encoder features #385
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,193 @@ extern "C" { | |
* @{ | ||
*/ | ||
|
||
/** Attribute value for VAConfigAttribEncHEVCFeatures. | ||
* | ||
* This attribute decribes the supported features of an HEVC/H.265 | ||
* encoder configuration. | ||
* | ||
* All of the field values in this attribute are VA_FEATURE_* values, | ||
* indicating support for the corresponding feature. | ||
*/ | ||
typedef union VAConfigAttribValEncHEVCFeatures { | ||
struct { | ||
/** Separate colour planes. | ||
* | ||
* Allows setting separate_colour_plane_flag in the SPS. | ||
*/ | ||
uint32_t separate_colour_planes : 2; | ||
/** Scaling lists. | ||
* | ||
* Allows scaling_list() elements to be present in both the SPS | ||
* and the PPS. The decoded form of the scaling lists must also | ||
* be supplied in a VAQMatrixBufferHEVC buffer when scaling lists | ||
* are enabled. | ||
*/ | ||
uint32_t scaling_lists : 2; | ||
/** Asymmetric motion partitions. | ||
* | ||
* Allows setting amp_enabled_flag in the SPS. | ||
*/ | ||
uint32_t amp : 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If amp is always supported by driver and cannot be disabled, how to set this field? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the driver requires amp to always be enabled then it should return VA_FEATURE_REQUIRED in this field. |
||
/** Sample adaptive offset filter. | ||
* | ||
* Allows setting slice_sao_luma_flag and slice_sao_chroma_flag | ||
* in slice headers. | ||
*/ | ||
uint32_t sao : 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Driver allows these two slice_sao_luma_flag and slice_sao_chroma_flag to be disabled/enabled respectively. How to set this field, which bit represent luma/chroma? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you thinking of hardware which supports SAO only on one type of plane but not the other? I was thinking that no such hardware would exist, but if you think it is possible then we could add separate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rereading that, I'm now not sure that that was your question. To clarify my intended meaning: If If If Do you have/expect hardware for which that would be a problem? |
||
/** PCM sample blocks. | ||
* | ||
* Allows setting pcm_enabled_flag in the SPS. When enabled | ||
* PCM parameters must be supplied with the sequence parameters, | ||
* including block sizes which may be further constrained as | ||
* noted in the VAConfigAttribEncHEVCBlockSizes attribute. | ||
*/ | ||
uint32_t pcm : 2; | ||
/** Temporal motion vector Prediction. | ||
* | ||
* Allows setting slice_temporal_mvp_enabled_flag in slice | ||
* headers. | ||
*/ | ||
uint32_t temporal_mvp : 2; | ||
/** Strong intra smoothing. | ||
* | ||
* Allows setting strong_intra_smoothing_enabled_flag in the SPS. | ||
*/ | ||
uint32_t strong_intra_smoothing : 2; | ||
/** Dependent slices. | ||
* | ||
* Allows setting dependent_slice_segment_flag in slice headers. | ||
*/ | ||
uint32_t dependent_slices : 2; | ||
/** Sign data hiding. | ||
* | ||
* Allows setting sign_data_hiding_enable_flag in the PPS. | ||
*/ | ||
uint32_t sign_data_hiding : 2; | ||
/** Constrained intra prediction. | ||
* | ||
* Allows setting constrained_intra_pred_flag in the PPS. | ||
*/ | ||
uint32_t constrained_intra_pred : 2; | ||
/** Transform skipping. | ||
* | ||
* Allows setting transform_skip_enabled_flag in the PPS. | ||
*/ | ||
uint32_t transform_skip : 2; | ||
/** QP delta within coding units. | ||
* | ||
* Allows setting cu_qp_delta_enabled_flag in the PPS. When | ||
* enabled, diff_cu_qp_delta_depth must be set to zero. | ||
*/ | ||
uint32_t cu_qp_delta : 2; | ||
/** Weighted prediction. | ||
* | ||
* Allows setting weighted_pred_flag and weighted_bipred_flag in | ||
* the PPS. The pred_weight_table() data must be supplied with | ||
* every slice header when weighted prediction is enabled. | ||
*/ | ||
uint32_t weighted_prediction : 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with SAO. Driver also allows weighted_pred_flag and weighted_bipred_flag to be disabled/enabled respectively. How to set this field? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the same case but for hardware which only has partial weighted prediction support? Again, I was imagining that no such hardware would exist, but we could separate them if you do have such hardware. (Hardware which lacks support for encoding P or B frames wouldn't care about the value of the other flag, because it would never be used.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a question about weighted_prediction, media-driver support two kind of weighted-prediction: 1. explicit weighted prediction, application should provide pred_weight_table, and media-driver do weighted prediction basing on the pred_weight_table from applicaiton, so a pre-process needed (such as, fade in/out detection) before encoding 2. media driver based weighted prediction (or implicit weight prediction), media-driver will analyze the statistic datas and will provide a pred_weigt_table internally, to help the video quality. it happens inside media-driver during encoding process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @XinfengZhang I think the setting for driver-produced prediction weights should be signalled by its own attribute rather than embedded here, since it's not actually related to the codec implementation - it would exist in H.264/H.266 as well. (There are other similar cases where either a driver-internal process or some kind of preprocessing step could be used to produce values for codec processes - e.g. the segmentation map in VP8/VP9/AV1, scaling lists in H.264/H.265/H.266, global motion in AV1. It would be sensible for these to all be treated in a consistent way.) |
||
/** Transform and quantisation bypass. | ||
* | ||
* Allows setting transquant_bypass_enabled_flag in the PPS. | ||
*/ | ||
uint32_t transquant_bypass : 2; | ||
/** Deblocking filter disable. | ||
* | ||
* Allows setting slice_deblocking_filter_disabled_flag. | ||
*/ | ||
uint32_t deblocking_filter_disable : 2; | ||
/* Reserved for future use. */ | ||
uint32_t reserved : 2; | ||
} bits; | ||
uint32_t value; | ||
} VAConfigAttribValEncHEVCFeatures; | ||
|
||
/** Attribute value for VAConfigAttribEncHEVCBlockSizes. | ||
* | ||
* This attribute describes the supported coding tree and transform block | ||
* sizes of an HEVC/H.265 encoder configuration | ||
*/ | ||
typedef union VAConfigAttribValEncHEVCBlockSizes { | ||
struct { | ||
/** Largest supported size of coding tree blocks. | ||
* | ||
* CtbLog2SizeY must not be larger than this. | ||
*/ | ||
uint32_t log2_max_coding_tree_block_size_minus3 : 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ask a question: if some device support LTU = 64, but not support LTU=32. how to report this attributes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only 64x64 luma CTBs supported: |
||
/** Smallest supported size of coding tree blocks. | ||
* | ||
* CtbLog2SizeY must not be smaller than this. | ||
* | ||
* This may be the same as the maximum size, indicating that only | ||
* one CTB size is supported. | ||
*/ | ||
uint32_t log2_min_coding_tree_block_size_minus3 : 2; | ||
|
||
/** Smallest supported size of luma coding blocks. | ||
* | ||
* MinCbLog2SizeY must not be smaller than this. | ||
*/ | ||
uint32_t log2_min_luma_coding_block_size_minus3 : 2; | ||
|
||
/** Largest supported size of luma transform blocks. | ||
* | ||
* MaxTbLog2SizeY must not be larger than this. | ||
*/ | ||
uint32_t log2_max_luma_transform_block_size_minus2 : 2; | ||
/** Smallest supported size of luma transform blocks. | ||
* | ||
* MinTbLog2SizeY must not be smaller than this. | ||
*/ | ||
uint32_t log2_min_luma_transform_block_size_minus2 : 2; | ||
|
||
/** Largest supported transform hierarchy depth in inter | ||
* coding units. | ||
* | ||
* max_transform_hierarchy_depth_inter must not be larger | ||
* than this. | ||
*/ | ||
uint32_t max_max_transform_hierarchy_depth_inter : 2; | ||
/** Smallest supported transform hierarchy depth in inter | ||
* coding units. | ||
* | ||
* max_transform_hierarchy_depth_inter must not be smaller | ||
* than this. | ||
*/ | ||
uint32_t min_max_transform_hierarchy_depth_inter : 2; | ||
|
||
/** Largest supported transform hierarchy depth in intra | ||
* coding units. | ||
* | ||
* max_transform_hierarchy_depth_intra must not be larger | ||
* than this. | ||
*/ | ||
uint32_t max_max_transform_hierarchy_depth_intra : 2; | ||
/** Smallest supported transform hierarchy depth in intra | ||
* coding units. | ||
* | ||
* max_transform_hierarchy_depth_intra must not be smaller | ||
* than this. | ||
*/ | ||
uint32_t min_max_transform_hierarchy_depth_intra : 2; | ||
|
||
/** Largest supported size of PCM coding blocks. | ||
* | ||
* Log2MaxIpcmCbSizeY must not be larger than this. | ||
*/ | ||
uint32_t log2_max_pcm_coding_block_size_minus3 : 2; | ||
/** Smallest supported size of PCM coding blocks. | ||
* | ||
* Log2MinIpcmCbSizeY must not be smaller than this. | ||
*/ | ||
uint32_t log2_min_pcm_coding_block_size_minus3 : 2; | ||
|
||
/** Reserved for future use. */ | ||
uint32_t reserved : 10; | ||
} bits; | ||
uint32_t value; | ||
} VAConfigAttribValEncHEVCBlockSizes; | ||
|
||
/** | ||
* @name Picture flags | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If from driver side, only packed is supported, planar are not supported. The meaning of 0 and 1 are not identical to Recommendation ITU-T H.265, the value returned from driver is VA_FEATURE_NOT_SUPPORTED. Are my understanding correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
VA_FEATURE_NOT_SUPPORTED
from the driver indicates that the separate colour planes are not usable, soseparate_colour_planes
must then always be set to zero by the user.