ISO/IEC 10918-1 : 1993(E)
SSSS = CSIZE(ZZ(K))
RS = (16 × R) + SSSS
Append EHUFSI(RS) bits
ZZ(K) < 0
ZZ(K) = ZZ(K) 1
low order bits of ZZ(K)
Figure F.3 Sequential encoding of a non-zero AC coefficient
Figure F.3 [D73] 14 cm = 547 %
Some of the procedures in Table D.1 are used in the higher level control structure for scans and restart intervals described
in Annex E. At the beginning of scans and restart intervals, the probability estimates used in the arithmetic coder are reset
to the standard initial value as part of the Initenc procedure which restarts the arithmetic coder. At the end of scans and
restart intervals, the Flush procedure is invoked to empty the code register before the next marker is appended.
Arithmetic encoding of DC coefficients
The basic structure of the decision sequence for encoding a DC difference value, DIFF, is shown in Figure F.4.
The context-index S0 and other context-indices used in the DC coding procedures are defined in Table F.4
(see F.22.214.171.124.3). A 0-decision is coded if the difference value is zero and a 1-decision is coded if the difference is not
zero. If the difference is not zero, the sign and magnitude are coded using the procedure Encode_V(S0), which is
described in F.126.96.36.199.
Arithmetic encoding of AC coefficients
The AC coefficients are coded in the order in which they occur in the zig-zag sequence ZZ(1,...,63). An end-of-block
(EOB) binary decision is coded before coding the first AC coefficient in ZZ, and after each non-zero coefficient. If the
EOB occurs, all remaining coefficients in ZZ are zero. Figure F.5 illustrates the decision sequence. The equivalent
procedure for the Huffman coder is found in Figure F.2.
CCITT Rec. T.81 (1992 E)