shithub: libvpx

Download patch

ref: 76495617e05d7192f887c688fa177fea77b9469b
parent: 55c3963c8828552b16473f0c8df370d501f27922
parent: 10ed60dc718aa6133508c2fb5183cfc7dc67e920
author: Yaowu Xu <yaowu@google.com>
date: Tue Jun 21 05:47:42 EDT 2011

Merge "adjusting the calculation of errorperbit"

--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -335,7 +335,8 @@
 {
 #if USE_ACT_INDEX
     x->rdmult += *(x->mb_activity_ptr) * (x->rdmult >> 2);
-    x->errorperbit = x->rdmult/x->rddiv;
+    x->errorperbit = x->rdmult * 100 /(110 * x->rddiv);
+    x->errorperbit += (x->errorperbit==0);
 #else
     INT64 a;
     INT64 b;
@@ -346,8 +347,8 @@
     b = (2*act) + cpi->activity_avg;
 
     x->rdmult = (unsigned int)(((INT64)x->rdmult*b + (a>>1))/a);
-    x->errorperbit = x->rdmult/x->rddiv;
-
+    x->errorperbit = x->rdmult * 100 /(110 * x->rddiv);
+    x->errorperbit += (x->errorperbit==0);
 #endif
 
     // Activity based Zbin adjustment
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -238,7 +238,7 @@
                 (cpi->RDMULT * rd_iifactor[cpi->twopass.next_iiratio]) >> 4;
     }
 
-    cpi->mb.errorperbit = (cpi->RDMULT / 100);
+    cpi->mb.errorperbit = (cpi->RDMULT / 110);
     cpi->mb.errorperbit += (cpi->mb.errorperbit==0);
 
     vp8_set_speed_features(cpi);
--