public abstract class PostCompRateAllocator extends ImgDataAdapter
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.
CodedCBlkDataSrcEnc
,
CodestreamWriter
Modifier and Type | Field and Description |
---|---|
(package private) CodestreamWriter |
bsWriter
The bit-stream writer
|
(package private) HeaderEncoder |
headEnc
The header encoder
|
protected int |
numLayers
The number of layers.
|
static char |
OPT_PREFIX
The prefix for rate allocation options: 'A'
|
private static String[][] |
pinfo
The list of parameters that is accepted for entropy coding.
|
protected CodedCBlkDataSrcEnc |
src
The source of entropy coded data
|
protected J2KImageWriteParamJava |
wp
The source of entropy coded data
|
imgdatasrc, tIdx
Constructor and Description |
---|
PostCompRateAllocator(CodedCBlkDataSrcEnc src,
int nl,
CodestreamWriter bw,
J2KImageWriteParamJava wp)
Initializes the source of entropy coded data.
|
Modifier and Type | Method and Description |
---|---|
static PostCompRateAllocator |
createInstance(CodedCBlkDataSrcEnc src,
float rate,
CodestreamWriter bw,
J2KImageWriteParamJava wp)
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.
|
int |
getNumLayers()
Returns the number of layers that are actually generated.
|
static String[][] |
getParameterInfo()
Returns the parameters that are used in this class and implementing
classes.
|
abstract void |
initialize()
Initializes the rate allocation points, taking into account header
overhead and such.
|
private static LayersInfo |
parseAlayers(String params,
float rate)
Convenience method that parses the 'Alayers' option.
|
abstract void |
runAndWrite()
Runs the rate allocation algorithm and writes the data to the
bit stream.
|
void |
setHeaderEncoder(HeaderEncoder headEnc)
Keep a reference to the header encoder.
|
getCompImgHeight, getCompImgWidth, getCompSubsX, getCompSubsY, getCompULX, getCompULY, getImgHeight, getImgULX, getImgULY, getImgWidth, getNomRangeBits, getNomTileHeight, getNomTileWidth, getNumComps, getNumTiles, getNumTiles, getTile, getTileCompHeight, getTileCompWidth, getTileHeight, getTileIdx, getTilePartULX, getTilePartULY, getTileWidth, nextTile, setTile
public static final char OPT_PREFIX
private static final String[][] pinfo
protected CodedCBlkDataSrcEnc src
protected J2KImageWriteParamJava wp
protected int numLayers
CodestreamWriter bsWriter
HeaderEncoder headEnc
public PostCompRateAllocator(CodedCBlkDataSrcEnc src, int nl, CodestreamWriter bw, J2KImageWriteParamJava wp)
src
- The source of entropy coded data.nl
- The number of layers to createbw
- The packet bit stream writer.wp
- The parameters listProgressionType
public void setHeaderEncoder(HeaderEncoder headEnc)
headEnc
- The header encoderpublic abstract void initialize() throws IOException
IOException
runAndWrite()
public abstract void runAndWrite() throws IOException
IOException
initialize()
public int getNumLayers()
public static String[][] getParameterInfo()
public static PostCompRateAllocator createInstance(CodedCBlkDataSrcEnc src, float rate, CodestreamWriter bw, J2KImageWriteParamJava wp)
src
- The source of entropy coded data.rate
- The target bitrate for the rate allocationbw
- The bit stream writer object, where the bit stream data will
be written.wp
- The parameter list (or options).private static LayersInfo parseAlayers(String params, float rate)
params
- The parameters of the 'Alayers' optionrate
- The overall target bitrateCopyright © 2017 Open Microscopy Environment