[]
        
(Showing Draft Content)

CSJ2K.j2k.entropy.encoder.CBlkRateDistStats

CBlkRateDistStats Class

This class stores coded (compressed) code-blocks with their associated rate-distortion statistics. This object should always contain all the compressed data of the code-block. It is applicable to the encoder engine only. Some data of the coded-block is stored in the super class, see CodedCBlk.

       <p>The rate-distortion statistics (i.e. R-D slope) is stored for valid
       points only. The set of valid points is determined by the entropy coder
       engine itself. Normally they are selected so as to lye in a convex hull,
       which can be achived by using the 'selectConvexHull' method of this class,
       but some other strategies might be employed.</p><p>The rate (in bytes) for each truncation point (valid or not) is stored
       in the 'truncRates' array. The rate of a truncation point is the total
       number of bytes in 'data' (see super class) that have to be decoded to
       reach the truncation point.</p><p>The slope (reduction of distortion divided by the increase in rate) at
       each of the valid truncation points is stored in 'truncSlopes'.</p><p>The index of each valid truncation point is stored in 'truncIdxs'. The
       index should be interpreted in the following way: a valid truncation point
       at position 'n' has the index 'truncIdxs[n]', the rate
       'truncRates[truncIdxs[n]]' and the slope 'truncSlopes[n]'. The arrays
       'truncIdxs' and 'truncRates' have at least 'nVldTrunc' elements. The
       'truncRates' array has at least 'nTotTrunc' elements.</p><p>In addition the 'isTermPass' array contains a flag for each truncation
       point (valid and non-valid ones) that tells if the pass is terminated or
       not. If this variable is null then it means that no pass is terminated,
       except the last one which always is.</p><p>The compressed data is stored in the 'data' member variable of the super
       class.</p>
Inheritance
CBlkRateDistStats
Namespace: CSJ2K.j2k.entropy.encoder
Assembly: C1.WPF.PdfViewer.4.6.2.dll
Syntax
public class CBlkRateDistStats : CodedCBlk

Constructors

Name Description
CBlkRateDistStats()

Creates a new CBlkRateDistStats object without allocating any space for 'truncRates', 'truncSlopes', 'truncDists' and 'truncIdxs' or 'data'.

CBlkRateDistStats(int, int, int, byte[], int[], double[], bool[], int, bool)

Creates a new CBlkRateDistStats object and initializes the valid truncation points, their rates and their slopes, from the 'rates' and 'dist' arrays. The 'rates', 'dist' and 'termp' arrays must contain the rate (in bytes), the reduction in distortion (from nothing coded) and the flag indicating if termination is used, respectively, for each truncation point.

       <p>The valid truncation points are selected by taking them as lying on
       a convex hull. This is done by calling the method
       selectConvexHull().</p><p>Note that the arrays 'rates' and 'termp' are copied, not referenced,
       so they can be modified after a call to this constructor.</p>

Fields

Name Description
isTermPass

Array of flags indicating terminated passes (valid or non-valid truncation points).

nROIcoeff

The number of ROI coefficients in the code-block

nROIcp

Number of ROI coding passes

nTotTrunc

The total number of truncation points

nVldTrunc

The number of valid truncation points

sb

The subband to which the code-block belongs

truncDists

The distortion for each truncation point (valid and non-valid ones)

truncIdxs

The indices of the valid truncation points, in increasing order.

truncRates

The rate (in bytes) for each truncation point (valid and non-valid ones)

truncSlopes

The negative of the rate-distortion slope for each valid truncation point

Methods

Name Description
ToString()

Returns the contents of the object in a string. This is used for debugging.

selectConvexHull(int[], double[], bool[], int, bool)

Compute the rate-distorsion slopes and selects those that lie in a convex hull. It will compute the slopes, select the ones that form the convex hull and initialize the 'truncIdxs' and 'truncSlopes' arrays, as well as 'nVldTrunc', with the selected truncation points. It will also initialize 'truncRates' and 'isTermPass' arrays, as well as 'nTotTrunc', with all the truncation points (selected or not).

       <p> Note that the arrays 'rates' and 'termp' are copied, not
       referenced, so they can be modified after a call to this method.</p>

See Also