background image
ISO/IEC 10918-1 : 1993(E)
TISO1350-93/d073
Encode_R,ZZ(K)
SSSS = CSIZE(ZZ(K))
RS = (16 R) + SSSS
Append EHUFSI(RS) bits
of EHUFCO(RS)
ZZ(K) < 0
?
Yes
No
ZZ(K) = ZZ(K) 1
Append SSSS
low order bits of ZZ(K)
Done
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.
F.1.4.1
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.1.4.4.1.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.1.4.3.1.
F.1.4.2
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)
93
[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]