ISO/IEC 10918-1 : 1993(E)
For simplicity of implementation, the divide by 2 in the prediction selections 5 and 6 of Table H.1 is done by an
arithmetic-right-shift of the integer values.
The difference between the prediction value and the input is calculated modulo 2
16
. In the decoder the difference is
16
, to the prediction.
H.1.2.2
Huffman coding of the modulo difference
The Huffman coding procedures defined in Annex F for coding the DC coefficients are used to code the modulo 2
16
differences. The table for DC coding contained in Tables F.1 and F.6 is extended by one additional entry. No extra bits
are appended after SSSS
=
16 is encoded. See Table H.2.
Table H.2 ­ Difference categories for lossless Huffman coding
SSSS
Difference values
1
0
0
1
1
­1,1
1
2
­3,­2,2,3
1
3
­7..­4,4..7
1
4
­15..­8,8..15
1
5
­31..­16,16..31
1
6
­63..­32,32..63
1
7
­127..­64,64..127
1
8
­255..­128,128..255
1
9
­511..­256,256..511
10
­1 023..­512,512..1 023
11
­2 047..­1 024,1 024..2 047
12
­4 095..­2 048,2 048..4 095
13
­8 191..­4 096,4 096..8 191
14
­16 383..­8 192,8 192..16 383
15
­32 767..­16 384,16 384..32 767
16
32 768
H.1.2.3
Arithmetic coding of the modulo difference
The statistical model defined for the DC coefficient arithmetic coding model (see F.1.4.4.1) is generalized to a two-
dimensional form in which differences coded for the sample to the left and for the line above are used for conditioning.
H.1.2.3.1
Two-dimensional statistical model
The binary decisions are conditioned on the differences coded for the neighbouring samples immediately above and
immediately to the left from the same component. As in the coding of the DC coefficients, the differences are classified
into 5 categories: zero(0), small positive (
+
S), small negative (­S), large positive (
+
L), and large negative (­L). The two
independent difference categories combine to give 25 different conditioning states. Figure H.2 shows the two-dimensional
array of conditioning indices. For each of the 25 conditioning states probability estimates for four binary decisions are
kept.
At the beginning of the scan and each restart interval the conditioning derived from the line above is set to zero for the
first line of each component. At the start of each line, the difference to the left is set to zero for the purposes of calculating
the conditioning.
134
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]