libjxl

FORK: libjxl patches used on blog
git clone https://git.neptards.moe/blog/libjxl.git
Log | Files | Refs | Submodules | README | LICENSE

common.h (2171B)


      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_COMMON_H_
      7 #define LIB_JXL_COMMON_H_
      8 
      9 // Shared constants.
     10 
     11 #include <cstddef>
     12 
     13 #ifndef JXL_HIGH_PRECISION
     14 #define JXL_HIGH_PRECISION 1
     15 #endif
     16 
     17 // Macro that defines whether support for decoding JXL files to JPEG is enabled.
     18 #ifndef JPEGXL_ENABLE_TRANSCODE_JPEG
     19 #define JPEGXL_ENABLE_TRANSCODE_JPEG 1
     20 #endif  // JPEGXL_ENABLE_TRANSCODE_JPEG
     21 
     22 // Macro that defines whether support for decoding boxes is enabled.
     23 #ifndef JPEGXL_ENABLE_BOXES
     24 #define JPEGXL_ENABLE_BOXES 1
     25 #endif  // JPEGXL_ENABLE_BOXES
     26 
     27 namespace jxl {
     28 // Some enums and typedefs used by more than one header file.
     29 
     30 // Maximum number of passes in an image.
     31 constexpr size_t kMaxNumPasses = 11;
     32 
     33 // Maximum number of reference frames.
     34 constexpr size_t kMaxNumReferenceFrames = 4;
     35 
     36 enum class SpeedTier {
     37   // Try multiple combinations of Glacier flags for modular mode. Otherwise
     38   // like kGlacier.
     39   kTectonicPlate = -1,
     40   // Learn a global tree in Modular mode.
     41   kGlacier = 0,
     42   // Turns on FindBestQuantizationHQ loop. Equivalent to "guetzli" mode.
     43   kTortoise = 1,
     44   // Turns on FindBestQuantization butteraugli loop.
     45   kKitten = 2,
     46   // Turns on dots, patches, and spline detection by default, as well as full
     47   // context clustering. Default.
     48   kSquirrel = 3,
     49   // Turns on error diffusion and full AC strategy heuristics. Equivalent to
     50   // "fast" mode.
     51   kWombat = 4,
     52   // Turns on gaborish by default, non-default cmap, initial quant field.
     53   kHare = 5,
     54   // Turns on simple heuristics for AC strategy, quant field, and clustering;
     55   // also enables coefficient reordering.
     56   kCheetah = 6,
     57   // Turns off most encoder features. Does context clustering.
     58   // Modular: uses fixed tree with Weighted predictor.
     59   kFalcon = 7,
     60   // Currently fastest possible setting for VarDCT.
     61   // Modular: uses fixed tree with Gradient predictor.
     62   kThunder = 8,
     63   // VarDCT: same as kThunder.
     64   // Modular: no tree, Gradient predictor, fast histograms
     65   kLightning = 9
     66 };
     67 
     68 }  // namespace jxl
     69 
     70 #endif  // LIB_JXL_COMMON_H_