enc_heuristics.h (1632B)
1 // Copyright (c) the JPEG XL Project Authors. All rights reserved. 2 // 3 // Use of this source code is governed by a BSD-style 4 // license that can be found in the LICENSE file. 5 6 #ifndef LIB_JXL_ENC_HEURISTICS_H_ 7 #define LIB_JXL_ENC_HEURISTICS_H_ 8 9 // Hook for custom encoder heuristics (VarDCT only for now). 10 11 #include <jxl/cms_interface.h> 12 #include <stddef.h> 13 14 #include "lib/jxl/base/data_parallel.h" 15 #include "lib/jxl/base/status.h" 16 #include "lib/jxl/frame_header.h" 17 #include "lib/jxl/image.h" 18 19 namespace jxl { 20 21 struct AuxOut; 22 struct PassesEncoderState; 23 class DequantMatrices; 24 class ImageBundle; 25 class ModularFrameEncoder; 26 27 // Initializes encoder structures in `enc_state` using the original image data 28 // in `original_pixels`, and the XYB image data in `opsin`. Also modifies the 29 // `opsin` image by applying Gaborish, and doing other modifications if 30 // necessary. `pool` is used for running the computations on multiple threads. 31 // `aux_out` collects statistics and can be used to print debug images. 32 Status LossyFrameHeuristics(const FrameHeader& frame_header, 33 PassesEncoderState* enc_state, 34 ModularFrameEncoder* modular_frame_encoder, 35 const Image3F* original_pixels, Image3F* opsin, 36 const Rect& rect, const JxlCmsInterface& cms, 37 ThreadPool* pool, AuxOut* aux_out); 38 39 void FindBestBlockEntropyModel(PassesEncoderState& enc_state); 40 41 Status DownsampleImage2_Iterative(Image3F* opsin); 42 Status DownsampleImage2_Sharper(Image3F* opsin); 43 44 } // namespace jxl 45 46 #endif // LIB_JXL_ENC_HEURISTICS_H_