Commit 8fcfcc57 authored by Nathan E. Egge's avatar Nathan E. Egge
Browse files

Use aom_reader / aom_writer API to code lsb.

The functions generic_encode() and generic_decode() code the lsb values
 as raw bits using the od_ec_enc_bits() and od_ec_dec_bits() functions.
These code bits in the reverse order as the aom_write_literal() and
 aom_read_literal() functions, so both the encoder and decoder must
 be changed at the same time.
This commit has no impact on metrics but is a bitstream change.

Change-Id: I83546e2d4b73c28a7f269ddc850742df53d227ce
parent d998a007
......@@ -131,11 +131,9 @@ int generic_decode_(aom_reader *r, generic_encoder *model, int max,
/* Because of the rounding, there's only half the number of possibilities
for xs=0 */
special = xs == 0;
#if CONFIG_DAALA_EC
if (shift - special > 0) lsb = od_ec_dec_bits(&r->ec, shift - special, acc_str);
#else
# error "CONFIG_PVQ currently requires CONFIG_DAALA_EC."
#endif
if (shift - special > 0) {
lsb = aom_read_literal(r, shift - special, acc_str);
}
lsb -= !special << (shift - 1);
}
x = (xs << shift) + lsb;
......
......@@ -135,12 +135,8 @@ void generic_encode(aom_writer *w, generic_encoder *model, int x, int max,
for xs=0. */
special = xs == 0;
if (shift - special > 0) {
#if CONFIG_DAALA_EC
od_ec_enc_bits(&w->ec, x - (xs << shift) + (!special << (shift - 1)),
aom_write_literal(w, x - (xs << shift) + (!special << (shift - 1)),
shift - special);
#else
# error "CONFIG_PVQ currently requires CONFIG_DAALA_EC."
#endif
}
}
generic_model_update(model, ex_q16, x, xs, id, integration);
......
Supports Markdown
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