summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/modular/encoding/enc_ma.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/modular/encoding/enc_ma.cc')
-rw-r--r--third_party/jpeg-xl/lib/jxl/modular/encoding/enc_ma.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/modular/encoding/enc_ma.cc b/third_party/jpeg-xl/lib/jxl/modular/encoding/enc_ma.cc
index ef72b2477b..de629ad038 100644
--- a/third_party/jpeg-xl/lib/jxl/modular/encoding/enc_ma.cc
+++ b/third_party/jpeg-xl/lib/jxl/modular/encoding/enc_ma.cc
@@ -109,8 +109,8 @@ IntersectionType BoxIntersects(StaticPropRange needle, StaticPropRange haystack,
void SplitTreeSamples(TreeSamples &tree_samples, size_t begin, size_t pos,
size_t end, size_t prop) {
auto cmp = [&](size_t a, size_t b) {
- return int32_t(tree_samples.Property(prop, a)) -
- int32_t(tree_samples.Property(prop, b));
+ return static_cast<int32_t>(tree_samples.Property(prop, a)) -
+ static_cast<int32_t>(tree_samples.Property(prop, b));
};
Rng rng(0);
while (end > begin + 1) {
@@ -243,7 +243,8 @@ void FindBestSplit(TreeSamples &tree_samples, float threshold,
// properties. We do this even if the current node is not a leaf, to
// minimize the number of nodes in the resulting tree.
for (size_t i = 0; i < mul_info.size(); i++) {
- uint32_t axis, val;
+ uint32_t axis;
+ uint32_t val;
IntersectionType t =
BoxIntersects(static_prop_range, mul_info[i].range, axis, val);
if (t == IntersectionType::kNone) continue;
@@ -696,7 +697,11 @@ void TreeSamples::Swap(size_t a, size_t b) {
}
void TreeSamples::ThreeShuffle(size_t a, size_t b, size_t c) {
- if (b == c) return Swap(a, b);
+ if (b == c) {
+ Swap(a, b);
+ return;
+ }
+
for (auto &r : residuals) {
auto tmp = r[a];
r[a] = r[c];
@@ -966,7 +971,7 @@ void CollectPixelSamples(const Image &image, const ModularOptions &options,
const pixel_type *row = image.channel[channel_ids[i]].Row(y);
pixel_samples.push_back(row[x]);
size_t xp = x == 0 ? 1 : x - 1;
- diff_samples.push_back((int64_t)row[x] - row[xp]);
+ diff_samples.push_back(static_cast<int64_t>(row[x]) - row[xp]);
}
}