JP2009246513A - Moving image encoder, control method thereof, and computer program - Google Patents

Moving image encoder, control method thereof, and computer program Download PDF

Info

Publication number
JP2009246513A
JP2009246513A JP2008088260A JP2008088260A JP2009246513A JP 2009246513 A JP2009246513 A JP 2009246513A JP 2008088260 A JP2008088260 A JP 2008088260A JP 2008088260 A JP2008088260 A JP 2008088260A JP 2009246513 A JP2009246513 A JP 2009246513A
Authority
JP
Japan
Prior art keywords
quantization
code amount
parameter
target code
encoding
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
JP2008088260A
Other languages
Japanese (ja)
Other versions
JP5132390B2 (en
Inventor
Masashi Kawakami
雅司 川上
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2008088260A priority Critical patent/JP5132390B2/en
Publication of JP2009246513A publication Critical patent/JP2009246513A/en
Application granted granted Critical
Publication of JP5132390B2 publication Critical patent/JP5132390B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To settle the generation code amount of the entire picture to the vicinity of the target code amount of the picture to end encoding of the picture when there is the possibility of the failure of a buffer and failure evading processing tends to occur. <P>SOLUTION: The moving image encoder includes a quantization means for quantizing an input image on the basis of a quantization parameter, an encoding means for entropy-encoding a quantized result by the quantization means and generating encoded data, a buffer means for storing the encoded data, a monitoring means for monitoring the occupancy amount of the buffer means, and a control means for determining the quantization parameter on the basis of the difference between the target code amount and the generated code amount in the encoding means and a reaction parameter, and controlling the quantization means. The monitoring means outputs control signals including the specification of the reaction parameter on the basis of the occupancy amount to the control means, and the control means determines the quantization parameter according to the specification of the reaction parameter included in control signals. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、動画像符号化装置及びその制御方法、コンピュータプログラムに関する。   The present invention relates to a moving image encoding apparatus, a control method thereof, and a computer program.

近年、ディジタル信号処理、LSIの高集積化、高速化などの進歩により、動画像や静止画像、音声等、大量のディジタル情報を高能率符号化し、記録媒体への記録及び通信媒体による伝送を行うことが可能になってきている。このような技術を応用し、テレビ放送や、ディジタルビデオカメラの映像をストリームに変換できる動画像符号化装置の開発が行われている。   With recent advances in digital signal processing, LSI integration, and speedup, high-efficiency encoding of large amounts of digital information such as moving images, still images, and voices is performed, and recording to a recording medium and transmission via a communication medium are performed. It is becoming possible. Applying such a technique, development of a moving image encoding apparatus capable of converting a video from a television broadcast or a digital video camera into a stream has been performed.

画像符号化の規格として近年、MPEGやITU−Tによって策定された H.264等が注目されている。これらの画像符号化の処理は、原画像(画像)をブロックと呼ばれる所定の領域に分割し、この分割したブロックを単位にして動き補償予測や直交変換処理や量子化処理を施すものである。   In recent years, H.264 has been established by MPEG and ITU-T as an image coding standard. H.264 and the like are attracting attention. In these image encoding processes, an original image (image) is divided into predetermined regions called blocks, and motion-compensated prediction, orthogonal transform processing, and quantization processing are performed in units of the divided blocks.

H.264方式の圧縮手順の内容については標準規格書に詳しく開示されているので詳しい説明は省略する。また、H.264の圧縮手順について開示したその他の先行文献も存在する(例えば、特許文献1参照)。   H. Since the contents of the H.264 compression procedure are disclosed in detail in the standard document, detailed description thereof will be omitted. H. There are other prior art documents that disclose H.264 compression procedures (see, for example, Patent Document 1).

このような動画像符号化装置で生成される符号量は、画像自体の特性である空間周波数特性やシーン及び量子化スケール値(量子化ステップ値)に応じて大きく異なる場合が多い。このような符号化特性を有する動画像符号化装置を実現する上で良好な画質の復号画像を得ることができるようにするための重要な技術が符号量制御である。   The amount of code generated by such a moving image coding apparatus often varies greatly depending on the spatial frequency characteristics, which are characteristics of the image itself, the scene, and the quantization scale value (quantization step value). An important technique for realizing a decoded image with good image quality in realizing a moving image coding apparatus having such coding characteristics is code amount control.

この符号量制御アルゴリズムの1つとして、TM5(Test Model 5)が一般的に使用されている。このTM5による符号量制御アルゴリズムは、以下に説明する3つのステップから構成され、GOP(Group Of Picture)毎にビットレートが一定になるように以下に挙げる3ステップで符号量が制御される。   TM5 (Test Model 5) is generally used as one of the code amount control algorithms. The code amount control algorithm according to TM5 is composed of the following three steps, and the code amount is controlled in the following three steps so that the bit rate is constant for each GOP (Group Of Picture).

[STEP1]
今から符号化を行うピクチャの目標符号量を決定する。現在のGOPにおいて利用可能な符号量であるRgopが以下の(1)式により演算される。
Rgop = (ni+np+nb)*(bits_rate/picture_rate) ・・・(1)
ここで、ni,np,nbはそれぞれI、P、Bピクチャの現GOPにおける残りのピクチャ数であり、bits_rateは目標ビットレート、picture_rateはピクチャレートを表す。 更に、I、P、Bピクチャ毎に符号化結果からピクチャの複雑度を以下の(2)式で求めている。
[STEP1]
The target code amount of the picture to be encoded from now is determined. Rgop, which is a code amount that can be used in the current GOP, is calculated by the following equation (1).
Rgop = (ni + np + nb) * (bits_rate / picture_rate) (1)
Here, ni, np, and nb are the number of remaining pictures in the current GOP of I, P, and B pictures, bits_rate represents the target bit rate, and picture_rate represents the picture rate. Further, the complexity of the picture is obtained from the encoding result for each of the I, P, and B pictures by the following equation (2).

Xi = Ri*Qi
Xp = Rp*Qp ・・・(2)
Xb = Rb*Qb
ここで、Xi、Xp、Xbはコンプレキシティ(Complexity)とも呼ばれる。また、Ri、Rp及びRbはそれぞれI、P、Bピクチャを符号化した結果得られる符号量である。さらに、Qi、Qp及びQbはそれぞれI、P、Bピクチャ内のすべてのマクロブロックにおける量子化スケールの平均値である。式(1)及び式(2)から、I、P、Bピクチャそれぞれについての目標符号量Ti、Tp及びTbは、以下の(3)式で求めることができる。
Xi = Ri * Qi
Xp = Rp * Qp (2)
Xb = Rb * Qb
Here, Xi, Xp, and Xb are also called complexity. Ri, Rp, and Rb are code amounts obtained as a result of encoding I, P, and B pictures, respectively. Further, Qi, Qp and Qb are average values of quantization scales in all macroblocks in the I, P and B pictures, respectively. From the equations (1) and (2), the target code amounts Ti, Tp, and Tb for the I, P, and B pictures can be obtained by the following equation (3).

Ti= max{(Rgop/(1+ ((Np*Xp)/(Xi*Kp)) + ((Nb*Xb)/(Xi*Kb)))) , (bit_rate/(8*picture_rate))}
Tp=max{(Rgop/(Np+ (Nb*Kp*Xb)/(Kb*Xp))) , (bit_rate/(8*picture_rate))} ・・・(3)
Tb=max{(Rgop/(Nb+ (Np*Kb*Xp)/(Kp*Xb))) , (bit_rate/(8*picture_rate))}
ただし、Np及びNbは現GOP内のそれぞれP及びBピクチャの残りの枚数、また定数Kp=1.0及びKb=1.4である。
Ti = max {(Rgop / (1 + ((Np * Xp) / (Xi * Kp)) + ((Nb * Xb) / (Xi * Kb)))), (bit_rate / (8 * picture_rate))}
Tp = max {(Rgop / (Np + (Nb * Kp * Xb) / (Kb * Xp))), (bit_rate / (8 * picture_rate))} (3)
Tb = max {(Rgop / (Nb + (Np * Kb * Xp) / (Kp * Xb))), (bit_rate / (8 * picture_rate))}
However, Np and Nb are the remaining number of P and B pictures in the current GOP, respectively, and constants Kp = 1.0 and Kb = 1.4.

[STEP2]
I、P及びBピクチャ毎に3つの仮想バッファを使用し、式(3)で求めた目標符号量と発生符号量との差分を管理する。仮想バッファのデータ蓄積量をフィードバックし、そのデータ蓄積量に基づいて実際の発生符号量が目標符号量に近づくように、次に符号化するマクロブロックについて、量子化スケール(量子化ステップ)の参照値が設定される。
[STEP2]
Three virtual buffers are used for each of the I, P, and B pictures, and the difference between the target code amount obtained by Expression (3) and the generated code amount is managed. Refers to the quantization scale (quantization step) for the macroblock to be encoded next so that the data amount stored in the virtual buffer is fed back and the actual generated code amount approaches the target code amount based on the data storage amount. Value is set.

例えば、現在のピクチャタイプがPピクチャの場合には、目標符号量と発生符号量との差分は、次の(4)式に従う演算処理により求めることができる。   For example, when the current picture type is a P picture, the difference between the target code amount and the generated code amount can be obtained by arithmetic processing according to the following equation (4).

dp,j = dp,0 + Bp,j-1 −((Tp*(j-1))/MB_cnt) ・・・(4)
ここで、添字jはピクチャ内のマクロブロックの番号であり、dp,0は仮想バッファの初期フルネスを示し、Bp,jはj番目のマクロブロックまでの総符号量、MB_cntはピクチャ内のマクロブロック数を示す。
dp, j = dp, 0 + Bp, j−1 − ((Tp * (j−1)) / MB_cnt) (4)
Here, the subscript j is the number of the macroblock in the picture, dp, 0 indicates the initial fullness of the virtual buffer, Bp, j is the total code amount up to the jth macroblock, and MB_cnt is the macroblock in the picture Indicates a number.

次にdp,j(以後、「dj」と記載する。) を用いて、j番目のマクロブロックにおける量子化スケールの参照値を求めると、(5)式のようになる。   Next, using dp, j (hereinafter referred to as “dj”), the reference value of the quantization scale in the j-th macroblock is obtained as shown in equation (5).

Qj = (dj*31) / r ・・・(5)
ここで、r = 2*bits_rate/picture_rate ・・・(6)
である。rは、reaction parameter(反応パラメータ)と呼ばれる。
Qj = (dj * 31) / r (5)
Where r = 2 * bits_rate / picture_rate (6)
It is. r is called a reaction parameter.

[STEP3]
視覚特性、即ち、復号画像の画質が良好になるように、符号化対象のマクロブロックの空間アクティビティに基づいて、量子化スケールを最終的に決定する処理を実行する。
[STEP3]
A process of finally determining the quantization scale is executed based on the spatial activity of the macroblock to be encoded so that the visual characteristics, that is, the image quality of the decoded image is improved.

ACTj = 1+ min(vblk1, vblk2,……,vblk8) ・・・(7)
(7)式中において、vblk1〜vblk4はフレーム構造のマクロブロックにおける8x8のサブブロックにおける空間アクティビティを示す。また、vblk5〜vblk8はフィールド構造のマクロブロックにおける8x8サブブロックの空間アクティビティを示す。ここで、空間アクティビチィの演算は次の(8)、(9)式により求めることが可能である。
vblk = Σ(Pi−Pbar)2 ・・・(8)
Pbar = (1/64 )* ΣPi ・・・(9)
ここで、Piはi番目のマクロブロックにおける画素値であり、式(8)、(9)中のΣはi=1〜64の演算である。次に(7)式で求めたACTjを以下の(10)式によって正規化を行う。
ACTj = 1+ min (vblk1, vblk2, ..., vblk8) (7)
In the equation (7), vblk1 to vblk4 indicate spatial activities in 8 × 8 sub-blocks in the macroblock of the frame structure. Further, vblk5 to vblk8 indicate the 8 × 8 sub-block spatial activity in the field-structured macroblock. Here, the calculation of the space activity can be obtained by the following equations (8) and (9).
vblk = Σ (Pi−Pbar) 2 (8)
Pbar = (1/64) * ΣPi (9)
Here, Pi is a pixel value in the i-th macroblock, and Σ in equations (8) and (9) is an operation of i = 1 to 64. Next, ACTj obtained by the equation (7) is normalized by the following equation (10).

N_ACTj = (2*ACTj +AVG_ACT)/ (ACTj + AVG_ACT) ・・・(10)
ここで、AVG_ACTは以前に符号化したピクチャにおけるACTjの参照値であり、最終的に量子化スケール(量子化ステップ)MQUANTjは以下の(11)式により求められる。 MQUANTj = Qj * N_ACTj ・・・(11)
以上のTM5のアルゴリズムによれば、STEP1の処理によりIピクチャに対して多くの符号量を割り当ており、更にピクチャ内においては視覚的に劣化の目立ちやすい平坦部(空間アクティビティが低い)に符号量が多く配分されるようになる。
N_ACTj = (2 * ACTj + AVG_ACT) / (ACTj + AVG_ACT) (10)
Here, AVG_ACT is a reference value of ACTj in a previously encoded picture, and finally a quantization scale (quantization step) MQUANTj is obtained by the following equation (11). MQUANTj = Qj * N_ACTj (11)
According to the above TM5 algorithm, a large amount of code is allocated to the I picture by the processing of STEP1, and the code amount is in a flat portion (low spatial activity) that is visually noticeable in the picture. A lot will be allocated.

また、MPEG等の規格を用いた動画像符号化装置では、符号化された画像データを復号する画像復号化装置の持つ入力バッファの容量を破綻させないことを検証するために、画像復号化装置側の入力バッファを動画像符号化装置側から仮想的に考えた復号化保証用バッファを想定する。すなわちMPEGでは、VBV(Video Buffering Verifier)バッファ、H.264ではCPB(Coded Picture Buffer)を想定する。そして、このバッファのデータ占有量が許容値をオーバーフローまたはアンダーフローすなわち破綻しないように、動画像符号化装置における符号化データの発生量を制御している。   In addition, in a moving picture coding apparatus using a standard such as MPEG, in order to verify that the capacity of the input buffer of the picture decoding apparatus that decodes the coded picture data is not destroyed, the picture decoding apparatus side Is assumed to be a decoding guarantee buffer in which the input buffer is virtually considered from the moving image encoding device side. That is, in MPEG, a VBV (Video Buffering Verifier) buffer, H.264 assumes CPB (Coded Picture Buffer). The amount of encoded data generated in the moving image encoding apparatus is controlled so that the data occupying amount of the buffer does not overflow or underflow, that is, does not fail.

図3を用いてVBVバッファの説明を行う。図3は、縦軸にVBVバッファの占有量を示し、横軸は、時間を示している。図3の300がバッファの最大値を示している。一方301はバッファの最小値を示している。線分302の傾きはビットレートを示し、該線分の位置はVBVバッファにおけるデータ占有量を示している。   The VBV buffer will be described with reference to FIG. In FIG. 3, the vertical axis represents the VBV buffer occupation amount, and the horizontal axis represents time. 300 in FIG. 3 indicates the maximum value of the buffer. On the other hand, 301 indicates the minimum value of the buffer. The slope of the line segment 302 indicates the bit rate, and the position of the line segment indicates the data occupation amount in the VBV buffer.

また時刻ti、tb1、tb2、tpでは1ピクチャ分のデータがVBVバッファから読み出されたことにより、VBVバッファのデータ占有量が減少していることを示している。時刻tiでは、Iピクチャが、時刻tb1及びtb2ではBピクチャが時刻tpでは、Pピクチャが読み出されていることを示している。   In addition, at time ti, tb1, tb2, and tp, it is indicated that the data occupation amount of the VBV buffer is reduced by reading data for one picture from the VBV buffer. It shows that an I picture is read at time ti, a B picture is read at times tb1 and tb2, and a P picture is read at time tp.

バッファの占有量が最大値300を超えた場合は、オーバーフロー、逆にバッファの占有量が最小値301を下回った場合はアンダーフローと呼び、これらの現象が起きたときVBVバッファが破綻したことになる。   When the buffer occupancy exceeds the maximum value 300, it is called overflow. Conversely, when the buffer occupancy falls below the minimum value 301, it is called underflow. When these phenomena occur, the VBV buffer has failed. Become.

時刻303は、所定のデータ占有量の範囲を超えるデータをもったピクチャがVBVバッファから読み出され、VBVバッファにアンダーフローが発生した場合を示している。上述したように目標符号量を定め、VBVバッファが破綻しないように制御しているが、ピクチャの複雑さや、動きの激しさによって実際の発生符号量が目標符号量を上回った場合にアンダーフローを起こす場合がある。アンダーフローが起きると、該ピクチャを復号するためのデータが不足するので画像を復号できないことを意味する。   Time 303 shows a case where a picture having data exceeding a predetermined data occupancy range is read from the VBV buffer and an underflow occurs in the VBV buffer. As described above, the target code amount is determined and the VBV buffer is controlled so as not to fail, but underflow occurs when the actual generated code amount exceeds the target code amount due to the complexity of the picture and the intensity of motion. It may happen. When an underflow occurs, it means that the image cannot be decoded because there is insufficient data for decoding the picture.

このようにVBVバッファが破綻し、復号できない状態を回避するための破綻回避策として、たとえば、VBVバッファの占有量を見て破綻する可能性がある場合には、残りのブロックを全てスキップブロックにして発生符号量を抑える方法がある。   As a failure avoidance measure for avoiding a state in which the VBV buffer fails and cannot be decoded, for example, when there is a possibility of failure by looking at the occupation amount of the VBV buffer, all remaining blocks are set as skip blocks. There is a method of suppressing the generated code amount.

この状況を図4を用いて説明する。図4の縦軸はあるピクチャの発生符号量を示している。横軸は、該ピクチャ内に含まれるマクロブロックの数を示している。400は、該ピクチャの目標符号量を示している。   This situation will be described with reference to FIG. The vertical axis in FIG. 4 indicates the generated code amount of a certain picture. The horizontal axis indicates the number of macroblocks included in the picture. Reference numeral 400 denotes a target code amount of the picture.

401は該ピクチャの総マクロブロック数である。即ち、全てのマクロブロックを符号化した時に、発生符号量が目標符号量400に近づくように制御しながら動画像符号化装置は符号化を行っている。402は、該ピクチャに割り当てられた目標符号量をマクロブロック単位に振り分けた場合の、積算値を表している。画柄の複雑さに応じてマクロブロック毎に割り当てられる目標符号量が異なるためこのような直線にはならないが、説明を簡単にするため直線で示している。   401 is the total number of macroblocks of the picture. That is, when all the macroblocks are encoded, the moving image encoding apparatus performs encoding while controlling the generated code amount to approach the target code amount 400. Reference numeral 402 denotes an integrated value when the target code amount allocated to the picture is distributed in units of macroblocks. Since the target code amount assigned to each macroblock differs depending on the complexity of the design, such a straight line is not obtained, but is shown by a straight line for the sake of simplicity.

403は、符号化がピクチャ内の最後のマクロブロックを符号化する前に発生符号量が目標符号量を大きく上回り、かつVBVバッファのアンダーフロー限界値との差分が小さくなったマクロブロックを示している。このとき、VBVバッファを破綻させないように破綻回避処理が実行され、残りのマクロブロック404は全てスキップブロックになり符号量が抑えられ、VBVバッファのアンダーフローを防ぐことができる。
特開2006−217180号公報
Reference numeral 403 denotes a macroblock in which the generated code amount greatly exceeds the target code amount before encoding the last macroblock in the picture, and the difference from the underflow limit value of the VBV buffer is reduced. Yes. At this time, failure avoidance processing is executed so as not to cause the VBV buffer to fail, all remaining macro blocks 404 become skip blocks, the code amount is suppressed, and underflow of the VBV buffer can be prevented.
JP 2006-217180 A

しかしながら、従来の方法では、バッファが破綻する可能性がある場合でも、そうでない場合でも量子化パラメータの制御方法は同じであった。そのため、バッファが破綻する可能性がある場合には、例えばピクチャの中央部から右下端まで全てスキップブロックになるといった現象が起こることがあった。破綻は回避できるが、ピクチャの大部分がスキップブロックになり、画質が著しく劣化するという問題があった。   However, in the conventional method, the quantization parameter control method is the same regardless of whether the buffer may fail or not. For this reason, when there is a possibility that the buffer may fail, for example, a phenomenon may occur in which all blocks from the center of the picture to the lower right end become skip blocks. Although the failure can be avoided, there is a problem that most of the picture becomes a skip block and the image quality is significantly deteriorated.

そこで本発明では、バッファが破綻する可能性があり破綻回避処理が起こりやすい場合に、ピクチャ全体の発生符号量を該ピクチャの目標符号量近傍に収めて該ピクチャの符号化を終了可能とすることを目的とする。   Therefore, in the present invention, when there is a possibility that the buffer may fail and failure avoiding processing is likely to occur, the generated code amount of the entire picture is placed near the target code amount of the picture so that the encoding of the picture can be completed. With the goal.

上記課題を解決するための、一つの側面に対応する本発明は、動画像符号化装置であって、
入力画像データを量子化パラメータに基づき量子化する量子化手段と、
前記量子化手段による量子化結果をエントロピー符号化し、符号化データを生成する符号化手段と、
前記符号化データを記憶するバッファ手段と、
前記バッファ手段の占有量を監視する監視手段と、
前記符号化手段における目標符号量と発生符号量との差分と、反応パラメータとに基づき前記量子化パラメータを決定して、前記量子化手段を制御する制御手段と
を備え、
前記監視手段は、前記占有量に基づいて、前記反応パラメータの指定を含む制御信号を前記制御手段に出力し、
前記制御手段は、前記制御信号に含まれる前記反応パラメータの指定に従い、前記量子化パラメータを決定することを特徴とする。
The present invention corresponding to one aspect for solving the above problem is a moving image encoding device,
A quantization means for quantizing the input image data based on the quantization parameter;
Encoding means for entropy encoding the quantization result by the quantization means to generate encoded data;
Buffer means for storing the encoded data;
Monitoring means for monitoring the occupancy of the buffer means;
Control means for controlling the quantization means by determining the quantization parameter based on a difference between a target code amount and a generated code amount in the encoding means and a reaction parameter;
The monitoring means outputs a control signal including designation of the reaction parameter to the control means based on the occupation amount,
The control means determines the quantization parameter in accordance with designation of the reaction parameter included in the control signal.

上記課題を解決するための、他の側面に対応する本発明は、動画像符号化装置であって、
入力画像データを量子化パラメータに基づき量子化する量子化手段と、
前記量子化手段による量子化結果をエントロピー符号化し、符号化データを生成する符号化手段と、
前記符号化データを記憶するバッファ手段と、
前記バッファ手段の占有量を監視する監視手段と、
前記占有量に基づき前記符号化手段において生成される前記符号化データの目標符号量を生成する目標符号量生成手段と、
前記目標符号量と前記符号化手段における発生符号量との差分と、反応パラメータとに基づき前記量子化パラメータを決定して、前記量子化手段を制御する制御手段と
を備え、
前記目標符号量生成手段は、前記占有量と前記目標符号量との少なくともいずれかに基づいて、前記反応パラメータの指定を含む制御信号を前記制御手段に出力し、
前記制御手段は、前記制御信号に含まれる前記反応パラメータの指定に従い、前記量子化パラメータを決定することを特徴とする。
The present invention corresponding to another aspect for solving the above-described problems is a moving image encoding apparatus,
A quantization means for quantizing the input image data based on the quantization parameter;
Encoding means for entropy encoding the quantization result by the quantization means to generate encoded data;
Buffer means for storing the encoded data;
Monitoring means for monitoring the occupancy of the buffer means;
Target code amount generating means for generating a target code amount of the encoded data generated in the encoding means based on the occupation amount;
Control means for controlling the quantization means by determining the quantization parameter based on a difference between the target code quantity and the generated code quantity in the encoding means and a reaction parameter;
The target code amount generation means outputs a control signal including designation of the reaction parameter to the control means based on at least one of the occupation amount and the target code amount,
The control means determines the quantization parameter in accordance with designation of the reaction parameter included in the control signal.

本発明によれば、バッファが破綻する可能性があり破綻回避処理が起こりやすい場合に、ピクチャ全体の発生符号量を該ピクチャの目標符号量近傍に収めて該ピクチャの符号化を終了させることができる。これにより、バッファを破綻させることなく、VBVバッファの破綻回避処理の実行タイミングを遅らせる、もしくはバッファの破綻回避処理の実行を抑え、画像の著しい劣化を防止することができる。   According to the present invention, when there is a possibility that the buffer may fail and failure avoiding processing is likely to occur, the generated code amount of the entire picture is placed near the target code amount of the picture and the encoding of the picture is terminated. it can. Accordingly, it is possible to delay the execution timing of the VBV buffer failure avoiding process without suppressing the buffer, or to suppress the execution of the buffer failure avoiding process and prevent the image from remarkably deteriorating.

以下、発明の実施形態を添付図面を参照して説明する。   Embodiments of the present invention will be described below with reference to the accompanying drawings.

[第1の実施形態]
図1は発明の第1の実施形態に対応する動画像符号化装置の概略的な構成を示す図である。動画像符号化装置10は、量子化部100、エントロピー符号化部101、バッファ部102、バッファ監視部103、量子化制御部104とを含む。なお、図1に示す動画像符号化装置10の構成は、本願発明の説明のために必要な最低限の構成要素を示したものであって、動画像符号化装置10は図1に示す以外に他の構成要素、例えば、直交変換処理を行う直交変換部等を含んで構成することができる。
[First Embodiment]
FIG. 1 is a diagram showing a schematic configuration of a moving picture encoding apparatus corresponding to the first embodiment of the invention. The moving image encoding apparatus 10 includes a quantization unit 100, an entropy encoding unit 101, a buffer unit 102, a buffer monitoring unit 103, and a quantization control unit 104. Note that the configuration of the moving image encoding device 10 shown in FIG. 1 shows the minimum components necessary for the description of the present invention, and the moving image encoding device 10 is not shown in FIG. In addition, other components, for example, an orthogonal transform unit that performs an orthogonal transform process may be included.

動画像符号化装置10において、量子化部100は、入力画像データを量子化する。エントロピー符号化部101は、量子化部100での量子化結果の画像データをエントロピー符号化する。バッファ部102は符号化された画像データを蓄積する。バッファ監視部103は、バッファ部102の占有量を監視する。量子化制御部104は、エントロピー符号化部101とバッファ監視部103からの信号を入力し、量子化パラメータを決定する。   In the moving image encoding device 10, the quantization unit 100 quantizes input image data. The entropy encoding unit 101 performs entropy encoding on the image data resulting from the quantization performed by the quantization unit 100. The buffer unit 102 stores the encoded image data. The buffer monitoring unit 103 monitors the occupation amount of the buffer unit 102. The quantization control unit 104 receives signals from the entropy coding unit 101 and the buffer monitoring unit 103 and determines a quantization parameter.

量子化部100に入力されるデータD10は、例えば不図示の前段のブロックにおいて、直交変換などの処理が施されている。量子化部100は、量子化制御部104から与えられる量子化スケール値(量子化ステップ値)D17を用いて量子化を行い、量子化変換係数D11をエントロピー符号化部101に出力する。   The data D10 input to the quantization unit 100 is subjected to processing such as orthogonal transformation in a preceding block (not shown), for example. The quantization unit 100 performs quantization using the quantization scale value (quantization step value) D17 given from the quantization control unit 104, and outputs the quantized transform coefficient D11 to the entropy coding unit 101.

エントロピー符号化部101には、量子化部100から入力された量子化変換係数D11のエントロピー符号化を行う。該エントロピー符号化は例えば、MPEGではVLC(Variable Length Code)の符号化方式により行うことができる。その他、H.264ではCAVLC(Context−based Adaptive VLC)やCABAC(Context−based Adptive Binary Arithmetic Coding)などがある。   The entropy encoding unit 101 performs entropy encoding of the quantized transform coefficient D11 input from the quantization unit 100. The entropy encoding can be performed by, for example, a VLC (Variable Length Code) encoding method in MPEG. In addition, H. H.264 includes CAVLC (Context-based Adaptive VLC) and CABAC (Context-based Adaptive Binary Asymmetric Coding).

エントロピー符号化された符号化データD12はバッファ部102に出力され、該バッファ部102に蓄積される。また、エントロピー符号化により生成された符号量D16の情報は、該エントロピー符号化部101から量子化制御部104に出力される。該符号量D16を主力するタイミングは、例えばマクロブロック単位でも良いし、スライス単位、ピクチャ単位でも良い。   The encoded data D12 subjected to entropy encoding is output to the buffer unit 102 and stored in the buffer unit 102. Also, the information of the code amount D16 generated by entropy coding is output from the entropy coding unit 101 to the quantization control unit 104. The main timing of the code amount D16 may be, for example, a macroblock unit, a slice unit, or a picture unit.

バッファ部102は、符号化データD12を蓄積する記憶装置である。バッファ監視部103は、バッファ部102の占有量を監視し、不図示の上位ブロックから与えられた閾値と比較し、占有量が閾値を超えた場合、制御信号D15を量子化制御部104に出力する。   The buffer unit 102 is a storage device that accumulates the encoded data D12. The buffer monitoring unit 103 monitors the occupation amount of the buffer unit 102, compares it with a threshold value given from an upper block (not shown), and outputs a control signal D15 to the quantization control unit 104 when the occupation amount exceeds the threshold value. To do.

以下、図2を参照してバッファ監視部103の動作説明する。図2は、縦軸にバッファ部102のバッファ占有量を示している。横軸は時間を示している。点線200は、バッファ部102の容量の最大値を示している。点線201はバッファ監視部103に与えられるバッファの占有量の第1の閾値を示している。   Hereinafter, the operation of the buffer monitoring unit 103 will be described with reference to FIG. FIG. 2 shows the buffer occupation amount of the buffer unit 102 on the vertical axis. The horizontal axis indicates time. A dotted line 200 indicates the maximum capacity of the buffer unit 102. A dotted line 201 indicates a first threshold of the buffer occupation amount given to the buffer monitoring unit 103.

折れ線203は、バッファ占有量の値を示しており、右斜め上方向の傾きはビットレートに対応する。また、時刻t22で示すようなバッファ占有量が定期的に落ち込んでいる箇所は、バッファに格納された符号化データがデコーダにより読み出されたことを示している。このデコーダによる読み出しは、所定のタイミングにより定期的に行われることとなっている。 A polygonal line 203 indicates the buffer occupancy value, and the slope in the upper right direction corresponds to the bit rate. Also, portions of buffer occupancy, as shown at time t 22 is depressed so regularly, encoded data stored in the buffer indicates that the data read out by the decoder. Reading by this decoder is periodically performed at a predetermined timing.

時刻t21は、例えば、比較的符号量が多いIピクチャの符号化データを該バッファ部に蓄積し終えた時刻を示している。バッファ監視部103は、バッファ部102のバッファ占有量が多いか否かを判定する。このときの判定基準は、例えば、バッファ占有量が、バッファ部102の容量に対して所定の割合以上を有するか否かに基づくことができる。当該所定の割合としては、例えば、最大値200の5割とすることができる。なお、ここで示す割合は、一例であって例えば6割、7割、或いはそれ以上であっても良い。当該判定基準によれば、時刻t21における該バッファの占有量が多いと判定される。このように該バッファ監視部103が、該バッファ部の占有量が多いと判定した場合には、量子化制御部104に対して、制御感度を低くするための第1の制御命令を含む制御信号D15を出力する。具体的に、後述する第1の反応パラメータr1の指定を含む制御信号D15を出力する。 Time t 21 indicates, for example, the time when the encoded data of an I picture having a relatively large code amount has been accumulated in the buffer unit. The buffer monitoring unit 103 determines whether the buffer occupation amount of the buffer unit 102 is large. The determination criterion at this time can be based on, for example, whether or not the buffer occupation amount has a predetermined ratio or more with respect to the capacity of the buffer unit 102. The predetermined ratio can be, for example, 50% of the maximum value 200. The ratio shown here is an example, and may be 60%, 70%, or more, for example. According to this criterion, at time t 21 is determined to occupancy of the buffer is large. As described above, when the buffer monitoring unit 103 determines that the occupied amount of the buffer unit is large, the control signal including the first control command for lowering the control sensitivity to the quantization control unit 104. D15 is output. Specifically, a control signal D15 including designation of a first reaction parameter r1 described later is output.

これにより、制御感度が低下し(第1の制御感度)発生符号量が増加するので、バッファからの読み出しデータ量が多くなって結果としてバッファの占有量が減少することとなる。よって、オーバーフローを防止することができる。   As a result, the control sensitivity is reduced (first control sensitivity) and the generated code amount is increased, so that the amount of data read from the buffer is increased and, as a result, the buffer occupation amount is decreased. Therefore, overflow can be prevented.

ここで、制御感度とは、発生符号量と目標符号量との差分の変化に対する量子化パラメータの感度のことをいう。即ち、制御感度が低いとは、差分の変化に対して量子化パラメータが変化しにくく、差分が小さい状態では量子化パラメータが変化しづらいことを意味する。この場合、量子化パラメータは小さいままであるので、発生符号量は増える方向に働くこととなる。一方、制御感度が高いとは、差分の変化に対して量子化パラメータが変化し易く、差分が小さい状態でも量子化パラメータが変化することを意味する。この場合、量子化パラメータが大きくなりやすいので、発生符号量は減る方向に働くこととなる。   Here, the control sensitivity refers to the sensitivity of the quantization parameter with respect to a change in the difference between the generated code amount and the target code amount. That is, the low control sensitivity means that the quantization parameter is difficult to change with respect to the difference change, and the quantization parameter is difficult to change when the difference is small. In this case, since the quantization parameter remains small, the amount of generated code works in an increasing direction. On the other hand, a high control sensitivity means that the quantization parameter is likely to change with respect to a change in the difference, and the quantization parameter changes even when the difference is small. In this case, since the quantization parameter tends to increase, the amount of generated code works in a direction to decrease.

次に、時刻t23は、あるピクチャ全ての符号化データが該バッファに蓄積された時刻である。その時刻t23の時に、該バッファの占有量が該第1の閾値以下の値となっている。バッファの占有量が下がってきていると言うことは、次に符号化するピクチャの発生符号量が大きかった場合(例えば、Iピクチャの場合)に、符号化データの蓄積が読み出しのタイミングに間に合わなければ、アンダーフローが発生することとなる。そこで、バッファ監視部103はバッファ部102の占有量が該閾値以下になった場合は、アンダーフローする可能性があると認識し、量子化制御部104に対して、制御感度を上昇させるための第2の制御命令を含む制御信号D15を出力する。具体的に、後述する第2の反応パラメータr2の指定を含む制御信号D15を出力する。 Next, at time t 23 is the time at which all of the coded data a picture has been stored in the buffer. When the time t 23, the occupied amount of the buffer is less than or equal to a value first threshold. The fact that the buffer occupancy is decreasing means that when the generated code amount of the next picture to be encoded is large (for example, in the case of an I picture), the accumulation of encoded data must be in time for the read timing. If this occurs, underflow will occur. Therefore, the buffer monitoring unit 103 recognizes that there is a possibility of underflow when the occupation amount of the buffer unit 102 is less than or equal to the threshold value, and causes the quantization control unit 104 to increase control sensitivity. A control signal D15 including the second control command is output. Specifically, a control signal D15 including designation of a second reaction parameter r2 described later is output.

これにより、制御感度が高まり(第2の制御感度)発生符号量が減少するので、符号化データ読み出しのタイミングでは、読み出すべき符号化データがバッファに蓄積されているので、アンダーフローを防ぐことができる。   As a result, the control sensitivity increases (second control sensitivity) and the amount of generated code decreases, so that at the timing of reading the encoded data, the encoded data to be read is accumulated in the buffer, so that underflow can be prevented. it can.

量子化制御部104には、エントロピー符号化部101から符号量が入力され、バッファ監視部103から制御信号D15が入力される。量子化制御部104は、入力される制御信号D15に応じて、制御感度を変化させる。量子化制御部104が設定する制御感度の違いによる発生符号量の違いを図5を用いて説明する。   The quantization control unit 104 receives a code amount from the entropy encoding unit 101 and receives a control signal D15 from the buffer monitoring unit 103. The quantization control unit 104 changes the control sensitivity according to the input control signal D15. A difference in generated code amount due to a difference in control sensitivity set by the quantization control unit 104 will be described with reference to FIG.

図5(a)は、第1の制御感度におけるマクロブロック毎の目標符号量と発生符号量の関係を示している。図5(b)は、第1の制御感度よりも高い第2の制御感度におけるマクロブロック毎の目標符号量と発生符号量の関係を示している。500及び503は、符号化中のピクチャに割り当てられた目標符号量をマクロブロック単位に振り分けた場合の、積算値を表している。501及び504は発生符号量を示している。502及び505は、該目標符号量と該発生符号量との差分値を示している。   FIG. 5A shows the relationship between the target code amount and the generated code amount for each macroblock in the first control sensitivity. FIG. 5B shows the relationship between the target code amount for each macroblock and the generated code amount at the second control sensitivity that is higher than the first control sensitivity. Reference numerals 500 and 503 denote integrated values when the target code amount allocated to the picture being encoded is distributed in units of macroblocks. Reference numerals 501 and 504 denote generated code amounts. Reference numerals 502 and 505 denote difference values between the target code amount and the generated code amount.

図5(a)に示すように、第1の制御感度では、目標符号量と発生符号量との差分値が所定の差分値502と一致した場合に、量子化スケール値(量子化ステップ値)が大きくなるように量子化パラメータを変化させている。これにより発生符号量が抑えられ、目標符号量との差分が小さくなるように制御が行われる。   As shown in FIG. 5A, in the first control sensitivity, when the difference value between the target code amount and the generated code amount matches a predetermined difference value 502, the quantization scale value (quantization step value). The quantization parameter is changed so that becomes larger. As a result, the generated code amount is suppressed, and control is performed so that the difference from the target code amount becomes small.

これに対して図5(b)に示すように、第2の制御感度では、目標符号量と発生符号量との差分値が所定の差分値505と一致した場合に、量子化スケール値(量子化ステップ値)が大きくなるように量子化パラメータを変化させている。制御感度を高めた場合、差分値505は差分値502よりも小さくなる。よって、量子化パラメータの変化する頻度は、図5(a)の場合と比べて高くなる。   On the other hand, as shown in FIG. 5B, in the second control sensitivity, when the difference value between the target code amount and the generated code amount matches the predetermined difference value 505, the quantization scale value (quantum) The quantization parameter is changed so that the quantization step value) increases. When the control sensitivity is increased, the difference value 505 is smaller than the difference value 502. Therefore, the frequency of changing the quantization parameter is higher than in the case of FIG.

制御感度は、例えば再度以下に引用する(5)式の反応パラメータ(reaction parameter)rを変化させることにより変更することができる。
Qj = (dj*31) / r ・・・(5)
ここで、Qjは、量子化スケール値、djは目標符号量と発生符号量との差分値、rは反応パラメータである。この(5)式によれば、rの値を大きくしたり、小さくしたりすることにより、量子化スケール値の値を制御することができる。例えば、第1の制御感度においてはrを第1の反応パラメータr1とし、第2の制御感度においてはrを第2の反応パラメータr2とする。このとき、r1>r2の関係が成立する。
The control sensitivity can be changed, for example, by changing the reaction parameter r in the equation (5) cited below again.
Qj = (dj * 31) / r (5)
Here, Qj is a quantization scale value, dj is a difference value between the target code amount and the generated code amount, and r is a reaction parameter. According to the equation (5), the value of the quantization scale value can be controlled by increasing or decreasing the value of r. For example, r is the first reaction parameter r1 in the first control sensitivity, and r is the second reaction parameter r2 in the second control sensitivity. At this time, the relationship r1> r2 is established.

このような反応パラメータの関係によれば、第1の制御感度と第2の制御感度では、同一の差分値であっても演算により得られる量子化スケール値が異なり、第1の制御感度の方が、第2の制御感度よりも量子化スケール値が小さくなる。このことは、第1の制御感度の場合は、第2の制御感度の場合よりも発生符号量が増えることを意味する。   According to the relationship between the reaction parameters, the first control sensitivity and the second control sensitivity have different quantization scale values obtained by calculation even with the same difference value. However, the quantization scale value becomes smaller than the second control sensitivity. This means that the generated code amount increases in the case of the first control sensitivity than in the case of the second control sensitivity.

このようにして制御感度を高めたい場合には、反応パラメータrの値を小さく(r1→r2)すればよい。これにより、差分値505(フルネスdj)が差分値502よりも小さい値でも量子化パラメータを変化させることが可能である。   In order to increase the control sensitivity in this way, the value of the reaction parameter r may be decreased (r1 → r2). As a result, the quantization parameter can be changed even when the difference value 505 (fullness dj) is smaller than the difference value 502.

以上の制御を行うことで、VBVバッファが破綻する可能性がある場合、符号化中のピクチャの発生符号量を目標符号量に近づけることができるので破綻回避処理を実行させる必要が低減され、VBVバッファの破綻も防止できる。   By performing the above control, if there is a possibility that the VBV buffer may fail, the generated code amount of the picture being encoded can be brought close to the target code amount, so that the necessity of executing the failure avoiding process is reduced. Buffer failures can also be prevented.

以上図1、図5に示したブロック図及び、制御方法に従った処理を実行することにより、破綻回避処理を低減することができ、破綻回避処理が実行された場合でも画像の著しい劣化を防止することが可能になる。   By executing the processing according to the block diagram and the control method shown in FIGS. 1 and 5, the failure avoidance processing can be reduced, and even when the failure avoidance processing is executed, the image is prevented from being significantly deteriorated. It becomes possible to do.

[第2の実施形態]
次に、発明の第2の実施形態を説明する。図6は、発明の第2の実施形態に対応する動画像符号化装置の概略的な構成を示す図である。
[Second Embodiment]
Next, a second embodiment of the invention will be described. FIG. 6 is a diagram showing a schematic configuration of a moving picture coding apparatus corresponding to the second embodiment of the invention.

動画像符号化装置60は、量子化部600、エントロピー符号化部601、バッファ部602、バッファ監視部603、目標符号量生成部604、量子化制御部605とを含む。なお、図6に示す動画像符号化装置60の構成は、本願発明の説明のために必要な最低限の構成要素を示したものであって、動画像符号化装置60は図6に示す以外に他の構成要素、例えば、直交変換処理を行う直交変換部等を含んで構成することができる。   The moving image encoding apparatus 60 includes a quantization unit 600, an entropy encoding unit 601, a buffer unit 602, a buffer monitoring unit 603, a target code amount generation unit 604, and a quantization control unit 605. The configuration of the moving image encoding device 60 shown in FIG. 6 shows the minimum components necessary for the description of the present invention, and the moving image encoding device 60 is not shown in FIG. In addition, other components, for example, an orthogonal transform unit that performs an orthogonal transform process may be included.

なお、量子化部600、エントロピー符号化部601及びバッファ部602は、第1の実施形態における量子化部100、エントロピー符号化部101及びバッファ部102と同様の動作を行うのでここでは詳細な説明は省略する。   Note that the quantization unit 600, the entropy encoding unit 601 and the buffer unit 602 perform the same operations as the quantization unit 100, the entropy encoding unit 101 and the buffer unit 102 in the first embodiment, and thus will be described in detail here. Is omitted.

