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