Posted By on 19-01-2012 09:38 AM
(NOTE: T.81 should be referred to as ITU-T T.81, not CCITT - this is an old designation that was changed circa 1992!)
On Figure F.18 at Page 111 of CCITT Rec. T.81 (1992E), when B2=0, which means it comes to 0xFF00, the end of a block (EOB), it need not return one bit. However, why does it come to the left box and finally returns 1 as the result?
I wish I have clarified my point. Thank you!
The left branch with B2=0 is not taken because an EOB symbol is decoded, but rather because it un-does the "byte-stuffing" of the encoder. That is, JPEG requires that on encoding a zero-byte is inserted after each 0xff byte. The procedure in figure F.18 removes this zero-byte again.
Decoding of EOB symbols happens at a higher level of the protocol, after the raw bits have been decoded by the Huffman decoder.
The purpose of the byte-stuffing is to allow a syntactical analysis of the compressed bitstream, especially of the entropy coded data stream, without having to analyse the contents of the entropy coded data itself. The byte-stuffing ensures that no byte sequence that could potentially look like a marker appears in the entropy coded data.
JPEG 2000 handled this more efficiently by only stuffing zero-bits, not zero bytes into the stream, but the purpose is quite the same.