Decoder performance improvement with daala_ec.
Cherry-pick Daala b5020bee:
Remove redundant test in od_ec_decode_bool_q15().
Using a test that decodes 100M random binary symbols, making this change
produced a speed up of 8.81% with gcc-4.9.3 and 3.71% with clang-3.7.1,
both compiled with -O2.
Change-Id: If6d0077a56121a575ae53bcd4d1d9b7d800a317d
diff --git a/aom_dsp/entdec.c b/aom_dsp/entdec.c
index 3f2feab..18563b2 100644
--- a/aom_dsp/entdec.c
+++ b/aom_dsp/entdec.c
@@ -206,6 +206,7 @@
od_ec_window dif;
od_ec_window vw;
unsigned r;
+ unsigned r_new;
unsigned v;
int ret;
OD_ASSERT(0 < fz);
@@ -216,10 +217,14 @@
OD_ASSERT(32768U <= r);
v = fz * (uint32_t)r >> 15;
vw = (od_ec_window)v << (OD_EC_WINDOW_SIZE - 16);
- ret = dif >= vw;
- if (ret) dif -= vw;
- r = ret ? r - v : v;
- return od_ec_dec_normalize(dec, dif, r, ret);
+ ret = 0;
+ r_new = v;
+ if (dif >= vw) {
+ r_new = r - v;
+ dif -= vw;
+ ret = 1;
+ }
+ return od_ec_dec_normalize(dec, dif, r_new, ret);
}
/*Decodes a symbol given a cumulative distribution function (CDF) table.
diff --git a/aom_dsp/intrapred.c b/aom_dsp/intrapred.c
index b513dc5..29b5a74 100644
--- a/aom_dsp/intrapred.c
+++ b/aom_dsp/intrapred.c
@@ -338,6 +338,7 @@
const int I = above[0];
const int J = above[1];
const int K = above[2];
+ (void)left;
dst[0] = AVG3(H, I, J);
dst[1] = AVG3(I, J, K);