fastfibonacci/byte_decode/mod.rs
1//! Byte oriented decoding:
2//! Oppposed to [`crate::bit_decode`] this assumes that the input stream comes in bigger chunks (u8/u16/u32/u64)
3//! rather than single bits and takes advantage (speed) of this fact.
4//!
5//! One drawback: We assume that the block of fibonacci encoding fits neatly into (u8/u16/u32/u64) and we dont need access
6//! to any possible trailing bits (containing some other data to be decoded differently).
7//!
8
9use std::io::Read;
10pub mod bare_metal_3264_stream;
11pub mod bytestream_transform;
12pub mod partial;
13pub mod u64_fibdecoder;
14pub mod u64_fibdecoder_refactor;
15pub mod faster;
16pub mod bare_metal_16single_faster;
17pub mod byte_manipulation;
18
19/// Marker trait for Fibonacci decoders.
20/// This is an iterator over u64 (the decoded integers),
21/// allows you to get back the intput iterator once done with decoding
22pub trait FbDecNew<'a>: Iterator<Item = u64> {
23 /// Returns the buffer behind the last bit processed.
24 /// Comes handy when the buffer contains data OTHER than fibonacci encoded
25 /// data that needs to be processed externally.
26 fn get_remaining_buffer(&self) -> &'a impl Read;
27
28 /// how far did we process into the buffer (pretty much the first bit after a 11).
29 fn get_bytes_processed(&self) -> usize;
30}