Warning: This is an old version. The latest stable version is Version 10.0.0.
Scope: otacast
In header: #include <otacast/decoder.hpp>
The otacast decoder.
decoder () | |
decoder (const decoder & other) | |
decoder & | operator= (const decoder & other) |
decoder (decoder && other) | |
decoder & | operator= (decoder && other) |
~decoder () | |
void | configure (finite_field field, std::size_t block_bytes, std::size_t symbol_bytes, std::size_t width) |
void | reset () |
std::size_t | symbol_bytes () const |
std::size_t | width () const |
std::size_t | block_bytes () const |
std::size_t | symbols () const |
finite_field | finite_field () const |
void | set_symbols_storage (uint8_t * symbol_storage) |
uint8_t * | symbols_storage () const |
void | decode (uint8_t * symbol, uint64_t seed, std::size_t offset) |
std::size_t | rank () const |
bool | can_complete_decoding () const |
void | complete_decoding () |
bool | is_complete () const |
double | progress () const |
std::size_t | state_bytes () const |
void | save_state (uint8_t * data) const |
bool | restore_state (const uint8_t * data, std::size_t size) |
Default constructor.
Copy constructor (disabled). This type is only movable.
Copy assign operator (disabled). This type is only movable.
R-value copy constructor.
R-value move assign operator.
Destructor.
Configure the decoder with the given parameters. This is useful for reusing an existing coder. Note that the reconfiguration always implies a reset, so the coder will be in a clean state after this operation
- Parameter
field
:- The finite field to use
- Parameter
block_bytes
:- The size of the block in bytes
- Parameter
symbol_bytes
:- The size of a symbol in bytes
- Parameter
width
:- The width of the encoding i.e. now many symbols are combined for each encoded symbol
Reset the state of the decoder.
Return the size in bytes per symbol supported by this decoder.
Return the width of the encoding i.e. now many symbols are combined for each encoded symbol
Return the total number of bytes that with this decoder spans.
Return the number of symbols supported by this decoder.
Return the finite field used.
Initialize all the symbols in the block
- Parameter
symbol_storage
:- The buffer containing all the data for the the block
- Returns:
- The memory for the block.
Feed a coded symbol to the decoder.
- Parameter
symbol
:- The data of the symbol assumed to be symbol_bytes() bytes in size.
- Parameter
seed
:- The seed for generating the coding coefficients.
- Parameter
offset
:- The offset of the coding coefficients
Return the current rank of this decoder.
- Returns:
- True if the decoder can complete the decoding, i.e., that the rank is full.
Instruct the decoder to complete the decoding, this is only possible when can_complete_decoding() returns true.
- Returns:
- True if the decoder is complete
- Returns:
- A value between 0 and 100, representing the decoding progress.
The number of bytes needed for storeing the state.
Save the state of this decoder so that it can be restored later using restore_state().
- Parameter
data
:- the data pointer writing the state, please make sure it is large enough to contain the number of bytes returned by state_bytes.
Restore the state of a past decoder. This operation is only allowed a new decoder object.
- Parameter
data
:- a data pointer to the state.
- Parameter
size
:- the size of the data being pointed to.
- Returns:
- True if the restore operation was successful, otherwise false.