Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 09/41] avcodec/x86/vc1dsp_init: Disable overridden functions on x64
Date: Fri, 10 Jun 2022 01:54:51 +0200
Message-ID: <DB6PR0101MB2214D69039BBFD9317CB30D28FA79@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com> (raw)
In-Reply-To: <DB6PR0101MB2214F3355A6887EB7203DAA38FA79@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com>

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

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/x86/h264_chromamc.asm     |  2 ++
 libavcodec/x86/vc1dsp_init.c         | 41 +++++++++++++++++++---------
 libavcodec/x86/vc1dsp_loopfilter.asm |  2 ++
 3 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/libavcodec/x86/h264_chromamc.asm b/libavcodec/x86/h264_chromamc.asm
index b5a78b537d..0421fa8695 100644
--- a/libavcodec/x86/h264_chromamc.asm
+++ b/libavcodec/x86/h264_chromamc.asm
@@ -448,7 +448,9 @@ chroma_mc2_mmx_func avg, h264
 
 INIT_MMX 3dnow
 chroma_mc8_mmx_func avg, h264, _rnd
+%if ARCH_X86_32
 chroma_mc8_mmx_func avg, vc1,  _nornd
+%endif
 chroma_mc8_mmx_func avg, rv40
 chroma_mc4_mmx_func avg, h264
 chroma_mc4_mmx_func avg, rv40
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 2fbf0b3a74..66d894061c 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -33,9 +33,10 @@
 #include "vc1dsp.h"
 #include "config.h"
 
-#define LOOP_FILTER(EXT) \
+#define LOOP_FILTER4(EXT) \
 void ff_vc1_v_loop_filter4_ ## EXT(uint8_t *src, ptrdiff_t stride, int pq); \
-void ff_vc1_h_loop_filter4_ ## EXT(uint8_t *src, ptrdiff_t stride, int pq); \
+void ff_vc1_h_loop_filter4_ ## EXT(uint8_t *src, ptrdiff_t stride, int pq);
+#define LOOP_FILTER816(EXT) \
 void ff_vc1_v_loop_filter8_ ## EXT(uint8_t *src, ptrdiff_t stride, int pq); \
 void ff_vc1_h_loop_filter8_ ## EXT(uint8_t *src, ptrdiff_t stride, int pq); \
 \
@@ -52,9 +53,13 @@ static void vc1_h_loop_filter16_ ## EXT(uint8_t *src, ptrdiff_t stride, int pq)
 }
 
 #if HAVE_X86ASM
-LOOP_FILTER(mmxext)
-LOOP_FILTER(sse2)
-LOOP_FILTER(ssse3)
+LOOP_FILTER4(mmxext)
+#if ARCH_X86_32
+LOOP_FILTER816(mmxext)
+#endif
+LOOP_FILTER816(sse2)
+LOOP_FILTER4(ssse3)
+LOOP_FILTER816(ssse3)
 
 void ff_vc1_h_loop_filter8_sse4(uint8_t *src, ptrdiff_t stride, int pq);
 
@@ -71,12 +76,14 @@ static void vc1_h_loop_filter16_sse4(uint8_t *src, ptrdiff_t stride, int pq)
         ff_ ## OP ## pixels ## DEPTH ## INSN(dst, src, stride, DEPTH);     \
     }
 
-DECLARE_FUNCTION(put_,  8, _mmx)
+#if ARCH_X86_32
 DECLARE_FUNCTION(put_, 16, _mmx)
 DECLARE_FUNCTION(avg_,  8, _mmx)
 DECLARE_FUNCTION(avg_, 16, _mmx)
-DECLARE_FUNCTION(avg_,  8, _mmxext)
 DECLARE_FUNCTION(avg_, 16, _mmxext)
+#endif
+DECLARE_FUNCTION(put_,  8, _mmx)
+DECLARE_FUNCTION(avg_,  8, _mmxext)
 DECLARE_FUNCTION(put_, 16, _sse2)
 DECLARE_FUNCTION(avg_, 16, _sse2)
 
@@ -114,9 +121,10 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
         if (EXTERNAL_MMXEXT(cpu_flags))
         ff_vc1dsp_init_mmxext(dsp);
 
-#define ASSIGN_LF(EXT) \
+#define ASSIGN_LF4(EXT) \
         dsp->vc1_v_loop_filter4  = ff_vc1_v_loop_filter4_ ## EXT; \
-        dsp->vc1_h_loop_filter4  = ff_vc1_h_loop_filter4_ ## EXT; \
+        dsp->vc1_h_loop_filter4  = ff_vc1_h_loop_filter4_ ## EXT
+#define ASSIGN_LF816(EXT) \
         dsp->vc1_v_loop_filter8  = ff_vc1_v_loop_filter8_ ## EXT; \
         dsp->vc1_h_loop_filter8  = ff_vc1_h_loop_filter8_ ## EXT; \
         dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_ ## EXT; \
@@ -127,19 +135,25 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
         dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_nornd_mmx;
 
         dsp->put_vc1_mspel_pixels_tab[1][0]      = put_vc1_mspel_mc00_8_mmx;
+#if ARCH_X86_32
         dsp->put_vc1_mspel_pixels_tab[0][0]      = put_vc1_mspel_mc00_16_mmx;
         dsp->avg_vc1_mspel_pixels_tab[1][0]      = avg_vc1_mspel_mc00_8_mmx;
         dsp->avg_vc1_mspel_pixels_tab[0][0]      = avg_vc1_mspel_mc00_16_mmx;
     }
     if (EXTERNAL_AMD3DNOW(cpu_flags)) {
         dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_3dnow;
+#endif
     }
     if (EXTERNAL_MMXEXT(cpu_flags)) {
-        ASSIGN_LF(mmxext);
-        dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_mmxext;
+        ASSIGN_LF4(mmxext);
+#if ARCH_X86_32
+        ASSIGN_LF816(mmxext);
 
-        dsp->avg_vc1_mspel_pixels_tab[1][0]      = avg_vc1_mspel_mc00_8_mmxext;
         dsp->avg_vc1_mspel_pixels_tab[0][0]      = avg_vc1_mspel_mc00_16_mmxext;
+#endif
+        dsp->avg_vc1_mspel_pixels_tab[1][0]      = avg_vc1_mspel_mc00_8_mmxext;
+
+        dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_mmxext;
 
         dsp->vc1_inv_trans_8x8_dc                = ff_vc1_inv_trans_8x8_dc_mmxext;
         dsp->vc1_inv_trans_4x8_dc                = ff_vc1_inv_trans_4x8_dc_mmxext;
@@ -156,7 +170,8 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
         dsp->avg_vc1_mspel_pixels_tab[0][0]      = avg_vc1_mspel_mc00_16_sse2;
     }
     if (EXTERNAL_SSSE3(cpu_flags)) {
-        ASSIGN_LF(ssse3);
+        ASSIGN_LF4(ssse3);
+        ASSIGN_LF816(ssse3);
         dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_nornd_ssse3;
         dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_ssse3;
     }
diff --git a/libavcodec/x86/vc1dsp_loopfilter.asm b/libavcodec/x86/vc1dsp_loopfilter.asm
index 74360949dc..3475a682b3 100644
--- a/libavcodec/x86/vc1dsp_loopfilter.asm
+++ b/libavcodec/x86/vc1dsp_loopfilter.asm
@@ -249,6 +249,7 @@ cglobal vc1_h_loop_filter4, 3,5,0
     call vc1_h_loop_filter_internal
     RET
 
+%if ARCH_X86_32
 ; void ff_vc1_v_loop_filter8_mmxext(uint8_t *src, ptrdiff_t stride, int pq)
 cglobal vc1_v_loop_filter8, 3,5,0
     START_V_FILTER
