aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/x86/vf_transpose.asm
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-21 16:43:26 +0200
committerPaul B Mahol <onemda@gmail.com>2019-10-21 20:37:51 +0200
commitccd9bca15a46a1de4fb536dd097153a270ae3b9c (patch)
tree81822ec78a06c60da60974811dab834fb65adc62 /libavfilter/x86/vf_transpose.asm
parentf7f4691f9f745f6a087879ab855dd65f9f16879d (diff)
downloadffmpeg-ccd9bca15a46a1de4fb536dd097153a270ae3b9c.tar.gz
avfilter/vf_transpose: add x86 SIMD
Diffstat (limited to 'libavfilter/x86/vf_transpose.asm')
-rw-r--r--libavfilter/x86/vf_transpose.asm88
1 files changed, 88 insertions, 0 deletions
diff --git a/libavfilter/x86/vf_transpose.asm b/libavfilter/x86/vf_transpose.asm
new file mode 100644
index 0000000000..f9f585369a
--- /dev/null
+++ b/libavfilter/x86/vf_transpose.asm
@@ -0,0 +1,88 @@
+;*****************************************************************************
+;* x86-optimized functions for transpose filter
+;*
+;* Copyright (C) 2019 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 .text
+
+;------------------------------------------------------------------------------
+; void ff_transpose_8x8(uint8_t *src, ptrdiff_t src_linesize,
+; uint8_t *dst, ptrdiff_t dst_linesize)
+;------------------------------------------------------------------------------
+
+INIT_XMM sse2
+cglobal transpose_8x8_8, 4,5,8, src, src_linesize, dst, dst_linesize, linesize3
+ lea linesize3q, [src_linesizeq * 3]
+ movq m0, [srcq + src_linesizeq * 0]
+ movq m1, [srcq + src_linesizeq * 1]
+ movq m2, [srcq + src_linesizeq * 2]
+ movq m3, [srcq + linesize3q]
+ lea srcq, [srcq + src_linesizeq * 4]
+ movq m4, [srcq + src_linesizeq * 0]
+ movq m5, [srcq + src_linesizeq * 1]
+ movq m6, [srcq + src_linesizeq * 2]
+ movq m7, [srcq + linesize3q]
+
+ TRANSPOSE_8X8B 0, 1, 2, 3, 4, 5, 6, 7
+
+ lea linesize3q, [dst_linesizeq * 3]
+ movq [dstq + dst_linesizeq * 0], m0
+ movq [dstq + dst_linesizeq * 1], m1
+ movq [dstq + dst_linesizeq * 2], m2
+ movq [dstq + linesize3q], m3
+ lea dstq, [dstq + dst_linesizeq * 4]
+ movq [dstq + dst_linesizeq * 0], m4
+ movq [dstq + dst_linesizeq * 1], m5
+ movq [dstq + dst_linesizeq * 2], m6
+ movq [dstq + linesize3q], m7
+ RET
+
+%if ARCH_X86_64
+
+INIT_XMM sse2
+cglobal transpose_8x8_16, 4,5,9, src, src_linesize, dst, dst_linesize, linesize3
+ lea linesize3q, [src_linesizeq * 3]
+ movu m0, [srcq + src_linesizeq * 0]
+ movu m1, [srcq + src_linesizeq * 1]
+ movu m2, [srcq + src_linesizeq * 2]
+ movu m3, [srcq + linesize3q]
+ lea srcq, [srcq + src_linesizeq * 4]
+ movu m4, [srcq + src_linesizeq * 0]
+ movu m5, [srcq + src_linesizeq * 1]
+ movu m6, [srcq + src_linesizeq * 2]
+ movu m7, [srcq + linesize3q]
+
+ TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8
+
+ lea linesize3q, [dst_linesizeq * 3]
+ movu [dstq + dst_linesizeq * 0], m0
+ movu [dstq + dst_linesizeq * 1], m1
+ movu [dstq + dst_linesizeq * 2], m2
+ movu [dstq + linesize3q], m3
+ lea dstq, [dstq + dst_linesizeq * 4]
+ movu [dstq + dst_linesizeq * 0], m4
+ movu [dstq + dst_linesizeq * 1], m5
+ movu [dstq + dst_linesizeq * 2], m6
+ movu [dstq + linesize3q], m7
+ RET
+
+%endif