Commit 08c99eb3 authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge
Browse files

Explicitly call daala read/write bit functions.

Calling aom_write_bit() and aom_read_bit() with --enable-daala_ec
 would call aom_write() and aom_read() with probability 128 which
 would ultimately call od_ec_enc_bits() and od_ec_dec_bits().
This refactors that code and makes the call explicit.

objective-1-fast:
master@2016-12-14T18:38:33Z -> daala_ec_bits@2016-12-14T18:36:22Z

    PSNR | PSNR Cb | PSNR Cr | PSNR HVS |   SSIM | MS SSIM | CIEDE 2000
  0.0000 |  0.0000 |  0.0000 |   0.0000 | 0.0000 |  0.0000 |     0.0000

Change-Id: Ib69e98734fadcdc8b89936b7b6fbd0574afc7e34
parent 90b305a9
......@@ -163,6 +163,9 @@ static INLINE int aom_read_bit_(aom_reader *r ACCT_STR_PARAM) {
int ret;
#if CONFIG_ANS
ret = uabs_read_bit(r); // Non trivial optimization at half probability
#elif CONFIG_DAALA_EC
// Note this uses raw bits and is not the same as aom_daala_read(r, 128);
ret = aom_daala_read_bit(r);
#else
ret = aom_read(r, 128, NULL); // aom_prob_half
#endif
......
......@@ -94,6 +94,7 @@ static INLINE void aom_write(aom_writer *br, int bit, int probability) {
#if CONFIG_ANS
buf_uabs_write(br, bit, probability);
#elif CONFIG_DAALA_EC
// Note this uses raw bits and is not the same as aom_daala_write(r, 128);
aom_daala_write(br, bit, probability);
#else
aom_dk_write(br, bit, probability);
......@@ -111,7 +112,11 @@ static INLINE void aom_write_record(aom_writer *br, int bit, int probability,
}
static INLINE void aom_write_bit(aom_writer *w, int bit) {
#if CONFIG_DAALA_EC
aom_daala_write_bit(w, bit);
#else
aom_write(w, bit, 128); // aom_prob_half
#endif
}
static INLINE void aom_write_bit_record(aom_writer *w, int bit,
......
......@@ -57,11 +57,7 @@ static INLINE int aom_daala_read(daala_reader *r, int prob) {
}*/
#endif
if (prob == 128) {
bit = od_ec_dec_bits(&r->ec, 1, "aom_bits");
} else {
bit = od_ec_decode_bool_q15(&r->ec, p);
}
#if CONFIG_BITSTREAM_DEBUG
{
......@@ -101,7 +97,7 @@ static INLINE int aom_daala_read(daala_reader *r, int prob) {
}
static INLINE int aom_daala_read_bit(daala_reader *r) {
return aom_daala_read(r, 128);
return od_ec_dec_bits(&r->ec, 1, "aom_bits");
}
static INLINE int aom_daala_reader_has_error(daala_reader *r) {
......
......@@ -50,11 +50,11 @@ static INLINE void aom_daala_write(daala_writer *w, int bit, int prob) {
bitstream_queue_push(bit, cdf, 2);
#endif
if (prob == 128) {
od_ec_enc_bits(&w->ec, bit, 1);
} else {
od_ec_encode_bool_q15(&w->ec, bit, p);
}
}
static INLINE void aom_daala_write_bit(daala_writer *w, int bit) {
od_ec_enc_bits(&w->ec, bit, 1);
}
static INLINE void daala_write_symbol(daala_writer *w, int symb,
......
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