Method | Description | |
---|---|---|
EBCOTRateAllocator ( CodedCBlkDataSrcEnc src, CSJ2K.j2k.entropy.encoder.LayersInfo lyrs, CSJ2K.j2k.codestream.writer.CodestreamWriter writer, CSJ2K.j2k.encoder.EncoderSpecs encSpec, CSJ2K.j2k.util.ParameterList pl ) : System |
Initializes the EBCOT rate allocator of entropy coded data. The layout of layers, and their bitrate constraints, is specified by the 'lyrs' parameter.
|
|
initialize ( ) : void |
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 ( ) : void |
Runs the rate allocation algorithm and writes the data to the bit stream writer object provided to the constructor.
|
|
writeCompPosResLy ( int t, int rs, int re, int cs, int ce, int lys, int lye ) : void |
Write a piece of bit stream according to the COMP_POS_RES_LY_PROG progression mode and between given bounds
|
|
writeLyResCompPos ( int t, int rs, int re, int cs, int ce, int lys, int lye ) : void |
Write a piece of bit stream according to the LY_RES_COMP_POS_PROG progression mode and between given bounds
|
|
writePosCompResLy ( int t, int rs, int re, int cs, int ce, int lys, int lye ) : void |
Write a piece of bit stream according to the COMP_POS_RES_LY_PROG progression mode and between given bounds
|
|
writeResLyCompPos ( int t, int rs, int re, int cs, int ce, int lys, int lye ) : void |
Write a piece of bit stream according to the RES_LY_COMP_POS_PROG progression mode and between given bounds
|
|
writeResPosCompLy ( int t, int rs, int re, int cs, int ce, int lys, int lye ) : void |
Write a piece of bit stream according to the RES_POS_COMP_LY_PROG progression mode and between given bounds
|
Method | Description | |
---|---|---|
buildAndWriteLayers ( ) : void |
This method builds all the bit stream layers and then writes them to the output bit stream. Firstly it builds all the layers by computing the threshold according to the layer target bit-rate, and then it writes the layer bit streams according to the progressive type.
|
|
estimateLayerThreshold ( int targetBytes, EBCOTLayer lastLayer ) : float |
This function attempts to estimate a rate-distortion slope threshold which will achieve a target number of code bytes close the `targetBytes' value.
|
|
findTruncIndices ( int layerIdx, int compIdx, int lvlIdx, int tileIdx, SubbandAn subb, float fthresh, int precinctIdx ) : void |
This function finds the new truncation points indices for a packet. It does so by including the data from the code-blocks in the component, resolution level and tile, associated with a R-D slope which is larger than or equal to 'fthresh'.
|
|
getAllCodeBlocks ( ) : void |
This method gets all the coded code-blocks from the EBCOT entropy coder for every component and every tile. Each coded code-block is stored in a 5D array according to the component, the resolution level, the tile, the subband it belongs and its position in the subband. For each code-block, the valid slopes are computed and converted into the mantissa-exponent representation.
|
|
getLimitedSIndexFromSlope ( float slope ) : int |
Returns the index of a slope for the summary table, limiting to the admissible values. The index is calculated as RD_SUMMARY_OFF plus the maximum exponent, base 2, that yields a value not larger than the slope itself. If the value to return is lower than 0, 0 is returned. If it is larger than the maximum table index, then the maximum is returned.
|
|
getSlopeFromSIndex ( int index ) : float |
Returns the minimum slope value associated with a summary table index. This minimum slope is just 2^(index-RD_SUMMARY_OFF).
|
|
optimizeBitstreamLayer ( int layerIdx, float fmaxt, int maxBytes, int prevBytes ) : float |
This function implements the rate-distortion optimization algorithm. It saves the state of any previously generated bit-stream layers and then simulate the formation of a new layer in the bit stream as often as necessary to find the smallest rate-distortion threshold such that the total number of bytes required to represent the layer does not exceed `maxBytes' minus `prevBytes'. It then restores the state of any previously generated bit-stream layers and returns the threshold.
|
public EBCOTRateAllocator ( CodedCBlkDataSrcEnc src, CSJ2K.j2k.entropy.encoder.LayersInfo lyrs, CSJ2K.j2k.codestream.writer.CodestreamWriter writer, CSJ2K.j2k.encoder.EncoderSpecs encSpec, CSJ2K.j2k.util.ParameterList pl ) : System | ||
src | CodedCBlkDataSrcEnc | The source of entropy coded data. /// /// |
lyrs | CSJ2K.j2k.entropy.encoder.LayersInfo | The layers layout specification. /// /// |
writer | CSJ2K.j2k.codestream.writer.CodestreamWriter | The bit stream writer. /// /// |
encSpec | CSJ2K.j2k.encoder.EncoderSpecs | |
pl | CSJ2K.j2k.util.ParameterList | |
return | System |
public writeCompPosResLy ( int t, int rs, int re, int cs, int ce, int lys, int lye ) : void | ||
t | int | Tile index. /// /// |
rs | int | First resolution level index. /// /// |
re | int | Last resolution level index. /// /// |
cs | int | First component index. /// /// |
ce | int | Last component index. /// /// |
lys | int | First layer index for each component and resolution. /// /// |
lye | int | Index of the last layer. /// /// |
return | void |
public writeLyResCompPos ( int t, int rs, int re, int cs, int ce, int lys, int lye ) : void | ||
t | int | Tile index. /// /// |
rs | int | First resolution level index. /// /// |
re | int | Last resolution level index. /// /// |
cs | int | First component index. /// /// |
ce | int | Last component index. /// /// |
lys | int | First layer index for each component and resolution. /// /// |
lye | int | Index of the last layer. /// /// |
return | void |
public writePosCompResLy ( int t, int rs, int re, int cs, int ce, int lys, int lye ) : void | ||
t | int | Tile index. /// /// |
rs | int | First resolution level index. /// /// |
re | int | Last resolution level index. /// /// |
cs | int | First component index. /// /// |
ce | int | Last component index. /// /// |
lys | int | First layer index for each component and resolution. /// /// |
lye | int | Index of the last layer. /// /// |
return | void |
public writeResLyCompPos ( int t, int rs, int re, int cs, int ce, int lys, int lye ) : void | ||
t | int | Tile index. /// /// |
rs | int | First resolution level index. /// /// |
re | int | Last resolution level index. /// /// |
cs | int | First component index. /// /// |
ce | int | Last component index. /// /// |
lys | int | First layer index for each component and resolution. /// /// |
lye | int | Index of the last layer. /// /// |
return | void |
public writeResPosCompLy ( int t, int rs, int re, int cs, int ce, int lys, int lye ) : void | ||
t | int | Tile index. /// /// |
rs | int | First resolution level index. /// /// |
re | int | Last resolution level index. /// /// |
cs | int | First component index. /// /// |
ce | int | Last component index. /// /// |
lys | int | First layer index for each component and resolution. /// /// |
lye | int | Last layer index. /// /// |
return | void |