[]
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.
<p>The advantage of using this function is that the cost of the method
call is amortized by the number of coded symbols per method call.</p><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 codeSymbols(int[] bits, int[] cX, int n)
Type | Name | Description |
---|---|---|
int[] | bits | An array containing the symbols to be encoded. Valid symbols are 0 and 1. |
int[] | cX | The context for each of the symbols to be encoded. |
int | n | The number of symbols to encode. |