mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
audioconvert: fix unaligned writes
Avoid some optimizations that cause unaligned writes. See #3572
This commit is contained in:
parent
bdd577c360
commit
b2c24f3435
1 changed files with 8 additions and 4 deletions
|
|
@ -889,10 +889,14 @@ conv_f32d_to_s16_avx2(struct convert *conv, void * SPA_RESTRICT dst[], const voi
|
|||
int16_t *d = dst[0];
|
||||
uint32_t i = 0, n_channels = conv->n_channels;
|
||||
|
||||
for(; i + 3 < n_channels; i += 4)
|
||||
conv_f32d_to_s16_4s_avx2(conv, &d[i], &src[i], n_channels, n_samples);
|
||||
for(; i + 1 < n_channels; i += 2)
|
||||
conv_f32d_to_s16_2s_avx2(conv, &d[i], &src[i], n_channels, n_samples);
|
||||
if ((n_channels & 0x3) == 0) {
|
||||
for(; i + 3 < n_channels; i += 4)
|
||||
conv_f32d_to_s16_4s_avx2(conv, &d[i], &src[i], n_channels, n_samples);
|
||||
}
|
||||
if ((n_channels & 0x1) == 0) {
|
||||
for(; i + 1 < n_channels; i += 2)
|
||||
conv_f32d_to_s16_2s_avx2(conv, &d[i], &src[i], n_channels, n_samples);
|
||||
}
|
||||
for(; i < n_channels; i++)
|
||||
conv_f32d_to_s16_1s_avx2(conv, &d[i], &src[i], n_channels, n_samples);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue