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
diff --git a/av1/decoder/generic_decoder.c b/av1/decoder/generic_decoder.c
index 719f72c..7f7fbca 100644
--- a/av1/decoder/generic_decoder.c
+++ b/av1/decoder/generic_decoder.c
@@ -131,11 +131,9 @@
/* 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;
diff --git a/av1/encoder/generic_encoder.c b/av1/encoder/generic_encoder.c
index b67e042..25b6f50 100644
--- a/av1/encoder/generic_encoder.c
+++ b/av1/encoder/generic_encoder.c
@@ -135,12 +135,8 @@
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);