summaryrefslogtreecommitdiff
path: root/libswresample/x86/audio_convert.asm
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-28 12:23:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-28 13:15:44 +0200
commitbcc66ff0e4ba50033804aaaf0eb1f92aab959c80 (patch)
treef3f45200cd3fe8fb0bbc27b806b7497913596905 /libswresample/x86/audio_convert.asm
parent06b62cb8f2886eb1baf60c3146f4c4cade31e369 (diff)
swr: add int16_to_int32_mmx/sse
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/x86/audio_convert.asm')
-rw-r--r--libswresample/x86/audio_convert.asm52
1 files changed, 52 insertions, 0 deletions
diff --git a/libswresample/x86/audio_convert.asm b/libswresample/x86/audio_convert.asm
new file mode 100644
index 0000000000..c7ce8c6c53
--- /dev/null
+++ b/libswresample/x86/audio_convert.asm
@@ -0,0 +1,52 @@
+;******************************************************************************
+;* Copyright (c) 2012 Michael Niedermayer
+;*
+;* This file is part of FFmpeg.
+;*
+;* FFmpeg is free software; you can redistribute it and/or
+;* modify it under the terms of the GNU Lesser General Public
+;* License as published by the Free Software Foundation; either
+;* version 2.1 of the License, or (at your option) any later version.
+;*
+;* FFmpeg is distributed in the hope that it will be useful,
+;* but WITHOUT ANY WARRANTY; without even the implied warranty of
+;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;* Lesser General Public License for more details.
+;*
+;* You should have received a copy of the GNU Lesser General Public
+;* License along with FFmpeg; if not, write to the Free Software
+;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+;******************************************************************************
+
+%include "libavutil/x86/x86inc.asm"
+%include "libavutil/x86/x86util.asm"
+
+SECTION .text
+
+%macro INT16_TO_INT32 0
+cglobal int16_to_int32_%1, 3, 3, 0, dst, src, len
+ mov srcq, [srcq]
+ mov dstq, [dstq]
+.next
+ movu m4, [srcq]
+ pxor m0, m0
+ pxor m1, m1
+ punpcklwd m0, m4
+ punpckhwd m1, m4
+ movu [ dstq], m0
+ movu [mmsize + dstq], m1
+ add srcq, mmsize
+ add dstq, 2*mmsize
+ sub lenq, 2*mmsize
+ jg .next
+%if mmsize == 8
+ emms
+%endif
+ REP_RET
+%endmacro
+
+INIT_MMX mmx
+INT16_TO_INT32
+
+INIT_XMM sse
+INT16_TO_INT32