]> git.sesse.net Git - x264/commitdiff
Don't set chroma_loc_info_present_flag for non-4:2:0
authorAnton Mitrofanov <BugMaster@narod.ru>
Sun, 23 Feb 2014 12:56:03 +0000 (16:56 +0400)
committerFiona Glaser <fiona@x264.com>
Wed, 12 Mar 2014 04:10:22 +0000 (21:10 -0700)
The H.264 spec says it shouldn't be set in these cases.

encoder/set.c

index e867a7d7d846f07d0ed2a5a89ceba41d67f038ed..6b0881bf6843ace7a5a860cec4c6d7773ed18884 100644 (file)
@@ -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;