libjxl

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

enc_quant_weights.h (1338B)


      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_QUANT_WEIGHTS_H_
      7 #define LIB_JXL_ENC_QUANT_WEIGHTS_H_
      8 
      9 #include <cstddef>
     10 
     11 #include "lib/jxl/quant_weights.h"
     12 
     13 namespace jxl {
     14 
     15 struct AuxOut;
     16 struct BitWriter;
     17 
     18 Status DequantMatricesEncode(
     19     const DequantMatrices& matrices, BitWriter* writer, size_t layer,
     20     AuxOut* aux_out, ModularFrameEncoder* modular_frame_encoder = nullptr);
     21 Status DequantMatricesEncodeDC(const DequantMatrices& matrices,
     22                                BitWriter* writer, size_t layer,
     23                                AuxOut* aux_out);
     24 // For consistency with QuantEncoding, higher values correspond to more
     25 // precision.
     26 void DequantMatricesSetCustomDC(DequantMatrices* matrices, const float* dc);
     27 
     28 void DequantMatricesScaleDC(DequantMatrices* matrices, float scale);
     29 
     30 Status DequantMatricesSetCustom(DequantMatrices* matrices,
     31                                 const std::vector<QuantEncoding>& encodings,
     32                                 ModularFrameEncoder* encoder);
     33 
     34 // Roundtrip encode/decode the matrices to ensure same values as decoder.
     35 void DequantMatricesRoundtrip(DequantMatrices* matrices);
     36 
     37 }  // namespace jxl
     38 
     39 #endif  // LIB_JXL_ENC_QUANT_WEIGHTS_H_