Encoding method and apparatus

Abstract: An encoding method and apparatus uses energy characteristic of discrete cosine transform (DCT) domains for determination of a quantization level. The DCT domain is divided into four sub-domains. The energy characteristic of each macroblock is represented as one among the four domains such as simple, complicated, edge and plain domains. A buffer (31) generates a first quantization level which is varied according to the buffer fullness in units of a slice. The energy characteristic information and the first quantization level of the buffer are used for determination of a second quantization level supplied to quantizers (12, 22). The quantizers (12, 22) quantize the transformation coefficient data according to the second quantization level generated in units of the macroblock. Thus, the viewer can see less quantization error. The encoding apparatus generates a second quantization level just by an addition operation of the varied value of the first quantization level which is determined by the energy characteristic information to the first quantization level, thereby providing a quantization level generator capable of being implemented with simple hardware an example of which is disclosed.

Description: Background to the Invention The present invention relates to an encoding method and apparatus and to the technology of encoding image data to compress an amount of the data, and more particularly, to an encoding method and apparatus in which a quantization level is varied according to an energy characteristic of a spatial frequency domain. Recently, there is known a system for transmitting and receiving an image signal and an audio signal which chiefly uses a method for converting an analog image and audio signal into a digital image and audio signal and encoding the converted digital signal to transmit the encoded signal and store the converted signal in a storage device, and for receiving the transmitted signal or reading out the stored signal to reproduce the received signal by decoding the received signal or the read-out signal and converting the decoded signal into an analog signal. Such an encoding and decoding system requires a technology of compressing a large amount of the transmitted data to maximise a transmission efficiency of the data. There exist a transformation encoding method, a differential pulse code modulation method, a vector quantization method and a variable length coding method etc, as general methods for encoding an image signal. The encoding methods remove redundancy data included in digital image signals for use in compression of a total amount of the data. To perform such an encoding method, a picture is divided into blocks each of which has a predetermined magnitude, and image data is transformed into a transformation coefficient of a frequency domain by way of a predetermined transformation with respect to each block or a difference signal between the blocks. There exist a discrete cosine transform a Walsh-Hadamard transform, a discrete cosine transform and a discrete sine transform, etc, as data transformation methods with respect to the respective blocks. Technologies for properly encoding such transformation coefficients according to the data characteristics, storing or transmitting the encoded signal, and decoding the encoded signal for reproduction have been recognised as very important technologies in high definition TV (HDTV), high definition VTR (HD-VTR), digital camcorders, multimedia equipment, video phones, etc. Meanwhile, when an image signal is compressed using a variable length coding and decoding apparatus, a buffer is used for maintaining a transfer bit rate of the encoded and transmitted signal. A quantization level is controlled according to the fullness of the buffer to avoid an overflow or an underflow of the buffer. Accordingly, an amount of the data which is input to the buffer is controlled. A conventional quantization level is chiefly controlled in units of a slice according to the data storage state in the buffer. In such a quantization level determination method, the quantization level is properly controlled according to the buffer fullness when the transfer bit rate of the buffer is determined. Thus, an amount of the bits which are input to the buffer could be exactly controlled. However, there was a problem that an image characteristic was not considered at all. Accordingly, many of the systems vary the quantization level in units of a macroblock so that the image characteristic can be reflected. Such a conventional quantization level of a unit macroblock is determined by the characteristic of the image signal in an image domain for processing image pixels. Thus, a signal processing procedure is complicated and hardware implementation is difficult. A prior art technology using an energy characteristic of a spatial frequency domain to quantize the image signal is disclosed in US patent number US-A-5,109,451 and 'Signal Processing Image Communication; vol.5, no.1/2, February 1993', Amsterdam, NL Summary of the Invention An advantage of the present invention is that it provides an encoding method having a simpler signal processing procedure than that of an image domain by using a quantization level which is determined in units of a macroblock by extracting a characteristic of an image signal in a frequency domain by means of transformation of the image signal so as to quantize the image signal. Another advantage of the present invention is that it provides an encoding apparatus which can embody a quantization level determination method which uses an energy characteristic in the above-mentioned frequency domain with simple hardware. Thus, there is provided an encoding method which quantizes and encodes image data to transmit the encoded data through a buffer, the encoding method comprising the steps of: receiving the encoded data to generate a first quantization level which is varied in order to transmit the received data at a predetermined transfer rate; transforming image data in an image domain into image data in a frequency domain in block units to generate transform coefficient data in the frequency domain; dividing a unit of a block of transform coefficients in the frequency domain into a plurality of frequency sub-domains according to the frequency components corresponding to the transform coefficients, summing up the absolute values of the transformation coefficients for each of the sub-domains, calculating domain average values by averaging the summed values of each of the respective sub-domains for a plurality of blocks defining a macroblock, and generating energy characteristic information by selecting the domain of the macroblock as one of a simple domain, an edge domain, a complicated domain and a plain domain according to the relationship between the domain average values corresponding to the respective sub-domains; determining a second quantization level according to the energy characteristic information and the first quantization level; and quantizing the transformation coefficient data according to the second quantization level. According to the present invention there is also provided an encoding apparatus which quantizes and encodes image data to transmit the encoded data, the encoding apparatus comprising: buffer means which receives the encoded data to transmit the received data at a predetermined transfer rate, and generates a first quantization level which is varied so as to maintain the transfer rate invariably; transformation means for transforming image data in an image domain into image data in a frequency domain in block units to generate transform coefficient data in the frequency domain; image characteristic discrimination means for dividing a unit of a block of transform coefficients in the frequency domain into a plurality of frequency sub-domains according to the frequency components corresponding to the transform coefficients, summing up the absolute values of the transformation coefficients for each of the sub-domains, calculating domain average values by averaging the summed values of each of the respective sub-domains for a plurality of blocks defining a macro block, and generating energy characteristic information by selecting the domain of the macroblock as one of a simple domain, an edge domain, a complicated domain and a plain domain according to the relationship between the domain average values corresponding to the respective sub-domains; quantization level determination means for receiving the energy characteristic information and the first quantization level and determining a second quantization level according to the energy characteristic information and the first quantization level to generate the determined second quantization level; and means for receiving the transformation coefficient data from the transformation means and quantizing the transformation coefficient data according to the second quantization level. According to the present invention, there is also provided an encoding apparatus which quantizes and encodes image data to transmit the encoded data, the apparatus comprising: buffer means which receives the encoded data to transmit the received data at a predetermined transfer rate, and generates a first quantization level which is varied so as to maintain the transfer rate invariably; transformation means for transforming units image data in an image domain into image data in a frequency domain in block units to generate transform coefficient data in the frequency domain; image characteristic discrimination means for dividing a unit of a block of transform coefficients in the frequency domain into a plurality of frequency sub-domains according to the frequency components corresponding to the transform coefficients, summing up the absolute values of the transformation coefficients for each of the sub-domains, calculating domain average values by averaging the summed values of each of the respective sub-domains for a plurality of blocks defining a macro block, and generating energy characteristic information by selecting the domain of the macroblock as one of a simple domain, an edge domain, a complicated domain and a plain domain according to the relationship between the domain average values corresponding to the respective sub-domains; means for varying the quantization level according to the energy characteristics whereby the transfer rate from the buffer means is maintained constant. Brief Description of the Drawings Figure 1 is a block diagram showing one embodiment of an encoding apparatus which uses a quantization level of a macroblock unit according to the present invention. Figure 2 is a view showing a processing unit of image data according to the present invention. Figure 3 is a view showing a discrete cosine transform (DCT) domain having four sub-domains according to the present invention. Detailed Description of the Preferred Embodiment A preferred embodiment of the present invention will be described below in more detail, by way of example only, with reference to the accompanying drawings. Figure 1 is a block diagram showing one embodiment of an encoding apparatus for encoding an image signal by using a quantization level which is determined through an energy characteristic of a DCT domain according to the present invention. The Figure 1 apparatus includes a first DCT portion 11 for transforming the image data which is input through an input port into data on a DCT domain being a frequency domain in units of a block. The output of first DCT portion 11 is connected to a first quantizer 12 for transforming the transformation coefficient data into representative values each of which has a predetermined level. The output of first quantizer 12 is connected to a first variable length coder 13 for variable-length encoding and quantized image data according to a data distribution probability. DCT portion 11, quantizer 12 and variable-length coder 13 form an intra-mode for encoding the image data contained in a frame. The intra-mode encodes the image data which is composed of pixel values constituting the image which is not differential data. The Figure 1 apparatus includes a first adder 20 which calculates differential data between the image data inputted through an input port and predetermined feedback data. A second DCT portion 21 for transforming the differential data into data of a frequency domain is connected to the output of the first adder 20. A second quantizer 22 for transforming transformation coefficients into representative values is connected to the output of second DCT portion 21. A second variable-length coder 23 for variable-length coding the quantized data to compress the data is connected to the output of second quantizer 22. DCT portion 21, quantizer 22 and variable-length coder 23 constitute an inter mode routine for encoding a difference signal between the current block data and the motion compensated block data. Further, the Figure 1 apparatus includes a first switch 30 for selecting one among two contacts "a" and "b" which are connected to the outputs of first and second variable-length coders 13 and 23, respectively, according to a mode selection signal S M . A buffer 31 for outputting a first quantization level SQUANT which is used for maintaining an amount of transmission data V CD invariably is connected to the output of first switch 30. A second switch 32 selects one among two contacts "d" and "e" which are connected to the respective outputs of first and second quantizers 12 and 22 according to mode selection signal S M . An inverse quantizer 33 and inverse DCT portion 34 are subsequently connected to the output of second switch 32. A second adder 50 for adding the inversely transformed data and predetermined feedback data to reconstruct a picture and a frame memory 35 are connected to the output of inverse DCT portion 34. A motion estimator 36 looks for block data which is most similar to image data V IN from frame memory 35 and calculates a motion vector MV which represents motion between the blocks. A motion compensator 37 for compensating the output data of frame memory 35 using motion vector MV is connected to the output of motion estimator 36. A whole direction analyzer 40 for outputting quantization level MQUANT in units of a macroblock is also connected to the output of first DCT portion 11. Whole direction analyzer 40 includes a domain discrimination portion 12. Whole direction analyzer 40 includes a domain discrimination portion 41 which receives the output of first DCT portion 11 and detects energy characteristic information in units of a macroblock, and a quantization level determination portion 41 which generates an optimum quantization level MQUANT using the energy characteristic information and first quantization level SQUANT which is supplied from buffer 31. Figure 2 is a conceptional view which represents blocks of the data processed in the Figure 1 apparatus. The Figure 1 apparatus performs a DCT transformation with respect to the block composed of 8 horizontal pixels by 8 vertical pixels. Also, the Figure 1 apparatus performs motion estimation and motion compensation in units of a macroblock composed of a plurality of blocks. Generally, the macroblock has a size of 16 by 16, or 32 by 16. In this embodiment, the macroblock of 32 (horizontal) by 16 (vertical) has been used. Also, the quantization level or the quantization step size which is determined by a state of the buffer has been determined in units of 1,408-by-16 slices. Image data V IN of a unit block which is inputted to the Figure 1 apparatus is transformed into transformation coefficient data of a frequency domain in first DCT portion 11. Here, the energy of the transformation coefficient data is mainly collected toward a low frequency. First adder 20 subtracts the output data of motion compensator 37 from input image data V IN to calculate differential data. The differential data is transformed into data of a frequency domain in second DCT portion 21. First and second quantizers 12 and 22 transform the transformation coefficient data into the representative values each of which has a predetermined level according to second quantization level MQUANT. Quantization level MQUANT which is supplied to first and second quantizers 12 and 22 is calculated in whole direction analyzer 40 considering a human's spatial vision characteristic. If the quantization level is high, the amount of data outputted from quantizer 12 or 22 becomes small and the quantization error becomes large. Conversely, if the quantization level is low, the amount of data outputted from quantizer 12 or 22 becomes large and the quantization error becomes small. Variable-length coders 13 and 23 which receive the quantized DCT transformation coefficient data further compress transmission data V CD by variable-length coding the data using a statistical characteristic of the data. First switch 30 receives the variable-length coded data which is supplied from first and second variable-length coders 13 and 23 through corresponding contact "a" or "b", and supplies the output data of the variable-length coders corresponding to the contact which is selected by externally supplied mode selection signal S M to buffer 31. Then, buffer 31 outputs first quantization level SQUANT to maintain an amount of the data outputted from buffer 31 invariably. The whole direction analyzer 40 receives the output of first DCT portion 11 and first quantization level SQUANT and generates second quantization level MQUANT being an optimum quantization level. The quantization level determination precess will be described in detail later. Further, since there are many similar portions between pictures, motion is estimated to calculate motion vector MV in the case of the picture having slight movement. Since the difference signal between the adjacent pictures is very small, the data is compensated using motion vector MV to further compress the data. To perform such motion compensation, second switch 32 receives the quantization coefficient data supplied from first and second quantizers 12 and 22 through corresponding contacts "d" or "e" and supplies the quantization coefficients of the corresponding quantizer to inverse quantizer 33 according to mode selection signal S M which represents the intra-mode or the inter-mode. Inverse quantizer 33 and inverse DCT portion 34 inversely quantize the input quantization coefficients, and inversely transform the inversely quantized data into the image data of the spatial domain. The image data outputted from inverse DCT portion 34 is added to the output data of the motion compensator 37 and the added data is stored in frame memory 35 for reconstructing the picture. If such a process completes with respect to one frame, frame memory 35 stores the same picture as the previously compressed and transmitted picture. This means that the stored picture is the same as the picture displayed in a reception end or during reproduction. If a next picture is inputted, motion estimator 36 looks for the block data of the pattern most similar to the input data from frame memory 35, and calculates motion vector MV which represents the movement between the two blocks. Such a motion vector MV is transmitted to the reception end for decoding, and is also transmitted to motion compensator 37. Motion compensator 37 reads out the block data corresponding to motion vector MV from the frame data in frame memory 35 and supplies the read block data to first adder 20. Then, first adder 20 calculates the differential data between input image date V IN and the block data outputted from motion compensator 37. The difference data is again encoded and transmitted to the reception end. Figure 3 shows the frequency sub-domains in the frequency domain which is obtained by a discrete cosine transform. As shown in Figure 3, the DCT domain of the block size is divided into four sub-domains according to the frequency components. Generally, in the DCT domain, the upper-left portion corresponds to the DC components. As it goes to the lower-right portions, the portion has the higher frequency components. That is, as it goes to the lower frequency portions, the energy becomes larger. In Figure 3, the most upperleft portion is called a "DC domain", and the lower frequency portion is called an "L domain". The edge portion located in the following position of the "L domain" is called an "E domain" and the other high frequency portion is called an "H domain". For determination of second quantization level MQUANT, the image is classified into four domains such as a simple domain, a complicated domain, an edge domain and a plain domain which is not included in the above three kinds of domains, in units of the macroblock. The reason is that since the simple domain and the edge domain are recognised as large in sight compared with the domain of which the boundary lines between the blocks are complicated, the quantization error is reduced int the simple domain and the edge domain and increased in the complicated domain, to thereby equalise the visual impact with respect to the quantization error in total to give the viewer the impression that the quality of picture is improved. Taking into consideration such an image characteristic, the domain determination process of the macroblock will be described below. The data in the frequency domain outputted from first DCT portion 11 is supplied to domain discrimination portion 41 of whole direction analyzer 40. Domain discrimination portion 41 divides one block of the DCT domain into the four frequency sub-domains as shown in Figure 3. Domain discrimination portion 41 sums up the absolute values of the transformation coefficient data according to the four sub-domains (DC, L, E and H), accumulates the eight blocks constituting a unit macroblock according to the respective domains and obtains a domain average value of averaging the accumulated result. Domain discrimination portion 41 determines the domain average value of the macroblock with respect to each of the four sub-domains and the domain of the macroblock by the requirements shown in the following Table I. PREREQUISITE REQUIREMENTS DOMAIN A<AVG(DC)<B AVG(E)+AVG(H)<C AND AVG(L)>D SIMPLE AVG(L)+AVG(E) > k x AVG(H) EDGE AVG(L)+AVG(E) <k x AVG(H) COMPLICATED THE ABOVE CONDITIONS ARE NOT APPLICABLE PLAIN Here, A, B, C, D and k are constant, and have values of 35, 180, 100, 10 and 3 respectively in the result of simulation. The "AVG( )" represents a domain average value of the domain corresponding to the character in the parenthesis. Thus, all the macroblocks have the energy characteristic information which is represented as one among the four domains in Table I. Quantization level determination portion 42 receives the energy characteristic information of the current macroblock which is supplied from domain discrimination portion 41, and first quantization level SQUANT of the unit slice fedback from buffer 31, to determine second quantization level MQUANT of the unit macroblock. The determination method of second quantization level MQUANT is shown in following Table II. DOMAIN INFORMATION MQUANT EFFECT SIMPLE DOMAIN SQUANT-SQUANT/2 PICTURE QUALITY UP, DATA AMOUNT UP EDGE DOMAIN SQUANT-SQUANT/4 PICTURE QUALITY UP, DATA AMOUNT UP COMPLICATED DOMAIN SQUANT+SQUANT/4 PICTURE QUALITY DOWN, DATA AMOUNT DOWN As described above, second quantization level MQUANT is varied, the quantization error is reduced in the simple domain and the edge domain, while the quantization error is made to be large in the complicated domain. Accordingly, the quality-improved image can be entirely viewed by the user. First and second quantizers 12 and 22 quantize the block transformation coefficient data supplied from corresponding first and second DCT portions 11 and 21 according to second quantization level MQUANT supplied from whole direction analyzer 40. As described above, the present invention relates to an encoding method and apparatus in which the energy characteristic of the DCT portion is used in the quantization operation. This can be contrasted with the prior art method which determines the quantization level of the unit macroblock through complicated processes in the image signal domain. The unit macroblock quantization level is simply determined using the energy characteristic in the DCT domain, to thereby facilitate hardware implementation.

Claims: An encoding apparatus which quantizes and encodes image data to transmit the encoded data, said encoding apparatus comprising: buffer means (31) which receives the encoded data to transmit the received data at a predetermined transfer rate, and generates a first quantization level which is varied so as to maintain the transfer rate invariably; transformation means (11, 21) for transforming image data of an image domain into image data of a frequency domain in block units to generate transformation coefficient data of the frequency domain; image characteristic discrimination means (41) for dividing a unit of a block of transform coefficients in the frequency domain into a plurality of frequently sub-domains according to the frequency components corresponding to the transform coefficients, summing up absolute values of the transformation coefficients of each of the sub-domains, calculating domain average values by averaging the summed values of respective sub-domains for a plurality of blocks defining a macroblock and generating energy characteristic information by selecting the domain of the macroblock as one among a simple domain, an edge domain, a complicated domain and a plain domain according to the relationship between the domain average values corresponding to the respective sub-domains; quantization level determination means (42) for receiving the energy characteristic information and the first quantization level and determining a second quantization level according to the energy characteristic information and the first quantization level to generate the determined second quantization level; and means (12, 22) for receiving the transformation coefficient data from the transformation means and quantizing the transformation coefficient data according to the second quantization level. An encoding apparatus according to Claim 1, wherein said energy characteristic information is determined as one among a simple domain, an edge domain, a complicated domain and a plain domain according to the following relationship between the domain average values corresponding to the four sub-domains: under the condition of A<AVG(DC)<B, i) if AVG(E)+AVG(H)<C and AVG(L)>D, it is defined as a "simple domain"; ii) if AVG(L)+AVG(E)>k AVG(H) and it is not the case of i), it is defined as an "edge domain"; iii) if AVG(L)+AVG(E)<k AVG(H), and it is not the case of i) nor ii), it is defined as a "complicated domain"; and iv) if it is neither of i), ii) nor iii), it is defined as a "plain domain", wherein reference characters A, B, C, D and k are preset constants, and AVG(E), AVG(H) and AVG(L) represent an edge average value, a high frequency domain average value and a low frequency domain average value, respectively. An encoding apparatus according to any preceding claim, wherein said quantization level determination means (42) receives said first quantization level and said energy characteristic information, and generates said second quantization level in which the level is reduced if said energy characteristic information represents the simple domain or the edge domain while said quantization level determination means generates said second quantization level in which the level is increased if said energy characteristic information represents the complicated domain. An encoding apparatus according to any preceding Claim, wherein said second quantization level (MQUANT) is determined as follows: if said energy characteristic information is the simple domain information, MQUANT=SQUANT-SQUANT/2; if said energy characteristic information is the edge domain information, MQUANT=SQUANT-SQUANT/4; and if said energy characteristic information is the complicated domain information, MQUANT=SQUANT+ SQUANT/4 wherein SQUANT represents said first quantization level. An encoding method which quantizes and encodes image data to transmit the encoded data through a buffer (31), the encoding method comprising the steps of: receiving the encoded data to generate a first quantization level which is varied in order to transmit the received data at a predetermined transfer rate; transforming image data in an image domain into image data in a frequency domain in block units to generate transform coefficient data in the frequency domain; dividing a unit of a block of transform coefficients in the frequency domain into a plurality of frequency sub-domains according to the frequency components corresponding to the transform coefficients, summing up the absolute values of the transformation coefficients for each of the sub-domains, calculating domain average values by averaging the summed values of each of the respective sub-domains for a plurality of blocks defining a macroblock, and generating energy characteristic information by selecting the domain of the macroblock as one of a simple domain, an edge domain, a complicated domain and a plain domain according to the relationship between the domain average values corresponding to the respective sub-domains; determining a second quantization level according to the energy characteristic information and the first quantization level; and quantizing the transformation coefficient data according to the second quantization level. An encoding method according to Claim 5, wherein said energy characteristic information is determined as one among a simple domain, an edge domain, a complicated domain and a plain domain according to the following relationship between the domain average values corresponding to the four sub-domains: under the condition of A<AVG(DC)<B, i) if AVG(E)+AVG(H)<C and AVG(L)>D, it is defined as a "simple domain"; ii) if AVG(L)+AVG(E)>k AVG(H) and it is not the case of i), it is defined as an "edge domain"; iii) if AVG(L)+AVG(E)<k AVG(H), and it is not the case of i) nor ii), it is defined as a "complicated domain"; and iv) if it is neither of i), ii) nor iii), it is defined as a "plain domain", wherein reference characters A, B, C, D and k are preset constants, and AVG(E), AVG(H) and AVG(L) represent an edge average value, a high frequency domain average value and a low frequency domain average value, respectively. An encoding method according to any one of claims 5 or 6, wherein said second quantization level determination step reduces said second quantization level it said energy characteristic information represents the simple domain or the edge domain while said quantization level determination step increases said second quantization level if said energy characteristic information represents the complicated domain. An encoding method according to Claim 7, wherein said second quantization level (MQUANT) is determined as MQUANT=SQUANT-SQUANT/2 if said energy characteristic information is the simple domain information with respect to said first quantization level (SQUANT). An encoding method according to Claim 7 or Claim 8, wherein said second quantization level (MQUANT) is determined as MQUANT=SQUANT-SQUANT/4 if said energy characteristic information is the edge domain information with respect to said first quantization level (SQUANT). An encoding method according to any one of Claims 7 to 9, wherein said second quantization level (MQUANT) is determined as MQUANT=SQUANT+SQUANT/4 if said energy characteristic information is the complicated domain information with respect to said first quantization level (SQUANT). An encoding apparatus which quantizes and encodes image data to transmit the encoded data, said encoding apparatus comprising: buffer means (31) which receives the encoded data to transmit the received data at a predetermined transfer rate, and generates a first quantization level which is varied so as to maintain the transfer rate invariably; transformation means (12,21) for transforming units image data in an image domain into image data in a frequency domain in block units to generate transform coefficient data in the frequency domain; image characteristic discrimination means (41) for dividing a unit of a block of transform coefficients in the frequency domain into a plurality of frequency sub-domains according to the frequency components corresponding to the transform coefficients, summing up the absolute values of the transformation coefficients for each of the sub-domains, calculating domain average values by averaging the summed values of each of the respective sub-domains for a plurality of blocks defining a macro block, and generating energy characteristic information by selecting the domain of the macroblock as one of a simple domain, an edge domain, a complicated domain and a plain domain according to the relationship between the domain average values corresponding to the respective sub-domains; means for varying the quantization level according to the energy characteristics whereby the transfer rate from the buffer means is maintained constant.

Inventors: JO JAE MOON, JO, JAE MOON
Applicants: SAMSUNG ELECTRONICS CO LTD, SAMSUNG ELECTRONICS CO., LTD.
Application year: 1994
Main classification: H04N7
IPC codes: H04N1, H04N7, G06T9, H03M7