C# Class CSJ2K.j2k.entropy.encoder.PostCompRateAllocator

This is the abstract class from which post-compression rate allocators which generate layers should inherit. The source of data is a 'CodedCBlkDataSrcEnc' which delivers entropy coded blocks with rate-distortion statistics.

The post compression rate allocator implementation should create the layers, according to a rate allocation policy, and send the packets to a CodestreamWriter. Since the rate allocator sends the packets to the bit stream then it should output the packets to the bit stream in the order imposed by the bit stream profiles.

Inheritance: CSJ2K.j2k.image.ImgDataAdapter
Show file Open project: cureos/csj2k Class Usage Examples

Protected Properties

Property Type Description
encSpec CSJ2K.j2k.encoder.EncoderSpecs
num_Layers int
src CodedCBlkDataSrcEnc

Public Methods

Method Description
PostCompRateAllocator ( CodedCBlkDataSrcEnc src, int nl, CSJ2K.j2k.codestream.writer.CodestreamWriter bw, CSJ2K.j2k.encoder.EncoderSpecs encSpec ) : System

Initializes the source of entropy coded data.

createInstance ( CodedCBlkDataSrcEnc src, CSJ2K.j2k.util.ParameterList pl, float rate, CSJ2K.j2k.codestream.writer.CodestreamWriter bw, CSJ2K.j2k.encoder.EncoderSpecs encSpec ) : PostCompRateAllocator

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.

initialize ( ) : void

Initializes the rate allocation points, taking into account header overhead and such. This method must be called after the header has been simulated but before calling the runAndWrite() one. The header must be rewritten after a call to this method since the number of layers may change.

runAndWrite ( ) : void

Runs the rate allocation algorithm and writes the data to the bit stream. This must be called after the initialize() method.

Private Methods

Method Description
parseAlayers ( System params_Renamed, float rate ) : CSJ2K.j2k.entropy.encoder.LayersInfo

Convenience method that parses the 'Alayers' option.

Method Details

PostCompRateAllocator() public method

Initializes the source of entropy coded data.
public PostCompRateAllocator ( CodedCBlkDataSrcEnc src, int nl, CSJ2K.j2k.codestream.writer.CodestreamWriter bw, CSJ2K.j2k.encoder.EncoderSpecs encSpec ) : System
src CodedCBlkDataSrcEnc The source of entropy coded data. /// ///
nl int
bw CSJ2K.j2k.codestream.writer.CodestreamWriter The packet bit stream writer. /// ///
encSpec CSJ2K.j2k.encoder.EncoderSpecs
return System

createInstance() public static method

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.
public static createInstance ( CodedCBlkDataSrcEnc src, CSJ2K.j2k.util.ParameterList pl, float rate, CSJ2K.j2k.codestream.writer.CodestreamWriter bw, CSJ2K.j2k.encoder.EncoderSpecs encSpec ) : PostCompRateAllocator
src CodedCBlkDataSrcEnc The source of entropy coded data. /// ///
pl CSJ2K.j2k.util.ParameterList The parameter lis (or options). /// ///
rate float The target bitrate for the rate allocation /// ///
bw CSJ2K.j2k.codestream.writer.CodestreamWriter The bit stream writer object, where the bit stream data will /// be written. /// ///
encSpec CSJ2K.j2k.encoder.EncoderSpecs
return PostCompRateAllocator

initialize() public abstract method

Initializes the rate allocation points, taking into account header overhead and such. This method must be called after the header has been simulated but before calling the runAndWrite() one. The header must be rewritten after a call to this method since the number of layers may change.
public abstract initialize ( ) : void
return void

runAndWrite() public abstract method

Runs the rate allocation algorithm and writes the data to the bit stream. This must be called after the initialize() method.
public abstract runAndWrite ( ) : void
return void

Property Details

encSpec protected property

The source of entropy coded data
protected EncoderSpecs,CSJ2K.j2k.encoder encSpec
return CSJ2K.j2k.encoder.EncoderSpecs

num_Layers protected property

The number of layers.
protected int num_Layers
return int

src protected property

The source of entropy coded data
protected CodedCBlkDataSrcEnc src
return CodedCBlkDataSrcEnc