[go: up one dir, main page]

JP4343667B2 - Image coding apparatus and image coding method - Google Patents

Image coding apparatus and image coding method Download PDF

Info

Publication number
JP4343667B2
JP4343667B2 JP2003409357A JP2003409357A JP4343667B2 JP 4343667 B2 JP4343667 B2 JP 4343667B2 JP 2003409357 A JP2003409357 A JP 2003409357A JP 2003409357 A JP2003409357 A JP 2003409357A JP 4343667 B2 JP4343667 B2 JP 4343667B2
Authority
JP
Japan
Prior art keywords
filter
image
encoding
quantization
block
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
JP2003409357A
Other languages
Japanese (ja)
Other versions
JP2005175621A (en
JP2005175621A5 (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.)
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 JP2003409357A priority Critical patent/JP4343667B2/en
Priority to US11/003,461 priority patent/US20050123038A1/en
Publication of JP2005175621A publication Critical patent/JP2005175621A/en
Publication of JP2005175621A5 publication Critical patent/JP2005175621A5/ja
Application granted granted Critical
Publication of JP4343667B2 publication Critical patent/JP4343667B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

本発明は、動画像を入力して、符号化データを出力するための動画像符号化装置および動画像符号化方法に関するもので、特に、低ビットレートにおいても良好な画質を得ることを可能にする画像符号化装置および画像符号化方法等に関する。   The present invention relates to a moving image encoding apparatus and a moving image encoding method for inputting moving images and outputting encoded data, and in particular, it is possible to obtain good image quality even at a low bit rate. The present invention relates to an image encoding device, an image encoding method, and the like.

近年のデジタル信号処理技術の飛躍的な進歩により、従来ならば困難であった蓄積メディアへの動画像の記録や伝送路を介した動画像の伝送が行われている。この場合に、動画像を構成する各々のフレームは圧縮処理が施されデータ量が大幅に削減されている。この圧縮処理として代表的な手法が、例えば、MPEG(Moving Picture Experts Group)方式として知られている。このMPEG方式に準拠して画像の圧縮、符号化を行う場合、その符号量は、画像自体の特性である空間周波数特性やシーン及び量子化スケール値に応じて大きく異なる場合が多い。このような符号化特性を有する符号化装置を実現する上で良好な画質の復号画像を得ることができるようにするための重要な技術が符号量制御である。   Due to dramatic progress in digital signal processing technology in recent years, recording of moving images on storage media and transmission of moving images via transmission paths, which has been difficult in the past, are performed. In this case, each frame constituting the moving image is subjected to compression processing, and the amount of data is greatly reduced. A typical technique for this compression processing is known as, for example, MPEG (Moving Picture Experts Group). When compressing and encoding an image in accordance with the MPEG system, the amount of code often varies greatly depending on the spatial frequency characteristics, the scene, and the quantization scale value, which are characteristics of the image itself. An important technique for realizing a decoded image with good image quality in realizing an encoding apparatus having such encoding characteristics is code amount control.

この符号量制御アルゴリズムの1つとして、TM5(Test Model 5)(非特許文献1を参照)が知られている。このTM5による符号量制御アルゴリズムは、以下に概説する3つのステップから構成され、GOP(Group of Picture)毎にビット・レートが一定になるように符号量が制御される。   TM5 (Test Model 5) (see Non-Patent Document 1) is known as one of the code amount control algorithms. The code amount control algorithm based on TM5 is composed of the three steps outlined below, and the code amount is controlled so that the bit rate is constant for each GOP (Group of Picture).

[STEP1: Target bit allocation]
STEP1の処理では、符号化を行う次のピクチャの目標符号量を設定する。ここで、STEP1の処理においては、現在のGOPにおいて許容される符号量Rgopが以下の(1)式により演算される(以下の各式において、「*」は乗算を意味するものとする。)。
[STEP1: Target bit allocation]
In step 1, the target code amount of the next picture to be encoded is set. Here, in the processing of STEP1, the code amount Rgop allowed in the current GOP is calculated by the following equation (1) (in the following equations, “*” means multiplication). .

Rgop = (ni+np+nb)*(bits_rate/picture_rate) ・・・(1)
ここで、ni,np,nbはそれぞれI、P、Bピクチャの現GOPにおける残りのピクチャ数であり、bits_rateは目標ビット・レート、picture_rateはピクチャ・レートを表す。更に、I、P、Bピクチャ毎に符号化結果からピクチャの複雑度を以下の(2)式で求めている。
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
ここで、Ri、Rp及びRbはそれぞれI、P、Bピクチャを符号化した結果得られる符号量であり、Qi、Qp及びQbはそれぞれI、P、Bピクチャ内のすべてのマクロ・ブロックにおけるQスケールの参照値である。式(1)及び式(2)から、I、P、Bピクチャそれぞれについての目標符号量Ti、Tp及びTbは、以下の(3)式で求めることができる。
Xi = Ri * Qi
Xp = Rp * Qp (2)
Xb = Rb * Qb
Here, Ri, Rp, and Rb are code amounts obtained as a result of encoding I, P, and B pictures, respectively, and Qi, Qp, and Qb are Q in all macroblocks in the I, P, and B pictures, respectively. Reference value of the scale. From the expressions (1) and (2), the target code amounts Ti, Tp, and Tb for the I, P, and B pictures can be obtained by the following expression (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))}
Tb=max{(Rgop/(Nb+ (Np*Kb*Xp)/(Kp*Xb))) , (bit_rate/(8*picture_rate))}
・・・(3)
ただし、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))}
Tb = max {(Rgop / (Nb + (Np * Kb * Xp) / (Kp * Xb))), (bit_rate / (8 * picture_rate))}
... (3)
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: Rate control]
STEP2では、I、P及びBピクチャ毎に3つの仮想バッファを使用し、式(3)で求めた目標符号量と発生符号量との差分を管理する。仮想バッファのデータ蓄積量をフィードバックし、そのデータ蓄積量に基づいて実際の発生符号量が目標符号量に近づくように、次にエンコードするマクロ・ブロックについて、Qスケールの参照値が設定される。例えば、現在のピクチャタイプがPピクチャの場合には、目標符号量と発生符号量との差分は、次の(4)式に従う演算処理により求めることができる。
[STEP2: Rate control]
In STEP2, three virtual buffers are used for each of I, P, and B pictures, and the difference between the target code amount obtained by Expression (3) and the generated code amount is managed. The data accumulation amount of the virtual buffer is fed back, and the reference value of the Q scale is set for the macro block to be encoded next so that the actual generated code amount approaches the target code amount based on the data accumulation amount. 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はピクチャ内のマクロ・ブロック数を示す。式((4)の関係をグラフに示すと、例示的に図2のようになる。図2において、横軸は、ピクチャ内のマクロ・ブロック数(MB_cnt)であり、縦軸はpピクチャの目標符号量である。図中のDp,jは(4)式で求められる差分値である。
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 in the picture Indicates the number of macro blocks. The relationship of equation (4) is shown in a graph, for example, as shown in Fig. 2. In Fig. 2, the horizontal axis is the number of macro blocks (MB_cnt) in the picture, and the vertical axis is the p picture. Dp, j in the figure is a difference value obtained by equation (4).

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

Qj = (dj*31) / r ・・・(5)
ここで、r = 2*bits_rate/picture_rate ・・・(6)
である。
Qj = (dj * 31) / r (5)
Where r = 2 * bits_rate / picture_rate (6)
It is.

[STEP3:Adaptive Quantization]
STEP3の処理では、視覚特性、即ち、復号画像の画質が良好になるように、エンコード対象のマクロ・ブロックの空間アクティビチィに基づいて、量子化スケールを最終的に決定する処理を実行する。
[STEP3: Adaptive Quantization]
In the process of STEP 3, a process of finally determining the quantization scale is executed based on the spatial activity of the macro block to be encoded so that the visual characteristics, that is, the image quality of the decoded image becomes good.

ACTj = 1+ min(vblk1, vblk2,……,vblk8) ・・・(7)
(7)式中において、vblk1〜vblk4はフレーム構造のマクロ・ブロックにおける8x8のサブ・ブロックにおける空間アクティビチィを示し、vblk5〜vblk8はフィールド構造のマクロ・ブロックにおける8x8サブ・ブロックの空間アクティビチィを示す。ここで、空間アクティビチィの演算は次の(8)、(9)式により求めることが可能である。
ACTj = 1+ min (vblk1, vblk2, ..., vblk8) (7)
In equation (7), vblk1 to vblk4 indicate the spatial activity in the 8 × 8 sub-block in the frame-structured macro block, and vblk5 to vblk8 indicate the spatial activity in the 8 × 8 sub-block in the field-structured macro block. Show. 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)
ここで、Piはi番目のマクロ・ブロックのにおける画素値であり、式(8)、(9)中のΣはi=1〜64の演算である。次に(7)式で求めたACTjを以下の(10)式によって正規化を行う。
vblk = Σ (Pi−Pbar) 2 (8)
Pbar = (1/64) * ΣPi (9)
Here, Pi is a pixel value in the i-th macro block, 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の参照値であり、最終的に量子化スケール(Qスケール値)MQUANTjは以下の(11)式により求められる。
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 (Q scale value) MQUANTj is obtained by the following equation (11).

MQUANTj = Qj * N_ACTj ・・・(11)
以上のTM5のアルゴリズムによれば、STEP1の処理によりIピクチャに対して多くの符号量を割り当ており、更にピクチャ内においては視覚的に劣化の目立ちやすい平坦部(空間アクティビティが低い)に符号量が多く配分されるようになる。
MQUANTj = Qj * N_ACTj (11)
According to the above TM5 algorithm, a large amount of code is assigned to the I picture by the processing of STEP1, and the amount of code is in a flat portion (low spatial activity) that is visually noticeable in the picture. A lot will be allocated.

また、 TM5の課題に対する技術である、特許文献1においては、図3に示すような、ローパスフィルタ(LPF)の遮断周波数のバランス点を求めるために、バランス関数なるものを定義して、量子化歪と画像鮮鋭度劣化との整合を取ることで、TM5における課題の解決を試みている。これは、量子化歪を抑制するために符号化装置に入力される各ピクチャの空間周波数をLPFにより低減することで実現している。図3の2本の曲線は以下の2つの関数F1及びF2に相当する。   In Patent Document 1, which is a technique for the problem of TM5, in order to obtain a balance point of a cutoff frequency of a low-pass filter (LPF) as shown in FIG. 3, a balance function is defined and quantized. Attempting to solve the problem in TM5 by matching the distortion and the degradation of image sharpness. This is realized by reducing the spatial frequency of each picture input to the encoding device with LPF in order to suppress quantization distortion. The two curves in FIG. 3 correspond to the following two functions F1 and F2.

F1(動き量,フィルタ係数, 量子化スケール,符号量)
F2(フィルタ係数,量子化スケール)
関数F1及びF2の交差点をバランス点として、符号量と画質の整合が最も優れている量子化スケールとLPFのフィルタ係数として設定する。
F1 (motion amount, filter coefficient, quantization scale, code amount)
F2 (filter coefficient, quantization scale)
The intersection of the functions F1 and F2 is set as the balance point, and the quantization scale and the LPF filter coefficient with the best matching of the code amount and the image quality are set.

また、特許文献2には、動画像符号化方法として、フィルタ係数を変更する際に、急激な変化を回避する技術が開示されている。
Test Model 5(Test Model Editing Commitee: "Test Model 5", ISO/IEC JTC/SC29/WG11/N0400(Apr.1993)) 特許2894137号公報、「動画像符号化におけるプリフィルタ制御方法及び装置」 特開2002-247576号公報
Patent Document 2 discloses a technique for avoiding a rapid change when changing a filter coefficient as a moving image encoding method.
Test Model 5 (Test Model Editing Commitee: "Test Model 5", ISO / IEC JTC / SC29 / WG11 / N0400 (Apr. 1993)) Japanese Patent No. 2894137, “Prefilter Control Method and Apparatus in Video Coding” JP 2002-247576 A

しかしながら、上述のTM5のアルゴリズムにおいては次のような課題がある。すなわち、最終的なMQUANTjを得るための判断情報として、(4)式における目標符号量と符号量との差分(乖離)以外、式(5)における前ピクチャの符号化結果のQスケール参照値(Qj)と、STEP3の処理における空間アクティビティ(ACTj )のみを使用しており、画質の定量的な劣化具合や人間の視覚特性が、TM5における符号量制御では十分考慮されておらず、符号化状況に応じ人間の視覚特性に合致した符号量制御を行なうという点では困難であった。   However, the above TM5 algorithm has the following problems. That is, as the determination information for obtaining the final MQUANTj, except for the difference (divergence) between the target code amount and the code amount in equation (4), the Q scale reference value of the previous picture encoding result in equation (5) ( Qj) and the spatial activity (ACTj) in STEP3 processing are used, and the quantitative degradation of image quality and human visual characteristics are not fully considered in the code amount control in TM5. Accordingly, it is difficult to control the amount of code in accordance with human visual characteristics.

また、TM5のアルゴリズムに対する課題を補う特許文献1における技術においても、上記の関数F1において引数である「動き量」を算出するために大規模な回路が必要となること、更には、直前のピクチャの情報のみを使用しているため、シーンチェンジ等の場合にはフィルタの特性が急激に変化してしまい、画質のボケが目立つという課題がある。   Also, in the technology in Patent Document 1 that compensates for the problem with the TM5 algorithm, a large-scale circuit is required to calculate the “motion amount” that is an argument in the function F1. Therefore, in the case of a scene change or the like, there is a problem that the filter characteristics change abruptly and the image quality blur is conspicuous.

動画像符号化方法として、フィルタ係数を変更する際に、急激な変化を回避している解決するための方法を開示する特許文献2によれば、まず符号化難易度Yを以下のとおりI、P及びBピクチャ毎に関数F(12)式を使用して求めている。   According to Patent Document 2 that discloses a method for solving a problem of avoiding a sudden change when changing a filter coefficient as a moving image encoding method, first, encoding difficulty level Y is set as I, The function F (12) is used for each P and B picture.

Y= F(累積符号量,平均Qスケール) ・・・(12)
次にI、P及びBそれぞれについて求めた符号化難易度Yi、Yp及びYbからフィルタ係数パラメータZを(13)式により求める((13)式)。
Y = F (accumulated code amount, average Q scale) (12)
Next, a filter coefficient parameter Z is obtained from the encoding difficulty levels Yi, Yp, and Yb obtained for I, P, and B, respectively, using equation (13) (equation (13)).

Z= (Yi + Yp + Yb)/(bits_rate) ・・・(13)
式(13)により得られたZの値に応じて、図4に示すように予め設定してあるフィルタ係数S0、S1及びS3から選択する。すなわち、各フィルタ係数に対応するZの値に幅をもたせることによって急激なフィルタ係数の変化を回避している。
Z = (Yi + Yp + Yb) / (bits_rate) (13)
Depending on the value of Z obtained by equation (13), selection is made from preset filter coefficients S0, S1, and S3 as shown in FIG. That is, a sudden change in the filter coefficient is avoided by giving a width to the value of Z corresponding to each filter coefficient.

しかしながら、特許文献2による方法は、単純に累積符号量と平均Qスケールだけの情報から予測しているにすぎないので、依然として画質の劣化具合や人間の視覚特性が考慮されているとは言い難い。   However, since the method according to Patent Document 2 simply predicts from information of only the accumulated code amount and the average Q scale, it is still difficult to say that the degradation of image quality and human visual characteristics are still taken into consideration. .

上記課題を鑑みて、本発明は、画質の劣化具合や人間の視覚特性を考慮した動画像符号化装置及び動画像符号化方法を提供することを目的とする。上記課題を解決し、その目的を達成する本発明にかかる動画像符号化装置等は主として以下の構成を有することを特徴とする。   In view of the above problems, an object of the present invention is to provide a moving image encoding apparatus and a moving image encoding method that take into consideration the degradation of image quality and human visual characteristics. The moving picture coding apparatus according to the present invention that solves the above-described problems and achieves the object mainly has the following configuration.

すなわち、画像をブロックに分割し圧縮符号化するブロック符号化手段と、前記圧縮符号化されたデータを復号する復号手段とを有する画像符号化装置は、
フィルタ係数により空間フィルタ特性を可変にするフィルタ手段と、
入力画像を前記フィルタ手段によりフィルタ処理して出力される画像と前記復号手段から出力される復号画像とから、分割されたブロックの境界画素を含み当該境界画素を除く当該ブロック内の全画素を含まない画像の差分を求め、当該差分に基づいて前記復号画像の歪み度を算出する算出手段とを有し、
前記符号化手段は前記フィルタ手段によりフィルタ処理された画像を入力とし、量子化スケールにより量子化特性を可変にする量子化手段と、
前記算出手段の算出結果に応じて、前記フィルタ手段の空間フィルタ特性と、前記量子化手段における量子化特性と、をそれぞれ制御するための前記フィルタ係数と前記量子化スケールとを決定する決定手段とを備え、
前記決定手段は、前記算出手段により算出された前記歪み度に応じて、前記歪み度が大きい程、遮断周波数が低くなように前記フィルタ係数を決定し、
更に、前記決定手段は、前記算出手段により算出された前記歪み度に応じて前記量子化スケールの値を補正するための値を決定することを特徴とする。
That is, an image encoding apparatus having a block encoding unit that divides an image into blocks and performs compression encoding, and a decoding unit that decodes the compression encoded data,
Filter means for varying the spatial filter characteristics by the filter coefficient;
Includes all pixels in the block except for the boundary pixel including the boundary pixel of the divided block from the image output by filtering the input image by the filtering unit and the decoded image output from the decoding unit And calculating means for calculating a difference between the images, and calculating a distortion degree of the decoded image based on the difference,
The encoding means receives an image filtered by the filter means, and a quantization means for varying a quantization characteristic according to a quantization scale;
Determining means for determining the filter coefficient and the quantization scale for controlling the spatial filter characteristic of the filter means and the quantization characteristic of the quantization means, respectively, according to the calculation result of the calculating means; With
Said determining means, in response to the distortion degree calculated by said calculating means, the greater the strain rate, cut-off frequency determines the filter coefficients such that a low,
Further, the determining means determines a value for correcting the value of the quantization scale in accordance with the degree of distortion calculated by the calculating means.

本発明によれば、プリフィルタを用いて符号量を制御するに当たり、直前までのブロック毎に求められたブロック歪み度のレベルに基づき、フィルタ係数及び量子化スケールのうち、少なくとも一方の設定を変えることで、人間の視覚特性を反映した歪みのない高画質な復号画像を得られるためのフィルタ制御、符号量制御を実現することが可能になる。   According to the present invention, when controlling the code amount using the prefilter, the setting of at least one of the filter coefficient and the quantization scale is changed based on the level of block distortion obtained for each previous block. Thus, it is possible to realize filter control and code amount control for obtaining a high-quality decoded image without distortion reflecting human visual characteristics.

以下、本発明の動画像符号化装置及び方法の好適な実施形態を添付図面を参照しつつ説明する。   Preferred embodiments of the moving picture coding apparatus and method of the present invention will be described below with reference to the accompanying drawings.

[第1実施形態]
図1は、本発明にかかる動画像符号化方法を実現する装置の構成を示す動画像符号化装置200のブロック図であり、上述のTM5アルゴリズムを実行することが可能なMPEG符号化ユニット100を利用する構成になっている。MPEG符号化ユニット100は、具体的には、MPEG-1、MPEG-2、MPEG-3或いはMPEG-4規格に対応するものであり、特定の符号化規格に限定するものではない。すなわち、入力画像を量子化する構成(量子化器としてQTZ104に相当する構成)を含む符号化規格であれば本発明にかかる動画像符号化技術を適用することが可能である。
[First embodiment]
FIG. 1 is a block diagram of a moving picture coding apparatus 200 showing the configuration of a device that implements the moving picture coding method according to the present invention, and shows an MPEG coding unit 100 capable of executing the above-described TM5 algorithm. It is configured to use. The MPEG encoding unit 100 specifically corresponds to the MPEG-1, MPEG-2, MPEG-3, or MPEG-4 standards, and is not limited to a specific encoding standard. That is, the moving picture coding technique according to the present invention can be applied to any coding standard that includes a configuration for quantizing an input image (a configuration corresponding to QTZ 104 as a quantizer).

動画像符号化装置200は、更に、ブロック歪み度算出ユニット109と、符号化パラメータ決定ユニット110を備えており、ブロック歪み度算出ユニット109により求められた画像の歪み度に基づいて、符号化パラメータ決定ユニット110は、マクロ・ブロック(MB)毎、または、ピクチャ毎、若しくは、一つのピクチャ内で複数回、量子化スケールMQUANTを決定するための計算を行なう。以下、図1のブロック図と、図5のフローチャートを参照して、動画像符号化処理の流れを具体的に説明する。   The moving image encoding apparatus 200 further includes a block distortion degree calculation unit 109 and an encoding parameter determination unit 110. Based on the distortion degree of the image obtained by the block distortion degree calculation unit 109, the encoding parameter is determined. The determination unit 110 performs calculation for determining the quantization scale MQUANT for each macro block (MB), for each picture, or for a plurality of times within one picture. Hereinafter, the flow of the moving image encoding process will be described in detail with reference to the block diagram of FIG. 1 and the flowchart of FIG.

<全体の動作フローの説明>
図5は、図1の符号化パラメータ決定ユニットにおける処理を説明するフローチャートである。まず、ステップS501において、上述のTM5アルゴリズムのSTEP1を利用するために、量子化スケール(Qスケール値)であるMQUANT及びフィルタ係数値(C_LPF)の初期値を設定する。
<Description of overall operation flow>
FIG. 5 is a flowchart for explaining processing in the coding parameter determination unit of FIG. First, in step S501, in order to use STEP1 of the above-described TM5 algorithm, initial values of a quantization scale (Q scale value) MQUANT and a filter coefficient value (C_LPF) are set.

次に、処理をステップS502に進め、(3)式に従ってピクチャタイプ(I、P、Bピクチャ)それぞれについての目標符号量Ti、Tp及びTbを算出する。本ステップの目標符号量の算出において、符号化を行なう次のピクチャの目標符号量が設定される。図12は、符号化対象ピクチャを例示する図であり、各ピクチャタイプ(I、P、Bピクチャ)の画像をここでは、それぞれ、Xi、Xp、Xbとして表している。現GOPを構成するP2ピクチャが次に符号化を行なう対象になるとすると、このピクチャに対する目標符号量が算出される。   Next, the process proceeds to step S502, and target code amounts Ti, Tp, and Tb for the picture types (I, P, and B pictures) are calculated according to equation (3). In calculating the target code amount in this step, the target code amount of the next picture to be encoded is set. FIG. 12 is a diagram illustrating an encoding target picture. Here, images of each picture type (I, P, B picture) are represented as Xi, Xp, and Xb, respectively. Assuming that the P2 picture constituting the current GOP is the next encoding target, the target code amount for this picture is calculated.

次に、処理をステップS503に進め、動画像符号化装置200にマクロ・ブロック(図1中のMB)を入力し、空間フィルタ処理を実施する。ここで、プリフィルタ101の実現方法としては、例えば、図6に示すような3x3正方マトリクスの空間フィルタを使用することが可能である。この場合のC_LPFの値と3x3正方マトリクスのフィルタ係数との関係を図7に示す。C_LPF=0の場合は、フィルタの動作がOFFとなり、入力画像(MB)=出力画像となる。また、図7のフィルタ係数の例では、C_LPFの値が大きい程、遮断周波数が低くなるように設定されている。プリフィルタの特性を与えるフィルタ係数を変えることにより、入力されるマクロ・ブロックに対する空間フィルタリング処理を所定の撮影モードに合うように制御することが可能になる。例えば、符号化パラメータ決定ユニット110は、求められたブロック歪み度、目標符号量と現在までの累積符号量の乖離から、ブロック歪みが発生すると判断した時は、プリフィルタの特性の通過帯域を現在よりも低周波領域に設定する。   Next, the process proceeds to step S503, where a macro block (MB in FIG. 1) is input to the moving picture coding apparatus 200, and spatial filter processing is performed. Here, as a method for realizing the pre-filter 101, for example, a spatial filter of a 3 × 3 square matrix as shown in FIG. 6 can be used. FIG. 7 shows the relationship between the value of C_LPF and the filter coefficient of the 3 × 3 square matrix in this case. When C_LPF = 0, the filter operation is turned OFF, and the input image (MB) = the output image. In the example of the filter coefficient in FIG. 7, the cutoff frequency is set to be lower as the value of C_LPF is larger. By changing the filter coefficient that gives the characteristics of the pre-filter, it is possible to control the spatial filtering processing for the input macro block so as to match a predetermined photographing mode. For example, when the encoding parameter determination unit 110 determines that block distortion occurs from the obtained block distortion degree, the difference between the target code amount and the accumulated code amount up to the present time, the encoding parameter determination unit 110 sets the passband of the prefilter characteristics as the current Set to a lower frequency region.

ここで、入力される符号化前のマクロブロック(MB)は、後に説明するブロック歪み算出のために、空間フィルタ処理がなされた後、ブロック歪み度算出ユニット109に入力される。ブロック歪み度算出ユニット109における処理は、後に詳述する。   Here, the input pre-coding macroblock (MB) is subjected to spatial filter processing for block distortion calculation described later, and then input to the block distortion degree calculation unit 109. The processing in the block distortion degree calculation unit 109 will be described in detail later.

ステップS504において、先のステップS501で初期値として設定された量子化スケール(MQUANT)の値を用いてMPEG符号化ユニット100が、離散コサイン変換(103)されたマクロ・ブロックを、量子化(104)して可変長符号化データ(105)を生成する。尚、MPEG符号化ユニット100については、MPEG符号化方式の規格に準拠した処理で実現することが可能であるので、動き予測(102)及び動き補償(108)に関するユニットを含め、ここでは各ユニットに関する具体的な説明は省略する。   In step S504, the MPEG coding unit 100 uses the quantization scale (MQUANT) value set as the initial value in the previous step S501 to quantize (104) the macro block subjected to the discrete cosine transform (103). ) To generate variable length encoded data (105). Note that the MPEG encoding unit 100 can be realized by processing conforming to the MPEG encoding standard, and therefore includes units relating to motion prediction (102) and motion compensation (108). The specific description about is omitted.

次に、処理をステップS505に進め、ステップS504の処理により生成された符号化データを局所復号化ユニット111に入力して、IQTZ106、IDCT107により逆変換処理を行なって復号データを生成する。尚、局所復号化ユニット111については、MPEG符号化方式の規格に準拠した処理で実現することが可能であるので、ここでは各ユニットに関する具体的な説明は省略する。   Next, the process proceeds to step S505, and the encoded data generated by the process of step S504 is input to the local decoding unit 111, and reverse conversion processing is performed by IQTZ 106 and IDCT 107 to generate decoded data. Note that the local decoding unit 111 can be realized by processing conforming to the MPEG encoding standard, and therefore a specific description of each unit is omitted here.

図13は、ブロック歪み度算出ユニット109の構成を示すブロック図でありる。ステップS506において、ブロック歪み度算出ユニット109により、符号化前のマクロ・ブロック(ステップS503で、空間フィルタ処理後のマクロ・ブロックがブロック歪み度算出ユニット109の符号化前データ格納部109aに格納されている。)と、復号化データ入力部109bを介して入力した局所復号化ユニット111で復号されたマクロ・ブロックとを比較して、ブロック歪み度演算ユニット109cは、MPEG処理により生じた画像の歪みを評価するパラメータとして、ブロック歪み度を演算する。ブロック歪み度の計算方法としては、例えば、次の2つの方法を用いることができる。   FIG. 13 is a block diagram showing a configuration of the block distortion degree calculation unit 109. In step S506, the block distortion degree calculation unit 109 stores the macro block before encoding (in step S503, the macro block after spatial filter processing is stored in the pre-encoding data storage unit 109a of the block distortion degree calculation unit 109. And the macro block decoded by the local decoding unit 111 input via the decoded data input unit 109b, the block distortion degree calculation unit 109c compares the image generated by the MPEG processing. The block distortion degree is calculated as a parameter for evaluating distortion. As a block distortion calculation method, for example, the following two methods can be used.

<方法1>
方法1は、符号化前及び復号化後の2つの画像に対するPSNR(Peak Signal to Noise Ratio)を求める方法であり、MPEG符号化ユニット100への入力画像の輝度成分をPj、局所復号化ユニット111の出力画像の輝度成分をRjとすれば、PNSRは以下の(14)式により求めることができる。
<Method 1>
Method 1 is a method for obtaining a PSNR (Peak Signal to Noise Ratio) for two images before encoding and after decoding. The luminance component of the input image to the MPEG encoding unit 100 is Pj, and the local decoding unit 111 is used. If the luminance component of the output image is Rj, PNSR can be obtained by the following equation (14).

SUM = Σ(Pj - Rj)2 (j = 0 〜255)
PSNR = 20×log10(255/sqrt(SUM/256)) ・・・(14)
(14)式により求まるPSNRを評価することで、入力画像と出力画像の歪み度を相対的に求めることができる。
SUM = Σ (Pj−Rj) 2 (j = 0 to 255)
PSNR = 20 × log10 (255 / sqrt (SUM / 256)) (14)
By evaluating the PSNR obtained from the equation (14), the degree of distortion between the input image and the output image can be obtained relatively.

<方法2>
方法2は、符号化前及び復号化後の2つの画像に関し、それぞれを8x8のブロックとし、この8x8のブロックの境界の各画素について、(15)式による差分和の計算を実行する。図8はマクロ・ブロック(図8(b))と、これを構成する8×8の画素ブロックの境界画素(ハッチングを付して示す(図8(a))を例示的に示す図であり、マクロ・ブロックを構成する4つの8×8のブロックの境界画素各々について、MPEG符号化ユニット100への入力画像の輝度成分(P0j、P1j、P2j、P3j)と、局所復号化ユニット111の出力画像の輝度成分(R0j、R1j、R2j、R3j)、として両者の差分和(BN)は(15)式により求めることができる。
<Method 2>
In Method 2, regarding the two images before encoding and after decoding, each of them is an 8 × 8 block, and a difference sum calculation is performed according to Equation (15) for each pixel at the boundary of the 8 × 8 block. FIG. 8 is a diagram exemplarily showing a macro block (FIG. 8 (b)) and boundary pixels (FIG. 8 (a)) of the 8 × 8 pixel blocks constituting the macro block (FIG. 8 (a)). For each boundary pixel of the four 8 × 8 blocks constituting the macro block, the luminance components (P0j, P1j, P2j, P3j) of the input image to the MPEG encoding unit 100 and the output of the local decoding unit 111 As the luminance components (R0j, R1j, R2j, R3j) of the image, the difference sum (BN) between them can be obtained by the equation (15).

BN=Σ(P0j−R0j)+Σ(P1j−R1j)+Σ(P2j−R2j)+Σ(P3j−R3j)
・・・(15)
(jは、図8の網掛けされた境界画素番号をとる)
ブロック歪み度演算ユニット109cは、上述の方法1または方法2による方法によりブロック歪み度を演算することができる。
BN = Σ (P0j−R0j) + Σ (P1j−R1j) + Σ (P2j−R2j) + Σ (P3j−R3j)
(15)
(J takes the shaded boundary pixel number in FIG. 8)
The block distortion degree calculation unit 109c can calculate the block distortion degree by the method 1 or the method 2 described above.

説明を図5のフローチャートに戻し、ステップS507において、(15)式により求めたブロック歪み度(BN)とMPEG符号化ユニット100におけるVLC(可変長符号化器)105から出力される符号量から、次のマクロ・ブロックに使用すべきフィルタ係数値(C_LPF)及びQスケール値(MQUANT)の値を決定する。この決定処理は、動画像符号化装置200の符号化パラメータ決定ユニット110により実行され、この具体的な処理は、図9〜図11を用いて後に詳述する。   Returning to the flowchart of FIG. 5, in step S507, from the block distortion degree (BN) obtained by the equation (15) and the code amount output from the VLC (variable length encoder) 105 in the MPEG encoding unit 100, The filter coefficient value (C_LPF) and Q scale value (MQUANT) values to be used for the next macro block are determined. This determination process is executed by the encoding parameter determination unit 110 of the moving image encoding apparatus 200, and this specific process will be described in detail later with reference to FIGS.

以上のステップS502〜S507までの処理をピクチャ内のすべてのマクロ・ブロックに対して繰り返し行うことによって(S508、S509)、符号量の制御を実現することができる。また、上述の処理の繰り返しは、 マクロ・ブロック(MB)毎、または、ピクチャ毎、若しくは、一つのピクチャ内で複数回行なうように設定するようにしてもよい。   By repeating the above-described steps S502 to S507 for all the macro blocks in the picture (S508, S509), the code amount can be controlled. Further, the above processing may be repeated for each macro block (MB), for each picture, or for a plurality of times within one picture.

<符号化パラメータ決定手段の動作説明>
次に、図5におけるステップS507に関し、図9のフローチャートを用いて処理の流れを具体的に説明する。ステップS507を実行する符号化パラメータ決定ユニット110は、図14に示すように符号化パラメータ算出部110aと、フィルタ係数決定部110b、量子化スケール決定部110cを有しており、符号化パラメータ算出部110aは、ブロック歪み度の演算結果、符号量、目標ビットレートを入力値として、動画像符号化に用いる符号化パラメータを算出する。そして、この算出結果に基づいて、フィルタ係数決定部110b及び量子化スケール決定部110cは、それぞれ、プリフィルタ101に設定するフィルタ係数(C_LPF)、量子化器(QTZ)104に設定する量子化スケール(Qスケール)MQUANTを決定する。
<Description of operation of encoding parameter determination means>
Next, regarding step S507 in FIG. 5, the flow of processing will be specifically described with reference to the flowchart in FIG. The encoding parameter determination unit 110 that executes step S507 includes an encoding parameter calculation unit 110a, a filter coefficient determination unit 110b, and a quantization scale determination unit 110c as illustrated in FIG. 110a calculates coding parameters used for moving picture coding, using the calculation result of the block distortion degree, the code amount, and the target bit rate as input values. Based on the calculation result, the filter coefficient determination unit 110b and the quantization scale determination unit 110c respectively set the filter coefficient (C_LPF) set in the prefilter 101 and the quantization scale set in the quantizer (QTZ) 104. (Q scale) Determine MQUANT.

図9のステップS901において、符号化パラメータ算出部110aは、ブロック歪み度の値(BN)に基づき、図10で示すように3つの領域に対応するAREA変数(0〜2)を取得する。ここで、ブロック歪み度(BN)の値は(15)(式)から1画素を8ビットで表現する場合には0〜28560までの値を取る。図10における、C_BN0、C_BN1は、歪み度(BN)を3つのAREAに分割するための設定値であり、これらの設定値と演算により求められた歪み度(BN)との大小関係を以下に示すように比較して、歪み度(BN)がどのAREAに対応するのかを、符号化パラメータ算出部110aは求める(S1〜S6)。   In step S901 in FIG. 9, the encoding parameter calculation unit 110a acquires the AREA variables (0 to 2) corresponding to the three areas as shown in FIG. 10 based on the block distortion degree value (BN). Here, the value of the block distortion degree (BN) takes a value from 0 to 28560 when one pixel is expressed by 8 bits from (15) (expression). C_BN0 and C_BN1 in FIG. 10 are setting values for dividing the distortion degree (BN) into three AREAs, and the magnitude relationship between these setting values and the distortion degree (BN) obtained by calculation is as follows. As shown, the encoding parameter calculation unit 110a determines which AREA the distortion degree (BN) corresponds to (S1 to S6).

IF(BN < C_BN0) THEN (S1)
AREA =0 (S2)
ELSE IF(BN < C_BN1) THEN (S3)
AREA =1 (S4)
ELSE (S5)
AREA =2 ただし(C_BN1≧C_BN0) (S6)
このとき、AREAを分割する基準値C_BN0、C_BN1は入力画像を本発明の実施形態にかかる動画像符号化装置200に入力する前に予め設定しておくものとする。次に求められた各AREAに応じて、符号化パラメータ算出部110aは、以下の処理を実行する。
IF (BN <C_BN0) THEN (S1)
AREA = 0 (S2)
ELSE IF (BN <C_BN1) THEN (S3)
AREA = 1 (S4)
ELSE (S5)
AREA = 2 (C_BN1 ≧ C_BN0) (S6)
At this time, the reference values C_BN0 and C_BN1 for dividing the AREA are set in advance before the input image is input to the moving image encoding apparatus 200 according to the embodiment of the present invention. Next, the encoding parameter calculation unit 110a executes the following processing according to each obtained AREA.

ステップS902において、AREA=0の場合(S902−Yes)、処理をステップS906に進める。このとき、フィルタ係数決定部110b及び量子化スケール決定部110cは、直前のマクロ・ブロックのブロック歪み度BNの値が小さいことからプリフィルタによる空間フィルタ処理及びTM5のアルゴリズムのSTEP2で求める量子化スケールの参照値Qj((6)式を参照)の値をそのまま使用して量子化スケールMQUANTとする。   In step S902, if AREA = 0 (S902-Yes), the process proceeds to step S906. At this time, since the filter coefficient determination unit 110b and the quantization scale determination unit 110c have a small value of the block distortion degree BN of the immediately preceding macro block, the quantization scale obtained by STEP2 of the spatial filter processing by the prefilter and the TM5 algorithm The value of the reference value Qj (see equation (6)) is used as it is to obtain the quantization scale MQUANT.

ステップS903において、AREA=1の場合(S903−Yes)、処理をステップS904に進め、AREA1をパラメータC_BN2(図10(b)を参照)により更に2つの領域に分割する。符号化パラメータ算出部110aは、ブロック歪みが視覚的に目立つ程度に発生するか否かを次の方法で予測する(S7〜S14)。   In step S903, if AREA = 1 (S903-Yes), the process proceeds to step S904, and AREA1 is further divided into two regions by parameter C_BN2 (see FIG. 10B). The encoding parameter calculation unit 110a predicts whether or not the block distortion is visually noticeable by the following method (S7 to S14).

IF(BN < C_BN2) THEN (S7)
WARN_BN = 0 (S8)
ELSE (S9)
IF(WRAN_BN_COUNT > C_BN_COUNT) THEN (S10)
WARN_BN = 1 (S11)
ELSE (S12)
WARN_BN = 0 (S13)
(C_BN1≧C_BN2≧C_BN0) (S14)
ここで、AREA=1を更に2つの領域に分割するパラメータC_BN2はパラメータC_BN0及びC_BN1と同様に予め設定するものとする。また、WARN_BNは、ブロック歪み度が大きく警告状態にあることを特定するためのパラメータであり、図9のステップS905において、符号化パラメータ算出部110aは、このパラメータの値を判定する。
IF (BN <C_BN2) THEN (S7)
WARN_BN = 0 (S8)
ELSE (S9)
IF (WRAN_BN_COUNT> C_BN_COUNT) THEN (S10)
WARN_BN = 1 (S11)
ELSE (S12)
WARN_BN = 0 (S13)
(C_BN1 ≧ C_BN2 ≧ C_BN0) (S14)
Here, the parameter C_BN2 for further dividing AREA = 1 into two regions is set in advance in the same manner as the parameters C_BN0 and C_BN1. WARN_BN is a parameter for specifying that the degree of block distortion is large and is in a warning state. In step S905 of FIG. 9, the encoding parameter calculation unit 110a determines the value of this parameter.

WARN_BN=0である場合(S905−No)には、AREA=0の場合と同様の処理を行い(S906)、WARN_BN=1の場合には、AREA=0と同様の処理を行うか否かの判断を行う。   If WARN_BN = 0 (S905-No), the same processing as in AREA = 0 is performed (S906). If WARN_BN = 1, whether to perform the same processing as in AREA = 0 or not. Make a decision.

ここでは、過去におけるマクロ・ブロックに対する水平方向の1走査分におけるBNの値がC_BN2の値より大きかった回数を「WARN_BN_COUNT」として、予め設定した定数C_BN_COUNTより大きいか否かで判定を行う。WARN_BN=0の場合(S905−No)、は処理をステップS906に進め、WARN_BN=1の場合(S905−Yes)には、ブロック歪み度が大きく、警告状態にあるとしてプリフィルタ101のフィルタ係数を変更するように係数の設定を行なう(S907)。ステップS907では、ブロック歪み度を小さくするようにフィルタ係数(C_LPF)の値を変更するための処理を行ない、量子化スケール(MQUANT)は、ステップS906と同様に、量子化スケールの参照値Qjの値をそのまま使用して量子化スケールMQUANTとする。   Here, the number of times that the BN value in one horizontal scan for the macro block in the past is larger than the value of C_BN2 is set as “WARN_BN_COUNT”, and the determination is made based on whether or not it is larger than a preset constant C_BN_COUNT. If WARN_BN = 0 (S905-No), the process proceeds to step S906, and if WARN_BN = 1 (S905-Yes), the filter coefficient of the pre-filter 101 is determined to be in a warning state because the degree of block distortion is large. Coefficients are set so as to be changed (S907). In step S907, processing for changing the value of the filter coefficient (C_LPF) so as to reduce the block distortion is performed, and the quantization scale (MQUANT) is set to the quantization scale reference value Qj in the same manner as in step S906. The value is used as it is to obtain the quantization scale MQUANT.

フィルタ係数決定部110bは、フィルタ係数(C_LPF)を求める関数GET_F(BN)と図11(a)に示すデータテーブルにより、ブロック歪み度(BN)とパラメータC_BNi(i=2〜5)との関係を求め、対応するフィルタ係数(C_LPF)を特定する。ここで、特定されたフィルタ係数(C_LPF)がプリフィルタ101に設定される(S907)。   The filter coefficient determination unit 110b uses the function GET_F (BN) for obtaining the filter coefficient (C_LPF) and the relationship between the block distortion degree (BN) and the parameter C_BNi (i = 2 to 5) based on the data table shown in FIG. And the corresponding filter coefficient (C_LPF) is specified. Here, the specified filter coefficient (C_LPF) is set in the pre-filter 101 (S907).

尚、ブロック歪み度(BN)≦C_BN2の場合は、ステップS906の処理と同様となり、この場合はフィルタ係数C_LPF=0となる。   Note that when the degree of block distortion (BN) ≦ C_BN2, the processing is the same as that in step S906, and in this case, the filter coefficient C_LPF = 0.

また、C_BN1<ブロック歪み度(BN)の場合は、後に説明するステップS908におけるAREA2の処理と同様となる。   If C_BN1 <block distortion (BN), the processing is the same as that of AREA2 in step S908 described later.

このようにブロック歪み度が警告すべき状態であるか否かを判定することで、視覚的に目立つブロック歪みの発生を予め回避することが可能となる。   By determining whether or not the degree of block distortion should be warned in this way, it is possible to avoid in advance occurrence of visually noticeable block distortion.

一方、ステップS903の処理でAREA=2にブロック歪み度(BN)が該当する場合(S903−No)、処理をステップS908に進める。このAREAはブロック歪み度(BN)が大きい領域であるので、ここでは、空間フィルタ処理を変更するためのフィルタ係数の設定に加えて、量子化スケール(MQUANT)の変更を行なう。フィルタ係数の設定は、ステップS907における処理と同様に、フィルタ係数決定部110bが図11(b)のようなデータテーブルを用いて、対応するブロック歪み度(BN)に応じたフィルタ係数値(C_LPF)=Ci(i=1〜4)を特定し、プリフィルタ101に設定する。ここで設定されるフィルタ係数は、算出されたブロック歪み度のレベルが大きくなるにつれて、低周波領域の通過帯域の特性を実現するように設定される。   On the other hand, if the block distortion degree (BN) corresponds to AREA = 2 in the process of step S903 (S903-No), the process proceeds to step S908. Since this AREA is an area where the degree of block distortion (BN) is large, the quantization scale (MQUANT) is changed here in addition to the setting of the filter coefficient for changing the spatial filter processing. As with the processing in step S907, the filter coefficient setting unit 110b uses the data table as shown in FIG. 11B to set the filter coefficient value (C_LPF) corresponding to the corresponding block distortion degree (BN). ) = Ci (i = 1 to 4) is specified and set in the pre-filter 101. The filter coefficient set here is set so as to realize the characteristics of the pass band in the low frequency region as the calculated block distortion level increases.

また、量子化スケール決定部110cは、TM5のアルゴリズムのSTEP2で求めた量子化スケールの参照値Qjに対して、更に、図11(b)に示すような定数ADD_Qi(i=1〜4)をブロック歪み度(BN)に応じて特定する。ここで特定された定数ADD_Qiが量子化スケールの参照値Qjに加算され、量子化器(QTZ)104に設定される。ここで量子化スケールの参照値Qjは、TM5のアルゴリズムにおけるSTEP2において(4)式及び(5)式により与えられ、目標符号量(目標ビットレート)とMPEG符号化装置100におけるVLC105より出力される符号量に基づいて演算されるものである。この参照値Qjにブロック歪み度の値のレベルに応じた値(ADD_Qi(i=1〜4))が加算されることにより量子化スケールが変更され、次のピクチャに対する符号量制御にブロック歪の情報が反映される。   Further, the quantization scale determining unit 110c further adds a constant ADD_Qi (i = 1 to 4) as shown in FIG. 11B to the quantization scale reference value Qj obtained in STEP2 of the TM5 algorithm. It is specified according to the block distortion (BN). The constant ADD_Qi specified here is added to the reference value Qj of the quantization scale and set in the quantizer (QTZ) 104. Here, the reference value Qj of the quantization scale is given by the equations (4) and (5) in STEP 2 in the TM5 algorithm, and is output from the target code amount (target bit rate) and the VLC 105 in the MPEG encoding device 100. It is calculated based on the code amount. The quantization scale is changed by adding a value (ADD_Qi (i = 1 to 4)) corresponding to the level of the block distortion value to this reference value Qj, and the block distortion is controlled in the code amount control for the next picture. Information is reflected.

尚、図11(a),(b)におけるパラメータC_BN3〜C_BN8は、AREAを分割するためのパラメータC_BN0及びC_BN1と同様に予め設定するものとする。このようにしてブロック歪み度が大きい領域にある場合、フィルタ係数と量子化スケールとを変更して、視覚的に目立つブロック歪みの発生を予め効果的に回避することが可能になる。   Note that the parameters C_BN3 to C_BN8 in FIGS. 11A and 11B are set in advance in the same manner as the parameters C_BN0 and C_BN1 for dividing the AREA. In this way, when the block distortion degree is in a large region, it is possible to effectively avoid the occurrence of visually noticeable block distortion in advance by changing the filter coefficient and the quantization scale.

以上説明したように、本実施形態によれば、プリフィルタを用いて符号量を制御するに当たり、直前までのブロック毎に求められたブロック歪み度のレベルに基づき、フィルタ係数及び量子化スケールのうち、少なくとも一方の設定を変えることで、人間の視覚特性を反映した歪みのない高画質な復号画像を得られるためのフィルタ制御、符号量制御を実現することが可能になる。   As described above, according to the present embodiment, when controlling the code amount using the pre-filter, based on the level of block distortion obtained for each previous block, the filter coefficient and the quantization scale are used. By changing at least one of the settings, it is possible to realize filter control and code amount control for obtaining a high-quality decoded image without distortion that reflects human visual characteristics.

[その他の実施形態]
また、本発明の目的は前述したように、実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体をシステムあるいは装置に提供し、そのシステムあるいは装置のコンピュータ(またはCPUやMPU)が記憶媒体に格納されたプログラムコードを読み出し実行することによっても達成されることは言うまでもない。この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本発明を構成することになる。
[Other Embodiments]
In addition, as described above, the object of the present invention is to provide a storage medium storing a program code of software that realizes the functions of the embodiment to a system or apparatus, and the computer of the system or apparatus (or CPU or MPU) stores it. Needless to say, this can also be achieved by reading and executing the program code stored in the medium. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the program code constitutes the present invention.

プログラムコードを供給するための記憶媒体としては、例えば、フロッピー(登録商標)ディスク、ハードディスク、光ディスク、光磁気ディスク、CD-ROM、CD-R、磁気テープ、不揮発性のメモリカード、ROMなどを用いることができる。   As a storage medium for supplying the program code, for example, a floppy (registered trademark) disk, hard disk, optical disk, magneto-optical disk, CD-ROM, CD-R, magnetic tape, nonvolatile memory card, ROM or the like is used. be able to.

また、コンピュータが読み出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOS(オペレーティングシステム)などが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれていることは言うまでもない。   Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an OS (operating system) running on the computer based on the instruction of the program code. Needless to say, some or all of the actual processing is performed and the functions of the above-described embodiments are realized by the processing.

さらに、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書きこまれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含むことは言うまでもない。   Furthermore, after the program code read from the storage medium is written to the memory provided in the function expansion board inserted into the computer or the function expansion unit connected to the computer, the function is based on the instruction of the program code. It goes without saying that the CPU or the like provided in the expansion board or the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.

本発明にかかる動画像符号化方法を実現する装置の構成を示す動画像符号化装置200のブロック図である。It is a block diagram of the moving image encoder 200 which shows the structure of the apparatus which implement | achieves the moving image encoding method concerning this invention. 符号量制御アルゴリズム(TM5)のSTEP2を説明する図である。It is a figure explaining STEP2 of a code amount control algorithm (TM5). 特許文献1において示されるバランス関数を説明する図である。It is a figure explaining the balance function shown in patent documents 1. 従来技術におけるフィルタ係数を決定するための処理を説明する図である。It is a figure explaining the process for determining the filter coefficient in a prior art. 本発明の実施形態にかかる動画像符号化処理の流れを説明するフローチャートである。It is a flowchart explaining the flow of the moving image encoding process concerning embodiment of this invention. 3x3正方マトリクスの空間フィルタを例示する図である。It is a figure which illustrates the spatial filter of 3x3 square matrix. フィルタ係数(C_LPF)の値と3x3正方マトリクスのフィルタ係数との関係を示す図である。It is a figure which shows the relationship between the value of a filter coefficient (C_LPF), and the filter coefficient of a 3x3 square matrix. マクロ・ブロックと、これを構成する8×8の画素ブロックの境界画素を例示的に示す図である。It is a figure which shows illustratively the boundary pixel of a macroblock and the 8x8 pixel block which comprises this. 本発明の実施形態にかかる符号化パラメータの決定処理を説明するフローチャートである。It is a flowchart explaining the determination process of the encoding parameter concerning embodiment of this invention. ブロック歪み度BNを分類する3つの領域(AREA)を説明する図である。It is a figure explaining three area | regions (AREA) which classify | categorize block distortion degree BN. ブロック歪み度(BN)に対応した、フィルタ係数(C_LPF)および量子化スケール値(Q)に加算するための定数(ADD_Q)の関係を示すデーテーブルの構成を例示する図である。It is a figure which illustrates the structure of the data table which shows the relationship of the constant (ADD_Q) for adding to a filter coefficient (C_LPF) and quantization scale value (Q) corresponding to a block distortion degree (BN). 符号化対象ピクチャを例示する図である。It is a figure which illustrates the encoding object picture. ブロック歪み度算出ユニット109の構成を示すブロック図である。3 is a block diagram showing a configuration of a block distortion degree calculation unit 109. FIG. 符号化パラメータ決定ユニット110の構成を示すブロック図である。2 is a block diagram showing a configuration of an encoding parameter determination unit 110. FIG.

Claims (4)

画像をブロックに分割し圧縮符号化するブロック符号化手段と、前記圧縮符号化されたデータを復号する復号手段とを有する画像符号化装置において、
フィルタ係数により空間フィルタ特性を可変にするフィルタ手段と、
入力画像を前記フィルタ手段によりフィルタ処理して出力される画像と前記復号手段から出力される復号画像とから、分割されたブロックの境界画素を含み当該境界画素を除く当該ブロック内の全画素を含まない画像の差分を求め、当該差分に基づいて前記復号画像の歪み度を算出する算出手段とを有し、
前記符号化手段は前記フィルタ手段によりフィルタ処理された画像を入力とし、量子化スケールにより量子化特性を可変にする量子化手段と、
前記算出手段の算出結果に応じて、前記フィルタ手段の空間フィルタ特性と、前記量子化手段における量子化特性と、をそれぞれ制御するための前記フィルタ係数と前記量子化スケールとを決定する決定手段とを備え、
前記決定手段は、前記算出手段により算出された前記歪み度に応じて、前記歪み度が大きい程、遮断周波数が低くなように前記フィルタ係数を決定し、
更に、前記決定手段は、前記算出手段により算出された前記歪み度に応じて前記量子化スケールの値を補正するための値を決定する
ことを特徴とする画像符号化装置。
In an image encoding apparatus having block encoding means for dividing an image into blocks and compression encoding, and decoding means for decoding the compression encoded data,
Filter means for varying the spatial filter characteristics by the filter coefficient;
Includes all pixels in the block except for the boundary pixel including the boundary pixel of the divided block from the image output by filtering the input image by the filtering unit and the decoded image output from the decoding unit And calculating means for calculating a difference between the images, and calculating a distortion degree of the decoded image based on the difference,
The encoding means receives an image filtered by the filter means, and a quantization means for varying a quantization characteristic according to a quantization scale;
Determining means for determining the filter coefficient and the quantization scale for controlling the spatial filter characteristic of the filter means and the quantization characteristic of the quantization means, respectively, according to the calculation result of the calculating means; With
Said determining means, in response to the distortion degree calculated by said calculating means, the greater the strain rate, cut-off frequency determines the filter coefficients such that a low,
Furthermore, the determination means determines a value for correcting the value of the quantization scale according to the degree of distortion calculated by the calculation means.
画像をブロックに分割し圧縮符号化するブロック符号化工程と、前記圧縮符号化されたデータを復号する復号工程とを有する画像符号化方法であって、
フィルタ係数により空間フィルタ特性を可変にするフィルタ工程と、
入力画像を前記フィルタ工程によりフィルタ処理して出力される画像と、前記復号工程から出力される復号画像とから、分割されたブロックの境界画素を含み当該境界画素を除く当該ブロック内の全画素を含まない画像の差分を求め、当該差分に基づいて前記復号画像の歪み度を算出する算出工程とを有し、
前記符号化工程は前記フィルタ工程でフィルタ処理された画像を入力とし、量子化スケールにより量子化特性を可変にする量子化工程と、
前記算出工程の算出結果に応じて、前記フィルタ工程の空間フィルタ特性と、前記量子化工程における量子化特性と、をそれぞれ制御するための前記フィルタ係数と前記量子化スケールとを決定する決定工程とを有し、
前記決定工程は、前記算出工程で算出された前記歪み度に応じて、前記歪み度が大きい程、遮断周波数が低くなように前記フィルタ係数を決定し、
更に、前記決定工程は、前記算出工程で算出された前記歪み度に応じて前記量子化スケールの値を補正するための値を決定する
ことを特徴とする画像符号化方法。
An image encoding method comprising a block encoding step of dividing an image into blocks and compression encoding, and a decoding step of decoding the compression encoded data,
A filter step for varying the spatial filter characteristics by the filter coefficient;
From the image output by filtering the input image by the filtering step and the decoded image output from the decoding step, all pixels in the block including the boundary pixels of the divided block and excluding the boundary pixels are obtained. Calculating a difference between images not included, and calculating a distortion degree of the decoded image based on the difference,
The encoding step takes the image filtered in the filter step as an input, and a quantization step for varying a quantization characteristic by a quantization scale;
A determination step for determining the filter coefficient and the quantization scale for controlling the spatial filter characteristic of the filter step and the quantization characteristic in the quantization step, respectively, according to the calculation result of the calculation step; Have
The determination step in response to the distortion degree calculated in said calculation step, the greater the strain rate, cut-off frequency determines the filter coefficients such that a low,
Furthermore, the determination step determines a value for correcting the value of the quantization scale in accordance with the degree of distortion calculated in the calculation step.
請求項2に記載の画像符号化方法をコンピュータによって実行させることを特徴とするプログラム。   A program causing a computer to execute the image encoding method according to claim 2. 請求項2に記載の画像符号化方法をコンピュータによって実行させるためのプログラムを格納したことを特徴とするコンピュータ可読の記憶媒体。   A computer-readable storage medium storing a program for causing a computer to execute the image encoding method according to claim 2.
JP2003409357A 2003-12-08 2003-12-08 Image coding apparatus and image coding method Expired - Fee Related JP4343667B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2003409357A JP4343667B2 (en) 2003-12-08 2003-12-08 Image coding apparatus and image coding method
US11/003,461 US20050123038A1 (en) 2003-12-08 2004-12-06 Moving image encoding apparatus and moving image encoding method, program, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003409357A JP4343667B2 (en) 2003-12-08 2003-12-08 Image coding apparatus and image coding method

Publications (3)

Publication Number Publication Date
JP2005175621A JP2005175621A (en) 2005-06-30
JP2005175621A5 JP2005175621A5 (en) 2007-02-08
JP4343667B2 true JP4343667B2 (en) 2009-10-14

Family

ID=34730767

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003409357A Expired - Fee Related JP4343667B2 (en) 2003-12-08 2003-12-08 Image coding apparatus and image coding method

Country Status (1)

Country Link
JP (1) JP4343667B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007300557A (en) * 2006-05-02 2007-11-15 Canon Inc Image coding apparatus and image coding method
CA2673091C (en) 2006-12-28 2014-03-04 Nippon Telegraph And Telephone Corporation Video processing method and apparatus, video processing program, and storage medium which stores the program
JP5032936B2 (en) * 2007-10-04 2012-09-26 キヤノン株式会社 Video encoding apparatus and control method thereof
JPWO2014171198A1 (en) * 2013-04-19 2017-02-16 リコーイメージング株式会社 Imaging apparatus and imaging control system
JP6796435B2 (en) * 2016-09-14 2020-12-09 日本放送協会 Rate control device, video decoding device, and program
US10708624B1 (en) * 2019-05-30 2020-07-07 Ati Technologies Ulc Pre-processing for video compression

Also Published As

Publication number Publication date
JP2005175621A (en) 2005-06-30

Similar Documents

Publication Publication Date Title
JP5215951B2 (en) Encoding apparatus, control method therefor, and computer program
JP4455487B2 (en) Decoding device, decoding method, and program
KR19990076563A (en) Video coding method
KR20180083389A (en) Video coding method and apparatus
US20130058420A1 (en) Decoding apparatus, decoding method, and computer-readable storage medium
JP5078837B2 (en) Encoding apparatus, encoding apparatus control method, and computer program
JP4343667B2 (en) Image coding apparatus and image coding method
JP7343817B2 (en) Encoding device, encoding method, and encoding program
WO2004075532A2 (en) Method and apparatus for perceptual model based video compression
JP4942208B2 (en) Encoder
JP5006763B2 (en) Image encoding apparatus, control method therefor, and computer program
JP2003069997A (en) Moving picture encoder
JP6694902B2 (en) Video coding apparatus and video coding method
JPH10108197A (en) Image encoding device, image encoding control method, and medium recording image encoding control program
JP2007053620A (en) Image processing apparatus and image processing method
KR20150096353A (en) Image encoding system, image decoding system and providing method thereof
JP5409842B2 (en) Image encoding apparatus, control method therefor, and computer program
JP5419560B2 (en) Imaging device
JP2007300557A (en) Image coding apparatus and image coding method
JPH11331850A (en) Video coding method
JP2009118097A (en) Image encoding apparatus, control method therefor, and computer program
JPH10285589A (en) Image encoding apparatus and method, and computer-readable recording medium recording image encoding control program
JP6985899B2 (en) Image coding device and its control method and program
JP3922581B2 (en) Variable transfer rate encoding method and apparatus
JP4007398B2 (en) Quantization control apparatus and method

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061208

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20061208

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080814

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080825

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081023

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090525

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090609

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

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

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

Free format text: PAYMENT UNTIL: 20120717

Year of fee payment: 3

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

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees