Take upstream r1455 to fix issue #95.
Partial fix for #138

Initial implementation of trellis quantization for arithmetic coding.
The rate computation does not yet implement all rules of the entropy
coder and may thus be suboptimal.
Refine rate estimate in trellis

Take into account cutoff parameter to switch between sets of contexts
for rate estimation in arithmetic coding version of trellis quantization