delay: improve delay performance

Use a wrap around delay ringbuffer. We can then avoid some modulo
arithmetic and read more efficiently.

Also handle the delay convolver case better by reversing the taps and
reading the taps and delay buffer without extra overhead.
This commit is contained in:
Wim Taymans 2024-10-15 12:14:57 +02:00
parent 668055e612
commit a57f2f25b6
4 changed files with 31 additions and 14 deletions

View file

@ -60,7 +60,7 @@ struct channelmix {
uint32_t hilbert_taps; /* to phase shift, 0 disabled */
struct lr4 lr4[SPA_AUDIO_MAX_CHANNELS];
float buffer[2][BUFFER_SIZE];
float buffer[2][BUFFER_SIZE*2];
uint32_t pos[2];
uint32_t delay;
float taps[MAX_TAPS];