Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 01/23] avcodec/x86/vvc/dsp_init: Make put wrappers static
@ 2025-04-03 20:31 Andreas Rheinhardt
  2025-04-05  7:38 ` Michael Niedermayer
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Rheinhardt @ 2025-04-03 20:31 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 29 bytes --]

Patches attached.

- Andreas

[-- Attachment #2: 0001-avcodec-x86-vvc-dsp_init-Make-put-wrappers-static.patch --]
[-- Type: text/x-patch, Size: 4778 bytes --]

From c397df6e6a8b8cc5a2b76ff2587cad868b16c028 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 12:31:15 +0200
Subject: [PATCH 01/23] avcodec/x86/vvc/dsp_init: Make put wrappers static

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

diff --git a/libavcodec/x86/vvc/dsp_init.c b/libavcodec/x86/vvc/dsp_init.c
index 31bb80e109..6245dc1a8b 100644
--- a/libavcodec/x86/vvc/dsp_init.c
+++ b/libavcodec/x86/vvc/dsp_init.c
@@ -32,39 +32,6 @@
 
 #if ARCH_X86_64
 
-#define PUT_PROTOTYPE(name, depth, opt) \
-void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, int height, const int8_t *hf, const int8_t *vf, int width);
-
-#define PUT_PROTOTYPES(name, bitd, opt) \
-        PUT_PROTOTYPE(name##2,   bitd, opt) \
-        PUT_PROTOTYPE(name##4,   bitd, opt) \
-        PUT_PROTOTYPE(name##8,   bitd, opt) \
-        PUT_PROTOTYPE(name##12,  bitd, opt) \
-        PUT_PROTOTYPE(name##16,  bitd, opt) \
-        PUT_PROTOTYPE(name##24,  bitd, opt) \
-        PUT_PROTOTYPE(name##32,  bitd, opt) \
-        PUT_PROTOTYPE(name##48,  bitd, opt) \
-        PUT_PROTOTYPE(name##64,  bitd, opt) \
-        PUT_PROTOTYPE(name##128, bitd, opt)
-
-#define PUT_BPC_PROTOTYPES(name, opt) \
-    PUT_PROTOTYPES(name,  8, opt)     \
-    PUT_PROTOTYPES(name, 10, opt)     \
-    PUT_PROTOTYPES(name, 12, opt)
-
-#define PUT_TAP_PROTOTYPES(n, opt) \
-    PUT_BPC_PROTOTYPES(n##tap_h,  opt) \
-    PUT_BPC_PROTOTYPES(n##tap_v,  opt) \
-    PUT_BPC_PROTOTYPES(n##tap_hv, opt)
-
-PUT_BPC_PROTOTYPES(pixels, sse4)
-PUT_BPC_PROTOTYPES(pixels, avx2)
-
-PUT_TAP_PROTOTYPES(4, sse4)
-PUT_TAP_PROTOTYPES(8, sse4)
-PUT_TAP_PROTOTYPES(4, avx2)
-PUT_TAP_PROTOTYPES(8, avx2)
-
 #define bf(fn, bd,  opt) fn##_##bd##_##opt
 #define BF(fn, bpc, opt) fn##_##bpc##bpc_##opt
 
@@ -156,14 +123,14 @@ ALF_PROTOTYPES(16, 10, avx2)
 ALF_PROTOTYPES(16, 12, avx2)
 
 #if ARCH_X86_64
-#if HAVE_SSE4_EXTERNAL
 #define FW_PUT(name, depth, opt) \
-void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,        \
+static void vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,    \
                                                  int height, const int8_t *hf, const int8_t *vf, int width)    \
 {                                                                                                              \
     ff_h2656_put_## name ## _ ## depth ## _##opt(dst, 2 * MAX_PB_SIZE, src, srcstride, height, hf, vf, width); \
 }
 
+#if HAVE_SSE4_EXTERNAL
 #define FW_PUT_TAP(fname, bitd, opt ) \
     FW_PUT(fname##4,   bitd, opt )    \
     FW_PUT(fname##8,   bitd, opt )    \
@@ -278,7 +245,7 @@ ALF_FUNCS(16, 12, avx2)
 #endif
 
 #define PEL_LINK(dst, C, W, idx1, idx2, name, D, opt)                              \
-    dst[C][W][idx1][idx2] = ff_vvc_put_## name ## _ ## D ## _##opt;                \
+    dst[C][W][idx1][idx2] = vvc_put_## name ## _ ## D ## _##opt;                   \
     dst ## _uni[C][W][idx1][idx2] = ff_h2656_put_uni_ ## name ## _ ## D ## _##opt; \
 
 #define MC_TAP_LINKS(pointer, C, my, mx, fname, bitd, opt )          \
@@ -378,9 +345,12 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd)
 
     switch (bd) {
     case 8:
+#if HAVE_SSE4_EXTERNAL
         if (EXTERNAL_SSE4(cpu_flags)) {
             MC_LINK_SSE4(8);
         }
+#endif
+#if HAVE_AVX2_EXTERNAL
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             ALF_INIT(8);
             AVG_INIT(8, avx2);
@@ -389,11 +359,15 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd)
             DMVR_INIT(8);
             SAD_INIT();
         }
+#endif
         break;
     case 10:
+#if HAVE_SSE4_EXTERNAL
         if (EXTERNAL_SSE4(cpu_flags)) {
             MC_LINK_SSE4(10);
         }
+#endif
+#if HAVE_AVX2_EXTERNAL
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             ALF_INIT(10);
             AVG_INIT(10, avx2);
@@ -403,11 +377,15 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd)
             DMVR_INIT(10);
             SAD_INIT();
         }
+#endif
         break;
     case 12:
+#if HAVE_SSE4_EXTERNAL
         if (EXTERNAL_SSE4(cpu_flags)) {
             MC_LINK_SSE4(12);
         }
+#endif
+#if HAVE_AVX2_EXTERNAL
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             ALF_INIT(12);
             AVG_INIT(12, avx2);
@@ -417,6 +395,7 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd)
             DMVR_INIT(12);
             SAD_INIT();
         }
+#endif
         break;
     default:
         break;
-- 
2.45.2


[-- Attachment #3: 0002-avcodec-x86-vvc-dsp_init-Make-ff_vvc_apply_bdof_-bd-.patch --]
[-- Type: text/x-patch, Size: 3121 bytes --]

From 57bf42131429e3213799f6ee8cf1e4c1c2c85741 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Wed, 2 Apr 2025 11:27:34 +0200
Subject: [PATCH 02/23] avcodec/x86/vvc/dsp_init: Make
 ff_vvc_apply_bdof_##bd##_avx2 static

These wrappers around ff_vvc_apply_bdof_avx2() are only used in
dsp_init.c.

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

diff --git a/libavcodec/x86/vvc/dsp_init.c b/libavcodec/x86/vvc/dsp_init.c
index 6245dc1a8b..6ee43b79da 100644
--- a/libavcodec/x86/vvc/dsp_init.c
+++ b/libavcodec/x86/vvc/dsp_init.c
@@ -71,20 +71,13 @@ DMVR_PROTOTYPES( 8, avx2)
 DMVR_PROTOTYPES(10, avx2)
 DMVR_PROTOTYPES(12, avx2)
 
-#define OF_PROTOTYPES(bd, opt)                                                                      \
-void ff_vvc_apply_bdof_##bd##_##opt(uint8_t *dst, ptrdiff_t dst_stride,                             \
-    const int16_t *src0, const int16_t *src1, int w, int h);                                        \
-
-OF_PROTOTYPES( 8, avx2)
-OF_PROTOTYPES(10, avx2)
-OF_PROTOTYPES(12, avx2)
-
 #if ARCH_X86_64 && HAVE_AVX2_EXTERNAL
-void ff_vvc_apply_bdof_avx2(uint8_t *dst, ptrdiff_t dst_stride,                                     \
-    const int16_t *src0, const int16_t *src1, int w, int h, int pixel_max);                         \
+void ff_vvc_apply_bdof_avx2(uint8_t *dst, ptrdiff_t dst_stride,
+                            const int16_t *src0, const int16_t *src1,
+                            int w, int h, int pixel_max);
 
 #define OF_FUNC(bd, opt)                                                                            \
-void ff_vvc_apply_bdof_##bd##_##opt(uint8_t *dst, ptrdiff_t dst_stride,                             \
+static void vvc_apply_bdof_##bd##_##opt(uint8_t *dst, ptrdiff_t dst_stride,                         \
     const int16_t *src0, const int16_t *src1, int w, int h)                                         \
 {                                                                                                   \
     ff_vvc_apply_bdof##_##opt(dst, dst_stride, src0, src1, w, h, (1 << bd)  - 1);                   \
@@ -93,6 +86,8 @@ void ff_vvc_apply_bdof_##bd##_##opt(uint8_t *dst, ptrdiff_t dst_stride,
 OF_FUNC( 8, avx2)
 OF_FUNC(10, avx2)
 OF_FUNC(12, avx2)
+
+#define OF_INIT(bd) c->inter.apply_bdof = vvc_apply_bdof_##bd##_avx2
 #endif
 
 #define ALF_BPC_PROTOTYPES(bpc, opt)                                                                                     \
@@ -321,10 +316,6 @@ ALF_FUNCS(16, 12, avx2)
     c->inter.dmvr[1][1]   = ff_vvc_dmvr_hv_##bd##_avx2;              \
 } while (0)
 
-#define OF_INIT(bd) do {                                             \
-    c->inter.apply_bdof   = ff_vvc_apply_bdof_##bd##_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;    \
-- 
2.45.2


[-- Attachment #4: 0003-avcodec-x86-vvc-dsp_init-Make-alf-wrappers-static.patch --]
[-- Type: text/x-patch, Size: 5511 bytes --]

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


[-- Attachment #5: 0004-avcodec-x86-vvc-dsp_init-Make-avg-wrappers-static.patch --]
[-- Type: text/x-patch, Size: 3770 bytes --]

From a84b2fac4b68fa5103a7648c67b90bc4f9f26f83 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 12:45:43 +0200
Subject: [PATCH 04/23] avcodec/x86/vvc/dsp_init: Make avg wrappers static

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

diff --git a/libavcodec/x86/vvc/dsp_init.c b/libavcodec/x86/vvc/dsp_init.c
index 2bc0ed1f7f..dc833bb0f1 100644
--- a/libavcodec/x86/vvc/dsp_init.c
+++ b/libavcodec/x86/vvc/dsp_init.c
@@ -42,21 +42,9 @@ void BF(ff_vvc_w_avg, bpc, opt)(uint8_t *dst, ptrdiff_t dst_stride,
     const int16_t *src0, const int16_t *src1, intptr_t width, intptr_t height,                       \
     intptr_t denom, intptr_t w0, intptr_t w1,  intptr_t o0, intptr_t o1, intptr_t pixel_max);
 
-#define AVG_PROTOTYPES(bd, opt)                                                                      \
-void bf(ff_vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,                                     \
-    const int16_t *src0, const int16_t *src1, int width, int height);                                \
-void bf(ff_vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,                                   \
-    const int16_t *src0, const int16_t *src1, int width, int height,                                 \
-    int denom, int w0, int w1, int o0, int o1);
-
 AVG_BPC_PROTOTYPES( 8, avx2)
 AVG_BPC_PROTOTYPES(16, avx2)
 
-AVG_PROTOTYPES( 8, avx2)
-AVG_PROTOTYPES(10, avx2)
-AVG_PROTOTYPES(12, avx2)
-
-
 #define DMVR_PROTOTYPES(bd, opt)                                                                    \
 void ff_vvc_dmvr_##bd##_##opt(int16_t *dst, const uint8_t *src, ptrdiff_t src_stride,               \
      int height, intptr_t mx, intptr_t my, int width);                                              \
@@ -183,12 +171,12 @@ FW_PUT_16BPC_AVX2(10)
 FW_PUT_16BPC_AVX2(12)
 
 #define AVG_FUNCS(bpc, bd, opt)                                                                     \
-void bf(ff_vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,                                    \
+static void bf(vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,                                \
     const int16_t *src0, const int16_t *src1, int width, int height)                                \
 {                                                                                                   \
     BF(ff_vvc_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height, (1 << bd)  - 1);           \
 }                                                                                                   \
-void bf(ff_vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,                                  \
+static void bf(vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,                              \
     const int16_t *src0, const int16_t *src1, int width, int height,                                \
     int denom, int w0, int w1, int o0, int o1)                                                      \
 {                                                                                                   \
@@ -293,8 +281,8 @@ ALF_FUNCS(16, 12, avx2)
     MC_TAP_LINKS_16BPC_AVX2(CHROMA, 4, bd);
 
 #define AVG_INIT(bd, opt) do {                                       \
-    c->inter.avg    = bf(ff_vvc_avg, bd, opt);                       \
-    c->inter.w_avg  = bf(ff_vvc_w_avg, bd, opt);                     \
+    c->inter.avg    = bf(vvc_avg, bd, opt);                          \
+    c->inter.w_avg  = bf(vvc_w_avg, bd, opt);                        \
 } while (0)
 
 #define DMVR_INIT(bd) do {                                           \
-- 
2.45.2


[-- Attachment #6: 0005-avcodec-celp_math-Reuse-ff_scalarproduct_float_c.patch --]
[-- Type: text/x-patch, Size: 2883 bytes --]

From b4521c9fdf9e3af549a1738d2bff35dd421ad66d Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 13:35:16 +0200
Subject: [PATCH 05/23] avcodec/celp_math: Reuse ff_scalarproduct_float_c()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/celp_math.c       | 14 ++------------
 libavcodec/celp_math.h       | 10 ----------
 libavcodec/tests/celp_math.c | 11 +++++++++--
 3 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/libavcodec/celp_math.c b/libavcodec/celp_math.c
index a5fe7f2ea9..39220a883a 100644
--- a/libavcodec/celp_math.c
+++ b/libavcodec/celp_math.c
@@ -24,6 +24,7 @@
 
 #include "config.h"
 #include "libavutil/avassert.h"
+#include "libavutil/float_dsp.h"
 #include "libavutil/intmath.h"
 #include "mathops.h"
 #include "celp_math.h"
@@ -107,20 +108,9 @@ int64_t ff_dot_product(const int16_t *a, const int16_t *b, int length)
     return sum;
 }
 
-float ff_dot_productf(const float* a, const float* b, int length)
-{
-    float sum = 0;
-    int i;
-
-    for(i=0; i<length; i++)
-        sum += a[i] * b[i];
-
-    return sum;
-}
-
 void ff_celp_math_init(CELPMContext *c)
 {
-    c->dot_productf   = ff_dot_productf;
+    c->dot_productf = ff_scalarproduct_float_c;
 
 #if HAVE_MIPSFPU
     ff_celp_math_init_mips(c);
diff --git a/libavcodec/celp_math.h b/libavcodec/celp_math.h
index 99a0470719..8228d560e0 100644
--- a/libavcodec/celp_math.h
+++ b/libavcodec/celp_math.h
@@ -84,14 +84,4 @@ static inline unsigned bidir_sal(unsigned value, int offset)
     else           return value <<  offset;
 }
 
-/**
- * Return the dot product.
- * @param a input data array
- * @param b input data array
- * @param length number of elements
- *
- * @return dot product = sum of elementwise products
- */
-float ff_dot_productf(const float* a, const float* b, int length);
-
 #endif /* AVCODEC_CELP_MATH_H */
diff --git a/libavcodec/tests/celp_math.c b/libavcodec/tests/celp_math.c
index 669ea70362..115817894f 100644
--- a/libavcodec/tests/celp_math.c
+++ b/libavcodec/tests/celp_math.c
@@ -16,8 +16,15 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <math.h>
+#include <stdint.h>
+
+#include "libavutil/avassert.h"
+#include "libavutil/float_dsp.h"
 #include "libavutil/libm.h"
-#include "libavcodec/celp_math.c"
+#include "libavutil/macros.h"
+
+#include "libavcodec/celp_math.h"
 
 static inline void IsAlmostEqual(float A, float B, float epsilon)
 {
@@ -36,7 +43,7 @@ int main(void)
     const int16_t i1[3] = {6,  7,  8};
     const int16_t i2[3] = {9, 10, 11};
 
-    float   r = ff_dot_productf(f1, f2, FF_ARRAY_ELEMS(f1));
+    float   r = ff_scalarproduct_float_c(f1, f2, FF_ARRAY_ELEMS(f1));
     int64_t d = ff_dot_product(i1, i2, FF_ARRAY_ELEMS(i1));
 
     IsAlmostEqual(16.94f, r, 0.000001f);
-- 
2.45.2


[-- Attachment #7: 0006-avcodec-lsp-Make-ff_acelp_lsp2lpc-static.patch --]
[-- Type: text/x-patch, Size: 2348 bytes --]

From 77006973e417e13024e014798d14f0506f71ca20 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 13:42:57 +0200
Subject: [PATCH 06/23] avcodec/lsp: Make ff_acelp_lsp2lpc() static

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/lsp.c | 12 +++++++++---
 libavcodec/lsp.h |  8 --------
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/libavcodec/lsp.c b/libavcodec/lsp.c
index 275984097d..4eaeb2bfc2 100644
--- a/libavcodec/lsp.c
+++ b/libavcodec/lsp.c
@@ -150,7 +150,13 @@ static void lsp2polyf(const double *lsp, double *f, int lp_half_order)
 }
 #endif /* lsp2polyf */
 
-void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order)
+/**
+ * @brief LSP to LP conversion (3.2.6 of G.729)
+ * @param[out] lp decoded LP coefficients (-0x8000 <= (3.12) < 0x8000)
+ * @param lsp LSP coefficients (-0x8000 <= (0.15) < 0x8000)
+ * @param lp_half_order LP filter order, divided by 2
+ */
+static void acelp_lsp2lpc(int16_t lp[], const int16_t lsp[], int lp_half_order)
 {
     int i;
     int f1[MAX_LP_HALF_ORDER+1]; // (3.22)
@@ -211,10 +217,10 @@ void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd
         lsp_1st[i] = (lsp_2nd[i] + lsp_prev[i]) >> 1;
 #endif
 
-    ff_acelp_lsp2lpc(lp_1st, lsp_1st, lp_order >> 1);
+    acelp_lsp2lpc(lp_1st, lsp_1st, lp_order >> 1);
 
     /* LSP values for second subframe (3.2.5 of G.729)*/
-    ff_acelp_lsp2lpc(lp_2nd, lsp_2nd, lp_order >> 1);
+    acelp_lsp2lpc(lp_2nd, lsp_2nd, lp_order >> 1);
 }
 
 void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order)
diff --git a/libavcodec/lsp.h b/libavcodec/lsp.h
index 26b1382eda..17126a43ce 100644
--- a/libavcodec/lsp.h
+++ b/libavcodec/lsp.h
@@ -67,14 +67,6 @@ void ff_acelp_lsf2lsp(int16_t *lsp, const int16_t *lsf, int lp_order);
  */
 void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order);
 
-/**
- * @brief LSP to LP conversion (3.2.6 of G.729)
- * @param[out] lp decoded LP coefficients (-0x8000 <= (3.12) < 0x8000)
- * @param lsp LSP coefficients (-0x8000 <= (0.15) < 0x8000)
- * @param lp_half_order LP filter order, divided by 2
- */
-void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order);
-
 /**
  * LSP to LP conversion (5.2.4 of AMR-WB)
  */
-- 
2.45.2


[-- Attachment #8: 0007-avcodec-celp_math-Mark-ff_celp_math_init-as-av_cold.patch --]
[-- Type: text/x-patch, Size: 2019 bytes --]

From 972d3b9d5504aea192d7629844b55f35ccf5defb Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 13:45:54 +0200
Subject: [PATCH 07/23] avcodec/celp_math: Mark ff_celp_math_init() as av_cold

Also do the same for ff_celp_math_init_mips().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/celp_math.c           | 7 +++++--
 libavcodec/mips/celp_math_mips.c | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/celp_math.c b/libavcodec/celp_math.c
index 39220a883a..658937dccc 100644
--- a/libavcodec/celp_math.c
+++ b/libavcodec/celp_math.c
@@ -23,13 +23,16 @@
 #include <stdint.h>
 
 #include "config.h"
-#include "libavutil/avassert.h"
+
+#include "libavutil/attributes.h"
 #include "libavutil/float_dsp.h"
 #include "libavutil/intmath.h"
 #include "mathops.h"
 #include "celp_math.h"
 
 #ifdef G729_BITEXACT
+#include "libavutil/avassert.h"
+
 static const uint16_t exp2a[]=
 {
      0,  1435,  2901,  4400,  5931,  7496,  9096, 10730,
@@ -108,7 +111,7 @@ int64_t ff_dot_product(const int16_t *a, const int16_t *b, int length)
     return sum;
 }
 
-void ff_celp_math_init(CELPMContext *c)
+av_cold void ff_celp_math_init(CELPMContext *c)
 {
     c->dot_productf = ff_scalarproduct_float_c;
 
diff --git a/libavcodec/mips/celp_math_mips.c b/libavcodec/mips/celp_math_mips.c
index ce711bd63c..1c41ce56d3 100644
--- a/libavcodec/mips/celp_math_mips.c
+++ b/libavcodec/mips/celp_math_mips.c
@@ -53,6 +53,7 @@
  */
 #include "config.h"
 #include "libavcodec/celp_math.h"
+#include "libavutil/attributes.h"
 #include "libavutil/mips/asmdefs.h"
 
 #if HAVE_INLINE_ASM
@@ -84,7 +85,7 @@ static float ff_dot_productf_mips(const float* a, const float* b,
 #endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
 #endif /* HAVE_INLINE_ASM */
 
-void ff_celp_math_init_mips(CELPMContext *c)
+av_cold void ff_celp_math_init_mips(CELPMContext *c)
 {
 #if HAVE_INLINE_ASM
 #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
-- 
2.45.2


[-- Attachment #9: 0008-avcodec-x86-hevc-mc-Remove-unused-functions.patch --]
[-- Type: text/x-patch, Size: 3409 bytes --]

From 102be2836915b957e5d52fc3cd4172801cd78ba4 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 20:26:19 +0200
Subject: [PATCH 08/23] avcodec/x86/hevc/mc: Remove unused functions

Saved 11536B here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/x86/hevc/mc.asm | 18 ------------------
 libavcodec/x86/hevcdsp.h   |  1 -
 2 files changed, 19 deletions(-)

diff --git a/libavcodec/x86/hevc/mc.asm b/libavcodec/x86/hevc/mc.asm
index ad4c4adc2e..550f7a0e23 100644
--- a/libavcodec/x86/hevc/mc.asm
+++ b/libavcodec/x86/hevc/mc.asm
@@ -1170,39 +1170,32 @@ cglobal hevc_put_bi_w%1_%2, 4, 6, 10, dst, dststride, src, src2, height, denom,
 
 INIT_XMM sse4                                    ; adds ff_ and _sse4 to function name
 
-WEIGHTING_FUNCS 2, 8
 WEIGHTING_FUNCS 4, 8
 WEIGHTING_FUNCS 6, 8
 WEIGHTING_FUNCS 8, 8
 
-WEIGHTING_FUNCS 2, 10
 WEIGHTING_FUNCS 4, 10
 WEIGHTING_FUNCS 6, 10
 WEIGHTING_FUNCS 8, 10
 
-WEIGHTING_FUNCS 2, 12
 WEIGHTING_FUNCS 4, 12
 WEIGHTING_FUNCS 6, 12
 WEIGHTING_FUNCS 8, 12
 
-HEVC_BI_PEL_PIXELS  2, 8
 HEVC_BI_PEL_PIXELS  4, 8
 HEVC_BI_PEL_PIXELS  6, 8
 HEVC_BI_PEL_PIXELS  8, 8
 HEVC_BI_PEL_PIXELS 12, 8
 HEVC_BI_PEL_PIXELS 16, 8
 
-HEVC_BI_PEL_PIXELS 2, 10
 HEVC_BI_PEL_PIXELS 4, 10
 HEVC_BI_PEL_PIXELS 6, 10
 HEVC_BI_PEL_PIXELS 8, 10
 
-HEVC_BI_PEL_PIXELS 2, 12
 HEVC_BI_PEL_PIXELS 4, 12
 HEVC_BI_PEL_PIXELS 6, 12
 HEVC_BI_PEL_PIXELS 8, 12
 
-HEVC_PUT_HEVC_EPEL 2,  8
 HEVC_PUT_HEVC_EPEL 4,  8
 HEVC_PUT_HEVC_EPEL 6,  8
 HEVC_PUT_HEVC_EPEL 8,  8
@@ -1210,28 +1203,23 @@ HEVC_PUT_HEVC_EPEL 12, 8
 HEVC_PUT_HEVC_EPEL 16, 8
 
 
-HEVC_PUT_HEVC_EPEL 2, 10
 HEVC_PUT_HEVC_EPEL 4, 10
 HEVC_PUT_HEVC_EPEL 6, 10
 HEVC_PUT_HEVC_EPEL 8, 10
 
-HEVC_PUT_HEVC_EPEL 2, 12
 HEVC_PUT_HEVC_EPEL 4, 12
 HEVC_PUT_HEVC_EPEL 6, 12
 HEVC_PUT_HEVC_EPEL 8, 12
 
-HEVC_PUT_HEVC_EPEL_HV 2,  8
 HEVC_PUT_HEVC_EPEL_HV 4,  8
 HEVC_PUT_HEVC_EPEL_HV 6,  8
 HEVC_PUT_HEVC_EPEL_HV 8,  8
 HEVC_PUT_HEVC_EPEL_HV 16, 8
 
-HEVC_PUT_HEVC_EPEL_HV 2, 10
 HEVC_PUT_HEVC_EPEL_HV 4, 10
 HEVC_PUT_HEVC_EPEL_HV 6, 10
 HEVC_PUT_HEVC_EPEL_HV 8, 10
 
-HEVC_PUT_HEVC_EPEL_HV 2, 12
 HEVC_PUT_HEVC_EPEL_HV 4, 12
 HEVC_PUT_HEVC_EPEL_HV 6, 12
 HEVC_PUT_HEVC_EPEL_HV 8, 12
@@ -1247,19 +1235,13 @@ HEVC_PUT_HEVC_QPEL 8, 10
 HEVC_PUT_HEVC_QPEL 4, 12
 HEVC_PUT_HEVC_QPEL 8, 12
 
-HEVC_PUT_HEVC_QPEL_HV 2, 8
 HEVC_PUT_HEVC_QPEL_HV 4, 8
-HEVC_PUT_HEVC_QPEL_HV 6, 8
 HEVC_PUT_HEVC_QPEL_HV 8, 8
 
-HEVC_PUT_HEVC_QPEL_HV 2, 10
 HEVC_PUT_HEVC_QPEL_HV 4, 10
-HEVC_PUT_HEVC_QPEL_HV 6, 10
 HEVC_PUT_HEVC_QPEL_HV 8, 10
 
-HEVC_PUT_HEVC_QPEL_HV 2, 12
 HEVC_PUT_HEVC_QPEL_HV 4, 12
-HEVC_PUT_HEVC_QPEL_HV 6, 12
 HEVC_PUT_HEVC_QPEL_HV 8, 12
 
 %if HAVE_AVX2_EXTERNAL
diff --git a/libavcodec/x86/hevcdsp.h b/libavcodec/x86/hevcdsp.h
index d596f9e50c..8be3c00750 100644
--- a/libavcodec/x86/hevcdsp.h
+++ b/libavcodec/x86/hevcdsp.h
@@ -75,7 +75,6 @@ void ff_hevc_put_uni_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride
 void ff_hevc_put_bi_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const int16_t *_src, const int16_t *_src2, int height, int denom,  int _wx0,  int _wx1, int _ox0, int _ox1)
 
 #define WEIGHTING_PROTOTYPES(bitd, opt) \
-        WEIGHTING_PROTOTYPE(2, bitd, opt); \
         WEIGHTING_PROTOTYPE(4, bitd, opt); \
         WEIGHTING_PROTOTYPE(6, bitd, opt); \
         WEIGHTING_PROTOTYPE(8, bitd, opt); \
-- 
2.45.2


[-- Attachment #10: 0009-avcodec-x86-hevc-dsp_init-Make-ff_hevc_put_uni_w_-fu.patch --]
[-- Type: text/x-patch, Size: 6980 bytes --]

From 5319b785a674b213f4e6c154e9fa4b6a79eaff06 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 15:25:28 +0200
Subject: [PATCH 09/23] avcodec/x86/hevc/dsp_init: Make ff_hevc_put_uni_w_*
 functions static

These are always C functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/x86/hevc/dsp_init.c | 22 ++++++++++++++--------
 libavcodec/x86/hevcdsp.h       |  3 +--
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/libavcodec/x86/hevc/dsp_init.c b/libavcodec/x86/hevc/dsp_init.c
index 015d5ac63e..802eb58fc0 100644
--- a/libavcodec/x86/hevc/dsp_init.c
+++ b/libavcodec/x86/hevc/dsp_init.c
@@ -608,11 +608,11 @@ mc_rep_bi_w(12, 8, 48, sse4)
 mc_rep_bi_w(12, 8, 64, sse4)
 
 #define mc_uni_w_func(name, bitd, W, opt) \
-void ff_hevc_put_uni_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _dststride,              \
-                                                  const uint8_t *_src, ptrdiff_t _srcstride,        \
-                                                  int height, int denom,                            \
-                                                  int _wx, int _ox,                                 \
-                                                  intptr_t mx, intptr_t my, int width)              \
+static void hevc_put_uni_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _dststride,          \
+                                                      const uint8_t *_src, ptrdiff_t _srcstride,    \
+                                                      int height, int denom,                        \
+                                                      int _wx, int _ox,                             \
+                                                      intptr_t mx, intptr_t my, int width)          \
 {                                                                                                   \
     LOCAL_ALIGNED_16(int16_t, temp, [71 * MAX_PB_SIZE]);                                            \
     ff_hevc_put_##name##W##_##bitd##_##opt(temp, _src, _srcstride, height, mx, my, width);          \
@@ -843,7 +843,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             }
             SAO_EDGE_INIT(8, ssse3);
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+#if HAVE_SSE4_EXTERNAL && ARCH_X86_64
+        if (EXTERNAL_SSE4(cpu_flags)) {
 
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels,  8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,      8, sse4);
@@ -855,6 +856,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     8, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    8, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_avx;
@@ -1015,7 +1017,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_ssse3;
             c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+#if HAVE_SSE4_EXTERNAL && ARCH_X86_64
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     10, sse4);
@@ -1026,6 +1029,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     10, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    10, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_avx;
@@ -1220,7 +1224,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_ssse3;
             c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+#if HAVE_SSE4_EXTERNAL && ARCH_X86_64
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     12, sse4);
@@ -1231,6 +1236,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     12, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    12, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_avx;
diff --git a/libavcodec/x86/hevcdsp.h b/libavcodec/x86/hevcdsp.h
index 8be3c00750..f68d07d1b1 100644
--- a/libavcodec/x86/hevcdsp.h
+++ b/libavcodec/x86/hevcdsp.h
@@ -33,7 +33,7 @@
 dst[idx1][idx2][idx3] = ff_hevc_put_ ## name ## _ ## D ## _##opt;      \
 dst ## _bi[idx1][idx2][idx3] = ff_hevc_put_bi_ ## name ## _ ## D ## _##opt;      \
 dst ## _uni[idx1][idx2][idx3] = ff_hevc_put_uni_ ## name ## _ ## D ## _##opt;      \
-dst ## _uni_w[idx1][idx2][idx3] = ff_hevc_put_uni_w_ ## name ## _ ## D ## _##opt;      \
+dst ## _uni_w[idx1][idx2][idx3] = hevc_put_uni_w_ ## name ## _ ## D ## _##opt;      \
 dst ## _bi_w[idx1][idx2][idx3] = ff_hevc_put_bi_w_ ## name ## _ ## D ## _##opt
 
 
@@ -41,7 +41,6 @@ dst ## _bi_w[idx1][idx2][idx3] = ff_hevc_put_bi_w_ ## name ## _ ## D ## _##opt
 void ff_hevc_put_ ## name ## _ ## D ## _##opt(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);      \
 void ff_hevc_put_bi_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);      \
 void ff_hevc_put_uni_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);      \
-void ff_hevc_put_uni_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);      \
 void ff_hevc_put_bi_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width)
 
 
-- 
2.45.2


[-- Attachment #11: 0010-avcodec-x86-hevc-dsp_init-Make-ff_hevc_put_bi_w_-fun.patch --]
[-- Type: text/x-patch, Size: 4022 bytes --]

From f223ec2f4cbe540a8b5ccf8d7994cb6522db6716 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 15:36:30 +0200
Subject: [PATCH 10/23] avcodec/x86/hevc/dsp_init: Make ff_hevc_put_bi_w_*
 functions static

They are always C wrappers around other functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/x86/hevc/dsp_init.c | 12 ++++++------
 libavcodec/x86/hevcdsp.h       |  3 +--
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/libavcodec/x86/hevc/dsp_init.c b/libavcodec/x86/hevc/dsp_init.c
index 802eb58fc0..b9b4837461 100644
--- a/libavcodec/x86/hevc/dsp_init.c
+++ b/libavcodec/x86/hevc/dsp_init.c
@@ -666,12 +666,12 @@ mc_uni_w_funcs(qpel_v, 12, sse4)
 mc_uni_w_funcs(qpel_hv, 12, sse4)
 
 #define mc_bi_w_func(name, bitd, W, opt) \
-void ff_hevc_put_bi_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _dststride,                \
-                                                 const uint8_t *_src, ptrdiff_t _srcstride,          \
-                                                 const int16_t *_src2,                               \
-                                                 int height, int denom,                              \
-                                                 int _wx0, int _wx1, int _ox0, int _ox1,             \
-                                                 intptr_t mx, intptr_t my, int width)                \
+static void hevc_put_bi_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _dststride,            \
+                                                     const uint8_t *_src, ptrdiff_t _srcstride,      \
+                                                     const int16_t *_src2,                           \
+                                                     int height, int denom,                          \
+                                                     int _wx0, int _wx1, int _ox0, int _ox1,         \
+                                                     intptr_t mx, intptr_t my, int width)            \
 {                                                                                                    \
     LOCAL_ALIGNED_16(int16_t, temp, [71 * MAX_PB_SIZE]);                                             \
     ff_hevc_put_##name##W##_##bitd##_##opt(temp, _src, _srcstride, height, mx, my, width);           \
diff --git a/libavcodec/x86/hevcdsp.h b/libavcodec/x86/hevcdsp.h
index f68d07d1b1..2627585bda 100644
--- a/libavcodec/x86/hevcdsp.h
+++ b/libavcodec/x86/hevcdsp.h
@@ -34,14 +34,13 @@ dst[idx1][idx2][idx3] = ff_hevc_put_ ## name ## _ ## D ## _##opt;      \
 dst ## _bi[idx1][idx2][idx3] = ff_hevc_put_bi_ ## name ## _ ## D ## _##opt;      \
 dst ## _uni[idx1][idx2][idx3] = ff_hevc_put_uni_ ## name ## _ ## D ## _##opt;      \
 dst ## _uni_w[idx1][idx2][idx3] = hevc_put_uni_w_ ## name ## _ ## D ## _##opt;      \
-dst ## _bi_w[idx1][idx2][idx3] = ff_hevc_put_bi_w_ ## name ## _ ## D ## _##opt
+dst ## _bi_w[idx1][idx2][idx3] = hevc_put_bi_w_ ## name ## _ ## D ## _##opt
 
 
 #define PEL_PROTOTYPE(name, D, opt) \
 void ff_hevc_put_ ## name ## _ ## D ## _##opt(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);      \
 void ff_hevc_put_bi_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);      \
 void ff_hevc_put_uni_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);      \
-void ff_hevc_put_bi_w_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width)
 
 
 ///////////////////////////////////////////////////////////////////////////////
-- 
2.45.2


[-- Attachment #12: 0011-avcodec-x86-hevc-dsp_init-Make-ff_hevc_put_uni_-qe-p.patch --]
[-- Type: text/x-patch, Size: 28802 bytes --]

From 1f4940ce3e6ecba1c34c760bf17a73907749a071 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 16:55:18 +0200
Subject: [PATCH 11/23] avcodec/x86/hevc/dsp_init: Make
 ff_hevc_put_uni_[qe]?pel* funcs static

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/x86/hevc/dsp_init.c | 166 +++++++++++++++++----------------
 libavcodec/x86/hevcdsp.h       |  10 +-
 2 files changed, 88 insertions(+), 88 deletions(-)

diff --git a/libavcodec/x86/hevc/dsp_init.c b/libavcodec/x86/hevc/dsp_init.c
index b9b4837461..f2ca51b6b0 100644
--- a/libavcodec/x86/hevc/dsp_init.c
+++ b/libavcodec/x86/hevc/dsp_init.c
@@ -100,7 +100,7 @@ void ff_hevc_put_ ## a ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src,
 }
 
 #define FW_PUT_UNI(p, a, b, depth, opt) \
-void ff_hevc_put_uni_ ## a ## _ ## depth ## _##opt(uint8_t *dst, ptrdiff_t dststride,                        \
+static void hevc_put_uni_ ## a ## _ ## depth ## _##opt(uint8_t *dst, ptrdiff_t dststride,                        \
                                                         const uint8_t *src, ptrdiff_t srcstride,             \
                                                         int height, intptr_t mx, intptr_t my, int width)     \
 {                                                                                                            \
@@ -203,7 +203,7 @@ void ff_hevc_put_##name##W##_##bitd##_##opt(int16_t *_dst,
     }                                                                                                           \
 }
 #define mc_rep_uni_func(name, bitd, step, W, opt) \
-void ff_hevc_put_uni_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride,                             \
+static void hevc_put_uni_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride,                         \
                                                 const uint8_t *_src, ptrdiff_t _srcstride, int height,          \
                                                 intptr_t mx, intptr_t my, int width)                            \
 {                                                                                                               \
@@ -212,7 +212,7 @@ void ff_hevc_put_uni_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststri
     for (i = 0; i < W; i += step) {                                                                             \
         const uint8_t *src = _src + (i * ((bitd + 7) / 8));                                                     \
         dst = _dst + (i * ((bitd + 7) / 8));                                                                    \
-        ff_hevc_put_uni_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride,                          \
+        hevc_put_uni_##name##step##_##bitd##_##opt(dst, dststride, src, _srcstride,                             \
                                                       height, mx, my, width);                                   \
     }                                                                                                           \
 }
@@ -247,12 +247,12 @@ void ff_hevc_put_##name##W##_##bitd##_##opt(int16_t *dst,
                                                _srcstride, height, mx, my, width);                              \
 }
 #define mc_rep_uni_func2(name, bitd, step1, step2, W, opt) \
-void ff_hevc_put_uni_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride,                              \
+static void hevc_put_uni_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride,                          \
                                                 const uint8_t *src, ptrdiff_t _srcstride, int height,           \
                                                 intptr_t mx, intptr_t my, int width)                            \
 {                                                                                                               \
-    ff_hevc_put_uni_##name##step1##_##bitd##_##opt(dst, dststride, src, _srcstride, height, mx, my, width);     \
-    ff_hevc_put_uni_##name##step2##_##bitd##_##opt(dst + (step1 * ((bitd + 7) / 8)), dststride,                 \
+    hevc_put_uni_##name##step1##_##bitd##_##opt(dst, dststride, src, _srcstride, height, mx, my, width);     \
+    hevc_put_uni_##name##step2##_##bitd##_##opt(dst + (step1 * ((bitd + 7) / 8)), dststride,                 \
                                                    src + (step1 * ((bitd + 7) / 8)), _srcstride,                \
                                                    height, mx, my, width);                                      \
 }
@@ -295,13 +295,13 @@ void ff_hevc_put_bi_##name##width1##_10_##opt1(uint8_t *dst, ptrdiff_t dststride
 }
 
 #define mc_uni_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4)                                   \
-void ff_hevc_put_uni_##name##width1##_10_##opt1(uint8_t *dst, ptrdiff_t dststride,                            \
+static void hevc_put_uni_##name##width1##_10_##opt1(uint8_t *dst, ptrdiff_t dststride,                        \
                                                 const uint8_t *src, ptrdiff_t _srcstride, int height,         \
                                                 intptr_t mx, intptr_t my, int width)                          \
 {                                                                                                             \
-    ff_hevc_put_uni_##name##width2##_10_##opt1(dst, dststride, src, _srcstride,                               \
+    hevc_put_uni_##name##width2##_10_##opt1(dst, dststride, src, _srcstride,                               \
                                                height, mx, my, width);                                        \
-    ff_hevc_put_uni_##name##width3##_10_##opt2(dst+width4, dststride, src+width4, _srcstride,                 \
+    hevc_put_uni_##name##width3##_10_##opt2(dst+width4, dststride, src+width4, _srcstride,                 \
                                                height, mx, my, width);                                        \
 }
 
@@ -331,13 +331,13 @@ void ff_hevc_put_bi_##name##width1##_8_##opt1(uint8_t *dst, ptrdiff_t dststride,
 }
 
 #define mc_uni_rep_mix_8(name, width1, width2, width3, opt1, opt2)                                            \
-void ff_hevc_put_uni_##name##width1##_8_##opt1(uint8_t *dst, ptrdiff_t dststride,                             \
+static void hevc_put_uni_##name##width1##_8_##opt1(uint8_t *dst, ptrdiff_t dststride,                             \
                                                const uint8_t *src, ptrdiff_t _srcstride, int height,          \
                                                intptr_t mx, intptr_t my, int width)                           \
 {                                                                                                             \
-    ff_hevc_put_uni_##name##width2##_8_##opt1(dst, dststride, src, _srcstride,                                \
+    hevc_put_uni_##name##width2##_8_##opt1(dst, dststride, src, _srcstride,                                \
                                               height, mx, my, width);                                         \
-    ff_hevc_put_uni_##name##width3##_8_##opt2(dst+width2, dststride, src+width2, _srcstride,                  \
+    hevc_put_uni_##name##width3##_8_##opt2(dst+width2, dststride, src+width2, _srcstride,                  \
                                               height, mx, my, width);                                         \
 }
 
@@ -365,11 +365,11 @@ mc_rep_mixs_10(qpel_v ,   24, 16, 8, avx2, sse4, 32)
 mc_rep_mixs_10(qpel_hv,   24, 16, 8, avx2, sse4, 32)
 
 
+mc_rep_funcs(pel_pixels, 8, 32, 64, avx2)
+
 mc_rep_uni_func(pel_pixels, 8, 64, 128, avx2)//used for 10bit
 mc_rep_uni_func(pel_pixels, 8, 32, 96, avx2) //used for 10bit
 
-mc_rep_funcs(pel_pixels, 8, 32, 64, avx2)
-
 mc_rep_func(pel_pixels, 10, 16, 32, avx2)
 mc_rep_func(pel_pixels, 10, 16, 48, avx2)
 mc_rep_func(pel_pixels, 10, 32, 64, avx2)
@@ -880,10 +880,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->sao_band_filter[0] = ff_hevc_sao_band_filter_8_8_avx2;
             c->sao_band_filter[1] = ff_hevc_sao_band_filter_16_8_avx2;
         }
+#if HAVE_AVX2_EXTERNAL
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
-            if (ARCH_X86_64) {
+
+#if ARCH_X86_64
                 c->put_hevc_epel[7][0][0] = ff_hevc_put_pel_pixels32_8_avx2;
                 c->put_hevc_epel[8][0][0] = ff_hevc_put_pel_pixels48_8_avx2;
                 c->put_hevc_epel[9][0][0] = ff_hevc_put_pel_pixels64_8_avx2;
@@ -892,13 +894,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel[8][0][0] = ff_hevc_put_pel_pixels48_8_avx2;
                 c->put_hevc_qpel[9][0][0] = ff_hevc_put_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_uni_pel_pixels64_8_avx2;
+            c->put_hevc_epel_uni[7][0][0] = hevc_put_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] = hevc_put_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] = hevc_put_uni_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_uni_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_uni[7][0][0] = hevc_put_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] = hevc_put_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] = hevc_put_uni_pel_pixels64_8_avx2;
 
                 c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_bi_pel_pixels32_8_avx2;
                 c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_8_avx2;
@@ -912,9 +914,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel[8][0][1] = ff_hevc_put_epel_h48_8_avx2;
                 c->put_hevc_epel[9][0][1] = ff_hevc_put_epel_h64_8_avx2;
 
-                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_uni_epel_h32_8_avx2;
-                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_uni_epel_h48_8_avx2;
-                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_uni_epel_h64_8_avx2;
+            c->put_hevc_epel_uni[7][0][1] = hevc_put_uni_epel_h32_8_avx2;
+            c->put_hevc_epel_uni[8][0][1] = hevc_put_uni_epel_h48_8_avx2;
+            c->put_hevc_epel_uni[9][0][1] = hevc_put_uni_epel_h64_8_avx2;
 
                 c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_bi_epel_h32_8_avx2;
                 c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_bi_epel_h48_8_avx2;
@@ -924,9 +926,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel[8][1][0] = ff_hevc_put_epel_v48_8_avx2;
                 c->put_hevc_epel[9][1][0] = ff_hevc_put_epel_v64_8_avx2;
 
-                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_uni_epel_v32_8_avx2;
-                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_uni_epel_v48_8_avx2;
-                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_uni_epel_v64_8_avx2;
+            c->put_hevc_epel_uni[7][1][0] = hevc_put_uni_epel_v32_8_avx2;
+            c->put_hevc_epel_uni[8][1][0] = hevc_put_uni_epel_v48_8_avx2;
+            c->put_hevc_epel_uni[9][1][0] = hevc_put_uni_epel_v64_8_avx2;
 
                 c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_bi_epel_v32_8_avx2;
                 c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_bi_epel_v48_8_avx2;
@@ -936,9 +938,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel[8][1][1] = ff_hevc_put_epel_hv48_8_avx2;
                 c->put_hevc_epel[9][1][1] = ff_hevc_put_epel_hv64_8_avx2;
 
-                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_uni_epel_hv32_8_avx2;
-                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_uni_epel_hv48_8_avx2;
-                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_uni_epel_hv64_8_avx2;
+            c->put_hevc_epel_uni[7][1][1] = hevc_put_uni_epel_hv32_8_avx2;
+            c->put_hevc_epel_uni[8][1][1] = hevc_put_uni_epel_hv48_8_avx2;
+            c->put_hevc_epel_uni[9][1][1] = hevc_put_uni_epel_hv64_8_avx2;
 
                 c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_bi_epel_hv32_8_avx2;
                 c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_bi_epel_hv48_8_avx2;
@@ -952,13 +954,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel[8][1][0] = ff_hevc_put_qpel_v48_8_avx2;
                 c->put_hevc_qpel[9][1][0] = ff_hevc_put_qpel_v64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_uni_qpel_h32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_uni_qpel_h48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_uni_qpel_h64_8_avx2;
+            c->put_hevc_qpel_uni[7][0][1] = hevc_put_uni_qpel_h32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][1] = hevc_put_uni_qpel_h48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][1] = hevc_put_uni_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_uni_qpel_v32_8_avx2;
-                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_uni_qpel_v48_8_avx2;
-                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_uni_qpel_v64_8_avx2;
+            c->put_hevc_qpel_uni[7][1][0] = hevc_put_uni_qpel_v32_8_avx2;
+            c->put_hevc_qpel_uni[8][1][0] = hevc_put_uni_qpel_v48_8_avx2;
+            c->put_hevc_qpel_uni[9][1][0] = hevc_put_uni_qpel_v64_8_avx2;
 
                 c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_bi_qpel_h32_8_avx2;
                 c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_bi_qpel_h48_8_avx2;
@@ -967,7 +969,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_bi_qpel_v32_8_avx2;
                 c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_bi_qpel_v48_8_avx2;
                 c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_bi_qpel_v64_8_avx2;
-            }
+#endif /* ARCH_X86_64 */
+
             SAO_BAND_INIT(8, avx2);
 
             c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_8_avx2;
@@ -976,6 +979,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
 
             c->add_residual[3] = ff_hevc_add_residual_32_8_avx2;
         }
+#endif /* HAVE_AVX2_EXTERNAL */
         if (EXTERNAL_AVX512ICL(cpu_flags) && ARCH_X86_64) {
             c->put_hevc_qpel[1][0][1] = ff_hevc_put_qpel_h4_8_avx512icl;
             c->put_hevc_qpel[3][0][1] = ff_hevc_put_qpel_h8_8_avx512icl;
@@ -1049,10 +1053,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_AVX2(cpu_flags)) {
             c->sao_band_filter[0] = ff_hevc_sao_band_filter_8_10_avx2;
         }
+#if HAVE_AVX2_EXTERNAL
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
-            if (ARCH_X86_64) {
+
+#if ARCH_X86_64
                 c->put_hevc_epel[5][0][0] = ff_hevc_put_pel_pixels16_10_avx2;
                 c->put_hevc_epel[6][0][0] = ff_hevc_put_pel_pixels24_10_avx2;
                 c->put_hevc_epel[7][0][0] = ff_hevc_put_pel_pixels32_10_avx2;
@@ -1065,17 +1071,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel[8][0][0] = ff_hevc_put_pel_pixels48_10_avx2;
                 c->put_hevc_qpel[9][0][0] = ff_hevc_put_pel_pixels64_10_avx2;
 
-                c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_uni_pel_pixels64_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_uni_pel_pixels96_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_uni_pel_pixels128_8_avx2;
+            c->put_hevc_epel_uni[5][0][0] = hevc_put_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[6][0][0] = hevc_put_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[7][0][0] = hevc_put_uni_pel_pixels64_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] = hevc_put_uni_pel_pixels96_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] = hevc_put_uni_pel_pixels128_8_avx2;
 
-                c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_uni_pel_pixels64_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_uni_pel_pixels96_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_uni_pel_pixels128_8_avx2;
+            c->put_hevc_qpel_uni[5][0][0] = hevc_put_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[6][0][0] = hevc_put_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[7][0][0] = hevc_put_uni_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] = hevc_put_uni_pel_pixels96_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] = hevc_put_uni_pel_pixels128_8_avx2;
 
                 c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_bi_pel_pixels16_10_avx2;
                 c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_bi_pel_pixels24_10_avx2;
@@ -1094,11 +1100,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel[8][0][1] = ff_hevc_put_epel_h48_10_avx2;
                 c->put_hevc_epel[9][0][1] = ff_hevc_put_epel_h64_10_avx2;
 
-                c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_uni_epel_h16_10_avx2;
-                c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_uni_epel_h24_10_avx2;
-                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_uni_epel_h32_10_avx2;
-                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_uni_epel_h48_10_avx2;
-                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_uni_epel_h64_10_avx2;
+            c->put_hevc_epel_uni[5][0][1] = hevc_put_uni_epel_h16_10_avx2;
+            c->put_hevc_epel_uni[6][0][1] = hevc_put_uni_epel_h24_10_avx2;
+            c->put_hevc_epel_uni[7][0][1] = hevc_put_uni_epel_h32_10_avx2;
+            c->put_hevc_epel_uni[8][0][1] = hevc_put_uni_epel_h48_10_avx2;
+            c->put_hevc_epel_uni[9][0][1] = hevc_put_uni_epel_h64_10_avx2;
 
                 c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_bi_epel_h16_10_avx2;
                 c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_bi_epel_h24_10_avx2;
@@ -1112,11 +1118,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel[8][1][0] = ff_hevc_put_epel_v48_10_avx2;
                 c->put_hevc_epel[9][1][0] = ff_hevc_put_epel_v64_10_avx2;
 
-                c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_uni_epel_v16_10_avx2;
-                c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_uni_epel_v24_10_avx2;
-                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_uni_epel_v32_10_avx2;
-                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_uni_epel_v48_10_avx2;
-                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_uni_epel_v64_10_avx2;
+            c->put_hevc_epel_uni[5][1][0] = hevc_put_uni_epel_v16_10_avx2;
+            c->put_hevc_epel_uni[6][1][0] = hevc_put_uni_epel_v24_10_avx2;
+            c->put_hevc_epel_uni[7][1][0] = hevc_put_uni_epel_v32_10_avx2;
+            c->put_hevc_epel_uni[8][1][0] = hevc_put_uni_epel_v48_10_avx2;
+            c->put_hevc_epel_uni[9][1][0] = hevc_put_uni_epel_v64_10_avx2;
 
                 c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_bi_epel_v16_10_avx2;
                 c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_bi_epel_v24_10_avx2;
@@ -1130,11 +1136,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel[8][1][1] = ff_hevc_put_epel_hv48_10_avx2;
                 c->put_hevc_epel[9][1][1] = ff_hevc_put_epel_hv64_10_avx2;
 
-                c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_uni_epel_hv16_10_avx2;
-                c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_uni_epel_hv24_10_avx2;
-                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_uni_epel_hv32_10_avx2;
-                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_uni_epel_hv48_10_avx2;
-                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_uni_epel_hv64_10_avx2;
+            c->put_hevc_epel_uni[5][1][1] = hevc_put_uni_epel_hv16_10_avx2;
+            c->put_hevc_epel_uni[6][1][1] = hevc_put_uni_epel_hv24_10_avx2;
+            c->put_hevc_epel_uni[7][1][1] = hevc_put_uni_epel_hv32_10_avx2;
+            c->put_hevc_epel_uni[8][1][1] = hevc_put_uni_epel_hv48_10_avx2;
+            c->put_hevc_epel_uni[9][1][1] = hevc_put_uni_epel_hv64_10_avx2;
 
                 c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_bi_epel_hv16_10_avx2;
                 c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_bi_epel_hv24_10_avx2;
@@ -1148,11 +1154,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel[8][0][1] = ff_hevc_put_qpel_h48_10_avx2;
                 c->put_hevc_qpel[9][0][1] = ff_hevc_put_qpel_h64_10_avx2;
 
-                c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_uni_qpel_h16_10_avx2;
-                c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_uni_qpel_h24_10_avx2;
-                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_uni_qpel_h32_10_avx2;
-                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_uni_qpel_h48_10_avx2;
-                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_uni_qpel_h64_10_avx2;
+            c->put_hevc_qpel_uni[5][0][1] = hevc_put_uni_qpel_h16_10_avx2;
+            c->put_hevc_qpel_uni[6][0][1] = hevc_put_uni_qpel_h24_10_avx2;
+            c->put_hevc_qpel_uni[7][0][1] = hevc_put_uni_qpel_h32_10_avx2;
+            c->put_hevc_qpel_uni[8][0][1] = hevc_put_uni_qpel_h48_10_avx2;
+            c->put_hevc_qpel_uni[9][0][1] = hevc_put_uni_qpel_h64_10_avx2;
 
                 c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_bi_qpel_h16_10_avx2;
                 c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_bi_qpel_h24_10_avx2;
@@ -1166,11 +1172,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel[8][1][0] = ff_hevc_put_qpel_v48_10_avx2;
                 c->put_hevc_qpel[9][1][0] = ff_hevc_put_qpel_v64_10_avx2;
 
-                c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_uni_qpel_v16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_uni_qpel_v24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_uni_qpel_v32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_uni_qpel_v48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_uni_qpel_v64_10_avx2;
+            c->put_hevc_qpel_uni[5][1][0] = hevc_put_uni_qpel_v16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][0] = hevc_put_uni_qpel_v24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][0] = hevc_put_uni_qpel_v32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][0] = hevc_put_uni_qpel_v48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][0] = hevc_put_uni_qpel_v64_10_avx2;
 
                 c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_bi_qpel_v16_10_avx2;
                 c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_bi_qpel_v24_10_avx2;
@@ -1184,24 +1190,26 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel[8][1][1] = ff_hevc_put_qpel_hv48_10_avx2;
                 c->put_hevc_qpel[9][1][1] = ff_hevc_put_qpel_hv64_10_avx2;
 
-                c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_uni_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_uni_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_uni_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_uni_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_uni_qpel_hv64_10_avx2;
+            c->put_hevc_qpel_uni[5][1][1] = hevc_put_uni_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][1] = hevc_put_uni_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][1] = hevc_put_uni_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][1] = hevc_put_uni_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][1] = hevc_put_uni_qpel_hv64_10_avx2;
 
                 c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_bi_qpel_hv16_10_avx2;
                 c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_bi_qpel_hv24_10_avx2;
                 c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_bi_qpel_hv32_10_avx2;
                 c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_bi_qpel_hv48_10_avx2;
                 c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_bi_qpel_hv64_10_avx2;
-            }
+#endif /* ARCH_X86_64 */
+
             SAO_BAND_INIT(10, avx2);
             SAO_EDGE_INIT(10, avx2);
 
             c->add_residual[2] = ff_hevc_add_residual_16_10_avx2;
             c->add_residual[3] = ff_hevc_add_residual_32_10_avx2;
         }
+#endif /* HAVE_AVX2_EXTERNAL */
     } else if (bit_depth == 12) {
         if (EXTERNAL_MMXEXT(cpu_flags)) {
             c->idct_dc[0] = ff_hevc_idct_4x4_dc_12_mmxext;
diff --git a/libavcodec/x86/hevcdsp.h b/libavcodec/x86/hevcdsp.h
index 2627585bda..4bf74ef99e 100644
--- a/libavcodec/x86/hevcdsp.h
+++ b/libavcodec/x86/hevcdsp.h
@@ -32,7 +32,7 @@
 #define PEL_LINK(dst, idx1, idx2, idx3, name, D, opt) \
 dst[idx1][idx2][idx3] = ff_hevc_put_ ## name ## _ ## D ## _##opt;      \
 dst ## _bi[idx1][idx2][idx3] = ff_hevc_put_bi_ ## name ## _ ## D ## _##opt;      \
-dst ## _uni[idx1][idx2][idx3] = ff_hevc_put_uni_ ## name ## _ ## D ## _##opt;      \
+dst ## _uni[idx1][idx2][idx3] = hevc_put_uni_ ## name ## _ ## D ## _##opt;      \
 dst ## _uni_w[idx1][idx2][idx3] = hevc_put_uni_w_ ## name ## _ ## D ## _##opt;      \
 dst ## _bi_w[idx1][idx2][idx3] = hevc_put_bi_w_ ## name ## _ ## D ## _##opt
 
@@ -40,7 +40,6 @@ dst ## _bi_w[idx1][idx2][idx3] = hevc_put_bi_w_ ## name ## _ ## D ## _##opt
 #define PEL_PROTOTYPE(name, D, opt) \
 void ff_hevc_put_ ## name ## _ ## D ## _##opt(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);      \
 void ff_hevc_put_bi_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);      \
-void ff_hevc_put_uni_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my, int width);      \
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -105,13 +104,6 @@ void ff_hevc_put_pel_pixels64_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff
 
 
 
-void ff_hevc_put_uni_pel_pixels32_8_avx2(uint8_t *dst, ptrdiff_t dststride,const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_uni_pel_pixels48_8_avx2(uint8_t *dst, ptrdiff_t dststride,const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_uni_pel_pixels64_8_avx2(uint8_t *dst, ptrdiff_t dststride,const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_uni_pel_pixels96_8_avx2(uint8_t *dst, ptrdiff_t dststride,const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width); //used for 10bit
-void ff_hevc_put_uni_pel_pixels128_8_avx2(uint8_t *dst, ptrdiff_t dststride,const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);//used for 10bit
-
-
 void ff_hevc_put_bi_pel_pixels16_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
 void ff_hevc_put_bi_pel_pixels24_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
 void ff_hevc_put_bi_pel_pixels32_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-- 
2.45.2


[-- Attachment #13: 0012-avcodec-x86-hevc-dsp_init-Make-ff_hevc_put_-eq-pel_-.patch --]
[-- Type: text/x-patch, Size: 26032 bytes --]

From 9536865ecdf388891cc754bcb5e147ad701e31dd Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 17:30:02 +0200
Subject: [PATCH 12/23] avcodec/x86/hevc/dsp_init: Make ff_hevc_put_[eq]?pel_*
 static

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/x86/hevc/dsp_init.c | 158 ++++++++++++++++-----------------
 libavcodec/x86/hevcdsp.h       |  17 +---
 2 files changed, 80 insertions(+), 95 deletions(-)

diff --git a/libavcodec/x86/hevc/dsp_init.c b/libavcodec/x86/hevc/dsp_init.c
index f2ca51b6b0..f8057dee9f 100644
--- a/libavcodec/x86/hevc/dsp_init.c
+++ b/libavcodec/x86/hevc/dsp_init.c
@@ -92,7 +92,7 @@ IDCT_FUNCS(avx)
     const uint8_t *vf = ff_hevc_ ## f ## _filters[my];
 
 #define FW_PUT(p, a, b, depth, opt) \
-void ff_hevc_put_ ## a ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,        \
+static void hevc_put_ ## a ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,    \
                                                int height, intptr_t mx, intptr_t my,int width)               \
 {                                                                                                            \
     DECL_HV_FILTER(p)                                                                                        \
@@ -190,7 +190,7 @@ FW_QPEL_HV(16, 10, avx2)
 #endif
 
 #define mc_rep_func(name, bitd, step, W, opt) \
-void ff_hevc_put_##name##W##_##bitd##_##opt(int16_t *_dst,                                                      \
+static void hevc_put_##name##W##_##bitd##_##opt(int16_t *_dst,                                                  \
                                             const uint8_t *_src, ptrdiff_t _srcstride, int height,              \
                                             intptr_t mx, intptr_t my, int width)                                \
 {                                                                                                               \
@@ -199,7 +199,7 @@ void ff_hevc_put_##name##W##_##bitd##_##opt(int16_t *_dst,
     for (i = 0; i < W; i += step) {                                                                             \
         const uint8_t *src  = _src + (i * ((bitd + 7) / 8));                                                    \
         dst = _dst + i;                                                                                         \
-        ff_hevc_put_##name##step##_##bitd##_##opt(dst, src, _srcstride, height, mx, my, width);                 \
+        hevc_put_##name##step##_##bitd##_##opt(dst, src, _srcstride, height, mx, my, width);                    \
     }                                                                                                           \
 }
 #define mc_rep_uni_func(name, bitd, step, W, opt) \
@@ -238,13 +238,13 @@ void ff_hevc_put_bi_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststrid
     mc_rep_bi_func(name, bitd, step, W, opt)
 
 #define mc_rep_func2(name, bitd, step1, step2, W, opt) \
-void ff_hevc_put_##name##W##_##bitd##_##opt(int16_t *dst,                                                       \
-                                            const uint8_t *src, ptrdiff_t _srcstride, int height,               \
-                                            intptr_t mx, intptr_t my, int width)                                \
+static void hevc_put_##name##W##_##bitd##_##opt(int16_t *dst,                                                   \
+                                                const uint8_t *src, ptrdiff_t _srcstride, int height,           \
+                                                intptr_t mx, intptr_t my, int width)                            \
 {                                                                                                               \
-    ff_hevc_put_##name##step1##_##bitd##_##opt(dst, src, _srcstride, height, mx, my, width);                    \
-    ff_hevc_put_##name##step2##_##bitd##_##opt(dst + step1, src + (step1 * ((bitd + 7) / 8)),                   \
-                                               _srcstride, height, mx, my, width);                              \
+    hevc_put_##name##step1##_##bitd##_##opt(dst, src, _srcstride, height, mx, my, width);                       \
+    hevc_put_##name##step2##_##bitd##_##opt(dst + step1, src + (step1 * ((bitd + 7) / 8)),                      \
+                                            _srcstride, height, mx, my, width);                                 \
 }
 #define mc_rep_uni_func2(name, bitd, step1, step2, W, opt) \
 static void hevc_put_uni_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride,                          \
@@ -275,12 +275,12 @@ void ff_hevc_put_bi_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride
 #if ARCH_X86_64 && HAVE_SSE4_EXTERNAL
 
 #define mc_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4)                                       \
-void ff_hevc_put_##name##width1##_10_##opt1(int16_t *dst, const uint8_t *src, ptrdiff_t _srcstride,           \
+static void hevc_put_##name##width1##_10_##opt1(int16_t *dst, const uint8_t *src, ptrdiff_t _srcstride,       \
                                             int height, intptr_t mx, intptr_t my, int width)                  \
                                                                                                               \
 {                                                                                                             \
-    ff_hevc_put_##name##width2##_10_##opt1(dst, src, _srcstride, height, mx, my, width);                      \
-    ff_hevc_put_##name##width3##_10_##opt2(dst+ width2, src+ width4, _srcstride, height, mx, my, width);      \
+    hevc_put_##name##width2##_10_##opt1(dst, src, _srcstride, height, mx, my, width);                         \
+    hevc_put_##name##width3##_10_##opt2(dst+ width2, src+ width4, _srcstride, height, mx, my, width);         \
 }
 
 #define mc_bi_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4)                                    \
@@ -311,12 +311,12 @@ mc_bi_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4)         \
 mc_uni_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4)
 
 #define mc_rep_mix_8(name, width1, width2, width3, opt1, opt2)                                                \
-void ff_hevc_put_##name##width1##_8_##opt1(int16_t *dst, const uint8_t *src, ptrdiff_t _srcstride,            \
+static void hevc_put_##name##width1##_8_##opt1(int16_t *dst, const uint8_t *src, ptrdiff_t _srcstride,        \
                                            int height, intptr_t mx, intptr_t my, int width)                   \
                                                                                                               \
 {                                                                                                             \
-    ff_hevc_put_##name##width2##_8_##opt1(dst, src, _srcstride, height, mx, my, width);                       \
-    ff_hevc_put_##name##width3##_8_##opt2(dst+ width2, src+ width2, _srcstride, height, mx, my, width);       \
+    hevc_put_##name##width2##_8_##opt1(dst, src, _srcstride, height, mx, my, width);                          \
+    hevc_put_##name##width3##_8_##opt2(dst+ width2, src+ width2, _srcstride, height, mx, my, width);          \
 }
 
 #define mc_bi_rep_mix_8(name, width1, width2, width3, opt1, opt2)                                             \
@@ -615,7 +615,7 @@ static void hevc_put_uni_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _
                                                       intptr_t mx, intptr_t my, int width)          \
 {                                                                                                   \
     LOCAL_ALIGNED_16(int16_t, temp, [71 * MAX_PB_SIZE]);                                            \
-    ff_hevc_put_##name##W##_##bitd##_##opt(temp, _src, _srcstride, height, mx, my, width);          \
+    hevc_put_##name##W##_##bitd##_##opt(temp, _src, _srcstride, height, mx, my, width);             \
     ff_hevc_put_uni_w##W##_##bitd##_##opt(_dst, _dststride, temp, height, denom, _wx, _ox);         \
 }
 
@@ -674,7 +674,7 @@ static void hevc_put_bi_w_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t _d
                                                      intptr_t mx, intptr_t my, int width)            \
 {                                                                                                    \
     LOCAL_ALIGNED_16(int16_t, temp, [71 * MAX_PB_SIZE]);                                             \
-    ff_hevc_put_##name##W##_##bitd##_##opt(temp, _src, _srcstride, height, mx, my, width);           \
+    hevc_put_##name##W##_##bitd##_##opt(temp, _src, _srcstride, height, mx, my, width);              \
     ff_hevc_put_bi_w##W##_##bitd##_##opt(_dst, _dststride, temp, _src2,                              \
                                          height, denom, _wx0, _wx1, _ox0, _ox1);                     \
 }
@@ -886,13 +886,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
 
 #if ARCH_X86_64
-                c->put_hevc_epel[7][0][0] = ff_hevc_put_pel_pixels32_8_avx2;
-                c->put_hevc_epel[8][0][0] = ff_hevc_put_pel_pixels48_8_avx2;
-                c->put_hevc_epel[9][0][0] = ff_hevc_put_pel_pixels64_8_avx2;
+            c->put_hevc_epel[7][0][0] = hevc_put_pel_pixels32_8_avx2;
+            c->put_hevc_epel[8][0][0] = hevc_put_pel_pixels48_8_avx2;
+            c->put_hevc_epel[9][0][0] = hevc_put_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel[7][0][0] = ff_hevc_put_pel_pixels32_8_avx2;
-                c->put_hevc_qpel[8][0][0] = ff_hevc_put_pel_pixels48_8_avx2;
-                c->put_hevc_qpel[9][0][0] = ff_hevc_put_pel_pixels64_8_avx2;
+            c->put_hevc_qpel[7][0][0] = hevc_put_pel_pixels32_8_avx2;
+            c->put_hevc_qpel[8][0][0] = hevc_put_pel_pixels48_8_avx2;
+            c->put_hevc_qpel[9][0][0] = hevc_put_pel_pixels64_8_avx2;
 
             c->put_hevc_epel_uni[7][0][0] = hevc_put_uni_pel_pixels32_8_avx2;
             c->put_hevc_epel_uni[8][0][0] = hevc_put_uni_pel_pixels48_8_avx2;
@@ -910,9 +910,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_8_avx2;
                 c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_bi_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel[7][0][1] = ff_hevc_put_epel_h32_8_avx2;
-                c->put_hevc_epel[8][0][1] = ff_hevc_put_epel_h48_8_avx2;
-                c->put_hevc_epel[9][0][1] = ff_hevc_put_epel_h64_8_avx2;
+            c->put_hevc_epel[7][0][1] = hevc_put_epel_h32_8_avx2;
+            c->put_hevc_epel[8][0][1] = hevc_put_epel_h48_8_avx2;
+            c->put_hevc_epel[9][0][1] = hevc_put_epel_h64_8_avx2;
 
             c->put_hevc_epel_uni[7][0][1] = hevc_put_uni_epel_h32_8_avx2;
             c->put_hevc_epel_uni[8][0][1] = hevc_put_uni_epel_h48_8_avx2;
@@ -922,9 +922,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_bi_epel_h48_8_avx2;
                 c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_bi_epel_h64_8_avx2;
 
-                c->put_hevc_epel[7][1][0] = ff_hevc_put_epel_v32_8_avx2;
-                c->put_hevc_epel[8][1][0] = ff_hevc_put_epel_v48_8_avx2;
-                c->put_hevc_epel[9][1][0] = ff_hevc_put_epel_v64_8_avx2;
+            c->put_hevc_epel[7][1][0] = hevc_put_epel_v32_8_avx2;
+            c->put_hevc_epel[8][1][0] = hevc_put_epel_v48_8_avx2;
+            c->put_hevc_epel[9][1][0] = hevc_put_epel_v64_8_avx2;
 
             c->put_hevc_epel_uni[7][1][0] = hevc_put_uni_epel_v32_8_avx2;
             c->put_hevc_epel_uni[8][1][0] = hevc_put_uni_epel_v48_8_avx2;
@@ -934,9 +934,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_bi_epel_v48_8_avx2;
                 c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_bi_epel_v64_8_avx2;
 
-                c->put_hevc_epel[7][1][1] = ff_hevc_put_epel_hv32_8_avx2;
-                c->put_hevc_epel[8][1][1] = ff_hevc_put_epel_hv48_8_avx2;
-                c->put_hevc_epel[9][1][1] = ff_hevc_put_epel_hv64_8_avx2;
+            c->put_hevc_epel[7][1][1] = hevc_put_epel_hv32_8_avx2;
+            c->put_hevc_epel[8][1][1] = hevc_put_epel_hv48_8_avx2;
+            c->put_hevc_epel[9][1][1] = hevc_put_epel_hv64_8_avx2;
 
             c->put_hevc_epel_uni[7][1][1] = hevc_put_uni_epel_hv32_8_avx2;
             c->put_hevc_epel_uni[8][1][1] = hevc_put_uni_epel_hv48_8_avx2;
@@ -946,13 +946,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_bi_epel_hv48_8_avx2;
                 c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_bi_epel_hv64_8_avx2;
 
-                c->put_hevc_qpel[7][0][1] = ff_hevc_put_qpel_h32_8_avx2;
-                c->put_hevc_qpel[8][0][1] = ff_hevc_put_qpel_h48_8_avx2;
-                c->put_hevc_qpel[9][0][1] = ff_hevc_put_qpel_h64_8_avx2;
+            c->put_hevc_qpel[7][0][1] = hevc_put_qpel_h32_8_avx2;
+            c->put_hevc_qpel[8][0][1] = hevc_put_qpel_h48_8_avx2;
+            c->put_hevc_qpel[9][0][1] = hevc_put_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel[7][1][0] = ff_hevc_put_qpel_v32_8_avx2;
-                c->put_hevc_qpel[8][1][0] = ff_hevc_put_qpel_v48_8_avx2;
-                c->put_hevc_qpel[9][1][0] = ff_hevc_put_qpel_v64_8_avx2;
+            c->put_hevc_qpel[7][1][0] = hevc_put_qpel_v32_8_avx2;
+            c->put_hevc_qpel[8][1][0] = hevc_put_qpel_v48_8_avx2;
+            c->put_hevc_qpel[9][1][0] = hevc_put_qpel_v64_8_avx2;
 
             c->put_hevc_qpel_uni[7][0][1] = hevc_put_uni_qpel_h32_8_avx2;
             c->put_hevc_qpel_uni[8][0][1] = hevc_put_uni_qpel_h48_8_avx2;
@@ -1059,17 +1059,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
 
 #if ARCH_X86_64
-                c->put_hevc_epel[5][0][0] = ff_hevc_put_pel_pixels16_10_avx2;
-                c->put_hevc_epel[6][0][0] = ff_hevc_put_pel_pixels24_10_avx2;
-                c->put_hevc_epel[7][0][0] = ff_hevc_put_pel_pixels32_10_avx2;
-                c->put_hevc_epel[8][0][0] = ff_hevc_put_pel_pixels48_10_avx2;
-                c->put_hevc_epel[9][0][0] = ff_hevc_put_pel_pixels64_10_avx2;
-
-                c->put_hevc_qpel[5][0][0] = ff_hevc_put_pel_pixels16_10_avx2;
-                c->put_hevc_qpel[6][0][0] = ff_hevc_put_pel_pixels24_10_avx2;
-                c->put_hevc_qpel[7][0][0] = ff_hevc_put_pel_pixels32_10_avx2;
-                c->put_hevc_qpel[8][0][0] = ff_hevc_put_pel_pixels48_10_avx2;
-                c->put_hevc_qpel[9][0][0] = ff_hevc_put_pel_pixels64_10_avx2;
+            c->put_hevc_epel[5][0][0] = hevc_put_pel_pixels16_10_avx2;
+            c->put_hevc_epel[6][0][0] = hevc_put_pel_pixels24_10_avx2;
+            c->put_hevc_epel[7][0][0] = hevc_put_pel_pixels32_10_avx2;
+            c->put_hevc_epel[8][0][0] = hevc_put_pel_pixels48_10_avx2;
+            c->put_hevc_epel[9][0][0] = hevc_put_pel_pixels64_10_avx2;
+
+            c->put_hevc_qpel[5][0][0] = hevc_put_pel_pixels16_10_avx2;
+            c->put_hevc_qpel[6][0][0] = hevc_put_pel_pixels24_10_avx2;
+            c->put_hevc_qpel[7][0][0] = hevc_put_pel_pixels32_10_avx2;
+            c->put_hevc_qpel[8][0][0] = hevc_put_pel_pixels48_10_avx2;
+            c->put_hevc_qpel[9][0][0] = hevc_put_pel_pixels64_10_avx2;
 
             c->put_hevc_epel_uni[5][0][0] = hevc_put_uni_pel_pixels32_8_avx2;
             c->put_hevc_epel_uni[6][0][0] = hevc_put_uni_pel_pixels48_8_avx2;
@@ -1094,11 +1094,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_10_avx2;
                 c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_bi_pel_pixels64_10_avx2;
 
-                c->put_hevc_epel[5][0][1] = ff_hevc_put_epel_h16_10_avx2;
-                c->put_hevc_epel[6][0][1] = ff_hevc_put_epel_h24_10_avx2;
-                c->put_hevc_epel[7][0][1] = ff_hevc_put_epel_h32_10_avx2;
-                c->put_hevc_epel[8][0][1] = ff_hevc_put_epel_h48_10_avx2;
-                c->put_hevc_epel[9][0][1] = ff_hevc_put_epel_h64_10_avx2;
+            c->put_hevc_epel[5][0][1] = hevc_put_epel_h16_10_avx2;
+            c->put_hevc_epel[6][0][1] = hevc_put_epel_h24_10_avx2;
+            c->put_hevc_epel[7][0][1] = hevc_put_epel_h32_10_avx2;
+            c->put_hevc_epel[8][0][1] = hevc_put_epel_h48_10_avx2;
+            c->put_hevc_epel[9][0][1] = hevc_put_epel_h64_10_avx2;
 
             c->put_hevc_epel_uni[5][0][1] = hevc_put_uni_epel_h16_10_avx2;
             c->put_hevc_epel_uni[6][0][1] = hevc_put_uni_epel_h24_10_avx2;
@@ -1112,11 +1112,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_bi_epel_h48_10_avx2;
                 c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_bi_epel_h64_10_avx2;
 
-                c->put_hevc_epel[5][1][0] = ff_hevc_put_epel_v16_10_avx2;
-                c->put_hevc_epel[6][1][0] = ff_hevc_put_epel_v24_10_avx2;
-                c->put_hevc_epel[7][1][0] = ff_hevc_put_epel_v32_10_avx2;
-                c->put_hevc_epel[8][1][0] = ff_hevc_put_epel_v48_10_avx2;
-                c->put_hevc_epel[9][1][0] = ff_hevc_put_epel_v64_10_avx2;
+            c->put_hevc_epel[5][1][0] = hevc_put_epel_v16_10_avx2;
+            c->put_hevc_epel[6][1][0] = hevc_put_epel_v24_10_avx2;
+            c->put_hevc_epel[7][1][0] = hevc_put_epel_v32_10_avx2;
+            c->put_hevc_epel[8][1][0] = hevc_put_epel_v48_10_avx2;
+            c->put_hevc_epel[9][1][0] = hevc_put_epel_v64_10_avx2;
 
             c->put_hevc_epel_uni[5][1][0] = hevc_put_uni_epel_v16_10_avx2;
             c->put_hevc_epel_uni[6][1][0] = hevc_put_uni_epel_v24_10_avx2;
@@ -1130,11 +1130,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_bi_epel_v48_10_avx2;
                 c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_bi_epel_v64_10_avx2;
 
-                c->put_hevc_epel[5][1][1] = ff_hevc_put_epel_hv16_10_avx2;
-                c->put_hevc_epel[6][1][1] = ff_hevc_put_epel_hv24_10_avx2;
-                c->put_hevc_epel[7][1][1] = ff_hevc_put_epel_hv32_10_avx2;
-                c->put_hevc_epel[8][1][1] = ff_hevc_put_epel_hv48_10_avx2;
-                c->put_hevc_epel[9][1][1] = ff_hevc_put_epel_hv64_10_avx2;
+            c->put_hevc_epel[5][1][1] = hevc_put_epel_hv16_10_avx2;
+            c->put_hevc_epel[6][1][1] = hevc_put_epel_hv24_10_avx2;
+            c->put_hevc_epel[7][1][1] = hevc_put_epel_hv32_10_avx2;
+            c->put_hevc_epel[8][1][1] = hevc_put_epel_hv48_10_avx2;
+            c->put_hevc_epel[9][1][1] = hevc_put_epel_hv64_10_avx2;
 
             c->put_hevc_epel_uni[5][1][1] = hevc_put_uni_epel_hv16_10_avx2;
             c->put_hevc_epel_uni[6][1][1] = hevc_put_uni_epel_hv24_10_avx2;
@@ -1148,11 +1148,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_bi_epel_hv48_10_avx2;
                 c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_bi_epel_hv64_10_avx2;
 
-                c->put_hevc_qpel[5][0][1] = ff_hevc_put_qpel_h16_10_avx2;
-                c->put_hevc_qpel[6][0][1] = ff_hevc_put_qpel_h24_10_avx2;
-                c->put_hevc_qpel[7][0][1] = ff_hevc_put_qpel_h32_10_avx2;
-                c->put_hevc_qpel[8][0][1] = ff_hevc_put_qpel_h48_10_avx2;
-                c->put_hevc_qpel[9][0][1] = ff_hevc_put_qpel_h64_10_avx2;
+            c->put_hevc_qpel[5][0][1] = hevc_put_qpel_h16_10_avx2;
+            c->put_hevc_qpel[6][0][1] = hevc_put_qpel_h24_10_avx2;
+            c->put_hevc_qpel[7][0][1] = hevc_put_qpel_h32_10_avx2;
+            c->put_hevc_qpel[8][0][1] = hevc_put_qpel_h48_10_avx2;
+            c->put_hevc_qpel[9][0][1] = hevc_put_qpel_h64_10_avx2;
 
             c->put_hevc_qpel_uni[5][0][1] = hevc_put_uni_qpel_h16_10_avx2;
             c->put_hevc_qpel_uni[6][0][1] = hevc_put_uni_qpel_h24_10_avx2;
@@ -1166,11 +1166,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_bi_qpel_h48_10_avx2;
                 c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_bi_qpel_h64_10_avx2;
 
-                c->put_hevc_qpel[5][1][0] = ff_hevc_put_qpel_v16_10_avx2;
-                c->put_hevc_qpel[6][1][0] = ff_hevc_put_qpel_v24_10_avx2;
-                c->put_hevc_qpel[7][1][0] = ff_hevc_put_qpel_v32_10_avx2;
-                c->put_hevc_qpel[8][1][0] = ff_hevc_put_qpel_v48_10_avx2;
-                c->put_hevc_qpel[9][1][0] = ff_hevc_put_qpel_v64_10_avx2;
+            c->put_hevc_qpel[5][1][0] = hevc_put_qpel_v16_10_avx2;
+            c->put_hevc_qpel[6][1][0] = hevc_put_qpel_v24_10_avx2;
+            c->put_hevc_qpel[7][1][0] = hevc_put_qpel_v32_10_avx2;
+            c->put_hevc_qpel[8][1][0] = hevc_put_qpel_v48_10_avx2;
+            c->put_hevc_qpel[9][1][0] = hevc_put_qpel_v64_10_avx2;
 
             c->put_hevc_qpel_uni[5][1][0] = hevc_put_uni_qpel_v16_10_avx2;
             c->put_hevc_qpel_uni[6][1][0] = hevc_put_uni_qpel_v24_10_avx2;
@@ -1184,11 +1184,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_bi_qpel_v48_10_avx2;
                 c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_bi_qpel_v64_10_avx2;
 
-                c->put_hevc_qpel[5][1][1] = ff_hevc_put_qpel_hv16_10_avx2;
-                c->put_hevc_qpel[6][1][1] = ff_hevc_put_qpel_hv24_10_avx2;
-                c->put_hevc_qpel[7][1][1] = ff_hevc_put_qpel_hv32_10_avx2;
-                c->put_hevc_qpel[8][1][1] = ff_hevc_put_qpel_hv48_10_avx2;
-                c->put_hevc_qpel[9][1][1] = ff_hevc_put_qpel_hv64_10_avx2;
+            c->put_hevc_qpel[5][1][1] = hevc_put_qpel_hv16_10_avx2;
+            c->put_hevc_qpel[6][1][1] = hevc_put_qpel_hv24_10_avx2;
+            c->put_hevc_qpel[7][1][1] = hevc_put_qpel_hv32_10_avx2;
+            c->put_hevc_qpel[8][1][1] = hevc_put_qpel_hv48_10_avx2;
+            c->put_hevc_qpel[9][1][1] = hevc_put_qpel_hv64_10_avx2;
 
             c->put_hevc_qpel_uni[5][1][1] = hevc_put_uni_qpel_hv16_10_avx2;
             c->put_hevc_qpel_uni[6][1][1] = hevc_put_uni_qpel_hv24_10_avx2;
diff --git a/libavcodec/x86/hevcdsp.h b/libavcodec/x86/hevcdsp.h
index 4bf74ef99e..b89a67f2e9 100644
--- a/libavcodec/x86/hevcdsp.h
+++ b/libavcodec/x86/hevcdsp.h
@@ -30,7 +30,7 @@
 
 
 #define PEL_LINK(dst, idx1, idx2, idx3, name, D, opt) \
-dst[idx1][idx2][idx3] = ff_hevc_put_ ## name ## _ ## D ## _##opt;      \
+dst[idx1][idx2][idx3] = hevc_put_ ## name ## _ ## D ## _##opt;      \
 dst ## _bi[idx1][idx2][idx3] = ff_hevc_put_bi_ ## name ## _ ## D ## _##opt;      \
 dst ## _uni[idx1][idx2][idx3] = hevc_put_uni_ ## name ## _ ## D ## _##opt;      \
 dst ## _uni_w[idx1][idx2][idx3] = hevc_put_uni_w_ ## name ## _ ## D ## _##opt;      \
@@ -38,7 +38,6 @@ dst ## _bi_w[idx1][idx2][idx3] = hevc_put_bi_w_ ## name ## _ ## D ## _##opt
 
 
 #define PEL_PROTOTYPE(name, D, opt) \
-void ff_hevc_put_ ## name ## _ ## D ## _##opt(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);      \
 void ff_hevc_put_bi_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);      \
 
 
@@ -90,20 +89,6 @@ EPEL_PROTOTYPES(pel_pixels ,  8, sse4);
 EPEL_PROTOTYPES(pel_pixels , 10, sse4);
 EPEL_PROTOTYPES(pel_pixels , 12, sse4);
 
-void ff_hevc_put_pel_pixels16_8_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_pel_pixels24_8_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_pel_pixels32_8_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_pel_pixels48_8_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_pel_pixels64_8_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-
-void ff_hevc_put_pel_pixels16_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_pel_pixels24_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_pel_pixels32_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_pel_pixels48_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-void ff_hevc_put_pel_pixels64_10_avx2(int16_t *dst, const uint8_t *_src, ptrdiff_t _srcstride, int height, intptr_t mx, intptr_t my,int width);
-
-
-
 void ff_hevc_put_bi_pel_pixels16_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
 void ff_hevc_put_bi_pel_pixels24_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
 void ff_hevc_put_bi_pel_pixels32_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-- 
2.45.2


[-- Attachment #14: 0013-avcodec-x86-hevc-dsp_init-Make-ff_hevc_put_bi_-eq-pe.patch --]
[-- Type: text/x-patch, Size: 16381 bytes --]

From e9f30cea6185b9f9def4f5110d0067751acdf8d0 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 18:44:47 +0200
Subject: [PATCH 13/23] avcodec/x86/hevc/dsp_init: Make
 ff_hevc_put_bi_[eq]?pel* funcs static

Given that there are actually ASM functions of this type,
one can't simply remove the ff_ prefix from the definitions
and declare them as static. Yet one can do nearly that
if one keeps the ff_ prefix and removes the declarations
for the (now static) functions defined in dsp_init.c
from hevcdsp.h and if one defines the functions in the correct
order (smaller width first) so that no forward declarations
are necessary (which was already true).

The new declarations avoid nested macros to simplify things.
It nevertheless turned out to be beneficial line-wise.

(It would be possible to avoid most of these declarations:
It is legal to repeat a function declaration without static
if the first declaration declared a function as static.
So if the macros simply declared all the functions that
they call, one could avoid declarations for the functions
that are called. While this is legal C, it unfortuntaly
clashes with GCC's -Wredundant-decls (which configure enables)
and it is also ugly, as these macro definitions would
provide declarations used in ff_hevc_dsp_init_x86().)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/x86/hevc/dsp_init.c |   8 +-
 libavcodec/x86/hevcdsp.h       | 224 ++++++++++++++-------------------
 2 files changed, 95 insertions(+), 137 deletions(-)

diff --git a/libavcodec/x86/hevc/dsp_init.c b/libavcodec/x86/hevc/dsp_init.c
index f8057dee9f..dc4157b071 100644
--- a/libavcodec/x86/hevc/dsp_init.c
+++ b/libavcodec/x86/hevc/dsp_init.c
@@ -217,7 +217,7 @@ static void hevc_put_uni_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dst
     }                                                                                                           \
 }
 #define mc_rep_bi_func(name, bitd, step, W, opt) \
-void ff_hevc_put_bi_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, const uint8_t *_src,         \
+static void ff_hevc_put_bi_##name##W##_##bitd##_##opt(uint8_t *_dst, ptrdiff_t dststride, const uint8_t *_src,  \
                                                ptrdiff_t _srcstride, const int16_t *_src2,                      \
                                                int height, intptr_t mx, intptr_t my, int width)                 \
 {                                                                                                               \
@@ -257,7 +257,7 @@ static void hevc_put_uni_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dsts
                                                    height, mx, my, width);                                      \
 }
 #define mc_rep_bi_func2(name, bitd, step1, step2, W, opt) \
-void ff_hevc_put_bi_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,           \
+static void ff_hevc_put_bi_##name##W##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,    \
                                                ptrdiff_t _srcstride, const int16_t *src2,                       \
                                                int height, intptr_t mx, intptr_t my, int width)                 \
 {                                                                                                               \
@@ -284,7 +284,7 @@ static void hevc_put_##name##width1##_10_##opt1(int16_t *dst, const uint8_t *src
 }
 
 #define mc_bi_rep_mix_10(name, width1, width2, width3, opt1, opt2, width4)                                    \
-void ff_hevc_put_bi_##name##width1##_10_##opt1(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,         \
+static void ff_hevc_put_bi_##name##width1##_10_##opt1(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,  \
                                                ptrdiff_t _srcstride, const int16_t *src2,                     \
                                                int height, intptr_t mx, intptr_t my, int width)               \
 {                                                                                                             \
@@ -320,7 +320,7 @@ static void hevc_put_##name##width1##_8_##opt1(int16_t *dst, const uint8_t *src,
 }
 
 #define mc_bi_rep_mix_8(name, width1, width2, width3, opt1, opt2)                                             \
-void ff_hevc_put_bi_##name##width1##_8_##opt1(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,          \
+static void ff_hevc_put_bi_##name##width1##_8_##opt1(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,   \
                                               ptrdiff_t _srcstride, const int16_t *src2,                      \
                                               int height, intptr_t mx, intptr_t my, int width)                \
 {                                                                                                             \
diff --git a/libavcodec/x86/hevcdsp.h b/libavcodec/x86/hevcdsp.h
index b89a67f2e9..b18d9449d7 100644
--- a/libavcodec/x86/hevcdsp.h
+++ b/libavcodec/x86/hevcdsp.h
@@ -37,35 +37,17 @@ dst ## _uni_w[idx1][idx2][idx3] = hevc_put_uni_w_ ## name ## _ ## D ## _##opt;
 dst ## _bi_w[idx1][idx2][idx3] = hevc_put_bi_w_ ## name ## _ ## D ## _##opt
 
 
-#define PEL_PROTOTYPE(name, D, opt) \
-void ff_hevc_put_bi_ ## name ## _ ## D ## _##opt(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);      \
+typedef void bi_pel_func(uint8_t *_dst, ptrdiff_t _dststride,
+                         const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2,
+                         int height, intptr_t mx, intptr_t my, int width);
 
+#define BI_PEL_PROTOTYPE(name, W, D, opt) \
+bi_pel_func ff_hevc_put_bi_ ## name ## W ## _ ## D ## _##opt
 
 ///////////////////////////////////////////////////////////////////////////////
 // MC functions
 ///////////////////////////////////////////////////////////////////////////////
 
-#define EPEL_PROTOTYPES(fname, bitd, opt) \
-        PEL_PROTOTYPE(fname##4,  bitd, opt); \
-        PEL_PROTOTYPE(fname##6,  bitd, opt); \
-        PEL_PROTOTYPE(fname##8,  bitd, opt); \
-        PEL_PROTOTYPE(fname##12, bitd, opt); \
-        PEL_PROTOTYPE(fname##16, bitd, opt); \
-        PEL_PROTOTYPE(fname##24, bitd, opt); \
-        PEL_PROTOTYPE(fname##32, bitd, opt); \
-        PEL_PROTOTYPE(fname##48, bitd, opt); \
-        PEL_PROTOTYPE(fname##64, bitd, opt)
-
-#define QPEL_PROTOTYPES(fname, bitd, opt) \
-        PEL_PROTOTYPE(fname##4,  bitd, opt); \
-        PEL_PROTOTYPE(fname##8,  bitd, opt); \
-        PEL_PROTOTYPE(fname##12, bitd, opt); \
-        PEL_PROTOTYPE(fname##16, bitd, opt); \
-        PEL_PROTOTYPE(fname##24, bitd, opt); \
-        PEL_PROTOTYPE(fname##32, bitd, opt); \
-        PEL_PROTOTYPE(fname##48, bitd, opt); \
-        PEL_PROTOTYPE(fname##64, bitd, opt)
-
 #define WEIGHTING_PROTOTYPE(width, bitd, opt) \
 void ff_hevc_put_uni_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const int16_t *_src, int height, int denom,  int _wx, int _ox);      \
 void ff_hevc_put_bi_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride, const int16_t *_src, const int16_t *_src2, int height, int denom,  int _wx0,  int _wx1, int _ox0, int _ox1)
@@ -83,125 +65,101 @@ void ff_hevc_put_bi_w##width##_##bitd##_##opt(uint8_t *dst, ptrdiff_t dststride,
 
 
 ///////////////////////////////////////////////////////////////////////////////
-// QPEL_PIXELS EPEL_PIXELS
+// EPEL_PIXELS
 ///////////////////////////////////////////////////////////////////////////////
-EPEL_PROTOTYPES(pel_pixels ,  8, sse4);
-EPEL_PROTOTYPES(pel_pixels , 10, sse4);
-EPEL_PROTOTYPES(pel_pixels , 12, sse4);
-
-void ff_hevc_put_bi_pel_pixels16_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-void ff_hevc_put_bi_pel_pixels24_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-void ff_hevc_put_bi_pel_pixels32_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-void ff_hevc_put_bi_pel_pixels48_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-void ff_hevc_put_bi_pel_pixels64_8_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-
-void ff_hevc_put_bi_pel_pixels16_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-void ff_hevc_put_bi_pel_pixels24_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-void ff_hevc_put_bi_pel_pixels32_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-void ff_hevc_put_bi_pel_pixels48_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
-void ff_hevc_put_bi_pel_pixels64_10_avx2(uint8_t *_dst, ptrdiff_t _dststride, const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2, int height, intptr_t mx, intptr_t my, int width);
+
+BI_PEL_PROTOTYPE(pel_pixels,  4,  8, sse4);
+BI_PEL_PROTOTYPE(pel_pixels,  4, 10, sse4);
+BI_PEL_PROTOTYPE(pel_pixels,  4, 12, sse4);
+BI_PEL_PROTOTYPE(pel_pixels,  6,  8, sse4);
+BI_PEL_PROTOTYPE(pel_pixels,  6, 10, sse4);
+BI_PEL_PROTOTYPE(pel_pixels,  6, 12, sse4);
+BI_PEL_PROTOTYPE(pel_pixels,  8,  8, sse4);
+BI_PEL_PROTOTYPE(pel_pixels,  8, 10, sse4);
+BI_PEL_PROTOTYPE(pel_pixels,  8, 12, sse4);
+BI_PEL_PROTOTYPE(pel_pixels, 12,  8, sse4);
+BI_PEL_PROTOTYPE(pel_pixels, 16,  8, sse4);
+BI_PEL_PROTOTYPE(pel_pixels, 16, 10, avx2);
+BI_PEL_PROTOTYPE(pel_pixels, 32,  8, avx2);
 
 ///////////////////////////////////////////////////////////////////////////////
 // EPEL
 ///////////////////////////////////////////////////////////////////////////////
-EPEL_PROTOTYPES(epel_h ,  8, sse4);
-EPEL_PROTOTYPES(epel_h , 10, sse4);
-EPEL_PROTOTYPES(epel_h , 12, sse4);
-
-EPEL_PROTOTYPES(epel_v ,  8, sse4);
-EPEL_PROTOTYPES(epel_v , 10, sse4);
-EPEL_PROTOTYPES(epel_v , 12, sse4);
-
-EPEL_PROTOTYPES(epel_hv ,  8, sse4);
-EPEL_PROTOTYPES(epel_hv , 10, sse4);
-EPEL_PROTOTYPES(epel_hv , 12, sse4);
-
-PEL_PROTOTYPE(epel_h16, 8, avx2);
-PEL_PROTOTYPE(epel_h24, 8, avx2);
-PEL_PROTOTYPE(epel_h32, 8, avx2);
-PEL_PROTOTYPE(epel_h48, 8, avx2);
-PEL_PROTOTYPE(epel_h64, 8, avx2);
-
-PEL_PROTOTYPE(epel_h16,10, avx2);
-PEL_PROTOTYPE(epel_h24,10, avx2);
-PEL_PROTOTYPE(epel_h32,10, avx2);
-PEL_PROTOTYPE(epel_h48,10, avx2);
-PEL_PROTOTYPE(epel_h64,10, avx2);
-
-PEL_PROTOTYPE(epel_v16, 8, avx2);
-PEL_PROTOTYPE(epel_v24, 8, avx2);
-PEL_PROTOTYPE(epel_v32, 8, avx2);
-PEL_PROTOTYPE(epel_v48, 8, avx2);
-PEL_PROTOTYPE(epel_v64, 8, avx2);
-
-PEL_PROTOTYPE(epel_v16,10, avx2);
-PEL_PROTOTYPE(epel_v24,10, avx2);
-PEL_PROTOTYPE(epel_v32,10, avx2);
-PEL_PROTOTYPE(epel_v48,10, avx2);
-PEL_PROTOTYPE(epel_v64,10, avx2);
-
-PEL_PROTOTYPE(epel_hv16, 8, avx2);
-PEL_PROTOTYPE(epel_hv24, 8, avx2);
-PEL_PROTOTYPE(epel_hv32, 8, avx2);
-PEL_PROTOTYPE(epel_hv48, 8, avx2);
-PEL_PROTOTYPE(epel_hv64, 8, avx2);
-
-PEL_PROTOTYPE(epel_hv16,10, avx2);
-PEL_PROTOTYPE(epel_hv24,10, avx2);
-PEL_PROTOTYPE(epel_hv32,10, avx2);
-PEL_PROTOTYPE(epel_hv48,10, avx2);
-PEL_PROTOTYPE(epel_hv64,10, avx2);
+
+BI_PEL_PROTOTYPE(epel_h,   4,  8, sse4);
+BI_PEL_PROTOTYPE(epel_h,   4, 10, sse4);
+BI_PEL_PROTOTYPE(epel_h,   4, 12, sse4);
+BI_PEL_PROTOTYPE(epel_h,   6,  8, sse4);
+BI_PEL_PROTOTYPE(epel_h,   6, 10, sse4);
+BI_PEL_PROTOTYPE(epel_h,   6, 12, sse4);
+BI_PEL_PROTOTYPE(epel_h,   8,  8, sse4);
+BI_PEL_PROTOTYPE(epel_h,   8, 10, sse4);
+BI_PEL_PROTOTYPE(epel_h,   8, 12, sse4);
+BI_PEL_PROTOTYPE(epel_h,  12,  8, sse4);
+BI_PEL_PROTOTYPE(epel_h,  16,  8, sse4);
+BI_PEL_PROTOTYPE(epel_h,  16, 10, avx2);
+BI_PEL_PROTOTYPE(epel_h,  32,  8, avx2);
+
+BI_PEL_PROTOTYPE(epel_hv,  4,  8, sse4);
+BI_PEL_PROTOTYPE(epel_hv,  4, 10, sse4);
+BI_PEL_PROTOTYPE(epel_hv,  4, 12, sse4);
+BI_PEL_PROTOTYPE(epel_hv,  6,  8, sse4);
+BI_PEL_PROTOTYPE(epel_hv,  6, 10, sse4);
+BI_PEL_PROTOTYPE(epel_hv,  6, 12, sse4);
+BI_PEL_PROTOTYPE(epel_hv,  8,  8, sse4);
+BI_PEL_PROTOTYPE(epel_hv,  8, 10, sse4);
+BI_PEL_PROTOTYPE(epel_hv,  8, 12, sse4);
+BI_PEL_PROTOTYPE(epel_hv, 16,  8, sse4);
+BI_PEL_PROTOTYPE(epel_hv, 16, 10, avx2);
+BI_PEL_PROTOTYPE(epel_hv, 32,  8, avx2);
+
+BI_PEL_PROTOTYPE(epel_v,   4,  8, sse4);
+BI_PEL_PROTOTYPE(epel_v,   4, 10, sse4);
+BI_PEL_PROTOTYPE(epel_v,   4, 12, sse4);
+BI_PEL_PROTOTYPE(epel_v,   6,  8, sse4);
+BI_PEL_PROTOTYPE(epel_v,   6, 10, sse4);
+BI_PEL_PROTOTYPE(epel_v,   6, 12, sse4);
+BI_PEL_PROTOTYPE(epel_v,   8,  8, sse4);
+BI_PEL_PROTOTYPE(epel_v,   8, 10, sse4);
+BI_PEL_PROTOTYPE(epel_v,   8, 12, sse4);
+BI_PEL_PROTOTYPE(epel_v,  12,  8, sse4);
+BI_PEL_PROTOTYPE(epel_v,  16,  8, sse4);
+BI_PEL_PROTOTYPE(epel_v,  16, 10, avx2);
+BI_PEL_PROTOTYPE(epel_v,  32,  8, avx2);
 
 ///////////////////////////////////////////////////////////////////////////////
 // QPEL
 ///////////////////////////////////////////////////////////////////////////////
-QPEL_PROTOTYPES(qpel_h ,  8, sse4);
-QPEL_PROTOTYPES(qpel_h , 10, sse4);
-QPEL_PROTOTYPES(qpel_h , 12, sse4);
-
-QPEL_PROTOTYPES(qpel_v,  8, sse4);
-QPEL_PROTOTYPES(qpel_v, 10, sse4);
-QPEL_PROTOTYPES(qpel_v, 12, sse4);
-
-QPEL_PROTOTYPES(qpel_hv,  8, sse4);
-QPEL_PROTOTYPES(qpel_hv, 10, sse4);
-QPEL_PROTOTYPES(qpel_hv, 12, sse4);
-
-PEL_PROTOTYPE(qpel_h16, 8, avx2);
-PEL_PROTOTYPE(qpel_h24, 8, avx2);
-PEL_PROTOTYPE(qpel_h32, 8, avx2);
-PEL_PROTOTYPE(qpel_h48, 8, avx2);
-PEL_PROTOTYPE(qpel_h64, 8, avx2);
-
-PEL_PROTOTYPE(qpel_h16,10, avx2);
-PEL_PROTOTYPE(qpel_h24,10, avx2);
-PEL_PROTOTYPE(qpel_h32,10, avx2);
-PEL_PROTOTYPE(qpel_h48,10, avx2);
-PEL_PROTOTYPE(qpel_h64,10, avx2);
-
-PEL_PROTOTYPE(qpel_v16, 8, avx2);
-PEL_PROTOTYPE(qpel_v24, 8, avx2);
-PEL_PROTOTYPE(qpel_v32, 8, avx2);
-PEL_PROTOTYPE(qpel_v48, 8, avx2);
-PEL_PROTOTYPE(qpel_v64, 8, avx2);
-
-PEL_PROTOTYPE(qpel_v16,10, avx2);
-PEL_PROTOTYPE(qpel_v24,10, avx2);
-PEL_PROTOTYPE(qpel_v32,10, avx2);
-PEL_PROTOTYPE(qpel_v48,10, avx2);
-PEL_PROTOTYPE(qpel_v64,10, avx2);
-
-PEL_PROTOTYPE(qpel_hv16, 8, avx2);
-PEL_PROTOTYPE(qpel_hv24, 8, avx2);
-PEL_PROTOTYPE(qpel_hv32, 8, avx2);
-PEL_PROTOTYPE(qpel_hv48, 8, avx2);
-PEL_PROTOTYPE(qpel_hv64, 8, avx2);
-
-PEL_PROTOTYPE(qpel_hv16,10, avx2);
-PEL_PROTOTYPE(qpel_hv24,10, avx2);
-PEL_PROTOTYPE(qpel_hv32,10, avx2);
-PEL_PROTOTYPE(qpel_hv48,10, avx2);
-PEL_PROTOTYPE(qpel_hv64,10, avx2);
+
+BI_PEL_PROTOTYPE(qpel_h,   4,  8, sse4);
+BI_PEL_PROTOTYPE(qpel_h,   4, 10, sse4);
+BI_PEL_PROTOTYPE(qpel_h,   4, 12, sse4);
+BI_PEL_PROTOTYPE(qpel_h,   8,  8, sse4);
+BI_PEL_PROTOTYPE(qpel_h,   8, 10, sse4);
+BI_PEL_PROTOTYPE(qpel_h,   8, 12, sse4);
+BI_PEL_PROTOTYPE(qpel_h,  12,  8, sse4);
+BI_PEL_PROTOTYPE(qpel_h,  16,  8, sse4);
+BI_PEL_PROTOTYPE(qpel_h,  16, 10, avx2);
+BI_PEL_PROTOTYPE(qpel_h,  32,  8, avx2);
+
+BI_PEL_PROTOTYPE(qpel_hv,  4,  8, sse4);
+BI_PEL_PROTOTYPE(qpel_hv,  4, 10, sse4);
+BI_PEL_PROTOTYPE(qpel_hv,  4, 12, sse4);
+BI_PEL_PROTOTYPE(qpel_hv,  8,  8, sse4);
+BI_PEL_PROTOTYPE(qpel_hv,  8, 10, sse4);
+BI_PEL_PROTOTYPE(qpel_hv,  8, 12, sse4);
+BI_PEL_PROTOTYPE(qpel_hv, 16, 10, avx2);
+
+BI_PEL_PROTOTYPE(qpel_v,   4,  8, sse4);
+BI_PEL_PROTOTYPE(qpel_v,   4, 10, sse4);
+BI_PEL_PROTOTYPE(qpel_v,   4, 12, sse4);
+BI_PEL_PROTOTYPE(qpel_v,   8,  8, sse4);
+BI_PEL_PROTOTYPE(qpel_v,   8, 10, sse4);
+BI_PEL_PROTOTYPE(qpel_v,   8, 12, sse4);
+BI_PEL_PROTOTYPE(qpel_v,  12,  8, sse4);
+BI_PEL_PROTOTYPE(qpel_v,  16,  8, sse4);
+BI_PEL_PROTOTYPE(qpel_v,  16, 10, avx2);
+BI_PEL_PROTOTYPE(qpel_v,  32,  8, avx2);
 
 WEIGHTING_PROTOTYPES(8, sse4);
 WEIGHTING_PROTOTYPES(10, sse4);
-- 
2.45.2


[-- Attachment #15: 0014-avcodec-x86-hevc-dsp_init-Reindent-after-the-previou.patch --]
[-- Type: text/x-patch, Size: 14834 bytes --]

From a57964d67ca71946dc688730877bc06be1bb758e Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 20:57:55 +0200
Subject: [PATCH 14/23] avcodec/x86/hevc/dsp_init: Reindent after the previous
 commits

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

diff --git a/libavcodec/x86/hevc/dsp_init.c b/libavcodec/x86/hevc/dsp_init.c
index dc4157b071..ad7b80d46e 100644
--- a/libavcodec/x86/hevc/dsp_init.c
+++ b/libavcodec/x86/hevc/dsp_init.c
@@ -902,13 +902,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_qpel_uni[8][0][0] = hevc_put_uni_pel_pixels48_8_avx2;
             c->put_hevc_qpel_uni[9][0][0] = hevc_put_uni_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_bi_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_bi_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_bi_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_bi_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_bi_pel_pixels32_8_avx2;
-                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_8_avx2;
-                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_bi_pel_pixels64_8_avx2;
+            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_bi_pel_pixels32_8_avx2;
+            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_8_avx2;
+            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_bi_pel_pixels64_8_avx2;
 
             c->put_hevc_epel[7][0][1] = hevc_put_epel_h32_8_avx2;
             c->put_hevc_epel[8][0][1] = hevc_put_epel_h48_8_avx2;
@@ -918,9 +918,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_epel_uni[8][0][1] = hevc_put_uni_epel_h48_8_avx2;
             c->put_hevc_epel_uni[9][0][1] = hevc_put_uni_epel_h64_8_avx2;
 
-                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_bi_epel_h32_8_avx2;
-                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_bi_epel_h48_8_avx2;
-                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_bi_epel_h64_8_avx2;
+            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_bi_epel_h32_8_avx2;
+            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_bi_epel_h48_8_avx2;
+            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_bi_epel_h64_8_avx2;
 
             c->put_hevc_epel[7][1][0] = hevc_put_epel_v32_8_avx2;
             c->put_hevc_epel[8][1][0] = hevc_put_epel_v48_8_avx2;
@@ -930,9 +930,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_epel_uni[8][1][0] = hevc_put_uni_epel_v48_8_avx2;
             c->put_hevc_epel_uni[9][1][0] = hevc_put_uni_epel_v64_8_avx2;
 
-                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_bi_epel_v32_8_avx2;
-                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_bi_epel_v48_8_avx2;
-                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_bi_epel_v64_8_avx2;
+            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_bi_epel_v32_8_avx2;
+            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_bi_epel_v48_8_avx2;
+            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_bi_epel_v64_8_avx2;
 
             c->put_hevc_epel[7][1][1] = hevc_put_epel_hv32_8_avx2;
             c->put_hevc_epel[8][1][1] = hevc_put_epel_hv48_8_avx2;
@@ -942,9 +942,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_epel_uni[8][1][1] = hevc_put_uni_epel_hv48_8_avx2;
             c->put_hevc_epel_uni[9][1][1] = hevc_put_uni_epel_hv64_8_avx2;
 
-                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_bi_epel_hv32_8_avx2;
-                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_bi_epel_hv48_8_avx2;
-                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_bi_epel_hv64_8_avx2;
+            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_bi_epel_hv32_8_avx2;
+            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_bi_epel_hv48_8_avx2;
+            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_bi_epel_hv64_8_avx2;
 
             c->put_hevc_qpel[7][0][1] = hevc_put_qpel_h32_8_avx2;
             c->put_hevc_qpel[8][0][1] = hevc_put_qpel_h48_8_avx2;
@@ -962,13 +962,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_qpel_uni[8][1][0] = hevc_put_uni_qpel_v48_8_avx2;
             c->put_hevc_qpel_uni[9][1][0] = hevc_put_uni_qpel_v64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_bi_qpel_h32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_bi_qpel_h48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_bi_qpel_h64_8_avx2;
+            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_bi_qpel_h32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_bi_qpel_h48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_bi_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_bi_qpel_v32_8_avx2;
-                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_bi_qpel_v48_8_avx2;
-                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_bi_qpel_v64_8_avx2;
+            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_bi_qpel_v32_8_avx2;
+            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_bi_qpel_v48_8_avx2;
+            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_bi_qpel_v64_8_avx2;
 #endif /* ARCH_X86_64 */
 
             SAO_BAND_INIT(8, avx2);
@@ -1083,16 +1083,16 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_qpel_uni[8][0][0] = hevc_put_uni_pel_pixels96_8_avx2;
             c->put_hevc_qpel_uni[9][0][0] = hevc_put_uni_pel_pixels128_8_avx2;
 
-                c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_bi_pel_pixels16_10_avx2;
-                c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_bi_pel_pixels24_10_avx2;
-                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_bi_pel_pixels32_10_avx2;
-                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_10_avx2;
-                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_bi_pel_pixels64_10_avx2;
-                c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_bi_pel_pixels16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_bi_pel_pixels24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_bi_pel_pixels32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_bi_pel_pixels64_10_avx2;
+            c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_bi_pel_pixels16_10_avx2;
+            c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_bi_pel_pixels24_10_avx2;
+            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_bi_pel_pixels32_10_avx2;
+            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_10_avx2;
+            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_bi_pel_pixels64_10_avx2;
+            c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_bi_pel_pixels16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_bi_pel_pixels24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_bi_pel_pixels32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_bi_pel_pixels48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_bi_pel_pixels64_10_avx2;
 
             c->put_hevc_epel[5][0][1] = hevc_put_epel_h16_10_avx2;
             c->put_hevc_epel[6][0][1] = hevc_put_epel_h24_10_avx2;
@@ -1106,11 +1106,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_epel_uni[8][0][1] = hevc_put_uni_epel_h48_10_avx2;
             c->put_hevc_epel_uni[9][0][1] = hevc_put_uni_epel_h64_10_avx2;
 
-                c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_bi_epel_h16_10_avx2;
-                c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_bi_epel_h24_10_avx2;
-                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_bi_epel_h32_10_avx2;
-                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_bi_epel_h48_10_avx2;
-                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_bi_epel_h64_10_avx2;
+            c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_bi_epel_h16_10_avx2;
+            c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_bi_epel_h24_10_avx2;
+            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_bi_epel_h32_10_avx2;
+            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_bi_epel_h48_10_avx2;
+            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_bi_epel_h64_10_avx2;
 
             c->put_hevc_epel[5][1][0] = hevc_put_epel_v16_10_avx2;
             c->put_hevc_epel[6][1][0] = hevc_put_epel_v24_10_avx2;
@@ -1124,11 +1124,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_epel_uni[8][1][0] = hevc_put_uni_epel_v48_10_avx2;
             c->put_hevc_epel_uni[9][1][0] = hevc_put_uni_epel_v64_10_avx2;
 
-                c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_bi_epel_v16_10_avx2;
-                c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_bi_epel_v24_10_avx2;
-                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_bi_epel_v32_10_avx2;
-                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_bi_epel_v48_10_avx2;
-                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_bi_epel_v64_10_avx2;
+            c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_bi_epel_v16_10_avx2;
+            c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_bi_epel_v24_10_avx2;
+            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_bi_epel_v32_10_avx2;
+            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_bi_epel_v48_10_avx2;
+            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_bi_epel_v64_10_avx2;
 
             c->put_hevc_epel[5][1][1] = hevc_put_epel_hv16_10_avx2;
             c->put_hevc_epel[6][1][1] = hevc_put_epel_hv24_10_avx2;
@@ -1142,11 +1142,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_epel_uni[8][1][1] = hevc_put_uni_epel_hv48_10_avx2;
             c->put_hevc_epel_uni[9][1][1] = hevc_put_uni_epel_hv64_10_avx2;
 
-                c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_bi_epel_hv16_10_avx2;
-                c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_bi_epel_hv24_10_avx2;
-                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_bi_epel_hv32_10_avx2;
-                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_bi_epel_hv48_10_avx2;
-                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_bi_epel_hv64_10_avx2;
+            c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_bi_epel_hv16_10_avx2;
+            c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_bi_epel_hv24_10_avx2;
+            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_bi_epel_hv32_10_avx2;
+            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_bi_epel_hv48_10_avx2;
+            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_bi_epel_hv64_10_avx2;
 
             c->put_hevc_qpel[5][0][1] = hevc_put_qpel_h16_10_avx2;
             c->put_hevc_qpel[6][0][1] = hevc_put_qpel_h24_10_avx2;
@@ -1160,11 +1160,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_qpel_uni[8][0][1] = hevc_put_uni_qpel_h48_10_avx2;
             c->put_hevc_qpel_uni[9][0][1] = hevc_put_uni_qpel_h64_10_avx2;
 
-                c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_bi_qpel_h16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_bi_qpel_h24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_bi_qpel_h32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_bi_qpel_h48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_bi_qpel_h64_10_avx2;
+            c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_bi_qpel_h16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_bi_qpel_h24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_bi_qpel_h32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_bi_qpel_h48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_bi_qpel_h64_10_avx2;
 
             c->put_hevc_qpel[5][1][0] = hevc_put_qpel_v16_10_avx2;
             c->put_hevc_qpel[6][1][0] = hevc_put_qpel_v24_10_avx2;
@@ -1178,11 +1178,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_qpel_uni[8][1][0] = hevc_put_uni_qpel_v48_10_avx2;
             c->put_hevc_qpel_uni[9][1][0] = hevc_put_uni_qpel_v64_10_avx2;
 
-                c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_bi_qpel_v16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_bi_qpel_v24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_bi_qpel_v32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_bi_qpel_v48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_bi_qpel_v64_10_avx2;
+            c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_bi_qpel_v16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_bi_qpel_v24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_bi_qpel_v32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_bi_qpel_v48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_bi_qpel_v64_10_avx2;
 
             c->put_hevc_qpel[5][1][1] = hevc_put_qpel_hv16_10_avx2;
             c->put_hevc_qpel[6][1][1] = hevc_put_qpel_hv24_10_avx2;
@@ -1196,11 +1196,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_qpel_uni[8][1][1] = hevc_put_uni_qpel_hv48_10_avx2;
             c->put_hevc_qpel_uni[9][1][1] = hevc_put_uni_qpel_hv64_10_avx2;
 
-                c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_bi_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_bi_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_bi_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_bi_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_bi_qpel_hv64_10_avx2;
+            c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_bi_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_bi_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_bi_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_bi_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_bi_qpel_hv64_10_avx2;
 #endif /* ARCH_X86_64 */
 
             SAO_BAND_INIT(10, avx2);
-- 
2.45.2


[-- Attachment #16: 0015-avcodec-x86-hevcdsp-Move-macro-to-dsp_init.c.patch --]
[-- Type: text/x-patch, Size: 2423 bytes --]

From 78a61a42fd3ed228198231367183861d8add3f52 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 21:07:43 +0200
Subject: [PATCH 15/23] avcodec/x86/hevcdsp: Move macro to dsp_init.c

It belongs to the [EQ]PEL_LINKS macros.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/x86/hevc/dsp_init.c | 7 +++++++
 libavcodec/x86/hevcdsp.h       | 9 ---------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/libavcodec/x86/hevc/dsp_init.c b/libavcodec/x86/hevc/dsp_init.c
index ad7b80d46e..16ea62dd00 100644
--- a/libavcodec/x86/hevc/dsp_init.c
+++ b/libavcodec/x86/hevc/dsp_init.c
@@ -783,6 +783,13 @@ SAO_EDGE_FILTER_FUNCS(12, avx2)
     c->sao_edge_filter[4]      = ff_hevc_sao_edge_filter_64_##bitd##_##opt; \
 } while (0)
 
+#define PEL_LINK(dst, idx1, idx2, idx3, name, D, opt) \
+dst          [idx1][idx2][idx3] = hevc_put_       ## name ## _ ## D ## _##opt; \
+dst ## _bi   [idx1][idx2][idx3] = ff_hevc_put_bi_ ## name ## _ ## D ## _##opt; \
+dst ## _uni  [idx1][idx2][idx3] = hevc_put_uni_   ## name ## _ ## D ## _##opt; \
+dst ## _uni_w[idx1][idx2][idx3] = hevc_put_uni_w_ ## name ## _ ## D ## _##opt; \
+dst ## _bi_w [idx1][idx2][idx3] = hevc_put_bi_w_  ## name ## _ ## D ## _##opt
+
 #define EPEL_LINKS(pointer, my, mx, fname, bitd, opt )           \
         PEL_LINK(pointer, 1, my , mx , fname##4 ,  bitd, opt ); \
         PEL_LINK(pointer, 2, my , mx , fname##6 ,  bitd, opt ); \
diff --git a/libavcodec/x86/hevcdsp.h b/libavcodec/x86/hevcdsp.h
index b18d9449d7..f8352750e4 100644
--- a/libavcodec/x86/hevcdsp.h
+++ b/libavcodec/x86/hevcdsp.h
@@ -28,15 +28,6 @@
 #include <stddef.h>
 #include <stdint.h>
 
-
-#define PEL_LINK(dst, idx1, idx2, idx3, name, D, opt) \
-dst[idx1][idx2][idx3] = hevc_put_ ## name ## _ ## D ## _##opt;      \
-dst ## _bi[idx1][idx2][idx3] = ff_hevc_put_bi_ ## name ## _ ## D ## _##opt;      \
-dst ## _uni[idx1][idx2][idx3] = hevc_put_uni_ ## name ## _ ## D ## _##opt;      \
-dst ## _uni_w[idx1][idx2][idx3] = hevc_put_uni_w_ ## name ## _ ## D ## _##opt;      \
-dst ## _bi_w[idx1][idx2][idx3] = hevc_put_bi_w_ ## name ## _ ## D ## _##opt
-
-
 typedef void bi_pel_func(uint8_t *_dst, ptrdiff_t _dststride,
                          const uint8_t *_src, ptrdiff_t _srcstride, const int16_t *src2,
                          int height, intptr_t mx, intptr_t my, int width);
-- 
2.45.2


[-- Attachment #17: 0016-avcodec-x86-hevcdsp-Move-to-x86-hevc.patch --]
[-- Type: text/x-patch, Size: 1866 bytes --]

From 34725044243b6b801daa06a953f3a2c9e2bc6b21 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 21:14:11 +0200
Subject: [PATCH 16/23] avcodec/x86/hevcdsp: Move to x86/hevc

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/x86/{hevcdsp.h => hevc/dsp.h} | 6 +++---
 libavcodec/x86/hevc/dsp_init.c           | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
 rename libavcodec/x86/{hevcdsp.h => hevc/dsp.h} (98%)

diff --git a/libavcodec/x86/hevcdsp.h b/libavcodec/x86/hevc/dsp.h
similarity index 98%
rename from libavcodec/x86/hevcdsp.h
rename to libavcodec/x86/hevc/dsp.h
index f8352750e4..03986b970a 100644
--- a/libavcodec/x86/hevcdsp.h
+++ b/libavcodec/x86/hevc/dsp.h
@@ -22,8 +22,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AVCODEC_X86_HEVCDSP_H
-#define AVCODEC_X86_HEVCDSP_H
+#ifndef AVCODEC_X86_HEVC_DSP_H
+#define AVCODEC_X86_HEVC_DSP_H
 
 #include <stddef.h>
 #include <stdint.h>
@@ -186,4 +186,4 @@ void ff_hevc_add_residual_32_10_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t
 void ff_hevc_add_residual_16_10_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
 void ff_hevc_add_residual_32_10_avx2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
 
-#endif // AVCODEC_X86_HEVCDSP_H
+#endif // AVCODEC_X86_HEVC_DSP_H
diff --git a/libavcodec/x86/hevc/dsp_init.c b/libavcodec/x86/hevc/dsp_init.c
index 16ea62dd00..ba921e7299 100644
--- a/libavcodec/x86/hevc/dsp_init.c
+++ b/libavcodec/x86/hevc/dsp_init.c
@@ -27,7 +27,7 @@
 #include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/hevc/dsp.h"
-#include "libavcodec/x86/hevcdsp.h"
+#include "libavcodec/x86/hevc/dsp.h"
 #include "libavcodec/x86/h26x/h2656dsp.h"
 
 #define LFC_FUNC(DIR, DEPTH, OPT) \
-- 
2.45.2


[-- Attachment #18: 0017-avcodec-aacenc_is-Make-ff_aac_is_encoding_err-static.patch --]
[-- Type: text/x-patch, Size: 4177 bytes --]

From 25269b997de12a1731daa44c6c54c6fb61e890de Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Wed, 2 Apr 2025 11:35:55 +0200
Subject: [PATCH 17/23] avcodec/aacenc_is: Make ff_aac_is_encoding_err() static

Possible since 9b11fefb88c770b9c1d4d4583c61c6abde6c033c.
Also remove a now always-zero parameter.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/aacenc_is.c | 31 +++++++++++++++++++++----------
 libavcodec/aacenc_is.h | 16 ----------------
 2 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/libavcodec/aacenc_is.c b/libavcodec/aacenc_is.c
index 4943b6450c..4e711382dc 100644
--- a/libavcodec/aacenc_is.c
+++ b/libavcodec/aacenc_is.c
@@ -30,16 +30,27 @@
 #include "aacenc_is.h"
 #include "aacenc_quantization.h"
 
-struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
-                                         int start, int w, int g, float ener0,
-                                         float ener1, float ener01,
-                                         int use_pcoeffs, int phase)
+/** Frequency in Hz for lower limit of intensity stereo **/
+#define INT_STEREO_LOW_LIMIT 6100
+
+struct AACISError {
+    int pass;    /* 1 if dist2 <= dist1  */
+    int phase;   /* -1 or +1             */
+    float error; /* fabs(dist1 - dist2)  */
+    float dist1; /* From original coeffs */
+    float dist2; /* From IS'd coeffs     */
+    float ener01;
+};
+
+static struct AACISError aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
+                                             int start, int w, int g, float ener0,
+                                             float ener1, float ener01, int phase)
 {
     int i, w2;
     SingleChannelElement *sce0 = &cpe->ch[0];
     SingleChannelElement *sce1 = &cpe->ch[1];
-    float *L = use_pcoeffs ? sce0->pcoeffs : sce0->coeffs;
-    float *R = use_pcoeffs ? sce1->pcoeffs : sce1->coeffs;
+    float *L = sce0->coeffs;
+    float *R = sce1->coeffs;
     float *L34 = &s->scoefs[256*0], *R34 = &s->scoefs[256*1];
     float *IS  = &s->scoefs[256*2], *I34 = &s->scoefs[256*3];
     float dist1 = 0.0f, dist2 = 0.0f;
@@ -128,10 +139,10 @@ void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElemen
                         ener01p += (coef0 - coef1)*(coef0 - coef1);
                     }
                 }
-                ph_err1 = ff_aac_is_encoding_err(s, cpe, start, w, g,
-                                                 ener0, ener1, ener01p, 0, -1);
-                ph_err2 = ff_aac_is_encoding_err(s, cpe, start, w, g,
-                                                 ener0, ener1, ener01, 0, +1);
+                ph_err1 = aac_is_encoding_err(s, cpe, start, w, g,
+                                              ener0, ener1, ener01p, -1);
+                ph_err2 = aac_is_encoding_err(s, cpe, start, w, g,
+                                              ener0, ener1, ener01, +1);
                 best = (ph_err1.pass && ph_err1.error < ph_err2.error) ? &ph_err1 : &ph_err2;
                 if (best->pass) {
                     cpe->is_mask[w*16+g] = 1;
diff --git a/libavcodec/aacenc_is.h b/libavcodec/aacenc_is.h
index 269fd1a9c9..beaa70c790 100644
--- a/libavcodec/aacenc_is.h
+++ b/libavcodec/aacenc_is.h
@@ -30,22 +30,6 @@
 
 #include "aacenc.h"
 
-/** Frequency in Hz for lower limit of intensity stereo **/
-#define INT_STEREO_LOW_LIMIT 6100
-
-struct AACISError {
-    int pass;    /* 1 if dist2 <= dist1  */
-    int phase;   /* -1 or +1             */
-    float error; /* fabs(dist1 - dist2)  */
-    float dist1; /* From original coeffs */
-    float dist2; /* From IS'd coeffs     */
-    float ener01;
-};
-
-struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
-                                         int start, int w, int g, float ener0,
-                                         float ener1, float ener01,
-                                         int use_pcoeffs, int phase);
 void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe);
 
 #endif /* AVCODEC_AACENC_IS_H */
-- 
2.45.2


[-- Attachment #19: 0018-avcodec-mjpegenc_huffman-Make-ff_mjpegenc_huffman_co.patch --]
[-- Type: text/x-patch, Size: 6125 bytes --]

From 64adc9f5ef701012cc9caf4fe72d0c65b042020f Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Wed, 2 Apr 2025 12:19:45 +0200
Subject: [PATCH 18/23] avcodec/mjpegenc_huffman: Make
 ff_mjpegenc_huffman_compute_bits() static

Only used here and in a test tool.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mjpegenc_huffman.c       | 31 +++++++++++++++++++++++++++--
 libavcodec/mjpegenc_huffman.h       | 29 ---------------------------
 libavcodec/tests/mjpegenc_huffman.c | 18 ++++++++---------
 3 files changed, 38 insertions(+), 40 deletions(-)

diff --git a/libavcodec/mjpegenc_huffman.c b/libavcodec/mjpegenc_huffman.c
index 9bfcb7e785..898db7d060 100644
--- a/libavcodec/mjpegenc_huffman.c
+++ b/libavcodec/mjpegenc_huffman.c
@@ -25,6 +25,32 @@
 #include "libavutil/qsort.h"
 #include "mjpegenc_huffman.h"
 
+/**
+ * Used to assign a occurrence count or "probability" to an input value
+ */
+typedef struct PTable {
+    int value;  ///< input value
+    int prob;   ///< number of occurences of this value in input
+} PTable;
+
+/**
+ * Used to store intermediate lists in the package merge algorithm
+ */
+typedef struct PackageMergerList {
+    int nitems;             ///< number of items in the list and probability      ex. 4
+    int item_idx[515];      ///< index range for each item in items                   0, 2, 5, 9, 13
+    int probability[514];   ///< probability of each item                             3, 8, 18, 46
+    int items[257 * 16];    ///< chain of all individual values that make up items    A, B, A, B, C, A, B, C, D, C, D, D, E
+} PackageMergerList;
+
+/**
+ * Used to store optimal huffman encoding results
+ */
+typedef struct HuffTable {
+    int code;       ///< code is the input value
+    int length;     ///< length of the encoding
+} HuffTable;
+
 /**
  * Comparison function for two PTables by prob
  *
@@ -74,7 +100,8 @@ static int compare_by_length(const void *a, const void *b)
  * @param size       size of the prob_table array
  * @param max_length max length of an encoding
  */
-void ff_mjpegenc_huffman_compute_bits(PTable *prob_table, HuffTable *distincts, int size, int max_length)
+static void mjpegenc_huffman_compute_bits(PTable *prob_table, HuffTable *distincts,
+                                          int size, int max_length)
 {
     PackageMergerList list_a, list_b, *to = &list_a, *from = &list_b, *temp;
 
@@ -178,7 +205,7 @@ void ff_mjpeg_encode_huffman_close(MJpegEncHuffmanContext *s, uint8_t bits[17],
     }
     val_counts[j].value = 256;
     val_counts[j].prob = 0;
-    ff_mjpegenc_huffman_compute_bits(val_counts, distincts, nval + 1, 16);
+    mjpegenc_huffman_compute_bits(val_counts, distincts, nval + 1, 16);
     AV_QSORT(distincts, nval, HuffTable, compare_by_length);
 
     memset(bits, 0, sizeof(bits[0]) * 17);
diff --git a/libavcodec/mjpegenc_huffman.h b/libavcodec/mjpegenc_huffman.h
index 5fe65504e4..8822e468aa 100644
--- a/libavcodec/mjpegenc_huffman.h
+++ b/libavcodec/mjpegenc_huffman.h
@@ -44,33 +44,4 @@ void ff_mjpeg_encode_huffman_close(MJpegEncHuffmanContext *s,
                                    uint8_t bits[17], uint8_t val[],
                                    int max_nval);
 
-
-/**
- * Used to assign a occurrence count or "probability" to an input value
- */
-typedef struct PTable {
-    int value;  ///< input value
-    int prob;   ///< number of occurences of this value in input
-} PTable;
-
-/**
- * Used to store intermediate lists in the package merge algorithm
- */
-typedef struct PackageMergerList {
-    int nitems;             ///< number of items in the list and probability      ex. 4
-    int item_idx[515];      ///< index range for each item in items                   0, 2, 5, 9, 13
-    int probability[514];   ///< probability of each item                             3, 8, 18, 46
-    int items[257 * 16];    ///< chain of all individual values that make up items    A, B, A, B, C, A, B, C, D, C, D, D, E
-} PackageMergerList;
-
-/**
- * Used to store optimal huffman encoding results
- */
-typedef struct HuffTable {
-    int code;       ///< code is the input value
-    int length;     ///< length of the encoding
-} HuffTable;
-
-void ff_mjpegenc_huffman_compute_bits(PTable *prob_table, HuffTable *distincts,
-                                      int size, int max_length);
 #endif /* AVCODEC_MJPEGENC_HUFFMAN_H */
diff --git a/libavcodec/tests/mjpegenc_huffman.c b/libavcodec/tests/mjpegenc_huffman.c
index 2ed92d07d5..39ad10c454 100644
--- a/libavcodec/tests/mjpegenc_huffman.c
+++ b/libavcodec/tests/mjpegenc_huffman.c
@@ -23,12 +23,12 @@
  * Optimal Huffman Encoding tests.
  */
 
-#include "libavcodec/avcodec.h"
-#include <stdlib.h>
-#include "libavcodec/mjpegenc.h"
-#include "libavcodec/mjpegenc_huffman.h"
-#include "libavcodec/mjpegenc_common.h"
-#include "libavcodec/mpegvideo.h"
+#include <stdio.h>
+
+#include "libavutil/avassert.h"
+#include "libavutil/macros.h"
+
+#include "libavcodec/mjpegenc_huffman.c"
 
 // Validate the computed lengths satisfy the JPEG restrictions and is optimal.
 static int check_lengths(int L, int expected_length,
@@ -45,7 +45,7 @@ static int check_lengths(int L, int expected_length,
         val_counts[i] = (PTable){.value = i, .prob = probs[i]};
     }
 
-    ff_mjpegenc_huffman_compute_bits(val_counts, lengths, nprobs, L);
+    mjpegenc_huffman_compute_bits(val_counts, lengths, nprobs, L);
 
     for (i = 0; i < nprobs; i++) {
         // Find the value's prob and length
@@ -137,8 +137,8 @@ int main(int argc, char **argv)
 
     // Build optimal huffman tree using an internal function, to allow for
     // smaller-than-normal test cases. This mutates val_counts by sorting.
-    ff_mjpegenc_huffman_compute_bits(val_counts, distincts,
-                                     FF_ARRAY_ELEMS(distincts), 3);
+    mjpegenc_huffman_compute_bits(val_counts, distincts,
+                                  FF_ARRAY_ELEMS(distincts), 3);
 
     for (i = 0; i < FF_ARRAY_ELEMS(distincts); i++) {
         if (distincts[i].code != expected[i].code ||
-- 
2.45.2


[-- Attachment #20: 0019-avocdec-mjpegenc_huffman-Avoid-redundant-loop.patch --]
[-- Type: text/x-patch, Size: 2068 bytes --]

From e9965a5e8ec301fdbcd42967a3adcb39a711d80f Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Wed, 2 Apr 2025 12:54:07 +0200
Subject: [PATCH 19/23] avocdec/mjpegenc_huffman: Avoid redundant loop

There is no point in iterating over the list twice.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mjpegenc_huffman.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/libavcodec/mjpegenc_huffman.c b/libavcodec/mjpegenc_huffman.c
index 898db7d060..16c0930524 100644
--- a/libavcodec/mjpegenc_huffman.c
+++ b/libavcodec/mjpegenc_huffman.c
@@ -185,31 +185,28 @@ void ff_mjpeg_encode_huffman_init(MJpegEncHuffmanContext *s)
 void ff_mjpeg_encode_huffman_close(MJpegEncHuffmanContext *s, uint8_t bits[17],
                                    uint8_t val[], int max_nval)
 {
-    int i, j;
-    int nval = 0;
+    int nval;
     PTable val_counts[257];
     HuffTable distincts[256];
 
-    for (i = 0; i < 256; i++) {
-        if (s->val_count[i]) nval++;
-    }
-    av_assert0 (nval <= max_nval);
+    av_assert1(max_nval <= FF_ARRAY_ELEMS(val_counts) - 1);
 
-    j = 0;
-    for (i = 0; i < 256; i++) {
+    nval = 0;
+    for (int i = 0; i < 256; i++) {
         if (s->val_count[i]) {
-            val_counts[j].value = i;
-            val_counts[j].prob = s->val_count[i];
-            j++;
+            val_counts[nval].value = i;
+            val_counts[nval].prob  = s->val_count[i];
+            nval++;
+            av_assert2(nval <= max_nval);
         }
     }
-    val_counts[j].value = 256;
-    val_counts[j].prob = 0;
+    val_counts[nval].value = 256;
+    val_counts[nval].prob  = 0;
     mjpegenc_huffman_compute_bits(val_counts, distincts, nval + 1, 16);
     AV_QSORT(distincts, nval, HuffTable, compare_by_length);
 
     memset(bits, 0, sizeof(bits[0]) * 17);
-    for (i = 0; i < nval; i++) {
+    for (int i = 0; i < nval; i++) {
         val[i] = distincts[i].code;
         bits[distincts[i].length]++;
     }
-- 
2.45.2


[-- Attachment #21: 0020-avcodec-mjpegenc_huffman-Avoid-AV_QSORT-to-sort-entr.patch --]
[-- Type: text/x-patch, Size: 28608 bytes --]

From a17db6215a1600021c9d4a7d6c7923ac5816ea70 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Wed, 2 Apr 2025 15:06:43 +0200
Subject: [PATCH 20/23] avcodec/mjpegenc_huffman: Avoid AV_QSORT to sort
 entries by length

It is unnecessary; all one needs to ensure that shorter codes
precede longer ones is to get the number of codes for each
length. Then the codes of length 1 occupy the first count[1]
positions, the codes of length 2 the next count[2]...
Doing so gives a 3.4% speedup of ff_mjpeg_encode_huffman_close()
here; it also saves about 340B.

The new code sorts codes of the same length in order of
ascending symbol. The old code did not and therefore
the FATE checksums needed to be updated. Due to MJPEG's
0xFF unescaping file sizes as well as file checksums
needed to be updated; the decoded picture hashes stayed
the same.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mjpegenc_huffman.c                 | 33 ++++++---------
 libavcodec/tests/mjpegenc_huffman.c           |  6 ++-
 tests/ref/fate/jpg-icc                        |  6 +--
 tests/ref/lavf/jpg                            |  4 +-
 tests/ref/lavf/smjpeg                         |  4 +-
 tests/ref/seek/vsynth_lena-mjpeg              | 40 +++++++++----------
 tests/ref/vsynth/vsynth1-mjpeg                |  4 +-
 tests/ref/vsynth/vsynth1-mjpeg-422            |  4 +-
 tests/ref/vsynth/vsynth1-mjpeg-444            |  4 +-
 tests/ref/vsynth/vsynth1-mjpeg-huffman        |  4 +-
 tests/ref/vsynth/vsynth1-mjpeg-trell          |  4 +-
 tests/ref/vsynth/vsynth1-mjpeg-trell-huffman  |  4 +-
 tests/ref/vsynth/vsynth2-mjpeg                |  4 +-
 tests/ref/vsynth/vsynth2-mjpeg-422            |  4 +-
 tests/ref/vsynth/vsynth2-mjpeg-444            |  4 +-
 tests/ref/vsynth/vsynth2-mjpeg-huffman        |  4 +-
 tests/ref/vsynth/vsynth2-mjpeg-trell          |  4 +-
 tests/ref/vsynth/vsynth2-mjpeg-trell-huffman  |  4 +-
 tests/ref/vsynth/vsynth3-mjpeg                |  4 +-
 tests/ref/vsynth/vsynth3-mjpeg-422            |  4 +-
 tests/ref/vsynth/vsynth3-mjpeg-444            |  4 +-
 tests/ref/vsynth/vsynth3-mjpeg-huffman        |  4 +-
 tests/ref/vsynth/vsynth3-mjpeg-trell          |  4 +-
 tests/ref/vsynth/vsynth3-mjpeg-trell-huffman  |  4 +-
 tests/ref/vsynth/vsynth_lena-mjpeg            |  4 +-
 tests/ref/vsynth/vsynth_lena-mjpeg-422        |  4 +-
 tests/ref/vsynth/vsynth_lena-mjpeg-444        |  4 +-
 tests/ref/vsynth/vsynth_lena-mjpeg-huffman    |  4 +-
 tests/ref/vsynth/vsynth_lena-mjpeg-trell      |  4 +-
 .../vsynth/vsynth_lena-mjpeg-trell-huffman    |  4 +-
 30 files changed, 91 insertions(+), 98 deletions(-)

diff --git a/libavcodec/mjpegenc_huffman.c b/libavcodec/mjpegenc_huffman.c
index 16c0930524..bd31a29729 100644
--- a/libavcodec/mjpegenc_huffman.c
+++ b/libavcodec/mjpegenc_huffman.c
@@ -65,20 +65,6 @@ static int compare_by_prob(const void *a, const void *b)
     return a_val.prob - b_val.prob;
 }
 
-/**
- * Comparison function for two HuffTables by length
- *
- * @param a First HuffTable to compare
- * @param b Second HuffTable to compare
- * @return < 0 for less than, 0 for equals, > 0 for greater than
- */
-static int compare_by_length(const void *a, const void *b)
-{
-    HuffTable a_val = *(HuffTable *) a;
-    HuffTable b_val = *(HuffTable *) b;
-    return a_val.length - b_val.length;
-}
-
 /**
  * Computes the length of the Huffman encoding for each distinct input value.
  * Uses package merge algorithm as follows:
@@ -97,10 +83,12 @@ static int compare_by_length(const void *a, const void *b)
  *
  * @param prob_table input array of a PTable for each distinct input value
  * @param distincts  output array of a HuffTable that will be populated by this function
+ * @param bits[out]  the number of values of a given length
  * @param size       size of the prob_table array
  * @param max_length max length of an encoding
  */
 static void mjpegenc_huffman_compute_bits(PTable *prob_table, HuffTable *distincts,
+                                          uint8_t counts[/* max_length + 1 */],
                                           int size, int max_length)
 {
     PackageMergerList list_a, list_b, *to = &list_a, *from = &list_b, *temp;
@@ -157,6 +145,7 @@ static void mjpegenc_huffman_compute_bits(PTable *prob_table, HuffTable *distinc
     for (i = 0; i < from->item_idx[min]; i++) {
         nbits[from->items[i]]++;
     }
+    memset(counts, 0, sizeof(counts[0]) * max_length + 1);
     // we don't want to return the 256 bit count (it was just in here to prevent
     // all 1s encoding)
     j = 0;
@@ -164,6 +153,7 @@ static void mjpegenc_huffman_compute_bits(PTable *prob_table, HuffTable *distinc
         if (nbits[i] > 0) {
             distincts[j].code = i;
             distincts[j].length = nbits[i];
+            counts[nbits[i]]++;
             j++;
         }
     }
@@ -188,6 +178,7 @@ void ff_mjpeg_encode_huffman_close(MJpegEncHuffmanContext *s, uint8_t bits[17],
     int nval;
     PTable val_counts[257];
     HuffTable distincts[256];
+    unsigned index[17];
 
     av_assert1(max_nval <= FF_ARRAY_ELEMS(val_counts) - 1);
 
@@ -202,12 +193,12 @@ void ff_mjpeg_encode_huffman_close(MJpegEncHuffmanContext *s, uint8_t bits[17],
     }
     val_counts[nval].value = 256;
     val_counts[nval].prob  = 0;
-    mjpegenc_huffman_compute_bits(val_counts, distincts, nval + 1, 16);
-    AV_QSORT(distincts, nval, HuffTable, compare_by_length);
 
-    memset(bits, 0, sizeof(bits[0]) * 17);
-    for (int i = 0; i < nval; i++) {
-        val[i] = distincts[i].code;
-        bits[distincts[i].length]++;
-    }
+    mjpegenc_huffman_compute_bits(val_counts, distincts, bits, nval + 1, 16);
+
+    index[1] = 0;
+    for (int i = 1; i < 16; ++i)
+        index[i + 1] = index[i] + bits[i];
+    for (int i = 0; i < nval; i++)
+        val[index[distincts[i].length]++] = distincts[i].code;
 }
diff --git a/libavcodec/tests/mjpegenc_huffman.c b/libavcodec/tests/mjpegenc_huffman.c
index 39ad10c454..6125776afc 100644
--- a/libavcodec/tests/mjpegenc_huffman.c
+++ b/libavcodec/tests/mjpegenc_huffman.c
@@ -36,6 +36,7 @@ static int check_lengths(int L, int expected_length,
 {
     HuffTable lengths[256];
     PTable val_counts[256];
+    uint8_t unused[17];
     int actual_length = 0, i, j, k, prob, length;
     int ret = 0;
     double cantor_measure = 0;
@@ -45,7 +46,7 @@ static int check_lengths(int L, int expected_length,
         val_counts[i] = (PTable){.value = i, .prob = probs[i]};
     }
 
-    mjpegenc_huffman_compute_bits(val_counts, lengths, nprobs, L);
+    mjpegenc_huffman_compute_bits(val_counts, lengths, unused, nprobs, L);
 
     for (i = 0; i < nprobs; i++) {
         // Find the value's prob and length
@@ -134,10 +135,11 @@ int main(int argc, char **argv)
     };
     // Actual code lengths
     HuffTable distincts[5];
+    uint8_t unused[17];
 
     // Build optimal huffman tree using an internal function, to allow for
     // smaller-than-normal test cases. This mutates val_counts by sorting.
-    mjpegenc_huffman_compute_bits(val_counts, distincts,
+    mjpegenc_huffman_compute_bits(val_counts, distincts, unused,
                                   FF_ARRAY_ELEMS(distincts), 3);
 
     for (i = 0; i < FF_ARRAY_ELEMS(distincts); i++) {
diff --git a/tests/ref/fate/jpg-icc b/tests/ref/fate/jpg-icc
index ee1aca4df1..f081113c9d 100644
--- a/tests/ref/fate/jpg-icc
+++ b/tests/ref/fate/jpg-icc
@@ -1,5 +1,5 @@
-5c83d22a628d01c095704f58328f63c9 *tests/data/fate/jpg-icc.mjpeg
-11016 tests/data/fate/jpg-icc.mjpeg
+9cd60fcae22de246eb38891b64f53574 *tests/data/fate/jpg-icc.mjpeg
+11012 tests/data/fate/jpg-icc.mjpeg
 #tb 0: 1/25
 #media_type 0: video
 #codec_id 0: rawvideo
@@ -19,7 +19,7 @@ best_effort_timestamp_time=0.000000
 duration=1
 duration_time=0.040000
 pkt_pos=0
-pkt_size=11016
+pkt_size=11012
 width=128
 height=128
 crop_top=0
diff --git a/tests/ref/lavf/jpg b/tests/ref/lavf/jpg
index 1420d46c6c..a3a5d17538 100644
--- a/tests/ref/lavf/jpg
+++ b/tests/ref/lavf/jpg
@@ -1,3 +1,3 @@
-64885ae70c3450b50196ce687a672dbe *tests/data/images/jpg/02.jpg
-26062 tests/data/images/jpg/02.jpg
+02c570d54499483977282f4ed5c7c0e3 *tests/data/images/jpg/02.jpg
+26064 tests/data/images/jpg/02.jpg
 tests/data/images/jpg/%02d.jpg CRC=0x1c357a3e
diff --git a/tests/ref/lavf/smjpeg b/tests/ref/lavf/smjpeg
index 832b8e99a6..7bab0d94f1 100644
--- a/tests/ref/lavf/smjpeg
+++ b/tests/ref/lavf/smjpeg
@@ -1,3 +1,3 @@
-659757345ce01f8a5c4c1373bd073d41 *tests/data/lavf/lavf.smjpeg
-728268 tests/data/lavf/lavf.smjpeg
+091108f9382943669b86ecbe2a724022 *tests/data/lavf/lavf.smjpeg
+728347 tests/data/lavf/lavf.smjpeg
 tests/data/lavf/lavf.smjpeg CRC=0x29d58fb8
diff --git a/tests/ref/seek/vsynth_lena-mjpeg b/tests/ref/seek/vsynth_lena-mjpeg
index 41f0c615ea..b374fcd9ca 100644
--- a/tests/ref/seek/vsynth_lena-mjpeg
+++ b/tests/ref/seek/vsynth_lena-mjpeg
@@ -1,46 +1,46 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11224
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11222
 ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11224
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11222
 ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 592510 size: 14069
+ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 592358 size: 14068
 ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 232724 size: 12267
+ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 232624 size: 12259
 ret:-1         st: 0 flags:1  ts:-0.320000
 ret:-1         st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 453244 size: 13732
+ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 453092 size: 13736
 ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 104162 size: 11211
+ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 104126 size: 11212
 ret:-1         st: 0 flags:1  ts:-0.760000
 ret:-1         st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 307478 size: 12725
+ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 307356 size: 12720
 ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11224
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11222
 ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 620688 size: 14145
+ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 620522 size: 14138
 ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 536394 size: 13965
+ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 536240 size: 13969
 ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 184556 size: 11973
+ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 184488 size: 11963
 ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11224
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11222
 ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 620688 size: 14145
+ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 620522 size: 14138
 ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 399054 size: 13347
+ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 398920 size: 13343
 ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:  59930 size: 10980
+ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:  59914 size: 10975
 ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11224
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11222
 ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 620688 size: 14145
+ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 620522 size: 14138
 ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 257278 size: 12415
+ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 257176 size: 12411
 ret:-1         st:-1 flags:1  ts:-0.222493
 ret:-1         st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 480846 size: 13843
+ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 480696 size: 13840
 ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 137982 size: 11451
+ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 137932 size: 11451
 ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/vsynth/vsynth1-mjpeg b/tests/ref/vsynth/vsynth1-mjpeg
index 89ed7dd9c0..b81d4eeb1a 100644
--- a/tests/ref/vsynth/vsynth1-mjpeg
+++ b/tests/ref/vsynth/vsynth1-mjpeg
@@ -1,4 +1,4 @@
-827f4da674de95b4227aadda8dbdaa77 *tests/data/fate/vsynth1-mjpeg.avi
-1391436 tests/data/fate/vsynth1-mjpeg.avi
+76fde1dcc129b6f1f67f2b93cb2e145e *tests/data/fate/vsynth1-mjpeg.avi
+1391234 tests/data/fate/vsynth1-mjpeg.avi
 f46e58458ea57495a494650f7153829d *tests/data/fate/vsynth1-mjpeg.out.rawvideo
 stddev:    7.87 PSNR: 30.21 MAXDIFF:   63 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-mjpeg-422 b/tests/ref/vsynth/vsynth1-mjpeg-422
index 095f2b2497..21db2ab23b 100644
--- a/tests/ref/vsynth/vsynth1-mjpeg-422
+++ b/tests/ref/vsynth/vsynth1-mjpeg-422
@@ -1,4 +1,4 @@
-eb0f7dc02efd5f4ab7ea3c73617801a3 *tests/data/fate/vsynth1-mjpeg-422.avi
-1611674 tests/data/fate/vsynth1-mjpeg-422.avi
+b1ee6bf4a661ef8578689059d4064057 *tests/data/fate/vsynth1-mjpeg-422.avi
+1611644 tests/data/fate/vsynth1-mjpeg-422.avi
 bc62d53cce32a595a0c6e9c318e4ce3e *tests/data/fate/vsynth1-mjpeg-422.out.rawvideo
 stddev:    7.45 PSNR: 30.69 MAXDIFF:   63 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-mjpeg-444 b/tests/ref/vsynth/vsynth1-mjpeg-444
index 77609c5a45..194efbc069 100644
--- a/tests/ref/vsynth/vsynth1-mjpeg-444
+++ b/tests/ref/vsynth/vsynth1-mjpeg-444
@@ -1,4 +1,4 @@
-bfde676dad356228f77aa319f046db8a *tests/data/fate/vsynth1-mjpeg-444.avi
-1831606 tests/data/fate/vsynth1-mjpeg-444.avi
+e68c62b1796a5ac024e7fd6a264f9fa9 *tests/data/fate/vsynth1-mjpeg-444.avi
+1831406 tests/data/fate/vsynth1-mjpeg-444.avi
 c51ee467d03242dfc1e4536b0485d00f *tests/data/fate/vsynth1-mjpeg-444.out.rawvideo
 stddev:    7.37 PSNR: 30.77 MAXDIFF:   63 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-mjpeg-huffman b/tests/ref/vsynth/vsynth1-mjpeg-huffman
index 7591c5b393..6616c729c2 100644
--- a/tests/ref/vsynth/vsynth1-mjpeg-huffman
+++ b/tests/ref/vsynth/vsynth1-mjpeg-huffman
@@ -1,4 +1,4 @@
-827f4da674de95b4227aadda8dbdaa77 *tests/data/fate/vsynth1-mjpeg-huffman.avi
-1391436 tests/data/fate/vsynth1-mjpeg-huffman.avi
+76fde1dcc129b6f1f67f2b93cb2e145e *tests/data/fate/vsynth1-mjpeg-huffman.avi
+1391234 tests/data/fate/vsynth1-mjpeg-huffman.avi
 f46e58458ea57495a494650f7153829d *tests/data/fate/vsynth1-mjpeg-huffman.out.rawvideo
 stddev:    7.87 PSNR: 30.21 MAXDIFF:   63 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-mjpeg-trell b/tests/ref/vsynth/vsynth1-mjpeg-trell
index e978c636de..8375221988 100644
--- a/tests/ref/vsynth/vsynth1-mjpeg-trell
+++ b/tests/ref/vsynth/vsynth1-mjpeg-trell
@@ -1,4 +1,4 @@
-e097a118dd37b3ab5607278d7b675ea3 *tests/data/fate/vsynth1-mjpeg-trell.avi
-1361112 tests/data/fate/vsynth1-mjpeg-trell.avi
+90b6f3d07eef09b96cfe6de0b9ae893d *tests/data/fate/vsynth1-mjpeg-trell.avi
+1360912 tests/data/fate/vsynth1-mjpeg-trell.avi
 548de4f6098cbc3d8b65574bb93faf09 *tests/data/fate/vsynth1-mjpeg-trell.out.rawvideo
 stddev:    7.67 PSNR: 30.42 MAXDIFF:   62 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-mjpeg-trell-huffman b/tests/ref/vsynth/vsynth1-mjpeg-trell-huffman
index f54b3663f1..aaa87e96d2 100644
--- a/tests/ref/vsynth/vsynth1-mjpeg-trell-huffman
+++ b/tests/ref/vsynth/vsynth1-mjpeg-trell-huffman
@@ -1,4 +1,4 @@
-e097a118dd37b3ab5607278d7b675ea3 *tests/data/fate/vsynth1-mjpeg-trell-huffman.avi
-1361112 tests/data/fate/vsynth1-mjpeg-trell-huffman.avi
+90b6f3d07eef09b96cfe6de0b9ae893d *tests/data/fate/vsynth1-mjpeg-trell-huffman.avi
+1360912 tests/data/fate/vsynth1-mjpeg-trell-huffman.avi
 548de4f6098cbc3d8b65574bb93faf09 *tests/data/fate/vsynth1-mjpeg-trell-huffman.out.rawvideo
 stddev:    7.67 PSNR: 30.42 MAXDIFF:   62 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-mjpeg b/tests/ref/vsynth/vsynth2-mjpeg
index b3954bbb5f..bd9791c73f 100644
--- a/tests/ref/vsynth/vsynth2-mjpeg
+++ b/tests/ref/vsynth/vsynth2-mjpeg
@@ -1,4 +1,4 @@
-2a959ad89469d88894d03dc9ce83e8b9 *tests/data/fate/vsynth2-mjpeg.avi
-792950 tests/data/fate/vsynth2-mjpeg.avi
+fd9061a1055cf2018fc4de38dc0dcf1d *tests/data/fate/vsynth2-mjpeg.avi
+792756 tests/data/fate/vsynth2-mjpeg.avi
 fe498d9edaa947e435e4f353c194ef3d *tests/data/fate/vsynth2-mjpeg.out.rawvideo
 stddev:    4.87 PSNR: 34.37 MAXDIFF:   55 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-mjpeg-422 b/tests/ref/vsynth/vsynth2-mjpeg-422
index 4978501f35..f8049ef7ae 100644
--- a/tests/ref/vsynth/vsynth2-mjpeg-422
+++ b/tests/ref/vsynth/vsynth2-mjpeg-422
@@ -1,4 +1,4 @@
-67a35df8ef714568db0362f4dce400fb *tests/data/fate/vsynth2-mjpeg-422.avi
-877718 tests/data/fate/vsynth2-mjpeg-422.avi
+92567a5474b6decd50eb187f685aa6e2 *tests/data/fate/vsynth2-mjpeg-422.avi
+877630 tests/data/fate/vsynth2-mjpeg-422.avi
 7fae296bb4290d09971a629040eac072 *tests/data/fate/vsynth2-mjpeg-422.out.rawvideo
 stddev:    4.69 PSNR: 34.69 MAXDIFF:   55 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-mjpeg-444 b/tests/ref/vsynth/vsynth2-mjpeg-444
index 6321301571..e1b8edbd6b 100644
--- a/tests/ref/vsynth/vsynth2-mjpeg-444
+++ b/tests/ref/vsynth/vsynth2-mjpeg-444
@@ -1,4 +1,4 @@
-24e04a6e3b645b3314e522cc6b4d3fb7 *tests/data/fate/vsynth2-mjpeg-444.avi
-1005214 tests/data/fate/vsynth2-mjpeg-444.avi
+3ed573850f79cd56fe8ddef2bdf2c5cf *tests/data/fate/vsynth2-mjpeg-444.avi
+1005048 tests/data/fate/vsynth2-mjpeg-444.avi
 fbeca59755dfb2b5e2f2c9781756d634 *tests/data/fate/vsynth2-mjpeg-444.out.rawvideo
 stddev:    4.57 PSNR: 34.93 MAXDIFF:   55 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-mjpeg-huffman b/tests/ref/vsynth/vsynth2-mjpeg-huffman
index 17601e20f8..01bf3919f3 100644
--- a/tests/ref/vsynth/vsynth2-mjpeg-huffman
+++ b/tests/ref/vsynth/vsynth2-mjpeg-huffman
@@ -1,4 +1,4 @@
-2a959ad89469d88894d03dc9ce83e8b9 *tests/data/fate/vsynth2-mjpeg-huffman.avi
-792950 tests/data/fate/vsynth2-mjpeg-huffman.avi
+fd9061a1055cf2018fc4de38dc0dcf1d *tests/data/fate/vsynth2-mjpeg-huffman.avi
+792756 tests/data/fate/vsynth2-mjpeg-huffman.avi
 fe498d9edaa947e435e4f353c194ef3d *tests/data/fate/vsynth2-mjpeg-huffman.out.rawvideo
 stddev:    4.87 PSNR: 34.37 MAXDIFF:   55 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-mjpeg-trell b/tests/ref/vsynth/vsynth2-mjpeg-trell
index 993aaca60f..dca288e927 100644
--- a/tests/ref/vsynth/vsynth2-mjpeg-trell
+++ b/tests/ref/vsynth/vsynth2-mjpeg-trell
@@ -1,4 +1,4 @@
-d6a09ff8a46c297934496d8089cdd2a2 *tests/data/fate/vsynth2-mjpeg-trell.avi
-734896 tests/data/fate/vsynth2-mjpeg-trell.avi
+04a8a2d77a681f5781afdea8b6df367e *tests/data/fate/vsynth2-mjpeg-trell.avi
+734780 tests/data/fate/vsynth2-mjpeg-trell.avi
 8612dfee87e32268f6f533188a097785 *tests/data/fate/vsynth2-mjpeg-trell.out.rawvideo
 stddev:    5.03 PSNR: 34.10 MAXDIFF:   67 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-mjpeg-trell-huffman b/tests/ref/vsynth/vsynth2-mjpeg-trell-huffman
index de7a029315..ff1acb539b 100644
--- a/tests/ref/vsynth/vsynth2-mjpeg-trell-huffman
+++ b/tests/ref/vsynth/vsynth2-mjpeg-trell-huffman
@@ -1,4 +1,4 @@
-d6a09ff8a46c297934496d8089cdd2a2 *tests/data/fate/vsynth2-mjpeg-trell-huffman.avi
-734896 tests/data/fate/vsynth2-mjpeg-trell-huffman.avi
+04a8a2d77a681f5781afdea8b6df367e *tests/data/fate/vsynth2-mjpeg-trell-huffman.avi
+734780 tests/data/fate/vsynth2-mjpeg-trell-huffman.avi
 8612dfee87e32268f6f533188a097785 *tests/data/fate/vsynth2-mjpeg-trell-huffman.out.rawvideo
 stddev:    5.03 PSNR: 34.10 MAXDIFF:   67 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-mjpeg b/tests/ref/vsynth/vsynth3-mjpeg
index ebcbc784e5..ed170d029f 100644
--- a/tests/ref/vsynth/vsynth3-mjpeg
+++ b/tests/ref/vsynth/vsynth3-mjpeg
@@ -1,4 +1,4 @@
-62a7732fcb9288a7223671b23ce06fa0 *tests/data/fate/vsynth3-mjpeg.avi
-48170 tests/data/fate/vsynth3-mjpeg.avi
+d64096d2f87e910e6b3a4ee87b002d2d *tests/data/fate/vsynth3-mjpeg.avi
+48156 tests/data/fate/vsynth3-mjpeg.avi
 a6daba607898eb6e1a172c2368084a67 *tests/data/fate/vsynth3-mjpeg.out.rawvideo
 stddev:    8.61 PSNR: 29.43 MAXDIFF:   58 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-mjpeg-422 b/tests/ref/vsynth/vsynth3-mjpeg-422
index cc2bbe2224..f36ce0444d 100644
--- a/tests/ref/vsynth/vsynth3-mjpeg-422
+++ b/tests/ref/vsynth/vsynth3-mjpeg-422
@@ -1,4 +1,4 @@
-9aa0f90dac7ef923a0be0d93ca7dc039 *tests/data/fate/vsynth3-mjpeg-422.avi
-52620 tests/data/fate/vsynth3-mjpeg-422.avi
+719eac54f73a371d6393dfe9ebe54cb2 *tests/data/fate/vsynth3-mjpeg-422.avi
+52606 tests/data/fate/vsynth3-mjpeg-422.avi
 7c64ab866add1e59fe7c34feed006df1 *tests/data/fate/vsynth3-mjpeg-422.out.rawvideo
 stddev:    8.22 PSNR: 29.82 MAXDIFF:   58 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-mjpeg-444 b/tests/ref/vsynth/vsynth3-mjpeg-444
index 1149953b62..2c1660a941 100644
--- a/tests/ref/vsynth/vsynth3-mjpeg-444
+++ b/tests/ref/vsynth/vsynth3-mjpeg-444
@@ -1,4 +1,4 @@
-c063ea1cddfc2a360b92f05d1811ea93 *tests/data/fate/vsynth3-mjpeg-444.avi
-53954 tests/data/fate/vsynth3-mjpeg-444.avi
+08c7bd010cbb0057f867ee235cf029f3 *tests/data/fate/vsynth3-mjpeg-444.avi
+53970 tests/data/fate/vsynth3-mjpeg-444.avi
 8bbbfeab8b3f6788719e1f0f77ce8612 *tests/data/fate/vsynth3-mjpeg-444.out.rawvideo
 stddev:    8.21 PSNR: 29.84 MAXDIFF:   58 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-mjpeg-huffman b/tests/ref/vsynth/vsynth3-mjpeg-huffman
index 00a4cef6f0..858fdcf444 100644
--- a/tests/ref/vsynth/vsynth3-mjpeg-huffman
+++ b/tests/ref/vsynth/vsynth3-mjpeg-huffman
@@ -1,4 +1,4 @@
-62a7732fcb9288a7223671b23ce06fa0 *tests/data/fate/vsynth3-mjpeg-huffman.avi
-48170 tests/data/fate/vsynth3-mjpeg-huffman.avi
+d64096d2f87e910e6b3a4ee87b002d2d *tests/data/fate/vsynth3-mjpeg-huffman.avi
+48156 tests/data/fate/vsynth3-mjpeg-huffman.avi
 a6daba607898eb6e1a172c2368084a67 *tests/data/fate/vsynth3-mjpeg-huffman.out.rawvideo
 stddev:    8.61 PSNR: 29.43 MAXDIFF:   58 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-mjpeg-trell b/tests/ref/vsynth/vsynth3-mjpeg-trell
index 5bfa3e0e12..79048a12cb 100644
--- a/tests/ref/vsynth/vsynth3-mjpeg-trell
+++ b/tests/ref/vsynth/vsynth3-mjpeg-trell
@@ -1,4 +1,4 @@
-7cbc02d85a572b5ea871c014ce27ab4c *tests/data/fate/vsynth3-mjpeg-trell.avi
-47834 tests/data/fate/vsynth3-mjpeg-trell.avi
+56a71287275ab4cda4b62580b875437f *tests/data/fate/vsynth3-mjpeg-trell.avi
+47848 tests/data/fate/vsynth3-mjpeg-trell.avi
 07822517628b20d54621df666ea79af3 *tests/data/fate/vsynth3-mjpeg-trell.out.rawvideo
 stddev:    8.27 PSNR: 29.78 MAXDIFF:   55 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-mjpeg-trell-huffman b/tests/ref/vsynth/vsynth3-mjpeg-trell-huffman
index 965a9e7792..755d625de2 100644
--- a/tests/ref/vsynth/vsynth3-mjpeg-trell-huffman
+++ b/tests/ref/vsynth/vsynth3-mjpeg-trell-huffman
@@ -1,4 +1,4 @@
-7cbc02d85a572b5ea871c014ce27ab4c *tests/data/fate/vsynth3-mjpeg-trell-huffman.avi
-47834 tests/data/fate/vsynth3-mjpeg-trell-huffman.avi
+56a71287275ab4cda4b62580b875437f *tests/data/fate/vsynth3-mjpeg-trell-huffman.avi
+47848 tests/data/fate/vsynth3-mjpeg-trell-huffman.avi
 07822517628b20d54621df666ea79af3 *tests/data/fate/vsynth3-mjpeg-trell-huffman.out.rawvideo
 stddev:    8.27 PSNR: 29.78 MAXDIFF:   55 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth_lena-mjpeg b/tests/ref/vsynth/vsynth_lena-mjpeg
index f56928dd55..5737e71ab6 100644
--- a/tests/ref/vsynth/vsynth_lena-mjpeg
+++ b/tests/ref/vsynth/vsynth_lena-mjpeg
@@ -1,4 +1,4 @@
-d8b968d6ecaa83bb120eb0dd08c3f6df *tests/data/fate/vsynth_lena-mjpeg.avi
-635642 tests/data/fate/vsynth_lena-mjpeg.avi
+eaf893d7b56dbc6cbb8a6da507f93926 *tests/data/fate/vsynth_lena-mjpeg.avi
+635468 tests/data/fate/vsynth_lena-mjpeg.avi
 095f88a721813c2a1c34b26303c1139a *tests/data/fate/vsynth_lena-mjpeg.out.rawvideo
 stddev:    4.33 PSNR: 35.40 MAXDIFF:   49 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-mjpeg-422 b/tests/ref/vsynth/vsynth_lena-mjpeg-422
index bb862da006..3f95a7a0e9 100644
--- a/tests/ref/vsynth/vsynth_lena-mjpeg-422
+++ b/tests/ref/vsynth/vsynth_lena-mjpeg-422
@@ -1,4 +1,4 @@
-494812cc00c2d51df2d9cbc03dc9eecd *tests/data/fate/vsynth_lena-mjpeg-422.avi
-707466 tests/data/fate/vsynth_lena-mjpeg-422.avi
+7690001a0545408b5f24fe759c317531 *tests/data/fate/vsynth_lena-mjpeg-422.avi
+707328 tests/data/fate/vsynth_lena-mjpeg-422.avi
 16d2be35266d303dff3361e4535e8dd8 *tests/data/fate/vsynth_lena-mjpeg-422.out.rawvideo
 stddev:    4.18 PSNR: 35.70 MAXDIFF:   49 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-mjpeg-444 b/tests/ref/vsynth/vsynth_lena-mjpeg-444
index cef6dd9eec..998c08658e 100644
--- a/tests/ref/vsynth/vsynth_lena-mjpeg-444
+++ b/tests/ref/vsynth/vsynth_lena-mjpeg-444
@@ -1,4 +1,4 @@
-52996e606d20fe34c327a206be066091 *tests/data/fate/vsynth_lena-mjpeg-444.avi
-807472 tests/data/fate/vsynth_lena-mjpeg-444.avi
+0226bade7ead7283c068dc3f087b0056 *tests/data/fate/vsynth_lena-mjpeg-444.avi
+807310 tests/data/fate/vsynth_lena-mjpeg-444.avi
 0db1c1942d750b107acf2acfbe08eacb *tests/data/fate/vsynth_lena-mjpeg-444.out.rawvideo
 stddev:    4.05 PSNR: 35.96 MAXDIFF:   49 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-mjpeg-huffman b/tests/ref/vsynth/vsynth_lena-mjpeg-huffman
index 5f5e19bb67..95239e4ac4 100644
--- a/tests/ref/vsynth/vsynth_lena-mjpeg-huffman
+++ b/tests/ref/vsynth/vsynth_lena-mjpeg-huffman
@@ -1,4 +1,4 @@
-d8b968d6ecaa83bb120eb0dd08c3f6df *tests/data/fate/vsynth_lena-mjpeg-huffman.avi
-635642 tests/data/fate/vsynth_lena-mjpeg-huffman.avi
+eaf893d7b56dbc6cbb8a6da507f93926 *tests/data/fate/vsynth_lena-mjpeg-huffman.avi
+635468 tests/data/fate/vsynth_lena-mjpeg-huffman.avi
 095f88a721813c2a1c34b26303c1139a *tests/data/fate/vsynth_lena-mjpeg-huffman.out.rawvideo
 stddev:    4.33 PSNR: 35.40 MAXDIFF:   49 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-mjpeg-trell b/tests/ref/vsynth/vsynth_lena-mjpeg-trell
index ca7f1b1d03..88679a4c77 100644
--- a/tests/ref/vsynth/vsynth_lena-mjpeg-trell
+++ b/tests/ref/vsynth/vsynth_lena-mjpeg-trell
@@ -1,4 +1,4 @@
-8217aef7ee16709b2c0591a9a28d9bb8 *tests/data/fate/vsynth_lena-mjpeg-trell.avi
-582648 tests/data/fate/vsynth_lena-mjpeg-trell.avi
+11855d1b59e8276db2ea2cf1719b9801 *tests/data/fate/vsynth_lena-mjpeg-trell.avi
+582520 tests/data/fate/vsynth_lena-mjpeg-trell.avi
 8c5c05e82a959ccc8b3c4ba8e4123bbe *tests/data/fate/vsynth_lena-mjpeg-trell.out.rawvideo
 stddev:    4.51 PSNR: 35.04 MAXDIFF:   60 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-mjpeg-trell-huffman b/tests/ref/vsynth/vsynth_lena-mjpeg-trell-huffman
index 2eb1658363..0baabc28d2 100644
--- a/tests/ref/vsynth/vsynth_lena-mjpeg-trell-huffman
+++ b/tests/ref/vsynth/vsynth_lena-mjpeg-trell-huffman
@@ -1,4 +1,4 @@
-8217aef7ee16709b2c0591a9a28d9bb8 *tests/data/fate/vsynth_lena-mjpeg-trell-huffman.avi
-582648 tests/data/fate/vsynth_lena-mjpeg-trell-huffman.avi
+11855d1b59e8276db2ea2cf1719b9801 *tests/data/fate/vsynth_lena-mjpeg-trell-huffman.avi
+582520 tests/data/fate/vsynth_lena-mjpeg-trell-huffman.avi
 8c5c05e82a959ccc8b3c4ba8e4123bbe *tests/data/fate/vsynth_lena-mjpeg-trell-huffman.out.rawvideo
 stddev:    4.51 PSNR: 35.04 MAXDIFF:   60 bytes:  7603200/  7603200
-- 
2.45.2


[-- Attachment #22: 0021-tests-fate-vcodec-Test-default-Huffman-tables-too.patch --]
[-- Type: text/x-patch, Size: 14522 bytes --]

From b5bfecf0c38acb7f6d2127b480b729d56af287bf Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Wed, 2 Apr 2025 15:48:29 +0200
Subject: [PATCH 21/23] tests/fate/vcodec: Test "default" Huffman tables, too

Since 45eeb1f785d6c726181568db341bbf80b43e32c0
optimal Huffman tables are the default (without slice-threading).
This made the fate-vsynth*-mjpeg-{trell-,}-huffman tests
identical to their corresponding tests without "-huffman".

This is of course wasteful, so switch the two tests with
"-huffman" counterparts back to the default tables.
Also use one of these tests to test slice threaded encoding.
It has so far been untested.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 tests/fate/vcodec.mak                    |  4 +--
 tests/ref/seek/lavf-jpg                  |  8 ++---
 tests/ref/seek/vsynth_lena-mjpeg         | 40 ++++++++++++------------
 tests/ref/vsynth/vsynth1-mjpeg           |  4 +--
 tests/ref/vsynth/vsynth1-mjpeg-trell     |  8 ++---
 tests/ref/vsynth/vsynth2-mjpeg           |  4 +--
 tests/ref/vsynth/vsynth2-mjpeg-trell     |  8 ++---
 tests/ref/vsynth/vsynth3-mjpeg           |  4 +--
 tests/ref/vsynth/vsynth3-mjpeg-trell     |  8 ++---
 tests/ref/vsynth/vsynth_lena-mjpeg       |  4 +--
 tests/ref/vsynth/vsynth_lena-mjpeg-trell |  8 ++---
 11 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index f433feac69..09e241127c 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -234,10 +234,10 @@ FATE_VCODEC-$(call ENCDEC, LJPEG MJPEG, AVI) += ljpeg
 fate-vsynth%-ljpeg:              ENCOPTS = -strict -1
 
 FATE_VCODEC_SCALE-$(call ENCDEC, MJPEG, AVI) += mjpeg mjpeg-422 mjpeg-444 mjpeg-trell mjpeg-huffman mjpeg-trell-huffman
-fate-vsynth%-mjpeg:                   ENCOPTS = -qscale 9 -pix_fmt yuvj420p
+fate-vsynth%-mjpeg:                   ENCOPTS = -qscale 9 -pix_fmt yuvj420p -huffman default -threads 5 -thread_type slice
 fate-vsynth%-mjpeg-422:               ENCOPTS = -qscale 9 -pix_fmt yuvj422p
 fate-vsynth%-mjpeg-444:               ENCOPTS = -qscale 9 -pix_fmt yuvj444p
-fate-vsynth%-mjpeg-trell:             ENCOPTS = -qscale 9 -pix_fmt yuvj420p -trellis 1
+fate-vsynth%-mjpeg-trell:             ENCOPTS = -qscale 9 -pix_fmt yuvj420p -trellis 1 -huffman default
 fate-vsynth%-mjpeg-huffman:           ENCOPTS = -qscale 9 -pix_fmt yuvj420p -huffman optimal
 fate-vsynth%-mjpeg-trell-huffman:     ENCOPTS = -qscale 9 -pix_fmt yuvj420p -trellis 1 -huffman optimal
 
diff --git a/tests/ref/seek/lavf-jpg b/tests/ref/seek/lavf-jpg
index 78e8255fac..c770155682 100644
--- a/tests/ref/seek/lavf-jpg
+++ b/tests/ref/seek/lavf-jpg
@@ -1,4 +1,4 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size: 25633
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:     -1 size: 25640
 ret:-EINVAL    st:-1 flags:0  ts:-1.000000
 ret:-EINVAL    st:-1 flags:1  ts: 1.894167
 ret:-EINVAL    st: 0 flags:0  ts: 0.800000
@@ -6,7 +6,7 @@ ret:-EINVAL    st: 0 flags:1  ts:-0.320000
 ret:-EINVAL    st:-1 flags:0  ts: 2.576668
 ret:-EINVAL    st:-1 flags:1  ts: 1.470835
 ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:     -1 size: 25312
+ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos:     -1 size: 25309
 ret:-EINVAL    st: 0 flags:1  ts:-0.760000
 ret:-EINVAL    st:-1 flags:0  ts: 2.153336
 ret:-EINVAL    st:-1 flags:1  ts: 1.047503
@@ -18,7 +18,7 @@ ret:-EINVAL    st: 0 flags:0  ts:-0.480000
 ret:-EINVAL    st: 0 flags:1  ts: 2.400000
 ret:-EINVAL    st:-1 flags:0  ts: 1.306672
 ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:     -1 size: 25799
+ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:     -1 size: 25793
 ret:-EINVAL    st: 0 flags:0  ts:-0.920000
 ret:-EINVAL    st: 0 flags:1  ts: 2.000000
 ret:-EINVAL    st:-1 flags:0  ts: 0.883340
@@ -26,5 +26,5 @@ ret:-EINVAL    st:-1 flags:1  ts:-0.222493
 ret:-EINVAL    st: 0 flags:0  ts: 2.680000
 ret:-EINVAL    st: 0 flags:1  ts: 1.560000
 ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:     -1 size: 25489
+ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos:     -1 size: 25506
 ret:-EINVAL    st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/seek/vsynth_lena-mjpeg b/tests/ref/seek/vsynth_lena-mjpeg
index b374fcd9ca..5fb3ee6ee4 100644
--- a/tests/ref/seek/vsynth_lena-mjpeg
+++ b/tests/ref/seek/vsynth_lena-mjpeg
@@ -1,46 +1,46 @@
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11222
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 12162
 ret: 0         st:-1 flags:0  ts:-1.000000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11222
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 12162
 ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 592358 size: 14068
+ret: 0         st: 0 flags:1 dts: 1.880000 pts: 1.880000 pos: 630752 size: 14882
 ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 232624 size: 12259
+ret: 0         st: 0 flags:1 dts: 0.800000 pts: 0.800000 pos: 248748 size: 13032
 ret:-1         st: 0 flags:1  ts:-0.320000
 ret:-1         st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 453092 size: 13736
+ret: 0         st: 0 flags:1 dts: 1.480000 pts: 1.480000 pos: 483058 size: 14588
 ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 104126 size: 11212
+ret: 0         st: 0 flags:1 dts: 0.360000 pts: 0.360000 pos: 111546 size: 11997
 ret:-1         st: 0 flags:1  ts:-0.760000
 ret:-1         st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 307356 size: 12720
+ret: 0         st: 0 flags:1 dts: 1.040000 pts: 1.040000 pos: 328288 size: 13537
 ret: 0         st: 0 flags:0  ts:-0.040000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11222
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 12162
 ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 620522 size: 14138
+ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 660542 size: 14951
 ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 536240 size: 13969
+ret: 0         st: 0 flags:1 dts: 1.720000 pts: 1.720000 pos: 571292 size: 14812
 ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 184488 size: 11963
+ret: 0         st: 0 flags:1 dts: 0.640000 pts: 0.640000 pos: 197392 size: 12793
 ret: 0         st: 0 flags:0  ts:-0.480000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11222
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 12162
 ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 620522 size: 14138
+ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 660542 size: 14951
 ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 398920 size: 13343
+ret: 0         st: 0 flags:1 dts: 1.320000 pts: 1.320000 pos: 425512 size: 14182
 ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:  59914 size: 10975
+ret: 0         st: 0 flags:1 dts: 0.200000 pts: 0.200000 pos:  64152 size: 11780
 ret: 0         st: 0 flags:0  ts:-0.920000
-ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 11222
+ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5652 size: 12162
 ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 620522 size: 14138
+ret: 0         st: 0 flags:1 dts: 1.960000 pts: 1.960000 pos: 660542 size: 14951
 ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 257176 size: 12411
+ret: 0         st: 0 flags:1 dts: 0.880000 pts: 0.880000 pos: 274872 size: 13185
 ret:-1         st:-1 flags:1  ts:-0.222493
 ret:-1         st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 480696 size: 13840
+ret: 0         st: 0 flags:1 dts: 1.560000 pts: 1.560000 pos: 512354 size: 14672
 ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 137932 size: 11451
+ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 147710 size: 12225
 ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/vsynth/vsynth1-mjpeg b/tests/ref/vsynth/vsynth1-mjpeg
index b81d4eeb1a..fe63ca6c79 100644
--- a/tests/ref/vsynth/vsynth1-mjpeg
+++ b/tests/ref/vsynth/vsynth1-mjpeg
@@ -1,4 +1,4 @@
-76fde1dcc129b6f1f67f2b93cb2e145e *tests/data/fate/vsynth1-mjpeg.avi
-1391234 tests/data/fate/vsynth1-mjpeg.avi
+365e4d16bae64737ea1d3d338d2b127d *tests/data/fate/vsynth1-mjpeg.avi
+1517996 tests/data/fate/vsynth1-mjpeg.avi
 f46e58458ea57495a494650f7153829d *tests/data/fate/vsynth1-mjpeg.out.rawvideo
 stddev:    7.87 PSNR: 30.21 MAXDIFF:   63 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-mjpeg-trell b/tests/ref/vsynth/vsynth1-mjpeg-trell
index 8375221988..19a6823864 100644
--- a/tests/ref/vsynth/vsynth1-mjpeg-trell
+++ b/tests/ref/vsynth/vsynth1-mjpeg-trell
@@ -1,4 +1,4 @@
-90b6f3d07eef09b96cfe6de0b9ae893d *tests/data/fate/vsynth1-mjpeg-trell.avi
-1360912 tests/data/fate/vsynth1-mjpeg-trell.avi
-548de4f6098cbc3d8b65574bb93faf09 *tests/data/fate/vsynth1-mjpeg-trell.out.rawvideo
-stddev:    7.67 PSNR: 30.42 MAXDIFF:   62 bytes:  7603200/  7603200
+fb6d9cbf5bb08daa30c12cd05a1e08c5 *tests/data/fate/vsynth1-mjpeg-trell.avi
+1454282 tests/data/fate/vsynth1-mjpeg-trell.avi
+10cdf1199f1de6b9618e82a36f656860 *tests/data/fate/vsynth1-mjpeg-trell.out.rawvideo
+stddev:    7.71 PSNR: 30.39 MAXDIFF:   63 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-mjpeg b/tests/ref/vsynth/vsynth2-mjpeg
index bd9791c73f..8ba00ef52c 100644
--- a/tests/ref/vsynth/vsynth2-mjpeg
+++ b/tests/ref/vsynth/vsynth2-mjpeg
@@ -1,4 +1,4 @@
-fd9061a1055cf2018fc4de38dc0dcf1d *tests/data/fate/vsynth2-mjpeg.avi
-792756 tests/data/fate/vsynth2-mjpeg.avi
+5ded62861f470b66fc47bf56299626d3 *tests/data/fate/vsynth2-mjpeg.avi
+832994 tests/data/fate/vsynth2-mjpeg.avi
 fe498d9edaa947e435e4f353c194ef3d *tests/data/fate/vsynth2-mjpeg.out.rawvideo
 stddev:    4.87 PSNR: 34.37 MAXDIFF:   55 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-mjpeg-trell b/tests/ref/vsynth/vsynth2-mjpeg-trell
index dca288e927..757cfb7ae8 100644
--- a/tests/ref/vsynth/vsynth2-mjpeg-trell
+++ b/tests/ref/vsynth/vsynth2-mjpeg-trell
@@ -1,4 +1,4 @@
-04a8a2d77a681f5781afdea8b6df367e *tests/data/fate/vsynth2-mjpeg-trell.avi
-734780 tests/data/fate/vsynth2-mjpeg-trell.avi
-8612dfee87e32268f6f533188a097785 *tests/data/fate/vsynth2-mjpeg-trell.out.rawvideo
-stddev:    5.03 PSNR: 34.10 MAXDIFF:   67 bytes:  7603200/  7603200
+8468487344bdb8dc067b9227db788c58 *tests/data/fate/vsynth2-mjpeg-trell.avi
+765928 tests/data/fate/vsynth2-mjpeg-trell.avi
+aae98b3de0ea17d057d8861f91d209ae *tests/data/fate/vsynth2-mjpeg-trell.out.rawvideo
+stddev:    5.03 PSNR: 34.09 MAXDIFF:   67 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-mjpeg b/tests/ref/vsynth/vsynth3-mjpeg
index ed170d029f..6c209da39c 100644
--- a/tests/ref/vsynth/vsynth3-mjpeg
+++ b/tests/ref/vsynth/vsynth3-mjpeg
@@ -1,4 +1,4 @@
-d64096d2f87e910e6b3a4ee87b002d2d *tests/data/fate/vsynth3-mjpeg.avi
-48156 tests/data/fate/vsynth3-mjpeg.avi
+2d2e163b5c49f32354a54f09226a3b30 *tests/data/fate/vsynth3-mjpeg.avi
+65324 tests/data/fate/vsynth3-mjpeg.avi
 a6daba607898eb6e1a172c2368084a67 *tests/data/fate/vsynth3-mjpeg.out.rawvideo
 stddev:    8.61 PSNR: 29.43 MAXDIFF:   58 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-mjpeg-trell b/tests/ref/vsynth/vsynth3-mjpeg-trell
index 79048a12cb..12fe120ca9 100644
--- a/tests/ref/vsynth/vsynth3-mjpeg-trell
+++ b/tests/ref/vsynth/vsynth3-mjpeg-trell
@@ -1,4 +1,4 @@
-56a71287275ab4cda4b62580b875437f *tests/data/fate/vsynth3-mjpeg-trell.avi
-47848 tests/data/fate/vsynth3-mjpeg-trell.avi
-07822517628b20d54621df666ea79af3 *tests/data/fate/vsynth3-mjpeg-trell.out.rawvideo
-stddev:    8.27 PSNR: 29.78 MAXDIFF:   55 bytes:    86700/    86700
+2c68c6bbbb8c78a779c123aaf78f0e23 *tests/data/fate/vsynth3-mjpeg-trell.avi
+63996 tests/data/fate/vsynth3-mjpeg-trell.avi
+dddf01bf0ef33be2492ba0eeb6262dd1 *tests/data/fate/vsynth3-mjpeg-trell.out.rawvideo
+stddev:    8.27 PSNR: 29.77 MAXDIFF:   61 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth_lena-mjpeg b/tests/ref/vsynth/vsynth_lena-mjpeg
index 5737e71ab6..84e342d4e7 100644
--- a/tests/ref/vsynth/vsynth_lena-mjpeg
+++ b/tests/ref/vsynth/vsynth_lena-mjpeg
@@ -1,4 +1,4 @@
-eaf893d7b56dbc6cbb8a6da507f93926 *tests/data/fate/vsynth_lena-mjpeg.avi
-635468 tests/data/fate/vsynth_lena-mjpeg.avi
+230b2e5002e7d2d3b23790fc4e057600 *tests/data/fate/vsynth_lena-mjpeg.avi
+676302 tests/data/fate/vsynth_lena-mjpeg.avi
 095f88a721813c2a1c34b26303c1139a *tests/data/fate/vsynth_lena-mjpeg.out.rawvideo
 stddev:    4.33 PSNR: 35.40 MAXDIFF:   49 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-mjpeg-trell b/tests/ref/vsynth/vsynth_lena-mjpeg-trell
index 88679a4c77..aee9aa92b9 100644
--- a/tests/ref/vsynth/vsynth_lena-mjpeg-trell
+++ b/tests/ref/vsynth/vsynth_lena-mjpeg-trell
@@ -1,4 +1,4 @@
-11855d1b59e8276db2ea2cf1719b9801 *tests/data/fate/vsynth_lena-mjpeg-trell.avi
-582520 tests/data/fate/vsynth_lena-mjpeg-trell.avi
-8c5c05e82a959ccc8b3c4ba8e4123bbe *tests/data/fate/vsynth_lena-mjpeg-trell.out.rawvideo
-stddev:    4.51 PSNR: 35.04 MAXDIFF:   60 bytes:  7603200/  7603200
+47bc34cf66d65e482e326512a7b8e17b *tests/data/fate/vsynth_lena-mjpeg-trell.avi
+613778 tests/data/fate/vsynth_lena-mjpeg-trell.avi
+d3eb3db7e2b74f2a16540c4c438cbb91 *tests/data/fate/vsynth_lena-mjpeg-trell.out.rawvideo
+stddev:    4.51 PSNR: 35.03 MAXDIFF:   60 bytes:  7603200/  7603200
-- 
2.45.2


[-- Attachment #23: 0022-avcodec-m-jx-pegdec-Simplify-freeing-frame.patch --]
[-- Type: text/x-patch, Size: 1455 bytes --]

From 3c0b941e6879207cd6fe779bfd9e947c2fffbcdd Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Wed, 2 Apr 2025 18:32:10 +0200
Subject: [PATCH 22/23] avcodec/m[jx]pegdec: Simplify freeing frame

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mjpegdec.c | 7 ++-----
 libavcodec/mxpegdec.c | 2 --
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index f3d940671e..a2dca7a88a 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2954,11 +2954,8 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_INFO, "Single field\n");
     }
 
-    if (s->picture) {
-        av_frame_free(&s->picture);
-        s->picture_ptr = NULL;
-    } else if (s->picture_ptr)
-        av_frame_unref(s->picture_ptr);
+    av_frame_free(&s->picture);
+    s->picture_ptr = NULL;
 
     av_frame_free(&s->smv_frame);
 
diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c
index c5c14cbe79..8661bba566 100644
--- a/libavcodec/mxpegdec.c
+++ b/libavcodec/mxpegdec.c
@@ -47,10 +47,8 @@ typedef struct MXpegDecodeContext {
 static av_cold int mxpeg_decode_end(AVCodecContext *avctx)
 {
     MXpegDecodeContext *s = avctx->priv_data;
-    MJpegDecodeContext *jpg = &s->jpg;
     int i;
 
-    jpg->picture_ptr = NULL;
     ff_mjpeg_decode_end(avctx);
 
     for (i = 0; i < 2; ++i)
-- 
2.45.2


[-- Attachment #24: 0023-avcodec-dovi_rpuenc-Constify-dv_levels.patch --]
[-- Type: text/x-patch, Size: 804 bytes --]

From 8c783d6ac5b69c0c1329adebb78ed40d4f9a9ade Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 3 Apr 2025 10:30:22 +0200
Subject: [PATCH 23/23] avcodec/dovi_rpuenc: Constify dv_levels

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/dovi_rpuenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dovi_rpuenc.c b/libavcodec/dovi_rpuenc.c
index 334b2c98a0..2e1f8be08e 100644
--- a/libavcodec/dovi_rpuenc.c
+++ b/libavcodec/dovi_rpuenc.c
@@ -31,7 +31,7 @@
 #include "put_golomb.h"
 #include "libavutil/refstruct.h"
 
-static struct {
+static const struct {
     uint64_t pps; // maximum pixels per second
     int width; // maximum width
     int main; // maximum bitrate in main tier
-- 
2.45.2


[-- Attachment #25: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH 01/23] avcodec/x86/vvc/dsp_init: Make put wrappers static
  2025-04-03 20:31 [FFmpeg-devel] [PATCH 01/23] avcodec/x86/vvc/dsp_init: Make put wrappers static Andreas Rheinhardt
@ 2025-04-05  7:38 ` Michael Niedermayer
  2025-04-05 14:36   ` Michael Niedermayer
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Niedermayer @ 2025-04-05  7:38 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 3917 bytes --]

On Thu, Apr 03, 2025 at 10:31:26PM +0200, Andreas Rheinhardt wrote:
> Patches attached.
> 
> - Andreas

[...]

>  libavcodec/mjpegenc_huffman.c                    |   33 ++++++------------
>  libavcodec/tests/mjpegenc_huffman.c              |    6 ++-
>  tests/ref/fate/jpg-icc                           |    6 +--
>  tests/ref/lavf/jpg                               |    4 +-
>  tests/ref/lavf/smjpeg                            |    4 +-
>  tests/ref/seek/vsynth_lena-mjpeg                 |   40 +++++++++++------------
>  tests/ref/vsynth/vsynth1-mjpeg                   |    4 +-
>  tests/ref/vsynth/vsynth1-mjpeg-422               |    4 +-
>  tests/ref/vsynth/vsynth1-mjpeg-444               |    4 +-
>  tests/ref/vsynth/vsynth1-mjpeg-huffman           |    4 +-
>  tests/ref/vsynth/vsynth1-mjpeg-trell             |    4 +-
>  tests/ref/vsynth/vsynth1-mjpeg-trell-huffman     |    4 +-
>  tests/ref/vsynth/vsynth2-mjpeg                   |    4 +-
>  tests/ref/vsynth/vsynth2-mjpeg-422               |    4 +-
>  tests/ref/vsynth/vsynth2-mjpeg-444               |    4 +-
>  tests/ref/vsynth/vsynth2-mjpeg-huffman           |    4 +-
>  tests/ref/vsynth/vsynth2-mjpeg-trell             |    4 +-
>  tests/ref/vsynth/vsynth2-mjpeg-trell-huffman     |    4 +-
>  tests/ref/vsynth/vsynth3-mjpeg                   |    4 +-
>  tests/ref/vsynth/vsynth3-mjpeg-422               |    4 +-
>  tests/ref/vsynth/vsynth3-mjpeg-444               |    4 +-
>  tests/ref/vsynth/vsynth3-mjpeg-huffman           |    4 +-
>  tests/ref/vsynth/vsynth3-mjpeg-trell             |    4 +-
>  tests/ref/vsynth/vsynth3-mjpeg-trell-huffman     |    4 +-
>  tests/ref/vsynth/vsynth_lena-mjpeg               |    4 +-
>  tests/ref/vsynth/vsynth_lena-mjpeg-422           |    4 +-
>  tests/ref/vsynth/vsynth_lena-mjpeg-444           |    4 +-
>  tests/ref/vsynth/vsynth_lena-mjpeg-huffman       |    4 +-
>  tests/ref/vsynth/vsynth_lena-mjpeg-trell         |    4 +-
>  tests/ref/vsynth/vsynth_lena-mjpeg-trell-huffman |    4 +-
>  30 files changed, 91 insertions(+), 98 deletions(-)
> 515cd8ef4364423e2e7ec04535f04b0580e97c78  0020-avcodec-mjpegenc_huffman-Avoid-AV_QSORT-to-sort-entr.patch
> From a17db6215a1600021c9d4a7d6c7923ac5816ea70 Mon Sep 17 00:00:00 2001
> From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> Date: Wed, 2 Apr 2025 15:06:43 +0200
> Subject: [PATCH 20/23] avcodec/mjpegenc_huffman: Avoid AV_QSORT to sort
>  entries by length
> 
> It is unnecessary; all one needs to ensure that shorter codes
> precede longer ones is to get the number of codes for each
> length. Then the codes of length 1 occupy the first count[1]
> positions, the codes of length 2 the next count[2]...
> Doing so gives a 3.4% speedup of ff_mjpeg_encode_huffman_close()
> here; it also saves about 340B.
> 
> The new code sorts codes of the same length in order of
> ascending symbol. The old code did not and therefore
> the FATE checksums needed to be updated. Due to MJPEG's
> 0xFF unescaping file sizes as well as file checksums
> needed to be updated; the decoded picture hashes stayed
> the same.

so theres a difference in size because of escaping differences
that implies the previous table was not optimal (by the definition
of smallest filesize)

have you considered to use this effect to reduce escaping overhead
further and thus improve compression further ?

for example one can build a variable length code that has no "all 1" code with
very little overhead. One also could maybe avoid codes that have
long runs of 1 over some threshold

The patch as is, is fine of course. Thats just an idea to improve
compression by another 0.1-0.3% or so

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH 01/23] avcodec/x86/vvc/dsp_init: Make put wrappers static
  2025-04-05  7:38 ` Michael Niedermayer
@ 2025-04-05 14:36   ` Michael Niedermayer
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Niedermayer @ 2025-04-05 14:36 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 4648 bytes --]

On Sat, Apr 05, 2025 at 09:38:10AM +0200, Michael Niedermayer wrote:
> On Thu, Apr 03, 2025 at 10:31:26PM +0200, Andreas Rheinhardt wrote:
> > Patches attached.
> > 
> > - Andreas
> 
> [...]
> 
> >  libavcodec/mjpegenc_huffman.c                    |   33 ++++++------------
> >  libavcodec/tests/mjpegenc_huffman.c              |    6 ++-
> >  tests/ref/fate/jpg-icc                           |    6 +--
> >  tests/ref/lavf/jpg                               |    4 +-
> >  tests/ref/lavf/smjpeg                            |    4 +-
> >  tests/ref/seek/vsynth_lena-mjpeg                 |   40 +++++++++++------------
> >  tests/ref/vsynth/vsynth1-mjpeg                   |    4 +-
> >  tests/ref/vsynth/vsynth1-mjpeg-422               |    4 +-
> >  tests/ref/vsynth/vsynth1-mjpeg-444               |    4 +-
> >  tests/ref/vsynth/vsynth1-mjpeg-huffman           |    4 +-
> >  tests/ref/vsynth/vsynth1-mjpeg-trell             |    4 +-
> >  tests/ref/vsynth/vsynth1-mjpeg-trell-huffman     |    4 +-
> >  tests/ref/vsynth/vsynth2-mjpeg                   |    4 +-
> >  tests/ref/vsynth/vsynth2-mjpeg-422               |    4 +-
> >  tests/ref/vsynth/vsynth2-mjpeg-444               |    4 +-
> >  tests/ref/vsynth/vsynth2-mjpeg-huffman           |    4 +-
> >  tests/ref/vsynth/vsynth2-mjpeg-trell             |    4 +-
> >  tests/ref/vsynth/vsynth2-mjpeg-trell-huffman     |    4 +-
> >  tests/ref/vsynth/vsynth3-mjpeg                   |    4 +-
> >  tests/ref/vsynth/vsynth3-mjpeg-422               |    4 +-
> >  tests/ref/vsynth/vsynth3-mjpeg-444               |    4 +-
> >  tests/ref/vsynth/vsynth3-mjpeg-huffman           |    4 +-
> >  tests/ref/vsynth/vsynth3-mjpeg-trell             |    4 +-
> >  tests/ref/vsynth/vsynth3-mjpeg-trell-huffman     |    4 +-
> >  tests/ref/vsynth/vsynth_lena-mjpeg               |    4 +-
> >  tests/ref/vsynth/vsynth_lena-mjpeg-422           |    4 +-
> >  tests/ref/vsynth/vsynth_lena-mjpeg-444           |    4 +-
> >  tests/ref/vsynth/vsynth_lena-mjpeg-huffman       |    4 +-
> >  tests/ref/vsynth/vsynth_lena-mjpeg-trell         |    4 +-
> >  tests/ref/vsynth/vsynth_lena-mjpeg-trell-huffman |    4 +-
> >  30 files changed, 91 insertions(+), 98 deletions(-)
> > 515cd8ef4364423e2e7ec04535f04b0580e97c78  0020-avcodec-mjpegenc_huffman-Avoid-AV_QSORT-to-sort-entr.patch
> > From a17db6215a1600021c9d4a7d6c7923ac5816ea70 Mon Sep 17 00:00:00 2001
> > From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> > Date: Wed, 2 Apr 2025 15:06:43 +0200
> > Subject: [PATCH 20/23] avcodec/mjpegenc_huffman: Avoid AV_QSORT to sort
> >  entries by length
> > 
> > It is unnecessary; all one needs to ensure that shorter codes
> > precede longer ones is to get the number of codes for each
> > length. Then the codes of length 1 occupy the first count[1]
> > positions, the codes of length 2 the next count[2]...
> > Doing so gives a 3.4% speedup of ff_mjpeg_encode_huffman_close()
> > here; it also saves about 340B.
> > 
> > The new code sorts codes of the same length in order of
> > ascending symbol. The old code did not and therefore
> > the FATE checksums needed to be updated. Due to MJPEG's
> > 0xFF unescaping file sizes as well as file checksums
> > needed to be updated; the decoded picture hashes stayed
> > the same.
> 
> so theres a difference in size because of escaping differences
> that implies the previous table was not optimal (by the definition
> of smallest filesize)
> 
> have you considered to use this effect to reduce escaping overhead
> further and thus improve compression further ?
> 
> for example one can build a variable length code that has no "all 1" code with
> very little overhead. One also could maybe avoid codes that have
> long runs of 1 over some threshold
> 
> The patch as is, is fine of course. Thats just an idea to improve
> compression by another 0.1-0.3% or so

or another way to see this, is that a huffman table assumes the cost
of each code of the same length is equal.
But due to the escaping thats not true, a code starting and ending in 0 and
not having 8 1 bits in  it is less costly than a code that is
more likely to create patterns that need escaping

the maximum compression gain from this is small, but it may be
an interresting problem. Within the bitstream syntax and adding
no cost on the decoder

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-05 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-03 20:31 [FFmpeg-devel] [PATCH 01/23] avcodec/x86/vvc/dsp_init: Make put wrappers static Andreas Rheinhardt
2025-04-05  7:38 ` Michael Niedermayer
2025-04-05 14:36   ` Michael Niedermayer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git