[FFmpeg-devel] [PATCH 19/41] avfilter/x86/vf_noise: Disable overridden functions on x64

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri Jun 10 02:55:01 EEST 2022


x64 always has MMX, MMXEXT, SSE and SSE2 and this means
that some functions for MMX, MMXEXT, SSE and 3dnow are always
overridden by other functions (unless one e.g. explicitly
disables SSE2). This commit therefore disables line_noise_mmx
at compile-time for x64.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavfilter/x86/vf_noise.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavfilter/x86/vf_noise.c b/libavfilter/x86/vf_noise.c
index f7a4d00336..ce7260e94f 100644
--- a/libavfilter/x86/vf_noise.c
+++ b/libavfilter/x86/vf_noise.c
@@ -25,6 +25,7 @@
 #include "libavfilter/vf_noise.h"
 
 #if HAVE_INLINE_ASM
+#if ARCH_X86_32
 static void line_noise_mmx(uint8_t *dst, const uint8_t *src,
                            const int8_t *noise, int len, int shift)
 {
@@ -52,6 +53,7 @@ static void line_noise_mmx(uint8_t *dst, const uint8_t *src,
     if (mmx_len != len)
         ff_line_noise_c(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
 }
+#endif
 
 #if HAVE_6REGS
 static void line_noise_avg_mmx(uint8_t *dst, const uint8_t *src,
@@ -132,7 +134,9 @@ av_cold void ff_noise_init_x86(NoiseContext *n)
     int cpu_flags = av_get_cpu_flags();
 
     if (INLINE_MMX(cpu_flags)) {
+#if ARCH_X86_32
         n->line_noise     = line_noise_mmx;
+#endif
 #if HAVE_6REGS
         n->line_noise_avg = line_noise_avg_mmx;
 #endif
-- 
2.34.1



More information about the ffmpeg-devel mailing list