[go: up one dir, main page]

JPH10285600A - Image encoder, image encoding method and recording medium - Google Patents

Image encoder, image encoding method and recording medium

Info

Publication number
JPH10285600A
JPH10285600A JP8650797A JP8650797A JPH10285600A JP H10285600 A JPH10285600 A JP H10285600A JP 8650797 A JP8650797 A JP 8650797A JP 8650797 A JP8650797 A JP 8650797A JP H10285600 A JPH10285600 A JP H10285600A
Authority
JP
Japan
Prior art keywords
image
quantization step
data
frame
encoded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP8650797A
Other languages
Japanese (ja)
Inventor
Masamichi Kitagawa
雅通 北川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP8650797A priority Critical patent/JPH10285600A/en
Publication of JPH10285600A publication Critical patent/JPH10285600A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Television Signal Processing For Recording (AREA)
  • Color Television Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PROBLEM TO BE SOLVED: To prevent the degradation of the image quality of decoding images by detecting the change of images between screens, abandoning a prediction parameter corresponding to the detected result and performing control so as to output a prescribed basic quantization step. SOLUTION: A quantization step controller 141 calculates the basic quantization step to be the base of a quantization step for quantizing the image of an encoding object by using the prediction parameter as information obtained from already encoded image data and performing learning. In the meantime, a prediction parameter selection circuit 140 controls the quantization step controller 141 so as to abandon the prediction parameter obtained by then and output the prescribed basic quantization step in the case that the images are suddenly changed. Thus, after the images are suddenly changed, without using the prediction parameter obtained from the images before the change, the basic quantization step is obtained.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、画像符号化装置お
よび画像符号化方法、並びに記録媒体に関し、特に、画
像データを、少なくとも量子化することにより符号化す
る画像符号化装置および画像符号化方法、並びに記録媒
体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image encoding device, an image encoding method, and a recording medium, and more particularly to an image encoding device and an image encoding method for encoding image data by at least quantizing the image data. And a recording medium.

【0002】[0002]

【従来の技術】図5は、従来の画像符号化装置の一例の
構成を示している。
2. Description of the Related Art FIG. 5 shows an example of the configuration of a conventional image encoding apparatus.

【0003】入力端子101には、例えば、図6に示す
ような、輝度成分Yが352画素(横)×240画素
(縦)に、クロマ成分CbおよびCrがいずれも174
画素×120画素にディジタル化された1フレームの画
像データが、1秒間に30フレーム単位などで供給され
る。
The input terminal 101 has, for example, a luminance component Y of 352 pixels (horizontal) × 240 pixels (vertical) and chrominance components Cb and Cr of 174 as shown in FIG.
One frame of image data digitized into pixels × 120 pixels is supplied in units of 30 frames per second.

【0004】入力端子101に供給された画像データ
は、その画像データを一時的に蓄え、所定の順番に入れ
替えるための、複数枚の画像の記憶が可能なフレームメ
モリ110を介して、ブロック分割器111および動き
検出器120に転送される。ブロック分割器111は、
フレームメモリ110から供給される画像データのフレ
ームを、例えば、図7に示すように、8×8画素の輝度
成分、クロマ成分Cb,Crのブロックに分割する。こ
こで、同図に示すように、4つの輝度成分Y0乃至Y3
のブロックと、それに対応する1つずつのクロマ成分C
b,Crのブロックとの合計6つのブロックで、マクロ
ブロック(MB)が構成される。
[0004] The image data supplied to the input terminal 101 is stored in a block divider 110 via a frame memory 110 capable of temporarily storing the image data and replacing a plurality of images in a predetermined order. 111 and the motion detector 120. The block divider 111
The frame of the image data supplied from the frame memory 110 is divided into, for example, 8 × 8 pixel blocks of luminance components and chroma components Cb and Cr as shown in FIG. Here, as shown in the figure, four luminance components Y0 to Y3
Block and one corresponding chroma component C
A macroblock (MB) is composed of a total of six blocks including the blocks b and Cr.

【0005】ブロック分割器111からは、画像データ
が、マクロブロック単位で、差分器112に供給され
る。差分器112は、ブロック分割器111からの画像
データと、後述するフレーム間予測画像データとの差分
をとり、その差分値を、後述するフレーム間符号化が行
われるフレームのデータとして、切換スイッチ113の
被切換端子bに供給する。また、切換スイッチ113の
被切換端子aには、ブロック分割器111が出力する画
像データが、後述するフレーム内符号化が行われるフレ
ームのデータとして供給される。
[0005] From the block divider 111, image data is supplied to the differentiator 112 in macroblock units. The differentiator 112 calculates a difference between the image data from the block divider 111 and the inter-frame prediction image data described later, and uses the difference value as the data of a frame on which inter-frame encoding described later is performed. To the switched terminal b. Image data output from the block divider 111 is supplied to a switched terminal a of the changeover switch 113 as data of a frame on which intra-frame encoding described later is performed.

【0006】切換スイッチ113は、被切換端子aまた
はbのうちのいずれかを選択し、これにより選択された
方の端子に供給された画像データが、ブロック単位でD
CT(離散コサイン変換)回路14に供給される。DC
T回路114は、そこに入力される画像データをDCT
処理し、その結果得られるDCT係数を量子化器115
に出力する。量子化器115は、DCT回路114から
のDCT係数を、所定の量子化ステップで量子化し、そ
の結果得られる量子化係数をジグザグスキャン回路11
6に出力する。
The changeover switch 113 selects one of the switched terminals a and b, and the image data supplied to the terminal selected by the switch a or b is converted into D-blocks in units of blocks.
The signal is supplied to a CT (discrete cosine transform) circuit 14. DC
The T circuit 114 converts the input image data into a DCT
And quantizes the resulting DCT coefficients into a quantizer 115
Output to The quantizer 115 quantizes the DCT coefficient from the DCT circuit 114 at a predetermined quantization step, and outputs the resulting quantized coefficient to the zigzag scan circuit 11.
6 is output.

【0007】ジグザグスキャン回路116は、ブロック
単位の量子化係数を、例えば、図8に示すように、いわ
ゆるジグザグスキャンし、その順番で、VLC(可変長
符号化)回路17に出力する。VLC回路117は、ジ
グザグスキャン回路116からの量子化係数をVLC処
理し、その結果得られる可変長符号化データを出力バッ
ファ118に供給する。出力バッファ118は、VLC
回路117からの可変長符号化データを一時記憶するこ
とにより、その出力のデータ量を平滑化して、出力端子
102から出力する。出力端子102から出力されたデ
ータは、例えば、図示せぬ記録媒体に記録などされる。
The zigzag scan circuit 116 performs a so-called zigzag scan of the quantized coefficients in block units, for example, as shown in FIG. 8, and outputs them to a VLC (variable length coding) circuit 17 in that order. The VLC circuit 117 performs VLC processing on the quantized coefficient from the zigzag scan circuit 116 and supplies the resulting variable-length encoded data to the output buffer 118. The output buffer 118 is a VLC
By temporarily storing the variable length coded data from the circuit 117, the output data amount is smoothed and output from the output terminal 102. The data output from the output terminal 102 is recorded on, for example, a recording medium (not shown).

【0008】また、出力バッファ118は、そのデータ
蓄積量を、量子化ステップ制御器119に出力する。量
子化ステップ制御器119は、出力バッファ118から
のデータ蓄積量に基づき、出力バッファ118がオーバ
ーフローおよびアンダーフローしないように量子化ステ
ップを設定し、量子化器115に出力する。上述した量
子化器115では、このようにして量子化ステップ制御
器119から供給される量子化ステップにしたがって量
子化が行われる。
[0008] The output buffer 118 outputs the data storage amount to the quantization step controller 119. The quantization step controller 119 sets a quantization step based on the data accumulation amount from the output buffer 118 so that the output buffer 118 does not overflow or underflow, and outputs the result to the quantizer 115. In the quantizer 115 described above, quantization is performed according to the quantization step supplied from the quantization step controller 119 in this way.

【0009】一方、量子化器115が出力する量子化係
数は、ジグザグスキャン回路116だけでなく、逆量子
化器126にも供給される。逆量子化器126は、量子
化器115からの量子化係数を逆量子化することでDC
T係数とし、逆DCT回路125に出力する。逆DCT
回路125は、DCT係数を逆DCT処理し、その結果
得られるデータを加算器124に供給する。さらに、加
算器124には、フレーム間符号化のフレームを処理す
るときにオンとなる切換スイッチ123を介し、動き補
償器121が出力するフレーム間予測画像データも供給
されるようになされている。加算器124は、これらの
データを加算し、フレームメモリ122に供給して記憶
させる。
On the other hand, the quantized coefficients output from the quantizer 115 are supplied not only to the zigzag scan circuit 116 but also to an inverse quantizer 126. The inverse quantizer 126 inversely quantizes the quantization coefficient from the quantizer 115, thereby
The T coefficient is output to the inverse DCT circuit 125. Inverse DCT
The circuit 125 performs an inverse DCT process on the DCT coefficient, and supplies the resulting data to the adder 124. Further, the adder 124 is also supplied with inter-frame predicted image data output from the motion compensator 121 via a changeover switch 123 which is turned on when processing an inter-frame encoded frame. The adder 124 adds these data and supplies the data to the frame memory 122 for storage.

【0010】そして、動き補償器121は、動き検出器
120から供給される動きベクトルにしたがって、フレ
ームメモリ122に記憶されたデータを動き補償し、そ
の結果得られるフレーム間予測画像データを、差分器1
12および切換スイッチ123に供給する。
The motion compensator 121 motion-compensates the data stored in the frame memory 122 in accordance with the motion vector supplied from the motion detector 120, and outputs the resulting inter-frame predicted image data to a differentiator. 1
12 and the changeover switch 123.

【0011】次に、図5の画像符号化装置における符号
化処理について、さらに説明する。
Next, the encoding process in the image encoding device of FIG. 5 will be further described.

【0012】なお、図5の画像符号化装置においては、
例えば、カラー動画像符号化方式の国際標準化作業グル
ープである、いわゆるMPEG(Moving Picture Exper
ts Group)におけるMPEG1の規格に準拠した符号化
が行われるものとする。
In the image coding apparatus shown in FIG.
For example, a so-called MPEG (Moving Picture Exper), which is an international standardization working group for color moving picture coding,
ts Group) in accordance with the MPEG1 standard.

【0013】また、ここでは、以下のように各フレーム
を定義することとする。
Here, each frame is defined as follows.

【0014】まず、表示順にフレームを並べたとき、各
フレームを、その先頭から、I0,B1,B2,P3,
B4,B5,P6,B7,B8,I9,B10,B1
1,B12,・・・と記述する。上述のI,P,Bは、
そのフレームがIピクチャ、Pピクチャ、Bピクチャで
あることを示しており、I,P,Bに続く数字は、表示
順序を表している。
First, when the frames are arranged in the display order, the respective frames are referred to as I0, B1, B2, P3,
B4, B5, P6, B7, B8, I9, B10, B1
1, B12,... The above I, P, B are
This indicates that the frame is an I picture, a P picture, and a B picture, and the numbers following I, P, and B indicate the display order.

【0015】MPEGでは、まず画像I0が符号化され
る。次に、画像P3が符号化されるが、画像P3そのも
のが符号化されるのではなく、画像P3とI0との差分
が符号化される。さらに、その次に、画像B1が符号化
されるが、画像B1そのものが符号化されるのではな
く、画像B1と、画像I0若しくはP3のうちのいずれ
か一方、またはその両方の平均値との差分が符号化され
る。この場合、画像I0,P3、またはその両方の平均
値のうちの、いわゆる予測残差を最も小さくするもの
(符号化して得られるデータ量が最も少なくなるもの)
が選択され、それと画像B1と差分が符号化される。
In MPEG, first, an image I0 is encoded. Next, although the image P3 is encoded, the difference between the image P3 and I0 is encoded instead of encoding the image P3 itself. Further, next, the image B1 is encoded. However, the image B1 itself is not encoded, but the image B1 and the average value of one or both of the images I0 and P3 or both are obtained. The difference is encoded. In this case, of the average values of the images I0, P3, or both, the one that minimizes the so-called prediction residual (the one that minimizes the amount of data obtained by encoding)
Is selected, and the image B1 and the difference are encoded.

【0016】画像B1の符号化後は、画像B2が符号化
されるが、画像B2そのものが符号化されるのではな
く、やはり、画像B2と、画像I0若しくはP3のうち
のいずれか一方、またはその両方の平均値との差分が符
号化される。また、この場合も、画像I0,P3、また
はその両方の平均値のうちの予測残差を最も小さくする
ものが選択され、それと画像B2と差分が符号化され
る。
After the picture B1 is coded, the picture B2 is coded. However, the picture B2 itself is not coded, and the picture B2 and one of the pictures I0 or P3, or The difference between the two averages is encoded. Also in this case, the one that minimizes the prediction residual among the average values of the images I0 and P3 or both is selected, and the difference between the prediction residual and the image B2 is encoded.

【0017】その後、画像P6が符号化されるが、画像
P6そのものが符号化されるのではなく、画像P6とP
3との差分が符号化される。以下、同様の手順で符号化
が行われていく。
Thereafter, the image P6 is encoded. However, the image P6 is not encoded, but the images P6 and P6 are encoded.
3 is coded. Hereinafter, encoding is performed in a similar procedure.

【0018】ここで、符号化対象の画像と、その際に差
分をとる相手となる画像との対応関係を、符号化順に、
以下に示す。 符号化順 符号化対象の画像 差分をとる相手となる画像 (1) I0 − (2) P3 I0またはP3 (3) B1 I0またはP3 (4) B2 I0またはP3 (5) P6 P3 (6) B4 P3またはP6 (7) B5 P3またはP6 (8) P9 P6 (9) B7 P6またはP9 (10) B8 P6またはP9 (11) I9 − (12) P12 I9 (13) B10 I9またはP12 (14) B11 I9またはP12 ・ ・ ・
Here, the correspondence between the image to be encoded and the image to be taken as a difference at that time is expressed in the order of encoding as follows:
It is shown below. Encoding order Image to be encoded Image to be taken as the difference partner (1) I0-(2) P3 I0 or P3 (3) B1 I0 or P3 (4) B2 I0 or P3 (5) P6 P3 (6) B4 P3 or P6 (7) B5 P3 or P6 (8) P9 P6 (9) B7 P6 or P9 (10) B8 P6 or P9 (11) I9-(12) P12 I9 (13) B10 I9 or P12 (14) B11 I9 or P12

【0019】以上のように、符号化順序は、I0,P
3,B1,B2,P6,B4,B5,P9,B7,B
8,I9,P12,B10,B11,・・・となり、表
示順序とは異なる順序になる。符号化後のデータは、こ
のような順番で出力される。
As described above, the encoding order is I0, P
3, B1, B2, P6, B4, B5, P9, B7, B
8, I9, P12, B10, B11,..., Which is different from the display order. The encoded data is output in such an order.

【0020】なお、PピクチャおよびBピクチャについ
ては、上述したように、他の画像との差分が符号化され
るのが通常であるが、画像そのものを符号化した方が、
差分を符号化するよりも、そのデータ量が少なくなる場
合には、画像そのものが符号化される。
As described above, the difference between a P picture and a B picture is usually encoded as described above. However, it is better to encode the image itself.
If the data amount is smaller than encoding the difference, the image itself is encoded.

【0021】図5の画像符号化装置では、以上のように
して符号化処理が行われる。
In the image coding apparatus shown in FIG. 5, the coding process is performed as described above.

【0022】従って、1枚目の画像I0の符号化時に
は、その画像データが、フレームメモリ110から読み
出され、ブロック分割器111に供給されてブロック化
される。ブロック分割器111によるブロック化によ
り、画像データは、上述したY0乃至Y3、Cb,Cr
のブロックにされ、その順に出力される。Iピクチャの
符号化時においては、切換スイッチ113は、被切換端
子aを選択しており、従って、ブロック分割器111が
出力する画像データは、切換スイッチ113を介して、
DCT回路114に供給される。DCT回路114で
は、そこに供給されるブロック単位の画像データに対し
て、縦横2次元のDCT処理が施され、これにより時間
軸上の画像データが、周波数軸上のデータとしてのDC
T係数に変換される。
Therefore, when encoding the first image I0, the image data is read from the frame memory 110 and supplied to the block divider 111 to be divided into blocks. By the block division by the block divider 111, the image data becomes Y0 to Y3, Cb, Cr described above.
And output in that order. At the time of encoding an I picture, the changeover switch 113 has selected the switched terminal a, and therefore, the image data output from the block divider 111 is transmitted through the changeover switch 113 through the changeover switch 113.
It is supplied to the DCT circuit 114. The DCT circuit 114 performs a two-dimensional vertical / horizontal DCT process on the image data in block units supplied thereto, whereby the image data on the time axis is converted into DC data as data on the frequency axis.
It is converted to a T coefficient.

【0023】このDCT係数は、量子化器115に供給
され、そこで、量子化ステップ制御器119からの量子
化ステップにしたがって量子化され、量子化係数とされ
る。この量子化係数は、ジグザグスキャン回路116
で、図8に示したようにジグザグスキャンされて、その
順番で出力される。ここで、量子化係数、即ち、量子化
されたDCT係数をジグザグスキャンして出力すると、
後に出力されるものほど周波数成分の高いDCT係数に
なる。一般に、高次のDCT係数の値は小さく、従っ
て、ブロックを同一の量子化ステップで量子化すると、
それにより得られる量子化値のうちの高次のDCT係数
に対応するものは、0となる頻度が高くなる。その結
果、量子化されたDCT係数をジグザグスキャンして出
力すると、後に出力されるものは0となる頻度が高くな
り、結果的に高域の成分が切り落とされることになる。
The DCT coefficient is supplied to a quantizer 115, where the DCT coefficient is quantized according to a quantization step from a quantization step controller 119 to be a quantized coefficient. This quantized coefficient is supplied to a zigzag scan circuit 116.
Then, zigzag scanning is performed as shown in FIG. Here, when the quantized coefficient, that is, the quantized DCT coefficient is zigzag scanned and output,
The later the output, the higher the DCT coefficient of the frequency component. In general, the values of the higher order DCT coefficients are small, so if a block is quantized with the same quantization step,
Of the quantized values obtained thereby, those corresponding to higher-order DCT coefficients have a higher frequency of becoming 0. As a result, when the quantized DCT coefficients are output by zigzag scanning, the frequency of later output becomes 0 frequently, and as a result, high-frequency components are cut off.

【0024】ジグザグスキャン回路116から出力され
た量子化係数は、VLC回路117に供給され、そこ
で、いわゆるハフマンコーディングなどの可変長符号化
処理が施される。この結果得られる可変長符号化データ
は、出力バッファ118に一旦蓄えられた後、一定のビ
ットレートで出力される。従って、出力バッファ118
は、不規則に発生するデータを一定のビットレートで出
力することができるようにするための、いわば緩衝のた
めのメモリの役割を果たす。
The quantized coefficients output from the zigzag scan circuit 116 are supplied to a VLC circuit 117, where they are subjected to variable-length coding such as Huffman coding. The variable-length coded data obtained as a result is temporarily stored in the output buffer 118 and then output at a constant bit rate. Therefore, the output buffer 118
Plays a role as a memory for buffering so that irregularly generated data can be output at a constant bit rate.

【0025】以上のように、Iピクチャ(Intra Pictur
e)である画像I0は、それ単独で符号化されるが、こ
のような符号化は、フレーム内(イントラ(Intra))
符号化と呼ばれる。なお、デコーダでは、Iピクチャ
は、上述の逆の手順にしたがってデコードされる。
As described above, the I picture (Intra Pictur)
The image I0 which is e) is encoded by itself, but such encoding is performed within a frame (Intra).
Called encoding. In the decoder, the I picture is decoded according to the reverse procedure.

【0026】次に、2枚目の画像P3の符号化について
説明する。2枚目以降の画像もIピクチャとして符号化
することが可能であるが、それでは、圧縮率が低くな
る。そこで、連続する画像には相関があることを利用し
て、2枚目以降の画像は、次のように符号化される。
Next, the encoding of the second image P3 will be described. Although the second and subsequent images can be encoded as I-pictures, the compression ratio is reduced. Therefore, the second and subsequent images are encoded as follows by utilizing the fact that continuous images have a correlation.

【0027】即ち、動き検出器120は、2枚目の画像
P3を構成するマクロブロックごとに、1枚目の画像I
0の中から、マクロブロックに良く似た部分を検出し、
その部分と、対応するマクロブロックとの相対的な位置
関係のずれを表すベクトルを、動きベクトルとして検出
する。ここで、動きベクトルの検出方法については、例
えば、ISO/ISC 11172−2 annex
D.6.2などに開示されているので、ここでは、その
説明は省略する。
That is, the motion detector 120 calculates the first image I for each macroblock constituting the second image P3.
From 0, a part very similar to a macroblock is detected,
A vector representing a shift in the relative positional relationship between the portion and the corresponding macroblock is detected as a motion vector. Here, a method of detecting a motion vector is described in, for example, ISO / ISC 11172-2 annex.
D. 6.2, etc., and the description is omitted here.

【0028】そして、2枚目の画像P3については、そ
のブロックを、そのままDCT回路114に供給するの
ではなく、各ブロックごとの動きベクトルにしたがって
動き補償を行うことにより1枚目の画像I0から得られ
るブロックとの差分を、差分器112で演算して、DC
T回路114に供給する。
The block of the second image P3 is not supplied to the DCT circuit 114 as it is, but is subjected to motion compensation in accordance with the motion vector of each block, so that the block from the first image I0 is obtained. The difference from the obtained block is calculated by the difference unit 112,
It is supplied to the T circuit 114.

【0029】ここで、1枚目の画像I0を、動きベクト
ルにしたがって動き補償して得られるブロックと、2枚
目の画像P3のブロックとの間の相関が高ければ、それ
らの差分は小さくなり、2枚目の画像P3のブロックを
イントラ符号化するよりも、差分を符号化した方が、符
号化の結果得られるデータ量は少なくなる。
Here, if the correlation between the block obtained by motion-compensating the first image I0 according to the motion vector and the block of the second image P3 is high, the difference between them becomes small. The amount of data obtained as a result of encoding is smaller when the difference is encoded than when the block of the second image P3 is intra-coded.

【0030】このように差分を符号化する手法は、フレ
ーム間(インター(Inter))符号化と呼ばれる。
The technique for encoding the difference in this way is called inter-frame (Inter) encoding.

【0031】なお、常に、差分を符号化する方がデータ
量が少なくなるわけではなく、符号化する画像の複雑さ
や、前後のフレームとの相関の高さによっては、差分を
符号化するインター符号化よりも、イントラ符号化を行
った方が、圧縮率が高くなることがある。このような場
合は、イントラ符号化が行われる。イントラ符号化を行
うか、インター符号化を行うかは、マクロブロック単位
で設定することができる。
It should be noted that encoding the difference does not always reduce the amount of data. Depending on the complexity of the image to be encoded and the degree of correlation with the preceding and succeeding frames, an inter-code encoding the difference may be used. The compression rate may be higher when intra coding is performed than when coding is performed. In such a case, intra coding is performed. Whether to perform intra coding or inter coding can be set for each macroblock.

【0032】ところで、インター符号化を行うには、デ
コーダで得られる復号画像を求めておく必要がある。
By the way, in order to perform inter coding, it is necessary to obtain a decoded image obtained by a decoder.

【0033】そこで、画像符号化装置には、いわゆるロ
ーカルデコーダが設けられている。図5においては、動
き補償器121、フレームメモリ122、切換スイッチ
123、加算器124、逆DCT回路125、および逆
量子化器126がローカルデコーダを構成している。な
お、フレームメモリ122に記憶される画像データは、
ローカルデコーデットピクチャ(Local Decoded Pictur
e)またはローカルデコーデットデータ(Local Decoded
Data)と呼ばれる。これに対して、符号化される前の
画像データは、オリジナルピクチャ(Original Pictur
e)またはオリジナルデータ(Original Data)と呼ばれ
る。
Therefore, the image encoding device is provided with a so-called local decoder. 5, the motion compensator 121, the frame memory 122, the changeover switch 123, the adder 124, the inverse DCT circuit 125, and the inverse quantizer 126 constitute a local decoder. The image data stored in the frame memory 122 is
Local Decoded Pictur
e) or Local Decoded data
Data). On the other hand, the image data before being encoded is an original picture (Original Pictur).
e) or Original Data.

【0034】1枚目の画像I0の符号化時においては、
量子化器115の出力が、逆量子化器126および逆D
CT回路125を介することによりローカルデコードさ
れ(この場合、切換スイッチ123はオフにされ、その
結果、加算器124では、実質的に処理は行われな
い)、フレームメモリ122に記憶される。
At the time of encoding the first image I0,
The output of the quantizer 115 is the inverse quantizer 126 and the inverse D
The signal is locally decoded through the CT circuit 125 (in this case, the changeover switch 123 is turned off, and as a result, the adder 124 does not substantially perform the processing) and is stored in the frame memory 122.

【0035】なお、フレームメモリ122に記憶された
画像は、オリジナルピクチャではなく、それを符号化
し、さらにローカルデコードした、デコーダ側で得られ
る画像と同一のものである。従って、フレームメモリ1
22の画像は、符号化および復号処理により、オリジナ
ルピクチャよりも多少画質の劣化したものとなる。
The image stored in the frame memory 122 is not the original picture, but the same picture as the picture obtained by encoding and then locally decoding the picture and obtained on the decoder side. Therefore, the frame memory 1
The image No. 22 has a slightly lower image quality than the original picture due to the encoding and decoding processes.

【0036】2枚目の画像P3は、1枚目の画像I0を
ローカルデコードしたものがフレームメモリ122に記
憶されている状態において、フレームメモリ110から
ブロック分割器111を介して、ブロック単位で差分器
112に供給される。なお、この時点までに、動き検出
器120において、画像P3の動きベクトルの検出が終
了している必要がある。
The second image P3 is a block-by-block difference from the frame memory 110 via the block divider 111 in a state where a locally decoded version of the first image I0 is stored in the frame memory 122. Is supplied to the vessel 112. Note that, by this time, the motion detector 120 must have finished detecting the motion vector of the image P3.

【0037】一方、動き検出器120は、2枚目の画像
P3について、マクロブロック単位で検出した動きベク
トルを、動き補償器121に供給する。動き補償器12
1は、動き検出器120からの動きベクトルにしたがっ
て、既にローカルデコードされてフレームメモリ122
に記憶されている画像I0を動き補償(MC(MotionCo
mpensation))し、その結果得られる動き補償データ
(MCデータ)(1マクロブロック)を、フレーム間予
測画像データとして差分器112に供給する。
On the other hand, the motion detector 120 supplies the motion vector detected for the second image P3 in units of macroblocks to the motion compensator 121. Motion compensator 12
1 is already locally decoded according to the motion vector from the motion detector 120 and is stored in the frame memory 122.
The motion compensation (MC (MotionCo
mpensation)), and the resulting motion compensation data (MC data) (one macroblock) is supplied to the differentiator 112 as inter-frame prediction image data.

【0038】差分器112では、ブロック分割器111
を介して供給される画像P3のオリジナルデータと、動
き補償器121から供給されるフレーム間予測画像デー
タとの、対応する画素どうしの差分が演算される。そし
て、その結果得られる差分値が、切換スイッチ113を
介して、DCT回路114に供給され、以下、Iピクチ
ャにおける場合と同様に符号化される。従って、この場
合、切換スイッチ113は、被切換端子bを選択する。
In the differentiator 112, the block divider 111
The difference between the corresponding pixels between the original data of the image P3 supplied via the P and the inter-frame prediction image data supplied from the motion compensator 121 is calculated. Then, the difference value obtained as a result is supplied to the DCT circuit 114 via the changeover switch 113, and is thereafter encoded in the same manner as in the case of the I picture. Therefore, in this case, the changeover switch 113 selects the switched terminal b.

【0039】以上のように、Pピクチャ(Predicted Pi
cture)である画像P3については、基本的には、その
直前に符号化されたIピクチャまたはPピクチャを参照
画像として、その参照画像を動き補償して得られる予測
画像との差分が符号化される。
As described above, the P picture (Predicted Pi
For the image P3 that is the current image, the difference between the predicted image obtained by motion-compensating the reference image and the I or P picture coded immediately before the reference image is basically coded. You.

【0040】即ち、Pピクチャに関し、インター符号化
する方がデータ量の少なくなるマクロブロック(インタ
ーマクロブロック)については、切換スイッチ113に
おいて被切換端子bが選択され、インター符号化が行わ
れる。また、イントラ符号化する方がデータ量の少なく
なるマクロブロック(イントラマクロブロック)につい
ては、切換スイッチ113において被切換端子aが選択
され、イントラ符号化が行われる。
That is, for a P picture, for a macro block (inter macro block) in which the data amount is smaller when the inter coding is performed, the switch-over terminal b is selected by the changeover switch 113 and the inter coding is performed. For a macroblock (intra-macroblock) whose data amount is smaller by intra-coding, the switch-over terminal a is selected by the changeover switch 113 and intra-coding is performed.

【0041】なお、Pピクチャのマクロブロックのう
ち、イントラ符号化されたものは、Iピクチャと同様に
してローカルデコードされ、フレームメモリ122に記
憶される。また、インター符号化されたものは、逆量子
化器126および逆DCT回路125を介したものと、
オン状態とされた切換スイッチ123を介して供給され
るフレーム間予測画像データとが加算器124で加算さ
れることによりローカルデコードされ、フレームメモリ
122に記憶される。
The intra-coded P-picture macroblocks are locally decoded in the same manner as the I-pictures and stored in the frame memory 122. In addition, the inter-coded data is obtained through an inverse quantizer 126 and an inverse DCT circuit 125,
The adder 124 adds the inter-frame prediction image data supplied via the changeover switch 123 that has been turned on, and the result is locally decoded and stored in the frame memory 122.

【0042】次に、3枚目の画像B1の符号化について
説明する。
Next, the encoding of the third image B1 will be described.

【0043】Bピクチャである画像B1の符号化時にお
いては、動き検出器120において、その画像B1の直
前に表示されるIピクチャまたはPピクチャと、その直
後に表示されるIピクチャまたはPピクチャとに対する
2つの動きベクトルが検出される。従って、ここでは、
画像B1の、画像I0とP3それぞれに対する動きベク
トルが検出される。ここで、画像B1の直前に表示され
るIピクチャである画像I0に対する動きベクトルをフ
ォワードベクトル(Forward Vector)と、その直後に表
示されるPピクチャである画像P3に対する動きベクト
ルをバックワードベクトル(Backward Bector)とい
う。
At the time of encoding the picture B1 which is a B picture, the motion detector 120 determines whether the I picture or P picture displayed immediately before the picture B1 and the I picture or P picture displayed immediately after the picture B1. Are detected. Therefore, here
A motion vector of the image B1 with respect to each of the images I0 and P3 is detected. Here, a motion vector for an image I0, which is an I picture displayed immediately before the image B1, is a forward vector (Forward Vector), and a motion vector for an image P3, which is a P picture displayed immediately after that, is a backward vector. Bector).

【0044】画像B1に関しては、(1)フォワードベ
クトルにしたがって画像I0をローカルデコードしたも
のを動き補償して得られるフレーム間予測画像データと
の差分、(2)バックワードベクトルにしたがって画像
P3をローカルデコードしたものを動き補償して得られ
るフレーム間予測画像データとの差分、(3)上述の
(1)および(2)で得られる2つのフレーム間予測画
像データの平均値との差分、(4)画像B1そのもの、
の4つのうちの、最もデータ量が少なくなるものが選択
されて符号化される。
As for the image B1, (1) the difference from the inter-frame prediction image data obtained by motion-compensating the locally decoded image I0 according to the forward vector, and (2) the image P3 according to the backward vector. (3) difference from inter-frame predicted image data obtained by motion compensation of decoded data, (3) difference from average value of two inter-frame predicted image data obtained in (1) and (2), (4) ) Image B1 itself,
Of the four, the one with the smallest data amount is selected and encoded.

【0045】(1)乃至(3)のうちのいずれかのデー
タが符号化される場合(インター符号化が行われる場
合)には、必要な動きベクトルが動き検出器120から
動き補償器121に供給され、その動きベクトルにした
がって動き補償を行うことにより得られるデータが、差
分器112に供給される。そして、差分器112におい
て、画像B1のオリジナルデータと、動き補償器121
からのデータとの差分が求められ、これが、切換スイッ
チ113を介してDCT回路114に供給される。従っ
て、この場合、切換スイッチ113は被切換端子bを選
択する。一方、(4)のデータが符号化される場合(イ
ントラ符号化が行われる場合)には、そのデータ、即
ち、画像B1のオリジナルデータが、切換スイッチ11
3を介してDCT回路114に供給される。従って、こ
の場合、切換スイッチ113は被切換端子aを選択す
る。
When any of the data (1) to (3) is encoded (when inter encoding is performed), the necessary motion vector is sent from the motion detector 120 to the motion compensator 121. The data supplied and obtained by performing motion compensation according to the motion vector is supplied to the differentiator 112. Then, in the differentiator 112, the original data of the image B1 and the motion compensator 121
, And the difference from the data is obtained and supplied to the DCT circuit 114 via the changeover switch 113. Therefore, in this case, the changeover switch 113 selects the switched terminal b. On the other hand, when the data of (4) is encoded (intra-encoding is performed), the data, that is, the original data of the image B1 is
3 is supplied to the DCT circuit 114. Therefore, in this case, the changeover switch 113 selects the switched terminal a.

【0046】Bピクチャである画像B1については、そ
の符号化時に、既に符号化され、ローカルデコードされ
た画像I0およびP3がフレームメモリに記憶されてい
るので、上述のような符号化が可能となる。
As for the picture B1 which is a B picture, the pictures I0 and P3, which have already been coded and locally decoded at the time of coding, are stored in the frame memory, so that the above-described coding becomes possible. .

【0047】4枚目の画像B2については、上述の画像
B1を符号化する場合の記述のうち、B1をB2に置き
換えた処理が行われる。
For the fourth image B2, the process of replacing B1 with B2 in the above description of encoding the image B1 is performed.

【0048】5枚目の画像P6については、上述の画像
P3を符号化する場合の記述のうち、P3をP6に、I
0をP3に、それぞれ置き換えた処理が行われる。
Regarding the fifth image P6, in the description of encoding the image P3, P3 is replaced by P6,
A process is performed in which 0 is replaced with P3.

【0049】6枚目以降の画像については、上述の繰り
返しとなるので、説明を省略する。
The above-mentioned image is repeated for the sixth and subsequent images, and the description is omitted.

【0050】なお、MPEGでは、何枚かのピクチャの
集まりがGOP(Group Of Picture)とされ、GOP
は、符号化後におけるデータの並びが連続するピクチャ
で構成される。
In MPEG, a group of several pictures is defined as a GOP (Group Of Picture).
Is composed of pictures in which the sequence of data after encoding is continuous.

【0051】GOPは、ランダムアクセスを考慮して規
定されたものであるため、GOPの最初に配置される符
号化後のデータはIピクチャでなければならない。さら
に、GOPを構成するピクチャのうち、最後に表示され
るものは、IまたはPピクチャでなければならない。
Since the GOP is defined in consideration of random access, the encoded data located at the beginning of the GOP must be an I picture. Furthermore, the last one of the pictures constituting the GOP must be an I or P picture.

【0052】図9は、GOPの構成例を示している。な
お、同図においては、最初のGOPが4枚のピクチャか
ら構成されており、それ以降のGOPは6枚のピクチャ
から構成されている。また、同図(A)では、GOPを
構成するピクチャを表示順(ディスプレイ順)に並べて
示してあり、同図(B)では、符号化順に並べて示して
ある。
FIG. 9 shows a configuration example of a GOP. In the figure, the first GOP is composed of four pictures, and subsequent GOPs are composed of six pictures. Also, FIG. 1A shows pictures constituting a GOP in display order (display order), and FIG. 2B shows pictures in encoding order.

【0053】例えば、図9において、2番目のGOP
(GOP2)に注目し、B4,B5が、P3およびI6
を参照画像として符号化されたとした場合、GOP2に
おいて最初に符号化されたI6へのランダムアクセスが
行われると、それに続くB4,B5は、GOP1の中の
P3がデコードされていないために正常にデコードする
ことができない。このように、その中に含まれるピクチ
ャだけで正常にデコードすることができないピクチャの
あるGOPは、オープンGOPと呼ばれる。これに対し
て、B4,B5が、I6だけを参照画像として符号化さ
れたとした場合、I6へのランダムアクセスが行われた
ときに、それに続くB4,B5は正常にデコードするこ
とができる。このように、その中に含まれるピクチャだ
けで正常にデコードすることができるGOPは、クロー
ズドGOP(Closed GOP)と呼ばれる。
For example, in FIG. 9, the second GOP
(GOP2), B4 and B5 are P3 and I6
Is encoded as a reference image, if random access to the first encoded I6 is performed in GOP2, subsequent B4 and B5 will not be normally performed because P3 in GOP1 has not been decoded. Can't decode. As described above, a GOP having a picture that cannot be normally decoded only by the pictures included therein is called an open GOP. On the other hand, if B4 and B5 are coded using only I6 as the reference image, when random access to I6 is performed, subsequent B4 and B5 can be decoded normally. A GOP that can be normally decoded only by the pictures contained therein is called a closed GOP.

【0054】ところで、図5の画像符号化装置におい
て、各画面の画像を、Iピクチャ、Pピクチャ、または
Bピクチャのうちのいずれのピクチャタイプ(Picture
Type)として、また、各ピクチャのマクロブロックをど
のようなマクロブロックタイプ(Macro Block Type)で
符号化するかは、基本的に、その符号化の結果発生する
データ量に基づいて選択されるが、そのデータ量は、符
号化する画像に依存し、実際に符号化してみなければ、
正確な値は分からない。
By the way, in the image coding apparatus of FIG. 5, the picture of each screen is converted to any picture type (Picture Picture) of I picture, P picture or B picture.
Type) and what macro block type (Macro Block Type) to encode the macroblock of each picture is basically selected based on the amount of data generated as a result of the encoding. , The amount of data depends on the image to be encoded,
The exact value is not known.

【0055】しかしながら、一般に、画像符号化装置が
出力する符号化結果としてのビットストリームのビット
レートは一定にする必要があり、このための方法とし
て、例えば、量子化器115における量子化ステップ
(量子化スケール)を制御する方法がある。即ち、量子
化ステップを大きくすれば粗い量子化が行われ、データ
量(発生符号量)を少なくすることができる。また、量
子化ステップを小さくすれば細かい量子化が行われ、発
生符号量を増加させることができる。
However, in general, the bit rate of the bit stream as a coding result output from the image coding apparatus needs to be constant. As a method for this, for example, a quantization step (quantization Scale). That is, if the quantization step is increased, coarse quantization is performed, and the data amount (the generated code amount) can be reduced. Further, if the quantization step is reduced, fine quantization is performed, and the amount of generated codes can be increased.

【0056】量子化ステップの制御は、具体的には、例
えば、次のように行われる。
The control of the quantization step is specifically performed, for example, as follows.

【0057】即ち、画像符号化装置においては、その出
力段に、出力バッファ118が設けられており、ここに
符号化されたデータを一時記憶することで、ある程度の
発生符号量の変化を吸収し、その出力ビットストリーム
のビットレートを一定にすることができる。
That is, in the image coding apparatus, an output buffer 118 is provided at the output stage, and temporarily stores the coded data to absorb a certain amount of change in the generated code amount. , The bit rate of the output bit stream can be made constant.

【0058】しかしながら、所定のビットレートを越え
るような割合での、符号化データ(可変長符号化デー
タ)の発生が続けば、出力バッファ118のデータ蓄積
量が増加し、オーバーフローすることになる。また、逆
に、所定のビットレートを下回るような割合での、符号
化データの発生が連続すれば、出力バッファ118のデ
ータ蓄積量が減少し、アンダーフローすることになる。
However, if encoded data (variable-length encoded data) continues to be generated at a rate exceeding a predetermined bit rate, the amount of data stored in the output buffer 118 increases and overflows. Conversely, if the generation of encoded data continues at a rate below the predetermined bit rate, the amount of data stored in the output buffer 118 will decrease, resulting in underflow.

【0059】そこで、上述したように、出力バッファ1
18のデータ蓄積量(符号量)を、量子化ステップ制御
器119にフィードバックし、量子化ステップ制御器1
19において、そのデータ蓄積量に基づいて、出力バッ
ファ118においてオーバーフローおよびアンダーフロ
ーのいずれも生じないように、量子化ステップが制御さ
れるようになされている。
Therefore, as described above, the output buffer 1
18 is fed back to the quantization step controller 119, and the quantization step controller 1
At 19, the quantization step is controlled based on the data storage amount so that neither overflow nor underflow occurs in the output buffer 118.

【0060】即ち、量子化ステップ制御器119は、出
力バッファ118のデータ蓄積量がその容量に近くな
り、オーバーフローしそうなときは、量子化ステップを
大きくし、これにより発生符号量を減少させる。また、
量子化ステップ制御器119は、出力バッファ118の
データ蓄積量が0に近くなり、アンダーフローしそうな
ときは、量子化ステップを小さくし、これにより発生符
号量を増加させる。
That is, the quantization step controller 119 increases the quantization step when the amount of data stored in the output buffer 118 approaches the capacity and is likely to overflow, thereby reducing the amount of generated code. Also,
When the amount of data stored in the output buffer 118 is close to 0 and is likely to underflow, the quantization step controller 119 decreases the quantization step, thereby increasing the amount of generated code.

【0061】ところで、発生符号量は、画像を、フレー
ム内符号化するか、またはフレーム間符号化するかによ
っても変化する。
Incidentally, the amount of generated codes also changes depending on whether the image is coded in a frame or between frames.

【0062】一般に、フレーム内符号化を行う場合に
は、大きな発生符号量が生じるため、出力バッファ11
8のデータ蓄積量が多いときには、かなり大きな量子化
ステップを設定する必要がある。しかしながら、この場
合、最大の量子化ステップを設定しても、出力バッファ
118がオーバーフローすることがある。また、大きな
量子化ステップで量子化を行った場合には、基本的に
は、復号画像の画質が劣化するため、その復号画像を参
照画像として符号化/復号される画像の画質も劣化する
ことになる。従って、フレーム内符号化を行う場合に
は、出力バッファ118のオーバーフローを防止し、ま
た、復号画像の画質の劣化を防止するために、出力バッ
ファ118に、充分な空き領域を確保しておく必要があ
る。
In general, when performing intra-frame encoding, a large amount of generated code is generated.
When the data storage amount of No. 8 is large, it is necessary to set a considerably large quantization step. However, in this case, even when the maximum quantization step is set, the output buffer 118 may overflow. In addition, when quantization is performed in a large quantization step, the quality of a decoded image basically deteriorates, so that the quality of an image encoded / decoded using the decoded image as a reference image also deteriorates. become. Therefore, when performing intra-frame encoding, it is necessary to secure a sufficient free space in the output buffer 118 in order to prevent the overflow of the output buffer 118 and prevent the deterioration of the image quality of the decoded image. There is.

【0063】そこで、量子化ステップ制御器119は、
圧縮方法選択回路132からの信号に基づき、フレーム
内符号化およびフレーム間符号化が行われる順番をあら
かじめ認識し、フレーム内符号化が行われるときには、
出力バッファ118に充分な空き領域が確保された状態
となるように、量子化ステップを制御するようにもなさ
れている。
Therefore, the quantization step controller 119
Based on the signal from the compression method selection circuit 132, the order in which intra-frame encoding and inter-frame encoding are performed is recognized in advance, and when intra-frame encoding is performed,
The quantization step is also controlled so that a sufficient free area is secured in the output buffer 118.

【0064】ところで、復号画像の画質の劣化を防止す
る観点からは、複雑な画像については、小さな量子化ス
テップで量子化を行い、平坦な画像については、大きな
量子化ステップで量子化を行う必要があるが、バッファ
フィードバックのみに基づいて設定された量子化ステッ
プには、そのようなことが考慮されない。量子化ステッ
プが、画像の複雑さの観点から適当な値になっていない
場合には、符号化対象の画像に対して、不当に多くのビ
ット量が割り当てられたり、また、少ないビット量が割
り当てられる。ある画像に対して、このような不当なビ
ット割当が行われると、それは、他の画像に対するビッ
ト割当量にも影響するので、好ましくない。
From the viewpoint of preventing the image quality of the decoded image from deteriorating, it is necessary to quantize a complicated image in a small quantization step and to quantize a flat image in a large quantization step. However, the quantization step set based only on the buffer feedback does not consider such a situation. If the quantization step is not an appropriate value from the viewpoint of the complexity of the image, an unreasonably large bit amount or a small bit amount is allocated to the image to be encoded. Can be If such an improper bit allocation is performed for a certain image, it also affects the bit allocation amount for another image, which is not preferable.

【0065】そこで、量子化ステップ制御器119にお
いては、バッファ118からのデータ蓄積量のフィード
バック(バッファフィードバック)だけでなく、符号化
対象の画像の複雑さにも対応して、量子化ステップが設
定されるようになされている。
Therefore, in the quantization step controller 119, the quantization step is set in accordance with not only the feedback of the data accumulation amount from the buffer 118 (buffer feedback) but also the complexity of the image to be encoded. It has been made to be.

【0066】即ち、図5の画像符号化装置では、画像評
価回路130において、フレームメモリ110に記憶さ
れた、これから符号化するピクチャが読み出され、その
複雑さを表す評価値が算出され、シーンチェンジ検出回
路131および量子化ステップ制御器119に供給され
る。
That is, in the image coding apparatus shown in FIG. 5, the picture evaluation circuit 130 reads out the picture to be coded from the frame memory 110 and calculates an evaluation value indicating the complexity of the picture. The change detection circuit 131 and the quantization step controller 119 are supplied.

【0067】量子化ステップ制御器119は、画像の符
号化に実際に使用した量子化ステップ、その量子化ステ
ップで量子化を行うことにより得られたデータ量(発生
符号量)、および画像評価回路130から供給される、
その画像についての複雑さに対応する評価値の関係を学
習し、その学習結果に基づき、次の量子化ステップの設
定を行うための基本となる基本量子化ステップを求め
る。
A quantization step controller 119 includes a quantization step actually used for encoding an image, a data amount (generated code amount) obtained by performing quantization in the quantization step, and an image evaluation circuit. Supplied from 130,
The relationship between the evaluation values corresponding to the complexity of the image is learned, and based on the learning result, a basic quantization step that is the basis for setting the next quantization step is obtained.

【0068】即ち、画像の符号化に実際に使用した量子
化ステップ、その量子化ステップで量子化を行うことに
より得られたデータ量(発生符号量)、およびその画像
についての複雑さに対応する評価値を用いて回帰分析を
行い、その回帰分析結果をグラフにすることで、学習が
行われる。そして、そのグラフから、次に符号化を行う
画像の複雑さについての評価値を引数として、その画像
の符号化に用いるのが最適な基本量子化ステップが予測
される。
That is, it corresponds to the quantization step actually used for encoding an image, the data amount (generated code amount) obtained by performing quantization in the quantization step, and the complexity of the image. Learning is performed by performing a regression analysis using the evaluation value and graphing the result of the regression analysis. Then, from the graph, an optimal basic quantization step to be used for encoding the image is predicted using the evaluation value regarding the complexity of the image to be encoded next as an argument.

【0069】そして、量子化ステップ制御器119は、
この基本量子化ステップを、バッファフィードバックに
したがって変化させ、その値を、量子化ステップとして
設定する。
Then, the quantization step controller 119
This basic quantization step is changed according to the buffer feedback, and the value is set as the quantization step.

【0070】基本量子化ステップは、学習により精度良
く予測することが可能であり、また、その値は、画像の
複雑さを考慮したものとなっているので、量子化ステッ
プを、このような基本量子化ステップから求めること
で、バッファフィードバックのみに基づいて量子化ステ
ップを制御する場合に比較して、復号画像の画質を向上
させることが可能となる。
The basic quantization step can be accurately predicted by learning, and its value takes into account the complexity of the image. By obtaining from the quantization step, it is possible to improve the image quality of the decoded image as compared with the case where the quantization step is controlled based only on the buffer feedback.

【0071】なお、図5において、シーンチェンジ検出
回路131では、画像評価回路130からの評価値に基
づき、シーンチェンジがあったかどうかが検出され、そ
の検出結果が圧縮方法選択回路132に供給される。圧
縮方法選択回路132では、画像評価回路130からの
評価値、さらには必要に応じて、シーンチェンジ検出回
路131の出力を用いて、画像の圧縮方法が選択され
る。即ち、圧縮方法選択回路132では、例えば、画像
を、Iピクチャ、Pピクチャ、またはBピクチャのうち
のいずれのピクチャタイプとして符号化するかや、GO
Pを構成させるピクチャ数、マクロブロックをフレーム
内符号化するか、またはフレーム間符号化するかなどに
関するマクロブロックタイプなどについての圧縮方法が
選択される。
In FIG. 5, the scene change detection circuit 131 detects whether a scene change has occurred based on the evaluation value from the image evaluation circuit 130, and supplies the detection result to the compression method selection circuit 132. The compression method selection circuit 132 selects an image compression method using the evaluation value from the image evaluation circuit 130 and, if necessary, the output of the scene change detection circuit 131. In other words, the compression method selection circuit 132 determines, for example, which picture type of an I picture, a P picture, or a B picture is to be encoded,
A compression method is selected for the number of pictures constituting P, a macroblock type regarding whether a macroblock is to be intra-frame encoded or inter-frame encoded, and the like.

【0072】圧縮方法選択回路132は、圧縮方法を選
択すると、そのうちの、マクロブロックをフレーム内符
号化するか、またはフレーム間符号化するかに基づい
て、切換スイッチ113および123を制御する。即
ち、これにより、上述したように、フレーム内符号化を
行う場合には、切換スイッチ113は被切換端子aに切
り換えられ、切り換えスイッチ123はオフ状態にされ
る。また、フレーム間符号化を行う場合には、切換スイ
ッチ113は被切換端子bに切り換えられ、切り換えス
イッチ123はオン状態にされる。
Upon selecting the compression method, the compression method selection circuit 132 controls the changeover switches 113 and 123 based on whether the macroblock is to be intra-frame encoded or inter-frame encoded. That is, as described above, when performing intra-frame encoding, the changeover switch 113 is switched to the switched terminal a and the changeover switch 123 is turned off. When performing inter-frame encoding, the changeover switch 113 is switched to the switched terminal b, and the changeover switch 123 is turned on.

【0073】さらに、圧縮方法選択回路132は、量子
化ステップ制御器119に対して、フレーム内符号化ま
たはフレーム間符号化のうちのいずれを行うかを通知す
る。量子化ステップ制御器119は、この通知によっ
て、上述したように、フレーム内符号化およびフレーム
間符号化が行われる順番を認識する。
Further, the compression method selection circuit 132 notifies the quantization step controller 119 whether to perform intra-frame coding or inter-frame coding. Based on this notification, the quantization step controller 119 recognizes the order in which the intra-frame coding and the inter-frame coding are performed, as described above.

【0074】ここで、圧縮方法選択回路132におい
て、画像をPピクチャまたはBピクチャとして符号化す
ることが長時間連続して選択された場合には、Pピクチ
ャおよびBピクチャは、基本的には、フレーム間符号化
されるため、シーンチェンジなどによりフレーム間の相
関が低い画像が生じると、発生符号量が増加し、また、
復号画像の画質が劣化する。
Here, when the compression method selection circuit 132 selects encoding a picture as a P picture or a B picture continuously for a long time, the P picture and the B picture are basically Since the image is encoded between frames, when an image having low correlation between frames occurs due to a scene change or the like, the generated code amount increases,
The image quality of the decoded image deteriorates.

【0075】そこで、上述したように、シーンチェンジ
検出回路131から圧縮方法選択回路132には、シー
ンチェンジの検出結果が供給されるようになされてお
り、圧縮方法選択回路132は、シーンチェンジがあっ
た旨を受信すると、そのシーンチェンジ後のピクチャ
を、いわば強制的に、Iピクチャとすることを選択する
ようになされている。
Therefore, as described above, a scene change detection result is supplied from the scene change detection circuit 131 to the compression method selection circuit 132, and the compression method selection circuit 132 detects the scene change. Upon receipt of the notification, the picture after the scene change is forcibly selected as an I picture.

【0076】なお、上述したように、学習により基本量
子化ステップを求め、その基本量子化ステップから量子
化ステップを設定する方法については、例えば、本件出
願人が先に出願した特願平8−102951号公報に、
その詳細が開示されている。
As described above, a method of obtaining a basic quantization step by learning and setting a quantization step from the basic quantization step is described in, for example, Japanese Patent Application No. 8-108 filed by the present applicant. No. 102951,
The details are disclosed.

【0077】[0077]

【発明が解決しようとする課題】ところで、基本量子化
ステップは、上述したように、画像の符号化に実際に使
用した量子化ステップ、その量子化ステップで量子化を
行うことにより得られたデータ量(発生符号量)、およ
びその画像についての複雑さに対応する評価値の関係を
学習することにより、即ち、既に符号化された画像から
得られる情報を学習サンプルとして用いた学習を行うこ
とにより求められる。
As described above, the basic quantization step is, as described above, a quantization step actually used for coding an image, and data obtained by performing quantization in the quantization step. By learning the relationship between the amount (generated code amount) and the evaluation value corresponding to the complexity of the image, that is, by performing learning using information obtained from an already encoded image as a learning sample Desired.

【0078】従って、学習は、過去のある期間における
画像から得られる情報を学習サンプルとして行われるた
め、その期間が短いと、学習サンプル数が少なくなり、
基本量子化ステップの予測精度が低下する。一方、期間
を長くし過ぎると、時間的にかなり遡った画像から得ら
れる情報が学習サンプルに含まれることになり、やは
り、基本量子化ステップの予測精度が劣化する。従っ
て、学習は、適当な期間を設定して行う必要がある。
Therefore, since learning is performed using information obtained from an image in a certain period in the past as a learning sample, if the period is short, the number of learning samples is reduced.
The prediction accuracy of the basic quantization step decreases. On the other hand, if the period is set too long, information obtained from an image that is considerably retroactive in time will be included in the learning sample, and the prediction accuracy of the basic quantization step will also deteriorate. Therefore, it is necessary to set an appropriate period for learning.

【0079】しかしながら、シーンチェンジなどによ
り、過去のフレームとの相関が低い画像(前のフレーム
から急激に変化した画像)が生じた場合においては、学
習に適当な期間を設定していたとしても、その画像と相
関の低い画像から得られる情報を学習サンプルとして学
習が行われるため、基本量子化ステップの予測精度が劣
化する。
However, when an image having a low correlation with a past frame (an image that has changed sharply from the previous frame) occurs due to a scene change or the like, even if an appropriate period is set for learning, Since learning is performed using information obtained from an image having a low correlation with the image as a learning sample, the prediction accuracy of the basic quantization step deteriorates.

【0080】さらに、その後も、しばらくの間は、相関
の低い過去のフレームの画像から得られる情報を用いて
学習が行われるため、その間、予測精度の低い基本量子
化ステップを用いた符号化が続けられることになる。
Further, after that, for a while, learning is performed using information obtained from an image of a past frame having low correlation, and during that time, encoding using the basic quantization step with low prediction accuracy is performed. Will be able to continue.

【0081】基本量子化ステップの予測精度が劣化する
と、不当なビット割当が行われるようになり、その結
果、復号画像の画質が劣化することになる。
If the prediction accuracy of the basic quantization step is degraded, improper bit allocation is performed, and as a result, the image quality of the decoded image is degraded.

【0082】本発明は、このような状況に鑑みてなされ
たものであり、基本量子化ステップの予測精度の低下を
防止(低減)し、これにより復号画像の画質の劣化を防
止する(低減する)ことができるようにするものであ
る。
The present invention has been made in view of such circumstances, and prevents (reduces) a decrease in the prediction accuracy of the basic quantization step, thereby preventing (reducing) the deterioration of the image quality of a decoded image. )

【0083】[0083]

【課題を解決するための手段】請求項1に記載の画像符
号化装置は、画像データを所定の量子化ステップで量子
化する量子化手段と、所定の量子化ステップを設定する
ための基本となる基本量子化ステップを、既に符号化さ
れた画像データから得られる情報としての予測パラメー
タを用いて学習を行うことにより求める基本量子化ステ
ップ算出手段と、基本量子化ステップから、所定の量子
化ステップを設定する量子化ステップ設定手段と、画面
間における画像の変化を検出する変化検出手段と、変化
検出手段の検出結果に対応して、予測パラメータを破棄
するとともに、所定の基本量子化ステップを出力するよ
うに、基本量子化ステップ算出手段を制御する制御手段
とを備えることを特徴とする。
According to a first aspect of the present invention, there is provided an image coding apparatus comprising: a quantizing means for quantizing image data in a predetermined quantization step; and a basic for setting the predetermined quantization step. A basic quantization step that is obtained by performing learning using a prediction parameter as information obtained from image data that has already been encoded, and a basic quantization step. , A quantization step setting unit, a change detection unit that detects a change in an image between screens, and a predetermined basic quantization step is output while discarding a prediction parameter according to a detection result of the change detection unit. Control means for controlling the basic quantization step calculation means.

【0084】請求項2に記載の画像符号化方法は、画像
データを所定の量子化ステップで量子化する量子化手段
と、所定の量子化ステップを設定するための基本となる
基本量子化ステップを、既に符号化された画像データか
ら得られる情報としての予測パラメータを用いて学習を
行うことにより求める基本量子化ステップ算出手段と、
基本量子化ステップから、所定の量子化ステップを設定
する量子化ステップ設定手段とを備える画像符号化装置
の画像符号化方法であって、画面間における画像の変化
を検出し、その検出結果に対応して、予測パラメータを
破棄するとともに、所定の基本量子化ステップを出力す
るように、基本量子化ステップ算出手段を制御すること
を特徴とする。
According to a second aspect of the present invention, there is provided an image encoding method comprising: a quantizing means for quantizing image data in a predetermined quantization step; and a basic quantization step serving as a basis for setting the predetermined quantization step. A basic quantization step calculating means obtained by performing learning by using a prediction parameter as information obtained from already encoded image data,
An image encoding method for an image encoding device, comprising: a basic quantization step; and a quantization step setting means for setting a predetermined quantization step, wherein the method detects an image change between screens and corresponds to the detection result. Then, the prediction parameter is discarded, and the basic quantization step calculating means is controlled so as to output a predetermined basic quantization step.

【0085】請求項3に記載の記録媒体は、請求項2に
記載の画像符号化方法により符号化された画像データが
記録されていることを特徴とする。
A recording medium according to a third aspect is characterized by recording image data encoded by the image encoding method according to the second aspect.

【0086】請求項1に記載の画像符号化装置において
は、量子化手段は、画像データを所定の量子化ステップ
で量子化し、基本量子化ステップ算出手段は、所定の量
子化ステップを設定するための基本となる基本量子化ス
テップを、既に符号化された画像データから得られる情
報としての予測パラメータを用いて学習を行うことによ
り求めるようになされている。量子化ステップ設定手段
は、基本量子化ステップから、所定の量子化ステップを
設定し、変化検出手段は、画面間における画像の変化を
検出するようになされている。制御手段は、変化検出手
段の検出結果に対応して、予測パラメータを破棄すると
ともに、所定の基本量子化ステップを出力するように、
基本量子化ステップ算出手段を制御するようになされて
いる。
In the image encoding apparatus according to the first aspect, the quantization means quantizes the image data in a predetermined quantization step, and the basic quantization step calculation means sets the predetermined quantization step. Is obtained by learning using a prediction parameter as information obtained from already encoded image data. The quantization step setting means sets a predetermined quantization step from the basic quantization step, and the change detection means detects a change in an image between screens. The control means, in response to the detection result of the change detection means, to discard the prediction parameter, and to output a predetermined basic quantization step,
The basic quantization step calculating means is controlled.

【0087】請求項2に記載の画像符号化方法において
は、画面間における画像の変化を検出し、その検出結果
に対応して、予測パラメータを破棄するとともに、所定
の基本量子化ステップを出力するように、基本量子化ス
テップ算出手段を制御するようになされている。
According to the image coding method of the present invention, a change in an image between screens is detected, and a prediction parameter is discarded and a predetermined basic quantization step is output in accordance with the detection result. Thus, the basic quantization step calculation means is controlled.

【0088】請求項3に記載の記録媒体には、請求項2
に記載の画像符号化方法により符号化された画像データ
が記録されている。
The recording medium according to the third aspect includes the second aspect.
The image data encoded by the image encoding method described in (1) is recorded.

【0089】[0089]

【発明の実施の形態】図1は、本発明を適用したパーソ
ナルコンピュータの一実施の形態の構成例を示してい
る。
FIG. 1 shows a configuration example of an embodiment of a personal computer to which the present invention is applied.

【0090】このパーソナルコンピュータ(以下、適
宜、パソコンという)は、ビデオカメラ14で撮影され
た画像や、モデム6あるいはチューナ5で受信された画
像、VTR16で再生された画像などを、そのまま、あ
るいは必要に応じて編集し、圧縮部13で圧縮符号化し
て、CD−R11やハードディスク12に記録しておく
ことができるようになされている。
The personal computer (hereinafter, appropriately referred to as a personal computer) can directly receive images taken by the video camera 14, images received by the modem 6 or the tuner 5, images reproduced by the VTR 16, or the like. , And can be compressed and encoded by the compression unit 13 and recorded on the CD-R 11 or the hard disk 12.

【0091】即ち、マイクロプロセッサ1は、ハードデ
ィスク12に記録されたオペレーティングシステムの制
御の下、同じくハードディスク12に記録されたアプリ
ケーションプログラムを実行することで、例えば、画像
の編集処理や符号化処理その他の所定の処理を行う。メ
インメモリ2は、マイクロプロセッサ1が実行するプロ
グラムや、マイクロプロセッサ1の動作上必要なデータ
を記憶する。フレームバッファ3は、例えば、DRAM
(Dynamic Random Access Memory)などで構成され、マ
イクロプロセッサ1が生成した画像などを記憶する。バ
スブリッジ4は、内部バスと、例えばPCI(Peripher
al Component Interconnect)ローカルバスなどの拡張
バスとの間でのデータのやりとりを制御する。
That is, the microprocessor 1 executes an application program also recorded on the hard disk 12 under the control of the operating system recorded on the hard disk 12, for example, to perform image editing processing, encoding processing and other processing. Perform predetermined processing. The main memory 2 stores programs executed by the microprocessor 1 and data necessary for the operation of the microprocessor 1. The frame buffer 3 is, for example, a DRAM
(Dynamic Random Access Memory) and stores an image generated by the microprocessor 1 and the like. The bus bridge 4 includes an internal bus and, for example, a PCI (Peripher
al Component Interconnect) Controls the exchange of data with an expansion bus such as a local bus.

【0092】以上のマイクロプロセッサ1、メインメモ
リ2、フレームバッファ3、およびバスブリッジ4は、
相互に、内部バスを介して接続されており、残りのブロ
ックは、拡張バスを介して相互に接続されている。な
お、バスブリッジ4は、内部バスと拡張バスとの両方に
接続されている。
The above-described microprocessor 1, main memory 2, frame buffer 3, and bus bridge 4
The blocks are connected to each other via an internal bus, and the remaining blocks are connected to each other via an expansion bus. The bus bridge 4 is connected to both the internal bus and the expansion bus.

【0093】チューナ5は、例えば、地上波や衛星回
線、CATV網を利用して放送されているテレビジョン
放送信号を受信する。ここで、チューナ5において受信
した画像や音声なども編集や符号化の対象とすることが
できる。モデム6は、電話回線を介しての通信を制御す
る。ここで、モデム6において、例えば、インターネッ
トなどから受信した画像や音声なども編集や符号化の対
象とすることができるし、また、編集や符号化した画像
や音声などを、外部に送信することもできる。
The tuner 5 receives, for example, a television broadcast signal broadcast using a terrestrial wave, a satellite line, or a CATV network. Here, images and sounds received by the tuner 5 can also be edited and encoded. The modem 6 controls communication via a telephone line. Here, in the modem 6, for example, images and sounds received from the Internet or the like can be edited or encoded, and the edited or encoded images or sounds can be transmitted to the outside. Can also.

【0094】I/O(Input/Output)インターフェイス
7は、キーボード8やマウス9の操作に対応した操作信
号を出力する。キーボード8は、所定のデータやコマン
ドを入力するときに、マウス9は、ディスプレイ(コン
ピュータディスプレイ)17に表示されるカーソルを移
動させたり、また、位置を指示したりするときなどに、
それぞれ操作される。
The I / O (Input / Output) interface 7 outputs an operation signal corresponding to the operation of the keyboard 8 and the mouse 9. The keyboard 8 is used to input predetermined data or commands, and the mouse 9 is used to move a cursor displayed on a display (computer display) 17 or to indicate a position.
Each is operated.

【0095】補助記憶インターフェイス10は、CD−
R(Compact Disc Recordable)11やハードディスク
(HD(Hard Disk))12などに対するデータの読み
書きを制御する。CD−R11には、例えば、圧縮部1
3で符号化されたデータが記録される。ハードディスク
12には、オペレーティングシステムや、画像の符号化
処理その他処理をマイクロプロセッサ1に実行させるた
めのアプリケーションプログラムなどが記録されてい
る。さらに、ハードディスク12には、圧縮部13で圧
縮符号化されたデータなども記録される。
The auxiliary storage interface 10 is a CD-ROM.
It controls reading / writing of data from / to an R (Compact Disc Recordable) 11 and a hard disk (HD (Hard Disk)) 12. For example, the compression unit 1
3 is recorded. The hard disk 12 stores an operating system, an application program for causing the microprocessor 1 to execute image encoding processing and other processing, and the like. Further, the hard disk 12 also records data compressed by the compression unit 13 and the like.

【0096】圧縮部13は、マイクロプロセッサ1の制
御の下、そこに入力される画像や音声を、例えば、MP
EGの規格に準拠して圧縮符号化する。なお、圧縮部1
3では、拡張バスを介して供給されるデータや、伸張部
15を介して供給されるデータ、さらには、外部の装置
である、例えば、ビデオカメラ14から供給されるデー
タなどを圧縮することができるようになされている。
Under the control of the microprocessor 1, the compression section 13 converts the image or sound input thereto into, for example, an MP
Compression-encodes according to the EG standard. The compression unit 1
In 3, data supplied via an expansion bus, data supplied via an expansion unit 15, and data supplied from an external device such as a video camera 14 can be compressed. It has been made possible.

【0097】ビデオカメラ14では、例えば、画像の撮
影などが行われ、圧縮部13に供給される。なお、圧縮
部13は、ビデオカメラ14とのインターフェイスを有
しており、これにより、ビデオカメラ14で記録された
画像や音声を圧縮部13に入力することができるように
なされている。
The video camera 14 captures an image, for example, and supplies it to the compression unit 13. Note that the compression unit 13 has an interface with the video camera 14, whereby images and sounds recorded by the video camera 14 can be input to the compression unit 13.

【0098】伸張部15は、圧縮部13で符号化(圧
縮)されたデータを復号(伸張)して出力する。なお、
伸張部15は、必要に応じて、フレームバッファ3に記
憶された画像に、復号した画像をオーバレイして出力す
る。ここで、フレームバッファ3から伸張部15への画
像データの供給は、図1の実施の形態では、それらの間
で直接行われるようになされているが、その他、内部バ
ス、バスブリッジ4、および拡張バスを介して行うこと
も可能である。但し、フレームバッファ3から伸張部1
5への画像データの供給を、内部バス、バスブリッジ
4、および拡張バスを介して行う場合には、内部バスや
拡張バスの能力が低いと、データが渋滞するおそれがあ
る。
The expansion unit 15 decodes (expands) the data encoded (compressed) by the compression unit 13 and outputs the data. In addition,
The decompression unit 15 overlays the decoded image on the image stored in the frame buffer 3 and outputs the decoded image as necessary. Here, the supply of the image data from the frame buffer 3 to the decompression unit 15 is performed directly between them in the embodiment of FIG. 1, but the internal bus, the bus bridge 4 and the It is also possible to do via an expansion bus. However, the extension unit 1
In the case where the supply of image data to 5 is performed via the internal bus, the bus bridge 4 and the expansion bus, if the capacity of the internal bus or the expansion bus is low, data may be congested.

【0099】VTR(ビデオテープレコーダ)16は、
伸張部15が出力する画像や音声を、必要に応じて記録
する。ディスプレイ17は、伸張部15が出力する画像
を、必要に応じて表示する。なお、伸張部15が出力す
る画像の表示は、コンピュータ用のディスプレイである
ディスプレイ17の他、TV(TeleVision)モニタなどに
よっても行うことができるようになされている。
The VTR (video tape recorder) 16
Images and sounds output by the decompression unit 15 are recorded as necessary. The display 17 displays the image output by the extension unit 15 as necessary. The display of the image output by the expansion unit 15 can be performed not only by the display 17 which is a display for a computer but also by a TV (TeleVision) monitor or the like.

