# CSJ2K.j2k.entropy.encoder.CBlkRateDistStats

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats" class="text-break">CBlkRateDistStats Class
</h1>
  <div class="markdown level0 summary"><p>This class stores coded (compressed) code-blocks with their associated
rate-distortion statistics. This object should always contain all the
compressed data of the code-block. It is applicable to the encoder engine
only. Some data of the coded-block is stored in the super class, see
CodedCBlk.</p>
<pre><code>       &lt;p&gt;The rate-distortion statistics (i.e. R-D slope) is stored for valid
       points only. The set of valid points is determined by the entropy coder
       engine itself. Normally they are selected so as to lye in a convex hull,
       which can be achived by using the 'selectConvexHull' method of this class,
       but some other strategies might be employed.&lt;/p&gt;&lt;p&gt;The rate (in bytes) for each truncation point (valid or not) is stored
       in the 'truncRates' array. The rate of a truncation point is the total
       number of bytes in 'data' (see super class) that have to be decoded to
       reach the truncation point.&lt;/p&gt;&lt;p&gt;The slope (reduction of distortion divided by the increase in rate) at
       each of the valid truncation points is stored in 'truncSlopes'.&lt;/p&gt;&lt;p&gt;The index of each valid truncation point is stored in 'truncIdxs'. The
       index should be interpreted in the following way: a valid truncation point
       at position 'n' has the index 'truncIdxs[n]', the rate
       'truncRates[truncIdxs[n]]' and the slope 'truncSlopes[n]'. The arrays
       'truncIdxs' and 'truncRates' have at least 'nVldTrunc' elements. The
       'truncRates' array has at least 'nTotTrunc' elements.&lt;/p&gt;&lt;p&gt;In addition the 'isTermPass' array contains a flag for each truncation
       point (valid and non-valid ones) that tells if the pass is terminated or
       not. If this variable is null then it means that no pass is terminated,
       except the last one which always is.&lt;/p&gt;&lt;p&gt;The compressed data is stored in the 'data' member variable of the super
       class.&lt;/p&gt;
</code></pre>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="CSJ2K.j2k.entropy.CodedCBlk.html">CodedCBlk</a></div>
    <div class="level2"><span class="xref">CBlkRateDistStats</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="CSJ2K.j2k.entropy.encoder.html">CSJ2K.j2k.entropy.encoder</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.ReportViewer.4.6.2.dll</h6>
  <h5 id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class CBlkRateDistStats : CodedCBlk</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class CBlkRateDistStats
    Inherits CodedCBlk</code></pre>
  </div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats__ctor" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.#ctor">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.-ctor.html#CSJ2K_j2k_entropy_encoder_CBlkRateDistStats__ctor">CBlkRateDistStats()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a new CBlkRateDistStats object without allocating any space for
'truncRates', 'truncSlopes', 'truncDists' and 'truncIdxs' or 'data'.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats__ctor_System_Int32_System_Int32_System_Int32_System_Byte___System_Int32___System_Double___System_Boolean___System_Int32_System_Boolean_" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.#ctor(System.Int32,System.Int32,System.Int32,System.Byte[],System.Int32[],System.Double[],System.Boolean[],System.Int32,System.Boolean)">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.-ctor.html#CSJ2K_j2k_entropy_encoder_CBlkRateDistStats__ctor_System_Int32_System_Int32_System_Int32_System_Byte___System_Int32___System_Double___System_Boolean___System_Int32_System_Boolean_">CBlkRateDistStats(int, int, int, byte[], int[], double[], bool[], int, bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a new CBlkRateDistStats object and initializes the valid
truncation points, their rates and their slopes, from the 'rates' and
'dist' arrays. The 'rates', 'dist' and 'termp' arrays must contain the
rate (in bytes), the reduction in distortion (from nothing coded) and
the flag indicating if termination is used, respectively, for each
truncation point.</p>
<pre><code>       &lt;p&gt;The valid truncation points are selected by taking them as lying on
       a convex hull. This is done by calling the method
       selectConvexHull().&lt;/p&gt;&lt;p&gt;Note that the arrays 'rates' and 'termp' are copied, not referenced,
       so they can be modified after a call to this constructor.&lt;/p&gt;
</code></pre>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="fields">Fields
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_isTermPass" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.isTermPass">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.isTermPass.html">isTermPass</a>
        </td>
        <td class="markdown level1 summary"><p>Array of flags indicating terminated passes (valid or non-valid
truncation points).</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_nROIcoeff" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.nROIcoeff">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.nROIcoeff.html">nROIcoeff</a>
        </td>
        <td class="markdown level1 summary"><p>The number of ROI coefficients in the code-block</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_nROIcp" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.nROIcp">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.nROIcp.html">nROIcp</a>
        </td>
        <td class="markdown level1 summary"><p>Number of ROI coding passes</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_nTotTrunc" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.nTotTrunc">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.nTotTrunc.html">nTotTrunc</a>
        </td>
        <td class="markdown level1 summary"><p>The total number of truncation points</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_nVldTrunc" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.nVldTrunc">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.nVldTrunc.html">nVldTrunc</a>
        </td>
        <td class="markdown level1 summary"><p>The number of valid truncation points</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_sb" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.sb">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.sb.html">sb</a>
        </td>
        <td class="markdown level1 summary"><p>The subband to which the code-block belongs</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_truncDists" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.truncDists">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.truncDists.html">truncDists</a>
        </td>
        <td class="markdown level1 summary"><p>The distortion for each truncation point (valid and non-valid ones)</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_truncIdxs" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.truncIdxs">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.truncIdxs.html">truncIdxs</a>
        </td>
        <td class="markdown level1 summary"><p>The indices of the valid truncation points, in increasing order.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_truncRates" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.truncRates">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.truncRates.html">truncRates</a>
        </td>
        <td class="markdown level1 summary"><p>The rate (in bytes) for each truncation point (valid and non-valid
ones)</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_truncSlopes" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.truncSlopes">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.truncSlopes.html">truncSlopes</a>
        </td>
        <td class="markdown level1 summary"><p>The negative of the rate-distortion slope for each valid truncation
point</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_ToString" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.ToString">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.ToString.html#CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_ToString">ToString()</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the contents of the object in a string. This is used for
debugging.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_selectConvexHull_System_Int32___System_Double___System_Boolean___System_Int32_System_Boolean_" data-uid="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.selectConvexHull(System.Int32[],System.Double[],System.Boolean[],System.Int32,System.Boolean)">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.CBlkRateDistStats.selectConvexHull.html#CSJ2K_j2k_entropy_encoder_CBlkRateDistStats_selectConvexHull_System_Int32___System_Double___System_Boolean___System_Int32_System_Boolean_">selectConvexHull(int[], double[], bool[], int, bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Compute the rate-distorsion slopes and selects those that lie in a
convex hull. It will compute the slopes, select the ones that form the
convex hull and initialize the 'truncIdxs' and 'truncSlopes' arrays, as
well as 'nVldTrunc', with the selected truncation points. It will also
initialize 'truncRates' and 'isTermPass' arrays, as well as
'nTotTrunc', with all the truncation points (selected or not).</p>
<pre><code>       &lt;p&gt; Note that the arrays 'rates' and 'termp' are copied, not
       referenced, so they can be modified after a call to this method.&lt;/p&gt;
</code></pre>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="seealso">See Also</h3>
  <div class="seealso">
      <div><a class="xref" href="CSJ2K.j2k.entropy.CodedCBlk.html">CodedCBlk</a></div>
  </div>

</div>
