The present invention relates to a coding method and a coding apparatus for bi-level document image which implements the coding of white pixels sequentially existing in an image together and reduces the number of processing steps and realizes a high speed coding processing, at the case that the coding of bi-level document image is implemented, in particular at the JBIG (Joint Bi-level Image Coding Experts Group) system recommended by the T.82 and T.85 of the ITU-T (International Telecommunication Union).
A conventional coding method and coding apparatus for bi-level document image implements the coding of bi-level document image applying the JBIG system recommended by the T.82 and T.85 of the ITUT. The JBIG system, which is a coding algorithm for bi-level document image by the recommendation of the T.82 and T.85 of the ITU-T, predicts a pixel in a unit of one pixel and implements the coding processing. At the prediction of the pixel, surrounding pixels called model template are used as referring pixels.
FIG. 1 is a model template diagram showing the conventional model template for the lowest resolution layer of the JBIG system. As model templates, there are a templates of three lines shown in FIG. 1(a) and a template of two lines shown in FIG. 1(b). In FIG. 1, P is a pixel to be coded and decoded and ten pixels C1 to C10 are referring pixels. The appearance probability of the pixel P is calculated by the combination of the pixel values of these C1 to C10, and the coding and decoding processing is implemented.
FIG. 2 is a flowchart showing a conventional coding processing by the JBIG system. First, each parameter is initialized (step S33). After this, a pixel value to be coded (hereinafter referred to as PIX) and context value (hereinafter referred to as CX) expressing the state of the model template at the time are read (step S34). The coding of PIX is implemented using the read PIX and CX (step S35). The processes of step S34 and step S35 are continued until the stripe is finished (step S36). In this, the stripe means a processing unit at the JBIG system, and one page of the image is divided to stripes and is processed at the JBIG system. After the coding processing of the stripe is finished, a FLUSH processing is implemented in order that the codes remaining in a register and a buffer are taken out (step S37).
FIG. 3 is a flowchart showing the conventional coding processing shown at the step S35 in FIG. 2 in detail. First, the present PIX value to be coded is compared with a MPS (more probable symbol) value corresponding to the CX at that time (step S38) and it is determined that the PIX is the MPS or a LPS (less probable symbol).
At the step S38, at the case that the PIX is the LPS, for the value of an A register expressing the probability area width, the subtraction of the appearance probability of the LPS (hereinafter referred to as LSZ) from A is implemented and the subtracted result is substituted (step S39). Next, the calculated value of the A register is compared with the LSZ (step S40) and at the case that Axe2x89xa7LSZ (No of step S40), the addition of a C register being a code generating register and the A register is implemented, and after this, the LSZ is substituted for the A register (step S41). At the step S40, at the case that A less than LSZ (Yes of step S40) and after the step S41 of the case that Axe2x89xa7LSZ, the value of a SWTCH is examined and at the case that the SWTCH=1 (Yes of step S42), the value of the MPS is made inverse (step S43). Last, for the value of a status (hereinafter referred to as ST) expressing the state of the CX, a NLPS (next less probable symbol) expressing a status of a next estimating position at the time of the LPS is substituted and a normalizing processing is implemented (step S44) and the coding processing of the PIX is finished.
The probability estimation table is described in the recommendation of the T.82 of the ITU-T. The table is composed of the value of the LSZ corresponding to each ST, the value of ST of the next estimating position NLPS at the case that the PIX at the time is judged to be the LPS, the value of ST of the next estimating position NMPS (next more probable symbol) at the case that the PIX at the time is judged to be the MPS and the SWTCH which decide whether the value of the MSP which the CX has at that time is made inverse or not.
At the step S38, at the case that the PIX is judged to be the MPS, first, at the same as the time of the LPS, the LSZ is subtracted from the value of the A register (step S45). The subtracted A value is compared with whether the A value is smaller than the value 0xc3x978000 (step S46). At the case that Axe2x89xa70xc3x978000, i.e., 8000 hexadecimal, No of step S46, the coding processing of the PIX is finished without any processes. At the case that A less than 0xc3x97800, Yes of step S46), the value of the A register is compared with the value of the LSZ (step S47), at the case that A less than LSZ (Yes of S47), the addition of the value of the C register and the value of the A register is implemented and the LSZ is substituted for the A register (step S48). Last, the NMPS is substituted for the ST and the normalizing processing is implemented (step S49) and the coding processing of the PIX is finished.
Japanese Patent Application Laid-Open No. HEI 5-298063 discloses a coding apparatus. This apparatus calculates the value of the MPS of each context and sets the calculated result as the initial value of the MPS to a coding section and a decoding section, by using plural documents to be coded or a document representative of documents to be decoded beforehand. And this apparatus also designates the number of the initial state of each context corresponding to the appearance probability of the LPS in each context. And a probability estimation section reduces the learning steps required to select the most suitable probability area width corresponding to the appearance probability of the LPS and MPS at each context. With this, without adding the changes for the construction of the known adaptive bi-level arithmetic coding apparatus, the improvement of the compression rate and coding efficiency of the document composed of letters can be realized by this apparatus.
However, recently the communication speed has become faster and the amount of the transmitting image data has increased and the resolution of pixels has also increased, as a result the further improvement at the image data processing speed has been required. For example, at the algorithm by the JBIG system, the processing is implemented for every pixel in images, therefore a certain number of processing steps are required for each pixel. At the case that this processing is realized by software, the processing speed is decreased, compared with the realization by hardware. Even the image of 200 dpi of the paper size A4 (about 210 mmxc3x97295 mm) has about 4 million pixels and the processing time for this image becomes huge.
Moreover, a high speed MODEM (modulator-demodulator) has been recently applied for a facsimile apparatus and the communication speed has become short, therefore the high speed processing has been also required for the coding processing. In particular, at the JBIG system with high compression rate, the communication time is short, therefore the coding processing time of some CPU (central processing unit) can not meet the communication speed. Even at the case that the CPU can meet the communication speed, the CPU must mainly operate this coding processing, there is a problem that the other operation can not be processed.
It is therefore an object of the present invention to provide a coding method and a coding apparatus for bi-level document image that can realize a further high speed coding processing, at the JBIG system.
According to a first aspect of the present invention, for achieving the mentioned above objects, there is provided a coding method for bi-level document image including a reading process for reading a document as image data, a checking process for checking sequential values of the image data read by said reading process, a coding processing process which implements the coding processing for the sequential same values from said sequential values checked by said checking process together at one time and a controlling process for controlling to make said reading process and said coding processing process implement every stripe, and implementing a high speed coding processing for document image data having a large amount of white areas, by the coding processing which implements the coding processing for said sequential same values together at one time.
According to a second aspect of the present invention, in the first aspect, said coding processing process implements the coding processing for the sequential same values from said sequential values checked by said checking process together at one time and implements a high speed coding processing for document image data having a large amount of white areas, at the JBIG system.
According to a third aspect of the present invention, in the second aspect, the coding processing at said coding processing process is mainly implemented for the document image data of white areas of xe2x80x9c0xe2x80x9d value.
According to a fourth aspect of the present invention, in the first aspect, said coding processing process is constructed as a switch-able structure of said high speed coding processing and a normal coding processing.
According to a fifth aspect of the present invention, in the fourth aspect, a coding method for bi-level document image provides a coding processing deciding process for deciding to implement the coding processing by either said high speed coding processing or said normal coding processing based on the result of said checking process.
According to a sixth aspect of the present invention, there is provided a coding apparatus for bi-level document image that provides an image reading processing section, a coding processing section, a RAM, a line memory and an image inputting equipment. In this apparatus, said image reading processing section provides an image data reading means for reading bi-level document image data from said RAM, a storing means for making said bi-level document image data of previous line and the line before previous line read by said image data reading means store in said line memory, a CX generating means for generating CX using said bi-level document image data stored in said line memory by said storing means and a CX counting means for counting the number of appearance times of CX based on said CX generated by said CX generating means and the values of said bi-level document image data stored by said storing means. In this apparatus, said coding processing section provides a normal coding means for implementing coding by a normal JBIG algorithm, a high speed coding means for implementing coding by using the values of CX counted by said CX counting means in high speed and a coding processing deciding means for deciding to use either coding processing of said normal coding means or said high speed coding means. Said coding apparatus for bi-level document image detects sequential white areas existing in said bi-level document image data and makes the high speed coding processing for the bi-level document image data having a large amount of white areas possible.