HEX
Server: LiteSpeed
System: Linux ip-172-31-76-142.ec2.internal 4.14.158-129.185.amzn2.x86_64 #1 SMP Tue Dec 24 03:15:32 UTC 2019 x86_64
User: 69b4844ae61d4e92bf26ad98af552775 (1065)
PHP: 7.2.27
Disabled: exec,passthru,shell_exec,system,eval
Upload Files
File: //usr/share/doc/openjpeg-devel-1.5.1/html/rs_8h.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>OpenJPEG: rs.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenJPEG
   &#160;<span id="projectnumber">1.5.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_99d2dc560f84dde124e930de108007a7.html">builddir</a></li><li class="navelem"><a class="el" href="dir_f6883469d6f26503444921bb15d930e9.html">build</a></li><li class="navelem"><a class="el" href="dir_37d5b7668ae03bfa373b2267d602ea0e.html">BUILD</a></li><li class="navelem"><a class="el" href="dir_9904e09c490f202282706830189faba0.html">openjpeg-1.5.1</a></li><li class="navelem"><a class="el" href="dir_10074df973a1c5851187da2011751b4d.html">libopenjpeg</a></li><li class="navelem"><a class="el" href="dir_62bcdca9cc05fca788a00c591ae9c50b.html">jpwl</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">rs.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Functions used to compute Reed-Solomon parity and check of byte arrays.  
<a href="#details">More...</a></p>

<p><a href="rs_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:afdc383f8992f4a960bb22998f57b6d37"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs_8h.html#afdc383f8992f4a960bb22998f57b6d37">MM</a>&#160;&#160;&#160;8		/* RS code over GF(2**MM) - change to suit */</td></tr>
<tr class="memdesc:afdc383f8992f4a960bb22998f57b6d37"><td class="mdescLeft">&#160;</td><td class="mdescRight">Global definitions for Reed-Solomon encoder/decoder Phil Karn KA9Q, September 1996.  <a href="#afdc383f8992f4a960bb22998f57b6d37">More...</a><br/></td></tr>
<tr class="separator:afdc383f8992f4a960bb22998f57b6d37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a170755e30c36be4904106b7bb279b1ec"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs_8h.html#a170755e30c36be4904106b7bb279b1ec">NN</a>&#160;&#160;&#160;((1 &lt;&lt; <a class="el" href="rs_8h.html#afdc383f8992f4a960bb22998f57b6d37">MM</a>) - 1)</td></tr>
<tr class="separator:a170755e30c36be4904106b7bb279b1ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6afabdc09a49a433ee19d8a9486056d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs_8h.html#ac6afabdc09a49a433ee19d8a9486056d">min</a>(a, b)&#160;&#160;&#160;(((a) &lt; (b)) ? (a) : (b))</td></tr>
<tr class="memdesc:ac6afabdc09a49a433ee19d8a9486056d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the minimum between two integers.  <a href="#ac6afabdc09a49a433ee19d8a9486056d">More...</a><br/></td></tr>
<tr class="separator:ac6afabdc09a49a433ee19d8a9486056d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a9a32f7398bb29c52b13b76b584370222"><td class="memItemLeft" align="right" valign="top">typedef unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs_8h.html#a9a32f7398bb29c52b13b76b584370222">dtype</a></td></tr>
<tr class="separator:a9a32f7398bb29c52b13b76b584370222"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aa0ee9fc5ac4f8fee725e9cd9573ff71b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs_8h.html#aa0ee9fc5ac4f8fee725e9cd9573ff71b">init_rs</a> (int)</td></tr>
<tr class="memdesc:aa0ee9fc5ac4f8fee725e9cd9573ff71b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization function.  <a href="#aa0ee9fc5ac4f8fee725e9cd9573ff71b">More...</a><br/></td></tr>
<tr class="separator:aa0ee9fc5ac4f8fee725e9cd9573ff71b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa77e47615ab8c02fab3ca37e85a24dd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs_8h.html#afa77e47615ab8c02fab3ca37e85a24dd">generate_gf</a> (void)</td></tr>
<tr class="memdesc:afa77e47615ab8c02fab3ca37e85a24dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">These two functions <em>must</em> be called in this order (e.g., by <a class="el" href="rs_8c.html#a3dad158bbf8c0e6402be80de973679a5" title="Initialization function. ">init_rs()</a>) before any encoding/decoding.  <a href="#afa77e47615ab8c02fab3ca37e85a24dd">More...</a><br/></td></tr>
<tr class="separator:afa77e47615ab8c02fab3ca37e85a24dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5ccf5e6e56bc414324daa9359571dd2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs_8h.html#ac5ccf5e6e56bc414324daa9359571dd2">gen_poly</a> (void)</td></tr>
<tr class="separator:ac5ccf5e6e56bc414324daa9359571dd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f81e64d6a0adf67aa3c7e1d28e3ddf1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs_8h.html#a6f81e64d6a0adf67aa3c7e1d28e3ddf1">encode_rs</a> (<a class="el" href="rs_8h.html#a9a32f7398bb29c52b13b76b584370222">dtype</a> data[], <a class="el" href="rs_8h.html#a9a32f7398bb29c52b13b76b584370222">dtype</a> bb[])</td></tr>
<tr class="memdesc:a6f81e64d6a0adf67aa3c7e1d28e3ddf1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reed-Solomon encoding data[] is the input block, parity symbols are placed in bb[] bb[] may lie past the end of the data, e.g., for (255,223): encode_rs(&amp;data[0],&amp;data[223]);.  <a href="#a6f81e64d6a0adf67aa3c7e1d28e3ddf1">More...</a><br/></td></tr>
<tr class="separator:a6f81e64d6a0adf67aa3c7e1d28e3ddf1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a033e2ded0c2c4975c5aee0dc09eadab6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rs_8h.html#a033e2ded0c2c4975c5aee0dc09eadab6">eras_dec_rs</a> (<a class="el" href="rs_8h.html#a9a32f7398bb29c52b13b76b584370222">dtype</a> data[], int eras_pos[], int no_eras)</td></tr>
<tr class="memdesc:a033e2ded0c2c4975c5aee0dc09eadab6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reed-Solomon erasures-and-errors decoding The received block goes into data[], and a list of zero-origin erasure positions, if any, goes in eras_pos[] with a count in no_eras.  <a href="#a033e2ded0c2c4975c5aee0dc09eadab6">More...</a><br/></td></tr>
<tr class="separator:a033e2ded0c2c4975c5aee0dc09eadab6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Functions used to compute Reed-Solomon parity and check of byte arrays. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ac6afabdc09a49a433ee19d8a9486056d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define min</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(((a) &lt; (b)) ? (a) : (b))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes the minimum between two integers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>first integer to compare </td></tr>
    <tr><td class="paramname">b</td><td>second integer to compare </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>returns the minimum integer between a and b </dd></dl>

