| java.lang.Object jj2000.j2k.image.ImgDataAdapter jj2000.j2k.entropy.encoder.PostCompRateAllocator jj2000.j2k.entropy.encoder.EBCOTRateAllocator
EBCOTRateAllocator | public class EBCOTRateAllocator extends PostCompRateAllocator (Code) | | This implements the EBCOT post compression rate allocation algorithm. This
algorithm finds the most suitable truncation points for the set of
code-blocks, for each layer target bitrate. It works by first collecting
the rate distortion info from all code-blocks, in all tiles and all
components, and then running the rate-allocation on the whole image at
once, for each layer.
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.
See Also: PostCompRateAllocator See Also: CodedCBlkDataSrcEnc See Also: jj2000.j2k.codestream.writer.CodestreamWriter |
Method Summary | |
public void | finalize() Prints the timing information, if collected, and calls 'finalize' on
the super class. | public void | initialize() Initializes the layers array. | public void | runAndWrite() Runs the rate allocation algorithm and writes the data to the bit
stream writer object provided to the constructor. | public void | writeCompPosResLy(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) | public void | writeLyResCompPos(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) | public void | writePosCompResLy(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) | public void | writeResLyCompPos(int t, int rs, int re, int cs, int ce, int lys, int lye) | public void | writeResPosCompLy(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) |
EBCOTRateAllocator | public EBCOTRateAllocator(CodedCBlkDataSrcEnc src, LayersInfo lyrs, CodestreamWriter writer, J2KImageWriteParamJava wp)(Code) | | Initializes the EBCOT rate allocator of entropy coded data. The layout
of layers, and their bitrate constraints, is specified by the 'lyrs'
parameter.
Parameters: src - The source of entropy coded data. Parameters: lyrs - The layers layout specification. Parameters: writer - The bit stream writer. See Also: ProgressionType |
finalize | public void finalize() throws Throwable(Code) | | Prints the timing information, if collected, and calls 'finalize' on
the super class.
|
initialize | public void initialize() throws IOException(Code) | | Initializes the layers array. This must be called after the main header
has been entirely written or simulated, so as to take its overhead into
account. This method will get all the code-blocks and then initialize
the target bitrates for each layer, according to the specifications.
|
runAndWrite | public void runAndWrite() throws IOException(Code) | | Runs the rate allocation algorithm and writes the data to the bit
stream writer object provided to the constructor.
|
writeCompPosResLy | public void writeCompPosResLy(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) throws IOException(Code) | | Write a piece of bit stream according to the
COMP_POS_RES_LY_PROG progression mode and between given bounds
Parameters: t - Tile index. Parameters: rs - First resolution level index. Parameters: re - Last resolution level index. Parameters: cs - First component index. Parameters: ce - Last component index. Parameters: lys - First layer index for each component and resolution. Parameters: lye - Index of the last layer. |
writeLyResCompPos | public void writeLyResCompPos(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) throws IOException(Code) | | Write a piece of bit stream according to the
LY_RES_COMP_POS_PROG progression mode and between given bounds
Parameters: t - Tile index. Parameters: rs - First resolution level index. Parameters: re - Last resolution level index. Parameters: cs - First component index. Parameters: ce - Last component index. Parameters: lys - First layer index for each component and resolution. Parameters: lye - Index of the last layer. |
writePosCompResLy | public void writePosCompResLy(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) throws IOException(Code) | | Write a piece of bit stream according to the
COMP_POS_RES_LY_PROG progression mode and between given bounds
Parameters: t - Tile index. Parameters: rs - First resolution level index. Parameters: re - Last resolution level index. Parameters: cs - First component index. Parameters: ce - Last component index. Parameters: lys - First layer index for each component and resolution. Parameters: lye - Index of the last layer. |
writeResLyCompPos | public void writeResLyCompPos(int t, int rs, int re, int cs, int ce, int lys, int lye) throws IOException(Code) | | Write a piece of bit stream according to the
RES_LY_COMP_POS_PROG progression mode and between given bounds
Parameters: t - Tile index. Parameters: rs - First resolution level index. Parameters: re - Last resolution level index. Parameters: cs - First component index. Parameters: ce - Last component index. Parameters: lys - First layer index for each component and resolution. Parameters: lye - Index of the last layer. |
writeResPosCompLy | public void writeResPosCompLy(int t, int rs, int re, int cs, int ce, int[][] lys, int lye) throws IOException(Code) | | Write a piece of bit stream according to the
RES_POS_COMP_LY_PROG progression mode and between given bounds
Parameters: t - Tile index. Parameters: rs - First resolution level index. Parameters: re - Last resolution level index. Parameters: cs - First component index. Parameters: ce - Last component index. Parameters: lys - First layer index for each component and resolution. Parameters: lye - Last layer index. |
|
|