Remove experimental flag of MOTION_VAR

This experiment has been adopted, we can simplify the code
by dropping the associated preprocessor conditionals.

Change-Id: I2dce80e1e1b2116708b6ba9feeacaacc12af8fc4
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index f2ef095..7e1e1dd 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -400,7 +400,6 @@
   }
 }
 
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
 static void write_motion_mode(const AV1_COMMON *cm, MACROBLOCKD *xd,
                               const MODE_INFO *mi, aom_writer *w) {
   const MB_MODE_INFO *mbmi = &mi->mbmi;
@@ -412,7 +411,7 @@
 #endif
                           mi);
   if (last_motion_mode_allowed == SIMPLE_TRANSLATION) return;
-#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
+#if CONFIG_WARPED_MOTION
 #if CONFIG_NCOBMC_ADAPT_WEIGHT
   if (last_motion_mode_allowed == NCOBMC_ADAPT_WEIGHT) {
     aom_write_symbol(w, mbmi->motion_mode,
@@ -433,13 +432,13 @@
 #endif
   } else {
 #endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-#endif  // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
+#endif  // CONFIG_WARPED_MOTION
     aom_write_symbol(w, mbmi->motion_mode,
                      xd->tile_ctx->motion_mode_cdf[mbmi->sb_type],
                      MOTION_MODES);
-#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
+#if CONFIG_WARPED_MOTION
   }
-#endif  // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
+#endif  // CONFIG_WARPED_MOTION
 }
 
 #if CONFIG_NCOBMC_ADAPT_WEIGHT
@@ -457,7 +456,6 @@
   }
 }
 #endif
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
 
 static void write_delta_qindex(const AV1_COMMON *cm, const MACROBLOCKD *xd,
                                int delta_qindex, aom_writer *w) {
@@ -1735,12 +1733,10 @@
     }
 #endif  // CONFIG_INTERINTRA
 
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
     if (mbmi->ref_frame[1] != INTRA_FRAME) write_motion_mode(cm, xd, mi, w);
 #if CONFIG_NCOBMC_ADAPT_WEIGHT
     write_ncobmc_mode(xd, mi, w);
 #endif
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
 
     if (
 #if CONFIG_COMPOUND_SINGLEREF
@@ -1749,9 +1745,7 @@
         cpi->common.reference_mode != SINGLE_REFERENCE &&
         is_inter_compound_mode(mbmi->mode) &&
 #endif  // CONFIG_COMPOUND_SINGLEREF
-#if CONFIG_MOTION_VAR
         mbmi->motion_mode == SIMPLE_TRANSLATION &&
-#endif  // CONFIG_MOTION_VAR
         is_any_masked_compound_used(bsize)) {
 #if CONFIG_JNT_COMP
       if (cm->allow_masked_compound && mbmi->compound_idx)
@@ -2332,7 +2326,7 @@
 #endif  // CONFIG_COEF_INTERLEAVE
 }
 
-#if CONFIG_MOTION_VAR && NC_MODE_INFO
+#if NC_MODE_INFO
 static void write_tokens_sb(AV1_COMP *cpi, const TileInfo *const tile,
                             aom_writer *w, const TOKENEXTRA **tok,
                             const TOKENEXTRA *const tok_end, int mi_row,
@@ -2406,7 +2400,7 @@
                           int mi_col) {
   write_mbmi_b(cpi, tile, w, mi_row, mi_col);
 
-#if CONFIG_MOTION_VAR && NC_MODE_INFO
+#if NC_MODE_INFO
   (void)tok;
   (void)tok_end;
 #else
@@ -2713,7 +2707,7 @@
 
     for (mi_col = mi_col_start; mi_col < mi_col_end; mi_col += cm->mib_size) {
       write_modes_sb(cpi, tile, w, tok, tok_end, mi_row, mi_col, cm->sb_size);
-#if CONFIG_MOTION_VAR && NC_MODE_INFO
+#if NC_MODE_INFO
       write_tokens_sb(cpi, tile, w, tok, tok_end, mi_row, mi_col, cm->sb_size);
 #endif
     }
@@ -3073,13 +3067,11 @@
       // Only one filter is used. So set the filter at frame level
       for (i = 0; i < SWITCHABLE_FILTERS; ++i) {
         if (count[i]) {
-#if CONFIG_MOTION_VAR
 #if CONFIG_WARPED_MOTION
           if (i == EIGHTTAP_REGULAR || WARP_WM_NEIGHBORS_WITH_OBMC)
 #else
           if (i == EIGHTTAP_REGULAR || WARP_GM_NEIGHBORS_WITH_OBMC)
 #endif  // CONFIG_WARPED_MOTION
-#endif  // CONFIG_MOTION_VAR
             cm->interp_filter = i;
           break;
         }
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index fd0e58e..a35f5c2 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -176,12 +176,10 @@
   int **mv_cost_stack[NMV_CONTEXTS];
   int **mvcost;
 
-#if CONFIG_MOTION_VAR
   int32_t *wsrc_buf;
   int32_t *mask_buf;
   uint8_t *above_pred_buf;
   uint8_t *left_pred_buf;
-#endif  // CONFIG_MOTION_VAR
 
   PALETTE_BUFFER *palette_buffer;
 
@@ -224,18 +222,16 @@
   int wedge_interintra_cost[BLOCK_SIZES_ALL][2];
   int interintra_mode_cost[BLOCK_SIZE_GROUPS][INTERINTRA_MODES];
 #endif  // CONFIG_INTERINTRA
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
   int motion_mode_cost[BLOCK_SIZES_ALL][MOTION_MODES];
-#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
+#if CONFIG_WARPED_MOTION
   int motion_mode_cost1[BLOCK_SIZES_ALL][2];
 #if CONFIG_NCOBMC_ADAPT_WEIGHT
   int motion_mode_cost2[BLOCK_SIZES_ALL][OBMC_FAMILY_MODES];
 #endif
-#endif  // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
-#if CONFIG_MOTION_VAR && CONFIG_NCOBMC_ADAPT_WEIGHT
+#endif  // CONFIG_WARPED_MOTION
+#if CONFIG_NCOBMC_ADAPT_WEIGHT
   int ncobmc_mode_cost[ADAPT_OVERLAP_BLOCKS][MAX_NCOBMC_MODES];
-#endif  // CONFIG_MOTION_VAR && CONFIG_NCOBMC_ADAPT_WEIGHT
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
   int intra_uv_mode_cost[INTRA_MODES][UV_INTRA_MODES];
   int y_mode_costs[INTRA_MODES][INTRA_MODES][INTRA_MODES];
 #if CONFIG_FILTER_INTRA
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index defdff8..fabd747 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -588,7 +588,7 @@
 #endif  // CONFIG_JNT_COMP
 }
 
-#if CONFIG_MOTION_VAR && NC_MODE_INFO
+#if NC_MODE_INFO
 static void set_mode_info_b(const AV1_COMP *const cpi,
                             const TileInfo *const tile, ThreadData *td,
                             int mi_row, int mi_col, BLOCK_SIZE bsize,
@@ -754,7 +754,7 @@
   set_mode_info_offsets(cpi, x, xd, mi_row, mi_col);
 }
 #endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-#endif  // CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
+#endif  // (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
 
 void av1_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src,
                           int mi_row, int mi_col) {
@@ -1189,7 +1189,6 @@
         }
 #endif  // CONFIG_INTERINTRA
 
