Remove CONFIG_HASH_ME

This tool is now fully adopted.

Change-Id: I68e51d30a6adedcc9e52e8a4d98d5ea5f8cd848e
diff --git a/av1/av1.cmake b/av1/av1.cmake
index 2c492b2..fdad64a 100644
--- a/av1/av1.cmake
+++ b/av1/av1.cmake
@@ -463,14 +463,12 @@
       ${AOM_AV1_COMMON_INTRIN_SSE4_1}
       "${AOM_ROOT}/av1/common/x86/highbd_warp_plane_sse4.c")
 
-if (CONFIG_HASH_ME)
   set(AOM_AV1_ENCODER_SOURCES
       ${AOM_AV1_ENCODER_SOURCES}
       "${AOM_ROOT}/av1/encoder/hash_motion.h"
       "${AOM_ROOT}/av1/encoder/hash_motion.c"
       "${AOM_ROOT}/third_party/vector/vector.h"
       "${AOM_ROOT}/third_party/vector/vector.c")
-endif ()
 
   set(AOM_AV1_COMMON_SOURCES
       ${AOM_AV1_COMMON_SOURCES}
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h
index 461c876..6257c84 100644
--- a/av1/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -28,10 +28,7 @@
 #include "av1/common/restoration.h"
 #include "av1/common/tile_common.h"
 #include "av1/common/odintrin.h"
-#if CONFIG_HASH_ME
-// TODO(youzhou@microsoft.com): Encoder only. Move it out of common
 #include "av1/encoder/hash_motion.h"
-#endif
 #if CONFIG_FILM_GRAIN
 #include "aom_dsp/grain_synthesis.h"
 #include "aom_dsp/grain_table.h"
@@ -136,9 +133,7 @@
 #endif
   aom_codec_frame_buffer_t raw_frame_buffer;
   YV12_BUFFER_CONFIG buf;
-#if CONFIG_HASH_ME
   hash_table hash_table;
-#endif
   uint8_t intra_only;
   FRAME_TYPE frame_type;
   // The Following variables will only be used in frame parallel decode.
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index cf110cd..c9b4cf5 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -4050,7 +4050,6 @@
     cm->allow_intrabc = 0;
   }
 
-#if CONFIG_HASH_ME
   if (cpi->oxcf.pass != 1 && av1_use_hash_me(cm)) {
     // add to hash table
     const int pic_width = cpi->source->y_crop_width;
@@ -4122,7 +4121,6 @@
       }
     }
   }
-#endif
 
   for (i = 0; i < MAX_SEGMENTS; ++i) {
     const int qindex = cm->seg.enabled
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index fd8414d..1f8f2ba 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -35,9 +35,7 @@
 #include "av1/encoder/encodetxb.h"
 #include "av1/encoder/ethread.h"
 #include "av1/encoder/firstpass.h"
-#if CONFIG_HASH_ME
 #include "av1/encoder/hash_motion.h"
-#endif
 #include "av1/encoder/mbgraph.h"
 #include "av1/encoder/picklpf.h"
 #include "av1/encoder/pickrst.h"
@@ -2928,12 +2926,10 @@
 #endif  // CONFIG_INTERNAL_STATS
 
   av1_remove_common(cm);
-#if CONFIG_HASH_ME
   for (i = 0; i < FRAME_BUFFERS; ++i) {
     av1_hash_table_destroy(&cm->buffer_pool->frame_bufs[i].hash_table);
   }
   if (cpi->sf.use_hash_based_trellis) hbt_destroy();
-#endif  // CONFIG_HASH_ME
   av1_free_ref_frame_buffers(cm->buffer_pool);
   aom_free(cpi);
 
@@ -3734,13 +3730,11 @@
     cm->ref_frame_map[i] = INVALID_IDX;
     pool->frame_bufs[i].ref_count = 0;
   }
-#if CONFIG_HASH_ME
   if (cm->seq_params.force_screen_content_tools) {
     for (i = 0; i < FRAME_BUFFERS; ++i) {
       av1_hash_table_init(&pool->frame_bufs[i].hash_table);
     }
   }
-#endif
 }
 
 static void check_initial_width(AV1_COMP *cpi, int use_highbitdepth,
@@ -5918,7 +5912,6 @@
     if (Pass0Encode(cpi, size, dest, 0, frame_flags) != AOM_CODEC_OK)
       return AOM_CODEC_ERROR;
   }
-#if CONFIG_HASH_ME
   if (oxcf->pass != 1 && cpi->common.allow_screen_content_tools) {
 #if CONFIG_AMVR
     cpi->previous_hash_table = &cm->cur_frame->hash_table;
@@ -5939,8 +5932,6 @@
 #endif
   }
 
-#endif
-
   if (!cm->large_scale_tile) {
     cm->frame_contexts[cm->new_fb_idx] = *cm->fc;
   }
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 1589a20..cb8edd5 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -649,7 +649,6 @@
   return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : INVALID_IDX;
 }
 
-#if CONFIG_HASH_ME
 // TODO(huisu@google.com, youzhou@microsoft.com): enable hash-me for HBD.
 static INLINE int av1_use_hash_me(const AV1_COMMON *const cm) {
   return cm->allow_screen_content_tools;
@@ -663,7 +662,6 @@
              ? &cm->buffer_pool->frame_bufs[buf_idx].hash_table
              : NULL;
 }
