remove optimization for centered stereo samples

in favour of vectorized mixing loop. Was incredibly unlikely to happen anyway.
This commit is contained in:
derselbst 2018-04-26 16:47:06 +02:00
parent ba9da3b790
commit f332f32a7c

View file

@ -269,30 +269,16 @@ fluid_rvoice_buffers_mix(fluid_rvoice_buffers_t* buffers,
for (i=0; i < bufcount; i++) {
fluid_real_t* buf = get_dest_buf(buffers, i, dest_bufs, dest_bufcount);
fluid_real_t* next_buf;
fluid_real_t amp = buffers->bufs[i].amp;
if (buf == NULL || amp == 0.0f)
continue;
/* Optimization for centered stereo samples - we can save one
multiplication per sample */
next_buf = (i+1 >= bufcount ? NULL : get_dest_buf(buffers, i+1, dest_bufs, dest_bufcount));
if (next_buf && buffers->bufs[i+1].amp == amp) {
for (dsp_i = start; dsp_i < samplecount; dsp_i++) {
fluid_real_t samp = amp * dsp_buf[dsp_i];
buf[dsp_i] += samp;
next_buf[dsp_i] += samp;
}
i++;
}
else {
#pragma omp simd aligned(dsp_buf:FLUID_DEFAULT_ALIGNMENT)
#pragma vector aligned(dsp_buf)
for (dsp_i = start; dsp_i < samplecount; dsp_i++)
{
buf[dsp_i] += amp * dsp_buf[dsp_i];
}
}
}
}