⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc803.txt

📁 著名的RFC文档,其中有一些文档是已经翻译成中文的的.
💻 TXT
📖 第 1 页 / 共 3 页
字号:
RFC 803          Dacom 450/500 Facsimile Data Transcoding         A. Agarwal, M. J. O'Connor and D. L. Mills                      2 November 19811.  Introduction     As part of our effort in support of  the  DARPA  Internet  Program,software  modules  to encode and decode facsimile data for the Dacom 450and 500 models Computerfax facsimile  machines  have  been  constructed.The  purpose of these modules is to map the data representations used bythese machines to and from bit-map  and  run-length  representations  inprograms  for editing, transmission and archiving facsimile images.  Themodules are written in the PDP-11 MACRO-11 assembly language and can  beincorporated into programs for, among others, the RT-11 operating systemand the DCNET BOS or VOS operating systems.     The first part of this report describes in  detail  the  Dacom  450data compression algorithm and is an update and correction to an earliermemorandum [2].  Following this, the encoding  and  decoding  algorithmsare  described  along  with  the  supporting  programs and file formats.Reference  [3]  describes  another  implementation   of   the   decodingalgorithm.   Grateful  acknowledgment  is made to E.  A.  Poe of Rapicomfor his assistance in this effort.     The second part of this report describes briefly the Dacom 500 datacompression  algorithm  as used by the INTELPOST electronic-mail networkunder  development  by  the  US  Postal  Service  and  several   foreignadministrations.    These  machines  conform  to  the  CCITT  T.4  DraftRecommendation, described in [5].  Supporting programs and file  formatsare described.2.  Dacom 450 Data Compression Principles     The encoding algorithm for the Dacom 450 processes lines scanned bythe  machine  to  produce a two-dimensional run-length code described byWeber [1]; however,  this  article  contains  a  number  of  errors  andomissions,  many  of  which  were  discovered  only  after  considerableanalysis  and  experimentation  [2,3].   The  machine  operates  over  acoordinate   space   of   l726   by  approximately  2200  pels  when  inhigh-resolution (detail) mode.  In normal (quality)  mode  the  verticalresolution is halved, so that about 1100 lines are transmitted, while inexpress mode about 733 lines are transmitted (missed lines are filled inon playback by replicating previous lines).     Data are encoded  two  rows  at  a  time  using  a  two-dimensionalrun-length  code.   Each  row-pair  is  scanned  left-to-right  and  theline-pairs themselves processed top-to-bottom of the document.  Figure 1shows how the pels are represented.Dacom 450/500 Facsimile Data Transcoding                        PAGE   2                    |          |          |                ----+----------+----------+----                ... |  x(1,j)  | x(1,j+1) | ...                ----+----------+----------+----                ... |  x(2,j)  | x(2,j+1) | ...                ----+----------+----------+----                    |          |          |                      Direction of scan ->               Figure 1. Data Representation     For each j the vector (x(1,j),x(2,j)) represents  the  contents  ofthe  jth  column, where x(i,j) can take on values of zero (white) or one(black).  Each of the four possible vectors ranging  over  these  valueswill  be  called a state (Dacom calls these "modes") with the successionof transitions between these states determined by the picture content ofthe  particular line-pair.  Scanning of the line-pairs follows one afterthe other with no special end-of-line code in the data itself.  For  thepurpose  of later discussion and comparison with the published data, thefollowing conventions will be used (note: the pels read top-bottom):                Pels    Vector  State                ---------------------                   W-W     (0,0)   0                B-W     (1,0)   1                W-B     (0,1)   2                B-B     (1,1)   3     The algorithm used by Dacom to generate the transmitted data as thecolumns   are   scanned   can  be  described  as  the  non-deterministicfinite-state automaton (nfsa) shown in Figure 2.  Conceptually, the nfsastarts  at  the beginning of a page in a designated state and at a pointjust after scanning the jth column in the jth state.  It then scans  the(j + 1)th column and enters that state while emitting the string of bitsshown in the figure.     In the states corresponding to  W-W  (0)  and  B-B  (3)  a  specialrun-length  encoding  techniques is used.  There are two state variablesassociated with each of  these  two  states,  one  variable  used  as  arun-length  counter  and  the  other  the field length (in bits) of thiscounter.  Upon each entry to either of these two states the  counter  isinitialized  at  zero  and  counts up for every additional column of thesame state.  At the end  of  the  run  the  value  of  this  counter  istransmitted  extending  with high-order zeros, if necessary, to fill thefield length specified.  If, however, the counter equals 2**n - 1, wheren  is the field length, then a sequence of n one-bits is emitted and thecounter re-initialized at zero with a field length of n + 1.   Thus,  ifn = 3, a run length of three is transmitted as {010} and a run length ofseven as {110}, while a run length of eight as two words, {111} followedby  {0000}.   The  field-length  variables are maintained separately forboth the W-W and B-B states, and at each re-entry  to  either  of  thesestates the previous values are used.Dacom 450/500 Facsimile Data Transcoding                        PAGE   3                                   0100           .--------------------->----------------------------------.           |                                                        |           |   .-----------------<------------------------------.   |           |   |                1                               |   |           |   V                                                |   |     .--------------.                     .---------------.     |   |     |              |                     |               |     |   |     |              |        010          |               |     |   |  .->|      1       |-------------------->|       2       |->.  |   |  |  |              |                     |               |  |  |   | 0|  |     B-W      |        101          |      W-B      |  |1 |   |  \<-|              |<--------------------|               |<-'  |   |     |              |                     |               |     |   |     |              |               .---->|               |     |   |     \--------------'               |     \---------------'     |   |         |   A                      |      |     |   A          |   |         |   |     .--------->------'      |     |   |          |   |         |   |     |         1             |     |   |          |   |         |   |     |                       |     |   |          A   V         |   |     |                       |     |   |          |   |     0111|   |1    |                       | 1000|   |1         |   |         |   |     |                       |     |   |          |   |         |   |     |                       |     |   |          |   |         |   |     |                       |     |   |          |   |         |   |     |          1011         |     |   |          |   |         |   |     |    .-------<----------'     |   |          |   |         V   |     |    |                        V   |          |   |     .--------------.   |                 .---------------.     |   |     |              |<--'                 |               |     |   |     |              |        0            |               |     |   |     |      3       |<--------------------|       0       |-----'   |     |              |                     |               |         |     |     B-B      |                     |      W-W      |         |     |              |-------------------->|               |<--------'     |              |        0            |               |     |              |                     |               |     \--------------'                     \---------------'         |    A                                 |    A         |    |                                 |    |         \----'                                 \----'          run                                    run                    Figure 2.  NFSA Model of Encoding     Dacom 450/500 Facsimile Data Transcoding                        PAGE   4     Field-length values are constrained not to exceed  seven,  so  thatruns  exceeding  l27 with n = 7 will be encoded as a separate 7-bit wordof one-bits for each run of l27  except  the  last,  which  must  alwayscontain  at  least one zero-bit.  The field length n is decreased by oneunder the following circumstances: the current run has been encoded as asingle  n-bit  field,  and for n in the range four through seven the twohigh-order bits are zero or for n equal to three the  single  high-orderbit  is  zero.   The field length is not allowed to be reduced below twobits.     The encoding algorithm starts in state 0 with  both  field  lengthsset to 7.2.1.  Dacom 450 Decoding Algorithm     For reasons of speed and simplicity it is desirable that the  Dacom450  decoding  algorithm  be  modeled  on  the  basis of a deterministicfinite-state automaton (dfsa).  Using straightforward formal procedures,the  dfsa  of Figure 3 can be constructed.  This machine makes one statetransition for every bit, except for the W-W (0)  and  B-B  (3)  states,which  must be treated specially in any case.  The states are labeled insuch a way as to correspond to those of Figure  2  for  states  numberedfrom zero to three.     The decoded output symbols, in this case the columns  correspondingto  each  of the states, are represented by the states themselves.  Uponentry to state B-W (1) or W-B (2) a run-length counter is initialized toone.   Each  traversal  of a loop back to the same state increments thiscounter and, upon exit to any other state, the  value  of  this  counterrepresents  the  number  of columns to be produced.  Upon entry to stateW-W (0) or B-B (3) the run-length counter is initialized to zero and theassociated   field-length   state  variable  n  established.   For  eachsuccessive n bits of all-ones, the counter is increased by 2**n - 1  andthen n itself increased by one, but not above seven.  If the next n bitsare not all ones, then the counter is increased by the value representedby the n-bit field plus one.  Finally, if upon entry to either state thenext n bits are not all ones, n is decreased by  one  according  to  therule mentioned in the preceding section.Dacom 450/500 Facsimile Data Transcoding                        PAGE   5                              .-----------.                     .-----------.  .-----|           |                     |           |-----.  |     |     9     |                     |     6     |     |  |   .-|           |<--.             .-->|           |-.   |  |   | \-----------'    \           /    \-----------' |   | 1|  0|                   \         /                   |1  |0  |   |    .->Error        \       /        Error<-.    |   |  |   |   0|                \     /                |1   |   |  |   | .-----------.        \   /        .-----------. |   |  | 1 | |           |         \ /         |           | | 0 |  | .---|     7     |          \          |    10     |---. |  | | | |           |         / \         |           | | | |  | | | \-----------'        /   \        \-----------' | | |  | | |       A             /     \             A       | | |  | | |       |            /       \            |       | | |  | | |      1|           /         \           |0      | | |  | | | .-----------.  0 /           \ 1  .-----------. | | |  | | | |           |---'             \---|           | | | |  | | | |     5     |                     |     8     | | | |  | | | |           |                     |           | | | |  | | | \-----------'                     \-----------' | | |  | | |       A                                 A       | | |

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -