PR #23844 opened by mkver
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23844
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23844.patch

Also remove unnecessary asm.h inclusions.


>From 394765ad1d0555389b4f10855aee437da7409a1d Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <[email protected]>
Date: Sun, 19 Jul 2026 11:35:07 +0200
Subject: [PATCH 1/2] avutil/x86/asm: Remove HAVE_[67]REGS, use
 HAVE_X86_[67]REGS directly

This allows to remove the asm.h inclusion from x86/mathops.h
and therefore from hundreds of files which don't need it.

Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavcodec/dirac_arith.h          | 5 +----
 libavcodec/msmpeg4.c              | 5 +----
 libavcodec/x86/cabac.h            | 4 ++--
 libavcodec/x86/h264_cabac.c       | 4 ++--
 libavcodec/x86/mathops.h          | 5 ++---
 libavcodec/x86/mlpdsp_init.c      | 6 +++---
 libavcodec/x86/mpeg4videodsp.c    | 2 +-
 libavcodec/x86/mpegaudiodsp.c     | 6 +++---
 libavcodec/x86/snowdsp_init.c     | 6 +++---
 libavcodec/x86/vc1dsp.h           | 6 +++---
 libavcodec/x86/vc1dsp_init.c      | 9 ++++-----
 libavcodec/x86/vc1dsp_mmx.c       | 4 ++--
 libavcodec/x86/vpx_arith.h        | 4 ++--
 libavfilter/x86/vf_noise.c        | 6 +++---
 libavutil/x86/asm.h               | 3 ---
 libswscale/x86/rgb2rgb.c          | 8 ++++----
 libswscale/x86/swscale.c          | 4 ++--
 libswscale/x86/swscale_template.c | 4 ++--
 18 files changed, 40 insertions(+), 51 deletions(-)

diff --git a/libavcodec/dirac_arith.h b/libavcodec/dirac_arith.h
index 203d481603..1836577017 100644
--- a/libavcodec/dirac_arith.h
+++ b/libavcodec/dirac_arith.h
@@ -30,9 +30,6 @@
 
 #include "config.h"
 
-#if ARCH_X86
-#include "libavutil/x86/asm.h"
-#endif
 #include "bytestream.h"
 #include "get_bits.h"
 
@@ -143,7 +140,7 @@ static inline int dirac_get_arith_bit(DiracArith *c, int 
ctx)
 
     range_times_prob = (c->range * prob_zero) >> 16;
 
-#if ARCH_X86 && HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS
+#if ARCH_X86 && HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_X86_6REGS
     low   -= range_times_prob << 16;
     range -= range_times_prob;
     bit = 0;
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index b0565bfe24..0968a32bac 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -33,9 +33,6 @@
 #include "libavutil/attributes.h"
 #include "libavutil/avassert.h"
 #include "libavutil/thread.h"
-#if ARCH_X86
-#include "libavutil/x86/asm.h"
-#endif
 
 #include "avcodec.h"
 #include "idctdsp.h"
@@ -231,7 +228,7 @@ int ff_msmpeg4_pred_dc(MpegEncContext *s, int n,
        necessitate to modify mpegvideo.c. The problem comes from the
        fact they decided to store the quantized DC (which would lead
        to problems if Q could vary !) */
-#if ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE
+#if ARCH_X86 && HAVE_X86_7REGS && HAVE_EBX_AVAILABLE
     __asm__ volatile(
         "movl %3, %%eax         \n\t"
         "shrl $1, %%eax         \n\t"
diff --git a/libavcodec/x86/cabac.h b/libavcodec/x86/cabac.h
index ce05f70988..dc384f89b2 100644
--- a/libavcodec/x86/cabac.h
+++ b/libavcodec/x86/cabac.h
@@ -216,7 +216,7 @@
 
 #endif /* BROKEN_RELOCATIONS */
 
-#if HAVE_7REGS && !BROKEN_COMPILER
+#if HAVE_X86_7REGS && !BROKEN_COMPILER
 #define get_cabac_inline get_cabac_inline_x86
 static
 #if ARCH_X86_32
@@ -255,7 +255,7 @@ int get_cabac_inline_x86(CABACContext *c, uint8_t *const 
state)
     );
     return bit & 1;
 }
-#endif /* HAVE_7REGS && !BROKEN_COMPILER */
+#endif /* HAVE_X86_7REGS && !BROKEN_COMPILER */
 
 #if !BROKEN_COMPILER
 #define get_cabac_bypass_sign get_cabac_bypass_sign_x86
diff --git a/libavcodec/x86/h264_cabac.c b/libavcodec/x86/h264_cabac.c
index 2edc6d7e74..ac7d07780c 100644
--- a/libavcodec/x86/h264_cabac.c
+++ b/libavcodec/x86/h264_cabac.c
@@ -41,7 +41,7 @@
 
 //FIXME use some macros to avoid duplicating get_cabac (cannot be done yet
 //as that would make optimization work hard)
-#if HAVE_7REGS && !BROKEN_COMPILER
+#if HAVE_X86_7REGS && !BROKEN_COMPILER
 #define decode_significance decode_significance_x86
 static int decode_significance_x86(CABACContext *c, int max_coeff,
                                    uint8_t *significant_coeff_ctx_base,
@@ -203,6 +203,6 @@ static int decode_significance_8x8_x86(CABACContext *c,
     );
     return coeff_count;
 }
-#endif /* HAVE_7REGS && BROKEN_COMPILER */
+#endif /* HAVE_X86_7REGS && BROKEN_COMPILER */
 
 #endif /* HAVE_INLINE_ASM */
diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h
index ca7e2dffc1..ea2ec98ead 100644
--- a/libavcodec/x86/mathops.h
+++ b/libavcodec/x86/mathops.h
@@ -25,7 +25,6 @@
 #include "config.h"
 
 #include "libavutil/common.h"
-#include "libavutil/x86/asm.h"
 
 #if HAVE_INLINE_ASM
 
@@ -98,7 +97,7 @@ static inline av_const int mid_pred(int a, int b, int c)
     return i;
 }
 
-#if HAVE_6REGS
+#if HAVE_X86_6REGS
 #define COPY3_IF_LT(x, y, a, b, c, d)\
 __asm__ volatile(\
     "cmpl  %0, %3       \n\t"\
@@ -108,7 +107,7 @@ __asm__ volatile(\
     : "+&r" (x), "+&r" (a), "+r" (c)\
     : "r" (y), "r" (b), "r" (d)\
 );
-#endif /* HAVE_6REGS */
+#endif /* HAVE_X86_6REGS */
 
 #endif /* HAVE_I686 */
 
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 21a0e38143..38b7bc4eb6 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -45,7 +45,7 @@ void ff_mlp_rematrix_channel_##opt(int32_t *samples, \
 REMATRIX_CHANNEL_FUNC(sse4)
 REMATRIX_CHANNEL_FUNC(avx2_bmi2)
 
-#if HAVE_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS
+#if HAVE_X86_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS
 
 extern char ff_mlp_firorder_8;
 extern char ff_mlp_firorder_7;
@@ -191,12 +191,12 @@ static void mlp_filter_channel_x86(int32_t *state, const 
int32_t *coeff,
     );
 }
 
-#endif /* HAVE_7REGS && HAVE_INLINE_ASM */
+#endif /* HAVE_X86_7REGS && HAVE_INLINE_ASM */
 
 av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
 {
     int cpu_flags = av_get_cpu_flags();
-#if HAVE_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS
+#if HAVE_X86_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
diff --git a/libavcodec/x86/mpeg4videodsp.c b/libavcodec/x86/mpeg4videodsp.c
index ea28bb1d3b..d326327f13 100644
--- a/libavcodec/x86/mpeg4videodsp.c
+++ b/libavcodec/x86/mpeg4videodsp.c
@@ -192,7 +192,7 @@ static void gmc_ssse3(uint8_t *dst, const uint8_t *src,
         "decl                %[h]             \n\t"
         "jnz                   1b             \n\t"
         : [dst]"+r"(dst), [src]"+r"(src),
-#if HAVE_6REGS || HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS
+#if HAVE_X86_6REGS || HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS
         [h]"+r"(h)
 #else
         [h]"+m"(h)
diff --git a/libavcodec/x86/mpegaudiodsp.c b/libavcodec/x86/mpegaudiodsp.c
index 43662cd279..bf1f48aa67 100644
--- a/libavcodec/x86/mpegaudiodsp.c
+++ b/libavcodec/x86/mpegaudiodsp.c
@@ -50,7 +50,7 @@ void ff_dct32_float_avx (float *out, const float *in);
 
 DECLARE_ALIGNED(16, static float, mdct_win_sse)[2][4][4*40];
 
-#if HAVE_6REGS && HAVE_SSE_INLINE
+#if HAVE_X86_6REGS && HAVE_SSE_INLINE
 
 #define MACS(rt, ra, rb) rt+=(ra)*(rb)
 #define MLSS(rt, ra, rb) rt-=(ra)*(rb)
@@ -194,7 +194,7 @@ static void apply_window_mp3(float *in, float *win, int 
*unused, float *out,
     *out = sum;
 }
 
-#endif /* HAVE_6REGS && HAVE_SSE_INLINE */
+#endif /* HAVE_X86_6REGS && HAVE_SSE_INLINE */
 
 #if HAVE_X86ASM
 #define DECL_IMDCT_BLOCKS(CPU1, CPU2)                                       \
@@ -260,7 +260,7 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s)
 {
     av_unused int cpu_flags = av_get_cpu_flags();
 
-#if HAVE_6REGS && HAVE_SSE_INLINE
+#if HAVE_X86_6REGS && HAVE_SSE_INLINE
     if (INLINE_SSE(cpu_flags)) {
         s->apply_window_float = apply_window_mp3;
     }
diff --git a/libavcodec/x86/snowdsp_init.c b/libavcodec/x86/snowdsp_init.c
index 34f91c1ee7..fda9f118b5 100644
--- a/libavcodec/x86/snowdsp_init.c
+++ b/libavcodec/x86/snowdsp_init.c
@@ -207,7 +207,7 @@ static void ff_snow_horizontal_compose97i_mmx(IDWTELEM *b, 
IDWTELEM *temp, int w
     }
 }
 
-#if HAVE_7REGS
+#if HAVE_X86_7REGS
 #define snow_vertical_compose_r2r_sub(s0,s1,s2,s3,t0,t1,t2,t3)\
         "psubw %%"s0", %%"t0" \n\t"\
         "psubw %%"s1", %%"t1" \n\t"\
@@ -325,7 +325,7 @@ static void ff_snow_vertical_compose97i_mmx(IDWTELEM *b0, 
IDWTELEM *b1, IDWTELEM
         :"+d"(i)
         :"r"(b0),"r"(b1),"r"(b2),"r"(b3),"r"(b4),"r"(b5));
 }
-#endif //HAVE_7REGS
+#endif //HAVE_X86_7REGS
 
 #endif /* HAVE_INLINE_ASM */
 
@@ -336,7 +336,7 @@ av_cold void ff_dwt_init_x86(SnowDWTContext *c)
 #if HAVE_INLINE_ASM
     if (INLINE_MMXEXT(cpuflags)) {
         c->horizontal_compose97i = ff_snow_horizontal_compose97i_mmx;
-#if HAVE_7REGS
+#if HAVE_X86_7REGS
         c->vertical_compose97i   = ff_snow_vertical_compose97i_mmx;
 #endif
     }
diff --git a/libavcodec/x86/vc1dsp.h b/libavcodec/x86/vc1dsp.h
index 9c16d73fd2..912ea0be36 100644
--- a/libavcodec/x86/vc1dsp.h
+++ b/libavcodec/x86/vc1dsp.h
@@ -21,14 +21,14 @@
 #ifndef AVCODEC_X86_VC1DSP_H
 #define AVCODEC_X86_VC1DSP_H
 
-#include "libavutil/x86/asm.h"
+#include "config.h"
 #include "libavcodec/vc1dsp.h"
 
-#if HAVE_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL
+#if HAVE_X86_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL
 
 void ff_vc1dsp_init_mmx(VC1DSPContext *dsp);
 void ff_vc1dsp_init_mmxext(VC1DSPContext *dsp);
 
-#endif /* HAVE_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL */
+#endif /* HAVE_X86_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL */
 
 #endif /* AVCODEC_X86_VC1DSP_H */
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 7546b0ceae..d0705f6bfb 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -27,7 +27,6 @@
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
 #include "libavutil/x86/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavcodec/vc1dsp.h"
 #include "fpel.h"
 #include "vc1dsp.h"
@@ -105,15 +104,15 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-#if HAVE_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL
-    if (HAVE_6REGS && INLINE_MMX(cpu_flags))
+#if HAVE_X86_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL
+    if (HAVE_X86_6REGS && INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
 
-    if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags))
+    if (HAVE_X86_6REGS && INLINE_MMXEXT(cpu_flags))
         if (EXTERNAL_MMXEXT(cpu_flags))
         ff_vc1dsp_init_mmxext(dsp);
-#endif /* HAVE_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL */
+#endif /* HAVE_X86_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL */
 
 #define ASSIGN_LF4(EXT) \
         dsp->vc1_v_loop_filter4  = ff_vc1_v_loop_filter4_ ## EXT; \
diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c
index b1a85150eb..36591f83fc 100644
--- a/libavcodec/x86/vc1dsp_mmx.c
+++ b/libavcodec/x86/vc1dsp_mmx.c
@@ -33,7 +33,7 @@
 #include "fpel.h"
 #include "vc1dsp.h"
 
-#if HAVE_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL
+#if HAVE_X86_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL
 
 void ff_vc1_put_ver_16b_shift2_mmx(int16_t *dst,
                                    const uint8_t *src, x86_reg stride,
@@ -349,4 +349,4 @@ av_cold void ff_vc1dsp_init_mmxext(VC1DSPContext *dsp)
     FN_ASSIGN(avg_, 3, 2, _mmxext);
     FN_ASSIGN(avg_, 3, 3, _mmxext);
 }
-#endif /* HAVE_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL */
+#endif /* HAVE_X86_6REGS && HAVE_INLINE_ASM && HAVE_MMX_EXTERNAL */
diff --git a/libavcodec/x86/vpx_arith.h b/libavcodec/x86/vpx_arith.h
index d9e4c0dec4..4a1c11bf75 100644
--- a/libavcodec/x86/vpx_arith.h
+++ b/libavcodec/x86/vpx_arith.h
@@ -24,9 +24,9 @@
 #ifndef AVCODEC_X86_VPX_ARITH_H
 #define AVCODEC_X86_VPX_ARITH_H
 
-#include "libavutil/x86/asm.h"
+#include "config.h"
 
-#if HAVE_INLINE_ASM && HAVE_FAST_CMOV && HAVE_6REGS
+#if HAVE_INLINE_ASM && HAVE_FAST_CMOV && HAVE_X86_6REGS
 #include "libavutil/attributes.h"
 
 #define vpx_rac_get_prob vpx_rac_get_prob
diff --git a/libavfilter/x86/vf_noise.c b/libavfilter/x86/vf_noise.c
index 3edcbd64e5..1eb04d3e98 100644
--- a/libavfilter/x86/vf_noise.c
+++ b/libavfilter/x86/vf_noise.c
@@ -25,7 +25,7 @@
 #include "libavfilter/vf_noise.h"
 
 #if HAVE_INLINE_ASM
-#if HAVE_6REGS
+#if HAVE_X86_6REGS
 static void line_noise_avg_sse2(uint8_t *dst, const uint8_t *src,
                                 int len, const int8_t * const *shift)
 {
@@ -73,7 +73,7 @@ static void line_noise_avg_sse2(uint8_t *dst, const uint8_t 
*src,
         ff_line_noise_avg_c(dst + xmm_len, src + xmm_len, len - xmm_len, 
shift2);
     }
 }
-#endif /* HAVE_6REGS */
+#endif /* HAVE_X86_6REGS */
 
 static void line_noise_sse2(uint8_t *dst, const uint8_t *src,
                             const int8_t *noise, int len, int shift)
@@ -110,7 +110,7 @@ av_cold void ff_noise_init_x86(NoiseContext *n)
     int cpu_flags = av_get_cpu_flags();
 
     if (INLINE_SSE2(cpu_flags)) {
-#if HAVE_6REGS
+#if HAVE_X86_6REGS
         n->line_noise_avg = line_noise_avg_sse2;
 #endif
         n->line_noise     = line_noise_sse2;
diff --git a/libavutil/x86/asm.h b/libavutil/x86/asm.h
index c304aa3279..1f9746bde3 100644
--- a/libavutil/x86/asm.h
+++ b/libavutil/x86/asm.h
@@ -71,9 +71,6 @@ typedef int32_t x86_reg;
 typedef int x86_reg;
 #endif
 
-#define HAVE_7REGS HAVE_X86_7REGS
-#define HAVE_6REGS HAVE_X86_6REGS
-
 #if ARCH_X86_64 && defined(PIC)
 #    define BROKEN_RELOCATIONS 1
 #endif
diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
index f2b434f611..16994f2023 100644
--- a/libswscale/x86/rgb2rgb.c
+++ b/libswscale/x86/rgb2rgb.c
@@ -1375,7 +1375,7 @@ static inline void planar2x_mmxext(const uint8_t *src, 
uint8_t *dst, int srcWidt
  * others are ignored in the C version.
  * FIXME: Write HQ version.
  */
-#if ARCH_X86_32 && HAVE_7REGS
+#if ARCH_X86_32 && HAVE_X86_7REGS
 DECLARE_ASM_CONST(8, uint64_t, bgr2YOffset)  = 0x1010101010101010ULL;
 DECLARE_ASM_CONST(8, uint64_t, bgr2UVOffset) = 0x8080808080808080ULL;
 DECLARE_ASM_CONST(8, uint64_t, w1111)        = 0x0001000100010001ULL;
@@ -1574,7 +1574,7 @@ static inline void rgb24toyv12_mmxext(const uint8_t *src, 
uint8_t *ydst, uint8_t
 
      ff_rgb24toyv12_c(src, ydst, udst, vdst, width, height-y, lumStride, 
chromStride, srcStride, rgb2yuv);
 }
-#endif /* HAVE_7REGS */
+#endif /* HAVE_X86_7REGS */
 
 static void extract_even_mmxext(const uint8_t *src, uint8_t *dst, x86_reg 
count)
 {
@@ -1977,9 +1977,9 @@ static av_cold void rgb2rgb_init_mmxext(void)
     yuyvtoyuv422       = yuyvtoyuv422_mmxext;
 
     planar2x           = planar2x_mmxext;
-#if ARCH_X86_32 && HAVE_7REGS
+#if ARCH_X86_32 && HAVE_X86_7REGS
     ff_rgb24toyv12     = rgb24toyv12_mmxext;
-#endif /* ARCH_X86_32 && HAVE_7REGS */
+#endif /* ARCH_X86_32 && HAVE_X86_7REGS */
 
     yuyvtoyuv420       = yuyvtoyuv420_mmxext;
     uyvytoyuv420       = uyvytoyuv420_mmxext;
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index 04782da81c..013d7374d7 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -498,7 +498,7 @@ av_cold void ff_sws_init_swscale_x86(SwsInternal *c)
                 if (!(c->opts.flags & SWS_FULL_CHR_H_INT)) {
                     switch (c->opts.dst_format) {
                     case AV_PIX_FMT_RGB32:   c->yuv2packedX = 
yuv2rgb32_X_ar_mmxext;   break;
-#if HAVE_6REGS
+#if HAVE_X86_6REGS
                     case AV_PIX_FMT_BGR24:   c->yuv2packedX = 
yuv2bgr24_X_ar_mmxext;   break;
 #endif
                     case AV_PIX_FMT_RGB555:  c->yuv2packedX = 
yuv2rgb555_X_ar_mmxext;  break;
@@ -528,7 +528,7 @@ av_cold void ff_sws_init_swscale_x86(SwsInternal *c)
                     switch (c->opts.dst_format) {
                     case AV_PIX_FMT_RGB32:   c->yuv2packedX = 
yuv2rgb32_X_mmxext;   break;
                     case AV_PIX_FMT_BGR32:   c->yuv2packedX = 
yuv2bgr32_X_mmxext;   break;
-#if HAVE_6REGS
+#if HAVE_X86_6REGS
                     case AV_PIX_FMT_BGR24:   c->yuv2packedX = 
yuv2bgr24_X_mmxext;   break;
 #endif
                     case AV_PIX_FMT_RGB555:  c->yuv2packedX = 
yuv2rgb555_X_mmxext;  break;
diff --git a/libswscale/x86/swscale_template.c 
b/libswscale/x86/swscale_template.c
index 94be51ff12..85ac7b1689 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -534,7 +534,7 @@ static void RENAME(yuv2rgb555_X)(SwsInternal *c, const 
int16_t *lumFilter,
 #undef WRITEBGR24
 #define WRITEBGR24(dst, dstw, index)  WRITEBGR24MMXEXT(dst, dstw, index)
 
-#if HAVE_6REGS
+#if HAVE_X86_6REGS
 static void RENAME(yuv2bgr24_X_ar)(SwsInternal *c, const int16_t *lumFilter,
                                    const int16_t **lumSrc, int lumFilterSize,
                                    const int16_t *chrFilter, const int16_t 
**chrUSrc,
@@ -584,7 +584,7 @@ static void RENAME(yuv2bgr24_X)(SwsInternal *c, const 
int16_t *lumFilter,
     : "%"FF_REG_a, "%"FF_REG_c, "%"FF_REG_d, "%"FF_REG_S
     );
 }
-#endif /* HAVE_6REGS */
+#endif /* HAVE_X86_6REGS */
 
 #define REAL_WRITEYUY2(dst, dstw, index) \
     "packuswb  %%mm3, %%mm3     \n\t"\
-- 
2.52.0


>From b5a08e36aef1b0aa746fe0fec07244d17cd97214 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <[email protected]>
Date: Sun, 19 Jul 2026 12:09:04 +0200
Subject: [PATCH 2/2] av{codec,filter}/x86: Remove unnecessary asm.h inclusions

asm.h is only for inline assembly.

Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavcodec/x86/ac3dsp_init.c          | 1 -
 libavcodec/x86/apv_dsp_init.c         | 1 -
 libavcodec/x86/h264dsp_init.c         | 1 -
 libavcodec/x86/h26x/h2656dsp.c        | 2 ++
 libavcodec/x86/h26x/h2656dsp.h        | 6 ++----
 libavcodec/x86/hevc/dsp_init.c        | 1 -
 libavcodec/x86/huffyuvdsp_init.c      | 1 -
 libavcodec/x86/mpegvideoenc.c         | 1 -
 libavcodec/x86/utvideodsp_init.c      | 1 -
 libavfilter/x86/vf_atadenoise_init.c  | 1 -
 libavfilter/x86/vf_bwdif_init.c       | 1 -
 libavfilter/x86/vf_eq_init.c          | 1 -
 libavfilter/x86/vf_maskedclamp_init.c | 1 -
 libavfilter/x86/vf_tinterlace_init.c  | 2 --
 libavfilter/x86/vf_transpose_init.c   | 1 -
 libavfilter/x86/vf_w3fdif_init.c      | 1 -
 libswscale/utils.c                    | 1 -
 17 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 353cf38f86..b8d25f72a5 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -20,7 +20,6 @@
  */
 
 #include "libavutil/attributes.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/ac3dsp.h"
 
diff --git a/libavcodec/x86/apv_dsp_init.c b/libavcodec/x86/apv_dsp_init.c
index 39360a0ad2..f87292a528 100644
--- a/libavcodec/x86/apv_dsp_init.c
+++ b/libavcodec/x86/apv_dsp_init.c
@@ -19,7 +19,6 @@
 #include "config.h"
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/apv_dsp.h"
 
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index add1344022..f617078d15 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -20,7 +20,6 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/h264dsp.h"
 
diff --git a/libavcodec/x86/h26x/h2656dsp.c b/libavcodec/x86/h26x/h2656dsp.c
index 1d8ec1898d..d5c45f14be 100644
--- a/libavcodec/x86/h26x/h2656dsp.c
+++ b/libavcodec/x86/h26x/h2656dsp.c
@@ -21,6 +21,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "config.h"
+
 #include "h2656dsp.h"
 
 #define mc_rep_func(name, bitd, step, W, opt) \
diff --git a/libavcodec/x86/h26x/h2656dsp.h b/libavcodec/x86/h26x/h2656dsp.h
index 0ea08b6a20..720fa9dafe 100644
--- a/libavcodec/x86/h26x/h2656dsp.h
+++ b/libavcodec/x86/h26x/h2656dsp.h
@@ -24,10 +24,8 @@
 #ifndef AVCODEC_X86_H26X_H2656DSP_H
 #define AVCODEC_X86_H26X_H2656DSP_H
 
-#include "config.h"
-#include "libavutil/x86/asm.h"
-#include "libavutil/x86/cpu.h"
-#include <stdlib.h>
+#include <stddef.h>
+#include <stdint.h>
 
 #define H2656_PEL_PROTOTYPE(name, D, opt) \
 void ff_h2656_put_ ## name ## _ ## D ## _##opt(int16_t *dst, ptrdiff_t 
dststride, const uint8_t *_src, ptrdiff_t _srcstride, int height, const int8_t 
*hf, const int8_t *vf, int width);          \
diff --git a/libavcodec/x86/hevc/dsp_init.c b/libavcodec/x86/hevc/dsp_init.c
index 00f24aed41..85905e6959 100644
--- a/libavcodec/x86/hevc/dsp_init.c
+++ b/libavcodec/x86/hevc/dsp_init.c
@@ -24,7 +24,6 @@
 
 #include "libavutil/cpu.h"
 #include "libavutil/mem_internal.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/hevc/dsp.h"
 #include "libavcodec/x86/hevc/dsp.h"
diff --git a/libavcodec/x86/huffyuvdsp_init.c b/libavcodec/x86/huffyuvdsp_init.c
index 239d3ca313..b25a416d81 100644
--- a/libavcodec/x86/huffyuvdsp_init.c
+++ b/libavcodec/x86/huffyuvdsp_init.c
@@ -22,7 +22,6 @@
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
 #include "libavutil/pixdesc.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/huffyuvdsp.h"
 
diff --git a/libavcodec/x86/mpegvideoenc.c b/libavcodec/x86/mpegvideoenc.c
index f33c37eeb9..13e969ff83 100644
--- a/libavcodec/x86/mpegvideoenc.c
+++ b/libavcodec/x86/mpegvideoenc.c
@@ -22,7 +22,6 @@
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
 #include "libavutil/mem_internal.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/avcodec.h"
 #include "libavcodec/mpegvideoenc.h"
diff --git a/libavcodec/x86/utvideodsp_init.c b/libavcodec/x86/utvideodsp_init.c
index 2b436c6c5c..dd02f82117 100644
--- a/libavcodec/x86/utvideodsp_init.c
+++ b/libavcodec/x86/utvideodsp_init.c
@@ -21,7 +21,6 @@
 #include "config.h"
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/utvideodsp.h"
 
diff --git a/libavfilter/x86/vf_atadenoise_init.c 
b/libavfilter/x86/vf_atadenoise_init.c
index 3847e53250..16143a5282 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -20,7 +20,6 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavfilter/atadenoise.h"
 
diff --git a/libavfilter/x86/vf_bwdif_init.c b/libavfilter/x86/vf_bwdif_init.c
index 51508ee771..5df50d76b3 100644
--- a/libavfilter/x86/vf_bwdif_init.c
+++ b/libavfilter/x86/vf_bwdif_init.c
@@ -20,7 +20,6 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavfilter/bwdifdsp.h"
 
diff --git a/libavfilter/x86/vf_eq_init.c b/libavfilter/x86/vf_eq_init.c
index a66dd1b993..16cbee80a3 100644
--- a/libavfilter/x86/vf_eq_init.c
+++ b/libavfilter/x86/vf_eq_init.c
@@ -22,7 +22,6 @@
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
 #include "libavutil/x86/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavfilter/vf_eq.h"
 
 extern void ff_process_one_line_sse2(const uint8_t *src, uint8_t *dst, short 
contrast,
diff --git a/libavfilter/x86/vf_maskedclamp_init.c 
b/libavfilter/x86/vf_maskedclamp_init.c
index 2a5388abac..48ac0ffcee 100644
--- a/libavfilter/x86/vf_maskedclamp_init.c
+++ b/libavfilter/x86/vf_maskedclamp_init.c
@@ -20,7 +20,6 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavfilter/maskedclamp.h"
 
diff --git a/libavfilter/x86/vf_tinterlace_init.c 
b/libavfilter/x86/vf_tinterlace_init.c
index 1c25a2bb7a..ac93327450 100644
--- a/libavfilter/x86/vf_tinterlace_init.c
+++ b/libavfilter/x86/vf_tinterlace_init.c
@@ -20,8 +20,6 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
-#include "libavutil/internal.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 
 #include "libavfilter/tinterlace.h"
diff --git a/libavfilter/x86/vf_transpose_init.c 
b/libavfilter/x86/vf_transpose_init.c
index 95c56eab73..c79cb0b092 100644
--- a/libavfilter/x86/vf_transpose_init.c
+++ b/libavfilter/x86/vf_transpose_init.c
@@ -20,7 +20,6 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavfilter/transpose.h"
 
diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
index 6d677d651d..ff5f5c8dfa 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -20,7 +20,6 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavfilter/w3fdif.h"
 
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 31d2e6e111..08424aa56b 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -44,7 +44,6 @@
 #include "libavutil/thread.h"
 #include "libavutil/aarch64/cpu.h"
 #include "libavutil/ppc/cpu.h"
-#include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavutil/loongarch/cpu.h"
 
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to