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) {
int ret;
#if CONFIG_ANS
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);
ret = aom_daala_read_bit(r);
#else
......
......@@ -94,7 +94,6 @@ static INLINE void aom_write(aom_writer *br, int bit, int probability) {
#if CONFIG_ANS
buf_rabs_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);
......@@ -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) {
#if CONFIG_ANS
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);
#else
aom_write(w, bit, 128); // aom_prob_half
......
......@@ -96,9 +96,11 @@ static INLINE int aom_daala_read(daala_reader *r, int prob) {
return bit;
}
#if CONFIG_RAWBITS
static INLINE int aom_daala_read_bit(daala_reader *r) {
return od_ec_dec_bits(&r->ec, 1, "aom_bits");
}
#endif
static INLINE int aom_daala_reader_has_error(daala_reader *r) {
return r->ec.error;
......
......@@ -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);
}
#if CONFIG_RAWBITS
static INLINE void aom_daala_write_bit(daala_writer *w, int bit) {
od_ec_enc_bits(&w->ec, bit, 1);
}
#endif
static INLINE void daala_write_symbol(daala_writer *w, int symb,
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) {
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.
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).
......@@ -471,6 +472,7 @@ uint32_t od_ec_dec_bits_(od_ec_dec *dec, unsigned ftb) {
dec->nend_bits = available;
return ret;
}
#endif
/*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
......
......@@ -390,6 +390,7 @@ void od_ec_encode_cdf_unscaled_dyadic(od_ec_enc *enc, int s,
cdf[s] << (15 - ftb));
}
#if CONFIG_RAWBITS
/*Encodes a raw unsigned integer in the stream.
fl: The integer to encode.
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) {
enc->end_window = end_window;
enc->nend_bits = nend_bits;
}
#endif
/*Overwrites a few bits at the very start of an existing stream, after they
have already been encoded.
......
......@@ -285,6 +285,7 @@ EXPERIMENT_LIST="
alt_intra
palette
daala_ec
rawbits
pvq
cb4x4
frame_size
......@@ -491,6 +492,10 @@ post_process_cmdline() {
enabled ec_multisymbol && ! enabled ans && soft_enable daala_ec
enabled ec_multisymbol && ! enabled daala_ec && soft_enable ans
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
log_echo "ext_tile not compatible with reference_buffer, so"
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