Beispiel #1
0
		/// <summary> Initializes the source of compressed data.
		/// 
		/// </summary>
		/// <param name="src">From where to obtain the quantized data.
		/// 
		/// </param>
		/// <param name="rb">The number of "range bits" for each component (must be the
		/// "range bits" of the un-transformed components. For a definition of
		/// "range bits" see the getNomRangeBits() method.
		/// 
		/// </param>
		/// <seealso cref="getNomRangeBits">
		/// 
		/// </seealso>
		public Dequantizer(CBlkQuantDataSrcDec src, int[] utrb, DecoderSpecs decSpec):base(src)
		{
			if (utrb.Length != src.NumComps)
			{
				throw new System.ArgumentException();
			}
			this.src = src;
			this.utrb = utrb;
			this.cts = decSpec.cts;
			this.wfs = decSpec.wfs;
		}
Beispiel #2
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);
		}
Beispiel #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);
		}
Beispiel #4
0
		/// <summary> Constructs a new ForwCompTransf object that operates on the
		/// specified source of image data.
		/// 
		/// </summary>
		/// <param name="imgSrc">The source from where to get the data to be
		/// transformed
		/// 
		/// </param>
		/// <param name="decSpec">The decoder specifications
		/// 
		/// </param>
		/// <param name="utdepth">The bit depth of the un-transformed components 
		/// 
		/// </param>
		/// <param name="pl">The command line optinons of the decoder
		/// 
		/// </param>
		/// <seealso cref="BlkImgDataSrc">
		/// 
		/// </seealso>
		public InvCompTransf(BlkImgDataSrc imgSrc, DecoderSpecs decSpec, int[] utdepth, ParameterList pl):base(imgSrc)
		{
			this.cts = decSpec.cts;
			this.wfs = decSpec.wfs;
			src = imgSrc;
			this.utdepth = utdepth;
			noCompTransf = !(pl.getBooleanParameter("comp_transf"));
		}
Beispiel #5
0
		/// <summary> Constructs a new ForwCompTransf object that operates on the specified
		/// source of image data.
		/// 
		/// </summary>
		/// <param name="imgSrc">The source from where to get the data to be transformed
		/// 
		/// </param>
		/// <param name="encSpec">The encoder specifications
		/// 
		/// </param>
		/// <seealso cref="BlkImgDataSrc">
		/// 
		/// </seealso>
		public ForwCompTransf(BlkImgDataSrc imgSrc, EncoderSpecs encSpec):base(imgSrc)
		{
			this.cts = encSpec.cts;
			this.wfs = encSpec.wfs;
			src = imgSrc;
		}