Image encoding apparatus optimizing the amount of generated code

Abstract: An image processing apparatus including: an input device (1) for inputting image data; a first encoding device (3) for encoding the image data with first parameter; a second encoding device (4) for encoding the image data with second parameter; a first counting device for counting the first amount of encoded image data encoded by the first encoding device; a second counting device for counting second amount of encoded image data encoded by the second encoding device; and a calculating device (5) for calculating third parameter, with which the image data is encoded to a predetermined amount of encoded data, in accordance with both of the first and the second amounts of encoded image data.

Description: The present invention relates to an image processing apparatus, and, more particularly to an image processing apparatus for compressing a digital image and transmitting compressed data to a transmission path or a storage medium. Fig. 7 illustrates a conventional image encoding apparatus in which image data received at a terminal 101 is analog-to-digital (hereinafter abbreviated to "A/D") converted in an A/D converter 102 before it is formed into a variable-length compressed code in an encoding unit 103. Then the variable-length compressed code is temporarily stored in a transmission buffer memory 104 before it is transmitted to a transmission path 106. At this time, a control coefficient (parameter) for use to control the quantity of data of the variable-length compressed code generated in the encoding unit 103 is generated depending upon the degree of the data occupancy of a buffer memory 104 and the transmission rate of the transmission path 106 so as to be fed back to the encoding unit 103 via a filter 105. As a result compressed data representing an image can, in an averaged manner, be transmitted at a rate of the transmission path 106. Data received via the transmission path 106 is temporarily stored in a receiving buffer memory 107 so as to, together with the supplied control coefficient, be transmitted to a decoding unit 108. As a result, variable-length compressed encoded data is expanded and decoded before it is digital-to-analog converted in a D/A converter 109 so that an image is transmitted to a terminal 110. A variety of systems for compressing a colour image to be performed in the encoding unit 103 shown in Fig. 7 have been disclosed. Among others a so-called Adaptive Discrete Cosine Transform (ADCT) system has been suggested as a preferable colour image encoding system. Fig. 8 is a schematic structural view which illustrates an image encoding apparatus structured to act according to the above-described ADCT system. The above-described apparatus is arranged to receive an image represented by 8-bit data, that is, data converted into 256 gradations/colour by the A/D converter 102 shown in Fig. 7, the input image being composed of three or four colours, that is, RGB, YUV, YPbPr, L*a*b* or YMCK or the like. The input image is, by a DCT unit 201, immediately subjected to a two-dimensional discrete cosine transformation (hereinafter abbreviated by "DCT") in units of sub-blocks each of which is composed of 8 x 8 pixels. Then, the obtained conversion coefficients are linearly quantized in a linear quantizing unit 202. Each conversion coefficient has a different quantizing step size which is made to be a value obtained by, multiplying by K an element of an 8 x 8 quantization matrix the 8 x 8 quantization matrix being employed while taking into consideration for each conversion coefficient the difference of the visual sensitivity for sensing the quantization noise, where K is called a "control coefficient". The value of K is used to control the image quality and the quantity of compressed and generated data. Table 1 shows an example of a quantization matrix stored in a quantization matrix storage unit 203. That is, since the number of quantization steps is reduced when K is enlarged, the image quality deteriorates and the data quantity decreases. 16 11 10 16 24 40 51 61 12 12 14 19 26 58 60 55 14 13 16 24 40 57 69 56 14 17 22 29 51 87 80 62 18 22 37 56 68 109 103 77 24 35 55 64 81 104 113 92 49 64 78 87 103 121 120 101 72 92 95 98 112 100 103 99 After the quantization has been completed, a DC conversion component (hereinafter called a "DC component") is, in a one-dimensional prediction unit 204, subjected to a one-dimensional forecasting between adjacent sub-blocks. As a result, the forecasted error is Huffman-encoded in a Huffman encoding unit 205. Then, the quantization output denoting the forecast error is divided into groups so that the identification number of a group which includes the forecasted error is Huffman-encoded before the value of the quantization output in the group is expressed by a fixed length code. The AC conversion component (hereinafter called "AC component") is encoded using a zigzag scanning unit 206 in such a manner that the above-described quantization output is diagonally zigzag scanned in a direction from low spatial frequency to high spatial frequency as shown in Fig. 9. That is, significant conversion coefficients, i.e. coefficients of non-zero value, are identified by an identification number according to horizonal and vertical spatial frequency. Also, the number of insignificant conversion coefficients, i.e. coefficients of zero value, scanned between each respective significant conversion coefficient and the next following scanned significant conversion coefficient is extracted. Each respective identification number and the corresponding extracted number of insignificant coefficients are paired and are Huffman encoded by the Huffman encoding unit 207. The respective values of the quantization output, ie the significant conversion coefficients, are each expressed by a fixed length code. Since the number of significant conversion coefficients is dependent on spatial frequency distribution, and will thus vary from one image frame to the next, the length of code generated for each image frame also will vary. It is thus difficult to match the capacity of the buffer memory 107, shown in Fig.7, to the amount of encoded data generated. If the capacity is too small, overflow will occur and the reproduced image will be degraded. If a large size memory is chosen to avoid such overflow, then there are penalties in extra hardware size and cost. The above problem of avoiding overflow has been addressed by Mukana et al., IEEE Transactions on Communications, Vol. Com -32, No. 3 March 1984, pages 280-287. The apparatus described therein is of the type defined in the preamble of claim 1 appended. In the case of transmitting or recording still image data, if the quantization is not controlled adaptively it is neither possible to predict the time required for transmission nor possible to predict the storage capacity required for recording. A variety of code length control technologies have been disclosed in European Patent Application EP-A-0447247 published 18 September 1991, and European Patent Application EP-A-0469835, European Patent Application EP-A-0469852, both published 5 February 1992. EP-A-0 469 835 discloses iteratively controlling the quantization characteristic to keep the amount of code below a desired value. Moreover, plural encoders are arranged in parallel, using respectively different encoding control parameters. The output from the encoder whose amount of code is an optimum approximation of the desired amount is selected. The present invention, as defined in the appended claims, is intended as a solution to the problems discussed above. In the accompanying drawings Fig. 1 is a structure block diagram which illustrates a first embodiment of the present invention; Fig. 2 illustrates an image to be transmitted in a structure according to the first embodiment of the present invention; Fig. 3 illustrates a calculating method according to the first embodiment of the present invention; Fig. 4 is a structure view which illustrates a second embodiment of the present invention; Fig. 5 illustrates a calculating method according to the second embodiment of the present invention; Fig. 6 illustrates a calculation flow according to the second embodiment of the present invention; Fig. 7 is a structural block diagram according to a conventional example; Fig. 8 illustrates an ordinary variable-length encoding system; Fig. 9, in detail, illustrates the ordinary variable-length encoding system; Fig. 10 illustrates a relationship between control coefficients and information quantities, according to a third embodiment of the invention; Fig. 11 illustrates another relationship between control coefficients and information quantities, according to the third embodiment; Fig. 12 illustrates a further-detailed calculating method according to a fourth embodiment of the present invention; Fig. 13 illustrates a calculating flow according to the fourth embodiment of the present invention; Fig. 14 illustrates a further-detailed calculating method according to a fifth embodiment of the present invention; Fig. 15 illustrates a calculating flow according to the fifth embodiment of the present invention; Fig. 16 is a block diagram which illustrates a sixth embodiment of the image encoding apparatus according to the present invention; Fig. 17 is a block diagram which illustrates the schematic structure of a conventional encoding system which employs a DCT conversion; Fig. 18 illustrates a quantization process shown in Fig. 17; Fig. 19 illustrates a quantization process shown in Fig. 17; Fig. 20 illustrates a sixth embodiment of the present invention; Fig. 21 further illustrates the sixth embodiment of the present invention; and Fig. 22 further illustrates the sixth embodiment shown in Fig. 16. First Embodiment A first embodiment of the present invention will be described now with reference to the drawings. Fig. 1 is a structural block diagram which illustrates an image processing apparatus according to the present invention. An image received from a video camera or a host computer or an image scanner or the like is A/D converted by an A/D converter 2 before it is variable-length encoded by an encoding unit (1) given reference numeral 3 by the above-described so-called ADCT system. At this time the control coefficient K has a constant value Q 1 for the current one frame of the image. As a result, the compressed information quantity B 1 is measured and the measured quantity B 1 is transmitted to a calculating unit 5. Simultaneously, the image data is also variable-length encoded by an encoding unit (2) given reference numeral 4 by the so-called ADCT system. At this time control coefficient K has a different constant value Q 2 , for the current one frame of the image. The resulting, compressed information quantity B 2 is measured and also transmitted to the calculating unit 5. Reference numeral 6 represents an image data delay unit for delaying the image, which has been A/D-converted, by about one image frame. Reference numeral 7 represents an encoding unit (0) for compressing and encoding the delayed image data under control of an optimum control coefficient K=Q 0 which is calculated by a linear approximation from Q 1 , Q 2 , the measured amounts B 1 and B 2 in the calculating unit 5, and from the predetermined desired quantity value B 0 of compressed and encoded data which value is already stored in a memory such as a ROM, a RAM and the like so as to be transmitted to the calculating unit 5. Reference numeral 9 represents a transmission path comprising a transmission medium such as ground waves or an optical space or the like exemplified by an optical fibre, a satellite or microwaves in the case of instantaneous transmission. In case of accumulated transmission, it is a storage medium such as a tape type medium exemplified by a digital VTR or a DAT or the like, a disc-like medium such as a floppy disk or an optical disk or the like or a solid medium such as a semiconductor memory. The transmission rate is determined depending upon the quantity of information of the original image, the compression rate and a required transmission time such that it is varied from several tens of kbits/second to several tens of Mbits/second. On the other hand, data received through the transmission path 9 is temporarily stored in a receiving buffer memory 10 so that compressed encoded data read from the receiving buffer memory 10 is extended and decoded in the decoding unit 11 with the optimum control coefficient Q 0 which has been received simultaneously with the above-described data item. Then, it is digital-to-analog converted a D/A converting unit so that an image is transmitted to a terminal 13. Referring to Figs. 2 and 3, the present invention will now be described in detail. Fig. 2 illustrates an example of an image to be transmitted, one frame of the image being an A/D converted image composed of 1280 pixels, each of which is constituted by 8 bits, in the horizontal direction and 1088 pixels in the longitudinal direction. The data capacity of one image is made of 1,280 x 1,088 x 8 = 11,141,120 bits. If the image is transmitted as a moving image at a speed of 30 frames/second a high speed transmission path capable of realizing 11,141,120 x 30 = 334,233,600 bits/second must be used. On the other hand, the transmission path is usually arranged to act at a predetermined transmission rate. Therefore, an information quantity which exceeds the predetermined transmission rate will cause a data overload to occur and thereby the transmission cannot be made. Assuming that a transmission path, the transmission rate of which is 36.0000 Mbits/second, is used and as well assuming that the redundancy degree for information such as a sink code, an ID code and a parity is 5%, the transmission rate at which image information can be transmitted is 34.2000 Mbits/second and thereby the compressed information quantity for one image (one frame) is 1.1400 Mbits/frame. Therefore, the image of frame must be compressed to a degree which is 10.23% or less. Furthermore, dummy data amounting to the residual quantity: 1,140,000 - (11,141,120 x 0.1023) = 263.424 bits/frame, that is, 263.424 x 30 = 7,902.72 bits/second must be inserted. Assuming that the control coefficient is a certain value and thereby the compressed information quantity of a certain image is 10%, the capacity of image information is 334,233,600 x 0.1.= 33,423,360 bits/seconds and thereby dummy data of 34,200,000 - (334,233,600 x 0.1) = 776,640 bits/second must be inserted. Assuming that the control coefficient has a certain value and thereby the compressed information quantity of a certain image is 11%, the capacity of image information is 334,233,600 x 0.11 = 36,765,696 bits/seconds, resulting in a negative amount of dummy data of 34,200,000 - (344,233,600 x 0.1)= -2,565,696 bits/second, which corresponds to exceeding the transmission rate of the transmission path, causing a data overload to occur. Therefore, it is necessary to constitute a structure in such a manner that the target compression rate set to 10.23% and an optimum control coefficient Q 0 is given to the encoding unit (0) given reference numeral 7 shown in Fig. 1 in order to obtain an approximate value which does not exceed the target compression rate of 10.23%. Fig. 3 illustrates a process of determining optimum control coefficient Q 0 , wherein a case in which the information quantity is compressed and encoded to about 1/10 by the so-called ADCT system is illustrated. The encoding system is arranged to be similar to that shown in Fig. 8 such that 8 horizontal pixels x 8 longitudinal pixels are collected into a DCT sub-block and the DCT conversion is performed in units of the DCT sub-blocks before the conversion coefficient is linearly quantized. Each conversion coefficient has a different quantizing step size which is made to be a value obtained by multiplying an 8 x 8 quantization matrix element shown in Table 1 by K, the 8 x 8 quantization matrix being employed while taking into consideration for each conversion coefficient the difference of the visual sensitivity for sensing the quantization noise. The value of K is used to control the image quality and the quantity of generated data so that the above-described desired compression ratio of about 1/10 is realized. After the quantization has been completed, a DC conversion component is, as a subtraction value from zero, subjected to a one-dimensional forecasting between adjacent sub-blocks. Then, the forecast error is Huffman-encoded. Then, the quantization output denoting the forecast error is divided into groups so that the identification number of a group which includes the forecasted error is Huffman-encoded before the value of the quantization output in the group is expressed by a fixed length code. An AC conversion component excluding the DC component is encoded in such a manner that the above-described quantization output is zigzag scanned from the low frequency component to the high frequency component. That is, the significant coefficients are classified into groups depending upon their values, and the identification number of the group and the number of the insignificant coefficients held between each significant coefficient and a following significant coefficient positioned in front of it in the direction of the scan, are paired with the significant coefficient and then Huffman encoded. At this time, two control coefficients Q 1 and Q 2 are selected and relationships Q 1 < Q 0 and Q 0 < Q 2 are established. Fig. 3 illustrates the relationship between control coefficient K for an ordinary image frame and the compressed information quantity Y. The above-described relationship between Y and K is expressed by function g, that is, Y = g (K), where function g is considered such that it extremely approximates a log curve expressed by: Y = g (K) = p log K + q (where p and q are constants) Then, encoding using control coefficient Q 1 is performed in the encoding unit (1) given reference numeral 3 shown in Fig. 1 so that compressed information quantity B 1 is obtained. Furthermore, encoding using control coefficient Q 2 is performed in the encoding unit (2) given reference numeral 4 shown in Fig. 1 so that compressed information quantity B 2 is obtained. In the calculating unit 5 shown in Fig. 1, a straight Y = aK + b (wherein a and b are constants) which connects two points (Q 1 , B 1 ) and (Q 2 , B 2 ) is calculated. Y = B 1 - B 2 Q 1 - Q 2 ·K + Q 2 · B 1 Q 2 - Q 1 - Q 1 · B 2 Q 2 - Q 1 Transformation is performed so that the following equation is obtained: K = (Q 2 - Q 1 )·Y - Q 2 ·B 1 + Q 1 ·B 2 B 2 - B 1 Then, by setting B 0 shown in Fig. 3 to the compressed information quantity corresponding to the desired compression ratio (10.23%), the optimum control coefficient Q 0 can be obtained by substituting B 0 into Y in Equation (2). Q 0 = (Q 2 - Q 1 ) B 0 - Q 2 ·B 1 + Q 1 ·B 2 B 2 - B 1 Actually, since the compressed information quantity generated with optimum control coefficient K = Q 0 has a value given by Y = g (K), the actual quantity is B 0 '. Since equation (1) is a downward-convex log curve, the straight line, which connects two points on the downward-convex curve, necessarily is positioned on or above this curve as shown in Fig. 3. This means that: B 0 > B 0 ' so that the desired compression ratio is not exceeded in any case. Therefore, data overload is avoided. Q 1 , Q 2 and B 0 of Equation (4) are known constant values. Therefore it is necessary to be capable of obtaining B 1 and B 2 by a trial of encoding. Therefore, the encoding units (1) and (2) respectively given reference numerals 3 and 4 shown in Fig. 1 are only required to generate the compressed information quantities. Although the calculating unit 5 shown in Fig. 1 calculates the above-described Equation (4), the calculation may be performed by using a CPU or a look-up table which uses a ROM or a RAM or the like. Although the above-described embodiment is arranged in such a manner that the relationship between the control coefficients and the compressed information quantities are expressed by a log curve, the actual relationship is sometimes different from this such that it can sometimes be approximated by a quadratic curve or a cubic curve depending upon the way of the quantization and the type of encoding employed in the encoding unit. However, any of the cases are commonly characterized in that each curve is a downward-convex curve (the tangent is always present below the curve). Therefore, the above-described method of determining the control coefficient can be effectively employed because of the above-described characteristics. Second Embodiment Fig. 4 is a structural block diagram which illustrates a second embodiment of the image encoding apparatus according to the present invention. An image received through a terminal 20 is A/D converted by an A/D converter 21 before it is variable-length encoded by an encoding unit (1) given reference numeral 22 by the above-described so-called ADCT system. At this time, control coefficient K is, as Q 1 which is a constant value, used to compress one frame of the image. As a result, a compressed information quantity B 1 is obtained so as to be transmitted to a comparison and calculating unit 26. Simultaneously, the image is also variable-length encoded by an encoding unit (2) given reference numeral 23 by the so-called ADCT system. At this time, control coefficient K is, as Q 2 , which is a constant value, used to compress the one frame of the image. As a result, a compressed information quantity B 2 is obtained so as to be transmitted to the comparison and calculating unit 26. The same image is similarly variable-length encoded by an encoding unit (3) given reference numeral 24 by the so-called ADCT system. At this time, control coefficient K is, as Q 3 , which is a constant value, used to compress the one frame of the image. As a result, a compressed information quantity B 3 is obtained so as to be transmitted to the comparison and calculating unit 26. Furthermore, the same image is similarly variable-length encoded by an encoding unit (4) given reference numeral 25 by the so-called ADCT system. At this time, control coefficient K is, as Q 4 , which is a constant value, used to compress the one frame of the image. As a result, a compressed information quantity B 4 is obtained so as to be transmitted to the comparison and calculating unit 26. Reference numeral 27 represents an image data delay unit for delaying the image, which has been A/D-converted, by about one image frame. Reference numeral 28 represents an encoding unit (0) for compressing and encoding the image data in dependance upon the optimum control coefficient K = Q 0 calculated by the comparison and calculating unit 26 so as to cause compressed and encoded data to be stored in a transmission buffer memory 29. Reference numeral 30 represents a transmission path. Data received through the transmission path 30 is temporarily stored in a receiving buffer memory 31. Compressed and encoded data read from the receiving buffer memory 31 is, in the encoding and decoding unit 32, extended and decoded with optimum control coefficient Q 0 which has been received simultaneously. Then, it is digital-to-analog converted in the D/A converter 33 so that an image is transmitted from a terminal 34. Then, the second embodiment of the present invention will now be described with reference to Figs. 5 and 6. Then, a description will made with reference to a case in which an image to be transmitted is, as shown in Fig. 2, similar to that according to the above-described first embodiment and one image frame is compressed to 10.23% or less, respectively. That is, it is necessary to constitute a structure in such a manner that the target compression rate is set to 10.23% and an optimum control coefficient Q 0 is given to the encoding unit (0) given reference numeral 28 shown in Fig. 4 in order to obtain an approximate value which does not exceed the target compression rate 10.23%. Fig. 5 illustrates a process of determining the optimum control coefficient Q 0 . The encoding system is arranged to employ the so-called ADCT system shown in Fig. 8 similarly to the first embodiment. Then, an assumption is made that four control coefficients Q 1 , Q 2 , Q 3 , and Q 4 are selected which hold relationships Q 1 < Q 0 and Q 0 < Q 4 . Fig. 5 illustrates the relationship between control coefficient K for an ordinary one image frame and the compressed information quantity Y thereof. The above-described relationship between Y and K is expressed by function g, that is, Y = g (K). In this state, Y = g (K) closely approximates a log curve. Then, encoding using control coefficient Q 1 is performed in the encoding unit (1) given reference numeral 22 shown in Fig. 4 so that compressed information quantity B 1 is obtained. Encoding using control coefficient Q 2 is performed in the encoding unit (2) given reference numeral 23 shown in Fig. 4 so that compressed information quantity B 2 is obtained. Encoding using control coefficient Q 3 is performed in the encoding unit (3) given reference numeral 24 shown in Fig. 4 so that compressed information quantity B 3 is obtained. Encoding using control coefficient Q 4 is performed in the encoding unit (4) given reference numeral 25 shown in Fig. 4 so that compressed information quantity B 4 is obtained. Then, the flow of the comparison and calculating unit 26 shown in Fig. 4 will now be described with reference to Fig. 6. In the comparison and calculating unit 26 shown in Fig. 4, target compression information quantity B 0 is subjected to comparisons with B 1 , B 2 , B 3 and B 4 obtained by the above-described compressing and encoding trial such that B 0 ≦ B 1 , B 0 ≦ B 2 , B 0 ≦ B 3 and B 0 ≦ B 4 , respectively (steps S1 to S4) so as to obtain N with which B 0 holds a relationship B N ≦ B 0 ≦ B N+1 (wherein N is a positive integer) (steps S5 to S7). If N is not obtained, an error is recognized (step S9). At the time at which N is detected, straight line Y = aK + b (where a and b are constants) which connects (Q N , B N ) and (Q N+1 , B N+1 ) to each other is calculated in the comparison and calculating unit 26 shown in Fig. 4. As a result, control coefficient K is obtained from Equation (5): K = (Q N+1 - Q N )·Y - Q N+1 ·B N + Q N ·B N+1 B N+1 - B N Then, by making B 0 shown in Fig. 5 to correspond to the desired compression ratio (10.23%) so that optimum control coefficient Q 0 can be obtained by substituting B 0 into Y in Equation (5). Q 0 = (Q N+1 - Q N )·B 0 - Q N+1 ·B N + Q N ·B N+1 B N+1 - B N Actually, since the compressed information quantity generated with optimum control coefficient K = Q 0 has a value given by Y = g (K), the actual quantity is B 0 '. This means that: B 0 > B 0 /so that the desired compression ratio is not exceeded in any case. Therefore, a data overload of the transmission path is avoided. Among the above-described values, Q 1 , Q 2 , Q 3 , Q 4 and B 0 are known constant values in the apparatus, therefore it it is necessary to be capable of obtaining only B 1 , B 2 , B 3 and B 4 by trial encoding. Therefore, the encoding units (1), (2), (3) and (4) given reference numerals 22, 23, 24 and 25 shown in Fig. 4 are only required to generate the compressed information quantities. Although the above-described Equation (6) is calculated in the above-described comparison and calculating unit 26 shown in Fig. 4, the calculation may be performed by using a CPU or the like or a look-up table which uses a ROM or a RAM or the like. Although the above-described second embodiment is arranged in such a manner that the number of the encoding units for generating only the encoded information quantity is made to be four, the above-described number can be increased, resulting an effect to be obtained in that the optimum control coefficient infinitely approximates the desired compressed information quantity while being limited to be smaller than the same. As a result, encoding can efficiently be performed. Therefore, the present invention is not limited to the above-described number of the encoding units. Furthermore, although the above-described ordinary encoding system as shown in Fig. 8 is employed in the encoding unit for the purpose of easily making the description, another encoding system may be employed. In addition, in the above-described case, the DCT unit shown in Fig. 8 is commonly employed in the encoding units. Therefore, due to the necessity of providing a plurality thereof they can be unified into one unit. The frequency conversion is not limited to DCT since other types of orthogonal conversion may be employed. In addition, the present invention is not limited to the block size arranged to be 8 x 8 pixels. Furthermore, the encoding method applied after the quantization has been completed is not limited to the Huffman encoding method. For example, an arithmetical encoding method or a run-length encoding method may be employed. As described above, the quantity of compressed data can be satisfactorily controlled. Third Embodiment The structure of the third embodiment is characterized by a means for adjusting the first-order term, or the zero order term, or both the zero and first order terms of the applied linear approximation. The basic block structure according to this embodiment is arranged to be similar to that shown in Fig. 1. Fig. 10 illustrates a case in which control coefficient K and information quantity Y hold a special relationship. In a case where the information quantities obtained by quantization using control coefficients Q 1 and Q 2 are B 1 and B 2 , respectively, and where the original information quantity is B 0 , the control coefficient which is obtained by linear approximation Y = aK + b as shown in Fig. 10 becomes Q 0 . Furthermore, if the actual information quantity B 0 , obtained through the quantization is performed using control coefficient Q 0 , holds a relationship B 0 ' > B 0 , data overload occurs. Therefore, by adding a predetermined information quantity β (a constant) to approximation curve Y = aK + b obtained with information quantities B l and B 2 , approximation Y' = aK + b + β can be obtained. Then, quantization with control coefficient Q 0β obtained with desired information quantity B 0 is performed so that the actual information quantity becomes B 0 ". As a result, a relationship B 0 " < B 0 and thereby the quantity becomes the desired information quantity B 0 or less. Therefore, information can be quantized and compressed so as to be transmitted while preventing data overload. Since Y = g (K) is, in Fig. 10, ordinarily a downward convex curve, it is preferable that the above-described constant β holds a relationship β > 0. By adding β thus-determined, the possibility of occurrence of a data overload can be decreased. The structure may be arranged in such a manner that β is set manually to the calculating unit 5 in accordance with the supplied image or the same is automatically set in accordance with the characteristics of the image. Fig. 11 illustrates control coefficient K and information quantity Y in a case where approximation Y = aK + b shown in Fig. 10 is transformed (amended) into Y' = (a + α) K + b + β. As described with reference to Fig. 3, by performing quantization with desired information quantity B 0 and control coefficient Q 0αβ obtained by approximation Y = (a + a) K + b + β, the actual information quantity becomes B 0 " which holds a relationship B 0 " < B 0 . Since the information quantity does not exceed the desired information quantity B 0 , quantization and compression can be performed so as to transmit information. Furthermore, it is preferable that α holds a relationship α > 0, similarly to β. According to the above-described embodiment of the present invention, the above-described adapted linear approximation is applied. As a result, quantization compression can be performed while preventing a data overload even if the image is an image of a type in which the quantization control coefficient and the information quantity holds a special relationship. Fourth Embodiment The fourth embodiment is characterized in that, in a case where the desired information quantity is larger than the information quantity generated by the trial made with the first control coefficient as a result of the trial of a plurality of variable-length compressing and encoding with M-types of control coefficients, or in a case where the information quantity is smaller than the information quantity generated by the trial made with the M-th control coefficient, variable-length encoding is performed using a predetermined constant value as the control coefficient. Since the basic block structure according to this embodiment is the same as that shown in Fig. 1, its description is omitted here. Fig. 13 is a flow chart for the calculation to be performed in the structure according to this embodiment. In a case where the image is very simple such as a colour bar and the original information quantity is small as designated by curve (B) shown in Fig. 12 as a result of a trial performed by using two control coefficients Q 1 and Q 2 shown in Fig. 1, a relationship B 0 > B 1B is held (S101) and the calculating unit 5 shown in Fig. 1 transmits Q 1 to the encoding unit 7 while making Q 0 = Q 1 . In a case where the image is, as designated by curve (A) shown in Fig. 12, very complicated such as a zone plate and the original information quantity is very large as a result of the trial performed by using two control coefficients Q 1 and Q 2 , a relationship B 0 < B 2A is held (S102) and the calculating unit 5 shown in Fig. 1 transmits Q MAX to the encoding unit 7 while making Q 0 = Q MAX (S104). In a case where B 2A < B 0 ≦ B 1B , Q 0 is calculated similarly to the first embodiment (S105). As a result, the desired compression ratio is not exceeded in any case and a data overload will not take place on the transmission path. Fifth Embodiment A fifth embodiment of the present invention is a modification to the second embodiment. Since the basic structure is the same as that shown in Fig. 4, its description is omitted here. Fig. 15 is a flow chart for the calculation to be performed in the structure according to this embodiment, the flow chart being basically arranged to be the same as that shown in Fig. 6. In a case where the image is very simple such as a colour bar and the original information quantity is small as designated by curve (B) shown in Fig. 14 as a result of a trial performed by using four control coefficients Q 1 , Q 2 , Q 3 and Q 4 shown in Fig. 14, a relationship B 0 > B 1B is held and the calculating unit 26 shown in Fig. 4 performs a transmission to the encoding unit (0) while making Q 0 = Q 1 (S9). In a case where the image is, as designated by curve (A) shown in Fig. 14, very complicated such as a zone plate and the original information quantity is very large as a result of the trial performed by using four control coefficients Q 1 , Q 2 , Q 3 and Q 4 , a relationship B 0 < B 4A is held and the calculating unit 26 shown in Fig. 4 performs a transmission to the encoding unit 0 while making Q 0 = Q MAX (S10). Although the above-described embodiment is arranged in such a manner that the relationship between the control coefficients and the compressed information quantities are expressed by a log curve, the actual relationship is sometimes different from this such that it can sometimes be approximated by a quadratic curve or a cubic curve depending upon the way of the quantization and the type of encoding employed in the encoding unit. However, any of the cases are commonly characterized in that each curve is a downward-convex curve (the tangent is always present below the curve). Therefore, the above-described method of determining the control coefficient can be effectively employed because of the above-described characteristics. Sixth Embodiment In general, in a case where an image signal is transmitted, the transmission path possesses a transmission capacity per unit time. Therefore, it is preferable that, in a case where one frame must be transmitted at a predetermined moment as in case of a moving image, the quantity of the code to be transmitted be a quantity fixed in units of frames or image blocks. Although the overall quantity of the code can be adjusted by changing the quantization step coefficient in the quantization process, the quantization step coefficient must be forecast in order to cause the overall quantity of encoded data to be included in the set code quantity because the quantity of encoded data is different depending upon the image. The relationship between the above-described quantization step coefficient and the overall quantity of the encoded data establish a monotone decreasing function. Furthermore, an average image is expressed by a logarithmic curve as shown in Fig. 18. As a method of estimating the quantization step size by utilizing the above-described characteristics, there has, according to the above-described embodiments, been described a method in which different trial quantization step coefficients are applied and the quantity of code obtained for each trial coefficient is measured and a linear interpolation is then performed to determine the approximate value of the optimum quantization step coefficient. Fig. 19 illustrates the above-described method of estimating the quantization step size. However, the above-described method encounters a problem in that many trials must be provided in order to reduce the error from the set quantity of the code, a plurality of trials must be performed in parallel in order to shorten the time required for estimation and the size of hardware of the apparatus cannot be reduced if the number of the measuring points is increased in order to improve the accuracy of the measured results. According to the sixth embodiment to be described below, there is provided an encoding apparatus for quantizing converted data obtained by converting image information into the spatial frequency domain in units of blocks composed of a plurality of pixels, and for variable-length encoding the quantized converted data, the encoding apparatus comprising means for measuring the quantity of code by, in parallel, performing quantization to variable-length encoding (VLC) with predetermined plural quantization step coefficients, and a calculating means for estimating a quantization step coefficient for a desired quantity of the code by a linear approximation, from the measured quantity of the code, wherein the intervals between the trial quantization step coefficients, for each of which the quantity of the code is measured, are widened in proportion to the value of the quantization step coefficient. Accordingly, the approximation error of the estimated quantization quantity can be approximated to a substantially constant value in comparison to a case in which the trial coefficients are equispaced. In particular, in a case where the quantity of the quantized code is large, the intervals between the trial coefficients can be narrowed. Therefore, an effect can be obtained in that the approximation error of the above-described estimated quantization quantity can be reduced. As a result, the estimation accuracy of the quantity of the quantized code can be improved while necessitating a small number of trials coefficients. Fig. 16 is a block diagram which illustrates the sixth embodiment of an encoding apparatus according to the present invention and structure in such a manner that the present invention is applied to a transmission apparatus for transmitting an image signal. Referring to Fig. 16, reference numeral 322 represents an input terminal for receiving a digital image signal. The image signal supplied for each line is, in a block forming circuit 324, divided into blocks each of which is composed of, for example, 8 longitudinal pixels and 8 horizontal pixels. Pixel data in each block is converted into spatial frequency data by a DCT conversion circuit 326. The above-described conversion data is temporarily stored in a memory 328 and as well as the same is linearly quantized in quantizing circuits 338a to 338n with different quantization step coefficients k 1 to k n received from generating circuits 334a to 334n for generating the predetermined quantization step coefficients k 1 to k n . According to this embodiment, quantization step coefficients k 1 to k n generated in the generating circuits 334a to 334n are not made in such a manner that the step interval is equalized as shown in Fig. 19 but the same is widened in inverse proportion to the quantity of the quantized code as shown in Fig. 22. Data quantized by the quantizing circuits 338a to 338n is variable-length encoded by VLCs 340a to 340n so that code quantities nb 1 to nb n for each data are obtained. However, the actual encoded data is not transmitted here but only the quantity of the code is measured before it is transmitted to a calculating circuit 342. In the calculating circuit 342, code quantities nb 1 to nb n at each measuring point and set code quantity nb 0 determined from the transmission rate are subjected to a comparison so as to identify a measuring point which is larger than nb 0 and nearest nb 0 and a measuring point which is smaller than nb 0 and nearest nb 0 are approximated by a straight line. As a result, quantization step coefficient k 0 with respect to set code quantity nb 0 is estimated before it is transmitted to the quantizing circuit 330. The quantizing circuit 330 receives conversion encoding data transmitted after it has been delayed by a predetermined period by the memory 328 so as to perform the linear quantization with estimated quantizing step coefficient k 0 before its result is supplied to a VLC 332. In the VLC 332, the variable-length encoding operation is performed so that its result is transmitted to the transmission path through a terminal 336 while extremely reducing the error with respect to a predetermined transmission rate. According to the above-described structure, the relationship between the total code quantity nb and quantization step coefficient k closely approximates a log curve. Therefore, the quantization step coefficient is selected in such a manner that the measuring points are set in an exponential function manner as shown in Fig. 20 so that, for example, the interval between the measured results of the code quantities is made to be equalized and the quantization error is made to be constant. Furthermore, an image of a type which encounters a quantization error because of its large code quantity can be processed to improve it in such a manner that the measuring points are, as shown in Fig. 21, set adjacent to the points as each of which the quantization step coefficient is small. Then, this embodiment will now be described in detail with reference to Figs. 16 and 22. First, two quantization step coefficients k 3 and k 4 are selected, k 3 and k 4 being arranged to hold the following relationships with optimum quantization step coefficient k 0 : k 3 < k 4 , k 0 < k 4 Referring to Fig. 16, the liner quantization and the VLC are performed with the quantization step coefficients k 3 and k 4 so that compressed code quantities nb 3 and nb 4 are obtained. Referring to Fig. 22, point (k 3 , nb 3 ) and point (k 4 , nb 4 ) are connected to each other by a straight line so that estimated value k 0 ' of the quantization step coefficient is obtained from code quantity nb 0 set for each predetermined period. Actually, since optimum quantization step coefficient k 0 with respect to nb 0 is on a curve shown in Fig. 22, compressed code quantity nb 0 ' with respect to k 0 ' and nb 0 always hold the following relationship: nb 0 ' < nb 0 As a result, the desired code quantity cannot be exceeded in any case so that it can be quantized. As a result of the above-described structure, in a case where the code quantity is small and thereby the estimated error of the quantization step coefficient becomes small, the measuring points is decreased. In a case where the code quantity is large and thereby the error becomes large, the measuring points are increased. Therefore, the estimation accuracy of the quantization step coefficient can be improved. Although the above-described embodiments are arranged in such a manner that the size of the formed block is made to be 8 x 8, the size may be varied. Furthermore, an orthogonal conversion (spatial frequency conversion) other than DCT may be employed. As described above, according to the image processing apparatus according to the present invention, the data quantity for a predetermined region can be set to a desired data quantity while reducing the quantity of hardware and exhibiting satisfactory high accuracy. The above-described embodiments are not limited to a moving image but the same can be applied to a still image. The above described invention finds application not only in the processing of images to be displayed by a monitor, but also in image reproduction by printing such as by laser beam or ink jet.

Claims: An image processing apparatus comprising: first encoding means (7;28;330;332) arranged to receive data representing an image, to produce a first amount (B o ') of encoded image data in response to a first control parameter (Q o ); and control means (3 to 5) to adapt said first control parameter (Q o ) so that said first amount (B o ') of encoded image data shall not exceed a predetermined amount (B o ); which apparatus is characterised in that:- said control means (3 to 5) comprises: second and third encoding means (3,4;22,23;338a and 340a,338b and 340b), arranged to receive data identical to that received by said first encoding means (7;28;330;332) to produce, in parallel, respective second and third different amounts (B 1 , B 2 ; nb 1 , nb 2 ) of encoded image data in response to respective second and third control parameters (Q 1 , Q 2 ; k 1 , k 2 ) different from each other; and determining means (5;26;342) responsive to said second and third control parameters (Q 1 , Q 2 ; k 1 ; k 2 ), said measured second and third amounts (B 1 , B 2 ; nb 1 , nb 2 ) and said predetermined amount to determine said first control parameter (Q o ) so that said first amount (B o ') shall approximate but not exceed said predetermined amount (B o ). An apparatus according to claim 1, wherein said determining means (5;26) is operable to determine said first control parameter by using a linear approximation. An apparatus according to claim 1 or 2, wherein said first encoding means (7;28;330;332) includes quantizing means and the first control parameter (Q o ) is a quantizing step. An apparatus according to any of claims 1 to 3, wherein the value of the second control parameter (Q 1 ) is larger than that of said first control parameter (Q o ) and said first amount (B o ') is larger than said second amount (B 1 ). An apparatus according to claims 1 to 4, wherein said first encoding means (7;28;330;332) is adapted to perform encoding by employing an orthogonal transformation. An apparatus according to any of claims 1 to 5, including input means to input data representing a sequence of pictures. An apparatus according to any of claims 1 to 6, further comprising a buffer memory (8) for storing the image data encoded by said first encoding means (7). An apparatus according to any of claims 1 to 7, further comprising transmitting means (9) for transmitting the image data encoded by said first encoding means (7) via a transmission path. An apparatus according to any of claims 1 to 8, further comprising decoding means (11) for decoding the image data encoded by said first encoding means (7). The apparatus as claimed in claim 2, wherein said linear approximation is based on use of the following formula: y = a k + b ; a = (B 1 -B 2 )/(Q 1 -Q 2 ); b = (Q 2 B 1 -Q 1 B 2 )/(Q 2 -Q 1 ) where y and k represent said predetermined data amount (B o ) and said first control parameter (Q o ), B 1 , B 2 represent said second and third data amounts corresponding to said second and third control parameters Q 1 , Q 2 . An apparatus as claimed in claim 2, wherein said linear approximation is based on use of the following formula: y = a k + b + β where y, a, k and b are as defined in claim 10 and β is a constant selected manually, or automatically in accordance with the characteristics of the image. An apparatus as claimed in claim 2, wherein said linear approximation is based on the following formula: y = (a + α) k + b + β y, a, k, b and β being as defined in claim 11 and α being a constant. An apparatus as claimed in claim 1 including additional encoding means responsive to at least one additional control parameter (Q 3 , Q 4 ) in addition to said first, second and third encoding means; and comparison and selection means to compare the data amounts encoded by said first, second and additional encoding means and to select therefrom two data amounts nearest above and below said predetermined amount, and to select the corresponding control parameters for input to said determining means, as said second and third data amounts and as said second and third control parameters, respectively. An apparatus as claimed in claim 13, including store means holding equispaced parameter values for use as said control parameters of said second, third, and additional encoding means. An apparatus as claimed in claim 13 including store means holding proportionate interval parameter values for use as said control parameters of said second, third and additional encoding means, the intervals between said parameter values increasing in proportion to the parameter value. An apparatus as claimed in claim 1, including store means holding parameters for use as said second and third control parameters. An apparatus as claimed in combined claims 4 and 16, wherein said store means also holds default maximum and minimum parameters (Q max , Q n ) for use as said first control parameter; comparison means for comparing said second and third data amounts with said predetermined amount; and selection means for selecting said default maximum or minimum parameter as said first control parameter when said second data amount exceeds said predetermined amount or said predetermined amount exceeds said first data amount, respectively. An apparatus according to claim 1, wherein said second and third encoding means perform full encoding operations to produce said second and third amounts of encoded image data. A method of encoding received data representing an image wherein a first amount (B o ') of encoded image data is produced by a first encoding means (7) in response to a first control parameter (Q o ) and the first control parameter is adapted so that said first amount (B o ') shall not exceed a predetermined amount (B o ), which method is characterised by: producing a second amount (B 1 ) of encoded image data from the received data by controlling a second encoding means (3) using a second control parameter (Q 1 ); producing a third amount (B 2 ) of encoded image data from the received data by controlling a third encoding means (4), in parallel with said second encoding means (3), using a third control parameter (Q 2 ) different from said second control parameter; and determining said first control parameter (Q o ) from said second and third data amounts (B 1 , B 2 ), said second and third control parameters (Q 1 , Q 2 ), and said predetermined data amount (B o ) as basis for approximation.

Inventors: ENARI MASAHIKO, HOSHI NOBUHIRO, TAKIZAWA HIROSHI, ENARI, MASAHIKO, HOSHI, NOBUHIRO, TAKIZAWA, HIROSHI, ENARI, MASAHIKO, C/O CANON KABUSHIKI KAISHA, HOSHI, NOBUHIRO, C/O CANON KABUSHIKI KAISHA, Takizawa, Hiroshi, c/o Canon Kabushiki Kaisha
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1991
Main classification: H04N1
IPC codes: H04N7, H04N1, G06T9