Parameters
- bits
- An array containing the symbols to be encoded. Valid symbols are 0 and 1.
- cX
- The context for each of the symbols to be encoded.
- n
- The number of symbols to encode.
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.
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.