mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-01-19 07:50:49 +00:00
remove optimization for centered stereo samples
in favour of vectorized mixing loop. Was incredibly unlikely to happen anyway.
This commit is contained in:
parent
ba9da3b790
commit
f332f32a7c
1 changed files with 0 additions and 14 deletions
|
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue