tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

enc_heuristics.h (1871B)


      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 
     13 #include "lib/jxl/base/data_parallel.h"
     14 #include "lib/jxl/base/rect.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* linear, Image3F* opsin,
     36                            const Rect& rect, const JxlCmsInterface& cms,
     37                            ThreadPool* pool, AuxOut* aux_out);
     38 
     39 Status ComputeARHeuristics(const FrameHeader& frame_header,
     40                           PassesEncoderState* enc_state,
     41                           const Image3F& orig_opsin, const Rect& rect,
     42                           ThreadPool* pool);
     43 
     44 void FindBestBlockEntropyModel(PassesEncoderState& enc_state);
     45 
     46 Status DownsampleImage2_Iterative(Image3F* opsin);
     47 Status DownsampleImage2_Sharper(Image3F* opsin);
     48 
     49 }  // namespace jxl
     50 
     51 #endif  // LIB_JXL_ENC_HEURISTICS_H_