diff options
author | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2017-04-03 15:34:51 +0200 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2017-04-07 12:04:51 +0200 |
commit | 3532dca16aacef23e5ea20611b4331621c566332 (patch) | |
tree | 4e5d4d773a8cc2773f48eea9fa4734e5ed843626 | |
parent | d744aeb5fa41d35f82a4fdbe5b4397335be40f87 (diff) | |
download | gstreamer-3532dca16aacef23e5ea20611b4331621c566332.tar.gz |
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
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiencoder_h265.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c index 8993e14d03..f49121ce2b 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c @@ -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; |