[FFmpeg-devel] [PATCH 23/41] avcodec/x86/sbrdsp_init: Disable overridden functions on x64

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri Jun 10 02:55:05 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
ff_sbr_qmf_deint_bfly_sse (which is overridden by an SSE2 function)
at compile-time for x64.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/x86/sbrdsp.asm    | 2 ++
 libavcodec/x86/sbrdsp_init.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/libavcodec/x86/sbrdsp.asm b/libavcodec/x86/sbrdsp.asm
index 62bbe512ec..ea5099a5d1 100644
--- a/libavcodec/x86/sbrdsp.asm
+++ b/libavcodec/x86/sbrdsp.asm
@@ -286,8 +286,10 @@ cglobal sbr_qmf_deint_bfly, 3,5,8, v,src0,src1,vrev,c
     REP_RET
 %endmacro
 
+%if ARCH_X86_32
 INIT_XMM sse
 SBR_QMF_DEINT_BFLY
+%endif
 
 INIT_XMM sse2
 SBR_QMF_DEINT_BFLY
diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c
index 6911a1a515..a710f10dc1 100644
--- a/libavcodec/x86/sbrdsp_init.c
+++ b/libavcodec/x86/sbrdsp_init.c
@@ -67,7 +67,9 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
         s->hf_g_filt  = ff_sbr_hf_g_filt_sse;
         s->hf_gen     = ff_sbr_hf_gen_sse;
         s->qmf_post_shuffle = ff_sbr_qmf_post_shuffle_sse;
+#if ARCH_X86_32
         s->qmf_deint_bfly   = ff_sbr_qmf_deint_bfly_sse;
+#endif
         s->qmf_deint_neg    = ff_sbr_qmf_deint_neg_sse;
         s->autocorrelate    = ff_sbr_autocorrelate_sse;
     }
-- 
2.34.1



More information about the ffmpeg-devel mailing list