summaryrefslogtreecommitdiffstats
path: root/third_party/aom/aom_dsp/bitreader.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/aom_dsp/bitreader.h')
-rw-r--r--third_party/aom/aom_dsp/bitreader.h62
1 files changed, 11 insertions, 51 deletions
diff --git a/third_party/aom/aom_dsp/bitreader.h b/third_party/aom/aom_dsp/bitreader.h
index 9cd34dd48..5bad70cb3 100644
--- a/third_party/aom/aom_dsp/bitreader.h
+++ b/third_party/aom/aom_dsp/bitreader.h
@@ -16,18 +16,13 @@
#include <limits.h>
#include "./aom_config.h"
-#if CONFIG_EC_ADAPT && !CONFIG_EC_MULTISYMBOL
-#error "CONFIG_EC_ADAPT is enabled without enabling CONFIG_EC_MULTISYMBOL."
-#endif
#include "aom/aomdx.h"
#include "aom/aom_integer.h"
#if CONFIG_ANS
#include "aom_dsp/ansreader.h"
-#elif CONFIG_DAALA_EC
-#include "aom_dsp/daalaboolreader.h"
#else
-#include "aom_dsp/dkboolreader.h"
+#include "aom_dsp/daalaboolreader.h"
#endif
#include "aom_dsp/prob.h"
#include "av1/common/odintrin.h"
@@ -61,26 +56,20 @@ extern "C" {
#if CONFIG_ANS
typedef struct AnsDecoder aom_reader;
-#elif CONFIG_DAALA_EC
-typedef struct daala_reader aom_reader;
#else
-typedef struct aom_dk_reader aom_reader;
+typedef struct daala_reader aom_reader;
#endif
static INLINE int aom_reader_init(aom_reader *r, const uint8_t *buffer,
size_t size, aom_decrypt_cb decrypt_cb,
void *decrypt_state) {
-#if CONFIG_ANS
(void)decrypt_cb;
(void)decrypt_state;
+#if CONFIG_ANS
if (size > INT_MAX) return 1;
return ans_read_init(r, buffer, (int)size);
-#elif CONFIG_DAALA_EC
- (void)decrypt_cb;
- (void)decrypt_state;
- return aom_daala_reader_init(r, buffer, (int)size);
#else
- return aom_dk_reader_init(r, buffer, size, decrypt_cb, decrypt_state);
+ return aom_daala_reader_init(r, buffer, (int)size);
#endif
}
@@ -89,20 +78,16 @@ static INLINE const uint8_t *aom_reader_find_end(aom_reader *r) {
(void)r;
assert(0 && "Use the raw buffer size with ANS");
return NULL;
-#elif CONFIG_DAALA_EC
- return aom_daala_reader_find_end(r);
#else
- return aom_dk_reader_find_end(r);
+ return aom_daala_reader_find_end(r);
#endif
}
static INLINE int aom_reader_has_error(aom_reader *r) {
#if CONFIG_ANS
return ans_reader_has_error(r);
-#elif CONFIG_DAALA_EC
- return aom_daala_reader_has_error(r);
#else
- return aom_dk_reader_has_error(r);
+ return aom_daala_reader_has_error(r);
#endif
}
@@ -112,10 +97,8 @@ static INLINE uint32_t aom_reader_tell(const aom_reader *r) {
(void)r;
assert(0 && "aom_reader_tell() is unimplemented for ANS");
return 0;
-#elif CONFIG_DAALA_EC
- return aom_daala_reader_tell(r);
#else
- return aom_dk_reader_tell(r);
+ return aom_daala_reader_tell(r);
#endif
}
@@ -125,10 +108,8 @@ static INLINE uint32_t aom_reader_tell_frac(const aom_reader *r) {
(void)r;
assert(0 && "aom_reader_tell_frac() is unimplemented for ANS");
return 0;
-#elif CONFIG_DAALA_EC
- return aom_daala_reader_tell_frac(r);
#else
- return aom_dk_reader_tell_frac(r);
+ return aom_daala_reader_tell_frac(r);
#endif
}
@@ -155,10 +136,8 @@ static INLINE int aom_read_(aom_reader *r, int prob ACCT_STR_PARAM) {
int ret;
#if CONFIG_ANS
ret = rabs_read(r, prob);
-#elif CONFIG_DAALA_EC
- ret = aom_daala_read(r, prob);
#else
- ret = aom_dk_read(r, prob);
+ ret = aom_daala_read(r, prob);
#endif
#if CONFIG_ACCOUNTING
if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
@@ -171,7 +150,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 && CONFIG_RAWBITS
+#elif CONFIG_RAWBITS
// Note this uses raw bits and is not the same as aom_daala_read(r, 128);
// Calls to this function are omitted from raw symbol accounting.
ret = aom_daala_read_bit(r);
@@ -194,28 +173,14 @@ static INLINE int aom_read_literal_(aom_reader *r, int bits ACCT_STR_PARAM) {
return literal;
}
-static INLINE int aom_read_tree_as_bits(aom_reader *r,
- const aom_tree_index *tree,
- const aom_prob *probs) {
- aom_tree_index i = 0;
-
- while ((i = tree[i + aom_read(r, probs[i >> 1], NULL)]) > 0) continue;
- return -i;
-}
-
-#if CONFIG_EC_MULTISYMBOL
static INLINE int aom_read_cdf_(aom_reader *r, const aom_cdf_prob *cdf,
int nsymbs ACCT_STR_PARAM) {
int ret;
#if CONFIG_ANS
(void)nsymbs;
ret = rans_read(r, cdf);
-#elif CONFIG_DAALA_EC
- ret = daala_read_symbol(r, cdf, nsymbs);
#else
-#error \
- "CONFIG_EC_MULTISYMBOL is selected without a valid backing entropy " \
- "coder. Enable daala_ec or ans for a valid configuration."
+ ret = daala_read_symbol(r, cdf, nsymbs);
#endif
#if CONFIG_ACCOUNTING
@@ -253,16 +218,11 @@ static INLINE int aom_read_tree_as_cdf(aom_reader *r,
} while (i > 0);
return -i;
}
-#endif // CONFIG_EC_MULTISYMBOL
static INLINE int aom_read_tree_(aom_reader *r, const aom_tree_index *tree,
const aom_prob *probs ACCT_STR_PARAM) {
int ret;
-#if CONFIG_EC_MULTISYMBOL
ret = aom_read_tree_as_cdf(r, tree, probs);
-#else
- ret = aom_read_tree_as_bits(r, tree, probs);
-#endif
#if CONFIG_ACCOUNTING
if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
#endif