Commit 9ade3940 authored by Jonathan Matthews's avatar Jonathan Matthews
Browse files

lv_map_multi: make entropy consistent

BUG=aomedia:1060

Change-Id: I051ff95b411cb27b0025cd634b5c599199ed082d
parent 625e50bd
......@@ -157,6 +157,7 @@ int od_ec_decode_bool_q15(od_ec_dec *dec, unsigned f) {
OD_ASSERT(dif >> (OD_EC_WINDOW_SIZE - 16) < r);
OD_ASSERT(32768U <= r);
v = ((r >> 8) * (uint32_t)(f >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT));
v += EC_MIN_PROB;
vw = (od_ec_window)v << (OD_EC_WINDOW_SIZE - 16);
ret = 1;
r_new = v;
......
......@@ -190,6 +190,7 @@ void od_ec_encode_bool_q15(od_ec_enc *enc, int val, unsigned f) {
r = enc->rng;
OD_ASSERT(32768U <= r);
v = ((r >> 8) * (uint32_t)(f >> EC_PROB_SHIFT) >> (7 - EC_PROB_SHIFT));
v += EC_MIN_PROB;
if (val) l += r - v;
r = val ? v : r - v;
od_ec_enc_normalize(enc, l, r);
......
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