# CSJ2K.j2k.entropy.decoder

## Content

<div class="doc-site-dotnet-api-container">

  <h1 id="CSJ2K_j2k_entropy_decoder" data-uid="CSJ2K.j2k.entropy.decoder" class="text-break">CSJ2K.j2k.entropy.decoder Namespace
</h1>
  <div class="markdown level0 summary"></div>
  <div class="markdown level0 conceptual"></div>
  <div class="markdown level0 remarks"></div>
    <h3 id="classes">
Classes
</h3>
      <h4><a class="xref" href="CSJ2K.j2k.entropy.decoder.ByteInputBuffer.html">ByteInputBuffer</a></h4>
      <section><p>This class provides a byte input facility from byte buffers. It is similar
to the ByteArrayInputStream class, but adds the possibility to add data to
the stream after the creation of the object.</p>
<pre><code>       &lt;p&gt;Unlike the ByteArrayInputStream this class is not thread safe (i.e. no
       two threads can use the same object at the same time, but different objects
       may be used in different threads).&lt;/p&gt;&lt;p&gt;This class can modify the contents of the buffer given to the
       constructor, when the addByteArray() method is called.&lt;/p&gt;
</code></pre>
</section>
      <h4><a class="xref" href="CSJ2K.j2k.entropy.decoder.ByteToBitInput.html">ByteToBitInput</a></h4>
      <section><p>This class provides an adapter to perform bit based input on byte based
output obejcts that inherit from a 'ByteInputBuffer' class. This class also
performs the bit unstuffing procedure specified for the 'selective
arithmetic coding bypass' mode of the JPEG 2000 entropy coder.</p>
</section>
      <h4><a class="xref" href="CSJ2K.j2k.entropy.decoder.DecLyrdCBlk.html">DecLyrdCBlk</a></h4>
      <section><p>This class stores coded (compressed) code-blocks that are organized in
layers. This object can contain either all code-block data (i.e. all
layers), or a subset of all the layers that make up the whole compressed
code-block. It is applicable to the decoder engine only. Some data of the
coded-block is stored in the super class, see CodedCBlk.</p>
<pre><code>       &lt;p&gt;A code-block may have its progressive attribute set (i.e. the 'prog'
       flag is true). If a code-block is progressive then it means that more data
       for it may be obtained for an improved quality. If the progressive flag is
       false then no more data is available from the source for this
       code-block.&lt;/p&gt;
</code></pre>
</section>
      <h4><a class="xref" href="CSJ2K.j2k.entropy.decoder.EntropyDecoder.html">EntropyDecoder</a></h4>
      <section></section>
      <h4><a class="xref" href="CSJ2K.j2k.entropy.decoder.MQDecoder.html">MQDecoder</a></h4>
      <section><p>This class implements the MQ arithmetic decoder. It is implemented using
the software conventions decoder for better performance (i.e. execution
time performance). The initial states for each context of the MQ-coder are
specified in the constructor.</p>
</section>
      <h4><a class="xref" href="CSJ2K.j2k.entropy.decoder.StdEntropyDecoder.html">StdEntropyDecoder</a></h4>
      <section><p>This class implements the JPEG 2000 entropy decoder, which codes stripes in
code-blocks. This entropy decoding engine decodes one code-block at a time.</p>
<pre><code>       &lt;p&gt;The code-blocks are rectangular and their dimensions must be powers of
       2. Each dimension cannot be smaller than 4 and larger than 256. The product
       of the two dimensions (i.e. area of the code-block) cannot exceed 4096.&lt;/p&gt;&lt;p&gt;Context 0 of the MQ-coder is used as the uniform one (uniform,
       non-adaptive probability distribution). Context 1 is used for RLC
       coding. Contexts 2-10 are used for zero-coding (ZC), contexts 11-15 are
       used for sign-coding (SC) and contexts 16-18 are used for
       magnitude-refinement (MR).&lt;/p&gt;&lt;p&gt;This implementation also provides some timing features. They can be
       enabled by setting the 'DO_TIMING' constant of this class to true and
       recompiling. The timing uses the 'System.currentTimeMillis()' Java API
       call, which returns wall clock time, not the actual CPU time used. The
       timing results will be printed on the message output. Since the times
       reported are wall clock times and not CPU usage times they can not be added
       to find the total used time (i.e. some time might be counted in several
       places). When timing is disabled ('DO_TIMING' is false) there is no penalty
       if the compiler performs some basic optimizations. Even if not the penalty
       should be negligeable.&lt;/p&gt;
</code></pre>
</section>
    <h3 id="interfaces">
Interfaces
</h3>
      <h4><a class="xref" href="CSJ2K.j2k.entropy.decoder.CodedCBlkDataSrcDec.html">CodedCBlkDataSrcDec</a></h4>
      <section><p>This interface defines a source of entropy coded data and methods to
transfer it in a code-block by code-block basis. In each call to
'geCodeBlock()' a specified coded code-block is returned.</p>
<pre><code>       &lt;p&gt;This interface is the source of data for the entropy decoder. See the
       'EntropyDecoder' class.&lt;/p&gt;&lt;p&gt;For each coded-code-block the entropy-coded data is returned along with
       its truncation point information in a 'DecLyrdCBlk' object.&lt;/p&gt;
</code></pre>
</section>


</div>
