encoder: h264: add pixel-aspect-ratio to VUI parameters.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 27 Jun 2014 11:15:13 +0000 (13:15 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 27 Jun 2014 11:15:13 +0000 (13:15 +0200)
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

index ac6e41f..7f6df3f 100644 (file)
@@ -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) */