1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>decode_rs8</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Reed-Solomon Library Programming Interface"><link rel="up" href="pubfunctions.html" title="Chapter 5. Public Functions Provided"><link rel="prev" href="API-encode-rs8.html" title="encode_rs8"><link rel="next" href="API-encode-rs16.html" title="encode_rs16"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">decode_rs8</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-encode-rs8.html">Prev</a> </td><th width="60%" align="center">Chapter 5. Public Functions Provided</th><td width="20%" align="right"> <a accesskey="n" href="API-encode-rs16.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-decode-rs8"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>decode_rs8 — 2 Decode codeword (8bit data width) 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">decode_rs8 </b>(</code></td><td>struct rs_control * <var class="pdparam">rs</var>, </td></tr><tr><td> </td><td>uint8_t * <var class="pdparam">data</var>, </td></tr><tr><td> </td><td>uint16_t * <var class="pdparam">par</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">len</var>, </td></tr><tr><td> </td><td>uint16_t * <var class="pdparam">s</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">no_eras</var>, </td></tr><tr><td> </td><td>int * <var class="pdparam">eras_pos</var>, </td></tr><tr><td> </td><td>uint16_t <var class="pdparam">invmsk</var>, </td></tr><tr><td> </td><td>uint16_t * <var class="pdparam">corr</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1123697788"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>rs</code></em></span></dt><dd><p> 4 the rs control structure 5 </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p> 6 data field of a given type 7 </p></dd><dt><span class="term"><em class="parameter"><code>par</code></em></span></dt><dd><p> 8 received parity data field 9 </p></dd><dt><span class="term"><em class="parameter"><code>len</code></em></span></dt><dd><p> 10 data length 11 </p></dd><dt><span class="term"><em class="parameter"><code>s</code></em></span></dt><dd><p> 12 syndrome data field (if NULL, syndrome is calculated) 13 </p></dd><dt><span class="term"><em class="parameter"><code>no_eras</code></em></span></dt><dd><p> 14 number of erasures 15 </p></dd><dt><span class="term"><em class="parameter"><code>eras_pos</code></em></span></dt><dd><p> 16 position of erasures, can be NULL 17 </p></dd><dt><span class="term"><em class="parameter"><code>invmsk</code></em></span></dt><dd><p> 18 invert data mask (will be xored on data, not on parity!) 19 </p></dd><dt><span class="term"><em class="parameter"><code>corr</code></em></span></dt><dd><p> 20 buffer to store correction bitmask on eras_pos 21 </p></dd></dl></div></div><div class="refsect1"><a name="idp1123707292"></a><h2>Description</h2><p> 22 The syndrome and parity uses a uint16_t data type to enable 23 symbol size > 8. The calling code must take care of decoding of the 24 syndrome result and the received parity before calling this code. 25 Returns the number of corrected bits or -EBADMSG for uncorrectable errors. 26</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-encode-rs8.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pubfunctions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-encode-rs16.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">encode_rs8</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">encode_rs16</span></td></tr></table></div></body></html> 27