mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-12 13:30:15 -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
|
|
@ -29,6 +29,9 @@
|
|||
#include <spa/utils/string.h>
|
||||
#include <spa/param/audio/raw.h>
|
||||
|
||||
#define DITHER_OPS_MAX_ALIGN 16
|
||||
#define DITHER_OPS_MAX_OVERREAD 16
|
||||
|
||||
struct dither {
|
||||
uint32_t intensity;
|
||||
#define DITHER_METHOD_NONE 0
|
||||
|
|
@ -45,7 +48,7 @@ struct dither {
|
|||
const void * SPA_RESTRICT src[], uint32_t n_samples);
|
||||
void (*free) (struct dither *d);
|
||||
|
||||
uint32_t random[16];
|
||||
uint32_t random[16 + DITHER_OPS_MAX_ALIGN/sizeof(uint32_t)];
|
||||
float *dither;
|
||||
uint32_t dither_size;
|
||||
float scale;
|
||||
|
|
@ -83,8 +86,6 @@ void dither_##name##_##arch(struct dither *d, \
|
|||
const void * SPA_RESTRICT src[], \
|
||||
uint32_t n_samples);
|
||||
|
||||
#define DITHER_OPS_MAX_ALIGN 16
|
||||
|
||||
DEFINE_FUNCTION(f32, c);
|
||||
#if defined(HAVE_SSE2)
|
||||
DEFINE_FUNCTION(f32, sse2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue