JP2005012527A - Encoding device, encoding program, and encoding method - Google Patents

Encoding device, encoding program, and encoding method Download PDF

Info

Publication number
JP2005012527A
JP2005012527A JP2003174771A JP2003174771A JP2005012527A JP 2005012527 A JP2005012527 A JP 2005012527A JP 2003174771 A JP2003174771 A JP 2003174771A JP 2003174771 A JP2003174771 A JP 2003174771A JP 2005012527 A JP2005012527 A JP 2005012527A
Authority
JP
Japan
Prior art keywords
macroblock
motion vector
image
motion
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003174771A
Other languages
Japanese (ja)
Inventor
Shinichi Sakaida
慎一 境田
Masahide Naemura
昌秀 苗村
Kazuhisa Iguchi
和久 井口
Makoto Ikeda
誠 池田
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.)
Japan Broadcasting Corp
Original Assignee
Nippon Hoso Kyokai NHK
Japan Broadcasting 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 Nippon Hoso Kyokai NHK, Japan Broadcasting Corp filed Critical Nippon Hoso Kyokai NHK
Priority to JP2003174771A priority Critical patent/JP2005012527A/en
Publication of JP2005012527A publication Critical patent/JP2005012527A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an encoding device, a program and a method thereof which can improve encoding efficiency even if motion compensation prediction is performed per conventional macroblock and can perform transcoding from a conventional method of capable of dividing macroblock into a method of not capable of dividing macroblock, without changing an encoding system such as MPEG-1 or MPEG-2 which have already been completely standardized. <P>SOLUTION: The encoding device 1 performs motion compensation prediction per block of an original image included in a dynamic image and compression-encodes the dynamic image. The device 1 is provided with a macroblock motion vector retrieving section 3, a macroblock dividing section 5, a divided block accumulating/successively outputing section 7, a divided block motion vector retrieval 9, a reference image accumulating section 11, a motion vector accumulating section 13, a macroblock motion compensating section 15, a motion compensation macroblock accumulating section 17, and a macroblock image comparing section 19. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、動画像処理に係り、特に、動画像に含まれる原画像をブロックに分割して動き補償予測を利用して圧縮符号化する符号化装置、符号化方法および符号化プログラムに関する。
【0002】
【従来の技術】
従来、動画像の圧縮符号化の方式は、ISO/IEC JTC1/SC29/WG11(MPEG)で規格化されたMPEG−1,2,4(それぞれISO/IEC 11172−2、ISO/IEC 13818−2、ISO/IEC 14496−2に対応している)や、ITU−Tで勧告されたH.261,263や、JVT(Joint Video Team(MPEG−4 part10 AVC[ISO/IEC 14496−10]/ITU−T H.264))といった規格がある。この動画像の圧縮符号化の処理は、動画像に含まれる原画像(画像)をブロックと呼ばれる所定の領域に分割し、この分割したブロックを単位にして動き補償予測やDCT変換処理を施すものである(例えば、非特許文献1および2参照)。
【0003】
動き補償予測の場合、圧縮符号化の処理の単位となるブロックの大きさは、MPEG−1、MPEG−2の方式では、マクロブロックと呼ばれる水平16画素×垂直16ラインである。このマクロブロック1つに対して、水平方向と垂直方向の2つの成分から動きベクトル1つが割り当てられている。
【0004】
ここで、図5に示すブロックの模式図を参照して、各圧縮符号化の処理について説明する。
図5(a)は、MPEG−1やMPEG−2のようにマクロブロックを単位とする動き補償予測の場合の動きベクトルの割り当て処理を模式的に示しており、この図5(a)に示すように、動き補償予測の場合の動きベクトルの割り当て処理は、マクロブロックを処理の単位とし、このマクロブロック内の画素が全て同一の動きベクトルで代表されるとする。そして、この動きベクトルの方向と移動量とによって当該マクロブロック内の画素も平行移動しているという動きモデルを仮定して、動画像を処理するものである。
【0005】
また、MPEG−4やITU−T H.263方式では、マクロブロック単位で動き補償予測を行う他に、図5(b)に示すように、水平8画素×垂直8ラインの大きさのブロック(小ブロック)単位で動き補償を行うモード(8×8モードとする)が備えられている。この8×8モードを用いた場合、水平16画素×垂直16ラインのマクロブロック内に複数の動きが存在する際に、マクロブロック1つに対して1つの動きベクトルを割り当てるよりも、実際の動きに近似した動きベクトルを得ることが可能である。
【0006】
この8×8モードの場合、動き補償予測を行うブロック単位をマクロブックにするか、小ブロックにするかを示すフラグを立てる(判別信号を出力する)ことによって、符号化した動画像を復号する復号処理時に判別できるように構成されている。ただし、小ブロックに分割する場合には、1つのマクロブロックに対して4つの小ブロックが存在するので、動きベクトルの数は、小ブロック毎に1つずつ存在し、1つのマクロブロックでは、4つ存在することになる。
【0007】
また、JVT方式では、マクロブロックの水平16画素×垂直16ラインおよび小ブロックの水平8画素×垂直8ラインの大きさの正方形のブロックの他に、図5(c)、(d)に示すように、水平16画素×垂直8ライン、水平8画素×垂直16ラインのような長方形のブロックや、図5(e)、(f)に示すように、マクロブロックを水平8画素×垂直8ラインの大きさの4つに分割したブロックや、さらにこの水平8画素×垂直8ラインの大きさのブロックを、図5(g)〜(i)に示すように、水平8画素×垂直4ライン、水平4画素×垂直8ライン、水平4画素×垂直4ラインの大きさに分割したブロックで動き補償予測を行うことも可能な構成となっている。
【0008】
なお、JTV方式の場合、水平16画素×垂直16ラインのマクロブロックをどのような大きさのブロックに分割するのかを示すフラグが多く必要になる。
【0009】
また、例えば、水平16画素×垂直16ラインのマクロブロックを、水平16画素×垂直8ラインの長方形のブロックの2つに分割した場合には、1つのマクロブロックに2つの動きベクトルが存在することになり、動きベクトルの数は、マクロブロックを4つの正方形のブロックに分割した場合よりも少なくなる。
【0010】
ところで、これら圧縮符号化の各方式では、図6に示すように、マクロブロック、或いは、このマクロブロックを分割した小ブロック毎に推定される動きベクトルMV(X)は、1つのブロック内、図6中の処理対象ブロックX内で符号化されるのではなく、隣接するブロックであるA、B、C、Dにおける動きベクトルMV(A)、MV(B)、MV(C)、MV(D)が近似していることを利用して、隣接するブロック間で動きベクトルの差分(dMV(X))をとり、この差分(dMV(X))を用いて符号化される場合が多い。このため、隣接するブロック間で動きベクトルの方向や大きさが近似しているほど符号化後に発生する情報量(符号化情報量)は小さくなる。なお、この図6において、破線で囲んでいる部分が一つのフレームを示している。また、処理対象ブロックXは、このフレームの任意の位置にあるものであり、この図6では図示を省略したが、通常、この処理対象ブロックXを囲むブロック(隣接するブロック)を全て利用する必要がある。
【0011】
【非特許文献1】
加藤禎篤 他著「ブロック単位境界モデルに基づく動き補償:H.26L予測方式に精緻化」電子情報通信学会大会予稿集、2002年3月29日、pp401−pp402
【非特許文献2】
木村青司 他著「可変サイズ可変形状ブロックに基づいた動き補償方式」電子情報通信学会論文誌、1997年2月 pp434−pp443
【0012】
【発明が解決しようとする課題】
しかしながら、動画像に含まれる各原画像のブロック単位で動き補償予測を行う従来の圧縮符号化の方式では、以下に示す問題がある。
MPEG−1やMPEG−2規格のように、水平16画素×垂直16ラインのマクロブロックを単位として動き補償予測を行う場合、図7(a)に示すように、マクロブロックの中に複数の異なる動き(被写体の動き)があると、正しい動きベクトルが予測できない場合がある。この例のように、動きベクトルの予測が正しくできない場合、予測値(動き補償予測した画像)と元々の原画像との差分(差分信号)が大きくなってしまい、符号化効率が低下してしまうという問題がある。特に低ビットレートで、動画像を符号化する場合、差分信号に割り当てる情報量が削減されてしまうため、正確ではない動きベクトルが作成される可能性が高くなり、当該動きベクトルを用いて復号した際に、原画像とは全く異なる復号画像が生成されてしまう恐れがある。
【0013】
また、正確ではない動きベクトルが予測できないことが別の手段(例えば、動きベクトルの信頼度を利用、例えば[金子豊 他著「輝度勾配ベクトル分布による動き推定の精度向上」電子情報通信学会 信学技報 1996年5月17日 pp17〜pp24を参照)で判明した場合、エンコーダ(符号化装置)によっては、強制的に動きベクトルを0にしてしまう場合がある。こういった場合、動きベクトルが予測できないマクロブロックについては、画面内符号化、すなわち、イントラブロック符号化によって処理されることになる。なお、イントラブロック符号化では、マクロブロックの動きベクトルを求める必要が無く、代わりに、マクロブロック全体のテクスチャの情報が必要となる。この結果、イントラブロック符号化は、画面間符号化、すなわち、インターブロック符号化よりも符号化効率が悪くなってしまう場合もある。
【0014】
このように、マクロブロックを単位として処理すると、動きベクトルが予測できない場合、マクロブロックを小ブロックに分割して、この小ブロックを単位にして動き補償予測を行えば、図7(b)に示すように、当該小ブロック(マクロブロックを2分割した水平8画素×垂直16ラインの小ブロック)の単位で、実際の動きに近い動きベクトルを推定できる可能性がある。
【0015】
しかし、MPEG−1やMPEG−2のように、規格が定まっている場合、規格上、マクロブロック毎に1つの動きベクトルを割り当てることになっているので、当該規格に準じたままでは、マクロブロックを分割した小ブロック毎の動きベクトルを導入できないという問題がある。
【0016】
また、各種の符号化方式で作成した符号化ストリームを別の符号化方式の符号化ストリームに変換する、いわゆるトランスコーディングの必要性があり、実際に符号化ストリームを取り扱う上で頻繁に起こりうる。しかしながら、MPEG−4やJVT方式では、マクロブロック当たり複数個の動きベクトルを備えることが可能であるが、MPEG−1やMPEG−2では、マクロブロック当たり1つの動きベクトルしか備えることができないので、単純に動きベクトルを置き換えることができないという問題がある。
【0017】
そこで、本発明の目的は前記した従来の技術が有する課題を解消し、既に規格化が完了しているMPEG−1やMPEG−2のような符号化方式の変更を行うことなく、従来のマクロブロックの単位で動き補償予測をおこなっても符号化効率を向上させることができ、また、符号化ストリームを取り扱う上で、マクロブロック当たり複数個の動きベクトルに対応する方式(MPEG−4やJVT方式)からマクロブロック当たり1つの動きベクトルに対応する方式(MPEG−1やMPEG−2)にトランスコーディング(変換)することができる符号化装置、符号化プログラムおよび符号化方法を提供することにある。
【0018】
【課題を解決するための手段】
本発明は、前記した目的を達成するため、以下に示す構成とした。
請求項1記載の符号化装置は、動画像に含まれている原画像のブロックの単位で動き補償予測を行って、当該動画像を圧縮符号化する符号化装置であって、マクロブロック動きベクトル探索手段と、マクロブロック分割手段と、分割ブロック動きベクトル探索手段と、マクロブロック動き補償手段と、マクロブロック画像比較手段と、を備える構成とした。
【0019】
かかる構成によれば、符号化装置は、マクロブロック動きベクトル探索手段によって、原画像が分割されたマクロブロックの動きベクトルであるマクロブロック動きベクトルを、原画像の直前のフレームである参照画像に基づいて探索する。なお、マクロブロックは一つの原画像の一つのフレームにおける水平16画素×垂直16ラインの領域のことである。マクロブロック動きベクトルは、マクロブロック内に含まれている被写体の動き、つまり、直前のフレーム(参照画像)から現在のフレーム(原画像)におけるマクロブロック内の画素の移動を、ベクトル(移動方向[矢印の向き]と移動量[矢印の長さ])で表現したものである。
【0020】
続いて、この符号化装置は、マクロブロック分割手段によって、マクロブロックを、当該マクロブロックよりも小さい(狭い)ブロックである小ブロックに分割し、この小ブロックの動きベクトルである小ブロック動きベクトルを、分割ブロック動きベクトル探索手段によって、参照画像に基づいて探索する。
【0021】
そして、この符号化装置は、マクロブロック動き補償手段によって、マクロブロック動きベクトルと、小ブロック動きベクトルと、参照画像とに基づいて、動き補償画像を作成する。この動き補償画像は、動き補償した際のマクロブロック動きベクトルに基づいて直前のフレームの画像をコピーしたものと、小ブロック動きベクトルに基づいて直前のフレームの画像をコピーしたものである。
【0022】
その後、この符号化装置は、マクロブロック画像比較手段によって、マクロブロック動き補償手段で作成された動き補償画像と、マクロブロックとを比較した結果に基づいて、符号化効率が最良となる動きベクトルを選択する。なお、この動きベクトルが求められた後、量子化等の処理を経て、動画像が圧縮符号化される。
【0023】
つまり、この符号化装置は、マクロブロック分割手段で分割した小ブロックの動き補償予測をマクロブロック動き補償手段で行って、マクロブロック画像比較手段によって、小ブロックの動きベクトル中で最も実際の動きに適している(符号化効率が最良となる)ものをマクロブロックの動きベクトルとすることによって、従来の方法(MPEG−1、MPEG−2)のように、小ブロック毎に見るとマクロブロックの動きベクトルが誤っていた(合致しない)としても、1つのマクロブロックに1つの動きベクトルを割り当ててしまう場合(図7)と比べて、図3に示すように、マクロブロック全体で見ると動きベクトルが実際の動き(領域に合った動き)に近づくようになる。すなわち、この符号化装置は、MPEG−1、MPEG−2の方式の範囲内で、マクロブロックの動きベクトルが小ブロックの動きベクトルに対応していない場合に、小ブロックに分割した際の動きベクトルをマクロブロックの動きベクトルとして代用させている。
【0024】
請求項2記載の符号化装置は、請求項1に記載の符号化装置において、前記マクロブロック動きベクトル探索手段または前記分割ブロック動きベクトル探索手段は、前記マクロブロック動きベクトル探索手段でマクロブロック動きベクトルを探索する際、或いは、前記分割ブロック動きベクトル探索手段で小ブロック動きベクトルを探索する際に、前記マクロブロックと前記参照画像の該当するブロックとの誤差の平均値および誤差の分散、または前記小ブロックと前記参照画像の該当するブロックとの誤差の平均値および誤差の分散、を最小とするものを探索することを特徴とする。
【0025】
かかる構成によれば、符号化装置は、マクロブロック動きベクトル探索手段、分割ブロック動きベクトル探索手段によって、動きベクトルを探索する際に、マクロブロックと参照画像の該当するブロック(マクロブロック)との誤差の平均値の最小値および誤差の分散の最小値、小ブロックと参照画像の該当するブロック(小ブロック)との誤差の平均値の最小値および誤差の分散の最小値を探索するので、従来、ブロック内全体の誤差の平均値のみを評価して動きベクトルを探索しているのに比べ、より正確に動きベクトルを探索することができる。なお、マクロブロック、小ブロックを含んでいる原画像は現在のフレームであり、参照画像はその直前のフレームである。
【0026】
請求項3記載の符号化装置は、請求項1または請求項2に記載の符号化装置において、前記マクロブロック動き補償手段で、前記マクロブロックと前記参照画像の該当するブロックとの誤差の計算と、前記小ブロックと前記参照画像の該当するブロックとの誤差の計算とを、別々の閾値を使用して行うことを特徴とする。
【0027】
かかる構成によれば、符号化装置は、マクロブロック動き補償手段によって、マクロブロック動きベクトルと参照画像とにより動き補償画像を求める際の閾値(判断基準)と、小ブロック動きベクトルと参照画像とにより動き補償画像を求める閾値(判断基準)とを別々にすること、つまり、判断基準となる閾値を変更することによって、同じ動き予測誤差の場合、例えば、小ブロックの動きベクトルがマクロブロック画像比較手段によって選択されるようにしておけば、符号化後に復号した際の当該小ブロックの部分の画質を向上させることができる。
【0028】
請求項4記載の符号化装置は、請求項1から請求項3のいずれか一項に記載の符号化装置において、前記マクロブロック画像比較手段で選択され、動きベクトルを求めた前記小ブロックの画質を判断基準にして、前記マクロブロック動き補償手段で作成された動き補償画像と前記原画像との誤差である誤差信号の符号化割り当てを制御する符号化割当制御手段を備えたことを特徴とする。
【0029】
かかる構成によれば、符号化装置は、符号化割当制御手段によって、マクロブロック画像比較手段によって動きベクトルを求めた小ブロックの画質を判断基準にして、動き補償画像と原画像との誤差である誤差信号の符号化割り当てを制御する。例えば、この符号化割当制御手段によって、動きベクトルを求めた小ブロックについて、誤差信号の符号化割り当てを大きくすれば、その部分の画質を向上させることができ、逆に、この小ブロックだけではなく、マクロブロック全体の画質を向上させたいのであれば、動きベクトルを求めた小ブロックについては、当該動きベクトルのみである程度、画像が再構成されているとし、マクロブロック中の残りの小ブロックに符号化割り当てを多くするように制御する。
【0030】
請求項5記載の符号化プログラムは、動画像に含まれている原画像のブロックの単位で動き補償予測を行って、当該動画像を圧縮符号化する装置を、マクロブロック動きベクトル探索手段、マクロブロック分割手段、分割ブロック動きベクトル探索手段、マクロブロック動き補償手段、マクロブロック画像比較手段、として機能させる構成とした。
【0031】
かかる構成によれば、符号化プログラムは、マクロブロック動きベクトル探索手段によって、原画像が分割されたマクロブロックの動きベクトルであるマクロブロック動きベクトルを、原画像の直前のフレームである参照画像に基づいて探索する。続いて、この符号化プログラムは、マクロブロック分割手段によって、マクロブロックを、当該マクロブロックよりも小さい(狭い)ブロックである小ブロックに分割し、この小ブロックの動きベクトルである小ブロック動きベクトルを、分割ブロック動きベクトル探索手段によって、参照画像に基づいて探索する。
【0032】
そして、この符号化プログラムは、マクロブロック動き補償手段によって、マクロブロック動きベクトルと、小ブロック動きベクトルと、参照画像とに基づいて、動き補償画像を作成し、マクロブロック画像比較手段によって、マクロブロック動き補償手段で作成された動き補償画像と、マクロブロックとを比較した結果に基づいて、符号化効率が最良となる動きベクトルを選択する。
【0033】
請求項6記載の符号化方法は、動画像に含まれている原画像のブロックの単位で動き補償予測を行って、当該動画像を圧縮符号化する符号化方法であって、マクロブロック動きベクトル探索ステップと、マクロブロック分割ステップと、分割ブロック動きベクトル探索ステップと、マクロブロック動き補償ステップと、マクロブロック画像比較ステップと、を含む手順とした。
【0034】
かかる手順によれば、符号化方法は、マクロブロック動きベクトル探索ステップにおいて、原画像が分割されたマクロブロックの動きベクトルであるマクロブロック動きベクトルを、原画像の直前のフレームである参照画像に基づいて探索する。続いて、この符号化方法は、マクロブロック分割ステップにおいて、マクロブロックを、当該マクロブロックよりも小さい(狭い)ブロックである小ブロックに分割し、この小ブロックの動きベクトルである小ブロック動きベクトルを、分割ブロック動きベクトル探索ステップにおいて、参照画像に基づいて探索する。
【0035】
そして、この符号化方法は、マクロブロック動き補償ステップにおいて、マクロブロック動きベクトルと、小ブロック動きベクトルと、参照画像とに基づいて、動き補償画像を作成し、マクロブロック画像比較ステップにおいて、マクロブロック動き補償ステップにて作成された動き補償画像と、マクロブロックとを比較した結果に基づいて、符号化効率が最良となる動きベクトルを選択する。
【0036】
【発明の実施の形態】
以下、本発明の一実施の形態について、図面を参照して詳細に説明する。
(符号化装置の構成)
図1に符号化装置のブロック図を示す。この図1に示すように、符号化装置1は、動画像に含まれている原画像の一つのフレームのマクロブロック信号(マクロブロック)を入力として、当該動画像を最適な符号化効率で圧縮符号化するために、マクロブロックの動きベクトルと、当該マクロブロックを分割した小ブロックの動きベクトルとを比較して求める(出力させる)もので、マクロブロック動きベクトル探索部3と、マクロブロック分割部5と、分割ブロック蓄積逐次出力部7と、分割ブロック動きベクトル探索部9と、参照画像蓄積部11と、動きベクトル蓄積部13と、マクロブロック動き補償部15と、動き補償マクロブロック蓄積部17と、マクロブロック画像比較部19とを備えている。
【0037】
なお、この符号化装置1は、MPEG−1やMPEG−2のように、1つのマクロブロックに1つの動きベクトルが割り当てられる方式において、MPEG−4の4つの動きベクトルや、JVT方式の複数の動きベクトルが割り当てられる方式の考え方を導入したものであるといえる。
【0038】
マクロブロック動きベクトル探索部3(マクロブロック動き探索手段)は、入力されたマクロブロック信号(マクロブロック)の動きベクトルを参照画像蓄積部11に蓄積されている参照画像信号(参照画像、一つ前のフレームの原画像)を参照することによって、動きベクトルを探索するものである。つまり、このマクロブロック動きベクトル探索部3は、マクロブロックの領域(水平16画素×垂直16ラインの正方形)に含まれている画素の配置(現フレーム画素配置)から、一つ前のフレームの中でほぼ合致する画素の配置(直前フレーム画素配置)を探索して、この直前フレーム画素配置の各画素から現フレーム画素配置の各画素までを結んだベクトルをマクロブロック動きベクトル(マクロブロック動きベクトル信号)として、動きベクトル蓄積部13に出力するものである。
【0039】
この実施の形態では、このマクロブロック動きベクトル探索部3は、MPEG−1やMPEG−2で従来用いられているブロックマッチング法によって、1つのマクロブロックに対して、1つの動きベクトルを探索する。
【0040】
マクロブロック分割部5(マクロブロック分割手段)は、マクロブロックを小ブロックに分割するものである。この実施の形態では、4つの動きベクトルを割り当てるMPEG−4と、多くの動きベクトルを割り当てるJVT方式との双方を利用することができる。MPEG−4の場合、水平16画素×垂直16ラインのマクロブロックを水平8画素×垂直8ラインの4つの小ブロックに分割することができる。また、JVT方式の場合、水平16画素×垂直16ラインのマクロブロックを、水平16画素×垂直16ラインのままにする他に、水平16画素×垂直8ラインの2つの小ブロックに分割するか、水平16画素×垂直16ラインのマクロブロックを水平8画素×垂直16ラインの2つの小ブロックに分割するか、水平16画素×垂直16ラインのマクロブロックを水平8画素×垂直8ラインの4つの小ブロックに分割することができる。
【0041】
なお、このJVT方式の場合、水平8画素×垂直8ラインの小ブロックを、水平8画素×垂直8ラインのままにする他にさらに、水平8画素×垂直4ラインの2つの小ブロックに分割するか、水平8画素×垂直8ラインの小ブロックを水平4画素×垂直8ラインの2つの小ブロックに分割するか、水平8画素×垂直8ラインの小ブロックを水平4画素×垂直4ラインの4つの小ブロックに分割することができる。
【0042】
分割ブロック蓄積逐次出力部7は、マクロブロック分割部5で分割された小ブロックを蓄積すると共に、逐次、蓄積した分割ブロック信号(小ブロック)を分割ブロック動きベクトル探索部9に出力するものである。例えば、この分割ブロック蓄積逐次出力部7から小ブロックを逐次(順番に)出力するタイミングは、分割ブロック動きベクトル探索部9に入力された小ブロックの動きベクトルが探索された直後である。
【0043】
分割ブロック動きベクトル探索部9(分割ブロック動きベクトル探索手段)は、入力された分割ブロック信号(小ブロック)毎の動きベクトルを参照画像蓄積部11に蓄積されている参照画像信号(参照画像、一つ前のフレームの原画像)を参照することによって、動きベクトルを探索するものである。つまり、この分割ブロック動きベクトル探索部9は、小ブロックの領域に含まれている画素の配置(現フレーム画素配置)から、一つ前のフレームの中でほぼ合致する画素の配置(直前フレーム画素配置)を探索して、この直前フレーム画素配置の各画素から現フレーム画素配置の各画素までを結んだベクトルを小ブロック動きベクトル(分割ブロック動きベクトル信号)として、動きベクトル蓄積部13に出力するものである。
【0044】
ここで、マクロブロック動きベクトル探索部3と、分割ブロック動きベクトル探索部9とにおける動きベクトル(マクロブロック動きベクトル、小ブロック動きベクトル)の探索の仕方について、さらに詳細に説明する。
【0045】
これらマクロブロック動きベクトル探索部3と、分割ブロック動きベクトル探索部9とにおいて、動きベクトルの探索に用いられるブロックマッチング法では、例えば、水平8画素×垂直8ラインといった所定の大きさのブロック毎に、当該ブロック内の処理対象画像(画素)と、参照画像(画素)との間で差分の絶対値や二乗誤差の平均値を計算している。そして、この平均値が最小となる参照画像の箇所(ブロック)から処理対象画像まで平行移動ベクトルを求め、この平行移動ベクトルを動きベクトルとしている。
【0046】
なお、この実施の形態では、誤差の平均値の最小となる動きベクトルを求めている。通常、ブロック(マクロブロック、小ブロック)内全体の誤差の平均値のみを評価しているので、ブロック全体で見ると誤差が同じであっても、実際にはある画素については誤差が大きく外れていたり、或いは、全体的に誤差が外れている傾向にあると、平均値だけでは、正確な動きベクトルを予測していると言えない場合が生じることがある。
【0047】
そこで、この実施の形態では、ブロック内の誤差の平均値の最小値を計算する方法の他に、ブロック間の誤差の分散を計算し、この誤差の分散が最小となるものを正確な動きベクトルとする方法を採用している。
【0048】
参照画像蓄積部11は、当該装置1に入力された動画像に含まれる各原画像を分割したマクロブロック信号よりも一つ前(直前)のフレームの原画像を参照画像として蓄積するものである。この参照画像蓄積部11は、通常、フレームメモリから構成されている。なお、この図1では、参照画像の入力経路を点線で図示しているように、現在フレームの直前のフレームの画像が入力されている。
【0049】
動きベクトル蓄積部13は、マクロブロック動きベクトル探索部3で探索されて出力されたマクロブロック動きベクトル信号(マクロブロック動きベクトル))と、分割ブロック動きベクトル探索部9で探索されて出力された分割ブロック動きベクトル信号(小ブロック動きベクトル)とを蓄積するものである。
【0050】
マクロブロック動き補償部15(マクロブロック動き補償手段)は、動きベクトル蓄積部13に蓄積されている動きベクトル信号(マクロブロック動きベクトル信号[マクロブロック動きベクトル]、分割ブロック動きベクトル信号[小ブロック動きベクトル])と、参照画像蓄積部11から出力(供給)される参照画像信号(参照画像)を用いて、マクロブロック毎の動き補償処理を行う、つまり、動き補償画像を作成するものである。この動き補償画像は、動きベクトルに基づいて、参照画像の該当する箇所をコピーしたものである。なお、このマクロブロック動き補償部15に入力される動きベクトル信号は、図5(a)〜(i)で示した複数の動きベクトルとなる。
【0051】
つまり、このマクロブロック動き補償部15では、マクロブロック単位で動き補償を行っており、小ブロック毎の動きベクトルを、該当する小ブロックだけではなく、図4に示すように、マクロブロック全体の動きベクトル、つまり、小ブロック毎の動きベクトルをマクロブロックの動きベクトルとみなして利用する。
【0052】
この図4(a)では、左上方の水平8画素×垂直8ラインの小ブロックの動きベクトル(分割ブロックの動きベクトル)を水平16画素×垂直16ラインのマクロブロックの動きベクトルとして利用している。図4(b)では、右上方の水平8画素×垂直8ラインの小ブロックの動きベクトル(分割ブロックの動きベクトル)を水平16画素×垂直16ラインのマクロブロックの動きベクトルとして利用している。図4(c)では、左下方の水平8画素×垂直8ラインの小ブロックの動きベクトル(分割ブロックの動きベクトル)を水平16画素×垂直16ラインのマクロブロックの動きベクトルとして利用している。図4(d)では、右下方の水平8画素×垂直8ラインの小ブロックの動きベクトル(分割ブロックの動きベクトル)を水平16画素×垂直16ラインのマクロブロックの動きベクトルとして利用している。
【0053】
この図4(a)〜(d)に示したように、マクロブロックを4つの小ブロックに分割して、そのうちの1つの小ブロックの動きベクトルをマクロブロックの動きベクトルとして代用させて、4通りの動き補償を行う(4つの動き補償画像を作成する)。なお、この他に、マクロブロックを2分割した場合には2通りの動き補償を行い(2つの動き補償画像を作成し)、3分割した場合には3通りの動き補償を行う(3つの動き補償画像を作成する)。
【0054】
また、動画像を低ビットレートで符号化する場合を想定すると、動き予測誤差信号(動き予測誤差)、すなわち、動きベクトルによって求めた動き補償画像(直前フレームである参照画像の一部をコピーしたもの)と、現フレームである原画像とを比較した際の誤差に割り当てる情報量が少なくなるので、当該動画像を符号化した後に復号する際に、動きベクトルのみで復号画像を再構成できるようにする仕組みが必要になる。小ブロック毎の動き予測補償の場合、小ブロック毎の動き予測誤差が小さくても、それよりもさらにマクロブロックの動き予測誤差が小さい場合、このマクロブロックの動き予測誤差が正しくなかったとしても選択されてしまう恐れが生じる。こういった場合には、動き予測誤差への情報量の割り当て情報量が少ないと画質が低下する。
【0055】
そこで、このマクロブロック動き補償部15では、小ブロック毎の動き予測誤差と、マクロブロックの動き予測誤差とを求める際の判定基準となる閾値を変更可能に構成されており、これによって、小ブロック毎の動き予測誤差と、マクロブロックの動き予想誤差とが同じになる場合には、マクロブロック画像比較部19において、小ブロックの動きベクトルが選択されるように構成されている。
【0056】
このようにすることによって、マクロブロックにおける小ブロック以外の部分の動き予測誤差は増大してしまうが、当該小ブロックの部分については画質を向上させることができる。なお、最も極端な例としては、小ブロックの部分について動き予測誤差が最小になった場合に、当該小ブロックの動きベクトルを選択すれば、当該小ブロックに関しては、動き予測誤差がなくても高画質を維持することができる。
【0057】
動き補償マクロブロック蓄積部17は、マクロブロック動き補償部15から出力された動き補償画像と、マクロブロックの動き予測誤差と、小ブロック毎の動き予測誤差とを動き補償マクロブロック信号として蓄積するものである。
【0058】
マクロブロック画像比較部19(マクロブロック画像比較手段)は、動き補償マクロブロック蓄積部17から出力された動き補償マクロブロック信号(動き補償画像、マクロブロックの動き予測誤差および小ブロック毎の動き予測誤差)と、マクロブロック信号(マクロブロック)とに基づいて、符号化効率が最良となる動きベクトルを選択し、最終マクロブロック動きベクトル信号として出力するものである。なお、このマクロブロック画像比較部19は、動きベクトルを求めた小ブロックの画質を判断基準にして、マクロブロック動き補償部15で作成された動き補償画像と原画像との誤差である誤差信号の符号化割り当てを制御する符号化割当制御手段(図示せず)を備えている。
【0059】
このマクロブロック画像比較部19において、符号化効率が最良となる動きベクトルの選択方法は、以下(1)と(2)がある。(1)動き補償マクロブロック信号(動き補償画像)とマクロブロック信号(マクロブロック)同士の差を比較し、最小となるものを選択する。(2)動き補償マクロブロック信号(動き補償画像)とマクロブロック信号(マクロブロック)同士の差を残差信号として符号化し、動きベクトル等の情報に基づいて、最終的なストリームにした状態で比較し、最小となるものを選択する。
【0060】
(2)の場合、動きベクトル(マクロブロック動きベクトル)の符号化の際には、この動きベクトルと、当該動きベクトルを求めたマクロブロックに隣接する隣接マクロブロックの動きベクトル(マクロブロック動きベクトル)との差分を計算する必要が生じ、マクロブロック内だけでは、処理が完結せず、隣接マクロブロックの影響を受けることになる。しかし、符号化装置1全体として(最終的に動画像の圧縮符号化を行う上で)、符号化効率がよくなるような評価を行うことが可能である。
【0061】
なお、この符号化装置1を、MPEG−4やJVT方式からMPEG−1やMPEG−2へのトランスコーディングに応用する場合には、マクロブロックがMPEG−4やJVT方式に対応した小ブロックに、マクロブロック分割部5で分割されており、分割ブロック動きベクトル探索部9で最適な動きベクトル(小ブロック動きベクトル)が求められているので、これらの小ブロック動きベクトルの中から1つを当該マクロブロックに適用するものを選択すればよいことになる。この選択をする際には、画質を重視する小ブロックがあれば、優先的に当該小ブロックの小ブロック動きベクトルを選択し、或いは、複数の動き小ブロック動きベクトルの多数決(合成)や平均値により決定することも可能である。
【0062】
また、符号化割当制御手段(図示せず)によって、動きベクトルが選択された小ブロックについては、動き予測誤差信号(動き予測誤差)の符号化割り当てを大きくすれば、さらに、その部分(小ブロック)のみの画質を向上させることができ、逆に、マクロブロック全体の画質を向上させたいのであれば、動きベクトルが選択された小ブロックについては、当該動きベクトルのみによって再構成画像(復号画像)ができるとして、マクロブロック中の残りの小ブロックに符号化割り当てを多くするように制御することができる。
【0063】
この符号化装置1によれば、マクロブロック動きベクトル探索部3によって、原画像が分割されたマクロブロックの動きベクトルであるマクロブロック動きベクトルが、原画像の直前のフレームである参照画像に基づいて探索され、マクロブロック分割部5によって、マクロブロックが、当該マクロブロックよりも小さい(狭い)ブロックである小ブロックに分割され、この小ブロックの動きベクトルである小ブロック動きベクトルが、分割ブロック動きベクトル探索部9によって、参照画像蓄積部11に蓄積されている参照画像に基づいて探索される。
【0064】
そして、マクロブロック動き補償部15によって、マクロブロック動きベクトルと、小ブロック動きベクトルと、参照画像とに基づいて、動き補償画像が作成され、マクロブロック画像比較部19によって、動き補償画像と、マクロブロックとを比較した結果に基づいて、符号化効率が最良となるマクロブロック動きベクトル(最終マクロブロック動きベクトル信号)が選択される。
【0065】
つまり、この符号化装置1は、マクロブロック分割部5で分割した小ブロックの動き補償予測をマクロブロック動き補償部15で行って、マクロブロック画像比較部19によって、小ブロックの動きベクトル中で最も実際の動きに適している(符号化効率が最良となる)ものをマクロブロックの動きベクトルとすることによって、従来の方法(MPEG−1、MPEG−2)のように、小ブロック毎に見るとマクロブロックの動きベクトルが誤っていた(合致しない)としても、1つのマクロブロックに1つの動きベクトルを割り当ててしまう場合と比べて、マクロブロック全体で見ると動きベクトルが実際の動き(領域に合った動き)に近づくようになる。
【0066】
このため、既に規格化が完了しているMPEG−1やMPEG−2のような符号化方式の変更を行うことなく、従来のマクロブロックの単位で動き補償予測をおこなっても符号化効率を向上させることができる。
【0067】
また、この符号化装置1によれば、MPEG−4やJVT方式に対応した小ブロックに、マクロブロック分割部5で分割されており、分割ブロック動きベクトル探索部9で最適な動きベクトル(小ブロック動きベクトル)が求められているので、これらの小ブロック動きベクトルの中から1つのマクロブロックに適用するものを選択すればよいことになり、符号化ストリームを取り扱う上で、マクロブロック当たり複数個の動きベクトルに対応する方式(MPEG−4やJVT方式)からマクロブロック当たり一つの動きベクトルに対応する方式(MPEG−1やMPEG−2)にトランスコーディング(変換)することができる。これによって、MPEG−4やJVT方式の符号化方式で作成した符号化ストリームを別の符号化方式、つまり、MPEG−1やMPEG−2の符号化ストリームに変換することができ、実際に符号化ストリームを取り扱う上での汎用性を向上させることができる。
【0068】
さらに、この符号化装置1によれば、マクロブロック動きベクトル探索部3、分割ブロック動きベクトル探索部9によって、動きベクトルを探索する際に、マクロブロックと参照画像の該当するブロック(マクロブロック)との誤差の平均値の最小値だけではなく、誤差の分散の最小値、小ブロックと参照画像の該当するブロック(小ブロック)との誤差の平均値の最小値だけではなく、誤差の分散の最小値も探索するので、従来、ブロック内全体の誤差の平均値のみを評価して動きベクトルを探索しているのに比べ、より正確に動きベクトルを探索することができる。
【0069】
そしてまた、この符号化装置1によれば、マクロブロック動き補償部15によって、マクロブロック動きベクトルと参照画像とにより動き補償画像を求める際の判断基準と、小ブロック動きベクトルと参照画像とにより動き補償画像を求める判断基準とを別々にすること、つまり、判断基準となる閾値を変更することによって、同じ動き予測誤差の場合、小ブロックの動きベクトルがマクロブロック画像比較部19によって選択されるようにしておけば、符号化後に復号した際の当該小ブロックの部分の画質を向上させることができる。
【0070】
そしてさらに、この符号化装置1によれば、符号化割当制御手段(図示せず)によって、マクロブロック画像比較部19にて動きベクトルを求めた小ブロックの画質を判断基準にして、動き補償画像と原画像との誤差である誤差信号の符号化割り当てを制御する。例えば、誤差信号の符号化割り当てを大きくすれば、その部分の画質を向上させることができ、逆に、動きベクトルを求めた小ブロックについては、当該動きベクトルのみである程度、画像が再構成されているとし、マクロブロック中の残りの小ブロックに符号化割り当てを多くするように制御して、この小ブロックだけではなく、マクロブロック全体の画質を向上させることができる。
【0071】
(符号化装置の動作)
次に、図2に示すフローチャートを参照して、符号化装置1の動作について説明する(適宜、図1参照)。
【0072】
まず、マクロブロック分割部5によって、符号化方式(MPEG−4、JVT方式)に準拠して、入力されたマクロブロック信号(マクロブロック)が、水平8画素×垂直8ライン、水平16画素×垂直8ライン、水平8画素×垂直16ライン等の小ブロックに分割される(S1)。続いて、分割ブロック動きベクトル探索部9によって、小ブロック単位の動きベクトルが探索される(S2)。また、図示を省略したが、入力されたマクロブロック信号がマクロブロック動き探索部3によって、マクロブロック単位の動きベクトルが探索される。
【0073】
すると、マクロブロック動き補償部15によって、マクロブロック単位の動き補償処理(動き補償予測)が行われ、動き補償画像と、マクロブロックの動き予測誤差(動き予測誤差信号)と、小ブロックの動き予測誤差(動き予測誤差信号)とが動き補償マクロブロック信号として、動き補償マクロブロック蓄積部17に出力される(S3)。そして、この動き補償マクロブロック信号とマクロブロック信号とがマクロブロック画像比較部19に出力される。
【0074】
すると、マクロブロック画像比較19によって、動き補償画像とマクロブロックとの誤差値が比較され、誤差値の小さい方が選択されて保持される(S4)。
【0075】
そして、分割ブロック動きベクトル探索部9によって探索された全ての小ブロック動きベクトルを、マクロブロックの動きベクトルとして割り当てた全ての組み合わせについて、S4の処理が終了したかどうかが判定される(S5)。全ての組み合わせについて終了したと判定されない場合(S5、No)、S2に戻って処理が実行され、全ての組み合わせについて終了したと判定された場合(S5、Yes)、最小の符号化情報量となる動きベクトル(最終マクロブロック動きベクトル信号)が出力される(S6)。
【0076】
以上、一実施形態に基づいて本発明を説明したが、本発明はこれに限定されるものではない。
例えば、符号化装置1の各構成の処理を一つずつの過程ととらえた符号化方法とみなすこともできるし、符号化装置1の各構成の処理を汎用的なコンピュータ言語で記述した符号化プログラムとみなすこともできる。これらの場合、符号化装置1と同様の効果を得ることができる。
【0077】
【発明の効果】
請求項1、5、6記載の発明によれば、分割した小ブロックの動き補償予測を行って、小ブロックの動きベクトル中で最も実際の動きに適しているものをマクロブロックの動きベクトルとすることによって、MPEG−1、MPEG−2のように、小ブロック毎に見るとマクロブロックの動きベクトルが誤っていたとしても、1つのマクロブロックに1つの動きベクトルを割り当ててしまう場合と比べて、マクロブロック全体で見ると動きベクトルが実際の動きに近づくようになる。このため、既に規格化が完了しているMPEG−1やMPEG−2のような符号化方式の変更を行うことなく、従来のマクロブロックの単位で動き補償予測をおこなっても符号化効率を向上させることができる。また、MPEG−4やJVT方式の符号化方式で作成した符号化ストリームを、別の符号化方式、つまり、MPEG−1やMPEG−2の符号化ストリームに変換することができ、実際に符号化ストリームを取り扱う上での汎用性を向上させることができる。
【0078】
請求項2記載の発明によれば、動きベクトルを探索する際に、マクロブロックと参照画像の該当するブロックとの誤差の平均値の最小値だけではなく、誤差の分散の最小値、小ブロックと参照画像の該当するブロックとの誤差の平均値の最小値だけではなく、誤差の分散の最小値も探索するので、従来、ブロック内全体の誤差の平均値のみを評価して動きベクトルを探索しているのに比べ、より正確に動きベクトルを探索することができる。
【0079】
請求項3記載の発明によれば、マクロブロック動きベクトルと参照画像とにより動き補償画像を求める際の判断基準と、小ブロック動きベクトルと参照画像とにより動き補償画像を求める判断基準とを別々にすること、つまり、判断基準となる閾値を変更することによって、同じ動き予測誤差の場合、小ブロックの動きベクトルがマクロブロック画像比較手段によって選択されるようにしておけば、符号化後に復号した際の当該小ブロックの部分の画質を向上させることができる。
【0080】
請求項4記載の発明によれば、動きベクトルを求めた小ブロックの画質を判断基準にして、動き補償画像と原画像との誤差である誤差信号の符号化割り当てを制御するので、例えば、誤差信号の符号化割り当てを大きくすれば、その部分の画質を向上させることができる。
【図面の簡単な説明】
【図1】本発明による一実施の形態である符号化装置のブロック図である。
【図2】図1に示した符号化装置の動作を説明したフローチャートである。
【図3】マクロブロックと動きベクトルとの関係を説明した図である。
【図4】小ブロック動きベクトルをマクロブロック動きベクトルとして割り当てた場合について説明した図である。
【図5】従来のマクロブロックの分割について説明した図である。
【図6】従来の動きベクトルの符号化について説明した図である。
【図7】マクロブロックと動きベクトルとの関係(従来)を説明した図である。
【符号の説明】
1 符号化装置
3 マクロブロック動きベクトル探索部(マクロブロック動きベクトル探索手段)
5 マクロブロック分割部(マクロブロック分割手段)
7 分割ブロック蓄積逐次出力部
9 分割ブロック動きベクトル探索部(分割ブロック動きベクトル探索手段)
11 参照画像蓄積部
13 動きベクトル蓄積部
15 マクロブロック動き補償部(マクロブロック動き補償手段)
17 動き補償マクロブロック蓄積部
19 マクロブロック画像比較部(マクロブロック画像比較手段)
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to moving image processing, and more particularly to an encoding device, an encoding method, and an encoding program that divide an original image included in a moving image into blocks and perform compression encoding using motion compensated prediction.
[0002]
[Prior art]
Conventionally, compression encoding methods for moving images are MPEG-1, 2, 4 (ISO / IEC 11172-2 and ISO / IEC 13818-2 respectively) standardized by ISO / IEC JTC1 / SC29 / WG11 (MPEG). , ISO / IEC 14496-2) and H.264 recommended by ITU-T. And JVT (Joint Video Team (MPEG-4 part 10 AVC [ISO / IEC 14496-10] / ITU-T H.264)). This compression coding processing of a moving image involves dividing an original image (image) included in the moving image into predetermined regions called blocks, and performing motion compensation prediction and DCT conversion processing in units of the divided blocks. (For example, see Non-Patent Documents 1 and 2).
[0003]
In the case of motion compensation prediction, the block size as a unit of compression encoding processing is 16 horizontal pixels × vertical 16 lines called macroblocks in the MPEG-1 and MPEG-2 systems. One motion vector is assigned to one macroblock from two components in the horizontal direction and the vertical direction.
[0004]
Here, each compression encoding process will be described with reference to a schematic block diagram shown in FIG.
FIG. 5A schematically shows a motion vector assignment process in the case of motion compensation prediction in units of macroblocks as in MPEG-1 and MPEG-2. As described above, in the motion vector allocation processing in the case of motion compensation prediction, a macroblock is used as a unit of processing, and all the pixels in the macroblock are represented by the same motion vector. Then, a moving image is processed assuming a motion model in which the pixels in the macroblock are also translated in accordance with the direction of the motion vector and the amount of movement.
[0005]
Also, MPEG-4 and ITU-T H.264. In the H.263 system, in addition to performing motion compensation prediction in units of macroblocks, as shown in FIG. 5B, a mode in which motion compensation is performed in units of blocks (small blocks) having a size of horizontal 8 pixels × vertical 8 lines ( 8 × 8 mode). When this 8 × 8 mode is used, when there are a plurality of motions in a macroblock of 16 horizontal pixels × 16 vertical lines, the actual motion is more than the case where one motion vector is assigned to one macroblock. Can be obtained.
[0006]
In the case of the 8 × 8 mode, the encoded moving image is decoded by setting a flag indicating whether the block unit for motion compensation prediction is a macro book or a small block (outputs a discrimination signal). It is configured to be able to discriminate during the decoding process. However, when dividing into small blocks, there are four small blocks for one macroblock, so the number of motion vectors is one for each small block. There will be one.
[0007]
In addition, in the JVT system, as shown in FIGS. 5C and 5D, in addition to a square block having a size of 16 horizontal macroblocks × 16 vertical lines for a macro block and 8 horizontal pixels × vertical 8 lines for a small block. In addition, a rectangular block such as horizontal 16 pixels × vertical 8 lines and horizontal 8 pixels × vertical 16 lines, or a macro block of horizontal 8 pixels × vertical 8 lines as shown in FIGS. As shown in FIGS. 5 (g) to 5 (i), a block divided into four sizes and a block having a size of horizontal 8 pixels × vertical 8 lines, horizontal 8 pixels × vertical 4 lines, horizontal It is also possible to perform motion compensation prediction with a block divided into a size of 4 pixels × vertical 8 lines and horizontal 4 pixels × vertical 4 lines.
[0008]
In the case of the JTV system, a large number of flags indicating what size block the macroblock of 16 horizontal pixels × 16 vertical lines is to be divided are required.
[0009]
For example, when a macro block of 16 horizontal pixels × vertical 16 lines is divided into two rectangular blocks of horizontal 16 pixels × vertical 8 lines, two motion vectors exist in one macro block. Thus, the number of motion vectors is smaller than when the macroblock is divided into four square blocks.
[0010]
By the way, in each of these compression encoding systems, as shown in FIG. 6, the motion vector MV (X) estimated for each macroblock or each small block obtained by dividing this macroblock is shown in one block, as shown in FIG. 6, motion vectors MV (A), MV (B), MV (C), and MV (D (D) in adjacent blocks A, B, C, and D are not encoded in the processing target block X. ) Is approximated, a motion vector difference (dMV (X)) is taken between adjacent blocks, and encoding is often performed using this difference (dMV (X)). For this reason, the amount of information (encoded information amount) generated after encoding becomes smaller as the direction and size of the motion vector are approximated between adjacent blocks. In FIG. 6, a portion surrounded by a broken line indicates one frame. Further, the processing target block X is located at an arbitrary position in this frame, and although not shown in FIG. 6, it is usually necessary to use all the blocks surrounding the processing target block X (adjacent blocks). There is.
[0011]
[Non-Patent Document 1]
Atsushi Kato et al. “Motion compensation based on block unit boundary model: refined to H.26L prediction method” IEICE Conference Proceedings, March 29, 2002, pp401-pp402
[Non-Patent Document 2]
Seiji Kimura et al. “Motion Compensation Method Based on Variable Size and Variable Shape Block” IEICE Transactions, February 1997 pp434-pp443
[0012]
[Problems to be solved by the invention]
However, the conventional compression coding method that performs motion compensation prediction in units of blocks of each original image included in a moving image has the following problems.
When motion compensation prediction is performed in units of macroblocks of horizontal 16 pixels × vertical 16 lines as in the MPEG-1 and MPEG-2 standards, a plurality of different macroblocks are used as shown in FIG. If there is a motion (subject motion), a correct motion vector may not be predicted. As in this example, when the motion vector cannot be predicted correctly, the difference (difference signal) between the predicted value (motion compensated predicted image) and the original original image becomes large, and the coding efficiency decreases. There is a problem. In particular, when a moving image is encoded at a low bit rate, the amount of information assigned to the difference signal is reduced, so that there is a high possibility that an inaccurate motion vector is created, and decoding is performed using the motion vector. At this time, there is a possibility that a decoded image completely different from the original image is generated.
[0013]
In addition, another means that an inaccurate motion vector cannot be predicted (for example, using the reliability of the motion vector, for example, [Toyo Kaneko et al., “Improvement of motion estimation accuracy by luminance gradient vector distribution”) IEICE Technical Report, May 17, 1996 (see pp17 to pp24)), depending on the encoder (encoding device), the motion vector may be forced to zero. In such a case, a macroblock whose motion vector cannot be predicted is processed by intra-frame coding, that is, intra-block coding. In intra-block coding, it is not necessary to obtain a motion vector of a macroblock, and instead, information on the texture of the entire macroblock is required. As a result, intra-block coding may be less efficient than inter-frame coding, that is, inter-block coding.
[0014]
In this way, when a motion vector cannot be predicted when processing is performed in units of macroblocks, if the macroblock is divided into small blocks and motion compensated prediction is performed in units of the small blocks, the result shown in FIG. Thus, there is a possibility that a motion vector close to the actual motion can be estimated in the unit of the small block (small block of horizontal 8 pixels × vertical 16 lines divided into two macroblocks).
[0015]
However, when a standard is established as in MPEG-1 or MPEG-2, one motion vector is assigned to each macroblock according to the standard. There is a problem that it is not possible to introduce a motion vector for each small block obtained by dividing.
[0016]
In addition, there is a need for so-called transcoding, in which an encoded stream created by various encoding methods is converted into an encoded stream of another encoding method, which may frequently occur when actually handling the encoded stream. However, in MPEG-4 and JVT systems, it is possible to provide a plurality of motion vectors per macroblock, but in MPEG-1 and MPEG-2, only one motion vector per macroblock can be provided. There is a problem that motion vectors cannot be simply replaced.
[0017]
Therefore, the object of the present invention is to solve the problems of the conventional techniques described above, and without changing the encoding method such as MPEG-1 or MPEG-2 that has already been standardized, Coding efficiency can be improved even if motion compensation prediction is performed in units of blocks, and a method corresponding to a plurality of motion vectors per macroblock (MPEG-4 or JVT method) in handling a coded stream. ) To an encoding device, an encoding program, and an encoding method that can be transcoded (converted) to a method (MPEG-1 or MPEG-2) corresponding to one motion vector per macroblock.
[0018]
[Means for Solving the Problems]
In order to achieve the above-described object, the present invention has the following configuration.
The encoding device according to claim 1 is an encoding device that performs motion compensation prediction in units of blocks of an original image included in a moving image, and compresses and encodes the moving image, and includes a macroblock motion vector. The configuration includes a search unit, a macroblock division unit, a divided block motion vector search unit, a macroblock motion compensation unit, and a macroblock image comparison unit.
[0019]
According to such a configuration, the encoding device uses the macroblock motion vector search means to calculate the macroblock motion vector that is the motion vector of the macroblock obtained by dividing the original image based on the reference image that is the frame immediately before the original image. To explore. A macroblock is an area of 16 horizontal pixels × 16 vertical lines in one frame of one original image. The macroblock motion vector is the motion of the subject included in the macroblock, that is, the movement of the pixel in the macroblock from the immediately preceding frame (reference image) to the current frame (original image). The direction of the arrow] and the amount of movement [the length of the arrow]).
[0020]
Subsequently, the encoding apparatus divides the macroblock into small blocks which are smaller (narrower) blocks than the macroblock by the macroblock dividing unit, and a small block motion vector which is a motion vector of the small block is obtained. Then, the divided block motion vector search means searches based on the reference image.
[0021]
Then, this encoding apparatus creates a motion compensated image based on the macroblock motion vector, the small block motion vector, and the reference image by the macroblock motion compensation means. This motion compensated image is a copy of the image of the immediately preceding frame based on the macroblock motion vector at the time of motion compensation, and a copy of the image of the immediately preceding frame based on the small block motion vector.
[0022]
Thereafter, the encoding apparatus calculates a motion vector that provides the best encoding efficiency based on the result of comparing the motion compensated image created by the macroblock motion compensation unit and the macroblock by the macroblock image comparison unit. select. Note that after the motion vector is obtained, the moving image is compressed and encoded through a process such as quantization.
[0023]
That is, this encoding apparatus performs motion compensation prediction of the small block divided by the macroblock dividing unit using the macroblock motion compensating unit, and the macroblock image comparing unit obtains the most actual motion among the small block motion vectors. By adopting a macroblock motion vector that is suitable (the coding efficiency is the best), the macroblock motion can be seen for each small block as in the conventional method (MPEG-1, MPEG-2). Even if the vector is incorrect (does not match), compared to the case where one motion vector is assigned to one macroblock (FIG. 7), as shown in FIG. It comes closer to the actual movement (movement suitable for the area). That is, this encoding apparatus is a motion vector obtained by dividing a macroblock into motion vectors when the motion vector of the macroblock does not correspond to the motion vector of the small block within the range of the MPEG-1 and MPEG-2 systems. Is substituted for the motion vector of the macroblock.
[0024]
The encoding device according to claim 2 is the encoding device according to claim 1, wherein the macroblock motion vector search means or the divided block motion vector search means is a macroblock motion vector search means. Or when searching for a small block motion vector by the divided block motion vector search means, an error average value and error variance between the macroblock and the corresponding block of the reference image, or the small block It is characterized in that a search is made for the one that minimizes the average error value and error variance between the block and the corresponding block of the reference image.
[0025]
According to such a configuration, when the encoding device searches for a motion vector by the macroblock motion vector search means and the divided block motion vector search means, an error between the macroblock and a corresponding block (macroblock) of the reference image is detected. Search for the minimum value of the average value and the minimum value of the error variance, the minimum value of the average value of the error between the small block and the corresponding block (small block) of the reference image, and the minimum value of the error variance. A motion vector can be searched more accurately than when a motion vector is searched by evaluating only the average value of errors in the entire block. The original image including the macro block and the small block is the current frame, and the reference image is the immediately preceding frame.
[0026]
According to a third aspect of the present invention, in the encoding device according to the first or second aspect, the macroblock motion compensation unit calculates an error between the macroblock and a corresponding block of the reference image. The calculation of the error between the small block and the corresponding block of the reference image is performed using different threshold values.
[0027]
According to such a configuration, the encoding device uses the threshold (determination criterion) when the motion compensation image is obtained from the macroblock motion vector and the reference image by the macroblock motion compensation means, and the small block motion vector and the reference image. In the case of the same motion prediction error by changing the threshold value (determination criterion) for obtaining the motion compensation image, that is, by changing the threshold value as the determination criterion, for example, the motion vector of the small block is a macroblock image comparison unit. If it is made to select by this, the image quality of the part of the said small block at the time of decoding after encoding can be improved.
[0028]
The encoding device according to claim 4 is the encoding device according to any one of claims 1 to 3, wherein the image quality of the small block that is selected by the macroblock image comparison unit and for which a motion vector is obtained. And a coding assignment control means for controlling the coding assignment of an error signal which is an error between the motion compensated image created by the macroblock motion compensation means and the original image. .
[0029]
According to such a configuration, the encoding apparatus is an error between the motion compensated image and the original image based on the image quality of the small block whose motion vector is obtained by the macroblock image comparison unit by the encoding allocation control unit. Control coding assignment of error signal. For example, if the coding allocation of the error signal is increased for a small block for which a motion vector is obtained by this coding allocation control means, the image quality of that portion can be improved. If it is desired to improve the image quality of the entire macroblock, regarding the small block for which the motion vector is obtained, the image is reconstructed to some extent only by the motion vector, and the remaining small blocks in the macroblock are encoded. Control to increase the number of allocations.
[0030]
An encoding program according to claim 5 is an apparatus for performing motion compensation prediction in units of blocks of an original image included in a moving image, and compressing and encoding the moving image as a macroblock motion vector search means, macro It is configured to function as block division means, divided block motion vector search means, macroblock motion compensation means, and macroblock image comparison means.
[0031]
According to this configuration, the encoding program uses the macroblock motion vector search unit to calculate a macroblock motion vector that is a motion vector of a macroblock obtained by dividing the original image based on the reference image that is the frame immediately before the original image. To explore. Subsequently, the encoding program divides the macro block into small blocks which are smaller (narrower) blocks than the macro block by the macro block dividing means, and the small block motion vector which is the motion vector of the small block is obtained. Then, the divided block motion vector search means searches based on the reference image.
[0032]
The encoding program generates a motion compensated image based on the macroblock motion vector, the small block motion vector, and the reference image by the macroblock motion compensation unit, and the macroblock image comparison unit Based on the result of comparing the motion compensated image created by the motion compensation means and the macroblock, the motion vector with the best coding efficiency is selected.
[0033]
The encoding method according to claim 6 is an encoding method that performs motion compensation prediction in units of blocks of an original image included in a moving image, and compresses and encodes the moving image, and includes a macroblock motion vector. The procedure includes a search step, a macroblock division step, a divided block motion vector search step, a macroblock motion compensation step, and a macroblock image comparison step.
[0034]
According to this procedure, in the macroblock motion vector search step, the encoding method uses a macroblock motion vector that is a motion vector of a macroblock obtained by dividing the original image based on a reference image that is a frame immediately before the original image. To explore. Subsequently, in the encoding method, in the macroblock division step, the macroblock is divided into small blocks that are smaller (narrower) blocks than the macroblock, and a small block motion vector that is a motion vector of the small block is obtained. In the divided block motion vector search step, search is performed based on the reference image.
[0035]
Then, in this encoding method, in the macroblock motion compensation step, a motion compensated image is created based on the macroblock motion vector, the small block motion vector, and the reference image, and in the macroblock image comparison step, the macroblock motion compensation step Based on the result of comparing the motion compensated image created in the motion compensation step with the macroblock, the motion vector with the best coding efficiency is selected.
[0036]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
(Configuration of encoding device)
FIG. 1 shows a block diagram of the encoding apparatus. As shown in FIG. 1, the encoding device 1 receives a macroblock signal (macroblock) of one frame of an original image included in a moving image, and compresses the moving image with an optimal encoding efficiency. In order to perform encoding, a macroblock motion vector search unit 3 and a macroblock division unit are used to obtain (output) by comparing a motion vector of a macroblock and a motion vector of a small block obtained by dividing the macroblock. 5, a divided block accumulation sequential output unit 7, a divided block motion vector search unit 9, a reference image accumulation unit 11, a motion vector accumulation unit 13, a macroblock motion compensation unit 15, and a motion compensation macroblock accumulation unit 17. And a macroblock image comparison unit 19.
[0037]
Note that this encoding apparatus 1 is a method in which one motion vector is assigned to one macroblock, such as MPEG-1 or MPEG-2, and a plurality of MPEG-4 motion vectors or a plurality of JVT methods. It can be said that it introduces the concept of a method in which motion vectors are assigned.
[0038]
The macroblock motion vector search unit 3 (macroblock motion search means) uses the motion vector of the input macroblock signal (macroblock) as a reference image signal (reference image, one before) stored in the reference image storage unit 11. The motion vector is searched by referring to the original image of the frame. In other words, the macroblock motion vector search unit 3 determines whether the macroblock area (horizontal 16 pixels × vertical 16 lines square) contains pixels (current frame pixel arrangement) included in the previous frame. Is searched for a substantially matching pixel arrangement (preceding frame pixel arrangement), and a vector connecting each pixel of the immediately preceding frame pixel arrangement to each pixel of the current frame pixel arrangement is a macroblock motion vector (macroblock motion vector signal). ) Is output to the motion vector storage unit 13.
[0039]
In this embodiment, the macroblock motion vector search unit 3 searches for one motion vector for one macroblock by a block matching method conventionally used in MPEG-1 or MPEG-2.
[0040]
The macroblock dividing unit 5 (macroblock dividing means) divides the macroblock into small blocks. In this embodiment, both MPEG-4 that assigns four motion vectors and the JVT system that assigns many motion vectors can be used. In the case of MPEG-4, a macroblock of horizontal 16 pixels × vertical 16 lines can be divided into four small blocks of horizontal 8 pixels × vertical 8 lines. In the case of the JVT method, a macroblock of 16 horizontal pixels × vertical 16 lines may be divided into two small blocks of 16 horizontal pixels × vertical 8 lines, in addition to keeping the horizontal 16 pixels × vertical 16 lines, A macro block of horizontal 16 pixels × vertical 16 lines is divided into two small blocks of horizontal 8 pixels × vertical 16 lines, or a macro block of horizontal 16 pixels × vertical 16 lines is divided into four small blocks of horizontal 8 pixels × vertical 8 lines. Can be divided into blocks.
[0041]
In the case of this JVT system, the small block of horizontal 8 pixels × vertical 8 lines is further divided into two small blocks of horizontal 8 pixels × vertical 4 lines in addition to keeping the horizontal 8 pixels × vertical 8 lines. Alternatively, a small block of horizontal 8 pixels × vertical 8 lines is divided into two small blocks of horizontal 4 pixels × vertical 8 lines, or a small block of horizontal 8 pixels × vertical 8 lines is divided into 4 of horizontal 4 pixels × vertical 4 lines. Can be divided into two small blocks.
[0042]
The divided block accumulation sequential output unit 7 accumulates the small blocks divided by the macroblock division unit 5 and outputs the accumulated divided block signals (small blocks) to the divided block motion vector search unit 9 sequentially. . For example, the timing for sequentially outputting the small blocks from the divided block accumulation sequential output unit 7 is immediately after the motion vector of the small block input to the divided block motion vector search unit 9 is searched.
[0043]
The divided block motion vector search unit 9 (divided block motion vector search means) uses the reference image signal (reference image, one image) stored in the reference image storage unit 11 for the input motion vector for each divided block signal (small block). The motion vector is searched by referring to the original image of the previous frame. In other words, the divided block motion vector search unit 9 performs pixel arrangement (preceding frame pixel) that almost matches from the arrangement of pixels included in the small block area (current frame pixel arrangement) in the immediately preceding frame. And a vector connecting each pixel in the previous frame pixel arrangement to each pixel in the current frame pixel arrangement is output to the motion vector accumulation unit 13 as a small block motion vector (divided block motion vector signal). Is.
[0044]
Here, how to search for a motion vector (macroblock motion vector, small block motion vector) in the macroblock motion vector search unit 3 and the divided block motion vector search unit 9 will be described in more detail.
[0045]
In the block matching method used for motion vector search in the macroblock motion vector search unit 3 and the divided block motion vector search unit 9, for example, for each block of a predetermined size such as horizontal 8 pixels × vertical 8 lines. The absolute value of the difference and the average value of the square error are calculated between the processing target image (pixel) in the block and the reference image (pixel). Then, a translation vector is obtained from the portion (block) of the reference image having the minimum average value to the processing target image, and this translation vector is used as a motion vector.
[0046]
In this embodiment, a motion vector that minimizes the average error is obtained. Normally, only the average value of errors in the entire block (macro block, small block) is evaluated, so even if the error is the same in the entire block, the error is actually far off for a certain pixel. Or, if the error tends to deviate as a whole, there may be a case where it cannot be said that an accurate motion vector is predicted only by the average value.
[0047]
Therefore, in this embodiment, in addition to the method of calculating the minimum value of the average value of errors in a block, the error variance between blocks is calculated, and an error vector that minimizes the error variance is calculated as an accurate motion vector. The method is adopted.
[0048]
The reference image storage unit 11 stores, as a reference image, an original image of a frame immediately preceding (immediately before) a macroblock signal obtained by dividing each original image included in a moving image input to the apparatus 1. . The reference image storage unit 11 is usually composed of a frame memory. In FIG. 1, the image of the frame immediately before the current frame is input as shown by the dotted line in the reference image input path.
[0049]
The motion vector accumulating unit 13 is a macroblock motion vector signal (macroblock motion vector) searched and output by the macroblock motion vector search unit 3 and the divided block searched and output by the divided block motion vector search unit 9. A block motion vector signal (small block motion vector) is accumulated.
[0050]
The macroblock motion compensation unit 15 (macroblock motion compensation means) includes motion vector signals (macroblock motion vector signals [macroblock motion vectors], divided block motion vector signals [small block motions) stored in the motion vector storage unit 13. Vector)) and a reference image signal (reference image) output (supplied) from the reference image storage unit 11 to perform motion compensation processing for each macroblock, that is, to create a motion compensated image. This motion compensated image is a copy of the corresponding portion of the reference image based on the motion vector. Note that the motion vector signals input to the macroblock motion compensation unit 15 are a plurality of motion vectors shown in FIGS.
[0051]
That is, the macroblock motion compensation unit 15 performs motion compensation in units of macroblocks, and the motion vector for each small block is not limited to the corresponding small block, as shown in FIG. A vector, that is, a motion vector for each small block is used as a motion vector of a macroblock.
[0052]
In FIG. 4A, the motion vector of the small block of horizontal 8 pixels × vertical 8 lines in the upper left (motion vector of the divided block) is used as the motion vector of the macroblock of horizontal 16 pixels × vertical 16 lines. . In FIG. 4B, a motion vector of a small block of horizontal 8 pixels × vertical 8 lines in the upper right (motion vector of a divided block) is used as a motion vector of a macroblock of horizontal 16 pixels × vertical 16 lines. In FIG. 4C, the motion vector of the small block of horizontal 8 pixels × vertical 8 lines in the lower left (motion vector of the divided block) is used as the motion vector of the macroblock of 16 horizontal pixels × vertical 16 lines. In FIG. 4 (d), the motion vector of the small block of horizontal 8 pixels × vertical 8 lines in the lower right (the motion vector of the divided block) is used as the motion vector of the macroblock of 16 horizontal pixels × vertical 16 lines.
[0053]
As shown in FIGS. 4A to 4D, a macroblock is divided into four small blocks, and a motion vector of one small block is used as a motion vector of the macroblock, so that there are four ways. Motion compensation is performed (four motion compensated images are created). In addition to this, when the macroblock is divided into two, two types of motion compensation are performed (two motion compensation images are created), and when divided into three, three types of motion compensation are performed (three motions). Create compensation image).
[0054]
Assuming that a moving image is encoded at a low bit rate, a motion prediction error signal (motion prediction error), that is, a motion compensated image obtained by a motion vector (a part of a reference image that is a previous frame is copied) 1) and the original image that is the current frame, the amount of information allocated to the error is reduced. Therefore, when the moving image is encoded and then decoded, the decoded image can be reconstructed only with the motion vector. A mechanism to make it is necessary. In the case of motion prediction compensation for each small block, even if the motion prediction error for each small block is small, if the motion prediction error for the macroblock is even smaller than that, select even if the motion prediction error for this macroblock is incorrect There is a risk of being done. In such a case, if the amount of information allocated to the motion prediction error is small, the image quality deteriorates.
[0055]
Therefore, the macroblock motion compensation unit 15 is configured to be able to change a threshold value that is a criterion for determining a motion prediction error for each small block and a motion prediction error for the macroblock. When the motion prediction error for each and the motion prediction error of the macroblock are the same, the macroblock image comparison unit 19 is configured to select the motion vector of the small block.
[0056]
By doing so, the motion prediction error of the portion other than the small block in the macroblock increases, but the image quality of the portion of the small block can be improved. As the most extreme example, when the motion prediction error is minimized for the small block portion, if the motion vector of the small block is selected, the small block is high even if there is no motion prediction error. Image quality can be maintained.
[0057]
The motion compensation macroblock storage unit 17 stores the motion compensated image output from the macroblock motion compensation unit 15, the motion prediction error of the macroblock, and the motion prediction error for each small block as a motion compensation macroblock signal. It is.
[0058]
The macroblock image comparison unit 19 (macroblock image comparison means) is a motion compensation macroblock signal (motion compensation image, macroblock motion prediction error and motion prediction error for each small block) output from the motion compensation macroblock storage unit 17. ) And the macroblock signal (macroblock), the motion vector having the best coding efficiency is selected and output as the final macroblock motion vector signal. The macroblock image comparison unit 19 uses an image quality of a small block for which a motion vector is obtained as a criterion for determination of an error signal that is an error between the motion compensated image created by the macroblock motion compensation unit 15 and the original image. Coding assignment control means (not shown) for controlling the coding assignment is provided.
[0059]
In this macroblock image comparison unit 19, there are the following (1) and (2) as methods for selecting a motion vector that provides the best coding efficiency. (1) The difference between the motion compensated macroblock signal (motion compensated image) and the macroblock signal (macroblock) is compared, and the smallest one is selected. (2) The difference between the motion compensated macroblock signal (motion compensated image) and the macroblock signal (macroblock) is encoded as a residual signal and compared in a final stream based on information such as motion vectors. And select the smallest one.
[0060]
In the case of (2), when coding a motion vector (macroblock motion vector), this motion vector and a motion vector (macroblock motion vector) of an adjacent macroblock adjacent to the macroblock for which the motion vector is obtained. Therefore, the process is not completed only within the macroblock, and is affected by the adjacent macroblock. However, it is possible to evaluate the coding apparatus 1 as a whole (when finally compressing and coding a moving image) so that the coding efficiency is improved.
[0061]
When this encoding apparatus 1 is applied to transcoding from MPEG-4 or JVT system to MPEG-1 or MPEG-2, the macroblock is changed to a small block corresponding to MPEG-4 or JVT system. Since it is divided by the macroblock dividing unit 5 and an optimum motion vector (small block motion vector) is obtained by the divided block motion vector search unit 9, one of these small block motion vectors is assigned to the macro. You only have to select what applies to the block. When making this selection, if there is a small block that emphasizes image quality, the small block motion vector of the small block is preferentially selected, or the majority (combination) or average value of a plurality of motion small block motion vectors is selected. It is also possible to determine by.
[0062]
For a small block for which a motion vector is selected by a coding allocation control means (not shown), if the coding allocation of a motion prediction error signal (motion prediction error) is increased, the portion (small block) is further increased. ) On the other hand, if it is desired to improve the image quality of the entire macroblock, the reconstructed image (decoded image) is only used for the small block for which the motion vector is selected. It is possible to control so as to increase the coding allocation to the remaining small blocks in the macroblock.
[0063]
According to this encoding device 1, a macroblock motion vector that is a motion vector of a macroblock obtained by dividing an original image by the macroblock motion vector search unit 3 is based on a reference image that is a frame immediately before the original image. The macro block is divided into small blocks that are smaller (narrower) blocks than the macro block by the macro block dividing unit 5, and the small block motion vector that is the motion vector of the small block is divided into the divided block motion vectors. The search unit 9 searches based on the reference image stored in the reference image storage unit 11.
[0064]
Then, the macroblock motion compensation unit 15 creates a motion compensated image based on the macroblock motion vector, the small block motion vector, and the reference image, and the macroblock image comparison unit 19 creates the motion compensated image, macro Based on the result of comparison with the block, the macroblock motion vector (final macroblock motion vector signal) with the best coding efficiency is selected.
[0065]
That is, the encoding apparatus 1 performs motion compensation prediction of the small block divided by the macroblock dividing unit 5 using the macroblock motion compensating unit 15, and the macroblock image comparing unit 19 uses the most of the small block motion vectors. By using a macroblock motion vector that is suitable for actual motion (which provides the best coding efficiency), it can be viewed for each small block as in the conventional method (MPEG-1, MPEG-2). Even if the motion vector of the macroblock is incorrect (does not match), compared to the case in which one motion vector is assigned to one macroblock, the motion vector looks like the actual motion (according to the area) when compared with the entire macroblock ).
[0066]
For this reason, encoding efficiency is improved even if motion compensation prediction is performed in units of conventional macroblocks without changing the encoding method such as MPEG-1 or MPEG-2 that has already been standardized. Can be made.
[0067]
Further, according to the encoding device 1, the macroblock dividing unit 5 divides the block into small blocks compatible with the MPEG-4 or JVT system, and the divided block motion vector search unit 9 optimizes the motion vector (small block). Motion vector) is required, it is only necessary to select one of these small block motion vectors to be applied to one macroblock. In handling an encoded stream, there are a plurality of motion vectors per macroblock. Transcoding (conversion) can be performed from a method corresponding to a motion vector (MPEG-4 or JVT method) to a method corresponding to one motion vector per macroblock (MPEG-1 or MPEG-2). As a result, an encoded stream created by the MPEG-4 or JVT encoding method can be converted into another encoding method, that is, an MPEG-1 or MPEG-2 encoded stream. The versatility in handling a stream can be improved.
[0068]
Furthermore, according to this encoding apparatus 1, when searching for a motion vector by the macroblock motion vector search unit 3 and the divided block motion vector search unit 9, the corresponding block (macroblock) of the macroblock and the reference image, Not only the minimum error mean, but also the minimum error variance, the minimum error mean between the small block and the corresponding block of the reference image (small block), and the minimum error variance Since a value is also searched, it is possible to search for a motion vector more accurately than when a motion vector is searched by evaluating only the average value of errors in the entire block.
[0069]
In addition, according to the encoding device 1, the macroblock motion compensation unit 15 uses the macroblock motion vector and the reference image to determine a motion compensated image, and the motion based on the small block motion vector and the reference image. The macroblock image comparison unit 19 selects the motion vector of the small block in the case of the same motion prediction error by separating the determination criterion for obtaining the compensation image, that is, by changing the threshold value serving as the criterion. If so, the image quality of the portion of the small block at the time of decoding after encoding can be improved.
[0070]
Further, according to this encoding apparatus 1, the motion compensation image is determined using the image quality of the small block obtained by the macroblock image comparison unit 19 by the encoding allocation control means (not shown) as a criterion. And encoding assignment of an error signal which is an error between the original image and the original image. For example, if the encoding assignment of the error signal is increased, the image quality of the portion can be improved, and conversely, for a small block for which a motion vector is obtained, the image is reconstructed to some extent only with the motion vector. As a result, it is possible to improve the image quality of not only the small block but also the entire macro block by controlling the encoding allocation to be increased in the remaining small blocks in the macro block.
[0071]
(Operation of encoding device)
Next, the operation of the encoding device 1 will be described with reference to the flowchart shown in FIG. 2 (see FIG. 1 as appropriate).
[0072]
First, the macroblock signal (macroblock) inputted by the macroblock dividing unit 5 in accordance with the encoding method (MPEG-4, JVT method) is horizontal 8 pixels × vertical 8 lines, horizontal 16 pixels × vertical. Divided into small blocks of 8 lines, horizontal 8 pixels × vertical 16 lines, etc. (S1). Subsequently, the divided block motion vector search unit 9 searches for a motion vector in units of small blocks (S2). Although not shown, the macroblock motion search unit 3 searches the input macroblock signal for a macroblock unit motion vector.
[0073]
Then, the macroblock motion compensation unit 15 performs motion compensation processing (motion compensation prediction) in units of macroblocks, and motion compensated images, macroblock motion prediction errors (motion prediction error signals), and small block motion predictions. The error (motion prediction error signal) is output to the motion compensation macroblock accumulating unit 17 as a motion compensation macroblock signal (S3). Then, the motion compensation macroblock signal and the macroblock signal are output to the macroblock image comparison unit 19.
[0074]
Then, the macroblock image comparison 19 compares the error value between the motion compensated image and the macroblock, and the smaller error value is selected and held (S4).
[0075]
Then, it is determined whether or not the process of S4 has been completed for all the combinations in which all the small block motion vectors searched by the divided block motion vector search unit 9 are assigned as the macroblock motion vectors (S5). When it is not determined that all combinations have been completed (S5, No), the process returns to S2, and when it is determined that all combinations have been completed (S5, Yes), the amount of encoded information becomes the minimum. A motion vector (final macroblock motion vector signal) is output (S6).
[0076]
As mentioned above, although this invention was demonstrated based on one Embodiment, this invention is not limited to this.
For example, the processing of each component of the encoding device 1 can be regarded as an encoding method that considers each process as one process, or the encoding of the processing of each component of the encoding device 1 described in a general-purpose computer language It can also be regarded as a program. In these cases, the same effect as that of the encoding device 1 can be obtained.
[0077]
【The invention's effect】
According to the first, fifth, and sixth aspects of the present invention, motion compensation prediction is performed on the divided small blocks, and the motion vector of the macroblock that is most suitable for the actual motion among the motion vectors of the small blocks is used. Thus, as in MPEG-1 and MPEG-2, even if the motion vector of the macroblock is incorrect when viewed in each small block, compared to the case where one motion vector is assigned to one macroblock, When viewed in the entire macroblock, the motion vector approaches the actual motion. For this reason, encoding efficiency is improved even if motion compensation prediction is performed in units of conventional macroblocks without changing the encoding method such as MPEG-1 or MPEG-2 that has already been standardized. Can be made. Also, an encoded stream created by an MPEG-4 or JVT encoding method can be converted into another encoding method, that is, an MPEG-1 or MPEG-2 encoded stream, and the actual encoding is performed. The versatility in handling a stream can be improved.
[0078]
According to the second aspect of the present invention, when searching for a motion vector, not only the minimum value of the average error between the macroblock and the corresponding block of the reference image, but also the minimum value of error variance, the small block, Since not only the minimum error average value with the corresponding block of the reference image but also the minimum error variance value is searched, conventionally, only the average error value in the entire block is evaluated to search for a motion vector. The motion vector can be searched more accurately than the above.
[0079]
According to the third aspect of the present invention, the determination criteria for obtaining the motion compensated image from the macroblock motion vector and the reference image and the determination criteria for obtaining the motion compensated image from the small block motion vector and the reference image are separately provided. In other words, in the case of the same motion prediction error, if the macroblock image comparison unit selects the motion vector of the small block by changing the threshold value used as a determination criterion, The image quality of the small block portion can be improved.
[0080]
According to the fourth aspect of the present invention, the coding assignment of the error signal, which is an error between the motion compensated image and the original image, is controlled using the image quality of the small block from which the motion vector is obtained as a criterion. If the signal coding allocation is increased, the image quality of that portion can be improved.
[Brief description of the drawings]
FIG. 1 is a block diagram of an encoding apparatus according to an embodiment of the present invention.
FIG. 2 is a flowchart for explaining the operation of the encoding apparatus shown in FIG. 1;
FIG. 3 is a diagram illustrating a relationship between a macroblock and a motion vector.
FIG. 4 is a diagram illustrating a case where a small block motion vector is assigned as a macroblock motion vector.
FIG. 5 is a diagram illustrating division of a conventional macroblock.
FIG. 6 is a diagram for describing conventional motion vector encoding.
FIG. 7 is a diagram illustrating a relationship (conventional) between a macroblock and a motion vector.
[Explanation of symbols]
1 Encoder
3 Macroblock motion vector search unit (macroblock motion vector search means)
5 Macroblock division (macroblock division means)
7 Divided block storage sequential output section
9 Divided block motion vector search unit (divided block motion vector search means)
11 Reference image storage unit
13 Motion vector storage unit
15 Macroblock motion compensation unit (macroblock motion compensation means)
17 Motion compensation macroblock storage
19 Macroblock image comparison unit (macroblock image comparison means)

