JP2003299081A - Encoder, encoding method, program and recording medium - Google Patents

Encoder, encoding method, program and recording medium

Info

Publication number
JP2003299081A
JP2003299081A JP2002104315A JP2002104315A JP2003299081A JP 2003299081 A JP2003299081 A JP 2003299081A JP 2002104315 A JP2002104315 A JP 2002104315A JP 2002104315 A JP2002104315 A JP 2002104315A JP 2003299081 A JP2003299081 A JP 2003299081A
Authority
JP
Japan
Prior art keywords
bit
uncompressed data
encoding
amount
detecting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2002104315A
Other languages
Japanese (ja)
Other versions
JP4273386B2 (en
Inventor
Hiromichi Ueno
弘道 上野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2002104315A priority Critical patent/JP4273386B2/en
Publication of JP2003299081A publication Critical patent/JP2003299081A/en
Application granted granted Critical
Publication of JP4273386B2 publication Critical patent/JP4273386B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To decide the maximum value of a sum value sum<SB>-</SB>sup of a bit supply quantity, according to the margin of a VBV (video buffering verifier) buffer size. <P>SOLUTION: In a step S31, the generating code amount of a nearest I picture is detected, and in a step S32, it is determined that max<SB>-</SB>sum<SB>-</SB>sup=VBV buffer size is the generating amount of the I picture. In a step S33, it is judged that a scene change occurs. If it is judged that the scene change occurs in a step S34, the encoding difficulties of the I picture of the scene change and an I picture before one picture are obtained. In a step S35, the difference between the two I pictures in coding difficulty are calculated, and the value of max<SB>-</SB>sum<SB>-</SB>sup calculated in the step S32 is increased or decreased on the basis of the difference in the coding difficulty, i.e., a scene change from a difficult image to an easy image or a scene change from the easy image to the difficult image. <P>COPYRIGHT: (C)2004,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、符号化装置および
符号化方法、プログラム、並びに記録媒体に関し、特
に、フィードバック型レート制御において、ビット補給
レート制御を行う場合に用いて好適な、符号化装置およ
び符号化方法、プログラム、並びに記録媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a coding device, a coding method, a program, and a recording medium, and particularly to a coding device suitable for use in a bit rate control in feedback rate control. And an encoding method, a program, and a recording medium.

【0002】[0002]

【従来の技術】近年、映像データおよび音声データを圧
縮して情報量を減らす方法として、種々の圧縮符号化方
法が提案されており、その代表的なものにMPEG2
(MovingPicture Experts Group Phase 2)がある。
2. Description of the Related Art In recent years, various compression coding methods have been proposed as a method of compressing video data and audio data to reduce the amount of information, of which MPEG2 is a typical one.
(MovingPicture Experts Group Phase 2) is available.

【0003】このような画像圧縮方式において、良好な
エンコード画質を得る方法として、TM5(Test Model
5)がある。TM5のステップ1においては、ピクチャ
単位に与えるターゲットビットの算出を行う。ターゲッ
トビットの算出においては、ピクチャタイプ別のGC
(Global Complexity)のそれぞれの比率に応じて、そ
のGOP(Group of Picture)内の残りのピクチャに割
り当てることができるビット量Rを比例配分して、各ピ
クチャに割り当てるビット量を算出する。
In such an image compression method, TM5 (Test Model
There is 5). In step 1 of TM5, the target bit to be given for each picture is calculated. When calculating the target bit, the GC for each picture type is used.
The bit amount R that can be assigned to the remaining pictures in the GOP (Group of Pictures) is proportionally distributed according to each ratio of (Global Complexity), and the bit amount to be assigned to each picture is calculated.

【0004】TM5は、GOPあたりの発生ビット量を
ほぼ一定にするために優れた方法であるが、固定レート
符号化を行う場合には、必ずしも、GOPの発生ビット
量を一定にする必要はない。固定レート符号化において
は、VBV(Video Buffering Verifier)バッファの占
有量が、規定値をオーバーフロー、あるいはアンダーフ
ローしないようにしなければならない。
TM4 is an excellent method for making the amount of generated bits per GOP almost constant, but when performing fixed rate coding, it is not always necessary to make the amount of generated bits of GOP constant. . In fixed-rate encoding, it is necessary to prevent the occupied amount of a VBV (Video Buffering Verifier) buffer from overflowing or underflowing a specified value.

【0005】TM5においては、GOPあたりの発生ビ
ット量がほぼ一定であるから、VBVバッファがオーバ
ーフローあるいはアンダーフローすることはない。しか
しながら、TM5においては、低いビットレートで符号
化した場合に、バッファ容量を有効利用することができ
ない。例えば、MPEGのMP@PLにおいて、TM5
を適用した場合、VBVバッファ容量は約1.8Mbi
tであるのに対して、バッファから引き抜かれる1枚あ
たりのピクチャのビット量が少ないため、約1.8Mb
itを有効に利用することができない。
In TM5, since the amount of generated bits per GOP is almost constant, the VBV buffer does not overflow or underflow. However, in TM5, the buffer capacity cannot be effectively used when encoding is performed at a low bit rate. For example, TM5 in MP @ PL of MPEG
, The VBV buffer capacity is about 1.8 Mbi.
However, since the number of bits per picture that is pulled out from the buffer is small, it is about 1.8 Mb.
It cannot be used effectively.

【0006】このように、入力される絵柄に関わらず、
一定量のビット量を割り当ててしまうことにより、符号
化難易度が高い絵柄については、符号化歪みが顕著に発
生してしまい、一方、符号化難易度が低い絵柄は、符号
化歪みが少ないため、全体として、むらの多い不安定な
画像になってしまう。
As described above, regardless of the input pattern,
By assigning a certain amount of bits, coding distortion will occur remarkably for pictures with high coding difficulty, while pictures with low coding difficulty will have less coding distortion. , As a whole, it becomes an unstable image with a lot of unevenness.

【0007】このような問題を解決するために、符号化
難易度が高い絵柄には、バッファがアンダーフローしな
い範囲で、より多くのビット量を配分し、一方、符号化
難易度が低い絵柄には、バッファがオーバーフローしな
い範囲で、絵柄に適した少ないビット量を配分する必要
がある。
In order to solve such a problem, a larger amount of bits is allocated to a picture having a high degree of coding difficulty in a range where the buffer does not underflow, while a picture having a low degree of coding difficulty is distributed. Needs to allocate a small amount of bits suitable for the picture within the range where the buffer does not overflow.

【0008】そこで、本出願人は、特開平10−754
43において、映像データの部分毎の絵柄の複雑さに応
じて発生ビット量を調節し、全体として、圧縮後の映像
の品質を向上させることができるようにした、映像デー
タ圧縮装置およびその方法について開示している。
Therefore, the applicant of the present invention has filed Japanese Patent Application Laid-Open No. 10-754.
43, a video data compression apparatus and method for adjusting the generated bit amount according to the complexity of a picture for each part of the video data so as to improve the quality of the video after compression as a whole. Disclosure.

【0009】TM5において、GOPの残りのピクチャ
に割り当てることができる使用可能ビット量Rは、レー
トコントロールで重要なパラメータである。例えば、G
OPの前半において、複雑な絵柄の画像が続いたため
に、たくさんのビット量を割り当ててしまうと、GOP
の後半で、ビット量Rが、極端に少なくなってしまった
り、あるいは、負の数になってしまう。
In TM5, the available bit amount R that can be assigned to the remaining pictures of the GOP is an important parameter in rate control. For example, G
In the first half of the OP, images with complicated patterns continued, so if a large amount of bits were allocated, GOP
In the latter half of the above, the bit amount R becomes extremely small or becomes a negative number.

【0010】これに対して、本出願人が特開平10−7
5443において開示したビット補給レート制御とは、
これからエンコードしようとする複数枚のピクチャに対
して割り当てられている使用可能ビット量Rに、そのエ
ンコード対象の画像難易度やVBVバッファ占有量に応
じて、ビット量を加える、あるいは減じる(以下、加え
られる、あるいは減じられるビットをsupplementと称す
る)ことを特徴とするレート制御方式である。
On the other hand, the applicant of the present invention has disclosed in Japanese Patent Laid-Open No. 10-7.
The bit replenishment rate control disclosed in 5443 is
A bit amount is added to or subtracted from the usable bit amount R allocated to a plurality of pictures to be encoded, depending on the image difficulty level of the encoding target and the VBV buffer occupancy amount (hereinafter, added Bits that can be or are subtracted are called supplements).

【0011】[0011]

【発明が解決しようとする課題】以前提案されたビット
補給レート制御は、これからエンコードしようとする複
数枚のピクチャ画像難易度等の情報が全て既知である場
合、すなわちエンコード情報を先読みしたフィードフォ
ワード(Feed Forward)型レート制御に適用されていた
もので、例えば、GOPの15枚のデータを蓄積した
後、その画像符号化難易度を判断していたので、その情
報蓄積に一定の遅延を生じてしまうものである。
The bit replenishment rate control that has been proposed in the past has been proposed in the case where information such as the difficulty levels of a plurality of picture images to be encoded is already known, that is, the feedforward (prefetching the encoding information). This is applied to feed forward type rate control. For example, after the data of 15 GOP data is accumulated, the image encoding difficulty level is judged, so that a certain delay occurs in the information accumulation. It is something that ends up.

【0012】しかしながら、先読み情報を得ることがで
きないフィードバック(Feed Back)型レート制御で
は、未来のVBV余裕度を正確に見積もることができな
いため、sum_supplement(以下、sum_supと称する)の
最大値および最小値をビットレートや使用可能VBVサ
イズによって決定した固定値を用いざるを得なかった。
しかしながら、特に、sum_supの最大値が固定値の場
合、ピクチャの発生量次第によってはVBVアンダーフ
ローを起こしやすくなるなどの問題があり、VBVアン
ダーフローを起こさないようにするためには、VBV余
裕度に応じて、sum_supの最大値を決定する必要があっ
た。
However, with feedback (Feed Back) rate control in which prefetch information cannot be obtained, the future VBV margin cannot be accurately estimated, and therefore the maximum and minimum values of sum_supplement (hereinafter referred to as sum_sup). Was forced to use a fixed value determined by the bit rate and the usable VBV size.
However, in particular, when the maximum value of sum_sup is a fixed value, there is a problem that VBV underflow is likely to occur depending on the amount of generated pictures, and in order to prevent VBV underflow, the VBV margin Therefore, it was necessary to determine the maximum value of sum_sup.

【0013】本発明はこのような状況に鑑みてなされた
ものであり、フィードバック型レート制御において、ビ
ット補給レート制御を行うことができるようにするもの
である。
The present invention has been made in view of such a situation, and it is possible to perform a bit replenishment rate control in a feedback type rate control.

【0014】[0014]

【課題を解決するための手段】本発明の符号化装置は、
非圧縮データの複雑さを検出する第1の検出手段と、非
圧縮データを圧縮符号化する符号化手段と、第1の検出
手段により検出された、符号化手段により過去に符号化
された非圧縮データの複雑さを基に、これから符号化さ
れる非圧縮データに対して割り当てられるVBVバッフ
ァのバッファ容量のうち、使用可能である第1のビット
量に加えられる第2のビット量を算出する算出手段と、
符号化手段により過去に符号化された非圧縮データのう
ちの、フレーム内符号化画像のビット発生量を検出する
第2の検出手段と、VBVバッファのバッファ容量か
ら、第2の検出手段により検出されたフレーム内符号化
画像のビット発生量を減算した値を算出し、第2のビッ
ト量の合計値の最大値として設定する設定手段とを備え
ることを特徴とする。
The encoding device of the present invention is
First detecting means for detecting the complexity of the uncompressed data, encoding means for compression-encoding the uncompressed data, and non-encoding detected in the past by the encoding means detected by the first detecting means. Based on the complexity of the compressed data, the second bit amount added to the usable first bit amount of the buffer capacity of the VBV buffer allocated to the uncompressed data to be encoded is calculated. Calculation means,
Second detection means for detecting the bit generation amount of the intra-frame coded image among the uncompressed data previously coded by the coding means and the second detection means from the buffer capacity of the VBV buffer. Setting means for calculating a value obtained by subtracting the bit generation amount of the generated intra-frame coded image and setting it as the maximum value of the total value of the second bit amounts.

【0015】1つ前のピクチャと次に符号化処理するピ
クチャとで、絵柄が所定の基準値より変化したことを検
出する第3の検出手段と、第3の検出手段により、絵柄
が所定の基準値より変化したことが検出された場合、第
1の検出手段により検出された絵柄の変化前後のフレー
ム内符号化画像の複雑さに基づいて、設定手段により設
定された第2のビット量の合計値の最大値を再設定する
再設定手段とを更に備えさせるようにすることができ
る。
A third detection means for detecting that the picture has changed from a predetermined reference value between the previous picture and the picture to be encoded next, and the third detection means make the predetermined picture. When the change from the reference value is detected, the second bit amount of the second bit amount set by the setting unit is determined based on the complexity of the intra-frame coded image before and after the change of the pattern detected by the first detecting unit. Resetting means for resetting the maximum value of the total value may be further provided.

【0016】本発明の符号化方法は、非圧縮データの複
雑さを検出する第1の検出ステップと、非圧縮データを
圧縮符号化する符号化ステップと、第1の検出ステップ
の処理により検出された、符号化ステップの処理により
過去に符号化された非圧縮データの複雑さを基に、これ
から符号化される非圧縮データに対して割り当てられる
VBVバッファのバッファ容量のうち、使用可能である
第1のビット量に加えられる第2のビット量を算出する
算出ステップと、符号化ステップの処理により過去に符
号化された非圧縮データのうちの、フレーム内符号化画
像のビット発生量を検出する第2の検出ステップと、V
BVバッファのバッファ容量から、第2の検出ステップ
の処理により検出されたフレーム内符号化画像のビット
発生量を減算した値を算出し、第2のビット量の合計値
の最大値に設定する設定ステップとを含むことを特徴と
する。
The encoding method of the present invention is detected by the processes of the first detection step of detecting the complexity of uncompressed data, the encoding step of compressing and encoding the uncompressed data, and the first detection step. In addition, based on the complexity of the uncompressed data encoded in the past by the processing of the encoding step, the available capacity of the VBV buffer allocated to the uncompressed data to be encoded is A calculation step of calculating a second bit amount added to the bit amount of 1 and a bit generation amount of the intra-frame encoded image of the uncompressed data encoded in the past by the processing of the encoding step are detected. Second detection step, V
Setting for calculating a value obtained by subtracting the bit generation amount of the intra-frame coded image detected by the process of the second detection step from the buffer capacity of the BV buffer and setting it to the maximum value of the total value of the second bit amounts And a step.

【0017】本発明の記録媒体に記録されているプログ
ラムは、非圧縮データの複雑さを検出する第1の検出ス
テップと、非圧縮データを圧縮符号化する符号化ステッ
プと、第1の検出ステップの処理により検出された、符
号化ステップの処理により過去に符号化された非圧縮デ
ータの複雑さを基に、これから符号化される非圧縮デー
タに対して割り当てられるVBVバッファのバッファ容
量のうち、使用可能である第1のビット量に加えられる
第2のビット量を算出する算出ステップと、符号化ステ
ップの処理により過去に符号化された非圧縮データのう
ちの、フレーム内符号化画像のビット発生量を検出する
第2の検出ステップと、VBVバッファのバッファ容量
から、第2の検出ステップの処理により検出されたフレ
ーム内符号化画像のビット発生量を減算した値を算出
し、第2のビット量の合計値の最大値に設定する設定ス
テップとを含むことを特徴とする。
The program recorded on the recording medium of the present invention includes a first detecting step for detecting the complexity of uncompressed data, an encoding step for compressing and encoding the uncompressed data, and a first detecting step. Of the buffer capacity of the VBV buffer allocated to the uncompressed data to be encoded in the future, based on the complexity of the uncompressed data encoded in the past by the processing of the encoding step detected by The calculation step of calculating the second bit amount added to the usable first bit amount, and the bit of the intra-frame encoded image of the uncompressed data encoded in the past by the processing of the encoding step. The second detection step of detecting the amount of generation and the intra-frame coded image detected by the processing of the second detection step from the buffer capacity of the VBV buffer It calculates a value obtained by subtracting the bit generation, characterized in that it comprises a setting step of setting the maximum value of the total value of the second bit quantity.

【0018】本発明のプログラムは、非圧縮データの複
雑さを検出する第1の検出ステップと、非圧縮データを
圧縮符号化する符号化ステップと、第1の検出ステップ
の処理により検出された、符号化ステップの処理により
過去に符号化された非圧縮データの複雑さを基に、これ
から符号化される非圧縮データに対して割り当てられる
VBVバッファのバッファ容量のうち、使用可能である
第1のビット量に加えられる第2のビット量を算出する
算出ステップと、符号化ステップの処理により過去に符
号化された非圧縮データのうちの、フレーム内符号化画
像のビット発生量を検出する第2の検出ステップと、V
BVバッファのバッファ容量から、第2の検出ステップ
の処理により検出されたフレーム内符号化画像のビット
発生量を減算した値を算出し、第2のビット量の合計値
の最大値に設定する設定ステップとを含むことを特徴と
する。
The program of the present invention is detected by the processing of the first detection step of detecting the complexity of uncompressed data, the encoding step of compressing and encoding the uncompressed data, and the processing of the first detection step. Based on the complexity of the non-compressed data encoded in the past by the processing of the encoding step, the first available buffer capacity of the VBV buffer allocated to the non-compressed data to be encoded from now on. A calculation step of calculating a second bit amount added to the bit amount, and a second step of detecting the bit generation amount of the intra-frame coded image of the uncompressed data coded in the past by the process of the coding step. Detection step of V
Setting for calculating a value obtained by subtracting the bit generation amount of the intra-frame coded image detected by the process of the second detection step from the buffer capacity of the BV buffer and setting it to the maximum value of the total value of the second bit amounts And a step.

【0019】本発明の符号化装置および符号化方法、並
びにプログラムにおいては、非圧縮データの複雑さが検
出され、非圧縮データが圧縮符号化され、過去に符号化
された非圧縮データの複雑さを基に、これから符号化さ
れる非圧縮データに対して割り当てられるVBVバッフ
ァのバッファ容量のうち、使用可能である第1のビット
量に加えられる第2のビット量が算出され、符号化ステ
ップの処理により過去に符号化された非圧縮データのう
ちの、フレーム内符号化画像のビット発生量が検出さ
れ、VBVバッファのバッファ容量から、検出されたフ
レーム内符号化画像のビット発生量を減算した値が算出
されて、第2のビット量の合計値の最大値に設定され
る。
In the encoding device, the encoding method, and the program of the present invention, the complexity of non-compressed data is detected, the non-compressed data is compression-encoded, and the complexity of non-compressed data encoded in the past is detected. Of the VBV buffer allocated to the uncompressed data to be encoded, a second bit amount added to the usable first bit amount is calculated, and the second bit amount is calculated. The bit generation amount of the intra-frame encoded image of the uncompressed data encoded in the past is detected by the processing, and the bit generation amount of the detected intra-frame encoded image is subtracted from the buffer capacity of the VBV buffer. A value is calculated and set to the maximum value of the total value of the second bit amounts.

【0020】[0020]

【発明の実施の形態】以下、図を参照して、本発明の実
施の形態について説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to the drawings.

【0021】図1は、本発明を適応したエンコーダ1の
構成を示すブロック図である。
FIG. 1 is a block diagram showing the configuration of an encoder 1 to which the present invention is applied.

【0022】画像並び替え部12は、入力された非圧縮
映像データを符号化順に並べ替える。走査変換・マクロ
ブロック化部13は、ピクチャ・フィールド変換を行
い、例えば、非圧縮映像データが映画の映像データであ
る場合、3:2プルダウン処理等を行う。イントラAC
算出部14は、画像並び替え部12および走査変換・マ
クロブロック化部13により処理され、Iピクチャに圧
縮符号化されるピクチャから、イントラAC(intra A
C)を算出する。
The image rearrangement unit 12 rearranges the input uncompressed video data in the order of encoding. The scan conversion / macroblocking unit 13 performs picture / field conversion, and performs, for example, 3: 2 pulldown processing when the uncompressed video data is video data of a movie. Intra AC
The calculation unit 14 is processed by the image rearrangement unit 12 and the scan conversion / macroblocking unit 13, and the intra AC (intra A
Calculate C).

【0023】Iピクチャについては、他のピクチャの参
照なしに圧縮符号化されるため、後述するME残差を求
めることができない。従って、Iピクチャの符号化難易
度を求めるために、ME残差に代わるパラメータとし
て、イントラACが用いられる。イントラACは、MP
EG方式におけるDCT処理単位のDCTブロックごと
の映像データとの分散値の総和として定義されるパラメ
ータであって、映像の複雑さを指標し、映像の絵柄の難
しさおよび圧縮後のデータ量と相関性を有する。すなわ
ち、イントラACとは、DCTブロック単位で、それぞ
れの画素の画素値から、ブロック毎の画素値の平均値を
引いたものの絶対値和の、画面内における総和である。
イントラACは、次の式(1)で示される。
Since the I picture is compression-encoded without reference to other pictures, the ME residual, which will be described later, cannot be obtained. Therefore, the intra AC is used as a parameter in place of the ME residual in order to obtain the coding difficulty of the I picture. Intra AC is MP
It is a parameter defined as a sum of variance values of video data for each DCT block in the DCT processing unit in the EG method, which indicates the complexity of the video and correlates with the difficulty of the picture pattern of the video and the amount of data after compression. Have sex. That is, the intra AC is the total sum of absolute values in the screen obtained by subtracting the average value of the pixel values of each block from the pixel value of each pixel in DCT block units.
The intra AC is represented by the following equation (1).

【0024】[0024]

【数1】 ・・・(1)[Equation 1] ... (1)

【0025】また、式(1)において、式(2)が成り
立つ。
Further, in the equation (1), the equation (2) is established.

【数2】 ・・・・(2)[Equation 2] ... (2)

【0026】イントラAC算出部14は、算出されたイ
ントラACの値を、レートコントロール部15の難易度
算出部32に出力する。
The intra AC calculator 14 outputs the calculated intra AC value to the difficulty calculator 32 of the rate controller 15.

【0027】演算処理部16は、動き補償部25から供
給される動き補償情報を基に、供給された映像データに
対して動き補償を行い、DCT部18に対して出力す
る。DCT部18は、演算処理部16から入力された映
像データに対して、例えば、16画素×16画素のマク
ロブロック単位に離散コサイン変換(DCT)処理を施
し、時間領域のデータから周波数領域のデータに変換し
て、量子化部19に対して出力する。
The arithmetic processing unit 16 performs motion compensation on the supplied video data based on the motion compensation information supplied from the motion compensating unit 25, and outputs it to the DCT unit 18. The DCT unit 18 performs, for example, discrete cosine transform (DCT) processing on the video data input from the arithmetic processing unit 16 in units of macroblocks of 16 pixels × 16 pixels, and converts the time domain data to the frequency domain data. And outputs to the quantizer 19.

【0028】量子化部19は、DCT部18から入力さ
れた周波数領域のデータを、レートコントロール部15
の量子化インデックス決定部35から供給される量子化
インデックスQで量子化し、量子化データとしてVLC
(Variable Length Code;可変長符号化)部20および
逆量子化部22に対して出力する。
The quantizing unit 19 converts the frequency domain data input from the DCT unit 18 into the rate control unit 15.
Quantized by the quantization index Q supplied from the quantization index determination unit 35 of
It outputs to (Variable Length Code) unit 20 and inverse quantization unit 22.

【0029】VLC部20は、量子化部19から入力さ
れた量子化データに対し、所定の変換テーブルに基づく
可変長符号化処理を行い、その結果得られる可変長符号
化データをバッファ21に出力する。
The VLC unit 20 performs variable length coding processing on the quantized data input from the quantizing unit 19 based on a predetermined conversion table, and outputs the resulting variable length coded data to the buffer 21. To do.

【0030】バッファ21は、入力された符号化データ
をバッファリングし、符号化ビットストリームとして、
順次、出力する。
The buffer 21 buffers the input coded data to form a coded bit stream.
Output sequentially.

【0031】逆量子化部22は、量子化部19から入力
された量子化データを、量子化部19が実行した量子化
の量子化ステップで逆量子化し、逆量子化データとして
逆DCT部23に対して出力する。
The inverse quantization unit 22 inversely quantizes the quantized data input from the quantization unit 19 in the quantization step of the quantization executed by the quantization unit 19, and the inverse DCT unit 23 as the inverse quantized data. Output to.

【0032】逆DCT部23は、逆量子化部22から入
力される逆量子化データに対して逆DCT処理を行い、
演算処理部24に対して出力する。
The inverse DCT unit 23 performs inverse DCT processing on the inverse quantized data input from the inverse quantization unit 22,
It is output to the arithmetic processing unit 24.

【0033】演算処理部24は、動き補償部25の出力
データ、および逆DCT部23の出力データを加算し、
動き補償部25に対して出力する。動き検出部17は、
圧縮対象となるピクチャ(入力ピクチャ)の注目マクロ
ブロックと、参照されるピクチャ(参照ピクチャ)との
間の差分値の絶対値和あるいは自乗値和が最小となるよ
うなマクロブロックを探し、動きベクトルを求めて、動
き補償部25に出力する。動き補償部25は、演算処理
部24の出力データに対して、動き検出部17から入力
される動きベクトルに基づいて動き補償処理を行い、演
算処理部24、および演算処理部16に対して出力す
る。
The arithmetic processing unit 24 adds the output data of the motion compensation unit 25 and the output data of the inverse DCT unit 23,
It is output to the motion compensation unit 25. The motion detector 17
The motion vector is searched for a macroblock that minimizes the sum of absolute values or the sum of squared differences between the target macroblock of the picture to be compressed (input picture) and the referenced picture (reference picture). Is calculated and output to the motion compensation unit 25. The motion compensation unit 25 performs motion compensation processing on the output data of the arithmetic processing unit 24 based on the motion vector input from the motion detection unit 17, and outputs the data to the arithmetic processing units 24 and 16. To do.

【0034】レートコントロール部15は、ME残差算
出部31、難易度算出部32、genbit検出部33、ター
ゲットビット決定部34、および量子化インデックス決
定部35で構成され、ターゲットビットおよび量子化イ
ンデックスを決定する。
The rate control unit 15 is composed of an ME residual calculation unit 31, a difficulty calculation unit 32, a genbit detection unit 33, a target bit determination unit 34, and a quantization index determination unit 35, and the target bit and the quantization index. To decide.

【0035】ME残差算出部31は、画像の符号化難易
度と強い相関があるパラメータであるME残差を算出す
る。動き予測によって、参照フレームから入力フレーム
への差分値の絶対値和などが少なくなるような動きベク
トルを求めることができるが、その場合における差分値
の絶対値和、あるいは自乗和などで求められる誤差成分
のパワーがME残差である。Pピクチャ、およびBピク
チャにおいては、ME残差と画像の符号化難易度とは、
ほぼ単純な比例関係を有している。
The ME residual calculation unit 31 calculates the ME residual, which is a parameter having a strong correlation with the image coding difficulty. By motion estimation, it is possible to obtain a motion vector that reduces the sum of absolute difference values from the reference frame to the input frame, but in that case, the error obtained by the sum of absolute difference values or the sum of squares. The power of the component is the ME residual. In the P picture and the B picture, the ME residual and the image coding difficulty are
It has an almost simple proportional relationship.

【0036】難易度算出部32は、ME残差算出部31
から入力されるME残差による近似により、式(3)、
および、式(4)を用いて、PピクチャおよびBピクチ
ャの符号化難易度Djを算出する。
The difficulty level calculation unit 32 uses the ME residual calculation unit 31.
By the approximation with the ME residual input from Equation (3),
Also, the coding difficulty Dj of the P picture and the B picture is calculated using the equation (4).

【数3】 ・・・(3)[Equation 3] ... (3)

【数4】 ・・・(4)[Equation 4] ... (4)

【0037】ここで、MEjは、j番目のピクチャにお
けるME残差であり、aP、aB、b P、bBは、それぞ
れ、1次式で近似した場合の傾きと補正値である。
Here, MEj is the j-th picture.
KE ME residual, aP, AB, B P, BBIs that
Is a slope and a correction value when approximated by a linear expression.

【0038】また、難易度算出部32はイントラAC算
出部14から入力されるイントラACによる近似によ
り、同様にIピクチャの符号化難易度Djを算出し、ター
ゲットビット決定部34に出力する。
Further, the difficulty calculation section 32 similarly calculates the coding difficulty Dj of the I picture by approximation by the intra AC input from the intra AC calculation section 14, and outputs it to the target bit determination section 34.

【0039】そして、難易度算出部32は、それそれの
ピクチャで算出された符号化難易度Djから、GOP毎
の難易度平均avgDを算出する。
Then, the difficulty level calculator 32 calculates the average difficulty level avgD for each GOP from the coding difficulty level Dj calculated for each picture.

【0040】genbit検出部33は、バッファ21にバッ
ファリングされている符号化データから、直近に符号化
されたIピクチャの発生ビット量genbitを検出し、その
値を、ターゲットビット決定部34に出力する。
The genbit detection unit 33 detects the generated bit amount genbit of the most recently encoded I picture from the encoded data buffered in the buffer 21, and outputs the value to the target bit determination unit 34. To do.

【0041】ターゲットビット決定部34は、難易度算
出部32から入力された符号化難易度Dj、および、gen
bit検出部33から入力されたIピクチャの発生ビット量
genbitに基づいて、各ピクチャタイプのピクチャそれぞ
れのターゲットビットを算出して、レート制御を行う。
The target bit determination unit 34 receives the encoding difficulty Dj and the gen input from the difficulty calculation unit 32.
Amount of generated bits of I picture input from bit detector 33
The target bit of each picture of each picture type is calculated based on the genbit, and the rate control is performed.

【0042】すなわち、ターゲットビット決定部34
は、後述する処理により、エンコードを終了した過去の
画像における難易度などを基に、これからエンコードし
ようとする複数枚のピクチャに対して割り当てられてい
る使用可能ビット量Rに加えられるsupplementの値(su
pplementは、正の値である場合、負の値である場合、0
である場合がある)を決定する。ターゲットビット決定
部34は、この使用可能ビット量R+supplementを基
に、ターゲットビットの値を求め、量子化インデックス
決定部35に出力する。
That is, the target bit determining unit 34
Is the value of the supplement added to the usable bit amount R assigned to the plurality of pictures to be encoded, based on the difficulty of the past image that has been encoded by the process described later ( su
pplement is 0 for positive and negative values
May be). The target bit determination unit 34 determines the value of the target bit based on the usable bit amount R + supplement and outputs it to the quantization index determination unit 35.

【0043】量子化インデックス決定部35は、ターゲ
ットビット決定部34から入力されたターゲットビット
の値に基づいて、量子化インデックスQを生成し、量子
化部19に対して出力する。
The quantization index determination unit 35 generates a quantization index Q based on the target bit value input from the target bit determination unit 34, and outputs it to the quantization unit 19.

【0044】次に、図2のフローチャートを参照して、
エンコードを終了した過去の画像における難易度を基に
Rに加えるsupplementを決定する、ビット補給レート制
御処理について説明する。
Next, referring to the flowchart of FIG.
A bit replenishment rate control process for determining the supplement to be added to R based on the degree of difficulty in the past image that has been encoded will be described.

【0045】ステップS1において、ターゲットビット
決定部34は、現在処理中のピクチャは、GOPの先頭
であるか否かを判断する。ステップS1において、GO
Pの先頭ではないと判断された場合、GOPの先頭であ
ると判断されるまで、ステップS1の処理が繰り返され
る。
In step S1, the target bit determining section 34 determines whether or not the picture currently being processed is the head of the GOP. In step S1, GO
When it is determined that it is not the head of P, the process of step S1 is repeated until it is determined that it is the head of GOP.

【0046】ステップS1において、GOPの先頭であ
ると判断された場合、ステップS2において、ターゲッ
トビット決定部34は、難易度算出部32より、前のG
OPにおける難易度平均avgDを取得する。
When it is determined in step S1 that the GOP is at the beginning, in step S2, the target bit determination unit 34 determines that the previous G from the difficulty level calculation unit 32 is determined.
Get the average difficulty level avgD in OP.

【0047】ステップS3において、図3、もしくは図
6を用いて後述するmax_sum_sup算出処理が実行され
る。
In step S3, a max_sum_sup calculation process described later with reference to FIG. 3 or 6 is executed.

【0048】ステップS4において、ターゲットビット
決定部34は、avgD > 0x2000かつsum_sup < max_sum_s
upであるか否かを判断する。ここで、難易度平均avgDと
比較されている0x2000は、予め定められた閾値であり、
画質を検討しながら要求される画質を得るために設定可
能な値である。
In step S4, the target bit determining section 34 determines that avgD> 0x2000 and sum_sup <max_sum_s.
It is determined whether it is up. Here, 0x2000 which is compared with the average difficulty level avgD is a predetermined threshold value,
It is a value that can be set to obtain the required image quality while considering the image quality.

【0049】ステップS4において、avgD > 0x2000か
つsum_sup < max_sum_supであると判断された場合、ス
テップS5において、ターゲットビット決定部34は、
使用可能ビット量Rに対して、正の値のsupplementを加
える。すなわち、ターゲットビット決定部34は、前の
GOPは、ある一定以上の難易度を有していたため、こ
れからエンコードするGOPの難易度を、前のGOPと
同程度であると予測して、使用可能ビット量Rに対し
て、正の値のsupplementを加える。
When it is determined in step S4 that avgD> 0x2000 and sum_sup <max_sum_sup, the target bit determination unit 34 determines in step S5.
A positive value supplement is added to the usable bit amount R. That is, since the previous GOP has a certain degree of difficulty or more, the target bit determination unit 34 predicts that the degree of difficulty of the GOP to be encoded is similar to that of the previous GOP, and can use the target bit. A positive value supplement is added to the bit amount R.

【0050】ステップS4において、avgD > 0x2000か
つsum_sup < max_sum_supではないと判断された場合、
ステップS6において、ターゲットビット決定部34
は、avgD< 0x1000、かつsum_sup > min_sum_supである
か否かを判断する。ここで、難易度平均avgDと比較され
ている0x1000は、予め定められた閾値であり、上述し
た0x2000より小さな値(画像難易度が低いことを示す
値)であり、画質を検討しながら要求される画質を得る
ために設定可能な値である。
If it is determined in step S4 that avgD> 0x2000 and sum_sup <max_sum_sup are not satisfied,
In step S6, the target bit determination unit 34
Determines whether avgD <0x1000 and sum_sup> min_sum_sup. Here, 0x1000 compared with the average difficulty level avgD is a predetermined threshold value, which is a value smaller than 0x2000 described above (a value indicating that the image difficulty level is low), and is requested while considering the image quality. It is a value that can be set in order to obtain high image quality.

【0051】ステップS6において、avgD < 0x1000、
かつsum_sup > min_sum_supであると判断された場合、
ステップS7において、ターゲットビット決定部34
は、使用可能ビット量Rに対して、負の値のsupplement
を加える。すなわち、ターゲットビット決定部34は、
前のGOPは、ある一定以下の難易度であった(すなわ
ち、簡単な画像であった)ため、これからエンコードす
るGOPの難易度を、前のGOPと同程度であると予測
して、使用可能ビット量Rに対して、負の値のsuppleme
ntを加える。
In step S6, avgD <0x1000,
And if it is determined that sum_sup> min_sum_sup,
In step S7, the target bit determination unit 34
Is a negative value for the available bit amount R
Add. That is, the target bit determination unit 34
Since the previous GOP had a certain level of difficulty or less (that is, a simple image), the difficulty of the GOP to be encoded is predicted to be the same as that of the previous GOP and can be used. Negative value of suppleme for bit amount R
add nt.

【0052】ステップS6において、avgD < 0x1000、
かつsum_sup > min_sum_supではなかったと判断された
場合、ステップS8において、ターゲットビット決定部
34は、supplement = 0とする。すなわち、ターゲッ
トビット決定部34は、使用可能ビット量Rに対して、
supplementの増減を行わない。
In step S6, avgD <0x1000,
When it is determined that sum_sup> min_sum_sup is not satisfied, the target bit determining unit 34 sets supplement = 0 in step S8. That is, the target bit determining unit 34 sets the available bit amount R to
Do not increase or decrease supplement.

【0053】ステップS5、ステップS7、もしくはス
テップS8の処理の終了後、ステップS9において、タ
ーゲットビット決定部34は、ステップS5、ステップ
S7、もしくはステップS8の処理において用いられた
supplementの値を用いて、sum_sup = sum_sup + supple
mentとし、処理は、ステップS1に戻り、それ以降の処
理が繰り返される。
After the processing of step S5, step S7, or step S8 is completed, the target bit determination unit 34 is used in step S5, step S7, or step S8 in step S9.
Using the value of supplement, sum_sup = sum_sup + supple
ment, the process returns to step S1 and the subsequent processes are repeated.

【0054】図2を用いて説明した処理により、エンコ
ードを終了した過去の画像における難易度を基に、使用
可能ビット量Rに加える、あるいは、減少されるsupple
mentの値が決定される。例えば、GOP単位で、R+su
pplemet(supplementは、正の値であるか、負の値であ
るか、もしくは0である)が決定される場合、前のGO
Pの画像難易度(イントラAC、あるいは、ME残差
等)の平均値を基に、これからエンコードするGOPの
難易度が前のGOPの難易度と同程度であると予測し
て、使用可能ビット量Rに対して、その難易度に応じた
supplementが加えられる。
By the processing described with reference to FIG. 2, the usable bit amount R is added or reduced based on the difficulty level of the past image which has been encoded.
The value of ment is determined. For example, in GOP units, R + su
The previous GO if pplemet (supplement is a positive value, a negative value, or 0) is determined
Based on the average value of the image difficulty level of P (intra AC, ME residual, etc.), it is predicted that the difficulty level of the GOP to be encoded will be the same as the difficulty level of the previous GOP, and the usable bit Depending on the amount R, depending on the difficulty
supplement is added.

【0055】ここでは、画像難易度をイントラAC、あ
るいは、ME残差を用いて算出するものとして説明した
が、画像難易度は、それ以外のパラメータを用いて算出
するようにしても良い。
Although the image difficulty has been described as being calculated using the intra AC or ME residual, the image difficulty may be calculated using other parameters.

【0056】また、supplementの具体的な値の算出方法
は、例えば、特開平10−75443に開示されている
方法でも良いし、それ以外の方法で、要求される画質を
得ることができるsupplementの値を用いるようにしても
良い。
The method of calculating the specific value of the supplement may be, for example, the method disclosed in Japanese Patent Laid-Open No. 10-75443, or a method other than that may obtain the required image quality. You may make it use a value.

【0057】また、ここでは、前の1GOPにおける難
易度平均avgDを用いるものとして説明したが、難易度
算出部32は、1GOPにおける難易度平均avgDに代
わって、例えば、複数のGOP、もしくは、GOPの一
部における難易度平均を求めるようにしても良いし、更
に、単純な難易度平均ではなく、必要に応じて、重み付
け和や重み付け平均を算出するようにしても良い。
Further, although it has been described here that the average difficulty level avgD in the previous 1 GOP is used, the difficulty level calculation section 32 may replace the average difficulty level avgD in 1 GOP with, for example, a plurality of GOPs or GOPs. The average of the degree of difficulty may be calculated for a part of the above, or, instead of the simple average of the degree of difficulty, a weighted sum or a weighted average may be calculated as necessary.

【0058】次に、図2のステップS3において実行さ
れるmax_sum_sup算出処理について説明する。
Next, the max_sum_sup calculation process executed in step S3 of FIG. 2 will be described.

【0059】LongGOPにおいては、Iピクチャの発生量が
大きくなる傾向がある。従って、ピクチャの発生量によ
ってVBVアンダーフローを起こすことを防ぐために
は、VBVバッファサイズからエンコードを終了した直
近のIピクチャのビット発生量を引いたものをsum_supの
最大値(max_sum_sup)とすればよい。
In Long GOP, the amount of I-pictures tends to increase. Therefore, in order to prevent VBV underflow depending on the amount of generated pictures, the maximum value of sum_sup (max_sum_sup) may be obtained by subtracting the bit generation amount of the most recent I picture after encoding from the VBV buffer size. .

【0060】図3のフローチャートを参照して、図2の
ステップS3において実行されるmax_sum_sup算出処理
1について説明する。
The max_sum_sup calculation process 1 executed in step S3 of FIG. 2 will be described with reference to the flowchart of FIG.

【0061】ステップS21において、genbit検出部3
3は、直近のIピクチャの発生符号量genbitを検出す
る。ターゲットビット決定部34は、genbit検出部33
から、genbitの値の入力を受ける。
In step S21, the genbit detector 3
3 detects the generated code amount genbit of the latest I picture. The target bit determination unit 34 includes a genbit detection unit 33.
Receives the value of genbit from.

【0062】ステップS22において、ターゲットビッ
ト決定部34は、sum_supの最大値であるmax_sum_supの
値を、max_sum_sup=VBVバッファサイズ−Iピクチャ
発生量とし、処理は、図2のステップS4に戻る。
In step S22, the target bit determining unit 34 sets the value of max_sum_sup, which is the maximum value of sum_sup, to max_sum_sup = VBV buffer size-I picture generation amount, and the process returns to step S4 in FIG.

【0063】図3を用いて説明した処理により、図4に
示すように、VBVサイズからIピクチャ発生量を引い
た、実線矢印の合計量が、VBV余裕度として、次のG
OPのsum_supの最大値とされる。これにより、アンダ
ーフローしやすい絵柄ではsupplementが与えられにくく
なり、アンダーフローに対する余裕がある絵柄に対して
はsupplementが与えられやすくなる。すなわち、Iピク
チャのビット発生量が多いために発生するVBVアンダ
ーフローを防ぐことができる。
By the processing described with reference to FIG. 3, as shown in FIG. 4, the total amount of the solid line arrow obtained by subtracting the I picture generation amount from the VBV size is defined as the next GB margin by the following G
It is the maximum value of sum_sup of OP. As a result, supplementation is less likely to be given to a pattern that easily underflows, and supplementation is likely to be given to a pattern that has a margin for underflow. That is, it is possible to prevent the VBV underflow that occurs due to the large amount of generated bits of the I picture.

【0064】しかしながら、図3を用いて説明した処理
では、シーンチェンジが起きた場合に不具合が発生して
しまう。例えば、難しい絵柄から簡単な絵柄へのシーン
チェンジが起きた場合、図5に示されるように、前のG
OPが難しい絵柄のため、次のGOPのmax_sum_sup
(実線矢印の合計)が大きくなり、絵柄が簡単なGOP
に、大きくなったmax_sum_supを適用してしまうので、
VBVの余裕が無いものに対してsum_supの最大値を大
きくしてしまう。また、同様に、簡単な絵柄から難しい
絵柄へのシーンチェンジにおいても、逆の不具合が発生
してしまう。
However, the processing described with reference to FIG. 3 causes a problem when a scene change occurs. For example, when a scene change from a difficult design to a simple design occurs, as shown in FIG.
Because OP is a difficult pattern, max_sum_sup of the next GOP
GOP with large (total of solid line arrows) and simple design
Since the increased max_sum_sup will be applied to
The maximum value of sum_sup is increased for those with no VBV margin. Similarly, in the case of a scene change from a simple design to a difficult design, the opposite problem will occur.

【0065】これを防ぐために、シーンチェンジのIピ
クチャを含むGOPをエンコードする場合には、前のI
ピクチャ発生量により求められたsum_supの最大値を、
シーンチェンジのIピクチャの難易度により増減させる
ようにすることができる。
In order to prevent this, when encoding a GOP including an I picture of a scene change, the previous I
The maximum value of sum_sup calculated from the picture generation amount is
It can be increased or decreased depending on the difficulty level of the I picture of the scene change.

【0066】図6のフローチャートを参照して、図2の
ステップS3において実行されるmax_sum_sup算出処理
2について説明する。
The max_sum_sup calculation process 2 executed in step S3 of FIG. 2 will be described with reference to the flowchart of FIG.

【0067】ステップS31において、genbit検出部3
3は、直近のIピクチャの発生符号量genbitを検出す
る。ターゲットビット決定部34は、genbit検出部33
から、genbitの値の入力を受ける。
In step S31, the genbit detector 3
3 detects the generated code amount genbit of the latest I picture. The target bit determination unit 34 includes a genbit detection unit 33.
Receives the value of genbit from.

【0068】ステップS32において、ターゲットビッ
ト決定部34は、sum_supの最大値であるmax_sum_supの
値を、max_sum_sup=VBVバッファサイズ−Iピクチャ
発生量とする。
In step S32, the target bit determination unit 34 sets the value of max_sum_sup which is the maximum value of sum_sup to max_sum_sup = VBV buffer size-I picture generation amount.

【0069】ステップS33において、ターゲットビッ
ト決定部34は、シーンチェンジであるか否かを判断す
る。シーンチェンジであるか否かの判断は、例えば、M
E残差算出部31により算出されるME残差の値を基に
して判断するようにしても良いし、それ以外のいかなる
方法によって判断するようにしても良い。
In step S33, the target bit determining section 34 determines whether or not there is a scene change. The determination as to whether or not there is a scene change is made by, for example, M
The determination may be made based on the ME residual value calculated by the E residual calculation unit 31, or may be made by any other method.

【0070】ステップS33において、シーンチェンジ
ではないと判断された場合、処理は、図2のステップS
4に戻る。
If it is determined in step S33 that the scene change has not occurred, the process proceeds to step S in FIG.
Return to 4.

【0071】ステップS33において、シーンチェンジ
であると判断された場合、ステップS34において、タ
ーゲットビット決定部34は、難易度算出部32より、
シーンチェンジのIピクチャ、および1つ前のIピクチャ
の符号化難易度を取得する。
When it is determined in step S33 that there is a scene change, in step S34, the target bit determination section 34 causes the difficulty level calculation section 32 to
The coding difficulty of the scene change I picture and the previous I picture is acquired.

【0072】ステップS35において、ターゲットビッ
ト決定部34は、2つのIピクチャの符号化難易度の差
を算出し、ステップS32において算出されたmax_sum_
supの値を、符号化難易度の差、すなわち、難しい絵柄
から簡単な絵柄へのシーンチェンジであるか、簡単な絵
柄から難しい絵柄へのシーンチェンジであるかを基に増
減して、処理は、図2のステップS4に戻る。
In step S35, the target bit determination unit 34 calculates the difference in coding difficulty between the two I pictures, and max_sum_calculated in step S32.
The value of sup is increased or decreased based on the difference in encoding difficulty, that is, whether the scene change is from a difficult design to a simple design or from a simple design to a difficult design. , And returns to step S4 in FIG.

【0073】具体的には、シーンチェンジ後の符号化難
易度が低い場合は、max_sum_supの値を少なくし、シー
ンチェンジ後の符号化難易度が高い場合は、max_sum_su
pの値を多くする。
Specifically, if the encoding difficulty after the scene change is low, the value of max_sum_sup is decreased, and if the encoding difficulty after the scene change is high, max_sum_su is reached.
Increase the value of p.

【0074】図6を用いて説明した処理により、シーン
チェンジのIピクチャを含むGOPをエンコードする場
合には、前のIピクチャ発生量により求まったsum_supの
最大値をシーンチェンジのIピクチャの難易度により増
減させることにより、例えば、次のGOPのIピクチャ
発生量が大きく、VBVに余裕が無いにもかかわらず、
大きなsum_sup最大値となってしまうようなことをふせ
ぐようにすることができる。
When a GOP including an I picture of a scene change is encoded by the processing described with reference to FIG. 6, the maximum value of sum_sup obtained by the previous I picture generation amount is set to the difficulty level of the I picture of the scene change. By increasing or decreasing by, for example, although the I-picture generation amount of the next GOP is large and VBV has no margin,
It is possible to prevent things such as a large sum_sup maximum value.

【0075】また、本発明は、図2を用いて説明したビ
ット補給レート制御処理以外でも、ビット補給レート制
御を行う場合、すなわち、ビット補給量supplementの積
算値sum_supの最大値である、max_sum_supを用いる処理
の全てに適用可能である。
Further, according to the present invention, when the bit replenishment rate control is performed other than the bit replenishment rate control processing described with reference to FIG. 2, that is, max_sum_sup, which is the maximum value of the integrated value sum_sup of the bit replenishment amount supplement, It is applicable to all the processes used.

【0076】上述した一連の処理は、ハードウエアによ
り実行させることもできるが、ソフトウエアにより実行
させることもできる。この場合、例えば、エンコーダ1
は、図7に示されるようなパーソナルコンピュータ10
1により構成される。
The series of processes described above can be executed by hardware, but can also be executed by software. In this case, for example, the encoder 1
Is a personal computer 10 as shown in FIG.
It is composed of 1.

【0077】図7において、CPU111は、ROM112に
記憶されているプログラム、または記憶部118からRA
M113にロードされたプログラムに従って、各種の処
理を実行する。RAM113にはまた、CPU111が各種の
処理を実行する上において必要なデータなども適宜記憶
される。
In FIG. 7, the CPU 111 uses the program stored in the ROM 112 or RA from the storage unit 118.
Various processes are executed according to the program loaded in M113. The RAM 113 also appropriately stores data necessary for the CPU 111 to execute various processes.

【0078】CPU111、ROM112、およびRAM113
は、バス114を介して相互に接続されている。このバ
ス114にはまた、入出力インタフェース115も接続
されている。
CPU 111, ROM 112, and RAM 113
Are mutually connected via a bus 114. An input / output interface 115 is also connected to the bus 114.

【0079】入出力インタフェース115には、キーボ
ード、マウスなどよりなる入力部116、ディスプレイ
やスピーカなどよりなる出力部117、ハードディスク
などより構成される記憶部118、モデム、ターミナル
アダプタなどより構成される通信部119が接続されて
いる。通信部119は、インターネットを含むネットワ
ークを介しての通信処理を行う。
The input / output interface 115 includes an input unit 116 including a keyboard and a mouse, an output unit 117 including a display and a speaker, a storage unit 118 including a hard disk, a communication including a modem and a terminal adapter. The section 119 is connected. The communication unit 119 performs communication processing via a network including the Internet.

【0080】入出力インタフェース115にはまた、必
要に応じてドライブ120が接続され、磁気ディスク1
31、光ディスク132、光磁気ディスク133、ある
いは、半導体メモリ134などが適宜装着され、それら
から読み出されたコンピュータプログラムが、必要に応
じて記憶部118にインストールされる。
A drive 120 is also connected to the input / output interface 115 if necessary, and the magnetic disk 1
31, the optical disk 132, the magneto-optical disk 133, the semiconductor memory 134, or the like is appropriately mounted, and the computer program read from them is installed in the storage unit 118 as necessary.

【0081】一連の処理をソフトウエアにより実行させ
る場合には、そのソフトウエアを構成するプログラム
が、専用のハードウエアに組み込まれているコンピュー
タ、または、各種のプログラムをインストールすること
で、各種の機能を実行することが可能な、例えば汎用の
パーソナルコンピュータなどに、ネットワークや記録媒
体からインストールされる。
When a series of processes are executed by software, a program that constitutes the software is installed in a computer in which dedicated hardware is installed, or various programs are installed to perform various functions. Is installed from a network or a recording medium into a general-purpose personal computer or the like capable of executing.

【0082】この記録媒体は、図7に示されるように、
装置本体とは別に、ユーザにプログラムを供給するため
に配布される、プログラムが記憶されている磁気ディス
ク131(フロッピディスクを含む)、光ディスク13
2(CD-ROM(Compact Disk-Read Only Memory),
DVD(Digital Versatile Disk)を含む)、光磁気デ
ィスク133(MD(Mini-Disk)(商標)を含む)、
もしくは半導体メモリ134などよりなるパッケージメ
ディアにより構成されるだけでなく、装置本体に予め組
み込まれた状態でユーザに供給される、プログラムが記
憶されているROM112や、記憶部118に含まれるハ
ードディスクなどで構成される。
This recording medium, as shown in FIG.
A magnetic disk 131 (including a floppy disk) in which a program is stored, which is distributed in order to supply the program to a user separately from the apparatus body, and an optical disk 13.
2 (CD-ROM (Compact Disk-Read Only Memory),
DVD (including Digital Versatile Disk), magneto-optical disk 133 (including MD (Mini-Disk) (trademark),
Alternatively, in addition to being configured by a package medium including a semiconductor memory 134, a ROM 112 in which a program is stored and a hard disk included in a storage unit 118, which is supplied to a user in a state of being incorporated in the apparatus body in advance, is used. Composed.

【0083】なお、本明細書において、記録媒体に記憶
されるプログラムを記述するステップは、含む順序に沿
って時系列的に行われる処理はもちろん、必ずしも時系
列的に処理されなくとも、並列的あるいは個別に実行さ
れる処理をも含むものである。
In the present specification, the steps for writing the program stored in the recording medium are not limited to the processing performed in time series in the order of inclusion, but may be performed in parallel if they are not necessarily performed in time series. Alternatively, it also includes processes that are individually executed.

【0084】[0084]

【発明の効果】本発明によれば、画像データをエンコー
ドすることができる。また、本発明によれば、エンコー
ドを終了した過去の画像における難易度を基に使用可能
ビット量Rに加えるsupplementを決定する場合の、supp
lementの合計値の最大値を設定することができるので、
フィードバック型レート制御にビット補給レート制御を
適用する場合にVBVアンダーフローを防ぐことができ
る。
According to the present invention, image data can be encoded. Further, according to the present invention, when the supplement to be added to the usable bit amount R is determined based on the degree of difficulty in the past image that has been encoded, the supp
Since you can set the maximum of the total value of lement,
VBV underflow can be prevented when the bit supplement rate control is applied to the feedback rate control.

【0085】また、シーンチェンジが起きたGOPをエ
ンコードする際には、シーンチェンジ前後のフレーム内
符号化画像の画像難易度を比較した値を用いて、supple
mentの合計値の最大値を再設定することができるので、
フィードバック型レート制御にビット補給レート制御を
適用する場合にVBVアンダーフローを防ぐことができ
る。
When encoding a GOP in which a scene change has occurred, a value obtained by comparing the image difficulty levels of the intra-frame coded images before and after the scene change is used.
Since you can reset the maximum value of the total value of ment,
VBV underflow can be prevented when the bit supplement rate control is applied to the feedback rate control.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明を適用したエンコーダの構成を示すブロ
ック図である。
FIG. 1 is a block diagram showing a configuration of an encoder to which the present invention has been applied.

【図2】ビット補給レート制御処理について説明するフ
ローチャートである。
FIG. 2 is a flowchart illustrating a bit supply rate control process.

【図3】max_sum_sup算出処理1について説明するフロ
ーチャートである。
FIG. 3 is a flowchart illustrating a max_sum_sup calculation process 1.

【図4】VBVバッファと、sum_supの最大値とについ
て説明するための図である。
FIG. 4 is a diagram for explaining a VBV buffer and a maximum value of sum_sup.

【図5】VBVバッファと、sum_supの最大値とについ
て説明するための図である。
FIG. 5 is a diagram for describing a VBV buffer and a maximum value of sum_sup.

【図6】max_sum_sup算出処理2について説明するフロ
ーチャートである。
FIG. 6 is a flowchart illustrating a max_sum_sup calculation process 2.

【図7】パーソナルコンピュータの構成について説明す
る図である。
FIG. 7 is a diagram illustrating a configuration of a personal computer.

【符号の説明】[Explanation of symbols]

1 エンコーダ, 12 画像並び替え部, 13 走
査変換・マクロブロック化部, 14 イントラAC算
出部, 15 レートコントロール部, 16演算処理
部, 17 動き検出部, 18 DCT処理部, 1
9 量子化部, 20 VLC部, 21 バッファ,
22 逆量子化部, 23 逆DCT処理部, 24
演算処理部, 25 動き補償部, 31 ME残差
算出部, 32 難易度算出部, 33 genbit検出
部, 34 ターゲットビット決定部, 35 量子化
インデックス決定部
1 encoder, 12 image rearranging unit, 13 scanning conversion / macroblocking unit, 14 intra AC calculation unit, 15 rate control unit, 16 arithmetic processing unit, 17 motion detection unit, 18 DCT processing unit, 1
9 quantization unit, 20 VLC unit, 21 buffer,
22 inverse quantizer, 23 inverse DCT processor, 24
Arithmetic processing unit, 25 motion compensation unit, 31 ME residual calculation unit, 32 difficulty calculation unit, 33 genbit detection unit, 34 target bit determination unit, 35 quantization index determination unit

フロントページの続き Fターム(参考) 5C059 KK01 KK22 KK35 MA00 MA05 MA14 MA23 MC11 MC38 ME01 NN01 NN21 NN43 PP05 PP06 PP07 SS20 TA46 TA60 TB03 TB04 TC02 TC03 TC10 TC14 TC16 TC20 TC27 TC38 TC41 TD03 TD05 TD06 TD12 UA02 UA32 UA33 UA38 UA39 Continued front page    F term (reference) 5C059 KK01 KK22 KK35 MA00 MA05                       MA14 MA23 MC11 MC38 ME01                       NN01 NN21 NN43 PP05 PP06                       PP07 SS20 TA46 TA60 TB03                       TB04 TC02 TC03 TC10 TC14                       TC16 TC20 TC27 TC38 TC41                       TD03 TD05 TD06 TD12 UA02                       UA32 UA33 UA38 UA39

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 非圧縮データの符号化を行う符号化装置
において、 前記非圧縮データの複雑さを検出する第1の検出手段
と、 前記非圧縮データを圧縮符号化する符号化手段と、 前記第1の検出手段により検出された、前記符号化手段
により過去に符号化された前記非圧縮データの複雑さを
基に、これから符号化される前記非圧縮データに対して
割り当てられるVBVバッファのバッファ容量のうち、
使用可能である第1のビット量に加えられる第2のビッ
ト量を算出する算出手段と、 前記符号化手段により過去に符号化された前記非圧縮デ
ータのうちの、フレーム内符号化画像のビット発生量を
検出する第2の検出手段と、 前記VBVバッファのバッファ容量から、前記第2の検
出手段により検出された前記フレーム内符号化画像のビ
ット発生量を減算した値を算出し、前記第2のビット量
の合計値の最大値として設定する設定手段とを備えるこ
とを特徴とする符号化装置。
1. An encoding device for encoding uncompressed data, comprising: first detecting means for detecting complexity of the uncompressed data; encoding means for compressing and encoding the uncompressed data; A buffer of a VBV buffer allocated to the uncompressed data that is to be encoded, based on the complexity of the uncompressed data that was previously encoded by the encoding unit and that was detected by the first detecting unit. Out of capacity
Calculating means for calculating a second bit amount to be added to the usable first bit amount, and bits of the intra-frame encoded image of the uncompressed data previously encoded by the encoding means Second detection means for detecting the amount of generation, and a value obtained by subtracting the bit generation amount of the intra-frame coded image detected by the second detection means from the buffer capacity of the VBV buffer are calculated, An encoding device, comprising: a setting unit configured to set a maximum value of a total value of two bit amounts.
【請求項2】 1つ前のピクチャと次に符号化処理する
ピクチャとで、絵柄が所定の基準値より変化したことを
検出する第3の検出手段と、 前記第3の検出手段により、前記絵柄が所定の前記基準
値より変化したことが検出された場合、前記第1の検出
手段により検出された絵柄の変化前後の前記フレーム内
符号化画像の複雑さに基づいて、前記設定手段により設
定された前記第2のビット量の合計値の最大値を再設定
する再設定手段とを更に備えることを特徴とする請求項
1に記載の符号化装置。
2. A third detecting means for detecting that a picture has changed from a predetermined reference value between a previous picture and a picture to be encoded next, and the third detecting means, When it is detected that the pattern has changed from the predetermined reference value, the setting unit sets it based on the complexity of the intra-frame encoded image before and after the change of the pattern detected by the first detection unit. The encoding device according to claim 1, further comprising: a resetting unit that resets a maximum value of the summed values of the second bit amounts.
【請求項3】 非圧縮データの符号化を行う符号化装置
の符号化方法において、 前記非圧縮データの複雑さを検出する第1の検出ステッ
プと、 前記非圧縮データを圧縮符号化する符号化ステップと、 前記第1の検出ステップの処理により検出された、前記
符号化ステップの処理により過去に符号化された前記非
圧縮データの複雑さを基に、これから符号化される前記
非圧縮データに対して割り当てられるVBVバッファの
バッファ容量のうち、使用可能である第1のビット量に
加えられる第2のビット量を算出する算出ステップと、 前記符号化ステップの処理により過去に符号化された前
記非圧縮データのうちの、フレーム内符号化画像のビッ
ト発生量を検出する第2の検出ステップと、 前記VBVバッファのバッファ容量から、前記第2の検
出ステップの処理により検出されたフレーム内符号化画
像のビット発生量を減算した値を算出し、前記第2のビ
ット量の合計値の最大値に設定する設定ステップとを含
むことを特徴とする符号化方法。
3. A coding method of a coding device for coding uncompressed data, comprising: a first detecting step of detecting complexity of the uncompressed data; and coding for compressing and coding the uncompressed data. Step, based on the complexity of the uncompressed data previously encoded by the process of the encoding step, detected by the process of the first detecting step, A calculation step of calculating a second bit amount to be added to the usable first bit amount of the buffer capacity of the VBV buffer allocated to the VBV buffer, and the encoding step performed in the past by the encoding step. The second detection step of detecting the bit generation amount of the intra-frame encoded image in the uncompressed data, and the second detection step from the buffer capacity of the VBV buffer. A setting step of calculating a value obtained by subtracting the bit generation amount of the intra-frame coded image detected by the processing of the detection step and setting the value to the maximum value of the total value of the second bit amounts. Encoding method.
【請求項4】 非圧縮データの符号化を行う符号化装置
用のプログラムであって、 前記非圧縮データの複雑さを検出する第1の検出ステッ
プと、 前記非圧縮データを圧縮符号化する符号化ステップと、 前記第1の検出ステップの処理により検出された、前記
符号化ステップの処理により過去に符号化された前記非
圧縮データの複雑さを基に、これから符号化される前記
非圧縮データに対して割り当てられるVBVバッファの
バッファ容量のうち、使用可能である第1のビット量に
加えられる第2のビット量を算出する算出ステップと、 前記符号化ステップの処理により過去に符号化された前
記非圧縮データのうちの、フレーム内符号化画像のビッ
ト発生量を検出する第2の検出ステップと、 前記VBVバッファのバッファ容量から、前記第2の検
出ステップの処理により検出されたフレーム内符号化画
像のビット発生量を減算した値を算出し、前記第2のビ
ット量の合計値の最大値に設定する設定ステップとを含
むことを特徴とするコンピュータが読み取り可能なプロ
グラムが記録されている記録媒体。
4. A program for an encoding device that encodes uncompressed data, comprising a first detection step of detecting the complexity of the uncompressed data, and a code that compression-encodes the uncompressed data. An encoding step, and the uncompressed data to be encoded based on the complexity of the uncompressed data previously encoded by the processing of the encoding step, which is detected by the processing of the first detection step. Of the buffer capacity of the VBV buffer allocated to the second bit amount, which is added to the usable first bit amount, and a step of calculating the second bit amount that has been encoded in the past by the process of the encoding step. From the second detection step of detecting the bit generation amount of the intra-frame encoded image of the uncompressed data, and from the buffer capacity of the VBV buffer, the second detection step is performed. And a setting step of calculating a value obtained by subtracting the bit generation amount of the intra-frame coded image detected by the processing of the detection step and setting it to the maximum value of the total value of the second bit amounts. A recording medium on which a computer-readable program is recorded.
【請求項5】 非圧縮データの符号化を行う符号化装置
を制御するコンピュータが実行可能なプログラムであっ
て、 前記非圧縮データの複雑さを検出する第1の検出ステッ
プと、 前記非圧縮データを圧縮符号化する符号化ステップと、 前記第1の検出ステップの処理により検出された、前記
符号化ステップの処理により過去に符号化された前記非
圧縮データの複雑さを基に、これから符号化される前記
非圧縮データに対して割り当てられるVBVバッファの
バッファ容量のうち、使用可能である第1のビット量に
加えられる第2のビット量を算出する算出ステップと、 前記符号化ステップの処理により過去に符号化された前
記非圧縮データのうちの、フレーム内符号化画像のビッ
ト発生量を検出する第2の検出ステップと、 前記VBVバッファのバッファ容量から、前記第2の検
出ステップの処理により検出されたフレーム内符号化画
像のビット発生量を減算した値を算出し、前記第2のビ
ット量の合計値の最大値に設定する設定ステップとを含
むことを特徴とするプログラム。
5. A program executable by a computer that controls an encoding device that encodes uncompressed data, the first detection step detecting complexity of the uncompressed data, and the uncompressed data. And a coding step for compressing and coding, based on the complexity of the non-compressed data previously coded by the processing of the coding step, detected by the processing of the first detection step. Of the buffer capacity of the VBV buffer allocated to the uncompressed data, the calculation step of calculating a second bit amount to be added to the usable first bit amount, and the encoding step. A second detection step of detecting the bit generation amount of the intra-frame encoded image of the uncompressed data encoded in the past, and the VBV buffer. Value obtained by subtracting the bit generation amount of the intra-frame coded image detected by the processing of the second detection step from the buffer capacity of the buffer, and set to the maximum value of the total value of the second bit amounts. A program including a setting step.
JP2002104315A 2002-04-05 2002-04-05 Encoding apparatus, encoding method, program, and recording medium Expired - Fee Related JP4273386B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002104315A JP4273386B2 (en) 2002-04-05 2002-04-05 Encoding apparatus, encoding method, program, and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002104315A JP4273386B2 (en) 2002-04-05 2002-04-05 Encoding apparatus, encoding method, program, and recording medium

Publications (2)

Publication Number Publication Date
JP2003299081A true JP2003299081A (en) 2003-10-17
JP4273386B2 JP4273386B2 (en) 2009-06-03

Family

ID=29389639

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002104315A Expired - Fee Related JP4273386B2 (en) 2002-04-05 2002-04-05 Encoding apparatus, encoding method, program, and recording medium

Country Status (1)

Country Link
JP (1) JP4273386B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005104561A1 (en) * 2004-04-20 2005-11-03 Sony Corporation Data processing device, method thereof, and encoding device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005104561A1 (en) * 2004-04-20 2005-11-03 Sony Corporation Data processing device, method thereof, and encoding device
US7711197B2 (en) 2004-04-20 2010-05-04 Sony Corporation Method and apparatus for determining a quantization scale of encoded data

Also Published As

Publication number Publication date
JP4273386B2 (en) 2009-06-03

Similar Documents

Publication Publication Date Title
JP4256574B2 (en) Image signal encoding method and image signal encoding apparatus
US6654417B1 (en) One-pass variable bit rate moving pictures encoding
EP1372113B1 (en) Variable bit rate video encoding method and device
KR100756596B1 (en) Video data encoder and video data encoding method
JP4221655B2 (en) Encoding apparatus, encoding method, program, and recording medium
JP2001169281A (en) Device and method for encoding moving image
JPH1075451A (en) Device and method for compressing video data
JP3907875B2 (en) Coding rate control device and information coding device
US8081679B2 (en) Image processing apparatus
JP2004514352A (en) Dynamic adaptation of complexity in MPEG-2 scalable decoder
JP2004166128A (en) Method, device and program for coding image information
JP4179917B2 (en) Video encoding apparatus and method
JP2003299081A (en) Encoder, encoding method, program and recording medium
JP4586340B2 (en) Encoding apparatus, encoding method, and program
JP4273385B2 (en) Encoding apparatus, encoding method, program, and recording medium
JP2005045736A (en) Method and device for encoding image signal, encoding controller, and program
JP3149673B2 (en) Video encoding device, video encoding method, video reproducing device, and optical disc
JP4186543B2 (en) Encoding apparatus, encoding method, program, and recording medium
JP3918208B2 (en) Video data compression apparatus and method
JP4264535B2 (en) Image processing apparatus and method, recording medium, and program
JP4228739B2 (en) Encoding apparatus, encoding method, program, and recording medium
JP4239734B2 (en) Encoding apparatus, encoding method, and program
JP2007053788A (en) Video data compression apparatus and method thereof
JP4747109B2 (en) Calculation amount adjustment device
Overmeire et al. Constant quality video coding using video content analysis

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050307

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070320

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070720

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070918

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080902

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081027

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20081118

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090114

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090205

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090218

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120313

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees