[FFmpeg-cvslog] x86: ABS2: port to cpuflags
Diego Biurrun
git at videolan.org
Tue Jan 15 15:30:17 CET 2013
ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Sun Jul 15 18:23:40 2012 +0200| [51969a652c2e9e330393c9ad40f919516a4795d1] | committer: Diego Biurrun
x86: ABS2: port to cpuflags
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=51969a652c2e9e330393c9ad40f919516a4795d1
---
libavcodec/x86/ac3dsp.asm | 3 ---
libavcodec/x86/dsputilenc.asm | 2 --
libavutil/x86/x86util.asm | 29 +++++++++++++----------------
3 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
index a5d9458..ef59db2 100644
--- a/libavcodec/x86/ac3dsp.asm
+++ b/libavcodec/x86/ac3dsp.asm
@@ -151,15 +151,12 @@ cglobal ac3_max_msb_abs_int16, 2,2,5, src, len
%endmacro
INIT_MMX mmx
-%define ABS2 ABS2_MMX
AC3_MAX_MSB_ABS_INT16 or_abs
INIT_MMX mmxext
-%define ABS2 ABS2_MMXEXT
AC3_MAX_MSB_ABS_INT16 min_max
INIT_XMM sse2
AC3_MAX_MSB_ABS_INT16 min_max
INIT_XMM ssse3
-%define ABS2 ABS2_SSSE3
AC3_MAX_MSB_ABS_INT16 or_abs
;-----------------------------------------------------------------------------
diff --git a/libavcodec/x86/dsputilenc.asm b/libavcodec/x86/dsputilenc.asm
index 3bb1f2f..a2cb7f9 100644
--- a/libavcodec/x86/dsputilenc.asm
+++ b/libavcodec/x86/dsputilenc.asm
@@ -263,7 +263,6 @@ INIT_MMX mmxext
HADAMARD8_DIFF
INIT_XMM sse2
-%define ABS2 ABS2_MMXEXT
%if ARCH_X86_64
%define ABS_SUM_8x8 ABS_SUM_8x8_64
%else
@@ -272,7 +271,6 @@ INIT_XMM sse2
HADAMARD8_DIFF 10
INIT_XMM ssse3
-%define ABS2 ABS2_SSSE3
%define ABS_SUM_8x8 ABS_SUM_8x8_64
HADAMARD8_DIFF 9
diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
index e24acdd..1451500 100644
--- a/libavutil/x86/x86util.asm
+++ b/libavutil/x86/x86util.asm
@@ -187,7 +187,18 @@
%endif
%endmacro
-%macro ABS2_MMX 4 ; a, b, tmp0, tmp1
+%macro ABS2 4
+%if cpuflag(ssse3)
+ pabsw %1, %1
+ pabsw %2, %2
+%elif cpuflag(mmxext) ; a, b, tmp0, tmp1
+ pxor %3, %3
+ pxor %4, %4
+ psubw %3, %1
+ psubw %4, %2
+ pmaxsw %1, %3
+ pmaxsw %2, %4
+%else ; a, b, tmp0, tmp1
pxor %3, %3
pxor %4, %4
pcmpgtw %3, %1
@@ -196,20 +207,7 @@
pxor %2, %4
psubw %1, %3
psubw %2, %4
-%endmacro
-
-%macro ABS2_MMXEXT 4 ; a, b, tmp0, tmp1
- pxor %3, %3
- pxor %4, %4
- psubw %3, %1
- psubw %4, %2
- pmaxsw %1, %3
- pmaxsw %2, %4
-%endmacro
-
-%macro ABS2_SSSE3 4
- pabsw %1, %1
- pabsw %2, %2
+%endif
%endmacro
%macro ABSB_MMX 2
@@ -252,7 +250,6 @@
ABS2 %3, %4, %5, %6
%endmacro
-%define ABS2 ABS2_MMX
%define ABSB ABSB_MMX
%define ABSB2 ABSB2_MMX
More information about the ffmpeg-cvslog
mailing list