[FFmpeg-cvslog] x86: PABSW: port to cpuflags

Diego Biurrun git at videolan.org
Mon Nov 5 22:40:23 CET 2012


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Sun Jul 15 17:59:26 2012 +0200| [dbb37e77117466edfc146f9f0df4c70bef6239d6] | committer: Diego Biurrun

x86: PABSW: port to cpuflags

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dbb37e77117466edfc146f9f0df4c70bef6239d6
---

 libavcodec/x86/vc1dsp.asm |    3 ---
 libavutil/x86/x86util.asm |   22 ++++++++++------------
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/libavcodec/x86/vc1dsp.asm b/libavcodec/x86/vc1dsp.asm
index 4b56c31..adf08d7 100644
--- a/libavcodec/x86/vc1dsp.asm
+++ b/libavcodec/x86/vc1dsp.asm
@@ -268,7 +268,6 @@ cglobal vc1_h_loop_filter8, 3,5,0
 %endmacro
 
 INIT_MMX mmxext
-%define PABSW PABSW_MMXEXT
 VC1_LF
 
 INIT_XMM sse2
@@ -284,8 +283,6 @@ cglobal vc1_h_loop_filter8, 3,6,8
     VC1_H_LOOP_FILTER 8, r5
     RET
 
-%define PABSW PABSW_SSSE3
-
 INIT_MMX ssse3
 ; void ff_vc1_v_loop_filter4_ssse3(uint8_t *src, int stride, int pq)
 cglobal vc1_v_loop_filter4, 3,5,0
diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
index 9183d38..b35d594 100644
--- a/libavutil/x86/x86util.asm
+++ b/libavutil/x86/x86util.asm
@@ -145,13 +145,21 @@
 %endif
 %endmacro
 
-; PABSW macros assume %1 != %2, while ABS1/2 macros work in-place
-%macro PABSW_MMX 2
+; PABSW macro assumes %1 != %2, while ABS1/2 macros work in-place
+%macro PABSW 2
+%if cpuflag(ssse3)
+    pabsw      %1, %2
+%elif cpuflag(mmxext)
+    pxor    %1, %1
+    psubw   %1, %2
+    pmaxsw  %1, %2
+%else
     pxor       %1, %1
     pcmpgtw    %1, %2
     pxor       %2, %1
     psubw      %2, %1
     SWAP       %1, %2
+%endif
 %endmacro
 
 %macro PSIGNW_MMX 2
@@ -159,16 +167,6 @@
     psubw      %1, %2
 %endmacro
 
-%macro PABSW_MMXEXT 2
-    pxor    %1, %1
-    psubw   %1, %2
-    pmaxsw  %1, %2
-%endmacro
-
-%macro PABSW_SSSE3 2
-    pabsw      %1, %2
-%endmacro
-
 %macro PSIGNW_SSSE3 2
     psignw     %1, %2
 %endmacro



More information about the ffmpeg-cvslog mailing list