[FFmpeg-devel] [PATCH] avcodec/x86/pngdsp: Remove obsolete ff_add_bytes_l2_mmx()
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Mon Jul 25 06:43:13 EEST 2022
It is overridden by ff_add_bytes_l2_sse2() on any non-ancient CPU.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavcodec/x86/pngdsp.asm | 16 ++--------------
libavcodec/x86/pngdsp_init.c | 7 -------
2 files changed, 2 insertions(+), 21 deletions(-)
diff --git a/libavcodec/x86/pngdsp.asm b/libavcodec/x86/pngdsp.asm
index 50e4255dec..7bc43c79a0 100644
--- a/libavcodec/x86/pngdsp.asm
+++ b/libavcodec/x86/pngdsp.asm
@@ -29,9 +29,8 @@ cextern pw_255
SECTION .text
-; %1 = nr. of xmm registers used
-%macro ADD_BYTES_FN 1
-cglobal add_bytes_l2, 4, 6, %1, dst, src1, src2, wa, w, i
+INIT_XMM sse2
+cglobal add_bytes_l2, 4, 6, 2, dst, src1, src2, wa, w, i
%if ARCH_X86_64
movsxd waq, wad
%endif
@@ -53,7 +52,6 @@ cglobal add_bytes_l2, 4, 6, %1, dst, src1, src2, wa, w, i
cmp iq, waq
jl .loop_v
-%if mmsize == 16
; vector loop
mov waq, wq
and waq, ~7
@@ -66,7 +64,6 @@ cglobal add_bytes_l2, 4, 6, %1, dst, src1, src2, wa, w, i
.end_l:
cmp iq, waq
jl .loop_l
-%endif
; scalar loop for leftover
jmp .end_s
@@ -79,15 +76,6 @@ cglobal add_bytes_l2, 4, 6, %1, dst, src1, src2, wa, w, i
cmp iq, wq
jl .loop_s
REP_RET
-%endmacro
-
-%if ARCH_X86_32
-INIT_MMX mmx
-ADD_BYTES_FN 0
-%endif
-
-INIT_XMM sse2
-ADD_BYTES_FN 2
%macro ADD_PAETH_PRED_FN 1
cglobal add_png_paeth_prediction, 5, 7, %1, dst, src, top, w, bpp, end, cntr
diff --git a/libavcodec/x86/pngdsp_init.c b/libavcodec/x86/pngdsp_init.c
index edbe866c22..e2cd5effe3 100644
--- a/libavcodec/x86/pngdsp_init.c
+++ b/libavcodec/x86/pngdsp_init.c
@@ -20,7 +20,6 @@
*/
#include <stdint.h>
-#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/x86/cpu.h"
#include "libavcodec/pngdsp.h"
@@ -29,8 +28,6 @@ void ff_add_png_paeth_prediction_mmxext(uint8_t *dst, uint8_t *src,
uint8_t *top, int w, int bpp);
void ff_add_png_paeth_prediction_ssse3(uint8_t *dst, uint8_t *src,
uint8_t *top, int w, int bpp);
-void ff_add_bytes_l2_mmx (uint8_t *dst, uint8_t *src1,
- uint8_t *src2, int w);
void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1,
uint8_t *src2, int w);
@@ -38,10 +35,6 @@ av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
{
int cpu_flags = av_get_cpu_flags();
-#if ARCH_X86_32
- if (EXTERNAL_MMX(cpu_flags))
- dsp->add_bytes_l2 = ff_add_bytes_l2_mmx;
-#endif
if (EXTERNAL_MMXEXT(cpu_flags))
dsp->add_paeth_prediction = ff_add_png_paeth_prediction_mmxext;
if (EXTERNAL_SSE2(cpu_flags))
--
2.34.1
More information about the ffmpeg-devel
mailing list