]> granicus.if.org Git - libx264/commitdiff
fix a rare NaN in ratecontrol
authorLoren Merritt <pengvado@videolan.org>
Mon, 31 Jul 2006 06:34:53 +0000 (06:34 +0000)
committerLoren Merritt <pengvado@videolan.org>
Mon, 31 Jul 2006 06:34:53 +0000 (06:34 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@541 df754926-b1dd-0310-bc7b-ec298dee348c

encoder/ratecontrol.c

index 7393261feb0ffdcd47df3eed68d4107947d3e026..7f0d4d6577e3761d30f4276635c4e1f68b5c5254 100644 (file)
@@ -1038,6 +1038,8 @@ static double predict_size( predictor_t *p, double q, double var )
 
 static void update_predictor( predictor_t *p, double q, double var, double bits )
 {
+    if( var < 10 )
+        return;
     p->count *= p->decay;
     p->coeff *= p->decay;
     p->count ++;