aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/aarch64/fmtconvert_neon.S
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2015-12-03 11:04:29 +0100
committerJanne Grunau <janne-libav@jannau.net>2015-12-14 16:45:02 +0100
commita0fc780a2093784e8664f88205ee1b215e109cee (patch)
tree3d4f4fbf79d02f6eb93fd93d304af9a6e10e0691 /libavcodec/aarch64/fmtconvert_neon.S
parent705f5e5e155f6f280a360af220fc5b30cfcee702 (diff)
downloadffmpeg-a0fc780a2093784e8664f88205ee1b215e109cee.tar.gz
arm64: int32_to_float_fmul neon asm
3% faster dts decoding on a cortex-a57. cortex-a57 cortex-a53 int32_to_float_fmul_array8_c: 1270.9 4475.6 int32_to_float_fmul_array8_neon: 328.6 569.2 int32_to_float_fmul_scalar_c: 928.5 4119.6 int32_to_float_fmul_scalar_neon: 309.1 524.1
Diffstat (limited to 'libavcodec/aarch64/fmtconvert_neon.S')
-rw-r--r--libavcodec/aarch64/fmtconvert_neon.S76
1 files changed, 76 insertions, 0 deletions
diff --git a/libavcodec/aarch64/fmtconvert_neon.S b/libavcodec/aarch64/fmtconvert_neon.S
new file mode 100644
index 0000000000..3b33c87ade
--- /dev/null
+++ b/libavcodec/aarch64/fmtconvert_neon.S
@@ -0,0 +1,76 @@
+/*
+ * ARM NEON optimised Format Conversion Utils
+ * Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
+ * Copyright (c) 2015 Janne Grunau <janne-libav@jannau.net>
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "libavutil/aarch64/asm.S"
+
+function ff_int32_to_float_fmul_scalar_neon, export=1
+ ld1 {v1.4s,v2.4s}, [x1], #32
+ scvtf v1.4s, v1.4s
+ scvtf v2.4s, v2.4s
+1:
+ subs w2, w2, #8
+ fmul v3.4s, v1.4s, v0.s[0]
+ fmul v4.4s, v2.4s, v0.s[0]
+ b.le 2f
+ ld1 {v1.4s,v2.4s}, [x1], #32
+ st1 {v3.4s,v4.4s}, [x0], #32
+ scvtf v1.4s, v1.4s
+ scvtf v2.4s, v2.4s
+ b 1b
+2:
+ st1 {v3.4s,v4.4s}, [x0]
+ ret
+endfunc
+
+function ff_int32_to_float_fmul_array8_neon, export=1
+ lsr w4, w4, #3
+ subs w5, w4, #1
+ b.eq 1f
+2:
+ ld1 {v0.4s,v1.4s}, [x2], #32
+ ld1 {v2.4s,v3.4s}, [x2], #32
+ scvtf v0.4s, v0.4s
+ scvtf v1.4s, v1.4s
+ ld1 {v16.2s}, [x3], #8
+ scvtf v2.4s, v2.4s
+ scvtf v3.4s, v3.4s
+ fmul v4.4s, v0.4s, v16.s[0]
+ fmul v5.4s, v1.4s, v16.s[0]
+ fmul v6.4s, v2.4s, v16.s[1]
+ fmul v7.4s, v3.4s, v16.s[1]
+ st1 {v4.4s,v5.4s}, [x1], #32
+ st1 {v6.4s,v7.4s}, [x1], #32
+ subs w5, w5, #2
+ b.gt 2b
+ b.eq 1f
+ ret
+1:
+ ld1 {v0.4s,v1.4s}, [x2]
+ ld1 {v16.s}[0], [x3]
+ scvtf v0.4s, v0.4s
+ scvtf v1.4s, v1.4s
+ fmul v4.4s, v0.4s, v16.s[0]
+ fmul v5.4s, v1.4s, v16.s[0]
+ st1 {v4.4s,v5.4s}, [x1]
+ ret
+endfunc