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

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri Jun 10 02:55:12 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
the 3dnow implementation (which is overridden by the MMXEXT
specific implementation) at compile-time for x64.

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

diff --git a/libavcodec/x86/hpeldsp_vp3.asm b/libavcodec/x86/hpeldsp_vp3.asm
index cba96d06cb..284babfd70 100644
--- a/libavcodec/x86/hpeldsp_vp3.asm
+++ b/libavcodec/x86/hpeldsp_vp3.asm
@@ -65,8 +65,10 @@ cglobal put_no_rnd_pixels8_x2_exact, 4,5
 
 INIT_MMX mmxext
 PUT_NO_RND_PIXELS8_X2_EXACT
+%if ARCH_X86_32
 INIT_MMX 3dnow
 PUT_NO_RND_PIXELS8_X2_EXACT
+%endif
 
 
 ; void ff_put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
@@ -107,5 +109,7 @@ cglobal put_no_rnd_pixels8_y2_exact, 4,5
 
 INIT_MMX mmxext
 PUT_NO_RND_PIXELS8_Y2_EXACT
+%if ARCH_X86_32
 INIT_MMX 3dnow
 PUT_NO_RND_PIXELS8_Y2_EXACT
+%endif
diff --git a/libavcodec/x86/hpeldsp_vp3_init.c b/libavcodec/x86/hpeldsp_vp3_init.c
index 5979f4123c..3c52f9d6f4 100644
--- a/libavcodec/x86/hpeldsp_vp3_init.c
+++ b/libavcodec/x86/hpeldsp_vp3_init.c
@@ -40,12 +40,14 @@ void ff_put_no_rnd_pixels8_y2_exact_3dnow(uint8_t *block,
 
 av_cold void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags, int flags)
 {
+#if ARCH_X86_32
     if (EXTERNAL_AMD3DNOW(cpu_flags)) {
         if (flags & AV_CODEC_FLAG_BITEXACT) {
             c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_3dnow;
             c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_3dnow;
         }
     }
+#endif
 
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         if (flags & AV_CODEC_FLAG_BITEXACT) {
-- 
2.34.1



More information about the ffmpeg-devel mailing list