background image
ISO/IEC 10918-1 : 1993(E)
F.2.2.4
The RECEIVE procedure
RECEIVE(SSSS) is a procedure which places the next SSSS bits of the entropy-coded segment into the low order bits of
DIFF, MSB first. It calls NEXTBIT and it returns the value of DIFF to the calling procedure (see Figure F.17).
TISO1490-93/d087
RECEIVE(SSSS)
I = 0
V = 0
I = I + 1
V = (SLL V 1) + NEXTBIT
I = SSSS
?
Yes
No
Return V
F igu r e F .17 ­ Pr oced u r e f or R E C E I V E (SSSS)
Figure F.17 [D87] = 11.5 cm = 449 %
F.2.2.5
The NEXTBIT procedure
NEXTBIT reads the next bit of compressed data and passes it to higher level routines. It also intercepts and removes stuff
bytes and detects markers. NEXTBIT reads the bits of a byte starting with the MSB (see Figure F.18).
Before starting the decoding of a scan, and after processing a RST marker, CNT is cleared. The compressed data are read
one byte at a time, using the procedure NEXTBYTE. Each time a byte, B, is read, CNT is set to 8.
The only valid marker which may occur within the Huffman coded data is the RST
m
marker. Other than the EOI or
markers which may occur at or before the start of a scan, the only marker which can occur at the end of the scan is the
DNL (define-number-of-lines).
Normally, the decoder will terminate the decoding at the end of the final restart interval before the terminating marker is
intercepted. If the DNL marker is encountered, the current line count is set to the value specified by that marker. Since the
DNL marker can only be used at the end of the first scan, the scan decode procedure must be terminated when it is
encountered.
110
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]