|
CCSDS 124.0-B-1 C++ 1.0.0
CCSDS 124.0-B-1 Lossless Compression
|
Sequential bit reader for compressed data. More...
#include <bitreader.hpp>
Public Member Functions | |
| BitReader (const std::uint8_t *data, std::size_t num_bits) noexcept | |
| Construct a bit reader. | |
| int | read_bit () noexcept |
| Read a single bit. | |
| std::uint32_t | read_bits (std::size_t num_bits) noexcept |
| Read multiple bits as unsigned value. | |
| std::size_t | position () const noexcept |
| Get current bit position. | |
| std::size_t | remaining () const noexcept |
| Get remaining bits. | |
| void | align_byte () noexcept |
| Skip to next byte boundary. | |
Sequential bit reader for compressed data.
Tracks position within a byte buffer for bit-level access. Used during decompression to parse compressed packets.
Definition at line 38 of file bitreader.hpp.
|
inlinenoexcept |
Construct a bit reader.
| data | Pointer to source data buffer |
| num_bits | Number of valid bits in buffer |
Definition at line 46 of file bitreader.hpp.
|
inlinenoexcept |
Skip to next byte boundary.
Advances position to start of next byte (for padding).
Definition at line 148 of file bitreader.hpp.
Referenced by ccsds124::decompress().
|
inlinenoexcept |
Get current bit position.
Definition at line 130 of file bitreader.hpp.
|
inlinenoexcept |
Read a single bit.
Definition at line 54 of file bitreader.hpp.
|
inlinenoexcept |
Read multiple bits as unsigned value.
Reads up to 32 bits MSB-first and returns as uint32_t. Optimized with fast path for byte-aligned reads.
| num_bits | Number of bits to read (1-32) |
Definition at line 78 of file bitreader.hpp.
References remaining().
|
inlinenoexcept |
Get remaining bits.
Definition at line 139 of file bitreader.hpp.
Referenced by ccsds124::decompress(), and read_bits().