Remove more unused motion vector cost arrays

Change-Id: I68f8cc50d81a0cac116c6f342202b85ad2e6e3b2
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index ac28fe2..12dbef9 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -142,10 +142,8 @@
   int *nmvcost[NMV_CONTEXTS][2];
   int *nmvcost_hp[NMV_CONTEXTS][2];
   int **mv_cost_stack[NMV_CONTEXTS];
-
   int **mvcost;
-  int *nmvsadcost[2];
-  int *nmvsadcost_hp[2];
+
 #if CONFIG_MOTION_VAR
   int32_t *wsrc_buf;
   int32_t *mask_buf;
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 6083155..af89c0b 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -507,9 +507,6 @@
     av1_copy(cc->nmv_costs_hp, cpi->nmv_costs_hp);
   }
 
-  av1_copy(cc->nmvcosts, cpi->nmvcosts);
-  av1_copy(cc->nmvcosts_hp, cpi->nmvcosts_hp);
-
   av1_copy(cc->last_ref_lf_deltas, cm->lf.last_ref_deltas);
   av1_copy(cc->last_mode_lf_deltas, cm->lf.last_mode_deltas);
 
@@ -529,9 +526,6 @@
     av1_copy(cpi->nmv_costs_hp, cc->nmv_costs_hp);
   }
 
-  av1_copy(cpi->nmvcosts, cc->nmvcosts);
-  av1_copy(cpi->nmvcosts_hp, cc->nmvcosts_hp);
-
   av1_copy(cm->lf.last_ref_deltas, cc->last_ref_lf_deltas);
   av1_copy(cm->lf.last_mode_deltas, cc->last_mode_lf_deltas);
 
@@ -2050,41 +2044,6 @@
 #endif  // CONFIG_ANS && ANS_MAX_SYMBOLS
 }
 
-#ifndef M_LOG2_E
-#define M_LOG2_E 0.693147180559945309417
-#endif
-#define log2f(x) (log(x) / (float)M_LOG2_E)
-
-static void cal_nmvsadcosts(int *mvsadcost[2]) {
-  int i = 1;
-
-  mvsadcost[0][0] = 0;
-  mvsadcost[1][0] = 0;
-
-  do {
-    double z = 256 * (2 * (log2f(8 * i) + .6));
-    mvsadcost[0][i] = (int)z;
-    mvsadcost[1][i] = (int)z;
-    mvsadcost[0][-i] = (int)z;
-    mvsadcost[1][-i] = (int)z;
-  } while (++i <= MV_MAX);
-}
-
-static void cal_nmvsadcosts_hp(int *mvsadcost[2]) {
-  int i = 1;
-
-  mvsadcost[0][0] = 0;
-  mvsadcost[1][0] = 0;
-
-  do {
-    double z = 256 * (2 * (log2f(8 * i) + .6));
-    mvsadcost[0][i] = (int)z;
-    mvsadcost[1][i] = (int)z;
-    mvsadcost[0][-i] = (int)z;
-    mvsadcost[1][-i] = (int)z;
-  } while (++i <= MV_MAX);
-}
-
 static INLINE void init_upsampled_ref_frame_bufs(AV1_COMP *cpi) {
   int i;
 
@@ -2167,11 +2126,6 @@
     memset(cpi->nmv_costs_hp, 0, sizeof(cpi->nmv_costs_hp));
   }
 
-  memset(cpi->nmvcosts, 0, sizeof(cpi->nmvcosts));
-  memset(cpi->nmvcosts_hp, 0, sizeof(cpi->nmvcosts_hp));
-  memset(cpi->nmvsadcosts, 0, sizeof(cpi->nmvsadcosts));
-  memset(cpi->nmvsadcosts_hp, 0, sizeof(cpi->nmvsadcosts_hp));
-
   for (i = 0; i < (sizeof(cpi->mbgraph_stats) / sizeof(cpi->mbgraph_stats[0]));
        i++) {
     CHECK_MEM_ERROR(
@@ -2239,13 +2193,6 @@
     cpi->td.mb.nmvcost_hp[i][0] = &cpi->nmv_costs_hp[i][0][MV_MAX];
     cpi->td.mb.nmvcost_hp[i][1] = &cpi->nmv_costs_hp[i][1][MV_MAX];
   }
-  cpi->td.mb.nmvsadcost[0] = &cpi->nmvsadcosts[0][MV_MAX];
-  cpi->td.mb.nmvsadcost[1] = &cpi->nmvsadcosts[1][MV_MAX];
-  cal_nmvsadcosts(cpi->td.mb.nmvsadcost);
-
-  cpi->td.mb.nmvsadcost_hp[0] = &cpi->nmvsadcosts_hp[0][MV_MAX];
-  cpi->td.mb.nmvsadcost_hp[1] = &cpi->nmvsadcosts_hp[1][MV_MAX];
-  cal_nmvsadcosts_hp(cpi->td.mb.nmvsadcost_hp);
 
 #ifdef OUTPUT_YUV_SKINMAP
   yuv_skinmap_file = fopen("skinmap.yuv", "ab");
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 9e1fd2e..626df3f 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -53,10 +53,6 @@
 #endif
 
 typedef struct {
-  int nmvjointcost[MV_JOINTS];
-  int nmvcosts[2][MV_VALS];
-  int nmvcosts_hp[2][MV_VALS];
-
   int nmv_vec_cost[NMV_CONTEXTS][MV_JOINTS];
   int nmv_costs[NMV_CONTEXTS][2][MV_VALS];
   int nmv_costs_hp[NMV_CONTEXTS][2][MV_VALS];
@@ -432,11 +428,6 @@
   int nmv_costs[NMV_CONTEXTS][2][MV_VALS];
   int nmv_costs_hp[NMV_CONTEXTS][2][MV_VALS];
 
-  int nmvcosts[2][MV_VALS];
-  int nmvcosts_hp[2][MV_VALS];
-  int nmvsadcosts[2][MV_VALS];
-  int nmvsadcosts_hp[2][MV_VALS];
-
   int64_t last_time_stamp_seen;
   int64_t last_end_time_stamp_seen;
   int64_t first_time_stamp_ever;