Port CONFIG_NEW_INTER_MODES to research branch
AV1 has symbols NEARESTMV and NEARMV to differentiate
between MV0 (nearest) and MV1/MV2/MV3 (near). This
distinction was inherited from VP9, which only had two
motion vectors and only used two symbols. This change
cleans up the syntax so a single mode, NEARMV, can be
used to identify any motion vector. This change is
extended to cover the compound modes. Moreover, the
NEWMV mode, which could only access 0, 1, 2, is
extended and can access any motion vector.
Original work by siroh@ on the experimental branch
Change-Id: I99b162b3d7657a3b6c0bd070364a59a0815b302e
diff --git a/av1/encoder/encodeframe_utils.c b/av1/encoder/encodeframe_utils.c
index 4c96b59..e9dcfe9 100644
--- a/av1/encoder/encodeframe_utils.c
+++ b/av1/encoder/encodeframe_utils.c
@@ -448,12 +448,13 @@
++counts->zeromv_mode[mode_ctx][1];
#endif
update_cdf(fc->zeromv_cdf[mode_ctx], 1, 2);
-
+#if !CONFIG_NEW_INTER_MODES
mode_ctx = (mode_context >> REFMV_OFFSET) & REFMV_CTX_MASK;
#if CONFIG_ENTROPY_STATS
++counts->refmv_mode[mode_ctx][mode != NEARESTMV];
-#endif
+#endif // CONFIG_ENTROPY_STATS
update_cdf(fc->refmv_cdf[mode_ctx], mode != NEARESTMV, 2);
+#endif // !CONFIG_NEW_INTER_MODES
}
static void update_palette_cdf(MACROBLOCKD *xd, const MB_MODE_INFO *const mbmi,
@@ -1225,8 +1226,14 @@
AVERAGE_CDF(ctx_left->coeff_br_cdf, ctx_tr->coeff_br_cdf, BR_CDF_SIZE);
AVERAGE_CDF(ctx_left->newmv_cdf, ctx_tr->newmv_cdf, 2);
AVERAGE_CDF(ctx_left->zeromv_cdf, ctx_tr->zeromv_cdf, 2);
+#if CONFIG_NEW_INTER_MODES
+ AVERAGE_CDF(ctx_left->drl_cdf[0], ctx_tr->drl_cdf[0], 2);
+ AVERAGE_CDF(ctx_left->drl_cdf[1], ctx_tr->drl_cdf[1], 2);
+ AVERAGE_CDF(ctx_left->drl_cdf[2], ctx_tr->drl_cdf[2], 2);
+#else
AVERAGE_CDF(ctx_left->refmv_cdf, ctx_tr->refmv_cdf, 2);
AVERAGE_CDF(ctx_left->drl_cdf, ctx_tr->drl_cdf, 2);
+#endif // CONFIG_NEW_INTER_MODES
AVERAGE_CDF(ctx_left->inter_compound_mode_cdf,
ctx_tr->inter_compound_mode_cdf, INTER_COMPOUND_MODES);
AVERAGE_CDF(ctx_left->compound_type_cdf, ctx_tr->compound_type_cdf,