background image
ISO/IEC 10918-1 : 1993(E)
The format for the additional bits is the same as in the coding of the DC coefficients. The value of SSSS gives the number
of additional bits required to specify the sign and precise amplitude of the coefficient. The additional bits are either the
low-order SSSS bits of ZZ(K) when ZZ(K) is positive or the low-order SSSS bits of ZZ(K) 1 when ZZ(K) is negative.
ZZ(K) is the Kth coefficient in the zig-zag sequence of coefficients being coded.
F.1.2.2.2
Defining Huffman tables for the AC coefficients
The syntax for specifying the Huffman tables is given in Annex B. The procedure for creating a code table from this
information is described in Annex C.
In the baseline system no more than two Huffman tables may be defined for coding of AC coefficients. Two examples of
Huffman tables for coding of AC coefficients are provided in Annex K.
F.1.2.2.3
Huffman encoding procedures for AC coefficients
As defined in Annex C, the Huffman code table is assumed to be available as a pair of tables, EHUFCO (containing the
code bits) and EHUFSI (containing the length of each code in bits), both indexed by the composite value defined above.
The procedure for encoding the AC coefficients in a block is shown in Figures F.2 and F.3. In Figure F.2, K is the index
to the zig-zag scan position and R is the run length of zero coefficients.
The procedure "Append EHUFSI(X'F0') bits of EHUFCO(X'F0')" codes a run of 16 zero coefficients (ZRL code of
Figure F.1). The procedure "Code EHUFSI(0) bits of EHUFCO(0)" codes the end-of-block (EOB code). If the last
coefficient (K
=
63) is not zero, the EOB code is bypassed.
CSIZE is a procedure which maps an AC coefficient to the SSSS value as defined in Table F.2.
F.1.2.3
Byte stuffing
In order to provide code space for marker codes which can be located in the compressed image data without decoding,
byte stuffing is used.
Whenever, in the course of normal encoding, the byte value X'FF' is created in the code string, a X'00' byte is stuffed
into the code string.
If a X'00' byte is detected after a X'FF' byte, the decoder must discard it. If the byte is not zero, a marker has been
detected, and shall be interpreted to the extent needed to complete the decoding of the scan.
Byte alignment of markers is achieved by padding incomplete bytes with 1-bits. If padding with 1-bits creates a X'FF'
value, a zero byte is stuffed before adding the marker.
F.1.3
Extended sequential DCT-based Huffman encoding process for 8-bit sample precision
This process is identical to the Baseline encoding process described in F.1.2, with the exception that the number of sets of
Huffman table destinations which may be used within the same scan is increased to four. Four DC and four AC Huffman
table destinations is the maximum allowed by this Specification.
F.1.4
Extended sequential DCT-based arithmetic encoding process for 8-bit sample precision
This subclause describes the use of arithmetic coding procedures in the sequential DCT-based encoding process.
NOTE The arithmetic coding procedures in this Specification are defined for the maximum precision to encourage
interchangeability.
The arithmetic coding extensions have the same DCT model as the Baseline DCT encoder. Therefore, Annex F.1.1 also
applies to arithmetic coding. As with the Huffman coding technique, the binary arithmetic coding technique is lossless. It
is possible to transcode between the two systems without either FDCT or IDCT computations, and without modification of
the reconstructed image.
The basic principles of adaptive binary arithmetic coding are described in Annex D. Up to four DC and four AC
conditioning table destinations and associated statistics areas may be used within one scan.
The arithmetic encoding procedures for encoding binary decisions, initializing the statistics area, initializing the encoder,
terminating the code string, and adding restart markers are listed in Table D.1 of Annex D.
CCITT Rec. T.81 (1992 E)
91
[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]