0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
1 /*
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
2 * Copyright 2012 Peter Meerwald <p.meerwald@bct-electronic.com>
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
3 */
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
4
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
5 #include <stdlib.h>
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
6 #include <stdio.h>
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
7 #include <stdarg.h>
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
8 #include <string.h>
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
9 #include <math.h>
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
10 #include <sys/time.h>
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
11 #include <assert.h>
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
12
|
1
|
13 typedef unsigned char uint8_t;
|
|
14 typedef short int16_t;
|
|
15 typedef unsigned int uint32_t;
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
16
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
17 typedef enum pa_sample_format {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
18 PA_SAMPLE_S16LE,
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
19 PA_SAMPLE_FLOAT32LE,
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
20 } pa_sample_format_t;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
21 #define PA_SAMPLE_S16NE PA_SAMPLE_S16LE
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
22 #define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32LE
|
1
|
23
|
|
24 typedef struct pa_sample_spec {
|
|
25 pa_sample_format_t format;
|
|
26 uint32_t rate;
|
|
27 uint8_t channels;
|
|
28 } pa_sample_spec;
|
|
29
|
|
30 #define PA_CHANNELS_MAX 32
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
31 typedef struct {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
32 pa_sample_format_t *format;
|
1
|
33 pa_sample_spec *i_ss, *o_ss;
|
|
34 float map_table_f[PA_CHANNELS_MAX][PA_CHANNELS_MAX];
|
|
35 int32_t map_table_i[PA_CHANNELS_MAX][PA_CHANNELS_MAX];
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
36 } pa_remap_t;
|
1
|
37
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
38 typedef long long unsigned int pa_usec_t;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
39
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
40 #define pa_assert(x) assert(x)
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
41 #define pa_assert_not_reached() assert(0)
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
42
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
43 #define PA_CLAMP_UNLIKELY(x, low, high) \
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
44 (((x) < (low)) ? (low) : (((x) > (high)) ? (high) : (x)))
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
45
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
46 static void pa_log_info(const char *format, ...) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
47 va_list ap;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
48 char buf[1024];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
49 va_start(ap, format);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
50 vsprintf(buf, format, ap);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
51 printf("%s\n", buf);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
52 va_end(ap);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
53 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
54
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
55 #define pa_log_debug pa_log_info
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
56
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
57 static pa_usec_t pa_rtclock_now() {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
58 struct timeval tv;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
59 gettimeofday(&tv, NULL);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
60
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
61 return tv.tv_sec * 1000000ULL + tv.tv_usec;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
62 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
63
|
1
|
64 static void remap_channels_matrix_c(pa_remap_t *m, void *dst, const void *src, unsigned n) {
|
|
65 unsigned oc, ic, i;
|
|
66 unsigned n_ic, n_oc;
|
|
67
|
|
68 n_ic = m->i_ss->channels;
|
|
69 n_oc = m->o_ss->channels;
|
|
70
|
|
71 switch (*m->format) {
|
|
72 case PA_SAMPLE_FLOAT32NE:
|
|
73 {
|
|
74 float *d, *s;
|
|
75
|
|
76 memset(dst, 0, n * sizeof(float) * n_oc);
|
|
77
|
|
78 for (oc = 0; oc < n_oc; oc++) {
|
|
79
|
|
80 for (ic = 0; ic < n_ic; ic++) {
|
|
81 float vol;
|
|
82
|
|
83 vol = m->map_table_f[oc][ic];
|
|
84
|
|
85 if (vol <= 0.0)
|
|
86 continue;
|
|
87
|
|
88 d = (float *)dst + oc;
|
|
89 s = (float *)src + ic;
|
|
90
|
|
91 if (vol >= 1.0) {
|
|
92 for (i = n; i > 0; i--, s += n_ic, d += n_oc)
|
|
93 *d += *s;
|
|
94 } else {
|
|
95 for (i = n; i > 0; i--, s += n_ic, d += n_oc)
|
|
96 *d += *s * vol;
|
|
97 }
|
|
98 }
|
|
99 }
|
|
100
|
|
101 break;
|
|
102 }
|
|
103 case PA_SAMPLE_S16NE:
|
|
104 {
|
|
105 int16_t *d, *s;
|
|
106
|
|
107 memset(dst, 0, n * sizeof(int16_t) * n_oc);
|
|
108
|
|
109 for (oc = 0; oc < n_oc; oc++) {
|
|
110
|
|
111 for (ic = 0; ic < n_ic; ic++) {
|
|
112 int32_t vol;
|
|
113
|
|
114 vol = m->map_table_i[oc][ic];
|
|
115
|
|
116 if (vol <= 0)
|
|
117 continue;
|
|
118
|
|
119 d = (int16_t *)dst + oc;
|
|
120 s = (int16_t *)src + ic;
|
|
121
|
|
122 if (vol >= 0x10000) {
|
|
123 for (i = n; i > 0; i--, s += n_ic, d += n_oc)
|
|
124 *d += *s;
|
|
125 } else {
|
|
126 for (i = n; i > 0; i--, s += n_ic, d += n_oc)
|
|
127 *d += (int16_t) (((int32_t)*s * vol) >> 16);
|
|
128 }
|
|
129 }
|
|
130 }
|
|
131 break;
|
|
132 }
|
|
133 default:
|
|
134 pa_assert_not_reached();
|
|
135 }
|
|
136 }
|
|
137
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
138 static void remap_mono_to_stereo_c(pa_remap_t *m, void *dst, const void *src, unsigned n) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
139 unsigned i;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
140
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
141 switch (*m->format) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
142 case PA_SAMPLE_FLOAT32NE:
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
143 {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
144 float *d, *s;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
145
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
146 d = (float *) dst;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
147 s = (float *) src;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
148
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
149 for (i = n >> 2; i; i--) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
150 d[0] = d[1] = s[0];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
151 d[2] = d[3] = s[1];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
152 d[4] = d[5] = s[2];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
153 d[6] = d[7] = s[3];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
154 s += 4;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
155 d += 8;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
156 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
157 for (i = n & 3; i; i--) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
158 d[0] = d[1] = s[0];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
159 s++;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
160 d += 2;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
161 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
162 break;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
163 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
164 case PA_SAMPLE_S16NE:
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
165 {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
166 int16_t *d, *s;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
167
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
168 d = (int16_t *) dst;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
169 s = (int16_t *) src;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
170
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
171 for (i = n >> 2; i; i--) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
172 d[0] = d[1] = s[0];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
173 d[2] = d[3] = s[1];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
174 d[4] = d[5] = s[2];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
175 d[6] = d[7] = s[3];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
176 s += 4;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
177 d += 8;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
178 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
179 for (i = n & 3; i; i--) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
180 d[0] = d[1] = s[0];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
181 s++;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
182 d += 2;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
183 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
184 break;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
185 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
186 default:
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
187 pa_assert_not_reached();
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
188 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
189 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
190
|
1
|
191
|
|
192
|
|
193 static void remap_stereo_to_mono_c(pa_remap_t *m, void *dst, const void *src, unsigned n) {
|
|
194 unsigned i;
|
|
195
|
|
196 switch (*m->format) {
|
|
197 case PA_SAMPLE_FLOAT32NE:
|
|
198 {
|
|
199 float *d = (float *) dst, *s = (float *) src;
|
|
200
|
|
201 for (i = n >> 2; i > 0; i--) {
|
|
202 d[0] = s[0] + s[1];
|
|
203 d[1] = s[2] + s[3];
|
|
204 d[2] = s[4] + s[5];
|
|
205 d[3] = s[6] + s[7];
|
|
206 s += 8;
|
|
207 d += 4;
|
|
208 }
|
|
209 for (i = n & 3; i; i--) {
|
|
210 d[0] = s[0] + s[1];
|
|
211 s += 2;
|
|
212 d += 1;
|
|
213 }
|
|
214 break;
|
|
215 }
|
|
216 case PA_SAMPLE_S16NE:
|
|
217 {
|
|
218 int16_t *d = (int16_t *) dst, *s = (int16_t *) src;
|
|
219
|
|
220 for (i = n >> 2; i > 0; i--) {
|
|
221 *d++ += s[0] + s[1];
|
|
222 *d++ += s[2] + s[3];
|
|
223 *d++ += s[4] + s[5];
|
|
224 *d++ += s[6] + s[7];
|
|
225 s += 8;
|
|
226 }
|
|
227 for (i = n & 3; i; i--) {
|
|
228 *d++ += s[0] + s[1];
|
|
229 s += 2;
|
|
230 }
|
|
231 break;
|
|
232 }
|
|
233 default:
|
|
234 pa_assert_not_reached();
|
|
235 }
|
|
236 }
|
|
237
|
|
238
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
239 #if defined(__arm__)
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
240
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
241 #include "arm_neon.h"
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
242
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
243 void remap_mono_to_stereo_neon(pa_remap_t *m, void *dst, const void *src, unsigned n) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
244 unsigned i;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
245 switch (*m->format) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
246 case PA_SAMPLE_FLOAT32NE:
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
247 {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
248 float *d = (float *) dst, *s = (float *) src;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
249
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
250 for (i = 0; i < n/4; i++) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
251 float32x4x2_t stereo;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
252 stereo.val[0] = vld1q_f32(s);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
253 stereo.val[1] = stereo.val[0];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
254 vst2q_f32(d, stereo);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
255 s += 4;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
256 d += 8;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
257 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
258
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
259 for (i = n & ~3; i < n; i++) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
260 d[0] = d[1] = s[0];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
261 s++;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
262 d += 2;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
263 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
264 break;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
265 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
266 case PA_SAMPLE_S16NE:
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
267 {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
268 int16_t *d = (int16_t *) dst, *s = (int16_t *) src;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
269
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
270 for (i = 0; i < n/8; i++) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
271 int16x8x2_t stereo;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
272 stereo.val[0] = vld1q_s16(s);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
273 stereo.val[1] = stereo.val[0];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
274 vst2q_s16(d, stereo);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
275 s += 8;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
276 d += 16;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
277 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
278
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
279 for (i = n & ~7; i < n; i++) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
280 d[0] = d[1] = s[0];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
281 s++;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
282 d += 2;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
283 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
284 break;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
285 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
286 default:
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
287 pa_assert_not_reached();
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
288 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
289 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
290
|
1
|
291 /* don't inline, causes ICE, see https://bugs.launchpad.net/bugs/936863 */
|
|
292 static __attribute__ ((noinline)) void stereo_to_mono_float(float *d, const float *s, unsigned n) {
|
|
293 unsigned i;
|
|
294
|
|
295 for (i = 0; i < n/4; i++) {
|
|
296 float32x4x2_t stereo = vld2q_f32(s);
|
|
297 float32x4_t mono = vaddq_f32(stereo.val[0], stereo.val[1]);
|
|
298 vst1q_f32(d, mono);
|
|
299 s += 8;
|
|
300 d += 4;
|
|
301 }
|
|
302 for (i = n & ~3; i < n; i++) {
|
|
303 d[0] = s[0] + s[1];
|
|
304 s += 2;
|
|
305 d++;
|
|
306 }
|
|
307 }
|
|
308
|
|
309 /* don't inline, causes ICE, see https://bugs.launchpad.net/bugs/936863 */
|
|
310 static __attribute__ ((noinline)) void stereo_to_mono_int16(int16_t *d, const int16_t *s, unsigned n) {
|
|
311 unsigned int i;
|
|
312
|
|
313 for (i = 0; i < n/8; i++) {
|
|
314 int16x8x2_t stereo = vld2q_s16(s);
|
|
315 int16x8_t mono = vaddq_s16(stereo.val[0], stereo.val[1]);
|
|
316 vst1q_s16(d, mono);
|
|
317 s += 16;
|
|
318 d += 8;
|
|
319 }
|
|
320 for (i = n & ~7; i < n; i++) {
|
|
321 d[0] = s[0] + s[1];
|
|
322 s += 2;
|
|
323 d++;
|
|
324 }
|
|
325 }
|
|
326
|
|
327 static void remap_stereo_to_mono_neon(pa_remap_t *m, void *dst, const void *src, unsigned n) {
|
|
328 switch (*m->format) {
|
|
329 case PA_SAMPLE_FLOAT32NE:
|
|
330 stereo_to_mono_float(dst, src, n);
|
|
331 break;
|
|
332 case PA_SAMPLE_S16NE:
|
|
333 stereo_to_mono_int16(dst, src, n);
|
|
334 break;
|
|
335 default:
|
|
336 pa_assert_not_reached();
|
|
337 }
|
|
338 }
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
339 #define SAMPLES 1019
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
340 #define TIMES 10000
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
341
|
1
|
342 static void run_test_mono_to_stereo_float(void) {
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
343 float stereo[2*SAMPLES];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
344 float stereo_ref[2*SAMPLES];
|
1
|
345 float stereo_gen[2*SAMPLES];
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
346 float mono[SAMPLES];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
347 int i;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
348 pa_usec_t start, stop;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
349 pa_sample_format_t sf;
|
1
|
350 pa_sample_spec iss, oss;
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
351 pa_remap_t remap;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
352
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
353 pa_log_debug("checking NEON remap_mono_to_stereo(float, %d)", SAMPLES);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
354
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
355 memset(stereo_ref, 0, sizeof(stereo_ref));
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
356 memset(stereo, 0, sizeof(stereo));
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
357
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
358 for (i = 0; i < SAMPLES; i++) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
359 mono[i] = rand()/(float) RAND_MAX - 0.5f;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
360 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
361
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
362 sf = PA_SAMPLE_FLOAT32NE;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
363 remap.format = &sf;
|
1
|
364 iss.format = PA_SAMPLE_FLOAT32NE;
|
|
365 iss.channels = 1;
|
|
366 oss.format = PA_SAMPLE_FLOAT32NE;
|
|
367 oss.channels = 2;
|
|
368 remap.i_ss = &iss;
|
|
369 remap.o_ss = &oss;
|
|
370 remap.map_table_f[0][0] = 1.0;
|
|
371 remap.map_table_f[1][0] = 1.0;
|
|
372
|
|
373 remap_mono_to_stereo_c(&remap, stereo_ref, mono, SAMPLES);
|
|
374 remap_channels_matrix_c(&remap, stereo_gen, mono, SAMPLES);
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
375 remap_mono_to_stereo_neon(&remap, stereo, mono, SAMPLES);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
376
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
377 for (i = 0; i < 2*SAMPLES; i++) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
378 if (fabsf(stereo[i] - stereo_ref[i]) > 0.00001) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
379 pa_log_debug("%d: %.3f != %.3f (%.3f)", i, stereo[i], stereo_ref[i],
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
380 mono[i/2]);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
381 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
382 }
|
1
|
383 for (i = 0; i < 2*SAMPLES; i++) {
|
|
384 if (fabsf(stereo[i] - stereo_gen[i]) > 0.00001) {
|
|
385 pa_log_debug("%d: %.3f != %.3f (%.3f)", i, stereo[i], stereo_gen[i],
|
|
386 mono[i/2]);
|
|
387 }
|
|
388 }
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
389
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
390 start = pa_rtclock_now();
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
391 for (i = 0; i < TIMES; i++) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
392 remap_mono_to_stereo_neon(&remap, stereo, mono, SAMPLES);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
393 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
394 stop = pa_rtclock_now();
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
395 pa_log_info("NEON: %llu usec.", (long long unsigned int)(stop - start));
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
396
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
397 start = pa_rtclock_now();
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
398 for (i = 0; i < TIMES; i++) {
|
1
|
399 remap_mono_to_stereo_c(&remap, stereo_ref, mono, SAMPLES);
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
400 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
401 stop = pa_rtclock_now();
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
402 pa_log_info("ref: %llu usec.", (long long unsigned int)(stop - start));
|
1
|
403
|
|
404 start = pa_rtclock_now();
|
|
405 for (i = 0; i < TIMES; i++) {
|
|
406 remap_channels_matrix_c(&remap, stereo_gen, mono, SAMPLES);
|
|
407 }
|
|
408 stop = pa_rtclock_now();
|
|
409 pa_log_info("generic: %llu usec.", (long long unsigned int)(stop - start));
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
410 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
411
|
1
|
412 static void run_test_stereo_to_mono_float(void) {
|
|
413 float stereo[2*SAMPLES];
|
|
414 float mono_ref[SAMPLES];
|
|
415 float mono_gen[SAMPLES];
|
|
416 float mono[SAMPLES];
|
|
417 int i;
|
|
418 pa_usec_t start, stop;
|
|
419 pa_sample_format_t sf;
|
|
420 pa_sample_spec iss, oss;
|
|
421 pa_remap_t remap;
|
|
422
|
|
423 pa_log_debug("checking NEON remap_stereo_to_mono(float, %d)", SAMPLES);
|
|
424
|
|
425 memset(mono_ref, 0, sizeof(mono_ref));
|
|
426 memset(mono, 0, sizeof(mono));
|
|
427
|
|
428 for (i = 0; i < 2*SAMPLES; i++) {
|
|
429 stereo[i] = rand()/(float) RAND_MAX - 0.5f;
|
|
430 }
|
|
431
|
|
432 sf = PA_SAMPLE_FLOAT32NE;
|
|
433 remap.format = &sf;
|
|
434 iss.format = PA_SAMPLE_FLOAT32NE;
|
|
435 iss.channels = 2;
|
|
436 oss.format = PA_SAMPLE_FLOAT32NE;
|
|
437 oss.channels = 1;
|
|
438 remap.i_ss = &iss;
|
|
439 remap.o_ss = &oss;
|
|
440 remap.map_table_f[0][0] = 1.0;
|
|
441 remap.map_table_f[0][1] = 1.0;
|
|
442
|
|
443 remap_stereo_to_mono_c(&remap, mono_ref, stereo, SAMPLES);
|
|
444 remap_channels_matrix_c(&remap, mono_gen, stereo, SAMPLES);
|
|
445 remap_stereo_to_mono_neon(&remap, mono, stereo, SAMPLES);
|
|
446
|
|
447 for (i = 0; i < SAMPLES; i++) {
|
|
448 if (fabsf(mono[i] - mono_ref[i]) > 0.00001) {
|
|
449 pa_log_debug("%d: %.3f != %.3f (%.3f %0.3f)", i, mono[i], mono_ref[i],
|
|
450 stereo[2*i+0], stereo[2*i+1]);
|
|
451 }
|
|
452 }
|
|
453
|
|
454 start = pa_rtclock_now();
|
|
455 for (i = 0; i < TIMES; i++) {
|
|
456 remap_stereo_to_mono_neon(&remap, mono, stereo, SAMPLES);
|
|
457 }
|
|
458 stop = pa_rtclock_now();
|
|
459 pa_log_info("NEON: %llu usec.", (long long unsigned int)(stop - start));
|
|
460
|
|
461 start = pa_rtclock_now();
|
|
462 for (i = 0; i < TIMES; i++) {
|
|
463 remap_stereo_to_mono_c(&remap, mono_ref, stereo, SAMPLES);
|
|
464 }
|
|
465 stop = pa_rtclock_now();
|
|
466 pa_log_info("ref: %llu usec.", (long long unsigned int)(stop - start));
|
|
467
|
|
468 start = pa_rtclock_now();
|
|
469 for (i = 0; i < TIMES; i++) {
|
|
470 remap_channels_matrix_c(&remap, mono_gen, stereo, SAMPLES);
|
|
471 }
|
|
472 stop = pa_rtclock_now();
|
|
473 pa_log_info("generic: %llu usec.", (long long unsigned int)(stop - start));
|
|
474 }
|
|
475
|
|
476 static void run_test_mono_to_stereo_s16(void) {
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
477 int16_t stereo[2*SAMPLES];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
478 int16_t stereo_ref[2*SAMPLES];
|
1
|
479 int16_t stereo_gen[2*SAMPLES];
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
480 int16_t mono[SAMPLES];
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
481 int i;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
482 pa_usec_t start, stop;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
483 pa_sample_format_t sf;
|
1
|
484 pa_sample_spec iss, oss;
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
485 pa_remap_t remap;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
486
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
487 pa_log_debug("checking NEON remap_mono_to_stereo(s16, %d)", SAMPLES);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
488
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
489 memset(stereo_ref, 0, sizeof(stereo_ref));
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
490 memset(stereo, 0, sizeof(stereo));
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
491
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
492 for (i = 0; i < SAMPLES; i++) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
493 mono[i] = rand() - RAND_MAX/2;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
494 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
495
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
496 sf = PA_SAMPLE_S16NE;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
497 remap.format = &sf;
|
1
|
498 iss.format = PA_SAMPLE_S16NE;
|
|
499 iss.channels = 1;
|
|
500 oss.format = PA_SAMPLE_S16NE;
|
|
501 oss.channels = 2;
|
|
502 remap.i_ss = &iss;
|
|
503 remap.o_ss = &oss;
|
|
504 remap.map_table_f[0][0] = 1.0;
|
|
505 remap.map_table_f[1][0] = 1.0;
|
|
506
|
|
507 remap_mono_to_stereo_c(&remap, stereo_ref, mono, SAMPLES);
|
|
508 remap_channels_matrix_c(&remap, stereo_gen, mono, SAMPLES);
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
509 remap_mono_to_stereo_neon(&remap, stereo, mono, SAMPLES);
|
1
|
510
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
511 for (i = 0; i < 2*SAMPLES; i++) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
512 if (abs(stereo[i] - stereo_ref[i]) > 0) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
513 pa_log_debug("%d: %d != %d (%d)", i, stereo[i], stereo_ref[i],
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
514 mono[i/2]);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
515 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
516 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
517
|
1
|
518 for (i = 0; i < 2*SAMPLES; i++) {
|
|
519 if (abs(stereo[i] - stereo_gen[i]) > 0) {
|
|
520 pa_log_debug("%d: %d != %d (%d)", i, stereo[i], stereo_gen[i],
|
|
521 mono[i/2]);
|
|
522 }
|
|
523 }
|
|
524
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
525 start = pa_rtclock_now();
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
526 for (i = 0; i < TIMES; i++) {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
527 remap_mono_to_stereo_neon(&remap, stereo, mono, SAMPLES);
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
528 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
529 stop = pa_rtclock_now();
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
530 pa_log_info("NEON: %llu usec.", (long long unsigned int)(stop - start));
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
531
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
532 start = pa_rtclock_now();
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
533 for (i = 0; i < TIMES; i++) {
|
1
|
534 remap_mono_to_stereo_c(&remap, stereo_ref, mono, SAMPLES);
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
535 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
536 stop = pa_rtclock_now();
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
537 pa_log_info("ref: %llu usec.", (long long unsigned int)(stop - start));
|
1
|
538
|
|
539 start = pa_rtclock_now();
|
|
540 for (i = 0; i < TIMES; i++) {
|
|
541 remap_channels_matrix_c(&remap, stereo_gen, mono, SAMPLES);
|
|
542 }
|
|
543 stop = pa_rtclock_now();
|
|
544 pa_log_info("generic: %llu usec.", (long long unsigned int)(stop - start));
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
545 }
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
546
|
1
|
547 static void run_test_stereo_to_mono_s16(void) {
|
|
548 int16_t stereo[2*SAMPLES];
|
|
549 int16_t mono_ref[SAMPLES];
|
|
550 int16_t mono_gen[SAMPLES];
|
|
551 int16_t mono[SAMPLES];
|
|
552 int i;
|
|
553 pa_usec_t start, stop;
|
|
554 pa_sample_format_t sf;
|
|
555 pa_sample_spec iss, oss;
|
|
556 pa_remap_t remap;
|
|
557
|
|
558 pa_log_debug("checking NEON remap_stereo_to_mono(s16, %d)", SAMPLES);
|
|
559
|
|
560 memset(mono_ref, 0, sizeof(mono_ref));
|
|
561 memset(mono, 0, sizeof(mono));
|
|
562
|
|
563 for (i = 0; i < 2*SAMPLES; i++) {
|
|
564 stereo[i] = rand() - RAND_MAX/2;
|
|
565 }
|
|
566
|
|
567 sf = PA_SAMPLE_S16NE;
|
|
568 remap.format = &sf;
|
|
569 iss.format = PA_SAMPLE_S16NE;
|
|
570 iss.channels = 2;
|
|
571 oss.format = PA_SAMPLE_S16NE;
|
|
572 oss.channels = 1;
|
|
573 remap.i_ss = &iss;
|
|
574 remap.o_ss = &oss;
|
|
575 remap.map_table_f[0][0] = 1.0;
|
|
576 remap.map_table_f[0][1] = 1.0;
|
|
577
|
|
578 remap_stereo_to_mono_c(&remap, mono_ref, stereo, SAMPLES);
|
|
579 remap_channels_matrix_c(&remap, mono_gen, stereo, SAMPLES);
|
|
580 remap_stereo_to_mono_neon(&remap, mono, stereo, SAMPLES);
|
|
581
|
|
582 for (i = 0; i < SAMPLES; i++) {
|
|
583 if (abs(mono[i] - mono_ref[i]) > 0) {
|
|
584 pa_log_debug("%d: %d != %d (%d)", i, mono[i], mono_ref[i],
|
|
585 stereo[2*i+0], stereo[2*i+1]);
|
|
586 }
|
|
587 }
|
|
588 for (i = 0; i < SAMPLES; i++) {
|
|
589 if (abs(mono[i] - mono_gen[i]) > 0) {
|
|
590 pa_log_debug("%d: %d != %d (%d)", i, mono[i], mono_gen[i],
|
|
591 stereo[2*i+0], stereo[2*i+1]);
|
|
592 }
|
|
593 }
|
|
594
|
|
595 start = pa_rtclock_now();
|
|
596 for (i = 0; i < TIMES; i++) {
|
|
597 remap_stereo_to_mono_neon(&remap, mono, stereo, SAMPLES);
|
|
598 }
|
|
599 stop = pa_rtclock_now();
|
|
600 pa_log_info("NEON: %llu usec.", (long long unsigned int)(stop - start));
|
|
601
|
|
602 start = pa_rtclock_now();
|
|
603 for (i = 0; i < TIMES; i++) {
|
|
604 remap_stereo_to_mono_c(&remap, mono_ref, stereo, SAMPLES);
|
|
605 }
|
|
606 stop = pa_rtclock_now();
|
|
607 pa_log_info("ref: %llu usec.", (long long unsigned int)(stop - start));
|
|
608
|
|
609 start = pa_rtclock_now();
|
|
610 for (i = 0; i < TIMES; i++) {
|
|
611 remap_channels_matrix_c(&remap, mono_gen, stereo, SAMPLES);
|
|
612 }
|
|
613 stop = pa_rtclock_now();
|
|
614 pa_log_info("generic: %llu usec.", (long long unsigned int)(stop - start));
|
|
615 }
|
|
616
|
|
617
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
618 #endif /* defined(__arm__) */
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
619
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
620 int main() {
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
621
|
1
|
622 run_test_stereo_to_mono_float();
|
|
623 run_test_stereo_to_mono_s16();
|
|
624
|
|
625 run_test_mono_to_stereo_float();
|
|
626 run_test_mono_to_stereo_s16();
|
|
627
|
0
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
628
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
629 return EXIT_SUCCESS;
|
Peter Meerwald <p.meerwald@bct-electronic.com>
parents:
diff
changeset
|
630 }
|