[FFmpeg-cvslog] swr-x86-SIMD: 3 instructions less for stereo planar->packed s32/flt->s16

Michael Niedermayer git at videolan.org
Sun May 6 17:32:35 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun May  6 12:59:59 2012 +0200| [adfa53b91f675e71d4b6049db91b357ed51fff12] | committer: Michael Niedermayer

swr-x86-SIMD: 3 instructions less for stereo planar->packed s32/flt->s16

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libswresample/x86/audio_convert.asm |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/libswresample/x86/audio_convert.asm b/libswresample/x86/audio_convert.asm
index 0f2d503..f72e4ff 100644
--- a/libswresample/x86/audio_convert.asm
+++ b/libswresample/x86/audio_convert.asm
@@ -52,6 +52,7 @@ pack_2ch_%2_to_%1_u_int %+ SUFFIX
     neg     lenq
     %7
 .next:
+%if %4 >= %5
     mov%3     m0, [         srcq +(1<<%5)*lenq]
     mova      m1, m0
     mov%3     m2, [         src2q+(1<<%5)*lenq]
@@ -62,14 +63,18 @@ pack_2ch_%2_to_%1_u_int %+ SUFFIX
     punpckldq m0, m2
     punpckhdq m1, m2
 %endif
-%if %4 < %5
-    mov%3     m2, [mmsize + srcq +(1<<%5)*lenq]
-    mova      m3, m2
-    mov%3     m4, [mmsize + src2q+(1<<%5)*lenq]
-    punpckldq m2, m4
-    punpckhdq m3, m4
-%endif
     %6
+%else
+    mov%3     m0, [         srcq +(1<<%5)*lenq]
+    mov%3     m1, [mmsize + srcq +(1<<%5)*lenq]
+    mov%3     m2, [         src2q+(1<<%5)*lenq]
+    mov%3     m3, [mmsize + src2q+(1<<%5)*lenq]
+    %6
+    mova      m2, m0
+    punpcklwd m0, m1
+    punpckhwd m2, m1
+    SWAP 1,2
+%endif
     mov%3 [           dstq+(2<<%4)*lenq], m0
     mov%3 [  mmsize + dstq+(2<<%4)*lenq], m1
 %if %4 > %5



More information about the ffmpeg-cvslog mailing list