ISO/IEC 10918-1 : 1993(E)
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).
I = 0
V = 0
I = I + 1
V = (SLL V 1) + NEXTBIT
I = SSSS
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 %
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
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
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
CCITT Rec. T.81 (1992 E)