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/chroma_from_luma.cc | |
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/chroma_from_luma.cc')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/chroma_from_luma.cc | 22 |
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 |