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

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,
static INLINE int aom_read_symbol_(aom_reader *r, aom_cdf_prob *cdf,
int nsymbs ACCT_STR_PARAM) {
int ret;
#if CONFIG_RANS
#if CONFIG_ANS
(void)nsymbs;
ret = rans_read(r, cdf);
#elif CONFIG_DAALA_EC
......@@ -247,7 +247,7 @@ static INLINE int aom_read_symbol_(aom_reader *r, aom_cdf_prob *cdf,
assert(0 && "Unsupported bitreader operation");
ret = -1;
#endif
#if ((CONFIG_RANS || CONFIG_DAALA_EC) && CONFIG_EC_ADAPT)
#if CONFIG_EC_ADAPT
update_cdf(cdf, ret, nsymbs);
#endif
......
......@@ -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,
int nsymbs) {
#if CONFIG_RANS
#if CONFIG_ANS
struct rans_sym s;
(void)nsymbs;
assert(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");
#endif
#if ((CONFIG_RANS || CONFIG_DAALA_EC) && CONFIG_EC_ADAPT)
#if CONFIG_EC_ADAPT
update_cdf(cdf, symb, nsymbs);
#endif
}
......
......@@ -11,7 +11,7 @@
#include "./aom_config.h"
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
#include <string.h>
#endif
......@@ -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);
}
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
typedef struct tree_node tree_node;
struct tree_node {
......
......@@ -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,
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,
aom_tree_index root, aom_cdf_prob *cdf, aom_tree_index *ind,
int *pth, int *len);
......
......@@ -15,9 +15,6 @@
#include "av1/common/onyxc_int.h"
#include "av1/common/entropymode.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/aom_integer.h"
......@@ -389,7 +386,7 @@ const aom_prob av1_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = {
{ 255, 243, 245, 255, 237, 255, 252, 254 },
{ 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
// from a Pareto distribution. The cdf of the distribution is:
// cdf(x) = 0.5 + 0.5 * sgn(x) * [1 - {alpha/(alpha + |x|)} ^ beta]
......@@ -661,7 +658,7 @@ const aom_cdf_prob
{ 32512, 238, 11, 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] = {
{ // Y plane
......@@ -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]);
}
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
static void build_token_cdfs(const aom_prob *pdf_model,
aom_cdf_prob cdf[ENTROPY_TOKENS]) {
int i, sum = 0;
......@@ -1357,16 +1354,16 @@ void av1_coef_pareto_cdfs(FRAME_CONTEXT *fc) {
build_token_cdfs(fc->coef_probs[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) {
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_16X16], default_coef_probs_16x16);
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);
#endif // CONFIG_RANS
#endif // CONFIG_EC_MULTISYMBOL
}
#define COEF_COUNT_SAT 24
......@@ -1438,7 +1435,7 @@ void av1_adapt_coef_probs(AV1_COMMON *cm) {
for (t = 0; t <= TX_32X32; t++)
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);
#endif // CONFIG_RANS
#endif // CONFIG_EC_MULTISYMBOL
}
......@@ -14,9 +14,6 @@
#include "./aom_config.h"
#include "aom/aom_integer.h"
#if CONFIG_RANS
#include "aom_dsp/ans.h"
#endif // CONFIG_RANS
#include "aom_dsp/prob.h"
#include "av1/common/common.h"
......@@ -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);
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
typedef aom_cdf_prob coeff_cdf_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
[ENTROPY_TOKENS];
extern const aom_cdf_prob av1_pareto8_token_probs[COEFF_PROB_MODELS]
[ENTROPY_TOKENS - 2];
struct frame_contexts;
void av1_coef_pareto_cdfs(struct frame_contexts *fc);
#endif // CONFIG_RANS
#endif // CONFIG_EC_MULTISYMBOL
typedef char ENTROPY_CONTEXT;
......
......@@ -68,9 +68,9 @@ typedef struct frame_contexts {
aom_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
aom_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
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];
#endif // CONFIG_RANS
#endif // CONFIG_EC_MULTISYMBOL
aom_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS - 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 = {
{ 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()
#endif
{ {
// Vertical component
128, // sign
{ 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()
#endif
{ 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_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
{ { 0 }, { 0 } }, // class0_fp_cdf is computed in av1_init_mv_probs()
{ 0 }, // fp_cdf is computed from fp in av1_init_mv_probs()
#endif
......@@ -68,14 +68,14 @@ static const nmv_context default_nmv_context = {
// Horizontal component
128, // sign
{ 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()
#endif
{ 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_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
{ { 0 }, { 0 } }, // class0_fp_cdf is computed in av1_init_mv_probs()
{ 0 }, // fp_cdf is computed from fp in av1_init_mv_probs()
#endif
......@@ -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;
#else
cm->fc->nmvc = default_nmv_context;
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
{
int i, j;
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[];
typedef struct {
aom_prob sign;
aom_prob classes[MV_CLASSES - 1];
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob class_cdf[MV_CLASSES];
#endif
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_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob class0_fp_cdf[CLASS0_SIZE][MV_FP_SIZE];
aom_cdf_prob fp_cdf[MV_FP_SIZE];
#endif
......@@ -101,7 +101,7 @@ typedef struct {
typedef struct {
aom_prob joints[MV_JOINTS - 1];
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob joint_cdf[MV_JOINTS];
#endif
nmv_component comps[2];
......
......@@ -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) {
int i;
#if !CONFIG_EC_ADAPT || !(CONFIG_DAALA_EC || CONFIG_RANS)
#if !CONFIG_EC_ADAPT
int j;
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);
#endif
......@@ -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->class0, CLASS0_SIZE - 1, 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);
#endif
}
......@@ -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];
for (j = 0; j < CLASS0_SIZE; ++j) {
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],
comp_ctx->class0_fp_cdf[j]);
#endif
}
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);
#endif
}
#endif // CONFIG_EC_ADAPT, CONFIG_DAALA_EC
#endif // !CONFIG_EC_ADAPT
if (allow_hp) {
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) {
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);
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
av1_coef_pareto_cdfs(fc);
#endif // CONFIG_RANS
#endif // CONFIG_EC_MULTISYMBOL
}
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) {
int mag, d, fr, hp;
const int sign = aom_read(r, mvcomp->sign, ACCT_STR);
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);
#else
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) {
}
// 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,
MV_FP_SIZE, ACCT_STR);
#else
......@@ -614,7 +614,7 @@ static INLINE void read_mv(aom_reader *r, MV *mv, const MV *ref,
nmv_context *ctx, nmv_context_counts *counts,
int allow_hp) {
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);
#else
(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,
aom_prob(*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
fc->coef_probs[tx_size][type][ref];
const aom_prob *prob;
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob(*coef_cdfs)[COEFF_CONTEXTS][ENTROPY_TOKENS] =
fc->coef_cdfs[tx_size][type][ref];
aom_cdf_prob(*cdf)[ENTROPY_TOKENS];
#endif // CONFIG_RANS
#endif // CONFIG_EC_MULTISYMBOL
unsigned int(*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1];
unsigned int(*eob_branch_count)[COEFF_CONTEXTS];
uint8_t token_cache[32 * 32];
......@@ -147,7 +147,7 @@ static int decode_coefs(MACROBLOCKD *xd, PLANE_TYPE type, tran_low_t *dqcoeff,
prob = coef_probs[band][ctx];
}
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
cdf = &coef_cdfs[band][ctx];
token = ONE_TOKEN +
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,
break;
}
}
#else // CONFIG_RANS
#else // CONFIG_EC_MULTISYMBOL
if (!aom_read(r, prob[ONE_CONTEXT_NODE], ACCT_STR)) {
INCREMENT_COUNT(ONE_TOKEN);
token = ONE_TOKEN;
......@@ -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
dqv = ((iqmatrix[scan[c]] * (int)dqv) + (1 << (AOM_QM_BITS - 1))) >>
AOM_QM_BITS;
......
......@@ -478,14 +478,14 @@ static void pack_mb_tokens(aom_writer *w, TOKENEXTRA **tp,
while (p < stop && p->token != EOSB_TOKEN) {
const uint8_t token = p->token;
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];
int coef_value = coef_encoding->value;
int coef_length = coef_encoding->len;
#endif // !CONFIG_RANS
#endif // !CONFIG_EC_MULTISYMBOL
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 (token != EOB_TOKEN) {
......@@ -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,
coef_length, index);
}
#endif // CONFIG_RANS
#endif // CONFIG_EC_MULTISYMBOL
if (extra_bits->base_val) {
const int bit_string = p->extra;
......@@ -1432,9 +1432,9 @@ static void update_coef_probs_common(aom_writer *const bc, AV1_COMP *cpi,
}
default: assert(0);
}
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
av1_coef_pareto_cdfs(cpi->common.fc);
#endif // CONFIG_RANS
#endif // CONFIG_EC_MULTISYMBOL
}
static void update_coef_probs(AV1_COMP *cpi, aom_writer *w) {
......
......@@ -46,7 +46,7 @@ static void encode_mv_component(aom_writer *w, int comp, nmv_component *mvcomp,
aom_write(w, sign, mvcomp->sign);
// Class
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, mv_class, mvcomp->class_cdf, MV_CLASSES);
#else
av1_write_token(w, av1_mv_class_tree, mvcomp->classes,
......@@ -63,7 +63,7 @@ static void encode_mv_component(aom_writer *w, int comp, nmv_component *mvcomp,
}
// Fractional bits
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(
w, fr, mv_class == MV_CLASS_0 ? mvcomp->class0_fp_cdf[d] : mvcomp->fp_cdf,
MV_FP_SIZE);
......@@ -150,7 +150,7 @@ static void update_mv(aom_writer *w, const unsigned int ct[2], aom_prob *cur_p,
#endif
}
#if !CONFIG_EC_ADAPT || !CONFIG_DAALA_EC
#if !CONFIG_EC_ADAPT
static void write_mv_update(const aom_tree_index *tree,
aom_prob probs[/*n - 1*/],
const unsigned int counts[/*n - 1*/], int n,
......@@ -219,9 +219,9 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w,
nmv_context_counts *const counts = nmv_counts;
int j;
#if !CONFIG_EC_ADAPT || !(CONFIG_DAALA_EC || CONFIG_RANS)
#if !CONFIG_EC_ADAPT
write_mv_update(av1_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS, w);
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf(av1_mv_joint_tree, cm->fc->nmvc.joints,
cm->fc->nmvc.joint_cdf);
#endif
......@@ -233,7 +233,7 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w,
update_mv(w, comp_counts->sign, &comp->sign, MV_UPDATE_PROB);
write_mv_update(av1_mv_class_tree, comp->classes, comp_counts->classes,
MV_CLASSES, w);
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf(av1_mv_class_tree, comp->classes, comp->class_cdf);
#endif
write_mv_update(av1_mv_class0_tree, comp->class0, comp_counts->class0,
......@@ -246,18 +246,18 @@ void av1_write_nmv_probs(AV1_COMMON *cm, int usehp, aom_writer *w,
for (j = 0; j < CLASS0_SIZE; ++j) {
write_mv_update(av1_mv_fp_tree, mvc->comps[i].class0_fp[j],
counts->comps[i].class0_fp[j], MV_FP_SIZE, w);
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf(av1_mv_fp_tree, mvc->comps[i].class0_fp[j],
mvc->comps[i].class0_fp_cdf[j]);
#endif
}
write_mv_update(av1_mv_fp_tree, mvc->comps[i].fp, counts->comps[i].fp,
MV_FP_SIZE, w);
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf(av1_mv_fp_tree, mvc->comps[i].fp, mvc->comps[i].fp_cdf);
#endif
}
#endif // !CONFIG_EC_ADAPT || !(CONFIG_DAALA_EC || CONFIG_RANS)
#endif // !CONFIG_EC_ADAPT
if (usehp) {
for (i = 0; i < 2; ++i) {
......@@ -274,7 +274,7 @@ void av1_encode_mv(AV1_COMP *cpi, aom_writer *w, const MV *mv, const MV *ref,
const MV diff = { mv->row - ref->row, mv->col - ref->col };
const MV_JOINT_TYPE j = av1_get_mv_joint(&diff);
#if CONFIG_DAALA_EC || CONFIG_RANS
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, j, mvctx->joint_cdf, MV_JOINTS);
#else
av1_write_token(w, av1_mv_joint_tree, mvctx->joints, &mv_joint_encodings[j]);
......
......@@ -318,17 +318,17 @@ 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_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob (*token_cdf)[ENTROPY_TOKENS],
#endif // CONFIG_RANS
#endif // CONFIG_EC_MULTISYMBOL
int32_t extra, uint8_t token,
uint8_t skip_eob_node, unsigned int *counts) {
(*t)->token = token;
(*t)->extra = extra;
(*t)->context_tree = context_tree;
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
(*t)->token_cdf = token_cdf;
#endif // CONFIG_RANS
#endif // CONFIG_EC_MULTISYMBOL
(*t)->skip_eob_node = skip_eob_node;
(*t)++;
++counts[token];
......@@ -402,7 +402,7 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
td->rd_counts.coef_counts[tx_size][type][ref];
aom_prob(*const coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
cpi->common.fc->coef_probs[tx_size][type][ref];
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob(*const coef_cdfs)[COEFF_CONTEXTS][ENTROPY_TOKENS] =
cpi->common.fc->coef_cdfs[tx_size][type][ref];
#endif
......@@ -426,7 +426,7 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
while (!v) {
add_token(&t, coef_probs[band[c]][pt],
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
&coef_cdfs[band[c]][pt],
#endif
0, ZERO_TOKEN, skip_eob, counts[band[c]][pt]);
......@@ -442,7 +442,7 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
av1_get_token_extra(v, &token, &extra);
add_token(&t, coef_probs[band[c]][pt],
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
&coef_cdfs[band[c]][pt],
#endif
extra, (uint8_t)token, (uint8_t)skip_eob, counts[band[c]][pt]);
......@@ -454,7 +454,7 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
}
if (c < seg_eob) {
add_token(&t, coef_probs[band[c]][pt],
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
NULL,
#endif
0, EOB_TOKEN, 0, counts[band[c]][pt]);
......
......@@ -36,7 +36,7 @@ typedef struct {
typedef struct {
const aom_prob *context_tree;
#if CONFIG_RANS || CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob (*token_cdf)[ENTROPY_TOKENS];
#endif
EXTRABIT extra;
......
......@@ -257,7 +257,7 @@ EXPERIMENT_LIST="
ext_compound
supertx
ans
rans
ec_multisymbol
daala_ec
parallel_deblocking
cb4x4
......@@ -428,9 +428,10 @@ post_process_cmdline() {
done
# Fix up experiment dependencies
enabled ec_adapt && ! enabled rans && soft_enable daala_ec
enabled ec_adapt && ! enabled daala_ec && soft_enable rans
enabled rans && enable_feature ans
enabled ec_adapt && enable_feature ec_multisymbol
enabled ec_multisymbol && ! enabled ans && soft_enable daala_ec
enabled ec_multisymbol && ! enabled daala_ec && soft_enable ans
enabled daala_ec && enable_feature ec_multisymbol
}
......
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