home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / BGFAX150.ZIP / BGFXDOCS.ZIP / T4SPEC.TEC < prev    next >
Encoding:
Text File  |  1995-08-12  |  5.7 KB  |  121 lines

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