mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-27 03:23:54 +01:00
that has to be rewritten because iteration 2305843009213693952 invokes undefined behaviour?
This commit is contained in:
34
src/fm95.c
34
src/fm95.c
@@ -46,29 +46,25 @@
|
|||||||
|
|
||||||
static volatile sig_atomic_t to_run = 1;
|
static volatile sig_atomic_t to_run = 1;
|
||||||
|
|
||||||
#include <arm_neon.h>
|
|
||||||
|
|
||||||
void uninterleave(const float *input, float *left, float *right, size_t num_samples) {
|
void uninterleave(const float *input, float *left, float *right, size_t num_samples) {
|
||||||
|
if (num_samples % 2 != 0) return;
|
||||||
|
|
||||||
|
size_t num_frames = num_samples / 2;
|
||||||
|
size_t i = 0;
|
||||||
|
|
||||||
#if USE_NEON
|
#if USE_NEON
|
||||||
size_t num_frames = num_samples / 2;
|
for (; i + 4 <= num_frames; i += 4) {
|
||||||
size_t i = 0;
|
float32x4x2_t interleaved = vld2q_f32(input + i * 2 * 2);
|
||||||
|
vst1q_f32(left + i, interleaved.val[0]);
|
||||||
for (; i + 4 <= num_frames; i += 4) {
|
vst1q_f32(right + i, interleaved.val[1]);
|
||||||
float32x4x2_t interleaved = vld2q_f32(input + i * 2 * 2);
|
}
|
||||||
vst1q_f32(left + i, interleaved.val[0]);
|
|
||||||
vst1q_f32(right + i, interleaved.val[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < num_frames; i++) {
|
|
||||||
left[i] = input[i * 2];
|
|
||||||
right[i] = input[i * 2 + 1];
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
for (size_t i = 0; i < num_samples / 2; i++) {
|
|
||||||
left[i] = input[i * 2];
|
|
||||||
right[i] = input[i * 2 + 1];
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
for (; i < num_frames; i++) {
|
||||||
|
left[i] = input[i * 2];
|
||||||
|
right[i] = input[i * 2 + 1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stop(int signum) {
|
static void stop(int signum) {
|
||||||
|
|||||||
Reference in New Issue
Block a user