📄 rfc803.txt
字号:
| | | | | | | | | | | 1| |0 | | | | | | .-----------. .-----------. | | | | | ->| | | |<- | | | | | 1 | | 2 | | | | | | B-W |<-----. .----->| W-B | | | | | \-----------' | | \-----------' | | | | | A | | A | | | | | | | |0 1| | | | | | | \-----' | | \-----' | | | | 0 .-----------. 0 | | | | | | | | | | | 4 | | | | | RUN | | RUN | | | | .-----. \-----------' .-----. | | | | | | A A | | | | | | | V | | V | | | | | .-----------. 1 | | 1 .-----------. | | | \-->| |------' 0 \------| |<--' | | | 3 |<--------------------| 0 | | \---->| B-B |-------------------->| W-W |<----' \-----------' 0 \-----------' Figure 3. DFSA Model of Encoding Dacom 450/500 Facsimile Data Transcoding PAGE 62.2. Formatting Considerations Data are encoded for transmission by the Dacom 450 in 585-bitframes, consisting of a 24-bit synchronization code, 37-bit leader,512-bit information area and l2-bit checksum. There are two kinds offrames distinguished by leader format, one for setup or initializationand the other for the data itself. Serial binary image data are placedin the data area of succeeding data frames. The header of each frame is shown in Figure 4. The various fieldsare defined in Table 1 following the Figure. +-----------+--------+-------------------+----------+ | Sync Code | Leader | Data | CRC Code | +-----------+--------+-------------------+----------+ 24 / 37 \ 512 12 .-------' \----------------------. / \ +-------+-------+-------+-------+-------+-------+ | Flags | Count | X Pos | Black | White | State | +-------+-------+-------+-------+-------+-------+ | 7 \ 10 12 3 3 2 | \--------------------------. | \ +-----+-----+------+-----+-------+-----+ | Seq | RUN | COFB | RPT | Spare | SUB | +-----+-----+------+-----+-------+-----+ 2 1 1 1 1 1 Figure 4. Frame FormatDacom 450/500 Facsimile Data Transcoding PAGE 7 Table 1. Header Field Definitions Field Width Function Setup Data (bits) Block Block-----------------------------------------------------Sync Code 24 Synchronization 30474730 (octal)Seq 2 Sequence number 00 00,01,10,11RUN 1 Initialize-start 0 1COFB 1 Unknown 0 0RPT 1 Unknown 1 0Spare 1 Unknown 0 0SUB 1 Indicates setup frame 1 0Count 10 Number of bits in data All 1's field (0 - 512)X Pos 12 Current position on All 1's scan line (0 - 1725)Black 3 Current black field All 1's length (2 - 7)White 3 Current white field All 1's length (2 - 7)State 2 Current state (0 - 3) All 1'sData 512 Data (0 - 512 bits)CRC Code 12 CRC checksum. Uses polynomial x**12 + x**8 + x**7 + x**5 + x**3 + 1Dacom 450/500 Facsimile Data Transcoding PAGE 8 Setup frames have additional information in the data field; thevarious fields and their functions are described in Table 2. Table 2. Field Definitions for Setup Frame. Field Width Function--------------------------------Start bit 1 Always zeroSpeed bit 1 Set if express modeDetail bit 1 Set if detail mode (speed and detail bits both zero for quality mode)14 inch 1 Set if 14-inch paper 5 inch 1 Set if 5-inch inch paper (14-inch and 5-inch inch paper bits both zero for 11-inch paper)Paper present 1 Set if paper present in scannerSpare 5 Can have any valueMulti-page 1 Set if multi-page mode 20 All 0's 480 Alternate 1's and 0's The tailing setup frames differ from the leading setup frames onlyin bits which indicate whether the system is operating in single ormultiple page mode and whether paper is present in the scanner. All n-bit numeric fields (except Seq) are transmitted by the Dacom450 machine least-significant-bit (LSB) first (i.e. Count, X Pos,Black, White, State, CRC, and run length words in the data field).All other fields are transmitted left-most bit first. There are a few important points to be considered in regard to theheader of a data frame. The header contains enough information aboutthe state of the decoding algorithm to be able to re-establish correctdecoding in the event of loss or mutilation of a data frame. Thedecoding algorithm resets its state variables to those in the headereach time it begins decoding a new data frame. One of the mostdifficult problems encountered while constructing the decoding algorithmwas the correct synchronization of the algorithm as it proceeds acrossthe frame boundary with respect to the header information. In order forsynchronization to be maintained, the operation of the algorithm mustDacom 450/500 Facsimile Data Transcoding PAGE 9follow exactly that described in the previous section. This requirement for every data frame to be self-synchronizing,leads to a few subtleties in the encoding algorithm which seem quitenatural, but were not very obvious in the beginning.1. Transition bits(s) labeling the arcs on the state transition diagram in Figure 2 are not broken across frames. Similarly, individual run-length words are not broken across frames.2. If a frame ends with a transition, the header of the next frame contains the state to which the transition is made.3. If a frame ends with a transition out of state 0 or 3, then the transition bit (0 or 1) is inserted at the end of the current frame (not at the beginning of the next frame).4. The field lengths for black and white runs in the header include changes that may have been caused at the end of the previous frame.5. If a frame begins with a white or black run, then this run is treated (for purpose of decreasing its field length) as if it were the beginning of a new run, since there is no information in the header to indicate otherwise. The decoding algorithm is initialized at the first data framereceived after the sequence of setup frames at the beginning oftransmission. The first data frame has a count of zero, indicating nodata bits are in the frame. The second data frame begins the actualdocument; however, its X position appears to be irrelevant. Instead, weassume the initial X position at this time is one pel to the left of theright margin (-l mod l726). With these assumptions succeeding Xpositions of the algorithm and the frame headers agree.2.3. The Decoding Program The decoding algorithm described above has been implemented in thePDP-11 MACRO-11 assembly language for the RT-11 operating system. Thisprogram contains extensive features for selectively dumping frames andtracing the operation of the algorithm. It is designed to operate on afile containing the raw data generated by the machine and does notdepend upon any prior reformatting of the data. However, it willoperate also on files in the so-called UCL format [4], which has beenadopted as the standard for use in the Internet Program. The existingDCNET supporting software for the Dacom 450 uses the UCL format andoperates normally to copy data directly between the machine and thefile, with decoding operations done at a later time. However, there isno intrinsic factor, except processing-rate limitations, why input datacould not be decoded directly from the machine. In operation, the program scans the input data one bit at a timeand searches for the synchronization pattern. Note that all dataprocessed are inverted from the natural interface conventions. When aDacom 450/500 Facsimile Data Transcoding PAGE 10synchronization pattern is found, the header and data portions areextracted and the various state variable checked and reset, ifnecessary. Checksum verification is performed according to thepolynomial 1 + x**3 + x**5 + x**7 + x**8 + x**12. In the case of setupframes the format (detail, quality, express), page length (14, 8-l/2,5-l/4) and multiple-page indicators are extracted from the data area.Finally, under control of specified options, the header and dataportions of the frame are printed with appropriate headings. The decoding algorithm itself is called for each data frame. Itproduces an output consisting of a sequence of run-length pairs which
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -