#if !defined(BROTLI_HUFFMAN_CODE_FAST_LOAD) /* Do not create this struct directly - use the ConstructHuffmanCode
* constructor below! */ typedefstruct {
uint8_t bits; /* number of bits used for this symbol */
uint16_t value; /* symbol value or table offset */
} HuffmanCode;
/* Please use the following macros to optimize HuffmanCode accesses in hot *paths. * *Forexample,assuming|table|containsaHuffmanCodepointer: * *BROTLI_HC_MARK_TABLE_FOR_FAST_LOAD(table); *BROTLI_HC_ADJUST_TABLE_INDEX(table,index_into_table); **bits=BROTLI_HC_GET_BITS(table); **value=BROTLI_HC_GET_VALUE(table); *BROTLI_HC_ADJUST_TABLE_INDEX(table,offset); **bits2=BROTLI_HC_GET_BITS(table); **value2=BROTLI_HC_GET_VALUE(table); *
*/
#define BROTLI_HC_MARK_TABLE_FOR_FAST_LOAD(H) #define BROTLI_HC_ADJUST_TABLE_INDEX(H, V) H += (V)
/* These must be given a HuffmanCode pointer! */ #define BROTLI_HC_FAST_LOAD_BITS(H) (H->bits) #define BROTLI_HC_FAST_LOAD_VALUE(H) (H->value)
/* These must be given a HuffmanCode pointer! */ #define BROTLI_HC_FAST_LOAD_BITS(H) ((__fastload_##H) & 0xFF) #define BROTLI_HC_FAST_LOAD_VALUE(H) ((__fastload_##H) >> 16) #endif/* BROTLI_HUFFMAN_CODE_FAST_LOAD */
/* Builds Huffman lookup table assuming code lengths are in symbol order. */
BROTLI_INTERNAL void BrotliBuildCodeLengthsHuffmanTable(HuffmanCode* root_table, const uint8_t* const code_lengths, uint16_t* count);
/* Builds Huffman lookup table assuming code lengths are in symbol order.
Returns size of resulting table. */
BROTLI_INTERNAL uint32_t BrotliBuildHuffmanTable(HuffmanCode* root_table, int root_bits, const uint16_t* const symbol_lists, uint16_t* count);
/* Builds a simple Huffman table. The |num_symbols| parameter is to be interpretedasfollows:0means1symbol,1means2symbols, 2means3symbols,3means4symbolswithlengths[2,2,2,2],
4 means 4 symbols with lengths [1, 2, 3, 3]. */
BROTLI_INTERNAL uint32_t BrotliBuildSimpleHuffmanTable(HuffmanCode* table, int root_bits, uint16_t* symbols, uint32_t num_symbols);
/* Contains a collection of Huffman trees with the same alphabet size. */ /* alphabet_size_limit is needed due to simple codes, since
log2(alphabet_size_max) could be greater than log2(alphabet_size_limit). */ typedefstruct {
HuffmanCode** htrees;
HuffmanCode* codes;
uint16_t alphabet_size_max;
uint16_t alphabet_size_limit;
uint16_t num_htrees;
} HuffmanTreeGroup;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.