summaryrefslogtreecommitdiffstats
path: root/third_party/jpeg-xl/lib/jxl/modular/encoding/encoding.cc
diff options
context:
space:
mode:
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);