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

Use y_mode_cdf with CONFIG_EC_MULTISYMBOL.

Change-Id: Ia5046d9158d5421a7f6e0397f4fa1e1925ae2ccb
parent a59b23dd
......@@ -583,9 +583,9 @@ static const aom_prob default_obmc_prob[BLOCK_SIZES] = {
static const aom_prob default_delta_q_probs[DELTA_Q_CONTEXTS] = { 220, 220,
220 };
#endif
#if CONFIG_EC_MULTISYMBOL
int av1_intra_mode_ind[INTRA_MODES];
int av1_intra_mode_inv[INTRA_MODES];
#if CONFIG_EC_MULTISYMBOL
int av1_inter_mode_ind[INTER_MODES];
int av1_inter_mode_inv[INTER_MODES];
#endif
......@@ -1773,14 +1773,14 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->switchable_restore_prob, default_switchable_restore_prob);
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_DAALA_EC
av1_tree_to_cdf_1D(av1_intra_mode_tree, fc->y_mode_prob, fc->y_mode_cdf,
BLOCK_SIZE_GROUPS);
av1_tree_to_cdf_1D(av1_intra_mode_tree, fc->uv_mode_prob, fc->uv_mode_cdf,
INTRA_MODES);
av1_tree_to_cdf_2D(av1_intra_mode_tree, av1_kf_y_mode_prob, av1_kf_y_mode_cdf,
INTRA_MODES, INTRA_MODES);
#endif
#if CONFIG_EC_MULTISYMBOL
av1_tree_to_cdf_1D(av1_intra_mode_tree, fc->y_mode_prob, fc->y_mode_cdf,
BLOCK_SIZE_GROUPS);
av1_tree_to_cdf_1D(av1_switchable_interp_tree, fc->switchable_interp_prob,
fc->switchable_interp_cdf, SWITCHABLE_FILTER_CONTEXTS);
av1_tree_to_cdf_1D(av1_partition_tree, fc->partition_prob, fc->partition_cdf,
......@@ -1824,6 +1824,9 @@ void av1_set_mode_cdfs(struct AV1Common *cm) {
av1_tree_to_cdf(av1_inter_mode_tree, fc->inter_mode_probs[i],
fc->inter_mode_cdf[i]);
for (i = 0; i < BLOCK_SIZE_GROUPS; ++i)
av1_tree_to_cdf(av1_intra_mode_tree, fc->y_mode_prob[i], fc->y_mode_cdf[i]);
#if !CONFIG_EXT_TX
for (i = TX_4X4; i < EXT_TX_SIZES; ++i)
for (j = 0; j < TX_TYPES; ++j)
......@@ -1844,9 +1847,6 @@ void av1_set_mode_cdfs(struct AV1Common *cm) {
av1_tree_to_cdf(av1_intra_mode_tree, cm->kf_y_prob[i][j],
cm->kf_y_cdf[i][j]);
for (i = 0; i < BLOCK_SIZE_GROUPS; ++i)
av1_tree_to_cdf(av1_intra_mode_tree, fc->y_mode_prob[i], fc->y_mode_cdf[i]);
#endif
}
#endif
......
......@@ -166,10 +166,10 @@ typedef struct frame_contexts {
aom_prob switchable_restore_prob[RESTORE_SWITCHABLE_TYPES - 1];
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_DAALA_EC
aom_cdf_prob y_mode_cdf[BLOCK_SIZE_GROUPS][INTRA_MODES];
aom_cdf_prob uv_mode_cdf[INTRA_MODES][INTRA_MODES];
#endif
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob y_mode_cdf[BLOCK_SIZE_GROUPS][INTRA_MODES];
aom_cdf_prob partition_cdf[PARTITION_CONTEXTS][PARTITION_TYPES];
aom_cdf_prob switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS];
......@@ -307,11 +307,9 @@ extern const aom_prob av1_default_palette_uv_color_prob[PALETTE_MAX_SIZE - 1]
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_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
extern int av1_intra_mode_ind[INTRA_MODES];
extern int av1_intra_mode_inv[INTRA_MODES];
#endif
#if CONFIG_EC_MULTISYMBOL
extern int av1_inter_mode_ind[INTER_MODES];
extern int av1_inter_mode_inv[INTER_MODES];
#endif
......
......@@ -57,6 +57,12 @@ static PREDICTION_MODE read_intra_mode(aom_reader *r, const aom_prob *p) {
return (PREDICTION_MODE)aom_read_tree(r, av1_intra_mode_tree, p, ACCT_STR);
}
#endif
#if CONFIG_EC_MULTISYMBOL
static PREDICTION_MODE read_intra_mode_cdf(aom_reader *r, aom_cdf_prob *cdf) {
return (PREDICTION_MODE)
av1_intra_mode_inv[aom_read_symbol(r, cdf, INTRA_MODES, ACCT_STR)];
}
#endif
#if CONFIG_DELTA_Q
static int read_delta_qindex(AV1_COMMON *cm, MACROBLOCKD *xd, aom_reader *r,
......@@ -97,8 +103,8 @@ static int read_delta_qindex(AV1_COMMON *cm, MACROBLOCKD *xd, aom_reader *r,
static PREDICTION_MODE read_intra_mode_y(AV1_COMMON *cm, MACROBLOCKD *xd,
aom_reader *r, int size_group) {
const PREDICTION_MODE y_mode =
#if CONFIG_DAALA_EC
read_intra_mode(r, cm->fc->y_mode_cdf[size_group]);
#if CONFIG_EC_MULTISYMBOL
read_intra_mode_cdf(r, cm->fc->y_mode_cdf[size_group]);
#else
read_intra_mode(r, cm->fc->y_mode_prob[size_group]);
#endif
......
......@@ -50,11 +50,9 @@ static void initialize_dec(void) {
av1_init_wedge_masks();
#endif // CONFIG_EXT_INTER
init_done = 1;
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
av1_indices_from_tree(av1_intra_mode_ind, av1_intra_mode_inv, INTRA_MODES,
av1_intra_mode_tree);
#endif
#if CONFIG_EC_MULTISYMBOL
av1_indices_from_tree(av1_switchable_interp_ind, av1_switchable_interp_inv,
SWITCHABLE_FILTERS, av1_switchable_interp_tree);
#if !CONFIG_EXT_TX
......
......@@ -193,12 +193,8 @@ void av1_encode_token_init(void) {
av1_indices_from_tree(av1_ext_tx_ind, av1_ext_tx_inv, TX_TYPES,
av1_ext_tx_tree);
#endif
#endif
#if CONFIG_DAALA_EC
av1_indices_from_tree(av1_intra_mode_ind, av1_intra_mode_inv, INTRA_MODES,
av1_intra_mode_tree);
#endif
#if CONFIG_EC_MULTISYMBOL
av1_indices_from_tree(av1_inter_mode_ind, av1_inter_mode_inv, INTER_MODES,
av1_inter_mode_tree);
#endif
......@@ -1351,7 +1347,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const MODE_INFO *mi,
if (!is_inter) {
if (bsize >= BLOCK_8X8 || unify_bsize) {
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, av1_intra_mode_ind[mode],
cm->fc->y_mode_cdf[size_group_lookup[bsize]],
INTRA_MODES);
......@@ -1365,7 +1361,7 @@ static void pack_inter_mode_mvs(AV1_COMP *cpi, const MODE_INFO *mi,
for (idy = 0; idy < 2; idy += num_4x4_h) {
for (idx = 0; idx < 2; idx += num_4x4_w) {
const PREDICTION_MODE b_mode = mi->bmi[idy * 2 + idx].as_mode;
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, av1_intra_mode_ind[b_mode], cm->fc->y_mode_cdf[0],
INTRA_MODES);
#else
......
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