Debian Codegraph @

modules/lsp-dsp-lib/include/private/dsp/arch/aarch64/asimd/fft/const.h

raw
1 /*
2 * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2020 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-dsp-lib
6 * Created on: 31 мар. 2020 г.
7 *
8 * lsp-dsp-lib is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-dsp-lib is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #ifndef PRIVATE_DSP_ARCH_AARCH64_ASIMD_FFT_CONST_H_
23 #define PRIVATE_DSP_ARCH_AARCH64_ASIMD_FFT_CONST_H_
24
25 #ifndef PRIVATE_DSP_ARCH_AARCH64_ASIMD_IMPL
26 #error "This header should not be included directly"
27 #endif /* PRIVATE_DSP_ARCH_AARCH64_ASIMD_IMPL */
28
29 /*
30 // Generator code:
31 int main()
32 {
33 // Cosines
34 printf("A_RE:\n");
35 for (int i=0; i<16; ++i)
36 {
37 int n = 4 << i;
38 for (size_t k=0; (k<8); ++k)
39 printf("%.16f, ", cos(M_PI * (k%n) / n));
40 printf("\n");
41 }
42
43 // Sines
44 printf("\nA_IM:\n");
45 for (int i=0; i<16; ++i)
46 {
47 int n = 4 << i;
48 for (size_t k=0; (k<8); ++k)
49 printf("%.16f, ", sin(M_PI * (k%n) / n));
50 printf("\n");
51 }
52
53 // Both
54 printf("\nA:\n");
55 for (int i=0; i<16; ++i)
56 {
57 int n = 4 << i;
58 for (size_t k=0; (k<8); ++k)
59 printf("%.16f, ", cos(M_PI * (k%n) / n));
60 printf("\n");
61 for (size_t k=0; (k<8); ++k)
62 printf("%.16f, ", sin(M_PI * (k%n) / n));
63 printf("\n");
64 }
65
66 printf("\nDW_RE:\n");
67 for (int i=0; i<16; ++i)
68 printf("LSP_DSP_VEC4(%.16f),\n", cos(M_PI / (4 << i)));
69
70 printf("\nDW_IM:\n");
71 for (int i=0; i<16; ++i)
72 printf("LSP_DSP_VEC4(%.16f),\n", sin(M_PI / (4 << i)));
73
74 printf("\nDW:\n");
75 for (int i=0; i<16; ++i)
76 printf("LSP_DSP_VEC4(%.16f), LSP_DSP_VEC4(%.16f),\n", cos(M_PI / (1 << i)), sin(M_PI / (1 << i)));
77
78
79 return 0;
80 }
81
82 */
83
84 namespace lsp
85 {
86 namespace asimd
87 {
88 IF_ARCH_AARCH64(
89 static const float XFFT_A[] __lsp_aligned16 =
90 {
91 1.0000000000000000, 0.7071067811865476, 0.0000000000000000, -0.7071067811865475, 1.0000000000000000, 0.7071067811865476, 0.0000000000000000, -0.7071067811865475,
92 0.0000000000000000, 0.7071067811865475, 1.0000000000000000, 0.7071067811865476, 0.0000000000000000, 0.7071067811865475, 1.0000000000000000, 0.7071067811865476,
93 1.0000000000000000, 0.9238795325112867, 0.7071067811865476, 0.3826834323650898, 0.0000000000000000, -0.3826834323650897, -0.7071067811865475, -0.9238795325112867,
94 0.0000000000000000, 0.3826834323650898, 0.7071067811865475, 0.9238795325112867, 1.0000000000000000, 0.9238795325112867, 0.7071067811865476, 0.3826834323650899,
95 1.0000000000000000, 0.9807852804032304, 0.9238795325112867, 0.8314696123025452, 0.7071067811865476, 0.5555702330196023, 0.3826834323650898, 0.1950903220161283,
96 0.0000000000000000, 0.1950903220161282, 0.3826834323650898, 0.5555702330196022, 0.7071067811865475, 0.8314696123025452, 0.9238795325112867, 0.9807852804032304,
97 1.0000000000000000, 0.9951847266721969, 0.9807852804032304, 0.9569403357322088, 0.9238795325112867, 0.8819212643483550, 0.8314696123025452, 0.7730104533627370,
98 0.0000000000000000, 0.0980171403295606, 0.1950903220161282, 0.2902846772544623, 0.3826834323650898, 0.4713967368259976, 0.5555702330196022, 0.6343932841636455,
99 1.0000000000000000, 0.9987954562051724, 0.9951847266721969, 0.9891765099647810, 0.9807852804032304, 0.9700312531945440, 0.9569403357322088, 0.9415440651830208,
100 0.0000000000000000, 0.0490676743274180, 0.0980171403295606, 0.1467304744553617, 0.1950903220161282, 0.2429801799032639, 0.2902846772544623, 0.3368898533922201,
101 1.0000000000000000, 0.9996988186962042, 0.9987954562051724, 0.9972904566786902, 0.9951847266721969, 0.9924795345987100, 0.9891765099647810, 0.9852776423889412,
102 0.0000000000000000, 0.0245412285229123, 0.0490676743274180, 0.0735645635996674, 0.0980171403295606, 0.1224106751992162, 0.1467304744553617, 0.1709618887603012,
103 1.0000000000000000, 0.9999247018391445, 0.9996988186962042, 0.9993223845883495, 0.9987954562051724, 0.9981181129001492, 0.9972904566786902, 0.9963126121827780,
104 0.0000000000000000, 0.0122715382857199, 0.0245412285229123, 0.0368072229413588, 0.0490676743274180, 0.0613207363022086, 0.0735645635996674, 0.0857973123444399,
105 1.0000000000000000, 0.9999811752826011, 0.9999247018391445, 0.9998305817958234, 0.9996988186962042, 0.9995294175010931, 0.9993223845883495, 0.9990777277526454,
106 0.0000000000000000, 0.0061358846491545, 0.0122715382857199, 0.0184067299058048, 0.0245412285229123, 0.0306748031766366, 0.0368072229413588, 0.0429382569349408,
107 1.0000000000000000, 0.9999952938095762, 0.9999811752826011, 0.9999576445519639, 0.9999247018391445, 0.9998823474542126, 0.9998305817958234, 0.9997694053512153,
108 0.0000000000000000, 0.0030679567629660, 0.0061358846491545, 0.0092037547820598, 0.0122715382857199, 0.0153392062849881, 0.0184067299058048, 0.0214740802754695,
109 1.0000000000000000, 0.9999988234517019, 0.9999952938095762, 0.9999894110819284, 0.9999811752826011, 0.9999705864309741, 0.9999576445519639, 0.9999423496760239,
110 0.0000000000000000, 0.0015339801862848, 0.0030679567629660, 0.0046019261204486, 0.0061358846491545, 0.0076698287395311, 0.0092037547820598, 0.0107376591672645,
111 1.0000000000000000, 0.9999997058628822, 0.9999988234517019, 0.9999973527669782, 0.9999952938095762, 0.9999926465807072, 0.9999894110819284, 0.9999855873151432,
112 0.0000000000000000, 0.0007669903187427, 0.0015339801862848, 0.0023009691514258, 0.0030679567629660, 0.0038349425697062, 0.0046019261204486, 0.0053689069639963,
113 1.0000000000000000, 0.9999999264657179, 0.9999997058628822, 0.9999993381915255, 0.9999988234517019, 0.9999981616434870, 0.9999973527669782, 0.9999963968222944,
114 0.0000000000000000, 0.0003834951875714, 0.0007669903187427, 0.0011504853371138, 0.0015339801862848, 0.0019174748098554, 0.0023009691514258, 0.0026844631545960,
115 1.0000000000000000, 0.9999999816164293, 0.9999999264657179, 0.9999998345478677, 0.9999997058628822, 0.9999995404107661, 0.9999993381915255, 0.9999990992051678,
116 0.0000000000000000, 0.0001917475973107, 0.0003834951875714, 0.0005752427637321, 0.0007669903187427, 0.0009587378455533, 0.0011504853371138, 0.0013422327863743,
117 1.0000000000000000, 0.9999999954041073, 0.9999999816164293, 0.9999999586369661, 0.9999999264657179, 0.9999998851026849, 0.9999998345478677, 0.9999997748012666,
118 0.0000000000000000, 0.0000958737990960, 0.0001917475973107, 0.0002876213937629, 0.0003834951875714, 0.0004793689778549, 0.0005752427637321, 0.0006711165443218,
119 1.0000000000000000, 0.9999999988510269, 0.9999999954041073, 0.9999999896592414, 0.9999999816164293, 0.9999999712756709, 0.9999999586369661, 0.9999999437003151,
120 0.0000000000000000, 0.0000479368996031, 0.0000958737990960, 0.0001438106983686, 0.0001917475973107, 0.0002396844958122, 0.0002876213937629, 0.0003355582910527,
121 1.0000000000000000, 0.9999999997127567, 0.9999999988510269, 0.9999999974148104, 0.9999999954041073, 0.9999999928189177, 0.9999999896592414, 0.9999999859250787,
122 0.0000000000000000, 0.0000239684498084, 0.0000479368996031, 0.0000719053493702, 0.0000958737990960, 0.0001198422487667, 0.0001438106983686, 0.0001677791478878
123 };
124
125 static const float XFFT_DW[] __lsp_aligned16 =
126 {
127 LSP_DSP_VEC4(0.0000000000000000), LSP_DSP_VEC4(0.0000000000000000),
128 LSP_DSP_VEC4(-1.0000000000000000), LSP_DSP_VEC4(0.0000000000000000),
129 LSP_DSP_VEC4(0.0000000000000000), LSP_DSP_VEC4(1.0000000000000000),
130 LSP_DSP_VEC4(0.7071067811865476), LSP_DSP_VEC4(0.7071067811865475),
131 LSP_DSP_VEC4(0.9238795325112867), LSP_DSP_VEC4(0.3826834323650898),
132 LSP_DSP_VEC4(0.9807852804032304), LSP_DSP_VEC4(0.1950903220161282),
133 LSP_DSP_VEC4(0.9951847266721969), LSP_DSP_VEC4(0.0980171403295606),
134 LSP_DSP_VEC4(0.9987954562051724), LSP_DSP_VEC4(0.0490676743274180),
135 LSP_DSP_VEC4(0.9996988186962042), LSP_DSP_VEC4(0.0245412285229123),
136 LSP_DSP_VEC4(0.9999247018391445), LSP_DSP_VEC4(0.0122715382857199),
137 LSP_DSP_VEC4(0.9999811752826011), LSP_DSP_VEC4(0.0061358846491545),
138 LSP_DSP_VEC4(0.9999952938095762), LSP_DSP_VEC4(0.0030679567629660),
139 LSP_DSP_VEC4(0.9999988234517019), LSP_DSP_VEC4(0.0015339801862848),
140 LSP_DSP_VEC4(0.9999997058628822), LSP_DSP_VEC4(0.0007669903187427),
141 LSP_DSP_VEC4(0.9999999264657179), LSP_DSP_VEC4(0.0003834951875714),
142 LSP_DSP_VEC4(0.9999999816164293), LSP_DSP_VEC4(0.0001917475973107),
143 LSP_DSP_VEC4(0.9999999954041073), LSP_DSP_VEC4(0.0000958737990960),
144 };
145 )
146 }
147 }
148
149 #endif /* PRIVATE_DSP_ARCH_AARCH64_ASIMD_FFT_CONST_H_ */