pub struct CcsdsRs { /* private fields */ }Expand description
An interleaved Reed–Solomon codeblock of CCSDS (see the module): the code of correction capability $E$, the interleaving depth $I$ and the virtual fill of $q$ symbols per codeword.
Implementations§
Source§impl CcsdsRs
impl CcsdsRs
Sourcepub fn new(e: usize, depth: usize, fill: usize) -> Result<CcsdsRs>
pub fn new(e: usize, depth: usize, fill: usize) -> Result<CcsdsRs>
The codeblock of correction capability e (8 or 16 symbols per codeword), depth
depth (1, 2, 3, 4, 5 or 8) and virtual fill fill ($q$ symbols per codeword,
$Q = q I$ in all; 0 for the full length).
§Errors
Error::Config for another $E$ or $I$, or a fill that leaves no information.
Sourcepub fn code(&self) -> &ReedSolomon
pub fn code(&self) -> &ReedSolomon
The conventional code of a codeword (the field of $F(x)$, the roots $\alpha^{11 j}$, shortened by the fill).
Sourcepub fn codeblock_len(&self) -> usize
pub fn codeblock_len(&self) -> usize
Octets of a codeblock, $(255 - q) I$.
Sourcepub fn encode_bytes(&self, frame: &[u8]) -> Result<Vec<u8>>
pub fn encode_bytes(&self, frame: &[u8]) -> Result<Vec<u8>>
The codeblock of a frame (dual-basis octets): the frame, then the $2 E I$ check symbols, codeword $i$ holding the symbols $i, i + I, i + 2I, \dots$ (Sec. 4.4.1).
§Errors
Error::Shape unless the frame has CcsdsRs::frame_len octets.
Sourcepub fn decode_bytes(&self, block: &[u8]) -> Result<(Vec<u8>, Option<usize>)>
pub fn decode_bytes(&self, block: &[u8]) -> Result<(Vec<u8>, Option<usize>)>
Decode a received codeblock: the frame and the number of corrected symbols
(None if a codeword could not be decoded; its frame symbols are then those
received).
§Errors
Error::Shape unless the codeblock has CcsdsRs::codeblock_len octets.
Trait Implementations§
Source§impl BlockCode for CcsdsRs
impl BlockCode for CcsdsRs
Source§fn decode_block(&self, llr: &[f64]) -> Result<Vec<u8>>
fn decode_block(&self, llr: &[f64]) -> Result<Vec<u8>>
Hard decisions on the LLRs, then CcsdsRs::decode_bytes.
Source§fn encode_block(&self, info: &[u8]) -> Result<Vec<u8>>
fn encode_block(&self, info: &[u8]) -> Result<Vec<u8>>
Source§fn encode_block_into(&self, info: &[u8], out: &mut [u8]) -> Result<()>
fn encode_block_into(&self, info: &[u8], out: &mut [u8]) -> Result<()>
out (ADR 0011: the default
copies BlockCode::encode_block; a code overrides it when a profile shows the
copy). Read moreSource§fn decode_block_into(&self, llr: &[f64], out: &mut [u8]) -> Result<()>
fn decode_block_into(&self, llr: &[f64], out: &mut [u8]) -> Result<()>
out (as
BlockCode::encode_block_into). Read more