changeset 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 440b8e4b2d35
children e9bfaabcf07d
files motion_est.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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
     }