Motion image data compression coding apparatus

Abstract: A motion image data compression coding apparatus and an image data compression coding method capable of smoothing compressed data among frames are disclosed. A data amount of compressed data is obtained by a hybrid coding of a combination of an orthogonal transform such as a discrete cosine transform, a quantization and a variable length coding of motion image data of one frame. A quantization step size is expressed by a product of a scaling factor f and quantization matrix factors q. The scaling factor f is determined from a code amount produced up to the preceding frame, a target code amount and an AC level of the transform factors of the present frame. Prior to the quantization and the variable length coding, a code amount actually resulted by the same coding is detected, and by considering the actual code amount, the scaling factor f for the last quantization is corrected.

Description: The present invention relates to a motion image data compression coding apparatus for compressing a data amount by successively carrying out an orthogonal transform, a quantization and a variable length coding of motion image data of one frame and an image data compression coding method for use in a motion image recording and reproducing system. Currently, recording and reproducing systems are being developed, and in these systems frame structures of motion image data for games, education or the like are coded for compressing the data amount, and the coded data are recorded onto or reproduced from a large capacity recording medium such as a CD-ROM or the like. Conventionally, as a high performance one of various coding systems for data compression, a hybrid coding system is known, and in this system, equal division of one frame of image data into blocks, an orthogonal transform such as discrete cosine transform (DCT) or the like, a quantization and a variable length coding (VLC) are applied. In detail, this hybrid coding system is disclosed in JP-A-87313850 "DCT-VQ compressed motion image data transmission system" and JP-A-90184242 "DCT compressed motion image data recording and reproducing system". In this conventional hybrid coding system, with a change of the data amount and the compression efficiency depending upon the image conditions, the data amount (produced code amount) after compression is also changed every frame. Hence, on reproducing, a relatively large capacity of buffer circuit and a complex control system for the buffering are required. In the coding, as described above, in order to reduce the buffer memory size and simplify the synchronization control in the reproducing part, it is desirable to smooth a frame of compressed data as flat as possible, and in order to realize this, a variety of methods have been proposed, for example, a frame of entire code amount is calculated, and to the direction to keep this, the step size of the quantization is dynamically varied. Such a technique is disclosed in earlier European application EP-A-0 469 648, published 05.02.92. However, even in such conventional various data smoothing methods including the dynamic change of the quantization step size, data smoothing is still insufficient and a more effective smoothing method is demanded. It is therefore an object of the present invention to provide a motion image data compression coding apparatus in view of the problems of the prior art, which is capable of smoothing a produced code amount among frames and compressed data among the frames. This object is solved with the features of the claims. The objects, features and advantages of the present invention will become more apparent from the consideration of the following detailed description, taken in conjunction with the accompanying drawings, in which: Fig. 1 is a block diagram of a motion image data compression coding apparatus according to a first embodiment of the present invention; Figs. 2A and 2B show quantization matrix factors for luminance and chrominance signals, respectively, to be used for quantization in the apparatus shown in Fig. 1; and Fig. 3 is a graphical representation of characteristics to be used for determining a scaling factor from an AC level of one frame and a target produced code amount in the apparatus shown in Fig. 1. Referring now to the drawings, wherein like reference characters designate like or corresponding parts throughout the views and thus the repeated description thereof can be omitted for brevity, there is shown in Fig. 1 a first embodiment of a motion image data compression coding apparatus according to the present invention. As shown in Fig. 1, the motion image data compression coding apparatus comprises a DCT (discrete cosine transform) part 1 coupled to an input terminal IN for motion image data to be compressed, a frame buffer memory 2, a quantization (Q) part 3 of a variable step size, a variable length coding (VLC) part 4 connected to an output terminal OUT, a produced code amount calculator 5, an AC level detector 6, a target produced code amount calculator 7, a step size set part 8, a preceding quantization part 9, a preceding variable length coding part 10, a preceding produced code amount calculator 11 and a preceding step size set part 12. In this embodiment, in the DCT part 1, the motion image data of the frame structure supplied from the input terminal IN are divided into a plurality of blocks every one frame unit and a discrete cosine transform is carried out every block to obtain transform efficient groups including AC and DC components. This discrete cosine transform is carried out in a conventional manner, as disclosed in the aforementioned JP-A-87313850 and JP-A-90184242. The transform coefficients output from the DCT part 1 are sent to the quantization part 3 through the frame buffer memory 2 and are quantized with a variable step size dynamically changed according to the produced code amount and the like. As to this quantization method, not a vector quantization method as disclosed in JP-A-87313850 but a usual scalar quantization method as disclosed in JP-A-90184242 can be used. The quantized data output from the quantization part 3 is converted into variable length codes in the variable length coding part 4, and the obtained variable length codes are output to the produced code amount calculator 5 and a recording device such as a CD-ROM via the output terminal OUT. In the produced code amount calculator 5, one frame of code amount produced by a hybrid coding of a combination of the aforementioned discrete cosine transform, the quantization of the variable step size and the variable length coding is summed with the code amount up to the present frame to calculate the produced code amount, and the calculation result is sent to the target produced code amount calculator 7. In the target produced code amount calculator 7, a target produced code amount to be produced for the following frame is calculated from the calculation result in the produced code amount calculator 5 and an instruction given from an external part and is output to the step size set part 8 and the preceding step size set part 12. In the AC level detector 6, one frame of the discrete cosine transform coefficients k(u,v) read out of the frame buffer memory 2 is input prior to the preceding quantization in the preceding quantization part 9, and a sum P of absolute values of all AC components except DC components is calculated to detect it as an AC level of its frame according to the following formula. P = ΣΣ|k(u,v)| The detected AC level is fed to the step size set part 8 and the preceding step size set part 12. In the quantization part 3, with the variable quantization step size determined by the step size set part 8, the transform coefficient read out of the frame buffer memory 2 is quantized. Now, assuming that the input to the quantization part 3 is A and the quantization step size is Qs, the output A' from the quantization part 3 is represented by the following formula. A' ≡ A / Qs In the quantization of the discrete cosine transform coefficients, as the quantization step size Qs is enlarged, the code amount (bit sum) of the compressed data after the variable length coding is reduced and the data compression rate is raised. This is the reason why the more the level of the quantization step size Qs is increased, the lower the output A' of the quantization part 3 and why the lower the level of the output A' of low appearance frequency in the following variable length coding part 4, the shorter the bit number of the code allotted. As described above, as the quantization step size Qs is enlarged, the data compression rate is increased, and on the contrary, as the quantization noise increases, the image quality of the reproduced image falls. Hence, although it is necessary to determine the quantization step size in consideration of the data compression rate and the image quality deterioration allowance, the control and smoothing of the produced code amount are further considered in the compression coding system according to the present invention. Relating to the motion image data, from the physiological characteristics of a viewer, it is known that the higher the space frequency of the AC component, the lower the image quality deterioration by quantization noise can be noticed. In this embodiment, the quantization step size Qs is determined by attention to the abovedescribed visual characteristics so as to be a large value as the space frequency of the AC component becomes higher. Hence, the quantization step size Qs is disintegrated into a quantization matrix factor q which depends on the order of a space harmonic and a quantization scaling factor f, as represented by the following formula Qs ≡ q · f/k wherein k is constant. First, the quantization matrix factor q depends on only the order (u,v) of the space harmonic and is determined to a fixed value which increases as the order (u,v) of the space harmonic increases, as shown in Figs. 2A and 2B. For example, as shown in Fig. 2A, a quantization matrix factor q for a luminance signal (Y) is determined to a relatively small value, and as shown in Fig. 2B, another quantization matrix factor q for a chrominance signal (R-Y,B-Y) of which image quality deterioration is inconspicuous is determined to a relatively large value. The dynamic control of the quantization step size Qs is practiced by the dynamic control of the quantization scaling factor f in the produced code amount calculator 5. Next, as shown in Fig. 3, the quantization scaling factor f is determined to a value which not only decreases at a certain AC level as the target produced code amount increases but also increases at a certain target produced code amount as the AC level of the discrete cosine transform coefficient increases. This is the reason why with the increase of the AC level, the amount of the data to be quantized increases, and the increase of the bit amount of the compressed data after the variable length coding is repressed to smooth the same. As described above, by determining the quantization step size Qs which increases with the increase of the AC level, even when the motion image pattern becomes fine to increase the AC level, the total bit amount of the compressed image data after the variable length coding can be maintained at an almost predetermined value. In the target produced code amount calculator 7, on the basis of the calculation result of the produced code amount calculator 5 and the instruction fed from the external ( portion, the target produced code amount to be produced for the next one frame is calculated as follows. From the input terminal IN, a total number F0 of the frames are supplied to the DCT part 1 at a fixed frame rate, for example, 30 frames/second. The required time for the data compression by the hybrid coding, that is, the total required time for the recording or reproducing becomes F0/30 seconds. Further, it is considered that a part of the input frames to be recorded is removed at a predetermined thinning rate to exclude from the compression object in the DCT part 1 and thus a frame rate and a bit rate of the compressed image data output from the output terminal OUT are Fr and Br, respectively. Hence, a total number F1 and a total bit amount Bt of the frames after the data compression by the coding are expressed by the respective following formulas. F1 = Fr(F0/30) Bt = Br(F0/30) At the same time of the coding start for the data, the calculations of the total number Fl of the coded frames and the total bit amount Bt produced by the coding are started, and it is considered that these two reach F2 and Bc, respectively, at the point the compression of a certain frame is finished, a remaining frame number F3 and a remaining produced allowable bit amount Bn of the compression object being obtained by the following formulas. F3 = F1 - F2 Bn = Bt - Bc When an allowable value of the bit amount produced by the compression of the next one frame is defined as a target produced code amount Bm, the target produced code amount Bm is obtained by the following formula. Bm = Bn/F3 The calculation of the target produced code amount Bm is performed on the basis of the total bit amount Bc calculated in the produced code amount calculator 5, the frame rate instructed from the external portion, the bit rate and the aforementioned formulas. As described above, with the quantization step size Qs set up by the step size set part 8, the quantization is executed in the quantization part 3 and then the variable length coding takes place in the variable length coding part 4. However, due to the incompleteness of the characteristics shown in Fig. 3 and the like, the actual produced code amount is shifted from the target value and variation of the produced code amounts among the frames can be caused. In this embodiment, in order to avoid the produced code amount variation among the frames, prior to the final coding by the step size set part 8, the quantization part 3 and the variable length coding part 4, a preceding coding by the preceding step size set part 12, the preceding quantization part 9 and the preceding variable length coding part 10 is carried out. In this preceding coding, the step size is determined by the preceding step size set part 12 on the basis of the detected value obtained in the AC level detector 6 and the resulting calculated value from the target produced code amount calculator 7. The code amount actually produced by the preceding coding is calculated in the preceding produced code amount calculator 11, and the calculation result is fed to the step size set part 8. In the step size set part 8, the step size determined by the detected value obtained in the AC level detector 6 and the calculation value obtained in the target produced code amount calculator 7, that is, the step size set up in the preceding quantization is corrected on the basis of an error E between the calculation value in the preceding produced code amount calculator 11 and the target produced code amount, and the corrected step size is set up in the quantization part 3. One example of this correction method will be described as follows. That is, as exemplified in Fig. 3, from an intersection (a white circle mark in Fig. 3) between a detected value of an AC level and a target produced code amount, 5 as a scaling factor f is set, and then a preceding quantization and a preceding variable length coding are carried out by the preceding quantization part 9 and the preceding variable length coding part 10, respectively, to obtain an error E (as shown by a dark circle mark) of which the calculation value in the preceding produced code amount calculator 11 exceeds the target value. Such an error occurrence is deemed to be attributed to the weakness of the relationship between the AC level and the scaling factor f, and the detected value of the AC level is adjusted to a value (adjusting value) imparting an intersection (a triangular mark) between a characteristic curve of scaling factor 5 and the calculated value. Accordingly, scaling factor 6 nearest to an intersection (a rectangular mark) between the adjusting value and the target produced code amount is determined on the final quantization. In this embodiment, as described above, the two systems of the quantization part and the variable length coding part for the final and preceding codings, are provided, and the final coding for the present frame and the preceding coding for the following frame are simultaneously processed to enable shortening of the processing time. However, in case that a hardware scale reduction is preferential to the processing time reduction, the quantization part, the variable length coding part and the like can be used in common for the final and preceding codings by a time-sharing operation in multiple. In this embodiment, as described above, the produced code amounts among the frames can be smoothed and hence cost reduction of a reproducing part side can be possible.

Claims: A motion image data compression coding apparatus, comprising: orthogonal transform means (1) for carrying out an orthogonal transform of motion image data of a frame structure to obtain transform coefficients; quantization means (3) for quantizing the transform coefficients sent from the orthogonal transform means (1) through a buffer memory (2) with a variable quantization step size to obtain quantized data; variable length coding means (4) for carrying out a variable length coding of the quantized data to output compressed coded data to an output terminal; code amount calculator means (5) for calculating a code amount of the compressed coded data produced every frame; preceding quantization means (9) for quantizing the transform coefficients of one frame read out of the buffer memory (2) with a second variable quantization step size to obtain second quantized data prior to the quantization of the quantization means (3) and the variable length coding of the variable length coding means; preceding variable length coding means (10) for carrying out a second variable length coding of the second quantized data to output second compressed coded data; preceding code amount calculator means (11) for calculating a second code amount of the second compressed coded data produced every frame; AC level detector means (6) for detecting an AC level reflecting an amplitude size of AC components of the transform coefficients every one frame; target code amount calculator means (7) for calculating a target code amount as a target value of a code amount of a next frame on the basis of the code amount calculated by the code amount calculator means (5) and an instruction input from an external part; preceding step size set means (12) for calculating a scaling factor from the calculated value of the target code amount calculator means (7) and the detected value of the AC level detector means (6), calculating a second quantization step size from a product of the scaling factor and quantization matrix factors set for the AC components of the transform coefficients and setting the second quantization step size to the preceding quantization means (9); and step size set means (8) for calculating a quantization step size from the calculated value of the target code amount calculator means (7), the detected value of the AC level detector means (6) and the calculated value of the preceding code amount calculator means (11) and setting the quantization step size to the quantization means (3), whereby the detected value of the AC level is adjusted to correct the error (E) between the calculated value of the preceding code amount and the calculated value of the target code amount, and the quantization step size is calculated on the basis of the adjusted AC level and the calculated value of the target code amount. The apparatus as claimed in claim 1, wherein the AC level detector means (6) detects a sum of absolute values of levels of the AC components of the transform coefficients as the AC level.

Inventors: KUNIHIRO HIDETO, KUNIHIRO, HIDETO, KUNIHIRO, HIDETO, C/O NEC HOME ELECTRONICS, LTD.
Applicants: NIPPON ELECTRIC CO, NEC CORPORATION
Application year: 1992
Main classification: H04N7
IPC codes: H04N7