Moving picture coding apparatus/method with output buffer memory control

Abstract: A coding apparatus for coding a video signal by way of total data amount control. The video signal is coded by high efficient predictive coding to produce first encoded data. A data amount of the first encoded data is counted and converted to a target data amount within a reference data amount. In response to the target data amount, quantization is controlled in the high efficient predictive coding. The coding is again carried out to produce second encoded data under quantization control. The quantization is corrected in the high efficient predictive coding in response to the target data amount and a data amount of the second encoded data. The second encoded data is outputted at a specific data transfer rate.

Description: BACKGROUND OF THE INVENTION The present invention relates to a moving picture coding apparatus with total data amount control. There is a conventional moving picture coding apparatus with total data amount control, EP-A-0 689 360. The conventional apparatus carries out twice coding operations in the total data amount control. High-efficiency encoded data of a data amount suitable for storage capacity of a storage medium to store the encoded data is output from the coding apparatus at a variable rate. In the first coding operation, the encoded data amount of a video signal is checked to decide a target data transfer rate and a target data amount with respect to the storage medium. In the second coding operation, the video signal is again encoded by a quantization scale corrected based on the target data amount. The encoded data whose amount is changed in accordance with the target amount is stored into a buffer memory. The stored encoded data is outputted from the buffer memory at the target transfer rate. The conventional apparatus, however, does not check the encoded data amount in the second coding operation. Therefore, the conventional apparatus has a disadvantage in that the encoded data amount outputted from the buffer memory, in the second coding operation, is not necessarily suitable for the storage capacity of the storage medium. Further, the picture quality of the video signal to be reproduced from the storage medium depends on the data sufficiency of the buffer memory. SUMMARY OF THE INVENTION An object of the present invention is to provide a moving picture coding apparatus with total data amount control in that the encoded data amount outputted therefrom, in the second coding operation, is always suitable for the storage capacity of a storage medium to store the encoded data. The present invention provides the apparatus defined in claim 1 for coding a video signal. Preferred embodiments of the apparatus according to the invention are defined in dependent claims 2 to 6. The present invention further provides the method defined in claim 7 for coding a video signal. Preferred embodiments of the method according to the invention are defined in dependent claims 8 to 13. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 shows a block diagram of a preferred embodiment of the moving picture coding apparatus with total data amount control according to the present invention; Fig. 2 shows a data format of a video signal to be coded by the coding apparatus of Fig. 1; Fig. 3 shows a block diagram of a temporal data amount counter and a temporal data amount memory of the coding apparatus of Fig. 1; Fig. 4 shows a block diagram of a data amount converter of the coding apparatus of Fig. 1; Fig. 5 depicts the target data amount change characteristics of a data amount converter of the coding apparatus of Fig. 1; Fig. 6 depicts a curve representing the relation-ship between buffer sufficiency (occupancy) and quantization scale (the number of quantized bits); Fig. 7 shows a block diagram of a data amount comparator of the coding apparatus of Fig. 1; Fig. 8 is a schematic illustration for explaining encoded data amount change; Fig. 9 shows a block diagram of a decoding apparatus used for decoding the video signal coded by the coding apparatus of Fig. 1 in order to explain a decoder buffer simulator of the coding apparatus; Fig. 10 depicts a curve representing data sufficiency (occupancy) characteristics of the decoder buffer memory of the decoding apparatus; and Fig. 11 is a flowchart explaining a target data amount resetter of the coding apparatus of Fig. 1. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A preferred embodiment of a moving picture coding apparatus with total data amount control according to the present invention will be described with reference to attached figures. In Fig. 1, firstly, switches 11 and 18 are switched to a terminal b and a switch 26 is turned off in the first coding operation. A video signal is supplied from a video signal source 1 to a predictive subtractor 2 and an activity detector 5. Based on the distribution of pixel values, absolute value addition of predictive error values or absolute value addition of orthogonal transform coefficients, the activity detector 5 detects the activity of video data per block of each of sequential blocks (e.g., 8 x 8 pixels) of the video signal; and generates a signal for a quantization scale (determining the number of quantized bits) decided by a quantization controller 6. Figure 2 shows that a picture consists of sequential blocks and a group of pictures (GOP) consists of a plurality of pictures. The quantization scale signal is supplied from the activity detector 5 to the quantization controller 6. Also supplied to the quantization controller 6 is a signal for a predetermined quantization scale from a reference quantization setter 17 via switch 18. The quantization controller 6 sets the quantization scale of a quantizer 4 to a small value with a video signal of low activity, but to a large value with a high activity video signal. On the other hand, the video signal is supplied from the video signal source 1 to the predictive subtractor 2. The predictive substractor 2 subtracts an output signal of a predictor 10 from the video signal to produce a predictive error signal. The predictive error signal is supplied to an orthogonal transformer 3 to produce orthogonal transform coefficients. The orthogonal transform coefficients are supplied to the quantizer 4 and are quantized with the quantization scale set by the quantization controller 6. The quantized data is supplied to an encoder 7 and a local decoder 8. The local decoder 8 decodes the quantized data to reproduce the predictive error signal by inverse quantization and inverse orthogonal transformation. The reproduced predictive error signal is supplied to an adder 9. The adder 9 adds the reproduced predictive error signal and a (inter-picture) predictive signal supplied from the (inter-picture) predictor 10. An output signal of the adder 9 is supplied to the predictor 10. The predictor 10 generates the predictive signal by motion compensation with one picture delay. The predictive signal is supplied to the predictive subtractor 2 and adder 9. The encoder 7 encodes the quantized data supplied from the quantizer 4 by variable length-coding to output compressed encoded data of sequential blocks that are supplied to the switch 11. Since the switch 11 has been switched to the terminal b , the compressed encoded data are supplied to a temporal data amount counter 19 via switch 11. Temporal data amount values are stored into a temporal data amount memory 20, and read therefrom and again supplied to the temporal data amount counter 19 via transmission lines 39 to 43. The temporal data amount counter 19 and the temporal data amount memory 20 will be described with reference to Fig. 3. In Fig. 3, the temporal data amount counter 19 consists of a block data amount counter 30, a picture data amount counter 31, and a GOP data amount counter 32. The temporal data amount memory 20 consists of a temporal block data amount memory 36, a temporal picture data amount memory 37, and a temporal GOP data amount memory 38. In Fig. 3, the encoded data of sequential blocks are supplied from the encoder 7 to the block data amount counter 30 via input terminal 29. The encoded data amounts are sequentially counted by the block data amount counter 30 to obtain a block data amount value. Whenever one block data amount is counted, one block data amount value is stored into the temporal block data amount memory 36 via transmission line 39. Each block data amount value stored in the temporal block data amount memory 36 is read therefrom and supplied to the picture data amount counter 31 via transmission line 40. The block data amounts are sequentially counted by the picture data amount counter 31 to obtain a picture data amount value. Whenever one picture data amount is counted, one picture amount value is stored into the temporal picture data amount memory 37 via transmission line 41. Each picture data amount value stored in the temporal picture data amount memory 37 is read therefrom and supplied to the GOP data amount counter 32 via transmission line 42. The picture data amounts are sequentially counted by the GOP data amount counter 32. Whenever one GOP data amount is detected, one GOP data amount value is stored into the temporal GOP data amount memory 38 via transmission line 43. The data amount values of the block, picture, and GOP data stored in the temporal data amount memories 36, 37, and 38, respectively, are read therefrom in the second coding operation of the video signal supplied from the video signal source 1. In Fig. 3, the temporal data amount counter 19 counts the data amounts of three stages of encoded data, that is, block, picture, and GOP, separately. Further, the temporal data amount memory 20 stores amount values of encoded data of block, picture, and GOP, separately. Not limited only to this, the counter 19 and memory 20 can be designed to process encoded data of block, macroblock, slice, picture, and GOP, separately. These five stages of encoded data can be arranged in accordance with ISO 11172-2 (Moving Picture international Standard). In general, N stages of encoded data can be separately counted to determine their amounts and stored by respective values temporally for double coding operations. In the first coding operation, the temporal data amount values of the GOP data are sequentially supplied from the temporal data amount counter 19 to a data amount converter 13 via transmission line 43. The amount value of each of sequential GOP data is converted to a target amount value by the data amount converter 13 in accordance with data amount conversion characteristics. The data amount converter 13 will be described in detail with reference to Fig. 4. The data amount converter 13 is provided with 9 number N of converters 61, 62, 63, ..., and Na, accumulators 65, 66, 67, ..., and Nb, and comparators 69, 70, 71, ..., and Nc. The data amount converter 13 is further provided with a total target data amount setter 60 and a determiner 73. Used as the total target data amount is the total storage capacity of a storage medium that stores encoded data obtained by efficiently-coding a video signal. Here, the temporal data amount value of each of the GOP data sequentially supplied from the temporal data amount counter 19 is expressed as T1(i) and the target data amount value to be obtained by converting the temporal data amount value T1(i) by the data amount converter 13 in accordance with the code amount conversion characteristics fg is expressed as T2(i). The sign "i" means the i th GOP data. The relationship among the temporal data amount value T1(i), the target data amount value T2(i), and conversion characteristics fg is expressed as follows: T2(i) = fg {T1(i)} where the upper limit of the target data amount value T2(i) depends on the capacity of a storage medium that stores encoded data or specifications of a decoding apparatus. The conversion characteristics fg is shown in Fig. 5 and expressed as follows: fg(x) = k · S2/S1 · x where S1 is the total temporal data amount, S2 is the target data amount in the second coding operation, and K is a constant larger than zero. In Fig. 5, curves fg1, fg2, fg3, ..., and fgN depict the conversion characteristics fg of the converters 61, 62, 63, ..., and Na, respectively. Instead of the expression (2), the characteristics fg can be expressed as follows: fg (x) = a · x^b where "^" means powers, a is a constant larger than zero, and b is another constant larger than zero but smaller than one. The characteristics fg expressed by the expression (3) is useful when a small amount of GOP data is to be converted to a large amount to avoid picture quality deterioration. In Fig. 4, the temporal data amount values of the GOP data are sequentially supplied from the temporal data amount counter 19 to the data amount converter 13 via input terminal 58. The same GOP data amount value is supplied to the converters 61, 62, 63, ..., and Na with different conversion characteristics fg as shown in Fig. 5. The number N of different amount values obtained from the converters 61, 62, 63, ..., and Na are supplied to the accumulators 65, 66, 67, ..., and Nb, respectively. Each accumulator accumulates sequential data amount values to obtain a total amount value of the encoded data of the video signal supplied from the video signal source 1. The number N of accumulated data amount values are supplied to the comparators 69, 70, 71, ..., Nc, respectively, and compared with the same target total data amount supplied from the target total data amount setter 60. The number N of comparison results are supplied from the comparators 69, 70, 71, ..., Nc to the determiner 73. The determiner 73 detects the conversion characteristics fg among the different ones shown in Fig. 5 by which the largest data amount value is produced within the target total data amount; and determines the data transfer rate that corresponds to the largest data amount value. The data transfer rate signal is supplied to a target transfer rate setter 15 shown in Fig. 1. In Fig. 1, next, the switches 11 and 18 are switched to a terminal a and the switch 26 is turned on in the second coding operation. The video signal is supplied again from the video signal source 1 to the predictive subtractor 2 and the activity detector 5. The activity detector 5 detects the activity of video data of each of sequential blocks (e.g., 8 x 8 pixels) of the video signal; and generates a signal for a quantization scale that is supplied to the quantization controller 6. Also supplied to the quantization controller 6 is a signal for another quantization scale per initial block of each picture from a quantization scale setter 25 via switch 18. In a period where the quantization scale setter 25 does not supply the signal to the quantization controller 6, a different quantization scale control signal is supplied to the quantization controller 6 from a data amount comparator 24 via switch 26. The quantized data outputted from the quantizer 4 is again supplied to the encoder 7 and also to the local decoder 8 for the predictive operation in the second coding operation the same as in the first coding operation. However, in the second operation, encoded data outputted from the encoder 7 are sequentially supplied to a data amount counter 12 via switch 11. A data amount value as counted by the data amount counter 12 is supplied to a subtractor 85. Also supplied to the subtractor 85 is a target data amount value from a target data amount memory 23. The encoded data outputted from the encoder 7 are also sequentially supplied to a buffer memory 16 under the control of the output buffer controller 80. A data signal representative of buffer occupancy stored in the buffer memory 16 is read out therefrom and supplied to the output buffer controller 80. In response to the buffer occupancy, the output buffer controller 80 generates a data transfer rate signal per unit of time that is supplied to the buffer memory 16. The data signal representative of buffer occupancy may be expressed as a difference between write and read addresses of the buffer memory 16. The encoded data stored in the buffer memory 16 is read out therefrom in accordance with the data transfer rate signal and outputted via output terminal 28. The transfer rate of each output encoded data thus depends on the data transfer rate information supplied by the output buffer controller 80. When the buffer occupancy is zero, the buffer memory 16 is controlled by the output buffer controller 80 so as not to output encoded data. The maximum data transfer rate of the encoded data read out from the buffer memory 16 is set equal to the maximum transfer rate of a decoding apparatus that is connected to the output terminal 28. The transfer rate signal supplied from the output buffer controller 80 to the buffer memory 80 in response to the data signal representative of buffer occupancy is determined by the relationship between the buffer sufficiency (occupancy) and quantization scale of the buffer memory 16 as shown in Fig. 6. The data amount values outputted from the data amount counter 12 are further sequentially supplied to the data amount comparator 24 in the second coding operation. The data amount comparator 24 will be described in detail with respect to Fig. 7. In Fig. 7, a data amount value is supplied from the data amount counter 12 to a block data detector 21 via input terminal 47. Further, a target block amount signal is supplied from a accumulation error compensator 84 to a subtractor 54 via input terminal 49. In response to the data amount value, the block data detector 21 detects a block data amount per block to generate a block data amount signal. The block data amount signal is supplied to the subtractor 54. The subtractor 54 subtracts the block data amount signal from the target block data amount signal to generate a difference block data amount signal. The difference block data amount signal is supplied to comparators 55 and 56 to which a positive and a negative reference value signal is supplied from reference value setters 51 and 50, respectively. The comparator 55 supplies a first comparison signal to a determiner 57 when the difference block data amount signal is positive and larger than the positive reference value signal supplied from reference value setter 51. On the other hand, the comparator 56 supplies a second comparison signal to the determiner 57 when the difference block amount signal is negative and smaller than the negative reference value signal supplied from reference value setter 50. The difference block data amount signal supplied from the subtractor 54 is positive (negative) when the target block data amount signal is larger (smaller) than the generated block data amount signal. Both the comparators 55 and 56 supply a third comparison signal to the determiner 57 when the difference block data amount signal is in the range defined by the positive and negative reference value signals, that is, the absolute value of the difference block data amount signal is smaller than a predetermined difference set by the setters 50 and 51. The determiner 57 supplies a quantization scale control signal per block to the quantization controller 6 via output terminal 48 and switch 26 to reduce the quantization scale of the quantization controller 6 in response to the first comparison signal but to increase it in response to the second comparison signal. On the other hand, the determiner 57 does not change the quantization scale of the quantization controller 6 in response to the third comparison signal. In Fig. 1, the quantization scale setter 25 supplies the quantization scale control signal only for quantization scale setting in the initial block of each picture to the quantization controller 6 via switch 18 in the second coding operation. This quantization scale control signal is used to change the total data amount of the video signal to be coded to the largest amount defined by T2 but less than a total target data amount. The total target data amount corresponds, for example, to the total storage capacity of a storage medium that is used to store the video signal. More in detail, the quantization scale control signal for quantization scale setting in the initial block of each picture is generated based on two signals. The first signal is the reference quantization scale signal supplied from the reference quantization scale setter 17 to the quantization controller 6 via switch 18 in the first coding operation. The second signal is a picture data amount signal supplied from the accumulation error compensator 84 to the quantization scale setter 25. The second signal is generated based on signals supplied from the target data amount memory 23 and a target data amount resetter 83. The signal supplied from the target data amount memory 23 is obtained based on the data amount from a target data amount converter 22 that converts the data amount values per block and picture to target amount values. As described in the first coding operation, the data amount values obtained by the temporal data amount counter 19 have been stored in the temporal data amount memory 20 and supplied to the data amount converter 13. The data amount values are of each block data, each picture data, and each GOP data of the video signal. These data amount values are used for determining the data amount conversion characteristics to convert the total data amount of the video signal to the largest amount but less than the total target amount. As described above, the total target amount corresponds to the storage capacity of the storage medium to store the video signal. More in detail, the temporal data amount value T1(i) of each of the sequential GOPs obtained in the first coding operation is supplied to the data amount converter 13. The data amount converter 13 determines the data amount conversion characteristics fg to convert the total data amount value of the video signal to the largest amount value T2 but less than the total target amount. The target data amount value T2(i) of each of the sequential GOPs is supplied from the data amount converter 13 and stored into the target transfer rate setter 15. Here, "i" of T1(i) and T2(i) is a numeral 1 to n that denotes the order of the sequential GOPs. On the other hand, in the second coding operation, a data amount value converted from the temporal data amount value T1(i) to the target data amount value T2(i) by an appropriate data amount conversion characteristic fg is stored in the target transfer rate setter 15. Further, the temporal data amount values of each of sequential blocks, pictures, and GOPs are stored in the temporal data amount memory 20. Here, the appropriate data amount conversion characteristic fg is obtained as follows by the relationship (2) described before: fg(x) = T2(i)/T1(i) · x In the second coding operation, the data amount values of blocks, pictures, and GOPs are supplied from the temporal data amount memory 20 to the target data amount converter 22 via transfer lines 44 to 46. To the target data amount converter 22, the target data amount values T2(i) of sequential GOPs stored in the target transfer rate setter 15 and the data amount signal from the accumulation error compensator 84 have already been supplied. The target data amount converter 22 converts the temporal amount values of encoded data of each of sequential blocks and pictures to the target amount values corrected by the data amounts actually generated in the second coding operation. The corrected target amount values of block and picture data are supplied to the target data amount memory 23. The corrected target amount values are selectively supplied to the target data code amount resetter 83 and the accumulation error compensator 84, and the subtractor 85. In other words, the target data amount converter 22 converts the data amount values of the sequential blocks and pictures to the specific target data amount values under the relationship T2/T1. Here, T1(i) corresponds to the temporal data amount value of GOP, and T2(i) to the target data amount value corrected by the output signal of the accumulation error compensator 84. The target data amount converter 22 will further be described with reference to Fig. 8. In the figure, Tp1(0), Tp1(1), ..., and Tp1(n) denote the temporal data amount values of sequential pictures, and Tp2(0), Tp2(1), ..., and Tp2(n) the target data amount values of the sequential pictures. Suppose that the temporal amount value T1(i) of a GOP is converted to the target code amount value T2(i), that is data amount conversion is made by the conversion characteristics expressed by fg(x) = T2(i)/T1(i) when the temporal data amount values of a plurality of pictures that consists of the GOP are Tp1(0), Tp1(1), ..., and Tp1(n). In this case, the temporal data amount values Tp1(0), Tp1(1), ..., and Tp1(n) are also converted to the target data amount values Tp2(0), Tp2(1), ..., and Tp2(n), respectively, by the conversion characteristics expressed by fg(x) = T2(i)/Tl(i). Further, in Fig. 8, Tb1(0), Tb1(1), ..., and Tb1(n) denote the temporal data amount values of sequential blocks stored in the temporal data amount memory 20 and Tb2(0), Tb2(1), ..., and Tb2(n) the target data amount values of the sequential blocks corrected by the output signal of the accumulation error compensator 84. Suppose that the temporal data amount value of a picture is Tp(i) is converted to the target code amount value Tp(i), that is data amount value conversion is made by the conversion characteristics expressed by fg(x) = Tp2(i)/Tp1(i) · x = T2(i)/T1(i) · x when the temporal code amount values of a plurality of blocks that consists of the picture are Tb1(0), Tb1(1), ..., and Tb1(n). In this case, the temporal data amount values Tb1(0), Tb1(1), ..., and Tb1(n) are also converted to the target data amount values Tb2(0), Tb2(1), ..., and Tb2(n), respectively, by the conversion characteristics expressed by fg(x) = Tp2(i)/Tp1(i) · x = T2(i)/T1(i) · x. Figure 8 shows that the ratio of the corrected temporal data amount value and the corrected target data amount value in the upper stage (GOP) of encoded data is applied to the lower stage (picture) of encoded data for proportional distribution. However, not only limited to this, weighting can be done in accordance with the above described expression (3), that is, fg(x) = a · x^b. The output data of the target data amount converter 22 are supplied to the target data amount memory 23. Here, the output data are the corrected target data amount values of the sequential blocks and pictures. The output data are supplied to the target data amount resetter 83, the accumulation error compensator 84, and the subtractor 85. As described above, in the second coding operation, the sequential encoded data outputted from the encoder 7 are supplied to the buffer memory 16 via switch 11 under the control of the output buffer controller 80. The data amount values of the output data are supplied to the data amount comparator 24 and the subtractor 85 via data amount counter 12. The encoded data stored in the buffer memory 16 are sequentially read therefrom at the transfer rate based on the transfer rate signal given by the output buffer controller 80 and outputted via output terminal 28 at variable transfer rate. The output encoded data are stored into a storage medium or transferred via transmission line to a receiving apparatus. A reproducing apparatus for reproducing the recorded data from a storage medium is provided with a decoder that decodes the data high efficiently encoded as described above. A receiving apparats for receiving the high-efficiency encoded data is also provided with such a decoder. Such a decoder works only when the encoded data amount is suitable for the decoding capability of the decoder. For this reason, the moving picture coding apparatus with total data amount control according to the present invention is provided a decoder buffer simulator 81 as shown in Fig. 1. The decoder buffer simulator 81 controls the amount of the encoded data outputted via output terminal 28 so that data overflow or underflow will not arise in a buffer memory in the decoding apparatus. The decoder buffer simulator 81 will be described with reference to Fig. 9. Figure 9 shows a decoding apparatus for decoding the high efficiently encoded data by the coding apparatus of Fig. 1. The decoding apparatus is provided with a pickup 78 that reads the high efficiently encoded data stored on a storage medium 75. The decoding apparatus is also provided with a decoder buffer memory 76 and a decoder 77. The encoded data read out from the storage medium 75 by the pickup 78 is once stored in the decoder buffer memory 76 and then decoded by the decoder 77. Figure 10 depicts variation of data sufficiency (occupancy) of the decoder buffer memory 76 when the high-efficiency encoded data of one picture is supplied to the decoding apparatus of Fig. 9 from the coding apparatus of Fig. 1. In Fig. 10, supply of the high efficiently encoded data to the decoder buffer memory 76 just starts at a time t1. The transfer rate of the high efficiently encoded data to the decoder buffer memory 76 is within the highest transfer rate of the decoding apparatus. The decoder 77 initiates decoding operation at a time t2 where data occupancy of the decoder buffer memory 76 reaches a predetermined level. At the time t2, the encoded data of one picture is supplied from the decoder buffer memory 76 to the decoder 77. The decoder buffer memory 76 continues to store the high efficiency encoded data from the storage medium 75 via pickup 78 until the data occupancy reaches 100 %. The encoded data amount values corresponding to the data occupancy of the decoder buffer memory 76 and to the decoder 77 are predetermined by the decoder buffer simulator 81 of the coding apparatus shown in Fig. 1. The decoder buffer simulator 81 supplies a decoder buffer sufficiency (occupancy) signal to the target data amount resetter 83 so that the data overflow or underflow will not arise in the decoder buffer memory 76 of Fig. 9. The decoder buffer sufficiency signal is supplied based on the data occupancy of the buffer memory 16 and the output transfer rate of the coding apparatus of Fig. 1 and the data occupancy of the decoder buffer memory 76 of the decoding apparatus of Fig. 9. In response to the data sufficiency signal from the decoder buffer simulator 81 and the target amount value from the target data amount memory 23, the target data amount resetter 83 generates a reset target data amount signal. The resetting target data amount signal is used such that data overflow or underflow will not arise in the decoder buffer memory 76 of Fig. 9. The target data amount resetter 83 of Fig. 1 will be described with respect to Fig. 11. In step S1, a check is made whether the data sufficiency (occupancy) of the decoder buffer memory 76 of Fig. 9 reaches 100 % (full). If so (Yes), the process goes to step S2, if not (No), step S3. In step S2, check is made whether the target picture data amount of the decoder buffer memory 76 represented by the value supplied from the target data amount memory 23 of Fig. 1 is smaller than a storage capacity of the decoder buffer memory 76. If so, the process goes to step S6 where the target picture data amount signal is supplied to the accumulation error compensator 84 of Fig. 1. If not so in step S2, the process goes to step S4 where the (converted) target picture data amount value is corrected to a corrected target picture data amount value suitable to the storage capacity of the decoder buffer memory 76. Then the process goes to step S6 where the corrected target picture data amount value is supplied to the accumulation error compensator 84. On the other hand, if the process goes to step S3 from step S1, a check is made whether the target picture data amount value is smaller than the data capacity (indicated as sufficiency) of the decoder buffer memory 76. If so, the process goes to step S6. If not so, the process goes to step S5 where the target picture data amount value is corrected to an amount value corresponding to the data capacity of the decoder buffer memory 76. In Fig. 1, the output of the subtractor 85 is sequentially supplied to an accumulation error counter 82. The sequential outputs are data amount errors ER and each error ER is the difference between a target data amount value from the target code amount memory 23 a the data amount value from the data amount counter 12. The accumulation error counter 82 accumulates the data amount errors ER per picture and supplies the accumulated error ERa per picture to the accumulation error compensator 84. The accumulation error compensator 84 corrects the reset target picture data amount signal from the target data amount resetter 83 by means of the accumulated error ERa. The corrected reset target picture data amount signal is supplied to the quantization scale setter 25, the data amount compensator 24, and the target data amount converter 22. The accumulation error correction of the accumulation error compensator 84 is executed such that the accumulated error ERα is distributed to pictures of a GOP after the period where the accumulated error ERα is obtained. When a number K of pictures exist after the time when the accumulated error ERα is obtained, the corrected target picture data amount value can be obtained by adding the target picture data amount value and the data amount value expressed by the following expression (4) or (5): ERα/K Here, is the total of the target picture data amount values of j pictures to be coded and stored in the target data amount memory 23. The sign "j" represents the number of sequential pictures. The corrected target picture data amount signal thus obtained above is supplied to the quantization scale setter 25, the data amount compensator 24, and the target data amount converter 22. According to the moving picture coding apparatus with total data amount control, the encoded data amount is checked again in the second coding operation to correct the target data amount value. Therefore, the encoded data amount outputted from the buffer memory, in the second coding operation, is always suitable for the storage capacity of a storage medium that stores the encoded data. Further, a high picture quality video signal is always obtained when reproducing from the storage medium. This is due to the decoder buffer simulator that resets the target data amount value of the encoded data in consideration of the data capacity of the storage medium.

