diff mbox series

[FFmpeg-devel,40/41] avfilter/x86/vf_eq_init: Disable overridden functions on x64

Message ID DB6PR0101MB2214DF2EA066E7A35D31C6488FA79@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com
State Superseded
Headers show
Series Stop including superseded functions for x64 | expand


Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt June 9, 2022, 11:55 p.m. UTC
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
process_mmxext (overridden by process_sse2) at compile-time for x64.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
 libavfilter/x86/vf_eq.asm    | 2 ++
 libavfilter/x86/vf_eq_init.c | 4 ++++
 2 files changed, 6 insertions(+)
diff mbox series


diff --git a/libavfilter/x86/vf_eq.asm b/libavfilter/x86/vf_eq.asm
index a30a287029..0b55d28c6b 100644
--- a/libavfilter/x86/vf_eq.asm
+++ b/libavfilter/x86/vf_eq.asm
@@ -83,8 +83,10 @@  cglobal process_one_line, 5, 7, 5, src, dst, contrast, brightness, w
+%if ARCH_X86_32
 INIT_MMX mmxext
 INIT_XMM sse2
diff --git a/libavfilter/x86/vf_eq_init.c b/libavfilter/x86/vf_eq_init.c
index 113056e76b..0ca341e07d 100644
--- a/libavfilter/x86/vf_eq_init.c
+++ b/libavfilter/x86/vf_eq_init.c
@@ -31,6 +31,7 @@  extern void ff_process_one_line_sse2(const uint8_t *src, uint8_t *dst, short con
                                      short brightness, int w);
 #if HAVE_X86ASM
+#if ARCH_X86_32
 static void process_mmxext(EQParameters *param, uint8_t *dst, int dst_stride,
                            const uint8_t *src, int src_stride, int w, int h)
@@ -45,6 +46,7 @@  static void process_mmxext(EQParameters *param, uint8_t *dst, int dst_stride,
 static void process_sse2(EQParameters *param, uint8_t *dst, int dst_stride,
                          const uint8_t *src, int src_stride, int w, int h)
@@ -65,9 +67,11 @@  av_cold void ff_eq_init_x86(EQContext *eq)
 #if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
+#if ARCH_X86_32
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         eq->process = process_mmxext;
     if (EXTERNAL_SSE2(cpu_flags)) {
         eq->process = process_sse2;