From f35e3fc26b99e1b3c943c131100fdfa4733fc932 Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Sun, 23 Feb 2014 16:56:03 +0400 Subject: [PATCH] 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. --- encoder/set.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.40.0