Cleanup functions that should be marked static

This is a followup to change 180c0cdb6992eb822bbe2273ed1b2f4bbde16532,
marking functions found using the command listed in aomedia:1540 as
static.

BUG=aomedia:1540,aomedia:2196

Change-Id: I4028461cb8328a8f7770d080ef7d22e86d62b927
diff --git a/aom_dsp/grain_table.c b/aom_dsp/grain_table.c
index 0d6a73f..5eb5b68 100644
--- a/aom_dsp/grain_table.c
+++ b/aom_dsp/grain_table.c
@@ -134,7 +134,8 @@
   }
 }
 
-void grain_table_entry_write(FILE *file, aom_film_grain_table_entry_t *entry) {
+static void grain_table_entry_write(FILE *file,
+                                    aom_film_grain_table_entry_t *entry) {
   const aom_film_grain_t *pars = &entry->params;
   fprintf(file, "E %" PRId64 " %" PRId64 " %d %d %d\n", entry->start_time,
           entry->end_time, pars->apply_grain, pars->random_seed,
diff --git a/av1/common/thread_common.c b/av1/common/thread_common.c
index 064cd67..258a8d5 100644
--- a/av1/common/thread_common.c
+++ b/av1/common/thread_common.c
@@ -243,7 +243,7 @@
   }
 }
 
-AV1LfMTInfo *get_lf_job_info(AV1LfSync *lf_sync) {
+static AV1LfMTInfo *get_lf_job_info(AV1LfSync *lf_sync) {
   AV1LfMTInfo *cur_job_info = NULL;
 
 #if CONFIG_MULTITHREAD
@@ -767,7 +767,7 @@
   }
 }
 
-AV1LrMTInfo *get_lr_job_info(AV1LrSync *lr_sync) {
+static AV1LrMTInfo *get_lr_job_info(AV1LrSync *lr_sync) {
   AV1LrMTInfo *cur_job_info = NULL;
 
 #if CONFIG_MULTITHREAD
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index f4aa4a3..2cbb865 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -5407,7 +5407,7 @@
   return (BITSTREAM_PROFILE)profile;
 }
 
-void superres_post_decode(AV1Decoder *pbi) {
+static void superres_post_decode(AV1Decoder *pbi) {
   AV1_COMMON *const cm = &pbi->common;
   BufferPool *const pool = cm->buffer_pool;
 
diff --git a/av1/encoder/aq_variance.c b/av1/encoder/aq_variance.c
index 58f906b..e9f80a7 100644
--- a/av1/encoder/aq_variance.c
+++ b/av1/encoder/aq_variance.c
@@ -147,7 +147,7 @@
 
 #define DEFAULT_E_MIDPOINT 10.0
 
-unsigned int haar_ac_energy(MACROBLOCK *x, BLOCK_SIZE bs) {
+static unsigned int haar_ac_energy(MACROBLOCK *x, BLOCK_SIZE bs) {
   MACROBLOCKD *xd = &x->e_mbd;
   int stride = x->plane[0].src.stride;
   uint8_t *buf = x->plane[0].src.buf;
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c
index 998d0a6..a0c6ec1 100644
--- a/av1/encoder/encodetxb.c
+++ b/av1/encoder/encodetxb.c
@@ -1014,7 +1014,7 @@
   return update;
 }
 
-void hbt_init() {
+static void hbt_init() {
   hbt_hash_table =
       aom_malloc(sizeof(OptTxbQcoeff) * HBT_TABLE_SIZE * HBT_ARRAY_LENGTH);
   memset(hbt_hash_table, 0,
@@ -1026,11 +1026,11 @@
 
 void hbt_destroy() { aom_free(hbt_hash_table); }
 
-int hbt_hash_miss(uint32_t hbt_ctx_hash, uint32_t hbt_qc_hash,
-                  TxbInfo *txb_info, const LV_MAP_COEFF_COST *txb_costs,
-                  const LV_MAP_EOB_COST *txb_eob_costs,
-                  const struct macroblock_plane *p, int block, int fast_mode,
-                  int *rate_cost) {
+static int hbt_hash_miss(uint32_t hbt_ctx_hash, uint32_t hbt_qc_hash,
+                         TxbInfo *txb_info, const LV_MAP_COEFF_COST *txb_costs,
+                         const LV_MAP_EOB_COST *txb_eob_costs,
+                         const struct macroblock_plane *p, int block,
+                         int fast_mode, int *rate_cost) {
   (void)fast_mode;
   const int16_t *scan = txb_info->scan_order->scan;
   int prev_eob = txb_info->eob;
@@ -1092,9 +1092,9 @@
   return txb_info->eob;
 }
 
-int hbt_hash_hit(uint32_t hbt_table_index, int hbt_array_index,
-                 TxbInfo *txb_info, const struct macroblock_plane *p, int block,
-                 int *rate_cost) {
+static int hbt_hash_hit(uint32_t hbt_table_index, int hbt_array_index,
+                        TxbInfo *txb_info, const struct macroblock_plane *p,
+                        int block, int *rate_cost) {
   const int16_t *scan = txb_info->scan_order->scan;
   int new_eob = 0;
   int update = 0;
@@ -1134,11 +1134,12 @@
   return txb_info->eob;
 }
 
-int hbt_search_match(uint32_t hbt_ctx_hash, uint32_t hbt_qc_hash,
-                     TxbInfo *txb_info, const LV_MAP_COEFF_COST *txb_costs,
-                     const LV_MAP_EOB_COST *txb_eob_costs,
-                     const struct macroblock_plane *p, int block, int fast_mode,
-                     int *rate_cost) {
+static int hbt_search_match(uint32_t hbt_ctx_hash, uint32_t hbt_qc_hash,
+                            TxbInfo *txb_info,
+                            const LV_MAP_COEFF_COST *txb_costs,
+                            const LV_MAP_EOB_COST *txb_eob_costs,
+                            const struct macroblock_plane *p, int block,
+                            int fast_mode, int *rate_cost) {
   // Check for qcoeff match
   int hbt_array_index = hbt_qc_hash % HBT_ARRAY_LENGTH;
   int hbt_table_index = hbt_ctx_hash % HBT_TABLE_SIZE;
@@ -1157,10 +1158,11 @@
   }
 }
 
-int hbt_create_hashes(TxbInfo *txb_info, const LV_MAP_COEFF_COST *txb_costs,
-                      const LV_MAP_EOB_COST *txb_eob_costs,
-                      const struct macroblock_plane *p, int block,
-                      int fast_mode, int *rate_cost) {
+static int hbt_create_hashes(TxbInfo *txb_info,
+                             const LV_MAP_COEFF_COST *txb_costs,
+                             const LV_MAP_EOB_COST *txb_eob_costs,
+                             const struct macroblock_plane *p, int block,
+                             int fast_mode, int *rate_cost) {
   // Initialize hash table if needed.
   if (hbt_needs_init) {
     hbt_init();
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c
index 29d52ed..13f5b8a 100644
--- a/av1/encoder/ethread.c
+++ b/av1/encoder/ethread.c
@@ -160,8 +160,8 @@
   }
 }
 
-void assign_tile_to_thread(MultiThreadHandle *multi_thread_ctxt, int num_tiles,
-                           int num_workers) {
+static void assign_tile_to_thread(MultiThreadHandle *multi_thread_ctxt,
+                                  int num_tiles, int num_workers) {
   int tile_id = 0;
   int i;
 
diff --git a/av1/encoder/firstpass.c b/av1/encoder/firstpass.c
index 601e8ce..4f51e60 100644
--- a/av1/encoder/firstpass.c
+++ b/av1/encoder/firstpass.c
@@ -1689,7 +1689,7 @@
   return frame_index;
 }
 
-void define_customized_gf_group_structure(AV1_COMP *cpi) {
+static void define_customized_gf_group_structure(AV1_COMP *cpi) {
   RATE_CONTROL *const rc = &cpi->rc;
   TWO_PASS *const twopass = &cpi->twopass;
   GF_GROUP *const gf_group = &twopass->gf_group;
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index 24cb931..619c0be 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -2541,11 +2541,11 @@
                      : 0);
 }
 
-int obmc_refining_search_sad(const MACROBLOCK *x, const int32_t *wsrc,
-                             const int32_t *mask, MV *ref_mv, int error_per_bit,
-                             int search_range,
-                             const aom_variance_fn_ptr_t *fn_ptr,
-                             const MV *center_mv, int is_second) {
+static int obmc_refining_search_sad(const MACROBLOCK *x, const int32_t *wsrc,
+                                    const int32_t *mask, MV *ref_mv,
+                                    int error_per_bit, int search_range,
+                                    const aom_variance_fn_ptr_t *fn_ptr,
+                                    const MV *center_mv, int is_second) {
   const MV neighbors[4] = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 } };
   const MACROBLOCKD *const xd = &x->e_mbd;
   const struct buf_2d *const in_what = &xd->plane[0].pre[is_second];
@@ -2584,12 +2584,13 @@
   return best_sad;
 }
 
-int obmc_diamond_search_sad(const MACROBLOCK *x, const search_site_config *cfg,
-                            const int32_t *wsrc, const int32_t *mask,
-                            MV *ref_mv, MV *best_mv, int search_param,
-                            int sad_per_bit, int *num00,
-                            const aom_variance_fn_ptr_t *fn_ptr,
-                            const MV *center_mv, int is_second) {
+static int obmc_diamond_search_sad(const MACROBLOCK *x,
+                                   const search_site_config *cfg,
+                                   const int32_t *wsrc, const int32_t *mask,
+                                   MV *ref_mv, MV *best_mv, int search_param,
+                                   int sad_per_bit, int *num00,
+                                   const aom_variance_fn_ptr_t *fn_ptr,
+                                   const MV *center_mv, int is_second) {
   const MACROBLOCKD *const xd = &x->e_mbd;
   const struct buf_2d *const in_what = &xd->plane[0].pre[is_second];
   // search_param determines the length of the initial step and hence the number
diff --git a/av1/encoder/pickrst.c b/av1/encoder/pickrst.c
index 2858d16..8f013a5 100644
--- a/av1/encoder/pickrst.c
+++ b/av1/encoder/pickrst.c
@@ -605,7 +605,7 @@
 #endif  // CONFIG_INTEGERIZE_SGR
 }
 
-void encode_xq(int *xq, int *xqd, const sgr_params_type *params) {
+static void encode_xq(int *xq, int *xqd, const sgr_params_type *params) {
   if (params->r[0] == 0) {
     xqd[0] = 0;
     xqd[1] = clamp((1 << SGRPROJ_PRJ_BITS) - xq[1], SGRPROJ_PRJ_MIN1,
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 88675e1..a66640b 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -176,6 +176,11 @@
 };
 
 typedef struct {
+  int16_t x;
+  int16_t y;
+} sobel_xy;
+
+typedef struct {
   PREDICTION_MODE mode;
   MV_REFERENCE_FRAME ref_frame[2];
 } MODE_DEFINITION;
@@ -627,7 +632,7 @@
 } InterModeSearchState;
 
 #if CONFIG_COLLECT_INTER_MODE_RD_STATS
-int inter_mode_data_block_idx(BLOCK_SIZE bsize) {
+static int inter_mode_data_block_idx(BLOCK_SIZE bsize) {
   if (bsize == BLOCK_8X8) return 1;
   if (bsize == BLOCK_16X16) return 2;
   if (bsize == BLOCK_32X32) return 3;
@@ -12390,7 +12395,7 @@
 }
 
 /* Use standard 3x3 Sobel matrix. */
-sobel_xy sobel(const uint8_t *input, int stride, int i, int j) {
+static sobel_xy sobel(const uint8_t *input, int stride, int i, int j) {
   int16_t s_x = get_pix(input, stride, i - 1, j - 1) -
                 get_pix(input, stride, i + 1, j - 1) +
                 2 * get_pix(input, stride, i - 1, j) -
diff --git a/av1/encoder/rdopt.h b/av1/encoder/rdopt.h
index d4df1e8..751de1b 100644
--- a/av1/encoder/rdopt.h
+++ b/av1/encoder/rdopt.h
@@ -146,13 +146,6 @@
 typedef void (*y4m_convert_func)(y4m_input *_y4m, unsigned char *_dst,
                                  unsigned char *_src);
 
-typedef struct {
-  int16_t x;
-  int16_t y;
-} sobel_xy;
-
-sobel_xy sobel(const uint8_t *input, int stride, int i, int j);
-
 #if CONFIG_COLLECT_INTER_MODE_RD_STATS
 void av1_inter_mode_data_init(struct TileDataEnc *tile_data);
 void av1_inter_mode_data_fit(TileDataEnc *tile_data, int rdmult);
diff --git a/av1/encoder/tokenize.c b/av1/encoder/tokenize.c
index 16a6a9a..af4cc70 100644
--- a/av1/encoder/tokenize.c
+++ b/av1/encoder/tokenize.c
@@ -125,9 +125,9 @@
                         counts);
 }
 
-void tokenize_vartx(ThreadData *td, TOKENEXTRA **t, RUN_TYPE dry_run,
-                    TX_SIZE tx_size, BLOCK_SIZE plane_bsize, int blk_row,
-                    int blk_col, int block, int plane, void *arg) {
+static void tokenize_vartx(ThreadData *td, TOKENEXTRA **t, RUN_TYPE dry_run,
+                           TX_SIZE tx_size, BLOCK_SIZE plane_bsize, int blk_row,
+                           int blk_col, int block, int plane, void *arg) {
   MACROBLOCK *const x = &td->mb;
   MACROBLOCKD *const xd = &x->e_mbd;
   MB_MODE_INFO *const mbmi = xd->mi[0];