mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-29 11:08:40 -05:00
audioconvert: ensure alignment
Allocate a little bit more data to ensure alignment and overread of the dither data. Ensure sse2 can load aligned data in all cases.
This commit is contained in:
parent
b41d52cfd1
commit
00998ffd7e
4 changed files with 19 additions and 18 deletions
|
|
@ -85,14 +85,14 @@ int dither_init(struct dither *d)
|
|||
d->scale = 1.0f / (1ULL << (31 + d->intensity));
|
||||
|
||||
d->dither_size = DITHER_SIZE;
|
||||
d->dither = calloc(d->dither_size + 8, sizeof(float));
|
||||
d->dither = calloc(d->dither_size + DITHER_OPS_MAX_OVERREAD +
|
||||
DITHER_OPS_MAX_ALIGN / sizeof(float), sizeof(float));
|
||||
if (d->dither == NULL)
|
||||
return -errno;
|
||||
|
||||
for (i = 0; i < SPA_N_ELEMENTS(d->random); i++)
|
||||
d->random[i] = random();
|
||||
|
||||
|
||||
d->free = impl_dither_free;
|
||||
d->process = info->process;
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue