Skip to content
Snippets Groups Projects
Commit 39d69bc0 authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge
Browse files

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 11206c60
No related branches found
No related tags found
2 merge requests!6Rav1e 11 yushin 1,!3Rav1e 10 yushin
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment