Code quantity assignment device and method
Abstract
This record has no abstract on file.
Term
Term ended
Expired 9 June 2020, 6.3 years ago.
- Priority and filed
- Granted
- Expired
- Today
10 claims: 4 independent, 6 dependent
- 1ビデオ信号を符号化して記録媒体に記録する圧縮符号化データ記録における符号量割り当て装置であって、 ビデオ信号に含まれる複数の所定数の画像フレームを有する画像群の目標符号発生量を、それぞれの画像群の画像複雑さ指標に基づいて求め、それぞれの画像群のバッファ占有率であってフレームのデータ発生前のバッファ占有率を算出する画像群バッファ占有率算出手段と、 前記算出された画像群のバッファ占有率が、予め設定されたバッファ占有率の上限値と下限値との間の範囲内に収まるように、前記画像群のバッファ占有率を補正し、当該画像群単位で符号量を割り当てる画像群符号量割当手段と、 前記符号量が割り当てられた画像群内における最初のフレームの目標符号発生量を、それぞれの最初のフレームの画像複雑さ指標に基づいて求め、それぞれの最初のフレームのデータ発生後のバッファ占有率を算出する第1フレームバッファ占有率算出手段と、 前記算出された最初のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値を超えないように、前記最初のフレームのバッファ占有率を補正し、当該最初のフレームに符号量を割り当てる第1フレーム符号量割当手段と、 前記符号量が割り当てられた画像群内における最初のフレーム以外のフレームの目標符号発生量を、それぞれのフレームの画像複雑さ指標に基づいて求め、それぞれのフレームのデータ発生後のバッファ占有率を算出する第2フレームバッファ占有率算出手段と、 前記算出された最初のフレーム以外のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値と下限値との間の範囲内に収まるように、前記最初のフレーム以外のフレームのバッファ占有率を補正し、当該フレームに符号量を割り当てる第2フレーム符号量割当手段と、 を備え、 前記画像群符号量割当手段は、前記算出されたそれぞれの画像群のバッファ占有率が、予め設定されたバッファ占有率の上限値より大きいか否か、および予め設定されたバッファ占有率の下限値より小さいか否かを判断し、前記上限値より大きい画像群については、当該画像群のバッファ占有率と予め設定されたバッファ占有率の上限値との比を上限画像群補正比率として算出し、前記下限値より小さい画像群については、当該画像群のバッファ占有率と予め設定されたバッファ占有率の下限値との比を下限画像群補正比率として算出し、前記算出された上限画像群補正比率のうち最も大きい上限画像群補正比率を、基準となる初期バッファ占有率より大きい前記画像群のバッファ占有率に乗算して補正し、前記算出された下限画像群補正比率のうち最も大きい下限画像群補正比率を、基準となる初期バッファ占有率より小さい前記画像群のバッファ占有率に乗算して補正し、当該画像群単位で符号量を割り当てることを特徴とする符号量割り当て装置。
- 2請求項1に記載の符号量割り当て装置において、 前記第1フレーム符号量割当手段は、前記算出された最初のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値より大きいか否か判断し、当該上限値より大きい場合には、前記最初のフレームバッファ占有率が、前記予め設定されたバッファ占有率の上限値と等しくなるように補正し、前記最初のフレームに符号量を割り当てることを特徴とする符号量割り当て装置。
- 3請求項1に記載の符号量割り当て装置において、 前記第1フレーム符号量割当手段は、前記算出された最初のフレームのバッファ占有率が、予め設定されたバッファ占有率の下限値より小さいか否か判断し、当該下限値より小さい場合には、前記最初のフレームバッファ占有率が、前記予め設定されたバッファ占有率の下限値と等しくなるように補正し、前記最初のフレームに符号量を割り当てることを特徴とする符号量割り当て装置。
- 4請求項1乃至3の何れか一項に記載の符号量割り当て装置において、 前記第2フレーム符号量割当手段は、前記算出された最初のフレーム以外のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値より大きいか否か、および、予め設定されたバッファ占有率の下限より小さいか否かを判断し、前記上限値より大きい前記フレームのバッファ占有率または前記下限値より小さい前記フレームのバッファ占有率と、予め求められたラインであって前記第1フレーム符号量割当手段により符号量が割り当てられた最初のフレームのバッファ占有率と、当該最初のフレームを有する画像群内における最後のフレームのバッファ占有率との間にひかれた理想ライン上のバッファ占有率との第1の差分を算出するとともに、前記バッファ占有率の上限値または下限値と、前記予め求められた理想ライン上のバッファ占有率との第2の差分を算出し、前記第1の差分と前記第2の差分との比をフレーム補正比率として算出し、当該算出されたフレーム補正比率のうち最も大きいフレーム補正比率を、前記上限値または前記下限値のそれぞれについて求め、当該フレーム補正比率を最初のフレーム以外のフレームのバッファ占有率に乗算して補正し、当該フレームに符号量を割り当てることを特徴とする符号量割り当て装置。
- 5ビデオ信号を符号化して記録媒体に記録する圧縮符号化データ記録における符号量割り当て装置であって、 ビデオ信号に含まれる複数の所定数の画像フレームを有する画像群の目標符号発生量を、それぞれの画像群の画像複雑さ指標に基づいて求め、それぞれの画像群のバッファ占有率であってフレームのデータ発生前のバッファ占有率を算出する画像群バッファ占有率算出手段と、 前記算出された画像群のバッファ占有率が、予め設定されたバッファ占有率の上限値と下限値との間の範囲内に収まるように、前記画像群のバッファ占有率を補正し、当該画像群単位で符号量を割り当てる画像群符号量割当手段と、 前記符号量が割り当てられた画像群内における最初のフレームの目標符号発生量を、それぞれの最初のフレームの画像複雑さ指標に基づいて求め、それぞれの最初のフレームのデータ発生後のバッファ占有率を算出する第1フレームバッファ占有率算出手段と、 前記算出された最初のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値を超えないように、前記最初のフレームのバッファ占有率を補正し、当該最初のフレームに符号量を割り当てる第1フレーム符号量割当手段と、 前記符号量が割り当てられた画像群内における最初のフレーム以外のフレームの目標符号発生量を、それぞれのフレームの画像複雑さ指標に基づいて求め、それぞれのフレームのデータ発生後のバッファ占有率を算出する第2フレームバッファ占有率算出手段と、 前記算出された最初のフレーム以外のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値と下限値との間の範囲内に収まるように、前記最初のフレーム以外のフレームのバッファ占有率を補正し、当該フレームに符号量を割り当てる第2フレーム符号量割当手段と、 を備え、 前記第2フレーム符号量割当手段は、前記算出された最初のフレーム以外のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値より大きいか否か、および、予め設定されたバッファ占有率の下限より小さいか否かを判断し、前記上限値より大きい前記フレームのバッファ占有率または前記下限値より小さい前記フレームのバッファ占有率と、予め求められたラインであって前記第1フレーム符号量割当手段により符号量が割り当てられた最初のフレームのバッファ占有率と、当該最初のフレームを有する画像群内における最後のフレームのバッファ占有率との間にひかれた理想ライン上のバッファ占有率との第1の差分を算出するとともに、前記バッファ占有率の上限値または下限値と、前記予め求められた理想ライン上のバッファ占有率との第2の差分を算出し、前記第1の差分と前記第2の差分との比をフレーム補正比率として算出し、当該算出されたフレーム補正比率のうち最も大きいフレーム補正比率を、前記上限値または前記下限値のそれぞれについて求め、当該フレーム補正比率を最初のフレーム以外のフレームのバッファ占有率に乗算して補正し、当該フレームに符号量を割り当てることを特徴とする符号量割り当て装置。
- 6ビデオ信号を符号化して記録媒体に記録する圧縮符号化データ記録における符号量割り当て方法であって、 ビデオ信号に含まれる複数の所定数の画像フレームを有する画像群の目標符号発生量を、それぞれの画像群の画像複雑さ指標に基づいて求め、それぞれの画像群のバッファ占有率であってフレームのデータ発生前のバッファ占有率を算出する画像群バッファ占有率算出工程と、 前記算出された画像群のバッファ占有率が、予め設定されたバッファ占有率の上限値と下限値との間の範囲内に収まるように、前記画像群のバッファ占有率を補正し、当該画像群単位で符号量を割り当てる画像群符号量割当工程と、 前記符号量が割り当てられた画像群内における最初のフレームの目標符号発生量を、それぞれの最初のフレームの画像複雑さ指標に基づいて求め、それぞれの最初のフレームのデータ発生後のバッファ占有率を算出する第1フレームバッファ占有率算出工程と、 前記算出された最初のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値を超えないように、前記最初のフレームのバッファ占有率を補正し、当該最初のフレームに符号量を割り当てる第1フレーム符号量割当工程と、 前記符号量が割り当てられた画像群内における最初のフレーム以外のフレームの目標符号発生量を、それぞれのフレームの画像複雑さ指標に基づいて求め、それぞれのフレームのデータ発生後のバッファ占有率を算出する第2フレームバッファ占有率算出工程と、 前記算出された最初のフレーム以外のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値と下限値との間の範囲内に収まるように、前記最初のフレーム以外のフレームのバッファ占有率を補正し、当該フレームに符号量を割り当てる第2フレーム符号量割当工程と、 を備え、 前記画像群符号量割当工程は、前記算出されたそれぞれの画像群のバッファ占有率が、予め設定されたバッファ占有率の上限値より大きいか否か、および予め設定されたバッファ占有率の下限値より小さいか否かを判断し、前記上限値より大きい画像群については、当該画像群のバッファ占有率と予め設定されたバッファ占有率の上限値との比を上限画像群補正比率として算出し、前記下限値より小さい画像群については、当該画像群のバッファ占有率と予め設定されたバッファ占有率の下限値との比を下限画像群補正比率として算出し、前記算出された上限画像群補正比率のうち最も大きい上限画像群補正比率を、基準となる初期バッファ占有率より大きい前記画像群のバッファ占有率に乗算して補正し、前記算出された下限画像群補正比率のうち最も大きい下限画像群補正比率を、基準となる初期バッファ占有率より小さい前記画像群のバッファ占有率に乗算して補正し、当該画像群単位で符号量を割り当てることを特徴とする符号量割り当て方法。
- 7請求項6に記載の符号量割り当て方法において、 前記第1フレーム符号量割当工程は、前記算出された最初のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値より大きいか否か判断し、当該上限値より大きい場合には、前記最初のフレームバッファ占有率が、前記予め設定されたバッファ占有率の上限値と等しくなるように補正し、前記最初のフレームに符号量を割り当てることを特徴とする符号量割り当て方法。
- 8請求項6に記載の符号量割り当て方法において、 前記第1フレーム符号量割当工程は、前記算出された最初のフレームのバッファ占有率が、予め設定されたバッファ占有率の下限値より小さいか否か判断し、当該下限値より小さい場合には、前記最初のフレームバッファ占有率が、前記予め設定されたバッファ占有率の下限値と等しくなるように補正し、前記最初のフレームに符号量を割り当てることを特徴とする符号量割り当て方法。
- 9請求項6乃至8の何れか一項に記載の符号量割り当て方法において、 前記第2フレーム符号量割当工程は、前記算出された最初のフレーム以外のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値より大きいか否か、および、予め設定されたバッファ占有率の下限より小さいか否かを判断し、前記上限値より大きい前記フレームのバッファ占有率または前記下限値より小さい前記フレームのバッファ占有率と、予め求められたラインであって前記第1フレーム符号量割当工程により符号量が割り当てられた最初のフレームのバッファ占有率と、当該最初のフレームを有する画像群内における最後のフレームのバッファ占有率との間にひかれた理想ライン上のバッファ占有率との第1の差分を算出するとともに、前記バッファ占有率の上限値または下限値と、前記予め求められた理想ライン上のバッファ占有率との第2の差分を算出し、前記第1の差分と前記第2の差分との比をフレーム補正比率として算出し、当該算出されたフレーム補正比率のうち最も大きいフレーム補正比率を、前記上限値または前記下限値のそれぞれについて求め、当該フレーム補正比率を最初のフレーム以外のフレームのバッファ占有率に乗算して補正し、当該フレームに符号量を割り当てることを特徴とする符号量割り当て方法。
- 10ビデオ信号を符号化して記録媒体に記録する圧縮符号化データ記録における符号量割り当て方法であって、 ビデオ信号に含まれる複数の所定数の画像フレームを有する画像群の目標符号発生量を、それぞれの画像群の画像複雑さ指標に基づいて求め、それぞれの画像群のバッファ占有率であってフレームのデータ発生前のバッファ占有率を算出する画像群バッファ占有率算出工程と、 前記算出された画像群のバッファ占有率が、予め設定されたバッファ占有率の上限値と下限値との間の範囲内に収まるように、前記画像群のバッファ占有率を補正し、当該画像群単位で符号量を割り当てる画像群符号量割当工程と、 前記符号量が割り当てられた画像群内における最初のフレームの目標符号発生量を、それぞれの最初のフレームの画像複雑さ指標に基づいて求め、それぞれの最初のフレームのデータ発生後のバッファ占有率を算出する第1フレームバッファ占有率算出工程と、 前記算出された最初のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値を超えないように、前記最初のフレームのバッファ占有率を補正し、当該最初のフレームに符号量を割り当てる第1フレーム符号量割当工程と、 前記符号量が割り当てられた画像群内における最初のフレーム以外のフレームの目標符号発生量を、それぞれのフレームの画像複雑さ指標に基づいて求め、それぞれのフレームのデータ発生後のバッファ占有率を算出する第2フレームバッファ占有率算出工程と、 前記算出された最初のフレーム以外のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値と下限値との間の範囲内に収まるように、前記最初のフレーム以外のフレームのバッファ占有率を補正し、当該フレームに符号量を割り当てる第2フレーム符号量割当工程と、 を備え、 前記第2フレーム符号量割当工程は、前記算出された最初のフレーム以外のフレームのバッファ占有率が、予め設定されたバッファ占有率の上限値より大きいか否か、および、予め設定されたバッファ占有率の下限より小さいか否かを判断し、前記上限値より大きい前記フレームのバッファ占有率または前記下限値より小さい前記フレームのバッファ占有率と、予め求められたラインであって前記第1フレーム符号量割当工程により符号量が割り当てられた最初のフレームのバッファ占有率と、当該最初のフレームを有する画像群内における最後のフレームのバッファ占有率との間にひかれた理想ライン上のバッファ占有率との第1の差分を算出するとともに、前記バッファ占有率の上限値または下限値と、前記予め求められた理想ライン上のバッファ占有率との第2の差分を算出し、前記第1の差分と前記第2の差分との比をフレーム補正比率として算出し、当該算出されたフレーム補正比率のうち最も大きいフレーム補正比率を、前記上限値または前記下限値のそれぞれについて求め、当該フレーム補正比率を最初のフレーム以外のフレームのバッファ占有率に乗算して補正し、当該フレームに符号量を割り当てることを特徴とする符号量割り当て方法。
Independent claims10
100 paragraphs, as filed
The present invention relates to a code amount allocation device and a method for recording compressed coded data in which a video signal is encoded and recorded on a recording medium.
[0002] Conventional Technique When an image is digitized and recorded on a recording medium such as a DVD-ROM, a CD-ROM, or a hard disk, the amount of data is enormous, so that the image is usually compressed and encoded. Will be recorded. There are various compression coding methods in this compression coding method. In particular, a coding method based on DCT (Discrete Cosine Transform) that compresses by utilizing the property that the spatial frequency of an image is concentrated in a low frequency. However, it is used relatively often. DCT is used in international standard coding methods such as JPEG (Joint Photographic Coding Experts Group) and MPEG (Moving Picture Coding Experts Group) 1, MPEG2, or MPEG4.
[0003] Conventionally, it has been known that a device that performs compression coding by the MPEG method performs coding control by a fixed bit rate coding method or a variable bit rate coding method.
[0004] In the constant bit rate coding method, the target code amount of each frame constituting the video sequence is a constant value regardless of the complexity of the image, and the occupancy rate of the decoder buffer is determined at the time of coding. In consideration of this, coding control is performed so as not to cause overflow or underflow.
[0005] On the other hand, in the variable bit rate coding method, the optimum code amount of each frame in the video sequence is assigned in advance based on the image complexity index obtained in advance, so that it is necessary for each frame. It is possible to assign the amount of code to be used, and it is possible to suppress the difference in image quality between frames.
[0006] By the way, since the code generation amount of each frame has a correlation with the image complexity index of the frame, the code amount allocation of each frame ignoring the image complexity index can be used. , The image quality of each frame will be uneven. In addition, in the code amount allocation considering the occupancy rate of the decoder buffer at the time of coding, when a larger code amount is desired, a large code amount cannot be allocated because there is little room for the buffer, and the image quality deteriorates. Even if sufficient image quality can be obtained with a small amount of code, a large amount of code is allocated because there is a lot of room for a buffer.
[0007] On the other hand, simply allocating the code amount of each frame based on the image complexity index results in the decoder buffer overflowing or underflowing.
[0008] The present invention has been made in view of the above points, and provides an apparatus and a method for assigning an optimum code amount to each frame based on an image complexity index of each frame constituting a video sequence. The purpose is to do.
[Means for Solving the Problems] In order to solve the above problems, the invention according to claim 1 is a code amount assigning device for compressed coded data recording in which a video signal is encoded and recorded on a recording medium. A group of images having a plurality of predetermined number of image frames included in a video signal.<u style="single">Image group buffer occupancy calculation means for obtaining the target code generation amount based on the image complexity index of each image group and calculating the buffer occupancy rate of each image group before the frame data is generated. The buffer occupancy rate of the image group is corrected so that the calculated buffer occupancy rate of the image group falls within the range between the upper limit value and the lower limit value of the preset buffer occupancy rate. The image group code amount assigning means for allocating the code amount for each image group and the target code generation amount of the first frame in the image group to which the code amount is assigned are determined based on the image complexity index of each first frame. The first frame buffer occupancy rate calculating means for obtaining and calculating the buffer occupancy rate after the data generation of each first frame and the buffer occupancy rate of the calculated first frame are the preset upper limit of the buffer occupancy rate. The first frame code amount allocating means for correcting the buffer occupancy of the first frame and allocating the code amount to the first frame so as not to exceed the value, and the first in the image group to which the code amount is assigned. The second frame buffer occupancy calculation means for calculating the target code generation amount of frames other than the frame based on the image complexity index of each frame and calculating the buffer occupancy after data generation of each frame, and the above calculation. The buffer occupancy rate of the frames other than the first frame is set so that the buffer occupancy rate of the frames other than the first frame is within the range between the preset upper limit value and the lower limit value of the buffer occupancy rate. A second frame code amount assigning means for correcting and assigning a code amount to the frame is provided.</u><u style="single"></u><u style="single">The image group code amount assigning means determines whether or not the calculated buffer occupancy rate of each image group is larger than the preset upper limit value of the buffer occupancy rate, and the lower limit value of the preset buffer occupancy rate. Whether it is smaller or not is determined, and for an image group larger than the upper limit value, the ratio of the buffer occupancy rate of the image group to the preset upper limit value of the buffer occupancy is calculated as the upper limit image group correction ratio. For image groups smaller than the lower limit, the ratio of the buffer occupancy of the image group to the preset lower limit of the buffer occupancy is calculated as the lower limit image group correction ratio, and the calculated upper limit image group correction ratio is calculated. The largest upper limit image group correction ratio is corrected by multiplying the buffer occupancy ratio of the image group larger than the reference initial buffer occupancy ratio, and the largest lower limit image group among the calculated lower limit image group correction ratios is corrected. The correction ratio is corrected by multiplying the buffer occupancy of the image group smaller than the reference initial buffer occupancy, and the code amount is assigned to each image group.</u>It is configured as follows.
[0010] According to the invention configured as described above, a plurality of predetermined number of image frames included in the video signal.<u style="single">The target code generation amount of the image group having the above is obtained based on the image complexity index of each image group, and the buffer occupancy rate of each image group before the data generation of the frame is calculated. .. Next, the buffer occupancy rate of the image group is corrected so that the calculated buffer occupancy rate of the image group falls within the range between the upper limit value and the lower limit value of the preset buffer occupancy rate. The code amount is assigned for each image group (first stage). Next, the target code generation amount of the first frame in the image group to which the code amount is assigned is obtained based on the image complexity index of each first frame, and after the data generation of each first frame is performed. The buffer occupancy is calculated. Next, the buffer occupancy of the first frame is corrected so that the calculated buffer occupancy of the first frame does not exceed the preset upper limit of the buffer occupancy, and the first frame is coded. The amount is assigned (second stage). Next, the target code generation amount of frames other than the first frame in the image group to which the code amount is assigned is obtained based on the image complexity index of each frame, and the buffer after data generation of each frame is obtained. The occupancy rate is calculated. Buffer occupancy of frames other than the first frame so that the calculated buffer occupancy of frames other than the first frame falls within the range between the preset upper limit and lower limit of the buffer occupancy. The rate is corrected and the code amount is assigned to the frame (third stage).</u>[0011] Therefore,<u style="single">The amount of code generated based on the image complexity index is corrected in three stages (correction of buffer occupancy for each image group, correction of buffer occupancy of the first frame, buffer occupancy of frames other than the first frame). The optimum code amount without overflow or underflow can be assigned to each frame in the decoder buffer, and higher image quality can be realized. In addition, in the second stage, by allocating the code amount of the first frame prior to the third stage, the generated code amount of the first frame can be maintained as much as possible, so that a more beautiful image is reproduced. be able to.</u>[0012] The invention according to claim 2 is<u style="single">In the code amount assigning apparatus according to claim 1,</u>The first frame code amount allocating means determines whether or not the calculated buffer occupancy rate of the first frame is larger than the preset upper limit value of the buffer occupancy rate, and if it is larger than the upper limit value, the buffer occupancy rate is larger than the preset upper limit value. The first frame buffer occupancy rate is corrected so as to be equal to the preset upper limit value of the buffer occupancy rate, and the code amount is allocated to the first frame.
[0013] The invention according to claim 3 is<u style="single">In the code amount assigning apparatus according to claim 1,</u>The first frame code amount allocating means determines whether or not the calculated buffer occupancy rate of the first frame is smaller than the preset lower limit value of the buffer occupancy rate, and if it is smaller than the lower limit value, the buffer occupancy rate is smaller than the lower limit value. The first frame buffer occupancy rate is corrected so as to be equal to the lower limit value of the preset buffer occupancy rate, and the code amount is allocated to the first frame.
【0014】<u style="single">The invention according to claim 5 is a code amount allocation device in compressed coded data recording in which a video signal is encoded and recorded on a recording medium, and is an image group having a plurality of predetermined number of image frames included in the video signal. Calculate the target code generation amount of each image group based on the image complexity index of each image group, and calculate the buffer occupancy rate of each image group before the frame data is generated. Image group buffer occupancy rate calculation The buffer occupancy rate of the image group is corrected so that the buffer occupancy rate of the means and the calculated image group falls within the range between the upper limit value and the lower limit value of the preset buffer occupancy rate. The image group code amount assigning means for allocating the code amount for each image group and the target code generation amount of the first frame in the image group to which the code amount is assigned are based on the image complexity index of each first frame. The first frame buffer occupancy rate calculating means for calculating the buffer occupancy rate after the data generation of each first frame and the buffer occupancy rate of the calculated first frame are the preset buffer occupancy rates. The first frame code amount allocating means for correcting the buffer occupancy of the first frame and allocating the code amount to the first frame so as not to exceed the upper limit value, and the first in the image group to which the code amount is assigned. The second frame buffer occupancy calculation means for calculating the target code generation amount of frames other than the frame based on the image complexity index of each frame and calculating the buffer occupancy after data generation of each frame, and the above. The buffer occupancy rate of the frames other than the first frame is set so that the calculated buffer occupancy rate of the frames other than the first frame falls within the range between the preset upper limit value and the lower limit value of the buffer occupancy rate. The second frame code amount allocating means for correcting and allocating the code amount to the frame is provided, and the second frame code amount allocating means has a buffer occupancy rate of frames other than the calculated first frame in advance. Whether it is larger than the set upper limit of the buffer occupancy, and the lower limit of the preset buffer occupancy.The buffer occupancy rate of the frame larger than the upper limit value or the buffer occupancy rate of the frame smaller than the lower limit value is determined to be smaller than the upper limit value, and the first frame code amount allocation means for the previously obtained line. The first of the buffer occupancy on the ideal line drawn between the buffer occupancy of the first frame to which the code amount is allocated by and the buffer occupancy of the last frame in the image group having the first frame. The second difference between the upper limit value or the lower limit value of the buffer occupancy rate and the buffer occupancy rate on the ideal line obtained in advance is calculated, and the first difference and the second difference are calculated. The ratio to the difference between the above is calculated as the frame correction ratio, the largest frame correction ratio among the calculated frame correction ratios is obtained for each of the upper limit value and the lower limit value, and the frame correction ratio is other than the first frame. The buffer occupancy of the frame is multiplied and corrected, and the code amount is assigned to the frame.</u>It is configured as follows.
【0015】<u style="single">The invention according to claim 6 is a code amount allocation method in compressed coded data recording in which a video signal is encoded and recorded on a recording medium, and is an image group having a plurality of predetermined number of image frames included in the video signal. Calculate the target code generation amount of each image group based on the image complexity index of each image group, and calculate the buffer occupancy rate of each image group before the frame data is generated. Image group buffer occupancy rate calculation The buffer occupancy rate of the image group is corrected so that the buffer occupancy rate of the step and the calculated image group falls within the range between the upper limit value and the lower limit value of the preset buffer occupancy rate. The image group code amount allocation step of allocating the code amount for each image group and the target code generation amount of the first frame in the image group to which the code amount is assigned are based on the image complexity index of each first frame. The first frame buffer occupancy rate calculation step of calculating the buffer occupancy rate after the data generation of each first frame and the calculated buffer occupancy rate of the first frame are the preset buffer occupancy rates. The first frame code amount allocation step of correcting the buffer occupancy of the first frame and allocating the code amount to the first frame so as not to exceed the upper limit value, and the first in the image group to which the code amount is assigned. The second frame buffer occupancy calculation step of obtaining the target code generation amount of frames other than the frame based on the image complexity index of each frame and calculating the buffer occupancy after data generation of each frame, and the above. The buffer occupancy rate of the frames other than the first frame is set so that the calculated buffer occupancy rate of the frames other than the first frame falls within the range between the preset upper limit value and the lower limit value of the buffer occupancy rate. The second frame code amount allocation step of correcting the above and allocating the code amount to the frame is provided, and in the image group code amount allocation step, the buffer occupancy rate of each of the calculated image groups is set in advance. Determine if it is greater than the upper limit of the buffer occupancy and if it is less than the preset lower limit of the buffer occupancy.For image groups larger than the upper limit, the ratio of the buffer occupancy of the image group to the preset upper limit of the buffer occupancy is calculated as the upper limit image group correction ratio, and the image is smaller than the lower limit. For the group, the ratio of the buffer occupancy rate of the image group to the preset lower limit value of the buffer occupancy rate is calculated as the lower limit image group correction ratio, and the largest upper limit image among the calculated upper limit image group correction ratios is obtained. The group correction ratio is corrected by multiplying the buffer occupancy of the image group that is larger than the reference initial buffer occupancy ratio, and the largest lower limit image group correction ratio among the calculated lower limit image group correction ratios is used as the reference. The buffer occupancy of the image group, which is smaller than the initial buffer occupancy, is multiplied and corrected, and the code amount is allocated for each image group.</u>[0016] The invention according to claim 7 is the invention.<u style="single">In the code amount allocation method according to claim 6,</u>The first frame code amount allocation step determines whether or not the calculated buffer occupancy rate of the first frame is larger than the preset upper limit value of the buffer occupancy rate, and if it is larger than the upper limit value, the buffer occupancy rate is larger than the preset upper limit value. The first frame buffer occupancy rate is corrected so as to be equal to the preset upper limit value of the buffer occupancy rate, and the code amount is allocated to the first frame.
[0017] The invention according to claim 8 is<u style="single">In the code amount allocation method according to claim 6,</u>The first frame code amount allocation step determines whether or not the calculated buffer occupancy of the first frame is smaller than the preset lower limit of the buffer occupancy, and if it is smaller than the lower limit, the buffer occupancy is smaller than the preset lower limit. The first frame buffer occupancy rate is corrected so as to be equal to the lower limit value of the preset buffer occupancy rate, and the code amount is allocated to the first frame.
【0018】<u style="single">The invention according to claim 10 is a code amount allocation method in compressed coded data recording in which a video signal is encoded and recorded on a recording medium, and is an image group having a plurality of predetermined number of image frames included in the video signal. Calculate the target code generation amount of each image group based on the image complexity index of each image group, and calculate the buffer occupancy rate of each image group before the frame data is generated. Image group buffer occupancy rate calculation The buffer occupancy rate of the image group is corrected so that the buffer occupancy rate of the step and the calculated image group falls within the range between the upper limit value and the lower limit value of the preset buffer occupancy rate. The image group code amount allocation step of allocating the code amount for each image group and the target code generation amount of the first frame in the image group to which the code amount is assigned are based on the image complexity index of each first frame. The first frame buffer occupancy rate calculation step of calculating the buffer occupancy rate after the data generation of each first frame and the calculated buffer occupancy rate of the first frame are the preset buffer occupancy rates. The first frame code amount allocation step of correcting the buffer occupancy of the first frame and allocating the code amount to the first frame so as not to exceed the upper limit value, and the first in the image group to which the code amount is assigned. The second frame buffer occupancy calculation step of obtaining the target code generation amount of frames other than the frame based on the image complexity index of each frame and calculating the buffer occupancy after data generation of each frame, and the above. The buffer occupancy rate of the frames other than the first frame is set so that the calculated buffer occupancy rate of the frames other than the first frame falls within the range between the preset upper limit value and the lower limit value of the buffer occupancy rate. The second frame code amount allocation step of correcting the above and allocating the code amount to the frame is provided, and in the second frame code amount allocation step, the buffer occupancy rate of the frames other than the calculated first frame is set in advance. Whether or not it is larger than the set upper limit of the buffer occupancy, and the lower limit of the preset buffer occupancy.It is determined whether or not it is smaller, and the buffer occupancy rate of the frame larger than the upper limit value or the buffer occupancy rate of the frame smaller than the lower limit value, and the first frame code amount allocation step of the line obtained in advance. The first of the buffer occupancy on the ideal line drawn between the buffer occupancy of the first frame to which the code amount is allocated by and the buffer occupancy of the last frame in the image group having the first frame. The second difference between the upper limit value or the lower limit value of the buffer occupancy rate and the buffer occupancy rate on the ideal line obtained in advance is calculated, and the first difference and the second difference are calculated. The ratio to the difference between the above is calculated as the frame correction ratio, the largest frame correction ratio among the calculated frame correction ratios is obtained for each of the upper limit value and the lower limit value, and the frame correction ratio is other than the first frame. The buffer occupancy rate of the frame is multiplied and corrected, and the code amount is allocated to the frame.</u>。
BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, preferred embodiments of the present invention will be described with reference to the drawings.
[0044] In the embodiment described below, each frame is used in a code amount assigning device (hereinafter referred to as "MPEG encoder") in compressed coded data recording in which a video signal is encoded by an MPEG method and recorded on a recording medium. It is an embodiment when the present invention is applied with respect to the allocation of the optimum code amount to. The recording medium includes a DVD-ROM, a DVD-RAM, a DVD-RW, a CD-ROM, a hard disk, and the like.
[0045] Before the embodiment of the present invention is specifically described, a video sequence created by an MPEG encoder and recorded on a recording medium (hereinafter referred to as "bit stream (encoded data string)"). However, the flow of decoding by a decoding device (hereinafter referred to as "MPEG decoder") that decodes by the MPEG method will be described with reference to FIGS. 1 and 2. FIG. 1 is a diagram showing an ideal (virtual) model (STD: System Target Decoder) of an MPEG decoder. This ideal model includes a VBV (Video Buffer Verifier) buffer 10, an MPEG decorator 20, and an alignment buffer 30. FIG. 2 is a diagram showing the transition status of the data occupancy rate (%) of the VBV buffer 10. Here, in order to briefly explain the flow, a fixed bit rate and a fixed frame rate are used, but the same thing can be said even if they are variable.
As shown in FIG. 1, the bit stream created by the MPEG encoder is input to the VBV buffer 10 at a bit rate R and is accumulated. In this way, as shown by reference numeral 50 in FIG. 2, the data occupancy (bits) of the VBV buffer 10 gradually increases. Here, the bit rate R means the amount of data (bits) input to the VBV buffer 10 between frames, and indicates the bit rate R = bit rate / frame rate. A bit stream is a GOP (Group Of) which is an image group having various header information such as VSH (Video Sequence Header) and a predetermined number of image frames. Picture). A GOP consists of one or more pictures, and one picture represents one frame. This picture includes an I picture (Intra-Picture) composed of only the intra-frame code (without predictive coding) and a P composed of the inter-frame predictive code only in the forward direction (inter-frame forward predictive coding). There are three types: a picture (Predictive-Picture) and a B-picture (Bidirectionally predictive-Picture) composed of two-way inter-frame predictive codes before and after (bidirectional predictive coding). Usually, the frame structure of GOP is I picture first, followed by P picture and B picture. The average amount of code generated for each picture is in the order of I picture> P picture> B picture. The picture is composed of a plurality of slices divided into arbitrary areas. Slices consist of multiple macroblocks arranged in order from left to right or top to bottom.
Next, the bit stream input to the VBV buffer 10 has the initial buffer occupancy (B'shown in FIG. 2) specified in the bit stream.<sub>0</sub>When the amount of data for) is reached, one frame of data is instantly transferred from the VBV buffer 10 to the MPEG decoder 20. As a result, as shown in FIG. 2, the transferred code amount (d)<sub>0</sub>) Minutes, the data occupancy (bits) of the VBV buffer 10 is reduced. In addition, the bit stream is continuously accumulated in the VBV buffer 10. The data in the next frame is also instantly transferred from the VBV buffer 10 to the MPEG decoder 20 when the time to decode the next frame is reached. After that, the bit stream input to the VBV buffer 10 is transferred every time the time to be decoded for each frame is reached. Here, "B" shown in FIG. 2 indicates the VBV buffer size (bits) as "B'.<sub>N</sub>"B" indicates the VBV buffer occupancy (bits) before removing (transferring) the data in the Nth frame.<sub>N</sub>"D" indicates the VBV buffer occupancy (bits) after removing the data in the Nth frame.<sub>N</sub>"Indicates the code amount (bits) of the Nth frame, respectively. Also, in the example of FIG. 2, since the first frame is an I picture, its buffer occupancy (B'<sub>0</sub>) Is the buffer occupancy of subsequent frames (eg B'<sub>N</sub>) Is larger.
Next, the one-frame data transferred to the MPEG decoder 20 is instantly decoded (decoded) and output as image data. At this time, when it is necessary to change the order of the frames, for example, when the frame is a B picture, the order of the frames is changed and output in the alignment buffer 30.
In this way, the input bit stream is decoded by the MPEG decoder 20, but at this time, the VBV buffer 10 causes overflow or underflow as shown in FIG. In the MPEG encoder, B<sub>N</sub> 0 and B'<sub>N</sub>The condition of B must be guaranteed. That is, the MPEG encoder needs to allocate the optimum code amount to each frame and create a bit stream so as to satisfy such a condition.
[0050] Hereinafter, embodiments of the present invention will be specifically described with reference to FIGS. 4 to 14 regarding the allocation of the optimum code amount to each frame in the MPEG encoder.
FIG. 4 is a schematic configuration diagram of the MPEG encoder 100 according to the embodiment of the present invention. As shown in FIG. 1, the MPEG encoder 100 includes an acquisition unit 50, a motion detection unit 51, a coding unit 52, an optimum code amount calculation unit 53, a generated code amount calculation unit 54, and a quantization control unit 55. , A multiplexer 56, and a buffer memory 57.
[0052] First, the operation of the MPEG encoder 100 will be briefly described.
[0053] The acquisition unit 50 acquires image data from the input digital video signal for each frame and performs predetermined processing such as field thinning. Further, the picture type of the acquired frame is determined, and when it is necessary to change the frame order, for example, in the case of a B picture, the frame order is also changed. The motion detection unit 51 calculates the motion vector of the input image in macroblock units of 16 × 16 pixels and outputs it as a frame signal Sv.
The coding unit 52 includes an addition unit 52a, a discrete cosine transform (DCT) 52b, a quantization unit (Q: Quantization) 52c, and a variable length coding unit (VLC: Variable Length Coding). ) 52d and the inverse quantization unit (Q)<sup>-1</sup>) 52e and the inverse discrete cosine transform (DCT)<sup>-1</sup>) 52f and a frame storage and motion compensation prediction unit 52g.
The addition unit 52a subtracts the compensation signal Se from the motion compensation prediction unit 52g from the frame signal Sv from the motion detection unit 51, and outputs the subtraction signal Sa to the discrete cosine transform unit 52b. The discrete cosine transform unit 52b converts the subtraction signal Sa into a two-dimensional discrete cosine transform in a block of 8 × 8 pixels, and outputs it as a conversion signal Sd to the quantization unit 52c. The quantization unit 52c quantizes the conversion signal Sd on a quantization scale determined based on the rate signal Sr from the quantization control unit 55, which will be described later, and uses the variable-length coding unit 52d and the inverse quantization as the quantization signal Sq. Output to unit 52e.
[0056] The inverse quantization unit 52e performs an inverse quantization process on the quantization signal Sq, and the inverse discrete cosine transform unit (DCT) is used as the inverse quantization signal Sig.<sup>-1</sup>) Output to 52f. The inverse discrete cosine transform unit 52f converts the inverse discrete cosine transform Sig into an inverse discrete cosine transform and outputs it as an inverse transform signal Sid to the motion compensation prediction unit 52g. The motion compensation prediction unit 52g performs motion compensation processing using so-called inter-frame prediction in the MPEG method based on the inverse conversion signal Sid and the motion vector included in the frame signal Sv from the motion detection unit 51, and performs the above compensation signal. Se is generated and output to the addition unit 52a.
[0057] On the other hand, the variable-length coding unit 52d performs a variable-length coding process on the quantization signal Sq and outputs it as a variable-length code Sout to the buffer memory 57 via the multiplexer 56. In this way, the variable-length code Sout is output from the buffer memory 57 as a bit stream and recorded on the recording medium. At this time, the generated code amount calculation unit 54 calculates the actual generated code amount based on the variable length code Sout of the buffer memory 57, and if it exceeds the target value, outputs the correction signal Sh to the quantization control unit 55. To do. As a result, the quantization control unit 55 determines the quantization scale based on the correction signal Sh and the rate signal Sr.
[0058] Next, the process of allocating the optimum code generation amount to each frame, which is a feature of the present invention, will be described. Such processing is performed by the optimum code amount calculation unit 53. The optimum code amount calculation unit 53 includes an image complexity index calculation unit 53a, an image complexity index storage unit 53b, a selector 53c, and a code amount allocation calculation unit 53d.
[0059] The image complexity index calculation unit 53a calculates the image complexity index of each frame based on the subtraction signal Sa output from the addition unit 52a of the coding unit 52. The image complexity index is expressed as a variance or an average absolute value error, and is proportional to the sign generation amount of each frame (or some function, for example, an exponential function). For example, as an image complexity index, the variance of the I picture is used, and the variance of the difference image is used for the P picture and the B picture. The image complexity index storage unit 53b stores the image complexity index calculated by the image complexity index calculation unit 53a. Then, after the image complexity index of all the frames is calculated, the data of the image complexity index is output from the image complexity index storage unit 53b to the code assignment calculation unit 53d via the selector 53c. However, since the image complexity index of each frame in the first GOP cannot be calculated by the image complexity index calculation unit 53a, the image complexity index set in advance at a certain ratio is used as sequence information in the selector 53c. And output to the code allocation calculation unit 53d. Then, the code allocation calculation unit 53d performs a calculation for allocating the optimum code amount to each frame based on the image complexity index of each frame. As shown in FIG. 5, such calculation can be roughly divided into three stages. The first step is the correction of the code generation amount in the GOP unit, the second step is the correction of the code generation amount in the first frame, and the third step is the correction of the code generation amount in the frame unit.
(1) Correction of Code Generation Amount in GOP Unit The correction of code generation amount in GOP unit in the first stage will be described below with reference to FIGS. 6 and 7. FIG. 6 is a flowchart showing the processing of the code generation amount correction in the GOP unit by the code allocation calculation unit 53d, and FIG. 7 is a diagram showing the buffer occupancy rate (%) in the code generation amount correction in the GOP unit. is there.
First, the target code generation amount (bits) of each GOP is calculated based on the image complexity index of each frame (S1). For example, the target total code generation amount (target bit rate (bps) x number of seconds (s)) is T, the total image complexity index is S, and the image complexity index of the i-th GOP is SG.<sub>i</sub>If, the target code generation amount of the i-th GOP (TG)<sub>i</sub>) Is calculated by Eq. (Equation 1).
[0062] TG<sub>i</sub>= T SG<sub>i</sub>/ S (Equation 1) Here, Fig. 15 shows the interrelationships of the image complexity index and the target code generation amount, which are often used in the following explanations, when expressed in frame units, GOP units, and total GOP.
Next, the VBV buffer occupancy rate (%) (before frame data generation) at the start time of each GOP is calculated based on the obtained target code generation amount (bits) of each GOP (S2). .. For example, VBV buffer size (bits) is B, and the number of frames in the i-th GOP is NG.<sub>i</sub>, When the buffer reduction amount (bits) for each frame is R, the VBV buffer occupancy rate (BL) at the start of the i + 1th GOP.<sub>i + 1,0</sub>) Is calculated by Eq. (Equation 2).
[0064] BL<sub>i + 1,0</sub>= BL<sub>i, 0</sub>+ (TG<sub>i</sub>-R / NG<sub>i</sub>) / B (Equation 2) However, VBV buffer occupancy at the start of the first GOP (BL<sub>i, 0</sub>) Is the initial buffer occupancy (B)<sub>0</sub>). That is, BL<sub>i, 0</sub>= B<sub>0</sub>Will be.
[0065] In this way, when the VBV buffer occupancy rate (%) at the start of all GOPs is calculated, the GOP correction ratio (RG) on the overflow side, which will be described later, is calculated.<sub>max</sub>) Is set to "1", and the GOP correction ratio (RG) on the underflow side<sub>min</sub>) Is set to "1" (S3). This RG<sub>max</sub>, RG<sub>min</sub>Is a parameter used for correcting the amount of code generated in GOP units, and is set to "1" (that is, indicating no correction) at the initial stage.
Next, whether or not there is a GOP whose VBV buffer occupancy rate (%) at the start of GOP is larger than the GOP upper limit value (LUG) of the preset VBV buffer occupancy rate (%) (overflow GOP). Whether or not there is) is determined (S4). For example, as shown in Figure 7, the VBV buffer occupancy (BL) at the start of the N-2nd GOP.<sub>N-2,0</sub>) Exceeds the GOP upper limit (LUG) of the VBV buffer occupancy (%), it is judged as overflow. And for all GOPs judged to overflow (BL in Figure 7)<sub>N-2,0</sub>Only, but in reality, there are multiple GOP correction ratios (RG)<sub>max</sub>) Is calculated, and the maximum GOP correction ratio (RG) is calculated.<sub>max</sub>) Is the new GOP correction ratio (RG<sub>max</sub>) Is set (S5). Initial buffer occupancy (%) is B<sub>0</sub>Then, the maximum GOP correction ratio (RG<sub>max</sub>) Is calculated by Eq. (Equation 3).
[0067] RG<sub>max</sub>= max ((BL<sub>i, 0</sub>-B<sub>0</sub>) / (LUG-B<sub>0</sub>)) (Equation 3) Next, whether or not there is a GOP whose VBV buffer occupancy rate (%) at the start of the above GOP is smaller than the GOP lower limit value (LLG) of the preset VBV buffer occupancy rate (%). (Whether or not there is an underflow GOP) is determined (S6). For example, as shown in Figure 7, the VBV buffer occupancy (BL) at the start of the third GOP.<sub>3,0</sub>) Is below the lower limit of GOP (LLG) of VBV buffer occupancy (%), it is judged as underflow. Then, for all GOPs judged to be underflow, the GOP correction ratio (RG)<sub>min</sub>) Is calculated, and the maximum GOP correction ratio (RG) is calculated.<sub>min</sub>) Is the new GOP correction ratio (RG<sub>min</sub>) Is set (S7). Maximum GOP correction ratio (RG<sub>min</sub>) Is calculated by Eq. (Equation 4).
[0068] RG<sub>min</sub>= max ((BL<sub>i, 0</sub>-B<sub>0</sub>) / (LLG-B<sub>0</sub>)) (Equation 4) Here, the GOP upper limit value (LUG) and the GOP lower limit value (LLG) can be arbitrarily set in anticipation of a deviation from the actual code generation amount.
Next, regarding the VBV buffer occupancy rate (%) at the start of each GOP, the initial buffer occupancy rate (B).<sub>0</sub>) Is determined (S8). Initial buffer occupancy (B)<sub>0</sub>), The VBV buffer occupancy rate (%) at the start of the GOP is the correction ratio (RG) calculated in step S5.<sub>max</sub>) Is corrected (S9). That is, as shown in FIG. 7, the buffer occupancy rate (%) of all frames in the GOP is the correction ratio (RG).<sub>max</sub>) Is uniformly reduced (in the example of FIG. 7, the solid line buffer occupancy rate (%) is corrected to the broken line buffer occupancy rate (%)). For example, the i-th VBV buffer occupancy (BL') corrected by step S9.<sub>i, 0</sub>) Is calculated by Eq. (Equation 5).
[0070] BL'<sub>i, 0</sub>= B<sub>0</sub>+ (BL<sub>i, 0</sub>-B<sub>0</sub>) / RG<sub>max</sub> (Equation 5) Next, for the VBV buffer occupancy rate (%) at the start of each GOP, the initial buffer occupancy rate (B)<sub>0</sub>) Is smaller (S10). Initial buffer occupancy (B)<sub>0</sub>), The VBV buffer occupancy rate (%) at the start of the GOP is the correction ratio (RG) calculated in step S7.<sub>min</sub>) Is corrected (S11). In such correction, the buffer occupancy (%) of all frames in the GOP is the correction ratio (RG).<sub>min</sub>), It will be raised uniformly. For example, the i-th VBV buffer occupancy (BL') corrected by step S11.<sub>i, 0</sub>) Is calculated by Eq. (Equation 6).
[0071] BL'<sub>i, 0</sub>= B<sub>0</sub>+ (BL<sub>i, 0</sub>-B<sub>0</sub>) / RG<sub>min</sub> (Equation 6) When the VBV buffer occupancy rate (%) at the start of each GOP is corrected in this way, the assigned code amount of each GOP is calculated based on these correction results (S12). For example, NG the number of frames in the i-th GOP<sub>i</sub>, When the amount of VBV buffer reduction (bits) for each frame is R, the amount of code assigned to the i-th GOP (TG'<sub>i</sub>) Is calculated by Eq. (Equation 7).
[0072] TG'<sub>i</sub>= R NG<sub>i</sub>+ (BL<sub>i + 1,0</sub>-BL<sub>i, 0</sub>) B (Number 7) Here, BL<sub>i + 1,0</sub>, BL<sub>i, 0</sub>In, the one corrected in step S7 or step S9 is the corrected BL'<sub>i + 1,0</sub>, BL'<sub>i, 0</sub>, The uncorrected BL calculated in step S3<sub>i + 1,0</sub>, BL<sub>i, 0</sub>To use.
[0073] As described above, in the first stage, the code generation amount is corrected in the GOP unit, and the code amount is assigned to each GOP. As a result, first, the occurrence of overflow and underflow can be suppressed as much as possible in GOP units.
[0074] If the sequence to be encoded does not have a GOP structure and the sequence is short, the whole is regarded as one GOP and the above processing is skipped. Further, when the sequence to be encoded does not have a GOP structure and the sequence is long, the whole is divided into a plurality of sequences, each of which is regarded as a GOP, and the above processing is performed.
(2) Correction of Code Generation Amount of First Frame In the correction of the first step, the VBV buffer occupancy rate (%) for each frame in the GOP is not considered, and the VBV buffer occupancy rate is not considered in GOP units. Since the amount of code to be allocated is determined in consideration of (%), the buffer occupancy rate (%) of the frame in the GOP may be larger than the frame upper limit value (LUF) of the preset VBV buffer occupancy rate (%). Alternatively, it may be smaller than the frame lower limit (LLF) of the VBV buffer occupancy (%). In such a case, in this second step, the code generation amount of the first frame is corrected and the optimum code amount is assigned to the first frame. Then, the correction of the code generation amount of the frames other than the first frame is performed in the third stage.
[0076] Hereinafter, the correction of the amount of code generated in the first frame of the second stage will be described with reference to FIGS. 8 and 9. FIG. 8 is a flowchart showing the processing of the code generation amount correction of the first frame by the code allocation calculation unit 53d, and FIG. 9 is a diagram showing the buffer occupancy rate (%) in the code generation amount correction of the first frame. is there.
First, the target code generation amount (bits) of the first frame of the GOP is calculated from the ratio of the target code generation amount (bits) of the GOP to the image complexity index of the first frame and the image complexity index of the GOP. Calculated (S21). For example, SF the image complexity index of the first frame of the i-th GOP<sub>i, 0</sub>SG image complexity index for i-th GOP<sub>i</sub>If, the target code generation amount (bits) (TF) of the first frame of the i-th GOP<sub>i, 0</sub>) Is calculated by Eq. (Equation 8).
[0078] TF<sub>i, 0</sub>= TG<sub>i</sub>·SCIENCE FICTION<sub>i, 0</sub>/ SG<sub>i</sub> (Equation 8) Next, based on the obtained VBV buffer occupancy rate (%) at the start of the GOP, the VBV buffer occupancy rate (%) of the first frame (for example, the VBV of the first frame of the i-th GOP). Buffer occupancy BU<sub>i, 0</sub>) Is calculated by Eq. (Equation 9) (S22).
BU<sub>i, 0</sub>= BL<sub>i, 0</sub>+ TF<sub>i, 0</sub>/ B (Equation 9) Next, whether the VBV buffer occupancy (%) of the first frame is larger than the frame upper limit (LUF) of the preset VBV buffer occupancy (%) (overflow). Whether or not) is determined (S23). If it is determined to be greater than the frame upper limit (LUF), the VBV buffer occupancy (%) of the first frame is corrected (S24). For example, the buffer occupancy of the first frame of the i-th GOP after correction (BU'<sub>i, 0</sub>) Is calculated by Eq. (Equation 10).
[0080] BU'<sub>i, 0</sub>= LUF (Equation 10) In the example in Figure 9, the VBV buffer occupancy (BU) of the first frame<sub>i, 0</sub>) Is deducted from (X) that exceeds the frame upper limit (LUF), and the new VBV buffer occupancy (BU'<sub>i, 0</sub>) Indicates that it is set. The amount of code for this deducted "X", that is, the amount of code that should be originally assigned to the first frame, is the later frame (other than the first frame in the same GOP) by the correction of the third stage described later. It will be supplemented (proportional distribution) to the frame).
Next, whether or not the VBV buffer occupancy rate (%) of the first frame of the GOP is smaller than the frame lower limit value (LLF) of the preset VBV buffer occupancy rate (%) (underflow). Whether or not) is judged (S25). If it is determined to be less than the frame lower limit (LLF), the VBV buffer occupancy (%) of the first frame is corrected (S26). For example, the buffer occupancy of the first frame of the i-th GOP after correction (BU'<sub>i, 0</sub>) Is calculated by Eq. (Equation 11).
[0082] BU'<sub>i, 0</sub>= LLF (Equation 11) Here, the frame upper limit value (LUF) and the frame lower limit value (LLF) can be arbitrarily set in anticipation of a deviation from the actual code generation amount.
[0083] When the VBV buffer occupancy (%) of the first frame of the GOP is corrected in this way, the allocated code amount of the first frame of the GOP is calculated based on these correction results (S27). For example, the allocated code amount (TF') of the first frame of the i-th GOP.<sub>i, 0</sub>) Is calculated by Eq. (Equation 12).
[0084] TF'<sub>i, 0</sub>= (BU<sub>i, 0</sub>-BL<sub>i, 0</sub>) B (number 12) Here, BU<sub>i, 0</sub>In, the one corrected in step S24 or step S26 is the corrected BU'<sub>i, 0</sub>, The uncorrected BU calculated in step S22<sub>i, 0</sub>To use.
[0085] Note that the correction of the amount of code generated in the first frame is intended for all GOPs in the sequence to be coded.
[0086] As described above, in the second stage, the code generation amount of the first frame in the GOP is corrected, and the optimum code amount is assigned to the first frame. As a result, the code amount of the first frame is determined, and based on this, the code generation amount of the frames other than the first frame can be corrected in the third stage. In this way, the reason why the amount of code generated in the first frame is corrected first is that, as described above, the GOP usually has a structure in which the P picture and the B picture come after the I picture. Since P-picture and B-picture are predicted by referring to the frame of I-picture, the code generation amount of I-picture, which is the first frame, is maintained as much as possible in order to obtain a beautiful image. Because it is necessary to do. That is, if the VBV buffer occupancy rate of the first frame does not overflow in the second stage, the code generation amount of the I picture, which is the first frame, is maintained as it is and is not corrected in the subsequent third stage. Also, if the VBV buffer occupancy of the first frame overflows in the second stage, the amount of code generated in the I picture in the first frame is minimally corrected, and then in the third stage. Because it is not corrected, a beautiful image can be secured.
(3) Correction of Code Generation Amount in Frame Units In the correction of the second stage, the code generation amount of the first frame of the GOP was corrected and the optimum code amount was assigned. In the correction at the stage of, the amount of code generated in frames other than the first frame is corrected, and the optimum amount of code is assigned.
[0088] Hereinafter, the correction of the code generation amount in the frame unit of the third stage will be described with reference to FIGS. 10 and 11. FIG. 10 is a flowchart showing the processing of the code generation amount correction in the frame unit by the code allocation calculation unit 53d, and FIG. 11 is a diagram showing the buffer occupancy rate (%) in the code generation amount correction in the frame unit. is there.
First, the target code generation amount (bits) of each frame other than the first frame in the GOP is calculated based on the image complexity index of each frame (S31). The target code generation amount (bits) of each frame is calculated by subtracting the code amount of the first frame from the code amount assigned to the GOP and proportionally allocating it by the image complexity index. For example, t = TG<sub>i</sub>-TF<sub>i, 0</sub>And s = SG<sub>i</sub>-SCIENCE FICTION<sub>i, 0</sub>Then, the target code generation amount (bits) (TF) of the jth frame of the i-th GOP<sub>i, j</sub>) Is calculated by Eq. (Equation 13).
[0090] TF<sub>i, j</sub>= t SF<sub>i, j</sub>/ s (Equation 13) Next, the VBV buffer occupancy rate (%) before and after the frame data is generated is calculated based on the obtained target code generation amount (bits) of the GOP frame (S32). .. For example, if the VBV buffer size (bits) is B, the VBV buffer occupancy rate (BU) after the data of the jth frame of the i-th GOP is generated.<sub>i, j</sub>) Is calculated by Eq. (Equation 14).
BU<sub>i, j</sub>= BL<sub>i, j</sub>+ TF<sub>i, j</sub>/ B (Equation 14) Also, "BL" in Equation (Equation 13)<sub>i, j</sub>Indicates the VBV buffer occupancy rate (%) before the data generation of the jth frame of the i-th GOP, and is calculated by, for example, the equation (Equation 15).
BL<sub>i, j + 1</sub>= BU<sub>i, j</sub>-R / B (Equation 15) Thus, the BU shown in Fig. 11<sub>i, j</sub>, BL<sub>i, j</sub>Is calculated, the frame correction ratio on the overflow side (RF)<sub>max</sub>) Is set to "1", and the frame correction ratio (RF) on the underflow side<sub>min</sub>) Is set to "1" (S33). This RF<sub>max</sub>, RF<sub>min</sub>Is a parameter used for correcting the amount of code generated in frame units, and is set to "1" (that is, indicating no correction) in the initial stage.
Next, as shown in FIG. 11A, a target (ideal) line between the buffer occupancy (%) of the first frame and the last frame buffer occupancy (%) in one GOP. The value of is calculated (S34). For example, BU the VBV buffer occupancy of the first frame of the i-th GOP.<sub>i, 0</sub>And the last frame of the i-th GOP (total number of frames of the i-th GOP (NG)<sub>i</sub>)-1) BU VBV buffer occupancy<sub>i, NGi-1</sub>, Then, the value of the target line of the jth frame of the i-th GOP (K)<sub>j</sub>) Is calculated by Eq. (Equation 16).
[0094] K<sub>j</sub>= BU<sub>i, 0</sub>+ (BU<sub>i, NGi-1</sub>-BU<sub>i, 0</sub>) J / (NG<sub>i</sub>-1) (Equation 16) Next, the VBV buffer occupancy rate (%) after the data generation of the frame calculated in step S32 is calculated from the frame upper limit value (LUF) of the preset VBV buffer occupancy rate (%). Whether or not there is a large frame (whether or not there is an overflow frame) is determined (S35). Frame correction ratio (RF) for all frames judged to overflow<sub>max</sub>) Is calculated, of which the maximum frame correction ratio (RF)<sub>max</sub>) Is the new frame correction ratio (RF)<sub>max</sub>) Is set (S36). Maximum frame correction ratio (RF<sub>max</sub>) Is calculated by Eq. (Equation 17).
[0095] RF<sub>max</sub>= max ((BU<sub>i, j</sub>-K<sub>j</sub>) / (LUF-K<sub>j</sub>)) (Equation 17) Next, the VBV buffer occupancy rate (%) before data generation of the frame calculated in step S32 is smaller than the frame lower limit value (LLF) of the preset VBV buffer occupancy rate (%). Whether or not there is a frame (whether or not there is an underflow frame) is determined (S37). Frame correction ratio (RF) for all frames judged to be underflow<sub>min</sub>) Is calculated, of which the maximum frame correction ratio (RF)<sub>min</sub>) Is the new frame correction ratio (RF)<sub>min</sub>) Is set (S38). Maximum frame correction ratio (RF<sub>min</sub>) Is calculated by Eq. (Equation 18).
[0096] RF<sub>min</sub>= max ((K<sub>j</sub>-BL<sub>i, j</sub>) / (K<sub>j</sub>-LLF)) (Equation 18) In Fig. 11 (A), the jth frame of the i-th GOP is underflowing.<sub>j</sub>-BL<sub>i, j</sub>) / (K<sub>j</sub>-LLF) corresponds to a / b in FIG. 11 (B). Of the "a / b" of frames in the same GOP (limited to frames causing underflow), the largest value is RF<sub>min</sub>Is set as.
Next, the VBV buffer occupancy rate (%) after the data generation of one frame is the value of the target line (K).<sub>j</sub>), And the VBV buffer occupancy (%) before data generation in the next frame of that frame is also the value of the target line (K).<sub>j</sub>) Is determined whether or not there is one frame that satisfies the condition (S39). For example, BU<sub>i, j</sub>> K<sub>j</sub>And BL<sub>i, j + 1</sub>> K<sub>j + 1</sub>It is determined whether or not there is a jth frame that satisfies the condition of. If it is determined that there is such a frame, the VBV buffer occupancy (%) after the data generation of that frame is the frame correction ratio (RF) calculated in step S36.<sub>max</sub>) Is corrected (S40). For example, if such a frame is the jth frame, the VBV buffer occupancy (BU') after the data of the jth frame after correction is generated.<sub>i, j</sub>) Is calculated by Eq. (Equation 19).
[0098] BU'<sub>i, j</sub>= K<sub>j</sub>+ (BU<sub>i, j</sub>-K<sub>j</sub>) / RF<sub>max</sub> (Equation 19) Such correction is performed for all frames satisfying the above conditions.
Next, the VBV buffer occupancy rate (%) after the data generation of one frame is the value of the target line (K).<sub>j</sub>), And the VBV buffer occupancy (%) before data generation in the next frame of that frame is also the value of the target line (K).<sub>j</sub>) It is determined whether or not there is one frame that satisfies the condition of being smaller (S41). For example, BU<sub>i, j</sub><K<sub>j</sub>And BL<sub>i, j + 1</sub><K<sub>j + 1</sub>It is determined whether or not there is a jth frame that satisfies the condition of. If it is determined that there is such a frame, the VBV buffer occupancy (%) before data generation in the next frame of that frame is the frame correction ratio (RF) calculated in step S38.<sub>min</sub>) Is corrected (S42). For example, if such a frame is the jth frame, the VBV buffer occupancy (BL') before the data generation of the j + 1th frame after correction<sub>i, j + 1</sub>) Is calculated by Eq. (Equation 20).
[0100] BL'<sub>i, j + 1</sub>= K<sub>j + 1</sub>-(K<sub>j + 1</sub>-BL<sub>i, j + 1</sub>) / RF<sub>min</sub> (Equation 20) That is, as shown in Fig. 11 (C), the VBV buffer occupancy (%) of frames other than the first frame is RF.<sub>min</sub>Proportional correction at = b / a.
[0101] Also, BU'<sub>i, j</sub>And BL'<sub>i, j + 1</sub>The relationship with is expressed by Eq. (Equation 21).
[0102] BU'<sub>i, j</sub>= BL'<sub>i, j + 1</sub>+ R / B (Equation 21) The processing shown in Fig. 10 is performed for all GOPs in the sequence, but it is determined that there is no overflow frame in step 35 and no underflow frame in step S37. The above correction will not be made for the GOP that has been made.
[0103] When the VBV buffer occupancy (%) of the frames other than the first frame of the GOP is corrected in this way, the allocation code amount of the frames other than the first frame of the GOP is calculated based on these correction results ( S43). For example, the allocated code amount of the j-th frame of the i-th GOP (TF'<sub>i, j</sub>) Is calculated by Eq. (Equation 22).
[0104] TF'<sub>i, j</sub>= R + (BL<sub>i, j + 1</sub>-BL<sub>i, j</sub>) B = R + (BU<sub>i, j</sub>-BU<sub>i, j-1</sub>) B (Number 22) Here, BL<sub>i, j + 1</sub>, BL<sub>i, j</sub>The one corrected in step S42 is the corrected BL'<sub>i, j + 1</sub>, BL'<sub>i, j</sub>, The uncorrected BL calculated in step S32<sub>i, j + 1</sub>, BL<sub>i, j</sub>To use. Also, BU<sub>i, j</sub>, BU<sub>i, j-1</sub>The one corrected in step S40 is the corrected BU'<sub>i, j</sub>, BU'<sub>i, j-1</sub>, The uncorrected BU calculated in step S32<sub>i, j</sub>, BU<sub>i, j-1</sub>To use.
[0105] As described above, in the third stage, the code generation amount is corrected for each frame, and the optimum code amount is assigned to each frame (excluding the first frame). As a result, overflow and underflow of each frame can be completely eliminated.
[0106] As described above, the code allocation calculation unit 53d performs the above-mentioned three-step correction, allocates the optimum code amount, and then uses the code amount as the rate signal Sr to be used as the rate signal Sr, and the quantization control unit 55. Output to. Then, as described above, the coding unit 52 quantizes the conversion signal Sd on a quantization scale determined based on the rate signal Sr from the quantization control unit 55, creates a video stream, and outputs the video stream.
[0107] The video stream created in this way can reproduce a high-quality image without causing overflow or underflow when decoded by the MPEG decoder.
[0108] FIGS. 12 to 14 show simulation results of the above correction. FIG. 12 shows the VBV buffer occupancy rate (%) and the allocated code amount (bits) before and after the correction in GOP units. As shown in FIG. 12, the buffer occupancy rate 55 before correction has a GOP that is not within the range of the GOP upper limit value (LUG = 75%) of the buffer occupancy rate and the GOP lower limit value (LLG = 15%) of the buffer occupancy rate. Although it exists and causes overflow and underflow, it can be seen that the corrected buffer occupancy rate 56 is within this range. Further, FIG. 13 shows the VBV buffer occupancy rate (%) and the allocated code amount (bits) before and after the correction in frame units, and is related to the correction on the overflow side. FIG. 14 shows the VBV buffer occupancy rate (%) and the allocated code amount (bits) before and after the correction in frame units, and is related to the correction on the underflow side. Looking at FIGS. 13 and 14 together, the buffer occupancy rate 60 before correction is the frame upper limit value (LUF = 85%) of the buffer occupancy rate shown in FIG. 13 and the frame lower limit value of the buffer occupancy rate shown in FIG. There are frames that are not within the range of (LLG = 15%), causing overflow and underflow, but it can be seen that the corrected buffer occupancy rate 61 is within this range. Further, as described above, it can be seen that such correction is corrected centering on the ideal line 62.
[0109] In the above embodiment, the above three stages of correction are performed and the optimum code amount is assigned, but the present invention is not limited to this, and for example, the above first stage correction (in GOP units). The optimum code amount may be assigned by performing only the correction of the code generation amount), or the correction of the second stage (correction of the code generation amount of the first frame) and the third stage of the above. The optimum code amount may be assigned by performing only the correction (correction of the code generation amount in frame units).
[0110] Further, in the above embodiment, the names of the I picture, the P picture, the B picture, and the GOP are the names in MPEG-1 and MPEG-2, but in the case of MPEG-4, the I picture is referred to as I-. The same function can be realized by reading VOP (Video Object Plane), P picture as P-VOP, B picture as B-VOP, and GOP as GOV (Group Of VOP). The image group having a predetermined number of image frames also includes GOV.
[Effect of the Invention] As described above, according to the present invention, with respect to the code generation amount calculated based on the image complexity index of each image group and each frame constituting the video sequence. By performing three-step correction, the optimum code amount that does not cause overflow or underflow can be assigned. Further, the correction of the code generation amount of the first frame is minimized, and the code generation amount of the first frame can be maintained as much as possible, so that a clearer image can be secured.
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a diagram showing an ideal (virtual) model of an MPEG decoder according to an embodiment of the present invention.
FIG. 2 is a diagram showing a transition state of data occupancy (bits) of the VBV buffer according to the embodiment of the present invention.
FIG. 3 is a diagram showing a transition state of data occupancy (bits) of the VBV buffer when there is overflow or underflow in FIG.
FIG. 4 is a schematic configuration diagram of an MPEG encoder 100 according to an embodiment of the present invention.
FIG. 5 is a flowchart showing a correction process of a code generation amount according to an embodiment of the present invention.
FIG. 6 is a flowchart showing a process of correcting the amount of code generated in GOP units by the code allocation calculation unit according to the embodiment of the present invention.
FIG. 7 is a diagram showing a buffer occupancy rate (%) in correction of a code generation amount in GOP units.
FIG. 8 is a flowchart showing a process of correcting the code generation amount of the first frame by the code allocation calculation unit according to the embodiment of the present invention.
FIG. 9 is a diagram showing a buffer occupancy rate (%) in the correction of the code generation amount of the first frame.
FIG. 10 is a flowchart showing a process of correcting the amount of code generated in frame units by the code allocation calculation unit according to the embodiment of the present invention.
FIG. 11 is a diagram showing a buffer occupancy rate (%) in correction of a code generation amount in a frame unit.
FIG. 12 is a diagram showing VBV buffer occupancy rate (%) and allocated code amount (bits) before and after correction in GOP units.
FIG. 13 shows the VBV buffer occupancy rate (%) and the allocated code amount (bits) before and after the correction in frame units, and is a diagram relating to the correction on the overflow side.
FIG. 14 shows the VBV buffer occupancy rate (%) and the allocated code amount (bits) before and after the correction in frame units, and is a diagram relating to the correction on the underflow side.
FIG. 15 is a diagram showing interrelationships of an image complexity index and a target code generation amount when expressed in frame units, GOP units, and total GOP.
[Description of Code] 10 ... VBV Buffer 20 ... MPEG Decoder 30 ... Alignment Buffer 50 ... Acquisition Unit 51 ... Motion Detection Unit 52 ... Coding Unit 52a ... Addition Unit 52b ... Discrete cosine conversion unit 52c ... Quantization unit 52d ... Variable length coding unit 52e ... Inverse quantization unit 52f ... Inverse discrete cosine conversion unit 52g ... Frame accumulation and compensation prediction Part 53 ... Optimal code amount calculation part 53a ... Image complexity index calculation part 53b ... Image complexity index storage part 53c ... Selector 53d ... Code amount allocation calculation part 54 ... Occurrence code Quantitative calculation unit 55 ... Quantization calculation unit 56 ... multiplexer 57 ... buffer memory
Every citation, both ways
| Document | Relation | Office |
|---|---|---|
| JP11098514A | Cites | Japan |
| JP10304311A | Cites | Japan |
| WO97039588A1 | Cites | World Intellectual Property Organization (WIPO) |
4 members in 2 offices
Priority claims2
| Document | Office | Kind | Date |
|---|---|---|---|
| 2000174064 | Japan | A | |
| JP20000174064 | – | – | – |
Members4
| Document | Office | Kind | |
|---|---|---|---|
| JP2001359097A | Japan | A | |
| US2002009138A1 | United States of America | A1 | |
| US6940902B2 | United States of America | B2 | |
| JP3889552B2This record | Japan | B2 |
14 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Cancellation because of no payment of annual feesLAPS | LAPS | |
| Renewal fee payment (event date is renewal date of database)FPAY | FPAY | |
| Renewal fee payment (event date is renewal date of database)FPAY | FPAY | |
| Renewal fee payment (event date is renewal date of database)FPAY | FPAY | |
| Renewal fee payment (event date is renewal date of database)FPAY | FPAY | |
| Certificate of patent or registration of utility modelJAPANESE INTERMEDIATE CODE: R150R150 | R150 | |
| First payment of annual fees (during grant procedure)JAPANESE INTERMEDIATE CODE: A61A61 | A61 | |
| Written decision to grant a patent or to grant a registration (utility model)JAPANESE INTERMEDIATE CODE: A01A01 | A01 | |
| Decision of grant or rejection writtenTRDD | TRDD | |
| Written amendmentJAPANESE INTERMEDIATE CODE: A523A521 | A521 | |
| Notification of reasons for refusalJAPANESE INTERMEDIATE CODE: A131A131 | A131 | |
| Written amendmentJAPANESE INTERMEDIATE CODE: A523A521 | A521 | |
| Notification of reasons for refusalJAPANESE INTERMEDIATE CODE: A131A131 | A131 | |
| Written request for application examinationJAPANESE INTERMEDIATE CODE: A621A621 | A621 |
Numbers
- Publication
- 3889552
- Publication, DOCDB
- 3889552
- Publication, EPODOC
- JP3889552B
- Application
- 174064
- Application, DOCDB
- 2000174064
- Application, EPODOC
- JP20000174064
Titles2
- Japanese
- 符号量割り当て装置および方法
- English
- Code amount allocation device and method
Classification
- CPC, 10
- H04N19/177
- H04N19/115
- H04N19/124
- H04N19/14
- H04N19/149
- H04N19/152
- H04N19/172
- H04N19/196
- H04N19/197
- H04N19/61
- IPC, 13
- H04N7 30
- H03M7 30
- H04N5 92
- H04N7 26
- H04N19 00
- H04N19 115
- H04N19 149
- H04N19 172
- H04N19 196
- H04N19 423
- H04N19 60
- H04N19 625
- H04N19 91