@@ -265,6 +266,7 @@ cglobal vc1_h_loop_filter8, 3,5,0
     lea  r0, [r0+4*r1]
     call vc1_h_loop_filter_internal
     RET
+%endif
 %endmacro
 
 INIT_MMX mmxext
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2022-06-09 23:57 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09 23:15 [FFmpeg-devel] [PATCH 00/41] Stop including superseded functions for x64 Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 01/41] avcodec/x86/qpeldsp: Remove unused ff_put_no_rnd_pixels16_l2_3dnow Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 02/41] avcodec/x86/hevcdsp_init: Remove unnecessary inclusion of get_bits.h Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 03/41] avcodec/hevcdec: Make ff_hevc_pel_weight static Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 04/41] avcodec/v4l2_m2m: Remove unused ff_v4l2_m2m_codec_full_reinit Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 05/41] avcodec/videodsp: Make ff_emulated_edge_mc_16 static Andreas Rheinhardt
2022-06-10 15:50   ` Ronald S. Bultje
2022-06-10 16:07     ` Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 06/41] avcodec/x86/fpel: Remove unused ff_avg_pixels4_mmx Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 07/41] avcodec/x86/rv34dsp: Remove unused ff_rv34_idct_dc_mmxext Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 08/41] avcodec/x86/h264_qpel_8bit: Remove unused function Andreas Rheinhardt
2022-06-09 23:54 ` Andreas Rheinhardt [this message]
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 10/41] avcodec/x86/ac3dsp_init: Disable overridden functions on x64 Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 11/41] avcodec/x86/audiodsp_init: " Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 12/41] avcodec/x86/diracdsp_init: " Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 13/41] avcodec/x86/mpegvideoenc: " Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 14/41] avcodec/x86/fdct: " Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 15/41] avcodec/x86/hevcdsp_init: " Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 16/41] avcodec/x86/rv40dsp_init: " Andreas Rheinhardt
2022-06-09 23:54 ` [FFmpeg-devel] [PATCH 17/41] avcodec/x86/cavsdsp: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 18/41] avcodec/x86/h264_intrapred_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 19/41] avfilter/x86/vf_noise: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 20/41] avcodec/x86/me_cmp: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 21/41] avcodec/x86/mpegvideoencdsp: Disable ff_pix_norm1_mmx " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 22/41] avcodec/x86/h264dsp_init: Disable overridden functions " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 23/41] avcodec/x86/sbrdsp_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 24/41] avcodec/x86/idctdsp_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 25/41] avcodec/x86/blockdsp_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 26/41] avcodec/x86/pixblockdsp_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 27/41] avcodec/x86/lossless_audiodsp_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 28/41] avcodec/x86/svq1enc_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 29/41] avcodec/x86/fmtconvert_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 30/41] avcodec/x86/hpeldsp_vp3_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 31/41] avcodec/x86/hpeldsp_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 32/41] avcodec/x86/h264_qpel: Make functions only used here static Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 33/41] avcodec/x86/h264_qpel: Disable overridden functions on x64 Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 34/41] avcodec/x86/h264chroma_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 35/41] swresample/x86/audio_convert_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 36/41] swresample/x86/rematrix_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 37/41] swscale/x86/rgb2rgb: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 38/41] swscale/x86/yuv2rgb: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 39/41] swscale/x86/swscale: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 40/41] avfilter/x86/vf_eq_init: " Andreas Rheinhardt
2022-06-09 23:55 ` [FFmpeg-devel] [PATCH 41/41] avutil/x86/pixelutils_init: " Andreas Rheinhardt
2022-06-11 20:14 ` [FFmpeg-devel] [PATCH 00/41] Stop including superseded functions for x64 Andreas Rheinhardt
2022-06-20 11:16   ` Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB6PR0101MB2214D69039BBFD9317CB30D28FA79@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git