prev
l
next
CCITT Facsmile Compression Standards

T.4 2-Dimensional
T.6 2-Dimensional

Books
References
Related links

 

CCITT Facsmile Compression Standards

The International Telecommunications Union, ITU-T (formerly know as CCITT), is a multinational union that provides standards for telecommunication equipment and systems. Here we will explain two standards for facsimile compression, T.4 and T.6.

Recommendation T.4 defines the characteristics of Group 3 facsimile terminals which enable black and white documents and also optionally colour documents to be transmitted on the general switched telephone network, international leased circuits and the Integrated Services Digital Network (ISDN). Group 3 facsimile terminals may be operated manually or automatically and document transmission may be requested alternatively with telephone conversation.
T.6 facsimile coding schemes consist of the basic facsimile coding scheme and optional facsimile coding schemes. They are defined in Section 2, 3 and 4. Facsimile coding schemes are specified assuming that transmission errors are corrected by control procedures at a lower level. The basic T.6 facsimile coding scheme is the two-dimensional coding scheme which is in principle the same as the two-dimensional coding scheme of Group 3 facsimile specified in Recommendation T.4. Optional facsimile coding schemes are specified not only for black and white images but also for grey scale and colour images. Facsimile coding control functions are used in facsimile user information in order to change facsimile parameters or to invoke the end of facsimile block.

The CCITT T.4 and T.6 specifications outline many different kinds of requirements for the facsimile apparatus, including the resolution of scanning and printing, dimensional tolerances, timing constraints etc. The sections which tend to be used in the imaging world are those which describe the compression schemes, and these are often referred to as Group 3 and Group 4 in their own right. The compression and decompression algorithms are quite complex, as will be seen, and must be implemented either in hardware or sophisticated software in order to achieve good performance.

So how do the Group 3 and Group 4 compression mechanisms work?
Both schemes encode the source image on a horizontal scanline-by-scanline basis, corresponding to the way in which documents are scanned and printed on a facsimile machine. The difference lies in the way the two standards handle successive scanlines - in Group 3, each scanline is encoded independently, whereas in Group 4, scanlines are encoded with reference to the previous one, resulting in improved compression ratios.

An interesting side-effect of the way that Group 3 and Group 4 work is that the size of compressed images is roughly linearly proportional to the resolution at which the image is scanned, whereas that of the original is of course proportional to the square of the resolution. This is because the total compressed size is a function of the number of scanlines, with roughly the same number of codes being produced for each scanline irrespective of resolution.

Compression ratios achieved using Group 3 of course depend upon the nature of the source image. Under certain circumstances, it will be obvious that the encoded version could be larger than the original (consider the case of single alternating black and white pixels), but in general compression ratios of 10:1 can be achieved on pages of typewritten text.

Compression ratios achieved using Group 4 are several times better than Group 3, yielding upwards of 25:1. Most imaging systems now use the Group 4 compression standard, as a result of the improved compression and the development of Group 4 software compression and decompression which executes at high speed.

 

back to top


CCITT T.4 2-Dimensional Compression Standard

INTRODUCTION
The CCITT Group 3 two-dimensional coding uses the Modified Huffman code and the Modified Relative element address designate (MR)code.The main atvantage of the CCITT Group 3 two-dimensional coding over the CCITT Group 3 one-dimensional coding is that compression efficiency is improved.This is due to the fact that the two-dimensional coding explores correlation of pixels in two successive lines.

In Group 3, a scanline is encoded as a set of runs, each representing a number of white or black pixels, with white runs alternating with black runs. Every run is encoded using a variable number of bits, which can be uniquely identified upon decoding. This means that frequently occurring lengths of run may be encoded very efficiently, at the expense of the infrequent ones. For example, a black run of 2 or 3 pixels is encoded using just 2 bits, whereas one of 1000 pixels is encoded in 25.

Important terms used in CCITT T.4
Term Definition
Color of an element Black or white
Changing element An element whose color is different from that of the previous element along the same scan line
Coding element The current scan line
Reference line The previous scan line
Coding mode A method to code the position of each changing element along the coding line.
Reference element An element whose position determines a coding mode


HOW DOES CCITT T.4 WORK?

The CCITT Group 3 two-dimensional coding is a line-by-line coding method. The position of each changing picture element on the coding line is coded with respect to the position of a corresponding reference element. The reference element is located on either the coding line or the reference line. After the coding line has been coded, it becomes the reference line for the next coding line. In order to limit the facsimile transmission error, a Modified Huffman coded line (i.e. one-dimensional coded line) is sent periodically. This period is referred to as K factor. For facsmile, at the standard vertical resolution, K is equal to 2; at the higher vertical resolution, K is equal to 4. For digital image, K can be any positive non-zero integer.

In summary, for every group of K lines, the CCITT Group two-dimensional scheme encodes 1 line in one-dimensional coding and the other K-1 lines in two-dimensional coding.
In the CCITT Group 3 2-D coding there are 5 changing picture elements

Changing elements
Changing element Definition
a0 The reference element on the coding line
a1 The next changing element to the right of a0 on the coding line
a2 The next changing element to the right of a1 on the coding line
b1 The next changing element on the reference line to the right of a0 and of opppsite color of a0
b2 The next changing element to the right of b1 on the reference line


At the starting the coding line, the changing element a0 is first set on imaginary white changing element located just before the first element on the coding line. During the encoding of the coding line, the position of a0 is determined by the previous coding mode.

EXAMPLE

                 b1       b2
////////////______////////__ __
////////______//////////////// __
      a0       a1         a2

MODES

In the CCITT T.4 standard, there are three coding modes: Pass Mode(P) ,Vertical Mode, and Horizontal Mode (H). Depending on the position of a changing element along the coding line, one of three coding modes can be identified.

Coding Modes
Coding Mode Condition
Pass Mode When the position of b2 lies to the left of a2
Vertical Mode When the relative distance between a1 and b1 is less than or equal to 3
Horizontal Mode When neither pass mode nor vertical mode occur

In the Vertical Mode, depending on the relative distance between a1 and b1, 7 possible cases can be identified:

               -  V  (0):a1 just under b1,
               -  Vr (1):a1 one pixel to the right of b1,
               -  Vr (2):a1 two pixels to the right of b1,
               -  Vr (3):a1 three pixels to the right of b1,
               -  Vl (1):a1 one pixel to the left b1,
               -  Vl (2):a1 two pixels to the left b1,
               -  Vl (3):a1 three pixels to the left b1.


The code words for three coding modes (pass, horizontal and vertical coding modes) are shown in Table 4. with the optional extension. In Table 4. M(ai,aj) represents the code words of 1-D compression standard for the run ai aj.

 

Table 4: Two-Dimensional Code Table
ModeElements to be coded Code word
Pass P b1,b2 0001
Horizontal H a0a1,a1a2 001+M (a0 a1) + M (a1 a2)
Vertical:V(0) a1 just under b1a1b1 = 0 1
Vr (1) a1b1 = 1 011
Vr (2) a1b1 = 2 000011
Vr (3) a1b1 = 3 0000011
Vl (1) a1b1 = 1 010
Vl(2) a1b1 = 2 000010
Vl(3) a1b1 = 3 0000010
Extension 2-D (extensions) 0000001xxx
1-D (extensions) 000000001xxx

 

back to top


CCITT T.6 2-Dimensional Compression Standard

INTRODUCTION
In 1984, the CCITT developed a specification defining the facsimile coding schemes to be used in the Group 4 black and white facismile. The standard, known as CCITT Recommendation T.6, is designed for error-free digital facsimile transmission mainly on public data networks. This specification has been widely used in document imaging systems for compressing black and white images. It is sometimes referred to as the CCITT Group 4 compression standard.

The CCITT T.6 facsimile coding standard consists of this basic facsimile coding scheme and future optional facsimile coding schemes. It is assumed that transmission errors are corrected by control procedures at a lower level. Therefore, CCITT T.6 is a noiseless coding scheme.
Since the CCITT T.6 coding scheme is designed for noise free transmission, a single bit error can cause corruption of the image. Compared to the CCITT T.4 coding scheme, this scheme is very sensitive to error, and is less robust.

HOW DOES CCITT T.6 WORK
The CCITT T.6 coding scheme is known as the Modified Modified Relative element address designate code (MMR). The basic facsimile coding scheme uses a two-dimensional line-by-line coding method, the position of each changing picture element on the current coding line is coded with the respect to the position of a corresponding reference element located on either the coding line or the reference line. The reference line is immediately above the coding line. After the coding line has been coded, it becomes the reference line for the next coding line. The reference for the first line of a page is an imaginary white line. This coding scheme is the same as the two-dimensional coding scheme of Group 3 facsimile specified in CCITT T.4, except the first line is encoded differently, and in the Group 3 two-dimensional coding scheme, every Kth line (K=2 or 4) of image data must be encoded by the Group 3 one-dimensional coding scheme.

The one-dimensional coding scheme of Group 3 facsimile makes use of only horizontal dependencies between picture elements in the same scan line. The advantage of the CCITT T.6 coding scheme over the one-dimensional coding scheme of Group 3 facsimile is that it exploits both horizontal and vertical dependencies, resulting in the greater compression efficiency. Since the CCITT T.4 two-dimensional coding scheme requires that every Kth line of image data must be encoded by the one-dimensional coding scheme, it is less efficient compared to the CCITT T.6 coding scheme.

Group 4 encoding is much more complex. As mentioned earlier, each scanline is compared with the previous one - in this way, vertical features in the source image can be used to achieve better compression ratios. Rather than considering the alternating white and black runs in each scanline, it considers the positions of changing pixels, in other words the positions of the first pixel in each run. Although these are effectively one and the same thing, Group 4 uses the position of the changing pixel relative to that of the one on the previous line as the coding scheme, rather than comparing relative runlengths.

The essence of the scheme is as follows. Consider the pattern shown in the figure below, which represents a few scanlines from an image. Because each changing pixel is underneath, or at least very close to, that on the line above, its position is encoded using a 'Vertical' code. This encoding is used where the relative positions are within three pixels of each other, and is the most commonly occurring type of code. In particular, the case where the positions of the changing pixels are identical, known as V(0) (the others being VL(3) to VR(3)), is encoded using a single bit. It can be seen immediately that a vertical line, of any thickness, can be encoded very efficiently.
When the bottom of image is detected (because the position of the changing pixel is very different to that on the line above), this is encoded as a 'Pass' code, and represents skipping over the two changing pixels, to black and back to white, on the line above. The positions of changing pixels which are not in close proximity to those above are encoded in pairs, using the Group 3 encoding mechanism.

Image2.bmp - 65430 Bytes

For 200 DPI (dots per inch) A4 documents, the typical compression ratio of the CCITT T.6 coding scheme is from about 15:1 to 20:1. For 400 DPI document images (e.g., eight CCITT test documents), it ranges from 30:1 to 40:1.

back to top


Books

back to top


References

  • Specs for Group 3 and 4 image coding (group 3 is very similar to group 4) are in CCITT (1988) volume VII fascicle VII.3.
  • The following paper covers T.4, T.6 :
    "Review of standards for electronic imaging for facsimile systems" in Journal of Electronic Imaging, Vol. 1, No. 1, pp. 5-21, January 1992.

back to top


Related Links

back to top