diff options
author | Chris Robinson <[email protected]> | 2023-05-05 13:37:50 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-05-05 13:50:16 -0700 |
commit | bfe766cd574985465fe1a9f4cffa388ca9ca1f9b (patch) | |
tree | 7752588dfa87ae2616fd84437697f4458d4d5293 /utils | |
parent | 09b153b85c9f6c75a6361ab2ecb0ed81e8920ff3 (diff) |
Use some more standard functions
Diffstat (limited to 'utils')
-rw-r--r-- | utils/uhjencoder.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/utils/uhjencoder.cpp b/utils/uhjencoder.cpp index 34698993..c381d1b9 100644 --- a/utils/uhjencoder.cpp +++ b/utils/uhjencoder.cpp @@ -502,11 +502,9 @@ int main(int argc, char **argv) got -= LeadIn; for(size_t c{0};c < uhjchans;++c) { - constexpr float max_val{8388607.0f / 8388608.0f}; - auto clamp = [](float v, float mn, float mx) noexcept - { return std::min(std::max(v, mn), mx); }; + static constexpr float max_val{8388607.0f / 8388608.0f}; for(size_t i{0};i < got;++i) - outmem[i*uhjchans + c] = clamp(encmem[c][LeadIn+i], -1.0f, max_val); + outmem[i*uhjchans + c] = std::clamp(encmem[c][LeadIn+i], -1.0f, max_val); } LeadIn = 0; |