diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /third_party/jpeg-xl/lib/jxl/enc_heuristics.h | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/enc_heuristics.h')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/enc_heuristics.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/enc_heuristics.h b/third_party/jpeg-xl/lib/jxl/enc_heuristics.h new file mode 100644 index 0000000000..14cb596387 --- /dev/null +++ b/third_party/jpeg-xl/lib/jxl/enc_heuristics.h @@ -0,0 +1,46 @@ +// Copyright (c) the JPEG XL Project Authors. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef LIB_JXL_ENC_HEURISTICS_H_ +#define LIB_JXL_ENC_HEURISTICS_H_ + +// Hook for custom encoder heuristics (VarDCT only for now). + +#include <jxl/cms_interface.h> +#include <stddef.h> + +#include "lib/jxl/base/data_parallel.h" +#include "lib/jxl/base/status.h" +#include "lib/jxl/frame_header.h" +#include "lib/jxl/image.h" + +namespace jxl { + +struct AuxOut; +struct PassesEncoderState; +class DequantMatrices; +class ImageBundle; +class ModularFrameEncoder; + +// Initializes encoder structures in `enc_state` using the original image data +// in `original_pixels`, and the XYB image data in `opsin`. Also modifies the +// `opsin` image by applying Gaborish, and doing other modifications if +// necessary. `pool` is used for running the computations on multiple threads. +// `aux_out` collects statistics and can be used to print debug images. +Status LossyFrameHeuristics(const FrameHeader& frame_header, + PassesEncoderState* enc_state, + ModularFrameEncoder* modular_frame_encoder, + const Image3F* original_pixels, Image3F* opsin, + const Rect& rect, const JxlCmsInterface& cms, + ThreadPool* pool, AuxOut* aux_out); + +void FindBestBlockEntropyModel(PassesEncoderState& enc_state); + +void DownsampleImage2_Iterative(Image3F* output); +void DownsampleImage2_Sharper(Image3F* opsin); + +} // namespace jxl + +#endif // LIB_JXL_ENC_HEURISTICS_H_ |