Commit f2753c34 authored by Alex Converse's avatar Alex Converse Committed by Thomas Davies
Browse files

Add ec_multisymbol for common daala_ec and rans code

The new ec_multisymbol experiment supersedes the rans experiment and is
used for multisymbol features that can be backed by either daala_ec or
rans.

This experiment is automatically enabled by ec_adapt and will try to
enable daala_ec or ans (in that order).

Change-Id: Ie75b4002b7a9d7f5f7b4d130c1aacb3dbe97e54f
parent 37fdce8a
...@@ -235,7 +235,7 @@ static INLINE int aom_read_tree_(aom_reader *r, const aom_tree_index *tree, ...@@ -235,7 +235,7 @@ static INLINE int aom_read_tree_(aom_reader *r, const aom_tree_index *tree,
static INLINE int aom_read_symbol_(aom_reader *r, aom_cdf_prob *cdf, static INLINE int aom_read_symbol_(aom_reader *r, aom_cdf_prob *cdf,
int nsymbs ACCT_STR_PARAM) { int nsymbs ACCT_STR_PARAM) {
int ret; int ret;
#if CONFIG_RANS #if CONFIG_ANS
(void)nsymbs; (void)nsymbs;
ret = rans_read(r, cdf); ret = rans_read(r, cdf);
#elif CONFIG_DAALA_EC #elif CONFIG_DAALA_EC
...@@ -247,7 +247,7 @@ static INLINE int aom_read_symbol_(aom_reader *r, aom_cdf_prob *cdf, ...@@ -247,7 +247,7 @@ static INLINE int aom_read_symbol_(aom_reader *r, aom_cdf_prob *cdf,
assert(0 && "Unsupported bitreader operation"); assert(0 && "Unsupported bitreader operation");
ret = -1; ret = -1;
#endif #endif
#if ((CONFIG_RANS || CONFIG_DAALA_EC) && CONFIG_EC_ADAPT) #if CONFIG_EC_ADAPT
update_cdf(cdf, ret, nsymbs); update_cdf(cdf, ret, nsymbs);
#endif #endif
......
...@@ -117,7 +117,7 @@ static INLINE void aom_write_tree(aom_writer *w, const aom_tree_index *tree, ...@@ -117,7 +117,7 @@ static INLINE void aom_write_tree(aom_writer *w, const aom_tree_index *tree,
static INLINE void aom_write_symbol(aom_writer *w, int symb, aom_cdf_prob *cdf, static INLINE void aom_write_symbol(aom_writer *w, int symb, aom_cdf_prob *cdf,
int nsymbs) { int nsymbs) {
#if CONFIG_RANS #if CONFIG_ANS
struct rans_sym s; struct rans_sym s;
(void)nsymbs; (void)nsymbs;
assert(cdf); assert(cdf);
...@@ -134,7 +134,7 @@ static INLINE void aom_write_symbol(aom_writer *w, int symb, aom_cdf_prob *cdf, ...@@ -134,7 +134,7 @@ static INLINE void aom_write_symbol(aom_writer *w, int symb, aom_cdf_prob *cdf,
assert(0 && "Unsupported bitwriter operation"); assert(0 && "Unsupported bitwriter operation");
#endif #endif
#if ((CONFIG_RANS || CONFIG_DAALA_EC) && CONFIG_EC_ADAPT) #if CONFIG_EC_ADAPT
update_cdf(cdf, symb, nsymbs); update_cdf(cdf, symb, nsymbs);
#endif #endif
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "./aom_config.h" #include "./aom_config.h"
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
#include <string.h> #include <string.h>
#endif #endif
...@@ -57,7 +57,7 @@ void aom_tree_merge_probs(const aom_tree_index *tree, const aom_prob *pre_probs, ...@@ -57,7 +57,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); tree_merge_probs_impl(0, tree, pre_probs, counts, probs);
} }
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
typedef struct tree_node tree_node; typedef struct tree_node tree_node;
struct tree_node { struct tree_node {
......
...@@ -97,7 +97,7 @@ static INLINE aom_prob mode_mv_merge_probs(aom_prob pre_prob, ...@@ -97,7 +97,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, void aom_tree_merge_probs(const aom_tree_index *tree, const aom_prob *pre_probs,
const unsigned int *counts, aom_prob *probs); const unsigned int *counts, aom_prob *probs);
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
int tree_to_cdf(const aom_tree_index *tree, const aom_prob *probs, 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, aom_tree_index root, aom_cdf_prob *cdf, aom_tree_index *ind,
int *pth, int *len); int *pth, int *len);
......
...@@ -15,9 +15,6 @@ ...@@ -15,9 +15,6 @@
#include "av1/common/onyxc_int.h" #include "av1/common/onyxc_int.h"
#include "av1/common/entropymode.h" #include "av1/common/entropymode.h"
#include "av1/common/scan.h" #include "av1/common/scan.h"
#if CONFIG_RANS
#include "aom_dsp/ans.h"
#endif // CONFIG_RANS
#include "aom_mem/aom_mem.h" #include "aom_mem/aom_mem.h"
#include "aom/aom_integer.h" #include "aom/aom_integer.h"
...@@ -389,7 +386,7 @@ const aom_prob av1_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = { ...@@ -389,7 +386,7 @@ const aom_prob av1_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = {
{ 255, 243, 245, 255, 237, 255, 252, 254 }, { 255, 243, 245, 255, 237, 255, 252, 254 },
{ 255, 246, 247, 255, 239, 255, 253, 255 }, { 255, 246, 247, 255, 239, 255, 253, 255 },
}; };
#if CONFIG_RANS || CONFIG_DAALA_EC #if CONFIG_EC_MULTISYMBOL
// Model obtained from a 2-sided zero-centered distribution derived // Model obtained from a 2-sided zero-centered distribution derived
// from a Pareto distribution. The cdf of the distribution is: // from a Pareto distribution. The cdf of the distribution is:
// cdf(x) = 0.5 + 0.5 * sgn(x) * [1 - {alpha/(alpha + |x|)} ^ beta] // cdf(x) = 0.5 + 0.5 * sgn(x) * [1 - {alpha/(alpha + |x|)} ^ beta]
...@@ -661,7 +658,7 @@ const aom_cdf_prob ...@@ -661,7 +658,7 @@ const aom_cdf_prob
{ 32512, 238, 11, 1, 1, 1, 1, 1, 1, 1 }, { 32512, 238, 11, 1, 1, 1, 1, 1, 1, 1 },
{ 32640, 117, 4, 1, 1, 1, 1, 1, 1, 1 }, { 32640, 117, 4, 1, 1, 1, 1, 1, 1, 1 },
}; };
#endif // CONFIG_RANS #endif // CONFIG_EC_MULTISYMBOL
static const av1_coeff_probs_model default_coef_probs_4x4[PLANE_TYPES] = { static const av1_coeff_probs_model default_coef_probs_4x4[PLANE_TYPES] = {
{ // Y plane { // Y plane
...@@ -1336,7 +1333,7 @@ void av1_model_to_full_probs(const aom_prob *model, aom_prob *full) { ...@@ -1336,7 +1333,7 @@ void av1_model_to_full_probs(const aom_prob *model, aom_prob *full) {
extend_to_full_distribution(&full[UNCONSTRAINED_NODES], model[PIVOT_NODE]); extend_to_full_distribution(&full[UNCONSTRAINED_NODES], model[PIVOT_NODE]);
} }
#if CONFIG_RANS || CONFIG_DAALA_EC #if CONFIG_EC_MULTISYMBOL
static void build_token_cdfs(const aom_prob *pdf_model, static void build_token_cdfs(const aom_prob *pdf_model,
aom_cdf_prob cdf[ENTROPY_TOKENS]) { aom_cdf_prob cdf[ENTROPY_TOKENS]) {
int i, sum = 0; int i, sum = 0;
...@@ -1357,16 +1354,16 @@ void av1_coef_pareto_cdfs(FRAME_CONTEXT *fc) { ...@@ -1357,16 +1354,16 @@ void av1_coef_pareto_cdfs(FRAME_CONTEXT *fc) {
build_token_cdfs(fc->coef_probs[t][i][j][k][l], build_token_cdfs(fc->coef_probs[t][i][j][k][l],
fc->coef_cdfs[t][i][j][k][l]); fc->coef_cdfs[t][i][j][k][l]);
} }
#endif // CONFIG_RANS #endif // CONFIG_EC_MULTISYMBOL
void av1_default_coef_probs(AV1_COMMON *cm) { void av1_default_coef_probs(AV1_COMMON *cm) {
av1_copy(cm->fc->coef_probs[TX_4X4], default_coef_probs_4x4); av1_copy(cm->fc->coef_probs[TX_4X4], default_coef_probs_4x4);
av1_copy(cm->fc->coef_probs[TX_8X8], default_coef_probs_8x8); av1_copy(cm->fc->coef_probs[TX_8X8], default_coef_probs_8x8);
av1_copy(cm->fc->coef_probs[TX_16X16], default_coef_probs_16x16); av1_copy(cm->fc->coef_probs[TX_16X16], default_coef_probs_16x16);
av1_copy(cm->fc->coef_probs[TX_32X32], default_coef_probs_32x32); av1_copy(cm->fc->coef_probs[TX_32X32], default_coef_probs_32x32);
#if CONFIG_RANS || CONFIG_DAALA_EC #if CONFIG_EC_MULTISYMBOL
av1_coef_pareto_cdfs(cm->fc); av1_coef_pareto_cdfs(cm->fc);
#endif // CONFIG_RANS #endif // CONFIG_EC_MULTISYMBOL
} }
#define COEF_COUNT_SAT 24 #define COEF_COUNT_SAT 24
...@@ -1438,7 +1435,7 @@ void av1_adapt_coef_probs(AV1_COMMON *cm) { ...@@ -1438,7 +1435,7 @@ void av1_adapt_coef_probs(AV1_COMMON *cm) {
for (t = 0; t <= TX_32X32; t++) for (t = 0; t <= TX_32X32; t++)
adapt_coef_probs(cm, t, count_sat, update_factor); adapt_coef_probs(cm, t, count_sat, update_factor);
#if CONFIG_RANS || CONFIG_DAALA_EC #if CONFIG_EC_MULTISYMBOL
av1_coef_pareto_cdfs(cm->fc); av1_coef_pareto_cdfs(cm->fc);
#endif // CONFIG_RANS #endif // CONFIG_EC_MULTISYMBOL
} }
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
#include "./aom_config.h" #include "./aom_config.h"
#include "aom/aom_integer.h" #include "aom/aom_integer.h"
#if CONFIG_RANS
#include "aom_dsp/ans.h"
#endif // CONFIG_RANS
#include "aom_dsp/prob.h" #include "aom_dsp/prob.h"
#include "av1/common/common.h" #include "av1/common/common.h"
...@@ -177,14 +174,14 @@ typedef unsigned int av1_coeff_count_model[REF_TYPES][COEF_BANDS] ...@@ -177,14 +174,14 @@ typedef unsigned int av1_coeff_count_model[REF_TYPES][COEF_BANDS]
void av1_model_to_full_probs(const aom_prob *model, aom_prob *full); void av1_model_to_full_probs(const aom_prob *model, aom_prob *full);
#if CONFIG_RANS || CONFIG_DAALA_EC #if CONFIG_EC_MULTISYMBOL
typedef aom_cdf_prob coeff_cdf_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] typedef aom_cdf_prob coeff_cdf_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
[ENTROPY_TOKENS]; [ENTROPY_TOKENS];
extern const aom_cdf_prob av1_pareto8_token_probs[COEFF_PROB_MODELS] extern const aom_cdf_prob av1_pareto8_token_probs[COEFF_PROB_MODELS]
[ENTROPY_TOKENS - 2]; [ENTROPY_TOKENS - 2];
struct frame_contexts; struct frame_contexts;
void av1_coef_pareto_cdfs(struct frame_contexts *fc); void av1_coef_pareto_cdfs(struct frame_contexts *fc);
#endif // CONFIG_RANS #endif // CONFIG_EC_MULTISYMBOL
typedef char ENTROPY_CONTEXT; typedef char ENTROPY_CONTEXT;
......
...@@ -68,9 +68,9 @@ typedef struct frame_contexts { ...@@ -68,9 +68,9 @@ typedef struct frame_contexts {
aom_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1]; aom_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
aom_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1]; aom_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
av1_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES]; av1_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES];
#if CONFIG_RANS || CONFIG_DAALA_EC #if CONFIG_EC_MULTISYMBOL
coeff_cdf_model coef_cdfs[TX_SIZES][PLANE_TYPES]; coeff_cdf_model coef_cdfs[TX_SIZES][PLANE_TYPES];
#endif // CONFIG_RANS #endif // CONFIG_EC_MULTISYMBOL
aom_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS] aom_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS - 1]; [SWITCHABLE_FILTERS - 1];
......
...@@ -43,21 +43,21 @@ const aom_tree_index av1_mv_fp_tree[TREE_SIZE(MV_FP_SIZE)] = { -0, 2, -1, ...@@ -43,21 +43,21 @@ const aom_tree_index av1_mv_fp_tree[TREE_SIZE(MV_FP_SIZE)] = { -0, 2, -1,
static const nmv_context default_nmv_context = { static const nmv_context default_nmv_context = {
{ 32, 64, 96 }, // joints { 32, 64, 96 }, // joints
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
{ 0, 0, 0, 0 }, // joint_cdf is computed from joints in av1_init_mv_probs() { 0, 0, 0, 0 }, // joint_cdf is computed from joints in av1_init_mv_probs()
#endif #endif
{ { { {
// Vertical component // Vertical component
128, // sign 128, // sign
{ 224, 144, 192, 168, 192, 176, 192, 198, 198, 245 }, // class { 224, 144, 192, 168, 192, 176, 192, 198, 198, 245 }, // class
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
{ 0 }, // class_cdf is computed from class in av1_init_mv_probs() { 0 }, // class_cdf is computed from class in av1_init_mv_probs()
#endif #endif
{ 216 }, // class0 { 216 }, // class0
{ 136, 140, 148, 160, 176, 192, 224, 234, 234, 240 }, // bits { 136, 140, 148, 160, 176, 192, 224, 234, 234, 240 }, // bits
{ { 128, 128, 64 }, { 96, 112, 64 } }, // class0_fp { { 128, 128, 64 }, { 96, 112, 64 } }, // class0_fp
{ 64, 96, 64 }, // fp { 64, 96, 64 }, // fp
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
{ { 0 }, { 0 } }, // class0_fp_cdf is computed in av1_init_mv_probs() { { 0 }, { 0 } }, // class0_fp_cdf is computed in av1_init_mv_probs()
{ 0 }, // fp_cdf is computed from fp in av1_init_mv_probs() { 0 }, // fp_cdf is computed from fp in av1_init_mv_probs()
#endif #endif
...@@ -68,14 +68,14 @@ static const nmv_context default_nmv_context = { ...@@ -68,14 +68,14 @@ static const nmv_context default_nmv_context = {
// Horizontal component // Horizontal component
128, // sign 128, // sign
{ 216, 128, 176, 160, 176, 176, 192, 198, 198, 208 }, // class { 216, 128, 176, 160, 176, 176, 192, 198, 198, 208 }, // class
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
{ 0 }, // class_cdf is computed from class in av1_init_mv_probs() { 0 }, // class_cdf is computed from class in av1_init_mv_probs()
#endif #endif
{ 208 }, // class0 { 208 }, // class0
{ 136, 140, 148, 160, 176, 192, 224, 234, 234, 240 }, // bits { 136, 140, 148, 160, 176, 192, 224, 234, 234, 240 }, // bits
{ { 128, 128, 64 }, { 96, 112, 64 } }, // class0_fp { { 128, 128, 64 }, { 96, 112, 64 } }, // class0_fp
{ 64, 96, 64 }, // fp { 64, 96, 64 }, // fp
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
{ { 0 }, { 0 } }, // class0_fp_cdf is computed in av1_init_mv_probs() { { 0 }, { 0 } }, // class0_fp_cdf is computed in av1_init_mv_probs()
{ 0 }, // fp_cdf is computed from fp in av1_init_mv_probs() { 0 }, // fp_cdf is computed from fp in av1_init_mv_probs()
#endif #endif
...@@ -262,7 +262,7 @@ void av1_init_mv_probs(AV1_COMMON *cm) { ...@@ -262,7 +262,7 @@ void av1_init_mv_probs(AV1_COMMON *cm) {
for (i = 0; i < NMV_CONTEXTS; ++i) cm->fc->nmvc[i] = default_nmv_context; for (i = 0; i < NMV_CONTEXTS; ++i) cm->fc->nmvc[i] = default_nmv_context;
#else #else
cm->fc->nmvc = default_nmv_context; cm->fc->nmvc = default_nmv_context;
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
{ {
int i, j; int i, j;
av1_tree_to_cdf(av1_mv_joint_tree, cm->fc->nmvc.joints, av1_tree_to_cdf(av1_mv_joint_tree, cm->fc->nmvc.joints,
......
...@@ -84,14 +84,14 @@ extern const aom_tree_index av1_mv_fp_tree[]; ...@@ -84,14 +84,14 @@ extern const aom_tree_index av1_mv_fp_tree[];
typedef struct { typedef struct {
aom_prob sign; aom_prob sign;
aom_prob classes[MV_CLASSES - 1]; aom_prob classes[MV_CLASSES - 1];
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
aom_cdf_prob class_cdf[MV_CLASSES]; aom_cdf_prob class_cdf[MV_CLASSES];
#endif #endif
aom_prob class0[CLASS0_SIZE - 1]; aom_prob class0[CLASS0_SIZE - 1];
aom_prob bits[MV_OFFSET_BITS]; aom_prob bits[MV_OFFSET_BITS];
aom_prob class0_fp[CLASS0_SIZE][MV_FP_SIZE - 1]; aom_prob class0_fp[CLASS0_SIZE][MV_FP_SIZE - 1];
aom_prob fp[MV_FP_SIZE - 1]; aom_prob fp[MV_FP_SIZE - 1];
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
aom_cdf_prob class0_fp_cdf[CLASS0_SIZE][MV_FP_SIZE]; aom_cdf_prob class0_fp_cdf[CLASS0_SIZE][MV_FP_SIZE];
aom_cdf_prob fp_cdf[MV_FP_SIZE]; aom_cdf_prob fp_cdf[MV_FP_SIZE];
#endif #endif
...@@ -101,7 +101,7 @@ typedef struct { ...@@ -101,7 +101,7 @@ typedef struct {
typedef struct { typedef struct {
aom_prob joints[MV_JOINTS - 1]; aom_prob joints[MV_JOINTS - 1];
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
aom_cdf_prob joint_cdf[MV_JOINTS]; aom_cdf_prob joint_cdf[MV_JOINTS];
#endif #endif
nmv_component comps[2]; nmv_component comps[2];
......
...@@ -241,10 +241,10 @@ static void update_mv_probs(aom_prob *p, int n, aom_reader *r) { ...@@ -241,10 +241,10 @@ static void update_mv_probs(aom_prob *p, int n, aom_reader *r) {
static void read_mv_probs(nmv_context *ctx, int allow_hp, aom_reader *r) { static void read_mv_probs(nmv_context *ctx, int allow_hp, aom_reader *r) {
int i; int i;
#if !CONFIG_EC_ADAPT || !(CONFIG_DAALA_EC || CONFIG_RANS) #if !CONFIG_EC_ADAPT
int j; int j;
update_mv_probs(ctx->joints, MV_JOINTS - 1, r); update_mv_probs(ctx->joints, MV_JOINTS - 1, r);
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf(av1_mv_joint_tree, ctx->joints, ctx->joint_cdf); av1_tree_to_cdf(av1_mv_joint_tree, ctx->joints, ctx->joint_cdf);
#endif #endif
...@@ -254,7 +254,7 @@ static void read_mv_probs(nmv_context *ctx, int allow_hp, aom_reader *r) { ...@@ -254,7 +254,7 @@ static void read_mv_probs(nmv_context *ctx, int allow_hp, aom_reader *r) {
update_mv_probs(comp_ctx->classes, MV_CLASSES - 1, r); update_mv_probs(comp_ctx->classes, MV_CLASSES - 1, r);
update_mv_probs(comp_ctx->class0, CLASS0_SIZE - 1, r); update_mv_probs(comp_ctx->class0, CLASS0_SIZE - 1, r);
update_mv_probs(comp_ctx->bits, MV_OFFSET_BITS, r); update_mv_probs(comp_ctx->bits, MV_OFFSET_BITS, r);
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf(av1_mv_class_tree, comp_ctx->classes, comp_ctx->class_cdf); av1_tree_to_cdf(av1_mv_class_tree, comp_ctx->classes, comp_ctx->class_cdf);
#endif #endif
} }
...@@ -262,17 +262,17 @@ static void read_mv_probs(nmv_context *ctx, int allow_hp, aom_reader *r) { ...@@ -262,17 +262,17 @@ static void read_mv_probs(nmv_context *ctx, int allow_hp, aom_reader *r) {
nmv_component *const comp_ctx = &ctx->comps[i]; nmv_component *const comp_ctx = &ctx->comps[i];
for (j = 0; j < CLASS0_SIZE; ++j) { for (j = 0; j < CLASS0_SIZE; ++j) {
update_mv_probs(comp_ctx->class0_fp[j], MV_FP_SIZE - 1, r); update_mv_probs(comp_ctx->class0_fp[j], MV_FP_SIZE - 1, r);
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf(av1_mv_fp_tree, comp_ctx->class0_fp[j], av1_tree_to_cdf(av1_mv_fp_tree, comp_ctx->class0_fp[j],
comp_ctx->class0_fp_cdf[j]); comp_ctx->class0_fp_cdf[j]);
#endif #endif
} }
update_mv_probs(comp_ctx->fp, MV_FP_SIZE - 1, r); update_mv_probs(comp_ctx->fp, MV_FP_SIZE - 1, r);
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf(av1_mv_fp_tree, comp_ctx->fp, comp_ctx->fp_cdf); av1_tree_to_cdf(av1_mv_fp_tree, comp_ctx->fp, comp_ctx->fp_cdf);
#endif #endif
} }
#endif // CONFIG_EC_ADAPT, CONFIG_DAALA_EC #endif // !CONFIG_EC_ADAPT
if (allow_hp) { if (allow_hp) {
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
...@@ -775,9 +775,9 @@ static void read_coef_probs(FRAME_CONTEXT *fc, TX_MODE tx_mode, aom_reader *r) { ...@@ -775,9 +775,9 @@ static void read_coef_probs(FRAME_CONTEXT *fc, TX_MODE tx_mode, aom_reader *r) {
TX_SIZE tx_size; TX_SIZE tx_size;
for (tx_size = TX_4X4; tx_size <= max_tx_size; ++tx_size) for (tx_size = TX_4X4; tx_size <= max_tx_size; ++tx_size)
read_coef_probs_common(fc->coef_probs[tx_size], r); read_coef_probs_common(fc->coef_probs[tx_size], r);
#if CONFIG_RANS || CONFIG_DAALA_EC #if CONFIG_EC_MULTISYMBOL
av1_coef_pareto_cdfs(fc); av1_coef_pareto_cdfs(fc);
#endif // CONFIG_RANS #endif // CONFIG_EC_MULTISYMBOL
} }
static void setup_segmentation(AV1_COMMON *const cm, static void setup_segmentation(AV1_COMMON *const cm,
......
...@@ -572,7 +572,7 @@ static int read_mv_component(aom_reader *r, nmv_component *mvcomp, int usehp) { ...@@ -572,7 +572,7 @@ static int read_mv_component(aom_reader *r, nmv_component *mvcomp, int usehp) {
int mag, d, fr, hp; int mag, d, fr, hp;
const int sign = aom_read(r, mvcomp->sign, ACCT_STR); const int sign = aom_read(r, mvcomp->sign, ACCT_STR);
const int mv_class = const int mv_class =
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
aom_read_symbol(r, mvcomp->class_cdf, MV_CLASSES, ACCT_STR); aom_read_symbol(r, mvcomp->class_cdf, MV_CLASSES, ACCT_STR);
#else #else
aom_read_tree(r, av1_mv_class_tree, mvcomp->classes, ACCT_STR); aom_read_tree(r, av1_mv_class_tree, mvcomp->classes, ACCT_STR);
...@@ -593,7 +593,7 @@ static int read_mv_component(aom_reader *r, nmv_component *mvcomp, int usehp) { ...@@ -593,7 +593,7 @@ static int read_mv_component(aom_reader *r, nmv_component *mvcomp, int usehp) {
} }
// Fractional part // Fractional part
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
fr = aom_read_symbol(r, class0 ? mvcomp->class0_fp_cdf[d] : mvcomp->fp_cdf, fr = aom_read_symbol(r, class0 ? mvcomp->class0_fp_cdf[d] : mvcomp->fp_cdf,
MV_FP_SIZE, ACCT_STR); MV_FP_SIZE, ACCT_STR);
#else #else
...@@ -614,7 +614,7 @@ static INLINE void read_mv(aom_reader *r, MV *mv, const MV *ref, ...@@ -614,7 +614,7 @@ static INLINE void read_mv(aom_reader *r, MV *mv, const MV *ref,
nmv_context *ctx, nmv_context_counts *counts, nmv_context *ctx, nmv_context_counts *counts,
int allow_hp) { int allow_hp) {
const MV_JOINT_TYPE joint_type = const MV_JOINT_TYPE joint_type =
#if CONFIG_DAALA_EC || CONFIG_RANS #if CONFIG_EC_MULTISYMBOL
(MV_JOINT_TYPE)aom_read_symbol(r, ctx->joint_cdf, MV_JOINTS, ACCT_STR); (MV_JOINT_TYPE)aom_read_symbol(r, ctx->joint_cdf, MV_JOINTS, ACCT_STR);
#else #else
(MV_JOINT_TYPE)aom_read_tree(r, av1_mv_joint_tree, ctx->joints, ACCT_STR); (MV_JOINT_TYPE)aom_read_tree(r, av1_mv_joint_tree, ctx->joints, ACCT_STR);
......
...@@ -68,11 +68,11 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff, ...@@ -68,11 +68,11 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
aom_prob(*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] = aom_prob(*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
fc->coef_probs[tx_size][type][ref]; fc->coef_probs[tx_size][type][ref];
const aom_prob *prob; const aom_prob *prob;
#if CONFIG_RANS || CONFIG_DAALA_EC #if CONFIG_EC_MULTISYMBOL
aom_cdf_prob(*coef_cdfs)[COEFF_CONTEXTS][ENTROPY_TOKENS] = aom_cdf_prob(*coef_cdfs)[COEFF_CONTEXTS][ENTROPY_TOKENS] =
fc->coef_cdfs[tx_size][type][ref]; fc->coef_cdfs[tx_size][type][ref];
aom_cdf_prob(*cdf)[ENTROPY_TOKENS]; aom_cdf_prob(*cdf)[ENTROPY_TOKENS];
#endif // CONFIG_RANS #endif // CONFIG_EC_MULTISYMBOL
unsigned int(*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1]; unsigned int(*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1];
unsigned int(*eob_branch_count)[COEFF_CONTEXTS]; unsigned int(*eob_branch_count)[COEFF_CONTEXTS];
uint8_t token_cache[32 * 32]; uint8_t token_cache[32 * 32];
...@@ -147,7 +147,7 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff, ...@@ -147,7 +147,7 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
prob = coef_probs[band][ctx]; prob = coef_probs[band][ctx];
} }
#if CONFIG_RANS || CONFIG_DAALA_EC #if CONFIG_EC_MULTISYMBOL
cdf = &coef_cdfs[band][ctx]; cdf = &coef_cdfs[band][ctx];
token = ONE_TOKEN + token = ONE_TOKEN +
aom_read_symbol(r, *cdf, CATEGORY6_TOKEN - ONE_TOKEN + 1, ACCT_STR); aom_read_symbol(r, *cdf, CATEGORY6_TOKEN - ONE_TOKEN + 1, ACCT_STR);
...@@ -194,7 +194,7 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff, ...@@ -194,7 +194,7 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
break; break;
} }
} }
#else // CONFIG_RANS #else // CONFIG_EC_MULTISYMBOL
if (!aom_read(r, prob[ONE_CONTEXT_NODE], ACCT_STR)) { if (!aom_read(r, prob[ONE_CONTEXT_NODE], ACCT_STR)) {
INCREMENT_COUNT(ONE_TOKEN); INCREMENT_COUNT(ONE_TOKEN);
token = ONE_TOKEN; token = ONE_TOKEN;
...@@ -245,7 +245,7 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff, ...@@ -245,7 +245,7 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
} }
} }
} }
#endif // CONFIG_RANS #endif // CONFIG_EC_MULTISYMBOL
#if CONFIG_AOM_QM #if CONFIG_AOM_QM
dqv = ((iqmatrix[scan[c]] * (int)dqv) + (1 << (AOM_QM_BITS - 1))) >> dqv = ((iqmatrix[scan[c]] * (int)dqv) + (1 << (AOM_QM_BITS - 1))) >>
AOM_QM_BITS; AOM_QM_BITS;
......
...@@ -478,14 +478,14 @@ static void pack_mb_tokens(aom_writer *w, TOKENEXTRA **tp, ...@@ -478,14 +478,14 @@ static void pack_mb_tokens(aom_writer *w, TOKENEXTRA **tp,
while (p < stop && p->token != EOSB_TOKEN) { while (p < stop && p->token != EOSB_TOKEN) {
const uint8_t token = p->token; const uint8_t token = p->token;
aom_tree_index index = 0; aom_tree_index index = 0;
#if !CONFIG_RANS && !CONFIG_DAALA_EC #if !CONFIG_EC_MULTISYMBOL
const struct av1_token *const coef_encoding = &av1_coef_encodings[token]; const struct av1_token *const coef_encoding = &av1_coef_encodings[token];
int coef_value = coef_encoding->value; int coef_value = coef_encoding->value;
int coef_length = coef_encoding->len; int coef_length = coef_encoding->len;
#endif // !CONFIG_RANS #endif // !CONFIG_EC_MULTISYMBOL
const av1_extra_bit *const extra_bits = &extra_bits_table[token]; const av1_extra_bit *const extra_bits = &extra_bits_table[token];
#if CONFIG_RANS || CONFIG_DAALA_EC #if CONFIG_EC_MULTISYMBOL
if (!p->skip_eob_node) aom_write(w, token != EOB_TOKEN, p->context_tree[0]); if (!p->skip_eob_node) aom_write(w, token != EOB_TOKEN, p->context_tree[0]);
if (token != EOB_TOKEN) { if (token != EOB_TOKEN) {
...@@ -526,7 +526,7 @@ static void pack_mb_tokens(aom_writer *w, TOKENEXTRA **tp, ...@@ -526,7 +526,7 @@ static void pack_mb_tokens(aom_writer *w, TOKENEXTRA **tp,
aom_write_tree_bits(w, av1_coef_tree, p->context_tree, coef_value, aom_write_tree_bits(w, av1_coef_tree, p->context_tree, coef_value,
coef_length, index); coef_length, index);
} }
#endif // CONFIG_RANS #endif // CONFIG_EC_MULTISYMBOL
if (extra_bits->base_val) { if (extra_bits->base_val) {
const int bit_string = p->extra; const int bit_string = p->extra;
...@@ -1432,9 +1432,9 @@ static void update_coef_probs_common(aom_writer *const bc, AV1_COMP *cpi, ...@@ -1432,9 +1432,9 @@ static void update_coef_probs_common(aom_writer *const bc, AV1_COMP *cpi,
} }