Commit c98d2863 authored by Nathan E. Egge's avatar Nathan E. Egge
Browse files

Add API for coding symbols with unscaled CDFs.

Add aom_write_symbol_unscaled() and aom_read_symbol_unscaled() calls
 for encoding and decoding symbols with non-dyadic CDFs, e.g. that
 don't add up to 32768.
This currently only works with the DAALA_EC backend, but does support
 AOM bit accounting.

Change-Id: Icb37500f1b051dd2e8893ff0920302ece1d6ccfd
parent fddd3eb6
......@@ -54,6 +54,8 @@
aom_read_tree_bits_(r, tree, probs ACCT_STR_ARG(ACCT_STR_NAME))
#define aom_read_symbol(r, cdf, nsymbs, ACCT_STR_NAME) \
aom_read_symbol_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
#define aom_read_symbol_unscaled(r, cdf, nsymbs, ACCT_STR_NAME) \
aom_read_symbol_unscaled_(r, cdf, nsymbs ACCT_STR_ARG(ACCT_STR_NAME))
#ifdef __cplusplus
extern "C" {
......@@ -242,6 +244,24 @@ static INLINE int aom_read_symbol_(aom_reader *r, aom_cdf_prob *cdf,
#endif
return ret;
}
#if CONFIG_PVQ
static INLINE int aom_read_symbol_unscaled_(aom_reader *r,
const aom_cdf_prob *cdf,
int nsymbs ACCT_STR_PARAM) {
int ret;
#if CONFIG_DAALA_EC
ret = od_ec_decode_cdf_unscaled(&r->ec, cdf, nsymbs);
#else
#error "CONFIG_PVQ currently requires CONFIG_DAALA_EC."
#endif
#if CONFIG_ACCOUNTING
if (ACCT_STR_NAME) aom_process_accounting(r, ACCT_STR_NAME);
#endif
return ret;
}
#endif
#endif // CONFIG_EC_MULTISYMBOL
#ifdef __cplusplus
......
......@@ -204,6 +204,18 @@ static INLINE void aom_write_symbol(aom_writer *w, int symb, aom_cdf_prob *cdf,
update_cdf(cdf, symb, nsymbs);
#endif
}
#if CONFIG_PVQ
static INLINE void aom_write_symbol_unscaled(aom_writer *w, int symb,
const aom_cdf_prob *cdf,
int nsymbs) {
#if CONFIG_DAALA_EC
od_ec_encode_cdf_unscaled(&w->ec, symb, cdf, nsymbs);
#else
#error "CONFIG_PVQ currently requires CONFIG_DAALA_EC."
#endif
}
#endif
#endif // CONFIG_EC_MULTISYMBOL
#ifdef __cplusplus
......
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