mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
libs: encoder: h265: chroma and luma with format
If the profile is main-10 the bit_depth_luma_minus8, in the sequence parameter buffer, shall be the color format bit depth minus 8, 10-8 which is 2. Also for bit_depth_chroma_minus8. This patch gets the negotiated sink caps format and queries its luma's depth and uses that value to fill the mentioned parameters. https://bugzilla.gnome.org/show_bug.cgi?id=771291
This commit is contained in:
parent
d744aeb5fa
commit
3532dca16a
1 changed files with 9 additions and 2 deletions
|
@ -1436,6 +1436,13 @@ static gboolean
|
|||
fill_sequence (GstVaapiEncoderH265 * encoder, GstVaapiEncSequence * sequence)
|
||||
{
|
||||
VAEncSequenceParameterBufferHEVC *const seq_param = sequence->param;
|
||||
const GstVideoFormat format =
|
||||
GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder));
|
||||
guint bits_depth_luma_minus8 =
|
||||
GST_VIDEO_FORMAT_INFO_DEPTH (gst_video_format_get_info (format), 0);
|
||||
if (bits_depth_luma_minus8 < 8)
|
||||
return FALSE;
|
||||
bits_depth_luma_minus8 -= 8;
|
||||
|
||||
memset (seq_param, 0, sizeof (VAEncSequenceParameterBufferHEVC));
|
||||
|
||||
|
@ -1457,8 +1464,8 @@ fill_sequence (GstVaapiEncoderH265 * encoder, GstVaapiEncSequence * sequence)
|
|||
seq_param->seq_fields.value = 0;
|
||||
seq_param->seq_fields.bits.chroma_format_idc = 1;
|
||||
seq_param->seq_fields.bits.separate_colour_plane_flag = 0;
|
||||
seq_param->seq_fields.bits.bit_depth_luma_minus8 = 0;
|
||||
seq_param->seq_fields.bits.bit_depth_chroma_minus8 = 0;
|
||||
seq_param->seq_fields.bits.bit_depth_luma_minus8 = bits_depth_luma_minus8;
|
||||
seq_param->seq_fields.bits.bit_depth_chroma_minus8 = bits_depth_luma_minus8;
|
||||
seq_param->seq_fields.bits.scaling_list_enabled_flag = FALSE;
|
||||
seq_param->seq_fields.bits.strong_intra_smoothing_enabled_flag = TRUE;
|
||||
seq_param->seq_fields.bits.amp_enabled_flag = TRUE;
|
||||
|
|
Loading…
Reference in a new issue