Commit 77c7c40f authored by Thomas Davies's avatar Thomas Davies

EC_ADAPT: use tile context for switchable filter.

Change-Id: I7bbd3c62341ede45628641766b8683b77f3a7efb
parent 1de6c88a
......@@ -1104,6 +1104,12 @@ static INLINE void read_mb_interp_filter(AV1_COMMON *const cm,
MB_MODE_INFO *const mbmi,
aom_reader *r) {
FRAME_COUNTS *counts = xd->counts;
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
#if CONFIG_DUAL_FILTER
int dir;
if (cm->interp_filter != SWITCHABLE) {
......@@ -1119,11 +1125,11 @@ static INLINE void read_mb_interp_filter(AV1_COMMON *const cm,
#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,
r, ec_ctx->switchable_interp_cdf[ctx], SWITCHABLE_FILTERS,
ACCT_STR)];
#else
mbmi->interp_filter[dir] = (InterpFilter)aom_read_tree(
r, av1_switchable_interp_tree, cm->fc->switchable_interp_prob[ctx],
r, av1_switchable_interp_tree, ec_ctx->switchable_interp_prob[ctx],
ACCT_STR);
#endif
if (counts) ++counts->switchable_interp[ctx][mbmi->interp_filter[dir]];
......@@ -1143,11 +1149,11 @@ static INLINE void read_mb_interp_filter(AV1_COMMON *const cm,
#if CONFIG_EC_MULTISYMBOL
mbmi->interp_filter =
(InterpFilter)av1_switchable_interp_inv[aom_read_symbol(
r, cm->fc->switchable_interp_cdf[ctx], SWITCHABLE_FILTERS,
r, ec_ctx->switchable_interp_cdf[ctx], SWITCHABLE_FILTERS,
ACCT_STR)];
#else
mbmi->interp_filter = (InterpFilter)aom_read_tree(
r, av1_switchable_interp_tree, cm->fc->switchable_interp_prob[ctx],
r, av1_switchable_interp_tree, ec_ctx->switchable_interp_prob[ctx],
ACCT_STR);
#endif
if (counts) ++counts->switchable_interp[ctx][mbmi->interp_filter];
......
......@@ -1072,6 +1072,11 @@ static void write_mb_interp_filter(AV1_COMP *cpi, const MACROBLOCKD *xd,
aom_writer *w) {
AV1_COMMON *const cm = &cpi->common;
const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
#if CONFIG_EC_ADAPT
FRAME_CONTEXT *ec_ctx = xd->tile_ctx;
#else
FRAME_CONTEXT *ec_ctx = cm->fc;
#endif
if (cm->interp_filter == SWITCHABLE) {
#if CONFIG_DUAL_FILTER
......@@ -1087,7 +1092,7 @@ static void write_mb_interp_filter(AV1_COMP *cpi, const MACROBLOCKD *xd,
has_subpel_mv_component(xd->mi[0], xd, dir + 2))) {
const int ctx = av1_get_pred_context_switchable_interp(xd, dir);
av1_write_token(w, av1_switchable_interp_tree,
cm->fc->switchable_interp_prob[ctx],
ec_ctx->switchable_interp_prob[ctx],
&switchable_interp_encodings[mbmi->interp_filter[dir]]);
++cpi->interp_filter_selected[0][mbmi->interp_filter[dir]];
}
......@@ -1097,10 +1102,10 @@ static void write_mb_interp_filter(AV1_COMP *cpi, const MACROBLOCKD *xd,
const int ctx = av1_get_pred_context_switchable_interp(xd);
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, av1_switchable_interp_ind[mbmi->interp_filter],
cm->fc->switchable_interp_cdf[ctx], SWITCHABLE_FILTERS);
ec_ctx->switchable_interp_cdf[ctx], SWITCHABLE_FILTERS);
#else
av1_write_token(w, av1_switchable_interp_tree,
cm->fc->switchable_interp_prob[ctx],
ec_ctx->switchable_interp_prob[ctx],
&switchable_interp_encodings[mbmi->interp_filter]);
#endif
++cpi->interp_filter_selected[0][mbmi->interp_filter];
......
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