diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/jxl/noise.h | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/noise.h')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/noise.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/noise.h b/third_party/jpeg-xl/lib/jxl/noise.h index 585fab0d42..c588c59d33 100644 --- a/third_party/jpeg-xl/lib/jxl/noise.h +++ b/third_party/jpeg-xl/lib/jxl/noise.h @@ -11,6 +11,7 @@ #include <stddef.h> #include <algorithm> +#include <array> #include <cmath> #include <utility> @@ -23,7 +24,9 @@ const float kNoisePrecision = 1 << 10; struct NoiseParams { // LUT index is an intensity of pixel / mean intensity of patch static constexpr size_t kNumNoisePoints = 8; - float lut[kNumNoisePoints]; + using Lut = std::array<float, kNumNoisePoints>; + + Lut lut; void Clear() { for (float& i : lut) i = 0.f; @@ -39,7 +42,7 @@ struct NoiseParams { static inline std::pair<int, float> IndexAndFrac(float x) { constexpr size_t kScaleNumerator = NoiseParams::kNumNoisePoints - 2; // TODO(user): instead of 1, this should be a proper Y range. - constexpr float kScale = kScaleNumerator / 1; + constexpr float kScale = kScaleNumerator / 1.0f; float scaled_x = std::max(0.f, x * kScale); float floor_x; float frac_x = std::modf(scaled_x, &floor_x); |