Claims (6)

動画像に含まれている原画像のブロックの単位で動き補償予測を行って、当該動画像を圧縮符号化する符号化装置であって、
前記原画像が分割されたマクロブロックの動きベクトルであるマクロブロック動きベクトルを、前記原画像の直前のフレームである参照画像に基づいて探索するマクロブロック動きベクトル探索手段と、
前記原画像が分割されたマクロブロックを、当該マクロブロックよりも小さいブロックである小ブロックに分割するマクロブロック分割手段と、
このマクロブロック分割手段で分割された小ブロックの動きベクトルである小ブロック動きベクトルを、前記参照画像に基づいて探索する分割ブロック動きベクトル探索手段と、
前記マクロブロック動きベクトル探索手段で探索されたマクロブロック動きベクトルと、前記分割ブロック動きベクトル探索手段で探索された小ブロック動きベクトルと、前記参照画像とに基づいて、動き補償画像を作成するマクロブロック動き補償手段と、
このマクロブロック動き補償手段で作成された動き補償画像と、前記マクロブロックとを比較した結果に基づいて、符号化効率が最良となる動きベクトルを選択するマクロブロック画像比較手段と、
を備えることを特徴とする符号化装置。
An encoding device that performs motion compensation prediction in units of blocks of an original image included in a moving image and compresses and encodes the moving image,
Macroblock motion vector search means for searching for a macroblock motion vector that is a motion vector of a macroblock into which the original image is divided based on a reference image that is a frame immediately before the original image;
Macroblock dividing means for dividing the macroblock obtained by dividing the original image into small blocks that are smaller than the macroblock;
Divided block motion vector search means for searching a small block motion vector, which is a motion vector of a small block divided by the macroblock dividing means, based on the reference image;
Macroblock that creates a motion compensated image based on the macroblock motion vector searched by the macroblock motion vector search means, the small block motion vector searched by the divided block motion vector search means, and the reference image Motion compensation means;
A macroblock image comparing means for selecting a motion vector having the best coding efficiency, based on a result of comparing the macroblock with the motion compensated image created by the macroblock motion compensating means;
An encoding device comprising:
前記マクロブロック動きベクトル探索手段または前記分割ブロック動きベクトル探索手段は、前記マクロブロック動きベクトル探索手段でマクロブロック動きベクトルを探索する際、或いは、前記分割ブロック動きベクトル探索手段で小ブロック動きベクトルを探索する際に、前記マクロブロックと前記参照画像の該当するブロックとの誤差の平均値および誤差の分散、または前記小ブロックと前記参照画像の該当するブロックとの誤差の平均値および誤差の分散、を最小とするものを探索することを特徴とする請求項1に記載の符号化装置。The macroblock motion vector search means or the divided block motion vector search means searches for a macroblock motion vector by the macroblock motion vector search means, or searches for a small block motion vector by the divided block motion vector search means. In this case, an error average value and error variance between the macroblock and the corresponding block of the reference image, or an error average value and error variance between the small block and the corresponding block of the reference image, 2. The encoding apparatus according to claim 1, wherein a search is made for a minimum one. 前記マクロブロック動き補償手段で、前記マクロブロックと前記参照画像の該当するブロックとの誤差の計算と、前記小ブロックと前記参照画像の該当するブロックとの誤差の計算とを、別々の閾値を使用して行うことを特徴とする請求項1または請求項2に記載の符号化装置。The macro block motion compensation means uses different threshold values for calculating the error between the macro block and the corresponding block of the reference image and calculating the error between the small block and the corresponding block of the reference image. The encoding apparatus according to claim 1, wherein the encoding apparatus is performed as described above. 前記マクロブロック画像比較手段で選択され、動きベクトルを求めた前記小ブロックの画質を判断基準にして、前記マクロブロック動き補償手段で作成された動き補償画像と前記原画像との誤差である誤差信号の符号化割り当てを制御する符号化割当制御手段を備えたことを特徴とする請求項1から請求項3のいずれか一項に記載の符号化装置。An error signal, which is an error between the motion compensated image created by the macroblock motion compensation means and the original image, based on the image quality of the small block selected by the macroblock image comparison means and the motion vector obtained as a criterion. The encoding apparatus according to any one of claims 1 to 3, further comprising: an encoding allocation control unit that controls encoding allocation. 動画像に含まれている原画像のブロックの単位で動き補償予測を行って、当該動画像を圧縮符号化する装置を、
前記原画像が分割されたマクロブロックの動きベクトルであるマクロブロック動きベクトルを、前記原画像の直前のフレームである参照画像に基づいて探索するマクロブロック動きベクトル探索手段、
前記原画像が分割されたマクロブロックを、当該マクロブロックよりも小さいブロックである小ブロックに分割するマクロブロック分割手段、
このマクロブロック分割手段で分割された小ブロックの動きベクトルである小ブロック動きベクトルを、前記参照画像に基づいて探索する分割ブロック動きベクトル探索手段、
前記マクロブロック動きベクトル探索手段で探索されたマクロブロック動きベクトルと、前記分割ブロック動きベクトル探索手段で探索された小ブロック動きベクトルと、前記参照画像とに基づいて、動き補償画像を作成するマクロブロック動き補償手段、
このマクロブロック動き補償手段で作成された動き補償画像と、前記マクロブロックとを比較した結果に基づいて、符号化効率が最良となる動きベクトルを選択するマクロブロック画像比較手段、
として機能させることを特徴とする符号化プログラム。
A device that performs motion compensation prediction in units of blocks of an original image included in a moving image and compresses and encodes the moving image,
Macroblock motion vector search means for searching for a macroblock motion vector that is a motion vector of a macroblock into which the original image is divided based on a reference image that is a frame immediately before the original image;
Macroblock dividing means for dividing the macroblock obtained by dividing the original image into small blocks that are smaller than the macroblock;
A divided block motion vector search means for searching a small block motion vector, which is a motion vector of a small block divided by the macroblock dividing means, based on the reference image;
Macroblock that creates a motion compensated image based on the macroblock motion vector searched by the macroblock motion vector search means, the small block motion vector searched by the divided block motion vector search means, and the reference image Motion compensation means,
A macroblock image comparison unit that selects a motion vector with the best coding efficiency based on a result of comparing the macroblock with the motion compensated image created by the macroblock motion compensation unit;
An encoding program characterized in that it is made to function as:
動画像に含まれている原画像のブロックの単位で動き補償予測を行って、当該動画像を圧縮符号化する符号化方法であって、
前記原画像が分割されたマクロブロックの動きベクトルであるマクロブロック動きベクトルを、前記原画像の直前のフレームである参照画像に基づいて探索するマクロブロック動きベクトル探索ステップと、
前記原画像が分割されたマクロブロックを、当該マクロブロックよりも小さいブロックである小ブロックに分割するマクロブロック分割ステップと、
このマクロブロック分割ステップにて分割された小ブロックの動きベクトルである小ブロック動きベクトルを、前記参照画像に基づいて探索する分割ブロック動きベクトル探索ステップと、
前記マクロブロック動きベクトル探索ステップにて探索されたマクロブロック動きベクトルと、前記分割ブロック動きベクトル探索ステップにて探索された小ブロック動きベクトルと、前記参照画像とに基づいて、動き補償画像を作成するマクロブロック動き補償ステップと、
このマクロブロック動き補償ステップにて作成された動き補償画像と、前記マクロブロックとを比較した結果に基づいて、符号化効率が最良となる動きベクトルを選択するマクロブロック画像比較ステップと、
を含むことを特徴とする符号化方法。
An encoding method that performs motion compensation prediction in units of blocks of an original image included in a moving image and compresses and encodes the moving image,
A macroblock motion vector search step for searching a macroblock motion vector, which is a motion vector of a macroblock obtained by dividing the original image, based on a reference image that is a frame immediately before the original image;
A macroblock dividing step of dividing the macroblock obtained by dividing the original image into small blocks that are smaller than the macroblock;
A divided block motion vector search step for searching a small block motion vector, which is a motion vector of a small block divided in the macroblock dividing step, based on the reference image;
A motion compensation image is created based on the macroblock motion vector searched in the macroblock motion vector search step, the small block motion vector searched in the divided block motion vector search step, and the reference image. A macroblock motion compensation step;
A macroblock image comparison step for selecting a motion vector with the best coding efficiency based on a result of comparing the macroblock with the motion compensated image created in the macroblock motion compensation step;
The encoding method characterized by including.
JP2003174771A 2003-06-19 2003-06-19 Encoding device, encoding program, and encoding method Pending JP2005012527A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003174771A JP2005012527A (en) 2003-06-19 2003-06-19 Encoding device, encoding program, and encoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003174771A JP2005012527A (en) 2003-06-19 2003-06-19 Encoding device, encoding program, and encoding method

Publications (1)

Publication Number Publication Date
JP2005012527A true JP2005012527A (en) 2005-01-13

Family

ID=34098156

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003174771A Pending JP2005012527A (en) 2003-06-19 2003-06-19 Encoding device, encoding program, and encoding method

Country Status (1)

Country Link
JP (1) JP2005012527A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007010779A1 (en) * 2005-07-15 2007-01-25 Matsushita Electric Industrial Co., Ltd. Packet transmitter

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06225153A (en) * 1993-01-27 1994-08-12 Fuji Xerox Co Ltd Picture coder
JPH07322246A (en) * 1994-05-27 1995-12-08 Sanyo Electric Co Ltd Moving image compression coder and method therefor
JPH08340531A (en) * 1995-06-14 1996-12-24 Toshiba Corp Variable rate coder
JPH1051784A (en) * 1996-07-30 1998-02-20 Sanyo Electric Co Ltd Dynamic image coder
WO2001084846A2 (en) * 2000-04-28 2001-11-08 Hewlett-Packard Company Method and apparatus for transcoding an object-based coded picture signal into a block-based coded picture signal
JP2002209213A (en) * 2000-12-28 2002-07-26 Sony Corp Motion vector detection method and device, and image coder
JP2003061099A (en) * 2001-08-21 2003-02-28 Kddi Corp Motion detection method in encoder
JP2003111082A (en) * 2001-09-28 2003-04-11 Toshiba Corp Motion vector detecting method and apparatus

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06225153A (en) * 1993-01-27 1994-08-12 Fuji Xerox Co Ltd Picture coder
JPH07322246A (en) * 1994-05-27 1995-12-08 Sanyo Electric Co Ltd Moving image compression coder and method therefor
JPH08340531A (en) * 1995-06-14 1996-12-24 Toshiba Corp Variable rate coder
JPH1051784A (en) * 1996-07-30 1998-02-20 Sanyo Electric Co Ltd Dynamic image coder
WO2001084846A2 (en) * 2000-04-28 2001-11-08 Hewlett-Packard Company Method and apparatus for transcoding an object-based coded picture signal into a block-based coded picture signal
JP2002209213A (en) * 2000-12-28 2002-07-26 Sony Corp Motion vector detection method and device, and image coder
JP2003061099A (en) * 2001-08-21 2003-02-28 Kddi Corp Motion detection method in encoder
JP2003111082A (en) * 2001-09-28 2003-04-11 Toshiba Corp Motion vector detecting method and apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007010779A1 (en) * 2005-07-15 2007-01-25 Matsushita Electric Industrial Co., Ltd. Packet transmitter
US7929560B2 (en) 2005-07-15 2011-04-19 Panasonic Corporation Packet transmitting apparatus
JP4886689B2 (en) * 2005-07-15 2012-02-29 パナソニック株式会社 Packet transmitter