バッファ監視部603は、バッファ部602の占有量を監視する。監視するタイミングはマクロブロック単位やピクチャ単位である。該占有量D60を目標符号量生成部604に入力する。   The buffer monitoring unit 603 monitors the occupation amount of the buffer unit 602. The monitoring timing is in units of macroblocks or pictures. The occupation amount D60 is input to the target code amount generation unit 604.

目標符号量生成部604は、次に符号化するピクチャの目標符号量を決定する。該目標符号量の決定方法は、上述したTM5(Test Model 5)と同じ方法で決定しても良い。該目標符号量生成部604で決定したピクチャの目標符号量D61は量子化制御部605に入力される。   A target code amount generation unit 604 determines a target code amount of a picture to be encoded next. The target code amount may be determined by the same method as TM5 (Test Model 5) described above. The target code amount D61 of the picture determined by the target code amount generation unit 604 is input to the quantization control unit 605.

量子化制御部605には、目標符号量生成部604から、次に符号化するピクチャの目標符号量D61が入力され、エントロピー符号化部601で符号化した結果生ずる発生符号量が該目標符号量に近づくように量子化パラメータを決定する。決定された量子化パラメータD62は量子化部600に出力される。   The quantization control unit 605 receives the target code amount D61 of the next picture to be encoded from the target code amount generation unit 604, and the generated code amount generated as a result of encoding by the entropy encoding unit 601 is the target code amount. The quantization parameter is determined so as to approach. The determined quantization parameter D62 is output to the quantization unit 600.

以下、図7を参照して、量子化制御部605における制御を説明する。図7の縦軸はバッファ部602の占有量を示している。横軸は時間を示している。以下では、Iピクチャの符号化を行う場合を例として説明する。   Hereinafter, the control in the quantization control unit 605 will be described with reference to FIG. The vertical axis in FIG. 7 indicates the occupation amount of the buffer unit 602. The horizontal axis indicates time. Hereinafter, a case where I picture coding is performed will be described as an example.

時刻t71は、Iピクチャ処理を開始する時点である。この時点において量子化制御部605には、目標符号量生成部604よりIピクチャの目標符号量D61と、バッファ占有量D60の情報が提供される。 Time t71 is a time point at which the I picture process is started. At this time, the quantization control unit 605 is provided with information of the target code amount D61 of the I picture and the buffer occupation amount D60 from the target code amount generation unit 604.

目標符号量生成部604より通知された占有量D60に対応する値が図7の点701で示される値に対応する。占有量の値701を「Br」とする。また、目標符号量D61は太線707で示す長さに相当し、この時の目標符号量の値707を「Dt」とする。処理対象のIピクチャは時刻t71で処理が開始され、点線702、703で示すようにバッファ部602に符号化データが格納される。格納完了時のバッファ占有量は点704に示す通りであり、時刻t73でそこから目標符号量Dtが読み出されることとなる。 A value corresponding to the occupation amount D60 notified from the target code amount generation unit 604 corresponds to a value indicated by a point 701 in FIG. The occupancy value 701 is “Br”. Further, the target code amount D61 corresponds to the length indicated by the bold line 707, and the value 707 of the target code amount at this time is “Dt”. Processing of the I picture to be processed is started at time t 71 , and encoded data is stored in the buffer unit 602 as indicated by dotted lines 702 and 703. Buffer occupancy at the time of completion of storage are as shown in the point 704, so that the target code amount Dt from there at time t 73 is read.

なお、時刻t72において、Iピクチャ以前に処理された他のピクチャ(例えば、Bピクチャ)の符号化データがバッファ部602から読み出される。なお、このとき読み出されるデータ量706は、エントロピー符号化部601から既に量子化制御部605に対して通知(D63)されているので、既知である。ここでは、この読み出しデータのデータ量706を「Db」とする。また、バッファ部602への書込速度を「Ws」とする。 At time t 72 , encoded data of another picture (for example, B picture) processed before the I picture is read from the buffer unit 602. Note that the data amount 706 read at this time is already known because the entropy coding unit 601 has already notified the quantization control unit 605 (D63). Here, the data amount 706 of the read data is “Db”. The writing speed to the buffer unit 602 is “Ws”.

以上によれば、時刻t73において、目標符号量に相当する符号化データがバッファ部602から削除された後のバッファの占有量705の値Bdは、以下のように求めることができる。
Bd=Br+Bs×(t73−t71)−(Db+Dt)
本実施形態では、Bdの大きさに基づいて、制御感度を変化させることができる。例えば、Bdがバッファの占有量の最小値に近い値を有する場合には、実際の発生符号量が目標符号量を上回った場合にアンダーフローを起こす可能性が高い。そこで、このような場合は、該制御感度を第2の制御感度とし、図5に示した制御を行うことでバッファの破綻を防止する。例えば、制御感度は上述した反応パラメータrをr2として、発生符号量を抑える方向に制御を行う。
According to the above, the value Bd of the buffer occupation amount 705 after the encoded data corresponding to the target code amount is deleted from the buffer unit 602 at time t 73 can be obtained as follows.
Bd = Br + Bs × (t 73 −t 71 ) − (Db + Dt)
In the present embodiment, the control sensitivity can be changed based on the magnitude of Bd. For example, when Bd has a value close to the minimum value of the buffer occupancy, underflow is likely to occur when the actual generated code amount exceeds the target code amount. Therefore, in such a case, the control sensitivity is set as the second control sensitivity, and the buffer failure is prevented by performing the control shown in FIG. For example, the control sensitivity is controlled so as to suppress the generated code amount, with the reaction parameter r described above as r2.

なお、Bdがアンダーフローを引き起こす程に低い値か否かは、例えば、予め定めておいた一定値との比較により判定することができる。即ち、Bdの値が一定値以下の場合には、アンダーフローを引き起こす可能性があるとして、制御感度を第2の制御感度とする。また、Bdの値が一定値より大きい場合には、制御感度を第1の制御感度とする。   Note that whether or not Bd is low enough to cause underflow can be determined, for example, by comparison with a predetermined constant value. That is, when the value of Bd is equal to or smaller than a certain value, the control sensitivity is set as the second control sensitivity because it may cause an underflow. When the value of Bd is larger than a certain value, the control sensitivity is set as the first control sensitivity.

また、その他にも、目標符号量D61の値自体を所定の第2の閾値と比較し、比較結果に応じて制御感度を設定しても良い。例えば、目標符号量D61が第2の閾値よりも大きい場合には、制御感度を高くして第2の制御感度とすることができる。これにより、発生符号量が目標符号量を上回って更に大きい値になることを防止して、バッファーの破綻を防止することができる。また、目標符号量D61が第2の閾値以下の場合には、制御感度を低下させて第1の制御感度とすることができる。   In addition, the value of the target code amount D61 itself may be compared with a predetermined second threshold value, and the control sensitivity may be set according to the comparison result. For example, when the target code amount D61 is larger than the second threshold value, the control sensitivity can be increased to obtain the second control sensitivity. Thereby, it is possible to prevent the generated code amount from exceeding the target code amount and become a larger value, thereby preventing a buffer failure. Further, when the target code amount D61 is equal to or smaller than the second threshold value, the control sensitivity can be lowered to the first control sensitivity.

なお、第1の実施形態と同様に、バッファ部602の占有量の値に基づいて、制御感度を変更しても良い。   As in the first embodiment, the control sensitivity may be changed based on the value of the occupation amount of the buffer unit 602.

以上、図6、図7に示したブロック図及び、制御方法に従った処理を実行することにより、破綻回避処理を低減することができ、破綻回避処理が実行された場合でも画像の著しい劣化を防止することが可能になる。   As described above, by executing the processing according to the block diagrams and the control method shown in FIGS. 6 and 7, the failure avoidance processing can be reduced, and even when the failure avoidance processing is executed, the image is significantly deteriorated. It becomes possible to prevent.

このような制御を行うことで、VBVバッファが破綻する可能性がある場合、符号化中のピクチャの発生符号量を目標符号量に近づけることができるので、破綻回避処理を実行させる必要が低減されVBVバッファの破綻も防止できる。   By performing such control, when there is a possibility that the VBV buffer may fail, the generated code amount of the picture being encoded can be brought close to the target code amount, thereby reducing the necessity of executing the failure avoiding process. The failure of the VBV buffer can also be prevented.

[その他の実施形態]
なお、以上の実施形態において、反応パラメータ、閾値、制御感度について、「第1の」、「第2の」との文言を利用したが、これは単に複数の概念を互いに区別するために用いたものであって、それ以上の意図はない。
[Other Embodiments]
In the above embodiment, the terms “first” and “second” are used for the reaction parameter, threshold value, and control sensitivity, but this is simply used to distinguish a plurality of concepts from each other. There is no intention beyond that.

本発明の目的は、前述した機能を実現するコンピュータプログラムのコードを記録した記憶媒体を、システムに供給し、そのシステムがコンピュータプログラムのコードを読み出し実行することによっても達成される。この場合、記憶媒体から読み出されたコンピュータプログラムのコード自体が前述した実施形態の機能を実現し、そのコンピュータプログラムのコードを記憶した記憶媒体は本発明を構成する。また、そのプログラムのコードの指示に基づき、コンピュータ上で稼働しているオペレーティングシステム(OS)などが実際の処理の一部または全部を行い、その処理によって前述した機能が実現される場合も含まれる。   The object of the present invention can also be achieved by supplying a storage medium storing a computer program code for realizing the above-described functions to the system, and the system reading and executing the computer program code. In this case, the computer program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the computer program code constitutes the present invention. In addition, the operating system (OS) running on the computer performs part or all of the actual processing based on the code instruction of the program, and the above-described functions are realized by the processing. .

さらに、以下の形態で実現しても構わない。すなわち、記憶媒体から読み出されたコンピュータプログラムコードを、コンピュータに挿入された機能拡張カードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込む。そして、そのコンピュータプログラムのコードの指示に基づき、その機能拡張カードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行って、前述した機能が実現される場合も含まれる。   Furthermore, you may implement | achieve with the following forms. That is, the computer program code read from the storage medium is written into a memory provided in a function expansion card inserted into the computer or a function expansion unit connected to the computer. Then, based on the instruction of the code of the computer program, the above-described functions are realized by the CPU or the like provided in the function expansion card or function expansion unit performing part or all of the actual processing.

本発明を上記記憶媒体に適用する場合、その記憶媒体には、先に説明したフローチャートに対応するコンピュータプログラムのコードが格納されることになる。   When the present invention is applied to the above storage medium, the computer program code corresponding to the flowchart described above is stored in the storage medium.

発明の第1の実施形態に対応する動画像符号化装置の構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the moving image encoder corresponding to the 1st Embodiment of invention. 発明の第1の実施形態に対応するバッファ監視部103の動作を説明するための、バッファ部102の占有量の遷移を示すグラフである。It is a graph which shows the transition of the occupation amount of the buffer part 102 for demonstrating operation | movement of the buffer monitoring part 103 corresponding to the 1st Embodiment of invention. 従来のバッファの占有量の遷移を示すグラフである。It is a graph which shows the transition of the occupation amount of the conventional buffer. 発生符号量と破綻回避処理の関係を示すグラフである。It is a graph which shows the relationship between generated code amount and failure avoidance processing. 発明の第1の実施形態に対応する量子化制御部104が設定する制御感度の違いによる発生符号量の違いを説明するための図である。It is a figure for demonstrating the difference in the generated code amount by the difference in the control sensitivity which the quantization control part 104 corresponding to the 1st Embodiment of the invention sets. 発明の第2の実施形態に対応する動画像符号化の構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the moving image encoding corresponding to the 2nd Embodiment of invention. 発明の第2の実施形態における量子化制御部605における制御を説明するためのグラフである。It is a graph for demonstrating control in the quantization control part 605 in the 2nd Embodiment of invention.

符号の説明Explanation of symbols

100 量子化部
101 エントロピー符号化部
102 バッファ部
103 バッファ監視部
104 量子化制御部
DESCRIPTION OF SYMBOLS 100 Quantization part 101 Entropy encoding part 102 Buffer part 103 Buffer monitoring part 104 Quantization control part

Claims (9)

動画像符号化装置であって、
入力画像データを量子化パラメータに基づき量子化する量子化手段と、
前記量子化手段による量子化結果をエントロピー符号化し、符号化データを生成する符号化手段と、
前記符号化データを記憶するバッファ手段と、
前記バッファ手段の占有量を監視する監視手段と、
前記符号化手段における目標符号量と発生符号量との差分と、反応パラメータとに基づき前記量子化パラメータを決定して、前記量子化手段を制御する制御手段と
を備え、
前記監視手段は、前記占有量に基づいて、前記反応パラメータの指定を含む制御信号を前記制御手段に出力し、
前記制御手段は、前記制御信号に含まれる前記反応パラメータの指定に従い、前記量子化パラメータを決定する
ことを特徴とする動画像符号化装置。
A video encoding device,
A quantization means for quantizing the input image data based on the quantization parameter;
Encoding means for entropy encoding the quantization result by the quantization means to generate encoded data;
Buffer means for storing the encoded data;
Monitoring means for monitoring the occupancy of the buffer means;
Control means for controlling the quantization means by determining the quantization parameter based on a difference between a target code amount and a generated code amount in the encoding means and a reaction parameter;
The monitoring means outputs a control signal including designation of the reaction parameter to the control means based on the occupation amount,
The moving picture coding apparatus, wherein the control means determines the quantization parameter in accordance with designation of the reaction parameter included in the control signal.
前記監視手段は、前記占有量が前記バッファ手段の容量に対して所定の割合を有する場合に、前記量子化パラメータの前記差分の変化に対する感度を低下させるために、前記反応パラメータを第1の反応パラメータに指定する前記制御信号を、前記制御手段に出力することを特徴とする請求項1に記載の動画像符号化装置。   The monitoring means sets the reaction parameter to a first reaction in order to reduce sensitivity to the change in the difference of the quantization parameter when the occupation amount has a predetermined ratio with respect to the capacity of the buffer means. 2. The moving image encoding apparatus according to claim 1, wherein the control signal specified as a parameter is output to the control means. 前記監視手段は、前記占有量が第1の閾値以下の値を有する場合に、前記量子化パラメータの前記差分の変化に対する感度を上昇させるために、前記反応パラメータを第2の反応パラメータに指定する前記制御信号を、前記制御手段に出力することを特徴とする請求項1に記載の動画像符号化装置。   The monitoring means designates the reaction parameter as a second reaction parameter in order to increase the sensitivity to the change in the difference of the quantization parameter when the occupation amount has a value equal to or less than a first threshold value. The video encoding apparatus according to claim 1, wherein the control signal is output to the control unit. 動画像符号化装置であって、
入力画像データを量子化パラメータに基づき量子化する量子化手段と、
前記量子化手段による量子化結果をエントロピー符号化し、符号化データを生成する符号化手段と、
前記符号化データを記憶するバッファ手段と、
前記バッファ手段の占有量を監視する監視手段と、
前記占有量に基づき前記符号化手段において生成される前記符号化データの目標符号量を生成する目標符号量生成手段と、
前記目標符号量と前記符号化手段における発生符号量との差分と、反応パラメータとに基づき前記量子化パラメータを決定して、前記量子化手段を制御する制御手段と
を備え、
前記目標符号量生成手段は、前記占有量と前記目標符号量との少なくともいずれかに基づいて、前記反応パラメータの指定を含む制御信号を前記制御手段に出力し、
前記制御手段は、前記制御信号に含まれる前記反応パラメータの指定に従い、前記量子化パラメータを決定する
ことを特徴とする動画像符号化装置。
A video encoding device,
A quantization means for quantizing the input image data based on the quantization parameter;
Encoding means for entropy encoding the quantization result by the quantization means to generate encoded data;
Buffer means for storing the encoded data;
Monitoring means for monitoring the occupancy of the buffer means;
Target code amount generating means for generating a target code amount of the encoded data generated in the encoding means based on the occupation amount;
Control means for controlling the quantization means by determining the quantization parameter based on a difference between the target code quantity and the generated code quantity in the encoding means and a reaction parameter;
The target code amount generation means outputs a control signal including designation of the reaction parameter to the control means based on at least one of the occupation amount and the target code amount,
The moving picture coding apparatus, wherein the control means determines the quantization parameter in accordance with designation of the reaction parameter included in the control signal.
前記目標符号量生成手段は、前記目標符号量と第2の閾値とを比較し、
前記目標符号量が前記第2の閾値以下の場合には、前記量子化パラメータの前記差分の変化に対する感度を低下させるために、前記反応パラメータを第1の反応パラメータに指定する前記制御信号を前記制御手段に出力し、
前記目標符号量が前記第2の閾値より大きい場合には、前記量子化パラメータの前記差分の変化に対する感度を上昇させるために、前記反応パラメータを第2の反応パラメータに指定する前記制御信号を前記制御手段に出力する
ことを特徴とする請求項4に記載の動画像符号化装置。
The target code amount generation means compares the target code amount with a second threshold,
When the target code amount is less than or equal to the second threshold value, the control signal that designates the reaction parameter as the first reaction parameter is set to the control signal to reduce sensitivity to the change in the difference of the quantization parameter. Output to the control means,
When the target code amount is larger than the second threshold, the control signal designating the reaction parameter as the second reaction parameter is set to the second reaction parameter in order to increase sensitivity to the change in the difference of the quantization parameter. 5. The moving picture coding apparatus according to claim 4, wherein the moving picture coding apparatus outputs to the control means.
前記目標符号量生成手段は、前記占有量と前記目標符号量とに基づき、前記符号化手段における発生符号量が前記目標符号量を上回った場合に、前記バッファ手段がアンダーフローする可能性があるか否かを判定し、
前記アンダーフローの可能性があると判定した場合には、前記量子化パラメータの前記差分の変化に対する感度を上昇させるために、前記反応パラメータを第2の反応パラメータに指定する前記制御信号を前記制御手段に出力する
ことを特徴とする請求項4に記載の動画像符号化装置。
The target code amount generation means may cause the buffer means to underflow based on the occupation amount and the target code amount, when the generated code amount in the encoding means exceeds the target code amount. Whether or not
If it is determined that there is a possibility of the underflow, the control signal that designates the reaction parameter as a second reaction parameter is controlled in order to increase sensitivity to the change in the difference of the quantization parameter. 5. The moving picture coding apparatus according to claim 4, wherein the moving picture coding apparatus outputs to the means.
入力画像データを量子化パラメータに基づき量子化する量子化手段と、
前記量子化手段による量子化結果をエントロピー符号化し、符号化データを生成する符号化手段と、
前記符号化データを記憶するバッファ手段と、
前記バッファ手段の占有量を監視する監視手段と、
前記符号化手段における目標符号量と発生符号量との差分と、反応パラメータとに基づき前記量子化パラメータを決定して、前記量子化手段を制御する制御手段と
を備える動画像符号化装置の制御方法であって、
前記監視手段が、前記占有量に基づいて、前記反応パラメータの指定を含む制御信号を前記制御手段に出力する出力工程と、
前記制御手段が、前記制御信号に含まれる前記反応パラメータの指定に従い、前記量子化パラメータを決定する決定工程と
を備えることを特徴とする動画像符号化装置の制御方法。
A quantization means for quantizing the input image data based on the quantization parameter;
Encoding means for entropy encoding the quantization result by the quantization means to generate encoded data;
Buffer means for storing the encoded data;
Monitoring means for monitoring the occupancy of the buffer means;
Control of a moving picture encoding apparatus comprising: a control unit that determines the quantization parameter based on a difference between a target code amount and a generated code amount in the encoding unit and a reaction parameter, and controls the quantization unit A method,
An output step of outputting a control signal including designation of the reaction parameter to the control means based on the occupation amount;
A control method for a moving picture coding apparatus, comprising: a determining step in which the control means determines the quantization parameter in accordance with designation of the reaction parameter included in the control signal.
入力画像データを量子化パラメータに基づき量子化する量子化手段と、
前記量子化手段による量子化結果をエントロピー符号化し、符号化データを生成する符号化手段と、
前記符号化データを記憶するバッファ手段と、
前記バッファ手段の占有量を監視する監視手段と、
前記占有量に基づき前記符号化手段において生成される前記符号化データの目標符号量を生成する目標符号量生成手段と、
前記目標符号量と前記符号化手段における発生符号量との差分と、反応パラメータとに基づき前記量子化パラメータを決定して、前記量子化手段を制御する制御手段と
を備える動画像符号化装置の制御方法であって、
前記目標符号量生成手段が、前記占有量と前記目標符号量との少なくともいずれかに基づいて、前記反応パラメータの指定を含む制御信号を前記制御手段に出力する出力工程と、
前記制御手段が、前記制御信号に含まれる前記反応パラメータの指定に従い、前記量子化パラメータを決定する決定工程と
を備えることを特徴とする動画像符号化装置の制御方法。
A quantization means for quantizing the input image data based on the quantization parameter;
Encoding means for entropy encoding the quantization result by the quantization means to generate encoded data;
Buffer means for storing the encoded data;
Monitoring means for monitoring the occupancy of the buffer means;
Target code amount generating means for generating a target code amount of the encoded data generated in the encoding means based on the occupation amount;
A video encoding device comprising: a control unit that determines the quantization parameter based on a difference between the target code amount and a generated code amount in the encoding unit and a reaction parameter, and controls the quantization unit A control method,
An output step in which the target code amount generating means outputs a control signal including designation of the reaction parameter to the control means based on at least one of the occupation amount and the target code amount;
A control method for a moving picture coding apparatus, comprising: a determining step in which the control means determines the quantization parameter in accordance with designation of the reaction parameter included in the control signal.
コンピュータを、請求項1乃至6のいずれか1項に記載の動画像符号化装置として機能させるためのコンピュータプログラム。   A computer program for causing a computer to function as the moving picture encoding apparatus according to any one of claims 1 to 6.
JP2008088260A 2008-03-28 2008-03-28 Moving picture coding apparatus, control method therefor, and computer program Expired - Fee Related JP5132390B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008088260A JP5132390B2 (en) 2008-03-28 2008-03-28 Moving picture coding apparatus, control method therefor, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008088260A JP5132390B2 (en) 2008-03-28 2008-03-28 Moving picture coding apparatus, control method therefor, and computer program

Publications (2)

Publication Number Publication Date
JP2009246513A true JP2009246513A (en) 2009-10-22
JP5132390B2 JP5132390B2 (en) 2013-01-30

Family

ID=41307980

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008088260A Expired - Fee Related JP5132390B2 (en) 2008-03-28 2008-03-28 Moving picture coding apparatus, control method therefor, and computer program

Country Status (1)

Country Link
JP (1) JP5132390B2 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05153569A (en) * 1991-11-25 1993-06-18 Olympus Optical Co Ltd Picture coder
JPH06205393A (en) * 1993-01-08 1994-07-22 Nippon Steel Corp Controller for quantity of generated encoding information for dynamic image
JPH09294267A (en) * 1996-04-25 1997-11-11 Matsushita Electric Ind Co Ltd Image compression coder
JPH10164588A (en) * 1996-11-26 1998-06-19 Sony Corp Video-signal encoding method, video-signal encoder and recording medium
JP2001008207A (en) * 1999-06-22 2001-01-12 Victor Co Of Japan Ltd Dynamic image coder and method therefor
JP2006345064A (en) * 2005-06-07 2006-12-21 Oki Electric Ind Co Ltd Coding apparatus and coding method
JP2007020216A (en) * 2006-09-11 2007-01-25 Sony Corp Encoding apparatus, encoding method, filtering apparatus and filtering method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05153569A (en) * 1991-11-25 1993-06-18 Olympus Optical Co Ltd Picture coder
JPH06205393A (en) * 1993-01-08 1994-07-22 Nippon Steel Corp Controller for quantity of generated encoding information for dynamic image
JPH09294267A (en) * 1996-04-25 1997-11-11 Matsushita Electric Ind Co Ltd Image compression coder
JPH10164588A (en) * 1996-11-26 1998-06-19 Sony Corp Video-signal encoding method, video-signal encoder and recording medium
JP2001008207A (en) * 1999-06-22 2001-01-12 Victor Co Of Japan Ltd Dynamic image coder and method therefor
JP2006345064A (en) * 2005-06-07 2006-12-21 Oki Electric Ind Co Ltd Coding apparatus and coding method
JP2007020216A (en) * 2006-09-11 2007-01-25 Sony Corp Encoding apparatus, encoding method, filtering apparatus and filtering method

Also Published As

Publication number Publication date
JP5132390B2 (en) 2013-01-30

Similar Documents

Publication Publication Date Title
US9369720B2 (en) Image coding apparatus and image coding method
US9179149B2 (en) Video encoding control method, video encoding apparatus, and video encoding program
JP5267655B2 (en) Image coding apparatus, image coding control method, and image coding program
JPWO2008142956A1 (en) Video encoding apparatus, video encoding method, and video encoding program
JP2005515732A (en) Dynamic control in complexity-constrained data compression
JP4179917B2 (en) Video encoding apparatus and method
JP5111128B2 (en) Encoding apparatus, encoding apparatus control method, and computer program
JP5132390B2 (en) Moving picture coding apparatus, control method therefor, and computer program
JP4492777B2 (en) Video encoding device
US20120163449A1 (en) Image processing apparatus and method
JP5078852B2 (en) Moving picture coding apparatus and moving picture coding method
JP2008271213A (en) Image encoding device
JP2005045736A (en) Method and device for encoding image signal, encoding controller, and program
JP4586340B2 (en) Encoding apparatus, encoding method, and program
US9661323B2 (en) Method of encoding picture and picture encoding device
WO2020024160A1 (en) Video processing device and method
JP5006763B2 (en) Image encoding apparatus, control method therefor, and computer program
JP4857243B2 (en) Image encoding apparatus, control method therefor, and computer program
JP2007208377A (en) Moving picture encoder and method therefor, and program
JP6985899B2 (en) Image coding device and its control method and program
JP7450078B1 (en) Video encoding device and video encoding method
JP4847423B2 (en) Moving picture encoding apparatus and computer program
WO2014002445A1 (en) Image coding apparatus, image coding method, and recording medium, and image decoding apparatus, image decoding method, and recording medium
TW202106014A (en) Image processing device and image processing method
JP2009081728A (en) Moving image coding apparatus, method of controlling moving image coding apparatus, and computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110325

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120319

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120514

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: 20121009

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: 20121106

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

Free format text: PAYMENT UNTIL: 20151116

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 5132390

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20151116

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees