diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /third_party/jpeg-xl/lib/jxl/splines.cc | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/splines.cc')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/splines.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/splines.cc b/third_party/jpeg-xl/lib/jxl/splines.cc index 1d4fc69e3e..2df2160d76 100644 --- a/third_party/jpeg-xl/lib/jxl/splines.cc +++ b/third_party/jpeg-xl/lib/jxl/splines.cc @@ -94,11 +94,11 @@ void DrawSegment(DF df, const SplineSegment& segment, const bool add, void DrawSegment(const SplineSegment& segment, const bool add, const size_t y, const ssize_t x0, ssize_t x1, float* JXL_RESTRICT rows[3]) { - ssize_t x = - std::max<ssize_t>(x0, segment.center_x - segment.maximum_distance + 0.5f); + ssize_t x = std::max<ssize_t>( + x0, std::llround(segment.center_x - segment.maximum_distance)); // one-past-the-end - x1 = - std::min<ssize_t>(x1, segment.center_x + segment.maximum_distance + 1.5f); + x1 = std::min<ssize_t>( + x1, std::llround(segment.center_x + segment.maximum_distance) + 1); HWY_FULL(float) df; for (; x + static_cast<ssize_t>(Lanes(df)) <= x1; x += Lanes(df)) { DrawSegment(df, segment, add, y, x, rows); @@ -550,8 +550,8 @@ Status QuantizedSpline::Decode(const std::vector<uint8_t>& context_map, } return true; }; - for (int c = 0; c < 3; ++c) { - JXL_RETURN_IF_ERROR(decode_dct(color_dct_[c])); + for (auto& dct : color_dct_) { + JXL_RETURN_IF_ERROR(decode_dct(dct)); } JXL_RETURN_IF_ERROR(decode_dct(sigma_dct_)); return true; |