diff options
| author | skal <pascal.massimino@gmail.com> | 2026-05-21 08:10:47 +0200 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-05-21 08:10:47 +0200 |
| commit | d806027dcaeadcdd8d2febd88bc46b2fd2c465de (patch) | |
| tree | 30bc1ef9f40ccab7c00e31ee20e62bb86755fa26 /src/util/ans.h | |
| parent | 680042a18c11ad5e58757e45b260745c2f52417f (diff) | |
Diffstat (limited to 'src/util/ans.h')
| -rw-r--r-- | src/util/ans.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/util/ans.h b/src/util/ans.h index 53c34b1..cf3d83a 100644 --- a/src/util/ans.h +++ b/src/util/ans.h @@ -34,25 +34,23 @@ uint32_t PeekUncompressedSize(const uint8_t* src, size_t src_size); // 'initial_counts' (256 entries) seeds the per-chunk adaptive model; pass // nullptr for the uniform default (all-ones). // Returns true on success and writes the decoded size to '*out_size'. -bool Decode(const uint8_t* src, size_t src_size, - uint8_t* dst, size_t dst_capacity, - size_t* out_size, +bool Decode(const uint8_t* src, size_t src_size, uint8_t* dst, + size_t dst_capacity, size_t* out_size, const uint32_t* initial_counts = nullptr); #if defined(ANS_ENABLE_ENCODER) // Encodes 'src[0..size]' into '*dst' (cleared and re-filled). // 'initial_counts' has the same semantics as in Decode(). // Returns true on success. -bool Encode(const uint8_t* src, size_t size, - std::vector<uint8_t>* dst, +bool Encode(const uint8_t* src, size_t size, std::vector<uint8_t>* dst, const uint32_t* initial_counts = nullptr); // Computes a byte histogram over 'src[0..size]', accumulating into // 'out_counts[256]' (caller must zero-initialize before the first call). // Useful for deriving a corpus-wide initial distribution from many files. void Histogram(const uint8_t* src, size_t size, uint32_t* out_counts); -#endif // ANS_ENABLE_ENCODER +#endif // ANS_ENABLE_ENCODER -} // namespace ans +} // namespace ans -#endif // ANS_H_ +#endif // ANS_H_ |
