enc_encoding.h (1651B)
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_MODULAR_ENCODING_ENC_ENCODING_H_ 7 #define LIB_JXL_MODULAR_ENCODING_ENC_ENCODING_H_ 8 9 #include <cstddef> 10 #include <cstdint> 11 #include <vector> 12 13 #include "lib/jxl/base/status.h" 14 #include "lib/jxl/enc_ans.h" 15 #include "lib/jxl/enc_bit_writer.h" 16 #include "lib/jxl/modular/encoding/dec_ma.h" 17 #include "lib/jxl/modular/encoding/enc_ma.h" 18 #include "lib/jxl/modular/modular_image.h" 19 #include "lib/jxl/modular/options.h" 20 21 namespace jxl { 22 23 struct AuxOut; 24 enum class LayerType : uint8_t; 25 struct GroupHeader; 26 27 Tree PredefinedTree(ModularOptions::TreeKind tree_kind, size_t total_pixels, 28 int bitdepth, int prevprop); 29 30 StatusOr<Tree> LearnTree( 31 TreeSamples &&tree_samples, size_t total_pixels, 32 const ModularOptions &options, 33 const std::vector<ModularMultiplierInfo> &multiplier_info = {}, 34 StaticPropRange static_prop_range = {}); 35 36 // TODO(veluca): make cleaner interfaces. 37 38 Status ModularGenericCompress( 39 Image &image, const ModularOptions &opts, BitWriter *writer, 40 AuxOut *aux_out = nullptr, LayerType layer = static_cast<LayerType>(0), 41 size_t group_id = 0, 42 // For gathering data for producing a global tree. 43 TreeSamples *tree_samples = nullptr, size_t *total_pixels = nullptr, 44 // For encoding with global tree. 45 const Tree *tree = nullptr, GroupHeader *header = nullptr, 46 std::vector<Token> *tokens = nullptr, size_t *widths = nullptr); 47 } // namespace jxl 48 49 #endif // LIB_JXL_MODULAR_ENCODING_ENC_ENCODING_H_