Commit 24f1a904 authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge

Add flag for RAWBITS to use raw bits with DAALA_EC.

The use of raw bits is now disabled by default and can be turned on with:
 ./configure --enable-experimental --enable-rawbits
This commit has a negligible impact on rate.

subset1:

master@2017-02-14T18:57:22.282Z -> no_rawbits@2017-02-14T18:57:41.977Z

   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

objective-1-fast:

master@2017-02-14T18:52:48.425Z -> no_rawbits@2017-02-14T18:52:04.489Z

   PSNR | PSNR Cb | PSNR Cr | PSNR HVS |    SSIM | MS SSIM | CIEDE 2000
-0.0001 | -0.0001 | -0.0001 |  -0.0001 | -0.0001 | -0.0001 |    -0.0001

Change-Id: I01e79e9f314565a64b224ca41047f7bd7fe33f70
parent 338e135c
...@@ -167,7 +167,7 @@ static INLINE int aom_read_bit_(aom_reader *r ACCT_STR_PARAM) { ...@@ -167,7 +167,7 @@ static INLINE int aom_read_bit_(aom_reader *r ACCT_STR_PARAM) {
int ret; int ret;
#if CONFIG_ANS #if CONFIG_ANS
ret = rabs_read_bit(r); // Non trivial optimization at half probability ret = rabs_read_bit(r); // Non trivial optimization at half probability
#elif CONFIG_DAALA_EC #elif CONFIG_DAALA_EC && CONFIG_RAWBITS
// Note this uses raw bits and is not the same as aom_daala_read(r, 128); // Note this uses raw bits and is not the same as aom_daala_read(r, 128);
ret = aom_daala_read_bit(r); ret = aom_daala_read_bit(r);
#else #else
......
...@@ -94,7 +94,6 @@ static INLINE void aom_write(aom_writer *br, int bit, int probability) { ...@@ -94,7 +94,6 @@ static INLINE void aom_write(aom_writer *br, int bit, int probability) {
#if CONFIG_ANS #if CONFIG_ANS
buf_rabs_write(br, bit, probability); buf_rabs_write(br, bit, probability);
#elif CONFIG_DAALA_EC #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); aom_daala_write(br, bit, probability);
#else #else
aom_dk_write(br, bit, probability); aom_dk_write(br, bit, probability);
...@@ -114,7 +113,8 @@ static INLINE void aom_write_record(aom_writer *br, int bit, int probability, ...@@ -114,7 +113,8 @@ static INLINE void aom_write_record(aom_writer *br, int bit, int probability,
static INLINE void aom_write_bit(aom_writer *w, int bit) { static INLINE void aom_write_bit(aom_writer *w, int bit) {
#if CONFIG_ANS #if CONFIG_ANS
buf_rabs_write_bit(w, bit); buf_rabs_write_bit(w, bit);
#elif CONFIG_DAALA_EC #elif CONFIG_DAALA_EC && CONFIG_RAWBITS
// Note this uses raw bits and is not the same as aom_daala_write(r, 128);
aom_daala_write_bit(w, bit); aom_daala_write_bit(w, bit);
#else #else
aom_write(w, bit, 128); // aom_prob_half aom_write(w, bit, 128); // aom_prob_half
......
...@@ -96,9 +96,11 @@ static INLINE int aom_daala_read(daala_reader *r, int prob) { ...@@ -96,9 +96,11 @@ static INLINE int aom_daala_read(daala_reader *r, int prob) {
return bit; return bit;
} }
#if CONFIG_RAWBITS
static INLINE int aom_daala_read_bit(daala_reader *r) { static INLINE int aom_daala_read_bit(daala_reader *r) {
return od_ec_dec_bits(&r->ec, 1, "aom_bits"); return od_ec_dec_bits(&r->ec, 1, "aom_bits");
} }
#endif
static INLINE int aom_daala_reader_has_error(daala_reader *r) { static INLINE int aom_daala_reader_has_error(daala_reader *r) {
return r->ec.error; return r->ec.error;
......
...@@ -53,9 +53,11 @@ static INLINE void aom_daala_write(daala_writer *w, int bit, int prob) { ...@@ -53,9 +53,11 @@ static INLINE void aom_daala_write(daala_writer *w, int bit, int prob) {
od_ec_encode_bool_q15(&w->ec, bit, p); od_ec_encode_bool_q15(&w->ec, bit, p);
} }
#if CONFIG_RAWBITS
static INLINE void aom_daala_write_bit(daala_writer *w, int bit) { static INLINE void aom_daala_write_bit(daala_writer *w, int bit) {
od_ec_enc_bits(&w->ec, bit, 1); od_ec_enc_bits(&w->ec, bit, 1);
} }
#endif
static INLINE void daala_write_symbol(daala_writer *w, int symb, static INLINE void daala_write_symbol(daala_writer *w, int symb,
const aom_cdf_prob *cdf, int nsymbs) { const aom_cdf_prob *cdf, int nsymbs) {
......
...@@ -411,6 +411,7 @@ int od_ec_decode_cdf_q15(od_ec_dec *dec, const uint16_t *cdf, int nsyms) { ...@@ -411,6 +411,7 @@ int od_ec_decode_cdf_q15(od_ec_dec *dec, const uint16_t *cdf, int nsyms) {
return od_ec_decode_cdf_unscaled_dyadic(dec, cdf, nsyms, 15); return od_ec_decode_cdf_unscaled_dyadic(dec, cdf, nsyms, 15);
} }
#if CONFIG_RAWBITS
/*Extracts a raw unsigned integer with a non-power-of-2 range from the stream. /*Extracts a raw unsigned integer with a non-power-of-2 range from the stream.
The integer must have been encoded with od_ec_enc_uint(). The integer must have been encoded with od_ec_enc_uint().
ft: The number of integers that can be decoded (one more than the max). ft: The number of integers that can be decoded (one more than the max).
...@@ -471,6 +472,7 @@ uint32_t od_ec_dec_bits_(od_ec_dec *dec, unsigned ftb) { ...@@ -471,6 +472,7 @@ uint32_t od_ec_dec_bits_(od_ec_dec *dec, unsigned ftb) {
dec->nend_bits = available; dec->nend_bits = available;
return ret; return ret;
} }
#endif
/*Returns the number of bits "used" by the decoded symbols so far. /*Returns the number of bits "used" by the decoded symbols so far.
This same number can be computed in either the encoder or the decoder, and is This same number can be computed in either the encoder or the decoder, and is
......
...@@ -390,6 +390,7 @@ void od_ec_encode_cdf_unscaled_dyadic(od_ec_enc *enc, int s, ...@@ -390,6 +390,7 @@ void od_ec_encode_cdf_unscaled_dyadic(od_ec_enc *enc, int s,
cdf[s] << (15 - ftb)); cdf[s] << (15 - ftb));
} }
#if CONFIG_RAWBITS
/*Encodes a raw unsigned integer in the stream. /*Encodes a raw unsigned integer in the stream.
fl: The integer to encode. fl: The integer to encode.
ft: The number of integers that can be encoded (one more than the max). ft: The number of integers that can be encoded (one more than the max).
...@@ -463,6 +464,7 @@ void od_ec_enc_bits(od_ec_enc *enc, uint32_t fl, unsigned ftb) { ...@@ -463,6 +464,7 @@ void od_ec_enc_bits(od_ec_enc *enc, uint32_t fl, unsigned ftb) {
enc->end_window = end_window; enc->end_window = end_window;
enc->nend_bits = nend_bits; enc->nend_bits = nend_bits;
} }
#endif
/*Overwrites a few bits at the very start of an existing stream, after they /*Overwrites a few bits at the very start of an existing stream, after they
have already been encoded. have already been encoded.
......
...@@ -285,6 +285,7 @@ EXPERIMENT_LIST=" ...@@ -285,6 +285,7 @@ EXPERIMENT_LIST="
alt_intra alt_intra
palette palette
daala_ec daala_ec
rawbits
pvq pvq
cb4x4 cb4x4
frame_size frame_size
...@@ -491,6 +492,10 @@ post_process_cmdline() { ...@@ -491,6 +492,10 @@ post_process_cmdline() {
enabled ec_multisymbol && ! enabled ans && soft_enable daala_ec enabled ec_multisymbol && ! enabled ans && soft_enable daala_ec
enabled ec_multisymbol && ! enabled daala_ec && soft_enable ans enabled ec_multisymbol && ! enabled daala_ec && soft_enable ans
enabled daala_ec && enable_feature ec_multisymbol enabled daala_ec && enable_feature ec_multisymbol
if enabled rawbits && ! enabled daala_ec; then
log_echo "rawbits requires daala_ec, so disabling rawbits"
disable_feature rawbits
fi
if enabled ext_tile; then if enabled ext_tile; then
log_echo "ext_tile not compatible with reference_buffer, so" log_echo "ext_tile not compatible with reference_buffer, so"
log_echo "disabling reference_buffer" log_echo "disabling reference_buffer"
......
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