/src/perfetto/buildtools/zstd/lib/common/bitstream.h
Line | Count | Source |
1 | | /* ****************************************************************** |
2 | | * bitstream |
3 | | * Part of FSE library |
4 | | * Copyright (c) Meta Platforms, Inc. and affiliates. |
5 | | * |
6 | | * You can contact the author at : |
7 | | * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy |
8 | | * |
9 | | * This source code is licensed under both the BSD-style license (found in the |
10 | | * LICENSE file in the root directory of this source tree) and the GPLv2 (found |
11 | | * in the COPYING file in the root directory of this source tree). |
12 | | * You may select, at your option, one of the above-listed licenses. |
13 | | ****************************************************************** */ |
14 | | #ifndef BITSTREAM_H_MODULE |
15 | | #define BITSTREAM_H_MODULE |
16 | | |
17 | | #if defined (__cplusplus) |
18 | | extern "C" { |
19 | | #endif |
20 | | /* |
21 | | * This API consists of small unitary functions, which must be inlined for best performance. |
22 | | * Since link-time-optimization is not available for all compilers, |
23 | | * these functions are defined into a .h to be included. |
24 | | */ |
25 | | |
26 | | /*-**************************************** |
27 | | * Dependencies |
28 | | ******************************************/ |
29 | | #include "mem.h" /* unaligned access routines */ |
30 | | #include "compiler.h" /* UNLIKELY() */ |
31 | | #include "debug.h" /* assert(), DEBUGLOG(), RAWLOG() */ |
32 | | #include "error_private.h" /* error codes and messages */ |
33 | | #include "bits.h" /* ZSTD_highbit32 */ |
34 | | |
35 | | |
36 | | /*========================================= |
37 | | * Target specific |
38 | | =========================================*/ |
39 | | #ifndef ZSTD_NO_INTRINSICS |
40 | | # if (defined(__BMI__) || defined(__BMI2__)) && defined(__GNUC__) |
41 | | # include <immintrin.h> /* support for bextr (experimental)/bzhi */ |
42 | | # elif defined(__ICCARM__) |
43 | | # include <intrinsics.h> |
44 | | # endif |
45 | | #endif |
46 | | |
47 | 0 | #define STREAM_ACCUMULATOR_MIN_32 25 |
48 | 0 | #define STREAM_ACCUMULATOR_MIN_64 57 |
49 | 0 | #define STREAM_ACCUMULATOR_MIN ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64)) |
50 | | |
51 | | |
52 | | /*-****************************************** |
53 | | * bitStream encoding API (write forward) |
54 | | ********************************************/ |
55 | | /* bitStream can mix input from multiple sources. |
56 | | * A critical property of these streams is that they encode and decode in **reverse** direction. |
57 | | * So the first bit sequence you add will be the last to be read, like a LIFO stack. |
58 | | */ |
59 | | typedef struct { |
60 | | size_t bitContainer; |
61 | | unsigned bitPos; |
62 | | char* startPtr; |
63 | | char* ptr; |
64 | | char* endPtr; |
65 | | } BIT_CStream_t; |
66 | | |
67 | | MEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC, void* dstBuffer, size_t dstCapacity); |
68 | | MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits); |
69 | | MEM_STATIC void BIT_flushBits(BIT_CStream_t* bitC); |
70 | | MEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC); |
71 | | |
72 | | /* Start with initCStream, providing the size of buffer to write into. |
73 | | * bitStream will never write outside of this buffer. |
74 | | * `dstCapacity` must be >= sizeof(bitD->bitContainer), otherwise @return will be an error code. |
75 | | * |
76 | | * bits are first added to a local register. |
77 | | * Local register is size_t, hence 64-bits on 64-bits systems, or 32-bits on 32-bits systems. |
78 | | * Writing data into memory is an explicit operation, performed by the flushBits function. |
79 | | * Hence keep track how many bits are potentially stored into local register to avoid register overflow. |
80 | | * After a flushBits, a maximum of 7 bits might still be stored into local register. |
81 | | * |
82 | | * Avoid storing elements of more than 24 bits if you want compatibility with 32-bits bitstream readers. |
83 | | * |
84 | | * Last operation is to close the bitStream. |
85 | | * The function returns the final size of CStream in bytes. |
86 | | * If data couldn't fit into `dstBuffer`, it will return a 0 ( == not storable) |
87 | | */ |
88 | | |
89 | | |
90 | | /*-******************************************** |
91 | | * bitStream decoding API (read backward) |
92 | | **********************************************/ |
93 | | typedef struct { |
94 | | size_t bitContainer; |
95 | | unsigned bitsConsumed; |
96 | | const char* ptr; |
97 | | const char* start; |
98 | | const char* limitPtr; |
99 | | } BIT_DStream_t; |
100 | | |
101 | | typedef enum { BIT_DStream_unfinished = 0, |
102 | | BIT_DStream_endOfBuffer = 1, |
103 | | BIT_DStream_completed = 2, |
104 | | BIT_DStream_overflow = 3 } BIT_DStream_status; /* result of BIT_reloadDStream() */ |
105 | | /* 1,2,4,8 would be better for bitmap combinations, but slows down performance a bit ... :( */ |
106 | | |
107 | | MEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize); |
108 | | MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits); |
109 | | MEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD); |
110 | | MEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* bitD); |
111 | | |
112 | | |
113 | | /* Start by invoking BIT_initDStream(). |
114 | | * A chunk of the bitStream is then stored into a local register. |
115 | | * Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t). |
116 | | * You can then retrieve bitFields stored into the local register, **in reverse order**. |
117 | | * Local register is explicitly reloaded from memory by the BIT_reloadDStream() method. |
118 | | * A reload guarantee a minimum of ((8*sizeof(bitD->bitContainer))-7) bits when its result is BIT_DStream_unfinished. |
119 | | * Otherwise, it can be less than that, so proceed accordingly. |
120 | | * Checking if DStream has reached its end can be performed with BIT_endOfDStream(). |
121 | | */ |
122 | | |
123 | | |
124 | | /*-**************************************** |
125 | | * unsafe API |
126 | | ******************************************/ |
127 | | MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits); |
128 | | /* faster, but works only if value is "clean", meaning all high bits above nbBits are 0 */ |
129 | | |
130 | | MEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC); |
131 | | /* unsafe version; does not check buffer overflow */ |
132 | | |
133 | | MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits); |
134 | | /* faster, but works only if nbBits >= 1 */ |
135 | | |
136 | | /*===== Local Constants =====*/ |
137 | | static const unsigned BIT_mask[] = { |
138 | | 0, 1, 3, 7, 0xF, 0x1F, |
139 | | 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, |
140 | | 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0x1FFFF, |
141 | | 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF, |
142 | | 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF, |
143 | | 0x3FFFFFFF, 0x7FFFFFFF}; /* up to 31 bits */ |
144 | | #define BIT_MASK_SIZE (sizeof(BIT_mask) / sizeof(BIT_mask[0])) |
145 | | |
146 | | /*-************************************************************** |
147 | | * bitStream encoding |
148 | | ****************************************************************/ |
149 | | /*! BIT_initCStream() : |
150 | | * `dstCapacity` must be > sizeof(size_t) |
151 | | * @return : 0 if success, |
152 | | * otherwise an error code (can be tested using ERR_isError()) */ |
153 | | MEM_STATIC size_t BIT_initCStream(BIT_CStream_t* bitC, |
154 | | void* startPtr, size_t dstCapacity) |
155 | 0 | { |
156 | 0 | bitC->bitContainer = 0; |
157 | 0 | bitC->bitPos = 0; |
158 | 0 | bitC->startPtr = (char*)startPtr; |
159 | 0 | bitC->ptr = bitC->startPtr; |
160 | 0 | bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer); |
161 | 0 | if (dstCapacity <= sizeof(bitC->bitContainer)) return ERROR(dstSize_tooSmall); |
162 | 0 | return 0; |
163 | 0 | } Unexecuted instantiation: entropy_common.c:BIT_initCStream Unexecuted instantiation: fse_decompress.c:BIT_initCStream Unexecuted instantiation: zstd_common.c:BIT_initCStream Unexecuted instantiation: fse_compress.c:BIT_initCStream Unexecuted instantiation: huf_compress.c:BIT_initCStream Unexecuted instantiation: zstd_compress.c:BIT_initCStream Unexecuted instantiation: zstd_compress_literals.c:BIT_initCStream Unexecuted instantiation: zstd_compress_sequences.c:BIT_initCStream Unexecuted instantiation: zstd_compress_superblock.c:BIT_initCStream Unexecuted instantiation: zstd_double_fast.c:BIT_initCStream Unexecuted instantiation: zstd_fast.c:BIT_initCStream Unexecuted instantiation: zstd_lazy.c:BIT_initCStream Unexecuted instantiation: zstd_ldm.c:BIT_initCStream Unexecuted instantiation: zstd_opt.c:BIT_initCStream Unexecuted instantiation: zstdmt_compress.c:BIT_initCStream Unexecuted instantiation: huf_decompress.c:BIT_initCStream Unexecuted instantiation: zstd_ddict.c:BIT_initCStream Unexecuted instantiation: zstd_decompress.c:BIT_initCStream Unexecuted instantiation: zstd_decompress_block.c:BIT_initCStream Unexecuted instantiation: cover.c:BIT_initCStream Unexecuted instantiation: fastcover.c:BIT_initCStream Unexecuted instantiation: zdict.c:BIT_initCStream |
164 | | |
165 | | MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits) |
166 | 0 | { |
167 | 0 | #if defined(STATIC_BMI2) && STATIC_BMI2 == 1 && !defined(ZSTD_NO_INTRINSICS) |
168 | 0 | return _bzhi_u64(bitContainer, nbBits); |
169 | | #else |
170 | | assert(nbBits < BIT_MASK_SIZE); |
171 | | return bitContainer & BIT_mask[nbBits]; |
172 | | #endif |
173 | 0 | } Unexecuted instantiation: entropy_common.c:BIT_getLowerBits Unexecuted instantiation: fse_decompress.c:BIT_getLowerBits Unexecuted instantiation: zstd_common.c:BIT_getLowerBits Unexecuted instantiation: fse_compress.c:BIT_getLowerBits Unexecuted instantiation: huf_compress.c:BIT_getLowerBits Unexecuted instantiation: zstd_compress.c:BIT_getLowerBits Unexecuted instantiation: zstd_compress_literals.c:BIT_getLowerBits Unexecuted instantiation: zstd_compress_sequences.c:BIT_getLowerBits Unexecuted instantiation: zstd_compress_superblock.c:BIT_getLowerBits Unexecuted instantiation: zstd_double_fast.c:BIT_getLowerBits Unexecuted instantiation: zstd_fast.c:BIT_getLowerBits Unexecuted instantiation: zstd_lazy.c:BIT_getLowerBits Unexecuted instantiation: zstd_ldm.c:BIT_getLowerBits Unexecuted instantiation: zstd_opt.c:BIT_getLowerBits Unexecuted instantiation: zstdmt_compress.c:BIT_getLowerBits Unexecuted instantiation: huf_decompress.c:BIT_getLowerBits Unexecuted instantiation: zstd_ddict.c:BIT_getLowerBits Unexecuted instantiation: zstd_decompress.c:BIT_getLowerBits Unexecuted instantiation: zstd_decompress_block.c:BIT_getLowerBits Unexecuted instantiation: cover.c:BIT_getLowerBits Unexecuted instantiation: fastcover.c:BIT_getLowerBits Unexecuted instantiation: zdict.c:BIT_getLowerBits |
174 | | |
175 | | /*! BIT_addBits() : |
176 | | * can add up to 31 bits into `bitC`. |
177 | | * Note : does not check for register overflow ! */ |
178 | | MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC, |
179 | | size_t value, unsigned nbBits) |
180 | 0 | { |
181 | 0 | DEBUG_STATIC_ASSERT(BIT_MASK_SIZE == 32); |
182 | 0 | assert(nbBits < BIT_MASK_SIZE); |
183 | 0 | assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); |
184 | 0 | bitC->bitContainer |= BIT_getLowerBits(value, nbBits) << bitC->bitPos; |
185 | 0 | bitC->bitPos += nbBits; |
186 | 0 | } Unexecuted instantiation: entropy_common.c:BIT_addBits Unexecuted instantiation: fse_decompress.c:BIT_addBits Unexecuted instantiation: zstd_common.c:BIT_addBits Unexecuted instantiation: fse_compress.c:BIT_addBits Unexecuted instantiation: huf_compress.c:BIT_addBits Unexecuted instantiation: zstd_compress.c:BIT_addBits Unexecuted instantiation: zstd_compress_literals.c:BIT_addBits Unexecuted instantiation: zstd_compress_sequences.c:BIT_addBits Unexecuted instantiation: zstd_compress_superblock.c:BIT_addBits Unexecuted instantiation: zstd_double_fast.c:BIT_addBits Unexecuted instantiation: zstd_fast.c:BIT_addBits Unexecuted instantiation: zstd_lazy.c:BIT_addBits Unexecuted instantiation: zstd_ldm.c:BIT_addBits Unexecuted instantiation: zstd_opt.c:BIT_addBits Unexecuted instantiation: zstdmt_compress.c:BIT_addBits Unexecuted instantiation: huf_decompress.c:BIT_addBits Unexecuted instantiation: zstd_ddict.c:BIT_addBits Unexecuted instantiation: zstd_decompress.c:BIT_addBits Unexecuted instantiation: zstd_decompress_block.c:BIT_addBits Unexecuted instantiation: cover.c:BIT_addBits Unexecuted instantiation: fastcover.c:BIT_addBits Unexecuted instantiation: zdict.c:BIT_addBits |
187 | | |
188 | | /*! BIT_addBitsFast() : |
189 | | * works only if `value` is _clean_, |
190 | | * meaning all high bits above nbBits are 0 */ |
191 | | MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, |
192 | | size_t value, unsigned nbBits) |
193 | 0 | { |
194 | 0 | assert((value>>nbBits) == 0); |
195 | 0 | assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); |
196 | 0 | bitC->bitContainer |= value << bitC->bitPos; |
197 | 0 | bitC->bitPos += nbBits; |
198 | 0 | } Unexecuted instantiation: entropy_common.c:BIT_addBitsFast Unexecuted instantiation: fse_decompress.c:BIT_addBitsFast Unexecuted instantiation: zstd_common.c:BIT_addBitsFast Unexecuted instantiation: fse_compress.c:BIT_addBitsFast Unexecuted instantiation: huf_compress.c:BIT_addBitsFast Unexecuted instantiation: zstd_compress.c:BIT_addBitsFast Unexecuted instantiation: zstd_compress_literals.c:BIT_addBitsFast Unexecuted instantiation: zstd_compress_sequences.c:BIT_addBitsFast Unexecuted instantiation: zstd_compress_superblock.c:BIT_addBitsFast Unexecuted instantiation: zstd_double_fast.c:BIT_addBitsFast Unexecuted instantiation: zstd_fast.c:BIT_addBitsFast Unexecuted instantiation: zstd_lazy.c:BIT_addBitsFast Unexecuted instantiation: zstd_ldm.c:BIT_addBitsFast Unexecuted instantiation: zstd_opt.c:BIT_addBitsFast Unexecuted instantiation: zstdmt_compress.c:BIT_addBitsFast Unexecuted instantiation: huf_decompress.c:BIT_addBitsFast Unexecuted instantiation: zstd_ddict.c:BIT_addBitsFast Unexecuted instantiation: zstd_decompress.c:BIT_addBitsFast Unexecuted instantiation: zstd_decompress_block.c:BIT_addBitsFast Unexecuted instantiation: cover.c:BIT_addBitsFast Unexecuted instantiation: fastcover.c:BIT_addBitsFast Unexecuted instantiation: zdict.c:BIT_addBitsFast |
199 | | |
200 | | /*! BIT_flushBitsFast() : |
201 | | * assumption : bitContainer has not overflowed |
202 | | * unsafe version; does not check buffer overflow */ |
203 | | MEM_STATIC void BIT_flushBitsFast(BIT_CStream_t* bitC) |
204 | 0 | { |
205 | 0 | size_t const nbBytes = bitC->bitPos >> 3; |
206 | 0 | assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8); |
207 | 0 | assert(bitC->ptr <= bitC->endPtr); |
208 | 0 | MEM_writeLEST(bitC->ptr, bitC->bitContainer); |
209 | 0 | bitC->ptr += nbBytes; |
210 | 0 | bitC->bitPos &= 7; |
211 | 0 | bitC->bitContainer >>= nbBytes*8; |
212 | 0 | } Unexecuted instantiation: entropy_common.c:BIT_flushBitsFast Unexecuted instantiation: fse_decompress.c:BIT_flushBitsFast Unexecuted instantiation: zstd_common.c:BIT_flushBitsFast Unexecuted instantiation: fse_compress.c:BIT_flushBitsFast Unexecuted instantiation: huf_compress.c:BIT_flushBitsFast Unexecuted instantiation: zstd_compress.c:BIT_flushBitsFast Unexecuted instantiation: zstd_compress_literals.c:BIT_flushBitsFast Unexecuted instantiation: zstd_compress_sequences.c:BIT_flushBitsFast Unexecuted instantiation: zstd_compress_superblock.c:BIT_flushBitsFast Unexecuted instantiation: zstd_double_fast.c:BIT_flushBitsFast Unexecuted instantiation: zstd_fast.c:BIT_flushBitsFast Unexecuted instantiation: zstd_lazy.c:BIT_flushBitsFast Unexecuted instantiation: zstd_ldm.c:BIT_flushBitsFast Unexecuted instantiation: zstd_opt.c:BIT_flushBitsFast Unexecuted instantiation: zstdmt_compress.c:BIT_flushBitsFast Unexecuted instantiation: huf_decompress.c:BIT_flushBitsFast Unexecuted instantiation: zstd_ddict.c:BIT_flushBitsFast Unexecuted instantiation: zstd_decompress.c:BIT_flushBitsFast Unexecuted instantiation: zstd_decompress_block.c:BIT_flushBitsFast Unexecuted instantiation: cover.c:BIT_flushBitsFast Unexecuted instantiation: fastcover.c:BIT_flushBitsFast Unexecuted instantiation: zdict.c:BIT_flushBitsFast |
213 | | |
214 | | /*! BIT_flushBits() : |
215 | | * assumption : bitContainer has not overflowed |
216 | | * safe version; check for buffer overflow, and prevents it. |
217 | | * note : does not signal buffer overflow. |
218 | | * overflow will be revealed later on using BIT_closeCStream() */ |
219 | | MEM_STATIC void BIT_flushBits(BIT_CStream_t* bitC) |
220 | 0 | { |
221 | 0 | size_t const nbBytes = bitC->bitPos >> 3; |
222 | 0 | assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8); |
223 | 0 | assert(bitC->ptr <= bitC->endPtr); |
224 | 0 | MEM_writeLEST(bitC->ptr, bitC->bitContainer); |
225 | 0 | bitC->ptr += nbBytes; |
226 | 0 | if (bitC->ptr > bitC->endPtr) bitC->ptr = bitC->endPtr; |
227 | 0 | bitC->bitPos &= 7; |
228 | 0 | bitC->bitContainer >>= nbBytes*8; |
229 | 0 | } Unexecuted instantiation: entropy_common.c:BIT_flushBits Unexecuted instantiation: fse_decompress.c:BIT_flushBits Unexecuted instantiation: zstd_common.c:BIT_flushBits Unexecuted instantiation: fse_compress.c:BIT_flushBits Unexecuted instantiation: huf_compress.c:BIT_flushBits Unexecuted instantiation: zstd_compress.c:BIT_flushBits Unexecuted instantiation: zstd_compress_literals.c:BIT_flushBits Unexecuted instantiation: zstd_compress_sequences.c:BIT_flushBits Unexecuted instantiation: zstd_compress_superblock.c:BIT_flushBits Unexecuted instantiation: zstd_double_fast.c:BIT_flushBits Unexecuted instantiation: zstd_fast.c:BIT_flushBits Unexecuted instantiation: zstd_lazy.c:BIT_flushBits Unexecuted instantiation: zstd_ldm.c:BIT_flushBits Unexecuted instantiation: zstd_opt.c:BIT_flushBits Unexecuted instantiation: zstdmt_compress.c:BIT_flushBits Unexecuted instantiation: huf_decompress.c:BIT_flushBits Unexecuted instantiation: zstd_ddict.c:BIT_flushBits Unexecuted instantiation: zstd_decompress.c:BIT_flushBits Unexecuted instantiation: zstd_decompress_block.c:BIT_flushBits Unexecuted instantiation: cover.c:BIT_flushBits Unexecuted instantiation: fastcover.c:BIT_flushBits Unexecuted instantiation: zdict.c:BIT_flushBits |
230 | | |
231 | | /*! BIT_closeCStream() : |
232 | | * @return : size of CStream, in bytes, |
233 | | * or 0 if it could not fit into dstBuffer */ |
234 | | MEM_STATIC size_t BIT_closeCStream(BIT_CStream_t* bitC) |
235 | 0 | { |
236 | 0 | BIT_addBitsFast(bitC, 1, 1); /* endMark */ |
237 | 0 | BIT_flushBits(bitC); |
238 | 0 | if (bitC->ptr >= bitC->endPtr) return 0; /* overflow detected */ |
239 | 0 | return (bitC->ptr - bitC->startPtr) + (bitC->bitPos > 0); |
240 | 0 | } Unexecuted instantiation: entropy_common.c:BIT_closeCStream Unexecuted instantiation: fse_decompress.c:BIT_closeCStream Unexecuted instantiation: zstd_common.c:BIT_closeCStream Unexecuted instantiation: fse_compress.c:BIT_closeCStream Unexecuted instantiation: huf_compress.c:BIT_closeCStream Unexecuted instantiation: zstd_compress.c:BIT_closeCStream Unexecuted instantiation: zstd_compress_literals.c:BIT_closeCStream Unexecuted instantiation: zstd_compress_sequences.c:BIT_closeCStream Unexecuted instantiation: zstd_compress_superblock.c:BIT_closeCStream Unexecuted instantiation: zstd_double_fast.c:BIT_closeCStream Unexecuted instantiation: zstd_fast.c:BIT_closeCStream Unexecuted instantiation: zstd_lazy.c:BIT_closeCStream Unexecuted instantiation: zstd_ldm.c:BIT_closeCStream Unexecuted instantiation: zstd_opt.c:BIT_closeCStream Unexecuted instantiation: zstdmt_compress.c:BIT_closeCStream Unexecuted instantiation: huf_decompress.c:BIT_closeCStream Unexecuted instantiation: zstd_ddict.c:BIT_closeCStream Unexecuted instantiation: zstd_decompress.c:BIT_closeCStream Unexecuted instantiation: zstd_decompress_block.c:BIT_closeCStream Unexecuted instantiation: cover.c:BIT_closeCStream Unexecuted instantiation: fastcover.c:BIT_closeCStream Unexecuted instantiation: zdict.c:BIT_closeCStream |
241 | | |
242 | | |
243 | | /*-******************************************************** |
244 | | * bitStream decoding |
245 | | **********************************************************/ |
246 | | /*! BIT_initDStream() : |
247 | | * Initialize a BIT_DStream_t. |
248 | | * `bitD` : a pointer to an already allocated BIT_DStream_t structure. |
249 | | * `srcSize` must be the *exact* size of the bitStream, in bytes. |
250 | | * @return : size of stream (== srcSize), or an errorCode if a problem is detected |
251 | | */ |
252 | | MEM_STATIC size_t BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize) |
253 | 91 | { |
254 | 91 | if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); } |
255 | | |
256 | 89 | bitD->start = (const char*)srcBuffer; |
257 | 89 | bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer); |
258 | | |
259 | 89 | if (srcSize >= sizeof(bitD->bitContainer)) { /* normal case */ |
260 | 27 | bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer); |
261 | 27 | bitD->bitContainer = MEM_readLEST(bitD->ptr); |
262 | 27 | { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; |
263 | 27 | bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; /* ensures bitsConsumed is always set */ |
264 | 27 | if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ } |
265 | 62 | } else { |
266 | 62 | bitD->ptr = bitD->start; |
267 | 62 | bitD->bitContainer = *(const BYTE*)(bitD->start); |
268 | 62 | switch(srcSize) |
269 | 62 | { |
270 | 11 | case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16); |
271 | 11 | ZSTD_FALLTHROUGH; |
272 | | |
273 | 20 | case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24); |
274 | 20 | ZSTD_FALLTHROUGH; |
275 | | |
276 | 25 | case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32); |
277 | 25 | ZSTD_FALLTHROUGH; |
278 | | |
279 | 32 | case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; |
280 | 32 | ZSTD_FALLTHROUGH; |
281 | | |
282 | 53 | case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; |
283 | 53 | ZSTD_FALLTHROUGH; |
284 | | |
285 | 60 | case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8; |
286 | 60 | ZSTD_FALLTHROUGH; |
287 | | |
288 | 62 | default: break; |
289 | 62 | } |
290 | 62 | { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; |
291 | 62 | bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; |
292 | 62 | if (lastByte == 0) return ERROR(corruption_detected); /* endMark not present */ |
293 | 62 | } |
294 | 58 | bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8; |
295 | 58 | } |
296 | | |
297 | 82 | return srcSize; |
298 | 89 | } Unexecuted instantiation: entropy_common.c:BIT_initDStream fse_decompress.c:BIT_initDStream Line | Count | Source | 253 | 38 | { | 254 | 38 | if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); } | 255 | | | 256 | 37 | bitD->start = (const char*)srcBuffer; | 257 | 37 | bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer); | 258 | | | 259 | 37 | if (srcSize >= sizeof(bitD->bitContainer)) { /* normal case */ | 260 | 11 | bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer); | 261 | 11 | bitD->bitContainer = MEM_readLEST(bitD->ptr); | 262 | 11 | { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; | 263 | 11 | bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; /* ensures bitsConsumed is always set */ | 264 | 11 | if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ } | 265 | 26 | } else { | 266 | 26 | bitD->ptr = bitD->start; | 267 | 26 | bitD->bitContainer = *(const BYTE*)(bitD->start); | 268 | 26 | switch(srcSize) | 269 | 26 | { | 270 | 9 | case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16); | 271 | 9 | ZSTD_FALLTHROUGH; | 272 | | | 273 | 14 | case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24); | 274 | 14 | ZSTD_FALLTHROUGH; | 275 | | | 276 | 16 | case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32); | 277 | 16 | ZSTD_FALLTHROUGH; | 278 | | | 279 | 18 | case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; | 280 | 18 | ZSTD_FALLTHROUGH; | 281 | | | 282 | 23 | case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; | 283 | 23 | ZSTD_FALLTHROUGH; | 284 | | | 285 | 24 | case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8; | 286 | 24 | ZSTD_FALLTHROUGH; | 287 | | | 288 | 26 | default: break; | 289 | 26 | } | 290 | 26 | { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; | 291 | 26 | bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; | 292 | 26 | if (lastByte == 0) return ERROR(corruption_detected); /* endMark not present */ | 293 | 26 | } | 294 | 23 | bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8; | 295 | 23 | } | 296 | | | 297 | 33 | return srcSize; | 298 | 37 | } |
Unexecuted instantiation: zstd_common.c:BIT_initDStream Unexecuted instantiation: fse_compress.c:BIT_initDStream Unexecuted instantiation: huf_compress.c:BIT_initDStream Unexecuted instantiation: zstd_compress.c:BIT_initDStream Unexecuted instantiation: zstd_compress_literals.c:BIT_initDStream Unexecuted instantiation: zstd_compress_sequences.c:BIT_initDStream Unexecuted instantiation: zstd_compress_superblock.c:BIT_initDStream Unexecuted instantiation: zstd_double_fast.c:BIT_initDStream Unexecuted instantiation: zstd_fast.c:BIT_initDStream Unexecuted instantiation: zstd_lazy.c:BIT_initDStream Unexecuted instantiation: zstd_ldm.c:BIT_initDStream Unexecuted instantiation: zstd_opt.c:BIT_initDStream Unexecuted instantiation: zstdmt_compress.c:BIT_initDStream huf_decompress.c:BIT_initDStream Line | Count | Source | 253 | 9 | { | 254 | 9 | if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); } | 255 | | | 256 | 9 | bitD->start = (const char*)srcBuffer; | 257 | 9 | bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer); | 258 | | | 259 | 9 | if (srcSize >= sizeof(bitD->bitContainer)) { /* normal case */ | 260 | 8 | bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer); | 261 | 8 | bitD->bitContainer = MEM_readLEST(bitD->ptr); | 262 | 8 | { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; | 263 | 8 | bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; /* ensures bitsConsumed is always set */ | 264 | 8 | if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ } | 265 | 8 | } else { | 266 | 1 | bitD->ptr = bitD->start; | 267 | 1 | bitD->bitContainer = *(const BYTE*)(bitD->start); | 268 | 1 | switch(srcSize) | 269 | 1 | { | 270 | 0 | case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16); | 271 | 0 | ZSTD_FALLTHROUGH; | 272 | |
| 273 | 1 | case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24); | 274 | 1 | ZSTD_FALLTHROUGH; | 275 | | | 276 | 1 | case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32); | 277 | 1 | ZSTD_FALLTHROUGH; | 278 | | | 279 | 1 | case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; | 280 | 1 | ZSTD_FALLTHROUGH; | 281 | | | 282 | 1 | case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; | 283 | 1 | ZSTD_FALLTHROUGH; | 284 | | | 285 | 1 | case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8; | 286 | 1 | ZSTD_FALLTHROUGH; | 287 | | | 288 | 1 | default: break; | 289 | 1 | } | 290 | 1 | { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; | 291 | 1 | bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; | 292 | 1 | if (lastByte == 0) return ERROR(corruption_detected); /* endMark not present */ | 293 | 1 | } | 294 | 1 | bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8; | 295 | 1 | } | 296 | | | 297 | 8 | return srcSize; | 298 | 9 | } |
Unexecuted instantiation: zstd_ddict.c:BIT_initDStream Unexecuted instantiation: zstd_decompress.c:BIT_initDStream zstd_decompress_block.c:BIT_initDStream Line | Count | Source | 253 | 44 | { | 254 | 44 | if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); } | 255 | | | 256 | 43 | bitD->start = (const char*)srcBuffer; | 257 | 43 | bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer); | 258 | | | 259 | 43 | if (srcSize >= sizeof(bitD->bitContainer)) { /* normal case */ | 260 | 8 | bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer); | 261 | 8 | bitD->bitContainer = MEM_readLEST(bitD->ptr); | 262 | 8 | { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; | 263 | 8 | bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; /* ensures bitsConsumed is always set */ | 264 | 8 | if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ } | 265 | 35 | } else { | 266 | 35 | bitD->ptr = bitD->start; | 267 | 35 | bitD->bitContainer = *(const BYTE*)(bitD->start); | 268 | 35 | switch(srcSize) | 269 | 35 | { | 270 | 2 | case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16); | 271 | 2 | ZSTD_FALLTHROUGH; | 272 | | | 273 | 5 | case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24); | 274 | 5 | ZSTD_FALLTHROUGH; | 275 | | | 276 | 8 | case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32); | 277 | 8 | ZSTD_FALLTHROUGH; | 278 | | | 279 | 13 | case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; | 280 | 13 | ZSTD_FALLTHROUGH; | 281 | | | 282 | 29 | case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; | 283 | 29 | ZSTD_FALLTHROUGH; | 284 | | | 285 | 35 | case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8; | 286 | 35 | ZSTD_FALLTHROUGH; | 287 | | | 288 | 35 | default: break; | 289 | 35 | } | 290 | 35 | { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1]; | 291 | 35 | bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0; | 292 | 35 | if (lastByte == 0) return ERROR(corruption_detected); /* endMark not present */ | 293 | 35 | } | 294 | 34 | bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8; | 295 | 34 | } | 296 | | | 297 | 41 | return srcSize; | 298 | 43 | } |
Unexecuted instantiation: cover.c:BIT_initDStream Unexecuted instantiation: fastcover.c:BIT_initDStream Unexecuted instantiation: zdict.c:BIT_initDStream |
299 | | |
300 | | MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getUpperBits(size_t bitContainer, U32 const start) |
301 | 0 | { |
302 | 0 | return bitContainer >> start; |
303 | 0 | } Unexecuted instantiation: entropy_common.c:BIT_getUpperBits Unexecuted instantiation: fse_decompress.c:BIT_getUpperBits Unexecuted instantiation: zstd_common.c:BIT_getUpperBits Unexecuted instantiation: fse_compress.c:BIT_getUpperBits Unexecuted instantiation: huf_compress.c:BIT_getUpperBits Unexecuted instantiation: zstd_compress.c:BIT_getUpperBits Unexecuted instantiation: zstd_compress_literals.c:BIT_getUpperBits Unexecuted instantiation: zstd_compress_sequences.c:BIT_getUpperBits Unexecuted instantiation: zstd_compress_superblock.c:BIT_getUpperBits Unexecuted instantiation: zstd_double_fast.c:BIT_getUpperBits Unexecuted instantiation: zstd_fast.c:BIT_getUpperBits Unexecuted instantiation: zstd_lazy.c:BIT_getUpperBits Unexecuted instantiation: zstd_ldm.c:BIT_getUpperBits Unexecuted instantiation: zstd_opt.c:BIT_getUpperBits Unexecuted instantiation: zstdmt_compress.c:BIT_getUpperBits Unexecuted instantiation: huf_decompress.c:BIT_getUpperBits Unexecuted instantiation: zstd_ddict.c:BIT_getUpperBits Unexecuted instantiation: zstd_decompress.c:BIT_getUpperBits Unexecuted instantiation: zstd_decompress_block.c:BIT_getUpperBits Unexecuted instantiation: cover.c:BIT_getUpperBits Unexecuted instantiation: fastcover.c:BIT_getUpperBits Unexecuted instantiation: zdict.c:BIT_getUpperBits |
304 | | |
305 | | MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits) |
306 | 2.38k | { |
307 | 2.38k | U32 const regMask = sizeof(bitContainer)*8 - 1; |
308 | | /* if start > regMask, bitstream is corrupted, and result is undefined */ |
309 | 2.38k | assert(nbBits < BIT_MASK_SIZE); |
310 | | /* x86 transform & ((1 << nbBits) - 1) to bzhi instruction, it is better |
311 | | * than accessing memory. When bmi2 instruction is not present, we consider |
312 | | * such cpus old (pre-Haswell, 2013) and their performance is not of that |
313 | | * importance. |
314 | | */ |
315 | 2.38k | #if defined(__x86_64__) || defined(_M_X86) |
316 | 2.38k | return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1); |
317 | | #else |
318 | | return (bitContainer >> (start & regMask)) & BIT_mask[nbBits]; |
319 | | #endif |
320 | 2.38k | } Unexecuted instantiation: entropy_common.c:BIT_getMiddleBits fse_decompress.c:BIT_getMiddleBits Line | Count | Source | 306 | 1.42k | { | 307 | 1.42k | U32 const regMask = sizeof(bitContainer)*8 - 1; | 308 | | /* if start > regMask, bitstream is corrupted, and result is undefined */ | 309 | 1.42k | assert(nbBits < BIT_MASK_SIZE); | 310 | | /* x86 transform & ((1 << nbBits) - 1) to bzhi instruction, it is better | 311 | | * than accessing memory. When bmi2 instruction is not present, we consider | 312 | | * such cpus old (pre-Haswell, 2013) and their performance is not of that | 313 | | * importance. | 314 | | */ | 315 | 1.42k | #if defined(__x86_64__) || defined(_M_X86) | 316 | 1.42k | return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1); | 317 | | #else | 318 | | return (bitContainer >> (start & regMask)) & BIT_mask[nbBits]; | 319 | | #endif | 320 | 1.42k | } |
Unexecuted instantiation: zstd_common.c:BIT_getMiddleBits Unexecuted instantiation: fse_compress.c:BIT_getMiddleBits Unexecuted instantiation: huf_compress.c:BIT_getMiddleBits Unexecuted instantiation: zstd_compress.c:BIT_getMiddleBits Unexecuted instantiation: zstd_compress_literals.c:BIT_getMiddleBits Unexecuted instantiation: zstd_compress_sequences.c:BIT_getMiddleBits Unexecuted instantiation: zstd_compress_superblock.c:BIT_getMiddleBits Unexecuted instantiation: zstd_double_fast.c:BIT_getMiddleBits Unexecuted instantiation: zstd_fast.c:BIT_getMiddleBits Unexecuted instantiation: zstd_lazy.c:BIT_getMiddleBits Unexecuted instantiation: zstd_ldm.c:BIT_getMiddleBits Unexecuted instantiation: zstd_opt.c:BIT_getMiddleBits Unexecuted instantiation: zstdmt_compress.c:BIT_getMiddleBits Unexecuted instantiation: huf_decompress.c:BIT_getMiddleBits Unexecuted instantiation: zstd_ddict.c:BIT_getMiddleBits Unexecuted instantiation: zstd_decompress.c:BIT_getMiddleBits zstd_decompress_block.c:BIT_getMiddleBits Line | Count | Source | 306 | 957 | { | 307 | 957 | U32 const regMask = sizeof(bitContainer)*8 - 1; | 308 | | /* if start > regMask, bitstream is corrupted, and result is undefined */ | 309 | 957 | assert(nbBits < BIT_MASK_SIZE); | 310 | | /* x86 transform & ((1 << nbBits) - 1) to bzhi instruction, it is better | 311 | | * than accessing memory. When bmi2 instruction is not present, we consider | 312 | | * such cpus old (pre-Haswell, 2013) and their performance is not of that | 313 | | * importance. | 314 | | */ | 315 | 957 | #if defined(__x86_64__) || defined(_M_X86) | 316 | 957 | return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1); | 317 | | #else | 318 | | return (bitContainer >> (start & regMask)) & BIT_mask[nbBits]; | 319 | | #endif | 320 | 957 | } |
Unexecuted instantiation: cover.c:BIT_getMiddleBits Unexecuted instantiation: fastcover.c:BIT_getMiddleBits Unexecuted instantiation: zdict.c:BIT_getMiddleBits |
321 | | |
322 | | /*! BIT_lookBits() : |
323 | | * Provides next n bits from local register. |
324 | | * local register is not modified. |
325 | | * On 32-bits, maxNbBits==24. |
326 | | * On 64-bits, maxNbBits==56. |
327 | | * @return : value extracted */ |
328 | | MEM_STATIC FORCE_INLINE_ATTR size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits) |
329 | 2.38k | { |
330 | | /* arbitrate between double-shift and shift+mask */ |
331 | 2.38k | #if 1 |
332 | | /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8, |
333 | | * bitstream is likely corrupted, and result is undefined */ |
334 | 2.38k | return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits); |
335 | | #else |
336 | | /* this code path is slower on my os-x laptop */ |
337 | | U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; |
338 | | return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask); |
339 | | #endif |
340 | 2.38k | } Unexecuted instantiation: entropy_common.c:BIT_lookBits fse_decompress.c:BIT_lookBits Line | Count | Source | 329 | 1.42k | { | 330 | | /* arbitrate between double-shift and shift+mask */ | 331 | 1.42k | #if 1 | 332 | | /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8, | 333 | | * bitstream is likely corrupted, and result is undefined */ | 334 | 1.42k | return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits); | 335 | | #else | 336 | | /* this code path is slower on my os-x laptop */ | 337 | | U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; | 338 | | return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask); | 339 | | #endif | 340 | 1.42k | } |
Unexecuted instantiation: zstd_common.c:BIT_lookBits Unexecuted instantiation: fse_compress.c:BIT_lookBits Unexecuted instantiation: huf_compress.c:BIT_lookBits Unexecuted instantiation: zstd_compress.c:BIT_lookBits Unexecuted instantiation: zstd_compress_literals.c:BIT_lookBits Unexecuted instantiation: zstd_compress_sequences.c:BIT_lookBits Unexecuted instantiation: zstd_compress_superblock.c:BIT_lookBits Unexecuted instantiation: zstd_double_fast.c:BIT_lookBits Unexecuted instantiation: zstd_fast.c:BIT_lookBits Unexecuted instantiation: zstd_lazy.c:BIT_lookBits Unexecuted instantiation: zstd_ldm.c:BIT_lookBits Unexecuted instantiation: zstd_opt.c:BIT_lookBits Unexecuted instantiation: zstdmt_compress.c:BIT_lookBits Unexecuted instantiation: huf_decompress.c:BIT_lookBits Unexecuted instantiation: zstd_ddict.c:BIT_lookBits Unexecuted instantiation: zstd_decompress.c:BIT_lookBits zstd_decompress_block.c:BIT_lookBits Line | Count | Source | 329 | 957 | { | 330 | | /* arbitrate between double-shift and shift+mask */ | 331 | 957 | #if 1 | 332 | | /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8, | 333 | | * bitstream is likely corrupted, and result is undefined */ | 334 | 957 | return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits); | 335 | | #else | 336 | | /* this code path is slower on my os-x laptop */ | 337 | | U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; | 338 | | return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask); | 339 | | #endif | 340 | 957 | } |
Unexecuted instantiation: cover.c:BIT_lookBits Unexecuted instantiation: fastcover.c:BIT_lookBits Unexecuted instantiation: zdict.c:BIT_lookBits |
341 | | |
342 | | /*! BIT_lookBitsFast() : |
343 | | * unsafe version; only works if nbBits >= 1 */ |
344 | | MEM_STATIC size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits) |
345 | 1.78k | { |
346 | 1.78k | U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; |
347 | 1.78k | assert(nbBits >= 1); |
348 | 1.78k | return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask); |
349 | 1.78k | } Unexecuted instantiation: entropy_common.c:BIT_lookBitsFast fse_decompress.c:BIT_lookBitsFast Line | Count | Source | 345 | 280 | { | 346 | 280 | U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; | 347 | 280 | assert(nbBits >= 1); | 348 | 280 | return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask); | 349 | 280 | } |
Unexecuted instantiation: zstd_common.c:BIT_lookBitsFast Unexecuted instantiation: fse_compress.c:BIT_lookBitsFast Unexecuted instantiation: huf_compress.c:BIT_lookBitsFast Unexecuted instantiation: zstd_compress.c:BIT_lookBitsFast Unexecuted instantiation: zstd_compress_literals.c:BIT_lookBitsFast Unexecuted instantiation: zstd_compress_sequences.c:BIT_lookBitsFast Unexecuted instantiation: zstd_compress_superblock.c:BIT_lookBitsFast Unexecuted instantiation: zstd_double_fast.c:BIT_lookBitsFast Unexecuted instantiation: zstd_fast.c:BIT_lookBitsFast Unexecuted instantiation: zstd_lazy.c:BIT_lookBitsFast Unexecuted instantiation: zstd_ldm.c:BIT_lookBitsFast Unexecuted instantiation: zstd_opt.c:BIT_lookBitsFast Unexecuted instantiation: zstdmt_compress.c:BIT_lookBitsFast huf_decompress.c:BIT_lookBitsFast Line | Count | Source | 345 | 1.14k | { | 346 | 1.14k | U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; | 347 | 1.14k | assert(nbBits >= 1); | 348 | 1.14k | return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask); | 349 | 1.14k | } |
Unexecuted instantiation: zstd_ddict.c:BIT_lookBitsFast Unexecuted instantiation: zstd_decompress.c:BIT_lookBitsFast zstd_decompress_block.c:BIT_lookBitsFast Line | Count | Source | 345 | 365 | { | 346 | 365 | U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; | 347 | 365 | assert(nbBits >= 1); | 348 | 365 | return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask); | 349 | 365 | } |
Unexecuted instantiation: cover.c:BIT_lookBitsFast Unexecuted instantiation: fastcover.c:BIT_lookBitsFast Unexecuted instantiation: zdict.c:BIT_lookBitsFast |
350 | | |
351 | | MEM_STATIC FORCE_INLINE_ATTR void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) |
352 | 4.17k | { |
353 | 4.17k | bitD->bitsConsumed += nbBits; |
354 | 4.17k | } Unexecuted instantiation: entropy_common.c:BIT_skipBits fse_decompress.c:BIT_skipBits Line | Count | Source | 352 | 1.70k | { | 353 | 1.70k | bitD->bitsConsumed += nbBits; | 354 | 1.70k | } |
Unexecuted instantiation: zstd_common.c:BIT_skipBits Unexecuted instantiation: fse_compress.c:BIT_skipBits Unexecuted instantiation: huf_compress.c:BIT_skipBits Unexecuted instantiation: zstd_compress.c:BIT_skipBits Unexecuted instantiation: zstd_compress_literals.c:BIT_skipBits Unexecuted instantiation: zstd_compress_sequences.c:BIT_skipBits Unexecuted instantiation: zstd_compress_superblock.c:BIT_skipBits Unexecuted instantiation: zstd_double_fast.c:BIT_skipBits Unexecuted instantiation: zstd_fast.c:BIT_skipBits Unexecuted instantiation: zstd_lazy.c:BIT_skipBits Unexecuted instantiation: zstd_ldm.c:BIT_skipBits Unexecuted instantiation: zstd_opt.c:BIT_skipBits Unexecuted instantiation: zstdmt_compress.c:BIT_skipBits huf_decompress.c:BIT_skipBits Line | Count | Source | 352 | 1.14k | { | 353 | 1.14k | bitD->bitsConsumed += nbBits; | 354 | 1.14k | } |
Unexecuted instantiation: zstd_ddict.c:BIT_skipBits Unexecuted instantiation: zstd_decompress.c:BIT_skipBits zstd_decompress_block.c:BIT_skipBits Line | Count | Source | 352 | 1.32k | { | 353 | 1.32k | bitD->bitsConsumed += nbBits; | 354 | 1.32k | } |
Unexecuted instantiation: cover.c:BIT_skipBits Unexecuted instantiation: fastcover.c:BIT_skipBits Unexecuted instantiation: zdict.c:BIT_skipBits |
355 | | |
356 | | /*! BIT_readBits() : |
357 | | * Read (consume) next n bits from local register and update. |
358 | | * Pay attention to not read more than nbBits contained into local register. |
359 | | * @return : extracted value. */ |
360 | | MEM_STATIC FORCE_INLINE_ATTR size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits) |
361 | 2.38k | { |
362 | 2.38k | size_t const value = BIT_lookBits(bitD, nbBits); |
363 | 2.38k | BIT_skipBits(bitD, nbBits); |
364 | 2.38k | return value; |
365 | 2.38k | } Unexecuted instantiation: entropy_common.c:BIT_readBits fse_decompress.c:BIT_readBits Line | Count | Source | 361 | 1.42k | { | 362 | 1.42k | size_t const value = BIT_lookBits(bitD, nbBits); | 363 | 1.42k | BIT_skipBits(bitD, nbBits); | 364 | 1.42k | return value; | 365 | 1.42k | } |
Unexecuted instantiation: zstd_common.c:BIT_readBits Unexecuted instantiation: fse_compress.c:BIT_readBits Unexecuted instantiation: huf_compress.c:BIT_readBits Unexecuted instantiation: zstd_compress.c:BIT_readBits Unexecuted instantiation: zstd_compress_literals.c:BIT_readBits Unexecuted instantiation: zstd_compress_sequences.c:BIT_readBits Unexecuted instantiation: zstd_compress_superblock.c:BIT_readBits Unexecuted instantiation: zstd_double_fast.c:BIT_readBits Unexecuted instantiation: zstd_fast.c:BIT_readBits Unexecuted instantiation: zstd_lazy.c:BIT_readBits Unexecuted instantiation: zstd_ldm.c:BIT_readBits Unexecuted instantiation: zstd_opt.c:BIT_readBits Unexecuted instantiation: zstdmt_compress.c:BIT_readBits Unexecuted instantiation: huf_decompress.c:BIT_readBits Unexecuted instantiation: zstd_ddict.c:BIT_readBits Unexecuted instantiation: zstd_decompress.c:BIT_readBits zstd_decompress_block.c:BIT_readBits Line | Count | Source | 361 | 957 | { | 362 | 957 | size_t const value = BIT_lookBits(bitD, nbBits); | 363 | 957 | BIT_skipBits(bitD, nbBits); | 364 | 957 | return value; | 365 | 957 | } |
Unexecuted instantiation: cover.c:BIT_readBits Unexecuted instantiation: fastcover.c:BIT_readBits Unexecuted instantiation: zdict.c:BIT_readBits |
366 | | |
367 | | /*! BIT_readBitsFast() : |
368 | | * unsafe version; only works if nbBits >= 1 */ |
369 | | MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits) |
370 | 645 | { |
371 | 645 | size_t const value = BIT_lookBitsFast(bitD, nbBits); |
372 | 645 | assert(nbBits >= 1); |
373 | 645 | BIT_skipBits(bitD, nbBits); |
374 | 645 | return value; |
375 | 645 | } Unexecuted instantiation: entropy_common.c:BIT_readBitsFast fse_decompress.c:BIT_readBitsFast Line | Count | Source | 370 | 280 | { | 371 | 280 | size_t const value = BIT_lookBitsFast(bitD, nbBits); | 372 | 280 | assert(nbBits >= 1); | 373 | 280 | BIT_skipBits(bitD, nbBits); | 374 | 280 | return value; | 375 | 280 | } |
Unexecuted instantiation: zstd_common.c:BIT_readBitsFast Unexecuted instantiation: fse_compress.c:BIT_readBitsFast Unexecuted instantiation: huf_compress.c:BIT_readBitsFast Unexecuted instantiation: zstd_compress.c:BIT_readBitsFast Unexecuted instantiation: zstd_compress_literals.c:BIT_readBitsFast Unexecuted instantiation: zstd_compress_sequences.c:BIT_readBitsFast Unexecuted instantiation: zstd_compress_superblock.c:BIT_readBitsFast Unexecuted instantiation: zstd_double_fast.c:BIT_readBitsFast Unexecuted instantiation: zstd_fast.c:BIT_readBitsFast Unexecuted instantiation: zstd_lazy.c:BIT_readBitsFast Unexecuted instantiation: zstd_ldm.c:BIT_readBitsFast Unexecuted instantiation: zstd_opt.c:BIT_readBitsFast Unexecuted instantiation: zstdmt_compress.c:BIT_readBitsFast Unexecuted instantiation: huf_decompress.c:BIT_readBitsFast Unexecuted instantiation: zstd_ddict.c:BIT_readBitsFast Unexecuted instantiation: zstd_decompress.c:BIT_readBitsFast zstd_decompress_block.c:BIT_readBitsFast Line | Count | Source | 370 | 365 | { | 371 | 365 | size_t const value = BIT_lookBitsFast(bitD, nbBits); | 372 | 365 | assert(nbBits >= 1); | 373 | 365 | BIT_skipBits(bitD, nbBits); | 374 | 365 | return value; | 375 | 365 | } |
Unexecuted instantiation: cover.c:BIT_readBitsFast Unexecuted instantiation: fastcover.c:BIT_readBitsFast Unexecuted instantiation: zdict.c:BIT_readBitsFast |
376 | | |
377 | | /*! BIT_reloadDStreamFast() : |
378 | | * Similar to BIT_reloadDStream(), but with two differences: |
379 | | * 1. bitsConsumed <= sizeof(bitD->bitContainer)*8 must hold! |
380 | | * 2. Returns BIT_DStream_overflow when bitD->ptr < bitD->limitPtr, at this |
381 | | * point you must use BIT_reloadDStream() to reload. |
382 | | */ |
383 | | MEM_STATIC BIT_DStream_status BIT_reloadDStreamFast(BIT_DStream_t* bitD) |
384 | 16 | { |
385 | 16 | if (UNLIKELY(bitD->ptr < bitD->limitPtr)) |
386 | 0 | return BIT_DStream_overflow; |
387 | 16 | assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8); |
388 | 16 | bitD->ptr -= bitD->bitsConsumed >> 3; |
389 | 16 | bitD->bitsConsumed &= 7; |
390 | 16 | bitD->bitContainer = MEM_readLEST(bitD->ptr); |
391 | 16 | return BIT_DStream_unfinished; |
392 | 16 | } Unexecuted instantiation: entropy_common.c:BIT_reloadDStreamFast Unexecuted instantiation: fse_decompress.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_common.c:BIT_reloadDStreamFast Unexecuted instantiation: fse_compress.c:BIT_reloadDStreamFast Unexecuted instantiation: huf_compress.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_compress.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_compress_literals.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_compress_sequences.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_compress_superblock.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_double_fast.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_fast.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_lazy.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_ldm.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_opt.c:BIT_reloadDStreamFast Unexecuted instantiation: zstdmt_compress.c:BIT_reloadDStreamFast Unexecuted instantiation: huf_decompress.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_ddict.c:BIT_reloadDStreamFast Unexecuted instantiation: zstd_decompress.c:BIT_reloadDStreamFast zstd_decompress_block.c:BIT_reloadDStreamFast Line | Count | Source | 384 | 16 | { | 385 | 16 | if (UNLIKELY(bitD->ptr < bitD->limitPtr)) | 386 | 0 | return BIT_DStream_overflow; | 387 | 16 | assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8); | 388 | 16 | bitD->ptr -= bitD->bitsConsumed >> 3; | 389 | 16 | bitD->bitsConsumed &= 7; | 390 | 16 | bitD->bitContainer = MEM_readLEST(bitD->ptr); | 391 | 16 | return BIT_DStream_unfinished; | 392 | 16 | } |
Unexecuted instantiation: cover.c:BIT_reloadDStreamFast Unexecuted instantiation: fastcover.c:BIT_reloadDStreamFast Unexecuted instantiation: zdict.c:BIT_reloadDStreamFast |
393 | | |
394 | | /*! BIT_reloadDStream() : |
395 | | * Refill `bitD` from buffer previously set in BIT_initDStream() . |
396 | | * This function is safe, it guarantees it will not read beyond src buffer. |
397 | | * @return : status of `BIT_DStream_t` internal register. |
398 | | * when status == BIT_DStream_unfinished, internal register is filled with at least 25 or 57 bits */ |
399 | | MEM_STATIC FORCE_INLINE_ATTR BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD) |
400 | 2.06k | { |
401 | 2.06k | if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8)) /* overflow detected, like end of stream */ |
402 | 269 | return BIT_DStream_overflow; |
403 | | |
404 | 1.79k | if (bitD->ptr >= bitD->limitPtr) { |
405 | 16 | return BIT_reloadDStreamFast(bitD); |
406 | 16 | } |
407 | 1.77k | if (bitD->ptr == bitD->start) { |
408 | 1.73k | if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer; |
409 | 30 | return BIT_DStream_completed; |
410 | 1.73k | } |
411 | | /* start < ptr < limitPtr */ |
412 | 40 | { U32 nbBytes = bitD->bitsConsumed >> 3; |
413 | 40 | BIT_DStream_status result = BIT_DStream_unfinished; |
414 | 40 | if (bitD->ptr - nbBytes < bitD->start) { |
415 | 5 | nbBytes = (U32)(bitD->ptr - bitD->start); /* ptr > start */ |
416 | 5 | result = BIT_DStream_endOfBuffer; |
417 | 5 | } |
418 | 40 | bitD->ptr -= nbBytes; |
419 | 40 | bitD->bitsConsumed -= nbBytes*8; |
420 | 40 | bitD->bitContainer = MEM_readLEST(bitD->ptr); /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */ |
421 | 40 | return result; |
422 | 1.77k | } |
423 | 1.77k | } Unexecuted instantiation: entropy_common.c:BIT_reloadDStream fse_decompress.c:BIT_reloadDStream Line | Count | Source | 400 | 1.68k | { | 401 | 1.68k | if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8)) /* overflow detected, like end of stream */ | 402 | 37 | return BIT_DStream_overflow; | 403 | | | 404 | 1.64k | if (bitD->ptr >= bitD->limitPtr) { | 405 | 0 | return BIT_reloadDStreamFast(bitD); | 406 | 0 | } | 407 | 1.64k | if (bitD->ptr == bitD->start) { | 408 | 1.62k | if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer; | 409 | 30 | return BIT_DStream_completed; | 410 | 1.62k | } | 411 | | /* start < ptr < limitPtr */ | 412 | 17 | { U32 nbBytes = bitD->bitsConsumed >> 3; | 413 | 17 | BIT_DStream_status result = BIT_DStream_unfinished; | 414 | 17 | if (bitD->ptr - nbBytes < bitD->start) { | 415 | 0 | nbBytes = (U32)(bitD->ptr - bitD->start); /* ptr > start */ | 416 | 0 | result = BIT_DStream_endOfBuffer; | 417 | 0 | } | 418 | 17 | bitD->ptr -= nbBytes; | 419 | 17 | bitD->bitsConsumed -= nbBytes*8; | 420 | 17 | bitD->bitContainer = MEM_readLEST(bitD->ptr); /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */ | 421 | 17 | return result; | 422 | 1.64k | } | 423 | 1.64k | } |
Unexecuted instantiation: zstd_common.c:BIT_reloadDStream Unexecuted instantiation: fse_compress.c:BIT_reloadDStream Unexecuted instantiation: huf_compress.c:BIT_reloadDStream Unexecuted instantiation: zstd_compress.c:BIT_reloadDStream Unexecuted instantiation: zstd_compress_literals.c:BIT_reloadDStream Unexecuted instantiation: zstd_compress_sequences.c:BIT_reloadDStream Unexecuted instantiation: zstd_compress_superblock.c:BIT_reloadDStream Unexecuted instantiation: zstd_double_fast.c:BIT_reloadDStream Unexecuted instantiation: zstd_fast.c:BIT_reloadDStream Unexecuted instantiation: zstd_lazy.c:BIT_reloadDStream Unexecuted instantiation: zstd_ldm.c:BIT_reloadDStream Unexecuted instantiation: zstd_opt.c:BIT_reloadDStream Unexecuted instantiation: zstdmt_compress.c:BIT_reloadDStream huf_decompress.c:BIT_reloadDStream Line | Count | Source | 400 | 17 | { | 401 | 17 | if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8)) /* overflow detected, like end of stream */ | 402 | 0 | return BIT_DStream_overflow; | 403 | | | 404 | 17 | if (bitD->ptr >= bitD->limitPtr) { | 405 | 0 | return BIT_reloadDStreamFast(bitD); | 406 | 0 | } | 407 | 17 | if (bitD->ptr == bitD->start) { | 408 | 3 | if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer; | 409 | 0 | return BIT_DStream_completed; | 410 | 3 | } | 411 | | /* start < ptr < limitPtr */ | 412 | 14 | { U32 nbBytes = bitD->bitsConsumed >> 3; | 413 | 14 | BIT_DStream_status result = BIT_DStream_unfinished; | 414 | 14 | if (bitD->ptr - nbBytes < bitD->start) { | 415 | 5 | nbBytes = (U32)(bitD->ptr - bitD->start); /* ptr > start */ | 416 | 5 | result = BIT_DStream_endOfBuffer; | 417 | 5 | } | 418 | 14 | bitD->ptr -= nbBytes; | 419 | 14 | bitD->bitsConsumed -= nbBytes*8; | 420 | 14 | bitD->bitContainer = MEM_readLEST(bitD->ptr); /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */ | 421 | 14 | return result; | 422 | 17 | } | 423 | 17 | } |
Unexecuted instantiation: zstd_ddict.c:BIT_reloadDStream Unexecuted instantiation: zstd_decompress.c:BIT_reloadDStream zstd_decompress_block.c:BIT_reloadDStream Line | Count | Source | 400 | 364 | { | 401 | 364 | if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8)) /* overflow detected, like end of stream */ | 402 | 232 | return BIT_DStream_overflow; | 403 | | | 404 | 132 | if (bitD->ptr >= bitD->limitPtr) { | 405 | 16 | return BIT_reloadDStreamFast(bitD); | 406 | 16 | } | 407 | 116 | if (bitD->ptr == bitD->start) { | 408 | 107 | if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer; | 409 | 0 | return BIT_DStream_completed; | 410 | 107 | } | 411 | | /* start < ptr < limitPtr */ | 412 | 9 | { U32 nbBytes = bitD->bitsConsumed >> 3; | 413 | 9 | BIT_DStream_status result = BIT_DStream_unfinished; | 414 | 9 | if (bitD->ptr - nbBytes < bitD->start) { | 415 | 0 | nbBytes = (U32)(bitD->ptr - bitD->start); /* ptr > start */ | 416 | 0 | result = BIT_DStream_endOfBuffer; | 417 | 0 | } | 418 | 9 | bitD->ptr -= nbBytes; | 419 | 9 | bitD->bitsConsumed -= nbBytes*8; | 420 | 9 | bitD->bitContainer = MEM_readLEST(bitD->ptr); /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */ | 421 | 9 | return result; | 422 | 116 | } | 423 | 116 | } |
Unexecuted instantiation: cover.c:BIT_reloadDStream Unexecuted instantiation: fastcover.c:BIT_reloadDStream Unexecuted instantiation: zdict.c:BIT_reloadDStream |
424 | | |
425 | | /*! BIT_endOfDStream() : |
426 | | * @return : 1 if DStream has _exactly_ reached its end (all bits consumed). |
427 | | */ |
428 | | MEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* DStream) |
429 | 8 | { |
430 | 8 | return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8)); |
431 | 8 | } Unexecuted instantiation: entropy_common.c:BIT_endOfDStream Unexecuted instantiation: fse_decompress.c:BIT_endOfDStream Unexecuted instantiation: zstd_common.c:BIT_endOfDStream Unexecuted instantiation: fse_compress.c:BIT_endOfDStream Unexecuted instantiation: huf_compress.c:BIT_endOfDStream Unexecuted instantiation: zstd_compress.c:BIT_endOfDStream Unexecuted instantiation: zstd_compress_literals.c:BIT_endOfDStream Unexecuted instantiation: zstd_compress_sequences.c:BIT_endOfDStream Unexecuted instantiation: zstd_compress_superblock.c:BIT_endOfDStream Unexecuted instantiation: zstd_double_fast.c:BIT_endOfDStream Unexecuted instantiation: zstd_fast.c:BIT_endOfDStream Unexecuted instantiation: zstd_lazy.c:BIT_endOfDStream Unexecuted instantiation: zstd_ldm.c:BIT_endOfDStream Unexecuted instantiation: zstd_opt.c:BIT_endOfDStream Unexecuted instantiation: zstdmt_compress.c:BIT_endOfDStream huf_decompress.c:BIT_endOfDStream Line | Count | Source | 429 | 8 | { | 430 | 8 | return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8)); | 431 | 8 | } |
Unexecuted instantiation: zstd_ddict.c:BIT_endOfDStream Unexecuted instantiation: zstd_decompress.c:BIT_endOfDStream Unexecuted instantiation: zstd_decompress_block.c:BIT_endOfDStream Unexecuted instantiation: cover.c:BIT_endOfDStream Unexecuted instantiation: fastcover.c:BIT_endOfDStream Unexecuted instantiation: zdict.c:BIT_endOfDStream |
432 | | |
433 | | #if defined (__cplusplus) |
434 | | } |
435 | | #endif |
436 | | |
437 | | #endif /* BITSTREAM_H_MODULE */ |