JPH0955939A - Moving picture compression method/device - Google Patents

Moving picture compression method/device

Info

Publication number
JPH0955939A
JPH0955939A JP20410895A JP20410895A JPH0955939A JP H0955939 A JPH0955939 A JP H0955939A JP 20410895 A JP20410895 A JP 20410895A JP 20410895 A JP20410895 A JP 20410895A JP H0955939 A JPH0955939 A JP H0955939A
Authority
JP
Japan
Prior art keywords
image
quantization
data value
picture
orthogonal transform
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.)
Pending
Application number
JP20410895A
Other languages
Japanese (ja)
Inventor
Hideo Arai
英雄 新井
Ryozo Abe
良三 阿部
Toshibumi Sakaguchi
俊文 坂口
Yoshizumi Wataya
由純 綿谷
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.)
GRAPHICS COMMUN LAB KK
Original Assignee
GRAPHICS COMMUN LAB KK
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 GRAPHICS COMMUN LAB KK filed Critical GRAPHICS COMMUN LAB KK
Priority to JP20410895A priority Critical patent/JPH0955939A/en
Publication of JPH0955939A publication Critical patent/JPH0955939A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a moving picture compression method which can securely estimate distortion quantity by means of a simple method and to obtain the best picture with a constant bit rate by controlling code generation quantity based on data obtained by orthogonal conversion or quantization, namely, distribution information of the conversion coefficient of orthogonal conversion. SOLUTION: A data value counting means 41 counting a data value obtained as the result of quantization by a quantization means 14 or a data value obtained in the middle stage of quantization and a code quantity control means 42 controlling the generation quantity of encoding data in accordance with the counted result are provided. In this method, not only generated code quantity and the quantization coefficient but also the data values which are orthogonally converted or quantized are considered and generated code quantity is controlled. The data value counting means 41 selectively counts the data value of the DC component of a non-intra-macro block being a specified block attribute based on the discriminated result of a macro block and outputs the counted result to the code quantity control means 42.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、ディジタル動画像
を圧縮する動画像圧縮方法および装置に関し、特にディ
ジタル動画像を構成する各画像を所定のブロック単位に
直交変換し、その結果得られる直交変換係数を量子化し
て符号化処理する動画像圧縮方法および装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a moving picture compression method and apparatus for compressing a digital moving picture, and in particular, orthogonally transforms each image forming a digital moving picture into a predetermined block unit and obtains the resulting orthogonal transformation. The present invention relates to a moving picture compression method and apparatus for quantizing coefficients and performing coding processing.

【0002】[0002]

【従来の技術】近年、マルチメディア時代に対応するオ
ーディオ・ビデオ符号化方式として、MPEG(Moving
Picture Experts Group)1が、続いてMPEG2が、
それぞれ国際標準となった。これらMPEGの動画像圧
縮方式を採用してディジタル動画像データから圧縮情報
を生成するエンコーダは、動画像の各画面を構成する画
像(以下、ピクチャーともいう)を小さなブロック(マ
クロブロック=16画素×16画素の矩形ブロック)に
分割し、時間的に前後の画像の中から圧縮しようとする
マクロブロックに似た領域(参照画像領域)を抽出した
後、参照画像領域との空間的な距離および方位を示す動
きベクトルと、参照画像領域と圧縮しようとする領域の
差分情報とを計算して、これらの情報をDCT(Discre
te CosineTransform;離散コサイン変換)直交変換、量
子化および可変長符号化により圧縮するようになってい
る。このように動きベクトルと差分情報を圧縮すると、
現画像そのものを圧縮するよりも、はるかに効率良く圧
縮できるからである。また、差分情報によって圧縮され
るピクチャーは参照するピクチャーがないと復元できな
いため、他の画像を参照しないIピクチャー(Intra-Pi
cture;フレーム内符号化画像)が周期的に設けられて
いる。このIピクチャーを圧縮する際には、Iピクチャ
ーの全マクロブロックが、他の画像を参照しないイント
ラブロックとしてそのままDCT直交変換、量子化およ
び可変長符号化されて圧縮される。そして、このIピク
チャーを参照画像として、次の画像が圧縮され、さら
に、既に圧縮された画像を参照画像として他の画像が圧
縮されていく。参照画像を用いて圧縮するピクチャーに
は、時間的に前方のピクチャーのみを参照画像とするP
(Predictive)ピクチャーと、時間的に前後のピクチャー
を参照画像とするB(Bidirectionally-Predictive)ピク
チャーがある。なお、PピクチャーはIピクチャーと同
様に他の画像の参照画像として利用され得るが、Bピク
チャーは他の画像の参照画像として利用されない。ま
た、動きベクトルによる補償を行うか否かは、入力画像
のマクロブロック毎にその補償の有無による発生ビット
量の差を推定判断して、決定される。一方、圧縮された
情報(ビットストリーム)から動画像を復元(伸長)す
るデコーダでは、エンコードの逆処理、すなわち、逆量
子化、逆DCT、参照画像との合成(加算)を行って動
画像を復元する。
2. Description of the Related Art In recent years, MPEG (Moving
Picture Experts Group) 1, followed by MPEG2
Each became an international standard. An encoder that adopts the MPEG moving image compression method to generate compression information from digital moving image data uses an image (hereinafter, also referred to as a picture) forming each screen of the moving image as a small block (macro block = 16 pixels ×). 16-pixel rectangular block), and after extracting a region (reference image region) similar to the macro block to be compressed from temporally previous and subsequent images, the spatial distance and orientation to the reference image region Is calculated and the difference information between the reference image area and the area to be compressed is calculated, and these pieces of information are calculated by the DCT (Discrete
te Cosine Transform (discrete cosine transform) Orthogonal transform, quantization and variable length coding are used for compression. When the motion vector and difference information are compressed in this way,
This is because it can be compressed much more efficiently than compressing the current image itself. Also, a picture compressed by the difference information cannot be restored without a picture to refer to, so an I-picture (Intra-Pi
cture; intra-frame coded image) is periodically provided. When this I picture is compressed, all macroblocks of the I picture are subjected to DCT orthogonal transform, quantization, and variable length coding as they are as intra blocks that do not refer to other images, and then compressed. Then, the next image is compressed by using this I picture as a reference image, and further the other images are compressed by using the already compressed image as a reference image. For a picture to be compressed using the reference image, only the picture that is temporally ahead is used as the reference image.
There are (Predictive) pictures and B (Bidirectionally-Predictive) pictures in which temporally preceding and following pictures are used as reference images. It should be noted that the P picture can be used as a reference image for other images as with the I picture, but the B picture is not used as a reference image for other images. Further, whether or not to compensate by the motion vector is determined by estimating and determining the difference in the amount of generated bits for each macroblock of the input image depending on the presence or absence of the compensation. On the other hand, in a decoder that restores (decompresses) a moving image from compressed information (bit stream), inverse processing of encoding, that is, inverse quantization, inverse DCT, synthesis with a reference image (addition) is performed to generate a moving image. Restore.

【0003】ところで、MPEGによる圧縮、伸長で
は、量子化、逆量子化の過程で歪みを生じるため、圧縮
されたデータ(ビットストリーム)から復元された画像
は、現画像とはわずかに異なる。細かく量子化すれば前
記歪みは小さくなるが、圧縮効率が低下する。そのた
め、定められたビットレートで最良の画質を得るために
は量子化特性を適切に制御する必要がある。
By the way, since compression and decompression by MPEG cause distortion in the process of quantization and dequantization, an image restored from compressed data (bit stream) is slightly different from the current image. If the quantization is performed finely, the distortion is reduced, but the compression efficiency is reduced. Therefore, it is necessary to appropriately control the quantization characteristic in order to obtain the best image quality at the determined bit rate.

【0004】また、量子化特性は、マクロブロック毎に
定まる量子化係数(テレビジョン学会誌1995年Vo
l.49、No.4(以下、文献1という)第45頁(10)
式のquantiser scaleに相当する)と、DCT係数の次
数によって定まる量子化マトリックス(文献1の第45頁
(10)式のW[w][v][u]に相当する)とをパラメータとして
制御され、通常は量子化係数を調整することにより量子
化のステップ幅を設定し、発生ビット量を調整するよう
になっている。
Further, the quantization characteristic is a quantization coefficient determined for each macroblock (Voice Society of Japan, 1995 Vo.
l. 49, No. 4 (hereinafter referred to as Reference 1) Page 45 (10)
(Corresponding to the quantizer scale in the equation) and the quantization matrix determined by the order of the DCT coefficient (Page 45 of Document 1)
(Corresponding to W [w] [v] [u] in Eq. (10)) is controlled as a parameter, and usually the quantization step is set by adjusting the quantization coefficient, and the amount of generated bits is adjusted. It is supposed to do.

【0005】従来の量子化制御方法としては、文献1の
第49〜50頁、「3−2−5 レート制御とバッファ
制御」に記載されるように、過去にエンコードした画面
の発生符号量と量子化係数を基に、全体の画質が最適化
されるようなビット配分を推定し、量子化制御を行うも
のが提案されている。また、他の従来の量子化制御方法
として、1994年画像符号化シンポジウム(PCSJ
94)の第9回シンポジウム資料第185〜186頁、
「動画像符号化の符号量制御に関する一検討」(以下、
文献2という)に記載されるように、復元画像の歪み
(SNR:Signal to Noise Ratio)を定量的に評価
し、SNRが最良になるように量子化制御を行う方法も
提案されている。
As a conventional quantization control method, as described in "3-2-5 Rate control and buffer control" on pages 49 to 50 of Document 1, the generated code amount of a screen encoded in the past and It has been proposed to estimate the bit allocation that optimizes the overall image quality based on the quantization coefficient and perform the quantization control. Further, as another conventional quantization control method, the 1994 Image Coding Symposium (PCSJ
94) 9th Symposium Materials, pp. 185-186,
"A study on code amount control for video coding" (hereinafter,
As described in (Reference 2), a method of quantitatively evaluating the distortion (SNR: Signal to Noise Ratio) of the restored image and performing the quantization control so that the SNR becomes the best is also proposed.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、上記文
献1に記載される従来の動画像圧縮方法および装置にあ
っては、実際の歪み量を評価するのではなく、量子化係
数を評価して符号量制御を行っているため、歪みを最小
にするような調整をすることが困難であった。量子化係
数と歪み量との間には強い相関があるものの、両者は多
少異なるものだからである。すなわち、かかる従来の動
画像圧縮方法および装置は、量子化係数から歪み量を推
定する簡便な方法では歪み量を正確に把握することがで
きず、歪み量を求める装置が複雑になるという課題を抱
えていた。
However, in the conventional moving image compression method and apparatus described in the above-mentioned Document 1, the quantization coefficient is evaluated by encoding instead of evaluating the actual distortion amount. Since the quantity is controlled, it is difficult to make an adjustment to minimize the distortion. This is because there is a strong correlation between the quantized coefficient and the amount of distortion, but they are somewhat different. That is, the conventional moving image compression method and apparatus have a problem that the distortion amount cannot be accurately grasped by a simple method of estimating the distortion amount from the quantized coefficient, and a device for obtaining the distortion amount becomes complicated. I was holding.

【0007】また、上記文献2に記載される他の従来例
にあっては、SNRを定量的に評価するために、エンコ
ードされた画像を全てデコードして現画像と比較するた
め、膨大な計算が必要となり、圧縮装置のコストを増加
させてしまうという問題があった。なお、通常のMPE
Gエンコーダでも、参照画像とするためにデコード画像
を作成する必要があるが、参照画像としてはIピクチャ
ー、Pピクチャーのみがあれば良いので、Bピクチャー
をデコードする必要はなかった。
Further, in another conventional example described in the above-mentioned document 2, in order to quantitatively evaluate the SNR, all the encoded images are decoded and compared with the current image, which requires a huge calculation. However, there is a problem that the cost of the compression device is increased. In addition, normal MPE
Even in the G encoder, it is necessary to create a decoded image in order to use it as a reference image, but it is not necessary to decode the B picture because only I pictures and P pictures are required as reference images.

【0008】本発明は、上述のような従来の課題を解決
すべく、簡便な方法で確実に歪み量を推定することので
きる動画像圧縮方法を実現し、定ビットレートで最良の
画像を得ることのできる低コストの動画像圧縮装置を提
供することを目的とする。
In order to solve the above-mentioned conventional problems, the present invention realizes a moving image compression method capable of reliably estimating the distortion amount by a simple method, and obtains the best image at a constant bit rate. It is an object of the present invention to provide a low-cost moving image compression apparatus capable of performing the above.

【0009】[0009]

【課題を解決するための手段】本願発明者は、MPEG
において、量子化係数が歪み量を正確には反映しない原
因が次の点にあることに着目した。まず、MPEGにお
いて、デコーダのノンイントラマクロブロックでの逆量
子化は、次の式で定められている。(上記文献1の第4
3〜48頁、「3−2−4DCT符号化、量子化、可変
長符号化」の(10)式および(11)式。但し、文献1ではノ
ンイントラブロックを「非イントラブロック」と表記し
ている。) F_dash[v][u]= ((2×QF[v][u]+k)× W[1][v][u]×quantiser scale)/32 ..(1) k=Sign(QF[v][u]) ..(2) ここで、 F_dash[v][u]:逆量子化後のDCT係数 QF[v][u]:逆量子化前のDCT係数(つまり、量子化後
のDCT係数) W[1][v][u]:量子化マトリックス(ノンイントラマクロ
ブロック用) quantiser scale:量子化係数 Sign():引数の符号が正であれば1、負であれば−1、
0であれば0を返す関数 / :切捨て除算 このような特性を持つ逆量子化に対しては、通常、次の
式で量子化を行う。
Means for Solving the Problems The present inventor
In the above, we paid attention to the following reasons that the quantized coefficient does not accurately reflect the distortion amount. First, in MPEG, the inverse quantization in the non-intra macroblock of the decoder is defined by the following equation. (4th of the above-mentioned literature 1
Expressions (10) and (11) in "3-2-4 DCT encoding, quantization, variable length encoding" on pages 3 to 48. However, in Document 1, the non-intra block is described as “non-intra block”. ) F_dash [v] [u] = ((2 × QF [v] [u] + k) × W [1] [v] [u] × quantizer scale) / 32 .. (1) k = Sign (QF [v] [u]) .. (2) where F_dash [v] [u]: DCT coefficient after dequantization QF [v] [u]: DCT coefficient before dequantization (that is, quantization) DCT coefficient after) W [1] [v] [u]: Quantization matrix (for non-intra macroblock) quantiser scale: Quantization coefficient Sign (): 1 if the sign of the argument is positive, and negative -1,
If it is 0, a function that returns 0 /: Truncation division For inverse quantization having such characteristics, quantization is usually performed by the following formula.

【0010】 QF[v][u]= ((F[v][u]×16+W[1][v][u]/2)/W[1][v][u])/quantiser scale)/32 ..(3) ここで、 F[v][u]:量子化前のDCT係数 / :切捨て除算 これらの変換式を用い、DCT係数 F[v][u]を量子化し
て逆量子化前のDCT係数QF[v][u]を求め、さらにこ
のQF[v][u]を逆量子化して逆量子化後のDCT係数 F
_dash[v][u]を得る。量子化前のDCT係数 F[v][u]と
逆量子化後のDCT係数 F_dash[v][u]との間の差が、
量子化、逆量子化による歪みである。
QF [v] [u] = ((F [v] [u] × 16 + W [1] [v] [u] / 2) / W [1] [v] [u]) / quantiser scale) / 32 .. (3) where F [v] [u]: DCT coefficient before quantization /: Truncation division Using these conversion formulas, the DCT coefficient F [v] [u] is quantized The DCT coefficient QF [v] [u] before dequantization is obtained, and this QF [v] [u] is dequantized to obtain the DCT coefficient F after dequantization.
Get _dash [v] [u]. The difference between the DCT coefficient F [v] [u] before quantization and the DCT coefficient F_dash [v] [u] after dequantization is
It is distortion due to quantization and inverse quantization.

【0011】この式において、単なる乗算による逆量子
化と異なる点は、Sign(QF[v][u])の項があることであ
り、この項があることで、図6に示すように QF[v]
[u]が0となるF[u][v]の範囲の方がQF[v][u]が1以上
又は−1以下になるF[u][v]の範囲より広くなるような
逆量子化がなされる(以下、この作用域をデッドゾーン
という)。したがって、より広い範囲が0として量子化
されることになり、ビット削減を効率よく行うことがで
きる。なお、図6は W[1][v][u]=16、quantiser_sca
le=8の条件で F[v][u]と F_dash[v][u]の関係を示し
たもので、複数の黒丸印と実線で表した線がF[v][u]とF
_dash[v][u]の関係を、点線で表した線が歪み0の変換
式をそれぞれ示している。つまり、実線と点線の差が量
子化歪みを表している。また、F_dash=0のレベルがQ
F[v][u]=0に、F_dash=±12がQF[v][u]±1にそ
れぞれ相当し、F_dash=±20がQF[v][u]±2に相当
する。QF[v][u]=0の範囲はFの値にして−7〜7ま
での15の幅が存在しているのに対し、他の値は8の幅
しかない。このように、QF[v][u]=0の幅は他の値の
場合よりも広いため、QF[v][u]=0の時の量子化誤差
は、他の値の場合の量子化誤差よりも大きくなってしま
う。付言すれば、QF[v][u]=0の場合は、点線(歪み
0の変換式)からのずれとして示される最大7の量子化
歪みが発生しているのに対し、その他の場合は最大4の
誤差しか発生していない。このように同一の量子化係数
であっても、QF[v][u]の値が異なると、量子化誤差が
異なってくるという現象により、量子化係数が歪み量を
正確に反映しなくなる。
In this equation, the point different from the inverse quantization by mere multiplication is that there is a term of Sign (QF [v] [u]), and the presence of this term results in QF as shown in FIG. [v]
The reverse such that the range of F [u] [v] where [u] is 0 is wider than the range of F [u] [v] where QF [v] [u] is 1 or more or -1 or less. Quantization is performed (hereinafter, this working area is called a dead zone). Therefore, a wider range is quantized as 0, and bit reduction can be performed efficiently. Note that in FIG. 6, W [1] [v] [u] = 16, quantizer_sca
It shows the relationship between F [v] [u] and F_dash [v] [u] under the condition of le = 8, and the lines indicated by multiple black circles and solid lines are F [v] [u] and F.
The lines represented by dotted lines in the relationship of _dash [v] [u] represent the conversion equations with zero distortion. That is, the difference between the solid line and the dotted line represents the quantization distortion. Also, the level when F_dash = 0 is Q
F [v] [u] = 0, F_dash = ± 12 corresponds to QF [v] [u] ± 1, and F_dash = ± 20 corresponds to QF [v] [u] ± 2. In the range of QF [v] [u] = 0, there are 15 widths from −7 to 7 in the value of F, while other values have a width of 8. Since the width of QF [v] [u] = 0 is wider than that of other values, the quantization error when QF [v] [u] = 0 is the quantum of other values. It will be larger than the error. In addition, in the case of QF [v] [u] = 0, a maximum of 7 quantization distortions indicated as deviations from the dotted line (transformation formula of 0 distortion) occur, whereas in other cases, Only a maximum error of 4 has occurred. Thus, even with the same quantized coefficient, the quantized coefficient does not accurately reflect the distortion amount due to the phenomenon that the quantized error differs when the value of QF [v] [u] is different.

【0012】そこで、本発明では、正確に歪み量を把握
し符号量制御の精度を高めるべく、量子化係数のみなら
ず、量子化される直交変換係数情報を把握してそれを符
号量制御に反映させる。そして、量子化後に非零となる
マクロブロックが少ない場合は、より大きな歪みを持つ
ため、量子化係数が小さくなるように制御し、量子化後
に非零となるマクロブロックが多い場合には、量子化係
数が大きくなるように制御する。このようにすれば、歪
みが均一になり、良好な復元画像を得ることができる。
特に、PピクチャーとBピクチャーの間で、非零係数の
割合に大きな違いがあるような動画像に対して、この効
果が顕著に現れる。
Therefore, in the present invention, in order to accurately grasp the distortion amount and improve the accuracy of the code amount control, not only the quantized coefficient but also the quadrature transform coefficient information to be quantized is grasped and used for the code amount control. To reflect. Then, when there are few macroblocks that become non-zero after quantization, the distortion is larger, so control is performed so that the quantization coefficient becomes small, and when there are many macroblocks that become non-zero after quantization, Control so that the conversion coefficient becomes large. By doing so, the distortion becomes uniform, and a good restored image can be obtained.
In particular, this effect is prominent for a moving image in which there is a large difference in the non-zero coefficient ratio between the P picture and the B picture.

【0013】例えば、図7に示すように、画面の輝度が
連続的にゆっくりと変化する動画像(フェード画像)に
おいて、Pピクチャーでは参照画像(Iピクチャー)か
らの差分D1 が通常画像よりも大きくなるため、非零係
数の数が多くなる。一方、Bピクチャーは、前後の画像
の平均を参照画像とするため、参照画像からの差分D 2
があまり大きくならず、非零係数の増加はさほどでな
い。つまり、PピクチャーとBピクチャーの間で、非零
係数の割合に大きな違いが生じる。このような動画像に
対しては、文献1の手法のように量子化係数から判断し
て適切なビット配分になるように制御すると、Pピクチ
ャーとBピクチャーの間で歪み量に大きな差が発生し、
PピクチャーとBピクチャーの繰返し周期で歪み量が増
大する所謂フリッカ現象が発生して、非常に見苦しい復
元画像となる。
For example, as shown in FIG. 7, the brightness of the screen is
For moving images (fade images) that change slowly and continuously
In the P picture, is it a reference image (I picture)?
Difference D1Is larger than a normal image,
The number of numbers increases. On the other hand, B picture is the previous and next images.
The difference D from the reference image is used because the average of 2
Is not very large, and the non-zero coefficient does not increase so much.
No. That is, non-zero between P picture and B picture
There is a big difference in the ratio of the coefficients. In such a moving image
On the other hand, judging from the quantized coefficient as in the method of Reference 1,
If you control so that the bit allocation is appropriate, P
Difference in the amount of distortion between the picture and the B picture,
The amount of distortion increases with the repetition period of P picture and B picture.
A so-called flicker phenomenon occurs, and it is very unsightly to recover.
It becomes the original image.

【0014】これに対し、例えば量子化後に直流成分
(ブロック内の画素データの平均値に相当する)が非零
となるブロックの数と量子化係数とを基に符号量制御を
行うようにすれば、非零係数の多いPピクチャーでは従
来よりも量子化ステップ幅を大きくし、非零係数の少な
いBピクチャーは従来方法よりも量子化ステップ幅を小
さくするようにして、歪みの均一化された復元画像を得
ることが可能になる。特に、DC(直流)成分、低周波
成分の歪みは、目立ち易いので、これらの成分が非零と
なるブロックの数を把握することで、より効果的に符号
量、画質の制御を行うことができる。
On the other hand, for example, the code amount control may be performed based on the number of blocks and the quantization coefficient in which the DC component (corresponding to the average value of the pixel data in the block) becomes non-zero after quantization. For example, the P-picture with many non-zero coefficients has a larger quantization step width than that of the conventional method, and the B-picture with less non-zero coefficients has a smaller quantization step width than that of the conventional method so that the distortion is uniformized. It becomes possible to obtain a restored image. In particular, distortions of DC (direct current) components and low-frequency components are conspicuous. Therefore, by grasping the number of blocks in which these components are non-zero, the code amount and the image quality can be controlled more effectively. it can.

【0015】また、符号量制御のためであれば、復元画
像の歪みでなくDCT係数の歪みを求めるだけでも良い
から、第2の発明として、DCT係数の歪み(図6中の
黒丸の点線からのずれ)を算出して、これを符号量制御
に反映させるようにする。このようにすると、文献2に
記載されたような符号量制御と同様な効果を、それより
簡単な装置で実現可能になる。
Further, for code amount control, the distortion of the DCT coefficient may be obtained instead of the distortion of the restored image. Therefore, as the second invention, the distortion of the DCT coefficient (from the dotted line of the black circle in FIG. 6). Deviation) is calculated and reflected in the code amount control. This makes it possible to achieve the same effect as the code amount control described in Document 2 with a simpler device.

【0016】本発明の発明者は、上述のような観点か
ら、次のような解決手段に到達した。すなわち、請求項
1に記載の発明は、動画像または動画像の予測差分画像
を所定のブロック単位に直交変換するとともに、前記直
交変換の結果得られる直交変換係数を量子化して、前記
画像の符号化データを発生する動画像圧縮方法であっ
て、前記直交変換又はその量子化により得られるデータ
に基づいて前記符号化データの発生量を制御する工程を
含むことを特徴とするものである。この場合、実空間で
なく直交変換空間の情報(空間周波数領域の情報)を符
号量制御に反映させることにより、量子化歪みをより正
確に把握し、符号量制御の精度を高めることができる。
さらに、請求項2に記載のように、前記量子化後に前記
直交変換係数の直流成分が非零となるブロックの数に応
じて前記符号化データの発生量を制御することが好まし
い。量子化後に非零となる直交変換係数の数と量子化係
数とを基に符号量制御を行うようにすれば、非零係数の
多いPピクチャーでは従来よりも量子化ステップ幅を大
きくし、非零係数の少ないBピクチャーは従来方法より
も量子化ステップ幅を小さくするようにして、歪み(S
NR)の均一化された復元画像が簡単に得られるからで
ある。
The inventor of the present invention has reached the following solving means from the above viewpoints. That is, the invention according to claim 1 orthogonally transforms a moving image or a predictive difference image of the moving image in units of a predetermined block, and quantizes an orthogonal transform coefficient obtained as a result of the orthogonal transform to obtain a code of the image. A moving image compression method for generating encoded data, comprising the step of controlling the generation amount of the encoded data based on the data obtained by the orthogonal transformation or the quantization thereof. In this case, by reflecting the information of the orthogonal transform space (information of the spatial frequency domain) instead of the real space in the code amount control, it is possible to more accurately grasp the quantization distortion and improve the accuracy of the code amount control.
Further, as described in claim 2, it is preferable that the generation amount of the encoded data is controlled according to the number of blocks in which the DC component of the orthogonal transform coefficient becomes non-zero after the quantization. If the code amount is controlled based on the number of orthogonal transform coefficients that become non-zero after quantization and the quantized coefficient, the quantization step width can be made larger in the P picture having many non-zero coefficients than before. A B-picture with few zero coefficients has a smaller quantization step width than that of the conventional method, and the distortion (S
This is because a restored image with uniform NR) can be easily obtained.

【0017】また、請求項3に記載の発明は、動画像ま
たは動画像の予測差分画像を所定のブロック単位に直交
変換するとともに、前記直交変換の結果得られる直交変
換係数を量子化して、前記画像の符号化データを発生す
る動画像圧縮方法であって、前記量子化後の直交変換係
数を逆量子化して得られる直交変換係数と前記量子化前
の直交変換係数との差分を算出する工程と、前記差分の
総和に基づいて前記符号化データの発生量を制御する工
程とを含むことを特徴とするものである。この場合、直
交変換係数の量子化前後の差分を算出し計数してその総
和を求めることで、実空間における画像の歪みを算出す
ることなく、歪みを正確に推定することができ、良好な
画像を得ることができる。
According to a third aspect of the present invention, the moving image or the predictive difference image of the moving image is orthogonally transformed in a predetermined block unit, and the orthogonal transformation coefficient obtained as a result of the orthogonal transformation is quantized, A moving image compression method for generating encoded data of an image, the step of calculating a difference between an orthogonal transform coefficient obtained by dequantizing the quantized orthogonal transform coefficient and the quantized orthogonal transform coefficient. And a step of controlling the generation amount of the encoded data based on the sum of the differences. In this case, it is possible to accurately estimate the distortion without calculating the distortion of the image in the real space by calculating the difference between before and after the quantization of the orthogonal transformation coefficient and counting the sum to calculate a good image. Can be obtained.

【0018】請求項4に記載の発明は、動画像または動
画像の予測差分画像を所定のブロック単位に直交変換す
る直交変換手段と、前記直交変換の結果得られる直交変
換係数を量子化する量子化手段と、を備え、前記直交変
換および量子化を含む符号化処理により前記画像の符号
化データを発生する動画像圧縮装置において、前記量子
化手段による量子化の結果得られるデータ値または量子
化の途中段階で得られるデータ値を計数するデータ値計
数手段と、該データ値計数手段の計数結果に応じ前記符
号化データの発生量を制御する符号量制御手段と、を設
けたことを特徴とするものであり、請求項5に記載のよ
うに、前記データ値計数手段が前記データ値について前
記ブロック単位の画像のブロック属性を判別する手段を
有し、該ブロック属性の判別結果に基づいて特定のブロ
ック属性に対応するデータ値を選択的に計数するのが好
ましい。この計数結果を符号発生量の制御に反映して効
果が得られるノンイントラブロックのみを選択し、効率
良く処理することができるからである。また、請求項6
に記載のように、前記データ値計数手段が、前記データ
値について前記直交変換の変換次数を判別する手段を有
し、該変換次数の判別結果に基づいて特定の変換次数に
対応するデータ値を選択的に計数するものであってもよ
く、さらに、請求項7に記載のように、前記データ値計
数手段が、前記データ値について前記直交変換係数が零
値か否かを判別する手段を有し、該判別結果に基づいて
前記非零値に対応する特定のデータ値を選択的に計数す
るものであってもよい。DC(直流)成分が非零となる
ブロック、あるいは更に低周波成分の歪みも目立ち易い
ので、該成分が非零となるブロックの数を把握すること
で、効果的に符号量、画質の制御を行うことができるか
らである。
According to a fourth aspect of the present invention, an orthogonal transform means for orthogonally transforming a moving image or a predictive difference image of the moving image in a predetermined block unit, and a quantum for quantizing an orthogonal transform coefficient obtained as a result of the orthogonal transform. And a data value obtained as a result of the quantization by the quantizing means in a moving picture compression apparatus for generating encoded data of the image by the encoding process including the orthogonal transformation and the quantization. Data value counting means for counting the data values obtained in the middle of the step, and code amount control means for controlling the generation amount of the encoded data according to the counting result of the data value counting means are provided. According to a fifth aspect of the present invention, the data value counting means has means for determining the block attribute of the image of the block unit for the data value, and the block Preferably selectively count data values corresponding to a specific block attribute on the basis of the sex determination result. This is because it is possible to select only the non-intra blocks that have an effect by reflecting the counting result in the control of the code generation amount and efficiently process the non-intra blocks. In addition, claim 6
As described above, the data value counting means has means for determining the conversion order of the orthogonal transformation for the data value, and based on the result of the determination of the conversion order, the data value corresponding to the specific conversion order is obtained. Alternatively, the data value counting means may have means for determining whether or not the orthogonal transformation coefficient is zero for the data value. However, a specific data value corresponding to the non-zero value may be selectively counted based on the determination result. Blocks in which the DC (direct current) component is non-zero, or distortion of low-frequency components are also noticeable, so by grasping the number of blocks in which the components are non-zero, the code amount and image quality can be effectively controlled. Because it can be done.

【0019】さらに、請求項8に記載の発明は、動画像
または動画像の予測差分画像を所定のブロック単位に直
交変換する直交変換手段と、前記直交変換の結果得られ
る直交係数を量子化する量子化手段と、を備え、前記直
交変換および量子化を含む符号化処理により前記画像の
符号化データを発生する動画像圧縮装置において、前記
量子化手段の出力を逆量子化する逆量子化手段と、逆量
子化手段によって逆量子化された直交変換係数と量子化
前の直交変換係数との差分を算出する直交変換係数差分
算出手段と、直交変換係数差分算出手段の出力を計数す
るデータ値計数手段と、データ値計数手段の計数結果に
基づいて前記符号化データの発生量を制御する符号量制
御手段と、を設けたことを特徴とするものであり、請求
項9に記載のように、前記データ値計数手段が、前記デ
ータ値について前記直交変換の変換次数を判別する手段
を有し、該変換次数の判別結果に基づいて特定の変換次
数に対応するデータ値を選択的に計数するのが望まし
い。
Further, in the invention described in claim 8, an orthogonal transform means for orthogonally transforming a moving image or a predictive difference image of the moving image in a predetermined block unit, and an orthogonal coefficient obtained as a result of the orthogonal transform are quantized. In a moving picture compression apparatus, which comprises a quantizing means and which generates coded data of the image by an encoding process including the orthogonal transformation and quantization, an inverse quantizing means for inversely quantizing the output of the quantizing means. And an orthogonal transform coefficient difference calculating means for calculating the difference between the orthogonal transform coefficient dequantized by the inverse quantizing means and the orthogonal transform coefficient before quantization, and a data value for counting the output of the orthogonal transform coefficient difference calculating means. The counting means and the code amount control means for controlling the generation amount of the encoded data based on the counting result of the data value counting means are provided, and as described in claim 9. , The data value counting means has means for determining the conversion order of the orthogonal transformation for the data value, and selectively counts the data value corresponding to a specific conversion order based on the result of the determination of the conversion order. Is desirable.

【0020】[0020]

【発明の実施の形態】以下、本発明の好ましい実施の形
態について図面を参照しつつ説明する。本実施形態の動
画像圧縮装置は、図1のブロック図に示されるように、
動画像または動画像の予測差分画像を所定のブロック単
位に直交変換する直交変換手段、例えばDCT(Discre
te Cosine Transform;離散コサイン変換)手段13
と、前記直交変換の結果得られる直交変換係数、例えば
DCT係数を量子化する量子化手段14とを備えてお
り、前記直交変換および量子化を含む符号化処理により
前記画像の符号化データを発生するようになっている。
この動画像圧縮装置は、更に、前記量子化手段14によ
る量子化の結果得られるデータ値または量子化の途中段
階で得られるデータ値を計数するデータ値計数手段41
と、該データ値計数手段41の計数結果に応じ前記符号
化データの発生量を制御する符号量制御手段42と、を
備えている。データ値計数手段41は、量子化手段14
による量子化の結果得られるデータ値又は量子化の途中
段階で得られるデータ値を計数することで、直交変換係
数情報、すなわち直交変換空間の情報を把握する。ま
た、符号量制御手段42は、データ値計数手段41によ
る計数の結果から直交変換係数情報を把握し、その結果
に応じて前記符号化データの前記ブロック単位の発生量
を制御する。
BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, preferred embodiments of the present invention will be described with reference to the drawings. As shown in the block diagram of FIG. 1, the moving image compression apparatus of the present embodiment is
Orthogonal transform means for orthogonally transforming a moving image or a predictive difference image of the moving image in a predetermined block unit, for example, DCT (Discre
te Cosine Transform) means 13
And a quantizing unit 14 for quantizing an orthogonal transform coefficient obtained as a result of the orthogonal transform, for example, a DCT coefficient, and generates encoded data of the image by an encoding process including the orthogonal transform and quantization. It is supposed to do.
The moving picture compression apparatus further includes a data value counting means 41 for counting the data value obtained as a result of the quantization by the quantization means 14 or the data value obtained in the middle of the quantization.
And a code amount control unit 42 for controlling the generation amount of the encoded data according to the counting result of the data value counting unit 41. The data value counting means 41 is the quantizing means 14
The orthogonal transformation coefficient information, that is, the information of the orthogonal transformation space, is grasped by counting the data value obtained as a result of the quantization by or the data value obtained in the middle of the quantization. Further, the code amount control means 42 grasps the orthogonal transform coefficient information from the result of counting by the data value counting means 41, and controls the generation amount of the encoded data in the block unit according to the result.

【0021】この装置を用いて本発明の動画像圧縮方法
を実施する場合の態様としては、まず、動画像または動
画像の予測差分画像を直交変換手段13によって所定の
ブロック単位に直交変換するとともに、この直交変換の
結果得られる直交変換係数を量子化手段14によって量
子化して、前記画像の符号化データを発生する方法であ
り、前記直交変換係数又はその量子化により得られるデ
ータ、例えば前記直交変換係数の量子化後のデータを計
数するデータ値計数手段41からの情報に基づき、符号
量制御手段42により量子化手段14を制御して、前記
符号化データの発生量を制御する工程を含むことにな
る。
As a mode of carrying out the moving picture compression method of the present invention using this apparatus, first, the moving picture or the prediction difference image of the moving picture is orthogonally transformed into a predetermined block unit by the orthogonal transformation means 13. , A method of generating coded data of the image by quantizing the orthogonal transformation coefficient obtained as a result of the orthogonal transformation by the quantizing means 14, and the orthogonal transformation coefficient or data obtained by the quantization thereof, for example, the orthogonal transformation. A step of controlling the quantization means 14 by the code amount control means 42 based on the information from the data value counting means 41 for counting the data after the quantization of the transform coefficient to control the generation amount of the encoded data. It will be.

【0022】このようにして、直交変換係数情報を符号
量制御に反映させる際、量子化後に直交変換係数が非零
となるブロックが少なく量子化歪みが大きくなる場合
は、量子化係数が小さくなるように制御し、一方、量子
化後に非零となるマクロブロックが多く量子化歪みが小
さくなる場合には、量子化係数が大きくなるように制御
すると、歪みが均一になるから良好な復元画像を得るこ
とができる。
In this way, when the orthogonal transform coefficient information is reflected in the code amount control, if there are few blocks in which the orthogonal transform coefficient becomes non-zero after quantization and the quantization distortion becomes large, the quantization coefficient becomes small. On the other hand, if there are many macroblocks that become non-zero after quantization and the quantization distortion is small, if the quantization coefficient is controlled to be large, the distortion will be uniform and a good restored image will be obtained. Obtainable.

【0023】前記符号量制御工程において、前記直交変
換係数の直流成分(DC成分)が非零となるブロックの
数に応じて前記符号化データの発生量を制御することが
でき、その場合、特にPピクチャーとBピクチャーの間
で、非零係数の割合に大きな違いがあるような動画像に
対して、顕著な効果が得られる。前記データ値計数手段
41は前記データ値について前記ブロック単位の画像の
ブロック属性を判別する手段51を有するものとするこ
とができ、その場合、該ブロック属性の判別結果に基づ
いて特定のブロック属性に対応するデータ値を選択的に
計数することができる。また、データ値計数手段41
は、前記データ値について前記直交変換の変換次数を判
別する手段52を有し、該変換次数の判別結果に基づい
て特定の変換次数に対応するデータ値を選択的に計数す
るものであってもよく、更に前記データ値について前記
直交変換係数が零値か否かを判別する手段53を設けて
の判別結果に基づいて前記非零値に対応する特定のデー
タ値を選択的に計数するようにすることもできる。
In the code amount control step, the generation amount of the encoded data can be controlled according to the number of blocks in which the DC component (DC component) of the orthogonal transform coefficient is non-zero. In that case, in particular, A significant effect can be obtained for a moving picture in which the ratio of non-zero coefficients is greatly different between the P picture and the B picture. The data value counting unit 41 may include a unit 51 for discriminating the block attribute of the image of the block unit for the data value. In that case, a specific block attribute is determined based on the discrimination result of the block attribute. Corresponding data values can be selectively counted. Further, the data value counting means 41
May have a means 52 for discriminating the transformation order of the orthogonal transformation with respect to the data value and selectively counting data values corresponding to a particular transformation order based on the discrimination result of the transformation order. Well, further, a specific data value corresponding to the non-zero value is selectively counted on the basis of the determination result of the means 53 for determining whether or not the orthogonal transformation coefficient is zero value for the data value. You can also do it.

【0024】なお、本発明でいう「直交変換」は好まし
くは離散コサイン変換(DCT)であるが、これに限る
ものではない。また、直交変換の結果得られる「直交変
換係数」はDC成分のみならず他の次数を含むものであ
ってもよく、例えば一次までの次数の直交変換係数を含
んでも好ましい。
The "orthogonal transform" used in the present invention is preferably a discrete cosine transform (DCT), but is not limited to this. Further, the “orthogonal transform coefficient” obtained as a result of the orthogonal transform may include not only the DC component but also other orders, and for example, it is preferable that the orthogonal transform coefficients of orders up to the first order are included.

【0025】[0025]

【実施例】図1〜図3は本実施形態の動画像圧縮装置の
詳細な実施例を示す図であり、図1はこの実施例のブロ
ック図である。図1において、1は図外のフレームメモ
リ等を介してディジタル動画像信号を入力する画像信号
入力端子であり、画像信号入力端子1には前記動画像の
各画面を構成する画像(ピクチャー)の輝度や色差を含
むデータが入力される。入力画像データはブロック化手
段11によって動画像の各画面を例えば16画素×16
画素の矩形ブロック(以下、マクロブロックという)に
分割するようブロック化され、マクロブロック単位で差
分画像生成手段12および動きベクトル探索手段31に
送られる。動きベクトル探索手段31は、エンコード
(符号化)しようとするマクロブロックの画像を復元画
像記録手段24中に記憶された参照画像(既にエンコー
ドされたIまたはPピクチャー)と比較し、参照画像の
中から、入力マクロブロックに最も似た画像領域を探索
して、その結果得られる動きベクトルを参照領域抽出手
段32に出力する。この参照領域抽出手段32は、動き
ベクトル探索手段31による探索の結果得られた動きベ
クトルに基づき、復元画像記録手段24中の参照画像の
中から圧縮しようとするマクロブロックに似た領域を参
照領域として抽出する。
1 to 3 are diagrams showing detailed examples of a moving image compression apparatus according to this embodiment, and FIG. 1 is a block diagram of this example. In FIG. 1, reference numeral 1 is an image signal input terminal for inputting a digital moving image signal via a frame memory or the like (not shown), and the image signal input terminal 1 stores images (pictures) constituting each screen of the moving image. Data including brightness and color difference is input. For the input image data, each screen of the moving image is, for example, 16 pixels × 16
Blocks are divided into rectangular blocks of pixels (hereinafter referred to as macroblocks), and the blocks are sent to the difference image generation means 12 and the motion vector search means 31 in macroblock units. The motion vector search unit 31 compares the image of the macroblock to be encoded (encoded) with the reference image (I or P picture already encoded) stored in the restored image recording unit 24, and compares To search the image area most similar to the input macroblock and output the resulting motion vector to the reference area extracting means 32. The reference area extracting unit 32, on the basis of the motion vector obtained as a result of the search by the motion vector searching unit 31, selects an area similar to the macroblock to be compressed from the reference images in the restored image recording unit 24 as the reference area. To extract.

【0026】差分画像生成手段12は、ブロック化手段
11および参照領域抽出手段32からのデータに基づい
て、予め入力画像の空間周波数の分布や動きベクトルを
用いて動き補償した差分画像の空間周波数等を推定する
処理を実行し、発生ビット量が少なくなるマクロブロッ
ク属性を(動き補償を行うか否かを)選択して入力画像
又は動きベクトルを用いて動き補償した差分画像の何れ
かを出力する。選択されるマクロブロックの属性として
は、動き補償を行わずに現画像をエンコードするイント
ラ(Intra;フレーム内符合化)マクロブロック、動き
補償を行って差分画像をエンコードするノンイントラマ
クロブロック、1フレームの画像を2つのフィールドに
分割してエンコードするフィールドエンコード等があ
る。
The differential image generating means 12 is based on the data from the blocking means 11 and the reference area extracting means 32, and the spatial frequency of the differential image, which has been motion-compensated using the spatial frequency distribution of the input image and the motion vector in advance. , A macroblock attribute that reduces the amount of generated bits is selected (whether or not motion compensation is performed), and either an input image or a motion-compensated difference image is output using a motion vector. . The attributes of the selected macroblock are an intra macroblock that encodes the current image without performing motion compensation, a non-intra macroblock that encodes a difference image by performing motion compensation, and one frame. There is a field encoding method in which the image of is divided into two fields and encoded.

【0027】より具体的には、例えば、入力画像が空間
周波数の高い成分を多く含むのに対して、差分画像が空
間周波数の低い成分しか持たない場合は、差分画像を直
交変換した方がより少ないデータ量に変換できるので、
入力したマクロブロックをノンイントラマクロブロック
としてエンコードした方が効率がよい。そこで、差分画
像生成手段12は、入力画像をそのままイントラブロッ
クとしてエンコードした場合の交流成分(AC成分)に
相当する値と、差分画像であるノンイントラブロックと
してエンコードした場合のAC成分に相当する値とをそ
れぞれ算出し、両方の値の比較結果に応じて有利なマク
ロブロック属性を判断する。DCT変換によって得られ
るDCT係数の交流成分(AC成分)が多くなると発生
符号量が増加するという一般的な傾向を利用して、発生
ビット量を推定し、判断できるからである。差分画像生
成手段12は、この判断結果により必要に応じて入力画
像と参照画像との間の間の減算処理を行い、差分画像を
生成してDCT手段13に出力する。なお、ブロック化
手段11への入力画像がIピクチャー(Intra-Pictur
e;フレーム内符号化画像)である場合、Iピクチャー
内の全マクロブロックがイントラブロックとなって、ブ
ロック化手段11からのデータがそのままDCT手段1
3に出力され、一方、ブロック化手段11への入力画像
がPピクチャー(Predictive-Picture;フレーム間順方
向予測符号化画像)若しくはBピクチャー(Bidirectio
nally predictive-Picture;双方向予測符号化画像)で
ある場合に、上述のように量子化するマクロブロックの
属性がマクロブロック毎に決定されることになる。
More specifically, for example, when the input image contains many components with high spatial frequencies, while the difference image has only components with low spatial frequencies, it is better to orthogonally transform the difference images. Since it can be converted to a small amount of data,
It is more efficient to encode the input macroblock as a non-intra macroblock. Therefore, the difference image generation unit 12 has a value corresponding to an AC component (AC component) when the input image is encoded as an intra block as it is and a value corresponding to the AC component when encoded as a non-intra block that is the difference image. And are respectively calculated, and an advantageous macroblock attribute is determined according to the comparison result of both values. This is because the generated bit amount can be estimated and judged by using the general tendency that the generated code amount increases when the AC component (AC component) of the DCT coefficient obtained by the DCT conversion increases. The difference image generation means 12 performs a subtraction process between the input image and the reference image according to the determination result as needed, generates a difference image and outputs it to the DCT means 13. The input image to the blocking means 11 is an I picture (Intra-Pictur).
e; intra-frame coded image), all macroblocks in the I picture become intra blocks, and the data from the blocking means 11 remains as is in the DCT means 1.
3 and the input image to the blocking means 11 is a P picture (Predictive-Picture; inter-frame forward prediction coded image) or B picture (Bidirectio).
nally predictive-Picture), the attribute of the macroblock to be quantized as described above is determined for each macroblock.

【0028】DCT手段13は、差分画像生成手段12
からのマクロブロック毎の予測誤差信号(イントラマク
ロブロックでは入力信号、ノンイントラマクロブロック
では前記差分画像の信号)を例えば8×8画素のブロッ
クに分割した後、そのブロック単位で公知の2次元のD
CT演算を行い、入力画像を直流成分(DC成分)およ
び交流成分(AC成分)を含む低周波項から高周波項ま
での複数のDCT係数に変換する。なお、このDCT変
換によって、入力画像は、第1低周波項であるDC成分
(平均値画像)から高周波項のAC成分まで、徐々に精
細さを表現する段階的な複数の画像成分に分解されるこ
とになる。また、自然画像では、DCT変換前にランダ
ムに分布していた画素値(例えば輝度又は色差)が、D
CT変換後には低周波項に集中することから、高周波項
を除去することで有効な情報圧縮が可能になる。
The DCT means 13 is the difference image generating means 12
After dividing the prediction error signal for each macroblock (input signal for intra macroblocks, signal of the difference image for non-intra macroblocks) into blocks of, for example, 8 × 8 pixels, a known two-dimensional D
A CT operation is performed to convert the input image into a plurality of DCT coefficients from a low frequency term including a direct current component (DC component) and an alternating current component (AC component) to a high frequency term. By this DCT transformation, the input image is decomposed into a plurality of stepwise image components that gradually express fineness, from the DC component (average value image) that is the first low-frequency term to the AC component of the high-frequency term. Will be. In addition, in the natural image, the pixel values (for example, luminance or color difference) randomly distributed before the DCT conversion are D
After the CT conversion, the high-frequency terms are concentrated, so that it is possible to effectively compress information by removing the high-frequency terms.

【0029】DCT手段13から出力されるDCT係数
は、量子化手段14により、マクロフロック属性(イン
トラマクロブロック、ノンイントラマクロブロック)に
応じた量子化手法で、周波数に応じた量子化マトリック
スとマクロブロック毎に定まる量子化係数とを用いて量
子化される。量子化手段14は、DCT変換により得ら
れたDCT係数の直流成分(DC成分)と交流成分(A
C成分)とを独立に、各々量子化ステップと呼ばれる除
数で割り算し、高周波項を除去するよう余りを丸める処
理を行って、各DCT係数を量子化するようになってい
る。量子化手段14による量子化の量子化ステップ幅
は、後述する符号量制御手段42によって制御され、こ
れによってマクロブロック毎の発生符号量(発生ビット
量)が制御可能になっている。
The DCT coefficient output from the DCT means 13 is quantized by the quantizing means 14 according to the macroblock attribute (intra macroblock, non-intra macroblock) by a quantizing matrix and macro depending on the frequency. Quantization is performed using a quantization coefficient that is determined for each block. The quantizing means 14 includes a DC component (DC component) and an AC component (A) of the DCT coefficient obtained by the DCT transform.
C component) is independently divided by a divisor called a quantization step, the remainder is rounded to remove high frequency terms, and each DCT coefficient is quantized. The quantization step width of the quantization performed by the quantization means 14 is controlled by the code amount control means 42, which will be described later, whereby the generated code amount (generated bit amount) for each macroblock can be controlled.

【0030】量子化手段14によって量子化されたデー
タは、可変長符号化手段15にて可変長符号化された
後、バッファ16にてビットレートを平均化しながら出
力端子2より出力され、図外の伝送路を経て外部デコー
ダへ伝送される。すなわち、画像信号はその画像の複雑
さや動きの激しさによって情報発生量が変動するため、
この変動を吸収して略一定の伝送速度で伝送するために
送信バッファ16を設けている。また、このバッファの
占有率に基づいて量子化特性を制御できるよう発生符号
量を計数する符号量計数手段17(後述する)が設けら
れている。
The data quantized by the quantizing means 14 is variable-length coded by the variable-length coding means 15 and then outputted from the output terminal 2 while averaging the bit rate in the buffer 16, which is not shown in the figure. Is transmitted to the external decoder via the transmission line of. That is, since the amount of information generated in an image signal varies depending on the complexity of the image and the intensity of movement,
A transmission buffer 16 is provided to absorb this fluctuation and transmit at a substantially constant transmission rate. Further, a code amount counting means 17 (described later) for counting the generated code amount is provided so that the quantization characteristic can be controlled based on the occupation rate of the buffer.

【0031】一方、量子化手段14によって量子化され
たデータは、逆量子化手段21にも入力され、逆量子化
手段21による逆量子化と逆DCT手段22による逆D
CT変換とで、すなわちデコーダと同じ処理によって復
元される。復元された画像、例えば復元されたIピクチ
ャー画像はローカルデコード画像として復元画像記録手
段24に保存され、次にエンコードする画像の参照画像
となる。このような処理をするのは、デコーダで復元さ
れるIピクチャーの画像と現画像との間の差異を抑える
ために、Iピクチャーを参照画像として他の画像を伝送
する場合、デコーダにより復元するIピクチャー画像と
全く同じ画像をデコーダ側でも作成しなければならない
という理由からである。なお、Pピクチャーは、Iピク
チャーと同様に、逆量子化手段21、逆DCT手段22
で処理され、復元画像生成手段23にてエンコード時に
用いた参照領域抽出手段32からの参照画像と合成(加
算)されることで、デコーダの処理と同様にして復元さ
れ、復元画像記憶手段24に保存される。
On the other hand, the data quantized by the quantizing means 14 is also input to the inverse quantizing means 21, and the inverse quantizing means 21 dequantizes and the inverse DCT means 22 inverse D.
It is restored by the CT conversion, that is, by the same processing as the decoder. The restored image, for example, the restored I-picture image is stored in the restored image recording means 24 as a local decoded image and becomes a reference image of the image to be encoded next. This processing is performed in order to suppress the difference between the image of the I picture restored by the decoder and the current image, and when another image is transmitted using the I picture as a reference image, the I image restored by the decoder is used. This is because the same image as the picture image must be created on the decoder side. Note that the P picture, like the I picture, is an inverse quantization means 21 and an inverse DCT means 22.
Is processed in the restored image generating means 23 and synthesized (added) with the reference image from the reference area extracting means 32 used at the time of encoding, so that the restored image is restored in the same manner as the decoder processing and stored in the restored image storing means 24. Saved.

【0032】ところで、エンコード過程において符号化
(直交変換および量子化)されたデータ(ビットストリ
ーム)のビットレートを目的のレートに保ち、かつ、よ
りよい復元画像画質を得るためには、従来技術について
先に述べた通り、量子化ステップ幅を適切に制御する必
要がある。そのため、本実施例においては、発生符号量
を計数する符号量計数手段17と、量子化係数を計数す
る量子化係数計数手段18とが設けられており、符号量
制御手段42は両手段17,18からの情報として入力
される発生符号量と平均量子化係数を基に次にエンコー
ドする画像の割り当てビット量を決定し、量子化手段1
4の量子化ステップ幅を変化させて発生符号量を制御す
ることができる。
By the way, in order to keep the bit rate of the data (bit stream) encoded (orthogonal transformation and quantization) at the target rate in the encoding process and to obtain a better restored image quality, the conventional technique is used. As described above, it is necessary to properly control the quantization step width. Therefore, in this embodiment, the code amount counting means 17 for counting the generated code amount and the quantization coefficient counting means 18 for counting the quantized coefficient are provided, and the code amount control means 42 includes both means 17, The quantizing means 1 determines the allocated bit amount of the image to be encoded next based on the generated code amount and the average quantization coefficient input as information from 18.
It is possible to control the generated code amount by changing the quantization step width of No. 4.

【0033】なお、これだけの制御であれば、文献1に
あげた従来の動画像圧縮装置で発生符号量を計数し、発
生符号量と平均量子化係数をもとに次にエンコードする
画像の割り当てビット量を決定しているのとほぼ同様の
処理内容となる。文献1中、49頁の(18)〜(25)式はこ
の制御を表わしているが、この場合、量子化係数の平均
が画質を反映しているという仮定から、I、P、Bピク
チャーの量子化係数が一定の比率(1:Kp:Kb)と
なるように制御されている。
In the case of such control, the number of generated codes is counted by the conventional moving image compression apparatus described in Document 1, and the image to be encoded next is assigned based on the generated code amount and the average quantization coefficient. The processing content is almost the same as that of determining the bit amount. Expressions (18) to (25) on page 49 of Document 1 express this control. In this case, it is assumed that the average of the quantized coefficients reflects the image quality. The quantization coefficient is controlled so as to have a constant ratio (1: Kp: Kb).

【0034】これに対し本実施例では、発生符号量と量
子化係数のみならず、DCT空間の情報を含む直交変換
および量子化(すなわち符号化処理)されたデータ値を
も考慮して発生符号量制御を行うようになっており、そ
のためにデータ値分布計数手段41が設けられている。
図2は本実施例におけるデータ値分布計数手段41の詳
細図であり、同図において、51は量子化手段14から
入力されるデータ値についてマクロブロックの属性を判
別し、そのブロック属性の判別結果に基づいてノンイン
トラマクロブロックに対応するデータを抽出するノンイ
ントラマクロブロック抽出手段である。また、52はノ
ンイントラマクロブロック抽出手段51からのデータの
うち各マクロブロックの画素データ(例えば輝度)の平
均値を表わすDC成分のデータを抽出するDC成分抽出
手段、53はDC成分抽出手段52からのデータのうち
非零成分のデータである非零係数を抽出する非零係数抽
出手段であり、非零係数抽出手段53によって抽出され
た非零係数は計数手段54によって計数される。すなわ
ち、データ値計数手段41は、マクロブロック属性の判
別結果に基づいて特定のブロック属性であるノンイント
ラマクロブロックのDC成分のデータ値を選択的に計数
するとともに、その計数結果を符号量制御手段42に出
力するようになっている。このようにノンイントラマク
ロブロックのDC成分を抽出するのは、本発明がノンイ
ントラマクロブロックに対して有効だからであり、MP
EGではノンイントラマクロブロックの非零係数の数が
量子化歪みの目安となるとともに、DC成分が最も目に
付き易い周波数成分だからである。
On the other hand, in this embodiment, not only the generated code amount and the quantized coefficient but also the orthogonally transformed and quantized (ie, encoded) data value including the information of the DCT space is taken into consideration. The quantity control is performed, and the data value distribution counting means 41 is provided for that purpose.
FIG. 2 is a detailed diagram of the data value distribution counting means 41 in this embodiment. In FIG. 2, reference numeral 51 identifies the attribute of the macroblock with respect to the data value input from the quantizing means 14, and the determination result of the block attribute. It is a non-intra macroblock extracting means for extracting data corresponding to the non-intra macroblock based on. Further, 52 is a DC component extracting means for extracting DC component data representing an average value of pixel data (for example, luminance) of each macroblock among the data from the non-intra macroblock extracting means 51, and 53 is a DC component extracting means 52. Is a non-zero coefficient extracting means for extracting the non-zero coefficient which is the data of the non-zero component from the data from 1. The non-zero coefficient extracted by the non-zero coefficient extracting means 53 is counted by the counting means 54. That is, the data value counting means 41 selectively counts the data value of the DC component of the non-intra macroblock having the specific block attribute based on the determination result of the macroblock attribute, and the count result is the code amount control means. It outputs to 42. The reason for extracting the DC component of the non-intra macroblock in this way is that the present invention is effective for the non-intra macroblock.
This is because in EG, the number of non-zero coefficients of non-intra macroblocks is a measure of quantization distortion, and the DC component is the most noticeable frequency component.

【0035】図3は、本実施例における符号量制御手段
42の詳細図である。同図に示すように、符号量制御手
段42は、Xi,Xp,Xb算出手段61、Xi記憶手段6
2、Xp記憶手段63、Xb記憶手段64、Ti,Tp,Tb
算出手段65、dji,djp,djb算出手段66および
Q算出手段67を有している。Xi,Xp,Xb算出手段6
1は、前記符号量計数手段17、量子化係数計数手段1
8および非零係数計数手段54からの情報を基に、エン
コードした画像の複雑さを表わす値Xi,XpおよびXb
をそれぞれ次式により算出する。
FIG. 3 is a detailed diagram of the code amount control means 42 in this embodiment. As shown in the figure, the code amount control means 42 includes Xi, Xp, Xb calculation means 61 and Xi storage means 6.
2, Xp storage means 63, Xb storage means 64, Ti, Tp, Tb
It has a calculating means 65, a dji, djp, djb calculating means 66 and a Q calculating means 67. Xi, Xp, Xb calculation means 6
1 is the code amount counting means 17 and the quantization coefficient counting means 1
8 and the values Xi, Xp and Xb representing the complexity of the encoded image based on the information from the non-zero coefficient counting means 54.
Are calculated by the following equations.

【0036】 Xi = Si × Qi .. (4) Xp = Sp × Qp × (1-α × (N_nonintra_dc_nonzero_p - N_nonintra_dc_nonzero_b)) .. (5) Xb = Sb × Qb × (1+α × (N_nonintra_dc_nonzero_p - N_nonintra_dc_nonzero_b)) .. (6)Xi = Si × Qi .. (4) Xp = Sp × Qp × (1-α × (N_nonintra_dc_nonzero_p-N_nonintra_dc_nonzero_b)) .. (5) Xb = Sb × Qb × (1 + α × (N_nonintra_dc_nonzero_p-N_nonintra_dc_non )) .. (6)

【0037】ここで、 Xi:Iピクチャーとしてエンコードした画像の複雑さ
を表わす値。 Xp:Pピクチャーとしてエンコードした画像の複雑さ
を表わす値。 Xb:Bピクチャーとしてエンコードした画像の複雑さ
を表わす値。 Si:Iピクチャーとしてエンコードされた画像の発生
ビット量。 Sp:Pピクチャーとしてエンコードされた画像の発生
ビット量。 Sb:Bピクチャーとしてエンコードされた画像の発生
ビット量。 Qi:Iピクチャーとしてエンコードした画像の平均量
子化係数。 Qp:Pピクチャーとしてエンコードした画像の平均量
子化係数。 Qb:Bピクチャーとしてエンコードした画像の平均量
子化係数。
Here, Xi: a value representing the complexity of an image encoded as an I picture. Xp: A value representing the complexity of an image encoded as a P picture. Xb: A value representing the complexity of an image encoded as a B picture. Si: generated bit amount of an image encoded as an I picture. Sp: generated bit amount of an image encoded as a P picture. Sb: generated bit amount of an image encoded as a B picture. Qi: Average quantization coefficient of an image encoded as an I picture. Qp: Average quantization coefficient of the image encoded as a P picture. Qb: Average quantization coefficient of an image encoded as a B picture.

【0038】N_nonintra_dc_nonzero_p:Pピクチャー
としてエンコードした画像のノンイントラマクロブロッ
クDC成分の非零係数の割合。計数手段54の計数値。 N_nonintra_dc_nonzero_b:Bピクチャーとしてエンコ
ードした画像のノンイントラマクロブロックDC成分の
非零係数の割合。計数手段54の計数値。 α:非零係数の割合が画質に及ぼす影響を示す定数(0
≦α)。
N_nonintra_dc_nonzero_p: Ratio of non-zero coefficient of DC component of non-intra macroblock of image encoded as P picture. Count value of the counting means 54. N_nonintra_dc_nonzero_b: Ratio of non-zero coefficient of non-intra macroblock DC component of image encoded as B picture. Count value of the counting means 54. α: A constant (0 that indicates the influence of the non-zero coefficient ratio on the image quality)
≤α).

【0039】また、Xi記憶手段62、Xp記憶手段63
およびXb記憶手段64は、Xi,Xp,Xb算出手段61に
より算出された画像の複雑さを表わす値Xi,Xpおよび
Xbをそれぞれ記憶するようになっており、エンコード
開始時には、Xi記憶手段62、Xp記憶手段63および
Xb記憶手段64にはそれぞれ適切な初期値が設定され
ている。また、Ti,Tp,Tb算出手段65は、Xi記憶手
段62、Xp記憶手段63およびXb記憶手段64からの
データに基づいて次画面をI,PおよびBピクチャーと
してエンコードする場合のそれぞれの割り当てビット量
Ti,Tp,Tbを次式により算出する。なお、次式は1画
面のIピクチャーと1画面以上のP,Bピクチャーから
なる所定のピクチャー集合体(GOP=Group of pictu
res)の合計ビット量を決めておき、その中で、各ピク
チャーに割り当てるビット量を決定してエンコードする
ようにした例である。
The Xi storage means 62 and the Xp storage means 63 are also provided.
The Xb storage means 64 stores the values Xi, Xp, and Xb representing the complexity of the image calculated by the Xi, Xp, and Xb calculation means 61, respectively. At the start of encoding, the Xi storage means 62, Appropriate initial values are set in the Xp storage means 63 and the Xb storage means 64, respectively. Further, the Ti, Tp, Tb calculation means 65 allocates each bit when the next screen is encoded as an I, P and B picture based on the data from the Xi storage means 62, Xp storage means 63 and Xb storage means 64. The quantities Ti, Tp, Tb are calculated by the following equations. Note that the following formula is a predetermined picture aggregate (GOP = Group of pictu) consisting of one screen of I pictures and one or more screens of P and B pictures.
This is an example in which the total bit amount of (res) is determined and the bit amount assigned to each picture is determined and encoded.

【0040】 Ti=max{R/1(1+(NpXp)/(XiKp) +(NbXb)/(XiKb)),bit rate/(8×picture rate)} ..(7) Tp=max{R/1(Np+(NbKbXb)/(KbXp)),bit rate/(8×picture rate) ..(8) Tb=max{R/1(Nb+(NpKbXp)/(KpXb)),bit rate/(8×picture rate) ..(9)Ti = max {R / 1 (1+ (NpXp) / (XiKp) + (NbXb) / (XiKb)), bit rate / (8 × picture rate)} .. (7) Tp = max {R / 1 (Np + (NbKbXb) / (KbXp)), bit rate / (8 × picture rate) .. (8) Tb = max (R / 1 (Nb + (NpKbXp) / (KpXb)), bit rate / (8 × picture rate) .. (9)

【0041】ここで、 Ti:次画面をIピクチャーとしてエンコードする場合の
割り当てビット量。 Tp:次画面をPピクチャーとしてエンコードする場合の
割り当てビット量。 Tb:次画面をBピクチャーとしてエンコードする場合の
割り当てビット量。 R :GOPの中で残されているビット量。 Np:GOPの中でまだエンコードされていないPピクチ
ャーの数。 Nb:GOPの中でまだエンコードされていないBピクチ
ャーの数。
Here, Ti: allocated bit amount when the next screen is encoded as an I picture. Tp: Allocation bit amount when the next screen is encoded as a P picture. Tb: Allocated bit amount when the next screen is encoded as a B picture. R: Amount of bits left in GOP. Np: The number of P pictures that have not been encoded in the GOP. Nb: The number of B pictures that have not been encoded in the GOP.

【0042】Kp:Iピクチャーの量子化スケールコード
を基準としたPピクチャーの量子化スケールコードの比
率。 Kb:Iピクチャーの量子化スケールコードを基準とした
Bピクチャーの量子化スケールコードの比率。 max{a,b}:aとbのうち大きい方の値を返す関数。
Kp: P picture quantized scale code ratio based on the I picture quantized scale code. Kb: Ratio of B picture quantization scale code with reference to I picture quantization scale code. max {a, b}: A function that returns the larger value of a and b.

【0043】このようにして割り当てビット量が算出さ
れると、各画面をその割り当てビット量におさめるた
め、各マクロブロックの量子化係数が適切に制御される
ことになる。そのために導入されている上式中のdj
i,djp,djbというパラメータは、仮想的なバッフ
ァの残量を示し、dji,djp,djb算出手段66に
よって次式により算出される(文献1中(28)〜(30)式に
相当する)。
When the allocated bit amount is calculated in this way, each screen is contained in the allocated bit amount, so that the quantization coefficient of each macroblock is appropriately controlled. Dj in the above formula introduced for that purpose
The parameters i, djp, and djb indicate the remaining capacity of the virtual buffer, and are calculated by the following formula by the dji, djp, and djb calculating means 66 (corresponding to formulas (28) to (30) in Literature 1). .

【0044】 dji = d0i+ Bj-1 − Ti × (j-1)/ MBcnt ..(10) djp = d0p+ Bj-1 − Tp × (j-1)/ MBcnt ..(11) dji = d0i+ Bj-1 − Tb × (j-1)/ MBcnt ..(12) ここで、 dji:Iピクチャー用仮想バッファの残量 djp:Pピクチャー用仮想バッファの残量 djb:Bピクチャー用仮想バッファの残量Dji = d0i + Bj-1−Ti × (j-1) / MBcnt .. (10) djp = d0p + Bj-1−Tp × (j-1) / MBcnt .. (11) djii = d0i + Bj- 1-Tb x (j-1) / MBcnt .. (12) where, dji: remaining amount of virtual buffer for I picture djp: remaining amount of virtual buffer for P picture djb: remaining amount of virtual buffer for B picture

【0045】d0p:Pピクチャー用仮想バッファの最初
のマクロブロックエンコード開始時の残量。初期値は
0。 d0b:Bピクチャー用仮想バッファの最初のマクロブロ
ックエンコード開始時の残量。初期値は0。 Bj-1:画面内でエンコード済のマクロブロックに要した
ビット量。 j-1:画面内でエンコード済のマクロブロック数。 MBcnt:画面内のマクロブロック数。
D0p: The remaining amount of the P picture virtual buffer at the start of the first macroblock encoding. The initial value is 0. d0b: Remaining amount of the B picture virtual buffer at the start of the first macroblock encoding. The initial value is 0. Bj-1: Amount of bits required for the encoded macroblock on the screen. j-1: Number of macroblocks encoded in the screen. MBcnt: Number of macroblocks on the screen.

【0046】上記dji,djp,djb を用い、次にエ
ンコードするマクロブロックの量子化係数Qを、Q算出
手段67により次の式に従って算出する(文献1の(31)
〜(32)式)。 Qj=dj × 31/(2×bit rate/picture rate) ..(13) ここで、 Qj:j番目のマクロブロックの量子化係数(quantise
r scale code)。 dj:ピクチャータイプに応じた仮想バッファ残量、即
ち、dji ,djpまたはdjb 。
Using the above-mentioned dji, djp, and djb, the quantized coefficient Q of the macroblock to be encoded next is calculated by the Q calculation means 67 according to the following equation ((31) in Document 1).
~ (32) formula). Qj = dj × 31 / (2 × bit rate / picture rate) .. (13) where, Qj: quantization coefficient (quantise) of the j-th macroblock
r scale code). dj: Virtual buffer remaining amount according to the picture type, that is, dji, djp or djb.

【0047】このようにマクロブロック単位で設定され
る量子化係数を用いて、量子化手段14による適切な量
子化がなされ、その量子化に用いられた量子化係数は量
子化係数計数手段18にて計数される。そして、量子化
係数計数手段18の係数値が次の画面の割り当てビット
量を算出する際に用いられる。
As described above, the quantization coefficient set in the macro block unit is used to perform appropriate quantization by the quantization means 14, and the quantization coefficient used for the quantization is sent to the quantization coefficient counting means 18. Is counted. Then, the coefficient value of the quantization coefficient counting means 18 is used when calculating the allocated bit amount of the next screen.

【0048】上述のように、非零係数の頻度を考慮して
符号量制御を行うようにすると、例えば、N_nonintra_d
c_nonzero_p は大きく、N_nonintra_dc_nonzero_b は小
さいフェード画像のような場合、従来の符号量制御(文
献1に記載されたもの)と比較して、Pピクチャーとし
てエンコードした画像の複雑さを表わす値Xp が小さ
く、Bピクチャーとしてエンコードした画像の複雑さを
表わす値Xb が大きくなる。このような値Xp ,Xb の
変化は、次画面をPピクチャーとしてエンコードする場
合の割り当てビット量Tp を小さくし、次画面をBピク
チャーとしてエンコードする場合の割り当てビット量T
b を大きくする役割を果たす。したがって、Pピクチャ
ー用仮想バッファの残量djp が小さく、Bピクチャー
用仮想バッファの残量djb が大きくなり、結果的に、
Pピクチャーの量子化係数が大きくなり、Bピクチャー
の量子化係数が小さくなる。この制御は、上述したデッ
ドゾーンの効果、すなわち、量子化後のDCT係数QF
[v][u]=0の幅が他の値の場合よりも広くなる(そのた
めに量子化後のDCT係数QF[v][u]=0の時の量子化
誤差が他の値の場合の量子化誤差よりも大きくなってし
まい、同一の量子化係数であっても量子化後のDCT係
数QF[v][u]の値が異なると量子化誤差が異なって量子
化係数が歪み量を正確に反映しなくなる)現象を打ち消
すように作用するので、フェード画像等に対してPピク
チャーとBピクチャーの歪みの差が増加するのを防止す
ることができる。その結果、PピクチャーとBピクチャ
ーの間で歪み量に大きな差が発生することによりPピク
チャーとBピクチャーの繰返し周期で歪み量が増大する
フリッカ現象によって復元画像が見苦しくなるといった
従来の問題が解消され、良好な復元画像が得られること
になる。しかも、本実施例の動画像圧縮装置は、データ
値計数手段41を用いてDCT係数の量子化後のデータ
を計数することにより、実際の復元画像の歪み(SN
R)を計算することなく歪み量を推定し、その情報を符
号量制御に反映させるという簡便な処理を採用している
ので、復元画像の歪みを計算するための複雑な演算回路
を設ける必要がなく、低コストの装置にすることができ
る。
As described above, when the code amount control is performed in consideration of the frequency of non-zero coefficients, for example, N_nonintra_d
In the case of a faded image in which c_nonzero_p is large and N_nonintra_dc_nonzero_b is small, the value Xp representing the complexity of the image encoded as the P picture is smaller than that in the conventional code amount control (described in Reference 1), and B The value Xb representing the complexity of the image encoded as a picture becomes large. Such changes in the values Xp and Xb reduce the allocated bit amount Tp when the next screen is encoded as a P picture, and the allocated bit amount T when the next screen is encoded as a B picture.
play a role in increasing b. Therefore, the remaining amount djp of the P picture virtual buffer is small, and the remaining amount djb of the B picture virtual buffer is large. As a result,
The quantized coefficient of the P picture becomes large, and the quantized coefficient of the B picture becomes small. This control is performed by the above-mentioned dead zone effect, that is, the quantized DCT coefficient QF.
The width of [v] [u] = 0 becomes wider than that of other values (for this reason, when the quantization error when the DCT coefficient QF [v] [u] = 0 after quantization is another value) Becomes larger than the quantization error of, and even if the quantization coefficient is the same, if the value of the quantized DCT coefficient QF [v] [u] is different, the quantization error is different and the quantization coefficient is distorted. The effect of canceling out the phenomenon that the P picture and the B picture are distorted in a faded image or the like can be prevented from increasing. As a result, the conventional problem that the restored image becomes unsightly due to the flicker phenomenon in which the distortion amount increases between the P picture and the B picture and the distortion amount increases in the repetition period of the P picture and the B picture is solved. Therefore, a good restored image can be obtained. Moreover, the moving picture compression apparatus of the present embodiment counts the data after the quantization of the DCT coefficient by using the data value counting means 41, so that the distortion of the actual restored image (SN
Since a simple process of estimating the distortion amount without calculating R) and reflecting the information in the code amount control is adopted, it is necessary to provide a complicated arithmetic circuit for calculating the distortion of the restored image. And can be a low-cost device.

【0049】このように、本発明では、DCT空間の情
報を符号量制御に反映させるだけの簡便な方法で、歪み
量(SNR)を一定にするようなレート制御を簡単に行
なうことのできる動画像圧縮方法を実現でき、定ビット
レートで最良の画像を得ることができるとともに、この
方法を実施することにより定ビットレートで最良の画像
を得ることのできる低コストの動画像圧縮装置を提供す
ることができる。
As described above, according to the present invention, a moving image in which the distortion amount (SNR) can be easily controlled by a simple method of reflecting the information of the DCT space in the code amount control can be easily performed. (EN) Provided is a low-cost moving image compression apparatus that can realize an image compression method and can obtain the best image at a constant bit rate, and can implement the method to obtain the best image at a constant bit rate. be able to.

【0050】[0050]

【発明の実施の形態】次に、第2の発明の好ましい実施
の形態について説明する。本実施形態の動画像圧縮装置
は、図4のブロック図に示されるように、動画像または
動画像の予測差分画像を所定のブロック単位に直交変
換、例えばDCT変換する直交変換手段としてのDCT
手段13と、前記直交変換、例えばDCTの結果得られ
る直交変換係数を量子化する量子化手段14とを備え、
前記直交変換および量子化を含む符号化処理により前記
画像の符号化データを発生するようになっている。この
動画像圧縮装置は、さらに、前記量子化手段14の出力
を逆量子化する逆量子化手段22と、逆量子化手段22
によって逆量子化された直交変換係数と量子化前の直交
変換係数との差分を算出する直交変換係数差分算出手段
としての量子化誤差算出手段73と、量子化誤差算出手
段73の出力を計数するデータ値計数手段71と、デー
タ値計数手段71の計数結果に基づいて前記符号化デー
タの前記ブロック単位の発生量を制御する符号量制御手
段72とを具備している。また、前記データ値計数手段
71は、前記データ値について前記直交変換の変換次数
を判別する手段52を有し、該変換次数の判別結果に基
づいて特定の変換次数に対応するデータ値を選択的に計
数するものであってもよい。
BEST MODE FOR CARRYING OUT THE INVENTION Next, a preferred embodiment of the second invention will be described. As shown in the block diagram of FIG. 4, the moving image compression apparatus according to the present embodiment is a DCT as an orthogonal transform unit that performs orthogonal transform, for example, DCT transform, on a moving image or a predicted difference image of the moving image in a predetermined block unit.
Means 13 and quantizing means 14 for quantizing the orthogonal transform coefficient obtained as a result of the orthogonal transform, eg DCT,
The coded data of the image is generated by the coding process including the orthogonal transformation and the quantization. The moving picture compression apparatus further includes an inverse quantizer 22 for inversely quantizing the output of the quantizer 14, and an inverse quantizer 22.
Quantization error calculating means 73 as an orthogonal transform coefficient difference calculating means for calculating the difference between the inverse transform quantized orthogonal transform coefficient and the unquantized orthogonal transform coefficient, and the output of the quantization error calculating means 73 are counted. The data value counting means 71 and the code amount control means 72 for controlling the generation amount of the encoded data in the block unit based on the counting result of the data value counting means 71. Further, the data value counting means 71 has means 52 for discriminating the transformation order of the orthogonal transformation for the data value, and selectively selects the data value corresponding to a particular transformation order based on the discrimination result of the transformation order. It may be one that counts.

【0051】この装置を用いて本発明の動画像圧縮方法
を実施する場合の態様としては、動画像の予測差分画像
を所定のブロック単位に直交変換するとともに、前記直
交変換の結果得られる直交変換係数を量子化して、前記
画像の符号化データを発生する。また、前記量子化後の
直交変換係数を逆量子化して得られる直交変換係数と前
記量子化前の直交変換係数との差分を算出する工程と、
前記差分の総和に基づいて前記符号化データの前記ブロ
ック単位の発生量を制御する工程とを含むことになる。
As a mode for carrying out the moving picture compression method of the present invention using this apparatus, the prediction difference image of the moving picture is orthogonally transformed in a predetermined block unit, and the orthogonal transformation obtained as a result of the orthogonal transformation is carried out. Quantize the coefficients to generate coded data for the image. Further, a step of calculating a difference between the orthogonal transform coefficient obtained by dequantizing the orthogonal transform coefficient after the quantization and the orthogonal transform coefficient before the quantization,
Controlling the generation amount of the encoded data in the block unit based on the sum of the differences.

【0052】なお、ここでいう「直交変換」は好ましく
は離散コサイン変換(DCT)であるが、これに限るも
のではない。また、直交変換の結果得られる「直交変換
係数」はDC成分のみならず他の次数を含むものであっ
てもよく、例えば一次までの次数の直交変換係数を含ん
でも好ましい。
The "orthogonal transformation" here is preferably discrete cosine transformation (DCT), but is not limited to this. Further, the “orthogonal transform coefficient” obtained as a result of the orthogonal transform may include not only the DC component but also other orders, and for example, it is preferable that the orthogonal transform coefficients of orders up to the first order are included.

【0053】[0053]

【実施例】図4および図5は本実施形態の動画像圧縮装
置の一実施例を示す図である。この第2実施例の動画像
圧縮装置は、直交変換係数差分算出手段である量子化誤
差算出手段73とそれに関連する構成が上述の実施例
(第1実施例)と異なるものの、他の大部分はほぼ同様
である。したがって、第1実施例と同一又はそれに相当
する構成には同一符号を付し、ここでは異なる構成部分
についてのみ説明する。
EXAMPLE FIG. 4 and FIG. 5 are views showing an example of the moving image compression apparatus of this embodiment. The moving image compression apparatus of the second embodiment is different from the above-described embodiment (first embodiment) in the quantization error calculation means 73, which is an orthogonal transform coefficient difference calculation means, and the configuration related thereto, but most of the other. Are almost the same. Therefore, the same or corresponding components as those of the first embodiment are designated by the same reference numerals, and only different components will be described here.

【0054】図4に示すように、量子化誤差算出手段7
3は、DCT係数の量子化誤差を計算するもので、DC
T手段13から出力される量子化前のDCT係数と、逆
量子化手段21から出力される逆量子化後のDCT係数
(逆DCT変換前のデータ)との差分を量子化誤差とし
て算出し、この量子化誤差の算出値をデータ値計数手段
71に出力する。
As shown in FIG. 4, the quantization error calculating means 7
3 is for calculating the quantization error of the DCT coefficient.
The difference between the DCT coefficient before quantization output from the T means 13 and the DCT coefficient after inverse quantization output from the inverse quantization means 21 (data before inverse DCT conversion) is calculated as a quantization error, The calculated value of the quantization error is output to the data value counting means 71.

【0055】データ値計数手段71は、図5に示すよう
に、誤差算出手段73からのデータのうち各マクロブロ
ックの画素データ(例えば輝度)の平均値を表わすDC
成分のデータを抽出するDC成分抽出手段82と、この
DC成分抽出手段82からのデータを計数する計数手段
84とを有している。すなわち、データ値計数手段71
は、DCT係数の量子化誤差のうちDC成分のみを抽出
して計数し、その計数結果を符号量制御手段72に送る
ようになっている。
As shown in FIG. 5, the data value counting means 71 is a DC which represents the average value of the pixel data (for example, brightness) of each macroblock among the data from the error calculating means 73.
It has a DC component extracting means 82 for extracting the component data and a counting means 84 for counting the data from the DC component extracting means 82. That is, the data value counting means 71
Of the DCT coefficient, only the DC component of the quantization error is extracted and counted, and the counting result is sent to the code amount control means 72.

【0056】符号量制御手段72は、第1実施例の符号
量制御手段42と略同様に構成されており、Xi,Xp,X
b算出手段61と同様なXi,Xp,Xb算出手段、Xi記憶
手段62、Xp記憶手段63、Xb記憶手段64、Ti,T
p,Tb算出手段65、dji,djp,djb算出手段66お
よびQ算出手段67を含むものである。そして、そのX
i,Xp,Xb算出手段は、データ値計数手段71からの量
子化誤差DC成分の計数値を基に、エンコードした画像
の複雑さを表わす値Xi,XpおよびXb をそれぞれ次式
により算出する。
The code amount control means 72 is constructed in substantially the same manner as the code amount control means 42 of the first embodiment, and has Xi, Xp, X.
Xi, Xp, Xb calculation means similar to the b calculation means 61, Xi storage means 62, Xp storage means 63, Xb storage means 64, Ti, T
It includes p, Tb calculating means 65, dji, djp, djb calculating means 66 and Q calculating means 67. And that X
The i, Xp, Xb calculating means calculates the values Xi, Xp and Xb representing the complexity of the encoded image based on the count value of the quantization error DC component from the data value counting means 71 by the following equations.

【0057】 Xi = Si × Qi × (1+ β×dc_distortion_i) .. (14) Xp = Sp × Qp × (1+ β×dc_distortion_p) .. (15) Xb = Sb × Qb × (1+ β×dc_distortion_b) .. (16)Xi = Si × Qi × (1+ β × dc_distortion_i) .. (14) Xp = Sp × Qp × (1+ β × dc_distortion_p) .. (15) Xb = Sb × Qb × (1+ β × dc_distortion_b) .. (16)

【0058】ここで、 Xi:Iピクチャーとしてエンコードした画像の複雑さ
を表わす値。 Xp:Pピクチャーとしてエンコードした画像の複雑さ
を表わす値。 Xb:Bピクチャーとしてエンコードした画像の複雑さ
を表わす値。 Si:Iピクチャーとしてエンコードされた画像の発生
ビット量。 Sp:Pピクチャーとしてエンコードされた画像の発生
ビット量。 Sb:Bピクチャーとしてエンコードされた画像の発生
ビット量。
Here, Xi: a value indicating the complexity of an image encoded as an I picture. Xp: A value representing the complexity of an image encoded as a P picture. Xb: A value representing the complexity of an image encoded as a B picture. Si: generated bit amount of an image encoded as an I picture. Sp: generated bit amount of an image encoded as a P picture. Sb: generated bit amount of an image encoded as a B picture.

【0059】Qi:Iピクチャーとしてエンコードした
画像の平均量子化係数。 Qp:Pピクチャーとしてエンコードした画像の平均量
子化係数。 Qb:Bピクチャーとしてエンコードした画像の平均量
子化係数。 β:DC成分の歪みの総和が画質に及ぼす影響を示す定
数(0≦β)。 dc_distortion_i:IピクチャーのDC成分の歪みの総
和。 dc_distortion_p:PピクチャーのDC成分の歪みの総
和。 dc_distortion_b:BピクチャーのDC成分の歪みの総
和。
Qi: Average quantization coefficient of an image encoded as an I picture. Qp: Average quantization coefficient of the image encoded as a P picture. Qb: Average quantization coefficient of an image encoded as a B picture. β: A constant (0 ≦ β) indicating the influence of the total sum of distortions of DC components on image quality. dc_distortion_i: Sum of distortion of DC component of I picture. dc_distortion_p: Sum of distortion of DC component of P picture. dc_distortion_b: Sum of distortion of DC component of B picture.

【0060】そして、算出された値Xi,XpおよびXb
に基づき、第1実施例と同様な処理を実行して量子化手
段14による量子化の量子化ステップ幅を変化させ、発
生符号量を制御する。
Then, the calculated values Xi, Xp and Xb
Based on the above, the same processing as in the first embodiment is executed to change the quantization step width of the quantization by the quantization means 14 and control the generated code amount.

【0061】このようにDC成分の歪みの総和を考慮し
て符号量制御を行うようにすると、例えば、Pピクチャ
ーのDC成分の歪みの総和dc_distortion_p は小さく、
BピクチャーのDC成分の歪みの総和dc_distortion_b
は大きいフェード画像のような場合、従来の符号量制御
(文献1に記載されたもの)と比較して、Pピクチャー
としてエンコードした画像の複雑さを表わす値Xp がよ
り小さく、Bピクチャーとしてエンコードした画像の複
雑さを表わす値Xb がより大きくなる。このような値X
p ,Xb の変化は、次画面をPピクチャーとしてエンコ
ードする場合の割り当てビット量Tp を小さくし、次画
面をBピクチャーとしてエンコードする場合の割り当て
ビット量Tb を大きくする役割を果たすので、Pピクチ
ャー用仮想バッファの残量djp が小さく、Bピクチャ
ー用仮想バッファの残量djb が大きくなり、結果的
に、Pピクチャーの量子化係数が大きくなり、Bピクチ
ャーの量子化係数が小さくなる。この制御は、上述した
デッドゾーン効果による悪影響を打ち消すように作用す
るので、フェード画像等に対してPピクチャーとBピク
チャーの歪み差が増加するのを防止することができ、フ
リッカ現象によって復元画像が見苦しくなるといった従
来の問題を解消して良好な復元画像を得ることができ
る。しかも、本実施例の動画像圧縮装置は、量子化誤差
算出手段73を用いて各DCT係数の量子化誤差を把握
し、その情報を符号量制御に反映させているので、符号
量制御のための歪み推定を正確に行なうことができ、よ
り良好な復元画像を得ることができる。
In this way, when the code amount control is performed in consideration of the total sum of distortions of DC components, for example, the total sum dc_distortion_p of distortions of DC components of P picture is small,
Sum of distortion of DC component of B picture dc_distortion_b
In the case of a large faded image, the value Xp representing the complexity of the image encoded as a P picture is smaller than that in the conventional code amount control (described in Reference 1), and it is encoded as a B picture. The value Xb representing the image complexity becomes larger. Such a value X
The change in p and Xb serves to reduce the allocated bit amount Tp when the next screen is encoded as a P picture and to increase the allocated bit amount Tb when the next screen is encoded as a B picture. The remaining amount djp of the virtual buffer is small and the remaining amount djb of the virtual buffer for B picture is large. As a result, the quantization coefficient of the P picture is large and the quantization coefficient of the B picture is small. This control acts to cancel the adverse effects of the dead zone effect described above, so that it is possible to prevent an increase in the distortion difference between the P picture and the B picture with respect to a faded image or the like, and the restored image is displayed due to the flicker phenomenon. It is possible to solve the conventional problem of being unsightly and obtain a good restored image. Moreover, the moving picture compression apparatus of the present embodiment grasps the quantization error of each DCT coefficient by using the quantization error calculation means 73 and reflects the information in the code amount control. Distortion can be accurately estimated, and a better restored image can be obtained.

【0062】さらに、復元画像の歪みを求めるのではな
く、DCT係数の歪みを算出してこれを符号量制御に反
映させているので、文献2に記載されたような符号量制
御と同様な効果を、より簡単な装置で実現可能になる。
なお、装置としては、構成の簡単な第1実施例を採用す
るか、正確な歪みの推定ができる第2実施例の動画像圧
縮装置を採用するかを選択するのが好ましいが、動画像
圧縮方法としてはこれらの実施例で実行する工程の双方
を含むようにしてもよい。例えば、動画像の種類に応じ
て2つの方法を使い分けることができる。
Furthermore, instead of obtaining the distortion of the restored image, the distortion of the DCT coefficient is calculated and reflected in the code amount control. Therefore, the same effect as the code amount control as described in Reference 2 is obtained. Can be realized with a simpler device.
It should be noted that it is preferable to select, as the device, either the first embodiment, which has a simple configuration, or the moving picture compression device, which can accurately estimate the distortion, according to the second embodiment. The method may include both of the steps performed in these examples. For example, two methods can be used properly according to the type of moving image.

【0063】また、上述の各実施例のように、DC成分
の非零係数のみを符号量制御に反映させるだけでなく、
人間の視覚特性に応じて、他の次数の係数を適応的に反
映させることによって、さらに効果的な符号量制御を行
うことができる。さらに、文献1に記載されるような符
号量制御法でなく他の符号量制御法を採用する場合で
も、非零計数の頻度を符号量制御に反映させることによ
り、同等の効果を得ることは可能である。
Further, as in the above-mentioned embodiments, not only the non-zero coefficient of the DC component is reflected in the code amount control, but
It is possible to perform more effective code amount control by adaptively reflecting the coefficients of other orders according to the human visual characteristics. Further, even when another code amount control method is adopted instead of the code amount control method as described in Document 1, it is possible to obtain the same effect by reflecting the frequency of non-zero counting in the code amount control. It is possible.

【0064】例えば、Tp ,Tb の式について、非零係
数の数を反映させた次式を採用することができる。 Tp=max{R/(Np+(NbKpXb)/(KbXp))×(1-α×(N_nonintra_dc_nonzero_p - N_nonintra_dc_nonzero-b)),bit_rate/(8×picture_rate) ..(8') Tb=max{R/(Nb+(NpKbXp)/(KpXb))×(1+α×(N_nonintra_dc_nonzero_p - N_nonintra_dc_nonzero-b)),bit rate/(8×picture_rate) ..(9')
For example, for the equations Tp and Tb, the following equation reflecting the number of non-zero coefficients can be adopted. Tp = max (R / (Np + (NbKpXb) / (KbXp)) × (1-α × (N_nonintra_dc_nonzero_p-N_nonintra_dc_nonzero-b)), bit_rate / (8 × picture_rate) .. (8 ') Tb = max (R / (Nb + (NpKbXp) / (KpXb)) × (1 + α × (N_nonintra_dc_nonzero_p-N_nonintra_dc_nonzero-b)), bit rate / (8 × picture_rate) .. (9 ')

【0065】ここで、 Xi:Iピクチャーとしてエンコードした画像の複雑さ
を表わす値。 Xp:Pピクチャーとしてエンコードした画像の複雑さ
を表わす値。 Xb:Bピクチャーとしてエンコードした画像の複雑さ
を表わす値。
Here, Xi: a value representing the complexity of an image encoded as an I picture. Xp: A value representing the complexity of an image encoded as a P picture. Xb: A value representing the complexity of an image encoded as a B picture.

【0066】N_nonintra_dc_nonzero_p:Pピクチャー
としてエンコードした画像のノンイントラマクロブロッ
クDC成分の非零係数の割合。計数手段54の計数値。 N_nonintra_dc_nonzero_b:Bピクチャーとしてエンコ
ードした画像のノンイントラマクロブロックDC成分の
非零係数の割合。計数手段54の計数値。 α:非零係数の割合が画質に及ぼす影響を示す定数(0
≦α)。 R :GOPの中で残されているビット量。
N_nonintra_dc_nonzero_p: Proportion of non-zero coefficient of non-intra macroblock DC component of image encoded as P picture. Count value of the counting means 54. N_nonintra_dc_nonzero_b: Ratio of non-zero coefficient of non-intra macroblock DC component of image encoded as B picture. Count value of the counting means 54. α: A constant (0 that indicates the influence of the non-zero coefficient ratio on the image quality)
≤α). R: Amount of bits left in GOP.

【0067】Np:GOPの中でまだエンコードされてい
ないPピクチャーの数。 Nb:GOPの中でまだエンコードされていないBピクチ
ャーの数。 Kp:Iピクチャーの量子化スケールコードを基準とした
Pピクチャーの量子化スケールコードの比率を示す定
数。 Kb:Iピクチャーの量子化スケールコードを基準とした
Bピクチャーの量子化スケールコードの比率を示す定
数。
Np: The number of P pictures that have not been encoded in the GOP. Nb: The number of B pictures that have not been encoded in the GOP. Kp: a constant indicating the ratio of the P picture quantization scale code with respect to the I picture quantization scale code. Kb: A constant indicating the ratio of the B picture quantization scale code with respect to the I picture quantization scale code.

【0068】max{a,b}:aとbのうち大きい方の値を返
す関数。 この場合、算出された割り当てビット量Tp ,Tb を式
(10)〜(13)に代入して量子化係数を求める。このように
すると、例えば、N_nonintra_dc_nonzero_p は大きく、
N_nonintra_dc_nonzero_b は小さいフェード画像のよう
な場合、従来の符号量制御(文献1に記載されたもの)
と比較して、次画面をPピクチャーとしてエンコードす
る場合の割り当てビット量Tp を小さくし、次画面をB
ピクチャーとしてエンコードする場合の割り当てビット
量Tb を大きくすることができ、Pピクチャーの量子化
係数Qjpがより大きくなり、Bピクチャーの量子化係数
Qjbが小さくなる。その結果、Bピクチャーの歪みが
減少する。したがって、Bピクチャーの歪みと上述のデ
ッドゾーン効果により歪み量の減少するPピクチャーと
の歪みが均一化され、フリッカ現象のない良好な復元画
像を得ることができる。
Max {a, b}: A function that returns the larger value of a and b. In this case, the calculated allocation bit amounts Tp and Tb
Substitute in (10) to (13) to obtain the quantized coefficient. By doing this, for example, N_nonintra_dc_nonzero_p is large,
N_nonintra_dc_nonzero_b is the conventional code amount control (such as the one described in Reference 1) in the case of a small fade image.
Compared with, the allocated bit amount Tp when the next screen is encoded as a P picture is reduced, and the next screen is
The allocated bit amount Tb in the case of encoding as a picture can be increased, the quantization coefficient Qjp of the P picture becomes larger, and the quantization coefficient Qjb of the B picture becomes smaller. As a result, B picture distortion is reduced. Therefore, the distortion of the B picture and the distortion of the P picture whose distortion amount decreases due to the dead zone effect described above are equalized, and a good restored image without a flicker phenomenon can be obtained.

【0069】また、量子化係数Qを変更することにより
非零係数の割合をレート制御に反映させる例としては、
次式があげられる。 Qjp=djp × 31/(2×bit rate/picture rate) × (1+α(N_nonintra_dc_nonzero_p - N_nonintra_dc_nonzero_b)) ..(13) Qjb=djp × 31/(2×bit rate/picture rate) × (1-α(N_nonintra_dc_nonzero_p - N_nonintra_dc_nonzero_b)) ..(14)
Further, as an example in which the ratio of non-zero coefficients is reflected in the rate control by changing the quantized coefficient Q,
The following formula can be given. Qjp = djp × 31 / (2 × bit rate / picture rate) × (1 + α (N_nonintra_dc_nonzero_p-N_nonintra_dc_nonzero_b)) .. (13) Qjb = djp × 31 / (2 × bit rate / picture rate) × (1- α (N_nonintra_dc_nonzero_p-N_nonintra_dc_nonzero_b)) .. (14)

【0070】ここで、 Qjp:Pピクチャーのj番目のマクロブロックの量子
化係数。 Qjb:Bピクチャーのj番目のマクロブロックの量子
化係数。 djp:Pピクチャーのマクロブロック毎の仮想バッフ
ァ残量を示す値。 djb:Bピクチャーのマクロブロック毎の仮想バッフ
ァ残量を示す値。 α:非零係数の割合が画質に及ぼす影響を示す定数(0
≦α)。 このようにすると、例えば、N_nonintra_dc_nonzero_p
は大きく、N_nonintra_dc_nonzero_b は小さいフェード
画像のような場合、従来の符号量制御(文献1に記載さ
れたもの)と比較して、Pピクチャーの量子化係数Qjp
を大きく、Bピクチャーの量子化係数Qjbを小さくす
ることができ、Bピクチャーの歪みが減少する。したが
って、Bピクチャーの歪みと上述のデッドゾーン効果に
より歪み量の減少するPピクチャーとの歪みが均一化さ
れ、フリッカ現象のない良好な復元画像を得ることがで
きる。
Here, Qjp: the quantization coefficient of the j-th macroblock of the P picture. Qjb: Quantization coefficient of the jth macroblock of B picture. djp: A value indicating the virtual buffer remaining amount for each macroblock of the P picture. djb: A value indicating the virtual buffer remaining amount for each macroblock of the B picture. α: A constant (0 that indicates the influence of the non-zero coefficient ratio on the image quality)
≤α). With this, for example, N_nonintra_dc_nonzero_p
Is large and N_nonintra_dc_nonzero_b is small, in the case of a faded image, compared to the conventional code amount control (described in Reference 1), the quantization coefficient Qjp of the P picture
Can be made large and the quantization coefficient Qjb of the B picture can be made small, and the distortion of the B picture can be reduced. Therefore, the distortion of the B picture and the distortion of the P picture whose distortion amount decreases due to the dead zone effect described above are equalized, and a good restored image without a flicker phenomenon can be obtained.

【0071】また、上述の各実施例では、MPEGを例
としたが、MPEG以外の動画像圧縮方法であっても、
逆量子化のステップに異なる偏りがある場合は、上述の
実施例と同様な技術思想に基づいて、その偏りに応じた
量子化値の分布を求めて符号量制御に反映させることに
より、その逆量子化ステップに応じた符号量制御を実現
することが可能である。
Although MPEG is taken as an example in each of the above-mentioned embodiments, moving image compression methods other than MPEG may be used.
If the inverse quantization steps have different biases, based on the same technical idea as the above-described embodiment, the distribution of the quantized values according to the biases is obtained and reflected in the code amount control, and the inverse It is possible to realize code amount control according to the quantization step.

【0072】[0072]

【発明の効果】請求項1に記載の発明によれば、直交変
換又はその量子化により得られるデータ、すなわち直交
変換の変換係数の分布情報に基づいて符号発生量を制御
するようにしているので、実空間でなく直交変換空間の
情報(空間周波数領域の情報)を符号量制御に反映させ
ることにより、復元画像の歪み量算出を行うことなく歪
み量を推定して定ビットレートで最良の画像を得ること
ができる。
According to the first aspect of the present invention, the code generation amount is controlled based on the data obtained by the orthogonal transform or the quantization thereof, that is, the distribution information of the transform coefficient of the orthogonal transform. , By reflecting the information of the orthogonal transform space (information of the spatial frequency domain) instead of the real space in the code amount control, the distortion amount can be estimated without calculating the distortion amount of the restored image, and the best image can be obtained at a constant bit rate. Can be obtained.

【0073】請求項2に記載の発明によれば、前記量子
化後に前記直交変換係数の直流成分が非零となるブロッ
クの数に応じて符号発生量を制御するようにしているの
で、ノンイントラマクロブロックの非零係数の数を量子
化歪みの目安とし、最も目に付き易い周波数成分の画像
について特に良好な画像を得ることができる。請求項3
に記載の発明によれば、量子化後の直交変換係数を逆量
子化して得られる直交変換係数と前記量子化前の直交変
換係数との差分を算出し、該差分の総和に基づいて符号
量を制御するようにしているので、実空間における画像
の歪みを算出することなく、歪みを正確に推定すること
ができ、良好な画像を得ることができる。
According to the second aspect of the present invention, the code generation amount is controlled according to the number of blocks in which the DC component of the orthogonal transform coefficient becomes non-zero after the quantization. By using the number of non-zero coefficients of the macroblock as a measure of quantization distortion, it is possible to obtain a particularly good image of the image of the frequency component that is most noticeable. Claim 3
According to the invention described in, the difference between the orthogonal transform coefficient obtained by dequantizing the orthogonal transform coefficient after quantization and the orthogonal transform coefficient before quantization is calculated, and the code amount based on the sum of the differences. Is controlled, the distortion can be accurately estimated without calculating the distortion of the image in the real space, and a good image can be obtained.

【0074】請求項4に記載の発明は、量子化手段によ
る量子化の結果得られるデータ値または量子化の途中段
階で得られるデータ値を計数するデータ値計数手段と、
該データ値計数手段の計数結果に応じ符号化データのブ
ロック単位の発生量を制御する符号量制御手段とを設け
ているので、実空間でなく直交変換空間の係数情報を符
号量制御に反映させることにより、復元画像の歪み量算
出を行うことなく歪み量を推定して定ビットレートで最
良の画像を得ることのできる低コストの動画像圧縮装置
を提供することができる。
According to a fourth aspect of the present invention, data value counting means for counting the data value obtained as a result of the quantization by the quantization means or the data value obtained in the middle of the quantization,
Since the code amount control unit for controlling the generation amount of the encoded data in block units according to the counting result of the data value counting unit is provided, the coefficient information of the orthogonal transform space, not the real space, is reflected in the code amount control. Accordingly, it is possible to provide a low-cost moving image compression apparatus capable of estimating the distortion amount and obtaining the best image at a constant bit rate without calculating the distortion amount of the restored image.

【0075】請求項5に記載の発明によれば、ブロック
単位の画像のブロック属性を判別する手段を有し、該ブ
ロック属性の判別結果に基づいて特定のブロック属性に
対応するデータ値を選択的に計数するので、その計数結
果を符号発生量の制御に反映して効果が得られるノンイ
ントラブロックのみを選択することができ、効率的な処
理を行なうことができる。
According to the invention described in claim 5, there is provided means for discriminating the block attribute of the image in block units, and the data value corresponding to the specific block attribute is selectively selected based on the discrimination result of the block attribute. Since the counting is performed, it is possible to select only the non-intra blocks that have an effect by reflecting the counting result in the control of the code generation amount, and it is possible to perform efficient processing.

【0076】請求項6に記載の発明によれば、前記デー
タ値計数手段が直交変換係数の変換次数を判別する手段
を有し、該変換次数の判別結果に基づいて特定の変換次
数に対応するデータ値を選択的に計数するので、直交変
換により得られる直交変換係数の直流成分や低周波数成
分が非零となるブロックの数を把握することで、より効
果的に符号量、画質の制御を行うことができる。
According to the sixth aspect of the present invention, the data value counting means has means for discriminating the transformation order of the orthogonal transformation coefficient, and corresponds to a specific transformation order based on the discrimination result of the transformation order. Since data values are selectively counted, it is possible to control the code amount and image quality more effectively by grasping the number of blocks in which the DC component and low frequency component of the orthogonal transform coefficient obtained by orthogonal transform are non-zero. It can be carried out.

【0077】請求項7に記載の発明によれば、前記デー
タ値計数手段により、前記データ値について前記直交変
換係数が零値か否かを判別し、該判別結果に基づいて前
記非零値に対応する特定のデータ値を選択的に計数する
ようにしているので、目立ち易いDC(直流)成分ある
いは更に低周波成分が非零となるブロックの数を把握す
ることで、より効果的に符号量、画質の制御を行うこと
ができる。
According to the seventh aspect of the invention, the data value counting means determines whether or not the orthogonal transformation coefficient is zero value for the data value, and based on the determination result, the non-zero value is obtained. Since the corresponding specific data value is selectively counted, the number of blocks in which the noticeable DC (direct current) component or the low-frequency component becomes non-zero is grasped, so that the code amount is more effective. , The image quality can be controlled.

【0078】請求項8に記載の発明によれば、量子化手
段の出力を逆量子化する逆量子化手段と、逆量子化手段
によって逆量子化された直交変換係数と量子化前の直交
変換係数との差分を算出する直交変換係数差分算出手段
と、直交変換係数差分算出手段の出力を計数するデータ
値計数手段と、データ値計数手段の計数結果に基づいて
前記符号化データの前記ブロック単位の発生量を制御す
る符号量制御手段と、を設けているので、実空間におけ
る画像の歪みを算出することなく、歪みを正確に推定す
ることができ、良好な画像を得ることができる。
According to the eighth aspect of the present invention, the inverse quantization means for inversely quantizing the output of the quantization means, the orthogonal transform coefficient inversely quantized by the inverse quantization means, and the orthogonal transform before quantization. Orthogonal transform coefficient difference calculating means for calculating the difference with the coefficient, data value counting means for counting the output of the orthogonal transform coefficient difference calculating means, and the block unit of the encoded data based on the counting result of the data value counting means. Since the code amount control means for controlling the generation amount of is provided, the distortion can be accurately estimated without calculating the distortion of the image in the real space, and a good image can be obtained.

【0079】請求項9に記載の発明によれば、前記デー
タ値計数手段が直交変換の変換次数を判別し、該変換次
数の判別結果に基づいて特定の変換次数に対応するデー
タ値を選択的に計数するので、直交変換により得られる
直交変換係数の直流成分や低周波数成分が非零となるブ
ロックの数を把握することで、より効果的に符号量、画
質の制御を行うことができる。
According to the invention described in claim 9, the data value counting means discriminates the transformation order of the orthogonal transformation, and selectively selects the data value corresponding to the particular transformation order based on the discrimination result of the transformation order. Since the number of blocks in which the DC component and the low frequency component of the orthogonal transform coefficient obtained by the orthogonal transform are non-zero is grasped, the code amount and the image quality can be controlled more effectively.

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

【図1】本発明に係る動画像圧縮装置の実施形態の一例
を示すブロック図である。
FIG. 1 is a block diagram showing an example of an embodiment of a moving image compression apparatus according to the present invention.

【図2】第1実施例のデータ値計数手段の構成を示すブ
ロック図である。
FIG. 2 is a block diagram showing a configuration of a data value counting means of the first embodiment.

【図3】第1実施例の符号量制御手段の構成を示すブロ
ック図である。
FIG. 3 is a block diagram showing a configuration of a code amount control means of the first embodiment.

【図4】本発明に係る動画像圧縮装置の他の実施形態を
示すブロック図である。
FIG. 4 is a block diagram showing another embodiment of the moving picture compression apparatus according to the present invention.

【図5】他の実施形態におけるデータ値計数手段の構成
を示すブロック図である。
FIG. 5 is a block diagram showing a configuration of a data value counting means in another embodiment.

【図6】量子化による歪みと量子化計数の関係を示すグ
ラフである。
FIG. 6 is a graph showing the relationship between the distortion due to quantization and the quantization count.

【図7】フェード画像とP,Bピクチャーの歪み量の相
違を示すグラフである。
FIG. 7 is a graph showing a difference in distortion amount between a fade image and P and B pictures.

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

1 画像信号入力端子 2 ビットストリーム出力端子 11 ブロック化手段 12 差分画像発生手段 13 DCT手段(直交変換手段) 14 量子化手段 15 可変長符号化手段 16 バッフア 17 符号量計数手段 18 量子化係数計数手段 21 逆量子化手段 22 逆DCT手段 23 復元画像生成手段 24 復元画像記憶手段 31 動きベクトル探索手段 32 参照領域抽出手段 41,71 データ値分布計数手段 42,72 符号量制御手段 51 ブロック属性を判別する手段 52 直交変換の変換次数を判別する手段 53 直交変換係数が零値か否かを判別する手段 72 符号量制御手段 73 DCT係数量子化誤差手段(直交変換係数差分
算出手段)
1 Image Signal Input Terminal 2 Bit Stream Output Terminal 11 Blocking Means 12 Difference Image Generating Means 13 DCT Means (Orthogonal Transforming Means) 14 Quantizing Means 15 Variable Length Encoding Means 16 Buffers 17 Code Amount Counting Means 18 Quantization Coefficient Counting Means 21 inverse quantization means 22 inverse DCT means 23 restored image generation means 24 restored image storage means 31 motion vector search means 32 reference area extraction means 41,71 data value distribution counting means 42,72 code amount control means 51 discriminating block attributes Means 52 Means for discriminating the transformation order of orthogonal transformation 53 Means for discriminating whether or not the orthogonal transformation coefficient is zero value 72 Code amount control means 73 DCT coefficient quantization error means (orthogonal transformation coefficient difference calculating means)

───────────────────────────────────────────────────── フロントページの続き (72)発明者 坂口 俊文 東京都渋谷区代々木4丁目36番19号 株式 会社グラフィックス・コミュニケーショ ン・ラボラトリーズ内 (72)発明者 綿谷 由純 東京都渋谷区代々木4丁目36番19号 株式 会社グラフィックス・コミュニケーショ ン・ラボラトリーズ内 ─────────────────────────────────────────────────── ─── Continued Front Page (72) Inventor Toshifumi Sakaguchi 4-36-19 Yoyogi, Shibuya-ku, Tokyo Within Graphics Communication Laboratories, Inc. (72) Inventor Yusumi Wataya 4-chome Yoyogi, Shibuya-ku, Tokyo 36th-19th Stock Company, Graphics Communication Laboratories

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】動画像または動画像の予測差分画像を所定
のブロック単位に直交変換するとともに、前記直交変換
の結果得られる直交変換係数を量子化して、前記画像の
符号化データを発生する動画像圧縮方法であって、 前記直交変換又はその量子化により得られるデータに基
づいて前記符号化データの発生量を制御する工程を含む
ことを特徴とする動画像圧縮方法。
1. A moving image in which a moving image or a predictive difference image of a moving image is orthogonally transformed in a predetermined block unit, and an orthogonal transformation coefficient obtained as a result of the orthogonal transformation is quantized to generate coded data of the image. An image compression method, comprising the step of controlling the generation amount of the encoded data based on the data obtained by the orthogonal transformation or the quantization thereof.
【請求項2】前記量子化後に前記直交変換係数の直流成
分が非零となるブロックの数に応じて前記符号化データ
の発生量を制御することを特徴とする請求項1に記載の
動画像圧縮方法。
2. The moving image according to claim 1, wherein the generation amount of the encoded data is controlled according to the number of blocks in which the DC component of the orthogonal transform coefficient is non-zero after the quantization. Compression method.
【請求項3】動画像または動画像の予測差分画像を所定
のブロック単位に直交変換するとともに、前記直交変換
の結果得られる直交変換係数を量子化して、前記画像の
符号化データを発生する動画像圧縮方法であって、 前記量子化後の直交変換係数を逆量子化して得られる直
交変換係数と前記量子化前の直交変換係数との差分を算
出する工程と、前記差分の総和に基づいて前記符号化デ
ータの発生量を制御する工程とを含むことを特徴とする
動画像圧縮方法。
3. A moving image for generating coded data of the image by orthogonally transforming a moving image or a predictive difference image of the moving image in units of a predetermined block, and quantizing an orthogonal transform coefficient obtained as a result of the orthogonal transform. An image compression method, a step of calculating a difference between the orthogonal transform coefficient obtained by dequantizing the orthogonal transform coefficient after the quantization and the orthogonal transform coefficient before the quantization, and based on the sum of the differences. And a step of controlling the generation amount of the encoded data.
【請求項4】動画像または動画像の予測差分画像を所定
のブロック単位に直交変換する直交変換手段(13)
と、前記直交変換の結果得られる直交変換係数を量子化
する量子化手段(14)と、を備え、前記直交変換およ
び量子化を含む符号化処理により前記画像の符号化デー
タを発生する動画像圧縮装置において、 前記量子化手段(14)による量子化の結果得られるデ
ータ値または量子化の途中段階で得られるデータ値を計
数するデータ値計数手段(41)と、 該データ値計数手段(41)の計数結果に応じ前記符号
化データの発生量を制御する符号量制御手段(42)
と、を設けたことを特徴とする動画像圧縮装置。
4. An orthogonal transformation means (13) for orthogonally transforming a moving image or a predictive difference image of the moving image in a predetermined block unit.
And a quantizer (14) for quantizing an orthogonal transform coefficient obtained as a result of the orthogonal transform, and a moving image for generating encoded data of the image by an encoding process including the orthogonal transform and quantization. In the compression device, a data value counting means (41) for counting a data value obtained as a result of the quantization by the quantization means (14) or a data value obtained in the middle of the quantization, and the data value counting means (41 ) Code amount control means (42) for controlling the generation amount of the encoded data according to the counting result of
And a moving picture compression apparatus.
【請求項5】前記データ値計数手段(41)が、前記デ
ータ値について前記ブロック単位の画像のブロック属性
を判別する手段(51)を有し、該ブロック属性の判別
結果に基づいて特定のブロック属性に対応するデータ値
を選択的に計数することを特徴とする請求項3または4
に記載の動画像圧縮装置。
5. The data value counting means (41) has means (51) for discriminating a block attribute of an image of the block unit with respect to the data value, and a specific block based on the discrimination result of the block attribute. 5. A data value corresponding to an attribute is selectively counted, wherein the data value is counted.
The moving image compression apparatus described in 1.
【請求項6】前記データ値計数手段(41)が、前記デ
ータ値について前記直交変換の変換次数を判別する手段
(52)を有し、該変換次数の判別結果に基づいて特定
の変換次数に対応するデータ値を選択的に計数すること
を特徴とする請求項3または4に記載の動画像圧縮装
置。
6. The data value counting means (41) has means (52) for discriminating a transformation order of the orthogonal transformation with respect to the data value, and based on the discrimination result of the transformation order, a specific transformation order is determined. The moving picture compression apparatus according to claim 3, wherein the corresponding data values are selectively counted.
【請求項7】前記データ値計数手段(41)が、前記デ
ータ値について前記直交変換係数が零値か否かを判別す
る手段(53)を有し、該判別結果に基づいて前記非零
値に対応する特定のデータ値を選択的に計数することを
特徴とする請求項4〜6の何れかに記載の動画像圧縮装
置。
7. The data value counting means (41) has means (53) for judging whether or not the orthogonal transformation coefficient is zero value for the data value, and the non-zero value is based on the judgment result. 7. The moving picture compression apparatus according to claim 4, wherein a specific data value corresponding to is selectively counted.
【請求項8】動画像または動画像の予測差分画像を所定
のブロック単位に直交変換する直交変換手段(13)
と、前記直交変換の結果得られる直交変換係数を量子化
する量子化手段(14)と、を備え、前記直交変換およ
び量子化を含む符号化処理により前記画像の符号化デー
タを発生する動画像圧縮装置において、 前記量子化手段(14)の出力を逆量子化する逆量子化
手段(22)と、 逆量子化手段(22)によって逆量子化された直交変換
係数と量子化前の直交変換係数との差分を算出する直交
変換係数差分算出手段(73)と、 直交変換係数差分算出手段(73)の出力を計数するデ
ータ値計数手段(71)と、 データ値計数手段(71)の計数結果に基づいて前記符
号化データの発生量を制御する符号量制御手段(72)
と、を設けたことを特徴とする動画像圧縮装置。
8. An orthogonal transformation means (13) for orthogonally transforming a moving image or a predictive difference image of the moving image in a predetermined block unit.
And a quantizer (14) for quantizing an orthogonal transform coefficient obtained as a result of the orthogonal transform, and a moving image for generating encoded data of the image by an encoding process including the orthogonal transform and the quantization. In a compression device, an inverse quantization means (22) for inversely quantizing the output of the quantization means (14), an orthogonal transform coefficient inversely quantized by the inverse quantization means (22), and an orthogonal transform before quantization. Orthogonal transform coefficient difference calculating means (73) for calculating the difference with the coefficient, data value counting means (71) for counting the output of the orthogonal transform coefficient difference calculating means (73), and counting by the data value counting means (71) Code amount control means (72) for controlling the generation amount of the encoded data based on the result
And a moving picture compression apparatus.
【請求項9】前記データ値計数手段(71)が、前記デ
ータ値について前記直交変換の変換次数を判別する手段
(82)を有し、該変換次数の判別結果に基づいて特定
の変換次数に対応するデータ値を選択的に計数すること
を特徴とする請求項8に記載の動画像圧縮装置。
9. The data value counting means (71) has means (82) for discriminating the transformation order of the orthogonal transformation with respect to the data value, and based on the discrimination result of the transformation order, a specific transformation order is determined. 9. The moving picture compression apparatus according to claim 8, wherein the corresponding data value is selectively counted.
JP20410895A 1995-08-10 1995-08-10 Moving picture compression method/device Pending JPH0955939A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20410895A JPH0955939A (en) 1995-08-10 1995-08-10 Moving picture compression method/device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20410895A JPH0955939A (en) 1995-08-10 1995-08-10 Moving picture compression method/device

Publications (1)

Publication Number Publication Date
JPH0955939A true JPH0955939A (en) 1997-02-25

Family

ID=16484940

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20410895A Pending JPH0955939A (en) 1995-08-10 1995-08-10 Moving picture compression method/device

Country Status (1)

Country Link
JP (1) JPH0955939A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001022734A1 (en) * 1999-09-21 2001-03-29 Sharp Kabushiki Kaisha Image encoding device
JP2007074100A (en) * 2005-09-05 2007-03-22 Nippon Telegr & Teleph Corp <Ntt> Method of estimating quantization distortion, device for estimating quantization distortion, and program for estimating quantization distortion and recording medium therefor
US7502517B2 (en) 2004-03-29 2009-03-10 Kabushiki Kaisha Toshiba Image coding apparatus including a coded quantity prediction expression retaining unit
JP2011514120A (en) * 2008-03-10 2011-04-28 トムソン ライセンシング Predictive frame selection method and apparatus supporting improved efficiency and subjective quality

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001022734A1 (en) * 1999-09-21 2001-03-29 Sharp Kabushiki Kaisha Image encoding device
US7016420B1 (en) 1999-09-21 2006-03-21 Sharp Kabushiki Kaisha Image encoding device
US7830966B2 (en) 1999-09-21 2010-11-09 Sharp Kabushiki Kaisha Image encoding device
US7502517B2 (en) 2004-03-29 2009-03-10 Kabushiki Kaisha Toshiba Image coding apparatus including a coded quantity prediction expression retaining unit
US8184716B2 (en) 2004-03-29 2012-05-22 Kabushiki Kaisha Toshiba Image coding apparatus, image coding method and image coding program
JP2007074100A (en) * 2005-09-05 2007-03-22 Nippon Telegr & Teleph Corp <Ntt> Method of estimating quantization distortion, device for estimating quantization distortion, and program for estimating quantization distortion and recording medium therefor
JP4490353B2 (en) * 2005-09-05 2010-06-23 日本電信電話株式会社 Quantization distortion estimation method, quantization distortion estimation apparatus, quantization distortion estimation program, and recording medium thereof
JP2011514120A (en) * 2008-03-10 2011-04-28 トムソン ライセンシング Predictive frame selection method and apparatus supporting improved efficiency and subjective quality
US10080034B2 (en) 2008-03-10 2018-09-18 Thomson Licensing Dtv Method and apparatus for predictive frame selection supporting enhanced efficiency and subjective quality

Similar Documents

Publication Publication Date Title
JP2891772B2 (en) Digital image coding method using random scanning of image frames
JP5086422B2 (en) Method and apparatus for encoding motion and prediction weighting parameters
US7308146B2 (en) Digital video compression
US6721359B1 (en) Method and apparatus for motion compensated video coding
JP2618083B2 (en) Image recovery method and apparatus
EP1113673B1 (en) Quantization matrix for still and moving picture decoding
JP3431331B2 (en) Video encoding device, video transmission device, and video conference device
US5892548A (en) Adaptive quantizer with modification of high frequency coefficients
EP2207358A1 (en) Video decoding method and video encoding method
US20060034371A1 (en) Method and apparatus for encoding and/or decoding moving pictures
US6252905B1 (en) Real-time evaluation of compressed picture quality within a digital video encoder
KR20060072070A (en) Method and apparatus for generating a quantisation matrix that can be used for encoding an image or a picture sequence
US20220086454A1 (en) System and method for reducing video coding fluctuation
EP1516493B1 (en) A method and system for optimizing image sharpness during coding
JP3429429B2 (en) Visual error processing method and image coding apparatus using this method
JP2003230142A (en) Method and apparatus for coding image information, and program and recording medium
JPH0955939A (en) Moving picture compression method/device
JP4081727B2 (en) Image encoding apparatus, image encoding method, recording apparatus, and recording method
JP4532607B2 (en) Apparatus and method for selecting a coding mode in a block-based coding system
JPH1066079A (en) Adaptive quantization control device
JPH0711832B2 (en) High-efficiency image coding device
JPH10136354A (en) Video signal encoding method, video signal encoder and recording medium
JPH07312754A (en) Animation image coder
JPH11196423A (en) Device and method for picture processing and presentation medium
JP2003264839A (en) Bit rate conversion apparatus for encoded moving picture data