Remove EXT_WARPED_MOTION flag

This is fully adopted.

Change-Id: Ie3a300b9e3362e7b309c8436547d6a79e0440255
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c
index 89f4d29..ea1eb41 100644
--- a/av1/common/mvref_common.c
+++ b/av1/common/mvref_common.c
@@ -1278,7 +1278,6 @@
     if (motion_field_projection(cm, LAST2_FRAME, 2)) --ref_stamp;
 }
 
-#if CONFIG_EXT_WARPED_MOTION
 static INLINE void record_samples(MB_MODE_INFO *mbmi, int *pts, int *pts_inref,
                                   int row_offset, int sign_r, int col_offset,
                                   int sign_c) {
@@ -1480,106 +1479,6 @@
 
   return np;
 }
-#else
-void calc_projection_samples(MB_MODE_INFO *const mbmi, int x, int y,
-                             int *pts_inref) {
-  pts_inref[0] = (x * 8) + mbmi->mv[0].as_mv.col;
-  pts_inref[1] = (y * 8) + mbmi->mv[0].as_mv.row;
-}
-
-// Note: Samples returned are at 1/8-pel precision
-// Sample are the neighbor block center point's coordinates relative to the
-// left-top pixel of current block.
-int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
-                int *pts, int *pts_inref) {
-  MB_MODE_INFO *const mbmi0 = &(xd->mi[0]->mbmi);
-  int ref_frame = mbmi0->ref_frame[0];
-  int up_available = xd->up_available;
-  int left_available = xd->left_available;
-  int i, mi_step, np = 0;
-
-  // scan the above row
-  if (up_available) {
-    for (i = 0; i < AOMMIN(xd->n8_w, cm->mi_cols - mi_col); i += mi_step) {
-      int mi_row_offset = -1;
-      int mi_col_offset = i;
-
-      MODE_INFO *mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-      MB_MODE_INFO *mbmi = &mi->mbmi;
-
-      mi_step = AOMMIN(xd->n8_w, mi_size_wide[mbmi->sb_type]);
-
-      if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) {
-        int bw = block_size_wide[mbmi->sb_type];
-        int bh = block_size_high[mbmi->sb_type];
-        int x = i * MI_SIZE + AOMMAX(bw, MI_SIZE) / 2 - 1;
-        int y = -AOMMAX(bh, MI_SIZE) / 2 - 1;
-
-        pts[0] = (x * 8);
-        pts[1] = (y * 8);
-        calc_projection_samples(mbmi, x, y, pts_inref);
-        pts += 2;
-        pts_inref += 2;
-        np++;
-        if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX;
-      }
-    }
-  }
-  assert(2 * np <= SAMPLES_ARRAY_SIZE);
-
-  // scan the left column
-  if (left_available) {
-    for (i = 0; i < AOMMIN(xd->n8_h, cm->mi_rows - mi_row); i += mi_step) {
-      int mi_row_offset = i;
-      int mi_col_offset = -1;
-
-      MODE_INFO *mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-      MB_MODE_INFO *mbmi = &mi->mbmi;
-
-      mi_step = AOMMIN(xd->n8_h, mi_size_high[mbmi->sb_type]);
-
-      if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) {
-        int bw = block_size_wide[mbmi->sb_type];
-        int bh = block_size_high[mbmi->sb_type];
-        int x = -AOMMAX(bw, MI_SIZE) / 2 - 1;
-        int y = i * MI_SIZE + AOMMAX(bh, MI_SIZE) / 2 - 1;
-
-        pts[0] = (x * 8);
-        pts[1] = (y * 8);
-        calc_projection_samples(mbmi, x, y, pts_inref);
-        pts += 2;
-        pts_inref += 2;
-        np++;
-        if (np >= LEAST_SQUARES_SAMPLES_MAX) return LEAST_SQUARES_SAMPLES_MAX;
-      }
-    }
-  }
-  assert(2 * np <= SAMPLES_ARRAY_SIZE);
-
-  if (left_available && up_available) {
-    int mi_row_offset = -1;
-    int mi_col_offset = -1;
-
-    MODE_INFO *mi = xd->mi[mi_col_offset + mi_row_offset * xd->mi_stride];
-    MB_MODE_INFO *mbmi = &mi->mbmi;
-
-    if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE_FRAME) {
-      int bw = block_size_wide[mbmi->sb_type];
-      int bh = block_size_high[mbmi->sb_type];
-      int x = -AOMMAX(bw, MI_SIZE) / 2 - 1;
-      int y = -AOMMAX(bh, MI_SIZE) / 2 - 1;
-
-      pts[0] = (x * 8);
-      pts[1] = (y * 8);
-      calc_projection_samples(mbmi, x, y, pts_inref);
-      np++;
-    }
-  }
-  assert(2 * np <= SAMPLES_ARRAY_SIZE);
-
-  return np;
-}
-#endif  // CONFIG_EXT_WARPED_MOTION
 
 void av1_setup_skip_mode_allowed(AV1_COMMON *cm) {
   cm->is_skip_mode_allowed = 0;
diff --git a/av1/common/mvref_common.h b/av1/common/mvref_common.h
index b414a78..12a059e 100644
--- a/av1/common/mvref_common.h
+++ b/av1/common/mvref_common.h
@@ -364,9 +364,7 @@
                            int_mv *near_mv);
 #endif
 
-#if CONFIG_EXT_WARPED_MOTION
 int selectSamples(MV *mv, int *pts, int *pts_inref, int len, BLOCK_SIZE bsize);
-#endif  // CONFIG_EXT_WARPED_MOTION
 int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
                 int *pts, int *pts_inref);
 
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index 69c55fa..7b62c96 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -1606,11 +1606,9 @@
   if (mbmi->motion_mode == WARPED_CAUSAL) {
     mbmi->wm_params[0].wmtype = DEFAULT_WMTYPE;
 
-#if CONFIG_EXT_WARPED_MOTION
     if (mbmi->num_proj_ref[0] > 1)
       mbmi->num_proj_ref[0] = selectSamples(&mbmi->mv[0].as_mv, pts, pts_inref,
                                             mbmi->num_proj_ref[0], bsize);
-#endif  // CONFIG_EXT_WARPED_MOTION
 
     if (find_projection(mbmi->num_proj_ref[0], pts, pts_inref, bsize,
                         mbmi->mv[0].as_mv.row, mbmi->mv[0].as_mv.col,
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index a7e7d37..ca77500 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -903,16 +903,10 @@
 }
 
 // Refine MV in a small range
-#if CONFIG_EXT_WARPED_MOTION
 unsigned int av1_refine_warped_mv(const AV1_COMP *cpi, MACROBLOCK *const x,
                                   BLOCK_SIZE bsize, int mi_row, int mi_col,
                                   int *pts0, int *pts_inref0,
                                   int total_samples) {
-#else
-unsigned int av1_refine_warped_mv(const AV1_COMP *cpi, MACROBLOCK *const x,
-                                  BLOCK_SIZE bsize, int mi_row, int mi_col,
-                                  int *pts, int *pts_inref) {
-#endif  // CONFIG_EXT_WARPED_MOTION
   const AV1_COMMON *const cm = &cpi->common;
   MACROBLOCKD *xd = &x->e_mbd;
   MODE_INFO *mi = xd->mi[0];
@@ -925,9 +919,7 @@
   int16_t *tr = &mbmi->mv[0].as_mv.row;
   int16_t *tc = &mbmi->mv[0].as_mv.col;
   WarpedMotionParams best_wm_params = mbmi->wm_params[0];
-#if CONFIG_EXT_WARPED_MOTION
   int best_num_proj_ref = mbmi->num_proj_ref[0];
-#endif  // CONFIG_EXT_WARPED_MOTION
   unsigned int bestmse;
   int minc, maxc, minr, maxr;
   const int start = cm->allow_high_precision_mv ? 0 : 4;
@@ -954,7 +946,6 @@
 
       if (*tc >= minc && *tc <= maxc && *tr >= minr && *tr <= maxr) {
         MV this_mv = { *tr, *tc };
-#if CONFIG_EXT_WARPED_MOTION
         int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
 
         memcpy(pts, pts0, total_samples * 2 * sizeof(*pts0));
@@ -962,7 +953,6 @@
         if (total_samples > 1)
           mbmi->num_proj_ref[0] =
               selectSamples(&this_mv, pts, pts_inref, total_samples, bsize);
-#endif  // CONFIG_EXT_WARPED_MOTION
 
         if (!find_projection(mbmi->num_proj_ref[0], pts, pts_inref, bsize, *tr,
                              *tc, &mbmi->wm_params[0], mi_row, mi_col)) {
@@ -972,9 +962,7 @@
           if (thismse < bestmse) {
             best_idx = idx;
             best_wm_params = mbmi->wm_params[0];
-#if CONFIG_EXT_WARPED_MOTION
             best_num_proj_ref = mbmi->num_proj_ref[0];
-#endif  // CONFIG_EXT_WARPED_MOTION
             bestmse = thismse;
           }
         }
@@ -992,9 +980,7 @@
   *tr = br;
   *tc = bc;
   mbmi->wm_params[0] = best_wm_params;
-#if CONFIG_EXT_WARPED_MOTION
   mbmi->num_proj_ref[0] = best_num_proj_ref;
-#endif  // CONFIG_EXT_WARPED_MOTION
   return bestmse;
 }
 
diff --git a/av1/encoder/mcomp.h b/av1/encoder/mcomp.h
index 85a38de..c3d0cf3 100644
--- a/av1/encoder/mcomp.h
+++ b/av1/encoder/mcomp.h
@@ -147,16 +147,8 @@
 unsigned int av1_compute_motion_cost(const struct AV1_COMP *cpi,
                                      MACROBLOCK *const x, BLOCK_SIZE bsize,
                                      int mi_row, int mi_col, const MV *this_mv);
-#if CONFIG_EXT_WARPED_MOTION
 unsigned int av1_refine_warped_mv(const struct AV1_COMP *cpi,
                                   MACROBLOCK *const x, BLOCK_SIZE bsize,
                                   int mi_row, int mi_col, int *pts0,
                                   int *pts_inref0, int total_samples);
-#else
-unsigned int av1_refine_warped_mv(const struct AV1_COMP *cpi,
-                                  MACROBLOCK *const x, BLOCK_SIZE bsize,
-                                  int mi_row, int mi_col, int *pts,
-                                  int *pts_inref);
-#endif  // CONFIG_EXT_WARPED_MOTION
-
 #endif  // AV1_ENCODER_MCOMP_H_
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 9199ba6..a650543 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -6864,24 +6864,16 @@
   uint8_t best_blk_skip[MAX_MB_PLANE][MAX_MIB_SIZE * MAX_MIB_SIZE];
   int interintra_allowed =
       cm->allow_interintra_compound && is_interintra_allowed(mbmi);
-#if CONFIG_EXT_WARPED_MOTION
   int pts0[SAMPLES_ARRAY_SIZE], pts_inref0[SAMPLES_ARRAY_SIZE];
   int total_samples;
-#else
-  int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
-#endif  // CONFIG_EXT_WARPED_MOTION
 
   (void)rate_mv;
 
   av1_invalid_rd_stats(&best_rd_stats);
 
   aom_clear_system_state();
-#if CONFIG_EXT_WARPED_MOTION
   mbmi->num_proj_ref[0] = findSamples(cm, xd, mi_row, mi_col, pts0, pts_inref0);
   total_samples = mbmi->num_proj_ref[0];
-#else
-  mbmi->num_proj_ref[0] = findSamples(cm, xd, mi_row, mi_col, pts, pts_inref);
-#endif  // CONFIG_EXT_WARPED_MOTION
   rate2_nocoeff = rd_stats->rate;
   base_mbmi = *mbmi;
   MOTION_MODE last_motion_mode_allowed =
@@ -6936,15 +6928,12 @@
 
     // Local warped motion mode
     if (mbmi->motion_mode == WARPED_CAUSAL) {
-#if CONFIG_EXT_WARPED_MOTION
       int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
-#endif  // CONFIG_EXT_WARPED_MOTION
       mbmi->motion_mode = WARPED_CAUSAL;
       mbmi->wm_params[0].wmtype = DEFAULT_WMTYPE;
       mbmi->interp_filters = av1_broadcast_interp_filter(
           av1_unswitchable_filter(cm->interp_filter));
 
-#if CONFIG_EXT_WARPED_MOTION
       memcpy(pts, pts0, total_samples * 2 * sizeof(*pts0));
       memcpy(pts_inref, pts_inref0, total_samples * 2 * sizeof(*pts_inref0));
       // Select the samples according to motion vector difference
@@ -6952,7 +6941,6 @@
         mbmi->num_proj_ref[0] = selectSamples(
             &mbmi->mv[0].as_mv, pts, pts_inref, mbmi->num_proj_ref[0], bsize);
       }
-#endif  // CONFIG_EXT_WARPED_MOTION
 
       if (!find_projection(mbmi->num_proj_ref[0], pts, pts_inref, bsize,
                            mbmi->mv[0].as_mv.row, mbmi->mv[0].as_mv.col,
@@ -6962,16 +6950,11 @@
           int tmp_rate_mv = 0;
           const int_mv mv0 = mbmi->mv[0];
           const WarpedMotionParams wm_params0 = mbmi->wm_params[0];
-#if CONFIG_EXT_WARPED_MOTION
           int num_proj_ref0 = mbmi->num_proj_ref[0];
 
           // Refine MV in a small range.
           av1_refine_warped_mv(cpi, x, bsize, mi_row, mi_col, pts0, pts_inref0,
                                total_samples);
-#else
-          // Refine MV in a small range.
-          av1_refine_warped_mv(cpi, x, bsize, mi_row, mi_col, pts, pts_inref);
-#endif  // CONFIG_EXT_WARPED_MOTION
 
           // Keep the refined MV and WM parameters.
           if (mv0.as_int != mbmi->mv[0].as_int) {
@@ -6996,9 +6979,7 @@
             // Restore the old MV and WM parameters.
             mbmi->mv[0] = mv0;
             mbmi->wm_params[0] = wm_params0;
-#if CONFIG_EXT_WARPED_MOTION
             mbmi->num_proj_ref[0] = num_proj_ref0;
-#endif  // CONFIG_EXT_WARPED_MOTION
           }
         }
 
@@ -10010,12 +9991,10 @@
   if (is_motion_variation_allowed_bsize(bsize) && !has_second_ref(mbmi)) {
     int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
     mbmi->num_proj_ref[0] = findSamples(cm, xd, mi_row, mi_col, pts, pts_inref);
-#if CONFIG_EXT_WARPED_MOTION
     // Select the samples according to motion vector difference
     if (mbmi->num_proj_ref[0] > 1)
       mbmi->num_proj_ref[0] = selectSamples(&mbmi->mv[0].as_mv, pts, pts_inref,
                                             mbmi->num_proj_ref[0], bsize);
-#endif  // CONFIG_EXT_WARPED_MOTION
   }
 
   set_default_interp_filters(mbmi, cm->interp_filter);
diff --git a/build/cmake/aom_config_defaults.cmake b/build/cmake/aom_config_defaults.cmake
index 9ee3d5a..6fae845 100644
--- a/build/cmake/aom_config_defaults.cmake
+++ b/build/cmake/aom_config_defaults.cmake
@@ -96,7 +96,6 @@
 set(CONFIG_ENTROPY_STATS 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_EXPLICIT_ORDER_HINT 1 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_EXT_DELTA_Q 1 CACHE NUMBER "AV1 experiment flag.")
-set(CONFIG_EXT_WARPED_MOTION 1 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_FILM_GRAIN 1 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_FILM_GRAIN_SHOWEX 1 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_FP_MB_STATS 0 CACHE NUMBER "AV1 experiment flag.")