| java.lang.Object jj2000.j2k.entropy.CodedCBlk jj2000.j2k.entropy.encoder.CBlkRateDistStats
CBlkRateDistStats | public class CBlkRateDistStats extends CodedCBlk (Code) | | 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.
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.
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.
The slope (reduction of distortion divided by the increase in rate) at
each of the valid truncation points is stored in 'truncSlopes'.
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.
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.
The compressed data is stored in the 'data' member variable of the super
class.
See Also: CodedCBlk |
Constructor Summary | |
public | CBlkRateDistStats() Creates a new CBlkRateDistStats object without allocating any space for
'truncRates', 'truncSlopes', 'truncDists' and 'truncIdxs' or 'data'. | public | CBlkRateDistStats(int m, int n, int skipMSBP, byte data, int rates, double dists, boolean termp, int np, boolean inclast) Creates a new CBlkRateDistStats object and initializes the valid
truncation points, their rates and their slopes, from the 'rates' and
'dist' arrays. |
Method Summary | |
public void | selectConvexHull(int rates, double dists, boolean termp, int n, boolean inclast) Compute the rate-distorsion slopes and selects those that lie in a
convex hull. | public String | toString() Returns the contents of the object in a string. |
isTermPass | public boolean isTermPass(Code) | | Array of flags indicating terminated passes (valid or non-valid
truncation points).
|
nROIcoeff | public int nROIcoeff(Code) | | The number of ROI coefficients in the code-block
|
nROIcp | public int nROIcp(Code) | | Number of ROI coding passes
|
nTotTrunc | public int nTotTrunc(Code) | | The total number of truncation points
|
nVldTrunc | public int nVldTrunc(Code) | | The number of valid truncation points
|
truncDists | public double truncDists(Code) | | The distortion for each truncation point (valid and non-valid ones)
|
truncIdxs | public int truncIdxs(Code) | | The indices of the valid truncation points, in increasing
order.
|
truncRates | public int truncRates(Code) | | The rate (in bytes) for each truncation point (valid and non-valid
ones)
|
truncSlopes | public float truncSlopes(Code) | | The negative of the rate-distortion slope for each valid truncation
point
|
CBlkRateDistStats | public CBlkRateDistStats()(Code) | | Creates a new CBlkRateDistStats object without allocating any space for
'truncRates', 'truncSlopes', 'truncDists' and 'truncIdxs' or 'data'.
|
CBlkRateDistStats | public CBlkRateDistStats(int m, int n, int skipMSBP, byte data, int rates, double dists, boolean termp, int np, boolean inclast)(Code) | | 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.
The valid truncation points are selected by taking them as lying on
a convex hull. This is done by calling the method selectConvexHull().
Note that the arrays 'rates' and 'termp' are copied, not
referenced, so they can be modified after a call to this constructor.
Parameters: m - The horizontal index of the code-block, within the subband. Parameters: n - The vertical index of the code-block, within the subband. Parameters: skipMSBP - The number of skipped most significant bit-planes forthis code-block. Parameters: data - The compressed data. This array is referenced by thisobject so it should not be modified after. Parameters: rates - The rates (in bytes) for each truncation point in thecompressed data. This array is modified by the method but no referenceis kept to it. Parameters: dists - The reduction in distortion (with respect to no informationcoded) for each truncation point. This array is modified by the methodbut no reference is kept to it. Parameters: termp - An array of boolean flags indicating, for each pass, if apass is terminated or not (true if terminated). If null then it isassumed that no pass is terminated except the last one which always is. Parameters: np - The number of truncation points contained in 'rates', 'dist'and 'termp'. Parameters: inclast - If false the convex hull is constructed as for lossycoding. If true it is constructed as for lossless coding, in which caseit is ensured that all bit-planes are sent (i.e. the last truncationpoint is always included). |
selectConvexHull | public void selectConvexHull(int rates, double dists, boolean termp, int n, boolean inclast)(Code) | | 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).
Note that the arrays 'rates' and 'termp' are copied, not
referenced, so they can be modified after a call to this method.
Parameters: rates - The rates (in bytes) for each truncation point in thecompressed data. This array is modified by the method. Parameters: dists - The reduction in distortion (with respect to noinformation coded) for each truncation point. This array is modified bythe method. Parameters: termp - An array of boolean flags indicating, for each pass, if apass is terminated or not (true if terminated). If null then it isassumed that no pass is terminated except the last one which always is. Parameters: n - The number of truncation points contained in 'rates', 'dist'and 'termp'. Parameters: inclast - If false the convex hull is constructed as for lossycoding. If true it is constructed as for lossless coding, in which caseit is ensured that all bit-planes are sent (i.e. the last truncationpoint is always included). |
toString | public String toString()(Code) | | Returns the contents of the object in a string. This is used for
debugging.
A string with the contents of the object |
|
|