EC_ADAPT: use tile context for inter mode.
Change-Id: I522dfe77cbe0ea4833d11e25386586d7312c463f
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 500952e..4687944 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -215,20 +215,20 @@
}
#endif // CONFIG_EXT_INTER
-static void write_inter_mode(AV1_COMMON *cm, aom_writer *w,
- PREDICTION_MODE mode,
+static void write_inter_mode(aom_writer *w, PREDICTION_MODE mode,
+ FRAME_CONTEXT *ec_ctx,
#if CONFIG_REF_MV && CONFIG_EXT_INTER
int is_compound,
#endif // CONFIG_REF_MV && CONFIG_EXT_INTER
const int16_t mode_ctx) {
#if CONFIG_REF_MV
const int16_t newmv_ctx = mode_ctx & NEWMV_CTX_MASK;
- const aom_prob newmv_prob = cm->fc->newmv_prob[newmv_ctx];
+ const aom_prob newmv_prob = ec_ctx->newmv_prob[newmv_ctx];
#if CONFIG_EXT_INTER
aom_write(w, mode != NEWMV && mode != NEWFROMNEARMV, newmv_prob);
if (!is_compound && (mode == NEWMV || mode == NEWFROMNEARMV))
- aom_write(w, mode == NEWFROMNEARMV, cm->fc->new2mv_prob);
+ aom_write(w, mode == NEWFROMNEARMV, ec_ctx->new2mv_prob);
if (mode != NEWMV && mode != NEWFROMNEARMV) {
#else
@@ -237,7 +237,7 @@
if (mode != NEWMV) {
#endif // CONFIG_EXT_INTER
const int16_t zeromv_ctx = (mode_ctx >> ZEROMV_OFFSET) & ZEROMV_CTX_MASK;
- const aom_prob zeromv_prob = cm->fc->zeromv_prob[zeromv_ctx];
+ const aom_prob zeromv_prob = ec_ctx->zeromv_prob[zeromv_ctx];
if (mode_ctx & (1 << ALL_ZERO_FLAG_OFFSET)) {
assert(mode == ZEROMV);
@@ -254,7 +254,7 @@
if (mode_ctx & (1 << SKIP_NEARMV_OFFSET)) refmv_ctx = 7;
if (mode_ctx & (1 << SKIP_NEARESTMV_SUB8X8_OFFSET)) refmv_ctx = 8;
- refmv_prob = cm->fc->refmv_prob[refmv_ctx];
+ refmv_prob = ec_ctx->refmv_prob[refmv_ctx];
aom_write(w, mode != NEARESTMV, refmv_prob);
}
}
@@ -262,10 +262,10 @@
assert(is_inter_mode(mode));
#if CONFIG_EC_MULTISYMBOL
aom_write_symbol(w, av1_inter_mode_ind[INTER_OFFSET(mode)],
- cm->fc->inter_mode_cdf[mode_ctx], INTER_MODES);
+ ec_ctx->inter_mode_cdf[mode_ctx], INTER_MODES);
#else
{
- const aom_prob *const inter_probs = cm->fc->inter_mode_probs[mode_ctx];
+ const aom_prob *const inter_probs = ec_ctx->inter_mode_probs[mode_ctx];
av1_write_token(w, av1_inter_mode_tree, inter_probs,
&inter_mode_encodings[INTER_OFFSET(mode)]);
}
@@ -1421,7 +1421,7 @@
write_inter_compound_mode(cm, w, mode, mode_ctx);
else if (is_inter_singleref_mode(mode))
#endif // CONFIG_EXT_INTER
- write_inter_mode(cm, w, mode,
+ write_inter_mode(w, mode, ec_ctx,
#if CONFIG_REF_MV && CONFIG_EXT_INTER
is_compound,
#endif // CONFIG_REF_MV && CONFIG_EXT_INTER
@@ -1458,7 +1458,7 @@
write_inter_compound_mode(cm, w, b_mode, mode_ctx);
else if (is_inter_singleref_mode(b_mode))
#endif // CONFIG_EXT_INTER
- write_inter_mode(cm, w, b_mode,
+ write_inter_mode(w, b_mode, ec_ctx,
#if CONFIG_REF_MV && CONFIG_EXT_INTER
has_second_ref(mbmi),
#endif // CONFIG_REF_MV && CONFIG_EXT_INTER