[FFmpeg-devel] [PATCH] x4->params.analyse.b_weighted_bipred gets wrong bool value in libx264.c

Erik Slagter erik
Sun Dec 6 12:17:31 CET 2009


I am not sure about the _exact_ semantics of this field, but according
to the source of x264 and compare runs it seems that value of this field
must be either 0 or 1, and not 0 or 32 what ffmpeg uses. A shallow
glance at the code inside libx264 suggests it does make a difference to
use 32 or 1 for true, so I'd rather have it correct.

Index: libavcodec/libx264.c
===================================================================
--- libavcodec/libx264.c    (revision 20746)
+++ libavcodec/libx264.c    (working copy)
@@ -227,7 +227,7 @@
 
     x4->params.analyse.i_direct_mv_pred  = avctx->directpred;
 
-    x4->params.analyse.b_weighted_bipred = avctx->flags2 &
CODEC_FLAG2_WPRED;
+    x4->params.analyse.b_weighted_bipred = !!(avctx->flags2 &
CODEC_FLAG2_WPRED);
     x4->params.analyse.i_weighted_pred = avctx->weighted_p_pred;
 
     if (avctx->me_method == ME_EPZS)




More information about the ffmpeg-devel mailing list