summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/frame_header.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/jxl/frame_header.h
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.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/frame_header.h')
-rw-r--r--third_party/jpeg-xl/lib/jxl/frame_header.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/frame_header.h b/third_party/jpeg-xl/lib/jxl/frame_header.h
index b246bf813e..30c62d5f27 100644
--- a/third_party/jpeg-xl/lib/jxl/frame_header.h
+++ b/third_party/jpeg-xl/lib/jxl/frame_header.h
@@ -82,8 +82,8 @@ struct YCbCrChromaSubsampling : public Fields {
Status VisitFields(Visitor* JXL_RESTRICT visitor) override {
// TODO(veluca): consider allowing 4x downsamples
- for (size_t i = 0; i < 3; i++) {
- JXL_QUIET_RETURN_IF_ERROR(visitor->Bits(2, 0, &channel_mode_[i]));
+ for (uint32_t& ch : channel_mode_) {
+ JXL_QUIET_RETURN_IF_ERROR(visitor->Bits(2, 0, &ch));
}
Recompute();
return true;
@@ -152,9 +152,9 @@ struct YCbCrChromaSubsampling : public Fields {
void Recompute() {
maxhs_ = 0;
maxvs_ = 0;
- for (size_t i = 0; i < 3; i++) {
- maxhs_ = std::max(maxhs_, kHShift[channel_mode_[i]]);
- maxvs_ = std::max(maxvs_, kVShift[channel_mode_[i]]);
+ for (uint32_t ch : channel_mode_) {
+ maxhs_ = std::max(maxhs_, kHShift[ch]);
+ maxvs_ = std::max(maxvs_, kVShift[ch]);
}
}
static const uint8_t kHShift[4];