ISO/IEC 10918-1 : 1993(E)
A marker segment consists of a marker followed by a sequence of related parameters. The first parameter in a marker
segment is the two-byte length parameter. This length parameter encodes the number of bytes in the marker segment,
including the length parameter and excluding the two-byte marker. The marker segments identified by the SOF and SOS
marker codes are referred to as headers: the frame header and the scan header respectively.
Entropy-coded data segments
An entropy-coded data segment contains the output of an entropy-coding procedure. It consists of an integer number of
bytes, whether the entropy-coding procedure used is Huffman or arithmetic.
Making entropy-coded segments an integer number of bytes is performed as follows: for Huffman coding, 1-bits are
used, if necessary, to pad the end of the compressed data to complete the final byte of a segment. For arithmetic coding, byte alignment
is performed in the procedure which terminates the entropy-coded segment (see D.1.8).
In order to ensure that a marker does not occur within an entropy-coded segment, any X'FF' byte generated by either a
Huffman or arithmetic encoder, or an X'FF' byte that was generated by the padding of 1-bits described in NOTE 1 above, is followed
by a "stuffed" zero byte (see D.1.6 and F.1.2.3).
In B.2 and B.3 the interchange format syntax is specified. For the purposes of this Specification, the syntax specification
the required ordering of markers, parameters, and entropy-coded segments;
identification of optional or conditional constituent parts;
the name, symbol, and definition of each marker and parameter;
the allowed values of each parameter;
any restrictions on the above which are specific to the various coding processes.
The ordering of constituent parts and the identification of which are optional or conditional is specified by the syntax
figures in B.2 and B.3. Names, symbols, definitions, allowed values, conditions, and restrictions are specified immediately
below each syntax figure.
Conventions for syntax figures
The syntax figures in B.2 and B.3 are a part of the interchange format specification. The following conventions, illustrated
in Figure B.1, apply to these figures:
A thin-lined box encloses either a marker or a single parameter;
A thick-lined box encloses either a marker segment, an entropy-coded data segment,
or combinations of these;
parameter length indicator:
The width of a thin-lined box is proportional to the parameter length (4, 8,
or 16 bits, shown as E, B, and D respectively in Figure B.1) of the marker or parameter it encloses; the
width of thick-lined boxes is not meaningful;
Square brackets indicate that a marker or marker segment is only
optionally or conditionally present in the compressed image data;
In the interchange format a parameter or marker shown in a figure precedes all of those shown
to its right, and follows all of those shown to its left;
entropy-coded data indicator:
Angled brackets indicate that the entity enclosed has been entropy
[ B ]
Figure B.1 Syntax notation conventions
Figure B.1 [D19], = 3 cm = 118%
CCITT Rec. T.81 (1992 E)