# CSJ2K.j2k.entropy.decoder.MQDecoder

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="CSJ2K_j2k_entropy_decoder_MQDecoder" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder" class="text-break">MQDecoder Class
</h1>
  <div class="markdown level0 summary"><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>
</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"><span class="xref">MQDecoder</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="CSJ2K.j2k.entropy.decoder.html">CSJ2K.j2k.entropy.decoder</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.ReportViewer.4.6.2.dll</h6>
  <h5 id="CSJ2K_j2k_entropy_decoder_MQDecoder_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class MQDecoder</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class MQDecoder</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_decoder_MQDecoder__ctor_CSJ2K_j2k_entropy_decoder_ByteInputBuffer_System_Int32_System_Int32___" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.#ctor(CSJ2K.j2k.entropy.decoder.ByteInputBuffer,System.Int32,System.Int32[])">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.MQDecoder.-ctor.html#CSJ2K_j2k_entropy_decoder_MQDecoder__ctor_CSJ2K_j2k_entropy_decoder_ByteInputBuffer_System_Int32_System_Int32___">MQDecoder(ByteInputBuffer, int, int[])</a>
        </td>
        <td class="markdown level1 summary"><p>Instantiates a new MQ-decoder, with the specified number of contexts
and initial states. The compressed bytestream is read from the
'iStream' object.</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_decoder_MQDecoder_ByteInputBuffer" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.ByteInputBuffer">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.MQDecoder.ByteInputBuffer.html#CSJ2K_j2k_entropy_decoder_MQDecoder_ByteInputBuffer">ByteInputBuffer</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the underlying 'ByteInputBuffer' from where the MQ coded input
bytes are read.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_decoder_MQDecoder_NumCtxts" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.NumCtxts">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.MQDecoder.NumCtxts.html#CSJ2K_j2k_entropy_decoder_MQDecoder_NumCtxts">NumCtxts</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the number of contexts in the arithmetic coder.</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_decoder_MQDecoder_checkPredTerm" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.checkPredTerm">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.MQDecoder.checkPredTerm.html#CSJ2K_j2k_entropy_decoder_MQDecoder_checkPredTerm">checkPredTerm()</a>
        </td>
        <td class="markdown level1 summary"><p>Checks for past errors in the decoding process using the predictable
error resilient termination. This works only if the encoder used the
predictable error resilient MQ termination, otherwise it reports wrong
results. If an error is detected it means that the MQ bit stream has
been wrongly decoded or that the MQ terminated segment length is too
long. If no errors are detected it does not necessarily mean that the
MQ bit stream has been correctly decoded.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_decoder_MQDecoder_decodeSymbol_System_Int32_" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.decodeSymbol(System.Int32)">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.MQDecoder.decodeSymbol.html#CSJ2K_j2k_entropy_decoder_MQDecoder_decodeSymbol_System_Int32_">decodeSymbol(int)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_decoder_MQDecoder_decodeSymbols_System_Int32___System_Int32___System_Int32_" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.decodeSymbols(System.Int32[],System.Int32[],System.Int32)">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.MQDecoder.decodeSymbols.html#CSJ2K_j2k_entropy_decoder_MQDecoder_decodeSymbols_System_Int32___System_Int32___System_Int32_">decodeSymbols(int[], int[], int)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_decoder_MQDecoder_nextSegment_System_Byte___System_Int32_System_Int32_" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.nextSegment(System.Byte[],System.Int32,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.MQDecoder.nextSegment.html#CSJ2K_j2k_entropy_decoder_MQDecoder_nextSegment_System_Byte___System_Int32_System_Int32_">nextSegment(byte[], int, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Resets the MQ decoder to start a new segment. This is like recreating a
new MQDecoder object with new input data.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_decoder_MQDecoder_resetCtxt_System_Int32_" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.resetCtxt(System.Int32)">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.MQDecoder.resetCtxt.html#CSJ2K_j2k_entropy_decoder_MQDecoder_resetCtxt_System_Int32_">resetCtxt(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Resets a context to the original probability distribution.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_decoder_MQDecoder_resetCtxts" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.resetCtxts">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.MQDecoder.resetCtxts.html#CSJ2K_j2k_entropy_decoder_MQDecoder_resetCtxts">resetCtxts()</a>
        </td>
        <td class="markdown level1 summary"><p>Resets a context to the original probability distribution. The original
probability distribution depends on the actual implementation of the
arithmetic coder or decoder.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
