Abstract:
In a data processor, in order to discriminate the kind of image in a processing block quickly and correctly, image data is divided into first processing blocks of m*m pixel matrices and second processing blocks of M*M pixel matrices wherein M&gt;m. The second processing block includes the data of the first processing block and adjacent pixels around it. Image data in the first and second processing blocks are subjected to orthogonal transform to generate coefficient data. The image type is discriminated as a character image, a dot image or a half-tone image according to the coefficient data of the second processing block and an appropriate quantization table is then selected. Having identified the appropriate quantization table based on analysis of second processing block, image data of the first processing block is quantized according to the thus selected quantization table and quantized data is thereby coded.

Description:
This application is a division of application Ser. No. 08/267,711, filed Jun. 28, 1994 now U.S. Pat. No. 5,517,327. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a data processor for data compression of image data. 
     2. Description of the Prior Art 
     An international standard for color image coding by a Joint Photographic Experts Group (JPEG) is a known coding technique of image data. In the color image coding, image data is divided into processing blocks each of a prescribed size of pixel matrix (normally 8*8 pixel matrix) and image data in a processing block is subjected to two dimensional pixel discrete cosine transformation (DCT). Then, weights are given to the DCT data, and the DCT data is subjected to nonlinear quantization and entropy coding. The decoding of the image data is performed with processing reverse to the above-mentioned processing. However, if this color image coding is applied to an image including characters and half-tone images, a character image is liable to be deteriorated and a half-tone image is liable to have a lower compression ratio. In order to solve the problems, it is proposed first to discriminate if an image to be coded is a character image or a half-tone image and second to select a quantization table used for the quantization according the discrimination. 
     However, this method has a problem that the discrimination takes a long time. It is also a problem that if the discrimination is erroneous, an erroneous quantization table is selected and this causes block distortion, mosquito noises and the like in an image. The precision of discrimination may be enhanced by increasing a size of the processing block. However, if the size of the processing block is increased, an amount of data to be processed after the quantization process becomes very large, and processing speed of data decreases. Another problem on the discrimination of image is that an erroneous discrimination is liable to occur especially on a dot image wherein an image is expressed as an assembly of minute dots. 
     SUMMARY OF THE INVENTION 
     An object of the present invention is to provide a coding apparatus which can perform discrimination of a character image and a half-tone image more precisely and efficiently in a short time. 
     Another object of the present invention is to provide a coding apparatus which can perform discrimination of a character image, a dot image and a half-tone image more precisely and efficiently in a short time. 
     A different object of the present invention is to provide a coding apparatus which can discriminate a dot image more precisely. 
     In one aspect of the present invention, in order to perform coding efficiently, image data of a prescribed size of pixel matrix is subjected to orthogonal transformation to be transformed to coefficient data. A first quantization table for character image and a second quantization table for half-tone image are provided. The coefficient data is quantized with the first quantization table and with the second quantization table. Then, the quantized data are used to discriminate a character image data and a half-tone image. Then, quantized data in correspondence to the discrimination result is selected or subjected to entropy coding. 
     In a further aspect of the invention, in order to discriminate a kind of image in a processing block fast and correctly, image data are divided into first processing blocks of m*m pixel matrices and second processing blocks of M*M pixel matrices wherein M&gt;m. A second processing block includes one of first processing blocks and adjacent pixels around it. For example, m=8 and M=16. Image data in a first processing block and image data in a second processing block including the first processing block are subjected to orthogonal transform to send coefficient data, respectively. It is discriminated according to the coefficient data of the second processing block if the image is a character image, a dot image or a half-tone image to select an appropriate quantization table. Then, image data of the first processing block is quantized according to the selected quantization table and quantized data are coded. Adjacent pixels around a processing block may be taken into account for image discrimination in a different way. For example, data of adjacent block may be added to data in a processing block with weights and image discrimination is performed with the weighted sum. 
     In a different aspect of the invention, in order to discriminate a dot image in a processing block, two discrimination windows are provided. A first of the windows consists of coefficient data around the DC component and a second consists of the other data. First, orthogonal transform coefficients of image data in a processing block are calculated. The image is discriminated to be a dot image if a maximum of absolute values of the first window is larger than that of the second and the former is larger than a prescribed threshold value. 
     An advantage of the present invention is that discrimination of a character image and a half-tone image can be performed precisely by using two quantization tables for character image and for half-tone image and efficiently by using not data of say 8 bits before quantization, but data of say a few bits after quantization. 
     Another advantage of the present invention is that an image can be discriminated more precisely by taking into account pixels around a processing block to be coded. 
     A different advantage of the present invention is that a dot image can be discriminated more precisely by using appropriate discrimination windows. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     These and other objects and features of the present invention will become clear from the following description taken in conjunction with the preferred embodiments thereof with reference to the accompanying drawings, and in which: 
     FIG. 1 is a schematic sectional view of a digital color copying machine; 
     FIG. 2 is a diagram of a processing block of a coder of a first embodiment; 
     FIGS. 3A and 3B are diagrams of a first quantization table and a second quantization table, respectively; 
     FIG. 4 is a diagram of a processing block used in the discrimination section; 
     FIG. 5 is a diagram for illustrating the order of zigzag scan of AC components in a processing block; 
     FIG. 6 is a block diagram of a coding section; 
     FIG. 7 is a diagram for illustrating areas (a)-(e) used for discriminating a dot image and a character image; 
     FIG. 8 is a diagram of an example of a Chinese character for which a precise discrimination of a character cannot be performed; 
     FIG. 9 is a block diagram of a coding section of a second embodiment; 
     FIG. 10 is a diagram of an example of processing block for discriminating an image in the second embodiment; 
     FIG. 11 is a diagram of a second example of processing block for discriminating an image; 
     FIG. 12 is a diagram of the second example of processing block at a periphery of an image; 
     FIG. 13 is a block diagram of a part of a coding section of a modified example of a second embodiment; 
     FIGS. 14(a)-(d) are diagrams of four 8*8 DCT matrices of a second example of a character image; 
     FIG. 15 is a diagram of a 16*16 DCT matrices of the character image; 
     FIGS. 16(a)-(d) are diagrams of four 8*8 DCT matrices of a second example of a dot image; 
     FIG. 17 is a diagram of a 16*16 DCT matrices of the dot image; 
     FIG. 18 is a diagram of a second example of a dot image; 
     FIGS. 19(a)-(d) are diagrams of four 8*8 DCT matrices of the dot image; 
     FIG. 20 is a diagram of a 16*16 DCT matrices of the dot image; 
     FIGS. 21(a)-(d) are diagrams of four 8*8 DCT matrices of a half-tone image; 
     FIG. 22 is a diagram of a 16*16 DCT matrices of the half-tone image; 
     FIG. 23 is a flow of a discrimination of image by the image discrimination section; 
     FIG. 24 is a graph of power of a character image obtained from the data of FIG. 15; 
     FIG. 25 is a graph of power of a dot image obtained from the data of FIG. 17; 
     FIG. 26 is a graph of power of another dot image obtained from the data of FIG. 20; 
     FIG. 27 is a graph of power of a character image obtained from the data of FIG. 22; 
     FIG. 28 is a block diagram of a coding section of a still modified example of a third embodiment; 
     FIG. 29 is a diagram of an example of processing block for discriminating an image of a third embodiment; 
     FIG. 30 is a flowchart of discrimination of image; 
     FIGS. 31A-31E are diagrams of prior art discrimination windows; 
     FIG. 32 is a block diagram of a coding section of a still modified example of a third embodiment; 
     FIGS. 33A and 33B are diagrams of two windows for image discrimination; 
     FIG. 34 is a block diagram of a coding section of FIG. 31; and 
     FIG. 35 is a block diagram of a dot image discrimination section. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     Referring now to the drawings, wherein like reference characters designate like or corresponding parts throughout the views, FIG. 1 shows a digital color copying machine which also serves as a facsimile apparatus, wherein image data of a document placed on a platen is read with an image reader and an image is printed on a paper with an electrophotographic process according the read image data. 
     The scanner comprises an exposure lamp, a rod lens array 13 and a color image sensor 14. When a copying operation is started, the scanner is driven by a motor 11 to read image data of the document. A signal processor 20 processes the image data and then supplies them to a coding unit 30. The coding unit 30 sends the image data to a print head 31. On the other hand, it also performs coding of the image data and the coded data may be transmitted to another facsimile apparatus via a facsimile transmission section 40 comprising a modulation and demodulation unit (MODEM) and a network control unit (NCU). 
     A laser diode in the print head 31 emits a light beam according the image data received from the coding unit 30, and the light beam is guided via a reflection mirror 37 to illuminate a surface of a photoconductor drum 41. The light beam forms an electrostatic latent image on the photoconductor drum 41 which has been sensitized at a predetermined potential. A development unit 45a-45d develops the latent image with toners of either of cyan, magenta, yellow and black. A paper in a tray 50 is fed to a transfer drum 51 and its top is chucked with a chucking mechanism 52. The toners adhered to the latent image is transferred to the paper wound on the transfer drum 51. Then, the latent image is erased with a lamp 42. Toners of four colors of cyan, magenta, yellow and black are transferred successively to the paper. Then, the paper is isolated from the transfer drum 51 with a claw 47 and discharged to a tray 49. 
     First Embodiment 
     Next, discrimination of image data of a character and a half-tone image is explained. In a first embodiment, DCT data are calculated from pixel data and they are quantized with two kinds of quantization tables for character and half-tone images. Then, two kinds of quantized data are used to discriminate an image, and one of the data quantized with the quantization table in correspondence to the discrimination result is used for coding for data compression. 
     FIG. 2 shows a processor block 100 in the coding unit 30. A DCT (discrete cosine transform) section 101 transforms image data S 0  in a block of 8*8 pixel matrix to DCT coefficients S 1  and sends the DCT coefficients S 1  to first and second quantization sections 102 and 104 connected in parallel to each other. In the DCT transformation, data P x ,y (x, y=0, 1, . . . , 7) of pixels in a processing matrix are transformed into DCT coefficients S u , v (u, v=0, 1, . . . , 7) as follows: ##EQU1## wherein x and y denote positions in a processing matrix, u and v denote positions in a matrix of DCT coefficients, ##EQU2## 
     The first quantization unit 102 is connected to a first quantization table 103 which has relatively small quantization steps for decreasing quantization errors for an image having high frequency components such as a character. FIG. 3A shows an example of the first quantization table 103. The first quantization unit 102 receives the DCT coefficients and quantizes them by using the first quantization table 103. The quantized data S 2  are sent to a discrimination section 106 and to a switch 107. 
     The second quantization unit 104 is connected to a second quantization table 105 which is a standard JPEG table suitable for an image which is not needed to take high frequency components seriously. FIG. 3B shows an example of the second quantization table 105 having large quantization steps at high frequencies in order to suppress high frequency components, to increase a compression ratio and to smooth data in the decoded image. The second quantization unit 104 receives the DCT coefficients and quantizes them by using the second quantization table 105. The quantized data S 3  are also sent to the discrimination section 106 and to the switch 107. 
     In a space frequency spectrum, a picture image generally has high values at low frequencies about 2 lines/mm. FIG. 4 shows an 8*8 matrix of DCT components, wherein a top leftmost element in the matrix is a DC component. A block or window consists of five hatched AC components which correspond to low frequency components expected to be prominent for a character image. Then, there is a characteristic that the absolute values of quantized data in the block of a character image are larger than that of a half-tone image. The discrimination section 106 utilizes the absolute value difference characteristic to discriminate a character image. 
     A controller 120 provides an ON signal to the discrimination section 106 when a quantized data received by the discrimination section is a data in the block shown in FIG. 4 with hatching, otherwise it sends an OFF signal to the discrimination section 106. Further, the controller 120 sends a threshold value Th to the discrimination section 106, and the threshold value Th is used for discrimination if an image in the 8*8 processing block is a character image. As described above, the discrimination section 106 receives quantized data S 2  and S 3  from the first and second quantization sections 102 and 103 and signals from the controller 120 and discriminates if an image in the processing block is a character image. Then, it sends a 1-bit discrimination signal S 4  to the switch 107. Details of the discrimination section 106 is explained later. 
     The switch 107 selects the signal S 2  or S 3  according to the discrimination signal and sends it as a signal S 5  to a differential pulse-coded modulation (DPCM) section 108 and a zigzag scan section 111. The DPCM section 108 calculates a difference between the DC component of the signal S 5  and that of the previous processing unit, and a coder 109 processes the difference for entropy coding (Huffmann coding). On the other hand, the zigzag scan section 111 scans the AC components (u, v; u=1-8, v=1-8) of the signal S 5  in the order shown in FIG. 5 so as to reorder them in a one-dimensional array. FIG. 5 shows the order in a matrix of 8*8 for the scan by the zigzag scan section 111. A coder 112 processes the reordered data for entropy coding. A coder 113 processes the 1-bit signal S 4  sent by the discrimination section 106 for entropy coding. A multiplexer 110 multiplexes the data S 8 , S 9  and S 10  coded by the coders 109, 112, 113 and sends a multiplex data S 11  to the facsimile transmission unit 40 or the like. 
     FIG. 6 shows a structure of the discrimination section 106 which performs discrimination according to the quantized data S2 and S3 of the low frequency components in a block shown with hatching in FIG. 4. The controller 120 sends a discrimination ON signal for input data of the hatched pixels to a maximum detection circuit 151 in the discrimination section 106. The controller 120 also sends a threshold level to a comparison circuit in the discrimination section 106. In the discrimination section 106, a difference circuit 150 receives quantized data S 2  and S 3  and calculates an absolute value of the difference for each component. Next, the maximum detection circuit 151 which is operated only when the discrimination ON signal is received updates a maximum value if a newly received difference data is larger than the current maximum value. Next, the comparison circuit 152 compares the maximum value with the threshold value Th. As explained above, the quantized data S 2  is provided by using the quantization table 103 for a character image, while the quantized data S 3  is provided by using the quantization table 105 not for a character image. Then, if the comparator 152 decides that the maximum is larger than the threshold value Th, an image under discrimination is a character image. Therefore, the comparator sends &#34;1&#34; (character signal) of 1-bit discrimination signal S 4 . Otherwise it sends &#34;0&#34; (half-tone image) of 1-bit discrimination signal S 4 . Thus, because the discrimination section discriminates a character image according not to data (say 8 bits) before quantization, but to data (say a few bits) after quantization, a coding apparatus of the embodiment can perform coding efficiently. Therefore, the discrimination of a character image can be carried out at a fast rate. 
     Second Embodiment 
     Dot image wherein an image is expressed as an assembly of minute dots generally has high AC components after discrete cosine transformation say of an 8*8 pixel matrix in one of areas (b)-(e) shown in FIG. 7. Further, a character image has high AC components in an area (a) of low frequency components adjacent to the DC component, similar to a block shown in FIG. 4. Then, if positions of high AC components are decided, a dot image or a character image can be discriminated. However, there is a possibility of erroneous discrimination because pixels around an 8*8 pixel matrix are not taken into account for discrimination of the kind of an image. FIG. 8 shows an example of such a case wherein an image of a chinese character is illustrated. The character is divided into a plurality of 8*8 pixel matrices. In this image, four hatched matrices are not blocks of character image, and they are quantized with a quantization table provided not for character image. However, it is natural that they are regarded as parts of the character image, but they cannot be decided as a part of the character. Especially, for a character of a reverse image, image distortion is liable to occur at constant density portions around edge portions of a character. Therefore, if blocks at the periphery of a character are compressed with a quantization table for character image, it is expected that image distortion is suppressed. This embodiment solves this problem. 
     A coding unit 30 of a second embodiment is explained next. FIG. 9 shows a processing block 300 of the coding unit 30. Image data of a document is sent to a 8*8 blocking section 301 and a 16*16 blocking section 306. The 8*8 blocking section 301 are divided into processing pixel matrices of 8*8 pixels. A first DCT (discrete cosine transform) section 302 transforms image data in a processing matrix to DCT coefficients. In the DCT transformation, data P x , y (x, y=0, 1, . . . , 7) of pixels in a processing matrix are transformed into 64 DCT coefficients S u , v (u, v=0, 1, . . . , 7) according to Eq. (2): ##EQU3## wherein x and y denote positions in the processing matrix, u and v denote positions in a matrix of DCT coefficients, ##EQU4## 
     In the DCT coefficients, coefficient S 0 ,0 is called as DC coefficient, and the other 63 coefficients are called as AC coefficients. The DC coefficient means an average of the 8*8 pixels in a processing matrix. If a pixel value P x ,y is represented as an 8-bit data, L. is defined as 128 as an expected value of the DC coefficient is taken as 128. Then, if an average of pixel values is 128, the DC component becomes zero. The first DCT section 302 sends the DCT coefficients to a quantization section 303. 
     The 16*16 blocking section 306 forms 16*16 pixel matrices for discrimination to be sent to a second DCT section 307. As shown in FIG. 10, a 16*16 matrix comprises a first 8*8 pixel matrix at the top and left side on which image data are coded. The 16*16 matrix further comprises a second 8*8 pixel matrix at the top and right side of the first matrix, a third 8*8 pixel matrix at the bottom and right side thereof and a fourth 8*8 pixel matrix at the bottom and left side thereof. The second DCT section 307 transforms image data in a 16*16 processing matrix to DCT coefficients and sends them to a image discrimination section 308. 
     In this embodiment, an image is discriminated on 16*16 DCT coefficients of a 16*16 pixel matrix. By using a 16*16 matrix, DCT coefficients of lower frequencies than those of a 8*8 matrix can be obtained. As shown in FIG. 7, for a 16*16 matrix of DCT coefficients, a dot image has peaks of AC coefficients in any of four areas (b)-(e) in FIG. 7, while a character image has large AC coefficients in an area (a) including low frequency components. An image which does not have the above-mentioned characteristic is discriminated as a half-tone image. The image discrimination section 308 discriminates a kind of an image in the processing block as described above and sends a result as a discrimination signal to the quantization section 303, which uses it to select a quantization table and to send a quantization table signal to a coder 311. The coder 311 performs coding of the signal and sends the quantization table code to a multiplexer 312. 
     On the other hand, the quantization section 303 selects a quantization table according to the discrimination signal received from the image discrimination section 308 and quantizes the DCT coefficients by using the selected quantization table. This means that a kind of image is discriminated by taking into account pixels of 16*16 matrix including the processing block (8*8 matrix) under coding. Then, the DC coefficient (S 0 ,0) is sent to a differential pulse-coded modulation (DPCM) section 304 while the AC coefficients are sent to a zigzag scan section 305. The DPCM section 304 calculates a difference between the DC component of the current processing block and that of the previous processing unit, and a coder 309 processes the difference for variable length coding. On the other hand, the zigzag scan section 305 scans the AC components in the order shown in FIG. 5 so as to reorder them in a one-dimensional array. FIG. 5 shows the order in a matrix of 8*8 for the scan by the zigzag scan section 305. A coder 310 processes the reordered data for entropy coding. A multiplexer 312 multiplexes the data coded by the coders 309, 310, 311 and sends the multiplexed data to the facsimile transmission unit 40 or the like. 
     A relation of a processing block for coding and a processing block for discrimination of image is not restricted in an example shown in FIG. 10. FIG. 11 shows another example of a processing block of 16*16 pixels for discrimination, wherein a processing block of 8*8 pixels for coding is located at the center of the processing block. Then, the all four sides of the 8*8 processing block at the center is surrounded by adjacent pixels. This example also has an advantage that lower frequency components can be checked. 
     If a processing block for coding is located at a corner of an image, as shown in FIG. 12, a processing block for discrimination does not have image data in a deficient area with hatching at the left and top portions. For example, an average of pixel data in the processing block for discrimination except the processing block for coding is taken as image data in the deficient area. Generally, if a processing block for coding is located at the periphery of an image, such an average is taken as image data in a deficient area. 
     FIG. 13 shows a part of a coding unit of the modified example. This unit is different from that shown in FIG. 9 in points that a 16*16 blocking section 306&#39; divides image data into 16*16 pixel matrices at positions different from those of the 16*16 blocking section 306 in FIG. 9 and that an average calculator 320 is provided. If a processing block for coding is located at the periphery of an image, the average calculator 320 calculates an average of pixel data in the processing block for discrimination except the processing block for coding, and it sends the average to the 16*16 blocking section 306&#39;. The processing of pixel data obtained as described above is the same as that of FIG. 9. 
     To sum up, in the present embodiment, a kind of image can be discriminated by taking into account pixels around a processing block for coding. Thus, a kind of image can be discriminated more correctly. Therefore, a suitable quantization table can be used for quantization. 
     Next, examples of DCT coefficient data of character, dot and half-tone images for image discrimination are shown in FIGS. 14-17 and 19-22. A color image of R, G and B is converted to Y, U and V components, and Y data are subjected to DCT operation. For an example of a character image, FIGS. 14(a)-(d) show an example of DCT coefficients data of four adjacent 8*8 matrices in correspondence to FIG. 10, while FIG. 15 shows an example of DCT coefficients data of the 16*16 matrix including the four matrices. 
     For an example of a dot image, FIGS. 16(a)-(d) show an example of four DCT coefficients data of four adjacent 8*8 matrices, while FIG. 17 shows an example of DCT coefficients data of the 16*16 matrix including the four matrices. The DCT coefficients of the four 8*8 matrices shown in FIGS. 16(a)-(d) can be discriminated to be a dot image. However, DCT coefficient data of the 16*16 matrix of FIG. 17 can be discriminated more easily to be a dot image because they include more frequency components not included in the 8*8 matrix. Another example of a dot image shown in FIG. 18 includes second and fourth 8*8 blocks with white portions at the right side thereof. FIGS. 19(a)-(d) shows an example of four DCT coefficients data of four adjacent 8*8 matrices, while FIG. 20 shows an example of DCT coefficients data of the 16*16 matrix including the four matrices. In this case, the second and fourth processing blocks are decided to be not a dot image, but a character image. On the other hand, 16*16 processing block is decided to be a dot image. For an example of a half-tone image (photograph) , FIGS. 21(a)-(d) shows an example of four DCT coefficients data of four adjacent 8*8 matrices, while FIG. 22 shows an example of DCT coefficients data of the 16*16 matrix including the four matrices. 
     Next, a discrimination of image by the image discrimination section 308 is explained with reference to FIG. 23. On a 16*16 matrix of DCT coefficients, a sum of DCT components in each row except the DC component is calculated (step S100), while a sum of DCT components in each column except the DC component is also calculated (step S102). On the other hand, a sum of all the DCT components including the DC component is also calculated (step S104). Then, these row and column sums are divided with the total sum (step S106), so that powers of each row and of each column are obtained (steps S108 and S110). Then, peaks are detected in the powers for discriminating a dot image (step S112). If peaks are relatively small at low frequencies in a region (a) in correspondence to FIG. 7 and peaks appear at high frequencies in areas (b)-(e) in FIG. 7, it is discriminated to be a dot image. For an image other than a dot image, differences of powers between row and column are calculated (step S114) and they are compared for image discrimination of character image and half-tone image (step S116). If differences of powers between row and column of the same number is large, it is discriminated as a character image, otherwise it is discriminated as a half-tone image. 
     FIGS. 24-27 show graphs of powers calculated from the data of FIG. 15, 17, 20 and 22. It is found that the data shown in FIGS. 24-27 can be discriminated as a character image, a dot image, a dot image and a half-tone image as expected. It is to be noted that an image of FIG. 18 in correspondence to the data of FIG. 20 has clear high peaks at high frequencies and it can be discriminated as a dot image. 
     Third Embodiment 
     FIG. 28 shows a processing block 600 of the coding unit 30 of a third embodiment. The processing block 600 is different from that of the second embodiment shown in FIG. 9 in a point that an adjacent block processing unit 340 is used instead of the 16*16 blocking section 306 and the second DCT section 307. In other words, 16*16 blocking is not needed for image discrimination in the third embodiment. 
     Image data of a document is sent to a 8*8 blocking section 301, which divides image data into processing pixel matrices of 8*8 pixels. A DCT (discrete cosine transform) section 302 transforms image data in a processing matrix to DCT coefficients. In the DCT transformation, data P x , y (x, y=0, 1, . . . , 7) of pixels in a processing matrix are transformed into 64 DCT coefficients S u , v (u, v=0, 1, . . . , 7) according to Eq. (1) described above. The DCT section 302 sends the DCT coefficients to a quantization section 303 and to the adjacent block processing unit 340. 
     The adjacent block processing unit 340 performs an average of DCT coefficients for each component as will be explained later and sends the averages to an image discrimination section 308&#39;. FIG. 29 shows an example of a processing block of discrimination. In this example, a processing block for coding (shown with hatching in FIG. 29) is located at a center of eight 8*8 pixel matrices. In other words, a processing block for discrimination is a 24*24 pixel matrix. Thus, data of eight adjacent blocks are taken into image discrimination. 
     The image discrimination section 308&#39; discriminates a kind of an image in the processing block according to the averages as described in the second Embodiment and sends a result as a discrimination signal to the quantization section 303, which uses it to select a quantization table, and as a quantization table signal to a coder 311. The coder 311 performs coding of the signal and sends the code of the quantization table to a multiplexer 312. 
     Then, the DC coefficient (S 0 ,0) is sent to a differential pulse-coded modulation (DPCM) section 304 while the AC coefficients are sent to a zigzag scan section 305. The DPCM section 304 calculates a difference between the DC component of the current processing block and that of the previous processing unit, and a coder 309 processes the difference for variable length coding. On the other hand, the zigzag scan section 305 scans the AC components in the order shown in FIG. 5. A coder 310 processes the reordered data for entropy coding. A multiplexer 312 multiplexes the data coded by the coders 309, 310, 311 and sends the multiplexed data to the facsimile transmission unit 40 or the like. 
     FIG. 30 shows a flowchart of the processing performed by the adjacent block processing unit 340. First, the adjacent block processing unit 340 receives DCT coefficients for the nine 8*8 pixel blocks including a processing block for coding at the center thereof and calculates a sum of the DCT coefficients for each component (step S200). For example, a sum of DC coefficients S 0 ,0 of the blocks is calculated. Next, each sum is divided with a number of blocks or nine (step S201). Next, the 8*8 matrix DCT coefficientes are updated with the average of the DCT coefficients (step S202). Then, an average of the DCT coefficients is supplied to the image discrimination section 308&#39; as DCT coefficients of a processing block for coding. Therefore, a kind of an image can be discriminated by taking adjacent processing blocks into account. 
     In the present embodiment, a kind of image can be discriminated by taking into account pixels around a processing block for coding as a kind of averages. Thus, a kind of image can be discriminated more correctly. Therefore, a suitable quantization table can be used for quantization. 
     Though a processing block of nine 8*8 matrices is used in the present embodiment, a processing block is not limited to that shown in FIG. 29. Though the adjacent block processing unit 340 performs simple average operation, it may perform average operation with appropriate weights. 
     Fourth Embodiment 
     Prior art discrimination windows as shown in FIGS. 31A-31E are used to discriminate a dot image. A dot image has generally a peak of AC coefficients in the windows shown in FIGS. 31B-31E and has relatively small absolute values in the window shown in FIG. 31A. Then, an image can be discriminated as a dot image if a sum of absolute values of DCT coefficients in the window shown in FIGS. 31B-31E is larger than the counterpart in the window shown in FIG. 31A and larger than a prescribed threshold value. However, it is a problem that the window of FIG. 31E overlaps the windows of FIGS. 31A-31D. Then, an erroneous discrimination is liable to occur when large peaks appear in the window shown in FIG. 31A because it is not certain which of windows of FIG. 31A and FIG. 31E has a larger sum. Then, it is preferable not to use overlapped windows for discrimination. Further, it is not preferable to calculate a sum for images such as a dot image having clear peaks, but an erroneous discrimination is not liable to occur if a maximum value is used for comparison instead of a sum. A dot image can be discriminated correctly and simply by using a discrimination method of this embodiment. 
     FIG. 32 shows a processing block 200 of the coding unit 30 of a fourth embodiment. Image data of a document is received by a 8*8 blocking section 201, and the 8*8 blocking section 201 divides the image data into processing pixel matrices of 8*8 pixels. A DCT (discrete cosine transform) section 202 transforms image data in a processing matrix to DCT coefficients. The DCT section 202 sends the DCT coefficients to an image discrimination section 203 and a quantization section 204. The image discrimination section 203 discriminates a kind of an image in the processing block as will be explained later. Then, it sends a discrimination signal to the quantization section 204 which uses it to select a quantization table. It also sends a quantization table signal to a coder 209. The coder 209 performs coding of the signal and sends the code of the quantization table to a multiplexer 210. On the other hand, the quantization section 204 selects a quantization table according to the discrimination signal and quantizes the DCT coefficients by using the selected quantization signal. Then, the DC coefficient is sent to a differential pulse-coded modulation (DPCM) section 205 while the AC coefficients are sent to a zigzag scan section 206. The DPCP section 205 calculates a difference between the DC component of the current processing block and that of the previous processing unit, and a coder 207 processes the difference for variable length coding. On the other hand, the zigzag scan section 206 scans the AC components in the order shown in FIG. 5 so as to reorder them in a one-dimensional array. A coder 2008 processes the reordered data for entropy coding. A multiplexer 210 multiplexes the data coded by the coders 207, 208, 209 and sends a multiplexed data to the facsimile transmission unit 40 or the like. 
     The image discrimination section 203 calculates a maximum of DCT coefficients in two regions shown in FIGS. 33A and 33B. The first region shown in FIG. 33A consists of four rows and four columns at low frequency components except the DC component, while the second region shown in FIG. 33B consists of the other components. Then, an image is discriminated by using the two maxima. 
     FIG. 34 shows a block diagram of the image discrimination section 203, wherein a dot image discrimination section 250 receives DCT coefficients of a processing block of an image. Then, it sends a high level signal to a selection signal generator 252 if the image is discriminated as a dot image, as will be explained later. The DCT coefficients data are sent next to a character image discrimination section 251. It sends a high or low level signal to the selection signal generator 252 according as the image is discriminated as a character image or a photograph image. The selection signal generator 252 generates a selection signal according to received three signals. For example, the selection signal is &#34;10&#34;, &#34;01&#34; or &#34;00&#34; according as the image is a dot image, a character image or a half-tone image. 
     Next, FIG. 35 shows the dot image discrimination section 250. A discrimination windows generation section 260 generates two windows shown in FIGS. 33A and 33B. A first window shown in FIG. 33A comprises AC DCT components around the DC coefficient, while a second window shown in FIG. 33B comprises AC DCT coefficients except those included in the first window . That is, the two windows do not have common DCT coefficients. In concrete, the discrimination windows generation section 260 separates the DCT coefficients in a processing block in the two areas shown in FIGS. 33A and 33B and supplies them to a MAX(A) calculation section 261 and a MAX(B) calculation section 262, respectively. The MAX(A) calculation section 261 calculates a maximum of absolute values (or a first peak) of the DCT coefficients in the first window, while a MAX(B) calculation section 262 calculates a maximum of absolute values (or a second peak) of the DCT coefficients in the second window. The two peak values are sent to a comparator 263. The comparator compares the first peak Keith the second peak, and it also compares the second peak value with a threshold value determined according to experimental data. If the second peak value is larger than the first peak value and larger than the threshold value, the image in the processing block is determined as an dot image. Otherwise the image is determined as a character or half-tone image. 
     Although the present invention has been fully described in connection with the preferred embodiments thereof with reference to the accompanying drawings, it is to be noted that various changes and modifications are apparent to those skilled in the art. Such changes and modifications are to be understood as included within the scope of the present invention as defined by the appended claims unless they depart therefrom.