# CSJ2K.j2k.quantization.quantizer.StdQuantizer

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="CSJ2K_j2k_quantization_quantizer_StdQuantizer" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer" class="text-break">StdQuantizer Class
</h1>
  <div class="markdown level0 summary"><p>This class implements scalar quantization of integer or floating-point
valued source data. The source data is the wavelet transformed image data
and the output is the quantized wavelet coefficients represented in
sign-magnitude (see below).</p>
<pre><code>       &lt;p&gt;Sign magnitude representation is used (instead of two's complement) for
       the output data. The most significant bit is used for the sign (0 if
       positive, 1 if negative). Then the magnitude of the quantized coefficient
       is stored in the next M most significat bits. The rest of the bits (least
       significant bits) can contain a fractional value of the quantized
       coefficient. This fractional value is not to be coded by the entropy
       coder. However, it can be used to compute rate-distortion measures with
       greater precision.&lt;/p&gt;&lt;p&gt;The value of M is determined for each subband as the sum of the number
       of guard bits G and the nominal range of quantized wavelet coefficients in
       the corresponding subband (Rq), minus 1:&lt;/p&gt;&lt;p&gt;M = G + Rq -1&lt;/p&gt;&lt;p&gt;The value of G should be the same for all subbands. The value of Rq
       depends on the quantization step size, the nominal range of the component
       before the wavelet transform and the analysis gain of the subband (see
       Subband).&lt;/p&gt;&lt;p&gt;The blocks of data that are requested should not cross subband
       boundaries.&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"><a class="xref" href="CSJ2K.j2k.quantization.quantizer.Quantizer.html">Quantizer</a></div>
    <div class="level3"><span class="xref">StdQuantizer</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="CSJ2K.j2k.quantization.quantizer.CBlkQuantDataSrcEnc.html">CBlkQuantDataSrcEnc</a></div>
    <div><a class="xref" href="CSJ2K.j2k.wavelet.analysis.ForwWTDataProps.html">ForwWTDataProps</a></div>
    <div><a class="xref" href="CSJ2K.j2k.image.ImgData.html">ImgData</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="CSJ2K.j2k.quantization.quantizer.html">CSJ2K.j2k.quantization.quantizer</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.ReportViewer.4.6.2.dll</h6>
  <h5 id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class StdQuantizer : Quantizer, CBlkQuantDataSrcEnc, ForwWTDataProps, ImgData</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class StdQuantizer
    Inherits Quantizer
    Implements CBlkQuantDataSrcEnc, ForwWTDataProps, 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_quantization_quantizer_StdQuantizer__ctor_CSJ2K_j2k_wavelet_analysis_CBlkWTDataSrc_CSJ2K_j2k_encoder_EncoderSpecs_" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.#ctor(CSJ2K.j2k.wavelet.analysis.CBlkWTDataSrc,CSJ2K.j2k.encoder.EncoderSpecs)">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.-ctor.html#CSJ2K_j2k_quantization_quantizer_StdQuantizer__ctor_CSJ2K_j2k_wavelet_analysis_CBlkWTDataSrc_CSJ2K_j2k_encoder_EncoderSpecs_">StdQuantizer(CBlkWTDataSrc, EncoderSpecs)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes the source of wavelet transform coefficients. The
constructor takes information on whether the quantizer is in
reversible, derived or expounded mode. If the quantizer is reversible
the value of 'derived' is ignored. If the source data is not integer
(int) then the quantizer can not be reversible.</p>
<pre><code>       &lt;p&gt;After initializing member attributes, getAnSubbandTree is called for
       all components setting the 'stepWMSE' for all subbands in the current
       tile.&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_quantization_quantizer_StdQuantizer_QSTEP_EXPONENT_BITS" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.QSTEP_EXPONENT_BITS">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.QSTEP_EXPONENT_BITS.html">QSTEP_EXPONENT_BITS</a>
        </td>
        <td class="markdown level1 summary"><p>The number of exponent bits for the quantization steps</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_QSTEP_MANTISSA_BITS" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.QSTEP_MANTISSA_BITS">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.QSTEP_MANTISSA_BITS.html">QSTEP_MANTISSA_BITS</a>
        </td>
        <td class="markdown level1 summary"><p>The number of mantissa bits for the quantization steps</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_QSTEP_MAX_EXPONENT" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.QSTEP_MAX_EXPONENT">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.QSTEP_MAX_EXPONENT.html">QSTEP_MAX_EXPONENT</a>
        </td>
        <td class="markdown level1 summary"><p>The maximum value of the exponent for the quantization steps</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_QSTEP_MAX_MANTISSA" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.QSTEP_MAX_MANTISSA">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.QSTEP_MAX_MANTISSA.html">QSTEP_MAX_MANTISSA</a>
        </td>
        <td class="markdown level1 summary"><p>The maximum value of the mantissa for the quantization steps</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_quantization_quantizer_StdQuantizer_QuantTypeSpec" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.QuantTypeSpec">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.QuantTypeSpec.html#CSJ2K_j2k_quantization_quantizer_StdQuantizer_QuantTypeSpec">QuantTypeSpec</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the quantization type spec object associated to the quantizer.</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_quantization_quantizer_StdQuantizer_calcSbParams_CSJ2K_j2k_wavelet_analysis_SubbandAn_System_Int32_" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.calcSbParams(CSJ2K.j2k.wavelet.analysis.SubbandAn,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.calcSbParams.html#CSJ2K_j2k_quantization_quantizer_StdQuantizer_calcSbParams_CSJ2K_j2k_wavelet_analysis_SubbandAn_System_Int32_">calcSbParams(SubbandAn, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Calculates the parameters of the SubbandAn objects that depend on the
Quantizer. The 'stepWMSE' field is calculated for each subband which is
a leaf in the tree rooted at 'sb', for the specified component. The
subband tree 'sb' must be the one for the component 'n'.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_convertToExpMantissa_System_Single_" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.convertToExpMantissa(System.Single)">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.convertToExpMantissa.html#CSJ2K_j2k_quantization_quantizer_StdQuantizer_convertToExpMantissa_System_Single_">convertToExpMantissa(float)</a>
        </td>
        <td class="markdown level1 summary"><p>Converts the floating point value to its exponent-mantissa
representation. The mantissa occupies the 11 least significant bits
(bits 10-0), and the exponent the previous 5 bits (bits 15-11).</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_getMaxMagBits_System_Int32_" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.getMaxMagBits(System.Int32)">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.getMaxMagBits.html#CSJ2K_j2k_quantization_quantizer_StdQuantizer_getMaxMagBits_System_Int32_">getMaxMagBits(int)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the maximum number of magnitude bits in any subband of the
current tile.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_getNextCodeBlock_System_Int32_CSJ2K_j2k_wavelet_analysis_CBlkWTData_" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.getNextCodeBlock(System.Int32,CSJ2K.j2k.wavelet.analysis.CBlkWTData)">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.getNextCodeBlock.html#CSJ2K_j2k_quantization_quantizer_StdQuantizer_getNextCodeBlock_System_Int32_CSJ2K_j2k_wavelet_analysis_CBlkWTData_">getNextCodeBlock(int, CBlkWTData)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the next code-block in the current tile for the specified
component, as a copy (see below). The order in which code-blocks are
returned is not specified. However each code-block is returned only
once and all code-blocks will be returned if the method is called 'N'
times, where 'N' is the number of code-blocks in the tile. After all
the code-blocks have been returned for the current tile calls to this
method will return 'null'.</p>
<pre><code>       &lt;p&gt;When changing the current tile (through 'setTile()' or 'nextTile()')
       this method will always return the first code-block, as if this method
       was never called before for the new current tile.&lt;/p&gt;&lt;p&gt;The data returned by this method is always a copy of the
       data. Therfore it can be modified &quot;in place&quot; without any problems after
       being returned. The 'offset' of the returned data is 0, and the 'scanw'
       is the same as the code-block width. See the 'CBlkWTData' class.&lt;/p&gt;&lt;p&gt;The 'ulx' and 'uly' members of the returned 'CBlkWTData' object
       contain the coordinates of the top-left corner of the block, with
       respect to the tile, not the subband.&lt;/p&gt;
</code></pre>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_getNextInternCodeBlock_System_Int32_CSJ2K_j2k_wavelet_analysis_CBlkWTData_" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.getNextInternCodeBlock(System.Int32,CSJ2K.j2k.wavelet.analysis.CBlkWTData)">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.getNextInternCodeBlock.html#CSJ2K_j2k_quantization_quantizer_StdQuantizer_getNextInternCodeBlock_System_Int32_CSJ2K_j2k_wavelet_analysis_CBlkWTData_">getNextInternCodeBlock(int, CBlkWTData)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the next code-block in the current tile for the specified
component. The order in which code-blocks are returned is not
specified. However each code-block is returned only once and all
code-blocks will be returned if the method is called 'N' times, where
'N' is the number of code-blocks in the tile. After all the code-blocks
have been returned for the current tile calls to this method will
return 'null'.</p>
<pre><code>       &lt;p&gt;When changing the current tile (through 'setTile()' or 'nextTile()')
       this method will always return the first code-block, as if this method
       was never called before for the new current tile.&lt;/p&gt;&lt;p&gt;The data returned by this method can be the data in the internal
       buffer of this object, if any, and thus can not be modified by the
       caller. The 'offset' and 'scanw' of the returned data can be
       arbitrary. See the 'CBlkWTData' class.&lt;/p&gt;&lt;p&gt;The 'ulx' and 'uly' members of the returned 'CBlkWTData' object
       contain the coordinates of the top-left corner of the block, with
       respect to the tile, not the subband.&lt;/p&gt;
</code></pre>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_getNumGuardBits_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.getNumGuardBits(System.Int32,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.getNumGuardBits.html#CSJ2K_j2k_quantization_quantizer_StdQuantizer_getNumGuardBits_System_Int32_System_Int32_">getNumGuardBits(int, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the number of guard bits used by this quantizer in the given
tile-component.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_isDerived_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.isDerived(System.Int32,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.isDerived.html#CSJ2K_j2k_quantization_quantizer_StdQuantizer_isDerived_System_Int32_System_Int32_">isDerived(int, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns true if given tile-component uses derived quantization step
sizes.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_quantization_quantizer_StdQuantizer_isReversible_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.quantization.quantizer.StdQuantizer.isReversible(System.Int32,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.quantization.quantizer.StdQuantizer.isReversible.html#CSJ2K_j2k_quantization_quantizer_StdQuantizer_isReversible_System_Int32_System_Int32_">isReversible(int, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns true if the quantized data is reversible, for the specified
tile-component. For the quantized data to be reversible it is necessary
and sufficient that the quantization is reversible.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="seealso">See Also</h3>
  <div class="seealso">
      <div><a class="xref" href="CSJ2K.j2k.wavelet.Subband.html">Subband</a></div>
      <div><a class="xref" href="CSJ2K.j2k.quantization.quantizer.Quantizer.html">Quantizer</a></div>
  </div>

</div>
