diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-29 14:10:34 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-29 14:20:35 +0200 |
commit | 65722e7fc5918644ca92d5cdfcb88a54b1b64d44 (patch) | |
tree | c975bfd5f19d5ac8ef07e7c49892747a833f6476 /libswresample/x86/audio_convert.asm | |
parent | 755667eebc0b6303814faadef047870071ccb5c6 (diff) | |
download | ffmpeg-65722e7fc5918644ca92d5cdfcb88a54b1b64d44.tar.gz |
swr: int32_to_int16_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.asm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libswresample/x86/audio_convert.asm b/libswresample/x86/audio_convert.asm index 1c70f6ef4c..f220e2d135 100644 --- a/libswresample/x86/audio_convert.asm +++ b/libswresample/x86/audio_convert.asm @@ -194,14 +194,45 @@ float_to_int16_u_int %+ SUFFIX REP_RET %endmacro +%macro INT32_TO_INT16 1 +cglobal int32_to_int16_%1, 3, 3, 2, dst, src, len + mov srcq, [srcq] + mov dstq, [dstq] +%ifidn %1, a + test dstq, mmsize-1 + jne int32_to_int16_u_int %+ SUFFIX + test srcq, mmsize-1 + jne int32_to_int16_u_int %+ SUFFIX +%else +int32_to_int16_u_int %+ SUFFIX +%endif + lea srcq, [srcq + 2*lenq] + add dstq, lenq + neg lenq +.next: + mov%1 m0, [ srcq+2*lenq] + mov%1 m1, [mmsize + srcq+2*lenq] + psrad m0, 16 + psrad m1, 16 + packssdw m0, m1 + mov%1 [ dstq+lenq], m0 + add lenq, mmsize + jl .next + REP_RET +%endmacro + INIT_MMX mmx INT16_TO_INT32 u INT16_TO_INT32 a +INT32_TO_INT16 u +INT32_TO_INT16 a INIT_XMM sse INT16_TO_INT32 u INT16_TO_INT32 a +INT32_TO_INT16 u +INT32_TO_INT16 a INIT_XMM sse2 INT32_TO_FLOAT u |