Пример #1
0
        /// <summary> Initialize all members with the given number of tiles and components.
        ///
        /// </summary>
        /// <param name="nt">Number of tiles
        ///
        /// </param>
        /// <param name="nc">Number of components
        ///
        /// </param>
        public DecoderSpecs(int nt, int nc)
        {
            // Quantization
            qts  = new QuantTypeSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP);
            qsss = new QuantStepSizeSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP);
            gbs  = new GuardBitsSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP);

            // Wavelet transform
            wfs = new SynWTFilterSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP);
            dls = new IntegerSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP);

            // Component transformation
            cts = new CompTransfSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP);

            // Entropy decoder
            ecopts = new ModuleSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP);
            ers    = new ModuleSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP);
            cblks  = new CBlkSizeSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP);

            // Precinct partition
            pss = new PrecinctSizeSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, dls);

            // Codestream
            nls  = new IntegerSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE);
            pos  = new IntegerSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE);
            pcs  = new ModuleSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE);
            sops = new ModuleSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE);
            ephs = new ModuleSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE);
            pphs = new ModuleSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE);
            iccs = new ModuleSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE);
            pphs.setDefault((System.Object)false);
        }
Пример #2
0
 /// <summary> Initializes the source of compressed data. And sets the number of range
 /// bits and fraction bits and receives the parameters for the dequantizer.
 ///
 /// </summary>
 /// <param name="src">From where to obtain the quantized data.
 ///
 /// </param>
 /// <param name="rb">The number of "range bits" (bitdepth) for each component
 /// (must be the "range bits" of the un-transformed components). For a
 /// definition of "range bits" see the getNomRangeBits() method.
 ///
 /// </param>
 /// <param name="qts">The quantizer type spec
 ///
 /// </param>
 /// <param name="qsss">The dequantizer step sizes spec
 ///
 /// </param>
 /// <seealso cref="Dequantizer.getNomRangeBits">
 ///
 /// </seealso>
 /// <exception cref="IllegalArgumentException">Thrown if 'outdt' is neither
 /// TYPE_FLOAT nor TYPE_INT, or if 'param' specify reversible quantization
 /// and 'outdt' is not TYPE_INT or 'fp' has non-zero values, or if 'outdt'
 /// is TYPE_FLOAT and 'fp' has non-zero values.
 ///
 /// </exception>
 public StdDequantizer(CBlkQuantDataSrcDec src, int[] utrb, DecoderSpecs decSpec) : base(src, utrb, decSpec)
 {
     if (utrb.Length != src.NumComps)
     {
         throw new System.ArgumentException("Invalid rb argument");
     }
     this.qsss = decSpec.qsss;
     this.qts  = decSpec.qts;
     this.gbs  = decSpec.gbs;
 }
Пример #3
0
        /// <summary> Initialize all members with the given number of tiles and components
        /// and the command-line arguments stored in a ParameterList instance
        ///
        /// </summary>
        /// <param name="nt">Number of tiles
        ///
        /// </param>
        /// <param name="nc">Number of components
        ///
        /// </param>
        /// <param name="imgsrc">The image source (used to get the image size)
        ///
        /// </param>
        /// <param name="pl">The ParameterList instance
        ///
        /// </param>
        public EncoderSpecs(int nt, int nc, BlkImgDataSrc imgsrc, ParameterList pl)
        {
            nTiles = nt;
            nComp  = nc;

            // ROI
            rois = new MaxShiftSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP);

            // Quantization
            pl.checkList(Quantizer.OPT_PREFIX, CSJ2K.j2k.util.ParameterList.toNameArray(Quantizer.ParameterInfo));
            qts  = new QuantTypeSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, pl);
            qsss = new QuantStepSizeSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, pl);
            gbs  = new GuardBitsSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, pl);

            // Wavelet transform
            wfs = new AnWTFilterSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, qts, pl);
            dls = new IntegerSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, pl, "Wlev");

            // Component transformation
            cts = new ForwCompTransfSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE, wfs, pl);

            // Entropy coder
            System.String[] strLcs = new System.String[] { "near_opt", "lazy_good", "lazy" };
            lcs = new StringSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, "Clen_calc", strLcs, pl);
            System.String[] strTerm = new System.String[] { "near_opt", "easy", "predict", "full" };
            tts = new StringSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, "Cterm_type", strTerm, pl);
            System.String[] strBoolean = new System.String[] { "on", "off" };
            sss   = new StringSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, "Cseg_symbol", strBoolean, pl);
            css   = new StringSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, "Ccausal", strBoolean, pl);
            rts   = new StringSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, "Cterminate", strBoolean, pl);
            mqrs  = new StringSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, "CresetMQ", strBoolean, pl);
            bms   = new StringSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, "Cbypass", strBoolean, pl);
            cblks = new CBlkSizeSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, pl);

            // Precinct partition
            pss = new PrecinctSizeSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE_COMP, imgsrc, dls, pl);

            // Codestream
            sops = new StringSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE, "Psop", strBoolean, pl);
            ephs = new StringSpec(nt, nc, ModuleSpec.SPEC_TYPE_TILE, "Peph", strBoolean, pl);
        }
Пример #4
0
 /// <summary> 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>After initializing member attributes, getAnSubbandTree is called for
 /// all components setting the 'stepWMSE' for all subbands in the current
 /// tile.</p>
 ///
 /// </summary>
 /// <param name="src">The source of wavelet transform coefficients.
 ///
 /// </param>
 /// <param name="encSpec">The encoder specifications
 ///
 /// </param>
 public StdQuantizer(CBlkWTDataSrc src, EncoderSpecs encSpec) : base(src)
 {
     qts  = encSpec.qts;
     qsss = encSpec.qsss;
     gbs  = encSpec.gbs;
 }