[x264-devel] Don't set chroma_loc_info_present_flag for non-4:2:0

Anton Mitrofanov git at videolan.org
Thu Mar 13 21:23:51 CET 2014


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Sun Feb 23 16:56:03 2014 +0400| [892cd51bcc50ea603c9fe70112b44e1b9626557a] | committer: Jason Garrett-Glaser

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.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=892cd51bcc50ea603c9fe70112b44e1b9626557a
---

 encoder/set.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/encoder/set.c b/encoder/set.c
index e867a7d..6b0881b 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;



More information about the x264-devel mailing list