[FFmpeg-cvslog] swr: int16->int32: use the old index negate trick to avoid 2 adds

Michael Niedermayer git at videolan.org
Sat Apr 28 17:19:24 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr 28 17:03:20 2012 +0200| [95057b197268eaa45a96923d9a13e4181b2af809] | committer: Michael Niedermayer

swr: int16->int32: use the old index negate trick to avoid 2 adds

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

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

 libswresample/x86/audio_convert.asm |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/libswresample/x86/audio_convert.asm b/libswresample/x86/audio_convert.asm
index 118b5e3..59de2d4 100644
--- a/libswresample/x86/audio_convert.asm
+++ b/libswresample/x86/audio_convert.asm
@@ -35,18 +35,20 @@ cglobal int16_to_int32_%1, 3, 3, 3, dst, src, len
 %else
 int16_to_int32_u_int %+ SUFFIX
 %endif
+    add     dstq, lenq
+    shr     lenq, 1
+    add     srcq, lenq
+    neg     lenq
 .next
-    mov%1 m4, [srcq]
-    pxor m0, m0
-    pxor m1, m1
-    punpcklwd m0, m4
-    punpckhwd m1, m4
-    mov%1 [         dstq], m0
-    mov%1 [mmsize + dstq], m1
-    add srcq, mmsize
-    add dstq, 2*mmsize
-    sub lenq, 2*mmsize
-        jg .next
+    mov%1     m2, [srcq+lenq]
+    pxor      m0, m0
+    pxor      m1, m1
+    punpcklwd m0, m2
+    punpckhwd m1, m2
+    mov%1 [         dstq+2*lenq], m0
+    mov%1 [mmsize + dstq+2*lenq], m1
+    add lenq, mmsize
+        jl .next
 %if mmsize == 8
     emms
 %endif



More information about the ffmpeg-cvslog mailing list