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/modular/encoding/context_predict.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/modular/encoding/context_predict.h')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/modular/encoding/context_predict.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/modular/encoding/context_predict.h b/third_party/jpeg-xl/lib/jxl/modular/encoding/context_predict.h index 4c3a33a52a..7bec5128fc 100644 --- a/third_party/jpeg-xl/lib/jxl/modular/encoding/context_predict.h +++ b/third_party/jpeg-xl/lib/jxl/modular/encoding/context_predict.h @@ -10,6 +10,7 @@ #include <vector> #include "lib/jxl/fields.h" +#include "lib/jxl/image_ops.h" #include "lib/jxl/modular/modular_image.h" #include "lib/jxl/modular/options.h" @@ -78,14 +79,14 @@ struct State { 294337, 289262, 284359, 279620, 275036, 270600, 266305, 262144}; constexpr static pixel_type_w AddBits(pixel_type_w x) { - return uint64_t(x) << kPredExtraBits; + return static_cast<uint64_t>(x) << kPredExtraBits; } State(Header header, size_t xsize, size_t ysize) : header(header) { // Extra margin to avoid out-of-bounds writes. // All have space for two rows of data. - for (size_t i = 0; i < 4; i++) { - pred_errors[i].resize((xsize + 2) * 2); + for (auto &pred_error : pred_errors) { + pred_error.resize((xsize + 2) * 2); } error.resize((xsize + 2) * 2); } @@ -538,8 +539,9 @@ JXL_INLINE PredictionResult Predict( } if (mode & kAllPredictions) { for (size_t i = 0; i < kNumModularPredictors; i++) { - predictions[i] = PredictOne((Predictor)i, left, top, toptop, topleft, - topright, leftleft, toprightright, wp_pred); + predictions[i] = + PredictOne(static_cast<Predictor>(i), left, top, toptop, topleft, + topright, leftleft, toprightright, wp_pred); } } result.guess += PredictOne(predictor, left, top, toptop, topleft, topright, |