aom: inspect.c: make some functions static

From 54b7027954b752e2de58abe2873cfdf8a17d4160 Mon Sep 17 00:00:00 2001
From: James Zern <[EMAIL REDACTED]>
Date: Tue, 18 Jun 2024 16:50:33 -0700
Subject: [PATCH] inspect.c: make some functions static

This fixes some -Wmissing-prototypes warnings.

Since this is untested the unused function put_reference_frame() is left
for reference.

Bug: aomedia:3416
Change-Id: I7df1162f82434f9adca472b30cc0e27e871e7a99
---
 examples/inspect.c | 61 +++++++++++++++++++++++++++++++++++-----------
 1 file changed, 47 insertions(+), 14 deletions(-)

diff --git a/examples/inspect.c b/examples/inspect.c
index 9b2aceaec..28d3f74eb 100644
--- a/examples/inspect.c
+++ b/examples/inspect.c
@@ -280,7 +280,8 @@ struct parm_offset parm_offsets[] = {
 };
 int parm_count = sizeof(parm_offsets) / sizeof(parm_offsets[0]);
 
-int convert_to_indices(char *str, int *indices, int maxCount, int *count) {
+static int convert_to_indices(char *str, int *indices, int maxCount,
+                              int *count) {
   *count = 0;
   do {
     char *comma = strchr(str, ',');
@@ -307,7 +308,7 @@ AvxVideoReader *reader = NULL;
 const AvxVideoInfo *info = NULL;
 aom_image_t *img = NULL;
 
-void on_frame_decoded_dump(char *json) {
+static void on_frame_decoded_dump(char *json) {
 #ifdef __EMSCRIPTEN__
   EM_ASM_({ Module.on_frame_decoded_json($0); }, json);
 #else
@@ -317,7 +318,7 @@ void on_frame_decoded_dump(char *json) {
 
 // Writing out the JSON buffer using snprintf is very slow, especially when
 // compiled with emscripten, these functions speed things up quite a bit.
-int put_str(char *buffer, const char *str) {
+static int put_str(char *buffer, const char *str) {
   int i;
   for (i = 0; str[i] != '\0'; i++) {
     buffer[i] = str[i];
@@ -325,7 +326,7 @@ int put_str(char *buffer, const char *str) {
   return i;
 }
 
-int put_str_with_escape(char *buffer, const char *str) {
+static int put_str_with_escape(char *buffer, const char *str) {
   int i;
   int j = 0;
   for (i = 0; str[i] != '\0'; i++) {
@@ -339,7 +340,7 @@ int put_str_with_escape(char *buffer, const char *str) {
   return j;
 }
 
-int put_num(char *buffer, char prefix, int num, char suffix) {
+static int put_num(char *buffer, char prefix, int num, char suffix) {
   int i = 0;
   char *buf = buffer;
   int is_neg = 0;
@@ -376,7 +377,7 @@ int put_num(char *buffer, char prefix, int num, char suffix) {
   return i;
 }
 
-int put_map(char *buffer, const map_entry *map) {
+static int put_map(char *buffer, const map_entry *map) {
   char *buf = buffer;
   const map_entry *entry = map;
   while (entry->name != NULL) {
@@ -392,7 +393,8 @@ int put_map(char *buffer, const map_entry *map) {
   return (int)(buf - buffer);
 }
 
-int put_reference_frame(char *buffer) {
+#if 0
+static int put_reference_frame(char *buffer) {
   const int mi_rows = frame_data.mi_rows;
   const int mi_cols = frame_data.mi_cols;
   char *buf = buffer;
@@ -429,8 +431,9 @@ int put_reference_frame(char *buffer) {
   buf += put_str(buf, "],\n");
   return (int)(buf - buffer);
 }
+#endif
 
-int put_motion_vectors(char *buffer) {
+static int put_motion_vectors(char *buffer) {
   const int mi_rows = frame_data.mi_rows;
   const int mi_cols = frame_data.mi_cols;
   char *buf = buffer;
@@ -469,7 +472,7 @@ int put_motion_vectors(char *buffer) {
   return (int)(buf - buffer);
 }
 
-int put_combined(char *buffer) {
+static int put_combined(char *buffer) {
   const int mi_rows = frame_data.mi_rows;
   const int mi_cols = frame_data.mi_cols;
   char *buf = buffer;
@@ -501,8 +504,8 @@ int put_combined(char *buffer) {
   return (int)(buf - buffer);
 }
 
-int put_block_info(char *buffer, const map_entry *map, const char *name,
-                   size_t offset, int len) {
+static int put_block_info(char *buffer, const map_entry *map, const char *name,
+                          size_t offset, int len) {
   const int mi_rows = frame_data.mi_rows;
   const int mi_cols = frame_data.mi_cols;
   char *buf = buffer;
@@ -568,7 +571,7 @@ int put_block_info(char *buffer, const map_entry *map, const char *name,
 }
 
 #if CONFIG_ACCOUNTING
-int put_accounting(char *buffer) {
+static int put_accounting(char *buffer) {
   char *buf = buffer;
   int i;
   const Accounting *accounting = frame_data.accounting;
@@ -610,7 +613,7 @@ int put_accounting(char *buffer) {
 
 int skip_non_transform = 0;
 
-void inspect(void *pbi, void *data) {
+static void inspect(void *pbi, void *data) {
   /* Fetch frame data. */
   ifd_inspect(&frame_data, pbi, skip_non_transform);
 
@@ -742,13 +745,15 @@ void inspect(void *pbi, void *data) {
   aom_free(buffer);
 }
 
-void ifd_init_cb(void) {
+static void ifd_init_cb(void) {
   aom_inspect_init ii;
   ii.inspect_cb = inspect;
   ii.inspect_ctx = NULL;
   aom_codec_control(&codec, AV1_SET_INSPECTION_CALLBACK, &ii);
 }
 
+EMSCRIPTEN_KEEPALIVE int open_file(char *file);
+
 EMSCRIPTEN_KEEPALIVE
 int open_file(char *file) {
   if (file == NULL) {
@@ -775,6 +780,8 @@ const unsigned char *end_frame;
 size_t frame_size = 0;
 struct av1_ref_frame ref_dec;
 
+EMSCRIPTEN_KEEPALIVE int read_frame(void);
+
 EMSCRIPTEN_KEEPALIVE
 int read_frame(void) {
   img = NULL;
@@ -823,35 +830,55 @@ int read_frame(void) {
   return EXIT_SUCCESS;
 }
 
+EMSCRIPTEN_KEEPALIVE const char *get_aom_codec_build_config(void);
+
 EMSCRIPTEN_KEEPALIVE
 const char *get_aom_codec_build_config(void) {
   return aom_codec_build_config();
 }
 
+EMSCRIPTEN_KEEPALIVE int get_bit_depth(void);
+
 EMSCRIPTEN_KEEPALIVE
 int get_bit_depth(void) { return img->bit_depth; }
 
+EMSCRIPTEN_KEEPALIVE int get_bits_per_sample(void);
+
 EMSCRIPTEN_KEEPALIVE
 int get_bits_per_sample(void) { return img->bps; }
 
+EMSCRIPTEN_KEEPALIVE int get_image_format(void);
+
 EMSCRIPTEN_KEEPALIVE
 int get_image_format(void) { return img->fmt; }
 
+EMSCRIPTEN_KEEPALIVE unsigned char *get_plane(int plane);
+
 EMSCRIPTEN_KEEPALIVE
 unsigned char *get_plane(int plane) { return img->planes[plane]; }
 
+EMSCRIPTEN_KEEPALIVE int get_plane_stride(int plane);
+
 EMSCRIPTEN_KEEPALIVE
 int get_plane_stride(int plane) { return img->stride[plane]; }
 
+EMSCRIPTEN_KEEPALIVE int get_plane_width(int plane);
+
 EMSCRIPTEN_KEEPALIVE
 int get_plane_width(int plane) { return aom_img_plane_width(img, plane); }
 
+EMSCRIPTEN_KEEPALIVE int get_plane_height(int plane);
+
 EMSCRIPTEN_KEEPALIVE
 int get_plane_height(int plane) { return aom_img_plane_height(img, plane); }
 
+EMSCRIPTEN_KEEPALIVE int get_frame_width(void);
+
 EMSCRIPTEN_KEEPALIVE
 int get_frame_width(void) { return info->frame_width; }
 
+EMSCRIPTEN_KEEPALIVE int get_frame_height(void);
+
 EMSCRIPTEN_KEEPALIVE
 int get_frame_height(void) { return info->frame_height; }
 
@@ -950,14 +977,20 @@ int main(int argc, char **argv) {
   }
 }
 
+EMSCRIPTEN_KEEPALIVE void quit(void);
+
 EMSCRIPTEN_KEEPALIVE
 void quit(void) {
   if (aom_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec");
   aom_video_reader_close(reader);
 }
 
+EMSCRIPTEN_KEEPALIVE void set_layers(LayerType v);
+
 EMSCRIPTEN_KEEPALIVE
 void set_layers(LayerType v) { layers = v; }
 
+EMSCRIPTEN_KEEPALIVE void set_compress(int v);
+
 EMSCRIPTEN_KEEPALIVE
 void set_compress(int v) { compress = v; }