|
CCSDS 124.0-B-1 C 1.0.0
CCSDS 124.0-B-1 Lossless Compression
|
Variable-length bit buffer for building compressed output. More...
Go to the source code of this file.
Functions | |
Initialization Functions | |
This module provides a dynamically-growing bit buffer for constructing compressed output streams. Bits are appended sequentially using MSB-first ordering as required by CCSDS 124.0-B-1.
| |
| void | bitbuffer_init (bitbuffer_t *bb) |
| Initialize bit buffer to empty state. | |
| void | bitbuffer_clear (bitbuffer_t *bb) |
| Clear bit buffer contents. | |
Bit Appending Functions | |
| static void | bitbuffer_flush_acc (bitbuffer_t *bb) |
| Flush accumulator to data buffer when it has 8+ bits. | |
| int | bitbuffer_append_bit (bitbuffer_t *bb, int bit) |
| Append a single bit to buffer. | |
| int | bitbuffer_append_bits (bitbuffer_t *bb, const uint8_t *data, size_t num_bits) |
| Append multiple bits from byte array. | |
| int | bitbuffer_append_value (bitbuffer_t *bb, uint32_t value, size_t num_bits) |
| Append multiple bits from a value in a single operation. | |
| int | bitbuffer_append_bitvector (bitbuffer_t *bb, const bitvector_t *bv) |
| Append all bits from a bit vector. | |
Query Functions | |
| size_t | bitbuffer_size (const bitbuffer_t *bb) |
| Get number of bits in buffer. | |
Byte Conversion Functions | |
| size_t | bitbuffer_to_bytes (const bitbuffer_t *bb, uint8_t *data, size_t max_bytes) |
| Convert bit buffer to byte array. | |
Variable-length bit buffer for building compressed output.
Definition in file bitbuffer.c.
|
static |
Flush accumulator to data buffer when it has 8+ bits.
| [in,out] | bb | Bit buffer |
Definition at line 66 of file bitbuffer.c.
References bitbuffer::acc, bitbuffer::acc_len, bitbuffer::data, and bitbuffer::num_bits.
Referenced by bitbuffer_append_bit(), and bitbuffer_append_value().