Source Code

 *  decode_rs8 - Decode codeword (8bit data width)
 *  @rsc:	the rs control structure
 *  @data:	data field of a given type
 *  @par:	received parity data field
 *  @len:	data length
 *  @s: 	syndrome data field, must be in index form
 *		(if NULL, syndrome is calculated)
 *  @no_eras:	number of erasures
 *  @eras_pos:	position of erasures, can be NULL
 *  @invmsk:	invert data mask (will be xored on data, not on parity!)
 *  @corr:	buffer to store correction bitmask on eras_pos
 *  The syndrome and parity uses a uint16_t data type to enable
 *  symbol size > 8. The calling code must take care of decoding of the
 *  syndrome result and the received parity before calling this code.
 *  Note: The rs_control struct @rsc contains buffers which are used for
 *  decoding, so the caller has to ensure that decoder invocations are
 *  serialized.
 *  Returns the number of corrected symbols or -EBADMSG for uncorrectable
 *  errors. The count includes errors in the parity.
int decode_rs8(struct rs_control *rsc, uint8_t *data, uint16_t *par, int len,
	       uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk,
	       uint16_t *corr)
#include "decode_rs.c"

This function is used when you have a bunch of data received from encode_rs8(), and now you want to decode and recover missing data.

Publish At: Author:Aiden Leong

Read more posts by this author

comments powered by Disqus