home *** CD-ROM | disk | FTP | other *** search
- This does NOT explain 2D-MR fax format, only the more common 1D-MH.
- This information is from [Simtel-20 CD-ROM]\MSDOS\TIFF\TIFF_50.ZIP.
-
- An Aldus/Microsoft Technical Memorandum: 8/8/88
-
- [several thousand lines explaining non-T.4 material deleted]
-
- A line (row) of data is composed of a series of variable length
- code words. Each code word represents a run length of either all
- white or all black. (Actually, more than one code word may be
- required to code a given run, in a manner described below.)
- White runs and black runs alternate.
-
- In order to ensure that the receiver (decompressor) maintains
- color synchronization, all data lines will begin with a white run
- length code word set. If the actual scan line begins with a
- black run, a white run length of zero will be sent (written).
- Black or white run lengths are defined by the code words in
- Tables 1 and 2. The code words are of two types: Terminating
- code words and Make-up code words. Each run length is
- represented by zero or more Make-up code words followed by
- exactly one Terminating code word.
-
- Run lengths in the range of 0 to 63 pels (pixels) are encoded
- with their appropriate Terminating code word. Note that there is
- a different list of code words for black and white run lengths.
-
- Run lengths in the range of 64 to 2623 (2560+63) pels are encoded
- first by the Make-up code word representing the run length that
- is nearest to, not longer than, that required. This is then
- followed by the Terminating code word representing the difference
- between the required run length and the run length represented by
- the Make-up code.
-
- Run lengths in the range of lengths longer than or equal to 2624
- pels are coded first by the Make-up code of 2560. If the
- remaining part of the run (after the first Make-up code of 2560)
- is 2560 pels or greater, additional Make-up code(s) of 2560 are
- issued until the remaining part of the run becomes less than 2560
- pels. Then the remaining part of the run is encoded by
- Terminating code or by Make-up code plus Terminating code,
- according to the range mentioned above.
-
- It is considered an unrecoverable error if the sum of the run
- lengths for a line does not equal the value of the ImageWidth
- field.
-
- New rows always begin on the next available byte boundary.
-
- No EOL code words are used. No fill bits are used, except for
- the ignored bits at the end of the last byte of a row. RTC is
- not used.
-
- Table 1/T.4 Terminating codes Table 2/T.4 Make-up codes
- len white black len white black
- --- -------- ---------- ---- --------- ------------
- 0 00110101 0000110111 64 11011 0000001111
- 1 000111 010 128 10010 000011001000
- 2 0111 11 192 010111 000011001001
- 3 1000 10 256 0110111 000001011011
- 4 1011 011 320 00110110 000000110011
- 5 1100 0011 384 00110111 000000110100
- 6 1110 0010 448 01100100 000000110101
- 7 1111 00011 512 01100101 0000001101100
- 8 10011 000101 576 01101000 0000001101101
- 9 10100 000100 640 01100111 0000001001010
- 10 00111 0000100 704 011001100 0000001001011
- 11 01000 0000101 768 011001101 0000001001100
- 12 001000 0000111 832 011010010 0000001001101
- 13 000011 00000100 896 011010011 0000001110010
- 14 110100 00000111 960 011010100 0000001110011
- 15 110101 000011000 1024 011010101 0000001110100
- 16 101010 0000010111 1088 011010110 0000001110101
- 17 101011 0000011000 1152 011010111 0000001110110
- 18 0100111 0000001000 1216 011011000 0000001110111
- 19 0001100 00001100111 1280 011011001 0000001010010
- 20 0001000 00001101000 1344 011011010 0000001010011
- 21 0010111 00001101100 1408 011011011 0000001010100
- 22 0000011 00000110111 1472 010011000 0000001010101
- 23 0000100 00000101000 1536 010011001 0000001011010
- 24 0101000 00000010111 1600 010011010 0000001011011
- 25 0101011 00000011000 1664 011000 0000001100100
- 26 0010011 000011001010 1728 010011011 0000001100101
- 27 0100100 000011001011 EOL 000000000001 EOL 000000000001
- 28 0011000 000011001100
- 29 00000010 000011001101 Table 3/Additional make-up codes
- 30 00000011 000001101000 len code for white or black
- 31 00011010 000001101001 ---- ---------------
- 32 00011011 000001101010 1792 00000001000
- 33 00010010 000001101011 1856 00000001100
- 34 00010011 000011010010 1920 00000001101
- 35 00010100 000011010011 1984 000000010010
- 36 00010101 000011010100 2048 000000010011
- 37 00010110 000011010101 2112 000000010100
- 38 00010111 000011010110 2176 000000010101
- 39 00101000 000011010111 2240 000000010110
- 40 00101001 000001101100 2304 000000010111
- 41 00101010 000001101101 2368 000000011100
- 42 00101011 000011011010 2432 000000011101
- 43 00101100 000011011011 2496 000000011110
- 44 00101101 000001010100 2560 000000011111
- 45 00000100 000001010101
- 46 00000101 000001010110
- 47 00001010 000001010111
- 48 00001011 000001100100
- 49 01010010 000001100101
- 50 01010011 000001010010
- 51 01010100 000001010011
- 52 01010101 000000100100
- 53 00100100 000000110111
- 54 00100101 000000111000
- 55 01011000 000000100111
- 56 01011001 000000101000
- 57 01011010 000001011000
- 58 01011011 000001011001
- 59 01001010 000000101011
- 60 01001011 000000101100
- 61 00110010 000001011010
- 62 00110011 000001100110
- 63 00110100 000001100111
-