From 0bfacb95dea6a04e4c10a24b9d90c14a401ade67 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 30 Oct 2002 22:55:07 +0000 Subject: [PATCH] fixing q>0.0 assert failure caused by overflow of variance for b frames Originally committed as revision 1120 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/motion_est.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index f8064b126c..547c619526 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -1558,7 +1558,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s, score=fbmin; type= MB_TYPE_BIDIR; } - score= (score*score + 128*256)>>16; + score= ((unsigned)(score*score + 128*256))>>16; s->mc_mb_var_sum += score; s->mc_mb_var[mb_y*s->mb_width + mb_x] = score; //FIXME use SSD }