diff motion_est.c @ 807:0e1d375c537f libavcodec

fixing q>0.0 assert failure caused by overflow of variance for b frames
author michaelni
date Wed, 30 Oct 2002 22:55:07 +0000
parents 7f0d502a42c5
children 79de6308c34d
line wrap: on
line diff
--- a/motion_est.c	Wed Oct 30 21:13:07 2002 +0000
+++ b/motion_est.c	Wed Oct 30 22:55:07 2002 +0000
@@ -1558,7 +1558,7 @@
             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
     }