mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
filter-chain: handle unaligned sum_simd
Fall back to slow path if the input is not aligned, which can happen after resampling. Fixes #1659
This commit is contained in:
parent
d2f0573369
commit
275dfed92a
1 changed files with 12 additions and 8 deletions
|
|
@ -2128,15 +2128,19 @@ static void zconvolve_simd(PFFFT_Setup * s, const float *a, const float *b,
|
||||||
|
|
||||||
static void sum_simd(const float *a, const float *b, float *ab, int len)
|
static void sum_simd(const float *a, const float *b, float *ab, int len)
|
||||||
{
|
{
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
if (VALIGNED(a) && VALIGNED(b) && VALIGNED(ab)) {
|
||||||
const v4sf *RESTRICT va = (const v4sf *)a;
|
const v4sf *RESTRICT va = (const v4sf *)a;
|
||||||
const v4sf *RESTRICT vb = (const v4sf *)b;
|
const v4sf *RESTRICT vb = (const v4sf *)b;
|
||||||
v4sf *RESTRICT vab = (v4sf *) ab;
|
v4sf *RESTRICT vab = (v4sf *) ab;
|
||||||
int i;
|
|
||||||
const int end4 = len / SIMD_SZ;
|
const int end4 = len / SIMD_SZ;
|
||||||
|
|
||||||
for (i = 0; i < end4; i += 1)
|
for (; i < end4; i += 1)
|
||||||
vab[i] = VADD(va[i],vb[i]);
|
vab[i] = VADD(va[i],vb[i]);
|
||||||
for (i = i * 4; i < len; ++i)
|
i *= 4;
|
||||||
|
}
|
||||||
|
for (; i < len; ++i)
|
||||||
ab[i] = a[i] + b[i];
|
ab[i] = a[i] + b[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue