]> granicus.if.org Git - libvpx/commitdiff
change to prevent computatio of log(0.0)
authorYaowu Xu <yaowu@google.com>
Fri, 20 Sep 2013 23:14:37 +0000 (16:14 -0700)
committerYaowu Xu <yaowu@google.com>
Tue, 24 Sep 2013 00:19:12 +0000 (17:19 -0700)
Change-Id: I5759f309f94a2b5c1297e6db3735c52986d3ecb2

vp8/encoder/firstpass.c

index 8548e747647e6688fc5bbc7b1d321a01ea5e295c..968c7f3652e11b14681ef7612756ef65a0c0e52f 100644 (file)
@@ -909,7 +909,10 @@ extern const int vp8_bits_per_mb[2][QINDEX_RANGE];
 
 static double bitcost( double prob )
 {
-    return -(log( prob ) / log( 2.0 ));
+  if (prob > 0.000122)
+    return -log(prob) / log(2.0);
+  else
+    return 13.0;
 }
 static int64_t estimate_modemvcost(VP8_COMP *cpi,
                                      FIRSTPASS_STATS * fpstats)