diff options
Diffstat (limited to 'third_party/aom/aom_dsp/bitwriter.h')
-rw-r--r-- | third_party/aom/aom_dsp/bitwriter.h | 63 |
1 files changed, 7 insertions, 56 deletions
diff --git a/third_party/aom/aom_dsp/bitwriter.h b/third_party/aom/aom_dsp/bitwriter.h index 6e3fac260..588e47bf3 100644 --- a/third_party/aom/aom_dsp/bitwriter.h +++ b/third_party/aom/aom_dsp/bitwriter.h @@ -14,16 +14,11 @@ #include <assert.h> #include "./aom_config.h" -#if CONFIG_EC_ADAPT && !CONFIG_EC_MULTISYMBOL -#error "CONFIG_EC_ADAPT is enabled without enabling CONFIG_EC_MULTISYMBOL" -#endif #if CONFIG_ANS #include "aom_dsp/buf_ans.h" -#elif CONFIG_DAALA_EC -#include "aom_dsp/daalaboolwriter.h" #else -#include "aom_dsp/dkboolwriter.h" +#include "aom_dsp/daalaboolwriter.h" #endif #include "aom_dsp/prob.h" @@ -38,10 +33,8 @@ extern "C" { #if CONFIG_ANS typedef struct BufAnsCoder aom_writer; -#elif CONFIG_DAALA_EC -typedef struct daala_writer aom_writer; #else -typedef struct aom_dk_writer aom_writer; +typedef struct daala_writer aom_writer; #endif typedef struct TOKEN_STATS { @@ -72,10 +65,8 @@ static INLINE void aom_start_encode(aom_writer *bc, uint8_t *buffer) { (void)bc; (void)buffer; assert(0 && "buf_ans requires a more complicated startup procedure"); -#elif CONFIG_DAALA_EC - aom_daala_start_encode(bc, buffer); #else - aom_dk_start_encode(bc, buffer); + aom_daala_start_encode(bc, buffer); #endif } @@ -83,20 +74,16 @@ static INLINE void aom_stop_encode(aom_writer *bc) { #if CONFIG_ANS (void)bc; assert(0 && "buf_ans requires a more complicated shutdown procedure"); -#elif CONFIG_DAALA_EC - aom_daala_stop_encode(bc); #else - aom_dk_stop_encode(bc); + aom_daala_stop_encode(bc); #endif } 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 - aom_daala_write(br, bit, probability); #else - aom_dk_write(br, bit, probability); + aom_daala_write(br, bit, probability); #endif } @@ -113,7 +100,7 @@ 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 && CONFIG_RAWBITS +#elif 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 @@ -137,28 +124,6 @@ static INLINE void aom_write_literal(aom_writer *w, int data, int bits) { for (bit = bits - 1; bit >= 0; bit--) aom_write_bit(w, 1 & (data >> bit)); } -static INLINE void aom_write_tree_as_bits(aom_writer *w, - const aom_tree_index *tr, - const aom_prob *probs, int bits, - int len, aom_tree_index i) { - do { - const int bit = (bits >> --len) & 1; - aom_write(w, bit, probs[i >> 1]); - i = tr[i + bit]; - } while (len); -} - -static INLINE void aom_write_tree_as_bits_record( - aom_writer *w, const aom_tree_index *tr, const aom_prob *probs, int bits, - int len, aom_tree_index i, TOKEN_STATS *token_stats) { - do { - const int bit = (bits >> --len) & 1; - aom_write_record(w, bit, probs[i >> 1], token_stats); - i = tr[i + bit]; - } while (len); -} - -#if CONFIG_EC_MULTISYMBOL static INLINE void aom_write_cdf(aom_writer *w, int symb, const aom_cdf_prob *cdf, int nsymbs) { #if CONFIG_ANS @@ -167,12 +132,8 @@ static INLINE void aom_write_cdf(aom_writer *w, int symb, const aom_cdf_prob cum_prob = symb > 0 ? cdf[symb - 1] : 0; const aom_cdf_prob prob = cdf[symb] - cum_prob; buf_rans_write(w, cum_prob, prob); -#elif CONFIG_DAALA_EC - daala_write_symbol(w, symb, cdf, nsymbs); #else -#error \ - "CONFIG_EC_MULTISYMBOL is selected without a valid backing entropy " \ - "coder. Enable daala_ec or ans for a valid configuration." + daala_write_symbol(w, symb, cdf, nsymbs); #endif } @@ -223,16 +184,10 @@ static INLINE void aom_write_tree_as_cdf(aom_writer *w, } while (len); } -#endif // CONFIG_EC_MULTISYMBOL - static INLINE void aom_write_tree(aom_writer *w, const aom_tree_index *tree, const aom_prob *probs, int bits, int len, aom_tree_index i) { -#if CONFIG_EC_MULTISYMBOL aom_write_tree_as_cdf(w, tree, probs, bits, len, i); -#else - aom_write_tree_as_bits(w, tree, probs, bits, len, i); -#endif } static INLINE void aom_write_tree_record(aom_writer *w, @@ -240,12 +195,8 @@ static INLINE void aom_write_tree_record(aom_writer *w, const aom_prob *probs, int bits, int len, aom_tree_index i, TOKEN_STATS *token_stats) { -#if CONFIG_EC_MULTISYMBOL (void)token_stats; aom_write_tree_as_cdf(w, tree, probs, bits, len, i); -#else - aom_write_tree_as_bits_record(w, tree, probs, bits, len, i, token_stats); -#endif } #ifdef __cplusplus |