aboutsummaryrefslogtreecommitdiffstats
path: root/alc/bformatdec.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-01-14 13:10:01 -0800
committerChris Robinson <[email protected]>2020-01-14 13:10:01 -0800
commit030d428aec2389f65336eef28076c55914e34d00 (patch)
tree29a27086ace7a5a2b66a7144159954f6a820b731 /alc/bformatdec.cpp
parent75a58ae333d3b606ec24f9d09b47430a880bae07 (diff)
Clean up some formating
Diffstat (limited to 'alc/bformatdec.cpp')
-rw-r--r--alc/bformatdec.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/alc/bformatdec.cpp b/alc/bformatdec.cpp
index d8f59ddc..0272139d 100644
--- a/alc/bformatdec.cpp
+++ b/alc/bformatdec.cpp
@@ -21,24 +21,25 @@
namespace {
-constexpr ALfloat Ambi3DDecoderHFScale[MAX_AMBI_ORDER+1] = {
+constexpr std::array<float,MAX_AMBI_ORDER+1> Ambi3DDecoderHFScale{{
1.00000000e+00f, 1.00000000e+00f
-};
-constexpr ALfloat Ambi3DDecoderHFScale2O[MAX_AMBI_ORDER+1] = {
- 7.45355990e-01f, 1.00000000e+00f
-};
-constexpr ALfloat Ambi3DDecoderHFScale3O[MAX_AMBI_ORDER+1] = {
- 5.89792205e-01f, 8.79693856e-01f
-};
-
-inline auto GetDecoderHFScales(ALuint order) noexcept -> const ALfloat(&)[MAX_AMBI_ORDER+1]
+}};
+constexpr std::array<float,MAX_AMBI_ORDER+1> Ambi3DDecoderHFScale2O{{
+ 7.45355990e-01f, 1.00000000e+00f, 1.00000000e+00f
+}};
+constexpr std::array<float,MAX_AMBI_ORDER+1> Ambi3DDecoderHFScale3O{{
+ 5.89792205e-01f, 8.79693856e-01f, 1.00000000e+00f, 1.00000000e+00f
+}};
+
+inline auto GetDecoderHFScales(ALuint order) noexcept -> const std::array<float,MAX_AMBI_ORDER+1>&
{
if(order >= 3) return Ambi3DDecoderHFScale3O;
if(order == 2) return Ambi3DDecoderHFScale2O;
return Ambi3DDecoderHFScale;
}
-inline auto GetAmbiScales(AmbDecScale scaletype) noexcept -> const std::array<float,MAX_AMBI_CHANNELS>&
+inline auto GetAmbiScales(AmbDecScale scaletype) noexcept
+ -> const std::array<float,MAX_AMBI_CHANNELS>&
{
if(scaletype == AmbDecScale::FuMa) return AmbiScale::FromFuMa;
if(scaletype == AmbDecScale::SN3D) return AmbiScale::FromSN3D;
@@ -175,16 +176,17 @@ void BFormatDec::process(const al::span<FloatBufferLine> OutBuffer,
}
-std::array<ALfloat,MAX_AMBI_ORDER+1> BFormatDec::GetHFOrderScales(const ALuint in_order, const ALuint out_order) noexcept
+auto BFormatDec::GetHFOrderScales(const ALuint in_order, const ALuint out_order) noexcept
+ -> std::array<float,MAX_AMBI_ORDER+1>
{
- std::array<ALfloat,MAX_AMBI_ORDER+1> ret{};
+ std::array<float,MAX_AMBI_ORDER+1> ret{};
assert(out_order >= in_order);
- const ALfloat (&target)[MAX_AMBI_ORDER+1] = GetDecoderHFScales(out_order);
- const ALfloat (&input)[MAX_AMBI_ORDER+1] = GetDecoderHFScales(in_order);
+ const auto &target = GetDecoderHFScales(out_order);
+ const auto &input = GetDecoderHFScales(in_order);
- for(ALuint i{0};i < in_order+1;++i)
+ for(size_t i{0};i < in_order+1;++i)
ret[i] = input[i] / target[i];
return ret;