aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/distortion.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-11 15:08:12 -0800
committerChris Robinson <[email protected]>2023-12-11 15:08:12 -0800
commitec40e4fefef954544c25285bfeae4a44c1134a44 (patch)
tree72b55e01fd50bed966db533713f998cf06815172 /alc/effects/distortion.cpp
parenta28bf538afabca45298a43e5d2acf3e6149a2c2c (diff)
Finish cleanup for effects
Diffstat (limited to 'alc/effects/distortion.cpp')
-rw-r--r--alc/effects/distortion.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/alc/effects/distortion.cpp b/alc/effects/distortion.cpp
index 3d77ff35..9ef9de25 100644
--- a/alc/effects/distortion.cpp
+++ b/alc/effects/distortion.cpp
@@ -45,7 +45,7 @@ namespace {
struct DistortionState final : public EffectState {
/* Effect gains for each channel */
- float mGain[MaxAmbiChannels]{};
+ std::array<float,MaxAmbiChannels> mGain{};
/* Effect parameters */
BiquadFilter mLowpass;
@@ -53,7 +53,7 @@ struct DistortionState final : public EffectState {
float mAttenuation{};
float mEdgeCoeff{};
- alignas(16) float mBuffer[2][BufferLineSize]{};
+ alignas(16) std::array<FloatBufferLine,2> mBuffer{};
void deviceUpdate(const DeviceBase *device, const BufferStorage *buffer) override;
@@ -124,7 +124,7 @@ void DistortionState::process(const size_t samplesToDo, const al::span<const Flo
* (which is fortunately first step of distortion). So combine three
* operations into the one.
*/
- mLowpass.process({mBuffer[0], todo}, mBuffer[1]);
+ mLowpass.process({mBuffer[0].data(), todo}, mBuffer[1].data());
/* Second step, do distortion using waveshaper function to emulate
* signal processing during tube overdriving. Three steps of
@@ -138,15 +138,15 @@ void DistortionState::process(const size_t samplesToDo, const al::span<const Flo
smp = (1.0f + fc) * smp/(1.0f + fc*std::abs(smp));
return smp;
};
- std::transform(std::begin(mBuffer[1]), std::begin(mBuffer[1])+todo, std::begin(mBuffer[0]),
+ std::transform(mBuffer[1].begin(), mBuffer[1].begin()+todo, mBuffer[0].begin(),
proc_sample);
/* Third step, do bandpass filtering of distorted signal. */
- mBandpass.process({mBuffer[0], todo}, mBuffer[1]);
+ mBandpass.process({mBuffer[0].data(), todo}, mBuffer[1].data());
todo >>= 2;
- const float *outgains{mGain};
- for(FloatBufferLine &output : samplesOut)
+ const float *outgains{mGain.data()};
+ for(FloatBufferLine &RESTRICT output : samplesOut)
{
/* Fourth step, final, do attenuation and perform decimation,
* storing only one sample out of four.