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

Image coding apparatus and image coding method Download PDF

Info

Publication number
JP3711573B2
JP3711573B2 JP23811294A JP23811294A JP3711573B2 JP 3711573 B2 JP3711573 B2 JP 3711573B2 JP 23811294 A JP23811294 A JP 23811294A JP 23811294 A JP23811294 A JP 23811294A JP 3711573 B2 JP3711573 B2 JP 3711573B2
Authority
JP
Japan
Prior art keywords
quantization step
image
amount
information
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP23811294A
Other languages
Japanese (ja)
Other versions
JPH08102946A (en
Inventor
聡 三橋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP23811294A priority Critical patent/JP3711573B2/en
Publication of JPH08102946A publication Critical patent/JPH08102946A/en
Application granted granted Critical
Publication of JP3711573B2 publication Critical patent/JP3711573B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/004Predictors, e.g. intraframe, interframe coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Television Signal Processing For Recording (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

【0001】
【産業上の利用分野】
本発明は、例えば画像を圧縮符号化する場合に用いて好適な画像符号化装置及び画像符号化方法に関する。
【0002】
【従来の技術】
従来の例えば画像を圧縮符号化する場合に用いて好適な画像符号化装置の構成例を図9に示す。
この図9の画像符号化装置において、入力端子1には、図10に示すように、
輝度成分(Y) 352(H)×240(V)×30フレーム
クロマ成分(Cb) 174(H)×120(V)×30フレーム
クロマ成分(Cr) 174(H)×120(V)×30フレーム
のピクセル数にディジタル化された画像データが供給される。
【0003】
上記入力端子1に供給された入力画像データは、当該入力画像データを一時的に蓄えて然るべき順番に入れ替えるためのフレームメモリ10を介して、動き検出器20とブロック分割器11に送られる。
当該ブロック分割器11は、フレームメモリ10から供給されたそれぞれのフレームを、図11に示すように、輝度成分(Y) ,クロマ成分(Cr),(Cb) それぞれを8×8ピクセルのブロックに分割する。なお、輝度成分(Y) の4つのブロック(Y0,Y1,Y2,Y3)と1つのクロマ成分(Cb)のブロックと、1つのクロマ成分(Cr)のブロックからなる合計6つのブロック(Y0,Y1,Y2,Y3,Cb,Cr) は、マクロブロック(MB)と呼ばれている。
【0004】
このブロック分割器11からのマクロブロック単位のデータは差分器12に送られる。
この差分器12では、ブロック分割器11からのデータと後述するフレーム間予測画像データとの差分をとり、その出力を後述するフレーム間予測符号化がなされるフレームのデータとして切換スイッチ13の被切換端子bに送る。また、当該切換スイッチ13の被切換端子aには、上記ブロック分割器11からのデータが後述するフレーム内符号化がなされるフレームのデータとして供給される。
【0005】
上記切換スイッチ13を介したブロック単位のデータはDCT回路14によって離散コサイン変換(DCT)処理され、そのDCT係数が量子化器15に送られる。当該量子化器15では、所定の量子化ステップ幅で上記DCT出力を量子化し、この量子化した係数がジグザグスキャン回路16に送られる。
当該ジグザグスキャン回路16では、上記量子化係数を図12に示すようにいわゆるジグザグスキャンによって並べ換え、その出力を可変長符号化回路17に送る。この可変長符号化回路17では、上記ジグザグスキャン回路16の出力データを可変長符号化(VLC)し、その出力を出力バッファ18に送ると共に、当該可変長符号化処理により発生した符号量を示す情報を、量子化ステップ制御器19に送る。量子化ステップ制御器19は、可変長符号化回路17からの符号量を示す情報に基づいて量子化器15の量子化ステップ幅を制御する。また、上記出力バッファ18から出力されたデータは圧縮符号化がなされた符号化出力として出力端子2から出力される。
【0006】
また、上記量子化器15からの出力は、逆量子化器27によって逆量子化され、さらに逆DCT回路26によって逆DCT処理される。当該逆DCT回路26の出力は、加算器25に送られる。
この加算器25には、フレーム間予測符号化のフレームのときにオンとなる切換スイッチ24を介した動き補償器21からのフレーム間予測画像データも供給され、当該データと上記逆DCT回路26の出力データとの加算が行われる。この加算器25の出力データは、フレームメモリ22に一時的に蓄えられた後、動き補償器21に送られる。
【0007】
当該動き補償器21は、上記動き検出器20によって検出された動きベクトルに基づいて動き補償を行い、これによって得たフレーム間予測画像データを出力する。
以下、上記図9の従来の画像符号化装置の具体的な動作について詳細に説明する。ここで、説明のために以下のように各フレームの呼び名を定義する。
【0008】
先ず、表示順にフレームを並べたとき、それぞれを
I0,B1,B2,P3,B4,B5,P6,B7,B8,I9,B10,B11,B12,・・・・・
と呼ぶこととする。これらのフレームのうち、I,P,Bは、後に説明するが、圧縮方法の種類を示し、これらI,P,Bの次の数字は、単純に表示順を示している。
【0009】
カラー動画像符号化方式の国際標準化作業グループであるいわゆるMPEG(Moving Picture Expert Group)のうちMPEG1では、この様な画像を圧縮するために、以下のようにすることが規定されている。
先ず、I0の画像を圧縮する。
次に、P3の画像を圧縮するのだが、P3そのものを圧縮するのではなく、P3とI0の画像との差分データを圧縮する。
【0010】
その次に、B1の画像を圧縮するのだが、B1そのものを圧縮するのではなく、B1とI0或いは、B1とP3との差分データ或いはI0とP3の平均値との差分(いずれか情報の少ない方)を圧縮する。
その次に、B2の画像を圧縮するのだが、B2そのものを圧縮するのではなく、B2とI0或いは、B2とP3との差分データ或いはI0とP3の平均値との差分(どちらか情報の少ない方を選んで)を圧縮する。
【0011】
次に、P6の画像を圧縮するのだが、P6そのものを圧縮するのではなく、P6とP3の画像との差分データを圧縮する。
上述したような処理を順番に並べて表すと、

Figure 0003711573
となる。このようにエンコード順は、
I0,P3,B1,B2,P6,B4,B5,P9,B7,B8,I9,P12,B10,B11,・・・・
のように、表示順とは順番が入れ替わる。圧縮後のデータ(符号化データ)はこの順番に並ぶことになる。
【0012】
以下、上述したことを図4の構成の動作と共にさらに詳しく述べる。
1枚目の画像(すなわちI0)のエンコードでは、先ず、上記フレームメモリ10から1枚目に圧縮すべき画像のデータが、ブロック分割器11によってブロック化される。このブロック分割器11からは、前記Y0,Y1,Y2,Y3,Cb,Crの順にブロック毎のデータが出力され、被切換端子a側に切り換えられた切換スイッチ13を介してDCT回路14に送られる。このDCT回路14では、それぞれのブロックについて縦横2次元の離散コサイン変換処理を行う。これにより、空間軸であったデータが周波数軸に変換される。
【0013】
このDCT回路14からのDCT係数は、量子化器15に送られ、当該量子化器15で所定の量子化ステップ幅で量子化される。その後、ジグザグスキャン回路16によって図12のようにジグザグ順に並べ変えられる。このようにジグザグ順に並べると、後ろへ行くほど、その係数は周波数成分の高い係数となるから、一般的に係数の値は後ろの方が小さくなる傾向にある。したがって、ある値Sで量子化すると、後ろへ行くほど、その結果は0になる頻度が増し、結果的に高域の成分が切り落とされることになる。
【0014】
その後、この量子化後の係数は、可変長符号化(VLC)回路17へ送られ、ここでいわゆるハフマンコーディングが施される。この結果得られる圧縮されたビットストリームは、出力バッファ18に一旦蓄えられた後、一定のビットレートで送出される。当該出力バッファ18は、不規則に発生するビットストリームを一定のビットレートで送出できるようにするための緩衝のためのメモリである。
【0015】
以上の様に1枚の画像だけ単独で圧縮することをフレーム内(イントラ:Intra )符号化と言い、この画像をIピクチャと呼ぶ。
したがって、デコーダが上記のIピクチャのビットストリームを受信した場合は、以上に述べたことを逆にたどり、1枚目の画像を完成させる。
次に、2枚目の画像(すなわちP3)のエンコードでは、以下のようになされる。
【0016】
すなわち、この2枚目以降もIピクチャとして圧縮してビットストリームを作っても良いが圧縮率を上げるには、連続する画像の内容には相関があることを利用して、以下の様な方法で圧縮する。
先ず、動き検出器20では、2枚目の画像を構成するマクロブロック毎に、1枚目の画像(I0)の中からそれに良く似たパターンを捜し出し、それを動きベクトルという(x,y)の相対位置の座標として表現する。
【0017】
また、2枚目の画像ではそれぞれのブロックを、上記Iピクチャの場合のようにそのままDCT回路14に送るのではなく、そのブロック毎の動きベクトルに従って一枚目の画像から引っ張ってきたブロックとの差分のデータ(差分器12による差分データ)を、DCT回路14へ送るようにする。なお、動きベクトルの検出方法としては、ISO/IEC 11172-2 annex D.6.2 に詳細に述べられているためここでは省略する。
【0018】
ここで、例えば上記動きベクトルによって示された一枚目の画像のパターンと、これから圧縮しようとするブロックのパターンとの間で、相関が非常に強くなっていれば、その差分データは非常に小さくなり、したがって、上記フレーム内(イントラ)符号化で圧縮するよりも、上記動きベクトルと上記差分データとを符号化した方が、圧縮後のデータ量は小さくなる。
【0019】
このような圧縮方法を、フレーム間(インター:Inter)予測符号化と呼んでいる。ただし、常に差分データが少なくなるわけではなく、絵柄(画像内容)によっては、差分を取るよりも、上記フレーム内符号化で圧縮した方が、圧縮率が上がる場合がある。このような場合は、上記フレーム内符号化で圧縮する。フレーム間予測符号化にするか、フレーム内符号化にするかは、マクロブロック毎に異なる。
【0020】
以上のことを図9の画像符号化装置(エンコーダ)に即して説明すると、先ず、フレーム間予測符号化を行うためには、エンコーダ側でたえずデコーダ側で作られる画像と同じ画像を作って置く必要がある。
そのためにエンコーダ内には、デコーダと同じ回路が存在する。その回路をローカルデコーダ(局部復号器)と呼ぶ。図9の逆量子化器27と逆DCT回路26と加算器25とフレームメモリ22と動き補償器21が当該ローカルデコーダに対応し、フレームメモリ22内に記憶される画像のことをローカルデコーデッドピクチャ(Local decoded picture)又はローカルデコーデッドデータ(Local decoded data)と呼ぶ。これに対して、圧縮前の画像のデータは、オリジナルピクチャ(Original picture)又はオリジナルデータ(Original data) と呼ぶ。
【0021】
なお、前述した1枚目のIピクチャの圧縮時にも、上記ローカルデコーダを通して復号化された1枚目の画像が、上記フレームメモリ22内に格納される。ここで、注意すべきことは、このローカルデコーダによって得られる画像は、圧縮前の画像ではなく、圧縮後復元した画像であり、圧縮による画質劣化のある、デコーダが復号化する画像とまったく同じ画像であるということである。
【0022】
このような状態のエンコーダに2枚目の画像(P3)のデータ(Original data)が入ってくるわけだが(この段階ですでに、動きベクトルは検出済でなければならない)、データはブロック毎に動きベクトルを持ち、このベクトルが動き補償器(MC:Motion Compensation)21に与えられる。当該動き補償回路21は、その動きベクトルの示すローカルデコーデッドピクチャ上のデータ(動き補償データ:MC data:1マクロブロック)を上記フレーム間予測画像データとして出力する。
【0023】
上記2枚目のオリジナルデータとこの動き補償データ(フレーム間予測画像データ)のピクセル毎の、差分器12による差分データが、上記DCT回路14に入力される。それからの後の圧縮方法は、基本的にIピクチャと同じである。上述のような圧縮方法によって圧縮する画像をPピクチャ(Predicted picture)と呼ぶ。
【0024】
さらに詳しく説明すると、Pピクチャにおいてすべてのマクロブロックがフレーム間予測符号化で圧縮するとは限らず、フレーム内符号化で圧縮する方が効率が良いと判断されるときは、そのマクロブロックは当該フレーム内符号化で符号化を行う。
すなわち、Pピクチャにおいても、マクロブロック毎に、フレーム内符号化によるか(このマクロブロックをイントラマクロブロックと呼ぶ)、又はフレーム間予測符号化によるか(このマクロブロックをインターマクロブロックと呼ぶ)のどちらかを選択して圧縮を行う。
【0025】
上述のように、上記ローカルデコーダでは、量子化器15の出力が、逆量子化器27で逆量子化され、さらに逆DCT回路26で逆DCT処理された後、エンコード時に動き補償データ(MC data )と足され最終的なローカルデコーデッドピクチャとなる。
次に、3枚目の画像(すなわちB1)のエンコードでは、以下のようになされる。
【0026】
上記3枚目の画像(B1)のエンコードでは、I0,P3の2枚の画像それぞれに対する動きベクトルを探索する。ここで、I0に対する動きベクトルをフォワードベクトル(forward Vector)MVf(x,y) と呼び、P3に対する動きベクトルをバックワードベクトル(Backward Vector)MVb(x,y) と呼ぶ。
この3枚目の画像についても差分データを圧縮するわけであるが、どのデータを圧縮するのかが、問題である。この場合も一番情報量が少なくなるものとの差分を取れば良い。このときの圧縮方法の選択肢としては、
(1)フォワードベクトルMVf(x,y) の示すI0上のデータとの差分
(2)バックワードベクトルMVb(x,y) の示すP3上のデータとの差分
(3)フォワードベクトルMVf(x,y) の示すI0上のデータとバックワードベクトルMVb(x,y) の示すP3上のデータの平均値との差分
(4)差分データは使わない(フレーム内符号化)
の4つである。マクロブロック毎にこの4種類の圧縮方法から一つが選択される。上記圧縮方法の選択肢のうちの(1),(2),(3)の場合は、それぞれの動きベクトルも動き補償器21に送られ、差分器21ではその動き補償データとの差分をとり、これがDCT回路14に送られる。上記圧縮方法の選択肢のうちの(4)の場合は、そのままのデータがDCT回路14へ送られる。
【0027】
上述した1枚目、2枚目のエンコードの処理の結果、ローカルデコーデッドピクチャを格納するフレームメモリ22には、I0,P3の2枚のピクチャが、復元されているのでこのようなことが可能である。
次に、4枚目の画像(すなわちB2)のエンコードでは、以下のようになされる。
【0028】
上記4枚目の画像(B2)のエンコードでは、上述した3枚目(B1)のエンコード方法のところの説明文で、B1をB2に置き換えたこと以外は、上記3枚目のエンコードと同じ方法で圧縮する。
次に、5枚目の画像(すなわちP6)のエンコードでは、以下のようになされる。
【0029】
上記5枚目の画像(P6)のエンコードでは、上述した2枚目(P3)のエンコード方法のところの説明文で、P3をP6に、I0をP3に置き換えただけで、他は同じ説明となる。
6枚目以降は、上述の繰り返しとなるので説明は省略する。
また、MPEGにおいては、GOP(Group Of Picture)と呼ばれるものが規定されている。
【0030】
すなわち、何枚かのピクチャの集まりがグループオブピクチャ(GOP)と呼ばれており、当該GOPは符号化データ(圧縮後のデータ)上で見て連続した画像の集まりでなくてはならないものである。また、GOPはランダムアクセスを考慮したもので、そのためには符号化データ上で見てGOPの最初に来るピクチャは上記Iピクチャである必要がある。さらに、表示順(ディスプレイ順)でGOPの最後は、I又はPピクチャでなくてはならない。
【0031】
図13には、最初が4枚のピクチャからなるGOPで、それ以降が6枚のピクチャからなるGOPとなる例を挙げる。なお、図13のAはディスプレイ順を示し、図13のBは符号化データ順を示している。
この図13において、GOP2に注目すると、B4,B5はP3,I6から形成されるため、例えばランダムアクセスでI6にアクセスされると、P3が無いため、B4,B5は正しく復号化できない。このようにGOP内だけで正しく復号化できないGOPは、クローズドGOP(Closed GOP)でないという。
【0032】
これに対し、もしB4,B5がI6だけしか参照していないとしならば、例えばランダムアクセスでI6にアクセスしても、P3は必要ないため、これらB4,B5は正しく復号化できることになる。このようにGOP内だけの情報で、完全に復号化できるGOPをクローズドGOP(Closed GOP)と呼ぶ。
以上のような圧縮方法の選択の中から一番効率の良い方法で圧縮するわけであるが、その結果発生する符号化データ(Coded data)の量は、入力画像にも依存し、実際に圧縮してみないと判らない。
【0033】
しかし、圧縮後のデータのビットレートを一定にするためにコントロールすることも必要である。当該コントロールを行うためのパラメータは、量子化器15に与える前記符号量を表す情報としての量子化ステップ(又は量子化スケール:Q-scale )である。同じ圧縮方法でも、上記量子化ステップを大きくすれば発生ビット量は減り、小さくすれば増える。
【0034】
この量子化ステップの値は、次のようにして制御する。
エンコーダには、圧縮後のデータを一定のビットレートにするために、出力に緩衝バッファ(出力バッファ18)が設けられており、これによって画像毎のある程度のデータ発生量の差は吸収できるようになされている。
しかし、定められたビットレートを超えるようなデータの発生が続けば、出力バッファ18の残量が増加し、ついにはオーバーフローを起こすことになる。逆にビットレートを下回るデータの発生が続けば出力バッファ18の残量は減少し、最後にはアンダーフローを引き起こすことになる。
【0035】
したがって、エンコーダは、出力バッファ18の残量をフィードバックすることにより、前記量子化ステップ制御器19が量子化器15の量子化ステップをコントロールし、ここで出力バッファ18の残量が少なくなればあまり圧縮しないように量子化ステップを小さくなるよう制御し、出力バッファ18の残量が多くなれば圧縮率を高くするように量子化ステップを大きくするようにコントロールを行うようにしている。
【0036】
また、前述した圧縮方法(前記フレーム内符号化やフレーム間予測符号化)によって発生する符号化データ量の範囲には、大きな差がある。
特にフレーム内符号化方式で圧縮をすると大量のデータが発生するため、出力バッファ18の空き容量が小さい場合には量子化ステップサイズを大きくしなければならず、場合によっては量子化ステップサイズを最大にしてもバッファ18のオーバーフローを招くかもしれない。よしんばバッファ18に収まったとしても量子化ステップが大きければフレーム内符号化の画像は後のフレーム間予測符号化の画質に影響するので、フレーム内符号化での圧縮を行う前には出力バッファ18に十分な空き容量が必要である。
【0037】
したがって、予め定められた順序の圧縮方法を決めておき、フレーム内符号化の前には十分な出力バッファ18の空き容量を確保するように、量子化ステップ制御器19は量子化ステップサイズのフィードバックコントロールを行うようにしている。
以上のようにして一定レートの符号化データに抑えることが可能となる。
【0038】
【発明が解決しようとする課題】
上述した従来の方法では、以下の理由により高画質を得られないことが欠点となっている。
すなわち、時々刻々情報量の変化する入力画像を一定のビットレートで平均的に高画質に圧縮するためには、出力バッファによって低ビットレートを維持できる範囲でかつ画質が均質になるように、情報量の多い画像(絵)には多めの圧縮データを許し、情報量の少ない画像には少なめの圧縮データにすることが必要だが、次のような場合に従来の方法ではそれができない。
【0039】
例えば、情報量の少ない画像が連続し、そのあとで急に情報量の多い画像が入ってくる場合を考えると、先に供給される情報量の少ない画像に対しては量子化ステップをあまり小さくし過ぎず、その後に続く情報量が多い画像が符号化されるまで出力バッファの残量を低く保つべきであるのに、前述した出力バッファ残量をフィードバックする方式では、上記情報量が少ない画像が連続するうちに出力バッファの残量を増加させてしまうようになる。
【0040】
逆に、情報量が多い画像の後に情報量の少ない画像が続く場合では、先に供給される情報量の多い画像を大きな量子化ステップで圧縮して出力バッファの残量を減らさなくても、その後に続くのは情報量の少ない画像なのでオーバーフローし難いはずであるが、上記出力バッファ残量フィードバック方式では、続く画像の情報量がわからないためバッファの残量を減らす方向、すなわち量子化ステップを大きくする方向に制御し、画質を低下させてしまう。
【0041】
このようなことから、例えば、入力画像の情報量を評価し、この評価値に基づいて量子化ステップを制御するような構成も考えられる。
ところが、上記入力画像の情報量の評価値を求めるような機構を備えた画像符号化装置において、例えば1枚の入力画像を圧縮する際には、当該入力情報を圧縮した後に得られることになるデータに対して使用可能な割当量を、当該入力画像の情報量(難易度)に応じて配当することになるが、そのときの量子化器の量子化ステップを、当該割当量に応じて精度良く予測する必要がある。
【0042】
ここで、もしも、上記予測した量子化ステップが適当でない場合には、上記圧縮後のデータに対して使用可能な割当量を大幅に割り込んだり、逆にオーバーしたりしてしまうことになる。このように割当量を大幅に割り込んだり、オーバーしたりすると、他のピクチャの圧縮の際の割当量に影響を与えてしまうことになる。
【0043】
すなわち例えば、割当量が少なくなったフレームでは、量子化ステップが大きくなり、したがって画質が低下するようになる。このため、例えば連続的に見て均等な画質のフレームが続かなくなり、全体的に見ても画質が悪い印象になってしまう。また、上記予測が大幅にずれると、最悪の場合、バッファのアンダーフローやオーバーフローを招くことになる。
【0044】
ここで、そのようにならないようにするために、例えば、1画面内で圧縮後の情報量と予定割当量と圧縮の進捗の画面内での割合で量子化ステップを制御していたとしても、基本の量子化ステップの予測が外れると画面内での量子化ステップの大きな変動が起こるようになる。このように画面内での量子化ステップの大きな変動が起こると、上記圧縮はラスタースキャン順になされるものなので、画面上で帯状に画質の不均等な部分が認識され、画質低下をもたらすようになる。
【0045】
ところで、量子化ステップの画面内の制御の目的は、二つあり、一つは画面内での画質を向上させることと、もう一つは、割当ビット量に十分近くなるように発生ビット量を制御することである。
例えば、画面内において量子化ステップの制御を行わないで一定の量子化スケールに固定した場合、画面内のどの部分においても量子化ステップが一定で同一であるため、DCT処理後の周波数軸上においては画面上に分布する量子化による量子化誤差は、一様(一定)であると言える。ただし、誤差分布が一様であるからといって、人間が認識できる画質劣化は一様でなく、劣化が目立つ部分と劣化がわからない部分が存在する。そこで、劣化が目立つ部分には量子化ステップを小さくし、量子化誤差による画質劣化を目立たなくし、わからない部分は量子化ステップを大きくし、無駄な量子化後の係数による圧縮後のデータ量の増加を削減する必要がある。
【0046】
他方で、入力画像によっては一画面に割り当てられるビット割当量に対して、圧縮後のデータ量(発生量)が多くなってしまったり、少なくなってしまったりする(予定に対して使い過ぎてしまうようなとき)場合がある。このとき、例えば画面毎の量子化ステップの制御を行なわずに、一定の同一の量子化ステップを使った場合で、基本量子化ステップが小さい場合には、量子化ステップが1違っただけでデータ発生量は大きく異なることになる。例えば、IピクチャやPピクチャよりも少ない割当量となるBピクチャ1枚分くらいは簡単にデータ発生量が変動することになる。したがって、データ発生量制御の見地からも画面内で量子化ステップの制御を行なう必要がある。
【0047】
この画面内の量子化ステップ制御として、マクロブロック毎に量子化ステップの制御を行うことを考えることができる。このマクロブロック毎の量子化ステップ制御には、画質向上とデータ発生量制御の2つの目的がある。しかし、このマクロブロック毎の量子化ステップ制御でも、マクロブロック毎に1つの量子化ステップを用いるような制御を行うと、上記画像とデータ発生量とが共に変化してしまい、それぞれの上記目的を別々に満足することができない。
【0048】
例えば、画質を制御する場合に基本となるマクロブロック内の量子化ステップの振幅(変化幅)は、例えば基本量子化ステップbase_Q が4(base _Q=4)の時と、15(base _Q=15) の時とでは大きく異なることが経験的に判っている。また、発生量を制御する場合、基本量子化ステップが1(base _Q=1)の時では、量子化ステップが例えば1違っただけで大きく発生量が異なるのに対し、基本量子化ステップが15(base _Q=15) 付近では、量子化ステップが例えば5異なっても発生量の絶対値はさほど異ならない。すなわち、量子化ステップが小さいときには、発生量と割当量の誤差は大きくなってしまう。
【0049】
そこで、本発明は、上述のような実情に鑑みて提案されたものであり、画質向上とデータ発生量制御を共に満足することができ、効率の良い画像圧縮が可能で、全体的に画質を向上させることができる画像符号化装置及び画像符号化方法を提供することを目的とするものである。
【0050】
【課題を解決するための手段】
本発明の画像符号化装置は、上述した目的を達成するために提案されたものであり、入力画像データを複数枚蓄える画像データ蓄積手段と、上記画像データ蓄積手段に蓄積された複数枚の画像データをそれぞれブロックに分割し、当該入力画像データの情報量を評価するための画像自身の情報量を示す第1のパラメータ、動きベクトルが検出された輝度情報の最小誤差及び動きベクトルが検出された色差情報の最小誤差からブロック内の和を用いて算出した画像の差分情報量を示す第2のパラメータ及び画像カウントのための画像情報を出力する画像情報評価手段と、画像データに直交変換処理を施し、直交変換係数を生成する直交変換手段と、上記直交変換手段により生成された直交変換係数を、所定の量子化ステップで量子化する量子化手段と、上記画像情報評価手段によって得られたブロック毎の情報量を表す上記パラメータに基づいてフレーム内符号化圧縮後のデータ量とフレーム間予測符号化圧縮後のデータ量の少ない何れか一方の圧縮方法を選択する圧縮方法選択手段と、上記圧縮方法選択手段が選択した圧縮方法で1画面分の画像データを圧縮することにより得られる予定圧縮データ量とマクロブロックタイプに応じて上記第1、第2のパラメータのどちらかを加算し一画面分合計することにより求められた難易度とから、上記量子化手段における量子化の際の基本量子化ステップを予測する基本量子化ステップ予測手段と、上記画像情報評価手段によって得られたブロック毎の情報量の評価値を予め定めた最大値を上限として正規化を行い、上記基本量子化ステップの値に応じて与えられる上記正規化した値の中央値と変動幅によって上記ブロック毎の量子化ステップを予測する量子化ステップ制御手段とを有し、上記量子化ステップ制御手段は、上記1画面分の画像データの予定圧縮データ量をallocated_bit とし、上記難易度をdifficultyとし、上記基本量子化ステップをベースQ_scale とするとき、予め定められたパラメータA、Bを用いて、
ベースQ_scale = exp((log(allocated_bit/difficulty)-B)/A)
の式により上記基本量子化ステップを求め、更に上記量子化ステップ制御手段は、マクロブロック毎の上記評価値の中央値を中央得点とし、上記ブロック毎の量子化ステップをMB_Q_scaleとするとき、
MB_Q_scale = ((中央得点−ブロック毎の評価値) * 変動幅 / (評価値の正規化値)) + ベースQ_scale
の式により上記ブロック毎の量子化ステップを求め、上記量子化手段は、上記量子化ステップ制御手段で予測された量子化ステップを用いて上記直交変換係数を量子化することを特徴とする。
【0051】
また、本発明の画像符号化方法は、入力画像データを複数枚蓄える画像データ蓄積工程と、上記画像データ蓄積手段に蓄積された複数枚の画像データをそれぞれブロックに分割し、当該入力画像データの情報量を評価するための画像自身の情報量を示す第1のパラメータ、動きベクトルが検出された輝度情報の最小誤差及び動きベクトルが検出された色差情報の最小誤差からブロック内の和を用いて算出した画像の差分情報量を示す第2のパラメータ及び画像カウントのための画像情報を出力する画像情報評価工程と、画像データに直交変換処理を施し、直交変換係数を生成する直交変換工程と、上記直交変換工程により生成された直交変換係数を、所定の量子化ステップで量子化する量子化工程と、上記画像情報評価工程によって得られたブロック毎の情報量を表す上記パラメータに基づいてフレーム内符号化圧縮後のデータ量とフレーム間予測符号化圧縮後のデータ量の少ない何れか一方の圧縮方法を選択する圧縮方法選択工程と、上記圧縮方法選択工程で選択した圧縮方法で1画面分の画像データを圧縮することにより得られる予定圧縮データ量とマクロブロックタイプに応じて上記第1、第2のパラメータのどちらかを加算し一画面分合計することにより求められた難易度とから、上記量子化手段における量子化の際の基本量子化ステップを予測する基本量子化ステップ予測工程と、上記画像情報評価工程によって得られたブロック毎の情報量の評価値を予め定めた最大値を上限として正規化を行い、上記基本量子化ステップの値に応じて与えられる上記正規化した値の中央値と変動幅によって上記ブロック毎の量子化ステップを予測する量子化ステップ制御工程とを有し、上記量子化ステップ制御工程は、上記1画面分の画像データの予定圧縮データ量をallocated_bit とし、上記難易度をdifficultyとし、上記基本量子化ステップをベースQ_scale とするとき、予め定められたパラメータA、Bを用いて、
ベースQ_scale = exp((log(allocated_bit/difficulty)-B)/A)
の式により上記基本量子化ステップを求め、更に上記量子化ステップ制御工程は、マクロブロック毎の上記評価値の中央値を中央得点とし、上記ブロック毎の量子化ステップをMB_Q_scaleとするとき、
MB_Q_scale = ((中央得点−ブロック毎の評価値) * 変動幅 / (評価値の正規化値)) + ベースQ_scale
の式により上記ブロック毎の量子化ステップを求め、上記量子化工程は、上記量子化ステップ制御工程で予測された量子化ステップを用いて上記直交変換係数を量子化することを特徴とする。
【0053】
【作用】
本発明によれば、複数枚の画像データをそれぞれブロックに分割し、各ブロック毎の画像データの情報量を評価し、そのブロック毎の情報量の評価値に基づいて、適応的に画像データの圧縮方法を選択した後、ブロック毎の情報量の評価値を基本量子化ステップを規準にして正規化し、この正規化した評価値によってブロック毎の量子化ステップを予測している。
【0054】
【実施例】
以下、図面を参照し、本発明の実施例について詳述する。
図1には本発明実施例の画像符号化装置の概略構成を示す。なお、この図1において、前述した図9と同じの構成については同一の指示符号を付してその説明については省略する。
【0055】
この図1の構成において、前記図9の構成に追加された構成要素は画像情報評価回路50とシーンチェンジ検出回路31と圧縮方法選択回路32と動きベクトル発生回路33であり、また、量子化ステップ制御器39とフレームメモリ40が変更されている。
すなわち、本発明実施例の画像符号化装置は、入力画像データを複数枚蓄える画像データ蓄積手段であるフレームメモリ40と、上記フレームメモリ40に蓄積された複数フレームの画像データをそれぞれブロックに分割し、各ブロック毎の画像データの情報量を評価する画像情報評価回路50と、画像データにDCT等の直交変換処理を施し、そのDCT係数を生成するDCT回路14と、上記DCT回路40による生成されたDCT係数を、所定の量子化ステップで量子化する量子化器15と、上記画像情報評価回路50によって得られたブロック毎の情報量の評価値に基づいて、適応的に画像データの圧縮方法を選択する圧縮方法選択回路32と、上記画像情報評価回路50により得られた画面毎の情報量とその情報量に基づいて割り当てた発生予測ビット量と、過去の画面毎の情報量と発生ビット量と量子化ステップの関係より、画面毎の基本量子化ステップを予測する基本量子化ステップ予測手段及び、上記画像情報評価回路50によって得られたブロック毎の情報量の評価値を正規化し、基本量子化ステップを規準にして上記ブロック毎の正規化した評価値によって上記ブロック毎の量子化ステップを予測する量子化ステップ制御手段としての量子化ステップ制御器39とを有することを特徴とする。
【0056】
この図1において、先ず、入力端子1から入力された入力画像データは、フレームメモリ40に蓄えられる。
このフレームメモリ40は、図9のフレームメモリ10とは異なり、所定数のフレームを蓄積できるものである。このときの蓄積する所定数としては、多過ぎるとフレームメモリ40が大規模になってしまうので好ましくない。上記所定数として効率的な長さ(フレーム数)は、ビットレートと出力バッファ18の容量、フレーム内符号化の圧縮方式の画像同士の間隔(ほとんどの場合GOPの長さといっても差し支えない)に大きく依存する。これは圧縮方法及び圧縮率の違いから生ずる圧縮データの大きさのむらを上記出力バッファ18によって吸収し、定ビットレートにすることができる範囲が、上記ビットレート及び出力バッファ容量とフレーム内符号化がなされる画像同士の間隔等の条件によって制約されるからである。
【0057】
ここで、一般的にフレーム内符号化方式で圧縮することは定期的に行われる(これがGOPになることが多い)ものであり、フレーム内符号化の圧縮方式は圧縮後のデータ量が他の方式に比べてかなり大きいため、フレーム内符号化による圧縮画像同士(或いはGOP)の間隔で情報量を調べ、データ量の配分をするのは一つの合理的な方法である。
【0058】
しかし、本実施例の方式ではシーンチェンジ等によって前後の画像の相関が著しく低くなった場合にもフレーム内符号化方式で圧縮するようにしている。
その場合、定期的に行うはずである近傍のフレーム内符号化によって圧縮を行う画像は、定ビットレート或いは均質な画質の維持が困難になるためフレーム内符号化による圧縮である必然性を失い、フレーム内符号化で圧縮することを取り止める必要がでてくる。
【0059】
したがって、フレーム内符号化による圧縮を行う周期の2倍程度を上記フレームメモリ40の長さ(上記所定数)とすることが適当である。
もちろん、上記フレーム数は一例であり、これに限定されることはなく様々な条件に合わせて変更することは可能である。
上記フレームメモリ40に蓄積された画像データは、適宜、画像情報評価回路50に送られる。
【0060】
ここで、当該画像情報評価回路50は、大別して2通りのパラメータを算出するものである。
第1のパラメータは、フレーム内符号化で圧縮を行った場合の圧縮後のデータ量を予測することが可能なように、その画像自身の情報量を示すものである。この第1のパラメータとしては、例えば、フレームメモリ40から供給された画像データに対して、DCT処理をブロック毎に行い、そのDCT係数の和や統計をとったものとしたり、また、それでは規模が大きくなる場合には、平均自乗誤差のブロック毎の和を求めたものとする。いずれにしても、当該画像情報評価回路50では、画像の情報量を表し、圧縮後のデーター量を類推するに足るパラメータを算出する。
【0061】
第2のパラメータは、フレーム間予測符号化で圧縮を行った場合の圧縮後のデータ量を予測することが可能な、画像の差分情報量を示すものである。この場合のパラメータとしては、例えば、フレームメモリ40に格納された画像と動き補償後の画像との差分値のブロック内の和を用いる。このパラメータ算出の際には、一般的な動きベクトル検出回路(動き検出器20及び動きベクトル発生回路33)で得られる動きベクトルが検出された最小誤差を利用することができる。
【0062】
このときのフレーム間予測符号化による圧縮後のデータ量の類推(予測)のためのパラメータとしては、一般的な輝度情報だけの動きベクトル検出回路(動き検出器20及び動きベクトル発生回路33)で得られる動きベクトル及びその動きベクトルが検出された輝度情報だけで求めた最小誤差に加えて、本実施例ではその動きベクトルが検出された色差情報だけで求めた最小誤差を新たに用いるようにする。
【0063】
本実施例装置では、このようにして求めた輝度情報からの最小誤差と色差情報からの最小誤差を用いて、そのマクロブロックの誤差とし、当該マクロブロックの誤差を用いて後述する圧縮方法選択回路32で圧縮方法の判定を行なう。
上記画像情報評価回路50によって、上述したようにして算出された画像情報の評価値(パラメータ)は、次に説明するシーンチェンジ検出回路31と、圧縮方法選択回路32と、量子化ステップ制御器39とに送られる。
【0064】
また、画像情報評価回路50からは、後述する圧縮方法選択回路32においてGOPの長さを決定する際に画像のカウントを行うため、その圧縮方法選択回路32に対して画像情報も送られる。
次に、シーンチェンジ検出回路31は、上記画像情報評価回路50の出力(例えば第2のパラメータ)を用いてシーンチェンジを検出するものである。
【0065】
ここで、当該シーンチェンジ検出回路31においてシーンチェンジを検出する目的は、フレーム間予測符号化かフレーム内符号化のいずれかの圧縮方式を決定するための判断材料にすることが主である。それは、シーンチェンジ部分のように前後で相関の極めて低い画像では、フレーム間予測符号化で圧縮するよりもフレーム内符号化で圧縮する方が効率良く圧縮できるからである。また、シーンチェンジ部分では、圧縮後のデータも大きなものとなるため、データ量配分や出力バッファマネジメントの観点からも当該シーンチェンジを把握することは重要である。
【0066】
上述のようなシーンチェンジは前後の画像で相関が著しく損なわれる所に存在するものであるため、当該シーンチェンジ部分は、例えば、前後の画像についてそれぞれ例えば動きベクトル補償後の画像との差分値を求め、それぞれこの差分値の画像全体での総和を求めて、さらに当該前後の画像での上記総和の比を求めるなどして検出できる。
【0067】
このようなことから、本実施例のシーンチェンジ検出回路31では、上記画像情報評価回路50の出力を用いてシーンチェンジを検出するようにしている。すなわち、上記画像情報評価回路50は、前述のように動き補償後の画像の差分値のブロック内の和を第2のパラメータとして出力するため、当該シーンチェンジ検出回路31では、当該差分値のブロック内の和を用いて、上述のシーンチェンジ検出のための演算を行うことができる。
【0068】
次に、圧縮方法選択回路32について説明する。
当該圧縮方法選択回路32は、上記シーンチェンジ検出回路31からのシーンチェンジ検出出力と、画像情報評価回路50からの画像情報をカウントしたカウント値と、前記輝度情報と色差情報からそれぞれ求めた第2のパラメータ(最小誤差)とに基づいて、フレーム内符号化/フレーム間予測符号化(P,Bピクチャ)のいずれの圧縮方式で圧縮を行うのかを選択する回路である。
【0069】
すなわち当該圧縮方法選択回路32では、上記画像情報評価回路50によって得られるマクロブロック毎の輝度情報及び色差情報から求めたパラメータに基づいて、マクロブロック毎のフレーム内符号化/フレーム間予測符号化の各圧縮方法によって発生するデータの予想量(発生予想量)を比較し、より発生予想量の少なくなる圧縮方法を選択するようにしている。
【0070】
また、フレーム内符号化方式による圧縮画像は少なくともGOPの最初になければならない。さらに、GOPはランダムアクセスを考慮してある程度の間隔となされているので、必然的にIピクチャは当該間隔で定期的に発生するものであり、また、本実施例ではシーンチェンジ等によっても発生するものである。
このようなことから、当該圧縮方法選択回路32では、上記画像情報評価回路50からの画像情報のカウントを行うと共に、上記シーンチェンジ検出回路31からのシーンチェンジ検出出力が当該圧縮方法選択回路32に加えられる。これにより当該圧縮方法選択回路32では、上記画像のカウント値から定期的なフレーム内符号化を選択すると共にシーンチェンジ検出時にもフレーム内符号化を選択(すなわちGOPの間隔を決定する)し、それら以外ではフレーム間予測符号化を選択するようにしている。
【0071】
この圧縮方法選択回路32は、上記圧縮方法の選択に応じて前記切換スイッチ13と24の切換制御を行うと共に、その選択結果を示す情報を量子化ステップ制御器39に送る。
量子化ステップ制御器39は、可変長符号化回路17からの符号量を示す情報に基づいて量子化器15の量子化ステップ幅を制御する。また、上記出力バッファ18から出力されたデータは圧縮符号化がなされた符号化出力として出力端子2から出力される。
【0072】
また、上記量子化器15からの出力は、逆量子化器27によって逆量子化され、さらに逆DCT回路26によって逆DCT処理される。当該逆DCT回路26の出力は、加算器25に送られる。
この加算器25には、フレーム間予測符号化のフレームのときにオンとなる切換スイッチ24を介した動き補償器21からのフレーム間予測画像データも供給され、当該データと上記逆DCT回路26の出力データとの加算が行われる。この加算器25の出力データは、フレームメモリ22に一時的に蓄えられた後、動き補償器21に送られる。
【0073】
当該動き補償器21は、上記動き検出器20によって検出され動きベクトル発生回路33によって発生された動きベクトルに基づいて動き補償を行い、これによって得たフレーム間予測画像データを出力する。
また、上記量子化ステップ制御器39は、前記画像情報評価回路50からの評価値(パラメータ)から画像の情報量、さらにはシーンチェンジのように前後の画像の相関が極めて低くなる所を知ると共に、圧縮方法選択回路32からの選択結果を示す情報からフレーム内符号化かフレーム間予測符号化のいずれが選択された画像であるかも知ることができる。
【0074】
したがって、当該量子化ステップ制御器39においては、出力バッファ18の残量のみをフィードバックする従来の量子化ステップ制御に比べて、入力画像の急激な情報量変化に追随できることになり、また、画像の情報量の変化に応じて適切な量子化ステップ制御が可能で、さらに、フレーム内符号化/フレーム間予測符号化の圧縮方法に応じて適切な量子化ステップ制御も可能となる。
【0075】
次に本実施例の各主要構成要素における処理の流れを、図2のフローチャートに沿ってより詳細に説明する。
先ず、ステップS1では、入力端子1に入力された画像データが順次フレームメモリ40へ格納される。
ここで、先に述べたようにIピクチャの頻度や間隔の決定が画質に影響を及ぼすので、これに関係して符号化に先だってGOPを決めておく必要があり、また、レートコントロール(量子化ステップ制御によるビットレートのコントロール)をするために符号化に先だって1GOP分の画像についての情報を収集しなければならない。このように、次々と入力されてくる画像データに対してその間に分析を行い、符号化するまでの十分な遅延時間を稼ぐため、大量のフレームメモリ40を用いる。
【0076】
次に、ステップS2では、動き検出器20において、フレーム間予測符号化で圧縮するために必要な動きベクトルを検出する。すなわち、このステップS2では、予め定められたスケジュールでフレームメモリ40中の各画像データをPピクチャ或いはBピクチャとして圧縮符号化できるように、動き検出(モーションエスティメーション)を行う。
【0077】
ここで、動き検出を行う画像については、Iピクチャを規定しない。それはどの画像データがIピクチャになるのかこの時点では確定していないからであり、またIピクチャは動き補償を必要としないため、後にどの画像データでもIピクチャにすることが可能だからである。
上記画像情報評価回路50は、上記動き検出をする際に用いられる最小歪み(Minimum Distortion)或いは誤差の絶対値和(AD:Absolute Difference )と呼ばれるものを符号化に用いるパラメータの一つ(第2のパラメータ)として読み出し格納する。
【0078】
なお、上記誤差の絶対値和(AD)は、リファレンス側の画像を8×8ピクセルのブロックに分割し、輝度データ8×8×4ピクセルと色差データ8×8×2ピクセルのマクロブロック(MB)に対し、動き検出を行なった際に求めた動きベクトルで切りだされるサーチ側のマクロブロックとの各画素同士の差の絶対値和で、以下の式(1) で求めることができる。
【0079】
【数1】
Figure 0003711573
これをさらにマクロブロック内のブロックについて集計したものを用いてマクロブロックの誤差の絶対値和(AD)とする。
このパラメータはシーンチェンジの判定やフレーム間予測符号化で圧縮する場合の画像の相関も考慮した情報量の推定に用いるものである。
【0080】
このパラメータはまた、後述するようにマクロブロックタイプを決定するために使われる。
画像の情報量を推定するパラメータSADは、式(2) のように、一つの画像内の上記誤差の絶対値和(AD)を合計したものである。
SAD=ΣAD (2)
もちろん、上記誤差の絶対値和(AD)以外に最小歪み(Minimum Distortion)を用いてもよい。
【0081】
次に、画像情報評価回路50では、ステップS3のように、上記動き検出で得られたパラメータ以外に、誤差の平均絶対値和(MAD:Mean Absolute Difference)、アクティビティ(Activity)を各画像毎に評価する。
上記誤差の平均絶対値和(MAD)はIピクチャの情報量を推定するためのパラメータで、下記の式(3) によって8×8画素のブロック毎に求め、必要に応じてマクロブロック或いは画面で集計を行う。このパラメータはまた、マクロブロックタイプを決定するために使われる。
【0082】
【数2】
Figure 0003711573
これをさらに、式(4) のように、マクロブロック内のブロックについて合計したものを用いてマクロブロックの判定に用いる。
MAD=Σ blockMAD (4)
またさらに、式(5) のように、マクロブロックの値を一つの画像内で合計してその値を、その画像の(Iピクチャとしての)情報量を表すパラメータSMADとする。
【0083】
SMAD=ΣMAD (5)
また、上記アクティビティは、一つの画面の中でそのマクロブロックの画像の状態に応じてよりきめ細かに量子化ステップを制御することによって画質を維持しながらより圧縮効率を高めるために、その画像の状態を定量化するためのパラメータである。
【0084】
例えば一つのブロック内で画像が画素のレベル変化の少ない平坦な部分では量子化による歪みが目立ち易く、量子化ステップを小さくしてやるべきで、逆にレベル変化が多い複雑なパターンのブロックでは量子化歪みは目立ち難く、情報量も多いので量子化ステップを大きくするべきである。
そこで、例えばブロックの平坦度を表すパラメータをこのアクティビティとして用いるようにしている。
【0085】
次に、圧縮方法選択回路32においては、ステップS4においてマクロブロックタイプの判定を行う。すなわち、圧縮方法選択回路32では、当該ステップS4においてマクロブロック毎の圧縮方法とマクロブロックタイプとを決める。
前述のように既に求めた上記誤差の平均絶対値和(MAD)と誤差の絶対値和(AD)は、それぞれフレーム内符号化/フレーム間予測符号化で圧縮したときの圧縮後のデータ量に関係するので、この2つのパラメータを比較すればフレーム内符号化/フレーム間予測符号化のどちらのマクロブロックタイプがより少ないデータ量になるか判定できる。
【0086】
次に、ステップS5では、上記シーンチェンジ検出回路31でシーンチェンジの検出を行う。このシーンチェンジ検出回路31でのシーンチェンジ検出は、上記画像情報評価回路50で得られたパラメータADを使ってなされる。具体的には、上記パラメータADを1画面分合計した上記パラメータSADを使い、その変化の割合で上記シーンチェンジを検出する。
【0087】
次に、圧縮方法選択回路32においては、ステップS6でGOP長の決定を行い、ステップS7で圧縮方法の選択(ピクチャタイプの決定)を行う。
ここでは、すでに述べたように、符号化に際してランダムアクセス性を考慮して適当なフレーム数毎にGOPを区切る。このとき少なくともGOPの符号順で最初のピクチャはIピクチャでなければならないから、ピクチャの数をカウントし定期的にピクチャタイプをIピクチャにする。
【0088】
一方、前記シーンチェンジによって前後のピクチャで相関が低くなった場合、これも先に述べたようにIピクチャで圧縮符号化すると効率が良い。しかしながら、Iピクチャは圧縮率が低いため、低ビットレートにおいては頻繁に現れると画質の低下を招く。したがってシーンチェンジ検出回路31によってシーンチェンジが検出された場合、圧縮方法選択回路32は、Iピクチャ同士の間隔を適度に保つよう適応的にGOPの長さを決める。
【0089】
次のステップS8では、量子化ステップ制御器39において、レートコントロールのためのビット配分を行う。
各ピクチャ毎の圧縮符号化された後のデータサイズは、その符号化方式や元々の画像データが持つ情報量、前後の相関などによって大きく変動する。平均的な画質を保つようにするならばことさらである。
【0090】
各ピクチャ毎の圧縮符号化された後のデータサイズのむらは出力バッファ18によってある程度吸収されるが、平均的には一定のビットレートにしなければならない。したがって、ある区間を定めればその間のピクチャのトータルの圧縮後のデータ量が決まる。そこで、既に決定しているピクチャタイプと、予め調べておいた画像の情報量パラメータとを用いて各ピクチャ毎に圧縮後のデータ量、すなわち各ピクチャが使用可能なビットの量を決める。
【0091】
このとき、例えば情報量の少ない画像やBピクチャには少なく、情報量の多い画像やIピクチャには多くする。これをビット配分と呼ぶ。これによって画質のばらつきを抑え、なおかつ一定レートに保つことが容易になる。
本実施例ではGOPをビット配分の区間として、次の式(6) ,式(7) のようにビット配分を行う。
Total Bit Count =(Bit Rate [bit/s]× Number Of Picture In GOP [picture])/(Picture Rate [picture/s]) [bit] (6)
Available Bits=(Total Bit Count ×ターゲットの画像情報量パラメータ)/画像情報量パラメータのGOP合計値) [bit] (7)
なお、この式(7) で使用している情報量パラメータは、先に述べたパラメータSMAD,SADを用い、これに圧縮するピクチャタイプ別の乗数をかけたものである。また、上記乗数は各ピクチャタイプ間のパラメータと画質との関係を調整するものである。
【0092】
なお、上記式(7) の上記画像情報量パラメータのGOP合計値は、式(8) に示すようにして求める。
画像情報量パラメータのGOP 合計値=Ki×ΣDiffi+Kp×ΣDiffp+Kb×ΣDiffb
Diffp:Pピクチャの難易度
Diffb:Bピクチャの難易度 (8)
上記量子化ステップ制御器39においては、次のステップS9で基本量子化ステップの決定を行う。
【0093】
すなわち、上述のようにしてピクチャタイプが決まり、マクロブロックタイプが決まれば、マクロブロックタイプに応じて1画面分の上記誤差の平均絶対値和(MAD)、誤差の絶対値和(AD)を集計することで、1画面の情報量パラメータ(すなわち難易度)が測定できる。したがって、過去の実績から、情報量パラメータと量子化後のデータ量が決まれば量子化ステップを推定することができる。
【0094】
本実施例の量子化ステップ制御器39は、1画面毎の割当ビット量(allocated_bit)と上記難易度(difficulty)とから、以下の方法により一画面の基本の量子化スケール(Q_scale)を決めるようにしている。
先ず、式(9) に示すように、
log(allocated_bit/difficulty) =A*log(Q _scale)+B (9)
という関係があると仮定し、上記式(9) 中のA,Bを予め学習(実験)により求めておく。さらに、上記式(9) を変形した式(10)から、上記量子化スケール(Q_scale)を求める。
【0095】
Q_scale =exp((log(allocated_bit/difficulty)-B)/A) (10)
このようにして求めた量子化ステップをそのピクチャの基本量子化ステップとする。
次に、量子化ステップ制御器39は、ステップS10において画面内の量子化ステップの制御を行う。
【0096】
本実施例の量子化ステップ制御器39は、先に述べたように画面内の量子化ステップを各ブロック毎に、なるべく画質を高く、しかも圧縮効率を高くするように制御する。すなわち、量子化ステップ制御器39では、上記アクティビティやマクロブロックタイプなどの情報をもとに基本量子化ステップを加減することで量子化器15に対する量子化ステップの制御を行う。
【0097】
ここで、上記マクロブロック毎の量子化ステップを決定する機構は、2段階の手順で構成する。
先ず、量子化ステップ制御器39は、前記画像情報評価回路50からのマクロブロック毎の上記誤差の平均絶対値和(MAD)、誤差の絶対値和(AD)、動きベクトル、アクティビティ等の情報から、それぞれの中央値、平均値を計算する。すなわち、人間の視覚上の特性と圧縮上の特性から、上記誤差の平均絶対値和(MAD)、誤差の絶対値和(AD)、動きベクトル、アクティビティのパラメータの表す特性を組み合わせて考えられる条件を基に評価値を正規化する。
【0098】
ここで、例えば、上記視覚上の特性として、
1.目が追随できるくらいの動きの時は画質劣化を認識できるが、動きの量がある範囲を越え、早く動くと画質劣化を認識できないこと、
2.概念として形のモデルがあるものは画質劣化に敏感であるが、モデルにないものは鈍感であることが挙げられる。
【0099】
また、圧縮上の特性として、
a.空間的に滑らかに変化する部分の量子化誤差は画質劣化として目立つが、変化量が多い部分の多少の量子化誤差は目立ちにくいこと、
b.物と物との境界があり境界の両側が滑らかな部分の量子化誤差は目立つが、境界の両側の変化量が多い場合は目立ちにくいことが挙げられる。
【0100】
このように、それぞれに特性があるわけであるが、その特性の条件、例えば上記a.の条件では、「空間的に滑らかに変化する部分」という条件を、マクロブロック毎の誤差の平均絶対値和(MAD)、誤差の絶対値和(AD)、動きベクトル、アクティビティ等のパラメータを組み合わせて表し、その状態になったときに、評価値( ポイント:point)を高くし、そうでないときに低くなるように正規化する。上記a.の条件を表すパラメータとしては、上記誤差の平均絶対値和(MAD)がマクロブロック内の凸凹さを表すので、当該誤差の平均絶対値和(MAD)の値の大小によって判断することができる。
【0101】
実際にはマクロブロックタイプ決定時にそれぞれのマクロブロックに対し上記誤差の平均絶対値和(MAD)の分布や誤差の絶対値和(AD)の分布、動きベクトル発生回路33から得られる動きベクトルの分布に応じて、評価値を正規化する。
すなわち例えば、評価値の平均を50、最大値を100として評価値を正規化する。この評価値の正規化方法については、後述する図3,図4,図5に示す評価値正規化のフローチャートのような処理による。
【0102】
次に、量子化ステップ制御器39は、上記基本量子化ステップから、マクロブロック毎の正規化した評価値に応じて量子化ステップを決定する。すなわち、基本量子化ステップに応じて、評価値の中央値、マクロブロック毎の量子化ステップの振幅を制御する。これにより、1画面に与えた割当ビット量に対しあまりに多く使い込むことが起きないように制御している。当該マクロブロックの量子化ステップ決定方法については、後述する図6に示す量子化ステップ決定のフローチャートのような処理による。
【0103】
次のステップS11では、可変長符号化回路17において符号化を行う。
ここまでで圧縮符号化の全てのパラメータが決まっているので、これ以後は、MPEGの規則にしたがって圧縮符号化する。
最後に、ステップS12では、前述した各パラメータの更新を行う。
ここで、画像情報量と基本量子化ステップ、圧縮後のデータ量の関係は、圧縮する画像に依存する。したがって、その関係を表す式に用いるパラメータ、予測パラメータを圧縮後の実際のデータ量をフィードバックしてやることにより学習させ、予測の精度を向上させている。
【0104】
このとき、先ず、ピクチャタイプ毎に学習パラメータA,Bを以下の方法により、学習し、修正する。
例えば、マクロブロック毎の量子化スケール(Q-scale) の平均値を(average_Q)とし、1画面圧縮した後の発生量を(generated bit) とすると、式(11)に示すように、
x = log(average_Q), y = log(generated bit/ difficulty) (11)
となり、AとBのパラメータを最小2乗誤差法で以下の式(12)、式(13)のようにして求める事ができる。なお、式中nは標本数である。
Figure 0003711573
次に図3のフローチャートについて説明する。
【0105】
この図3において、ステップS31では、1画面分の誤差の平均絶対値和(MAD)、誤差の絶対値和(AD)、フラットネス(平坦度)、動きベクトルを集計し、マクロブロックタイプを決定する。
次のステップS32では、1画面分の誤差の平均絶対値和(MAD)、誤差の絶対値和(AD)、動きベクトルの平均値、中央値の集計を行い、ステップS33では、上記誤差の平均絶対値和(MAD)、誤差の絶対値和(AD)の平均値、中央値から初期値としてイントラセンタ(intra _center) とインターセンタ(inter_center) を計算して設定する。ここでは、平均値、中央値の大きい方をセンタとする。
【0106】
次のステップS34ではフレーム内符号化されるマクロブロック(イントラマクロブロック)か否かの判定を行う。このステップS34において、イントラマクロブロックであると判定した場合にはステップS35に進み、イントラマクロブロックでない(ノンイントラマクロブロック)と判定した場合にはステップS35に進む。ステップS35ではノンイントラマクロブロック用の処理を行い評価値を決定し、ステップS36ではイントラマクロブロック用の処理を行い評価値を決定する。
【0107】
次のステップS37ではフラットネスを加算し、ステップS38では評価値の正規化,規格化を行う。例えば、評価値が規格として定めた最大100で最小0、中央分布状態が50近辺になっているかどうかをチェックして修正する。
次のステップS39では、1画面分のマクロブロックの処理が終了したか否かの判定を行い、処理途中であると判断したときはステップS34に戻り、処理が終わったと判断した場合は全体の処理を終了する。
【0108】
次に図4のフローチャートには、図3のステップS36におけるイントラマクロブロックの評価値決定処理の一例を示している。
この図4において、ステップS41では、誤差の平均絶対値和(MAD)の値により、フラットか凸凹があるか否かを判断する。すなわち、マクロブロックの誤差の平均絶対値和(MB_MAD)がイントラセンタ(intra_center) より大きいか否かによって、フラットか凸凹があるかを判断する。
【0109】
このステップS41においてフラットであると判断した場合にはステップS43に、凸凹があると判断した場合にはステップS42に進む。
ステップS42では、MB_POINT=0 、sabun=MB_MAD とし、その次のステップS44では、誤差の平均絶対値和(MAD)の値により、複雑な凸凹であるかどうかを判定する。ステップS44で複雑な凸凹であると判定した場合にはステップS45に進み、ここで評価値ポイントを少なくし、その後ステップS48に進む。また、ステップS44で複雑でないと判断した場合にはステップS48に進む。このステップS48では、評価値ポイントを与え、PLUS_MAD の値により重み付けを与える。
【0110】
また、ステップS41において、フラットであると判断した場合のステップS43に進む。
このステップS41では、MB_POINT=0 とし、その次のステップS46では、動きベクトルが小さいか否かの判定を行う。このステップS46で、動きベクトルがとても小さいと判定した場合には、ステップS47に進み、動きが少なくフラットであるのでポイントを与え、その後ステップS49に進む。また、ステップS46で小さくないと判定した場合は、ステップS49に進む。このステップS49では、誤差の平均絶対値和(MAD)の値によるポイントの勾配を、MINUS _MAD の値により与える。
【0111】
次に図5のフローチャートには、図3のステップS35におけるノンイントラマクロブロックの評価値決定処理の一例を示している。
この図5において、ステップS51では、動きベクトルの値により、ポイントを与える。次のステップS52では、誤差の絶対値和(AD)の値により、変化具合を判定する。このステップS52において、変化が小さいと判定した場合はステップS53に進み、変化が大きいと判定した場合はステップS55に進む。
【0112】
ステップS55では、誤差の絶対値和(AD)の値によるポイントの勾配を、PLUS_MAD の値により与える。
また、ステップS53では、動きベクトルが非常に小さいか否かの判定を行い、小さいと判定した場合のステップS54では、変化が少ないので細かい差分が表現できるようにポイントを与える。一方、ステップS53で変化が小さくないと判定した場合は、誤差の絶対値和(AD)の値によるポイントの勾配をMINUS _MAD の値により与える。
【0113】
上記ステップS55,ステップS56では、PLUS_MAD 、MINUS _MAD の値により勾配を変化させ、ポイントの値を適正な値にする。
次に図6には、前記量子化ステップ決定のフローチャートを示している。
この図6において、ステップS61では基本量子化スケール(ベースQ _scale)の値が3より小さいか否か、ステップS62では基本量子化ステップの値が5より小さいか否か、ステップS63では基本量子化ステップの値が10より小さいか否か、ステップS64では基本量子化ステップの値が15より小さいか否かをそれぞれ順に判定していく。これらステップS61〜S63において、それぞれ小さいと判定した場合にはそれぞれ対応するステップS66〜S69に進み、最後のステップS64で大きいと判定した場合にはステップS65に進む。これらステップS65〜S69では、それぞれ対応する基本量子化ステップの値に基にして、決定時の評価値の中央値と、量子化ステップの振幅とを求め、その後ステップS70でマクロブロック毎の量子化ステップを制御し、ステップS71でマクロブロック毎の量子化ステップをクリップする。
【0114】
次に、図7には、基本量子化スケール(ベースQ _scale)とマクロブロック毎の量子化スケール(Q_scale)の関係を示す。
すなわち、この図7において、本実施例では、基本量子化スケール(ベースQ _scale)に応じて、マクロブロック毎の量子化スケール(Q_scale)の値域を制御する。マクロブロック毎の評価値に応じて、基本量子化スケール(ベースQ _scale)からマクロブロック毎の量子化スケール(Q_scale)が決定される。
【0115】
また、図8には、中心得点の量子化スケール(Q_scale)の変動幅の関係を示している。すなわち、基本量子化スケール(ベースQ _scale)の値に応じてマクロブロック毎の量子化スケール(Q_scale)を決定する際のマクロブロック毎の評価値の中央値=中心得点と、マクロブロック毎の量子化スケール(Q_scale)の変動幅を示す図である。
【0116】
この図8において、中心得点というのは、マクロブロック毎の評価値を得点で表したときの中心となる得点のことで、基本量子化スケール(ベースQ _scale)の値により制御する。これを概念的に式(15)で表すと、
MB _Q _scale = ((中心得点−MB毎の評価値)*変動幅/(評価値の正規化値))+ベースQ _scale (15)
となる。なお、評価値の正規化値は例えば100である。
【0117】
上述したように、本実施例装置においては、フレームメモリ40内の入力画像データの情報量を画像情報評価回路50で評価し、さらにシーンチェンジ検出回路31で画像間の相関等を調べ、それら画像についての情報によって圧縮方法選択回路32で適応的に圧縮方法を決定した後、量子化ステップ制御器39において、入力画像の圧縮に際しての難易度(情報量)を入力画像フレーム内の情報量と入力画像フレーム間の相関情報量とを集計、推定し、過去の実績値により基本量子化スケールを推定するようにしている。したがって、画面内で量子化ステップの制御がマクロブロック毎の圧縮する上の特性や視覚上の特性を考慮した評価値から決定でき、なおかつ、データ発生量も適切に制御されるため、画面毎にビットの使い込みや余りが発生せず、平均化した画質を維持できる。
【0118】
また、本実施例装置では、画面内のマクロブロック毎の難易度(人間の視覚)を、入力画像フレーム内の情報量や入力画像フレーム間の相関情報量やアクティビティから判定し、正規化した評価値を決定している。すなわち、圧縮に際しての難易度に応じて画面内でビット配分が行われることになるため、量子化ステップを精度良く予測でき、無駄なくビットが使われ、画面内で不均質が検出し難く、画質劣化が検出され難い圧縮画像を得ることが可能となる。
【0119】
さらに、本実施例装置では、基本量子化ステップの値によって、量子化ステップの振幅と正規化した評価値の中央値を変化させて、圧縮後のデータ量が割当られたデータ量に近くなるようにマクロブロック毎の量子化ステップを制御している。すなわち、基本量子化ステップは決定しなくても、画面内の正規化した評価値は独立に決定できるようになり、なおかつ、画質面からの評価値を盛り込み易くなっている。
【0120】
またさらに、本実施例装置では、量子化ステップ制御器39で基本量子化ステップを決定するので、基本量子化ステップと独立に評価値を決定できるようになっている。
【0121】
【発明の効果】
本発明の画像符号化装置においては、入力画像データを複数枚蓄積し、蓄積された複数枚の画像データをそれぞれブロックに分割して各ブロック毎の画像データの情報量を評価し、そのブロック毎の情報量の評価値に基づいて、適応的に画像データの圧縮方法を選択した後、ブロック毎の情報量の評価値を基本量子化ステップを規準にして正規化し、この正規化した評価値によってブロック毎の量子化ステップを予測することにより、画質向上とデータ発生量制御を共に満足することができ、効率の良い画像圧縮が可能で、全体的に画質を向上させることが可能となっている。
【図面の簡単な説明】
【図1】本発明実施例の画像符号化装置の概略構成を示すブロック回路図である。
【図2】本実施例装置の動作を示すフローチャートである。
【図3】1画面分の評価値正規化のフローチャートである。
【図4】イントラマクロブロックの評価値決定のフローチャートである。
【図5】ノンイントラマクロブロックの評価値決定のフローチャートである。
【図6】量子化ステップ決定のフローチャートである。
【図7】基本量子化ステップとマクロブロック毎の量子化ステップの関係を示す図である。
【図8】中心得点と量子化ステップの変動幅の関係を示す図である。
【図9】従来の画像符号化装置の概略構成を示すブロック回路図である。
【図10】画像の解像度と構成について説明するための図である。
【図11】マクロブロックとブロックについて説明するための図である。
【図12】ジグザグスキャンについて説明するための図である。
【図13】GOPについて説明するための図である。
【符号の説明】
22,40 フレームメモリ
11 ブロック分割器
12 差分器
13,24 スイッチ
14 DCT回路
15 量子化器
16 ジグザグスキャン回路
17 可変長符号化回路
18 出力バッファ
39 量子化ステップ制御器
20 動き検出器
21 動き補償器
25 加算器
26 逆DCT回路
27 逆量子化器
31 シーンチェンジ検出回路
32 圧縮方法選択回路
33 動きベクトル発生回路
50 画像情報評価回路[0001]
[Industrial application fields]
The present invention relates to an image encoding device and an image encoding method suitable for use in, for example, compression encoding of an image.
[0002]
[Prior art]
FIG. 9 shows a configuration example of a conventional image coding apparatus that is suitable for use in, for example, conventional compression coding of an image.
In the image encoding device of FIG. 9, the input terminal 1 is connected to the input terminal 1 as shown in FIG.
Luminance component (Y) 352 (H) x 240 (V) x 30 frames
Chroma component (Cb) 174 (H) x 120 (V) x 30 frames
Chroma component (Cr) 174 (H) x 120 (V) x 30 frames
The digitized image data is supplied to the number of pixels.
[0003]
The input image data supplied to the input terminal 1 is sent to the motion detector 20 and the block divider 11 via the frame memory 10 for temporarily storing the input image data and replacing it in an appropriate order.
The block divider 11 divides each frame supplied from the frame memory 10 into a block of 8 × 8 pixels, as shown in FIG. 11, for each of the luminance component (Y), chroma component (Cr), and (Cb). To divide. It should be noted that a total of six blocks (Y0, Y1, Y2, Y3), four blocks (Y0, Y1, Y2, Y3), one chroma component (Cb), and one chroma component (Cr) block. Y1, Y2, Y3, Cb, Cr) are called macroblocks (MB).
[0004]
Data in units of macroblocks from the block divider 11 is sent to the differentiator 12.
The differencer 12 takes the difference between the data from the block divider 11 and the inter-frame prediction image data described later, and outputs the data as the frame data to be subjected to the inter-frame prediction encoding described later. Send to terminal b. In addition, the data from the block divider 11 is supplied to the switched terminal a of the changeover switch 13 as data of a frame to be subjected to intraframe encoding described later.
[0005]
Data in block units via the selector switch 13 is subjected to discrete cosine transform (DCT) processing by the DCT circuit 14, and the DCT coefficients are sent to the quantizer 15. The quantizer 15 quantizes the DCT output with a predetermined quantization step width, and sends the quantized coefficients to the zigzag scan circuit 16.
In the zigzag scan circuit 16, the quantized coefficients are rearranged by so-called zigzag scan as shown in FIG. 12 and the output is sent to the variable length coding circuit 17. The variable length coding circuit 17 performs variable length coding (VLC) on the output data of the zigzag scan circuit 16, sends the output to the output buffer 18, and indicates the amount of code generated by the variable length coding processing. Information is sent to the quantization step controller 19. The quantization step controller 19 controls the quantization step width of the quantizer 15 based on the information indicating the code amount from the variable length coding circuit 17. The data output from the output buffer 18 is output from the output terminal 2 as an encoded output subjected to compression encoding.
[0006]
The output from the quantizer 15 is inversely quantized by an inverse quantizer 27 and further subjected to inverse DCT processing by an inverse DCT circuit 26. The output of the inverse DCT circuit 26 is sent to the adder 25.
The adder 25 is also supplied with the inter-frame prediction image data from the motion compensator 21 via the changeover switch 24 that is turned on in the case of the inter-frame prediction encoding frame, and the data and the inverse DCT circuit 26 Addition with output data is performed. The output data of the adder 25 is temporarily stored in the frame memory 22 and then sent to the motion compensator 21.
[0007]
The motion compensator 21 performs motion compensation based on the motion vector detected by the motion detector 20, and outputs inter-frame prediction image data obtained thereby.
The specific operation of the conventional image encoding apparatus shown in FIG. 9 will be described in detail below. Here, for the sake of explanation, the name of each frame is defined as follows.
[0008]
First, when arranging the frames in the display order,
I0, B1, B2, P3, B4, B5, P6, B7, B8, I9, B10, B11, B12, ...
I will call it. Among these frames, I, P, and B, which will be described later, indicate the type of compression method, and the numbers after these I, P, and B simply indicate the display order.
[0009]
Of the so-called MPEG (Moving Picture Expert Group), which is an international standardization working group for color moving picture coding systems, MPEG1 stipulates the following to compress such images.
First, the I0 image is compressed.
Next, the P3 image is compressed, but not the P3 itself, but the difference data between the P3 and the I0 image is compressed.
[0010]
Next, the B1 image is compressed, but the B1 itself is not compressed, but the difference between B1 and I0 or the difference data between B1 and P3 or the average value of I0 and P3 (whichever information is less) )).
Next, the image of B2 is compressed, but B2 itself is not compressed, but the difference between B2 and I0 or the difference data between B2 and P3 or the average value of I0 and P3 (whichever information is less) Choose the method).
[0011]
Next, the P6 image is compressed, but not the P6 itself, but the difference data between the P6 and P3 images is compressed.
If the processing as described above is arranged in order,
Figure 0003711573
It becomes. In this way, the encoding order is
I0, P3, B1, B2, P6, B4, B5, P9, B7, B8, I9, P12, B10, B11,.
As shown, the display order is changed. The compressed data (encoded data) is arranged in this order.
[0012]
The above will be described in more detail together with the operation of the configuration of FIG.
In encoding the first image (that is, I0), first, the data of the image to be compressed from the frame memory 10 is blocked by the block divider 11. The block divider 11 outputs data for each block in the order of Y0, Y1, Y2, Y3, Cb, and Cr, and sends the data to the DCT circuit 14 via the changeover switch 13 switched to the switched terminal a side. It is done. The DCT circuit 14 performs two-dimensional vertical and horizontal discrete cosine transform processing for each block. Thereby, the data which was the space axis is converted into the frequency axis.
[0013]
The DCT coefficient from the DCT circuit 14 is sent to the quantizer 15 where it is quantized with a predetermined quantization step width. After that, the zigzag scan circuit 16 rearranges them in the zigzag order as shown in FIG. When arranged in this zigzag order, the coefficient becomes a coefficient having a higher frequency component as it goes backward, so that the coefficient value generally tends to be smaller at the rear. Therefore, when quantization is performed with a certain value S, the frequency of the result becoming 0 increases as going backward, and as a result, the high frequency component is cut off.
[0014]
Thereafter, the quantized coefficients are sent to a variable length coding (VLC) circuit 17 where so-called Huffman coding is performed. The compressed bit stream obtained as a result is temporarily stored in the output buffer 18 and then transmitted at a constant bit rate. The output buffer 18 is a memory for buffering so that an irregularly generated bit stream can be transmitted at a constant bit rate.
[0015]
As described above, compression of only one image alone is called intra-frame (Intra) coding, and this image is called an I picture.
Accordingly, when the decoder receives the bit stream of the above I picture, the above process is reversed to complete the first image.
Next, the encoding of the second image (that is, P3) is performed as follows.
[0016]
That is, the second and subsequent frames may be compressed as an I picture to create a bit stream. However, in order to increase the compression rate, the following method is used by utilizing the fact that there is a correlation between the contents of successive images. Compress with.
First, the motion detector 20 searches for a pattern very similar to it from the first image (I0) for each macroblock constituting the second image and calls it a motion vector (x, y). It is expressed as the coordinates of the relative position.
[0017]
Also, in the second image, each block is not sent as it is to the DCT circuit 14 as in the case of the I picture, but with the block pulled from the first image according to the motion vector for each block. The difference data (difference data by the differentiator 12) is sent to the DCT circuit 14. The method for detecting a motion vector is described in detail in ISO / IEC 11172-2 annex D.6.2, and is therefore omitted here.
[0018]
For example, if the correlation between the pattern of the first image indicated by the motion vector and the pattern of the block to be compressed is very strong, the difference data is very small. Therefore, the amount of data after compression is smaller when the motion vector and the difference data are encoded than when the compression is performed by intra-frame (intra) encoding.
[0019]
Such a compression method is called inter-frame (Inter) predictive coding. However, the difference data does not always decrease, and depending on the design (image content), the compression rate may be higher when compression is performed by the intra-frame coding than when the difference is taken. In such a case, compression is performed by the intra-frame coding. Whether to perform interframe prediction encoding or intraframe encoding differs for each macroblock.
[0020]
The above will be described with reference to the image coding apparatus (encoder) in FIG. 9. First, in order to perform interframe predictive coding, the same image as that created on the decoder side is created on the encoder side. Need to put.
For this purpose, the same circuit as the decoder exists in the encoder. This circuit is called a local decoder (local decoder). The inverse quantizer 27, the inverse DCT circuit 26, the adder 25, the frame memory 22 and the motion compensator 21 in FIG. 9 correspond to the local decoder, and the image stored in the frame memory 22 is represented as a local decoded picture. It is called (Local decoded picture) or Local decoded data. On the other hand, the image data before compression is called original picture (Original picture) or original data (Original data).
[0021]
Even when the first I picture is compressed, the first image decoded through the local decoder is stored in the frame memory 22. Here, it should be noted that the image obtained by the local decoder is not an image before compression but an image restored after compression, and is exactly the same image as the image decoded by the decoder with image quality degradation due to compression. It is that.
[0022]
The data (Original data) of the second image (P3) comes into the encoder in such a state (the motion vector must already be detected at this stage), but the data for each block It has a motion vector, and this vector is given to a motion compensator (MC) 21. The motion compensation circuit 21 outputs data on the locally decoded picture (motion compensation data: MC data: 1 macroblock) indicated by the motion vector as the inter-frame prediction image data.
[0023]
Difference data by the differentiator 12 for each pixel of the second original data and the motion compensation data (inter-frame prediction image data) is input to the DCT circuit 14. The subsequent compression method is basically the same as the I picture. An image compressed by the compression method as described above is called a P picture (Predicted picture).
[0024]
More specifically, not all macroblocks in a P picture are compressed by interframe predictive coding, and when it is determined that compression by intraframe coding is more efficient, the macroblock is not Encoding is performed by inner encoding.
That is, even in a P picture, for each macroblock, whether it is by intraframe coding (this macroblock is called an intra macroblock) or by interframe predictive coding (this macroblock is called an intermacroblock). Choose one to compress.
[0025]
As described above, in the local decoder, the output of the quantizer 15 is inversely quantized by the inverse quantizer 27 and further subjected to inverse DCT processing by the inverse DCT circuit 26, and then motion compensation data (MC data) is encoded. ) To be the final local decoded picture.
Next, the encoding of the third image (that is, B1) is performed as follows.
[0026]
In the encoding of the third image (B1), a motion vector for each of the two images I0 and P3 is searched. Here, the motion vector for I0 is called a forward vector (forward vector) MVf (x, y), and the motion vector for P3 is called a backward vector (Backward Vector) MVb (x, y).
The difference data is also compressed for the third image, but the problem is which data to compress. In this case as well, a difference from the one with the least amount of information may be taken. In this case, compression options are:
(1) Difference from data on I0 indicated by the forward vector MVf (x, y)
(2) Difference from data on P3 indicated by backward vector MVb (x, y)
(3) The difference between the data on I0 indicated by the forward vector MVf (x, y) and the average value of the data on P3 indicated by the backward vector MVb (x, y)
(4) Do not use differential data (intraframe coding)
There are four. One of these four compression methods is selected for each macroblock. In the case of (1), (2), (3) among the options of the compression method, each motion vector is also sent to the motion compensator 21, and the differencer 21 takes the difference from the motion compensation data, This is sent to the DCT circuit 14. In the case of (4) among the options of the compression method, the data as it is is sent to the DCT circuit 14.
[0027]
As a result of the first and second encoding processes described above, two pictures I0 and P3 are restored in the frame memory 22 storing local decoded pictures, and this is possible. It is.
Next, the encoding of the fourth image (that is, B2) is performed as follows.
[0028]
The encoding of the fourth image (B2) is the same as the encoding of the third image except that B1 is replaced with B2 in the explanation of the encoding method of the third image (B1) described above. Compress with.
Next, the encoding of the fifth image (that is, P6) is performed as follows.
[0029]
The encoding of the fifth image (P6) is the same as the description of the encoding method of the second image (P3), except that P3 is replaced with P6 and I0 is replaced with P3. Become.
Since the sixth and subsequent sheets are repeated as described above, the description is omitted.
In MPEG, a so-called GOP (Group Of Picture) is defined.
[0030]
That is, a group of pictures is called a group of pictures (GOP), and the GOP must be a group of continuous images as viewed on encoded data (compressed data). is there. In addition, GOP considers random access. For this purpose, the picture that comes first in GOP on the encoded data needs to be the I picture. Further, the last GOP in the display order (display order) must be an I or P picture.
[0031]
FIG. 13 shows an example in which the first GOP is composed of 4 pictures and the subsequent GOP is composed of 6 pictures. Note that A in FIG. 13 indicates the display order, and B in FIG. 13 indicates the encoded data order.
In FIG. 13, focusing on GOP2, since B4 and B5 are formed from P3 and I6, for example, when I6 is accessed by random access, B4 and B5 cannot be correctly decoded because there is no P3. Thus, a GOP that cannot be correctly decoded only within the GOP is not a closed GOP.
[0032]
On the other hand, if B4 and B5 refer only to I6, for example, even if I6 is accessed by random access, P3 is not necessary, so that B4 and B5 can be correctly decoded. A GOP that can be completely decoded with only information in the GOP is called a closed GOP.
Although compression is performed by the most efficient method from among the compression methods as described above, the amount of coded data (Coded data) generated as a result depends on the input image and is actually compressed. I do not know without trying.
[0033]
However, it is also necessary to control the bit rate of the compressed data to be constant. The parameter for performing the control is a quantization step (or quantization scale: Q-scale) as information representing the code amount given to the quantizer 15. Even with the same compression method, the amount of generated bits decreases if the quantization step is increased, and increases if it is decreased.
[0034]
The value of this quantization step is controlled as follows.
The encoder is provided with a buffer buffer (output buffer 18) at the output in order to set the compressed data to a constant bit rate, so that a certain amount of difference in data generation amount for each image can be absorbed. Has been made.
However, if the generation of data that exceeds the predetermined bit rate continues, the remaining amount of the output buffer 18 increases and eventually overflows. On the contrary, if the data below the bit rate continues to be generated, the remaining amount of the output buffer 18 will decrease, and finally an underflow will be caused.
[0035]
Therefore, the encoder feeds back the remaining amount of the output buffer 18 so that the quantization step controller 19 controls the quantization step of the quantizer 15. Control is performed such that the quantization step is reduced so as not to be compressed, and the quantization step is increased so as to increase the compression rate when the remaining amount of the output buffer 18 increases.
[0036]
In addition, there is a large difference in the range of the encoded data amount generated by the above-described compression method (the intra-frame encoding or inter-frame predictive encoding).
In particular, when compression is performed by the intraframe coding method, a large amount of data is generated. Therefore, when the free capacity of the output buffer 18 is small, the quantization step size must be increased. In some cases, the quantization step size is maximized. However, the buffer 18 may overflow. Even if it fits in the buffer 18, if the quantization step is large, the image of the intra-frame coding affects the image quality of the subsequent inter-frame prediction coding. Therefore, before performing the compression in the intra-frame coding, the output buffer 18 Sufficient free space is required.
[0037]
Therefore, the quantization step controller 19 determines the compression method in a predetermined order, and the quantization step controller 19 provides feedback of the quantization step size so as to ensure a sufficient free space in the output buffer 18 before intra-frame coding. I try to control it.
As described above, it is possible to suppress the encoded data at a constant rate.
[0038]
[Problems to be solved by the invention]
The conventional method described above has a drawback in that high image quality cannot be obtained for the following reason.
In other words, in order to compress an input image whose amount of information changes from moment to moment to an average high image quality at a constant bit rate, the information should be uniform so that the output buffer can maintain a low bit rate and the image quality is uniform. It is necessary to allow a large amount of compressed data for an image (picture) with a large amount and a small amount of compressed data for an image with a small amount of information. However, the conventional method cannot do this in the following cases.
[0039]
For example, if images with a small amount of information continue and then an image with a large amount of information suddenly comes in, the quantization step is made too small for images with a small amount of information supplied earlier. However, the remaining amount of the output buffer should be kept low until an image with a large amount of information that follows is encoded. Will continue to increase the remaining amount of output buffer.
[0040]
Conversely, if an image with a large amount of information is followed by an image with a small amount of information, even if the image with a large amount of information supplied earlier is compressed with a large quantization step and the remaining amount of the output buffer is not reduced, Subsequent images that have a small amount of information should be difficult to overflow. However, in the output buffer remaining amount feedback method, since the amount of information of the following image is unknown, the direction in which the remaining amount of the buffer is reduced, that is, the quantization step is increased. Control in the direction to reduce the image quality.
[0041]
For this reason, for example, a configuration in which the information amount of the input image is evaluated and the quantization step is controlled based on the evaluation value is also conceivable.
However, in an image encoding apparatus having a mechanism for obtaining the evaluation value of the information amount of the input image, for example, when compressing one input image, it is obtained after compressing the input information. The allocation amount that can be used for the data is paid out according to the information amount (difficulty level) of the input image, and the quantization step of the quantizer at that time is accurately determined according to the allocation amount. It is necessary to predict well.
[0042]
Here, if the predicted quantization step is not appropriate, a usable allocation amount for the compressed data is significantly interrupted or conversely exceeded. If the allocation amount is significantly cut or exceeded in this way, the allocation amount at the time of compression of other pictures is affected.
[0043]
That is, for example, in a frame in which the allocated amount is small, the quantization step is large, and thus the image quality is lowered. For this reason, for example, frames with uniform image quality do not continue when viewed continuously, and the overall image quality is poor. Further, if the prediction is greatly deviated, in the worst case, buffer underflow or overflow may be caused.
[0044]
Here, in order to prevent this from happening, for example, even if the quantization step is controlled by the ratio of the information amount after compression in one screen, the scheduled allocation amount, and the compression progress in the screen, If the basic quantization step is not predicted, a large fluctuation of the quantization step in the screen will occur. In this way, when a large variation in the quantization step occurs in the screen, the compression is performed in the order of raster scan, so that a non-uniform portion of image quality is recognized in a strip shape on the screen, resulting in a decrease in image quality. .
[0045]
By the way, there are two purposes for controlling the quantization step in the screen, one is to improve the image quality on the screen, and the other is to reduce the generated bit amount so that it is close enough to the allocated bit amount. Is to control.
For example, when the quantization step is not controlled in the screen and fixed to a constant quantization scale, the quantization step is constant and the same in any part of the screen, so on the frequency axis after DCT processing. It can be said that the quantization error due to quantization distributed on the screen is uniform (constant). However, even if the error distribution is uniform, image quality degradation that can be recognized by humans is not uniform, and there are portions where the degradation is noticeable and portions where the degradation is not known. Therefore, the quantization step is reduced in the part where the deterioration is conspicuous, the image quality deterioration due to the quantization error is inconspicuous, the quantization step is increased in the part that is not known, and the amount of data after compression is increased by the useless coefficient after quantization Need to be reduced.
[0046]
On the other hand, depending on the input image, the amount of data (generated amount) after compression may increase or decrease with respect to the bit allocation amount allocated to one screen (overuse for the schedule). When). At this time, for example, when the same quantization step is used without controlling the quantization step for each screen, and the basic quantization step is small, the data is obtained only by changing the quantization step by one. The amount generated will vary greatly. For example, the data generation amount easily fluctuates for about one B picture, which has a smaller allocation amount than I and P pictures. Therefore, it is necessary to control the quantization step within the screen from the viewpoint of data generation amount control.
[0047]
As the quantization step control in this screen, it can be considered that the quantization step is controlled for each macroblock. The quantization step control for each macroblock has two purposes: image quality improvement and data generation amount control. However, even in this quantization step control for each macroblock, if control is performed using one quantization step for each macroblock, both the image and the data generation amount change, and the respective purposes are I can't be satisfied separately.
[0048]
For example, the amplitude (change width) of the quantization step in the macroblock that is the basis for controlling the image quality is, for example, 15 (base_Q = 15) when the basic quantization step base_Q is 4 (base_Q = 4). It has been empirically found that it is very different from the time of). Also, when controlling the amount of generation, when the basic quantization step is 1 (base_Q = 1), the amount of generation differs greatly only when the quantization step is different, for example, while the basic quantization step is 15 In the vicinity of (base_Q = 15), even if the quantization step is different, for example, the absolute value of the generated amount is not so different. That is, when the quantization step is small, the error between the generation amount and the allocation amount becomes large.
[0049]
Therefore, the present invention has been proposed in view of the above circumstances, and can satisfy both the image quality improvement and the data generation amount control, can efficiently perform image compression, and can improve the overall image quality. An object of the present invention is to provide an image encoding apparatus and an image encoding method that can be improved.
[0050]
[Means for Solving the Problems]
An image encoding device of the present invention has been proposed to achieve the above-described object, and includes an image data storage unit that stores a plurality of input image data, and a plurality of images stored in the image data storage unit. The first parameter indicating the information amount of the image itself for evaluating the information amount of the input image data, the minimum error of the luminance information from which the motion vector was detected, and the motion vector were detected. Image information evaluation means for outputting the second parameter indicating the amount of difference information of the image calculated from the minimum error of the color difference information using the sum in the block and image information for image counting, and orthogonal transformation processing on the image data And orthogonal transform means for generating orthogonal transform coefficients, and quantization for quantizing the orthogonal transform coefficients generated by the orthogonal transform means in a predetermined quantization step And the amount of data after intraframe coding compression and the amount of data after interframe predictive coding compression based on the parameter representing the amount of information for each block obtained by the image information evaluation means. A compression method selection means for selecting a compression method, and the first and the second according to the planned compression data amount and macroblock type obtained by compressing image data for one screen by the compression method selected by the compression method selection means, A basic quantization step prediction means for predicting a basic quantization step at the time of quantization in the quantization means from the difficulty level obtained by adding one of the second parameters and totaling one screen; The evaluation value of the information amount for each block obtained by the image information evaluation means is normalized up to a predetermined maximum value as an upper limit, and the basic quantization step is performed. Quantization step control means for predicting the quantization step for each block based on the median value of the normalized value given in accordance with the value of the value and the fluctuation range, and the quantization step control means includes the one screen. When the scheduled compressed data amount of image data for minutes is allocated_bit, the difficulty is Difficulty, and the basic quantization step is base Q_scale, using predetermined parameters A and B,
Base Q_scale = exp ((log (allocated_bit / difficulty) -B) / A)
The basic quantization step is obtained by the following equation, and the quantization step control means further uses the median of the evaluation values for each macroblock as a central score, and the quantization step for each block as MB_Q_scale.
MB_Q_scale = ((Central score-Evaluation value for each block) * Fluctuation range / (Normalization value of evaluation value)) + Base Q_scale
The quantization step for each block is obtained by the following equation, and the quantization means quantizes the orthogonal transform coefficient using the quantization step predicted by the quantization step control means.
[0051]
The image encoding method of the present invention includes an image data storage step for storing a plurality of pieces of input image data, and a plurality of pieces of image data stored in the image data storage means. The first parameter indicating the information amount of the image itself for evaluating the information amount, the minimum error of the luminance information from which the motion vector is detected, and the minimum error of the color difference information from which the motion vector is detected, are used in the block. An image information evaluation step for outputting the second parameter indicating the calculated difference information amount of the image and image information for image counting; an orthogonal transformation step for performing orthogonal transformation processing on the image data and generating an orthogonal transformation coefficient; Obtained by the quantization step for quantizing the orthogonal transformation coefficient generated by the orthogonal transformation step in a predetermined quantization step and the image information evaluation step. A compression method selection step of selecting one of the compression methods with a small amount of data after intra-frame coding compression and inter-frame predictive coding compression based on the parameter representing the amount of information for each lock; and One screen is added by adding either the first parameter or the second parameter according to the planned compressed data amount obtained by compressing the image data for one screen by the compression method selected in the compression method selection step and the macroblock type. A basic quantization step prediction step for predicting a basic quantization step at the time of quantization in the quantization means, and a block-by-block obtained by the image information evaluation step from the difficulty level obtained by summing Normalize the evaluation value of the amount of information with a predetermined maximum value as the upper limit, and among the normalized values given according to the value of the basic quantization step A quantization step control step for predicting a quantization step for each block according to a value and a fluctuation range, wherein the quantization step control step sets a planned compressed data amount of the image data for one screen as allocated_bit, and When the difficulty level is difficult and the basic quantization step is the base Q_scale, using predetermined parameters A and B,
Base Q_scale = exp ((log (allocated_bit / difficulty) -B) / A)
The basic quantization step is obtained by the following equation, and the quantization step control step further uses a median score of the evaluation values for each macroblock as a central score, and a quantization step for each block as MB_Q_scale.
MB_Q_scale = ((Central score-Evaluation value for each block) * Fluctuation range / (Normalization value of evaluation value)) + Base Q_scale
The quantization step for each block is obtained by the following equation, and the quantization step quantizes the orthogonal transform coefficient using the quantization step predicted in the quantization step control step.
[0053]
[Action]
According to the present invention, each of a plurality of pieces of image data is divided into blocks, the information amount of the image data for each block is evaluated, and the image data is adaptively determined based on the evaluation value of the information amount for each block. After the compression method is selected, the evaluation value of the information amount for each block is normalized with reference to the basic quantization step, and the quantization step for each block is predicted based on the normalized evaluation value.
[0054]
【Example】
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
FIG. 1 shows a schematic configuration of an image encoding apparatus according to an embodiment of the present invention. In FIG. 1, the same components as those in FIG. 9 described above are denoted by the same reference numerals, and the description thereof is omitted.
[0055]
In the configuration of FIG. 1, the components added to the configuration of FIG. 9 are an image information evaluation circuit 50, a scene change detection circuit 31, a compression method selection circuit 32, and a motion vector generation circuit 33, and a quantization step The controller 39 and the frame memory 40 are changed.
That is, the image coding apparatus according to the embodiment of the present invention divides the frame memory 40 as image data storage means for storing a plurality of pieces of input image data, and the plurality of frames of image data stored in the frame memory 40 into blocks. The image information evaluation circuit 50 that evaluates the amount of image data for each block, the DCT circuit 14 that performs orthogonal transform processing such as DCT on the image data and generates the DCT coefficient, and the DCT circuit 40 A method of compressing image data adaptively based on the quantizer 15 that quantizes the DCT coefficients in a predetermined quantization step and the evaluation value of the information amount for each block obtained by the image information evaluation circuit 50. The compression method selection circuit 32 for selecting the image information and the information amount for each screen obtained by the image information evaluation circuit 50 and the information amount based on the information amount. Basic quantization step prediction means for predicting the basic quantization step for each screen based on the relationship between the generated predicted bit amount, the past information amount for each screen, the generated bit amount, and the quantization step, and the image information evaluation circuit Quantization step control means for normalizing the evaluation value of the information amount for each block obtained by 50 and predicting the quantization step for each block by the normalized evaluation value for each block with reference to the basic quantization step And a quantization step controller 39.
[0056]
In FIG. 1, first, input image data input from the input terminal 1 is stored in the frame memory 40.
Unlike the frame memory 10 shown in FIG. 9, the frame memory 40 can store a predetermined number of frames. As the predetermined number to be accumulated at this time, if the number is too large, the frame memory 40 becomes large, which is not preferable. The effective length (number of frames) as the predetermined number is the bit rate, the capacity of the output buffer 18, and the interval between images of the compression method of intra-frame coding (in most cases, it may be the GOP length). Depends heavily on This is because the output buffer 18 absorbs non-uniformity in the size of the compressed data resulting from the difference in compression method and compression rate, and the range where the constant bit rate can be obtained is that the bit rate, output buffer capacity and intra-frame coding are This is because it is limited by conditions such as the interval between images.
[0057]
Here, in general, compression by an intra-frame coding method is performed periodically (this is often a GOP), and the compression method of intra-frame coding has a data amount after compression other than Since it is considerably larger than the method, it is one reasonable method to check the information amount at the interval between compressed images (or GOP) by intra-frame coding and to allocate the data amount.
[0058]
However, in the system of the present embodiment, compression is performed by the intra-frame coding system even when the correlation between the previous and next images becomes extremely low due to a scene change or the like.
In that case, an image that is compressed by nearby intraframe coding that should be performed periodically loses the necessity of compression by intraframe coding because it becomes difficult to maintain a constant bit rate or uniform image quality. It is necessary to cancel the compression by the inner coding.
[0059]
Therefore, it is appropriate that the length of the frame memory 40 (the predetermined number) is about twice as long as the period of compression by intraframe coding.
Of course, the number of frames is only an example, and is not limited to this, and can be changed in accordance with various conditions.
The image data stored in the frame memory 40 is sent to the image information evaluation circuit 50 as appropriate.
[0060]
Here, the image information evaluation circuit 50 roughly calculates two kinds of parameters.
The first parameter indicates the amount of information of the image itself so that the amount of data after compression when compression is performed by intraframe coding can be predicted. As the first parameter, for example, DCT processing is performed for each block on the image data supplied from the frame memory 40, and the sum and statistics of the DCT coefficients are taken. When it becomes larger, the sum of the mean square error for each block is obtained. In any case, the image information evaluation circuit 50 calculates a parameter that represents the information amount of the image and can be used to analogize the data amount after compression.
[0061]
The second parameter indicates the amount of difference information of an image capable of predicting the amount of data after compression when compression is performed by inter-frame predictive coding. As the parameter in this case, for example, the sum of the difference values between the image stored in the frame memory 40 and the image after motion compensation in the block is used. In calculating this parameter, it is possible to use a minimum error in which a motion vector obtained by a general motion vector detection circuit (motion detector 20 and motion vector generation circuit 33) is detected.
[0062]
At this time, as a parameter for analogy (prediction) of the amount of data after compression by inter-frame predictive coding, a motion vector detection circuit (motion detector 20 and motion vector generation circuit 33) with only general luminance information is used. In addition to the minimum error obtained only from the obtained motion vector and the luminance information from which the motion vector is detected, in this embodiment, the minimum error obtained from only the color difference information from which the motion vector is detected is newly used. .
[0063]
In the present embodiment apparatus, the minimum error from the luminance information and the minimum error from the color difference information obtained in this way are used as the error of the macroblock, and the compression method selection circuit described later using the error of the macroblock. At 32, the compression method is determined.
The evaluation value (parameter) of the image information calculated as described above by the image information evaluation circuit 50 is a scene change detection circuit 31, a compression method selection circuit 32, and a quantization step controller 39 described below. And sent to.
[0064]
The image information evaluation circuit 50 also sends image information to the compression method selection circuit 32 in order to count images when the GOP length is determined in the compression method selection circuit 32 described later.
Next, the scene change detection circuit 31 detects a scene change using the output (for example, the second parameter) of the image information evaluation circuit 50.
[0065]
Here, the purpose of detecting a scene change in the scene change detection circuit 31 is mainly to be used as a judgment material for determining a compression method of either inter-frame predictive coding or intra-frame coding. This is because an image with extremely low correlation between before and after such as a scene change portion can be compressed more efficiently by intra-frame coding than by inter-frame prediction coding. In addition, since the data after compression becomes large in the scene change portion, it is important to grasp the scene change from the viewpoint of data amount distribution and output buffer management.
[0066]
Since the scene change as described above exists where the correlation is significantly impaired in the previous and subsequent images, for example, the scene change portion includes, for example, a difference value between the previous and next images, for example, the image after motion vector compensation. It can be detected by obtaining the sum of the difference values in the entire image and obtaining the ratio of the sum in the previous and subsequent images.
[0067]
For this reason, the scene change detection circuit 31 of this embodiment detects a scene change using the output of the image information evaluation circuit 50. That is, since the image information evaluation circuit 50 outputs the sum of the difference values of the image after motion compensation in the block as the second parameter as described above, the scene change detection circuit 31 performs the block of the difference value. The above-described calculation for scene change detection can be performed using the sum of the two.
[0068]
Next, the compression method selection circuit 32 will be described.
The compression method selection circuit 32 obtains the second change obtained from the scene change detection output from the scene change detection circuit 31, the count value obtained by counting the image information from the image information evaluation circuit 50, and the luminance information and the color difference information. This is a circuit that selects which compression method to use for the intra-frame coding / inter-frame prediction coding (P, B picture) based on the parameter (minimum error).
[0069]
That is, the compression method selection circuit 32 performs intraframe coding / interframe prediction coding for each macroblock based on the parameters obtained from the luminance information and color difference information for each macroblock obtained by the image information evaluation circuit 50. The expected amount of data generated by each compression method (predicted amount of occurrence) is compared, and a compression method that reduces the expected amount of generation is selected.
[0070]
Also, the compressed image by the intraframe coding method must be at least at the beginning of the GOP. Further, since the GOP is set at a certain interval in consideration of random access, the I picture is inevitably generated periodically at the interval, and in this embodiment, it is also generated by a scene change or the like. Is.
For this reason, the compression method selection circuit 32 counts the image information from the image information evaluation circuit 50, and the scene change detection output from the scene change detection circuit 31 is sent to the compression method selection circuit 32. Added. As a result, the compression method selection circuit 32 selects the regular intra-frame coding from the count value of the image and also selects the intra-frame coding at the time of detecting the scene change (that is, determines the GOP interval). In other cases, inter-frame predictive coding is selected.
[0071]
The compression method selection circuit 32 performs switching control of the changeover switches 13 and 24 according to the selection of the compression method, and sends information indicating the selection result to the quantization step controller 39.
The quantization step controller 39 controls the quantization step width of the quantizer 15 based on the information indicating the code amount from the variable length coding circuit 17. The data output from the output buffer 18 is output from the output terminal 2 as an encoded output subjected to compression encoding.
[0072]
The output from the quantizer 15 is inversely quantized by an inverse quantizer 27 and further subjected to inverse DCT processing by an inverse DCT circuit 26. The output of the inverse DCT circuit 26 is sent to the adder 25.
The adder 25 is also supplied with the inter-frame prediction image data from the motion compensator 21 via the changeover switch 24 that is turned on in the case of the inter-frame prediction encoding frame, and the data and the inverse DCT circuit 26 Addition with output data is performed. The output data of the adder 25 is temporarily stored in the frame memory 22 and then sent to the motion compensator 21.
[0073]
The motion compensator 21 performs motion compensation based on the motion vector detected by the motion detector 20 and generated by the motion vector generation circuit 33, and outputs inter-frame prediction image data obtained thereby.
The quantization step controller 39 knows from the evaluation value (parameter) from the image information evaluation circuit 50 that the amount of information of the image, and further, the correlation between the preceding and following images becomes extremely low like a scene change. From the information indicating the selection result from the compression method selection circuit 32, it is also possible to know which of the images selected is intra-frame coding or inter-frame prediction coding.
[0074]
Therefore, in the quantization step controller 39, compared to the conventional quantization step control that feeds back only the remaining amount of the output buffer 18, it is possible to follow an abrupt change in the information amount of the input image. Appropriate quantization step control can be performed according to the change in the information amount, and further appropriate quantization step control can be performed according to the compression method of intraframe coding / interframe prediction coding.
[0075]
Next, the flow of processing in each main component of the present embodiment will be described in more detail along the flowchart of FIG.
First, in step S <b> 1, image data input to the input terminal 1 is sequentially stored in the frame memory 40.
Here, since the determination of the frequency and interval of the I picture affects the image quality as described above, it is necessary to determine the GOP prior to encoding in connection with this, and rate control (quantization) In order to perform the bit rate control by step control), information about an image for 1 GOP must be collected prior to encoding. In this way, a large amount of frame memory 40 is used in order to obtain a sufficient delay time until the image data input one after another is analyzed in the meantime and encoded.
[0076]
Next, in step S2, the motion detector 20 detects a motion vector necessary for compression by interframe predictive coding. That is, in this step S2, motion detection (motion estimation) is performed so that each image data in the frame memory 40 can be compression-coded as a P picture or a B picture according to a predetermined schedule.
[0077]
Here, an I picture is not defined for an image subjected to motion detection. This is because it is not determined at this point which image data is to be an I picture, and since I pictures do not require motion compensation, any image data can later become an I picture.
The image information evaluation circuit 50 uses one of the parameters (second distortion) used for encoding a so-called minimum distortion or absolute difference (AD) used for the motion detection. Parameter).
[0078]
Note that the absolute value sum (AD) of the errors is obtained by dividing the reference-side image into 8 × 8 pixel blocks and macroblocks (MB) of luminance data 8 × 8 × 4 pixels and color difference data 8 × 8 × 2 pixels. ), The absolute value sum of the difference between each pixel and the macro block on the search side cut out by the motion vector obtained when motion detection is performed, and can be obtained by the following equation (1).
[0079]
[Expression 1]
Figure 0003711573
This is further used as a sum of absolute values (AD) of errors of the macroblock by using the total of the blocks in the macroblock.
This parameter is used to estimate the amount of information in consideration of scene change determination and image correlation when compression is performed by inter-frame predictive coding.
[0080]
This parameter is also used to determine the macroblock type as described below.
The parameter SAD for estimating the information amount of the image is the sum of the absolute value sums (AD) of the errors in one image, as shown in Equation (2).
SAD = ΣAD (2)
Of course, in addition to the absolute value sum (AD) of the errors, a minimum distortion may be used.
[0081]
Next, in the image information evaluation circuit 50, as in step S3, in addition to the parameters obtained by the motion detection, a mean absolute difference (MAD) and an activity (Activity) of errors for each image. evaluate.
The average absolute value sum of errors (MAD) is a parameter for estimating the amount of information of an I picture, and is obtained for each 8 × 8 pixel block by the following equation (3). Aggregate. This parameter is also used to determine the macroblock type.
[0082]
[Expression 2]
Figure 0003711573
This is further used for the determination of the macroblock using the sum of the blocks in the macroblock as shown in equation (4).
MAD = Σ blockMAD (4)
Further, as shown in equation (5), the values of the macroblocks are summed in one image, and the value is set as a parameter SMAD representing the amount of information (as an I picture) of the image.
[0083]
SMAD = ΣMAD (5)
In addition, the above-described activity is performed in order to improve the compression efficiency while maintaining the image quality by controlling the quantization step more finely according to the state of the image of the macroblock in one screen. Is a parameter for quantifying.
[0084]
For example, in a flat block where the image level is small and the pixel level change is small, distortion due to quantization is conspicuous, and the quantization step should be reduced. Is inconspicuous and has a lot of information, so the quantization step should be increased.
Therefore, for example, a parameter representing the flatness of the block is used as this activity.
[0085]
Next, in the compression method selection circuit 32, the macro block type is determined in step S4. That is, the compression method selection circuit 32 determines the compression method and macroblock type for each macroblock in the step S4.
As described above, the average absolute value sum (MAD) of errors and the sum of absolute values of errors (AD) already obtained are the data amounts after compression when compressed by intraframe coding / interframe prediction coding, respectively. Therefore, if these two parameters are compared, it can be determined which of the macroblock types of intraframe coding and interframe prediction coding has a smaller data amount.
[0086]
In step S5, the scene change detection circuit 31 detects a scene change. The scene change detection by the scene change detection circuit 31 is performed using the parameter AD obtained by the image information evaluation circuit 50. Specifically, the scene change is detected at the rate of change using the parameter SAD obtained by adding the parameter AD for one screen.
[0087]
Next, the compression method selection circuit 32 determines the GOP length in step S6, and selects the compression method (determination of picture type) in step S7.
Here, as described above, the GOP is divided for each appropriate number of frames in consideration of random accessibility during encoding. At this time, since at least the first picture in the GOP code order must be an I picture, the number of pictures is counted and the picture type is changed to an I picture periodically.
[0088]
On the other hand, when the correlation changes between the preceding and succeeding pictures due to the scene change, it is also efficient to perform compression coding with the I picture as described above. However, since the I picture has a low compression rate, if it appears frequently at a low bit rate, the image quality is degraded. Therefore, when a scene change is detected by the scene change detection circuit 31, the compression method selection circuit 32 adaptively determines the length of the GOP so as to keep an interval between I pictures moderate.
[0089]
In the next step S8, the quantization step controller 39 performs bit allocation for rate control.
The data size after compression encoding for each picture varies greatly depending on the encoding method, the amount of information of the original image data, the correlation before and after, and the like. This is especially true if average image quality is maintained.
[0090]
The nonuniformity of the data size after compression coding for each picture is absorbed to some extent by the output buffer 18, but on average it must be a constant bit rate. Therefore, if a certain section is determined, the total compressed data amount of the picture during that period is determined. Therefore, the amount of data after compression, that is, the amount of bits that can be used for each picture, is determined for each picture using the picture type that has already been determined and the information amount parameter of the image that has been examined in advance.
[0091]
At this time, for example, it is small for images and B pictures with a small amount of information, and is large for images and I pictures with a large amount of information. This is called bit allocation. This makes it easy to suppress variations in image quality and maintain a constant rate.
In this embodiment, GOP is used as a bit allocation section, and bit allocation is performed as in the following equations (6) and (7).
Total Bit Count = (Bit Rate [bit / s] x Number Of Picture In GOP [picture]) / (Picture Rate [picture / s]) [bit] (6)
Available Bits = (Total Bit Count x Target image information parameter) / GOP total value of image information parameter) [bit] (7)
The information amount parameter used in the equation (7) is obtained by multiplying the parameters SMAD and SAD described above by the multiplier for each picture type to be compressed. The multiplier adjusts the relationship between the parameter and the image quality between the picture types.
[0092]
Note that the GOP total value of the image information amount parameter in the equation (7) is obtained as shown in the equation (8).
GOP total value of image information amount parameter = Ki × ΣDiffi + Kp × ΣDiffp + Kb × ΣDiffb
Diffp: P picture difficulty
Diffb: B picture difficulty (8)
In the quantization step controller 39, the basic quantization step is determined in the next step S9.
[0093]
That is, if the picture type is determined as described above, and the macroblock type is determined, the average absolute value sum (MAD) of errors and the sum of absolute values of errors (AD) for one screen are totaled according to the macroblock type. Thus, the information amount parameter (that is, the difficulty level) of one screen can be measured. Therefore, if the information amount parameter and the amount of data after quantization are determined from past results, the quantization step can be estimated.
[0094]
The quantization step controller 39 of the present embodiment determines the basic quantization scale (Q_scale) of one screen from the allocated bit amount (allocated_bit) for each screen and the above difficulty (difficulty) by the following method. I have to.
First, as shown in equation (9),
log (allocated_bit / difficulty) = A * log (Q_scale) + B (9)
A and B in the above equation (9) are obtained in advance by learning (experiment). Further, the quantization scale (Q_scale) is obtained from Expression (10) obtained by modifying Expression (9).
[0095]
Q_scale = exp ((log (allocated_bit / difficulty) -B) / A) (10)
The quantization step obtained in this way is set as the basic quantization step for the picture.
Next, the quantization step controller 39 controls the quantization step in the screen in step S10.
[0096]
As described above, the quantization step controller 39 of the present embodiment controls the quantization step in the screen for each block so that the image quality is as high as possible and the compression efficiency is as high as possible. That is, the quantization step controller 39 controls the quantization step for the quantizer 15 by adjusting the basic quantization step based on the information such as the activity and the macro block type.
[0097]
Here, the mechanism for determining the quantization step for each macroblock is composed of a two-step procedure.
First, the quantization step controller 39 uses the information such as the average absolute value sum (MAD), the error absolute value sum (AD), the motion vector, and the activity for each macroblock from the image information evaluation circuit 50. Calculate the median and average of each. That is, a condition that can be considered by combining the characteristics expressed by the average absolute value sum (MAD) of errors, the sum of absolute values of errors (AD), motion vectors, and activity parameters based on human visual characteristics and compression characteristics. The evaluation value is normalized based on.
[0098]
Here, for example, as the above visual characteristics,
1. It can recognize image quality degradation when the eye is able to follow, but the amount of movement exceeds a certain range and if it moves quickly, it can not recognize image quality degradation,
2. One that has a shape model as a concept is sensitive to image quality degradation, but one that is not in the model is insensitive.
[0099]
In addition, as compression characteristics,
a. Quantization errors in spatially smoothly changing parts are conspicuous as image quality degradation, but some quantization errors in parts that have a large amount of change are inconspicuous,
b. A quantization error is noticeable in a portion where there is a boundary between objects and the both sides of the boundary are smooth, but it is difficult to notice when there is a large amount of change on both sides of the boundary.
[0100]
In this way, each has its own characteristics, but the conditions of the characteristics, for example, the a. In the above condition, the condition of “a portion that changes smoothly in space” is combined with parameters such as the average absolute value sum of errors (MAD), absolute error sum (AD), motion vector, activity, etc. for each macroblock. It normalizes so that the evaluation value (point) is increased when it is in that state, and is lower when it is not. A. As the parameter representing the above condition, since the average absolute value sum (MAD) of the error represents unevenness in the macroblock, it can be determined by the magnitude of the average absolute value sum (MAD) of the error.
[0101]
Actually, the distribution of the average absolute value sum (MAD) of the error, the distribution of the absolute value sum (AD) of the error, and the distribution of the motion vector obtained from the motion vector generation circuit 33 for each macro block when the macro block type is determined The evaluation value is normalized according to.
That is, for example, the evaluation value is normalized by setting the average evaluation value to 50 and the maximum value to 100. The evaluation value normalization method is based on processing such as the flowchart of evaluation value normalization shown in FIGS.
[0102]
Next, the quantization step controller 39 determines a quantization step from the basic quantization step according to the normalized evaluation value for each macroblock. That is, according to the basic quantization step, the median evaluation value and the amplitude of the quantization step for each macroblock are controlled. As a result, control is performed so that excessive use of the allocated bit amount given to one screen does not occur. The method for determining the quantization step for the macroblock is based on a process such as the flowchart for determining the quantization step shown in FIG.
[0103]
In the next step S11, the variable length encoding circuit 17 performs encoding.
Since all parameters for compression encoding have been determined so far, the compression encoding is performed in accordance with the MPEG rules.
Finally, in step S12, each parameter described above is updated.
Here, the relationship between the amount of image information, the basic quantization step, and the amount of data after compression depends on the image to be compressed. Therefore, the parameters and prediction parameters used in the expression representing the relationship are learned by feeding back the actual data amount after compression, thereby improving the prediction accuracy.
[0104]
At this time, the learning parameters A and B are first learned and corrected by the following method for each picture type.
For example, assuming that the average value of the quantization scale (Q-scale) for each macroblock is (average_Q) and the generated amount after one screen compression is (generated bit), as shown in equation (11),
x = log (average_Q), y = log (generated bit / difficulty) (11)
Thus, the parameters A and B can be obtained by the least square error method as shown in the following equations (12) and (13). In the formula, n is the number of samples.
Figure 0003711573
Next, the flowchart of FIG. 3 will be described.
[0105]
In FIG. 3, in step S31, the average absolute value sum (MAD) of errors for one screen, the sum of absolute values of errors (AD), flatness (flatness), and motion vectors are totaled to determine the macroblock type. To do.
In the next step S32, an average absolute value sum (MAD) of errors for one screen, an absolute value sum of errors (AD), an average value of motion vectors, and a median value are summed, and in step S33, the average of the errors is calculated. An intra center (intra_center) and an inter center (inter_center) are calculated and set as initial values from the absolute value sum (MAD), the average value of the sum of absolute values of errors (AD), and the median value. Here, the center having the larger average value and median value is set as the center.
[0106]
In the next step S34, it is determined whether or not the macro block is an intra-frame encoded (intra macro block). If it is determined in step S34 that the block is an intra macroblock, the process proceeds to step S35. If it is determined that the block is not an intra macroblock (non-intra macroblock), the process proceeds to step S35. In step S35, the process for non-intra macroblock is performed to determine the evaluation value, and in step S36, the process for intra macroblock is performed to determine the evaluation value.
[0107]
In the next step S37, the flatness is added, and in step S38, the evaluation value is normalized and normalized. For example, it is checked and corrected whether the evaluation value is a maximum of 100 defined as a standard, a minimum of 0, and the central distribution state is around 50.
In the next step S39, it is determined whether or not the processing of the macroblock for one screen has been completed. If it is determined that the process is in progress, the process returns to step S34, and if it is determined that the process has been completed, the entire process is completed. Exit.
[0108]
Next, the flowchart of FIG. 4 shows an example of the evaluation value determination process of the intra macroblock in step S36 of FIG.
In FIG. 4, in step S41, it is determined whether or not there is flat or unevenness based on the value of the mean absolute value of errors (MAD). That is, it is determined whether there is a flat or unevenness depending on whether the average absolute value sum (MB_MAD) of macro block errors is larger than the intra center (intra_center).
[0109]
If it is determined in step S41 that it is flat, the process proceeds to step S43. If it is determined that there is unevenness, the process proceeds to step S42.
In step S42, MB_POINT = 0 and sabun = MB_MAD are set, and in the next step S44, it is determined whether or not there is a complicated unevenness by the value of the mean absolute value of errors (MAD). If it is determined in step S44 that the unevenness is complicated, the process proceeds to step S45, where the evaluation value points are decreased, and then the process proceeds to step S48. If it is determined in step S44 that there is no complexity, the process proceeds to step S48. In this step S48, evaluation value points are given, and weighting is given by the value of PLUS_MAD.
[0110]
In step S41, the process proceeds to step S43 when it is determined to be flat.
In this step S41, MB_POINT = 0 is set, and in the next step S46, it is determined whether or not the motion vector is small. If it is determined in this step S46 that the motion vector is very small, the process proceeds to step S47, a point is given because the motion is small and flat, and then the process proceeds to step S49. If it is determined in step S46 that the size is not small, the process proceeds to step S49. In this step S49, the gradient of the point based on the value of the average absolute value sum (MAD) of errors is given by the value of MINUS_MAD.
[0111]
Next, the flowchart of FIG. 5 shows an example of the non-intra macroblock evaluation value determination process in step S35 of FIG.
In FIG. 5, in step S51, points are given according to the value of the motion vector. In the next step S52, the degree of change is determined based on the value of the absolute value sum (AD) of errors. If it is determined in step S52 that the change is small, the process proceeds to step S53. If it is determined that the change is large, the process proceeds to step S55.
[0112]
In step S55, the gradient of the point according to the value of the absolute value sum (AD) of errors is given by the value of PLUS_MAD.
Further, in step S53, it is determined whether or not the motion vector is very small. In step S54 when it is determined that the motion vector is small, points are given so that a small difference can be expressed because the change is small. On the other hand, if it is determined in step S53 that the change is not small, a point gradient based on the sum of absolute values of errors (AD) is given by the value of MINUS_MAD.
[0113]
In steps S55 and S56, the gradient is changed according to the values of PLUS_MAD and MINUS_MAD, and the point value is set to an appropriate value.
Next, FIG. 6 shows a flowchart of the quantization step determination.
In FIG. 6, in step S61, whether or not the value of the basic quantization scale (base Q_scale) is smaller than 3, whether or not the value of the basic quantization step is smaller than 5 in step S62, and basic quantization in step S63. Whether or not the step value is smaller than 10 and whether or not the basic quantization step value is smaller than 15 are sequentially determined in step S64. In these steps S61 to S63, if it is determined that each is small, the process proceeds to the corresponding steps S66 to S69, and if it is determined that the value is large in the last step S64, the process proceeds to step S65. In these steps S65 to S69, the median value of the evaluation value at the time of determination and the amplitude of the quantization step are obtained based on the values of the corresponding basic quantization steps, and then the quantization for each macroblock is performed in step S70. The step is controlled, and the quantization step for each macroblock is clipped in step S71.
[0114]
Next, FIG. 7 shows the relationship between the basic quantization scale (base Q_scale) and the quantization scale (Q_scale) for each macroblock.
That is, in FIG. 7, in this embodiment, the range of the quantization scale (Q_scale) for each macroblock is controlled according to the basic quantization scale (base Q_scale). Depending on the evaluation value for each macroblock, the quantization scale (Q_scale) for each macroblock is determined from the basic quantization scale (base Q_scale).
[0115]
FIG. 8 shows the relationship of the fluctuation range of the quantization scale (Q_scale) of the center score. That is, the median value of the evaluation value for each macroblock when determining the quantization scale (Q_scale) for each macroblock according to the value of the basic quantization scale (base Q_scale) = the center score, and the quantum for each macroblock It is a figure which shows the fluctuation range of a quantization scale (Q_scale).
[0116]
In FIG. 8, the center score is a score that is the center when the evaluation value for each macroblock is expressed as a score, and is controlled by the value of the basic quantization scale (base Q_scale). This can be conceptually expressed by equation (15).
MB _Q _scale = ((central score-evaluation value for each MB) * fluctuation range / (normalization value of evaluation value)) + base Q _scale (15)
It becomes. Note that the normalized value of the evaluation value is 100, for example.
[0117]
As described above, in the apparatus according to the present embodiment, the information amount of the input image data in the frame memory 40 is evaluated by the image information evaluation circuit 50, and the correlation between the images is examined by the scene change detection circuit 31, and these images are checked. After the compression method selection circuit 32 adaptively determines the compression method according to the information about the information, the quantization step controller 39 determines the difficulty level (information amount) when compressing the input image and the information amount in the input image frame. The correlation information amount between the image frames is totaled and estimated, and the basic quantization scale is estimated from the past actual values. Therefore, the quantization step control within the screen can be determined from the evaluation value considering the compression characteristics and visual characteristics for each macroblock, and the data generation amount is also appropriately controlled. Bits are not used or left over, and averaged image quality can be maintained.
[0118]
Also, in the present embodiment apparatus, the degree of difficulty (human vision) for each macroblock in the screen is determined from the information amount in the input image frame, the correlation information amount between the input image frames, and the activity, and normalized evaluation. The value is determined. In other words, since bit allocation is performed in the screen according to the difficulty level during compression, the quantization step can be accurately predicted, bits are used without waste, and inhomogeneity is difficult to detect in the screen. It is possible to obtain a compressed image in which deterioration is difficult to detect.
[0119]
Further, in the apparatus according to the present embodiment, the amplitude of the quantization step and the median value of the normalized evaluation values are changed according to the value of the basic quantization step so that the compressed data amount becomes close to the allocated data amount. In addition, the quantization step for each macroblock is controlled. That is, even if the basic quantization step is not determined, the normalized evaluation value in the screen can be determined independently, and the evaluation value from the image quality aspect can be easily included.
[0120]
Furthermore, in the apparatus according to the present embodiment, since the basic quantization step is determined by the quantization step controller 39, the evaluation value can be determined independently of the basic quantization step.
[0121]
【The invention's effect】
In the image encoding device of the present invention, a plurality of pieces of input image data are accumulated, the accumulated plurality of pieces of image data are divided into blocks, and the information amount of the image data for each block is evaluated. After selecting an image data compression method adaptively based on the evaluation value of the amount of information, the evaluation value of the information amount for each block is normalized with reference to the basic quantization step, and the normalized evaluation value By predicting the quantization step for each block, both image quality improvement and data generation amount control can be satisfied, efficient image compression is possible, and overall image quality can be improved. .
[Brief description of the drawings]
FIG. 1 is a block circuit diagram showing a schematic configuration of an image encoding apparatus according to an embodiment of the present invention.
FIG. 2 is a flowchart showing the operation of the apparatus according to the present embodiment.
FIG. 3 is a flowchart of evaluation value normalization for one screen.
FIG. 4 is a flowchart for determining an evaluation value of an intra macroblock.
FIG. 5 is a flowchart for determining an evaluation value of a non-intra macroblock.
FIG. 6 is a flowchart of quantization step determination.
FIG. 7 is a diagram illustrating a relationship between a basic quantization step and a quantization step for each macroblock.
FIG. 8 is a diagram illustrating a relationship between a center score and a fluctuation range of a quantization step.
FIG. 9 is a block circuit diagram showing a schematic configuration of a conventional image encoding device.
FIG. 10 is a diagram for explaining the resolution and configuration of an image.
FIG. 11 is a diagram for explaining macroblocks and blocks;
FIG. 12 is a diagram for explaining zigzag scanning.
FIG. 13 is a diagram for explaining a GOP;
[Explanation of symbols]
22, 40 frame memory
11 Block divider
12 Differentiator
13,24 switch
14 DCT circuit
15 Quantizer
16 Zigzag scan circuit
17 Variable length coding circuit
18 Output buffer
39 Quantization step controller
20 Motion detector
21 motion compensator
25 Adder
26 Inverse DCT circuit
27 Inverse Quantizer
31 Scene change detection circuit
32 Compression method selection circuit
33 Motion vector generation circuit
50 Image information evaluation circuit

Claims (2)

入力画像データを複数枚蓄える画像データ蓄積手段と、
上記画像データ蓄積手段に蓄積された複数枚の画像データをそれぞれブロックに分割し、当該入力画像データの情報量を評価するための画像自身の情報量を示す第1のパラメータ、動きベクトルが検出された輝度情報の最小誤差及び動きベクトルが検出された色差情報の最小誤差からブロック内の和を用いて算出した画像の差分情報量を示す第2のパラメータ及び画像カウントのための画像情報を出力する画像情報評価手段と、
画像データに直交変換処理を施し、直交変換係数を生成する直交変換手段と、
上記直交変換手段により生成された直交変換係数を、所定の量子化ステップで量子化する量子化手段と、
上記画像情報評価手段によって得られたブロック毎の情報量を表す上記パラメータに基づいてフレーム内符号化圧縮後のデータ量とフレーム間予測符号化圧縮後のデータ量の少ない何れか一方の圧縮方法を選択する圧縮方法選択手段と、
上記圧縮方法選択手段が選択した圧縮方法で1画面分の画像データを圧縮することにより得られる予定圧縮データ量とマクロブロックタイプに応じて上記第1、第2のパラメータのどちらかを加算し一画面分合計することにより求められた難易度とから、上記量子化手段における量子化の際の基本量子化ステップを予測する基本量子化ステップ予測手段と、
上記画像情報評価手段によって得られたブロック毎の情報量の評価値を予め定めた最大値を上限として正規化を行い、上記基本量子化ステップの値に応じて与えられる上記正規化した値の中央値と変動幅によって上記ブロック毎の量子化ステップを予測する量子化ステップ制御手段とを有し、
上記量子化ステップ制御手段は、上記1画面分の画像データの予定圧縮データ量を allocated_bit とし、上記難易度を difficulty とし、上記基本量子化ステップをベース Q_scale とするとき、予め定められたパラメータA、Bを用いて、
ベース Q_scale exp((log(allocated_bit/difficulty)-B)/A)
の式により上記基本量子化ステップを求め、
更に上記量子化ステップ制御手段は、マクロブロック毎の上記評価値の中央値を中央得点とし、上記ブロック毎の量子化ステップを MB_Q_scale とするとき、
MB_Q_scale (( 中央得点−ブロック毎の評価値 ) * 変動幅 ( 評価値の正規化値 )) ベース Q_scale
の式により上記ブロック毎の量子化ステップを求め、
上記量子化手段は、上記量子化ステップ制御手段で予測された量子化ステップを用いて上記直交変換係数を量子化することを特徴とする画像符号化装置。
Image data storage means for storing a plurality of input image data;
A plurality of pieces of image data stored in the image data storage means are each divided into blocks, and a first parameter indicating the information amount of the image itself and a motion vector for detecting the information amount of the input image data are detected. The second parameter indicating the difference information amount of the image calculated using the sum in the block from the minimum error of the luminance information and the minimum error of the color difference information from which the motion vector is detected, and image information for image counting are output. Image information evaluation means;
Orthogonal transform means for performing orthogonal transform processing on image data and generating orthogonal transform coefficients;
Quantization means for quantizing the orthogonal transformation coefficient generated by the orthogonal transformation means in a predetermined quantization step;
Based on the parameter representing the amount of information for each block obtained by the image information evaluation means, either one of the compression methods with a small amount of data after intraframe coding compression or a small amount of data after interframe predictive coding compression is used. A compression method selection means to select;
Either one of the first and second parameters is added according to the planned compressed data amount obtained by compressing the image data for one screen by the compression method selected by the compression method selection means and the macroblock type. A basic quantization step prediction means for predicting a basic quantization step at the time of quantization in the quantization means, based on the difficulty level obtained by summing up the screens ;
The evaluation value of the information amount for each block obtained by the image information evaluation means is normalized with a predetermined maximum value as an upper limit , and the center of the normalized value given according to the value of the basic quantization step A quantization step control means for predicting a quantization step for each block according to a value and a fluctuation range;
The quantization step control means has a predetermined parameter A, when the scheduled compressed data amount of the image data for one screen is allocated_bit , the difficulty is difficulty , and the basic quantization step is a base Q_scale . Using B,
Base Q_scale = exp ((log (allocated_bit / difficulty) -B) / A)
The above basic quantization step is obtained by
Further, the quantization step control means, when the median score of the evaluation value for each macroblock is a central score, and the quantization step for each block is MB_Q_scale ,
MB_Q_scale = (( central score-evaluation value for each block ) * fluctuation range / ( Evaluation value normalized value )) + Base Q_scale
The quantization step for each block is obtained by the equation
The image coding apparatus characterized in that the quantization means quantizes the orthogonal transform coefficient using the quantization step predicted by the quantization step control means.
入力画像データを複数枚蓄える画像データ蓄積工程と、
上記画像データ蓄積手段に蓄積された複数枚の画像データをそれぞれブロックに分割し、当該入力画像データの情報量を評価するための画像自身の情報量を示す第1のパラメータ、動きベクトルが検出された輝度情報の最小誤差及び動きベクトルが検出された色差情報の最小誤差からブロック内の和を用いて算出した画像の差分情報量を示す第2のパラメータ及び画像カウントのための画像情報を出力する画像情報評価工程と、
画像データに直交変換処理を施し、直交変換係数を生成する直交変換工程と、
上記直交変換工程により生成された直交変換係数を、所定の量子化ステップで量子化する量子化工程と、
上記画像情報評価工程によって得られたブロック毎の情報量を表す上記パラメータに基づいてフレーム内符号化圧縮後のデータ量とフレーム間予測符号化圧縮後のデータ量の少ない何れか一方の圧縮方法を選択する圧縮方法選択工程と、
上記圧縮方法選択工程で選択した圧縮方法で1画面分の画像データを圧縮することにより得られる予定圧縮データ量とマクロブロックタイプに応じて上記第1、第2のパラメータのどちらかを加算し一画面分合計することにより求められた難易度とから、上記量子化手段における量子化の際の基本量子化ステップを予測する基本量子化ステップ予測工程と、
上記画像情報評価工程によって得られたブロック毎の情報量の評価値を予め定めた最大値を上限として正規化を行い、上記基本量子化ステップの値に応じて与えられる上記正規化した値の中央値と変動幅によって上記ブロック毎の量子化ステップを予測する量子化ステップ制御工程とを有し、
上記量子化ステップ制御工程は、上記1画面分の画像データの予定圧縮データ量を allocated_bit とし、上記難易度を difficulty とし、上記基本量子化ステップをベース Q_scale とするとき、予め定められたパラメータA、Bを用いて、
ベース Q_scale exp((log(allocated_bit/difficulty)-B)/A)
の式により上記基本量子化ステップを求め、
更に上記量子化ステップ制御工程は、マクロブロック毎の上記評価値の中央値を中央得点とし、上記ブロック毎の量子化ステップを MB_Q_scale とするとき、
MB_Q_scale (( 中央得点−ブロック毎の評価値 ) * 変動幅 ( 評価値の正規化値 )) ベース Q_scale
の式により上記ブロック毎の量子化ステップを求め、
上記量子化工程は、上記量子化ステップ制御工程で予測された量子化ステップを用いて上記直交変換係数を量子化することを特徴とする画像符号化方法。
An image data storage process for storing a plurality of input image data;
A plurality of pieces of image data stored in the image data storage means are each divided into blocks, and a first parameter indicating the information amount of the image itself and a motion vector for detecting the information amount of the input image data are detected. The second parameter indicating the difference information amount of the image calculated using the sum in the block from the minimum error of the luminance information and the minimum error of the color difference information from which the motion vector is detected, and image information for image counting are output. Image information evaluation process;
An orthogonal transform process for performing orthogonal transform processing on image data and generating orthogonal transform coefficients;
A quantization step of quantizing the orthogonal transformation coefficient generated by the orthogonal transformation step in a predetermined quantization step;
Based on the parameter representing the amount of information for each block obtained by the image information evaluation step, either one of the compression methods with a small amount of data after intraframe coding compression and a small amount of data after interframe predictive coding compression is used. A compression method selection step to select;
One of the first and second parameters is added according to the planned compressed data amount obtained by compressing the image data for one screen by the compression method selected in the compression method selection step and the macroblock type. A basic quantization step prediction step for predicting a basic quantization step at the time of quantization in the quantization means from the degree of difficulty obtained by summing up the screens ;
The evaluation value of the information amount for each block obtained by the image information evaluation step is normalized with a predetermined maximum value as an upper limit , and the center of the normalized value given according to the value of the basic quantization step A quantization step control step for predicting a quantization step for each block according to a value and a fluctuation range,
In the quantization step control step, when the scheduled compressed data amount of the image data for the one screen is allocated_bit , the difficulty is difficulty , and the basic quantization step is a base Q_scale , a predetermined parameter A, Using B,
Base Q_scale = exp ((log (allocated_bit / difficulty) -B) / A)
The above basic quantization step is obtained by
Further, the quantization step control step uses a median score of the evaluation values for each macroblock as a central score, and a quantization step for each block as MB_Q_scale ,
MB_Q_scale = (( central score-evaluation value for each block ) * fluctuation range / ( Evaluation value normalized value )) + Base Q_scale
The quantization step for each block is obtained by the equation
The said quantization process quantizes the said orthogonal transformation coefficient using the quantization step estimated at the said quantization step control process, The image coding method characterized by the above-mentioned.
JP23811294A 1994-09-30 1994-09-30 Image coding apparatus and image coding method Expired - Fee Related JP3711573B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23811294A JP3711573B2 (en) 1994-09-30 1994-09-30 Image coding apparatus and image coding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23811294A JP3711573B2 (en) 1994-09-30 1994-09-30 Image coding apparatus and image coding method

Publications (2)

Publication Number Publication Date
JPH08102946A JPH08102946A (en) 1996-04-16
JP3711573B2 true JP3711573B2 (en) 2005-11-02

Family

ID=17025359

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23811294A Expired - Fee Related JP3711573B2 (en) 1994-09-30 1994-09-30 Image coding apparatus and image coding method

Country Status (1)

Country Link
JP (1) JP3711573B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6373033B2 (en) * 2014-03-28 2018-08-15 キヤノン株式会社 Encoding apparatus and encoding method
KR102535825B1 (en) 2015-06-03 2023-05-23 삼성전자주식회사 System On Chip and Operating Method of System On Chip
JP7020068B2 (en) * 2017-11-16 2022-02-16 日本電気株式会社 Video coding device, video coding method, and program

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2516082B2 (en) * 1990-03-19 1996-07-10 日本ビクター株式会社 Data compression device
JP2587534B2 (en) * 1990-11-09 1997-03-05 シャープ株式会社 Image coding device
JP2611555B2 (en) * 1991-03-08 1997-05-21 三菱電機株式会社 Video encoding device
JPH04336894A (en) * 1991-05-14 1992-11-25 Oki Electric Ind Co Ltd Moving picture coder
JPH0541860A (en) * 1991-08-05 1993-02-19 Oki Electric Ind Co Ltd Picture compression coder
JPH05344493A (en) * 1992-06-10 1993-12-24 Victor Co Of Japan Ltd Dynamic image coder

Also Published As

Publication number Publication date
JPH08102946A (en) 1996-04-16

Similar Documents

Publication Publication Date Title
JP3954656B2 (en) Image coding apparatus and method
US7593462B2 (en) Moving picture encoding system
KR100860147B1 (en) Image encoding method, device thereof, and control program thereof
KR100471956B1 (en) Moving picture encoding apparatus and method
JP3755155B2 (en) Image encoding device
JPH0898185A (en) Picture encoding device
JPH0974565A (en) Controller for video signal coding system
JP3259702B2 (en) Moving picture variable bit rate coding apparatus and method
JP4257655B2 (en) Video encoding device
JP3508916B2 (en) Moving image variable bit rate encoding method and apparatus
JP3480067B2 (en) Image coding apparatus and method
US8792562B2 (en) Moving image encoding apparatus and method for controlling the same
JP3450384B2 (en) Video encoding device
JP3173369B2 (en) Image compression coding device
KR100708182B1 (en) Rate control apparatus and method in video encoder
JPH07264595A (en) Source coding method of picture
JP3711573B2 (en) Image coding apparatus and image coding method
JP3711572B2 (en) Image coding apparatus and method
JP3888533B2 (en) Image coding apparatus according to image characteristics
JP3812269B2 (en) Video encoding apparatus and method
JP2001238215A (en) Moving picture coding apparatus and its method
JP5171658B2 (en) Image encoding device
JP4676513B2 (en) Encoded picture type determination method, apparatus, program thereof, and recording medium thereof
JP2894335B2 (en) Image encoding device, method, and recording medium recording program
KR20090037288A (en) Method for real-time scene-change detection for rate control of video encoder, method for enhancing qulity of video telecommunication using the same, and system for the video telecommunication

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040601

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040608

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040809

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20041026

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041227

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20050117

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050726

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050808

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

Free format text: PAYMENT UNTIL: 20080826

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090826

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees