/src/duckdb/third_party/brotli/enc/histogram.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* Copyright 2013 Google Inc. All Rights Reserved. |
2 | | |
3 | | Distributed under MIT license. |
4 | | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
5 | | */ |
6 | | |
7 | | /* Models the histograms of literals, commands and distance codes. */ |
8 | | |
9 | | #ifndef BROTLI_ENC_HISTOGRAM_H_ |
10 | | #define BROTLI_ENC_HISTOGRAM_H_ |
11 | | |
12 | | #include <string.h> /* memset */ |
13 | | |
14 | | #include <brotli/types.h> |
15 | | |
16 | | #include "../common/brotli_constants.h" |
17 | | #include "../common/context.h" |
18 | | #include "../common/brotli_platform.h" |
19 | | #include "block_splitter.h" |
20 | | #include "command.h" |
21 | | |
22 | | namespace duckdb_brotli { |
23 | | |
24 | | /* The distance symbols effectively used by "Large Window Brotli" (32-bit). */ |
25 | 0 | #define BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS 544 |
26 | | |
27 | 0 | #define FN(X) X ## Literal |
28 | 0 | #define DATA_SIZE BROTLI_NUM_LITERAL_SYMBOLS |
29 | | #define DataType uint8_t |
30 | | /* NOLINT(build/header_guard) */ |
31 | | /* Copyright 2013 Google Inc. All Rights Reserved. |
32 | | |
33 | | Distributed under MIT license. |
34 | | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
35 | | */ |
36 | | |
37 | | /* template parameters: Histogram, DATA_SIZE, DataType */ |
38 | | |
39 | | /* A simple container for histograms of data in blocks. */ |
40 | | |
41 | | typedef struct FN(Histogram) { |
42 | | uint32_t data_[DATA_SIZE]; |
43 | | size_t total_count_; |
44 | | double bit_cost_; |
45 | | } FN(Histogram); |
46 | | |
47 | 0 | static BROTLI_INLINE void FN(HistogramClear)(FN(Histogram)* self) { |
48 | 0 | memset(self->data_, 0, sizeof(self->data_)); |
49 | 0 | self->total_count_ = 0; |
50 | 0 | self->bit_cost_ = HUGE_VAL; |
51 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramClearLiteral(duckdb_brotli::HistogramLiteral*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramClearLiteral(duckdb_brotli::HistogramLiteral*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramClearLiteral(duckdb_brotli::HistogramLiteral*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramClearLiteral(duckdb_brotli::HistogramLiteral*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramClearLiteral(duckdb_brotli::HistogramLiteral*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramClearLiteral(duckdb_brotli::HistogramLiteral*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramClearLiteral(duckdb_brotli::HistogramLiteral*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramClearLiteral(duckdb_brotli::HistogramLiteral*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramClearLiteral(duckdb_brotli::HistogramLiteral*) |
52 | | |
53 | | static BROTLI_INLINE void FN(ClearHistograms)( |
54 | 0 | FN(Histogram)* array, size_t length) { |
55 | 0 | size_t i; |
56 | 0 | for (i = 0; i < length; ++i) FN(HistogramClear)(array + i); |
57 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::ClearHistogramsLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::ClearHistogramsLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::ClearHistogramsLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::ClearHistogramsLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::ClearHistogramsLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::ClearHistogramsLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::ClearHistogramsLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::ClearHistogramsLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::ClearHistogramsLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) |
58 | | |
59 | 0 | static BROTLI_INLINE void FN(HistogramAdd)(FN(Histogram)* self, size_t val) { |
60 | 0 | ++self->data_[val]; |
61 | 0 | ++self->total_count_; |
62 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramAddLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramAddLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramAddLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramAddLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramAddLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramAddLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramAddLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramAddLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramAddLiteral(duckdb_brotli::HistogramLiteral*, unsigned long) |
63 | | |
64 | | static BROTLI_INLINE void FN(HistogramAddVector)(FN(Histogram)* self, |
65 | 0 | const DataType* p, size_t n) { |
66 | 0 | self->total_count_ += n; |
67 | 0 | n += 1; |
68 | 0 | while (--n) ++self->data_[*p++]; |
69 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramAddVectorLiteral(duckdb_brotli::HistogramLiteral*, unsigned char const*, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramAddVectorLiteral(duckdb_brotli::HistogramLiteral*, unsigned char const*, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramAddVectorLiteral(duckdb_brotli::HistogramLiteral*, unsigned char const*, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramAddVectorLiteral(duckdb_brotli::HistogramLiteral*, unsigned char const*, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramAddVectorLiteral(duckdb_brotli::HistogramLiteral*, unsigned char const*, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramAddVectorLiteral(duckdb_brotli::HistogramLiteral*, unsigned char const*, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramAddVectorLiteral(duckdb_brotli::HistogramLiteral*, unsigned char const*, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramAddVectorLiteral(duckdb_brotli::HistogramLiteral*, unsigned char const*, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramAddVectorLiteral(duckdb_brotli::HistogramLiteral*, unsigned char const*, unsigned long) |
70 | | |
71 | | static BROTLI_INLINE void FN(HistogramAddHistogram)(FN(Histogram)* self, |
72 | 0 | const FN(Histogram)* v) { |
73 | 0 | size_t i; |
74 | 0 | self->total_count_ += v->total_count_; |
75 | 0 | for (i = 0; i < DATA_SIZE; ++i) { |
76 | 0 | self->data_[i] += v->data_[i]; |
77 | 0 | } |
78 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramAddHistogramLiteral(duckdb_brotli::HistogramLiteral*, duckdb_brotli::HistogramLiteral const*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramAddHistogramLiteral(duckdb_brotli::HistogramLiteral*, duckdb_brotli::HistogramLiteral const*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramAddHistogramLiteral(duckdb_brotli::HistogramLiteral*, duckdb_brotli::HistogramLiteral const*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramAddHistogramLiteral(duckdb_brotli::HistogramLiteral*, duckdb_brotli::HistogramLiteral const*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramAddHistogramLiteral(duckdb_brotli::HistogramLiteral*, duckdb_brotli::HistogramLiteral const*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramAddHistogramLiteral(duckdb_brotli::HistogramLiteral*, duckdb_brotli::HistogramLiteral const*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramAddHistogramLiteral(duckdb_brotli::HistogramLiteral*, duckdb_brotli::HistogramLiteral const*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramAddHistogramLiteral(duckdb_brotli::HistogramLiteral*, duckdb_brotli::HistogramLiteral const*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramAddHistogramLiteral(duckdb_brotli::HistogramLiteral*, duckdb_brotli::HistogramLiteral const*) |
79 | | |
80 | 0 | static BROTLI_INLINE size_t FN(HistogramDataSize)(void) { return DATA_SIZE; } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramDataSizeLiteral() Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramDataSizeLiteral() Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramDataSizeLiteral() Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramDataSizeLiteral() Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramDataSizeLiteral() Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramDataSizeLiteral() Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramDataSizeLiteral() Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramDataSizeLiteral() Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramDataSizeLiteral() |
81 | | #undef DataType |
82 | | #undef DATA_SIZE |
83 | | #undef FN |
84 | | |
85 | 0 | #define FN(X) X ## Command |
86 | | #define DataType uint16_t |
87 | 0 | #define DATA_SIZE BROTLI_NUM_COMMAND_SYMBOLS |
88 | | /* NOLINT(build/header_guard) */ |
89 | | /* Copyright 2013 Google Inc. All Rights Reserved. |
90 | | |
91 | | Distributed under MIT license. |
92 | | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
93 | | */ |
94 | | |
95 | | /* template parameters: Histogram, DATA_SIZE, DataType */ |
96 | | |
97 | | /* A simple container for histograms of data in blocks. */ |
98 | | |
99 | | typedef struct FN(Histogram) { |
100 | | uint32_t data_[DATA_SIZE]; |
101 | | size_t total_count_; |
102 | | double bit_cost_; |
103 | | } FN(Histogram); |
104 | | |
105 | 0 | static BROTLI_INLINE void FN(HistogramClear)(FN(Histogram)* self) { |
106 | 0 | memset(self->data_, 0, sizeof(self->data_)); |
107 | 0 | self->total_count_ = 0; |
108 | 0 | self->bit_cost_ = HUGE_VAL; |
109 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramClearCommand(duckdb_brotli::HistogramCommand*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramClearCommand(duckdb_brotli::HistogramCommand*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramClearCommand(duckdb_brotli::HistogramCommand*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramClearCommand(duckdb_brotli::HistogramCommand*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramClearCommand(duckdb_brotli::HistogramCommand*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramClearCommand(duckdb_brotli::HistogramCommand*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramClearCommand(duckdb_brotli::HistogramCommand*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramClearCommand(duckdb_brotli::HistogramCommand*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramClearCommand(duckdb_brotli::HistogramCommand*) |
110 | | |
111 | | static BROTLI_INLINE void FN(ClearHistograms)( |
112 | 0 | FN(Histogram)* array, size_t length) { |
113 | 0 | size_t i; |
114 | 0 | for (i = 0; i < length; ++i) FN(HistogramClear)(array + i); |
115 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::ClearHistogramsCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::ClearHistogramsCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::ClearHistogramsCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::ClearHistogramsCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::ClearHistogramsCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::ClearHistogramsCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::ClearHistogramsCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::ClearHistogramsCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::ClearHistogramsCommand(duckdb_brotli::HistogramCommand*, unsigned long) |
116 | | |
117 | 0 | static BROTLI_INLINE void FN(HistogramAdd)(FN(Histogram)* self, size_t val) { |
118 | 0 | ++self->data_[val]; |
119 | 0 | ++self->total_count_; |
120 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramAddCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramAddCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramAddCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramAddCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramAddCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramAddCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramAddCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramAddCommand(duckdb_brotli::HistogramCommand*, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramAddCommand(duckdb_brotli::HistogramCommand*, unsigned long) |
121 | | |
122 | | static BROTLI_INLINE void FN(HistogramAddVector)(FN(Histogram)* self, |
123 | 0 | const DataType* p, size_t n) { |
124 | 0 | self->total_count_ += n; |
125 | 0 | n += 1; |
126 | 0 | while (--n) ++self->data_[*p++]; |
127 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramAddVectorCommand(duckdb_brotli::HistogramCommand*, unsigned short const*, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramAddVectorCommand(duckdb_brotli::HistogramCommand*, unsigned short const*, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramAddVectorCommand(duckdb_brotli::HistogramCommand*, unsigned short const*, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramAddVectorCommand(duckdb_brotli::HistogramCommand*, unsigned short const*, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramAddVectorCommand(duckdb_brotli::HistogramCommand*, unsigned short const*, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramAddVectorCommand(duckdb_brotli::HistogramCommand*, unsigned short const*, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramAddVectorCommand(duckdb_brotli::HistogramCommand*, unsigned short const*, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramAddVectorCommand(duckdb_brotli::HistogramCommand*, unsigned short const*, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramAddVectorCommand(duckdb_brotli::HistogramCommand*, unsigned short const*, unsigned long) |
128 | | |
129 | | static BROTLI_INLINE void FN(HistogramAddHistogram)(FN(Histogram)* self, |
130 | 0 | const FN(Histogram)* v) { |
131 | 0 | size_t i; |
132 | 0 | self->total_count_ += v->total_count_; |
133 | 0 | for (i = 0; i < DATA_SIZE; ++i) { |
134 | 0 | self->data_[i] += v->data_[i]; |
135 | 0 | } |
136 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramAddHistogramCommand(duckdb_brotli::HistogramCommand*, duckdb_brotli::HistogramCommand const*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramAddHistogramCommand(duckdb_brotli::HistogramCommand*, duckdb_brotli::HistogramCommand const*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramAddHistogramCommand(duckdb_brotli::HistogramCommand*, duckdb_brotli::HistogramCommand const*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramAddHistogramCommand(duckdb_brotli::HistogramCommand*, duckdb_brotli::HistogramCommand const*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramAddHistogramCommand(duckdb_brotli::HistogramCommand*, duckdb_brotli::HistogramCommand const*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramAddHistogramCommand(duckdb_brotli::HistogramCommand*, duckdb_brotli::HistogramCommand const*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramAddHistogramCommand(duckdb_brotli::HistogramCommand*, duckdb_brotli::HistogramCommand const*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramAddHistogramCommand(duckdb_brotli::HistogramCommand*, duckdb_brotli::HistogramCommand const*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramAddHistogramCommand(duckdb_brotli::HistogramCommand*, duckdb_brotli::HistogramCommand const*) |
137 | | |
138 | 0 | static BROTLI_INLINE size_t FN(HistogramDataSize)(void) { return DATA_SIZE; } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramDataSizeCommand() Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramDataSizeCommand() Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramDataSizeCommand() Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramDataSizeCommand() Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramDataSizeCommand() Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramDataSizeCommand() Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramDataSizeCommand() Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramDataSizeCommand() Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramDataSizeCommand() |
139 | | #undef DATA_SIZE |
140 | | #undef FN |
141 | | |
142 | 0 | #define FN(X) X ## Distance |
143 | 0 | #define DATA_SIZE BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS |
144 | | /* NOLINT(build/header_guard) */ |
145 | | /* Copyright 2013 Google Inc. All Rights Reserved. |
146 | | |
147 | | Distributed under MIT license. |
148 | | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
149 | | */ |
150 | | |
151 | | /* template parameters: Histogram, DATA_SIZE, DataType */ |
152 | | |
153 | | /* A simple container for histograms of data in blocks. */ |
154 | | |
155 | | typedef struct FN(Histogram) { |
156 | | uint32_t data_[DATA_SIZE]; |
157 | | size_t total_count_; |
158 | | double bit_cost_; |
159 | | } FN(Histogram); |
160 | | |
161 | 0 | static BROTLI_INLINE void FN(HistogramClear)(FN(Histogram)* self) { |
162 | 0 | memset(self->data_, 0, sizeof(self->data_)); |
163 | 0 | self->total_count_ = 0; |
164 | 0 | self->bit_cost_ = HUGE_VAL; |
165 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramClearDistance(duckdb_brotli::HistogramDistance*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramClearDistance(duckdb_brotli::HistogramDistance*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramClearDistance(duckdb_brotli::HistogramDistance*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramClearDistance(duckdb_brotli::HistogramDistance*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramClearDistance(duckdb_brotli::HistogramDistance*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramClearDistance(duckdb_brotli::HistogramDistance*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramClearDistance(duckdb_brotli::HistogramDistance*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramClearDistance(duckdb_brotli::HistogramDistance*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramClearDistance(duckdb_brotli::HistogramDistance*) |
166 | | |
167 | | static BROTLI_INLINE void FN(ClearHistograms)( |
168 | 0 | FN(Histogram)* array, size_t length) { |
169 | 0 | size_t i; |
170 | 0 | for (i = 0; i < length; ++i) FN(HistogramClear)(array + i); |
171 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::ClearHistogramsDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::ClearHistogramsDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::ClearHistogramsDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::ClearHistogramsDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::ClearHistogramsDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::ClearHistogramsDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::ClearHistogramsDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::ClearHistogramsDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::ClearHistogramsDistance(duckdb_brotli::HistogramDistance*, unsigned long) |
172 | | |
173 | 0 | static BROTLI_INLINE void FN(HistogramAdd)(FN(Histogram)* self, size_t val) { |
174 | 0 | ++self->data_[val]; |
175 | 0 | ++self->total_count_; |
176 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramAddDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramAddDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramAddDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramAddDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramAddDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramAddDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramAddDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramAddDistance(duckdb_brotli::HistogramDistance*, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramAddDistance(duckdb_brotli::HistogramDistance*, unsigned long) |
177 | | |
178 | | static BROTLI_INLINE void FN(HistogramAddVector)(FN(Histogram)* self, |
179 | 0 | const DataType* p, size_t n) { |
180 | 0 | self->total_count_ += n; |
181 | 0 | n += 1; |
182 | 0 | while (--n) ++self->data_[*p++]; |
183 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramAddVectorDistance(duckdb_brotli::HistogramDistance*, unsigned short const*, unsigned long) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramAddVectorDistance(duckdb_brotli::HistogramDistance*, unsigned short const*, unsigned long) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramAddVectorDistance(duckdb_brotli::HistogramDistance*, unsigned short const*, unsigned long) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramAddVectorDistance(duckdb_brotli::HistogramDistance*, unsigned short const*, unsigned long) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramAddVectorDistance(duckdb_brotli::HistogramDistance*, unsigned short const*, unsigned long) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramAddVectorDistance(duckdb_brotli::HistogramDistance*, unsigned short const*, unsigned long) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramAddVectorDistance(duckdb_brotli::HistogramDistance*, unsigned short const*, unsigned long) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramAddVectorDistance(duckdb_brotli::HistogramDistance*, unsigned short const*, unsigned long) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramAddVectorDistance(duckdb_brotli::HistogramDistance*, unsigned short const*, unsigned long) |
184 | | |
185 | | static BROTLI_INLINE void FN(HistogramAddHistogram)(FN(Histogram)* self, |
186 | 0 | const FN(Histogram)* v) { |
187 | 0 | size_t i; |
188 | 0 | self->total_count_ += v->total_count_; |
189 | 0 | for (i = 0; i < DATA_SIZE; ++i) { |
190 | 0 | self->data_[i] += v->data_[i]; |
191 | 0 | } |
192 | 0 | } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramAddHistogramDistance(duckdb_brotli::HistogramDistance*, duckdb_brotli::HistogramDistance const*) Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramAddHistogramDistance(duckdb_brotli::HistogramDistance*, duckdb_brotli::HistogramDistance const*) Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramAddHistogramDistance(duckdb_brotli::HistogramDistance*, duckdb_brotli::HistogramDistance const*) Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramAddHistogramDistance(duckdb_brotli::HistogramDistance*, duckdb_brotli::HistogramDistance const*) Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramAddHistogramDistance(duckdb_brotli::HistogramDistance*, duckdb_brotli::HistogramDistance const*) Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramAddHistogramDistance(duckdb_brotli::HistogramDistance*, duckdb_brotli::HistogramDistance const*) Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramAddHistogramDistance(duckdb_brotli::HistogramDistance*, duckdb_brotli::HistogramDistance const*) Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramAddHistogramDistance(duckdb_brotli::HistogramDistance*, duckdb_brotli::HistogramDistance const*) Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramAddHistogramDistance(duckdb_brotli::HistogramDistance*, duckdb_brotli::HistogramDistance const*) |
193 | | |
194 | 0 | static BROTLI_INLINE size_t FN(HistogramDataSize)(void) { return DATA_SIZE; } Unexecuted instantiation: encode.cpp:duckdb_brotli::HistogramDataSizeDistance() Unexecuted instantiation: compress_fragment.cpp:duckdb_brotli::HistogramDataSizeDistance() Unexecuted instantiation: brotli_bit_stream.cpp:duckdb_brotli::HistogramDataSizeDistance() Unexecuted instantiation: metablock.cpp:duckdb_brotli::HistogramDataSizeDistance() Unexecuted instantiation: histogram.cpp:duckdb_brotli::HistogramDataSizeDistance() Unexecuted instantiation: compress_fragment_two_pass.cpp:duckdb_brotli::HistogramDataSizeDistance() Unexecuted instantiation: block_splitter.cpp:duckdb_brotli::HistogramDataSizeDistance() Unexecuted instantiation: cluster.cpp:duckdb_brotli::HistogramDataSizeDistance() Unexecuted instantiation: bit_cost.cpp:duckdb_brotli::HistogramDataSizeDistance() |
195 | | #undef DataType |
196 | | #undef DATA_SIZE |
197 | | #undef FN |
198 | | |
199 | | BROTLI_INTERNAL void BrotliBuildHistogramsWithContext( |
200 | | const Command* cmds, const size_t num_commands, |
201 | | const BlockSplit* literal_split, const BlockSplit* insert_and_copy_split, |
202 | | const BlockSplit* dist_split, const uint8_t* ringbuffer, size_t pos, |
203 | | size_t mask, uint8_t prev_byte, uint8_t prev_byte2, |
204 | | const ContextType* context_modes, HistogramLiteral* literal_histograms, |
205 | | HistogramCommand* insert_and_copy_histograms, |
206 | | HistogramDistance* copy_dist_histograms); |
207 | | |
208 | | } |
209 | | |
210 | | #endif /* BROTLI_ENC_HISTOGRAM_H_ */ |