-#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
@@ -1200,7 +1199,7 @@
 #endif
                                 mi);
         if (mbmi->ref_frame[1] != INTRA_FRAME)
-#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
+#if CONFIG_WARPED_MOTION
         {
           if (motion_allowed == WARPED_CAUSAL) {
             counts->motion_mode[mbmi->sb_type][mbmi->motion_mode]++;
@@ -1231,7 +1230,7 @@
             update_cdf(fc->motion_mode_cdf[mbmi->sb_type], mbmi->motion_mode,
                        MOTION_MODES);
           }
-#endif  // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
+#endif  // CONFIG_WARPED_MOTION
 
 #if CONFIG_NCOBMC_ADAPT_WEIGHT
         if (mbmi->motion_mode == NCOBMC_ADAPT_WEIGHT) {
@@ -1248,8 +1247,6 @@
         }
 #endif
 
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
-
         if (
 #if CONFIG_COMPOUND_SINGLEREF
             is_inter_anyref_comp_mode(mbmi->mode)
@@ -1257,10 +1254,7 @@
             cm->reference_mode != SINGLE_REFERENCE &&
             is_inter_compound_mode(mbmi->mode)
 #endif  // CONFIG_COMPOUND_SINGLEREF
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
-            && mbmi->motion_mode == SIMPLE_TRANSLATION
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
-            ) {
+            && mbmi->motion_mode == SIMPLE_TRANSLATION) {
           if (is_interinter_compound_used(COMPOUND_WEDGE, bsize)) {
             counts
                 ->compound_interinter[bsize][mbmi->interinter_compound_type]++;
@@ -1433,11 +1427,10 @@
 #endif
                      PICK_MODE_CONTEXT *ctx, int *rate) {
   MACROBLOCK *const x = &td->mb;
-#if (CONFIG_MOTION_VAR && CONFIG_NCOBMC) | CONFIG_EXT_DELTA_Q | \
-    CONFIG_NCOBMC_ADAPT_WEIGHT
+#if (CONFIG_NCOBMC) | CONFIG_EXT_DELTA_Q | CONFIG_NCOBMC_ADAPT_WEIGHT
   MACROBLOCKD *xd = &x->e_mbd;
   MB_MODE_INFO *mbmi;
-#if CONFIG_MOTION_VAR && CONFIG_NCOBMC
+#if CONFIG_NCOBMC
   int check_ncobmc;
 #endif
 #endif
@@ -1447,22 +1440,22 @@
   x->e_mbd.mi[0]->mbmi.partition = partition;
 #endif
   update_state(cpi, td, ctx, mi_row, mi_col, bsize, dry_run);
-#if CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
+#if (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
   mbmi = &xd->mi[0]->mbmi;
 #if CONFIG_WARPED_MOTION
   set_ref_ptrs(&cpi->common, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
 #endif
 #endif
 
-#if CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
+#if (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
   const MOTION_MODE motion_allowed = motion_mode_allowed(0, xd->global_motion,
 #if CONFIG_WARPED_MOTION
                                                          xd,
 #endif
                                                          xd->mi[0]);
-#endif  // CONFIG_MOTION_VAR && (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
+#endif  // (CONFIG_NCOBMC || CONFIG_NCOBMC_ADAPT_WEIGHT)
 
-#if CONFIG_MOTION_VAR && CONFIG_NCOBMC
+#if CONFIG_NCOBMC
   check_ncobmc = is_inter_block(mbmi) && motion_allowed >= OBMC_CAUSAL;
   if (!dry_run && check_ncobmc) {
     av1_check_ncobmc_rd(cpi, x, mi_row, mi_col);
@@ -3194,7 +3187,7 @@
   if (best_rdc.rate < INT_MAX && best_rdc.dist < INT64_MAX &&
       pc_tree->index != 3) {
     if (bsize == cm->sb_size) {
-#if CONFIG_MOTION_VAR && NC_MODE_INFO
+#if NC_MODE_INFO
       set_mode_info_sb(cpi, td, tile_info, tp, mi_row, mi_col, bsize, pc_tree);
 #endif
 
@@ -4665,7 +4658,6 @@
     av1_build_inter_predictors_sb(cm, xd, mi_row, mi_col, NULL, block_size);
 
 #if !CONFIG_NCOBMC_ADAPT_WEIGHT
-#if CONFIG_MOTION_VAR
     if (mbmi->motion_mode == OBMC_CAUSAL) {
 #if CONFIG_NCOBMC
       if (dry_run == OUTPUT_ENABLED)
@@ -4674,7 +4666,6 @@
 #endif
         av1_build_obmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
     }
-#endif  // CONFIG_MOTION_VAR
 #else
     if (mbmi->motion_mode == OBMC_CAUSAL) {
       av1_build_obmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 5b4611c..2f897bd 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -515,7 +515,6 @@
   aom_free(cpi->active_map.map);
   cpi->active_map.map = NULL;
 
-#if CONFIG_MOTION_VAR
   aom_free(cpi->td.mb.above_pred_buf);
   cpi->td.mb.above_pred_buf = NULL;
 
@@ -527,7 +526,6 @@
 
   aom_free(cpi->td.mb.mask_buf);
   cpi->td.mb.mask_buf = NULL;
-#endif
 
 #if CONFIG_MFMV
   aom_free(cm->tpl_mvs);
@@ -1390,7 +1388,6 @@
 #endif  // CONFIG_EXT_PARTITION
 #endif  // CONFIG_EXT_PARTITION_TYPES
 
-#if CONFIG_MOTION_VAR
 #define HIGHBD_OBFP(BT, OSDF, OVF, OSVF) \
   cpi->fn_ptr[BT].osdf = OSDF;           \
   cpi->fn_ptr[BT].ovf = OVF;             \
@@ -1444,7 +1441,6 @@
 MAKE_OBFP_SAD_WRAPPER(aom_highbd_obmc_sad128x32)
 #endif  // CONFIG_EXT_PARTITION
 #endif  // CONFIG_EXT_PARTITION_TYPES
-#endif  // CONFIG_MOTION_VAR
 
 static void highbd_set_var_fns(AV1_COMP *const cpi) {
   AV1_COMMON *const cm = &cpi->common;
@@ -1674,7 +1670,6 @@
         HIGHBD_MBFP(BLOCK_4X16, aom_highbd_masked_sad4x16_bits8,
                     aom_highbd_8_masked_sub_pixel_variance4x16)
 #endif
-#if CONFIG_MOTION_VAR
 #if CONFIG_EXT_PARTITION
         HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits8,
                     aom_highbd_obmc_variance128x128,
@@ -1760,7 +1755,6 @@
                     aom_highbd_obmc_variance4x16,
                     aom_highbd_obmc_sub_pixel_variance4x16)
 #endif
-#endif  // CONFIG_MOTION_VAR
         break;
 
       case AOM_BITS_10:
@@ -1993,7 +1987,6 @@
         HIGHBD_MBFP(BLOCK_4X16, aom_highbd_masked_sad4x16_bits10,
                     aom_highbd_10_masked_sub_pixel_variance4x16)
 #endif
-#if CONFIG_MOTION_VAR
 #if CONFIG_EXT_PARTITION
         HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits10,
                     aom_highbd_10_obmc_variance128x128,
@@ -2079,7 +2072,6 @@
                     aom_highbd_10_obmc_variance4x16,
                     aom_highbd_10_obmc_sub_pixel_variance4x16)
 #endif
-#endif  // CONFIG_MOTION_VAR
         break;
 
       case AOM_BITS_12:
@@ -2313,7 +2305,6 @@
                     aom_highbd_12_masked_sub_pixel_variance4x16)
 #endif
 
-#if CONFIG_MOTION_VAR
 #if CONFIG_EXT_PARTITION
         HIGHBD_OBFP(BLOCK_128X128, aom_highbd_obmc_sad128x128_bits12,
                     aom_highbd_12_obmc_variance128x128,
@@ -2399,7 +2390,6 @@
                     aom_highbd_12_obmc_variance4x16,
                     aom_highbd_12_obmc_sub_pixel_variance4x16)
 #endif
-#endif  // CONFIG_MOTION_VAR
         break;
 
       default:
@@ -2750,7 +2740,6 @@
   }
 #endif
 
-#if CONFIG_MOTION_VAR
 #if CONFIG_HIGHBITDEPTH
   int buf_scaler = 2;
 #else
@@ -2775,8 +2764,6 @@
                   (int32_t *)aom_memalign(
                       16, MAX_SB_SQUARE * sizeof(*cpi->td.mb.mask_buf)));
 
-#endif
-
   av1_set_speed_features_framesize_independent(cpi);
   av1_set_speed_features_framesize_dependent(cpi);
 
@@ -2950,7 +2937,6 @@
   BFP(BLOCK_2X4, NULL, NULL, aom_variance2x4, NULL, NULL, NULL, NULL, NULL)
   BFP(BLOCK_4X2, NULL, NULL, aom_variance4x2, NULL, NULL, NULL, NULL, NULL)
 
-#if CONFIG_MOTION_VAR
 #define OBFP(BT, OSDF, OVF, OSVF) \
   cpi->fn_ptr[BT].osdf = OSDF;    \
   cpi->fn_ptr[BT].ovf = OVF;      \
@@ -3018,7 +3004,6 @@
        aom_obmc_sub_pixel_variance128x32)
 #endif  // CONFIG_EXT_PARTITION
 #endif  // CONFIG_EXT_PARTITION_TYPES
-#endif  // CONFIG_MOTION_VAR
 
 #define MBFP(BT, MCSDF, MCSVF)  \
   cpi->fn_ptr[BT].msdf = MCSDF; \
@@ -3201,12 +3186,10 @@
     // Deallocate allocated thread data.
     if (t < cpi->num_workers - 1) {
       aom_free(thread_data->td->palette_buffer);
-#if CONFIG_MOTION_VAR
       aom_free(thread_data->td->above_pred_buf);
       aom_free(thread_data->td->left_pred_buf);
       aom_free(thread_data->td->wsrc_buf);
       aom_free(thread_data->td->mask_buf);
-#endif  // CONFIG_MOTION_VAR
       aom_free(thread_data->td->counts);
       av1_free_pc_tree(thread_data->td);
       aom_free(thread_data->td);
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index b79eaad..9328f0d 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -336,12 +336,10 @@
   FRAME_COUNTS *counts;
   PC_TREE *pc_tree;
   PC_TREE *pc_root[MAX_MIB_SIZE_LOG2 - MIN_MIB_SIZE_LOG2 + 1];
-#if CONFIG_MOTION_VAR
   int32_t *wsrc_buf;
   int32_t *mask_buf;
   uint8_t *above_pred_buf;
   uint8_t *left_pred_buf;
-#endif
 
   PALETTE_BUFFER *palette_buffer;
 } ThreadData;
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c
index 253deb0..0c823c7 100644
--- a/av1/encoder/ethread.c
+++ b/av1/encoder/ethread.c
@@ -83,7 +83,6 @@
         thread_data->td->pc_tree = NULL;
         av1_setup_pc_tree(cm, thread_data->td);
 
-#if CONFIG_MOTION_VAR
 #if CONFIG_HIGHBITDEPTH
         int buf_scaler = 2;
 #else
@@ -107,7 +106,6 @@
             cm, thread_data->td->mask_buf,
             (int32_t *)aom_memalign(
                 16, MAX_SB_SQUARE * sizeof(*thread_data->td->mask_buf)));
-#endif
         // Allocate frame counters in thread data.
         CHECK_MEM_ERROR(cm, thread_data->td->counts,
                         aom_calloc(1, sizeof(*thread_data->td->counts)));
@@ -143,12 +141,10 @@
     if (thread_data->td != &cpi->td) {
       thread_data->td->mb = cpi->td.mb;
       thread_data->td->rd_counts = cpi->td.rd_counts;
-#if CONFIG_MOTION_VAR
       thread_data->td->mb.above_pred_buf = thread_data->td->above_pred_buf;
       thread_data->td->mb.left_pred_buf = thread_data->td->left_pred_buf;
       thread_data->td->mb.wsrc_buf = thread_data->td->wsrc_buf;
       thread_data->td->mb.mask_buf = thread_data->td->mask_buf;
-#endif
     }
     if (thread_data->td->counts != &cpi->common.counts) {
       memcpy(thread_data->td->counts, &cpi->common.counts,
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index 6fb0312..3b7eb6a 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -2667,7 +2667,6 @@
   return var;
 }
 
-#if CONFIG_MOTION_VAR
 /* returns subpixel variance error function */
 #define DIST(r, c) \
   vfp->osvf(pre(y, y_stride, r, c), y_stride, sp(c), sp(r), z, mask, &sse)
@@ -3136,7 +3135,6 @@
   }
   return bestsme;
 }
-#endif  // CONFIG_MOTION_VAR
 
 // Note(yunqingwang): The following 2 functions are only used in the motion
 // vector unit test, which return extreme motion vectors allowed by the MV
diff --git a/av1/encoder/mcomp.h b/av1/encoder/mcomp.h
index 37cd2d2..8ca42be 100644
--- a/av1/encoder/mcomp.h
+++ b/av1/encoder/mcomp.h
@@ -137,7 +137,6 @@
                           int var_max, int rd);
 #endif
 
