Description of the Drawings
FIG. 1 shows a template in accordance with the present invention
FIG. 2 shows a template used in the prior arithmetic coding.
FIG. 3 shows a block diagram of a system for performing the improved data compression of the present invention.
Description of the Preferred Embodiment
In describing the preferred embodiment of the present invention, it is assumed for convenience of description that the dither image is generated with a 4 by 4 matrix, although the invention can be applied to any images generated by dither matrices with arbitrary size and threshold patterns. Also, the invention is described hereinafter utilizing a 7 bit template, but it will be understood that the invention can be applicable to larger template sizes. To enlarge the template, however will require increasing the size of the statistical table of the arithmetic coder. The 7 bit template is one of a practical size in the trade-off between compression efficiency and cost of the coder.
FIG. 1 shows the template 2 of the present invention. The template 2 samples the history pels "A", "B", "C", "D", "E", "F" and "G" in a history line and a current line. The pels "B", "C" , "D" and "G" are adjacent pels to the current pel "X" to be processed, and the pels "A", "E" and "F" are separated from the adjacent pels. Particularly, the pels "A" and "E" are so separated from the pels "D" and "G", respectively, as to adapt to a period of the 4.times.4 dither matrix. The sampled previous 7 bits are used to determine whether the bit pattern or image of the 7 bits should be treated as a text/graphic image or a dither image, or neither.
By way of describing the manner in which the determination is carried out, 128 bit patterns represented by the 7 bits are classified into a dither dominant group, a text/graphic dominant group or a remaining group which does not belong to the dither dominant and the text/graphic dominant groups.
In the case of the dither image, every 4th pel will correlate owing to the delocalization, and the following case is statistically frequent:
On the other hand, the correlation is well localized in the text/graphic image, and the following case is statistically dominant:
Using the conditions (1), (2) and (3), the dither dominant states (patterns) and the text/graphic dominant states among the 128 states or patterns of the 7 bits "A" through "G" are defined, as follows.
Dither Dominant Patterns
Consider a numeric P="ABCDEFG" bits, and n is 0 or positive integers.
In the case of
In the case of
P:5,7,21,23,37,39,53,55
In the case of
P: 72,74,88,90,104,106,120,122
In the case of
P:77,79,93,95,109,111,124,127
In this manner, 32 dither dominant states or patterns are defined.
It is noted, however, that the underlined states are not used as the dither dominant patterns, as described hereinbelow.
Text/Graphic Dominant Patterns
In the case of
P: 0,,4,6,8,10,12,14
In the case of
P: 66,68,70,, 74,76,78
In the case of
P: 49,51,53,55,57,59,61,63,113,115, 117,119,121,123,125,127
In this manner, 32 text/graphic dominant states are defined.
It is noted, however, that the underlined states are not used as the text/graphic dominant patterns, as described hereinbelow.
Among the number P, the following eight states or patterns are common to both the dither dominant and text/graphic patterns
P: 0,2,53,55,62,74,125,127
These numbers are shown as underlined in the above, and these satisfy the above conditions for the dither and text/graphic dominant states. Explaining about "0" and "72", for example;
"0" satisfies "A=D=E=G=0" or the conditions (1) and (2) for the dither image, and also satisfies "B=C=G=0" or the condition (3) for the text/graphic image. "72" satisfies "A=D=1; E=G=0" or the conditions (1) and (2) for the dither image, and also satisfies "B=C=G=O" or the condition (3) for the text/graphic image.
Finally, 24 states (32-8=24) are chosen in both states for determining whether the bit pattern P sampled by the template 2 belongs to the dither dominant patterns or the text/graphic patterns.
Referring to FIG. 3, a system is shown for making the determination for a seven bit pattern using a table 3. For each sample of the seven bits by the template 2, the seven bits are supplied to a register 6 and the table 3. The seven bits are used as an address for accessing the table 3. The following Table 2 partially shows the contents of the table 3 of FIG. 3.
If the pattern of the sampled seven bits is of dither dominant states as in the case of P=16 are 88, for example, the "+1" output is read out of the table 3. If the sampled seven bits are of text/graphic dominant states as in the case of P=64 and P=119, the "-1" output is read out. For the states other than these states, the "0" output is read out.
The invention basically switches, after a dither or a text/graphic image occurs, the access to the first and second statistical tables 8 and 9. The first table 8 stores, at each entry, the more probable symbol and the probability of the less probable symbol for the seven bit pattern of the text/graphic image, and the second statistical table 9 stores, at each entry, the more probable and the probability of the less probable symbol for the seven bit pattern of the dither image. In a real image in a document, the 7 bit pattern may accidentally match to a dither dominant pattern although the 7 bit pattern is in the text image, and vice versa. Such a fluctuation can be removed by introducing a hysteresis in the switching operation, as follows.
A counter 4 and a decision and control circuit 5 are provided between the table 3 and the register 6. The counter 4 counts up whenever the "+1" output is applied, and counts down whenever the "-1" output is applied, and stays at its value when the "0" output is applied.
Also, the invention introduces an upper and a lower threshold for the count value. The decision and control circuit 5 determines whether the count value has reached the upper threshold or the lower threshold, or not. When the count value is equal to or larger than the upper threshold, the decision and control circuit 5 supplies "1" to the position "Q" of the register 6, and causes the count value to be equal to the upper threshold value. When the count value is equal to or smaller than the lower threshold, the decision and control circuit 5 supplies "0" to the position "Q" of the register 6, and causes the counter value to be equal to the lower threshold. Otherwise, the bit in the position "Q" is not changed. The upper and lower thresholds are determined or selected empirically to maximize the compression efficiency.
In this manner, the number of occurrences of the text/graphic dominant states and the dither states is accumulated for controlling the switch of the access to the first and second statistical tables, whereby the above-stated fluctuation is removed.
The eight bits including the bit "Q" and seven bits "A" through "G" are supplied from the register 6 to the table access 7, which switches the access operation to the first and second statistical tables 8 and 9 in response to the value of the bit "Q".
The selected statistical table is accessed by use of the seven bits as an address. The more probable bit or symbol in the addressed entry is supplied to a compare circuit 10, which compress the more probable bit with the current bit "X". If equal, a YES signal is supplied to a coding circuit 11, and if not equal, a NO signal is supplied to the coding circuit 11. Also, the coding circuit 11 receives the probability of the less probable bit from the addressed entry, and calculates the composite probability of the coded output. And, the most probable bit and the probability of less probable bit in the entry are updated. These calculations and the update are described in the above-cited Langdon references, and are not described herein.
Effect of the Invention
To evaluate the efficiency achieved by the present invention, compression rates for the present invention and the prior methods were stimulated. Three kinds of test charts were used. The first chart was CCITT's test chart No. 1, called as Test chart hereinbelow. The second chart was the text chart of The Institutes of Image Electronics Engineers of Japan, and called as Dither chart. The third chart was IEEE's Facsimile Test Chart "IEEE Std 167A-1980" which includes text, graphic and dither images, and called as Mixed Chart.
The entropy on adapting to stationary statistics is defined as follows. Assuming that there are N states in a template model under consideration, n(k) is the probability of "0" in state k, and p(k) is the probability of "0" in state k. Then entropy H of the image data is: ##EQU1##
The entropy is very close to the actual data compressed data volume according to the arithmetic coding scheme as shown in the reference (2). The slow adaptation scheme was not used to evaluate the several template models here. The slow adaptation can be utilized in addition to the fast adaptation of the invention at the same time, and it will help to improve the compression about 10% as compared with the entropy on static adaptation as shown in the reference (2). However, the entropy is a good measure to evaluate the prediction models in general, and especially very close to the real compressed data volume in the arithmetic coding scheme.
So the entropy to evaluate the model efficiency was used.
As shown in Table 3, the calculated entropies are compared with original data and compressed data volumes with the modified READ scheme. The data in the last colume was obtained using the present invention, where the template is the 7 bit template B, and the adaptive switching scheme was used with the hysteresis parameter: UPPER=2 and LOWER=2.
The result shows that the present invention can improve the compression efficiency in both the dither picture and the mixed document drastically. This improvement is realized by the present invention through the introduction of the new template model taking into consideration the delocalization of bit correlations in the dither image and the localization of bit correlations in the text/graphic image, and the introduction of the adaptive switching scheme to adapt to the different statistics between both images.
The improved scheme of the present invention can be implemented in software and hardware coder/decoders.