ISO/IEC 10918-1 : 1993(E)
Binary arithmetic decoding principles
The probability interval subdivision and sub-interval ordering defined for the arithmetic encoding procedures also apply to
the arithmetic decoding procedures.
Since the bit stream always points within the current probability interval, the decoding process is a matter of determining,
for each decision, which sub-interval is pointed to by the bit stream. This is done recursively, using the same probability
interval sub-division process as in the encoder. Each time a decision is decoded, the decoder subtracts from the bit stream
any interval the encoder added to the bit stream. Therefore, the code register in the decoder is a pointer into the current
probability interval relative to the base of the interval.
If the size of the sub-interval allocated to the LPS is larger than the sub-interval allocated to the MPS, the encoder invokes
the conditional exchange procedure. When the interval sizes are inverted in the decoder, the sense of the symbol decoded
must be inverted.
Decoding conventions and approximations
The approximations and integer arithmetic defined for the probability interval subdivision in the encoder must also be
used in the decoder. However, where the encoder would have added to the code register, the decoder subtracts from the
Decoder code register conventions
The flow charts given in this section assume the register structures for the decoder as shown in Table D.5:
Table D.5 Decoder register conventions
Cx and C-low can be regarded as one 32-bit C-register, in that renormalization of C shifts a bit of new data from bit 15 of
C-low to bit 0 of Cx. However, the decoding comparisons use Cx alone. New data are inserted into the "b" bits of C-low
one byte at a time.
NOTE The comparisons shown in the various procedures use arithmetic comparisons, and therefore assume precisions
greater than 16 bits for the variables. Unsigned (logical) comparisons should be used in 16-bit precision implementations.
The decode procedure
The decoder decodes one binary decision at a time. After decoding the decision, the decoder subtracts any amount from
the code register that the encoder added. The amount left in the code register is the offset from the base of the current
probability interval to the sub-interval allocated to the binary decisions not yet decoded. In the first test in the decode
procedure shown in Figure D.16 the code register is compared to the size of the MPS sub-interval. Unless a conditional
exchange is needed, this test determines whether the MPS or LPS for context-index S is decoded. Note that the LPS for
context-index S is given by 1 MPS(S).
CCITT Rec. T.81 (1992 E)