# CSJ2K.j2k.entropy.encoder.PostCompRateAllocator

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="CSJ2K_j2k_entropy_encoder_PostCompRateAllocator" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator" class="text-break">PostCompRateAllocator Class
</h1>
  <div class="markdown level0 summary"><p>This is the abstract class from which post-compression rate allocators
which generate layers should inherit. The source of data is a
'CodedCBlkDataSrcEnc' which delivers entropy coded blocks with
rate-distortion statistics.</p>
<pre><code>       &lt;p&gt;The post compression rate allocator implementation should create the
       layers, according to a rate allocation policy, and send the packets to a
       CodestreamWriter. Since the rate allocator sends the packets to the bit
       stream then it should output the packets to the bit stream in the order
       imposed by the bit stream profiles.&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.image.ImgDataAdapter.html">ImgDataAdapter</a></div>
    <div class="level2"><span class="xref">PostCompRateAllocator</span></div>
      <div class="level3"><a class="xref" href="CSJ2K.j2k.entropy.encoder.EBCOTRateAllocator.html">EBCOTRateAllocator</a></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="CSJ2K.j2k.image.ImgData.html">ImgData</a></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_PostCompRateAllocator_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract class PostCompRateAllocator : ImgDataAdapter, ImgData</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public MustInherit Class PostCompRateAllocator
    Inherits ImgDataAdapter
    Implements ImgData</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_PostCompRateAllocator__ctor_CSJ2K_j2k_entropy_encoder_CodedCBlkDataSrcEnc_System_Int32_CSJ2K_j2k_codestream_writer_CodestreamWriter_CSJ2K_j2k_encoder_EncoderSpecs_" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.#ctor(CSJ2K.j2k.entropy.encoder.CodedCBlkDataSrcEnc,System.Int32,CSJ2K.j2k.codestream.writer.CodestreamWriter,CSJ2K.j2k.encoder.EncoderSpecs)">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.-ctor.html#CSJ2K_j2k_entropy_encoder_PostCompRateAllocator__ctor_CSJ2K_j2k_entropy_encoder_CodedCBlkDataSrcEnc_System_Int32_CSJ2K_j2k_codestream_writer_CodestreamWriter_CSJ2K_j2k_encoder_EncoderSpecs_">PostCompRateAllocator(CodedCBlkDataSrcEnc, int, CodestreamWriter, EncoderSpecs)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes the source of entropy coded data.</p>
</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_PostCompRateAllocator_OPT_PREFIX" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.OPT_PREFIX">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.OPT_PREFIX.html">OPT_PREFIX</a>
        </td>
        <td class="markdown level1 summary"><p>The prefix for rate allocation options: 'A'</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_encSpec" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.encSpec">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.encSpec.html">encSpec</a>
        </td>
        <td class="markdown level1 summary"><p>The source of entropy coded data</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_num_Layers" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.num_Layers">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.num_Layers.html">num_Layers</a>
        </td>
        <td class="markdown level1 summary"><p>The number of layers.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_src" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.src">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.src.html">src</a>
        </td>
        <td class="markdown level1 summary"><p>The source of entropy coded data</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</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_PostCompRateAllocator_HeaderEncoder" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.HeaderEncoder">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.HeaderEncoder.html#CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_HeaderEncoder">HeaderEncoder</a>
        </td>
        <td class="markdown level1 summary"><p>Keep a reference to the header encoder.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_NumLayers" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.NumLayers">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.NumLayers.html#CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_NumLayers">NumLayers</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the number of layers that are actually generated.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_ParameterInfo" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.ParameterInfo">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.ParameterInfo.html#CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_ParameterInfo">ParameterInfo</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the parameters that are used in this class and implementing
classes. It returns a 2D String array. Each of the 1D arrays is for a
different option, and they have 3 elements. The first element is the
option name, the second one is the synopsis, the third one is a long
description of what the parameter is and the fourth is its default
value. The synopsis or description may be 'null', in which case it is
assumed that there is no synopsis or description of the option,
respectively. Null may be returned if no options are supported.</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_PostCompRateAllocator_createInstance_CSJ2K_j2k_entropy_encoder_CodedCBlkDataSrcEnc_CSJ2K_j2k_util_ParameterList_System_Single_CSJ2K_j2k_codestream_writer_CodestreamWriter_CSJ2K_j2k_encoder_EncoderSpecs_" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.createInstance(CSJ2K.j2k.entropy.encoder.CodedCBlkDataSrcEnc,CSJ2K.j2k.util.ParameterList,System.Single,CSJ2K.j2k.codestream.writer.CodestreamWriter,CSJ2K.j2k.encoder.EncoderSpecs)">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.createInstance.html#CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_createInstance_CSJ2K_j2k_entropy_encoder_CodedCBlkDataSrcEnc_CSJ2K_j2k_util_ParameterList_System_Single_CSJ2K_j2k_codestream_writer_CodestreamWriter_CSJ2K_j2k_encoder_EncoderSpecs_">createInstance(CodedCBlkDataSrcEnc, ParameterList, float, CodestreamWriter, EncoderSpecs)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a PostCompRateAllocator object for the appropriate rate
allocation parameters in the parameter list 'pl', having 'src' as the
source of entropy coded data, 'rate' as the target bitrate and 'bw' as
the bit stream writer object.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_initialize" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.initialize">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.initialize.html#CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_initialize">initialize()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes the rate allocation points, taking into account header
overhead and such. This method must be called after the header has been
simulated but before calling the runAndWrite() one. The header must be
rewritten after a call to this method since the number of layers may
change.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_runAndWrite" data-uid="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.runAndWrite">
          <a class="xref" href="CSJ2K.j2k.entropy.encoder.PostCompRateAllocator.runAndWrite.html#CSJ2K_j2k_entropy_encoder_PostCompRateAllocator_runAndWrite">runAndWrite()</a>
        </td>
        <td class="markdown level1 summary"><p>Runs the rate allocation algorithm and writes the data to the
bit stream. This must be called after the initialize() method.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="seealso">See Also</h3>
  <div class="seealso">
      <div><a class="xref" href="CSJ2K.j2k.entropy.encoder.CodedCBlkDataSrcEnc.html">CodedCBlkDataSrcEnc</a></div>
  </div>

</div>
