/src/ghostpdl/brotli/c/enc/block_encoder_inc.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* NOLINT(build/header_guard) */ |
2 | | /* Copyright 2014 Google Inc. All Rights Reserved. |
3 | | |
4 | | Distributed under MIT license. |
5 | | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
6 | | */ |
7 | | |
8 | | /* template parameters: FN */ |
9 | | |
10 | | #define HistogramType FN(Histogram) |
11 | | |
12 | | /* Creates entropy codes for all block types and stores them to the bit |
13 | | stream. */ |
14 | | static void FN(BuildAndStoreEntropyCodes)(MemoryManager* m, BlockEncoder* self, |
15 | | const HistogramType* histograms, const size_t histograms_size, |
16 | | const size_t alphabet_size, HuffmanTree* tree, |
17 | 0 | size_t* storage_ix, uint8_t* storage) { |
18 | 0 | const size_t table_size = histograms_size * self->histogram_length_; |
19 | 0 | self->depths_ = BROTLI_ALLOC(m, uint8_t, table_size); |
20 | 0 | self->bits_ = BROTLI_ALLOC(m, uint16_t, table_size); |
21 | 0 | if (BROTLI_IS_OOM(m)) return; |
22 | | |
23 | 0 | { |
24 | 0 | size_t i; |
25 | 0 | for (i = 0; i < histograms_size; ++i) { |
26 | 0 | size_t ix = i * self->histogram_length_; |
27 | 0 | BuildAndStoreHuffmanTree(&histograms[i].data_[0], self->histogram_length_, |
28 | 0 | alphabet_size, tree, &self->depths_[ix], &self->bits_[ix], |
29 | 0 | storage_ix, storage); |
30 | 0 | } |
31 | 0 | } |
32 | 0 | } Unexecuted instantiation: brotli_bit_stream.c:BuildAndStoreEntropyCodesLiteral Unexecuted instantiation: brotli_bit_stream.c:BuildAndStoreEntropyCodesCommand Unexecuted instantiation: brotli_bit_stream.c:BuildAndStoreEntropyCodesDistance |
33 | | |
34 | | #undef HistogramType |