// Copyright 2017 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SRC_HUFFMAN_TABLE_H_ #define SRC_HUFFMAN_TABLE_H_ #include <cstddef> #include <cstdint> #include <string> #include <vector> #include "puffin/src/bit_reader.h" #include "puffin/src/bit_writer.h" #include "puffin/src/include/puffin/common.h" #include "puffin/src/logging.h" namespace puffin { // Maximum Huffman code length based on RFC1951. constexpr size_t kMaxHuffmanBits = …; // Permutations of input Huffman code lengths (used only to read // |dynamic_code_lens_|). extern const uint8_t kPermutations[]; // The bases of each alphabet which is added to the integer value of extra // bits that comes after the Huffman code in the input to create the given // length value. The last element is a guard. extern const uint16_t kLengthBases[]; // Number of extra bits that comes after the associating Huffman code. extern const uint8_t kLengthExtraBits[]; // same as |kLengthBases| except for the the distances instead of lengths. // The last element is a guard. extern const uint16_t kDistanceBases[]; // Same as |kLengthExtraBits| except for distances instead of lengths. extern const uint8_t kDistanceExtraBits[]; class HuffmanTable { … }; // The type of a block in a deflate stream. enum class BlockType : uint8_t { … }; std::string BlockTypeToString(BlockType type); } // namespace puffin #endif // SRC_HUFFMAN_TABLE_H_