[]
public class MQCoder
Name | Description |
---|---|
MQCoder(ByteOutputBuffer, int, int[]) | Instantiates a new MQ-coder, with the specified number of contexts and initial states. The compressed bytestream is written to the 'oStream' object. |
Name | Description |
---|---|
LENGTH_LAZY | Identifier for the lazy length calculation. The lazy length calculation is not optimal but is extremely simple. |
LENGTH_LAZY_GOOD | Identifier for a very simple length calculation. This provides better results than the 'LENGTH_LAZY' computation. This is the old length calculation that was implemented in this class. |
LENGTH_NEAR_OPT | Identifier for the near optimal length calculation. This calculation is more complex than the lazy one but provides an almost optimal length calculation. |
TERM_EASY | The identifier for the easy termination that is simpler than the 'TERM_NEAR_OPT' one but slightly less efficient. |
TERM_FULL | The identifier fort the termination that uses a full flush. This is the less efficient termination. |
TERM_NEAR_OPT | The identifier for the termination that uses the near optimal length calculation to terminate the arithmetic codewrod |
TERM_PRED_ER | The identifier for the predictable termination policy for error resilience. This is the same as the 'TERM_EASY' one but an special sequence of bits is embodied in the spare bits for error resilience purposes. |
Name | Description |
---|---|
LenCalcType | Set the length calculation type to the specified type. |
NumCodedBytes | Returns the number of bytes that are necessary from the compressed output stream to decode all the symbols that have been coded this far. The number of returned bytes does not include anything coded previous to the last time the 'terminate()' or 'reset()' methods where called.
|
NumCtxts | Returns the number of contexts in the arithmetic coder. |
TermType | Set termination type to the specified type. |
Name | Description |
---|---|
codeSymbol(int, int) | This function performs the arithmetic encoding of one symbol. The function receives a bit that is to be encoded and a context with which to encode it.
|
codeSymbols(int[], int[], int) | This function performs the arithmetic encoding of several symbols together. The function receives an array of symbols that are to be encoded and an array containing the contexts with which to encode them.
|
fastCodeSymbols(int, int, int) | |
finishLengthCalculation(int[], int) | Terminates the calculation of the required length for each coding pass. This method must be called just after the 'terminate()' one has been called for each terminated MQ segment.
|
reset() | Reinitializes the MQ coder and the underlying 'ByteOutputBuffer' buffer as if a new object was instantaited. All the data in the 'ByteOutputBuffer' buffer is erased and the state and contexts of the MQ coder are reinitialized). Additionally any saved MQ states are discarded. |
resetCtxt(int) | Resets a context to the original probability distribution, and sets its more probable symbol to 0. |
resetCtxts() | Resets all contexts to their original probability distribution and sets all more probable symbols to 0. |
terminate() | This function flushes the remaining encoded bits and makes sure that enough information is written to the bit stream to be able to finish decoding, and then it reinitializes the internal state of the MQ coder but without modifying the context states.
|