Commit cd539518 authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge

Replace EC_MULTISYMBOL with DAALA_EC || ANS.

Change-Id: Ia0eb3a3694fdbe9d33548ff4014b704b2f3db86a
parent 2e300633
......@@ -16,8 +16,9 @@
#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."
#if CONFIG_EC_ADAPT && !(CONFIG_DAALA_EC || CONFIG_ANS)
#error \
"CONFIG_EC_ADAPT is enabled without either CONFIG_DAALA_EC or CONFIG_ANS."
#endif
#include "aom/aomdx.h"
......@@ -203,19 +204,15 @@ static INLINE int aom_read_tree_as_bits(aom_reader *r,
return -i;
}
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
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,12 +250,12 @@ static INLINE int aom_read_tree_as_cdf(aom_reader *r,
} while (i > 0);
return -i;
}
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
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
#if CONFIG_DAALA_EC || CONFIG_ANS
ret = aom_read_tree_as_cdf(r, tree, probs);
#else
ret = aom_read_tree_as_bits(r, tree, probs);
......
......@@ -14,8 +14,9 @@
#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"
#if CONFIG_EC_ADAPT && !(CONFIG_DAALA_EC || CONFIG_ANS)
#error \
"CONFIG_EC_ADAPT is enabled without either CONFIG_DAALA_EC of CONFIG_ANS."
#endif
#if CONFIG_ANS
......@@ -158,7 +159,7 @@ static INLINE void aom_write_tree_as_bits_record(
} while (len);
}
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
static INLINE void aom_write_cdf(aom_writer *w, int symb,
const aom_cdf_prob *cdf, int nsymbs) {
#if CONFIG_ANS
......@@ -167,12 +168,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,12 +220,12 @@ static INLINE void aom_write_tree_as_cdf(aom_writer *w,
} while (len);
}
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
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
#if CONFIG_DAALA_EC || CONFIG_ANS
aom_write_tree_as_cdf(w, tree, probs, bits, len, i);
#else
aom_write_tree_as_bits(w, tree, probs, bits, len, i);
......@@ -240,7 +237,7 @@ 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
#if CONFIG_DAALA_EC || CONFIG_ANS
(void)token_stats;
aom_write_tree_as_cdf(w, tree, probs, bits, len, i);
#else
......
......@@ -11,9 +11,9 @@
#include "./aom_config.h"
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
#include <string.h>
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#include "aom_dsp/prob.h"
......@@ -53,7 +53,7 @@ void aom_tree_merge_probs(const aom_tree_index *tree, const aom_prob *pre_probs,
tree_merge_probs_impl(0, tree, pre_probs, counts, probs);
}
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
typedef struct tree_node tree_node;
struct tree_node {
......@@ -233,4 +233,4 @@ void av1_indices_from_tree(int *ind, int *inv, const aom_tree_index *tree) {
int stack_index = 0;
tree_to_index(&stack_index, ind, inv, tree, 0, 0);
}
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
......@@ -33,9 +33,9 @@ typedef uint8_t aom_prob;
// TODO(negge): Rename this aom_prob once we remove vpxbool.
typedef uint16_t aom_cdf_prob;
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
#define CDF_SIZE(x) ((x) + 1)
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#define CDF_PROB_BITS 15
#define CDF_PROB_TOP (1 << CDF_PROB_BITS)
......@@ -117,7 +117,7 @@ static INLINE aom_prob mode_mv_merge_probs(aom_prob pre_prob,
void aom_tree_merge_probs(const aom_tree_index *tree, const aom_prob *pre_probs,
const unsigned int *counts, aom_prob *probs);
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
int tree_to_cdf(const aom_tree_index *tree, const aom_prob *probs,
aom_tree_index root, aom_cdf_prob *cdf, aom_tree_index *ind,
int *pth, int *len);
......@@ -150,7 +150,7 @@ static INLINE void av1_tree_to_cdf(const aom_tree_index *tree,
} while (0)
void av1_indices_from_tree(int *ind, int *inv, const aom_tree_index *tree);
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
DECLARE_ALIGNED(16, extern const uint8_t, aom_norm[256]);
......
......@@ -627,7 +627,7 @@ const aom_prob av1_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = {
// The full source code of the generating program is available in:
// tools/gen_constrained_tokenset.py
//
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
// Values for tokens TWO_TOKEN through CATEGORY6_TOKEN included
// in the table here : the ONE_TOKEN probability is
// removed and the probabilities rescaled.
......@@ -891,7 +891,7 @@ const aom_cdf_prob av1_pareto8_tail_probs[COEFF_PROB_MODELS][TAIL_NODES] = {
{ 31131, 1448, 152, 31, 2, 1, 1, 1, 1 },
{ 31486, 1150, 107, 20, 1, 1, 1, 1, 1 },
};
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
/* clang-format off */
#if CONFIG_Q_ADAPT_PROBS
......@@ -3563,7 +3563,7 @@ default_qctx_coef_probs[QCTX_BINS][TX_SIZES][PLANE_TYPES] = {
},
};
#else
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
static const av1_coeff_probs_model default_coef_probs_4x4[PLANE_TYPES] = {
{ // Y plane
{ // Intra
......@@ -3988,7 +3988,7 @@ static const av1_coeff_probs_model default_coef_probs_32x32[PLANE_TYPES] = {
}
}
};
#else // CONFIG_EC_MULTISYMBOL
#else // CONFIG_DAALA_EC || CONFIG_ANS
static const av1_coeff_probs_model default_coef_probs_4x4[PLANE_TYPES] = {
{ // Y plane
{ // Intra
......@@ -4324,7 +4324,7 @@ static const av1_coeff_probs_model default_coef_probs_32x32[PLANE_TYPES] = {
}
}
};
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#if CONFIG_TX64X64
// FIXME. Optimize for EC_MULTISYMBOL
......@@ -4413,7 +4413,7 @@ static const av1_coeff_probs_model default_coef_probs_64x64[PLANE_TYPES] = {
};
#endif // CONFIG_TX64X64
#endif // CONFIG_Q_ADAPT_PROBS
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
static const aom_prob av1_default_blockzero_probs[TX_SIZES][PLANE_TYPES]
[REF_TYPES][BLOCKZ_CONTEXTS] = {
{ // TX_4x4
......@@ -5654,7 +5654,7 @@ static const coeff_cdf_model default_coef_head_cdf_32x32[PLANE_TYPES] = {
{AOM_ICDF(3009), AOM_ICDF(3246), AOM_ICDF(10158), AOM_ICDF(10533),
AOM_ICDF(32768) } } } }
};
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
/* clang-format on */
......@@ -5669,7 +5669,7 @@ void av1_model_to_full_probs(const aom_prob *model, aom_prob *full) {
extend_to_full_distribution(&full[UNCONSTRAINED_NODES], model[PIVOT_NODE]);
}
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
static void build_tail_cdfs(aom_cdf_prob cdf_tail[CDF_SIZE(ENTROPY_TOKENS)],
aom_cdf_prob cdf_head[CDF_SIZE(ENTROPY_TOKENS)],
......@@ -5825,7 +5825,7 @@ void av1_coef_pareto_cdfs(FRAME_CONTEXT *fc) {
build_tail_cdfs(fc->coef_tail_cdfs[t][i][j][k][l],
fc->coef_head_cdfs[t][i][j][k][l], k == 0);
}
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
void av1_default_coef_probs(AV1_COMMON *cm) {
#if CONFIG_Q_ADAPT_PROBS
......@@ -5844,12 +5844,12 @@ void av1_default_coef_probs(AV1_COMMON *cm) {
av1_copy(cm->fc->coef_probs[TX_64X64], default_coef_probs_64x64);
#endif // CONFIG_TX64X64
#endif // CONFIG_Q_ADAPT_PROBS
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
av1_copy(cm->fc->blockzero_probs, av1_default_blockzero_probs);
/* Load the head tokens */
av1_default_coef_cdfs(cm->fc);
av1_coef_pareto_cdfs(cm->fc);
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
}
#if !CONFIG_LV_MAP
......@@ -5864,13 +5864,13 @@ static void adapt_coef_probs(AV1_COMMON *cm, TX_SIZE tx_size,
const unsigned int(*eob_counts)[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] =
(const unsigned int(*)[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS])
cm->counts.eob_branch[tx_size];
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
const av1_blockz_probs_model *const pre_blockz_probs =
pre_fc->blockzero_probs[tx_size];
av1_blockz_probs_model *const blockz_probs = cm->fc->blockzero_probs[tx_size];
const av1_blockz_count_model *const blockz_counts =
(const av1_blockz_count_model *)&cm->counts.blockz_count[tx_size][0];
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
int i, j, k, l, m;
#if CONFIG_RECT_TX
assert(!is_rect_tx(tx_size));
......@@ -5893,7 +5893,7 @@ static void adapt_coef_probs(AV1_COMMON *cm, TX_SIZE tx_size,
count_sat, update_factor);
}
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
for (i = 0; i < PLANE_TYPES; ++i) {
for (j = 0; j < REF_TYPES; ++j) {
for (k = 0; k < BLOCKZ_CONTEXTS; ++k) {
......@@ -5905,7 +5905,7 @@ static void adapt_coef_probs(AV1_COMMON *cm, TX_SIZE tx_size,
}
}
}
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
}
#endif // !CONFIG_LV_MAP
......@@ -5963,10 +5963,10 @@ void av1_average_tile_coef_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
aom_cdf_prob *fc_cdf_ptr;
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
AVERAGE_TILE_CDFS(coef_head_cdfs)
AVERAGE_TILE_CDFS(coef_tail_cdfs)
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
}
void av1_average_tile_mv_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
......
......@@ -45,7 +45,7 @@ extern "C" {
#define CATEGORY5_TOKEN 9 // 35-66 Extra Bits 5+1
#define CATEGORY6_TOKEN 10 // 67+ Extra Bits 14+1
#define EOB_TOKEN 11 // EOB Extra Bits 0+0
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
#define NO_EOB 0 // Not an end-of-block
#define EARLY_EOB 1 // End of block before the last position
#define LAST_EOB 2 // End of block in the last position (implicit)
......@@ -56,7 +56,7 @@ extern "C" {
#define ONE_TOKEN_NEOB 2
#define TWO_TOKEN_PLUS_EOB 3
#define TWO_TOKEN_PLUS_NEOB 4
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#define ENTROPY_TOKENS 12
#define ENTROPY_NODES 11
......@@ -171,9 +171,9 @@ static INLINE int av1_get_cat6_extrabits_size(TX_SIZE tx_size,
distinct bands). */
#define COEFF_CONTEXTS 6
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
#define BLOCKZ_CONTEXTS 3
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#define COEFF_CONTEXTS0 3 // for band 0
#define BAND_COEFF_CONTEXTS(band) \
((band) == 0 ? COEFF_CONTEXTS0 : COEFF_CONTEXTS)
......@@ -243,7 +243,7 @@ typedef unsigned int av1_coeff_count_model[REF_TYPES][COEF_BANDS]
void av1_model_to_full_probs(const aom_prob *model, aom_prob *full);
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
typedef aom_cdf_prob coeff_cdf_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
[CDF_SIZE(ENTROPY_TOKENS)];
typedef aom_prob av1_blockz_probs_model[REF_TYPES][BLOCKZ_CONTEXTS];
......@@ -256,7 +256,7 @@ struct frame_contexts;
void av1_coef_head_cdfs(struct frame_contexts *fc);
void av1_coef_pareto_cdfs(struct frame_contexts *fc);
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
typedef char ENTROPY_CONTEXT;
......
......@@ -1173,22 +1173,22 @@ static const aom_prob default_obmc_prob[BLOCK_SIZES] = {
#if CONFIG_DELTA_Q
static const aom_prob default_delta_q_probs[DELTA_Q_PROBS] = { 220, 220, 220 };
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
static const aom_cdf_prob default_delta_q_cdf[CDF_SIZE(DELTA_Q_PROBS + 1)] = {
AOM_ICDF(28160), AOM_ICDF(32120), AOM_ICDF(32677), AOM_ICDF(32768), 0
};
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#if CONFIG_EXT_DELTA_Q
static const aom_prob default_delta_lf_probs[DELTA_LF_PROBS] = { 220, 220,
220 };
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
static const aom_cdf_prob default_delta_lf_cdf[CDF_SIZE(DELTA_LF_PROBS + 1)] = {
AOM_ICDF(28160), AOM_ICDF(32120), AOM_ICDF(32677), AOM_ICDF(32768), 0
};
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#endif
#endif
#endif
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
int av1_intra_mode_ind[INTRA_MODES];
int av1_intra_mode_inv[INTRA_MODES];
int av1_inter_mode_ind[INTER_MODES];
......@@ -1199,7 +1199,7 @@ int av1_ext_tx_intra_inv[EXT_TX_SETS_INTRA][TX_TYPES];
int av1_ext_tx_inter_ind[EXT_TX_SETS_INTER][TX_TYPES];
int av1_ext_tx_inter_inv[EXT_TX_SETS_INTER][TX_TYPES];
#endif
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#if CONFIG_ALT_INTRA
#if CONFIG_SMOOTH_HV
......@@ -2150,10 +2150,10 @@ const aom_tree_index av1_intra_filter_tree[TREE_SIZE(INTRA_FILTERS)] = {
-INTRA_FILTER_LINEAR, 2, -INTRA_FILTER_8TAP, 4, -INTRA_FILTER_8TAP_SHARP,
-INTRA_FILTER_8TAP_SMOOTH,
};
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
int av1_intra_filter_ind[INTRA_FILTERS];
int av1_intra_filter_inv[INTRA_FILTERS];
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
#if CONFIG_FILTER_INTRA
......@@ -2189,7 +2189,7 @@ static const aom_prob default_segment_pred_probs[PREDICTION_PROBS] = {
};
// clang-format on
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
#if CONFIG_DUAL_FILTER
static const aom_cdf_prob
default_switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS][CDF_SIZE(
......@@ -4315,7 +4315,7 @@ const aom_cdf_prob
AOM_ICDF(30393), AOM_ICDF(32768), 0 } },
#endif // CONFIG_ALT_INTRA
};
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->uv_mode_prob, default_uv_probs);
......@@ -4390,7 +4390,7 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#if CONFIG_LOOP_RESTORATION
av1_copy(fc->switchable_restore_prob, default_switchable_restore_prob);
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
av1_copy(fc->y_mode_cdf, default_if_y_mode_cdf);
av1_copy(fc->uv_mode_cdf, default_uv_mode_cdf);
av1_copy(fc->switchable_interp_cdf, default_switchable_interp_cdf);
......@@ -4403,17 +4403,17 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
av1_copy(fc->seg.tree_cdf, default_seg_tree_cdf);
av1_copy(fc->tx_size_cdf, default_tx_size_cdf);
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#if CONFIG_DELTA_Q
av1_copy(fc->delta_q_prob, default_delta_q_probs);
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
av1_copy(fc->delta_q_cdf, default_delta_q_cdf);
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#if CONFIG_EXT_DELTA_Q
av1_copy(fc->delta_lf_prob, default_delta_lf_probs);
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
av1_copy(fc->delta_lf_cdf, default_delta_lf_cdf);
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#endif
#endif // CONFIG_DELTA_Q
#if CONFIG_CFL
......@@ -4421,7 +4421,7 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif
}
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
int av1_switchable_interp_ind[SWITCHABLE_FILTERS];
int av1_switchable_interp_inv[SWITCHABLE_FILTERS];
......@@ -4522,7 +4522,7 @@ void av1_set_mode_cdfs(struct AV1Common *cm) {
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
}
#endif // !CONFIG_EC_ADAPT
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#if CONFIG_DUAL_FILTER
const aom_tree_index av1_switchable_interp_tree[TREE_SIZE(SWITCHABLE_FILTERS)] =
......
......@@ -99,11 +99,11 @@ typedef struct frame_contexts {
aom_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
#endif
av1_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES];
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
coeff_cdf_model coef_tail_cdfs[TX_SIZES][PLANE_TYPES];
coeff_cdf_model coef_head_cdfs[TX_SIZES][PLANE_TYPES];
aom_prob blockzero_probs[TX_SIZES][PLANE_TYPES][REF_TYPES][BLOCKZ_CONTEXTS];
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
aom_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS - 1];
#if CONFIG_ADAPT_SCAN
......@@ -260,7 +260,7 @@ typedef struct frame_contexts {
#if CONFIG_LOOP_RESTORATION
aom_prob switchable_restore_prob[RESTORE_SWITCHABLE_TYPES - 1];
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
aom_cdf_prob y_mode_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(INTRA_MODES)];
aom_cdf_prob uv_mode_cdf[INTRA_MODES][CDF_SIZE(INTRA_MODES)];
#if CONFIG_EXT_PARTITION_TYPES
......@@ -294,7 +294,7 @@ typedef struct frame_contexts {
#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
aom_cdf_prob intra_filter_cdf[INTRA_FILTERS + 1][CDF_SIZE(INTRA_FILTERS)];
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
#endif // CONFIG_EC_MULTISYMBOL
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#if CONFIG_DELTA_Q
aom_prob delta_q_prob[DELTA_Q_PROBS];
#if CONFIG_EXT_DELTA_Q
......@@ -356,9 +356,9 @@ typedef struct FRAME_COUNTS {
unsigned int coeff_lps[TX_SIZES][PLANE_TYPES][LEVEL_CONTEXTS][2];
#endif // CONFIG_LV_MAP
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
av1_blockz_count_model blockz_count[TX_SIZES][PLANE_TYPES];
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
unsigned int newmv_mode[NEWMV_MODE_CONTEXTS][2];
unsigned int zeromv_mode[ZEROMV_MODE_CONTEXTS][2];
......@@ -450,11 +450,11 @@ typedef struct FRAME_COUNTS {
// Contexts used: Intra mode (Y plane) of 'above' and 'left' blocks.
extern const aom_prob av1_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
[INTRA_MODES - 1];
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
// CDF version of 'av1_kf_y_mode_prob'.
extern const aom_cdf_prob av1_kf_y_mode_cdf[INTRA_MODES][INTRA_MODES]
[CDF_SIZE(INTRA_MODES)];
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#if CONFIG_PALETTE
extern const aom_prob av1_default_palette_y_mode_prob[PALETTE_BLOCK_SIZES]
......@@ -473,7 +473,7 @@ extern const aom_prob av1_default_palette_uv_color_index_prob
extern const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)];
extern const aom_tree_index av1_inter_mode_tree[TREE_SIZE(INTER_MODES)];
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
extern int av1_intra_mode_ind[INTRA_MODES];
extern int av1_intra_mode_inv[INTRA_MODES];
extern int av1_inter_mode_ind[INTER_MODES];
......@@ -484,7 +484,7 @@ extern int av1_ext_tx_intra_inv[EXT_TX_SETS_INTRA][TX_TYPES];
extern int av1_ext_tx_inter_ind[EXT_TX_SETS_INTER][TX_TYPES];
extern int av1_ext_tx_inter_inv[EXT_TX_SETS_INTER][TX_TYPES];
#endif
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
#if CONFIG_EXT_INTER
#if CONFIG_INTERINTRA
......@@ -535,20 +535,20 @@ extern const aom_tree_index av1_motion_mode_tree[TREE_SIZE(MOTION_MODES)];
extern const aom_tree_index
av1_switchable_restore_tree[TREE_SIZE(RESTORE_SWITCHABLE_TYPES)];
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
extern int av1_switchable_interp_ind[SWITCHABLE_FILTERS];
extern int av1_switchable_interp_inv[SWITCHABLE_FILTERS];
#if !CONFIG_EC_ADAPT
void av1_set_mode_cdfs(struct AV1Common *cm);
#endif
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
void av1_setup_past_independence(struct AV1Common *cm);
void av1_adapt_intra_frame_probs(struct AV1Common *cm);
void av1_adapt_inter_frame_probs(struct AV1Common *cm);
#if CONFIG_EC_MULTISYMBOL && !CONFIG_EXT_TX
#if (CONFIG_DAALA_EC || CONFIG_ANS) && !CONFIG_EXT_TX
extern int av1_ext_tx_ind[TX_TYPES];
extern int av1_ext_tx_inv[TX_TYPES];
#endif
......
......@@ -43,57 +43,57 @@ const aom_tree_index av1_mv_fp_tree[TREE_SIZE(MV_FP_SIZE)] = { -0, 2, -1,
static const nmv_context default_nmv_context = {
{ 32, 64, 96 }, // joints
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
{ AOM_ICDF(4096), AOM_ICDF(11264), AOM_ICDF(19328), AOM_ICDF(32768),
0 }, // joint_cdf
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
{ {
// Vertical component
128, // sign
{ 224, 144, 192, 168, 192, 176, 192, 198, 198, 245 }, // class
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
{ AOM_ICDF(28672), AOM_ICDF(30976), AOM_ICDF(31858), AOM_ICDF(32320),
AOM_ICDF(32551), AOM_ICDF(32656), AOM_ICDF(32740), AOM_ICDF(32757),
AOM_ICDF(32762), AOM_ICDF(32767), AOM_ICDF(32768), 0 }, // class_cdf
#endif
{ 216 }, // class0
#endif // CONFIG_DAALA_EC || CONFIG_ANS
{ 216 }, // class0
{ 136, 140, 148, 160, 176, 192, 224, 234, 234, 240 }, // bits
{ { 128, 128, 64 }, { 96, 112, 64 } }, // class0_fp
{ 64, 96, 64 }, // fp
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
{ { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(26624), AOM_ICDF(32768),
0 },
{ AOM_ICDF(12288), AOM_ICDF(21248), AOM_ICDF(24128), AOM_ICDF(32768),
0 } }, // class0_fp_cdf
{ AOM_ICDF(8192), AOM_ICDF(17408), AOM_ICDF(21248), AOM_ICDF(32768),
0 }, // fp_cdf
#endif
160, // class0_hp bit
128, // hp
#endif // CONFIG_DAALA_EC || CONFIG_ANS
160, // class0_hp bit
128, // hp
},
{
// Horizontal component
128, // sign
{ 216, 128, 176, 160, 176, 176, 192, 198, 198, 208 }, // class
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
{ AOM_ICDF(28672), AOM_ICDF(30976), AOM_ICDF(31858), AOM_ICDF(32320),
AOM_ICDF(32551), AOM_ICDF(32656), AOM_ICDF(32740), AOM_ICDF(32757),
AOM_ICDF(32762), AOM_ICDF(32767), AOM_ICDF(32768), 0 }, // class_cdf
#endif
{ 208 }, // class0
#endif // CONFIG_DAALA_EC || CONFIG_ANS
{ 208 }, // class0
{ 136, 140, 148, 160, 176, 192, 224, 234, 234, 240 }, // bits
{ { 128, 128, 64 }, { 96, 112, 64 } }, // class0_fp
{ 64, 96, 64 }, // fp
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
{ { AOM_ICDF(16384), AOM_ICDF(24576), AOM_ICDF(26624), AOM_ICDF(32768),
0 },
{ AOM_ICDF(12288), AOM_ICDF(21248), AOM_ICDF(24128), AOM_ICDF(32768),
0 } }, // class0_fp_cdf
{ AOM_ICDF(8192), AOM_ICDF(17408), AOM_ICDF(21248), AOM_ICDF(32768),
0 }, // fp_cdf
#endif
160, // class0_hp bit
128, // hp
#endif // CONFIG_DAALA_EC || CONFIG_ANS
160, // class0_hp bit
128, // hp
} },
};
......@@ -268,7 +268,7 @@ void av1_adapt_mv_probs(AV1_COMMON *cm, int allow_hp) {
}
}
#if CONFIG_EC_MULTISYMBOL && !CONFIG_EC_ADAPT
#if (CONFIG_DAALA_EC || CONFIG_ANS) && !CONFIG_EC_ADAPT
void av1_set_mv_cdfs(nmv_context *ctx) {
int i;
int j;
......
......@@ -84,26 +84,26 @@ extern const aom_tree_index av1_mv_fp_tree[];
typedef struct {
aom_prob sign;
aom_prob classes[MV_CLASSES - 1];
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
aom_cdf_prob class_cdf[CDF_SIZE(MV_CLASSES)];
#endif
#endif // CONFIG_DAALA_EC || CONFIG_ANS
aom_prob class0[CLASS0_SIZE - 1];
aom_prob bits[MV_OFFSET_BITS];
aom_prob class0_fp[CLASS0_SIZE][MV_FP_SIZE - 1];
aom_prob fp[MV_FP_SIZE - 1];
#if CONFIG_EC_MULTISYMBOL
#if CONFIG_DAALA_EC || CONFIG_ANS
aom_cdf_prob class0_fp_cdf[CLASS0_SIZE][CDF_SIZE(MV_FP_SIZE)];