ISO/IEC 10918-1 : 1993(E)
The probability estimation tables are defined by Table D.3. The statistics areas are initialized to an MPS sense of 0 and a
Qe index of zero as defined by Table D.3. The stack count (ST) is cleared, the code register (C) is cleared, and the interval
register is set to X'10000'. The counter (CT) is set to 11, reflecting the fact that when A is initialized to X'10000' three
spacer bits plus eight output bits in C must be filled before the first byte is removed. Note that BP is initialized to point to
the byte before the start of the entropy-coded segment (which is at BPST). Note also that the statistics areas are initialized
for all values of context-index S to MPS(S) = 0 and Index(S) = 0.
NOTE Although the probability interval is initialized to X'10000' in both Initenc and Initdec, the precision of
the probability interval register can still be limited to 16 bits. When the precision of the interval register is 16 bits, it is initialized to
zero.
D.1.8
Termination of encoding
The Flush procedure is used to terminate the arithmetic encoding procedures and prepare the entropy-coded segment for
the addition of the X'FF' prefix of the marker which follows the arithmetically coded data. Figure D.13 shows this flush
procedure. The first step in the procedure is to set as many low order bits of the code register to zero as possible without
pointing outside of the final interval. Then, the output byte is aligned by shifting it left by CT bits; Byte_out then removes
it from C. C is then shifted left by 8 bits to align the second output byte and Byte_out is used a second time. The
remaining low order bits in C are guaranteed to be zero, and these trailing zero bits shall not be written to the entropy-
coded segment.
TISO1130-93/d051
Flush
Done
Byte_out
C = SLL C 8
C = SLL C CT
Clear_final_bits
Byte_out
Discard_final_zeros
Figure D.13 Flush procedure
Figure D.13 [D51], = 15.5 cm = 606.%
CCITT Rec. T.81 (1992 E)
67