aom: av1_loopfilter.c: make av1_get_filter_level() static

From acae43ef62d6f7543d7b8023ec8f7747d955c7fa Mon Sep 17 00:00:00 2001
From: James Zern <[EMAIL REDACTED]>
Date: Tue, 13 Aug 2024 17:01:18 -0700
Subject: [PATCH] av1_loopfilter.c: make av1_get_filter_level() static

This function is unused outside of this file.

Bug: aomedia:3416
Change-Id: Ifc5118d0ebac310350124f581dfd6066942d1307
---
 av1/common/av1_loopfilter.c | 30 +++++++++++++++---------------
 av1/common/av1_loopfilter.h |  4 ----
 av1/encoder/picklpf.c       |  3 ++-
 3 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/av1/common/av1_loopfilter.c b/av1/common/av1_loopfilter.c
index 83549597e1..043c51bb90 100644
--- a/av1/common/av1_loopfilter.c
+++ b/av1/common/av1_loopfilter.c
@@ -65,9 +65,10 @@ static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) {
   }
 }
 
-uint8_t av1_get_filter_level(const AV1_COMMON *cm,
-                             const loop_filter_info_n *lfi_n, const int dir_idx,
-                             int plane, const MB_MODE_INFO *mbmi) {
+static uint8_t get_filter_level(const AV1_COMMON *cm,
+                                const loop_filter_info_n *lfi_n,
+                                const int dir_idx, int plane,
+                                const MB_MODE_INFO *mbmi) {
   const int segment_id = mbmi->segment_id;
   if (cm->delta_q_info.delta_lf_present_flag) {
     int8_t delta_lf;
@@ -266,7 +267,7 @@ static TX_SIZE set_lpf_parameters(
     // prepare outer edge parameters. deblock the edge if it's an edge of a TU
     {
       const uint32_t curr_level =
-          av1_get_filter_level(cm, &cm->lf_info, edge_dir, plane, mbmi);
+          get_filter_level(cm, &cm->lf_info, edge_dir, plane, mbmi);
       const int curr_skipped = mbmi->skip_txfm && is_inter_block(mbmi);
       uint32_t level = curr_level;
       if (coord) {
@@ -281,7 +282,7 @@ static TX_SIZE set_lpf_parameters(
               xd, mi_prev, pv_row, pv_col, plane, scale_horz, scale_vert);
 
           const uint32_t pv_lvl =
-              av1_get_filter_level(cm, &cm->lf_info, edge_dir, plane, mi_prev);
+              get_filter_level(cm, &cm->lf_info, edge_dir, plane, mi_prev);
 
           const int pv_skip_txfm =
               mi_prev->skip_txfm && is_inter_block(mi_prev);
@@ -689,10 +690,10 @@ static AOM_FORCE_INLINE void set_one_param_for_line_luma(
     }
     assert(mi_prev);
     uint8_t level =
-        av1_get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_Y, mbmi);
+        get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_Y, mbmi);
     if (!level) {
-      level = av1_get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_Y,
-                                   mi_prev);
+      level =
+          get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_Y, mi_prev);
     }
 
     const int32_t pu_edge = mi_prev != mbmi;
@@ -723,7 +724,7 @@ static AOM_FORCE_INLINE void set_one_param_for_line_luma(
 }
 
 // Similar to set_lpf_parameters, but does so one row/col at a time to reduce
-// calls to \ref get_transform_size and \ref av1_get_filter_level
+// calls to \ref get_transform_size and \ref get_filter_level
 static AOM_FORCE_INLINE void set_lpf_parameters_for_line_luma(
     AV1_DEBLOCKING_PARAMETERS *const params_buf, TX_SIZE *tx_buf,
     const AV1_COMMON *const cm, const MACROBLOCKD *const xd,
@@ -822,18 +823,17 @@ static AOM_FORCE_INLINE void set_one_param_for_line_chroma(
       *min_dim = is_vert ? tx_size_high[pv_ts] : tx_size_wide[pv_ts];
     }
 
-    uint8_t level =
-        av1_get_filter_level(cm, &cm->lf_info, edge_dir, plane, mbmi);
+    uint8_t level = get_filter_level(cm, &cm->lf_info, edge_dir, plane, mbmi);
     if (!level) {
-      level = av1_get_filter_level(cm, &cm->lf_info, edge_dir, plane, mi_prev);
+      level = get_filter_level(cm, &cm->lf_info, edge_dir, plane, mi_prev);
     }
 #ifndef NDEBUG
     if (joint_filter_chroma) {
       uint8_t v_level =
-          av1_get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_V, mbmi);
+          get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_V, mbmi);
       if (!v_level) {
-        v_level = av1_get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_V,
-                                       mi_prev);
+        v_level =
+            get_filter_level(cm, &cm->lf_info, edge_dir, AOM_PLANE_V, mi_prev);
       }
       assert(level == v_level);
     }
diff --git a/av1/common/av1_loopfilter.h b/av1/common/av1_loopfilter.h
index 2ecc47c72b..6c02f9fa23 100644
--- a/av1/common/av1_loopfilter.h
+++ b/av1/common/av1_loopfilter.h
@@ -139,10 +139,6 @@ void av1_filter_block_plane_horz_opt_chroma(
     TX_SIZE *tx_buf, int plane, bool joint_filter_chroma,
     int num_mis_in_lpf_unit_height_log2);
 
-uint8_t av1_get_filter_level(const struct AV1Common *cm,
-                             const loop_filter_info_n *lfi_n, const int dir_idx,
-                             int plane, const MB_MODE_INFO *mbmi);
-
 #ifdef __cplusplus
 }  // extern "C"
 #endif
diff --git a/av1/encoder/picklpf.c b/av1/encoder/picklpf.c
index abcbb7d481..29a8abdfde 100644
--- a/av1/encoder/picklpf.c
+++ b/av1/encoder/picklpf.c
@@ -72,7 +72,8 @@ static int64_t try_filter_frame(const YV12_BUFFER_CONFIG *sd,
   if (plane == 0 && dir == 0) filter_level[1] = cm->lf.filter_level[1];
   if (plane == 0 && dir == 1) filter_level[0] = cm->lf.filter_level[0];
 
-  // set base filters for use of av1_get_filter_level when in DELTA_LF mode
+  // set base filters for use of get_filter_level (av1_loopfilter.c) when in
+  // DELTA_LF mode
   switch (plane) {
     case 0:
       cm->lf.filter_level[0] = filter_level[0];