Claims: An apparatus for coding a video signal comprising: coding means (2-4, 7, 8-10) for coding the video signal a first time by high efficient predictive coding to produce first encoded data; first counting (19) means for counting a data amount of the first encoded data and providing a respective data amount value (T1); first converting means (13) for converting the data amount value of the first encoded data to a target data amount value (T2) within range limited by a reference data amount value; control means (6), responsive to the target data amount value, for controlling quantization in the high efficient predictive coding by the coding means, the coding means under the control of the control means, coding a second time the same video signal to produce second encoded data; second counting means (12) for counting a data amount of the second encoded data and providing a respective data amount value; correcting means (22-23, 82-85) for correcting the target data amount value used in controlling the quantization in the high efficient predictive coding of the second time in response to the target data amount value of the first encoded data and said data amount value of the second encoded data; and output means (16, 80) for outputting the second encoded data at a specific data transfer rate. The apparatus according to claim 1, wherein the first encoded data includes a plurality of sequential data groups (GOPs), each data group having a plurality of sequential picture data, and each picture data having a plurality of sequential block data, the first counting means (19) comprising: means (30) for counting the data amount of each of the sequential block data to output sequential block data amount values; means (31), responsive to the sequential block data amount values, for counting the data amount of each of the sequential picture data to output sequential picture data amount values; and means (32), responsive to the sequential picture data amount values, for counting the data amount of each of the sequential data groups to output sequential data group amount values. The apparatus according to claim 1, wherein the first converting means (13) comprises: means (61, 62, ...Na) for converting the data amount value of the first encoded data to a plurality of different data amount values by means of a plurality of different data amount conversion characteristics (fg1... fgN); and means for comparing the different data amount values with the reference data amount value to find a maximum data amount value among the different data amount values within the range set by the reference data amount value, the maximum data amount value being outputted as said target data amount value (T2). The apparatus according to claim 1, wherein the correcting means comprises: subtracting means (85) for subtracting the target data amount value of the first encoded data from the data amount value of the second encoded data to produce a data amount error; second converting (22) means for converting the target data amount value of the first encoded data based on the data amount error to produce a converted target data amount value; comparing means (24) for comparing the data amount value of the second encoded data and the converted target data amount value corrected by said correcting means of the first encoded data to produce a first signal for controlling the quantization scale of the coding means at said second time of coding; and setting means (25) for setting the quantization scale in response to the converted target data amount value corrected by said correcting means to produce a second signal for controlling the quantization scale, wherein means (18, 26) are provided to supply either one of the first and second signals to the control means (6) to control the quantization in the high efficient predictive coding by the coding means. The apparatus according to claim 4, further comprising means (81, 83, 84), responsive to the second encoded data, for controlling the converted target data amount value of the first encoded data so as to meet a data capacity of a storage means that stores the second encoded data, the thus controlled converted target data amount value being supplied to the second converting means (22) by taking account of it in said data amount error. The apparatus according to claim 4, the comparing means (24) comprising: means (54) for subtracting the data amount value of the second encoded data from the converted target data amount value corrected by said correcting means of the first encoded data to produce a difference amount value; and means (55, 56) for comparing the difference amount value with a reference positive amount value and a reference negative amount value to produce a first difference signal when the converted target data amount value corrected by said correcting means of the first encoded data is larger than the sum of the values of the second encoded data amount and the reference positive amount, to produce a second difference signal when the converted target data amount value corrected by said correcting means of the first encoded data is smaller than the sum of the values of the second encoded data amount and the reference negative amount, and to produce a third difference signal when the difference amount value is in a range defined between the reference positive and negative amount values, one of the first, second, and third difference signals being outputted as said first signal for controlling. A method for coding a video signal comprising the steps of: coding the video signal a first time by high efficient predictive coding to produce first encoded data; first counting a data amount of the first encoded data and providing a respective data amount value (T1); converting the data amount value of the first encoded data to a target data amount value (T2) within a range limited by a reference data amount value; controlling quantization in the high efficient predictive coding, in response to the converted target data amount value, the same video signal being coded a second time to produce second encoded data; second counting step counting a data amount of the second encoded data and providing a respective data amount value; correcting the target data amount value used in controlling the quantization in the high efficient predictive coding of the second time in response to the converted target data amount value of the first encoded data and said data amount value of the second encoded data; and outputting the second encoded data at a specific data transfer rate. The method according to claim 7, wherein the first encoded data includes a plurality of sequential data groups (GOPs), each data group having a plurality of sequential picture data, and each picture data having a plurality of sequential block data, the first counting step comprising the steps of: counting the data amount of each of the sequential block data to output sequential block data amount values; counting the data amount of each of the sequential picture data in response to the sequential block data amount values to output sequential picture data amount values; and counting the data amount of each of the sequential data groups in response to the sequential picture data amounts to output sequential data group amount values. The method according to claim 7, wherein the converting step comprises the steps of: converting the data amount value of the first encoded data to a plurality of different data amount values by means of a plurality of different data amount conversion characteristics (fg1...fgN); and comparing the different data amount values with the reference data amount value to find a maximum data amount value among the different data amount values within the range set by the reference data amount value, the maximum data amount value being outputted as said target data amount value (T2). The method according to claim 7, wherein the correcting step comprises the steps of: subtracting the target data amount value of the first encoded data from the data amount value of the second encoded data to produce a data amount error; converting the target data amount value of the first encoded data based on the data amount error to produce a converted target data amount value; comparing the data amount value of the second encoded data and the converted target data amount value corrected by said correcting of the first encoded data to produce a first signal for controlling the quantization scale of the coding at said second time of coding; and setting the quantization scale in response to the converted target data amount value corrected by said correcting to produce a second signal for controlling the quantization scale, wherein either one of the first and second signals is used to control the quantization in the high efficient predictive coding. The method according to claim 10, further comprising the step of controlling the converted target data amount value of the first encoded data in response to the second encoded data so as to meet a data capacity of a storage means that stores the second encoded data. The method according to claim 10, the comparing step comprising the steps of: subtracting the data amount value of the second encoded data from the converted target data amount value corrected by said correcting of the first encoded data to produce a difference amount value; and comparing the difference amount value with a reference positive amount value and a reference negative amount value to produce a first difference signal when the converted target data amount value corrected by said correcting of the first encoded data is larger than the sum of the values of the second encoded data amount and the reference positive amount, to produce a second difference signal when the converted target data amount value corrected by said correcting of the first encoded data is smaller than the sum of the values of the second encoded data amount and the reference negative amount value, and to produce a third difference signal when the difference amount value is in a range defined between the reference positive and negative amount values, one of the first, second, and third difference signals being outputted as said first signal for controlling. The method according to claim 10, the setting step comprising the steps of: checking (S1) whether the data occupancy of storage means (76) that store the second encoded data reaches the full state; checking (S2), if it reaches the full state, whether the target data amount is smaller than a storage capacity of the storage means; changing (S4), if not smaller, the converted target data amount value so as to meet the storage capacity; checking (S3), if it does not reach the full state, whether the target data amount is smaller than the data capacity; and changing (S5), if not smaller, the converted target data amount value so as to meet the data capacity.

Inventors: FUJIWARA MITSUAKI, FUJIWARA, MITSUAKI
Applicants: VICTOR COMPANY OF JAPAN, VICTOR COMPANY OF JAPAN, LTD.
Application year: 1996
Main classification: H04N7
IPC codes: H04N5, G06T9, H03M7, H04N7