aboutsummaryrefslogtreecommitdiffstats
path: root/core/mastering.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-10 22:15:17 -0800
committerChris Robinson <[email protected]>2023-12-10 22:15:17 -0800
commitbb3387b0fc5d3071a30c6d003b415dc6e77f3d62 (patch)
tree1645291391b412040ce55ae8dc34232cde5d22e0 /core/mastering.cpp
parentcf37d92442ccf3c7f4b979bd97282dcbe28ca64a (diff)
Much more clang-tidy cleanup
Diffstat (limited to 'core/mastering.cpp')
-rw-r--r--core/mastering.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/mastering.cpp b/core/mastering.cpp
index 1f8ad921..e9b079d6 100644
--- a/core/mastering.cpp
+++ b/core/mastering.cpp
@@ -21,8 +21,8 @@
static_assert((BufferLineSize & (BufferLineSize-1)) == 0, "BufferLineSize is not a power of 2");
struct SlidingHold {
- alignas(16) float mValues[BufferLineSize];
- uint mExpiries[BufferLineSize];
+ alignas(16) FloatBufferLine mValues;
+ std::array<uint,BufferLineSize> mExpiries;
uint mLowerIndex;
uint mUpperIndex;
uint mLength;
@@ -44,8 +44,8 @@ float UpdateSlidingHold(SlidingHold *Hold, const uint i, const float in)
{
static constexpr uint mask{BufferLineSize - 1};
const uint length{Hold->mLength};
- float (&values)[BufferLineSize] = Hold->mValues;
- uint (&expiries)[BufferLineSize] = Hold->mExpiries;
+ const al::span values{Hold->mValues};
+ const al::span expiries{Hold->mExpiries};
uint lowerIndex{Hold->mLowerIndex};
uint upperIndex{Hold->mUpperIndex};
@@ -110,7 +110,8 @@ void LinkChannels(Compressor *Comp, const uint SamplesToDo, const FloatBufferLin
auto fill_max = [SamplesToDo,side_begin](const FloatBufferLine &input) -> void
{
const float *RESTRICT buffer{al::assume_aligned<16>(input.data())};
- auto max_abs = std::bind(maxf, _1, std::bind(static_cast<float(&)(float)>(std::fabs), _2));
+ auto max_abs = [](const float s0, const float s1) noexcept -> float
+ { return std::max(s0, std::fabs(s1)); };
std::transform(side_begin, side_begin+SamplesToDo, buffer, side_begin, max_abs);
};
std::for_each(OutBuffer, OutBuffer+numChans, fill_max);