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/enc_ar_control_field.h | |
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/enc_ar_control_field.h')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/enc_ar_control_field.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/enc_ar_control_field.h b/third_party/jpeg-xl/lib/jxl/enc_ar_control_field.h index fe602c16e3..f3c5a97a1b 100644 --- a/third_party/jpeg-xl/lib/jxl/enc_ar_control_field.h +++ b/third_party/jpeg-xl/lib/jxl/enc_ar_control_field.h @@ -21,11 +21,15 @@ struct PassesEncoderState; struct ArControlFieldHeuristics { struct TempImages { - void InitOnce() { - if (laplacian_sqrsum.xsize() != 0) return; - laplacian_sqrsum = ImageF(kEncTileDim + 4, kEncTileDim + 4); - sqrsum_00 = ImageF(kEncTileDim / 4, kEncTileDim / 4); - sqrsum_22 = ImageF(kEncTileDim / 4 + 1, kEncTileDim / 4 + 1); + Status InitOnce() { + if (laplacian_sqrsum.xsize() != 0) return true; + JXL_ASSIGN_OR_RETURN(laplacian_sqrsum, + ImageF::Create(kEncTileDim + 4, kEncTileDim + 4)); + JXL_ASSIGN_OR_RETURN(sqrsum_00, + ImageF::Create(kEncTileDim / 4, kEncTileDim / 4)); + JXL_ASSIGN_OR_RETURN( + sqrsum_22, ImageF::Create(kEncTileDim / 4 + 1, kEncTileDim / 4 + 1)); + return true; } ImageF laplacian_sqrsum; @@ -37,11 +41,11 @@ struct ArControlFieldHeuristics { temp_images.resize(num_threads); } - void RunRect(const CompressParams& cparams, const FrameHeader& frame_header, - const Rect& block_rect, const Image3F& opsin, - const Rect& opsin_rect, const ImageF& quant_field, - const AcStrategyImage& ac_strategy, ImageB* epf_sharpness, - size_t thread); + Status RunRect(const CompressParams& cparams, const FrameHeader& frame_header, + const Rect& block_rect, const Image3F& opsin, + const Rect& opsin_rect, const ImageF& quant_field, + const AcStrategyImage& ac_strategy, ImageB* epf_sharpness, + size_t thread); std::vector<TempImages> temp_images; }; |