warped_motion: disable warped_motion mode if ref frame is scaled
To make it compatible with frame_superres
Change-Id: Id1560e1477a09cfd27a4b4f17468be9c76d09013
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index fa4b970..002be73 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -7890,6 +7890,9 @@
#if CONFIG_GLOBAL_MOTION
0, xd->global_motion,
#endif // CONFIG_GLOBAL_MOTION
+#if CONFIG_WARPED_MOTION
+ xd,
+#endif
mi);
#endif // CONFIG_NCOBMC_ADAPT_WEIGHT
base_mbmi = *mbmi;
@@ -10908,12 +10911,18 @@
*returnrate_nocoef -= av1_cost_bit(av1_get_intra_inter_prob(cm, xd),
mbmi->ref_frame[0] != INTRA_FRAME);
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+#if CONFIG_WARPED_MOTION
+ set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
+#endif
#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
MODE_INFO *const mi = xd->mi[0];
const MOTION_MODE motion_allowed = motion_mode_allowed(
#if CONFIG_GLOBAL_MOTION
0, xd->global_motion,
#endif // CONFIG_GLOBAL_MOTION
+#if CONFIG_WARPED_MOTION
+ xd,
+#endif
mi);
if (motion_allowed == WARPED_CAUSAL)
*returnrate_nocoef -= cpi->motion_mode_cost[bsize][mbmi->motion_mode];
@@ -11446,7 +11455,11 @@
#if CONFIG_WARPED_MOTION || CONFIG_MOTION_VAR
// Correct the motion mode for ZEROMV
const MOTION_MODE last_motion_mode_allowed =
- motion_mode_allowed(0, xd->global_motion, xd->mi[0]);
+ motion_mode_allowed(0, xd->global_motion,
+#if CONFIG_WARPED_MOTION
+ xd,
+#endif
+ xd->mi[0]);
if (mbmi->motion_mode > last_motion_mode_allowed)
mbmi->motion_mode = last_motion_mode_allowed;
#endif // CONFIG_WARPED_MOTION || CONFIG_MOTION_VAR