-#if CONFIG_MOTION_VAR
 int av1_obmc_full_pixel_diamond(const struct AV1_COMP *cpi, MACROBLOCK *x,
                                 MV *mvp_full, int step_param, int sadpb,
                                 int further_steps, int do_refine,
@@ -148,7 +147,6 @@
     int error_per_bit, const aom_variance_fn_ptr_t *vfp, int forced_stop,
     int iters_per_step, int *mvjcost, int *mvcost[2], int *distortion,
     unsigned int *sse1, int is_second, int use_upsampled_ref);
-#endif  // CONFIG_MOTION_VAR
 #ifdef __cplusplus
 }  // extern "C"
 #endif
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 8dcaa88..e05f406 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -399,12 +399,11 @@
 #endif
     }
 #endif  // CONFIG_INTERINTRA
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
     for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; i++) {
       av1_cost_tokens_from_cdf(x->motion_mode_cost[i], fc->motion_mode_cdf[i],
                                NULL);
     }
-#if CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
+#if CONFIG_WARPED_MOTION
     for (i = BLOCK_8X8; i < BLOCK_SIZES_ALL; i++) {
 #if CONFIG_NCOBMC_ADAPT_WEIGHT
       av1_cost_tokens_from_cdf(x->motion_mode_cost2[i], fc->ncobmc_cdf[i],
@@ -417,14 +416,13 @@
       x->motion_mode_cost1[i][1] = av1_cost_bit(fc->obmc_prob[i], 1);
 #endif
     }
-#endif  // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
-#if CONFIG_MOTION_VAR && CONFIG_NCOBMC_ADAPT_WEIGHT
+#endif  // CONFIG_WARPED_MOTION
+#if CONFIG_NCOBMC_ADAPT_WEIGHT
     for (i = ADAPT_OVERLAP_BLOCK_8X8; i < ADAPT_OVERLAP_BLOCKS; ++i) {
       av1_cost_tokens_from_cdf(x->ncobmc_mode_cost[i], fc->ncobmc_mode_cdf[i],
                                NULL);
     }
-#endif  // CONFIG_MOTION_VAR && CONFIG_NCOBMC_ADAPT_WEIGHT
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+#endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
   }
 }
 
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 5e9d24c..87de695 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -30,9 +30,7 @@
 #include "av1/common/entropymode.h"
 #include "av1/common/idct.h"
 #include "av1/common/mvref_common.h"
