enc_entropy_coder.h (1572B)
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_ENTROPY_CODER_H_ 7 #define LIB_JXL_ENC_ENTROPY_CODER_H_ 8 9 #include <sys/types.h> 10 11 #include <cstdint> 12 #include <vector> 13 14 #include "lib/jxl/ac_context.h" // BlockCtxMap 15 #include "lib/jxl/base/compiler_specific.h" 16 #include "lib/jxl/base/rect.h" 17 #include "lib/jxl/base/status.h" 18 #include "lib/jxl/coeff_order_fwd.h" 19 #include "lib/jxl/enc_ans.h" 20 #include "lib/jxl/frame_header.h" // YCbCrChromaSubsampling 21 #include "lib/jxl/image.h" 22 23 // Entropy coding and context modeling of DC and AC coefficients, as well as AC 24 // strategy and quantization field. 25 26 namespace jxl { 27 28 class AcStrategyImage; 29 30 // Generate DCT NxN quantized AC values tokens. 31 // Only the subset "rect" [in units of blocks] within all images. 32 // See also DecodeACVarBlock. 33 Status TokenizeCoefficients(const coeff_order_t* JXL_RESTRICT orders, 34 const Rect& rect, 35 const int32_t* JXL_RESTRICT* JXL_RESTRICT ac_rows, 36 const AcStrategyImage& ac_strategy, 37 const YCbCrChromaSubsampling& cs, 38 Image3I* JXL_RESTRICT tmp_num_nzeroes, 39 std::vector<Token>* JXL_RESTRICT output, 40 const ImageB& qdc, const ImageI& qf, 41 const BlockCtxMap& block_ctx_map); 42 43 } // namespace jxl 44 45 #endif // LIB_JXL_ENC_ENTROPY_CODER_H_