aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/hrtf.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-08-09 14:57:01 -0700
committerChris Robinson <[email protected]>2017-08-09 14:57:01 -0700
commit649bf575e2898200f35aa776bb729460583c9bdb (patch)
treee1941c4df5755cd4573ef16d613b936b86e970a1 /Alc/hrtf.c
parentad3c4b81e2e6547fba7e66615a7ffd2fb69eb3bc (diff)
Declare that a couple arrays are aligned
Diffstat (limited to 'Alc/hrtf.c')
-rw-r--r--Alc/hrtf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index 14e350c0..fb498356 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -96,7 +96,8 @@ static ALsizei CalcAzIndex(ALsizei azcount, ALfloat az, ALfloat *mu)
/* Calculates static HRIR coefficients and delays for the given polar elevation
* and azimuth in radians. The coefficients are normalized.
*/
-void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread, ALfloat (*coeffs)[2], ALsizei *delays)
+void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread,
+ ALfloat (*restrict coeffs)[2], ALsizei *delays)
{
ALsizei evidx, azidx, idx[4];
ALsizei evoffset;
@@ -164,6 +165,7 @@ void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth,
idx[2] *= Hrtf->irSize;
idx[3] *= Hrtf->irSize;
+ coeffs = ASSUME_ALIGNED(coeffs, 16);
/* Calculate the blended HRIR coefficients. */
coeffs[0][0] = PassthruCoeff * (1.0f-dirfact);
coeffs[0][1] = PassthruCoeff * (1.0f-dirfact);
@@ -174,10 +176,11 @@ void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth,
}
for(c = 0;c < 4;c++)
{
+ const ALfloat (*restrict srccoeffs)[2] = ASSUME_ALIGNED(Hrtf->coeffs+idx[c], 16);
for(i = 0;i < Hrtf->irSize;i++)
{
- coeffs[i][0] += Hrtf->coeffs[idx[c]+i][0] * blend[c];
- coeffs[i][1] += Hrtf->coeffs[idx[c]+i][1] * blend[c];
+ coeffs[i][0] += srccoeffs[i][0] * blend[c];
+ coeffs[i][1] += srccoeffs[i][1] * blend[c];
}
}
}