JP3970267B2 - Moving picture coding apparatus and moving picture coding method - Google Patents

Moving picture coding apparatus and moving picture coding method Download PDF

Info

Publication number
JP3970267B2
JP3970267B2 JP2004209500A JP2004209500A JP3970267B2 JP 3970267 B2 JP3970267 B2 JP 3970267B2 JP 2004209500 A JP2004209500 A JP 2004209500A JP 2004209500 A JP2004209500 A JP 2004209500A JP 3970267 B2 JP3970267 B2 JP 3970267B2
Authority
JP
Japan
Prior art keywords
vop
frame
quantization parameter
code amount
encoded
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.)
Expired - Fee Related
Application number
JP2004209500A
Other languages
Japanese (ja)
Other versions
JP2006033426A (en
Inventor
順子 篠原
喜子 幡野
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2004209500A priority Critical patent/JP3970267B2/en
Publication of JP2006033426A publication Critical patent/JP2006033426A/en
Application granted granted Critical
Publication of JP3970267B2 publication Critical patent/JP3970267B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

本発明は、動画像の符号化に関し、ITU−T勧告H.26xやISO/IEC標準MPEG等に代表される方式により符号化を行う動画像符号化装置及び方法に関するものである。本発明による動画像符号化装置及び動画像符号化方法は、例えば携帯電話などに搭載される装置に関するものである。   The present invention relates to video coding, and relates to ITU-T Recommendation H.264. The present invention relates to a moving image coding apparatus and method for performing coding by a method typified by 26x or ISO / IEC standard MPEG. The moving picture coding apparatus and the moving picture coding method according to the present invention relate to a device mounted on, for example, a mobile phone.

従来の画像符号化方式について、以下、MPEG−4を例に取り説明する。一般に、MPEG−4に代表される画像符号化方式は、入力される画像信号に対して空間的・時間的相関関係を利用してデータの圧縮を行う。そして、この空間的圧縮・時間的圧縮により得られるデータをもとに、所定の順序に従ってさらに可変長符号化を行い、ビットストリームを生成する。   A conventional image encoding method will be described below using MPEG-4 as an example. In general, an image encoding method represented by MPEG-4 compresses data using a spatial / temporal correlation with respect to an input image signal. Then, based on the data obtained by the spatial compression / temporal compression, variable length coding is further performed in a predetermined order to generate a bit stream.

ここで以下の説明のため、MPEG−4のフレームの概念について述べておく。MPEG−4では、表示される画像全体(合成画像)は、複数の画像系列の画像(物体)により構成されることから、各画像系列の、各表示時刻における画面をビデオ・オブジェクト・プレーン(以下、「VOP」と記す。)と呼び、MPEG−1,2におけるフレームと区別している。なお、表示画像の全体が1つの画像系列の画像により構成される場合には、VOPとフレームは一致することとなる。   Here, for the following description, the concept of the MPEG-4 frame will be described. In MPEG-4, the entire image to be displayed (composite image) is composed of images (objects) of a plurality of image sequences. Therefore, the screen of each image sequence at each display time is displayed as a video object plane (hereinafter referred to as a video object plane). , “VOP”), and is distinguished from the frames in MPEG-1 and MPEG-2. When the entire display image is composed of images of one image series, the VOP and the frame match.

VOPは輝度信号と色差信号をもち、複数のマクロブロックから構成される。マクロブロックは、輝度信号に対して縦横それぞれ16画素から成り、MPEG−4における画像符号化では、このマクロブロック単位で空間的圧縮、時間的圧縮等の手法により情報量の圧縮が行われる。   The VOP has a luminance signal and a color difference signal, and is composed of a plurality of macro blocks. The macro block is composed of 16 pixels in each of the vertical and horizontal directions with respect to the luminance signal, and in the image encoding in MPEG-4, the information amount is compressed by a method such as spatial compression or temporal compression in units of the macro block.

空間的圧縮は、直交変換の一種である離散コサイン変換(Discrete Cosine Transform。以下、「DCT」と記す。)により時間領域から周波数領域に変換した後の信号を量子化することにより行われ、時間的圧縮には、動き補償(Motion Compensation)が用いられる。   Spatial compression is performed by quantizing a signal after being transformed from the time domain to the frequency domain by a discrete cosine transform (hereinafter referred to as “DCT”), which is a kind of orthogonal transform. Motion compensation is used for dynamic compression.

また、VOP単位のデータ圧縮方法には、同一画面内の空間的圧縮のみで符号化される空間的画面内符号化(以下、「イントラ符号化」と記す。)と、画面間の相関から時間的圧縮を用いて符号化される画面間符号化(以下、「インター符号化」と記す。)とがある。   In addition, in the data compression method in units of VOPs, time is determined from spatial intra-frame coding (hereinafter referred to as “intra coding”) that is encoded only by spatial compression within the same screen, and correlation between screens. There is inter-screen coding (hereinafter referred to as “inter-coding”) which is coded using dynamic compression.

一般に、イントラ符号化されたVOPをI(Intra)−VOP(以下、「I−VOP」と記す。)と呼ぶ。また、インター符号化されたVOPで、参照VOPとして時間的に前に符号化されたVOPのみを用いて動き補償を行って符号化されたVOPをP(Predictive)−VOP(以下、「P−VOP」と記す。)と呼び、参照VOPとして時間的に前後に符号化されたVOPを用いて双方向の動き補償を行って符号化されたVOPをB(Bi−directionally predictive)−VOP(以下、「B−VOP」と記す。)と呼ぶ。但し、例えば、MPEG−4のシンプルプロファイルの場合、I−VOPとP−VOPのみが用いられ、B−VOPは用いられない。以下の説明は、主として、このMPEG−4のシンプルプロファイルに関して行われる。   In general, an intra-coded VOP is referred to as I (Intra) -VOP (hereinafter referred to as “I-VOP”). In addition, an inter-encoded VOP that is obtained by performing motion compensation using only a VOP previously encoded as a reference VOP is referred to as P (Predictive) -VOP (hereinafter, “P- VOP encoded by performing bi-directional motion compensation using a VOP encoded before and after in time as a reference VOP is referred to as B (Bi-directionally predictive) -VOP (hereinafter referred to as VOP). , “B-VOP”). However, for example, in the case of an MPEG-4 simple profile, only I-VOP and P-VOP are used, and B-VOP is not used. The following description will be mainly given with respect to this MPEG-4 simple profile.

動画像符号化装置では、所定の符号化パラメータに従って、指定された符号量のビットストリームを出力しなければならない。さらにビットストリームを受取る復号化装置側のバッファ(仮想バッファ検証器、以下、「VBVバッファ」と記す。)がオーバーフローやアンダーフローが生じないように、符号化装置側でVBVバッファの占有量を想定して発生符号量を制御しなくてはならない。   In a moving image encoding device, a bit stream having a specified code amount must be output according to a predetermined encoding parameter. Further, the VBV buffer occupancy is assumed on the encoding device side so that the buffer on the decoding device side (virtual buffer verifier, hereinafter referred to as “VBV buffer”) that receives the bit stream does not cause overflow or underflow. Thus, the generated code amount must be controlled.

発生符号量の制御は、VOPを構成するマクロブロック毎に設定される、DCT係数を量子化するために用いる、量子化パラメータ(量子化ステップサイズ)により行う。従って、発生符号量の制御はVOP単位で行われることとなる。一般に、量子化パラメータを大きくすると発生符号量は小さくなり、量子化パラメータを小さくすると発生符号量は大きくなる。つまり、発生符号量と量子化パラメータとは反比例の関係にある。この性質を用いて発生符号量を変化させることが可能である。   The generated code amount is controlled by a quantization parameter (quantization step size) used for quantizing the DCT coefficient set for each macroblock constituting the VOP. Therefore, the generated code amount is controlled in units of VOPs. In general, when the quantization parameter is increased, the generated code amount is decreased, and when the quantization parameter is decreased, the generated code amount is increased. That is, the generated code amount and the quantization parameter are in an inversely proportional relationship. It is possible to change the generated code amount using this property.

また、VOP単位で発生符号量制御を行うため、制御の簡便上、I−VOP、P−VOP等のVOPタイプ毎に、量子化パラメータを設定し、これらを個別に制御するのが一般的である。   In addition, since the amount of generated code is controlled in units of VOPs, it is common to set quantization parameters for each VOP type such as I-VOP and P-VOP and control them individually for the sake of simplicity of control. is there.

上記のような、VOPタイプ毎に、量子化パラメータを設け、これらを個別に制御する技術については、例えば特許文献1に記載されている。   A technique for providing quantization parameters for each VOP type as described above and individually controlling them is described in Patent Document 1, for example.

特開2002−262297号公報(第5−7頁、第1図)Japanese Patent Laid-Open No. 2002-262297 (page 5-7, FIG. 1)

本発明が解決しようとする問題点は、VOPタイプ毎に、量子化パラメータを設定し、これらを個別に制御する場合に、画像内容により、画質が視覚的に不自然になる場合があることである。一般的に画像編集等での、符号化後データの取扱いを考慮して、一定のフレーム数に対応する間隔(周期)毎にI−VOPを設定し、I−VOPから次のI−VOPまでの間はP−VOPで符号化するという符号化制御が行われる。なお、I−VOPの間隔を、例えば2秒間隔とすれば、15フレーム/秒のフレームレートの場合で、I−VOPの挿入される間隔は30フレーム間隔となる。   The problem to be solved by the present invention is that when setting quantization parameters for each VOP type and controlling them individually, the image quality may be visually unnatural depending on the image content. is there. In general, in consideration of handling of encoded data in image editing, etc., an I-VOP is set at intervals (cycles) corresponding to a certain number of frames, and from I-VOP to the next I-VOP During this period, encoding control is performed such that encoding is performed using P-VOP. If the I-VOP interval is, for example, 2 seconds, the I-VOP insertion interval is 30 frames at a frame rate of 15 frames / second.

一般にI−VOPの画質は重要であるため、I−VOPの量子化パラメータの初期値は、P−VOPの量子化パラメータよりも小さい値を設定する。つまり、小さい値で量子化するため、符号量が多く割り当てられる。このように量子化パラメータが設定された場合、ある程度動きのある画像では、P−VOPに多く符号量が必要になり、P−VOPの量子化パラメータがI−VOPの量子化パラメータよりも大きい初期の状態をほぼ保ちながら符号化が行われる。   Since the image quality of I-VOP is generally important, the initial value of the quantization parameter of I-VOP is set to a value smaller than the quantization parameter of P-VOP. That is, since quantization is performed with a small value, a large amount of code is allocated. When the quantization parameter is set in this way, in an image having a certain amount of motion, a large amount of code is required for the P-VOP, and the P-VOP quantization parameter is larger than the I-VOP quantization parameter. The encoding is performed while substantially maintaining the above state.

しかし、静止画に近い画像など、動きが少ない画像を符号化する場合、P−VOPの符号量が少なくなり、P−VOPの量子化パラメータ値が極端に小さくなることがある。このとき、I−VOPはイントラ符号化を施されるので、量子化パラメータ値が急激に小さくなるということはないため、想定しているI−VOPの量子化パラメータと、P−VOPの量子化パラメータの設定値の大小関係が逆転したり、さらにI−VOPの量子化パラメータとP−VOPの量子化パラメータの差が大きくなることがある。   However, when an image with little motion, such as an image close to a still image, is encoded, the P-VOP code amount may be reduced, and the P-VOP quantization parameter value may become extremely small. At this time, since the I-VOP is subjected to intra coding, the quantization parameter value does not become abruptly reduced. Therefore, the assumed I-VOP quantization parameter and the P-VOP quantization The magnitude relationship between the parameter setting values may be reversed, or the difference between the I-VOP quantization parameter and the P-VOP quantization parameter may become larger.

このようにI−VOPの量子化パラメータと、P−VOPの量子化パラメータの設定値の大小が逆転し、その差が大きくなると、静止画に近い画像を符号化した場合に、I−VOPでの画質劣化が視覚的に顕著になる場合がある。
本発明は上記のような課題を解決するためになされたもので、静止画に近い画像など、動きが少ない画像を符号化する場合にも、画面内符号化されたVOP(又はフレーム)における視覚的画質劣化がなく全体として高画質な符号化を行うことができる動画像符号化装置を提供することを目的とする。
As described above, when the I-VOP quantization parameter and the setting value of the P-VOP quantization parameter are reversed and the difference between them increases, when an image close to a still image is encoded, In some cases, the image quality degradation of the image becomes noticeable.
The present invention has been made to solve the above-described problems. Even when an image with little motion, such as an image close to a still image, is encoded, the visual in the VOP (or frame) encoded in the screen is displayed. It is an object of the present invention to provide a moving image encoding apparatus that can perform high-quality encoding as a whole without deterioration in image quality.

本発明は、
入力された動画像の各フレーム又はVOPに対し画面内符号化又は画面間符号化を選択的に行う符号化手段と、
前記符号化手段にて符号化された各フレーム又はVOPの符号量を求める符号量検出手段と、
前記符号化手段における符号化で用いられる量子化パラメータを設定する符号化制御手段と、
前記符号化制御手段で設定された量子化パラメータの、各フレーム又はVOP毎の平均値を算出する量子化パラメータ平均値算出手段と、
一つのフレーム又はVOPを画面内符号化するに当たり、直前に画面内符号化されたフレーム又はVOPのために設定された量子化パラメータの平均値と、直前に画面間符号化されたフレーム又はVOPのために設定された量子化パラメータの平均値とに基づき、目標符号量の割増しを行うか否かを決定する符号化条件解析手段とを備え、
前記符号化制御手段は、前記符号化条件解析手段における決定に基づき、前記一つのフレーム又はVOPのための前記量子化パラメータを設定することを特徴とする
動画像符号化装置を提供するものである。
The present invention
Coding means for selectively performing intra-frame coding or inter-frame coding for each frame or VOP of the input moving image;
Code amount detection means for obtaining the code amount of each frame or VOP encoded by the encoding means;
Encoding control means for setting a quantization parameter used in encoding in the encoding means;
Quantization parameter average value calculating means for calculating an average value for each frame or VOP of the quantization parameter set by the encoding control means;
In the intra-frame encoding of one frame or VOP, the average value of the quantization parameter set for the frame or VOP that was encoded immediately before the frame and the frame or VOP that was encoded immediately before the inter-frame Coding condition analysis means for determining whether to increase the target code amount based on the average value of the quantization parameter set for
The encoding control means provides a moving picture encoding apparatus, wherein the quantization parameter for the one frame or VOP is set based on the determination in the encoding condition analysis means. .

本発明によれば、符号化条件を解析し、これに基づき適切な符号量割り当てを行うことにより、静止画に近い画像など、動きが少ない画像を符号化する場合にも、画面内符号化されたフレーム又はVOPにおける視覚的画質劣化がなく全体として高画質な符号化を行うことができるという効果がある。   According to the present invention, when encoding an image with little motion, such as an image close to a still image, by analyzing an encoding condition and assigning an appropriate code amount based on the analysis, an intra-screen encoding is performed. There is an effect that high-quality encoding can be performed as a whole without any visual image quality degradation in a frame or VOP.

以下に説明する実施の形態では、入力される動画像がVOP単位で符号化されるが、フレーム単位で符号化される場合にも本発明を同様に適用することができる。また、以下の実施の形態は、MPEG−4のシンプルプロファイルに対応するものであるが、本発明はこれに限定されない。   In the embodiment described below, an input moving image is encoded in units of VOPs, but the present invention can be similarly applied to the case of encoding in units of frames. The following embodiments correspond to the MPEG-4 simple profile, but the present invention is not limited to this.

実施の形態1.
図1は、この発明の実施の形態1の動画像符号化装置を示すブロック図、図2は実施の形態1における動画像符号化装置のフレームメモリの構成を示す図、図3は、実施の形態1の動画像符号化装置のVOPの符号化処理手順を示すであり、図4は、図1の符号化制御部の一例を示すブロック図、図5は実施の形態1の動画像符号化装置における符号化条件解析処理手順を示す図である。
Embodiment 1 FIG.
FIG. 1 is a block diagram showing a moving picture coding apparatus according to Embodiment 1 of the present invention, FIG. 2 is a view showing a configuration of a frame memory of the moving picture coding apparatus according to Embodiment 1, and FIG. FIG. 4 shows a VOP encoding processing procedure of the moving picture encoding apparatus according to the first embodiment, FIG. 4 is a block diagram illustrating an example of the encoding control unit of FIG. 1, and FIG. 5 is a moving picture encoding according to the first embodiment. It is a figure which shows the encoding condition analysis processing procedure in an apparatus.

本実施の形態1の動画像符号化装置100には図1に示すように、有線通信や無線通信により伝送される画像信号がVOPとして入力され、この入力されるVOPに対する画像符号化処理を行うもので、入力されるVOPをマクロブロックに分割して符号化処理を行い、ビットストリームとして出力するものである。   As shown in FIG. 1, the moving image encoding apparatus 100 according to the first embodiment receives an image signal transmitted by wired communication or wireless communication as a VOP, and performs an image encoding process on the input VOP. Therefore, the input VOP is divided into macro blocks, encoded, and output as a bit stream.

図1に示されるように本実施の形態の動画像符号化装置100は、フレームメモリ1と、変化量検出部2と、シーンチェンジ検出部3と、符号化器4と、バッファ5と、符号量検出部6と、符号化制御部7と、平均量子化パラメータ算出部8と、符号化条件解析部9とを備えている。   As shown in FIG. 1, a moving image encoding apparatus 100 according to the present embodiment includes a frame memory 1, a change amount detection unit 2, a scene change detection unit 3, an encoder 4, a buffer 5, An amount detection unit 6, an encoding control unit 7, an average quantization parameter calculation unit 8, and an encoding condition analysis unit 9 are provided.

フレームメモリ1は、外部から順次入力されるVOPを一時的に蓄積する。フレームメモリ1は、図2に示すように、相前後する(連続する)VOPを記憶することができるもので、一つのVOP(i番目のVOP)のデータを記憶する第1の領域1aと、次のVOP((i+1)番目のVOP)のデータを記憶する第2の領域1bとの2つの領域により構成されている。外部からVOPが1つ入力される度に、フレームメモリ1の領域1a、1b内のVOPが書換えられ、第2の領域1bに最新の(現在の)VOP((i+1)番目のVOP)が記憶され、第1の領域1aに一つ前の(直前の)VOPが記憶されて状態が維持される。言換えると、通常は(連続動作中は)、フレームメモリ1は、相前後する2つのVOPのデータが記憶された状態が維持される。   The frame memory 1 temporarily stores VOPs that are sequentially input from the outside. As shown in FIG. 2, the frame memory 1 is capable of storing successive (continuous) VOPs, and includes a first area 1a for storing data of one VOP (i-th VOP), It is composed of two areas including a second area 1b for storing data of the next VOP ((i + 1) th VOP). Each time one VOP is input from the outside, the VOP in the areas 1a and 1b of the frame memory 1 is rewritten, and the latest (current) VOP ((i + 1) th VOP) is stored in the second area 1b. The previous (immediately preceding) VOP is stored in the first area 1a and the state is maintained. In other words, normally (during continuous operation), the frame memory 1 is maintained in a state where data of two adjacent VOPs are stored.

変化量検出部2は、フレームメモリ1からi番目及び(i+1)番目のVOP、即ちフレームメモリ1に取り込まれた動画像の相前後するVOPを読み出し、これら相互間の特徴量、例えば輝度信号の変化量を検出する。この変化量として、例えば、同じ画素についてVOP相関の輝度信号の差の絶対値を求め、この絶対値の、VOP全体に亘る積算値(総和)を求める。   The change amount detection unit 2 reads the i-th and (i + 1) -th VOPs from the frame memory 1, that is, the VOPs that follow the moving image captured in the frame memory 1, and the feature amount between them, for example, the luminance signal Detect the amount of change. As the amount of change, for example, the absolute value of the difference in the luminance signal of the VOP correlation is obtained for the same pixel, and the integrated value (total) of the absolute value over the entire VOP is obtained.

シーンチェンジ検出部3は、変化量検出部2で検出されたVOP相互間の特徴量の変化量に基づき、シーンチェンジの検出を行い(各VOPについてシーンチェンジが検出されたかどうかの判定、即ち各VOPが「シーンチェンジのVOPかどうか」の判定を行い)、検出結果(乃至判定結果)に基づきシーンチェンジ信号SGの値を設定する。即ち、シーンチェンジを検出したときは、シーンチェンジ信号SGを第1の値、例えば「1」に設定し、それ以外のときはシーンチェンジ信号SGを第2の値、例えば「0」に設定する。   The scene change detection unit 3 detects a scene change based on the change amount of the feature amount between the VOPs detected by the change amount detection unit 2 (determining whether a scene change has been detected for each VOP, that is, each A determination is made as to whether or not the VOP is a scene change VOP), and the value of the scene change signal SG is set based on the detection result (or determination result). That is, when a scene change is detected, the scene change signal SG is set to a first value, for example, “1”, and otherwise, the scene change signal SG is set to a second value, for example, “0”. .

符号化器4には、フレームメモリ1から(i+1)番目のVOP(即ち、「現在の」VOP)が供給され、符号化器4は、入力されたVOPを、マクロブロック単位で符号化する。
バッファ5は、符号化器4から出力されたビットストリームを一時的に蓄積する。
符号量検出部6は、バッファ5に蓄積されたビットストリームからVOP毎の発生符号量をカウント(計数乃至計量)することにより、符号化器4にて符号化された各フレームの符号量を求める。
The encoder 4 is supplied with the (i + 1) -th VOP (ie, “current” VOP) from the frame memory 1, and the encoder 4 encodes the input VOP in units of macroblocks.
The buffer 5 temporarily stores the bit stream output from the encoder 4.
The code amount detection unit 6 obtains the code amount of each frame encoded by the encoder 4 by counting the generated code amount for each VOP from the bit stream stored in the buffer 5. .

符号化制御部7は、符号化器4にて実施される符号化における目標符号量の設定を行い、量子化パラメータ(量子化ステップサイズ)の決定を行う。この際、VOPのタイプ毎に、即ちI−VOPと、P−VOPで個別に、目標符号量の設定を行い、量子化パラメータの決定を行う。   The encoding control unit 7 sets a target code amount in encoding performed by the encoder 4 and determines a quantization parameter (quantization step size). At this time, the target code amount is set for each VOP type, that is, individually for the I-VOP and the P-VOP, and the quantization parameter is determined.

平均量子化パラメータ算出部8は、符号化制御部7で設定された、各VOP毎の量子化パラメータの、各VOP毎の平均値を算出する。   The average quantization parameter calculation unit 8 calculates the average value for each VOP of the quantization parameter for each VOP set by the encoding control unit 7.

符号化条件解析部9は、シーンチェンジ検出部3から出力されたシーチェンジ信号SGの値と、平均量子化パラメータ算出部8から出力された各VOP毎の平均量子化パラメータ値をもとに、符号化条件(直前に符号化されたVOPについてのシーンチェンジに伴う符号量の割増し、直前に符号化されたI−VOPについての量子化パラメータの平均値IQa、直前に符号化されたP−VOPについての量子化パラメータの平均値PQa)を解析することによって、符号化の状態を判別し、これに基づき符号化制御部7にて適切な符号量割り当てを行われるように制御する。即ち、符号量の割増しの要否を決定し、決定結果に基づき割増し要求信号WSの値を設定する。例えば、割増し要と判断したときは、割増し要求信号WSを第1の値、例えば「1」に設定し、割増し不要と判断したときは割増し要求信号WSを第2の値、例えば「0」に設定する。   The encoding condition analysis unit 9 is based on the value of the sea change signal SG output from the scene change detection unit 3 and the average quantization parameter value for each VOP output from the average quantization parameter calculation unit 8. Coding conditions (addition of code amount accompanying scene change for VOP coded immediately before, IQa average value of quantization parameter for I-VOP coded just before, P-VOP coded just before By analyzing the quantization parameter average value PQa), the coding state is determined, and based on this, the coding control unit 7 performs control so that appropriate code amount allocation is performed. That is, it is determined whether or not the code amount is to be increased, and the value of the additional request signal WS is set based on the determination result. For example, when it is determined that the premium is required, the premium request signal WS is set to a first value, for example, “1”, and when it is determined that the premium is not necessary, the premium request signal WS is set to a second value, for example, “0”. Set.

「直前に符号化されたVOP」とは、過去に符号化されたVOPのうちの最新のVOPを言い、「直前に符号化されたI−VOP」とは、過去に符号化されたI−VOPのうちの最新のVOPを言い、「直前に符号化されたP−VOP」とは、過去に符号化されたP−VOPのうちの最新のVOPを言い、これらをそれぞれ「直前のVOP」、「直前のI−VOP」、「直前のP−VOP」、或いは単に「前VOP」、「前I−VOP」、「前P−VOP」と言うこともある。   “VOP encoded immediately before” refers to the latest VOP of VOPs encoded in the past, and “I-VOP encoded immediately before” refers to I-VOP encoded in the past. The latest VOP among the VOPs is referred to as “P-VOP encoded immediately before”. The latest VOP among the P-VOPs encoded in the past is referred to as “Previous VOP”. , “Previous I-VOP”, “Previous P-VOP”, or simply “Previous VOP”, “Previous I-VOP”, “Previous P-VOP”.

符号化制御部7は、上記のような目標符号量の設定、量子化パラメータの決定を行うに当り、符号量検出部6にて求められた各VOPの符号量Acと、符号化条件解析部9における符号量の割増しの要否に関する決定結果を参照する。   The encoding control unit 7 sets the target code amount and determines the quantization parameter as described above, the code amount Ac of each VOP obtained by the code amount detection unit 6, and the encoding condition analysis unit. Reference is made to the determination result regarding the necessity of extra code amount in FIG.

図3は、動画像符号化装置100のVOP符号化処理動作手順を示す図である。以下、図3を参照して、VOPの符号化処理の概略を説明する。
まず、動画像符号化装置100に入力された現VOPと前VOPとの特徴量、例えば輝度信号の変化量を検出する(ステップS1)。
FIG. 3 is a diagram illustrating a VOP encoding processing operation procedure of the moving image encoding apparatus 100. The outline of the VOP encoding process will be described below with reference to FIG.
First, a feature amount between the current VOP and the previous VOP input to the moving image coding apparatus 100, for example, a change amount of a luminance signal is detected (step S1).

次に、ステップS1で検出した特徴量の変化量に基づいて、シーンチェンジの有無を判定し、判定結果に基づいてシーンチェンジ信号SGの値を設定する(ステップS2)。例えばシーンチェンジが検出されたときはシーンチェンジ信号SGを第1の値、例えば「1」に設定し、それ以外のときは、シーンチェンジ信号SGを第2の値、例えば「0」に設定する。   Next, the presence / absence of a scene change is determined based on the change amount of the feature amount detected in step S1, and the value of the scene change signal SG is set based on the determination result (step S2). For example, when a scene change is detected, the scene change signal SG is set to a first value, eg, “1”, and otherwise, the scene change signal SG is set to a second value, eg, “0”. .

次に、直前に符号化されたVOPについてのシーンチェンジ信号SGの値と、直前に符号化されたI-VOPの平均量子化パラメータ値IQaと、直前に符号化されたP−VOPの平均量子化パラメータ値IQaとに基づいて、符号化条件の解析を行い、符号量の割増しの要否を決定する(ステップS3)。
直前に符号化されたI−VOP及びP−VOPの各々の平均量子化パラメータ値IQa、PQaは符号化条件解析部9内に記憶されている。また、直前に符号化されたVOPについてのシーンチェンジ信号SGの値も符号化条件解析部9内に記憶されている。
Next, the value of the scene change signal SG for the VOP encoded immediately before, the average quantization parameter value IQa of I-VOP encoded immediately before, and the average quantum of the P-VOP encoded immediately before Based on the coding parameter value IQa, the coding condition is analyzed, and it is determined whether or not the code amount needs to be increased (step S3).
The average quantization parameter values IQa and PQa of the I-VOP and P-VOP encoded immediately before are stored in the encoding condition analysis unit 9. The value of the scene change signal SG for the VOP encoded immediately before is also stored in the encoding condition analysis unit 9.

次に、ステップS3における符号化条件の解析の結果、即ち符号量の割増しの要否の決定結果に基づき、符号化処理の目標符号量を設定する(ステップS4)。   Next, the target code amount of the encoding process is set based on the result of the analysis of the encoding condition in step S3, that is, the determination result of whether or not the code amount needs to be increased (step S4).

そして、ステップS4で設定された目標符号量に基づき、各マクロブロック毎の量子化パラメータQpを決定し(ステップS5)、実際に現VOPの符号化処理を行う(ステップS6)。   Then, the quantization parameter Qp for each macroblock is determined based on the target code amount set in step S4 (step S5), and the current VOP is actually encoded (step S6).

次に、図1及び図3を参照して、動画像符号化装置100のVOP符号化処理動作について詳細に説明する。
まず、本実施の形態1の動画像符号化装置100の各部を統括して制御する上位の制御系により入力されたVOPが、フレームメモリ1に一時的に蓄積される。上記のように、フレームメモリ1は、i番目のVOPのデータを記憶する第1の領域1aと、(i+1)番目のVOPのデータを記憶する第2の領域1bを有し、通常は(連続動作中は)、相連続する2つのVOPのデータが記憶された状態が維持される。
Next, the VOP encoding processing operation of the moving image encoding apparatus 100 will be described in detail with reference to FIGS. 1 and 3.
First, VOPs input by an upper control system that controls each unit of the moving picture encoding apparatus 100 according to the first embodiment are temporarily stored in the frame memory 1. As described above, the frame memory 1 has the first area 1a for storing the data of the i-th VOP and the second area 1b for storing the data of the (i + 1) -th VOP. During operation), the state in which data of two consecutive VOPs is stored is maintained.

変化量検出部2は、フレームメモリ1からi番目及び(i+1)番目のVOP、即ちフレームメモリ1に取り込まれた動画像の相前後するVOPを読み出し、これら相互間の特徴量の変化量を求める(ステップS1)。シーンチェンジ検出部3では、変化量検出部2で求められた相前後するVOP間の変化量の値に基づき、変化量が基準値以上であれば、現VOPをシーンチェンジのVOPであると判定し、基準値に満たなければ、シーンチェンジのVOPではないと判定する(ステップS2)。   The change amount detection unit 2 reads the i-th and (i + 1) -th VOPs from the frame memory 1, that is, the VOPs that follow the moving image captured in the frame memory 1, and obtains the change amount of the feature amount between them. (Step S1). The scene change detection unit 3 determines that the current VOP is the VOP of the scene change if the change amount is equal to or greater than the reference value based on the value of the change amount between successive VOPs obtained by the change amount detection unit 2. If it does not satisfy the reference value, it is determined that it is not a scene change VOP (step S2).

一方、符号化器4には、フレームメモリ1から(i+1)番目のVOP(即ち、「現在の」VOP)が供給され、符号化器4は、入力されたVOPを、マクロブロック単位で符号化する。この符号化は、符号化制御部7により設定された量子化パラメータに従って行われる。
符号化器4は符号化処理されたビットストリームをバッファ5に出力し、バッファ5においてビットストリームが一時的に蓄積される。
On the other hand, the encoder 4 is supplied with the (i + 1) th VOP from the frame memory 1 (that is, the “current” VOP), and the encoder 4 encodes the input VOP in units of macroblocks. To do. This encoding is performed according to the quantization parameter set by the encoding control unit 7.
The encoder 4 outputs the encoded bit stream to the buffer 5, and the bit stream is temporarily stored in the buffer 5.

バッファ5に蓄積されたビットストリームは、上述の上位の制御系により、動画像符号化装置100から出力される。同様に、バッファ5に蓄積されたビットストリームは、符号量検出部6にも入力される。   The bit stream stored in the buffer 5 is output from the moving picture encoding apparatus 100 by the above-described upper control system. Similarly, the bit stream stored in the buffer 5 is also input to the code amount detection unit 6.

符号量検出部6は、バッファ5に蓄積されたビットストリームからVOP毎の符号発生量をカウントすることにより、符号化器4にて符号化された各フレームの符号量を求め、求められた符号量を表すデータを符号化制御部7に出力する。
なお、符号量検出部6における符号量の検出は、各マクロブロックの符号化終了毎に行い、現在符号化中のVOPの発生符号量の累積値がマクロブロックの符号化の進行とともに検出され、検出結果が符号化制御部7に出力される。
The code amount detection unit 6 obtains the code amount of each frame encoded by the encoder 4 by counting the code generation amount for each VOP from the bit stream accumulated in the buffer 5, and calculates the obtained code Data representing the quantity is output to the encoding control unit 7.
The code amount detection in the code amount detection unit 6 is performed at the end of each macroblock encoding, and the accumulated value of the generated code amount of the VOP currently being encoded is detected as the macroblock encoding progresses. The detection result is output to the encoding control unit 7.

符号化制御部7では、符号化器4において行われるマクロブロック単位の符号化で用いられる量子化パラメータの設定を行う。まず、各VOPの先頭のマクロブロックに対する量子化パラメータの設定は以下のようにして行われる。
即ち、符号量検出部6から出力される、各VOPの最後における符号量の累積値を、そのVOPの符号量として検出して記憶し、平均量子化パラメータ算出部8から出力される平均量子化パラメータ値を記憶し、同じVOPタイプの前VOPの発生符号量と、同じVOPタイプの前VOPの平均量子化パラメータ値と、符号化条件解析部9による目標符号量の割増しの要否についての決定結果とに基づき、現VOPの目標符号量を定め、このようにして定められた現VOPの目標符号量に基づいて現VOPの先頭のマクロブロックの量子化パラメータを定める。即ち、I−VOPに対しては、直前に符号化されたI−VOPの発生符号量と、直前に符号化されたI−VOPの平均量子化パラメータ値と、符号化条件解析部9による割増しの要否の決定結果とに基づき、現I−VOPの目標符号量を定め、このようにして定められた現I−VOPの目標符号量に基づいて現I−VOPの先頭のマクロブロックの量子化パラメータを定める。P−VOPに対しては、直前に符号化されたP−VOPの発生符号量と、直前に符号化されたP−VOPの平均量子化パラメータ値と、符号化条件解析部9による割増しの要否の決定結果とに基づき、現P−VOPの目標符号量を定め、このようにして定められた現P−VOPの目標符号量に基づいて現P−VOPの先頭のマクロブロックの量子化パラメータを定める。
The encoding control unit 7 sets a quantization parameter used in encoding in units of macroblocks performed in the encoder 4. First, the quantization parameter is set for the first macroblock of each VOP as follows.
That is, the accumulated value of the code amount at the end of each VOP output from the code amount detection unit 6 is detected and stored as the code amount of the VOP, and the average quantization output from the average quantization parameter calculation unit 8 The parameter value is stored, and the generated code amount of the previous VOP of the same VOP type, the average quantization parameter value of the previous VOP of the same VOP type, and the determination of whether or not the target code amount needs to be increased by the encoding condition analysis unit 9 The target code amount of the current VOP is determined based on the result, and the quantization parameter of the first macroblock of the current VOP is determined based on the target code amount of the current VOP thus determined. That is, for the I-VOP, the generated code amount of the I-VOP encoded immediately before, the average quantization parameter value of the I-VOP encoded immediately before, and the extra by the encoding condition analysis unit 9 The target code amount of the current I-VOP is determined based on the determination result of the necessity of the current I-VOP, and the quantum of the first macroblock of the current I-VOP is determined based on the target code amount of the current I-VOP thus determined. Define the parameter. For the P-VOP, the generated code amount of the P-VOP encoded immediately before, the average quantization parameter value of the P-VOP encoded immediately before, and the encoding condition analysis unit 9 need to pay extra. The target code amount of the current P-VOP is determined based on the determination result of “No”, and the quantization parameter of the first macroblock of the current P-VOP is determined based on the target code amount of the current P-VOP thus determined. Determine.

また、VOPの先頭のマクロブロックに続く、2番目以降のマクロブロックに対する量子化パラメータの設定は、以下のようにして行われる。即ち、符号量検出部6により、各マクロブロックの符号化終了時における発生符号量の累積値に基づき、現VOPのまだ符号化していないマクロブロックに割当てられる符号量を計算し、これから符号化されるマクロブロックの量子化パラメータを定める。このようにして、上記した当該VOPの先頭のマクロブロックの量子化パラメータを初期値として、マクロブロック毎に量子化パラメータを調整しながら、符号化を進める。   Also, the setting of quantization parameters for the second and subsequent macroblocks following the first macroblock of the VOP is performed as follows. That is, the code amount detection unit 6 calculates the code amount allocated to a macroblock that has not yet been encoded in the current VOP based on the accumulated value of the generated code amount at the end of encoding of each macroblock, and is encoded from this. The quantization parameter of the macroblock is determined. In this way, encoding is advanced while adjusting the quantization parameter for each macroblock using the quantization parameter of the first macroblock of the VOP as an initial value.

このような量子化パラメータの決定のため、符号化制御部7は、図4に示すように、符号量検出部6から出力される、各VOPの最後における符号量の累積値を、各VOPの最後の時点で取り込んでそのVOPの符号量VAcとして検出するVOP符号量検出手段7aと、VOP符号量検出手段7aから出力されるVOP符号量VAcを、VOPのタイプ毎に区別して記憶し、また平均量子化パラメータ算出部8で算出された各VOPの平均量子化パラメータ値IQa、PQaを各VOPのタイプ毎に区別して記憶する記憶部7bと、記憶部7bに記憶された符号量及び平均量子化パラメータ値と、符号化条件解析部9からの割増し要求信号WSとに基づいて目標符号量を定める目標符号量決定部7cと、各マクロブロックの符号化終了時における発生符号量の累積値に基づき、現VOPのまだ符号化していないマクロブロックに割当てられる符号量を計算する割当て符号量計算部7dと、各VOPの先頭のマクロブロックに対しては、目標符号量決定部7cで決定された目標符号量に基づいて量子化パラメータを決定し、各VOPの先頭以外のマクロブロックに対しては、割当て符号量計算部7dで計算された割当て符号量に基づいて、これから符号化されるマクロブロックの量子化パラメータを定める量子化パラメータ決定部7eとを備えている。   For such determination of the quantization parameter, the encoding control unit 7 calculates the cumulative value of the code amount at the end of each VOP output from the code amount detection unit 6 as shown in FIG. The VOP code amount detection means 7a that is captured at the last time and detected as the VOP code amount VAc, and the VOP code amount VAc output from the VOP code amount detection means 7a are stored separately for each VOP type. A storage unit 7b for storing the average quantization parameter values IQa and PQa of each VOP calculated by the average quantization parameter calculation unit 8 for each VOP type, and a code amount and an average quantum stored in the storage unit 7b A target code amount determination unit 7c that determines a target code amount based on the encoding parameter value and the additional request signal WS from the encoding condition analysis unit 9, and at the end of encoding of each macroblock An assigned code amount calculation unit 7d for calculating a code amount assigned to an unencoded macroblock of the current VOP based on a cumulative value of the generated code amount, and a target code for the first macroblock of each VOP The quantization parameter is determined based on the target code amount determined by the amount determining unit 7c, and for macroblocks other than the head of each VOP, based on the allocated code amount calculated by the allocated code amount calculating unit 7d. And a quantization parameter determining unit 7e for determining the quantization parameter of the macroblock to be encoded.

符号化制御部7は、このようにして設定された量子化パラメータを符号化器4及び平均量子化パラメータ算出部8へ出力する。   The encoding control unit 7 outputs the quantization parameter set in this way to the encoder 4 and the average quantization parameter calculation unit 8.

平均量子化パラメータ算出部8は、符号化制御部7から出力されたI−VOP及びP−VOPの各々に対して個別に設定された量子化パラメータの設定値から、I−VOP及びP−VOPの各々に対して個別に各VOP毎の平均量子化パラメータ値を算出する。   The average quantization parameter calculation unit 8 calculates I-VOP and P-VOP from the set values of quantization parameters individually set for each of the I-VOP and P-VOP output from the encoding control unit 7. For each VOP, the average quantization parameter value for each VOP is calculated individually.

符号化条件解析部9は、平均量子化パラメータ算出部8により算出された、I−VOP及びP−VOPの各々に対して個別に設定された量子化パラメータの各VOP毎の平均値Qa、特に直前のI−VOPに対して設定された量子化パラメータの平均値IQaと直前のP−VOPに対して設定された量子化パラメータの平均値PQaと、シーンチェンジ検出部3で設定されたシーンチェンジ信号SGの値とに基づき、符号化条件を解析し、符号量の割増しの要否を決定する(ステップS3)。
符号化条件の解析の処理の詳細については後述する。
The encoding condition analysis unit 9 calculates the average value Qa for each VOP of the quantization parameter individually set for each of the I-VOP and the P-VOP calculated by the average quantization parameter calculation unit 8, The average value IQa of the quantization parameter set for the immediately preceding I-VOP, the average value PQa of the quantization parameter set for the immediately preceding P-VOP, and the scene change set by the scene change detection unit 3 Based on the value of the signal SG, the encoding condition is analyzed to determine whether or not the code amount needs to be increased (step S3).
Details of the encoding condition analysis processing will be described later.

符号化条件解析部9による符号量割増しの要否の決定の結果を示す割増し要求信号WSは、符号化制御部7に出力され、これと前I−VOP又は前P−VOPの発生符号量VAcと、前I−VOP又は前P−VOPの平均量子化パラメータ値IQa、PQaとに基づき、現VOPの目標符号量の設定を行い(ステップS4)、目標符号量に対応した量子化パラメータを求め、これを当該VOPの先頭のマクロブロックのための量子化パラメータとして符号化器4および平均量子化パラメータ算出部8へ出力する(ステップS5)。また、2番目以降のマクロブロックについては、上記のように、符号量検出部6により、各マクロブロックの符号化終了時に、現VOPの発生符号量の累積値に基づき、現VOPのまだ符号化していないマクロブロックに割当てられる符号量を計算し、これから符号化されるマクロブロックの量子化パラメータを定める。   An additional request signal WS indicating the result of determining whether or not the encoding amount analysis unit 9 needs to increase the code amount is output to the encoding control unit 7 and the generated code amount VAc of the previous I-VOP or the previous P-VOP. Based on the average quantization parameter values IQa and PQa of the previous I-VOP or the previous P-VOP, the target code amount of the current VOP is set (step S4), and the quantization parameter corresponding to the target code amount is obtained. This is output to the encoder 4 and the average quantization parameter calculation unit 8 as a quantization parameter for the first macroblock of the VOP (step S5). For the second and subsequent macroblocks, as described above, at the end of encoding of each macroblock, the code amount detector 6 still encodes the current VOP based on the accumulated value of the generated code amount of the current VOP. A code amount allocated to a macroblock that is not yet calculated is calculated, and a quantization parameter of a macroblock to be encoded is determined.

符号化器4では、符号化制御部7により設定された量子化パラメータの設定値に基づき、現VOPの符号化を行う(ステップS6)。   The encoder 4 encodes the current VOP based on the set value of the quantization parameter set by the encoding control unit 7 (step S6).

以下に、図5を用いて、動画像符号化装置100の符号化条件解析部9における、符号化条件の解析の方法、即ち、図3のステップS3の詳細について説明する。   Hereinafter, a method of analyzing the encoding condition in the encoding condition analyzing unit 9 of the moving image encoding apparatus 100, that is, details of step S3 in FIG. 3 will be described with reference to FIG.

符号化条件解析部9においては、平均量子化パラメータ算出部8において算出された、直前に符号化されたI−VOPの平均量子化パラメータ値と、直前に符号化されたP−VOPの平均量子化パラメータ値と、1つ前のVOPがシーンチェンジのVOPであったか否かを示す前VOPのシーンチェンジ信号SGの値(符号化条件解析部9内に記憶されている)に基づき、符号化条件の解析を行い、符号量の割増しの要否の決定を行う。   The encoding condition analysis unit 9 calculates the average quantization parameter value of the immediately preceding I-VOP calculated by the average quantization parameter calculation unit 8 and the average quantum of the P-VOP encoded immediately before. Encoding condition based on the encoding parameter value and the value of the scene change signal SG of the previous VOP indicating whether or not the previous VOP was a scene change VOP (stored in the encoding condition analysis unit 9). To determine whether or not an extra code amount is necessary.

符号化条件解析部9では、まず符号化を行うVOPがI−VOPであるかP−VOPであるかを判定する(ステップS10)。P−VOPである場合は、現VOPのシーンチェンジ信号に基づき、通常の符号量割り当てを行うこと、即ちステップS4における目標符号量の設定に当たり、符号量の割増しを行わないことを決定する(ステップS16)。なお、シーンチェンジVOPである場合には、シーンチェンジ用の符号量割増しを行う。   The encoding condition analysis unit 9 first determines whether the VOP to be encoded is an I-VOP or a P-VOP (step S10). In the case of P-VOP, it is determined that normal code amount allocation is performed based on the scene change signal of the current VOP, that is, when the target code amount is set in step S4, the code amount is not increased (step S4). S16). In the case of a scene change VOP, an additional code amount for scene change is performed.

ステップS10でI−VOPの符号化であると判定された場合は、前I−VOPの平均量子化パラメータ値IQaと前P−VOPの平均量子化パラメータ値PQaの値の大小関係を比較して、前I−VOPの平均量子化パラメータ値IQaが前P−VOPの平均量子化パラメータ値PQaより十分大きいか否かの判定を行う(ステップS11)。具体的には、前I−VOPの平均量子化パラメータ値IQaが前P−VOPの平均量子化パラメータ値PQaよりある値(第1の所定値)α以上大きい(IQa−PQa>αである)かどうかの判定、即ち、前I−VOPの平均量子化パラメータ値IQaが前P−VOPの平均量子化パラメータ値PQaより大きく、その差が第1の所定値αより大きいか否かの判定を行う。   If it is determined in step S10 that the encoding is I-VOP, the magnitude relationship between the average quantization parameter value IQa of the previous I-VOP and the average quantization parameter value PQa of the previous P-VOP is compared. Then, it is determined whether or not the average quantization parameter value IQa of the previous I-VOP is sufficiently larger than the average quantization parameter value PQa of the previous P-VOP (step S11). Specifically, the average quantization parameter value IQa of the previous I-VOP is larger than the average quantization parameter value PQa of the previous P-VOP by a certain value (first predetermined value) α or more (IQa−PQa> α). That is, whether or not the average quantization parameter value IQa of the previous I-VOP is larger than the average quantization parameter value PQa of the previous P-VOP and the difference is larger than the first predetermined value α. Do.

一般にI−VOPの画質は重要であるため、I−VOPの量子化パラメータの値は、P−VOPの量子化パラメータと同程度以下に設定する望ましいが、上記の判定結果がYESであれば、上記の望ましい関係が成立していないことになる。即ち量子化パラメータ値の逆転が起こる。このような逆転が起こるのは、P−VOPの発生符号量が小さくて、P−VOPの量子化パラメータ値が小さくなっているためであり、これは静止画に近い画像など、動きが少ない画像を符号化している状態であると考えられる。   Since the image quality of I-VOP is generally important, the value of the quantization parameter of I-VOP is preferably set to the same level or less as the quantization parameter of P-VOP, but if the above determination result is YES, The above desirable relationship is not established. That is, inversion of the quantization parameter value occurs. Such inversion occurs because the generated code amount of P-VOP is small and the quantization parameter value of P-VOP is small. This is an image with little motion such as an image close to a still image. Is considered to be in a state of encoding.

ステップS11で、前I−VOPの平均量子化パラメータ値IQaが前P−VOPの平均量子化パラメータ値PQaより第1の所定値α以上大きい(IQa−PQa>αである)と判定された場合、静止画に近い画像であると判断して、静止画用の符号量割り当てを行うこと、即ち、即ちステップS4における目標符号量の設定に当たり、符号量の割増しを行うことを決定する(ステップS15)。   When it is determined in step S11 that the average quantization parameter value IQa of the previous I-VOP is larger than the average quantization parameter value PQa of the previous P-VOP by a first predetermined value α or more (IQa−PQa> α) Therefore, it is determined that the image is close to a still image, and it is determined that code amount allocation for still images is performed, that is, when the target code amount is set in step S4, the code amount is increased (step S15). ).

静止画用の符号量割り当てでは、P−VOPの画質に対し、I−VOPの画質の劣化が視覚的に顕著になることを防ぐため、I−VOPの目標符号量の設定を通常の場合より多くなるように設定する。例えば、通常のI−VOPの目標符号量をP−VOPの2倍に設定している場合に、静止画用の符号量割り当てでは、P−VOPの5倍程度に設定する。これにより、符号化制御部7により、I−VOPの量子化パラメータが小さく設定され、I−VOPでの画質が向上し、静止画に近い画像など、動きが少ない画像においてもI−VOPでの画質劣化を防ぐことができる。   In the code amount allocation for still images, the target code amount of the I-VOP is set more than usual in order to prevent the deterioration of the image quality of the I-VOP from being visually noticeable with respect to the image quality of the P-VOP. Set to increase. For example, when the target code amount of the normal I-VOP is set to twice that of the P-VOP, the code amount allocation for still images is set to about 5 times that of the P-VOP. As a result, the I-VOP quantization parameter is set to a small value by the encoding control unit 7, the image quality in the I-VOP is improved, and even in an image with little motion such as an image close to a still image, Image quality degradation can be prevented.

ステップS11において、前I−VOPの平均量子化パラメータ値IQaが前P−VOPの平均量子化パラメータ値PQaより第1の所定値α以上大きい(IQa−PQa>αである)と判定されなかった場合(ステップS11における判定結果がNOである場合)には、ステップS12に進む。
ステップS11において、前I−VOPの平均量子化パラメータ値IQaが前P−VOPの平均量子化パラメータ値PQaより第1の所定値α以上大きい(IQa−PQa>αである)と判定されなかった場合(ステップS11における判定結果がNOである場合)にも、前I−VOPの平均量子化パラメータ値IQaと前P−VOPの平均量子化パラメータ値PQaの値の関係等により、I−VOPでの画質の劣化が目立つ場合がある。ステップS12乃至S14の処理は、このような場合にも、I−VOPに対する符号量の割増しを行うことでI−VOPの画質の劣化を防ぐことを目的として行われるものである。
In step S11, it is not determined that the average quantization parameter value IQa of the previous I-VOP is larger than the average quantization parameter value PQa of the previous P-VOP by a first predetermined value α or more (IQa−PQa> α). In the case (when the determination result in step S11 is NO), the process proceeds to step S12.
In step S11, it is not determined that the average quantization parameter value IQa of the previous I-VOP is larger than the average quantization parameter value PQa of the previous P-VOP by a first predetermined value α or more (IQa−PQa> α). Even in the case (when the determination result in step S11 is NO), I-VOP is determined by the relationship between the average quantization parameter value IQa of the previous I-VOP and the average quantization parameter value PQa of the previous P-VOP. Degradation of image quality may be noticeable. Even in such a case, the processes in steps S12 to S14 are performed for the purpose of preventing deterioration of the image quality of the I-VOP by increasing the code amount for the I-VOP.

ステップS12では、前VOPがシーンチェンジVOPであったか否かを判別する。シーンチェンジ時には符号量が多く発生するため、シーンチェンジ用に符号量を割増し、画質の劣化を防ぐという符号量割り当てを行うため、次のI―VOPでさらに静止画用の符号量割り当てを行うと、連続して局所的に符号量が増えることとなり、他の部分の画質劣化を生じ、全体としての高画質を保てなくなる。また、前VOPがシーンチェンジであった場合は、画面の切り替わりに当たるため、次のI−VOPの量子化パラメータ値IQaが多少大きくも、I−VOPでの画質の劣化は目立たない。従って、ここで、前VOPがシーンチェンジVOPであると判定される場合は、通常の符号量割り当てを行うこと、即ちステップS4における目標符号量の決定に当たり、符号量の割増しを行わないことを決定する(ステップS16)。   In step S12, it is determined whether or not the previous VOP was a scene change VOP. Since a large amount of code is generated at the time of a scene change, code amount allocation for increasing the amount of code for scene change and preventing image quality deterioration is performed. When code amount allocation for still images is further performed in the next I-VOP As a result, the code amount increases continuously and locally, image quality degradation occurs in other parts, and the overall image quality cannot be maintained. If the previous VOP is a scene change, it corresponds to a screen change. Therefore, even if the quantization parameter value IQa of the next I-VOP is somewhat large, the image quality degradation in the I-VOP is not noticeable. Therefore, here, when it is determined that the previous VOP is a scene change VOP, it is determined that normal code amount allocation is performed, that is, when the target code amount is determined in step S4, the code amount is not increased. (Step S16).

次に、ステップS13では、前P―VOPの平均量子化パラメータ値PQaが動画像を符号化しているとして、十分小さいか否か、具体的には、ある値(第2の所定値)βよりも小さいか(PQa<βであるか)否かを判別する。つまり、前P−VOPの平均量子化パラメータ値PQaが第2の所定値β以上であれば(ステップS12の判定結果がNOであれば)、ある程度動きのある画像であると判断して、通常の符号量割り当てを行うこと、即ちステップS4における目標符号量の決定に当たり、符号量の割増しを行わないことを決定する(ステップS16)。
ステップS13で、前P―VOPの平均量子化パラメータ値PQaが十分小さければ(PQa<βであれば、つまり、ステップS12の判定結果がYESであれば)、次にステップS14に進む。
Next, in step S13, whether or not the average quantization parameter value PQa of the previous P-VOP is encoded as a moving image is determined to be sufficiently small, specifically from a certain value (second predetermined value) β. Is smaller (whether PQa <β) or not. That is, if the average quantization parameter value PQa of the previous P-VOP is equal to or greater than the second predetermined value β (if the determination result in step S12 is NO), it is determined that the image has some degree of motion, and normal When determining the target code amount in step S4, it is determined not to increase the code amount (step S16).
If the average quantization parameter value PQa of the previous P-VOP is sufficiently small in step S13 (if PQa <β, that is, if the determination result in step S12 is YES), the process proceeds to step S14.

次に、ステップS14では、前P−VOPの平均量子化パラメータ値PQaと前I−VOPの平均量子化パラメータ値IQaとの値の大小関係を比較して、前P−VOPの平均量子化パラメータ値PQaが前I−VOPの平均量子化パラメータ値IQaより十分大きいか否かの判定を行う。具体的には、前P−VOPの平均量子化パラメータ値PQaが前I−VOPの平均量子化パラメータ値IQaよりある値(第3の所定値)γ以上大きい(PQa−IQa>γである)かどうかの判定、即ち、前P−VOPの平均量子化パラメータ値PQaが前I−VOPの平均量子化パラメータ値IQaより大きく、その差が第3の所定値γより大きいか否かの判定を行う。第3の所定値γは、それ以上の差があると、I−VOPでの画質劣化が生じないような値に定められる。ステップS14における判定結果がYESの場合は、通常の符号量割り当てを行うこと、即ちステップS4における目標符号量の決定に当たり、符号量の割増しを行わないことを決定する(ステップS16)。   Next, in step S14, the magnitude relationship between the average quantization parameter value PQa of the previous P-VOP and the average quantization parameter value IQa of the previous I-VOP is compared, and the average quantization parameter of the previous P-VOP is compared. It is determined whether or not the value PQa is sufficiently larger than the average quantization parameter value IQa of the previous I-VOP. Specifically, the average quantization parameter value PQa of the previous P-VOP is larger than the average quantization parameter value IQa of the previous I-VOP by a certain value (third predetermined value) γ (PQa−IQa> γ). That is, whether or not the average quantization parameter value PQa of the previous P-VOP is larger than the average quantization parameter value IQa of the previous I-VOP and the difference is larger than a third predetermined value γ. Do. The third predetermined value γ is set to a value that does not cause image quality degradation in the I-VOP if there is a difference greater than that. If the determination result in step S14 is YES, it is determined that normal code amount allocation is performed, that is, when the target code amount is determined in step S4, the code amount is not increased (step S16).

ステップS14の判定結果がNOの場合に、すなわち、前P−VOPの平均量子化パラメータ値PQaが前I−VOPの平均量子化パラメータ値IQaより大きくても差が小さい場合、もしくは、前I−VOPの平均量子化パラメータ値IQaと前P−VOPの平均量子化パラメータ値PQaが等しい場合、または前I−VOPの平均量子化パラメータ値IQaが前P−VOPの平均量子化パラメータ値PQaより大きい場合は、I−VOPで画質劣化を招く場合であると判定し、静止画に近い画像であると判断して、静止画用の符号量割り当てを行うこと、即ちステップS4における目標符号量の決定に当たり、符号量の割増しを行うことを決定する。つまり、P−VOPの画質に対し、I−VOPの画質の劣化が視覚的に顕著になることを防ぐため、I−VOPの目標符号量の設定を通常の場合より多くなるように設定すること、即ちステップS4における目標符号量の決定に当たり、符号量の割増しを行うことを決定する(ステップS15)。   When the determination result in step S14 is NO, that is, when the average quantization parameter value PQa of the previous P-VOP is larger than the average quantization parameter value IQa of the previous I-VOP, or when the difference is small. When the average quantization parameter value IQa of the VOP is equal to the average quantization parameter value PQa of the previous P-VOP, or the average quantization parameter value IQa of the previous I-VOP is larger than the average quantization parameter value PQa of the previous P-VOP In this case, it is determined that the image quality is deteriorated by the I-VOP, it is determined that the image is close to the still image, and the code amount allocation for the still image is performed, that is, the target code amount is determined in step S4. In this case, it is decided to increase the code amount. In other words, in order to prevent the image quality of the I-VOP from becoming noticeably deteriorated with respect to the image quality of the P-VOP, the target code amount of the I-VOP is set to be larger than that in the normal case. That is, in determining the target code amount in step S4, it is determined to increase the code amount (step S15).

このように、前I−VOPの平均量子化パラメータ値IQaと前P−VOPの平均量子化パラメータ値PQaの関係を解析することにより、P−VOPの符号量が少なく、P−VOPの量子化パラメータ値が極端に小さくなり、想定しているI−VOPの量子化パラメータと、P−VOPの量子化パラメータの設定値の大小関係が逆転したり、さらにI−VOPの量子化パラメータとP−VOPの量子化パラメータの差が大きくなる場合を検出し、I−VOPでの画質劣化が生じると判断された場合には、I−VOPの目標符号量の設定を通常の場合より多くなるように設定することにより、I−VOPの量子化パラメータ値が小さく設定され、I−VOPでの画質が向上し、静止画に近い画像など、動きが少ない画像においてもI−VOPでの画質劣化を防ぐことができる。   In this way, by analyzing the relationship between the average quantization parameter value IQa of the previous I-VOP and the average quantization parameter value PQa of the previous P-VOP, the P-VOP quantization is small, and the P-VOP quantization is small. The parameter value becomes extremely small, the magnitude relationship between the assumed I-VOP quantization parameter and the set value of the P-VOP quantization parameter is reversed, and further, the I-VOP quantization parameter and the P- When the difference in the VOP quantization parameter is detected and it is determined that the image quality is deteriorated in the I-VOP, the target code amount of the I-VOP is set to be larger than in the normal case. By setting, the quantization parameter value of the I-VOP is set small, the image quality in the I-VOP is improved, and even in an image with little motion such as an image close to a still image, the I-VOP It is possible to prevent the deterioration of image quality.

また、前VOPのシーンチェンジ信号SGの値に基づき、前VOPにおいてシーンチェンジが検出されたかを解析し(即ちシーンチェンジに伴う符号量の割増しが行われたかを解析し)、これによって、前VOPがシーンチェンジのVOPであり、シーンチェンジ用に符号量を割増している場合に、引き続き、次のI―VOPでさらに符号量割増しを行わないように制御し、これにより、連続して局所的に符号量が増えて他の部分の画質が劣化することを防ぎ、全体として安定して高画質を保つことができる。   In addition, based on the value of the scene change signal SG of the previous VOP, it is analyzed whether a scene change has been detected in the previous VOP (that is, whether the code amount accompanying the scene change has been increased). Is a scene change VOP, and when the code amount is increased for the scene change, control is performed so that the code amount is not further increased in the next I-VOP. It is possible to prevent the code amount from increasing and the image quality of other portions from deteriorating, and to maintain a stable high image quality as a whole.

なお、図5に示す判定ステップの順序は変更が可能である。例えば、ステップS12とS13を入れ替えても良い。ステップS11乃至S14による符号量の割増しの要否の決定のための基準を要約すれば以下のごとくとなる。
(a) 前I−VOPの平均量子化パラメータ値IQaが、前P−VOPの平均量子化パラメータ値PQaより第1の所定値α以上大きい(IQa−PQa>αである)と判定したときは(ステップS11でYES)、目標符号量の決定に当たり符号量を割増すことを決定する。
(b) 前I−VOPの平均量子化パラメータ値IQaが、前P−VOPの平均量子化パラメータ値PQaより第1の所定値α以上大きくはなく(IQa−PQa>αではなく)(ステップS11でNO)、かつ、前VOPについてシーンチェンジが検出されたときは(ステップS12でYES)、目標符号量の決定に当たり符号量の割増しを行わないことを決定する。
(c) 前I−VOPの平均量子化パラメータ値IQaが、前P−VOPの平均量子化パラメータ値PQaより第1の所定値α以上大きくはなく(IQa−PQa>αではなく)(ステップS11でNO)、かつ、前P−VOPの平均量子化パラメータ値が所定値β以上であるときは(ステップS13でNO)、目標符号量の決定に当たり符号量の割増しを行わないことを決定する。
(d) 前I−VOPの平均量子化パラメータ値IQaが、前P−VOPの平均量子化パラメータ値PQaより第1の所定値α以上大きくはなく(IQa−PQa>αではなく)(ステップS11でNO)、かつ、前P−VOPの平均量子化パラメータ値PQaが前I−VOPの平均量子化パラメータ値IQaより第3の所定値γ以上大きいときは(ステップS14でYES)、目標符号量の決定に当たり符号量の割増しを行わないことを決定する。
(e) 前VOPについてシーンチェンジが検出されず(ステップS12でNO)、かつ、前P−VOPの平均量子化パラメータ値が所定値β以上ではなく(ステップS13でYES)、かつ、前P−VOPの平均量子化パラメータ値PQaが前I−VOPの平均量子化パラメータ値IQaより第3の所定値γ以上大きくはないときは(ステップS14でNO)、目標符号量の決定に当たり符号量の割増しを行うことを決定する。なお、ステップS14でNOであればステップS11で当然YESとなる。但し、ステップS11でYESでもステップS14にステップS12でYES又はS13でNOのためステップS14に至らないことがある。
Note that the order of the determination steps shown in FIG. 5 can be changed. For example, steps S12 and S13 may be interchanged. Summarizing the criteria for determining whether or not to increase the code amount in steps S11 to S14 is as follows.
(A) When it is determined that the average quantization parameter value IQa of the previous I-VOP is larger than the average quantization parameter value PQa of the previous P-VOP by a first predetermined value α or more (IQa−PQa> α) (YES in step S11), it is determined to increase the code amount in determining the target code amount.
(B) The average quantization parameter value IQa of the previous I-VOP is not larger than the first predetermined value α by the average quantization parameter value PQa of the previous P-VOP (not IQa−PQa> α) (step S11) NO), and when a scene change is detected for the previous VOP (YES in step S12), it is determined not to increase the code amount in determining the target code amount.
(C) The average quantization parameter value IQa of the previous I-VOP is not greater than the first predetermined value α or more than the average quantization parameter value PQa of the previous P-VOP (not IQa−PQa> α) (step S11) If the average quantization parameter value of the previous P-VOP is equal to or greater than the predetermined value β (NO in step S13), it is determined not to increase the code amount in determining the target code amount.
(D) The average quantization parameter value IQa of the previous I-VOP is not greater than the first predetermined value α or more than the average quantization parameter value PQa of the previous P-VOP (not IQa−PQa> α) (step S11) NO) and when the average quantization parameter value PQa of the previous P-VOP is larger than the average quantization parameter value IQa of the previous I-VOP by a third predetermined value γ or more (YES in step S14), the target code amount It is determined that no extra code amount is to be performed.
(E) No scene change is detected for the previous VOP (NO in step S12), the average quantization parameter value of the previous P-VOP is not equal to or greater than the predetermined value β (YES in step S13), and the previous P- If the average quantization parameter value PQa of the VOP is not larger than the third predetermined value γ by the average quantization parameter value IQa of the previous I-VOP (NO in step S14), the code amount is increased when determining the target code amount. Decide to do. If NO in step S14, it is naturally YES in step S11. However, even if YES in step S11, step S14 may not be reached because step S14 is YES in step S12 or NO in step S13.

なお、上記実施の形態1では静止画用の符号量割り当ての例として、通常のI−VOPの目標符号量をP−VOPの目標符号量の2倍に設定している場合に、P−VOPの5倍程度に設定する場合を挙げたが、目標符号量の設定方法は、このようにI−VOPの目標符号量とP−VOPの目標符号量の整数比により設定するものには限らず、I−VOP、P−VOPの実際の発生符号量、I−VOP、およびP−VOPの平均量子化パラメータ値、シーンチェンジの情報などの符号化情報の組み合わせに基づいて目標符号量の設定を行うこととしてもよい。   In the first embodiment, as an example of code amount allocation for still images, when the target code amount of a normal I-VOP is set to twice the target code amount of P-VOP, P-VOP However, the method of setting the target code amount is not limited to the method of setting the integer code ratio between the target code amount of I-VOP and the target code amount of P-VOP in this way. , I-VOP, P-VOP actual generated code amount, I-VOP, P-VOP average quantization parameter value, setting of target code amount based on combination of encoding information such as scene change information It may be done.

また、上記実施の形態1では、前I−VOPの平均量子化パラメータ値IQaと、前P−VOPの平均量子化パラメータ値PQaを用いることにより符号化条件を解析しているが、過去に符号化された複数のI−VOP、およびP−VOPの平均量子化パラメータ値を用いてもよい。   In the first embodiment, the encoding condition is analyzed by using the average quantization parameter value IQa of the previous I-VOP and the average quantization parameter value PQa of the previous P-VOP. A plurality of generalized I-VOPs and P-VOP average quantization parameter values may be used.

また、上記実施の形態1では図5に示す方法で符号化条件の解析を行うこととしたが説明したが、これに限るものではなく、一般にI−VOPの量子化パラメータ値IQaとP−VOPの量子化パラメータ値PQaの関係で、I−VOPでの画質劣化が視覚的に許容範囲外となる場合を検出できるものであればよい。   In the first embodiment, the encoding condition is analyzed by the method shown in FIG. 5. However, the present invention is not limited to this. In general, the I-VOP quantization parameter value IQa and the P-VOP are used. Any quantization parameter value PQa can be used as long as it can detect a case where the image quality degradation in the I-VOP is visually outside the allowable range.

また、上記実施の形態1では変化量検出部2における変化量の検出を、輝度信号に基づいて行っているが、輝度信号でなく色信号を用いてもよい。   In the first embodiment, the change amount detection unit 2 detects the change amount based on the luminance signal. However, a color signal may be used instead of the luminance signal.

また、相前後するVOP間の変化量を、各画素についての信号の差分の絶対値の、画面内のすべての画素についての総和により求めているが、これに限るものではなく、画面内の信号値の最大値、最小値、中央値などの画面の特徴値を用いてもよい。   Further, the amount of change between successive VOPs is obtained from the sum of all the pixels in the screen of the absolute value of the signal difference for each pixel. However, the present invention is not limited to this. Screen feature values such as a maximum value, a minimum value, and a median value may be used.

また、相前後するVOP間の変化量の計算を画面全体について行っているが、これに限るものではなく、画面をいくつかの部分に分割して、分割した小領域内で計算し、所定値と比較してもよい。   In addition, the amount of change between successive VOPs is calculated for the entire screen. However, the present invention is not limited to this. The screen is divided into several parts, calculated within the divided small areas, and a predetermined value. May be compared.

また、これらの全てのシーンチェンジ判定条件を組み合わせてもよい。例えば、これらの判定条件を組み合わせで、各判定条件の1つでも満たされた場合にシーンチェンジと検出する方法、各判定基準が満たされるかどうかの判定結果を用いた多数決によりシーンチェンジかどうかの判定を行う方法、各判定条件が満たされるかどうかの判定結果に重みをつけて多数決によりシーンチェンジかどうかの判定を行う方法、所定数以上の判定条件が満たされたときにシーンチェンジと検出する方法、特定の判定条件が満たされたときは他の判定条件による判定結果の如何を問わずシーンチェンジと検出する方法等があるが、これらも本発明に包含される。   All these scene change determination conditions may be combined. For example, a combination of these determination conditions, a method of detecting a scene change when at least one of the determination conditions is satisfied, whether a scene change is determined by a majority decision using the determination result of whether each determination criterion is satisfied A method of determining, a method of determining whether or not a scene change is made by majority by weighting the determination result of whether or not each determination condition is satisfied, and detecting a scene change when a predetermined number or more of the determination conditions are satisfied There are a method, a method of detecting a scene change regardless of the determination result based on other determination conditions when a specific determination condition is satisfied, and these are also included in the present invention.

また、上記実施の形態1ではシーンチェンジ検出部3におけるシーンチェンジの検出は、現VOPと前VOPとの間の変化量に基づき行っているが、変化量のみでなく、符号化の状態、例えば、符号量制御によって符号化を行わない、すなわちあるVOPの符号化をスキップすることを示す、スキップ信号等を用いて、シーンチェンジ検出を行ってもよい。   In the first embodiment, the scene change detection unit 3 detects the scene change based on the amount of change between the current VOP and the previous VOP, but not only the amount of change but also the encoding state, for example, Further, scene change detection may be performed using a skip signal or the like indicating that encoding is not performed by code amount control, that is, encoding of a certain VOP is skipped.

さらにまた、上記の実施の形態1では、画面間符号化としてP−VOPのみを行う場合を行っているが、P−VOPのみならず、B−VOPを行う場合にも本発明を適用できる。この場合、I−VOP、P−VOP、B−VOPのそれぞれの平均量子化パラメータ値により符号化条件を解析し、それぞれのVOPタイプに対して量子化パラメータを設定する。   Furthermore, in Embodiment 1 described above, only P-VOP is performed as inter-frame coding, but the present invention can be applied to not only P-VOP but also B-VOP. In this case, the encoding condition is analyzed based on the average quantization parameter values of I-VOP, P-VOP, and B-VOP, and the quantization parameter is set for each VOP type.

以下に、実施の形態1に示した、図5の符号化条件解析処理フローに従い、符号化条件解析部9における、符号化条件解析の方法について、前I−VOPの平均量子化パラメータ値IQa、前P−VOPの平均量子化パラメータ値PQa、判定値α、β、γ、前VOPのシーンチェンジ信号SGにつき具体的数値例を当てはめて説明する。以下の第1の例及び第2の例のいずれにおいても、符号化されるVOPがI−VOPであり、ステップS10でI−VOPの符号化であると判断されるものとする。   Hereinafter, according to the coding condition analysis processing flow of FIG. 5 shown in the first embodiment, the coding condition analysis method in the coding condition analysis unit 9 will be described with respect to the average quantization parameter value IQa of the previous I-VOP, Description will be made by applying specific numerical examples for the average quantization parameter value PQa of the previous P-VOP, the determination values α, β, γ, and the scene change signal SG of the previous VOP. In both the following first example and second example, it is assumed that the VOP to be encoded is an I-VOP, and it is determined in step S10 that the I-VOP is encoded.

第1の例は、ステップS11にて、前I−VOPの平均量子化パラメータ値IQaと前P−VOPの平均量子化パラメータ値PQaの値の大小関係を比較により、前I−VOPの平均量子化パラメータ値IQaが前P−VOPの平均量子化パラメータ値PQaより十分大きいと判定される場合である。
前I−VOPの平均量子化パラメータ値IQa=11、前P−VOPの平均量子化パラメータ値PQa=3、α=1、β=6、γ=0、前VOPはシーンチェンジVOPであるとする。
ステップS11にて、(前I−VOPの平均量子化パラメータ値IQa)−(前P−VOPの平均量子化パラメータ値PQa)=8であり、α=1より大きいため、静止画に近い画像の符号化を行っている状態であると判定される。この場合、前VOPはシーンチェンジVOPであるが、前I−VOPの平均量子化パラメータ値IQaが前P−VOPの平均量子化パラメータ値PQaより十分大きいため、前VOPと、I−VOPとの画質差が生じるものとして、符号量を割増しを決定する(ステップS15)。
In the first example, the average quantization parameter value IQa of the previous I-VOP and the average quantization parameter value PQa of the previous P-VOP are compared in step S11 by comparing the magnitude relationship between the average quantization parameter value PQa of the previous I-VOP. This is a case where it is determined that the quantization parameter value IQa is sufficiently larger than the average quantization parameter value PQa of the previous P-VOP.
Average quantization parameter value IQa of previous I-VOP = 11, average quantization parameter value PQa of previous P-VOP = 3, α = 1, β = 6, γ = 0, and previous VOP is scene change VOP .
In step S11, (average quantization parameter value IQa of previous I-VOP) − (average quantization parameter value PQa of previous P-VOP) = 8 and larger than α = 1, so that an image close to a still image It is determined that the encoding is being performed. In this case, the previous VOP is a scene change VOP, but since the average quantization parameter value IQa of the previous I-VOP is sufficiently larger than the average quantization parameter value PQa of the previous P-VOP, the previous VOP and the I-VOP The code amount is determined to be increased as a difference in image quality occurs (step S15).

第2の例は、第1の例とは異なり、ステップS11にて、前I−VOPの平均量子化パラメータ値IQaと前P−VOPの平均量子化パラメータ値PQaの値の大小関係の比較により、前I−VOPの平均量子化パラメータ値IQaが前P−VOPの平均量子化パラメータ値PQaより十分大きいと判定されない場合である。
前I−VOPの平均量子化パラメータ値IQa=5、前P−VOPの平均量子化パラメータ値PQa=5、α=1、β=6、γ=0、前VOPはシーンチェンジVOPでないとする。
ステップS11にて、(前I−VOPの平均量子化パラメータ値IQa)−(前P−VOPの平均量子化パラメータ値PQa)=0であり、α=1より小さいため、ステップS12に進む。
ステップS12にて、前VOPはシーンチェンジVOPでないため、ステップS13に進む。
ステップS13で前P−VOPの平均量子化パラメータ値PQaが5<6(=β)より小さいため、前P−VOPの平均量子化パラメータ値PQaは十分小さいと判定して、ステップS14に進む。
The second example is different from the first example in step S11 by comparing the magnitude relationship between the average quantization parameter value IQa of the previous I-VOP and the average quantization parameter value PQa of the previous P-VOP. This is a case where it is not determined that the average quantization parameter value IQa of the previous I-VOP is sufficiently larger than the average quantization parameter value PQa of the previous P-VOP.
It is assumed that the previous I-VOP average quantization parameter value IQa = 5, the previous P-VOP average quantization parameter value PQa = 5, α = 1, β = 6, γ = 0, and the previous VOP is not a scene change VOP.
In step S11, (average quantization parameter value IQa of previous I-VOP) − (average quantization parameter value PQa of previous P-VOP) = 0 and smaller than α = 1, so the process proceeds to step S12.
In step S12, since the previous VOP is not a scene change VOP, the process proceeds to step S13.
In step S13, since the average quantization parameter value PQa of the previous P-VOP is smaller than 5 <6 (= β), it is determined that the average quantization parameter value PQa of the previous P-VOP is sufficiently small, and the process proceeds to step S14.

次に、ステップS14で、前P−VOPの平均量子化パラメータ値PQaと前I−VOPの平均量子化パラメータ値IQaとの値の大小関係を比較して、前P−VOPの平均量子化パラメータ値PQaが前I−VOPの平均量子化パラメータ値IQaより大きく、その差によりI−VOPでの画質劣化が生じない程度であるか否かを判別する。
この場合、前I−VOPの平均量子化パラメータ値IQa=5、前P−VOPの平均量子化パラメータ値PQa=5で等しく差がないため、I−VOPでの画質劣化がP−VOPに比較して視覚的に目立つ場合であると判定して、符号量の割増しを行うことを決定する(ステップS15)。
Next, in step S14, the magnitude relationship between the average quantization parameter value PQa of the previous P-VOP and the average quantization parameter value IQa of the previous I-VOP is compared, and the average quantization parameter of the previous P-VOP is compared. It is determined whether or not the value PQa is larger than the average quantization parameter value IQa of the previous I-VOP, and the difference does not cause image quality degradation in the I-VOP.
In this case, since there is no difference between the average quantization parameter value IQa = 5 of the previous I-VOP and the average quantization parameter value PQa = 5 of the previous P-VOP, image quality degradation in the I-VOP is compared with the P-VOP. Then, it is determined that this is a visually conspicuous case, and it is determined to increase the code amount (step S15).

なお、上記した実施の形態の動画像符号化装置のフレームメモリ1、バッファ5以外の部分、即ち、図1の変化量検出部2、シーンチェンジ検出部3、符号化器4、符号量検出部6、符号化制御部7、平均量子化パラメータ算出部8、符号化条件解析部9をソフトウエアにより、即ちプログラムされたコンピュータにより実現することとしても良い。   It should be noted that portions other than the frame memory 1 and the buffer 5 of the moving picture encoding apparatus according to the above-described embodiment, that is, the change amount detection unit 2, the scene change detection unit 3, the encoder 4, and the code amount detection unit in FIG. 6. The encoding control unit 7, the average quantization parameter calculation unit 8, and the encoding condition analysis unit 9 may be realized by software, that is, by a programmed computer.

この発明の実施の形態を示す動画像符号化装置を示すブロック図ある。It is a block diagram which shows the moving image encoder which shows embodiment of this invention. この発明の実施の形態1を示す動画像符号化装置のフレームメモリの構成図である。It is a block diagram of the frame memory of the moving image encoder which shows Embodiment 1 of this invention. この発明の実施の形態1を示す動画像符号化装置のVOPの符号化処理手順を示すフロー図である。It is a flowchart which shows the encoding process procedure of VOP of the moving image encoder which shows Embodiment 1 of this invention. 図1の符号化制御部7の詳細を示すブロック図である。It is a block diagram which shows the detail of the encoding control part 7 of FIG. この発明の実施の形態1を示す動画像符号化装置の符号化条件解析処理手順を示すフロー図である。It is a flowchart which shows the encoding condition analysis processing procedure of the moving image encoder which shows Embodiment 1 of this invention.

符号の説明Explanation of symbols

1 フレームメモリ、 2 変化量検出部、 3 シーンチェンジ検出部、 4 符号化器、 5 バッファ、 6 符号量検出部、 7 符号化制御回路、 8 平均量子化パラメータ算出部、 9 符号化条件解析部、 100 動画像符号化装置。   1 frame memory, 2 change amount detection unit, 3 scene change detection unit, 4 encoder, 5 buffer, 6 code amount detection unit, 7 encoding control circuit, 8 average quantization parameter calculation unit, 9 encoding condition analysis unit 100 A moving image encoding device.

Claims (10)

入力された動画像の各フレーム又はVOPに対し画面内符号化又は画面間符号化を選択的に行う符号化手段と、
前記符号化手段にて符号化された各フレーム又はVOPの符号量を求める符号量検出手段と、
前記符号化手段における符号化で用いられる量子化パラメータを設定する符号化制御手段と、
前記符号化制御手段で設定された量子化パラメータの、各フレーム又はVOP毎の平均値を算出する量子化パラメータ平均値算出手段と、
一つのフレーム又はVOPを画面内符号化するに当たり、直前に画面内符号化されたフレーム又はVOPのために設定された量子化パラメータの平均値と、直前に画面間符号化されたフレーム又はVOPのために設定された量子化パラメータの平均値とに基づき、目標符号量の割増しを行うか否かを決定する符号化条件解析手段とを備え、
前記符号化制御手段は、前記符号化条件解析手段における決定に基づき、前記一つのフレーム又はVOPのための前記量子化パラメータを設定し、
前記符号化条件解析手段は、
前記直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値が、前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値より第1の所定値以上大きいと判定したときは、
前記目標符号量の決定に当たり符号量の割増しを行うことを特徴とする
動画像符号化装置。
Coding means for selectively performing intra-frame coding or inter-frame coding for each frame or VOP of the input moving image;
Code amount detection means for obtaining the code amount of each frame or VOP encoded by the encoding means;
Encoding control means for setting a quantization parameter used in encoding in the encoding means;
Quantization parameter average value calculating means for calculating an average value for each frame or VOP of the quantization parameter set by the encoding control means;
In the intra-frame encoding of one frame or VOP, the average value of the quantization parameter set for the frame or VOP that was encoded immediately before the frame and the frame or VOP that was encoded immediately before the inter-frame Coding condition analysis means for determining whether to increase the target code amount based on the average value of the quantization parameter set for
The encoding control means sets the quantization parameter for the one frame or VOP based on the determination in the encoding condition analysis means ,
The encoding condition analysis means includes
When it is determined that the average quantization parameter value of the frame or VOP that was intra-encoded just before is larger than the average quantization parameter value of the frame or VOP that was inter-encoded just before the first predetermined value Is
A moving picture encoding apparatus, wherein a code amount is increased when determining the target code amount .
符号化されたフレーム又はVOPについてシーンチェンジを検出する手段をさらに有し、
前記符号化条件解析手段は、
前記直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値が、前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値より第1の所定値以上大きくはなく、かつ、
直前に符号化されたフレーム又はVOPについてシーンチェンジが検出されたときは、
前記目標符号量の決定に当たり符号量の割増しを行わない
ことを特徴とする請求項1に記載の動画像符号化装置。
Further we have a means for detecting the scene change for the encoded frame or VOP,
The encoding condition analysis means includes
The average quantization parameter value of the frame or VOP that was intra-encoded just before is not greater than the first predetermined value than the average quantization parameter value of the frame or VOP that was inter-encoded just before, and ,
When a scene change is detected for the frame or VOP encoded immediately before,
2. The moving picture coding apparatus according to claim 1 , wherein an extra code amount is not performed in determining the target code amount .
前記符号化条件解析手段は、
前記直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値が、前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値より第1の所定値以上大きくはなく、かつ、
前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値が第2の所定値以上であるときは、
目標符号量の決定に当たり、符号量の割増しを行わないことを特徴とする請求項1に記載の動画像符号化装置。
The encoding condition analysis means includes
The average quantization parameter value of the frame or VOP that was intra-encoded just before is not greater than the first predetermined value than the average quantization parameter value of the frame or VOP that was inter-encoded immediately before, and ,
When the average quantization parameter value of the frame or VOP that has been inter-frame encoded immediately before is equal to or greater than a second predetermined value,
2. The moving picture encoding apparatus according to claim 1, wherein when determining the target code amount, no additional code amount is performed.
前記符号化条件解析手段は、
前記直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値が、前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値より第1の所定値以上大きくはなく、かつ、
前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値が直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値より第3の所定値以上大きいときは、
目標符号量の決定に当たり符号量の割増しを行わないことを決定することを特徴とする請求項1に記載の動画像符号化装置。
The encoding condition analysis means includes
The average quantization parameter value of the frame or VOP that was intra-encoded just before is not greater than the first predetermined value than the average quantization parameter value of the frame or VOP that was inter-encoded just before, and ,
When the average quantization parameter value of the frame or VOP that has been inter-frame encoded immediately before is larger than the average quantization parameter value of the frame or VOP that has been intra-frame encoded immediately before by a third predetermined value,
2. The moving picture encoding apparatus according to claim 1, wherein when determining the target code amount, it is determined not to increase the code amount.
前記符号化条件解析手段は、
直前に符号化されたフレーム又はVOPについてシーンチェンジが検出されず、かつ、
前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値が第2の所定値以上ではなく、かつ、
前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値が直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値より第3の所定値以上大きくはないときは、
目標符号量の決定に当たり符号量の割増しを行うことを特徴とする請求項2に記載の動画像符号化装置。
The encoding condition analysis means includes
No scene change is detected for the frame or VOP encoded immediately before, and
The average quantization parameter value of the frame or VOP that has been inter-coded immediately before is not equal to or greater than a second predetermined value, and
When the average quantization parameter value of the frame or VOP encoded immediately before the screen is not greater than the third predetermined value than the average quantization parameter value of the frame or VOP encoded immediately before the screen,
3. The moving picture coding apparatus according to claim 2 , wherein the code amount is increased when the target code amount is determined.
入力された動画像の各フレーム又はVOPに対し画面内符号化又は画面間符号化を選択的に行う符号化ステップと、
前記符号化ステップにて符号化された各フレーム又はVOPの符号量を求める符号量検出ステップと、
前記符号化ステップにおける符号化で用いられる量子化パラメータを設定する符号化制御ステップと、
前記符号化制御ステップで設定された量子化パラメータの、各フレーム又はVOP毎の平均値を算出する量子化パラメータ平均値算出ステップと、
一つのフレーム又はVOPを画面内符号化するに当たり、直前に画面内符号化されたフレーム又はVOPのために設定された量子化パラメータの平均値と、直前に画面間符号化されたフレーム又はVOPのために設定された量子化パラメータの平均値とに基づき、目標符号量の割増しを行うか否かを決定する符号化条件解析ステップとを備え、
前記符号化制御ステップは、前記符号化条件解析ステップにおける決定に基づき、前記一つのフレーム又はVOPのための前記量子化パラメータを設定し、
前記符号化条件解析ステップは、
前記直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値が、前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値より第1の所定値以上大きいと判定したときは、
前記目標符号量の決定に当たり符号量の割増しを行うことを特徴とする
動画像符号化方法。
A coding step for selectively performing intra-frame coding or inter-frame coding for each frame or VOP of the input moving image;
A code amount detection step for obtaining a code amount of each frame or VOP encoded in the encoding step;
An encoding control step for setting a quantization parameter used in encoding in the encoding step;
A quantization parameter average value calculating step for calculating an average value for each frame or VOP of the quantization parameter set in the encoding control step;
In the intra-frame encoding of one frame or VOP, the average value of the quantization parameter set for the frame or VOP that was encoded immediately before the frame and the frame or VOP that was encoded immediately before the inter-frame An encoding condition analysis step for determining whether or not to increase the target code amount based on the average value of the quantization parameter set for
The encoding control step sets the quantization parameter for the one frame or VOP based on the determination in the encoding condition analysis step ,
The encoding condition analysis step includes:
When it is determined that the average quantization parameter value of the frame or VOP that was intra-encoded just before is larger than the average quantization parameter value of the frame or VOP that was inter-encoded just before the first predetermined value Is
A moving image coding method, wherein a code amount is increased when determining the target code amount .
符号化されたフレーム又はVOPについてシーンチェンジを検出するステップをさらに有し、
前記符号化条件解析ステップは、
前記直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値が、前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値より第1の所定値以上大きくはなく、かつ、
直前に符号化されたフレーム又はVOPについてシーンチェンジが検出されたときは、
前記目標符号量の決定に当たり符号量の割増しを行わない
ことを特徴とする請求項6に記載の動画像符号化方法。
Further have a step of detecting a scene change for the encoded frame or VOP,
The encoding condition analysis step includes:
The average quantization parameter value of the frame or VOP that was intra-encoded just before is not greater than the first predetermined value than the average quantization parameter value of the frame or VOP that was inter-encoded just before, and ,
When a scene change is detected for the frame or VOP encoded immediately before,
7. The moving picture encoding method according to claim 6 , wherein an extra code amount is not performed in determining the target code amount .
前記符号化条件解析ステップは、
前記直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値が、前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値より第1の所定値以上大きくはなく、かつ、
前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値が第2の所定値以上であるときは、
目標符号量の決定に当たり、符号量の割増しを行わないことを特徴とする請求項6に記載の動画像符号化方法。
The encoding condition analysis step includes:
The average quantization parameter value of the frame or VOP that was intra-encoded just before is not greater than the first predetermined value than the average quantization parameter value of the frame or VOP that was inter-encoded immediately before, and ,
When the average quantization parameter value of the frame or VOP that has been inter-frame encoded immediately before is equal to or greater than a second predetermined value,
7. The moving picture coding method according to claim 6 , wherein the code amount is not increased when determining the target code amount.
前記符号化条件解析ステップは、
前記直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値が、前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値より第1の所定値以上大きくはなく、かつ、
前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値が直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値より第3の所定値以上大きいときは、
目標符号量の決定に当たり符号量の割増しを行わないことを決定することを特徴とする請求項6に記載の動画像符号化方法。
The encoding condition analysis step includes:
The average quantization parameter value of the frame or VOP that was intra-encoded just before is not greater than the first predetermined value than the average quantization parameter value of the frame or VOP that was inter-encoded just before, and ,
When the average quantization parameter value of the frame or VOP that has been inter-frame encoded immediately before is larger than the average quantization parameter value of the frame or VOP that has been intra-frame encoded immediately before by a third predetermined value,
7. The moving picture encoding method according to claim 6 , wherein it is determined not to increase the code amount when determining the target code amount.
前記符号化条件解析ステップは、
直前に符号化されたフレーム又はVOPについてシーンチェンジが検出されず、かつ、
前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値が第2の所定値以上ではなく、かつ、
前記直前に画面間符号化されたフレーム又はVOPの平均量子化パラメータ値が直前に画面内符号化されたフレーム又はVOPの平均量子化パラメータ値より第3の所定値以上大きくはないときは、
目標符号量の決定に当たり符号量の割増しを行うことを特徴とする請求項7に記載の動画像符号化方法。
The encoding condition analysis step includes:
No scene change is detected for the frame or VOP encoded immediately before, and
The average quantization parameter value of the frame or VOP that has been inter-coded immediately before is not equal to or greater than a second predetermined value, and
When the average quantization parameter value of the frame or VOP encoded immediately before the screen is not greater than the third predetermined value than the average quantization parameter value of the frame or VOP encoded immediately before the screen,
8. The moving picture encoding method according to claim 7 , wherein a code amount is increased when determining the target code amount.
JP2004209500A 2004-07-16 2004-07-16 Moving picture coding apparatus and moving picture coding method Expired - Fee Related JP3970267B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004209500A JP3970267B2 (en) 2004-07-16 2004-07-16 Moving picture coding apparatus and moving picture coding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004209500A JP3970267B2 (en) 2004-07-16 2004-07-16 Moving picture coding apparatus and moving picture coding method

Publications (2)

Publication Number Publication Date
JP2006033426A JP2006033426A (en) 2006-02-02
JP3970267B2 true JP3970267B2 (en) 2007-09-05

Family

ID=35899241

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004209500A Expired - Fee Related JP3970267B2 (en) 2004-07-16 2004-07-16 Moving picture coding apparatus and moving picture coding method

Country Status (1)

Country Link
JP (1) JP3970267B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8542730B2 (en) 2008-02-22 2013-09-24 Qualcomm, Incorporated Fast macroblock delta QP decision
JP5930781B2 (en) * 2012-03-12 2016-06-08 株式会社メガチップス Image processing device

Also Published As

Publication number Publication date
JP2006033426A (en) 2006-02-02

Similar Documents

Publication Publication Date Title
US8218627B2 (en) Scalable MPEG video/macro block rate control
US6819714B2 (en) Video encoding apparatus that adjusts code amount by skipping encoding of image data
US6804301B2 (en) First pass encoding of I and P-frame complexity for compressed digital video
US8160139B2 (en) Adaptive quantizer, adaptive quantization method and adaptive quantization program
US8374236B2 (en) Method and apparatus for improving the average image refresh rate in a compressed video bitstream
JP4007594B2 (en) Moving picture coding apparatus and method, moving picture coding system conversion apparatus and method
KR101439484B1 (en) Method and apparatus for decording video considering noise
JP2001169281A (en) Device and method for encoding moving image
JP2004274236A (en) Encoding apparatus, encoding method, program, and recording medium
US7054364B2 (en) Moving picture encoding apparatus and moving picture encoding method
JP2006135557A (en) Moving picture encoding device
JP3778208B2 (en) Image coding apparatus and image coding method
JP3889013B2 (en) Moving picture coding apparatus and moving picture coding method
JP3970267B2 (en) Moving picture coding apparatus and moving picture coding method
JP4073444B2 (en) Video encoding device
JP3480067B2 (en) Image coding apparatus and method
JP2002010271A (en) Device for coding video
US7133448B2 (en) Method and apparatus for rate control in moving picture video compression
JP4586340B2 (en) Encoding apparatus, encoding method, and program
US6922490B2 (en) Image compression of selected regions based on transmission bit rate, motion, and/or region information, and bit selection before compression based on transmission bit rate
JP4718736B2 (en) Video encoding device
JP3428332B2 (en) Image encoding method and apparatus, and image transmission method
JP2005303555A (en) Moving image encoding apparatus and its method
JP3690259B2 (en) High-speed moving image encoding apparatus and high-speed moving image encoding method
JPH10126792A (en) Image encoding method and device

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060620

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060726

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070605

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20100615

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110615

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120615

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130615

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees