History

avutil/aarch64: add AV_COPY128 and AV_ZERO128 macros

Ramiro Polla committed 2 years ago

Commit abb4e131 parent 40dda882 files · +45 −1Browse files

Unified · Split

2 files
  1. libavutil/aarch64/intreadwrite.h +42 −0
  2. libavutil/intreadwrite.h +3 −1
libavutil/aarch64/intreadwrite.h+42−0
@@ -0,0 +1,42 @@
1+/*
2+ * This file is part of FFmpeg.
3+ *
4+ * FFmpeg is free software; you can redistribute it and/or
5+ * modify it under the terms of the GNU Lesser General Public
6+ * License as published by the Free Software Foundation; either
7+ * version 2.1 of the License, or (at your option) any later version.
8+ *
9+ * FFmpeg is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * Lesser General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Lesser General Public
15+ * License along with FFmpeg; if not, write to the Free Software
16+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+ */
18+
19+#ifndef AVUTIL_AARCH64_INTREADWRITE_H
20+#define AVUTIL_AARCH64_INTREADWRITE_H
21+
22+#if HAVE_INTRINSICS_NEON
23+
24+#include <arm_neon.h>
25+
26+#define AV_COPY128 AV_COPY128
27+static av_always_inline void AV_COPY128(void *d, const void *s)
28+{
29+ uint8x16_t tmp = vld1q_u8((const uint8_t *)s);
30+ vst1q_u8((uint8_t *)d, tmp);
31+}
32+
33+#define AV_ZERO128 AV_ZERO128
34+static av_always_inline void AV_ZERO128(void *d)
35+{
36+ uint8x16_t zero = vdupq_n_u8(0);
37+ vst1q_u8((uint8_t *)d, zero);
38+}
39+
40+#endif /* HAVE_INTRINSICS_NEON */
41+
42+#endif /* AVUTIL_AARCH64_INTREADWRITE_H */
libavutil/intreadwrite.h+3−1
@@ -64,7 +64,9 @@ typedef union { · 63 unmodified lines
6464
6565 #include "config.h"
6666
67−#if ARCH_MIPS
67+#if ARCH_AARCH64
68+# include "aarch64/intreadwrite.h"
69+#elif ARCH_MIPS
6870 # include "mips/intreadwrite.h"
6971 #elif ARCH_PPC
7072 # include "ppc/intreadwrite.h"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t