-#if CONFIG_MOTION_VAR
 #include "av1/common/obmc.h"
-#endif
 #include "av1/common/pred_common.h"
 #include "av1/common/quant_common.h"
 #include "av1/common/reconinter.h"
@@ -6761,11 +6759,9 @@
 
   av1_set_mv_search_range(&x->mv_limits, &ref_mv);
 
-#if CONFIG_MOTION_VAR
   if (mbmi->motion_mode != SIMPLE_TRANSLATION)
     mvp_full = mbmi->mv[0].as_mv;
   else
-#endif  // CONFIG_MOTION_VAR
     mvp_full = pred_mv[x->mv_best_ref_index[ref]];
 
   mvp_full.col >>= 3;
@@ -6773,21 +6769,18 @@
 
   x->best_mv.as_int = x->second_best_mv.as_int = INVALID_MV;
 
-#if CONFIG_MOTION_VAR
   switch (mbmi->motion_mode) {
     case SIMPLE_TRANSLATION:
-#endif  // CONFIG_MOTION_VAR
 #if CONFIG_HASH_ME
       bestsme = av1_full_pixel_search(cpi, x, bsize, &mvp_full, step_param,
                                       sadpb, cond_cost_list(cpi, cost_list),
                                       &ref_mv, INT_MAX, 1, (MI_SIZE * mi_col),
                                       (MI_SIZE * mi_row), 0);
 #else
-  bestsme = av1_full_pixel_search(cpi, x, bsize, &mvp_full, step_param, sadpb,
-                                  cond_cost_list(cpi, cost_list), &ref_mv,
-                                  INT_MAX, 1);
+      bestsme = av1_full_pixel_search(cpi, x, bsize, &mvp_full, step_param,
+                                      sadpb, cond_cost_list(cpi, cost_list),
+                                      &ref_mv, INT_MAX, 1);
 #endif
-#if CONFIG_MOTION_VAR
       break;
     case OBMC_CAUSAL:
       bestsme = av1_obmc_full_pixel_diamond(
@@ -6797,7 +6790,6 @@
       break;
     default: assert(0 && "Invalid motion mode!\n");
   }
-#endif  // CONFIG_MOTION_VAR
 
   x->mv_limits = tmp_mv_limits;
 
@@ -6811,10 +6803,8 @@
   if (bestsme < INT_MAX) {
 #endif
     int dis; /* TODO: use dis in distortion calculation later. */
-#if CONFIG_MOTION_VAR
     switch (mbmi->motion_mode) {
       case SIMPLE_TRANSLATION:
-#endif  // CONFIG_MOTION_VAR
         if (cpi->sf.use_upsampled_references) {
           int best_mv_var;
           const int try_second = x->second_best_mv.as_int != INVALID_MV &&
@@ -6864,7 +6854,6 @@
               x->nmvjointcost, x->mvcost, &dis, &x->pred_sse[ref], NULL, NULL,
               0, 0, 0, 0, 0);
         }
-#if CONFIG_MOTION_VAR
         break;
       case OBMC_CAUSAL:
         av1_find_best_obmc_sub_pixel_tree_up(
@@ -6875,16 +6864,11 @@
         break;
       default: assert(0 && "Invalid motion mode!\n");
     }
-#endif  // CONFIG_MOTION_VAR
   }
   *rate_mv = av1_mv_bit_cost(&x->best_mv.as_mv, &ref_mv, x->nmvjointcost,
                              x->mvcost, MV_COST_WEIGHT);
 
-#if CONFIG_MOTION_VAR
   if (cpi->sf.adaptive_motion_search && mbmi->motion_mode == SIMPLE_TRANSLATION)
-#else
-  if (cpi->sf.adaptive_motion_search)
-#endif  // CONFIG_MOTION_VAR
     x->pred_mv[ref] = x->best_mv.as_mv;
 
   if (scaled_ref_frame) {
@@ -7793,13 +7777,11 @@
 }
 
 typedef struct {
-#if CONFIG_MOTION_VAR
   // Inter prediction buffers and respective strides
   uint8_t *above_pred_buf[MAX_MB_PLANE];
   int above_pred_stride[MAX_MB_PLANE];
   uint8_t *left_pred_buf[MAX_MB_PLANE];
   int left_pred_stride[MAX_MB_PLANE];
-#endif  // CONFIG_MOTION_VAR
   int_mv *single_newmv;
   // Pointer to array of motion vectors to use for each ref and their rates
   // Should point to first of 2 arrays in 2D array
@@ -8052,7 +8034,6 @@
   return 0;
 }
 
-#if CONFIG_WARPED_MOTION || CONFIG_MOTION_VAR
 #if CONFIG_DUAL_FILTER
 static InterpFilters condition_interp_filters_on_mv(
     InterpFilters interp_filters, const MACROBLOCKD *xd) {
@@ -8065,7 +8046,6 @@
   return av1_make_interp_filters(filters[0], filters[1]);
 }
 #endif
-#endif  // CONFIG_WARPED_MOTION || CONFIG_MOTION_VAR
 
 // TODO(afergs): Refactor the MBMI references in here - there's four
 // TODO(afergs): Refactor optional args - add them to a struct or remove
@@ -8075,12 +8055,10 @@
     int *disable_skip, int_mv (*mode_mv)[TOTAL_REFS_PER_FRAME], int mi_row,
     int mi_col, HandleInterModeArgs *const args, const int64_t ref_best_rd,
     const int *refs, int rate_mv,
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
     // only used when WARPED_MOTION is on?
     int_mv *const single_newmv, int rate2_bmc_nocoeff,
-    MB_MODE_INFO *best_bmc_mbmi, int rate_mv_bmc,
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
-    int rs, int *skip_txfm_sb, int64_t *skip_sse_sb, BUFFER_SET *orig_dst) {
+    MB_MODE_INFO *best_bmc_mbmi, int rate_mv_bmc, int rs, int *skip_txfm_sb,
+    int64_t *skip_sse_sb, BUFFER_SET *orig_dst) {
   const AV1_COMMON *const cm = &cpi->common;
   MACROBLOCKD *xd = &x->e_mbd;
   MODE_INFO *mi = xd->mi[0];
@@ -8096,17 +8074,15 @@
   (void)rate_mv;
   (void)is_comp_pred;
   (void)this_mode;
-#if !CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR
+#if !CONFIG_WARPED_MOTION
   (void)single_newmv;
 #endif
 
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
   MOTION_MODE motion_mode, last_motion_mode_allowed;
   int rate2_nocoeff = 0, best_xskip, best_disable_skip = 0;
   RD_STATS best_rd_stats, best_rd_stats_y, best_rd_stats_uv;
   MB_MODE_INFO base_mbmi, best_mbmi;
   uint8_t best_blk_skip[MAX_MB_PLANE][MAX_MIB_SIZE * MAX_MIB_SIZE * 4];
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
 
 #if CONFIG_WARPED_MOTION
 #if CONFIG_EXT_WARPED_MOTION
@@ -8118,9 +8094,7 @@
 #endif  // CONFIG_EXT_WARPED_MOTION
 #endif  // CONFIG_WARPED_MOTION
 
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
   av1_invalid_rd_stats(&best_rd_stats);
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
 
   if (cm->interp_filter == SWITCHABLE) rd_stats->rate += rs;
 #if CONFIG_WARPED_MOTION
@@ -8134,7 +8108,6 @@
 #endif  // CONFIG_EXT_WARPED_MOTION
   best_bmc_mbmi->num_proj_ref[0] = mbmi->num_proj_ref[0];
 #endif  // CONFIG_WARPED_MOTION
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
   rate2_nocoeff = rd_stats->rate;
   last_motion_mode_allowed = motion_mode_allowed(0, xd->global_motion,
 #if CONFIG_WARPED_MOTION
@@ -8142,9 +8115,7 @@
 #endif
                                                  mi);
   base_mbmi = *mbmi;
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
 
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
   int64_t best_rd = INT64_MAX;
   for (motion_mode = SIMPLE_TRANSLATION;
        motion_mode <= last_motion_mode_allowed; motion_mode++) {
@@ -8164,7 +8135,6 @@
 
     *mbmi = base_mbmi;
     mbmi->motion_mode = motion_mode;
-#if CONFIG_MOTION_VAR
     if (mbmi->motion_mode == OBMC_CAUSAL) {
       *mbmi = *best_bmc_mbmi;
       mbmi->motion_mode = OBMC_CAUSAL;
@@ -8196,7 +8166,6 @@
       model_rd_for_sb(cpi, bsize, x, xd, 0, MAX_MB_PLANE - 1, &tmp_rate,
                       &tmp_dist, skip_txfm_sb, skip_sse_sb);
     }
-#endif  // CONFIG_MOTION_VAR
 
 #if CONFIG_WARPED_MOTION
     if (mbmi->motion_mode == WARPED_CAUSAL) {
@@ -8290,21 +8259,20 @@
     rd_stats->skip = 1;
     rd_stats->rate = tmp_rate2;
     if (last_motion_mode_allowed > SIMPLE_TRANSLATION) {
-#if CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR
+#if CONFIG_WARPED_MOTION
       if (last_motion_mode_allowed == WARPED_CAUSAL)
-#endif  // CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR
+#endif  // CONFIG_WARPED_MOTION
         rd_stats->rate += x->motion_mode_cost[bsize][mbmi->motion_mode];
-#if CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR
+#if CONFIG_WARPED_MOTION
       else
         rd_stats->rate += x->motion_mode_cost1[bsize][mbmi->motion_mode];
-#endif  // CONFIG_WARPED_MOTION && CONFIG_MOTION_VAR
+#endif  // CONFIG_WARPED_MOTION
     }
 #if CONFIG_WARPED_MOTION
     if (mbmi->motion_mode == WARPED_CAUSAL) {
       rd_stats->rate -= rs;
     }
 #endif  // CONFIG_WARPED_MOTION
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
     if (!*skip_txfm_sb) {
       int64_t rdcosty = INT64_MAX;
       int is_cost_valid_uv = 0;
@@ -8327,16 +8295,12 @@
 
       if (rd_stats_y->rate == INT_MAX) {
         av1_invalid_rd_stats(rd_stats);
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
         if (mbmi->motion_mode != SIMPLE_TRANSLATION) {
           continue;
         } else {
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
           restore_dst_buf(xd, *orig_dst);
           return INT64_MAX;
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
         }
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
       }
 
       av1_merge_rd_stats(rd_stats, rd_stats_y);
@@ -8348,12 +8312,7 @@
           inter_block_uvrd(cpi, x, rd_stats_uv, bsize, ref_best_rd - rdcosty,
                            0);
       if (!is_cost_valid_uv) {
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
         continue;
-#else
-        restore_dst_buf(xd, *orig_dst);
-        return INT64_MAX;
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
       }
       /* clang-format on */
       av1_merge_rd_stats(rd_stats, rd_stats_uv);
@@ -8365,7 +8324,6 @@
       // other place when we need to compare non-coefficient cost.
       mbmi->rd_stats = *rd_stats;
 #endif  // CONFIG_RD_DEBUG
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
       const int skip_ctx = av1_get_skip_context(xd);
       if (rd_stats->skip) {
         rd_stats->rate -= rd_stats_uv->rate + rd_stats_y->rate;
@@ -8392,16 +8350,13 @@
         mbmi->skip = 0;
       }
       *disable_skip = 0;
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
     } else {
       x->skip = 1;
       *disable_skip = 1;
       mbmi->tx_size = tx_size_from_tx_mode(bsize, cm->tx_mode, 1);
 
-// The cost of skip bit needs to be added.
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
+      // The cost of skip bit needs to be added.
       mbmi->skip = 0;
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
       rd_stats->rate += x->skip_cost[av1_get_skip_context(xd)][1];
 
       rd_stats->dist = *skip_sse_sb;
@@ -8419,7 +8374,6 @@
       }
     }
 
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
     tmp_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
     if (mbmi->motion_mode == SIMPLE_TRANSLATION || (tmp_rd < best_rd)) {
       best_mbmi = *mbmi;
@@ -8449,7 +8403,6 @@
            sizeof(uint8_t) * xd->n8_h * xd->n8_w * 4);
   x->skip = best_xskip;
   *disable_skip = best_disable_skip;
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
 
   restore_dst_buf(xd, *orig_dst);
   return 0;
@@ -8502,11 +8455,9 @@
 #endif  // CONFIG_HIGHBITDEPTH
   uint8_t *tmp_buf;
 
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
   int rate2_bmc_nocoeff;
   MB_MODE_INFO best_bmc_mbmi;
   int rate_mv_bmc;
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
   int64_t rd = INT64_MAX;
   BUFFER_SET orig_dst, tmp_dst;
   int rs = 0;
@@ -8514,7 +8465,7 @@
   int skip_txfm_sb = 0;
   int64_t skip_sse_sb = INT64_MAX;
   int16_t mode_ctx;
-#if CONFIG_NCOBMC_ADAPT_WEIGHT && CONFIG_MOTION_VAR
+#if CONFIG_NCOBMC_ADAPT_WEIGHT
   // dummy fillers
   mbmi->ncobmc_mode[0] = NO_OVERLAP;
   mbmi->ncobmc_mode[1] = NO_OVERLAP;
@@ -8748,12 +8699,10 @@
       &rd, &rs, &skip_txfm_sb, &skip_sse_sb);
   if (ret_val != 0) return ret_val;
 
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
   best_bmc_mbmi = *mbmi;
   rate2_bmc_nocoeff = rd_stats->rate;
   if (cm->interp_filter == SWITCHABLE) rate2_bmc_nocoeff += rs;
   rate_mv_bmc = rate_mv;
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
 
 #if CONFIG_COMPOUND_SINGLEREF
   if (is_comp_pred || is_singleref_comp_mode)
@@ -9095,19 +9044,15 @@
 
 #if CONFIG_INTERINTRA
   rd_stats->rate += compmode_interintra_cost;
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
   rate2_bmc_nocoeff += compmode_interintra_cost;
 #endif
-#endif
   rd_stats->rate += compmode_interinter_cost;
 
-  ret_val = motion_mode_rd(
-      cpi, x, bsize, rd_stats, rd_stats_y, rd_stats_uv, disable_skip, mode_mv,
-      mi_row, mi_col, args, ref_best_rd, refs, rate_mv,
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
-      single_newmv, rate2_bmc_nocoeff, &best_bmc_mbmi, rate_mv_bmc,
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
-      rs, &skip_txfm_sb, &skip_sse_sb, &orig_dst);
+  ret_val = motion_mode_rd(cpi, x, bsize, rd_stats, rd_stats_y, rd_stats_uv,
+                           disable_skip, mode_mv, mi_row, mi_col, args,
+                           ref_best_rd, refs, rate_mv, single_newmv,
+                           rate2_bmc_nocoeff, &best_bmc_mbmi, rate_mv_bmc, rs,
+                           &skip_txfm_sb, &skip_sse_sb, &orig_dst);
   if (ret_val != 0) return ret_val;
 
   return 0;  // The rate-distortion cost will be re-calculated by caller.
@@ -9493,13 +9438,11 @@
                            plane_block_height);
 }
 
