Image processing apparatus and method

Abstract: An apparatus is provided for quantizing data obtained by transforming image data to a frequency zone so as to encode it. The speed at which such an apparatus performs processing is increased. Data is quantized on the basis of a plurality of coefficients C₁ for controlling a quantizing step. As a result of the quantization, reference encoding data items Nb1 to Nb4 are obtained. Coefficients C₅ to C₇ for controlling the quantizing step are generated when image data which is delayed by one frame is quantized. At this time, the data items Nb1 to Nb 4 are output by bit-shifting the result of the quantization.

Description: The present invention relates to an apparatus and method for encoding an image. More particularly, it pertains to an apparatus and method for quantizing conversion data obtained by transforming image information to a frequency space so as to encode such data. An Adaptive Discrete Cosine Transformation (ADCT) encoding system used as a method for encoding color image signals has gained attention in recent years. A Joint Photographic Expert Group (JPEG), which was founded as an international organization for standardizing such an encoding system, will soon adopt the ADCT encoding system as an official encoding system. The outline of such an encoding system will be described briefly. Fig. 3 is a block diagram illustrating the approximate structure of a conventional encoding system utilizing DCT. Figs. 4A to 4D are views illustrating the encoding system shown in Fig. 3. Numeral 2 denotes an input terminal of a digital image signal to be encoded. A raster scanned digital image signal is input from a CCD sensor (not shown) to the input terminal 2, and then to an 8 x 8 block formation circuit 4, where it is two dimensionally divided into 8 x 8 pixel blocks, and then transmitted pixel block by pixel block to components connected to the formation circuit 4. Numeral 6 denotes a DCT converting circuit for changing the image signal transmitted from the block formation circuit 4 into discrete cosine transformation so as to output 8 x 8 data matrixes representing data in frequency space. In other words, the DCT converting circuit 6 converts pixel blocks forming image data items D 11 to D 88 shown in Fig. 4A into data matrixes forming DCT coefficients X 11 to X 88 shown in Fig. 4B. Data matrix value X 11 represents a DC component in horizontal and vertical directions of the pixel block, that is, the average value of the pixel block. When the DCT coefficients X 11 to X 88 are expressed as Xij, the greater the "i" increases, the higher the frequency a component has in the vertical direction; similarly, the greater the "j" increases, the higher the frequency the component has in the horizontal direction. The data matrixes output from the DCT converting circuit 6 are input to a linear quantization circuit 8. A quantization matrix generation circuit 18 generates quantization matrix values W 11 to W 88 (shown in Fig. 4C) which show the weight of a step of quantizing the DCT coefficients X 11 to X 88 . A coefficient generation circuit 16 generates coefficients C. The quantization matrixes W 11 to W 88 and the coefficients C are input to a multiplier 20. The multiplier 20 calculates an equation (W ij x C/C 0 ). A quantizing step performed by the linear quantization circuit 8 is determined in accordance with the outputs Q 11 to Q 88 of the multiplier 20. The coefficients C are positive values which control image quality and the amount of data generated, whereas C 0 is a constant. The linear quantization circuit 8 actually calculates an equation X ij /Q ij , and outputs it. The outputs of the linear quantization circuit 8 are expressed as quantized conversion data items G 11 to G 88 . The quantized data items G 11 to G 88 are successively transmitted starting from DC components from a zigzag scan circuit 10. In other words, the data items G 11 to G 88 are supplied from the zigzag circuit 10 to a Variable Length Coding (VLC) circuit 12 in the order of G 11 , G 12 , G 21 , G 31 , G 22 , G 13 , G 14 , G 23 , G 32 , G 41 ··· G 85 , G 86 , G 77 , G 68 , G 78 , and G 88 . As regards, for example, a DC component G 11 , the VLC circuit 12 calculates a predicted value between pixel blocks located near the DC component G 11 , and changes a difference between the predicted value and an actual value into a Huffman code. As regards AC components G 12 to G 88 , since most of the coefficients appear to be zeros, group ID numbers, which identify groups into which significant coefficients except zero are divided according to the values of the significant coefficients, and values combined with the number of zeros preceded by the significant coefficients (run length of zeros) are formed into Huffman codes by the VLC circuit 12. Data indicating values in the groups, into which the significant coefficients are divided, is additionally coded. In general, since the ratio at which high-frequency components occur in the diagonal direction of an image is low, it is predicted that, after zigzag scanning has been performed, in many cases all components become zero which occupy the latter half of the outputs represented by Gij and transmitted from the line quantization circuit 8. It is therefore expected that variable length codes thus obtained can be compressed at a very high ratio. If a compression ratio between 1 to 2 and 1 to 9 is employed, it is possible to reproduce an image having hardly deteriorated quality. Generally, the amount of data transmitted through a transmission route per unit time is fixed. When one screen must be transmitted at each predetermined time interval, as when an image is transmitted, it is desirable that an output code be represented by a bit number fixed by an image or pixel block unit. If a high value is given to the coefficients C mentioned previously, the ratio at which Gij assumes zero increases and the total number of bits of encoded data NB decreases. The relationship between the coefficients C and the total number of bits NB varies according to images, and is expressed by a monotonically decreasing function. It is known that such a relationship regarding an average image is expressed by the logarithmic curve shown in Fig. 4D. The above-mentioned JPEG presents a method of predicting a coefficient C 0 for obtaining the desired total number of bits NB0. A coefficient C 1 is first encoded, and then the total number of bits nbl of a thus-obtained code is determined. A predicted value C 2 of the coefficient C 0 is calculated on the basis of the total number of bits nbl. Such calculation can be predicted because the logarithmic curve shown in Fig. 4D runs through a point (C 1 , nb1). By repeating the above operation several times, the amount of data encoded can be obtained within approximately several % errors with respect to the desired total number of bits NB0. However, the process of repeatedly encoding data so as to determine the coefficients C is a very time-consuming process, and is not suitable for an encoding apparatus which is required to transmit one screen at predetermined time intervals, such as moving images. Such a process is extremely difficult to perform in terms of calculation speed, particularly when image signals of a very high bit rate, such as high definition television signals, are handled. It is known from EP-A-0401854 to provide an image processing apparatus comprising input means operable to input image data, quantizing means operable to quantize the image data and to generate quantized image data, encoding means operable to encode the quantized image data and to generate encoded image data, and control means operating to control the data amount of the encoded image data by varying a quantizing condition of said quantizing means. A disadvantage of such apparatus is that control of the quantizing condition requires repeated calculation of an estimated value of the data amount. The present invention is characterised in that said control means comprises a plurality of measuring systems operating in parallel to quantize the image data such that each measuring system uses a respective quantizing condition defined by using respective matrix values and a respective coefficient, the same matrix values being used in common for defining each of the quantizing conditions and the respective coefficients being different from one another, the measuring systems further operating to perform measuring operations in parallel so as to generate respective data amounts representative of the amount of encoded data which would be produced by the encoding means using the respective quantizing conditions and further comprising determining means operable to determine the quantizing condition of said quantizing means on the basis of said data amounts. Embodiments of the present invention will now be described by way of example only and with reference to the accompanying drawings of which: Fig. 1 is a view showing a first embodiment of the present invention; Fig. 2 is a view showing a second embodiment of this invention; Fig. 3 is a view showing the conventional art; and Figs. 4A to 4D are views illustrating the encoding method shown in Fig. 3. According to the embodiments of the present invention which will be described below, an encoding apparatus, which quantizes data obtained by transforming image information into a frequency space and then forms such data into variable length codes, comprises a plurality of quantizing means, a calculating means, a calculating and generating means, and a selecting means. The quantizing means perform control on the basis of a first set of control coefficients; the calculating means calculates the amount of data when a plurality of quantized data are formed into variable length codes; the calculating and generating means calculates and generates a second set of control coefficients; and the selecting means selects outputs which are quantized and formed into variable length codes using the second set of control coefficients. Because of the structure as described above, the control coefficients obtained by a second quantizing means approach desired values as compared with a first quantizing means. Control coefficients substantially close to the desired control coefficients can be obtained. Since it is not necessary to repeatedly encode data and calculate the control coefficients, a process can be performed at extremely high speed. The apparatus can be thoroughly applied to processing moving images. The embodiments of this invention will be described below in detail. Fig. 1 is a block diagram showing the first embodiment of this invention. In this figure, numeral 20 denotes an input terminal of an analog television signal. A television signal input through the terminal 20 is digitized by an A/D convertor 22 into 8-bit data. The 8-bit data is then divided by an 8 x 8 block formation circuit 26 into 8 x 8 pixel blocks, and supplied to a DCT converting circuit 28 block by block. The 8 x 8 block formation circuit 26 operates in the same manner as the block formation circuit 4 shown in Fig. 3. As in Fig. 3, pixel data items D 11 to D 88 in blocks are converted by the DCT converting circuit 28 into data matrixes X 11 to X 88 defining data in frequency space, and are supplied to a zigzag scan circuit 30. The zigzag scan circuit 30 operates in the same manner as the zigzag scan circuit 10 shown in Fig. 3, and outputs the DCT converted data matrix values X 11 to X 88 in the order of X 11 , X 12 , X 21 , X 31 , X 22 , X 13 , X 14 , X 23 , X 32 , X 41 ··· X 85 , X 86 , X 77 , X 68 , X 78 , X 87 and X 88 . A quantization matrix generation circuit 36 generates the quantized matrix values X 11 to X 88 . However, in this embodiment, since data which has already been quantized is input to quantization circuits 32a to 32d, the quantized matrix values X 11 to X 88 are generated in an order corresponding to the order of zigzag scanning, and supplied to multipliers 38a to 38d. Initial coefficients C 1 to C 4 , serving as control coefficients C, are fed from a coefficient calculator 48 to the multipliers 38a to 38d, respectively. In the same manner as in the conventional art described previously, the multipliers 38a to 38d calculate the quantized matrix values X 11 to X 88 and the control coefficients C x using an equation (W ij x C x /C 0 ), and output them to the quantization circuits 32a to 32d. The quantization circuits 32a to 32d quantize conversion coefficients, which are controlled by the control coefficients C 1 to C 4 , and zigzag-scanned in a quantizing step. The quantization circuits 32a to 32d output these coefficients to variable length coders (VLCs) 40a to 40d. In this embodiment, the VLCs 40a to 40d do not output data which has actually been encoded, but only output information nb1 to nb4 regarding the total number of bits of each screen when the VLCs 40a to 40d perform the same process as the VLC 12 shown in Fig. 3. The coefficient calculator 48 calculates a control coefficient C 5 used for the desired total number of bits and outputs it to a multiplier 38e. This calculation is performed using the control coefficients C 1 to C 4 and the information nb1 to nb4 output from the VLCs 40a to 40d, respectively. The coefficient calculator 48 outputs control coefficients C 6 and C 7 , which are values approximate to the control coefficient C 5 , to multipliers 38f and 38g and to terminals 44a to 44c of a switch 44. However, when C 5 is greater than or equal to C n and less than or equal to C n+1 (C n ≦ C 5 ≦ C n+1 ), then C 6 is greater than or equal to C n and less than C 5 (C n ≦ C 6 < C 5 ), and C 7 is greater than C 5 and less than or equal to C n+1 (C 5 < C 7 ≦ C n+1 ), where n is greater than or equal to 1 and less than or equal to 3 (1 ≦ n ≦ 3). The matrixes and the coefficients are calculated by the quantization matrix generation circuit 36 and using the control coefficients C 5 to C 7 . In the same way as the above-mentioned multipliers 38a to 38d, the multipliers 38e to 38g output the matrixes and the control coefficients to quantization circuits 32e to 32g during a vertical blanking period. A DCT conversion coefficient is output from the zigzag scan circuit 30, delayed by a one-frame delay circuit 34, and then input to quantization circuits 32e to 32g. The quantization circuits 32e to 32g quantize the conversion coefficient, which has been controlled by the control coefficients C 5 , C 6 and C 7 in a quantizing step, and output it to variable length coders (VLCs) 40e to 40g. In this embodiment, the VLCs 40e to 40g not only output data which has actually been encoded to entry buffers 42a to 42c, but also output the total number of bits nb5 to nb7 to a judgment circuit 50. The judgment circuit 50 outputs, to switches 44 and 46, data which selects the result of quantizing the conversion coefficient so that the result is nearest but not more than the desired total number of bits. The entry buffers 42a to 42c accumulate encoded data until the judgement circuit 50 outputs the result of judgement. The switch 44 selects the control coefficients on the basis of the judgement, and outputs them to a multiplexer 52. The switch 46 selects the encoded data, and outputs it to the multiplexer 52. The multiplexer 52 multiplexes the control coefficients and encoded data, and outputs them to an output terminal 54. Fig. 2 is a block diagram showing the second embodiment of this invention. Components operating in the same manner as those in the first embodiment are identified by the same reference characters. A DCT coefficient from a zigzag circuit 30 is output to a one-frame delay circuit 34 and a quantization circuit 60. A multiplier 62 first multiplies an initial coefficient C 1 and quantized matrix values W 11 to W 38 output from a quantization matrix generation circuit 36. The multiplier 62 then outputs the multiplied coefficient and quantized matrix values to the quantization circuit 60. The initial control coefficient C 1 is output from a coefficient calculator 64. The quantization circuit 60 quantizes the DCT coefficient which has been controlled by the control coefficient C1, and outputs it to variable length coders (VLCs) 40a to 40d, this quantization being performed in a quantizing step. If the total number of bits of the quantized DCT coefficient is K bits, K bits are output to the VLC 40a; (K-1) bits are output to the low-order bit of the VLC 40b; (K-2) bits are output to the low-order bit of the VLC 40c; and (K-3) bits are output to the low-order bit of the VLC 40d. As in the first embodiment, the VLCs 40a to 40d do not output encoded data, but output to the coefficient calculator 64 only information nb1 to nb4 regarding the total number of bits of each screen. The output of the quantization circuit 60 is shifted 0 to 3 bits toward a low-order direction, and then connected. By such an operation, the VLC 40a changes a quantized output, which is controlled by the initial control coefficient C 1 , into a variable length code; the VLC 40b changes a quantized output, which is quantized using a step size twice that of the initial control coefficient C 1 , into a variable length code; the VLC 40c changes a quantized output, which is quantized using a step size four times that of the initial control coefficient C 1 , into a variable length code; the VLC 40d changes a quantized output, which is quantized using a step size eight times that of the initial control coefficient C 1 , into a variable length code. In other words, the amount of data, nb1 to nb4, formed into variable length codes represents the amount of data encoded by control coefficients C 1 , C 1 x 2, C 1 x 4 and C 1 x 8. It is thus possible to decrease the number of encoders and to simplify the structure of circuitry by shifting bits. The coefficient calculator 64 determines a control coefficient C 5 with respect to the desired amount of encoding. This determination is based upon the amount of data, nb1 to nb4, formed into the variable length codes corresponding to the control coefficients C 1 , C 1 x 2, C 1 x 4, and C 1 x 8. The coefficient calculator 64 also determines not only C 6 = C 5 - α, serving as a value approximate to the control coefficient C 5 , but also C 7 = C 5 + α, serving as a value approximate to the control coefficients C 6 and C 7 . It outputs the control coefficients C 5 to C 7 to multipliers 38e to 38g, respectively. A process thereafter is performed in the same manner as in the first embodiment. As has been described above, the image encoder of this invention, which quantizes data obtained by transforming image information to a frequency zone so as to form such data into variable length codes, is capable of setting the amount of data at every predetermined time interval to the desired amount and processing the data at very high speed. The present invention may be applied to processing images in motion as well as at rest. Bits may be shifted one by one or two by two. Instead of controlling control coefficients, the contents of a quantization table may be changed. The present invention is not limited to the embodiments described above, and various modifications and application may be possible within the scope of the claim.

Claims: An image processing apparatus comprising: input means (20) operable to input image data; quantizing means (32e-32g) operable to quantize the image data and to generate quantized image data; encoding means (40e-40g) operable to encode the quantized image data and to generate encoded image data; and control means (48,50) operable to control the data amount of the encoded image data by varying a quantizing condition of said quantizing means, characterised in that said control means comprises: a plurality of measuring systems (32a-32d, 40a-40d) operating in parallel to quantize the image data such that each measuring system uses a respective quantizing condition defined by using respective matrix values (W 11 - W88) and a respective coefficient (C1-C7), the same matrix values being used in common for defining each of the quantizing conditions and the respective coefficients being different from one another, the measuring systems further operating to perform measuring operations in parallel so as to generate respective data amounts (Nb 1 - Nb 4 ) representative of the amount of encoded data which would be produced by the encoding means using the respective quantizing conditions; and further comprising determining means (48, 50) operable to determine the quantizing condition of said quantizing means on the basis of said data amounts. An apparatus according to claim 1, further comprising converting means (28) operable to perform a DCT conversion on the image data input by said input means block by block. An apparatus according to any of claims 1 and 2, further comprising an A/D converter (22) for converting the image data input by said input means into digital image data. An apparatus according to any one of claims 1 to 3, wherein said quantizing means is operable to quantize the image data block by block and the size of said quantization matrix is the same as the size of the block. An apparatus according to any one of claims 1 to 4, wherein said encoding means is operable perform a variable length encoding. An apparatus according to any one of claims 1 to 5, further comprising delay means (34) operable to perform a one-frame delay on the image data and to output the delayed image data to the quantizing means. An apparatus according to any one of claims 1 to 6, further comprising output means (52) operable to output the encoded image data with the determined quantizing condition. An apparatus according to any one of claims 1 to 7, wherein the determining means is operable to determine the quantizing condition such that the amount of the encoded image data is near but not more than a desired data amount. An apparatus as claimed in any preceding claim wherein the determining means comprises a coefficient calculator (48) operable to calculate a control coefficient (C 5 ) required for the encoded image data to be substantially equal to a desired data amount, the quantizing means comprising a multiplier (38e) operable to obtain values of a quantization matrix (X 11 -X 88 ) by multiplication of the matrix values (W 11 -W 88 ) by the control coefficient (C 5 ), and the quantizing means being operable to quantize the image data using the quantization matrix. An image processing method comprising: an input step of inputting image data; a quantizing step of quantizing the image data to generate image data; an encoding step of encoding the quantized image data to generate encoded image data; and controlling the data amount of the encoded image data by varying a quantizing condition of said quantizing means; characterised in that the amount of the encoded image data is controlled by operating in parallel a plurality of measuring systems (32a-32d, 40a-40d) to quantize the image data such that each measuring system uses a respective quantizing condition defined by using respective matrix values (W 11 -W 88 ) and a respective coefficient (C1-C7), the same matrix values being used in common for defining each of the quantizing conditions and the respective coefficients being different from one another, and the measuring systems performing measuring operations in parallel so as to generate respective data amounts (Nbl-Nb4) representative of the amount of encoded data which would be produced using the respective quantizing conditions; and including the further step of determining the quantizing conditions of said quantizing step on the basis of said data amounts. A method according to claim 10 including the step of performing a DCT conversion on the input image data block by block. A method according to any of claims 10 and 11 including the step of A/D converting the input image data. A method according to any one of claims 10 to 12 wherein said encoding step comprises variable length encoding the quantized image data and outputting variable length encoded image data. A method according to any one of claims 10 to 13 including the step of delaying the image data by one frame before said encoding step. A method according to any one of claims 10 to 14 including the step of outputting the encoded image data with the determined quantizing condition. A method according to any one of claims 10 to 15 wherein the quantizing condition is determined so that the amount of the encoded image data is nearest but not more than a desired total data amount. A method according to any of claims 10 to 16 wherein the determining means comprises a coefficient calculator (48) which calculates a control coefficient C5 required for the encoded image data to be substantially equal to a desired data amount, the quantizing means comprising a multiplier (38e) obtaining values of a quantization matrix X 11 -X 88 by multiplication of the matrix values W 11 -W 88 by the control coefficient C5, and the quantizing means quantizing the image data using the quantization matrix.

Inventors: HOSHI NOBUHIRO, NAGASAWA KENICHI, HOSHI, NOBUHIRO, NAGASAWA, KENICHI, HOSHI, NOBUHIRO, C/O CANON KABUSHIKI KAISHA, NAGASAWA, KENICHI,C/O CANON KABUSHIKI KAISHA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1992
Main classification: H04N7
IPC codes: G06T9, H04N1, H04N7, G06T1, H03M7