summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/chroma_from_luma.cc
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/chroma_from_luma.cc
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.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/chroma_from_luma.cc')
-rw-r--r--third_party/jpeg-xl/lib/jxl/chroma_from_luma.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/chroma_from_luma.cc b/third_party/jpeg-xl/lib/jxl/chroma_from_luma.cc
index 63d21cbb4b..69585c44cf 100644
--- a/third_party/jpeg-xl/lib/jxl/chroma_from_luma.cc
+++ b/third_party/jpeg-xl/lib/jxl/chroma_from_luma.cc
@@ -5,17 +5,25 @@
#include "lib/jxl/chroma_from_luma.h"
+#include "lib/jxl/image_ops.h"
+
namespace jxl {
-ColorCorrelationMap::ColorCorrelationMap(size_t xsize, size_t ysize, bool XYB)
- : ytox_map(DivCeil(xsize, kColorTileDim), DivCeil(ysize, kColorTileDim)),
- ytob_map(DivCeil(xsize, kColorTileDim), DivCeil(ysize, kColorTileDim)) {
- ZeroFillImage(&ytox_map);
- ZeroFillImage(&ytob_map);
+StatusOr<ColorCorrelationMap> ColorCorrelationMap::Create(size_t xsize,
+ size_t ysize,
+ bool XYB) {
+ ColorCorrelationMap result;
+ size_t xblocks = DivCeil(xsize, kColorTileDim);
+ size_t yblocks = DivCeil(ysize, kColorTileDim);
+ JXL_ASSIGN_OR_RETURN(result.ytox_map, ImageSB::Create(xblocks, yblocks));
+ JXL_ASSIGN_OR_RETURN(result.ytob_map, ImageSB::Create(xblocks, yblocks));
+ ZeroFillImage(&result.ytox_map);
+ ZeroFillImage(&result.ytob_map);
if (!XYB) {
- base_correlation_b_ = 0;
+ result.base_correlation_b_ = 0;
}
- RecomputeDCFactors();
+ result.RecomputeDCFactors();
+ return result;
}
} // namespace jxl