【0100】次に、図2は、図1の圧縮部13の一実施
の形態の構成例を示している。なお、図中、図5におけ
る場合と対応する部分については、同一の符号を付して
あり、以下では、その説明は、適宜省略する。即ち、圧
縮部13は、予測パラメータ選択回路140(変化検出
手段)(制御手段)が新たに設けられ、さらに、量子化
ステップ制御器119に代えて量子化ステップ制御器1
41(基本量子化ステップ算出手段)(量子化ステップ
設定手段)が新たに設けられている他は、基本的に、図
5の画像符号化装置と同様に構成されている。
Next, FIG. 2 shows a configuration example of an embodiment of the compression section 13 of FIG. In the figure, portions corresponding to those in FIG. 5 are denoted by the same reference numerals, and a description thereof will be omitted as appropriate below. That is, the compression unit 13 is provided with a new prediction parameter selection circuit 140 (change detecting means) (control means), and further includes the quantization step controller 1 instead of the quantization step controller 119.
41 (basic quantization step calculation means) (quantization step setting means), except that it is newly provided.

【0101】フレームメモリ110、ブロック分割器1
11、差分器112、切換スイッチ113、DCT回路
114、量子化器115(量子化手段)、ジグザグスキ
ャン回路116、VLC回路117、出力バッファ11
8、動き検出器120、動き補償器121、フレームメ
モリ122、切換スイッチ123、加算器124、逆D
CT回路125、および逆量子化器126においては、
図5における場合と同様にして、画像がMPEG符号化
される。即ち、この圧縮部13においては、量子化器1
15で用いられる量子化ステップの設定方法が、図5に
おける場合と異なるので、ここでは、この量子化ステッ
プの設定方法を中心に説明する。
Frame memory 110, block divider 1
11, differentiator 112, changeover switch 113, DCT circuit 114, quantizer 115 (quantizing means), zigzag scan circuit 116, VLC circuit 117, output buffer 11
8, motion detector 120, motion compensator 121, frame memory 122, changeover switch 123, adder 124, inverse D
In the CT circuit 125 and the inverse quantizer 126,
The image is MPEG-coded as in the case of FIG. That is, in the compression unit 13, the quantizer 1
Since the setting method of the quantization step used in 15 is different from that in FIG. 5, the following description focuses on this quantization step setting method.

【0102】画像評価回路130では、符号化対象の画
像を評価するための評価値として、次のような画像の複
雑さを表す2つのパラメータが、フレームメモリ110
を参照することで算出される。
In the image evaluation circuit 130, the following two parameters representing the complexity of the image are used as the evaluation values for evaluating the image to be encoded in the frame memory 110.
Is calculated by referring to.

【0103】即ち、第1のパラメータとしては、画像を
フレーム内符号化したときの発生符号量(画像をIピク
チャとして符号化したときの発生符号量)を予測(推
測)することが可能な、その画像自体の情報量を表す評
価値が算出される。具体的には、第1のパラメータとし
ては、例えば、画像をブロックごとにDCT処理し、そ
のDCT係数の総和その他の統計量を用いることができ
る。また、例えば、ブロックごとに、その画素値の平均
値を、各画素値から減算した値の絶対値和(以下、適
宜、平均絶対値和という)を求め、各ブロックの平均絶
対値和の総和をとったものなどを、第1のパラメータと
することも可能である。なお、このように絶対値和を求
める方が、DCT係数の総和を求める場合より、比較
的、画像評価回路130の回路規模を小さくし、また、
処理の負荷を小さくすることができる。
That is, as the first parameter, it is possible to predict (estimate) the generated code amount when the image is coded in the frame (the generated code amount when the image is coded as an I picture). An evaluation value representing the information amount of the image itself is calculated. Specifically, as the first parameter, for example, an image is subjected to DCT processing for each block, and a sum of DCT coefficients and other statistics can be used. For example, for each block, the sum of the absolute values of the values obtained by subtracting the average value of the pixel values from the pixel values (hereinafter, appropriately referred to as the sum of the average absolute values) is obtained, and the sum of the sum of the average absolute values of the respective blocks Can be used as the first parameter. It should be noted that obtaining the sum of absolute values makes the circuit scale of the image evaluation circuit 130 relatively smaller than obtaining the sum of DCT coefficients, and
The processing load can be reduced.

【0104】ここでは、画像評価回路130において、
第1のパラメータとしての、例えば平均絶対値和の総和
が、次のようにして求められる。
Here, in the image evaluation circuit 130,
For example, the sum of the average absolute value sums as the first parameter is obtained as follows.

【0105】即ち、例えば、いま、符号化対象の画像を
構成する、あるブロックSについて、そのブロックの最
も左上から、右方向にi番目で、下方向にj番目の位置
にある画素の画素値をSi,jと表すとすると、各ブロッ
クについての平均絶対値和MAD(Mean Absolute Diff
erence)が、次式にしたがって求められる(ここでは、
例えば、輝度のブロックおよび色差のブロックのすべて
について求められる。但し、例えば、輝度ブロックのみ
について求めるようにすることも可能である)。
That is, for example, for a certain block S constituting an image to be encoded, the pixel value of the pixel located at the i-th position to the right and the j-th position to the right from the upper left of the block Let S i, j be the mean absolute value sum MAD (Mean Absolute Diff
erence) is calculated according to the following equation (here,
For example, it is obtained for all of the luminance block and the chrominance block. However, for example, it is also possible to obtain only the luminance block.)

【0106】[0106]

【数1】 ・・・(1) 但し、式(1)において、SAVEは、ブロックSの画素
値の平均値を表す。
(Equation 1) (1) In the expression (1), S AVE represents an average value of the pixel values of the block S.

【0107】そして、次式にしたがって、平均絶対値和
の総和SMADが、第1のパラメータとして求められ
る。
Then, the sum SMAD of the average absolute value sum is obtained as the first parameter according to the following equation.

【0108】SMAD=ΣMAD・・・(2) 但し、式(2)において、Σは、画像を構成するブロッ
クすべてについてのサメーションを表す。
SMAD = ΣMAD (2) where, in equation (2), Σ represents summation for all the blocks constituting the image.

【0109】なお、画像評価回路130では、式(1)
で表される平均絶対値和MADの、マクロブロック単位
での総和も求められる。これは、例えば、圧縮方法選択
回路132において行われる、各マクロブロックを、フ
レーム内符号化するか、またはフレーム間符号化(前方
予測符号化、後方予測符号化、若しくは両方向予測符号
化)するかの決定などに用いられる。
In the image evaluation circuit 130, the expression (1)
The total sum of the average absolute value sums MAD expressed by the following formulas is also obtained for each macroblock. For example, whether each macro block is subjected to intra-frame coding or inter-frame coding (forward prediction coding, backward prediction coding, or bidirectional prediction coding) performed in the compression method selection circuit 132 It is used to determine

【0110】第2のパラメータとしては、画像をフレー
ム間符号化したときの発生符号量を予測することが可能
な、その画像と、フレーム間符号化するときに用いられ
る参照画像との差分の情報量を表す評価値が算出され
る。具体的には、第2のパラメータとしては、例えば、
画像と、その予測画像(参照画像を動き補償して得られ
るもの)との差分の絶対値和(以下、適宜、差分絶対値
和という)を、ブロック単位で求め、各ブロックの差分
絶対値和の総和をとったものなどを用いることができ
る。
The second parameter is information on the difference between the image and a reference image used for inter-frame encoding, which can predict the amount of generated code when the image is inter-coded. An evaluation value representing the quantity is calculated. Specifically, as the second parameter, for example,
The sum of absolute values of the difference between the image and its predicted image (obtained by motion-compensating the reference image) (hereinafter, appropriately referred to as the sum of absolute differences) is obtained in block units, and the sum of absolute differences of each block is obtained. Can be used.

【0111】ここで、差分絶対値和は、動き検出器12
0において動きベクトルを検出するときに求められる。
そこで、画像評価回路130では、動き検出器120に
よる動き検出結果を用いて、第2のパラメータとして
の、例えば差分絶対値和の総和が求められる。
Here, the sum of absolute differences is calculated by the motion detector 12
It is obtained when a motion vector is detected at 0.
Thus, the image evaluation circuit 130 obtains, for example, the sum of the sum of absolute differences as a second parameter using the result of motion detection by the motion detector 120.

【0112】即ち、例えば、いま、参照画像について、
横×縦が8×8画素で構成されるブロックを考え、その
ブロックの最も左上から、右方向にi番目で、下方向に
j番目の位置にある画素の画素値をRi,jと表す。さら
に、符号化対象の画像について、その最も左上から右ま
たは下方向にx軸またはy軸をそれぞれ考え、点(x,
y)を最も左上の画素とするブロックの最も左上から、
右方向にi番目で、下方向にj番目の位置にある画素の
画素値をSx+i,y+jと表す。
That is, for example, for the reference image,
Consider a block composed of 8 × 8 pixels in the horizontal and vertical directions, and the pixel value of the pixel at the i-th position to the right and the j-th position to the right from the upper left of the block is denoted by R i, j . Further, regarding the image to be encoded, the x-axis or the y-axis is considered from the upper left to the right or downward, respectively, and the point (x,
From the upper left corner of a block where y) is the upper left pixel,
The pixel value of the pixel located at the i-th position in the right direction and the j-th position in the downward direction is represented as S x + i, y + j .

【0113】この場合、動き検出器120では、次式で
示されるd(x,y)が、x,yそれぞれを1ずつ変化
させて求められる。
In this case, the motion detector 120 obtains d (x, y) represented by the following equation by changing x and y by one.

【0114】[0114]

【数2】 ・・・(3)(Equation 2) ... (3)

【0115】そして、動き検出器120では、式(3)
のd(x,y)を最小にする(x,y)が動きベクトル
として検出され、さらに、その最小のd(x,y)が差
分絶対値和ADとして算出される。
Then, in the motion detector 120, the equation (3)
(X, y) that minimizes d (x, y) is detected as a motion vector, and the minimum d (x, y) is calculated as the sum of absolute differences AD.

【0116】画像評価回路130では、以上のようにし
て動き検出器120で求められるブロック単位の差分絶
対値和ADを用い、次式にしたがって、差分絶対値和の
総和SADが、第2のパラメータとして求められる。
The image evaluation circuit 130 uses the block-by-block difference absolute value sum AD obtained by the motion detector 120 as described above, and calculates the total sum SAD of the difference absolute value sums according to the following equation. Is required.

【0117】SAD=ΣAD・・・(4) 但し、式(4)においても、Σは、画像を構成するブロ
ックすべてについてのサメーションを表す。
SAD = ΣAD (4) However, also in equation (4), Σ represents summation for all the blocks constituting the image.

【0118】なお、画像評価回路130では、式(3)
で表される差分絶対値和ADの、マクロブロック単位で
の総和も求められる。これは、例えば、圧縮方法選択回
路132において行われる、各マクロブロックを、フレ
ーム内符号化するか、またはフレーム間符号化(前方予
測符号化、後方予測符号化、若しくは両方向予測符号
化)するかの決定などに用いられる。
In the image evaluation circuit 130, the expression (3)
The sum of the difference absolute value sum AD expressed by the following expression is also obtained in units of macroblocks. For example, whether each macro block is subjected to intra-frame coding or inter-frame coding (forward prediction coding, backward prediction coding, or bidirectional prediction coding) performed in the compression method selection circuit 132 It is used to determine

【0119】画像評価回路130において求められた第
1のパラメータSMADおよび第2のパラメータSAD
は、シーンチェンジ検出回路131、圧縮方法選択回路
132、予測パラメータ選択回路140、および量子化
ステップ制御器141に供給される。
First parameter SMAD and second parameter SAD obtained by image evaluation circuit 130
Are supplied to a scene change detection circuit 131, a compression method selection circuit 132, a prediction parameter selection circuit 140, and a quantization step controller 141.

【0120】前述したように、シーンチェンジ検出回路
131では、画像評価回路130の出力に基づき、シー
ンチェンジがあったかどうかが検出され、また、圧縮方
法選択回路132では、画像評価回路130からの評価
値、さらには必要に応じて、シーンチェンジ検出回路1
31の出力を用いて、画像の圧縮方法が選択される。
As described above, the scene change detection circuit 131 detects whether a scene change has occurred based on the output of the image evaluation circuit 130, and the compression method selection circuit 132 has the evaluation value from the image evaluation circuit 130 And, if necessary, a scene change detection circuit 1
Using the output of 31, an image compression method is selected.

【0121】なお、シーンチェンジ検出回路131で
は、例えば、連続する画像についての第2のパラメータ
SADどうしの比が求められ、その比の大小によって、
シーンチェンジがあったかどうかの検出が行われる。ま
た、圧縮方法選択回路132では、例えば、Pピクチャ
およびBピクチャについては、画像評価回路130から
供給される、平均絶対値和MADと差分絶対値和ADと
の、マクロブロック単位での総和を比較し、それらの大
小関係に基づいて、マクロブロックをフレーム内符号化
するか、またはフレーム間符号化するかが決定される。
即ち、マクロブロックについて、平均絶対値和MADの
総和の方が、差分絶対値和ADの総和より小さく、従っ
て、フレーム内符号化を行った方が発生符号量が少なく
なると予想される場合、フレーム内符号化を行うことが
選択される。また、平均絶対値和MADの総和の方が、
差分絶対値和ADの総和より大きく、従って、フレーム
間符号化を行った方が発生符号量が少なくなると予想さ
れる場合、フレーム間符号化を行うことが選択される。
Note that the scene change detection circuit 131 obtains, for example, the ratio between the second parameters SAD for continuous images.
It is detected whether a scene change has occurred. The compression method selection circuit 132 compares, for example, the sum of the average absolute value sum MAD and the difference absolute value sum AD supplied from the image evaluation circuit 130 in macroblock units for the P picture and the B picture. Then, it is determined whether the macroblock is to be intra-frame coded or inter-frame coded based on their magnitude relation.
That is, for a macroblock, if the sum of the average absolute value sums MAD is smaller than the sum of the differential absolute value sums AD, and therefore, it is expected that the amount of generated code will be smaller when intra-frame encoding is performed. It is selected to perform inner coding. Also, the sum of the average absolute value sums MAD is
If the sum of the absolute difference sums AD is larger than the sum of the absolute difference sums AD, and accordingly, it is expected that the generated code amount will be smaller when the interframe coding is performed, the interframe coding is selected.

【0122】一方、予測パラメータ選択回路140およ
び量子化ステップ制御器141では、例えば、図3のフ
ローチャートにしたがった処理が行われることにより、
量子化器115における量子化において用いられる量子
化ステップが決定される。
On the other hand, in the prediction parameter selection circuit 140 and the quantization step controller 141, for example, the processing according to the flowchart of FIG.
The quantization step used in the quantization in the quantizer 115 is determined.

【0123】即ち、各フレームにおける最初のマクロブ
ロックを量子化するときに、量子化ステップ制御器14
1は、ステップS1において、基本量子化ステップを算
出する。そして、ステップS2に進み、量子化ステップ
制御器141は、ステップS1で求めた基本量子化ステ
ップを、出力バッファ118からのバッファフィードバ
ックに基づいて調整し、その調整結果を、実際の量子化
に用いる量子化ステップとして設定(決定)する。この
量子化ステップは、量子化器115に供給され、マクロ
ブロックの量子化に用いられる。
That is, when the first macro block in each frame is quantized, the quantization step controller 14
1 calculates a basic quantization step in step S1. Then, the process proceeds to step S2, where the quantization step controller 141 adjusts the basic quantization step obtained in step S1 based on the buffer feedback from the output buffer 118, and uses the adjustment result for actual quantization. It is set (determined) as a quantization step. This quantization step is supplied to the quantizer 115 and used for quantization of the macroblock.

【0124】ステップS2において、マクロブロックの
量子化ステップを設定した後は、ステップS3に進み、
量子化ステップ制御器141において、1フレームを構
成するマクロブロックすべての量子化が終了したかどう
かが判定される。
After setting the macroblock quantization step in step S2, the process proceeds to step S3.
In the quantization step controller 141, it is determined whether or not quantization of all macroblocks constituting one frame has been completed.

【0125】ここで、圧縮方法選択回路132は、符号
化の対象となっている画像のピクチャタイプや、いま、
ピクチャの中のどのマクロブロックの処理が行われてい
るかなどの管理も行っており、量子化ステップ制御器1
41では、例えば、圧縮方法選択回路132に問い合わ
せを行うことで、ステップS3の判定処理を行うように
なされている。
Here, the compression method selection circuit 132 determines the picture type of the image to be encoded,
It also manages which macroblock in the picture is being processed, and so on.
At 41, for example, by making an inquiry to the compression method selection circuit 132, the determination processing of step S3 is performed.

【0126】ステップS3において、1フレームを構成
するマクロブロックすべての量子化が終了していないと
判定された場合、ステップS2に戻り、次のマクロブロ
ックを量子化するための量子化ステップが設定される。
また、ステップS3において、1フレームを構成するマ
クロブロックすべての量子化が終了したと判定された場
合、ステップS1に戻り、次のフレームについての基本
量子化ステップが算出される。
If it is determined in step S3 that the quantization of all the macroblocks constituting one frame has not been completed, the process returns to step S2, and a quantization step for quantizing the next macroblock is set. You.
If it is determined in step S3 that the quantization of all the macroblocks constituting one frame has been completed, the process returns to step S1, and the basic quantization step for the next frame is calculated.

【0127】次に、図4のフローチャートを参照して、
図3のステップS1における基本量子化ステップの算出
処理の詳細について説明する。
Next, referring to the flowchart of FIG.
The details of the calculation process of the basic quantization step in step S1 of FIG. 3 will be described.

【0128】この場合、まず最初に、ステップS11に
おいて、予測パラメータ選択回路140は、画像評価回
路130からの評価値(第1のパラメータSMADおよ
び第2のパラメータSAD)に基づき、フレーム間にお
いて、画像が急激に変化したかどうかを判定(検出)す
る。
In this case, first, in step S11, the prediction parameter selection circuit 140 determines whether an image is to be transmitted between frames based on the evaluation values (the first parameter SMAD and the second parameter SAD) from the image evaluation circuit 130. It is determined (detected) whether or not abruptly changed.

【0129】ここで、符号化対象の画像が、その前の画
面(フレーム)の画像から急激に変化した場合、SMA
D若しくはSADのうちのいずれか一方、またはその両
方が急激に変化する。
Here, when the image to be coded suddenly changes from the image of the previous screen (frame), the SMA
Either D or SAD, or both, change rapidly.

【0130】即ち、例えば、物体が一定方向に移動して
いる状態を表示している画像から、シーンチェンジなど
により、それとまったく異なる画像に変化すると、ほぼ
一定値であったSADが大きく変化する。また、例え
ば、ある静止画が表示された画像から、それとまったく
異なる静止画が表示された画像に変化すると、やはり、
ほぼ一定値であったSMADが大きく変化する。
That is, for example, when an image displaying a state in which an object is moving in a certain direction changes to an image completely different from the image due to a scene change or the like, the SAD, which is a substantially constant value, greatly changes. In addition, for example, when an image in which a certain still image is displayed changes to an image in which a completely different still image is displayed, again,
The SMAD, which was almost constant, changes greatly.

【0131】このように、画像の変化は、SMADやS
ADの変化となって現れるので、この変化量が所定の閾
値を越えるような場合は、大きな画像の変化があったと
考えられる。そこで、ステップS11では、SMADや
SADの変化量が所定の閾値を越えたかどうかを判定す
ることで、シーンチェンジなどの大きな画像の変化があ
ったかどうかが判定される。
As described above, the change of the image is determined by SMAD or S
Since this appears as a change in AD, if the amount of change exceeds a predetermined threshold, it is considered that a large image change has occurred. Thus, in step S11, it is determined whether or not the amount of change in SMAD or SAD has exceeded a predetermined threshold, thereby determining whether or not a large image change such as a scene change has occurred.

【0132】なお、画像がそれほど変化しなくても、S
MADやSADは変化するので、閾値は、これを考慮し
て設定するのが望ましい。
Note that even if the image does not change so much,
Since MAD and SAD change, it is desirable to set the threshold value in consideration of this.

【0133】ステップS11において、画像が急激に変
化していないと判定された場合、即ち、符号化対象の画
像が、例えば、前フレームとほとんど同一の画像となっ
ているか、ほぼ同一でなくても、それほど大きく変化し
たものではない場合、予測パラメータ選択回路140
は、従来における場合と同様に、既に符号化された画像
から得られる情報(後述する予測パラメータ)を用いて
学習を行うことにより、基本量子化ステップを算出する
ように、量子化ステップ制御器141を制御する。
In step S11, when it is determined that the image has not changed abruptly, that is, even if the image to be encoded is, for example, almost the same as the previous frame or not substantially the same. If the change is not so large, the prediction parameter selection circuit 140
As in the conventional case, the quantization step controller 141 performs learning using information (prediction parameters described later) obtained from an already-encoded image to calculate a basic quantization step. Control.

【0134】即ち、この場合、ステップS11からS1
2に進み、量子化ステップ制御器141は、例えば、次
式で示される予測パラメータx,yを算出する。
That is, in this case, steps S11 to S1
Proceeding to 2, the quantization step controller 141 calculates, for example, prediction parameters x and y represented by the following equations.

【0135】x=log(average_Q)y=log(generated_bit/di
ff1)・・・(5) なお、式(5)において、average_Qは、前回符号化さ
れたフレームを構成するマクロブロックの量子化に用い
た量子化ステップの平均値を意味する。また、generate
d_bitは、前回符号化されたフレームについての実際の
発生符号量を意味し、出力バッファ118からのバッフ
ァフィードバックに基づいて認識される。さらに、diff
1は、前回符号化されたフレームについての複雑さ(難
易度)(difficulty)を表し、画像評価回路130から
のSMADまたはSADに基づいて求められる。
X = log (average_Q) y = log (generated_bit / di
ff1) (5) In equation (5), average_Q means an average value of quantization steps used for quantization of macroblocks constituting a previously encoded frame. Also, generate
The d_bit indicates the actual amount of generated code for the previously encoded frame, and is recognized based on the buffer feedback from the output buffer 118. And diff
1 represents the complexity (difficulty) of the previously encoded frame, and is obtained based on the SMAD or SAD from the image evaluation circuit 130.

【0136】ステップS12で予測パラメータx,yを
算出した後は、ステップS13に進み、量子化ステップ
制御器141は、最も古い予測パラメータx,yを破棄
し、今回のステップS12の処理により得られた最新の
予測パラメータx,yを、学習サンプルとして新たに記
憶する。即ち、量子化ステップ制御器119は、基本量
子化ステップを予測するのに適当なフレーム数nについ
ての、過去に符号化された画像から求められた予測パラ
メータx,yを記憶するための図示せぬメモリを有して
おり、新たな予測パラメータx,yを得ると、そのメモ
リから、最も古い予測パラメータx,yを削除し(但
し、削除が行われるのは、メモリにn個の予測パラメー
タx,yが記憶されている場合のみ)、新たな予測パラ
メータx,yを記憶させる。
After calculating the prediction parameters x and y in step S12, the process proceeds to step S13, in which the quantization step controller 141 discards the oldest prediction parameters x and y, and obtains them by the current processing in step S12. The latest predicted parameters x and y are newly stored as learning samples. That is, the quantization step controller 119 is used to store the prediction parameters x and y obtained from the previously coded images for the number n of frames appropriate for predicting the basic quantization step. When a new prediction parameter x, y is obtained, the oldest prediction parameter x, y is deleted from the memory (however, the deletion is performed only when n prediction parameters are stored in the memory). Only when x and y are stored), new prediction parameters x and y are stored.

【0137】そして、量子化ステップ制御器141は、
ステップS14において、メモリに記憶されたn個の学
習サンプルとしての予測パラメータx,yを用いて回帰
分析による学習を行うことにより、基本量子化ステップ
を算出(予測)する。
Then, the quantization step controller 141
In step S14, a basic quantization step is calculated (predicted) by performing learning by regression analysis using the prediction parameters x and y as n learning samples stored in the memory.

【0138】即ち、量子化ステップ制御器141は、n
個の予測パラメータx,yを用いて、次式で示される
A,Bを算出する。
That is, the quantization step controller 141 sets n
Using the prediction parameters x and y, A and B represented by the following equations are calculated.

【0139】 A=(sum(xy)-(sum(x)×sum(y))/n)/(sum(x2)-(sum(x))2/n) B=(sum(y)/n-A)×sum(x)/n ・・・(6) 但し、式(6)において、sum()は、括弧()内の
値の、n個の予測パラメータについてのサメーションを
意味する。
A = (sum (xy) − (sum (x) × sum (y)) / n) / (sum (x 2 ) − (sum (x)) 2 / n) B = (sum (y) / nA) × sum (x) / n (6) In equation (6), sum () means the summation of the values in parentheses for n prediction parameters.

【0140】そして、量子化ステップ制御器141は、
式(6)のA,Bを用いて、基本量子化ステップQ_scal
eを、例えば、次式にしたがって算出する。
Then, the quantization step controller 141
Using A and B in equation (6), the basic quantization step Q_scal
e is calculated, for example, according to the following equation.

【0141】 Q_scale=exp((log(allocated_bit/diff2)-B)/A) ・・・(7) 但し、式(7)において、allocated_bitは、今回の符
号化対象のフレームに対するビット割当量を意味する。
また、diff2は、今回の符号対象のフレームについての
複雑さを表し、画像評価回路130からのSMADまた
はSADに基づいて求められる。
Q_scale = exp ((log (allocated_bit / diff2) −B) / A) (7) In Equation (7), “allocated_bit” means a bit allocation amount for the current encoding target frame. I do.
Diff2 represents the complexity of the current frame to be encoded, and is obtained based on the SMAD or SAD from the image evaluation circuit 130.

【0142】以上のようにして、ステップS14におい
て、基本量子化ステップQ_scaleが算出された後、リタ
ーンする。
As described above, after the basic quantization step Q_scale is calculated in step S14, the process returns.

【0143】一方、ステップS11において、画像が急
激に変化したと判定された場合、予測パラメータ選択回
路140は、記憶している予測パラメータをすべて破棄
するとともに、所定の基本量子化ステップを出力するよ
うに、量子化ステップ制御器141を制御する。
On the other hand, if it is determined in step S11 that the image has changed abruptly, the prediction parameter selection circuit 140 discards all the stored prediction parameters and outputs a predetermined basic quantization step. Next, the quantization step controller 141 is controlled.

【0144】即ち、この場合、ステップS11からS1
5に進み、予測パラメータ選択回路140は、画像評価
回路130からのSMADまたはSADに基づいて、式
(7)で説明した、今回の符号対象のフレームについて
の複雑さdiff2を求め、その複雑さdiff2に対応する基本
量子化ステップを選択するように、量子化ステップ制御
器141を制御する。
That is, in this case, from step S11 to S1
Proceeding to 5, the prediction parameter selection circuit 140 obtains the complexity diff2 of the current frame to be coded, described in equation (7), based on the SMAD or SAD from the image evaluation circuit 130, and calculates the complexity diff2 The quantization step controller 141 is controlled so as to select the basic quantization step corresponding to.

【0145】ここで、1フレームに対するビット割当量
allocated_bit、そのフレームの画像の複雑さdiff、お
よびそのフレームを量子化するのに適切な基本量子化ス
テップQ_scaleの間には、次式で示される関係があると
仮定することができる。
Here, the bit allocation amount for one frame
It can be assumed that there is a relationship between the allocated_bit, the image complexity diff for that frame, and the basic quantization step Q_scale that is appropriate for quantizing the frame.

【0146】 log(allocated_bit/diff)=A×log(Q_scale)+B ・・・(8) 但し、式(8)において、A,Bは、所定の定数であ
る。また、この式(8)を変形したものが、上述の式
(7)である。
Log (allocated_bit / diff) = A × log (Q_scale) + B (8) In Expression (8), A and B are predetermined constants. A modified version of this equation (8) is the above-mentioned equation (7).

【0147】式(8)における定数A,Bについては、
様々な複雑さの画像を用いて学習を行うことにより、そ
の複雑さごとに適切な値を求めることができ、そのよう
にしてあらかじめ求められた定数A,Bが、量子化ステ
ップ制御器141には記憶されている。
For the constants A and B in equation (8),
By performing learning using images of various complexity, an appropriate value can be obtained for each complexity, and the constants A and B obtained in advance in this way are transmitted to the quantization step controller 141. Is stored.

【0148】そして、今回の符号対象のフレームについ
ての複雑さdiff2に対応する基本量子化ステップを選択
するように、予測パラメータ選択回路140から指示が
あると、量子化ステップ制御器141では、その複雑さ
diff2に対応する定数A,Bを用いて、式(7)が計算
され、これにより、基本量子化ステップが求められる。
When the prediction parameter selection circuit 140 issues an instruction to select the basic quantization step corresponding to the complexity diff2 of the current frame to be encoded, the quantization step controller 141 Sa
Using the constants A and B corresponding to diff2, equation (7) is calculated, whereby the basic quantization step is obtained.

【0149】従って、シーンチェンジなどにより、符号
化しようとする画像が急激に変化した場合においては、
過去の符号化結果から得られる予測パラメータx,yを
用いて基本量子化ステップが求められるのではなく、符
号化しようとする画像の複雑さに対応した基本量子化ス
テップが求められるので、その予測精度が大きく低下す
ることを防止することができる。その結果、復号画像の
画質の劣化も低減することができる。
Therefore, when the image to be encoded changes rapidly due to a scene change or the like,
The basic quantization step corresponding to the complexity of the image to be coded is obtained instead of using the prediction parameters x and y obtained from the past coding results. It is possible to prevent the accuracy from being greatly reduced. As a result, deterioration of the image quality of the decoded image can be reduced.

【0150】ステップS15の処理後は、ステップS1
6に進み、予測パラメータ選択回路140は、記憶して
いるn個の予測パラメータx,yをすべて破棄(メモリ
から削除)するように、量子化ステップ制御器141を
制御し、リターンする。
After the processing in step S15, step S1
Proceeding to 6, the prediction parameter selection circuit 140 controls the quantization step controller 141 so as to discard (delete from the memory) all of the stored n prediction parameters x and y, and returns.

【0151】これにより、予測パラメータ選択回路14
0では、n個の予測パラメータx,yすべてがメモリか
ら削除される。従って、シーンチェンジなどにより、符
号化しようとする画像が急激に変化した後においては、
基本量子化ステップの算出にあたって、その変化前の符
号化結果から得られる予測パラメータx,yが用いられ
ることがなくなり、基本量子化ステップの予測精度が大
きく低下することを防止することができる。その結果、
復号画像の画質の劣化も低減することができる。
Thus, the prediction parameter selection circuit 14
At 0, all n prediction parameters x, y are deleted from memory. Therefore, after the image to be coded suddenly changes due to a scene change or the like,
In calculating the basic quantization step, the prediction parameters x and y obtained from the coding result before the change are not used, so that it is possible to prevent the prediction accuracy of the basic quantization step from being greatly reduced. as a result,
Deterioration of the image quality of the decoded image can also be reduced.

【0152】なお、本実施の形態においては、画像をM
PEGの規格に準拠した符号化を行うようにしたが、画
像の符号化方式は、その画像データを、少なくとも量子
化するものであれば良く、MPEG符号化だけに限定さ
れるものではない。
In the present embodiment, the image is
The encoding is performed according to the PEG standard. However, the encoding method of the image is not limited to the MPEG encoding as long as the image data is at least quantized.

【0153】また、本実施の形態では、予測パラメータ
選択回路140において、SMADおよびSADに基づ
き、画像に急激な変化が生じたかどうかを判定させるよ
うにしたが、その他、例えば、図5において点線で示す
ように、シーンチェンジ検出回路131から予測パラメ
ータ選択回路140に対して、シーンチェンジの検出結
果を供給するようにし、このシーンチェンジの検出結果
も考慮して、画像に急激な変化が生じたかどうかを判定
するようにすることが可能である。
Further, in the present embodiment, the prediction parameter selection circuit 140 determines whether or not a sharp change has occurred in the image based on SMAD and SAD. In addition, for example, in FIG. As shown in the figure, the scene change detection circuit 131 supplies a scene change detection result to the prediction parameter selection circuit 140. In consideration of the scene change detection result, it is determined whether a sharp change has occurred in the image. Can be determined.

【0154】さらに、本実施の形態では、特に言及しな
かったが、量子化ステップ制御器141では、各ピクチ
ャタイプごとに、基本量子化ステップが求められるよう
になされている。
Further, although not particularly mentioned in the present embodiment, the quantization step controller 141 is adapted to obtain a basic quantization step for each picture type.

【0155】[0155]

【発明の効果】請求項1に記載の画像符号化装置および
請求項2に記載の画像符号化方法によれば、画面間にお
ける画像の変化が検出され、その検出結果に対応して、
予測パラメータを破棄するとともに、所定の基本量子化
ステップを出力するように制御が行われる。従って、復
号画像の画質の劣化を防止(低減)することが可能とな
る。
According to the image encoding apparatus of the first aspect and the image encoding method of the second aspect, a change in an image between screens is detected, and in accordance with the detection result,
Control is performed so that the prediction parameters are discarded and a predetermined basic quantization step is output. Therefore, it is possible to prevent (reduce) deterioration of the image quality of the decoded image.

【0156】請求項3に記載の記録媒体には、請求項2
に記載の画像符号化方法により符号化された画像データ
が記録されている。従って、良質な画質の復号画像を得
ることが可能となる。
The recording medium according to the third aspect includes the second aspect.
The image data encoded by the image encoding method described in (1) is recorded. Therefore, it is possible to obtain a decoded image of high quality.

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

【図1】本発明を適用したパーソナルコンピュータの一
実施の形態の構成例を示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration example of a personal computer according to an embodiment of the present invention.

【図2】図1の圧縮部13の構成例を示すブロック図で
ある。
FIG. 2 is a block diagram illustrating a configuration example of a compression unit 13 in FIG.

【図3】図2の予測パラメータ選択回路140および量
子化ステップ制御器141の処理を説明するためのフロ
ーチャートである。
FIG. 3 is a flowchart for explaining processing of a prediction parameter selection circuit 140 and a quantization step controller 141 of FIG. 2;

【図4】図3のステップS1の処理のより詳細を説明す
るためのフローチャートである。
FIG. 4 is a flowchart for explaining the process in step S1 of FIG. 3 in more detail;

【図5】従来の画像符号化装置の一例の構成を示すブロ
ック図である。
FIG. 5 is a block diagram illustrating a configuration of an example of a conventional image encoding device.

【図6】入力端子101に入力される画像データを示す
図である。
FIG. 6 is a diagram showing image data input to an input terminal 101.

【図7】マクロブロックと、それを構成するブロックと
を示す図である。
FIG. 7 is a diagram showing a macroblock and blocks constituting the macroblock.

【図8】ジグザグスキャンを示す図である。FIG. 8 is a diagram showing a zigzag scan.

【図9】GOPを示す図である。FIG. 9 is a diagram showing a GOP.

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

1 マイクロプロセッサ, 2 メインメモリ, 3
フレームバッファ,4 バスブリッジ, 5 チュー
ナ, 6 モデム, 7 I/Oインターフェイス,
8 キーボード, 9 マウス, 10 補助記憶イン
ターフェイス,11 CD−R, 12 ハードディス
ク, 13 圧縮部, 14 ビデオカメラ, 15
伸張部, 16 VTR, 17 コンピュータディス
プレイ, 101 入力端子, 102 出力端子,
110 フレームメモリ, 111 ブロック分割器,
112 差分器, 113 切換スイッチ, 114
DCT回路, 115 量子化器(量子化手段), 1
16 ジグザグスキャン回路, 117 VLC回路,
118 出力バッファ, 120 動き検出器, 1
21 動き補償器, 122 フレームメモリ, 12
3 切換スイッチ, 124 加算器, 125 逆D
CT回路, 126 逆量子化器, 130 画像評価
回路, 131 シーンチェンジ検出回路, 132
圧縮方法選択回路, 140 予測パラメータ選択回路
(変化検出手段)(制御手段),141 量子化ステッ
プ制御器(基本量子化ステップ算出手段)(量子化ステ
ップ設定手段)
1 microprocessor, 2 main memory, 3
Frame buffer, 4 bus bridge, 5 tuner, 6 modem, 7 I / O interface,
Reference Signs List 8 keyboard, 9 mouse, 10 auxiliary storage interface, 11 CD-R, 12 hard disk, 13 compression unit, 14 video camera, 15
Extension unit, 16 VTR, 17 computer display, 101 input terminal, 102 output terminal,
110 frame memory, 111 block divider,
112 Difference device, 113 Changeover switch, 114
DCT circuit, 115 Quantizer (quantization means), 1
16 zigzag scan circuit, 117 VLC circuit,
118 output buffer, 120 motion detector, 1
21 motion compensator, 122 frame memory, 12
3 changeover switch, 124 adder, 125 reverse D
CT circuit, 126 inverse quantizer, 130 image evaluation circuit, 131 scene change detection circuit, 132
Compression method selection circuit, 140 prediction parameter selection circuit (change detection means) (control means), 141 quantization step controller (basic quantization step calculation means) (quantization step setting means)

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 画像データを所定の量子化ステップで量
子化する量子化手段と、 前記所定の量子化ステップを設定するための基本となる
基本量子化ステップを、既に符号化された前記画像デー
タから得られる情報としての予測パラメータを用いて学
習を行うことにより求める基本量子化ステップ算出手段
と、 前記基本量子化ステップから、前記所定の量子化ステッ
プを設定する量子化ステップ設定手段と、 画面間における画像の変化を検出する変化検出手段と、 前記変化検出手段の検出結果に対応して、前記予測パラ
メータを破棄するとともに、所定の基本量子化ステップ
を出力するように、前記基本量子化ステップ算出手段を
制御する制御手段とを備えることを特徴とする画像符号
化装置。
A quantizing means for quantizing the image data in a predetermined quantization step; and a basic quantization step which is a basis for setting the predetermined quantization step, comprising the steps of: A basic quantization step calculating means for obtaining by performing learning using a prediction parameter as information obtained from; a quantization step setting means for setting the predetermined quantization step from the basic quantization step; A change detecting means for detecting a change in an image in the calculation of the basic quantization step so as to discard the prediction parameter and output a predetermined basic quantization step in accordance with a detection result of the change detection means. Control means for controlling the means.
【請求項2】 画像データを所定の量子化ステップで量
子化する量子化手段と、 前記所定の量子化ステップを設定するための基本となる
基本量子化ステップを、既に符号化された前記画像デー
タから得られる情報としての予測パラメータを用いて学
習を行うことにより求める基本量子化ステップ算出手段
と、 前記基本量子化ステップから、前記所定の量子化ステッ
プを設定する量子化ステップ設定手段とを備える画像符
号化装置の画像符号化方法であって、 画面間における画像の変化を検出し、 その検出結果に対応して、前記予測パラメータを破棄す
るとともに、所定の基本量子化ステップを出力するよう
に、前記基本量子化ステップ算出手段を制御することを
特徴とする画像符号化方法。
2. A quantization means for quantizing image data in a predetermined quantization step, and a basic quantization step which is a basis for setting the predetermined quantization step, comprising: An image comprising: a basic quantization step calculating unit that is obtained by performing learning using a prediction parameter as information obtained from the information processing unit; and a quantization step setting unit that sets the predetermined quantization step from the basic quantization step. An image encoding method for an encoding device, comprising: detecting a change in an image between screens, discarding the prediction parameter, and outputting a predetermined basic quantization step in accordance with the detection result. An image encoding method comprising controlling the basic quantization step calculating means.
【請求項3】 請求項2に記載の画像符号化方法により
符号化された画像データが記録されていることを特徴と
する記録媒体。
3. A recording medium on which image data encoded by the image encoding method according to claim 2 is recorded.
JP8650797A 1997-04-04 1997-04-04 Image encoder, image encoding method and recording medium Withdrawn JPH10285600A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8650797A JPH10285600A (en) 1997-04-04 1997-04-04 Image encoder, image encoding method and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8650797A JPH10285600A (en) 1997-04-04 1997-04-04 Image encoder, image encoding method and recording medium

Publications (1)

Publication Number Publication Date
JPH10285600A true JPH10285600A (en) 1998-10-23

Family

ID=13888902

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8650797A Withdrawn JPH10285600A (en) 1997-04-04 1997-04-04 Image encoder, image encoding method and recording medium

Country Status (1)

Country Link
JP (1) JPH10285600A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013128189A (en) * 2011-12-19 2013-06-27 Canon Inc Image encoder

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013128189A (en) * 2011-12-19 2013-06-27 Canon Inc Image encoder

Similar Documents

Publication Publication Date Title
JP4123567B2 (en) Image signal processing apparatus and method
US5731850A (en) Hybrid hierarchial/full-search MPEG encoder motion estimation
US7532808B2 (en) Method for coding motion in a video sequence
US5751358A (en) Video encoder with quantization controlled by inter-picture correlation
US7224734B2 (en) Video data encoding apparatus and method for removing a continuous repeat field from the video data
JP3189861B2 (en) Video encoding apparatus and method
JP2000278692A (en) Compressed data processing method, processor and recording and reproducing system
JPH09322176A (en) Encoding mode selecting method, moving image encoding device, encoding method, recording method and transmitting method
JPH10290391A (en) Image processor, image processing method and record medium
JPH10285542A (en) Image recorder and image recording method
JPH10257366A (en) Image-processing device and method therefor
US6968087B1 (en) Encoding apparatus, encoding method, and storage medium
JP3888533B2 (en) Image coding apparatus according to image characteristics
JP3480067B2 (en) Image coding apparatus and method
JP2000312362A (en) Image encoding system conversion device and its method and recording medium
JP3200199B2 (en) Video compression encoding method
JPH05183872A (en) Device and method for moving picture encoding
JPH10285600A (en) Image encoder, image encoding method and recording medium
JP3428332B2 (en) Image encoding method and apparatus, and image transmission method
JPH09214965A (en) Method and device for encoding moving image
JPH10108197A (en) Image coder, image coding control method, and medium storing image coding control program
JP4605183B2 (en) Image signal processing apparatus and method
JP2004180345A (en) Photographed image recording apparatus
JPH09261530A (en) Video recorder
JP2868445B2 (en) Moving image compression method and apparatus

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20040706