Commit 33590f8c authored by Alex Converse's avatar Alex Converse

Rename rans_dec_lut to rans_lut

It's used in both encoding and decoding. Matches (historical)
implementation in aom/master.

Change-Id: Ib009b6b6023cfe69e99a0a92f3c70f4416fcdb47
parent 7fe2ae8e
......@@ -39,8 +39,6 @@ typedef uint16_t AnsP10;
// This is now just a boring cdf. It starts with an explicit zero.
// TODO(aconverse): Remove starting zero.
typedef uint16_t rans_lut[16];
// TODO(aconverse): Update callers and remove this shim
#define rans_dec_lut rans_lut
void aom_rans_build_cdf_from_pdf(const AnsP10 token_probs[], rans_lut cdf_tab);
......
......@@ -2801,7 +2801,7 @@ void av1_model_to_full_probs(const aom_prob *model, aom_prob *full) {
}
#if CONFIG_ANS
void av1_build_token_cdfs(const aom_prob *pdf_model, rans_dec_lut cdf) {
void av1_build_token_cdfs(const aom_prob *pdf_model, rans_lut cdf) {
AnsP10 pdf_tab[ENTROPY_TOKENS - 1];
assert(pdf_model[2] != 0);
// TODO(aconverse): Investigate making the precision of the zero and EOB tree
......
......@@ -192,7 +192,7 @@ extern const aom_prob av1_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES];
extern const AnsP10 av1_pareto8_token_probs[COEFF_PROB_MODELS]
[ENTROPY_TOKENS - 2];
typedef rans_dec_lut coeff_cdf_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS];
typedef rans_lut coeff_cdf_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS];
#endif // CONFIG_ANS
typedef aom_prob av1_coeff_probs_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
......
......@@ -265,10 +265,10 @@ static int decode_coefs_ans(const MACROBLOCKD *const xd, PLANE_TYPE type,
const int tx_size_ctx = txsize_sqr_map[tx_size];
const aom_prob(*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
fc->coef_probs[tx_size_ctx][type][ref];
const rans_dec_lut(*coef_cdfs)[COEFF_CONTEXTS] =
const rans_lut(*coef_cdfs)[COEFF_CONTEXTS] =
fc->coef_cdfs[tx_size_ctx][type][ref];
const aom_prob *prob;
const rans_dec_lut *cdf;
const rans_lut *cdf;
unsigned int(*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1];
unsigned int(*eob_branch_count)[COEFF_CONTEXTS];
uint8_t token_cache[MAX_TX_SQUARE];
......
......@@ -738,7 +738,7 @@ static void pack_mb_tokens(struct BufAnsCoder *ans, const TOKENEXTRA **tp,
if (t != EOB_TOKEN) {
struct rans_sym s;
const rans_dec_lut *token_cdf = p->token_cdf;
const rans_lut *token_cdf = p->token_cdf;
assert(token_cdf);
s.cum_prob = (*token_cdf)[t - ZERO_TOKEN];
s.prob = (*token_cdf)[t - ZERO_TOKEN + 1] - s.cum_prob;
......
......@@ -145,7 +145,7 @@ static void cost(int *costs, aom_tree tree, const aom_prob *probs, int i,
#if CONFIG_ANS
void av1_cost_tokens_ans(int *costs, const aom_prob *tree_probs,
const rans_dec_lut token_cdf, int skip_eob) {
const rans_lut token_cdf, int skip_eob) {
int c_tree = 0; // Cost of the "tree" nodes EOB and ZERO.
int i;
costs[EOB_TOKEN] = av1_cost_bit(tree_probs[0], 0);
......
......@@ -60,7 +60,7 @@ void av1_cost_tokens_skip(int *costs, const aom_prob *probs, aom_tree tree);
#if CONFIG_ANS
void av1_cost_tokens_ans(int *costs, const aom_prob *tree_probs,
const rans_dec_lut token_cdf, int skip_eob);
const rans_lut token_cdf, int skip_eob);
#endif
#ifdef __cplusplus
......
......@@ -363,7 +363,7 @@ static void set_entropy_context_b(int plane, int block, int blk_row,
static INLINE void add_token(TOKENEXTRA **t, const aom_prob *context_tree,
#if CONFIG_ANS
const rans_dec_lut *token_cdf,
const rans_lut *token_cdf,
#endif // CONFIG_ANS
int32_t extra, uint8_t token,
uint8_t skip_eob_node, unsigned int *counts) {
......@@ -469,7 +469,7 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
cpi->common.fc->coef_probs[txsize_sqr_map[tx_size]][type][ref];
#endif // CONFIG_ENTROPY
#if CONFIG_ANS
rans_dec_lut(*const coef_cdfs)[COEFF_CONTEXTS] =
rans_lut(*const coef_cdfs)[COEFF_CONTEXTS] =
cpi->common.fc->coef_cdfs[txsize_sqr_map[tx_size]][type][ref];
#endif // CONFIG_ANS
unsigned int(*const eob_branch)[COEFF_CONTEXTS] =
......@@ -493,7 +493,7 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
add_token(&t, coef_probs[band[c]][pt],
#if CONFIG_ANS
(const rans_dec_lut *)&coef_cdfs[band[c]][pt],
(const rans_lut *)&coef_cdfs[band[c]][pt],
#endif // CONFIG_ANS
extra, (uint8_t)token, (uint8_t)skip_eob, counts[band[c]][pt]);
......
......@@ -37,7 +37,7 @@ typedef struct {
typedef struct {
const aom_prob *context_tree;
#if CONFIG_ANS
const rans_dec_lut *token_cdf;
const rans_lut *token_cdf;
#endif // CONFIG_ANS
EXTRABIT extra;
uint8_t token;
......
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