Add encoder/decoder pipeline to support single ref comp modes
Now the single ref comp mode should work with WEDGE and
COMPOUND_SEGMENT. For motion_var, the OBMC_CAUSAL mode uses the 2nd
predictor if the neighboring block is single ref comp mode predicted.
This patch removes the mode of SR_NEAREST_NEWMV and leaves four
single ref comp modes in total:
SR_NEAREST_NEARMV
SR_NEAR_NEWMV
SR_ZERO_NEWMV
SR_NEW_NEWMV
Change-Id: If6140455771f0f1a3b947766eccf82f23cc6b67a
diff --git a/av1/encoder/encodemv.c b/av1/encoder/encodemv.c
index e1b515b..8aed521 100644
--- a/av1/encoder/encodemv.c
+++ b/av1/encoder/encodemv.c
@@ -295,6 +295,27 @@
mbmi_ext->ref_mv_stack[rf_type], 0, mbmi->ref_mv_idx);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
av1_inc_mv(&diff, counts, 1);
+#if CONFIG_COMPOUND_SINGLEREF
+ } else {
+ assert( // mode == SR_NEAREST_NEWMV ||
+ mode == SR_NEAR_NEWMV || mode == SR_ZERO_NEWMV || mode == SR_NEW_NEWMV);
+ const MV *ref = &mbmi_ext->ref_mvs[mbmi->ref_frame[0]][0].as_mv;
+ int8_t rf_type = av1_ref_frame_type(mbmi->ref_frame);
+ int nmv_ctx =
+ av1_nmv_ctx(mbmi_ext->ref_mv_count[rf_type],
+ mbmi_ext->ref_mv_stack[rf_type], 0, mbmi->ref_mv_idx);
+ nmv_context_counts *counts = &nmv_counts[nmv_ctx];
+ (void)pred_mvs;
+ MV diff;
+ if (mode == SR_NEW_NEWMV) {
+ diff.row = mvs[0].as_mv.row - ref->row;
+ diff.col = mvs[0].as_mv.col - ref->col;
+ av1_inc_mv(&diff, counts, 1);
+ }
+ diff.row = mvs[1].as_mv.row - ref->row;
+ diff.col = mvs[1].as_mv.col - ref->col;
+ av1_inc_mv(&diff, counts, 1);
+#endif // CONFIG_COMPOUND_SINGLEREF
}
}
@@ -339,7 +360,7 @@
av1_inc_mv(&diff, counts, 1);
}
}
-#else
+#else // !CONFIG_EXT_INTER
static void inc_mvs(const MB_MODE_INFO *mbmi, const MB_MODE_INFO_EXT *mbmi_ext,
const int_mv mvs[2], const int_mv pred_mvs[2],
nmv_context_counts *nmv_counts) {