Our straightforward range coder performs one division on encoding:
let old_range = self.hai - self.low;
let range = old_range / total;
And 2 more on decoding:
let range = (self.hai - self.low) / total;
(code - self.low) / range
Division is not the fastest operation out there, and the performance constraints on the range coder are always very tight. We should provide an implementation that uses bit shifts as an alternative. The problem is sharing code, if any, with the canonical one that we have.
Our straightforward range coder performs one division on encoding:
And 2 more on decoding:
Division is not the fastest operation out there, and the performance constraints on the range coder are always very tight. We should provide an implementation that uses bit shifts as an alternative. The problem is sharing code, if any, with the canonical one that we have.