-#if CONFIG_MOTION_VAR
 static void calc_target_weighted_pred(const AV1_COMMON *cm, const MACROBLOCK *x,
                                       const MACROBLOCKD *xd, int mi_row,
                                       int mi_col, const uint8_t *above,
                                       int above_stride, const uint8_t *left,
                                       int left_stride);
-#endif  // CONFIG_MOTION_VAR
 
 void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
                                MACROBLOCK *x, int mi_row, int mi_col,
@@ -9583,16 +9526,10 @@
   const int mode_search_skip_flags = sf->mode_search_skip_flags;
 
   HandleInterModeArgs args = {
-#if CONFIG_MOTION_VAR
-    { NULL },
-    { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE },
-    { NULL },
-    { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE },
-#endif  // CONFIG_MOTION_VAR
-    NULL,
-    NULL,
-    NULL,
-    { { 0 } },
+    { NULL }, { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE },
+    { NULL }, { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE },
+    NULL,     NULL,
+    NULL,     { { 0 } },
   };
 
   const int rows = block_size_high[bsize];
@@ -9600,7 +9537,6 @@
   int palette_ctx = 0;
   const MODE_INFO *above_mi = xd->above_mi;
   const MODE_INFO *left_mi = xd->left_mi;
-#if CONFIG_MOTION_VAR
   int dst_width1[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
   int dst_width2[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
   int dst_height1[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
@@ -9630,7 +9566,6 @@
 #if CONFIG_HIGHBITDEPTH
   }
 #endif  // CONFIG_HIGHBITDEPTH
-#endif  // CONFIG_MOTION_VAR
 
   av1_zero(best_mbmode);
 
@@ -9715,7 +9650,6 @@
     }
   }
 
