/src/ghostpdl/brotli/c/enc/histogram_inc.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* NOLINT(build/header_guard) */ |
2 | | /* Copyright 2013 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: Histogram, DATA_SIZE, DataType */ |
9 | | |
10 | | /* A simple container for histograms of data in blocks. */ |
11 | | |
12 | | typedef struct FN(Histogram) { |
13 | | uint32_t data_[DATA_SIZE]; |
14 | | size_t total_count_; |
15 | | double bit_cost_; |
16 | | } FN(Histogram); |
17 | | |
18 | 0 | static BROTLI_INLINE void FN(HistogramClear)(FN(Histogram)* self) { |
19 | 0 | memset(self->data_, 0, sizeof(self->data_)); |
20 | 0 | self->total_count_ = 0; |
21 | 0 | self->bit_cost_ = HUGE_VAL; |
22 | 0 | } Unexecuted instantiation: encode.c:HistogramClearLiteral Unexecuted instantiation: encode.c:HistogramClearCommand Unexecuted instantiation: encode.c:HistogramClearDistance Unexecuted instantiation: metablock.c:HistogramClearDistance Unexecuted instantiation: metablock.c:HistogramClearLiteral Unexecuted instantiation: metablock.c:HistogramClearCommand Unexecuted instantiation: bit_cost.c:HistogramClearLiteral Unexecuted instantiation: bit_cost.c:HistogramClearCommand Unexecuted instantiation: bit_cost.c:HistogramClearDistance Unexecuted instantiation: block_splitter.c:HistogramClearLiteral Unexecuted instantiation: block_splitter.c:HistogramClearCommand Unexecuted instantiation: block_splitter.c:HistogramClearDistance Unexecuted instantiation: brotli_bit_stream.c:HistogramClearLiteral Unexecuted instantiation: brotli_bit_stream.c:HistogramClearCommand Unexecuted instantiation: brotli_bit_stream.c:HistogramClearDistance Unexecuted instantiation: cluster.c:HistogramClearLiteral Unexecuted instantiation: cluster.c:HistogramClearCommand Unexecuted instantiation: cluster.c:HistogramClearDistance Unexecuted instantiation: compress_fragment.c:HistogramClearLiteral Unexecuted instantiation: compress_fragment.c:HistogramClearCommand Unexecuted instantiation: compress_fragment.c:HistogramClearDistance Unexecuted instantiation: compress_fragment_two_pass.c:HistogramClearLiteral Unexecuted instantiation: compress_fragment_two_pass.c:HistogramClearCommand Unexecuted instantiation: compress_fragment_two_pass.c:HistogramClearDistance Unexecuted instantiation: histogram.c:HistogramClearLiteral Unexecuted instantiation: histogram.c:HistogramClearCommand Unexecuted instantiation: histogram.c:HistogramClearDistance |
23 | | |
24 | | static BROTLI_INLINE void FN(ClearHistograms)( |
25 | 0 | FN(Histogram)* array, size_t length) { |
26 | 0 | size_t i; |
27 | 0 | for (i = 0; i < length; ++i) FN(HistogramClear)(array + i); |
28 | 0 | } Unexecuted instantiation: encode.c:ClearHistogramsLiteral Unexecuted instantiation: encode.c:ClearHistogramsCommand Unexecuted instantiation: encode.c:ClearHistogramsDistance Unexecuted instantiation: metablock.c:ClearHistogramsLiteral Unexecuted instantiation: metablock.c:ClearHistogramsDistance Unexecuted instantiation: metablock.c:ClearHistogramsCommand Unexecuted instantiation: bit_cost.c:ClearHistogramsLiteral Unexecuted instantiation: bit_cost.c:ClearHistogramsCommand Unexecuted instantiation: bit_cost.c:ClearHistogramsDistance Unexecuted instantiation: block_splitter.c:ClearHistogramsLiteral Unexecuted instantiation: block_splitter.c:ClearHistogramsCommand Unexecuted instantiation: block_splitter.c:ClearHistogramsDistance Unexecuted instantiation: brotli_bit_stream.c:ClearHistogramsLiteral Unexecuted instantiation: brotli_bit_stream.c:ClearHistogramsCommand Unexecuted instantiation: brotli_bit_stream.c:ClearHistogramsDistance Unexecuted instantiation: cluster.c:ClearHistogramsLiteral Unexecuted instantiation: cluster.c:ClearHistogramsCommand Unexecuted instantiation: cluster.c:ClearHistogramsDistance Unexecuted instantiation: compress_fragment.c:ClearHistogramsLiteral Unexecuted instantiation: compress_fragment.c:ClearHistogramsCommand Unexecuted instantiation: compress_fragment.c:ClearHistogramsDistance Unexecuted instantiation: compress_fragment_two_pass.c:ClearHistogramsLiteral Unexecuted instantiation: compress_fragment_two_pass.c:ClearHistogramsCommand Unexecuted instantiation: compress_fragment_two_pass.c:ClearHistogramsDistance Unexecuted instantiation: histogram.c:ClearHistogramsLiteral Unexecuted instantiation: histogram.c:ClearHistogramsCommand Unexecuted instantiation: histogram.c:ClearHistogramsDistance |
29 | | |
30 | 0 | static BROTLI_INLINE void FN(HistogramAdd)(FN(Histogram)* self, size_t val) { |
31 | 0 | ++self->data_[val]; |
32 | 0 | ++self->total_count_; |
33 | 0 | } Unexecuted instantiation: encode.c:HistogramAddLiteral Unexecuted instantiation: encode.c:HistogramAddCommand Unexecuted instantiation: encode.c:HistogramAddDistance Unexecuted instantiation: metablock.c:HistogramAddDistance Unexecuted instantiation: metablock.c:HistogramAddCommand Unexecuted instantiation: metablock.c:HistogramAddLiteral Unexecuted instantiation: bit_cost.c:HistogramAddLiteral Unexecuted instantiation: bit_cost.c:HistogramAddCommand Unexecuted instantiation: bit_cost.c:HistogramAddDistance Unexecuted instantiation: block_splitter.c:HistogramAddLiteral Unexecuted instantiation: block_splitter.c:HistogramAddCommand Unexecuted instantiation: block_splitter.c:HistogramAddDistance Unexecuted instantiation: brotli_bit_stream.c:HistogramAddCommand Unexecuted instantiation: brotli_bit_stream.c:HistogramAddLiteral Unexecuted instantiation: brotli_bit_stream.c:HistogramAddDistance Unexecuted instantiation: cluster.c:HistogramAddLiteral Unexecuted instantiation: cluster.c:HistogramAddCommand Unexecuted instantiation: cluster.c:HistogramAddDistance Unexecuted instantiation: compress_fragment.c:HistogramAddLiteral Unexecuted instantiation: compress_fragment.c:HistogramAddCommand Unexecuted instantiation: compress_fragment.c:HistogramAddDistance Unexecuted instantiation: compress_fragment_two_pass.c:HistogramAddLiteral Unexecuted instantiation: compress_fragment_two_pass.c:HistogramAddCommand Unexecuted instantiation: compress_fragment_two_pass.c:HistogramAddDistance Unexecuted instantiation: histogram.c:HistogramAddCommand Unexecuted instantiation: histogram.c:HistogramAddLiteral Unexecuted instantiation: histogram.c:HistogramAddDistance |
34 | | |
35 | | static BROTLI_INLINE void FN(HistogramAddVector)(FN(Histogram)* self, |
36 | 0 | const DataType* p, size_t n) { |
37 | 0 | self->total_count_ += n; |
38 | 0 | n += 1; |
39 | 0 | while (--n) ++self->data_[*p++]; |
40 | 0 | } Unexecuted instantiation: encode.c:HistogramAddVectorLiteral Unexecuted instantiation: encode.c:HistogramAddVectorCommand Unexecuted instantiation: encode.c:HistogramAddVectorDistance Unexecuted instantiation: metablock.c:HistogramAddVectorLiteral Unexecuted instantiation: metablock.c:HistogramAddVectorCommand Unexecuted instantiation: metablock.c:HistogramAddVectorDistance Unexecuted instantiation: bit_cost.c:HistogramAddVectorLiteral Unexecuted instantiation: bit_cost.c:HistogramAddVectorCommand Unexecuted instantiation: bit_cost.c:HistogramAddVectorDistance Unexecuted instantiation: block_splitter.c:HistogramAddVectorLiteral Unexecuted instantiation: block_splitter.c:HistogramAddVectorCommand Unexecuted instantiation: block_splitter.c:HistogramAddVectorDistance Unexecuted instantiation: brotli_bit_stream.c:HistogramAddVectorLiteral Unexecuted instantiation: brotli_bit_stream.c:HistogramAddVectorCommand Unexecuted instantiation: brotli_bit_stream.c:HistogramAddVectorDistance Unexecuted instantiation: cluster.c:HistogramAddVectorLiteral Unexecuted instantiation: cluster.c:HistogramAddVectorCommand Unexecuted instantiation: cluster.c:HistogramAddVectorDistance Unexecuted instantiation: compress_fragment.c:HistogramAddVectorLiteral Unexecuted instantiation: compress_fragment.c:HistogramAddVectorCommand Unexecuted instantiation: compress_fragment.c:HistogramAddVectorDistance Unexecuted instantiation: compress_fragment_two_pass.c:HistogramAddVectorLiteral Unexecuted instantiation: compress_fragment_two_pass.c:HistogramAddVectorCommand Unexecuted instantiation: compress_fragment_two_pass.c:HistogramAddVectorDistance Unexecuted instantiation: histogram.c:HistogramAddVectorLiteral Unexecuted instantiation: histogram.c:HistogramAddVectorCommand Unexecuted instantiation: histogram.c:HistogramAddVectorDistance |
41 | | |
42 | | static BROTLI_INLINE void FN(HistogramAddHistogram)(FN(Histogram)* self, |
43 | 0 | const FN(Histogram)* v) { |
44 | 0 | size_t i; |
45 | 0 | self->total_count_ += v->total_count_; |
46 | 0 | for (i = 0; i < DATA_SIZE; ++i) { |
47 | 0 | self->data_[i] += v->data_[i]; |
48 | 0 | } |
49 | 0 | } Unexecuted instantiation: encode.c:HistogramAddHistogramLiteral Unexecuted instantiation: encode.c:HistogramAddHistogramCommand Unexecuted instantiation: encode.c:HistogramAddHistogramDistance Unexecuted instantiation: metablock.c:HistogramAddHistogramLiteral Unexecuted instantiation: metablock.c:HistogramAddHistogramCommand Unexecuted instantiation: metablock.c:HistogramAddHistogramDistance Unexecuted instantiation: bit_cost.c:HistogramAddHistogramLiteral Unexecuted instantiation: bit_cost.c:HistogramAddHistogramCommand Unexecuted instantiation: bit_cost.c:HistogramAddHistogramDistance Unexecuted instantiation: block_splitter.c:HistogramAddHistogramLiteral Unexecuted instantiation: block_splitter.c:HistogramAddHistogramCommand Unexecuted instantiation: block_splitter.c:HistogramAddHistogramDistance Unexecuted instantiation: brotli_bit_stream.c:HistogramAddHistogramLiteral Unexecuted instantiation: brotli_bit_stream.c:HistogramAddHistogramCommand Unexecuted instantiation: brotli_bit_stream.c:HistogramAddHistogramDistance Unexecuted instantiation: cluster.c:HistogramAddHistogramLiteral Unexecuted instantiation: cluster.c:HistogramAddHistogramCommand Unexecuted instantiation: cluster.c:HistogramAddHistogramDistance Unexecuted instantiation: compress_fragment.c:HistogramAddHistogramLiteral Unexecuted instantiation: compress_fragment.c:HistogramAddHistogramCommand Unexecuted instantiation: compress_fragment.c:HistogramAddHistogramDistance Unexecuted instantiation: compress_fragment_two_pass.c:HistogramAddHistogramLiteral Unexecuted instantiation: compress_fragment_two_pass.c:HistogramAddHistogramCommand Unexecuted instantiation: compress_fragment_two_pass.c:HistogramAddHistogramDistance Unexecuted instantiation: histogram.c:HistogramAddHistogramLiteral Unexecuted instantiation: histogram.c:HistogramAddHistogramCommand Unexecuted instantiation: histogram.c:HistogramAddHistogramDistance |
50 | | |
51 | 0 | static BROTLI_INLINE size_t FN(HistogramDataSize)(void) { return DATA_SIZE; } Unexecuted instantiation: encode.c:HistogramDataSizeLiteral Unexecuted instantiation: encode.c:HistogramDataSizeCommand Unexecuted instantiation: encode.c:HistogramDataSizeDistance Unexecuted instantiation: metablock.c:HistogramDataSizeLiteral Unexecuted instantiation: metablock.c:HistogramDataSizeCommand Unexecuted instantiation: metablock.c:HistogramDataSizeDistance Unexecuted instantiation: bit_cost.c:HistogramDataSizeLiteral Unexecuted instantiation: bit_cost.c:HistogramDataSizeCommand Unexecuted instantiation: bit_cost.c:HistogramDataSizeDistance Unexecuted instantiation: block_splitter.c:HistogramDataSizeLiteral Unexecuted instantiation: block_splitter.c:HistogramDataSizeCommand Unexecuted instantiation: block_splitter.c:HistogramDataSizeDistance Unexecuted instantiation: brotli_bit_stream.c:HistogramDataSizeLiteral Unexecuted instantiation: brotli_bit_stream.c:HistogramDataSizeCommand Unexecuted instantiation: brotli_bit_stream.c:HistogramDataSizeDistance Unexecuted instantiation: cluster.c:HistogramDataSizeLiteral Unexecuted instantiation: cluster.c:HistogramDataSizeCommand Unexecuted instantiation: cluster.c:HistogramDataSizeDistance Unexecuted instantiation: compress_fragment.c:HistogramDataSizeLiteral Unexecuted instantiation: compress_fragment.c:HistogramDataSizeCommand Unexecuted instantiation: compress_fragment.c:HistogramDataSizeDistance Unexecuted instantiation: compress_fragment_two_pass.c:HistogramDataSizeLiteral Unexecuted instantiation: compress_fragment_two_pass.c:HistogramDataSizeCommand Unexecuted instantiation: compress_fragment_two_pass.c:HistogramDataSizeDistance Unexecuted instantiation: histogram.c:HistogramDataSizeLiteral Unexecuted instantiation: histogram.c:HistogramDataSizeCommand Unexecuted instantiation: histogram.c:HistogramDataSizeDistance |