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.
This commit is contained in:
Gwenole Beauchesne 2014-06-27 13:15:13 +02:00
parent a4bd8450f7
commit a12662fd3e

View file

@ -1697,6 +1697,11 @@ fill_sequence (GstVaapiEncoderH264 * encoder, GstVaapiEncSequence * sequence)
seq_param->vui_parameters_present_flag = TRUE; seq_param->vui_parameters_present_flag = TRUE;
if (seq_param->vui_parameters_present_flag) { if (seq_param->vui_parameters_present_flag) {
seq_param->vui_fields.bits.aspect_ratio_info_present_flag = FALSE; 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; seq_param->vui_fields.bits.bitstream_restriction_flag = FALSE;
/* if vui_parameters_present_flag is TRUE and sps data belongs to /* 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) */ * subset sps, timing_info_preset_flag should be zero (H.7.4.2.1.1) */