Exemplo n.º 1
0
 /// <summary> Initializes the source of entropy coded data.
 ///
 /// </summary>
 /// <param name="src">The source of entropy coded data.
 ///
 /// </param>
 /// <param name="ln">The number of layers to create
 ///
 /// </param>
 /// <param name="pt">The progressive type, as defined in 'ProgressionType'.
 ///
 /// </param>
 /// <param name="bw">The packet bit stream writer.
 ///
 /// </param>
 /// <seealso cref="ProgressionType">
 ///
 /// </seealso>
 public PostCompRateAllocator(CodedCBlkDataSrcEnc src, int nl, CodestreamWriter bw, EncoderSpecs encSpec) : base(src)
 {
     this.src     = src;
     this.encSpec = encSpec;
     num_Layers   = nl;
     bsWriter     = bw;
 }
Exemplo n.º 2
0
        /// <summary> Creates a PostCompRateAllocator object for the appropriate rate
        /// allocation parameters in the parameter list 'pl', having 'src' as the
        /// source of entropy coded data, 'rate' as the target bitrate and 'bw' as
        /// the bit stream writer object.
        ///
        /// </summary>
        /// <param name="src">The source of entropy coded data.
        ///
        /// </param>
        /// <param name="pl">The parameter lis (or options).
        ///
        /// </param>
        /// <param name="rate">The target bitrate for the rate allocation
        ///
        /// </param>
        /// <param name="bw">The bit stream writer object, where the bit stream data will
        /// be written.
        ///
        /// </param>
        public static PostCompRateAllocator createInstance(CodedCBlkDataSrcEnc src, ParameterList pl, float rate, CodestreamWriter bw, EncoderSpecs encSpec)
        {
            // Check parameters
            pl.checkList(OPT_PREFIX, CSJ2K.j2k.util.ParameterList.toNameArray(pinfo));

            // Construct the layer specification from the 'Alayers' option
            LayersInfo lyrs = parseAlayers(pl.getParameter("Alayers"), rate);

            int nTiles    = encSpec.nTiles;
            int nComp     = encSpec.nComp;
            int numLayers = lyrs.TotNumLayers;

            // Parse the progressive type
            encSpec.pocs = new ProgressionSpec(nTiles, nComp, numLayers, encSpec.dls, ModuleSpec.SPEC_TYPE_TILE_COMP, pl);

            return(new EBCOTRateAllocator(src, lyrs, bw, encSpec, pl));
        }