Facsimile image coding - IEEE Computer Society

Facsimile image coding
by JOAN L. MITCHELL
IBM Thomas J. Watson Research Center
Yorktown Heights, New York
INTRODUCTION
non's entropy,6 the minimum number of bits per symbol,
together with the number of coded symbols can be used to
calculate the lower bound on the number of bits needed to
code each document for a· given model. The entropy is a
measure of the "randomness or surprise" found in an image
for a particular model. Thus, the entropy of a document can
change dramatically when a new source model is used.
Fixed codes assume that average statistics apply to all
documents. However, some documents do not fit these statistics. When the assumptions are completely invalid, regions of the "compressed" image may require many more
bits than the original uncompressed image. The uncompressed mode option in the two dimensional CCITT recommendation2 can be used to minimize the worst case local
expansion.
Facsimile image coding has recently received a lot of attention because of the standardization work being done in this
area by the International Telegraph and Telephone Con~
sultative Committee (CCITT). In November, 1977, CCITT
Study Group XIV standardized a one-dimensional data
compression scheme for facsimile images.) Two years later
this standard was incorporated in a recommended two-dimensional coding scheme. 2
Data compression (coding) of images is essential if high
quality digital facsimile is to be practical. 3,4 A standard facsimile document has 3.85 scan lines/mm vertically. However, an optional vertical resolution of 7.7 lines/mm can be
used for images with fine details. The standard horizontal
resolution is fixed at 8.04 picture elements/mm (1728 picture
elements in 215 mm) to avoid excessive "stair stepping" on
curved or diagonal edges of the reproduced images.
Almost a quarter million bytes are required to store the
raw digitized data ofa 215 mm x 280 mm page at the normal
resolution. At the higher resolution, close to a half million
bytes are needed. Run length coding schemes, such as the
CCITT one-dimensional standard, reduce the storage requirement by factors of 5 to 15 for typical images.
Two-dimensional schemes take advantage of correlation
between successive scan lines to obtain better compression.
This paper considers only black/white reversible facsimil~
coding. The original black/white images are reconstructed
exactly (assuming no errors during transmission or storage)
after each encoding/decoding cycle.
ONE-DIMENSIONAL CODING
The black and white picture elements in typical images are
not randomly distributed but come with a high degree of
correlation or redundancy. In each horizontal scan line the
pels of a given color (black or white) tend to come in groups
or runs. Run length coding takes advantage of this horizontal
correlation in a practical way. 7,8 The number of pels between
color changes is coded instead of each pel. The runs alternate
in color so that as long as the first run in a line is guaranteed
to be a white run no extra bits are needed to specify the
color. A length of zero can be used if the line actually starts
black. Figure 1 shows some examples of run lengths.
An average entropy per pel for run length coding was obtained by taking eight CCITT documents scanned at 1728
pel/line for 2376 lines (nominally 8 x 8 pel/mm) and collecting
the statistics ofthe entire set together. To simulate the standard resolution the odd numbered lines were used (nominally
8 x 4 pel/mm). From the run length probability distribution
a lower bound of 0.113 bits/pel was obtained for both resolutions (HIGH and STD). This entropy per pel for mixed
black and white run lengths is used as a reference point and
therefore is entered in Table I as 100 percent.
The model which considers the black and white run lengths.
as the same statistically is not optimum. It is well-known
that a strong peak in the black run distribution9 usually occurs for runs of two or three pels for typewritten documents
scanned at this resolution. The white runs tend to have a
SOURCE MODEL
The facsimile scanned image can be described mathematically as a set of symbols representing various patterns of
picture elements (pels). The set of symbols, the "source
model," must be sufficiently general that all possible configurations of pels can be described. Each possible set of
symbols has particular statistical properties; once these statistical properties are understood and the coding rules defined, the generation of variable length code words can be
a straightforward application of Huffman5 coding. Normally,
the tables are selected for a large set of documents and therefore may not be optimum for individual documents. Shan423
From the collection of the Computer History Museum (www.computerhistory.org)
424
Scan Line
National Computer Conference, 1980
~l----~'~~3-~'---5--~'~-2
Figure I-Run length examples.
less sharp peak spread out over the 4 to 7 pel runs. Optimizing the black and white runs separately (B & W Sep.) decreases the entropy per pel by a few percent.
CCITT Modified Huffman code
The CCITT one-dimensional standard Modified Huffman
Code) is a run length coding scheme in which the black and
white runs have separate tables. Runs longer than 63 are
coded in two pieces in order to decrease the size of the code
tables by an order of magnitude. Multiples of 64 are coded
first as a Makeup Code and then the remainder follows as
a Terminating Code. Short runs (0-63) only need the Terminating Code.
Since the CCITT standard is for telephone tra,nsmission,
the standard also includes a unique end of line (EOL) code
for resynchronization after transmission errors. It is a unique
pattern of eleven zeros followed by a one. Extra zeros can
precede the EOL as fill bits to maintain a minimum transmission time per line.
Figure 2-Vertical reference coding.
tory line (VRl). The white run has a vertical difference of
zero (VO).
The entropy per pel as a percent of the one-dimensional
entropy per pel is listed in Table I for various maximum
allowed differences, N. Separating the black and white run
statistics decreases the entropy per pel by a few percent
"relative to the combined statistics.
Generally about half of all the runs vertically align exactly
and another 25 percent are within one pel of the appropriate
transition. Larger vertical differences are much less frequent. Table II gives the distribution of runs in percent for
N = 3. Runs which stop to the left of the transition on the
preceding line are given as VLx and those to the right are
shown as VRx. For differences greater than N a run length
. (RL) codeiis used. The white and black runs have a similar
distribution.
So far only independent statistics have been considered.
Conditional probabilities can also be used. Table II illustrates how the distribution changes from almost 50 percent
VERTICAL REFERENCE CODING
TABLE n.-Distribution of Runs in Percent
Run length coding can only take advantage of the horizontal redundancy. There is also strong vertical correlation
in most images which comes from the vertical continuity of
objects, strokes, or lines. Vertical reference coding3 ,4,IO-J3
codes a run as the difference between the run length and the
distance to the same color change on the history line (preceding scan line). Figure 2 shows the black run ending one
pel to the right of the first black-to-white change on the his-
RES.
VL3
VL2
VLl
B & W Sep.
VRI
VR2
VR3
RL
HIGH
0.8
2.9
16.0
46.9
15.0
2.4
0.7
15.4
STD
1.9
4.9
11.4
40.1
10.4
4.0
1.5
25.7
HIGH
0.8
2.8
16.3
43.6
15.7
2.8
o•9
17.2
STD
1.8
4.0
10.4
37.3
10.7
4.1
2.1
29.7
Pass, B&W Sep.
HIGH
0.8
2.9
16.2
45.2
15.3
2.6
0.8
16.3
STD
1.8
4.5
10.9
38.7
10.6
4.1
1.8
27.7
RES.
HIGH
STD
HIGH
STD
HIGH
STD
1-D
100.0
100.0
96.3
96.3
96.3
96.3
MIXED RUNS
N=O
72.2
81.2
70.5
75.6
70.2
74.6
N=l
57.9
72.2
57'.1
70.8
55.5
68.4
HIGH
0.7
2.8
17.3
49.3
16.6
2.8
0.8
9.7
N=2
57.0
71.1
56.4
70.0
54.3
66.9
STD
1.7
4.7
12.4
45.9
11.6
4.5
1.9
17.3
N=3
57.1
71.1
56.6
70.2
54.2
66.8
"N=4
57.3
71.2
56.8
70.6
54.4
67.0
N=5
57.6
72.0
57.1
71. 1
54.6
67.3
HIGH
1.3
3.4
10.4
24.3
8.7
1.4
0.5
50.1
STD
2.1
3.9
7.0
20.0
7.8
3.0
1.3
54.9
N=l +
55.8
69.7
N=3 +
54.8
68.9
+ Conditional entropy
PM
BLACK RUNS
T ABLE I.-Entropy Per Pel as a Percent of One-Dimensional Mixed Run
Length Entropy Per Pel (0.113 bits/pel)
MIXED
VO
WHITE RUNS
RUNS FOLLOWING V
RUNS FOLLOWING RL
WITH PASS MODE
HIGH
0.9
2.9
16.8
46.9
16.1
2.7
0.7
12.9
5.6
STD
2.0
4.9
11.9
40.8
11.3
4.4
1.7
23.0
9.2
From the collection of the Computer History Museum (www.computerhistory.org)
Facsimile Image Coding
vo to more than 50 percent RL depending upon whether the
last code was a vertical (V) code or a run length (RL) code.
The entropies calculated from the conditional probabilities
for N = 1 and N = 3 are also given in Table I.
IBM coding scheme
IBM proposed to the CCITT a coding scheme l4 . 15 that only
considered vertical transitions within one pel. (Most of the
compression improvement attributable to vertical reference
coding is obtained with N = 1.) Figure 3 shows coding examples using vertical reference codes within one pel of history transitions.
Compression performance improvements are obtained by
switching the code tables so that they depend upon whether
the last code was a run length or a vertical reference code
to take advantage of the differences in the conditional probabilities. The RL-prefix is followed by the run length count
coded with the Modified Huffman codes. The code table is
given below.
Code Table
Following RL Following V
RL-prefix
VO
VLl
VRI
1
01
001
000
01
1
001
000
0001*
* Even numbered VRI 's in a series have an extra 1 to
break up long strings of zeros.
Additional compression is obtained by removing redundancy
from the code table. Pels at distances which would be coded
with vertical reference coding if they were the· final pel are
not included in the run length count. A few percent can be
saved by sometimes being able to represent a run by a count
shorter than its true length.
CCITT Modified READ code
The recommended CCITT two-dimensional Modified Relative Element Address Designate (Modified READ) coding
scheme 2 is a simplification of the original READ coding
scheme l6 which considered vertical reference coding out to
plus or minus twenty-six pels. Modified READ only uses
vertical reference coding out to plus or minus three pels.
In both codes if a run does not end with a vertical reference
code, the horizontal mode (HM) code precedes two Modified
History Line
Scan Line
Huffman· run length codes for that run and the next run ..
Coding a pair of runs with one prefix is another way of taking
advantage of the high probability that a run length code is
immediately followed by another run length code.
Sometimes a run on the preceding line comes from an
object which terminated on that line. A pass mode (PM) skips
over such runs on the preceding line. It is used if another
transition is encountered to the right of the first vertical reference transition (before the end of the run). A new run is
started at that transition. figure 4 illustrates pass mode. Pass
mode can be coded several times within a single run. Table
I gives the entropy per pel with pass mode present where
the black and white runs have been considered separately.
Table II shows how the distribution of runs shifts slightly
when pass mode is used. Some runs are coded as a pass
followed by a vertical code instead of as a run length.
In order to limit the effect of transmission errors, at least
every Kth line is coded one-dimensionally. The value of K
is set as 2 for the normal resolution and 4 for the higher
resolution.
The code table is given below.
Modified READ Code Table
001
HM
PM
0001
VO
1
VL1
010
VR1
011
VL2
000010
000011
VR2
VL3
0000010
VR3
0000011
EO L
000000000001 T
Extensions
0000001xxx
2-D
1-D
000000001xxx
T on the EOL denotes a tag bit which tells whether the next
line is coded one-dimensionally (T= 1) or two-dimensionally
(T=O).
UNCOMPRESSED MODE
One of the future extensions has been identified as uncompressed mode. The xxx bits are' 111' for this mode. This
mode can improve compression significantly for scanned
halftones and images witp many one or two pel runs. IBM
proposed the following table as a simple uncompressed mode
coding scheme. 17
~lmll~1
I-VO~VL1~
Figure 3-Coding examples.
425
Figure 4-Pass mode followed by VO.
From the collection of the Computer History Museum (www.computerhistory.org)
426
National Computer Conference, 1980
TABLE IlL-Compression Ratios for High Resolution Images (1728 pels
x 2376 lines)
K=l
~OC.
1-0
sro
K=4
IBM
(EOls)
MR
K=2376 (no EOls)
IBM
MR
13.7
19.3
19.8
26.3
28.4
14.9
24.3
26.2
41.6
47.5
3
7.9
i2.4
12.6
17.6
17.9
4
4.7
6.2
6.3
7.4
7.4
5
7.5
11.4
"11.6
15.5
15.9
10.0
17.S
18.2
28.9
30.8
7
4.8
6.2
6.3
7.3
7.4
8
8.2
14.2
15.6
24.5
27.1
AVE.
7.7
11. 3
11.6
lS.l
lS.6
U ncompressed Mode Code Table
Code Word
Image Pattern
1
1
01
01
001
001
0001
0001
00001
00001
000001
00000
Exits
000000IT
0000000IT
0
00000000 IT
00
0000000001 T
000
0000
0000000000IT
TABLE IV.-Compression Ratios for Standard Resolution Images (1728
pels x 1188 lin~s)
~OC.
1-0
sro
K=2
IBM
(EOls)
MR
K=1l88 (no EOls)
IBM
Eight documents of the line drawing and text type have
been used to compare and evaluate the performance of coding schemes in CCITT Study Group XIV. Tables III and IV
show the compression ratios for the CCITT one-dimensional
standard (l-D STD) for each document at both resolutions.
The compression ratios for the IBM scheme witft error recovery (K = 2 and 4) and for continuous two-dimensional
coding without EOLs (K = 1188 and 2376) are listed. The
CCITT two-dimensional (MR) code compression ratios are
also given.
ACKNOWLEDGMENT
The development of the IBM coding scheme was done in
collaboration with Dr. G. Goertzel.
REFERENCES
The exit codes signal when to resume normal coding. The
T denotes a tag bit which tells the color of the next run
(Black = 1, White = 0).
K=l
COMPRESSION RESULTS
MR
13.7
lS.7
lS.7
21.2
21.4
14.9
18.6
19.2
31.7
34.3
14.8
3
7.9
9.9
9.9
lS.0
4
4.7
S.2
S.O
S.9
S.6
S
7.S
9.1
9.1
12.7
12.6
2S.7
10.0
13.4
13.6
24.4
7
4.8
S.2
S.l
S.9
S.7
8
8.2
10.8
11. 2
19.5
20.4
AVE.
7.7
9.1
9.0
12.2
12.0
1. CCITTStudy Group XIV, "Report of the Meeting Held in Geneva, 1418 November 1977," Doc. 25-E, 33 (1977).
2. CCITT Study Group XIV-Temporary Document No. 39-E, Kyoto 7-15
November 1979.
3. Huang, T. S., "Coding of Two-Tone Images," IEEE Trans. on Comm.
COM-25, 1406 (1977).
4. Gorog, I., Heyman, P. M., Kim, H. K., and Lippman, M. D., "An Experimental Low-cost Graphic Information Distribution Terminal," SID
Dig. Tech. Papers, 2, 14 (1971).
5. Huffman, D. A., "A Method for the Construction of Minimum-Redundancy Codes," Proc. IRE 40, 1098 (1952).
6. Shannon, C. E., "A Mathematical Theory of Communication," Bell Syst.
Tech. J., 27, 379 (1948).
7. Capon, J., "A Probabilistic Model for Runlength Coding of Pictures,"
IRE Trans. on Inf. Theo., IT-5, 157 (1959).
8. Takagi, M. and Tsuda, T., "A Highly Efficient Run-Length Coding
Scheme for .Facsimile Transmission," Electron Commun Jpn 58, 30
(1975).
9. Deutsch, S., "A Note on Some Statistics Concerning Typewritten or
Printed Material," IRE Trans. on Information Theory IT-3, 147 (1957).
10. Laemmel, A. E., "Coding Processes for Bandwidth Reduction in Picture
Transmission," Report R-248-51, PIB-187, Poly Inst of Brooklyn, N.Y.,
29 (1951).
11. Bahl, L. B., Barnea, D. I., and Kobayashi, H., Image Compaction System, U.S. Patent 3,833,900 (1974).
12. Yamazaki, Y., Wakahara, Y., and Teramura, H., "Digital Facsimile
Equipment 'Quick-FAX' Using a New Redundancy Reduction Technique," NTC '76, 6.2-1 (1976).
13. Musmann, H. G. and Preuss, D., "Comparison of Redundancy Reducing
Codes for Facsimile Transmission of Documents," IEEE Trans. on
Comm., COM-25, 1425 (1977).
14. Mitchell, J. L. and Goertzel, G., "Two-Dimensional Facsimile Coding
Scheme," ICC '79, 8.7.1 (1979).
15. CCITT Study Group XIV, IBM Europe, "Proposal for Two-Dimensional
Coding Scheme," Doc. 64-E, (1979).
16. CCITT Study Group XIV, Japan, "Proposal for Draft Recommendation
of Two-Dimensional Coding Scheme," Doc. 42-E, (1978).
17. CCITT Study Group XIV, IBM Europe, "Uncompressed Mode Enhancement to IBM Coding Scheme," Doc. 80-E, (1979).
From the collection of the Computer History Museum (www.computerhistory.org)