Commit 6bdc40f1 authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Thomas Davies

Remove the EC_ADAPT experimental flags.

Removing these flags make the EC_ADAPT experiment an integral part of
 the draft AV1 bitstream definition
This commit has no effect on metrics.

Change-Id: Ice78520935e8bfa9d25cf4b8384a1b872069d09c
parent 9f5cedd1
......@@ -194,9 +194,7 @@ static INLINE int aom_read_symbol_(aom_reader *r, aom_cdf_prob *cdf,
int nsymbs ACCT_STR_PARAM) {
int ret;
ret = aom_read_cdf(r, cdf, nsymbs, ACCT_STR_NAME);
#if CONFIG_EC_ADAPT
update_cdf(cdf, ret, nsymbs);
#endif
return ret;
}
......
......@@ -140,9 +140,7 @@ static INLINE void aom_write_cdf(aom_writer *w, int symb,
static INLINE void aom_write_symbol(aom_writer *w, int symb, aom_cdf_prob *cdf,
int nsymbs) {
aom_write_cdf(w, symb, cdf, nsymbs);
#if CONFIG_EC_ADAPT
update_cdf(cdf, symb, nsymbs);
#endif
}
static INLINE void aom_write_tree_as_cdf(aom_writer *w,
......
......@@ -186,10 +186,8 @@ int tree_to_cdf(const aom_tree_index *tree, const aom_prob *probs,
for (i = 1; i < nsymbs; i++) {
cdf[i] = AOM_ICDF(AOM_ICDF(cdf[i - 1]) + cdf[i]);
}
// Store symbol count at the end of the CDF
#if CONFIG_EC_ADAPT
// Store symbol count at the end of the CDF
cdf[nsymbs] = 0;
#endif
return nsymbs;
}
......
......@@ -148,7 +148,6 @@ static INLINE void av1_tree_to_cdf(const aom_tree_index *tree,
void av1_indices_from_tree(int *ind, int *inv, const aom_tree_index *tree);
#if CONFIG_EC_ADAPT
static INLINE void update_cdf(aom_cdf_prob *cdf, int val, int nsymbs) {
const int rate = 4 + (cdf[nsymbs] > 31) + get_msb(nsymbs);
const int rate2 = 5;
......@@ -183,7 +182,6 @@ static INLINE void update_cdf(aom_cdf_prob *cdf, int val, int nsymbs) {
#endif
cdf[nsymbs] += (cdf[nsymbs] < 32);
}
#endif
#ifdef __cplusplus
} // extern "C"
......
......@@ -702,9 +702,7 @@ typedef struct macroblockd {
#if CONFIG_PVQ
daala_dec_ctx daala_dec;
#endif
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *tile_ctx;
#endif
/* Bit depth: 8, 10, 12 */
int bd;
......
......@@ -5590,7 +5590,6 @@ void av1_adapt_coef_probs(AV1_COMMON *cm) {
#endif
}
#if CONFIG_EC_ADAPT
static void av1_average_cdf(aom_cdf_prob *cdf_ptr[], aom_cdf_prob *fc_cdf_ptr,
int cdf_size, const int num_tiles) {
int i;
......@@ -5714,9 +5713,7 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
#if CONFIG_EXT_INTER
AVERAGE_TILE_CDFS(inter_compound_mode_cdf)
#if CONFIG_EC_ADAPT
AVERAGE_TILE_CDFS(compound_type_cdf)
#endif // CONFIG_EC_ADAPT
#if CONFIG_INTERINTRA
#if CONFIG_NEW_MULTISYMBOL
......@@ -5808,4 +5805,3 @@ void av1_average_tile_pvq_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
AVERAGE_TILE_CDFS(pvq_context.pvq.pvq_skip_dir_cdf)
}
#endif // CONFIG_PVQ
#endif // CONFIG_EC_ADAPT
......@@ -188,9 +188,7 @@ struct AV1Common;
struct frame_contexts;
void av1_default_coef_probs(struct AV1Common *cm);
void av1_adapt_coef_probs(struct AV1Common *cm);
#if CONFIG_EC_ADAPT
void av1_adapt_coef_cdfs(struct AV1Common *cm, struct frame_contexts *pre_fc);
#endif
// This is the index in the scan order beyond which all coefficients for
// 8x8 transform and above are in the top band.
......@@ -431,7 +429,6 @@ static INLINE aom_prob av1_mode_mv_merge_probs(aom_prob pre_prob,
return mode_mv_merge_probs(pre_prob, ct);
}
#if CONFIG_EC_ADAPT
void av1_average_tile_coef_cdfs(struct frame_contexts *fc,
struct frame_contexts *ec_ctxs[],
aom_cdf_prob *cdf_ptrs[], int num_tiles);
......@@ -450,7 +447,6 @@ void av1_default_pvq_probs(struct AV1Common *cm);
void av1_average_tile_pvq_cdfs(struct frame_contexts *fc,
struct frame_contexts *ec_ctxs[], int num_tiles);
#endif // CONFIG_PVQ
#endif // CONFIG_EC_ADAPT
#ifdef __cplusplus
} // extern "C"
#endif
......
This diff is collapsed.
......@@ -195,37 +195,29 @@ typedef struct frame_contexts {
#if CONFIG_EXT_INTER
aom_prob inter_compound_mode_probs[INTER_MODE_CONTEXTS]
[INTER_COMPOUND_MODES - 1];
#if CONFIG_EC_ADAPT
aom_cdf_prob inter_compound_mode_cdf[INTER_MODE_CONTEXTS]
[CDF_SIZE(INTER_COMPOUND_MODES)];
#endif
#if CONFIG_COMPOUND_SINGLEREF
aom_prob inter_singleref_comp_mode_probs[INTER_MODE_CONTEXTS]
[INTER_SINGLEREF_COMP_MODES - 1];
#endif // CONFIG_COMPOUND_SINGLEREF
aom_prob compound_type_prob[BLOCK_SIZES][COMPOUND_TYPES - 1];
#if CONFIG_EC_ADAPT
aom_cdf_prob compound_type_cdf[BLOCK_SIZES][CDF_SIZE(COMPOUND_TYPES)];
#endif
#if CONFIG_INTERINTRA
aom_prob interintra_prob[BLOCK_SIZE_GROUPS];
aom_prob wedge_interintra_prob[BLOCK_SIZES];
aom_prob interintra_mode_prob[BLOCK_SIZE_GROUPS][INTERINTRA_MODES - 1];
#if CONFIG_EC_ADAPT
#if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob interintra_cdf[BLOCK_SIZE_GROUPS][CDF_SIZE(2)];
aom_cdf_prob wedge_interintra_cdf[BLOCK_SIZES][CDF_SIZE(2)];
#endif
aom_cdf_prob interintra_mode_cdf[BLOCK_SIZE_GROUPS]
[CDF_SIZE(INTERINTRA_MODES)];
#endif
#endif // CONFIG_INTERINTRA
#endif // CONFIG_EXT_INTER
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
aom_prob motion_mode_prob[BLOCK_SIZES][MOTION_MODES - 1];
#if CONFIG_EC_ADAPT
aom_cdf_prob motion_mode_cdf[BLOCK_SIZES][CDF_SIZE(MOTION_MODES)];
#endif
#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
aom_prob ncobmc_mode_prob[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES - 1];
#endif
......@@ -372,11 +364,11 @@ typedef struct frame_contexts {
typedef struct FRAME_COUNTS {
// Note: This structure should only contain 'unsigned int' fields, or
// aggregates built solely from 'unsigned int' fields/elements
#if !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
#if CONFIG_ENTROPY_STATS
unsigned int kf_y_mode[INTRA_MODES][INTRA_MODES][INTRA_MODES];
unsigned int y_mode[BLOCK_SIZE_GROUPS][INTRA_MODES];
unsigned int uv_mode[INTRA_MODES][INTRA_MODES];
#endif // !CONFIG_EC_ADAPT || CONFIG_ENTROPY_STATS
#endif // CONFIG_ENTROPY_STATS
#if CONFIG_EXT_PARTITION_TYPES
unsigned int partition[PARTITION_CONTEXTS][EXT_PARTITION_TYPES];
#else
......@@ -510,13 +502,6 @@ typedef struct FRAME_COUNTS {
#endif // CONFIG_FILTER_INTRA
} FRAME_COUNTS;
#if !CONFIG_EC_ADAPT
// Default probabilities for signaling Intra mode for Y plane -- used only for
// intra-only frames. ('default_if_y_probs' is used for inter frames).
// 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];
#endif
// 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)];
......@@ -536,14 +521,8 @@ extern const aom_prob av1_default_palette_uv_color_index_prob
[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][PALETTE_COLORS - 1];
#endif // CONFIG_PALETTE
#if !CONFIG_EC_ADAPT
extern const aom_tree_index av1_intra_mode_tree[TREE_SIZE(INTRA_MODES)];
extern int av1_intra_mode_ind[INTRA_MODES];
extern int av1_intra_mode_inv[INTRA_MODES];
#else
extern const int av1_intra_mode_ind[INTRA_MODES];
extern const int av1_intra_mode_inv[INTRA_MODES];
#endif
#if CONFIG_EXT_TX
extern int av1_ext_tx_intra_ind[EXT_TX_SETS_INTRA][TX_TYPES];
extern int av1_ext_tx_intra_inv[EXT_TX_SETS_INTRA][TX_TYPES];
......@@ -605,10 +584,6 @@ extern const aom_tree_index
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
void av1_setup_past_independence(struct AV1Common *cm);
void av1_adapt_intra_frame_probs(struct AV1Common *cm);
......
......@@ -228,25 +228,6 @@ void av1_adapt_mv_probs(AV1_COMMON *cm, int allow_hp) {
}
}
#if !CONFIG_EC_ADAPT
void av1_set_mv_cdfs(nmv_context *ctx) {
int i;
int j;
av1_tree_to_cdf(av1_mv_joint_tree, ctx->joints, ctx->joint_cdf);
for (i = 0; i < 2; ++i) {
nmv_component *const comp_ctx = &ctx->comps[i];
av1_tree_to_cdf(av1_mv_class_tree, comp_ctx->classes, comp_ctx->class_cdf);
for (j = 0; j < CLASS0_SIZE; ++j) {
av1_tree_to_cdf(av1_mv_fp_tree, comp_ctx->class0_fp[j],
comp_ctx->class0_fp_cdf[j]);
}
av1_tree_to_cdf(av1_mv_fp_tree, comp_ctx->fp, comp_ctx->fp_cdf);
}
}
#endif
void av1_init_mv_probs(AV1_COMMON *cm) {
int i;
for (i = 0; i < NMV_CONTEXTS; ++i) {
......
......@@ -137,9 +137,6 @@ typedef enum {
void av1_inc_mv(const MV *mv, nmv_context_counts *mvctx,
MvSubpelPrecision precision);
#if !CONFIG_EC_ADAPT
void av1_set_mv_cdfs(nmv_context *ctx);
#endif
#ifdef __cplusplus
} // extern "C"
......
......@@ -22,9 +22,7 @@ void aom_cdf_init_q15_1D(uint16_t *cdf, int nsyms, int cdf_size) {
for (i = 0; i < nsyms; i++)
cdf[i] = AOM_ICDF((i + 1)*CDF_PROB_TOP/nsyms);
#if CONFIG_EC_ADAPT
cdf[cdf_size - 1] = 0;
#endif
}
/** Adapts a Q15 cdf after encoding/decoding a symbol. */
......
......@@ -47,7 +47,7 @@ void generic_model_init(generic_encoder *model);
#define OD_CDFS_INIT_Q15(cdfs) \
{ int n_cdfs = sizeof(cdfs)/sizeof(cdfs[0]); \
int cdf_size = sizeof(cdfs[0])/sizeof(cdfs[0][0]); \
int nsyms = cdf_size - CONFIG_EC_ADAPT; \
int nsyms = cdf_size - 1; \
int i_; \
for (i_ = 0; i_ < n_cdfs; i_++) \
aom_cdf_init_q15_1D(cdfs[i_], nsyms, cdf_size); \
......
......@@ -163,26 +163,6 @@ static TX_MODE read_tx_mode(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
#endif // CONFIG_VAR_TX_NO_TX_MODE
}
#if !CONFIG_EC_ADAPT
static void read_tx_size_probs(FRAME_CONTEXT *fc, aom_reader *r) {
int i, j, k;
for (i = 0; i < MAX_TX_DEPTH; ++i)
for (j = 0; j < TX_SIZE_CONTEXTS; ++j)
for (k = 0; k < i + 1; ++k)
av1_diff_update_prob(r, &fc->tx_size_probs[i][j][k], ACCT_STR);
}
#endif
#if !CONFIG_EC_ADAPT
static void read_switchable_interp_probs(FRAME_CONTEXT *fc, aom_reader *r) {
int i, j;
for (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j) {
for (i = 0; i < SWITCHABLE_FILTERS - 1; ++i)
av1_diff_update_prob(r, &fc->switchable_interp_prob[j][i], ACCT_STR);
}
}
#endif
#if !CONFIG_NEW_MULTISYMBOL
static void read_inter_mode_probs(FRAME_CONTEXT *fc, aom_reader *r) {
int i;
......@@ -197,21 +177,7 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, aom_reader *r) {
}
#endif
#if CONFIG_EXT_INTER
#if !CONFIG_EC_ADAPT
static void read_inter_compound_mode_probs(FRAME_CONTEXT *fc, aom_reader *r) {
int i, j;
if (aom_read(r, GROUP_DIFF_UPDATE_PROB, ACCT_STR)) {
for (j = 0; j < INTER_MODE_CONTEXTS; ++j) {
for (i = 0; i < INTER_COMPOUND_MODES - 1; ++i) {
av1_diff_update_prob(r, &fc->inter_compound_mode_probs[j][i], ACCT_STR);
}
}
}
}
#endif // CONFIG_EC_ADAPT
#if CONFIG_COMPOUND_SINGLEREF
#if CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
static void read_inter_singleref_comp_mode_probs(FRAME_CONTEXT *fc,
aom_reader *r) {
int i, j;
......@@ -224,30 +190,7 @@ static void read_inter_singleref_comp_mode_probs(FRAME_CONTEXT *fc,
}
}
}
#endif // CONFIG_COMPOUND_SINGLEREF
#endif // CONFIG_EXT_INTER
#if !CONFIG_EC_ADAPT
#if !CONFIG_EXT_TX
static void read_ext_tx_probs(FRAME_CONTEXT *fc, aom_reader *r) {
int i, j, k;
if (aom_read(r, GROUP_DIFF_UPDATE_PROB, ACCT_STR)) {
for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
for (j = 0; j < TX_TYPES; ++j) {
for (k = 0; k < TX_TYPES - 1; ++k)
av1_diff_update_prob(r, &fc->intra_ext_tx_prob[i][j][k], ACCT_STR);
}
}
}
if (aom_read(r, GROUP_DIFF_UPDATE_PROB, ACCT_STR)) {
for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
for (k = 0; k < TX_TYPES - 1; ++k)
av1_diff_update_prob(r, &fc->inter_ext_tx_prob[i][k], ACCT_STR);
}
}
}
#endif
#endif
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
static REFERENCE_MODE read_frame_reference_mode(
const AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
......@@ -323,27 +266,6 @@ 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
int j;
update_mv_probs(ctx->joints, MV_JOINTS - 1, r);
for (i = 0; i < 2; ++i) {
nmv_component *const comp_ctx = &ctx->comps[i];
update_mv_probs(&comp_ctx->sign, 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->bits, MV_OFFSET_BITS, r);
}
for (i = 0; i < 2; ++i) {
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);
}
update_mv_probs(comp_ctx->fp, MV_FP_SIZE - 1, r);
}
#endif // !CONFIG_EC_ADAPT
if (allow_hp) {
for (i = 0; i < 2; ++i) {
nmv_component *const comp_ctx = &ctx->comps[i];
......@@ -2319,12 +2241,8 @@ static PARTITION_TYPE read_partition(AV1_COMMON *cm, MACROBLOCKD *xd,
FRAME_COUNTS *const counts = xd->counts;
#endif
PARTITION_TYPE p;
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
(void)cm;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
aom_cdf_prob *partition_cdf = (ctx >= 0) ? ec_ctx->partition_cdf[ctx] : NULL;
......@@ -2631,11 +2549,7 @@ static void decode_partition(AV1Decoder *const pbi, MACROBLOCKD *const xd,
if (skip) {
av1_reset_skip_context(xd, mi_row, mi_col, bsize);
} else {
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
#if CONFIG_EXT_TX
if (get_ext_tx_types(supertx_size, bsize, 1, cm->reduced_tx_set_used) >
1) {
......@@ -2740,33 +2654,6 @@ static void setup_bool_decoder(const uint8_t *data, const uint8_t *data_end,
"Failed to allocate bool decoder %d", 1);
}
#if !CONFIG_PVQ && !CONFIG_EC_ADAPT && !CONFIG_LV_MAP
static void read_coef_probs_common(av1_coeff_probs_model *coef_probs,
aom_reader *r) {
int i, j, k, l, m;
#if CONFIG_EC_ADAPT
const int node_limit = UNCONSTRAINED_NODES - 1;
#else
const int node_limit = UNCONSTRAINED_NODES;
#endif
if (aom_read_bit(r, ACCT_STR))
for (i = 0; i < PLANE_TYPES; ++i)
for (j = 0; j < REF_TYPES; ++j)
for (k = 0; k < COEF_BANDS; ++k)
for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l)
for (m = 0; m < node_limit; ++m)
av1_diff_update_prob(r, &coef_probs[i][j][k][l][m], ACCT_STR);
}
static void read_coef_probs(FRAME_CONTEXT *fc, TX_MODE tx_mode, aom_reader *r) {
const TX_SIZE max_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
TX_SIZE tx_size;
for (tx_size = 0; tx_size <= max_tx_size; ++tx_size)
read_coef_probs_common(fc->coef_probs[tx_size], r);
}
#endif
static void setup_segmentation(AV1_COMMON *const cm,
struct aom_read_bit_buffer *rb) {
struct segmentation *const seg = &cm->seg;
......@@ -3858,11 +3745,9 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
#endif
td->dqcoeff);
#if CONFIG_EC_ADAPT
// Initialise the tile context from the frame context
td->tctx = *cm->fc;
td->xd.tile_ctx = &td->tctx;
#endif
#if CONFIG_PVQ
daala_dec_init(cm, &td->xd.daala_dec, &td->bit_reader);
......@@ -4223,11 +4108,9 @@ static const uint8_t *decode_tiles_mt(AV1Decoder *pbi, const uint8_t *data,
daala_dec_init(cm, &twd->xd.daala_dec, &twd->bit_reader);
twd->xd.daala_dec.state.adapt = &twd->tctx.pvq_context;
#endif
#if CONFIG_EC_ADAPT
// Initialise the tile context from the frame context
twd->tctx = *cm->fc;
twd->xd.tile_ctx = &twd->tctx;
#endif
#if CONFIG_PALETTE
twd->xd.plane[0].color_index_map = twd->color_index_map[0];
twd->xd.plane[1].color_index_map = twd->color_index_map[1];
......@@ -4844,37 +4727,6 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
return sz;
}
#if CONFIG_EXT_TX
#if !CONFIG_EC_ADAPT
static void read_ext_tx_probs(FRAME_CONTEXT *fc, aom_reader *r) {
int i, j, k;
int s;
for (s = 1; s < EXT_TX_SETS_INTER; ++s) {
if (aom_read(r, GROUP_DIFF_UPDATE_PROB, ACCT_STR)) {
for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
if (!use_inter_ext_tx_for_txsize[s][i]) continue;
for (j = 0; j < num_ext_tx_set[ext_tx_set_type_inter[s]] - 1; ++j)
av1_diff_update_prob(r, &fc->inter_ext_tx_prob[s][i][j], ACCT_STR);
}
}
}
for (s = 1; s < EXT_TX_SETS_INTRA; ++s) {
if (aom_read(r, GROUP_DIFF_UPDATE_PROB, ACCT_STR)) {
for (i = TX_4X4; i < EXT_TX_SIZES; ++i) {
if (!use_intra_ext_tx_for_txsize[s][i]) continue;
for (j = 0; j < INTRA_MODES; ++j)
for (k = 0; k < num_ext_tx_set[ext_tx_set_type_intra[s]] - 1; ++k)
av1_diff_update_prob(r, &fc->intra_ext_tx_prob[s][i][j][k],
ACCT_STR);
}
}
}
}
#endif // !CONFIG_EC_ADAPT
#else
#endif // CONFIG_EXT_TX
#if CONFIG_SUPERTX
static void read_supertx_probs(FRAME_CONTEXT *fc, aom_reader *r) {
int i, j;
......@@ -5004,9 +4856,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
FRAME_CONTEXT *const fc = cm->fc;
aom_reader r;
int i;
#if !CONFIG_EC_ADAPT
int j;
#endif
#if CONFIG_ANS && ANS_MAX_SYMBOLS
r.window_size = 1 << cm->ans_window_size_log2;
......@@ -5025,9 +4874,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
}
#endif
#if !CONFIG_EC_ADAPT
if (cm->tx_mode == TX_MODE_SELECT) read_tx_size_probs(fc, &r);
#endif
#if CONFIG_EXT_TX && CONFIG_RECT_TX && CONFIG_RECT_TX_EXT
if (cm->tx_mode == TX_MODE_SELECT)
av1_diff_update_prob(&r, &fc->quarter_tx_size_prob, ACCT_STR);
......@@ -5035,12 +4881,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#if CONFIG_LV_MAP
av1_read_txb_probs(fc, cm->tx_mode, &r);
#else // CONFIG_LV_MAP
#if !CONFIG_PVQ
#if !CONFIG_EC_ADAPT
read_coef_probs(fc, cm->tx_mode, &r);
#endif // !CONFIG_EC_ADAPT
#endif // !CONFIG_PVQ
#endif // CONFIG_LV_MAP
#if !CONFIG_NEW_MULTISYMBOL
......@@ -5052,76 +4892,8 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
av1_diff_update_prob(&r, &fc->skip_probs[i], ACCT_STR);
#endif
#if CONFIG_DELTA_Q && !CONFIG_EC_ADAPT
#if CONFIG_EXT_DELTA_Q
if (cm->delta_q_present_flag) {
for (i = 0; i < DELTA_Q_PROBS; ++i)
av1_diff_update_prob(&r, &fc->delta_q_prob[i], ACCT_STR);
}
if (cm->delta_lf_present_flag) {
for (i = 0; i < DELTA_LF_PROBS; ++i)
av1_diff_update_prob(&r, &fc->delta_lf_prob[i], ACCT_STR);
}
#else
for (i = 0; i < DELTA_Q_PROBS; ++i)
av1_diff_update_prob(&r, &fc->delta_q_prob[i], ACCT_STR);
#endif
#endif
#if !CONFIG_EC_ADAPT
if (cm->seg.enabled && cm->seg.update_map) {
if (cm->seg.temporal_update) {
for (i = 0; i < PREDICTION_PROBS; i++)
av1_diff_update_prob(&r, &cm->fc->seg.pred_probs[i], ACCT_STR);
}
for (i = 0; i < MAX_SEGMENTS - 1; i++)
av1_diff_update_prob(&r, &cm->fc->seg.tree_probs[i], ACCT_STR);
}
for (j = 0; j < INTRA_MODES; j++) {
for (i = 0; i < INTRA_MODES - 1; ++i)
av1_diff_update_prob(&r, &fc->uv_mode_prob[j][i], ACCT_STR);
}
#if CONFIG_EXT_PARTITION_TYPES
for (j = 0; j < PARTITION_PLOFFSET; ++j)
for (i = 0; i < PARTITION_TYPES - 1; ++i)
av1_diff_update_prob(&r, &fc->partition_prob[j][i], ACCT_STR);
for (; j < PARTITION_CONTEXTS_PRIMARY; ++j)
for (i = 0; i < EXT_PARTITION_TYPES - 1; ++i)
av1_diff_update_prob(&r, &fc->partition_prob[j][i], ACCT_STR);
#else
for (j = 0; j < PARTITION_CONTEXTS_PRIMARY; ++j)
for (i = 0; i < PARTITION_TYPES - 1; ++i)
av1_diff_update_prob(&r, &fc->partition_prob[j][i], ACCT_STR);
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_UNPOISON_PARTITION_CTX
for (; j < PARTITION_CONTEXTS_PRIMARY + PARTITION_BLOCK_SIZES; ++j)
av1_diff_update_prob(&r, &fc->partition_prob[j][PARTITION_VERT], ACCT_STR);
for (; j < PARTITION_CONTEXTS_PRIMARY + 2 * PARTITION_BLOCK_SIZES; ++j)
av1_diff_update_prob(&r, &fc->partition_prob[j][PARTITION_HORZ], ACCT_STR);
#endif // CONFIG_UNPOISON_PARTITION_CTX
#if CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
for (i = 0; i < INTRA_FILTERS + 1; ++i)
for (j = 0; j < INTRA_FILTERS - 1; ++j)
av1_diff_update_prob(&r, &fc->intra_filter_probs[i][j], ACCT_STR);
#endif // CONFIG_EXT_INTRA && CONFIG_INTRA_INTERP
#endif // !CONFIG_EC_ADAPT
if (frame_is_intra_only(cm)) {
#if !CONFIG_EC_ADAPT
av1_copy(cm->kf_y_prob, av1_kf_y_mode_prob);
#endif
av1_copy(cm->fc->kf_y_cdf, av1_kf_y_mode_cdf);
#if !CONFIG_EC_ADAPT
int k;
for (k = 0; k < INTRA_MODES; k++)
for (j = 0; j < INTRA_MODES; j++)
for (i = 0; i < INTRA_MODES - 1; ++i)
av1_diff_update_prob(&r, &cm->kf_y_prob[k][j][i], ACCT_STR);
#endif
#if CONFIG_INTRABC
if (cm->allow_screen_content_tools) {
av1_diff_update_prob(&r, &fc->intrabc_prob, ACCT_STR);
......@@ -5133,9 +4905,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#endif
#if CONFIG_EXT_INTER
#if !CONFIG_EC_ADAPT
read_inter_compound_mode_probs(fc, &r);
#endif
#if CONFIG_COMPOUND_SINGLEREF
read_inter_singleref_comp_mode_probs(fc, &r);
#endif // CONFIG_COMPOUND_SINGLEREF
......@@ -5150,12 +4919,6 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
}
}
#endif
#if !CONFIG_EC_ADAPT
for (i = 0; i < BLOCK_SIZE_GROUPS; i++) {
for (j = 0; j < INTERINTRA_MODES - 1; j++)
av1_diff_update_prob(&r, &fc->interintra_mode_prob[i][j], ACCT_STR);
}
#endif
#if CONFIG_WEDGE && !CONFIG_NEW_MULTISYMBOL
for (i = 0; i < BLOCK_SIZES; i++) {
if (is_interintra_allowed_bsize(i) && is_interintra_wedge_used(i)) {
......@@ -5165,32 +4928,8 @@ static int read_compressed_header(AV1Decoder *pbi, const uint8_t *data,
#endif // CONFIG_WEDGE
}
#endif // CONFIG_INTERINTRA
#if !CONFIG_EC_ADAPT && (CONFIG_COMPOUND_SEGMENT || CONFIG_WEDGE)
#if CONFIG_COMPOUND_SINGLEREF
if (cm->allow_masked_compound) {
#else // !CONFIG_COMPOUND_SINGLEREF
if (cm->reference_mode != SINGLE_REFERENCE && cm->allow_masked_compound) {
#endif // CONFIG_COMPOUND_SINGLEREF