CCSDS 124.0-B-1 C++ 1.0.0
CCSDS 124.0-B-1 Lossless Compression
Loading...
Searching...
No Matches
ccsds124::Compressor< N, MaxOutputBytes > Class Template Reference

CCSDS 124.0-B-1 compressor with static memory allocation. More...

#include <compressor.hpp>

Public Member Functions

 Compressor (std::uint8_t robustness=0, int pt_limit=0, int ft_limit=0, int rt_limit=0) noexcept
 Construct compressor with configuration.
 
void set_initial_mask (const BitVector< N > &initial_mask) noexcept
 Set the initial mask.
 
void reset () noexcept
 Reset compressor to initial state.
 
template<std::size_t OutputSize>
Error compress_packet (const BitVector< N > &input, BitBuffer< OutputSize > &output, const CompressParams *params=nullptr) noexcept
 Compress a single input packet.
 
std::size_t time_index () const noexcept
 Get current time index.
 
std::uint8_t robustness () const noexcept
 Get robustness level.
 
const BitVector< N > & mask () const noexcept
 Get current mask.
 
CompressParams compute_auto_params (std::size_t packet_index) noexcept
 Compute parameters for automatic mode.
 

Detailed Description

template<std::size_t N, std::size_t MaxOutputBytes = N * 6>
class ccsds124::Compressor< N, MaxOutputBytes >

CCSDS 124.0-B-1 compressor with static memory allocation.

Template class that implements the CCSDS 124.0-B-1 compression algorithm. All memory is statically allocated based on template parameters.

Template Parameters
NPacket length in bits (F)
MaxOutputBytesMaximum output buffer size

Definition at line 58 of file compressor.hpp.

Constructor & Destructor Documentation

◆ Compressor()

template<std::size_t N, std::size_t MaxOutputBytes = N * 6>
ccsds124::Compressor< N, MaxOutputBytes >::Compressor ( std::uint8_t  robustness = 0,
int  pt_limit = 0,
int  ft_limit = 0,
int  rt_limit = 0 
)
inlineexplicitnoexcept

Construct compressor with configuration.

Parameters
robustnessBase robustness level R_t (0-7)
pt_limitNew mask period (0 = manual control)
ft_limitSend mask period (0 = manual control)
rt_limitUncompressed period (0 = manual control)

Definition at line 68 of file compressor.hpp.

References ccsds124::Compressor< N, MaxOutputBytes >::reset().

Member Function Documentation

◆ compress_packet()

template<std::size_t N, std::size_t MaxOutputBytes = N * 6>
template<std::size_t OutputSize>
Error ccsds124::Compressor< N, MaxOutputBytes >::compress_packet ( const BitVector< N > &  input,
BitBuffer< OutputSize > &  output,
const CompressParams params = nullptr 
)
inlinenoexcept

◆ compute_auto_params()

template<std::size_t N, std::size_t MaxOutputBytes = N * 6>
CompressParams ccsds124::Compressor< N, MaxOutputBytes >::compute_auto_params ( std::size_t  packet_index)
inlinenoexcept

Compute parameters for automatic mode.

Parameters
packet_indexCurrent packet index (0-based)
Returns
Computed parameters

Definition at line 351 of file compressor.hpp.

References ccsds124::CompressParams::min_robustness, ccsds124::CompressParams::new_mask_flag, ccsds124::CompressParams::send_mask_flag, and ccsds124::CompressParams::uncompressed_flag.

◆ mask()

template<std::size_t N, std::size_t MaxOutputBytes = N * 6>
const BitVector< N > & ccsds124::Compressor< N, MaxOutputBytes >::mask ( ) const
inlinenoexcept

Get current mask.

Definition at line 341 of file compressor.hpp.

◆ reset()

template<std::size_t N, std::size_t MaxOutputBytes = N * 6>
void ccsds124::Compressor< N, MaxOutputBytes >::reset ( )
inlinenoexcept

Reset compressor to initial state.

Resets time index to 0 and clears all history while preserving configuration.

Definition at line 96 of file compressor.hpp.

References ccsds124::MAX_HISTORY, and ccsds124::MAX_VT_HISTORY.

Referenced by ccsds124::Compressor< N, MaxOutputBytes >::Compressor().

◆ robustness()

template<std::size_t N, std::size_t MaxOutputBytes = N * 6>
std::uint8_t ccsds124::Compressor< N, MaxOutputBytes >::robustness ( ) const
inlinenoexcept

Get robustness level.

Definition at line 334 of file compressor.hpp.

◆ set_initial_mask()

template<std::size_t N, std::size_t MaxOutputBytes = N * 6>
void ccsds124::Compressor< N, MaxOutputBytes >::set_initial_mask ( const BitVector< N > &  initial_mask)
inlinenoexcept

Set the initial mask.

Parameters
initial_maskInitial mask M_0

Definition at line 85 of file compressor.hpp.

◆ time_index()

template<std::size_t N, std::size_t MaxOutputBytes = N * 6>
std::size_t ccsds124::Compressor< N, MaxOutputBytes >::time_index ( ) const
inlinenoexcept

Get current time index.

Definition at line 327 of file compressor.hpp.


The documentation for this class was generated from the following file: