Unverified Commit fc1499d8 authored by Karl Linden's avatar Karl Linden
Browse files

Merge branch 'master' into waf-macosx-fixes

parents c4f01e51 cf8ccd2e
......@@ -28,6 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <Accelerate/Accelerate.h>
#elif defined (__SSE__) && !defined (__sun__)
#include <xmmintrin.h>
#elif defined (__ARM_NEON__)
#include <arm_neon.h>
#endif
namespace Jack
......@@ -51,6 +53,13 @@ static inline void MixAudioBuffer(jack_default_audio_sample_t* mixbuffer, jack_d
__m128 vec = _mm_add_ps(_mm_load_ps(mixbuffer), _mm_load_ps(buffer));
_mm_store_ps(mixbuffer, vec);
mixbuffer += 4;
buffer += 4;
frames_group--;
#elif defined (__ARM_NEON__)
float32x4_t vec = vaddq_f32(vld1q_f32(mixbuffer), vld1q_f32(buffer));
vst1q_f32(mixbuffer, vec);
mixbuffer += 4;
buffer += 4;
frames_group--;
......@@ -116,7 +125,24 @@ static void AudioBufferMixdown(void* mixbuffer, void** src_buffers, int src_coun
for (jack_nframes_t i = 0; i != remaining_frames; ++i) {
target[i] = source[i];
}
#elif defined (__ARM_NEON__)
jack_nframes_t frames_group = nframes / 4;
jack_nframes_t remaining_frames = nframes % 4;
jack_default_audio_sample_t* source = static_cast<jack_default_audio_sample_t*>(src_buffers[0]);
jack_default_audio_sample_t* target = static_cast<jack_default_audio_sample_t*>(mixbuffer);
while (frames_group > 0) {
float32x4_t vec = vld1q_f32(source);
vst1q_f32(target, vec);
source += 4;
target += 4;
--frames_group;
}
for (jack_nframes_t i = 0; i != remaining_frames; ++i) {
target[i] = source[i];
}
#else
memcpy(mixbuffer, src_buffers[0], nframes * sizeof(jack_default_audio_sample_t));
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment