ISO/IEC 10918-1 : 1993(E)
The subdivision of the current probability interval would ideally require a multiplication of the interval by the probability
estimate for the LPS. Because this subdivision is done approximately, it is possible for the LPS sub-interval to be larger
than the MPS sub-interval. When that happens a "conditional exchange" interchanges the assignment of the sub-intervals
such that the MPS is given the larger sub-interval.
Since the encoding procedure involves addition of binary fractions rather than concatenation of integer code words, the
more probable binary decisions can sometimes be coded at a cost of much less than one bit per decision.
Conditioning of probability estimates
An adaptive binary arithmetic coder requires a statistical model a model for selecting conditional probability estimates to
be used in the coding of each binary decision. When a given binary decision probability estimate is dependent on a
particular feature or features (the context) already coded, it is "conditioned" on that feature. The conditioning of
probability estimates on previously coded decisions must be identical in encoder and decoder, and therefore can use only
information known to both.
Each conditional probability estimate required by the statistical model is kept in a separate storage location or "bin"
identified by a unique context-index S. The arithmetic coder is adaptive, which means that the probability estimates at
each context-index are developed and maintained by the arithmetic coding system on the basis of prior coding decisions
for that context-index.
Encoding conventions and approximations
The encoding procedures use fixed precision integer arithmetic and an integer representation of fractional values in which
X'8000' can be regarded as the decimal value 0.75. The probability interval, A, is kept in the integer
X'10000' by doubling it whenever its integer value falls below X'8000'. This is equivalent to
keeping A in the decimal range 0.75
1.5. This doubling procedure is called renormalization.
The code register, C, contains the trailing bits of the bit stream. C is also doubled each time A is doubled. Periodically
to keep C from overflowing a byte of data is removed from the high order bits of the C-register and placed in the
Carry-over into the entropy-coded segment is limited by delaying X'FF' output bytes until the carry-over is resolved. Zero
bytes are stuffed after each X'FF' byte in the entropy-coded segment in order to avoid the accidental generation of
markers in the entropy-coded segment.
Keeping A in the range 0.75
1.5 allows a simple arithmetic approximation to be used in the probability interval
subdivision. Normally, if the current estimate of the LPS probability for context-index S is Qe(S), precise calculation of
the sub-intervals would require:
Probability sub-interval for the LPS;
A) Probability sub-interval for the MPS.
Because the decimal value of A is of order unity, these can be approximated by
Probability sub-interval for the LPS;
Probability sub-interval for the MPS.
Whenever the LPS is coded, the value of A Qe(S) is added to the code register and the probability interval is reduced to
Qe(S). Whenever the MPS is coded, the code register is left unchanged and the interval is reduced to A Qe(S). The
precision range required for A is then restored, if necessary, by renormalization of both A and C.
With the procedure described above, the approximations in the probability interval subdivision process can sometimes
make the LPS sub-interval larger than the MPS sub-interval. If, for example, the value of Qe(S) is 0.5 and A is at the
minimum allowed value of 0.75, the approximate scaling gives one-third of the probability interval to the MPS and two-
thirds to the LPS. To avoid this size inversion, conditional exchange is used. The probability interval is subdivided using
the simple approximation, but the MPS and LPS sub-interval assignments are exchanged whenever the LPS sub-interval is
larger than the MPS sub-interval. This MPS/LPS conditional exchange can only occur when a renormalization will be
Each binary decision uses a context. A context is the set of prior coding decisions which determine the context-index, S,
identifying the probability estimate used in coding the decision.
Whenever a renormalization occurs, a probability estimation procedure is invoked which determines a new probability
estimate for the context currently being coded. No explicit symbol counts are needed for the estimation. The relative
probabilities of renormalization after coding of LPS and MPS provide, by means of a table-based probability estimation
state machine, a direct estimate of the probabilities.
CCITT Rec. T.81 (1992 E)