diff options
author | Chris Robinson <[email protected]> | 2018-12-23 20:56:27 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-23 20:56:27 -0800 |
commit | ef101523610a26639228fd88bfd303cb31dbd025 (patch) | |
tree | 497a725bc0b63827f9f9a1d7f6d5e9b5955b9ba1 | |
parent | 1f966c11ef5728b446203212b62191ab440a1ee3 (diff) |
Assume alignment for some buffers
-rw-r--r-- | Alc/alu.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp index 45c47008..b95f0d7c 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -1530,8 +1530,8 @@ void ApplyStablizer(FrontStablizer *Stablizer, ALfloat (*RESTRICT Buffer)[BUFFER Stablizer->APFilter[i].process(Buffer[i], SamplesToDo); } - ALfloat (*RESTRICT lsplit)[BUFFERSIZE]{Stablizer->LSplit}; - ALfloat (*RESTRICT rsplit)[BUFFERSIZE]{Stablizer->RSplit}; + ALfloat (&lsplit)[2][BUFFERSIZE] = Stablizer->LSplit; + ALfloat (&rsplit)[2][BUFFERSIZE] = Stablizer->RSplit; Stablizer->LFilter.process(lsplit[1], lsplit[0], Buffer[lidx], SamplesToDo); Stablizer->RFilter.process(rsplit[1], rsplit[0], Buffer[ridx], SamplesToDo); @@ -1560,17 +1560,17 @@ void ApplyStablizer(FrontStablizer *Stablizer, ALfloat (*RESTRICT Buffer)[BUFFER } void ApplyDistanceComp(ALfloat (*RESTRICT Samples)[BUFFERSIZE], const DistanceComp &distcomp, - ALfloat *RESTRICT Values, ALsizei SamplesToDo, ALsizei numchans) + ALfloat *RESTRICT Values, const ALsizei SamplesToDo, const ALsizei numchans) { ASSUME(SamplesToDo > 0); ASSUME(numchans > 0); for(ALsizei c{0};c < numchans;c++) { - ALfloat *RESTRICT inout{Samples[c]}; + ALfloat *RESTRICT inout{al::assume_aligned<16>(Samples[c])}; const ALfloat gain{distcomp[c].Gain}; const ALsizei base{distcomp[c].Length}; - ALfloat *RESTRICT distbuf{distcomp[c].Buffer}; + ALfloat *RESTRICT distbuf{al::assume_aligned<16>(distcomp[c].Buffer)}; if(base <= 0) { @@ -1600,8 +1600,8 @@ void ApplyDistanceComp(ALfloat (*RESTRICT Samples)[BUFFERSIZE], const DistanceCo } } -void ApplyDither(ALfloat (*RESTRICT Samples)[BUFFERSIZE], ALuint *dither_seed, - const ALfloat quant_scale, const ALsizei SamplesToDo, const ALsizei numchans) +void ApplyDither(ALfloat (*Samples)[BUFFERSIZE], ALuint *dither_seed, const ALfloat quant_scale, + const ALsizei SamplesToDo, const ALsizei numchans) { ASSUME(numchans > 0); @@ -1611,9 +1611,10 @@ void ApplyDither(ALfloat (*RESTRICT Samples)[BUFFERSIZE], ALuint *dither_seed, */ const ALfloat invscale{1.0f / quant_scale}; ALuint seed{*dither_seed}; - auto dither_channel = [&seed,invscale,quant_scale,SamplesToDo](ALfloat *buffer) -> void + auto dither_channel = [&seed,invscale,quant_scale,SamplesToDo](ALfloat *input) -> void { ASSUME(SamplesToDo > 0); + ALfloat *buffer{al::assume_aligned<16>(input)}; std::transform(buffer, buffer+SamplesToDo, buffer, [&seed,invscale,quant_scale](ALfloat sample) noexcept -> ALfloat { |