ISO/IEC 10918-1 : 1993(E)
Non-zero coefficients with zero history are coded with a composite code of the form:
HUFFCO(RRRRSSSS) + additional bit (rule a) + correction bits (rule b)
In addition whenever zero runs are coded with ZRL or EOBn codes, correction bits for those coefficients with non-zero
history contained within the zero run are appended according to rule b above.
For the Huffman coding version of Encode_AC_Coefficients_SA the EOB is defined to be the position of the last point
transformed coefficient of magnitude 1 in the band. If there are no coefficients of magnitude 1, the EOB is defined to be
NOTE The definition of EOB is different for Huffman and arithmetic coding procedures.
In Figures G.7 and G.8 BE is the count of buffered correction bits at the start of coding of the block. BE is initialized to
zero at the start of each restart interval. At the end of each restart interval any remaining buffered bits are appended to the
bit stream following the last EOBn Huffman code and associated appended bits.
In Figures G.7 and G.9, BR is the count of buffered correction bits which are appended to the bit stream according to rule
b. BR is set to zero at the beginning of each Encode_AC_Coefficients_SA. At the end of each restart interval any
remaining buffered bits are appended to the bit stream following the last Huffman code and associated appended bits.
Progressive encoding procedures with arithmetic coding
G.1.3.1 Progressive encoding of DC coefficients with arithmetic coding
The first scan for a given component shall encode the DC coefficient values using the procedures described in F.1.4.1. If
the successive approximation bit position parameter is not zero, the coefficient values shall be reduced in precision by the
point transform described in Annex A before coding.
In subsequent scans using successive approximation the least significant bits shall be coded as binary decisions using a
fixed probability estimate of 0.5 (Qe
G.1.3.2 Progressive encoding of AC coefficients with arithmetic coding
Except for the point transform scaling of the DCT coefficients and the grouping of the coefficients into bands, the first
scan(s) of successive approximation is identical to the sequential encoding procedure described in F.1.4. If Kmin is
equated to Ss, the index of the first AC coefficient index in the band, the flow chart shown in Figure F.5 applies. The
EOB decision in that figure refers to the "end-of-band" rather than the "end-of-block". For the arithmetic coding version
of Encode_AC_Coefficients_SA (and all other AC coefficient coding procedures) the EOB is defined to be the position
following the last non-zero coefficient in the band.
NOTE - The definition of EOB is different for Huffman and arithmetic coding procedures.
The statistical model described in F.1.4 also holds. For this model the default value of Kx is 5. Other values of Kx may be
specified using the DAC marker code (Annex B). The following calculation for Kx has proven to give good results for 8-
bit precision samples:
Se Kmin) 4
This expression reduces to the default of Kx
5 when the band is from index 1 to index 63.
CCITT Rec. T.81 (1992 E)