Commit 5357dcaf authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Yaowu Xu

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
parent 91219941
......@@ -206,6 +206,7 @@ int od_ec_decode_bool_q15(od_ec_dec *dec, unsigned fz) {
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 @@ int od_ec_decode_bool_q15(od_ec_dec *dec, unsigned fz) {
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.
......
......@@ -338,6 +338,7 @@ void aom_ve_predictor_2x2_c(uint8_t *dst, ptrdiff_t stride,
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment