diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-10-05 12:28:41 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-10-09 21:38:15 +0200 |
commit | 35af7add6fac7f926d0cbb5724f36f0fe5022488 (patch) | |
tree | 038c8d9a54b192093ed2c05b679a80ee6e0fa673 /libavcodec/x86/takdsp.asm | |
parent | 2f4374fae135afeee84f987c8fab8cbad1c7fcc7 (diff) | |
download | ffmpeg-35af7add6fac7f926d0cbb5724f36f0fe5022488.tar.gz |
avcodec/takdec: add x86 SIMD for rest of decorrelation modes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/x86/takdsp.asm')
-rw-r--r-- | libavcodec/x86/takdsp.asm | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/libavcodec/x86/takdsp.asm b/libavcodec/x86/takdsp.asm new file mode 100644 index 0000000000..d3c6a13f11 --- /dev/null +++ b/libavcodec/x86/takdsp.asm @@ -0,0 +1,116 @@ +;****************************************************************************** +;* TAK DSP SIMD optimizations +;* +;* Copyright (C) 2015 Paul B Mahol +;* +;* 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/x86util.asm" + +SECTION_RODATA + +pd_128: times 4 dd 128 + +SECTION .text + +INIT_XMM sse2 +cglobal tak_decorrelate_ls, 3, 3, 2, p1, p2, length + shl lengthd, 2 + add p1q, lengthq + add p2q, lengthq + neg lengthq +.loop: + mova m0, [p1q+lengthq+mmsize*0] + mova m1, [p1q+lengthq+mmsize*1] + paddd m0, [p2q+lengthq+mmsize*0] + paddd m1, [p2q+lengthq+mmsize*1] + mova [p2q+lengthq+mmsize*0], m0 + mova [p2q+lengthq+mmsize*1], m1 + add lengthq, mmsize*2 + jl .loop + REP_RET + +cglobal tak_decorrelate_sr, 3, 3, 2, p1, p2, length + shl lengthd, 2 + add p1q, lengthq + add p2q, lengthq + neg lengthq + +.loop: + mova m0, [p2q+lengthq+mmsize*0] + mova m1, [p2q+lengthq+mmsize*1] + psubd m0, [p1q+lengthq+mmsize*0] + psubd m1, [p1q+lengthq+mmsize*1] + mova [p1q+lengthq+mmsize*0], m0 + mova [p1q+lengthq+mmsize*1], m1 + add lengthq, mmsize*2 + jl .loop + REP_RET + +cglobal tak_decorrelate_sm, 3, 3, 6, p1, p2, length + shl lengthd, 2 + add p1q, lengthq + add p2q, lengthq + neg lengthq + +.loop: + mova m0, [p1q+lengthq] + mova m1, [p2q+lengthq] + mova m3, [p1q+lengthq+mmsize] + mova m4, [p2q+lengthq+mmsize] + mova m2, m1 + mova m5, m4 + psrld m2, 1 + psrld m5, 1 + psubd m0, m2 + psubd m3, m5 + paddd m1, m0 + paddd m4, m3 + mova [p1q+lengthq], m0 + mova [p2q+lengthq], m1 + mova [p1q+lengthq+mmsize], m3 + mova [p2q+lengthq+mmsize], m4 + add lengthq, mmsize*2 + jl .loop + REP_RET + +INIT_XMM sse4 +cglobal tak_decorrelate_sf, 3, 3, 5, p1, p2, length, dshift, dfactor + shl lengthd, 2 + add p1q, lengthq + add p2q, lengthq + neg lengthq + + movd m2, dshiftm + movd m3, dfactorm + pshufd m3, m3, 0 + mova m4, [pd_128] + +.loop: + mova m0, [p1q+lengthq] + mova m1, [p2q+lengthq] + psrld m1, m2 + pmulld m1, m3 + paddd m1, m4 + psrld m1, 8 + pslld m1, m2 + psubd m1, m0 + mova [p1q+lengthq], m1 + add lengthq, mmsize + jl .loop + REP_RET |