background image
ISO/IEC 10918-1 : 1993(E)
D.2.1
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.
D.2.2
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
code register.
D.2.3
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
MSB
LSB
Cx register
xxxxxxxx,
xxxxxxxx
C-low
bbbbbbbb,
00000000
A-register
aaaaaaaa,
aaaaaaaa
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.
D.2.4
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).
70
CCITT Rec. T.81 (1992 E)
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150] [151] [152] [153] [154] [155] [156] [157] [158] [159] [160] [161] [162] [163] [164] [165] [166] [167] [168] [169] [170] [171] [172] [173] [174] [175] [176] [177] [178] [179] [180] [181] [182] [183] [184] [185] [186]