public class EBCOTRateAllocator extends PostCompRateAllocator
This implementation also provides some timing features. They can be enabled by setting the 'DO_TIMING' constant of this class to true and recompiling. The timing uses the 'System.currentTimeMillis()' Java API call, which returns wall clock time, not the actual CPU time used. The timing results will be printed on the message output. Since the times reported are wall clock times and not CPU usage times they can not be added to find the total used time (i.e. some time might be counted in several places). When timing is disabled ('DO_TIMING' is false) there is no penalty if the compiler performs some basic optimizations. Even if not the penalty should be negligeable.
PostCompRateAllocator
,
CodedCBlkDataSrcEnc
,
CodestreamWriter
numLayers, OPT_PREFIX, src, wp
imgdatasrc, tIdx
Constructor and Description |
---|
EBCOTRateAllocator(CodedCBlkDataSrcEnc src,
LayersInfo lyrs,
CodestreamWriter writer,
J2KImageWriteParamJava wp)
Initializes the EBCOT rate allocator of entropy coded data.
|
Modifier and Type | Method and Description |
---|---|
void |
finalize()
Prints the timing information, if collected, and calls 'finalize' on
the super class.
|
void |
initialize()
Initializes the layers array.
|
void |
runAndWrite()
Runs the rate allocation algorithm and writes the data to the bit
stream writer object provided to the constructor.
|
void |
writeCompPosResLy(int t,
int rs,
int re,
int cs,
int ce,
int[][] lys,
int lye)
Write a piece of bit stream according to the
COMP_POS_RES_LY_PROG progression mode and between given bounds
|
void |
writeLyResCompPos(int t,
int rs,
int re,
int cs,
int ce,
int[][] lys,
int lye)
Write a piece of bit stream according to the
LY_RES_COMP_POS_PROG progression mode and between given bounds
|
void |
writePosCompResLy(int t,
int rs,
int re,
int cs,
int ce,
int[][] lys,
int lye)
Write a piece of bit stream according to the
COMP_POS_RES_LY_PROG progression mode and between given bounds
|
void |
writeResLyCompPos(int t,
int rs,
int re,
int cs,
int ce,
int[][] lys,
int lye)
Write a piece of bit stream according to the
RES_LY_COMP_POS_PROG progression mode and between given bounds
|
void |
writeResPosCompLy(int t,
int rs,
int re,
int cs,
int ce,
int[][] lys,
int lye)
Write a piece of bit stream according to the
RES_POS_COMP_LY_PROG progression mode and between given bounds
|
createInstance, getNumLayers, getParameterInfo, setHeaderEncoder
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 EBCOTRateAllocator(CodedCBlkDataSrcEnc src, LayersInfo lyrs, CodestreamWriter writer, J2KImageWriteParamJava wp)
src
- The source of entropy coded data.lyrs
- The layers layout specification.writer
- The bit stream writer.ProgressionType
public void finalize() throws Throwable
public void runAndWrite() throws IOException
runAndWrite
in class PostCompRateAllocator
IOException
PostCompRateAllocator.initialize()
public void initialize() throws IOException
initialize
in class PostCompRateAllocator
IOException
PostCompRateAllocator.runAndWrite()
public void writeResLyCompPos(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) throws IOException
t
- Tile index.rs
- First resolution level index.re
- Last resolution level index.cs
- First component index.ce
- Last component index.lys
- First layer index for each component and resolution.lye
- Index of the last layer.IOException
public void writeLyResCompPos(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) throws IOException
t
- Tile index.rs
- First resolution level index.re
- Last resolution level index.cs
- First component index.ce
- Last component index.lys
- First layer index for each component and resolution.lye
- Index of the last layer.IOException
public void writePosCompResLy(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) throws IOException
t
- Tile index.rs
- First resolution level index.re
- Last resolution level index.cs
- First component index.ce
- Last component index.lys
- First layer index for each component and resolution.lye
- Index of the last layer.IOException
public void writeCompPosResLy(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) throws IOException
t
- Tile index.rs
- First resolution level index.re
- Last resolution level index.cs
- First component index.ce
- Last component index.lys
- First layer index for each component and resolution.lye
- Index of the last layer.IOException
public void writeResPosCompLy(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) throws IOException
t
- Tile index.rs
- First resolution level index.re
- Last resolution level index.cs
- First component index.ce
- Last component index.lys
- First layer index for each component and resolution.lye
- Last layer index.IOException
Copyright © 2015–2022 SCIFIO. All rights reserved.