CCSDS 124.0-B-1 C++ 1.0.0
CCSDS 124.0-B-1 Lossless Compression
Loading...
Searching...
No Matches
ccsds124::detail Namespace Reference

Pre-computed COUNT encodings for values 1-33. More...

Functions

int extract_msb (std::uint32_t &word) noexcept
 Extract and clear the most significant set bit from a word.
 
int extract_lsb (std::uint32_t &word) noexcept
 Extract and clear the least significant set bit from a word.
 

Variables

constexpr std::uint8_t COUNT_VALUES [34]
 
constexpr std::uint8_t COUNT_BITS [34]
 

Detailed Description

Pre-computed COUNT encodings for values 1-33.

Function Documentation

◆ extract_lsb()

int ccsds124::detail::extract_lsb ( std::uint32_t &  word)
inlinenoexcept

Extract and clear the least significant set bit from a word.

Parameters
wordReference to the word (will be modified to clear the LSB)
Returns
Position of the LSB from MSB (0-31), or -1 if word was zero

Definition at line 71 of file bitvector.hpp.

Referenced by ccsds124::bit_insert().

◆ extract_msb()

int ccsds124::detail::extract_msb ( std::uint32_t &  word)
inlinenoexcept

Extract and clear the most significant set bit from a word.

This helper makes bit iteration loops analyzable by static analysis tools. The loop termination is bounded by popcount (number of set bits).

Parameters
wordReference to the word (will be modified to clear the MSB)
Returns
Position of the MSB (0-31), or -1 if word was zero

Definition at line 56 of file bitvector.hpp.

Referenced by ccsds124::bit_extract_forward(), ccsds124::bit_insert_forward(), and ccsds124::Decompressor< N >::decompress_packet().

Variable Documentation

◆ COUNT_BITS

constexpr std::uint8_t ccsds124::detail::COUNT_BITS[34]
inlineconstexpr
Initial value:
= {
0U, 1U,
8U, 8U, 8U, 8U, 8U, 8U, 8U, 8U,
8U, 8U, 8U, 8U, 8U, 8U, 8U, 8U,
8U, 8U, 8U, 8U, 8U, 8U, 8U, 8U,
8U, 8U, 8U, 8U, 8U, 8U, 8U, 8U
}

Definition at line 48 of file encoder.hpp.

Referenced by ccsds124::count_encode().

◆ COUNT_VALUES

constexpr std::uint8_t ccsds124::detail::COUNT_VALUES[34]
inlineconstexpr
Initial value:
= {
0U, 0U,
0xC0U, 0xC1U, 0xC2U, 0xC3U, 0xC4U, 0xC5U, 0xC6U, 0xC7U,
0xC8U, 0xC9U, 0xCAU, 0xCBU, 0xCCU, 0xCDU, 0xCEU, 0xCFU,
0xD0U, 0xD1U, 0xD2U, 0xD3U, 0xD4U, 0xD5U, 0xD6U, 0xD7U,
0xD8U, 0xD9U, 0xDAU, 0xDBU, 0xDCU, 0xDDU, 0xDEU, 0xDFU
}

Definition at line 41 of file encoder.hpp.

Referenced by ccsds124::count_encode().