From 0e8a8e653ae3a57ddf859b818134834684071a79 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 12:41:22 +0200
Subject: [PATCH 03/23] avcodec/x86/vvc/dsp_init: Make alf wrappers static

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/x86/vvc/dsp_init.c | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/libavcodec/x86/vvc/dsp_init.c b/libavcodec/x86/vvc/dsp_init.c
index 6ee43b79da..2bc0ed1f7f 100644
--- a/libavcodec/x86/vvc/dsp_init.c
+++ b/libavcodec/x86/vvc/dsp_init.c
@@ -102,21 +102,9 @@ void BF(ff_vvc_alf_classify_grad, bpc, opt)(int *gradient_sum,
 void BF(ff_vvc_alf_classify, bpc, opt)(int *class_idx, int *transpose_idx, const int *gradient_sum,                      \
     intptr_t width, intptr_t height, intptr_t vb_pos, intptr_t bit_depth);                                               \
 
-#define ALF_PROTOTYPES(bpc, bd, opt)                                                                                     \
-void bf(ff_vvc_alf_filter_luma, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride,   \
-    int width, int height, const int16_t *filter, const int16_t *clip, const int vb_pos);                                \
-void bf(ff_vvc_alf_filter_chroma, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, \
-    int width, int height, const int16_t *filter, const int16_t *clip, const int vb_pos);                                \
-void bf(ff_vvc_alf_classify, bd, opt)(int *class_idx, int *transpose_idx,                                                \
-    const uint8_t *src, ptrdiff_t src_stride, int width, int height, int vb_pos, int *gradient_tmp);                     \
-
 ALF_BPC_PROTOTYPES(8,  avx2)
 ALF_BPC_PROTOTYPES(16, avx2)
 
-ALF_PROTOTYPES(8,  8,  avx2)
-ALF_PROTOTYPES(16, 10, avx2)
-ALF_PROTOTYPES(16, 12, avx2)
-
 #if ARCH_X86_64
 #define FW_PUT(name, depth, opt) \
 static void vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,    \
@@ -213,20 +201,20 @@ AVG_FUNCS(16, 10, avx2)
 AVG_FUNCS(16, 12, avx2)
 
 #define ALF_FUNCS(bpc, bd, opt)                                                                                          \
-void bf(ff_vvc_alf_filter_luma, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride,   \
+static void bf(vvc_alf_filter_luma, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, \
     int width, int height, const int16_t *filter, const int16_t *clip, const int vb_pos)                                 \
 {                                                                                                                        \
     const int param_stride  = (width >> 2) * ALF_NUM_COEFF_LUMA;                                                         \
     BF(ff_vvc_alf_filter_luma, bpc, opt)(dst, dst_stride, src, src_stride, width, height,                                \
         filter, clip, param_stride, vb_pos, (1 << bd)  - 1);                                                             \
 }                                                                                                                        \
-void bf(ff_vvc_alf_filter_chroma, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, \
+static void bf(vvc_alf_filter_chroma, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, \
     int width, int height, const int16_t *filter, const int16_t *clip, const int vb_pos)                                 \
 {                                                                                                                        \
     BF(ff_vvc_alf_filter_chroma, bpc, opt)(dst, dst_stride, src, src_stride, width, height,                              \
         filter, clip, 0, vb_pos,(1 << bd)  - 1);                                                                         \
 }                                                                                                                        \
-void bf(ff_vvc_alf_classify, bd, opt)(int *class_idx, int *transpose_idx,                                                \
+static void bf(vvc_alf_classify, bd, opt)(int *class_idx, int *transpose_idx,                                            \
     const uint8_t *src, ptrdiff_t src_stride, int width, int height, int vb_pos, int *gradient_tmp)                      \
 {                                                                                                                        \
     BF(ff_vvc_alf_classify_grad, bpc, opt)(gradient_tmp, src, src_stride, width, height, vb_pos);                        \
@@ -317,9 +305,9 @@ ALF_FUNCS(16, 12, avx2)
 } while (0)
 
 #define ALF_INIT(bd) do {                                            \
-    c->alf.filter[LUMA]   = ff_vvc_alf_filter_luma_##bd##_avx2;      \
-    c->alf.filter[CHROMA] = ff_vvc_alf_filter_chroma_##bd##_avx2;    \
-    c->alf.classify       = ff_vvc_alf_classify_##bd##_avx2;         \
+    c->alf.filter[LUMA]   = vvc_alf_filter_luma_##bd##_avx2;         \
+    c->alf.filter[CHROMA] = vvc_alf_filter_chroma_##bd##_avx2;       \
+    c->alf.classify       = vvc_alf_classify_##bd##_avx2;            \
 } while (0)
 
 int ff_vvc_sad_avx2(const int16_t *src0, const int16_t *src1, int dx, int dy, int block_w, int block_h);
-- 
2.45.2