| java.lang.Object jj2000.j2k.entropy.encoder.BitToByteOutput
BitToByteOutput | class BitToByteOutput (Code) | | This class provides an adapter to perform bit based output on byte based
output objects that inherit from a 'ByteOutputBuffer' class. This class
implements the bit stuffing policy needed for the 'selective arithmetic
coding bypass' mode of the entropy coder. This class also delays the output
of a trailing 0xFF, since they are synthetized be the decoder.
|
Method Summary | |
void | flush() Writes the contents of the bit buffer and byte aligns the output by
filling bits with an alternating sequence of 0's and 1's. | int | length() Returns the length, in bytes, of the output bit stream as written by
this object. | void | reset() Resets the bit buffer to empty, without writing anything to the
underlying byte output, and resets the byte count. | void | setPredTerm(boolean isPredTerm) Set the flag according to whether or not the predictable termination is
requested. | public int | terminate() Terminates the bit stream by calling 'flush()' and then 'reset()'. | final void | writeBit(int bit) Write a bit to the output. | final void | writeBits(int[] symbuf, int nsym) Writes to the bit stream the symbols contained in the 'symbuf'
buffer. |
PAD_SEQ | final static int PAD_SEQ(Code) | | The alternating sequence of 0's and 1's used for byte padding
|
bbuf | int bbuf(Code) | | The bit buffer
|
bpos | int bpos(Code) | | The position of the next bit to put in the bit buffer. When it is 7
the bit buffer 'bbuf' is empty. The value should always be between 7
and 0 (i.e. if it gets to -1, the bit buffer should be immediately
written to the byte output).
|
delFF | boolean delFF(Code) | | Flag that indicates if an FF has been delayed
|
nb | int nb(Code) | | The number of written bytes (excluding the bit buffer)
|
BitToByteOutput | BitToByteOutput(ByteOutputBuffer out)(Code) | | Instantiates a new 'BitToByteOutput' object that uses 'out' as the
underlying byte based output.
Parameters: out - The underlying byte based output |
flush | void flush()(Code) | | Writes the contents of the bit buffer and byte aligns the output by
filling bits with an alternating sequence of 0's and 1's.
|
length | int length()(Code) | | Returns the length, in bytes, of the output bit stream as written by
this object. If the output bit stream does not have an integer number
of bytes in length then it is rounded to the next integer.
The length, in bytes, of the output bit stream. |
reset | void reset()(Code) | | Resets the bit buffer to empty, without writing anything to the
underlying byte output, and resets the byte count. The underlying byte
output is NOT reset.
|
setPredTerm | void setPredTerm(boolean isPredTerm)(Code) | | Set the flag according to whether or not the predictable termination is
requested.
Parameters: isPredTerm - Whether or not predictable termination is requested. |
terminate | public int terminate()(Code) | | Terminates the bit stream by calling 'flush()' and then 'reset()'.
|
writeBit | final void writeBit(int bit)(Code) | | Write a bit to the output. The least significant bit of 'bit' is
written to the output.
Parameters: bit - |
writeBits | final void writeBits(int[] symbuf, int nsym)(Code) | | Writes to the bit stream the symbols contained in the 'symbuf'
buffer. The least significant bit of each element in 'symbuf'is
written.
Parameters: symbuf - The symbols to write Parameters: nsym - The number of symbols in symbuf |
|
|