Commit 00b3331e authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge

Use switchable_interp_cdf with CONFIG_EC_MULTISYMBOL.

Change-Id: I3f7eeff102fc30e2cef59c2c07df94826587d100
parent 29ccee03
......@@ -1775,14 +1775,14 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
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_1D(av1_switchable_interp_tree, fc->switchable_interp_prob,
fc->switchable_interp_cdf, SWITCHABLE_FILTER_CONTEXTS);
av1_tree_to_cdf_1D(av1_inter_mode_tree, fc->inter_mode_probs,
fc->inter_mode_cdf, INTER_MODE_CONTEXTS);
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_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,
PARTITION_CONTEXTS);
#if !CONFIG_EXT_TX
......@@ -1798,12 +1798,10 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
#endif
}
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
int av1_switchable_interp_ind[SWITCHABLE_FILTERS];
int av1_switchable_interp_inv[SWITCHABLE_FILTERS];
#endif
#if CONFIG_EC_MULTISYMBOL
void av1_set_mode_cdfs(struct AV1Common *cm) {
FRAME_CONTEXT *fc = cm->fc;
int i, j;
......@@ -1816,6 +1814,10 @@ void av1_set_mode_cdfs(struct AV1Common *cm) {
av1_tree_to_cdf(av1_partition_tree, fc->partition_prob[i],
fc->partition_cdf[i]);
for (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j)
av1_tree_to_cdf(av1_switchable_interp_tree, fc->switchable_interp_prob[j],
fc->switchable_interp_cdf[j]);
#if !CONFIG_EXT_TX
for (i = TX_4X4; i < EXT_TX_SIZES; ++i)
for (j = 0; j < TX_TYPES; ++j)
......@@ -1836,10 +1838,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 (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j)
av1_tree_to_cdf(av1_switchable_interp_tree, fc->switchable_interp_prob[j],
fc->switchable_interp_cdf[j]);
for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
av1_tree_to_cdf(av1_inter_mode_tree, fc->inter_mode_probs[i],
fc->inter_mode_cdf[i]);
......
......@@ -168,12 +168,12 @@ typedef struct frame_contexts {
#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];
aom_cdf_prob switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS];
aom_cdf_prob inter_mode_cdf[INTER_MODE_CONTEXTS][INTER_MODES];
#endif
#if CONFIG_EC_MULTISYMBOL
aom_cdf_prob partition_cdf[PARTITION_CONTEXTS][PARTITION_TYPES];
aom_cdf_prob switchable_interp_cdf[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS];
#if !CONFIG_EXT_TX
aom_cdf_prob intra_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES][TX_TYPES];
aom_cdf_prob inter_ext_tx_cdf[EXT_TX_SIZES][TX_TYPES];
......@@ -358,11 +358,10 @@ 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_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
extern int av1_switchable_interp_ind[SWITCHABLE_FILTERS];
extern int av1_switchable_interp_inv[SWITCHABLE_FILTERS];
#endif
#if CONFIG_EC_MULTISYMBOL
void av1_set_mode_cdfs(struct AV1Common *cm);
#endif
......
......@@ -1082,7 +1082,7 @@ static INLINE void read_mb_interp_filter(AV1_COMMON *const cm,
if (has_subpel_mv_component(xd->mi[0], xd, dir) ||
(mbmi->ref_frame[1] > INTRA_FRAME &&
has_subpel_mv_component(xd->mi[0], xd, dir + 2))) {
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
mbmi->interp_filter[dir] =
(InterpFilter)av1_switchable_interp_inv[aom_read_symbol(
r, cm->fc->switchable_interp_cdf[ctx], SWITCHABLE_FILTERS,
......@@ -1112,7 +1112,7 @@ static INLINE void read_mb_interp_filter(AV1_COMMON *const cm,
mbmi->interp_filter = cm->interp_filter;
} else {
const int ctx = av1_get_pred_context_switchable_interp(xd);
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
mbmi->interp_filter =
(InterpFilter)av1_switchable_interp_inv[aom_read_symbol(
r, cm->fc->switchable_interp_cdf[ctx], SWITCHABLE_FILTERS,
......
......@@ -51,14 +51,14 @@ static void initialize_dec(void) {
#endif // CONFIG_EXT_INTER
init_done = 1;
#if CONFIG_DAALA_EC
av1_indices_from_tree(av1_switchable_interp_ind, av1_switchable_interp_inv,
SWITCHABLE_FILTERS, av1_switchable_interp_tree);
av1_indices_from_tree(av1_intra_mode_ind, av1_intra_mode_inv, INTRA_MODES,
av1_intra_mode_tree);
av1_indices_from_tree(av1_inter_mode_ind, av1_inter_mode_inv, INTER_MODES,
av1_inter_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
av1_indices_from_tree(av1_ext_tx_ind, av1_ext_tx_inv, TX_TYPES,
av1_ext_tx_tree);
......
......@@ -1111,7 +1111,7 @@ static void write_mb_interp_filter(AV1_COMP *cpi, const MACROBLOCKD *xd,
#else
{
const int ctx = av1_get_pred_context_switchable_interp(xd);
#if CONFIG_DAALA_EC
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, av1_switchable_interp_ind[mbmi->interp_filter],
cm->fc->switchable_interp_cdf[ctx], SWITCHABLE_FILTERS);
#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