|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.j2k.entropy.encoder.BitToByteOutput
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.
Field Summary | |
(package private) int |
bbuf
The bit buffer |
(package private) int |
bpos
The position of the next bit to put in the bit buffer. |
(package private) boolean |
delFF
Flag that indicates if an FF has been delayed |
private boolean |
isPredTerm
Whether or not predictable termination is requested. |
(package private) int |
nb
The number of written bytes (excluding the bit buffer) |
(package private) ByteOutputBuffer |
out
The byte based output |
(package private) static int |
PAD_SEQ
The alternating sequence of 0's and 1's used for byte padding |
Constructor Summary | |
(package private) |
BitToByteOutput(ByteOutputBuffer out)
Instantiates a new 'BitToByteOutput' object that uses 'out' as the underlying byte based output. |
Method Summary | |
(package private) 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. |
(package private) int |
length()
Returns the length, in bytes, of the output bit stream as written by this object. |
(package private) void |
reset()
Resets the bit buffer to empty, without writing anything to the underlying byte output, and resets the byte count. |
(package private) void |
setPredTerm(boolean isPredTerm)
Set the flag according to whether or not the predictable termination is requested. |
int |
terminate()
Terminates the bit stream by calling 'flush()' and then 'reset()'. |
(package private) void |
writeBit(int bit)
Write a bit to the output. |
(package private) void |
writeBits(int[] symbuf,
int nsym)
Writes to the bit stream the symbols contained in the 'symbuf' buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean isPredTerm
static final int PAD_SEQ
boolean delFF
ByteOutputBuffer out
int bbuf
int bpos
int nb
Constructor Detail |
BitToByteOutput(ByteOutputBuffer out)
out
- The underlying byte based outputMethod Detail |
final void writeBits(int[] symbuf, int nsym)
symbuf
- The symbols to writensym
- The number of symbols in symbuffinal void writeBit(int bit)
bit
- void flush()
public int terminate()
void reset()
int length()
void setPredTerm(boolean isPredTerm)
isPredTerm
- Whether or not predictable termination is requested.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |