The present invention relates to a packet generation device and a non-transitory computer readable medium.
According to an aspect of the invention, there is provided a packet generation device including:
a first generation unit that generates a packet having a b-byte payload including plural sets of first data corresponding to a pixels from the first data having m-bit image information for each pixel; and
wherein a is defined so that (n−m)×a becomes multiples of 8, and
wherein b is defined based on a least common multiple of the number of bytes of sets of the first data corresponding to a pixels and the number of bytes of sets of the second data corresponding to a pixels.
Exemplary embodiments of the invention will be described in detail based on the following figures, wherein:
An exemplary embodiment of the invention will be described.
The image processing apparatus 100 includes an image processing unit 101 which converts, for example, data which is described in a page description language into image information with a raster format and performs various image processes on the image information. The communication device 10A transmits the image information having undergone the image processes in the image processing unit 101, to the communication device 10B via the transmission path 16. The image forming apparatus 200 includes an image forming unit 201 which forms an image based on the image information received by the communication device 10B on a recording medium.
The communication processing unit 22 includes a control information interface (I/F) 24, an image information I/F 26, an information memory 30, a packet generation portion 40, an 8B/10B encoder 42, a parallel/serial (P/S) converter 44, a transmission portion 46, a reception portion 50, an S/P converter 52, a 10B/8B decoder 54, and a packet conversion portion 56.
The control information I/F 24 is an interface which transmits and receives control information to and from the controller 20 and the information memory 30. The image information I/F 26 of the communication device 10A is an interface which transmits and receives image information to and from the image processing unit 101 and the information memory 30. The image information I/F 26 of the communication device 10B is an interface which transmits and receives image information to and from the information memory 30 and the image forming unit 201.
The information memory 30 includes a control information buffer 32, an image information buffer 34, and a control register group 36. Control information which is output from the controller 20 is written to the control information buffer 32 via the control information I/F 24. Image information which has undergone image processes by the image processing unit 101 is written to the image information buffer 34 of the communication device 10A via the image information I/F 26 of the communication device 10A. The image information written to the image information buffer 34 of the communication device 10A is output to the image forming unit 201 via the image information I/F 26 of the communication device 10B.
The control register group 36 is used to temporarily store a calculation result, to store addresses when reading or writing is performed on the control information buffer 32 or the image information buffer 34, to store an operation state of the communication processing unit 22, or the like.
The packet generation portion 40 is an example of a packet generation device related to the exemplary embodiment of the invention, and generates a packet based on the image information read from the image information buffer 34. The packet has an 84-byte (1 byte=8 bits) payload. The packet generation portion 40 outputs the generated packet to the 8B/10B encoder 42. Details of the packet generation portion 40 will be described later.
The 8B/10B encoder 42 coverts data included in the packet which is output from the packet generation portion 40, into 10-bit data every 8 bits from a leading part by using an 8B/10B coding method, and outputs the converted packet to the P/S converter 44. The P/S converter 44 outputs data of 1 bit sequentially from a leading part of the packet which is output from the 8B/10B encoder 42, to the transmission portion 46. The transmission portion 46 converts the data which is output from the P/S converter 44 into a differential signal which is sent to the transmission path 16. The transmission path 16 is a cable which serially transmits differential signals.
The reception portion 50 receives the differential signal which is transmitted from the transmission portion 46 via the transmission path 16, and converts the received differential signal into 1-bit data which is output to the S/P converter 52. The S/P converter 52 converts the data which is output from the reception portion 50, into a packet, and outputs the converted packet to the 10B/8B decoder 54. The 10B/8B decoder 54 inversely converts data included in the packet which is output from the S/P converter 52, into 8-bit data every 10 bits from a leading part by using an 8B/10B coding method, and outputs the inversely converted packet to the packet conversion portion 56.
The packet conversion portion 56 analyzes the packet which is output from the 10B/8B decoder 54 so as to convert the packet into image information, and writes the converted image information to the image information buffer 34. Details of the packet conversion portion 56 will be described later.
Next, the packet generation portion 40 will be described in detail. The packet generation portion 40 generates a packet in either a first mode or a second mode. The first mode is a mode in which image information with a resolution of 8 bits (image information in which a grayscale of a pixel is represented in binary numbers of 8 bits and which is hereinafter referred to as 8-bit data) is converted into a packet. The second mode is a mode in which image information with a resolution of 10 bits (image information in which a grayscale of a pixel is represented in binary numbers of 10 bits and which is hereinafter referred to as 10-bit data) is converted into a packet. The packet generation portion 40 determines whether the image information read from the image information buffer 34 is 8-bit data or 10-bit data, generates a packet in the first mode if the image information is 8-bit data, and generates a packet in the second mode if the image information is 10-bit data. Information indicating a resolution of the image information may be included in the image information, and information indicating a resolution of the image information may be transmitted from the controller 20 to the packet generation portion 40.
In both cases of the 8-bit data and the 10-bit data, 4-bit additional information is added to image information for each pixel. The additional information includes information or the like indicating the type of image information (for example, text, a picture, or the like).
The description will be made referring to
In the present exemplary embodiment, a payload length is common to the first mode and the second mode. In the first mode, 1 set is formed by data of 6 bytes, and, in the second mode, 1 set is formed by data of 7 bytes. The least common multiple of 6 and 7 is 42, but, in the present exemplary embodiment, 84 bytes which is double of 42 is defined as a payload length. The reason is as follows.
Information such as Start of Packet (SOP), an address of a transmission destination of a packet, and an address of a transmission source thereof is appended to each packet. Since this information has a specific data amount regardless of a payload length, transmission is performed more efficiently as a payload length is increased. On the other hand, a 1-bit correction code is added to each packet, but if a payload length is increased too much, there is a high probability that 2-bit errors may occur. Therefore, a payload length is required to be defined in consideration of balance between transmission efficiency and a 2-bit error occurrence probability, and, as an example thereof, in the present exemplary embodiment, a payload length is defined as 84 bytes.
The packet generated by the packet generation portion 40 undergoes processes in the 8B/10B encoder 42 and the P/S converter 44 as described above, and is transmitted from the communication device 10A to the communication device 10B. Here, packet configuration information indicating a configuration of the packet which is transmitted from the communication device 10A, is transmitted to the communication device 10B. The packet configuration information is, for example, information for determining whether a packet is generated from 8-bit data or 10-bit data. The packet configuration information may be transmitted only once before a packet is transmitted, and may be included in each packet. The transmitted packet undergoes processes in the S/P converter 52 and the 10B/8B decoder 54, so as to be output to the packet conversion portion 56.
The packet conversion portion 56 determines whether the received packet is generated from 8-bit data or 10-bit data based on the packet configuration information, and converts the packet into image information in accordance with a result of the determination. In other words, in a case where the packet is generated from 10-bit data, upper 2 bits and lower 8 bits of image information are extracted from the packet for each pixel, and are joined together so as to be converted into 10-bit image information. The converted image information is written to the image information buffer 34.
According to the present exemplary embodiment, data whose resolution is 10 bits is transmitted without reducing transmission efficiency by using a packet format of a fixed length (84 bytes) common to one used for transmission of data whose resolution is 8 bits.
The exemplary embodiment may be modified as follows. In addition, plural modification examples may be combined with each other.
Although, in the above-described exemplary embodiment, an example of using a packet format common to data whose resolution is 8 bits and data whose resolution is 10 bits has been described, the exemplary embodiment of the invention may be applied to data with other resolutions. A function of the packet generation portion 40 is described as follows when the number of bits of data is generalized.
In the first mode, the packet generation portion 40 generates a packet having a b-byte payload including plural sets of first data corresponding to a pixels from the first data having m-bit image information and p-bit additional information for each pixel (first generation unit). In addition, in the second mode, the packet generation portion 40 generates a packet having a b-byte payload including plural sets of second data corresponding to a pixels from the second data having n-bit image information and p-bit additional information for each pixel (second generation unit). Here, p<m<n is satisfied. In addition, a is defined so that (n−m)×a becomes multiples of 8. Further, b is defined based on the least common multiple of the number of bytes of sets of the first data corresponding to a pixels and the number of bytes of sets of the second data corresponding to a pixels.
The example described in the exemplary embodiment corresponds to a case of m=8, n=10, and p=4, and, in this case, a minimum value of a is 4. Then, since the number of bytes of sets of the first data corresponding to a pixels is 6 bytes, and the number of bytes of sets of the second data corresponding to a pixels is 7 bytes, the least common multiple thereof is 42.
As another example, for example, if m=8, n=12, and p=4, a becomes 2. Then, since the number of bytes of sets of the first data corresponding to a pixels is 3 bytes, and the number of bytes of sets of the second data corresponding to a pixels is 4 bytes, the least common multiple thereof is 12. As described in the exemplary embodiment, a payload length is defined from values of integer multiples of the least common multiple in consideration of transmission efficiency and a 2-bit error occurrence probability.
A function of the packet conversion portion 56 is described as follows when the number of bits of data is generalized. In the first mode, the packet conversion portion 56 converts a packet having a b-byte payload including plural sets of first data corresponding to a pixels into the first data having m-bit image information and p-bit additional information for each pixel. In addition, in the second mode, the packet conversion portion 56 converts a packet having a b-byte payload including plural sets of second data corresponding to a pixels into the second data having n-bit image information and p-bit additional information for each pixel. Here, p<m<n is satisfied. In addition, a is defined so that (n−m)×a becomes multiples of 8. Further, b is defined based on the least common multiple of the number of bytes of sets of the first data corresponding to a pixels and the number of bytes of sets of the second data corresponding to a pixels.
The exemplary embodiment of the invention may be applied to a case where additional information is not added to image information. For example, if m=8, n=10, and p=0, and, in this case, a minimum value of a is 4. Then, since the number of bytes of sets of the first data corresponding to a pixels is 4 bytes, and the number of bytes of sets of the second data corresponding to a pixels is 5 bytes, the least common multiple thereof is 20.
In the exemplary embodiment, an example has been described in which 1 set is formed by image information corresponding to 4 pixels and additional information, but, in this case, the image information I/F 26 may write image information and additional information to the image information buffer 34 every 4 pixels.
In the exemplary embodiment, the data items are arranged in the packet as illustrated in
The communication device 10 may be configured to realize the above-described function by the controller 20 executing a program, and the above-described function may be mounted in a hardware circuit. In addition, the program may be recorded on a computer readable recording medium such as an optical recording medium or a semiconductor memory so as to be provided, and the program may be read from the recording medium so as to be installed in the communication device 10. Further, the program may be provided via an electric communication line.
The foregoing description of the exemplary embodiments of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations will be apparent to practitioners skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical applications, thereby enabling others skilled in the art to understand the invention for various embodiments and with the various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2014-057807 | Mar 2014 | JP | national |
This application is based on and claims priority under 35 USC 119 from Japanese Patent Application No. 2014-057807 filed Mar. 20, 2014.