From: Anton Mitrofanov Date: Sun, 23 Feb 2014 12:56:03 +0000 (+0400) Subject: Don't set chroma_loc_info_present_flag for non-4:2:0 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f35e3fc26b99e1b3c943c131100fdfa4733fc932;p=libx264 Don't set chroma_loc_info_present_flag for non-4:2:0 The H.264 spec says it shouldn't be set in these cases. --- diff --git a/encoder/set.c b/encoder/set.c index e867a7d7..6b0881bf 100644 --- a/encoder/set.c +++ b/encoder/set.c @@ -228,7 +228,8 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param ) } /* FIXME: not sufficient for interlaced video */ - sps->vui.b_chroma_loc_info_present = param->vui.i_chroma_loc > 0 && param->vui.i_chroma_loc <= 5; + sps->vui.b_chroma_loc_info_present = param->vui.i_chroma_loc > 0 && param->vui.i_chroma_loc <= 5 && + sps->i_chroma_format_idc == CHROMA_420; if( sps->vui.b_chroma_loc_info_present ) { sps->vui.i_chroma_loc_top = param->vui.i_chroma_loc;