jp2codec.entropy.decoder
Interface CodedCBlkDataSrcDec

All Superinterfaces:
InvWTData, MultiResImgData
All Known Implementing Classes:
BitstreamReaderAgent

public interface CodedCBlkDataSrcDec
extends InvWTData

This interface defines a source of entropy coded data and methods to transfer it in a code-block by code-block basis. In each call to 'geCodeBlock()' a specified coded code-block is returned.

This interface is the source of data for the entropy decoder. See the 'EntropyDecoder' class.

For each coded-code-block the entropy-coded data is returned along with its truncation point information in a 'DecLyrdCBlk' object.

See Also:
EntropyDecoder, DecLyrdCBlk, BitstreamReaderAgent

Method Summary
 DecLyrdCBlk getCodeBlock(int c, int m, int n, SubbandSyn sb, int fl, int nl, DecLyrdCBlk ccb)
          Returns the specified coded code-block, for the specified component, in the current tile.
 Coord getNumCodeBlocks(SubbandSyn sb, int c, Coord co)
          Returns the number of code-blocks in a subband, along the horizontal and vertical dimensions.
 
Methods inherited from interface jp2codec.wavelet.synthesis.InvWTData
getPartitionULX, getPartitionULY, getSubbandTree
 
Methods inherited from interface jp2codec.wavelet.synthesis.MultiResImgData
getCompHeight, getCompImgHeight, getCompImgWidth, getCompSubsX, getCompSubsY, getCompWidth, getHeight, getImgHeight, getImgULX, getImgULY, getImgWidth, getNumComps, getNumTiles, getNumTiles, getTile, getTileIdx, getTileOff, getULX, getULY, getWidth, nextTile, setTile
 

Method Detail

getNumCodeBlocks

Coord getNumCodeBlocks(SubbandSyn sb,
                       int c,
                       Coord co)
Returns the number of code-blocks in a subband, along the horizontal and vertical dimensions.

Parameters:
sb - The subband for which to return the number of blocks.
c - The component where the subband is.
co - If not null the values are returned in this object. If null a new object is allocated and returned.
Returns:
The number of code-blocks along the horizontal dimension in 'Coord.x' and the number of code-blocks along the vertical dimension in 'Coord.y'.

getCodeBlock

DecLyrdCBlk getCodeBlock(int c,
                         int m,
                         int n,
                         SubbandSyn sb,
                         int fl,
                         int nl,
                         DecLyrdCBlk ccb)
Returns the specified coded code-block, for the specified component, in the current tile. The first layer to return is indicated by 'fl'. The number of layers that is returned depends on 'nl' and the amount of data available.

The argument 'fl' is to be used by subsequent calls to this method for the same code-block. In this way supplamental data can be retrieved at a later time. The fact that data from more than one layer can be returned means that several packets from the same code-block, of the same component, and the same tile, have been concatenated.

The returned compressed code-block can have its progressive attribute set. If this attribute is set it means that more data can be obtained by subsequent calls to this method (subject to transmission delays, etc). If the progressive attribute is not set it means that the returned data is all the data that can be obtained for the specified subblock.

The compressed code-block is uniquely specified by the current tile, the component (identified by 'c'), the subband (indentified by 'sb') and the code-bock vertical and horizontal indexes 'm' and 'n'.

The 'ulx' and 'uly' members of the returned 'DecLyrdCBlk' object contain the coordinates of the top-left corner of the block, with respect to the tile, not the subband.

Parameters:
c - The index of the component, from 0 to N-1.
m - The vertical index of the code-block to return, in the specified subband.
n - The horizontal index of the code-block to return, in the specified subband.
sb - The subband in whic the requested code-block is.
fl - The first layer to return.
nl - The number of layers to return, if negative all available layers are returned, starting at 'fl'.
ccb - If not null this object is used to return the compressed code-block. If null a new object is created and returned. If the data array in ccb is not null then it can be reused to return the compressed data.
Returns:
The compressed code-block, with a certain number of layers determined by the available data and 'nl'.