summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/modular/encoding/encoding.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/modular/encoding/encoding.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/modular/encoding/encoding.cc')
-rw-r--r--third_party/jpeg-xl/lib/jxl/modular/encoding/encoding.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/modular/encoding/encoding.cc b/third_party/jpeg-xl/lib/jxl/modular/encoding/encoding.cc
index a6abdcfc91..bb690b74ba 100644
--- a/third_party/jpeg-xl/lib/jxl/modular/encoding/encoding.cc
+++ b/third_party/jpeg-xl/lib/jxl/modular/encoding/encoding.cc
@@ -14,6 +14,8 @@
#include "lib/jxl/base/scope_guard.h"
#include "lib/jxl/dec_ans.h"
#include "lib/jxl/dec_bit_reader.h"
+#include "lib/jxl/frame_dimensions.h"
+#include "lib/jxl/image_ops.h"
#include "lib/jxl/modular/encoding/context_predict.h"
#include "lib/jxl/modular/options.h"
#include "lib/jxl/pack_signed.h"
@@ -141,7 +143,7 @@ Status DecodeModularChannelMAANS(BitReader *br, ANSSymbolReader *reader,
Channel &channel = image->channel[chan];
std::array<pixel_type, kNumStaticProperties> static_props = {
- {chan, (int)group_id}};
+ {chan, static_cast<int>(group_id)}};
// TODO(veluca): filter the tree according to static_props.
// zero pixel channel? could happen
@@ -376,7 +378,9 @@ Status DecodeModularChannelMAANS(BitReader *br, ANSSymbolReader *reader,
MATreeLookup tree_lookup(tree);
Properties properties = Properties(num_props);
const intptr_t onerow = channel.plane.PixelsPerRow();
- Channel references(properties.size() - kNumNonrefProperties, channel.w);
+ JXL_ASSIGN_OR_RETURN(
+ Channel references,
+ Channel::Create(properties.size() - kNumNonrefProperties, channel.w));
for (size_t y = 0; y < channel.h; y++) {
pixel_type *JXL_RESTRICT p = channel.Row(y);
PrecomputeReferences(channel, y, *image, chan, &references);
@@ -422,7 +426,9 @@ Status DecodeModularChannelMAANS(BitReader *br, ANSSymbolReader *reader,
MATreeLookup tree_lookup(tree);
Properties properties = Properties(num_props);
const intptr_t onerow = channel.plane.PixelsPerRow();
- Channel references(properties.size() - kNumNonrefProperties, channel.w);
+ JXL_ASSIGN_OR_RETURN(
+ Channel references,
+ Channel::Create(properties.size() - kNumNonrefProperties, channel.w));
weighted::State wp_state(wp_header, channel.w, channel.h);
for (size_t y = 0; y < channel.h; y++) {
pixel_type *JXL_RESTRICT p = channel.Row(y);