Similar Documents

Publication Publication Date Title
US11277631B2 (en) Flexible reference picture management for video encoding and decoding
US20210218974A1 (en) Hash-based encoder decisions for video coding
EP3075154B1 (en) Selection of motion vector precision
US10462480B2 (en) Computationally efficient motion estimation
AU2015206771B2 (en) Intra block copy prediction with asymmetric partitions and encoder-side search patterns, search ranges and approaches to partitioning
US10390034B2 (en) Innovations in block vector prediction and estimation of reconstructed sample values within an overlap area
CN107483958B (en) Encoding method, encoding device, decoding method, and decoding device
US8098731B2 (en) Intraprediction method and apparatus using video symmetry and video encoding and decoding method and apparatus
JP5289440B2 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
EP3549345A1 (en) Local hash-based motion estimation for screen remoting scenarios
EP1993292A1 (en) Dynamic image encoding method and device and program using the same
KR20170021337A (en) Encoder decisions based on results of hash-based block matching
MXPA06002525A (en) Coding and decoding for interlaced video.
US20160373739A1 (en) Intra/inter decisions using stillness criteria and information from previous pictures
US20160057415A1 (en) Image encoding method, image encoding apparatus, and related encoding medium, image decoding method, image decoding apparatus, and related decoding medium
JP5649296B2 (en) Image encoding device
JP2005012439A (en) Encoding device, encoding method and encoding program
JP2005012527A (en) Encoding device, encoding program, and encoding method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060214

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071120

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071128

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080318