-#endif
 
 static INLINE YV12_BUFFER_CONFIG *get_ref_frame_buffer(
     const AV1_COMP *cpi, MV_REFERENCE_FRAME ref_frame) {
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index b9b1dbd..e8881cb 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -2484,17 +2484,10 @@
          (*x->ex_search_count_ptr <= max_ex) && !cpi->rc.is_src_frame_alt_ref;
 }
 
-#if CONFIG_HASH_ME
 int av1_full_pixel_search(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
                           MV *mvp_full, int step_param, int error_per_bit,
                           int *cost_list, const MV *ref_mv, int var_max, int rd,
                           int x_pos, int y_pos, int intra) {
-#else
-int av1_full_pixel_search(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
-                          MV *mvp_full, int step_param, int error_per_bit,
-                          int *cost_list, const MV *ref_mv, int var_max,
-                          int rd) {
-#endif
   const SPEED_FEATURES *const sf = &cpi->sf;
   const SEARCH_METHODS method = sf->mv.search_method;
   const aom_variance_fn_ptr_t *fn_ptr = &cpi->fn_ptr[bsize];
@@ -2566,7 +2559,6 @@
   if (method != NSTEP && rd && var < var_max)
     var = av1_get_mvpred_var(x, &x->best_mv.as_mv, ref_mv, fn_ptr, 1);
 
-#if CONFIG_HASH_ME
   do {
     if (!av1_use_hash_me(&cpi->common)) break;
 
@@ -2635,7 +2627,6 @@
       }
     }
   } while (0);
-#endif
 
   return var;
 }
diff --git a/av1/encoder/mcomp.h b/av1/encoder/mcomp.h
index 42eca55..c96eddc 100644
--- a/av1/encoder/mcomp.h
+++ b/av1/encoder/mcomp.h
@@ -125,17 +125,10 @@
 
 struct AV1_COMP;
 
-#if CONFIG_HASH_ME
 int av1_full_pixel_search(const struct AV1_COMP *cpi, MACROBLOCK *x,
                           BLOCK_SIZE bsize, MV *mvp_full, int step_param,
                           int error_per_bit, int *cost_list, const MV *ref_mv,
                           int var_max, int rd, int x_pos, int y_pos, int intra);
-#else
-int av1_full_pixel_search(const struct AV1_COMP *cpi, MACROBLOCK *x,
-                          BLOCK_SIZE bsize, MV *mvp_full, int step_param,
-                          int error_per_bit, int *cost_list, const MV *ref_mv,
-                          int var_max, int rd);
-#endif
 
 int av1_obmc_full_pixel_diamond(const struct AV1_COMP *cpi, MACROBLOCK *x,
                                 MV *mvp_full, int step_param, int sadpb,
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 9d0670c..d7d22af 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -5727,16 +5727,10 @@
 
   switch (mbmi->motion_mode) {
     case SIMPLE_TRANSLATION:
-#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);
-#endif
       break;
     case OBMC_CAUSAL:
       bestsme = av1_obmc_full_pixel_diamond(
@@ -7915,16 +7909,10 @@
     mvp_full.row >>= 3;
     int sadpb = x->sadperbit16;
     int cost_list[5];
-#if CONFIG_HASH_ME
     int bestsme = av1_full_pixel_search(
         cpi, x, bsize, &mvp_full, step_param, sadpb,
         cond_cost_list(cpi, cost_list), &dv_ref.as_mv, INT_MAX, 1,
         (MI_SIZE * mi_col), (MI_SIZE * mi_row), 1);
-#else
-    int bestsme = av1_full_pixel_search(cpi, x, bsize, &mvp_full, step_param,
-                                        sadpb, cond_cost_list(cpi, cost_list),
-                                        &dv_ref.as_mv, INT_MAX, 1);
-#endif
 
     x->mv_limits = tmp_mv_limits;
     if (bestsme == INT_MAX) continue;
diff --git a/build/cmake/aom_config_defaults.cmake b/build/cmake/aom_config_defaults.cmake
index 47c8fb1..5d0ed64 100644
--- a/build/cmake/aom_config_defaults.cmake
+++ b/build/cmake/aom_config_defaults.cmake
@@ -95,7 +95,6 @@
 set(CONFIG_FILM_GRAIN_SHOWEX 1 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_FP_MB_STATS 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_FRAME_COUNTER_FOR_SCALABILITY 0 CACHE NUMBER "AV1 experiment flag.")
-set(CONFIG_HASH_ME 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_INTER_STATS_ONLY 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_LOWPRECISION_BLEND 1 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_OBU_REDUNDANT_FRAME_HEADER 1 CACHE NUMBER "AV1 experiment flag.")
diff --git a/build/cmake/aom_experiment_deps.cmake b/build/cmake/aom_experiment_deps.cmake
index df05c2b..c8b15c8 100644
--- a/build/cmake/aom_experiment_deps.cmake
+++ b/build/cmake/aom_experiment_deps.cmake
@@ -14,11 +14,6 @@
 # Adjusts CONFIG_* CMake variables to address conflicts between active AV1
 # experiments.
 macro (fix_experiment_configs)
-  if (CONFIG_AMVR)
-    if (NOT CONFIG_HASH_ME)
-      change_config_and_warn(CONFIG_HASH_ME 1 CONFIG_AMVR)
-    endif ()
-  endif ()
 
   if (CONFIG_ANALYZER)
     if (NOT CONFIG_INSPECTION)