From a12662fd3e881fe13cf3587b4101f7f53c538136 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Fri, 27 Jun 2014 13:15:13 +0200 Subject: [PATCH] encoder: h264: add pixel-aspect-ratio to VUI parameters. Report sample aspect ratio (SAR) as present, and make it match what we have obtained from the user as pixel-aspect-ratio (PAR). i.e. the VUI parameter aspect_ratio_info_present_flag now defaults to TRUE. --- gst-libs/gst/vaapi/gstvaapiencoder_h264.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c index ac6e41f95b..7f6df3fd04 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_h264.c @@ -1697,6 +1697,11 @@ fill_sequence (GstVaapiEncoderH264 * encoder, GstVaapiEncSequence * sequence) seq_param->vui_parameters_present_flag = TRUE; if (seq_param->vui_parameters_present_flag) { seq_param->vui_fields.bits.aspect_ratio_info_present_flag = FALSE; + if (seq_param->vui_fields.bits.aspect_ratio_info_present_flag) { + const GstVideoInfo *const vip = GST_VAAPI_ENCODER_VIDEO_INFO (encoder); + seq_param->sar_width = GST_VIDEO_INFO_PAR_N (vip); + seq_param->sar_height = GST_VIDEO_INFO_PAR_D (vip); + } seq_param->vui_fields.bits.bitstream_restriction_flag = FALSE; /* if vui_parameters_present_flag is TRUE and sps data belongs to * subset sps, timing_info_preset_flag should be zero (H.7.4.2.1.1) */