aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/convolution.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-01-21 02:05:55 -0800
committerChris Robinson <[email protected]>2021-01-21 04:03:30 -0800
commit20f5e7c1fafcd40cdee2f7226ae81480ae049d1a (patch)
tree3b7e1aef92cefcbea1b9fca7f472d4831c0322cb /alc/effects/convolution.cpp
parent92c653e5f0617befccf0bd44d035f821ec7cb1ba (diff)
Avoid global constexpr arrays
Diffstat (limited to 'alc/effects/convolution.cpp')
-rw-r--r--alc/effects/convolution.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp
index 4e10b62a..2dec0dc6 100644
--- a/alc/effects/convolution.cpp
+++ b/alc/effects/convolution.cpp
@@ -76,23 +76,23 @@ void LoadSamples(double *RESTRICT dst, const al::byte *src, const size_t srcstep
}
-auto GetAmbiScales(AmbiScaling scaletype) noexcept -> const std::array<float,MaxAmbiChannels>&
+inline auto& GetAmbiScales(AmbiScaling scaletype) noexcept
{
- if(scaletype == AmbiScaling::FuMa) return AmbiScale::FromFuMa;
- if(scaletype == AmbiScaling::SN3D) return AmbiScale::FromSN3D;
- return AmbiScale::FromN3D;
+ if(scaletype == AmbiScaling::FuMa) return AmbiScale::FromFuMa();
+ if(scaletype == AmbiScaling::SN3D) return AmbiScale::FromSN3D();
+ return AmbiScale::FromN3D();
}
-auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbiChannels>&
+inline auto& GetAmbiLayout(AmbiLayout layouttype) noexcept
{
- if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa;
- return AmbiIndex::FromACN;
+ if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa();
+ return AmbiIndex::FromACN();
}
-auto GetAmbi2DLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbi2DChannels>&
+inline auto& GetAmbi2DLayout(AmbiLayout layouttype) noexcept
{
- if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa2D;
- return AmbiIndex::FromACN2D;
+ if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa2D();
+ return AmbiIndex::FromACN2D();
}
@@ -387,7 +387,7 @@ void ConvolutionState::update(const ALCcontext *context, const EffectSlot *slot,
}
mOutTarget = target.Main->Buffer;
- const auto &scales = GetAmbiScales(mAmbiScaling);
+ auto&& scales = GetAmbiScales(mAmbiScaling);
const uint8_t *index_map{(mChannels == FmtBFormat2D) ?
GetAmbi2DLayout(mAmbiLayout).data() :
GetAmbiLayout(mAmbiLayout).data()};