[]
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.
<p>Each context has a current MPS and an index describing what the
current probability is for the LPS. Each bit is encoded and if the
probability of the LPS exceeds .5, the MPS and LPS are switched.</p>
public void codeSymbol(int bit, int context)
Type | Name | Description |
---|---|---|
int | bit | The symbol to be encoded, must be 0 or 1. |
int | context | the context with which to encode the symbol. |