<p>Referenced by <a class="el" href="rs_8c.html#af1dc726419d303ffdcda6939bda11aae">eras_dec_rs()</a>, <a class="el" href="group___i_n_t.html#gab900976eb2a33a61c596189145fad7fc">int_clamp()</a>, <a class="el" href="group___j_p_w_l.html#ga241c44d08df58284bdc90125901ecfce">jpwl_epbs_add()</a>, <a class="el" href="group___t_c_d.html#ga95e1326c7801627873a59e065d541355">tcd_decode_tile()</a>, and <a class="el" href="group___t_c_d.html#ga7f0c1a599dee1eddda33b6ad08034709">tcd_rateallocate()</a>.</p>

</div>
</div>
<a class="anchor" id="afdc383f8992f4a960bb22998f57b6d37"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MM&#160;&#160;&#160;8		/* RS code over GF(2**MM) - change to suit */</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Global definitions for Reed-Solomon encoder/decoder Phil Karn KA9Q, September 1996. </p>
<p>The parameters MM and KK specify the Reed-Solomon code parameters.</p>
<p>Set MM to be the size of each code symbol in bits. The Reed-Solomon block size will then be NN = 2**M - 1 symbols. Supported values are defined in <a class="el" href="rs_8c.html" title="Functions used to compute the Reed-Solomon parity and check of byte arrays. ">rs.c</a>.</p>
<p>Set KK to be the number of data symbols in each block, which must be less than the block size. The code will then be able to correct up to NN-KK erasures or (NN-KK)/2 errors, or combinations thereof with each error counting as two erasures. </p>

<p>Referenced by <a class="el" href="rs_8h.html#afa77e47615ab8c02fab3ca37e85a24dd">generate_gf()</a>, and <a class="el" href="rs_8c.html#acf591e4e0cfd0b1cde804c679349947f">modnn()</a>.</p>

</div>
</div>
<a class="anchor" id="a170755e30c36be4904106b7bb279b1ec"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define NN&#160;&#160;&#160;((1 &lt;&lt; <a class="el" href="rs_8h.html#afdc383f8992f4a960bb22998f57b6d37">MM</a>) - 1)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Referenced by <a class="el" href="rs_8c.html#a01e2c45240483af10538eb2d7ed56f81">encode_rs()</a>, <a class="el" href="rs_8c.html#af1dc726419d303ffdcda6939bda11aae">eras_dec_rs()</a>, <a class="el" href="rs_8h.html#ac5ccf5e6e56bc414324daa9359571dd2">gen_poly()</a>, <a class="el" href="rs_8h.html#afa77e47615ab8c02fab3ca37e85a24dd">generate_gf()</a>, <a class="el" href="rs_8h.html#aa0ee9fc5ac4f8fee725e9cd9573ff71b">init_rs()</a>, <a class="el" href="group___j_p_w_l.html#gac9eeaa750b40bcdf4fd1f01059a535cc">jpwl_epb_correct()</a>, <a class="el" href="group___j_p_w_l.html#ga65f414948b05e0bfad08023063dbdf96">jpwl_epb_fill()</a>, and <a class="el" href="rs_8c.html#acf591e4e0cfd0b1cde804c679349947f">modnn()</a>.</p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="a9a32f7398bb29c52b13b76b584370222"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef unsigned char <a class="el" href="rs_8h.html#a9a32f7398bb29c52b13b76b584370222">dtype</a></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a6f81e64d6a0adf67aa3c7e1d28e3ddf1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int encode_rs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="rs_8h.html#a9a32f7398bb29c52b13b76b584370222">dtype</a>&#160;</td>
          <td class="paramname"><em>data</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="rs_8h.html#a9a32f7398bb29c52b13b76b584370222">dtype</a>&#160;</td>
          <td class="paramname"><em>bb</em>[]&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reed-Solomon encoding data[] is the input block, parity symbols are placed in bb[] bb[] may lie past the end of the data, e.g., for (255,223): encode_rs(&amp;data[0],&amp;data[223]);. </p>

</div>
</div>
<a class="anchor" id="a033e2ded0c2c4975c5aee0dc09eadab6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int eras_dec_rs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="rs_8h.html#a9a32f7398bb29c52b13b76b584370222">dtype</a>&#160;</td>
          <td class="paramname"><em>data</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>eras_pos</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>no_eras</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reed-Solomon erasures-and-errors decoding The received block goes into data[], and a list of zero-origin erasure positions, if any, goes in eras_pos[] with a count in no_eras. </p>
<p>The decoder corrects the symbols in place, if possible and returns the number of corrected symbols. If the codeword is illegal or uncorrectible, the data array is unchanged and -1 is returned </p>

</div>
</div>
<a class="anchor" id="ac5ccf5e6e56bc414324daa9359571dd2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gen_poly </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>References <a class="el" href="rs_8c.html#aaa77e8ef556afba0da22dae38b0ea8ea">Alpha_to</a>, <a class="el" href="rs_8c.html#a8a03ef52aa4926d1d75cb647ac768622">B0</a>, <a class="el" href="rs_8c.html#af474e09bee18450627e4c7d40419e973">Gg</a>, <a class="el" href="rs_8c.html#aadc731ecca09ed2f114b3c30ce5c4982">Index_of</a>, <a class="el" href="rs_8c.html#a086193b71e7c24768de1dc748b817c8c">KK</a>, <a class="el" href="rs_8c.html#acf591e4e0cfd0b1cde804c679349947f">modnn()</a>, and <a class="el" href="rs_8h.html#a170755e30c36be4904106b7bb279b1ec">NN</a>.</p>

<p>Referenced by <a class="el" href="rs_8h.html#aa0ee9fc5ac4f8fee725e9cd9573ff71b">init_rs()</a>.</p>

</div>
</div>
<a class="anchor" id="afa77e47615ab8c02fab3ca37e85a24dd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void generate_gf </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>These two functions <em>must</em> be called in this order (e.g., by <a class="el" href="rs_8c.html#a3dad158bbf8c0e6402be80de973679a5" title="Initialization function. ">init_rs()</a>) before any encoding/decoding. </p>

<p>References <a class="el" href="rs_8c.html#a0d158f1e3af2ab523eb8423db3e5bd6e">A0</a>, <a class="el" href="rs_8c.html#aaa77e8ef556afba0da22dae38b0ea8ea">Alpha_to</a>, <a class="el" href="rs_8c.html#aadc731ecca09ed2f114b3c30ce5c4982">Index_of</a>, <a class="el" href="rs_8h.html#afdc383f8992f4a960bb22998f57b6d37">MM</a>, <a class="el" href="rs_8h.html#a170755e30c36be4904106b7bb279b1ec">NN</a>, and <a class="el" href="rs_8c.html#ac4465651339912643627d98d70a2c131">Pp</a>.</p>

<p>Referenced by <a class="el" href="rs_8h.html#aa0ee9fc5ac4f8fee725e9cd9573ff71b">init_rs()</a>.</p>

</div>
</div>
<a class="anchor" id="aa0ee9fc5ac4f8fee725e9cd9573ff71b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void init_rs </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialization function. </p>

<p>References <a class="el" href="rs_8c.html#ac5ccf5e6e56bc414324daa9359571dd2">gen_poly()</a>, <a class="el" href="rs_8c.html#afa77e47615ab8c02fab3ca37e85a24dd">generate_gf()</a>, <a class="el" href="rs_8c.html#a086193b71e7c24768de1dc748b817c8c">KK</a>, and <a class="el" href="rs_8h.html#a170755e30c36be4904106b7bb279b1ec">NN</a>.</p>

<p>Referenced by <a class="el" href="group___j_p_w_l.html#gac9eeaa750b40bcdf4fd1f01059a535cc">jpwl_epb_correct()</a>, and <a class="el" href="group___j_p_w_l.html#ga65f414948b05e0bfad08023063dbdf96">jpwl_epb_fill()</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>