-#if CONFIG_MOTION_VAR
   av1_count_overlappable_neighbors(cm, xd, mi_row, mi_col);
 
   if (check_num_overlappable_neighbors(mbmi) &&
@@ -9732,7 +9666,6 @@
                               args.above_pred_stride[0], args.left_pred_buf[0],
                               args.left_pred_stride[0]);
   }
-#endif  // CONFIG_MOTION_VAR
 
   for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
     if (!(cpi->ref_frame_flags & flag_list[ref_frame])) {
@@ -10720,25 +10653,8 @@
           }
 
           if (tmp_alt_rd < INT64_MAX) {
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
             tmp_alt_rd =
                 RDCOST(x->rdmult, tmp_rd_stats.rate, tmp_rd_stats.dist);
-#else
-            if (RDCOST(x->rdmult, tmp_rd_stats_y.rate + tmp_rd_stats_uv.rate,
-                       tmp_rd_stats.dist) <
-                RDCOST(x->rdmult, 0, tmp_rd_stats.sse))
-              tmp_alt_rd = RDCOST(
-                  x->rdmult,
-                  tmp_rd_stats.rate + x->skip_cost[av1_get_skip_context(xd)][0],
-                  tmp_rd_stats.dist);
-            else
-              tmp_alt_rd =
-                  RDCOST(x->rdmult,
-                         tmp_rd_stats.rate +
-                             x->skip_cost[av1_get_skip_context(xd)][1] -
-                             tmp_rd_stats_y.rate - tmp_rd_stats_uv.rate,
-                         tmp_rd_stats.sse);
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
           }
 
           if (tmp_ref_rd > tmp_alt_rd) {
@@ -10805,12 +10721,7 @@
     }
 #endif  // CONFIG_COMPOUND_SINGLEREF
 
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
-    if (ref_frame == INTRA_FRAME)
-#else
-    if (!disable_skip)
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
-    {
+    if (ref_frame == INTRA_FRAME) {
       if (skippable) {
         // Back out the coefficient coding costs
         rate2 -= (rate_y + rate_uv);
@@ -10840,7 +10751,6 @@
 
       // Calculate the final RD estimate for this mode.
       this_rd = RDCOST(x->rdmult, rate2, distortion2);
-#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
     } else {
       this_skip2 = mbmi->skip;
       this_rd = RDCOST(x->rdmult, rate2, distortion2);
@@ -10848,7 +10758,6 @@
         rate_y = 0;
         rate_uv = 0;
       }
-#endif  // CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
     }
 
     if (ref_frame == INTRA_FRAME) {
@@ -10963,13 +10872,11 @@
 
     if (is_inter_mode(mbmi->mode)) {
       av1_build_inter_predictors_sb(cm, xd, mi_row, mi_col, NULL, bsize);
-#if CONFIG_MOTION_VAR
       if (mbmi->motion_mode == OBMC_CAUSAL) {
         av1_build_obmc_inter_prediction(
             cm, xd, mi_row, mi_col, args.above_pred_buf, args.above_pred_stride,
             args.left_pred_buf, args.left_pred_stride);
       }
-#endif  // CONFIG_MOTION_VAR
       av1_subtract_plane(x, bsize, 0);
       if (cm->tx_mode == TX_MODE_SELECT || xd->lossless[mbmi->segment_id]) {
         // av1_rd_pick_inter_mode_sb
@@ -11267,7 +11174,6 @@
   // Note: this section is needed since the mode may have been forced to
   // ZEROMV by the all-zero mode handling of ref-mv.
   if (mbmi->mode == ZEROMV || mbmi->mode == ZERO_ZEROMV) {
-#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,
@@ -11277,7 +11183,6 @@
                             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
 
     // Correct the interpolation filter for ZEROMV
     if (is_nontrans_global_motion(xd)) {
@@ -11385,9 +11290,7 @@
 #endif
 
   mbmi->motion_mode = SIMPLE_TRANSLATION;
-#if CONFIG_MOTION_VAR
   av1_count_overlappable_neighbors(cm, xd, mi_row, mi_col);
-#endif
 #if CONFIG_WARPED_MOTION
   if (is_motion_variation_allowed_bsize(bsize) && !has_second_ref(mbmi)) {
     int pts[SAMPLES_ARRAY_SIZE], pts_inref[SAMPLES_ARRAY_SIZE];
@@ -11459,8 +11362,6 @@
   store_coding_context(x, ctx, THR_ZEROMV, best_pred_diff, 0);
 }
 
-#if CONFIG_MOTION_VAR
-
 struct calc_target_weighted_pred_ctxt {
   const MACROBLOCK *x;
   const uint8_t *tmp;
@@ -11856,7 +11757,6 @@
   if (mbmi->motion_mode != NCOBMC_ADAPT_WEIGHT)
     av1_build_inter_predictors_sb(cm, xd, mi_row, mi_col, NULL, bsize);
 
-#if CONFIG_MOTION_VAR
   if (mbmi->motion_mode == OBMC_CAUSAL) {
 #if CONFIG_NCOBMC
     av1_build_ncobmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
@@ -11864,7 +11764,6 @@
     av1_build_obmc_inter_predictors_sb(cm, xd, mi_row, mi_col);
 #endif
   }
-#endif  // CONFIG_MOTION_VAR
 
   if (mbmi->motion_mode == NCOBMC_ADAPT_WEIGHT)
     for (int plane = 0; plane < MAX_MB_PLANE; ++plane)
@@ -12112,4 +12011,3 @@
 }
 
 #endif  // CONFIG_NCOBMC_ADAPT_WEIGHT
-#endif  // CONFIG_MOTION_VAR
diff --git a/av1/encoder/rdopt.h b/av1/encoder/rdopt.h
index 23127e3..57dff32 100644
--- a/av1/encoder/rdopt.h
+++ b/av1/encoder/rdopt.h
@@ -109,10 +109,10 @@
 int av1_active_v_edge(const struct AV1_COMP *cpi, int mi_col, int mi_step);
 int av1_active_edge_sb(const struct AV1_COMP *cpi, int mi_row, int mi_col);
 
-#if CONFIG_MOTION_VAR && CONFIG_NCOBMC
+#if CONFIG_NCOBMC
 void av1_check_ncobmc_rd(const struct AV1_COMP *cpi, struct macroblock *x,
                          int mi_row, int mi_col);
-#endif  // CONFIG_MOTION_VAR && CONFIG_NCOBMC
+#endif  // CONFIG_NCOBMC
 
 #ifdef __cplusplus
 }  // extern "C"