JP4000928B2 - Motion compensation device - Google Patents

Motion compensation device Download PDF

Info

Publication number
JP4000928B2
JP4000928B2 JP2002196275A JP2002196275A JP4000928B2 JP 4000928 B2 JP4000928 B2 JP 4000928B2 JP 2002196275 A JP2002196275 A JP 2002196275A JP 2002196275 A JP2002196275 A JP 2002196275A JP 4000928 B2 JP4000928 B2 JP 4000928B2
Authority
JP
Japan
Prior art keywords
value
pixel
reference image
horizontal
pixels
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
JP2002196275A
Other languages
Japanese (ja)
Other versions
JP2004040575A (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 JP2002196275A priority Critical patent/JP4000928B2/en
Publication of JP2004040575A publication Critical patent/JP2004040575A/en
Application granted granted Critical
Publication of JP4000928B2 publication Critical patent/JP4000928B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明の属する技術分野】
本発明は、例えばMPEG4(ISO/IEC 14496-2)等の動画像符号化データを復号する復号装置に用いられる動き補償装置に関するものである。
【0002】
【従来の技術】
MPEG4ビジュアル圧縮符号化規格(ISO/IEC 14496-2)では、ビデオオブジェクトプレーン(VOP)という画像単位で画像圧縮が行われる。VOPは、時間方向に連続したオブジェクトのある時点での2次元の画像を意味している。VOPは、例えば、図11(A)に示すような画面の背景を現す矩形形状のオブジェクト、図11(B)に示すような画面内に現れている人物や物等を表す任意形状のオブジェクト等の任意の時間位置での表示画像である。MPEG4ビジュアル圧縮符号化規格では、同時刻に存在する1以上のVOPに対して、それぞれ独立に符号化が行われ、また、それぞれ独立に復号が行われる。
【0003】
また、MPEG4ビジュアル圧縮符号化規格では、動き予測を用いて時間方向の画像相関を利用した圧縮符号化が行われる。すなわち、ある時点のVOPに対して圧縮符号化を行う場合、過去又は未来から現時点への画像の動き予測を行い、その動き量に基づき過去又は未来の画像からの予測画像を生成し、現時点での画像からその予測画像を減算することにより、情報量の圧縮が行われる。MPEG4ビジュアル圧縮符号化規格では、動き予測を、MPEG2と同様に、16×16(垂直×水平)ピクセルから構成されるマクロブロック単位で行う。
【0004】
ところで、MPEG4ビジュアル圧縮符号化規格では、矩形形状のVOPに対して符号化を行う場合、動きベクトルにより特定される参照画像が、VOPの領域外にあってもよいとされている。例えば、図12のAに示すように参照画像の一部又は全部のピクセルがVOPの水平方向の領域外となっていてもよいし、図12のBに示すように参照画像の一部又は全部のピクセルがVOPの垂直方向の領域外となっていてもよいし、図12のCに示すように参照画像の全部のピクセルがVOPの水平及び垂直方向ともに領域外となっていてもよい。
【0005】
しかしながら、参照画像の一部又は全部のピクセルがVOPの領域外となっている場合、その領域外となっている部分にはデータが存在していないので、このままでは、復号時にマクロブロックに対する動き補償処理を行うことができない。そのため、MPEG4ビジュアル圧縮符号化規格では、参照画像の一部又は全部のピクセルがVOPの領域外にある場合には、復号時に、領域外に位置するピクセル(領域外ピクセル)のデータを生成する必要がある。MPEG4ビジュアル圧縮符号化規格では、領域外ピクセルのデータを生成する処理を、パディング処理と呼んでいる。
【0006】
参照画像のパディング処理の処理例を図13、図14及び図15に示す。
【0007】
一般に、領域外ピクセルのもっとも近傍にあるVOP内のピクセルデータを、領域外ピクセルにコピーすることにより、参照画像のパディング処理が行われる。
【0008】
例えば、図13に示すように、VOPの水平方向の領域外に領域外ピクセルがある場合には、VOP内の水平方向の境界に位置するピクセルであって且つ領域外ピクセルに最も近いピクセルのデータを、その領域外ピクセルにコピーすることによりパディング処理が行われる。例えば、図14に示すように、VOPの垂直方向の領域外に領域外ピクセルがある場合には、VOP内の垂直方向の境界に位置するピクセルであって且つ領域外ピクセルに最も近いピクセルのデータを、領域外ピクセルにコピーすることによりパディング処理が行われる。例えば、図15に示すように、VOPの水平方向及び垂直方向ともに領域外に領域外ピクセルがある場合には、VOP内の水平方向及び垂直方向の境界に位置するピクセル(コーナー部分のピクセル)であって且つ領域外ピクセルに最も近いピクセルのデータを、領域外ピクセルにコピーすることによりパディング処理が行われる。
【0009】
【発明が解決しようとする課題】
しかしながら、従来、参照画像のパディング処理を行うには、VOPの境界ピクセルを水平方向及び垂直方向に拡張した画像を生成し、その画像をフレームメモリに格納して動き補償を行わなければならなかった。従って、従来の参照画像のパディング処理では、フレームメモリのサイズを拡張しなければ処理をすることができなかった。また、フレームメモリを拡張せずにソフトウェアでパディング処理を行うこともできるが、パディング処理用の処理サイクルが費やされてしまうので、通常の動き補償処理よりも処理時間が長くなってしまっていた。
【0010】
本発明は、このような従来の実情に鑑みて提案されたものであり、動き補償用のフレームメモリを拡張せずに、高速にパディング処理を行うことができる動き補償装置を提供することを目的とする。
【0011】
【課題を解決するための手段】
本発明にかかる動き補償装置は、符号化データが入力され、その符号化データの任意のビデオオブジェクトプレーン(VOP)の任意のマクロブロックに対して動き補償を行う。
【0012】
VOPは、矩形状にピクセルが配列された2次元の画像である。マクロブロックは、VOPを構成する所定画素数の2次元画素ブロックである。さらに、符号化データは、VOPが時間方向に配列された動画像信号を符号化したものであって、且つ、その符号化にマクロブロック単位で動き予測を用いた画像圧縮を行ったものである。
【0013】
本発明にかかる動き補償装置は、基準位置算出手段と、ピクセルカウンタと、領域外判定手段と、位置補正手段と、アドレス生成手段と、補償手段とを備えている。
【0014】
基準位置算出手段は、動き補償対象のマクロブロック(対象マクロブロック)のVOP内における位置情報と対象マクロブロックの動き情報とに基づき、当該対象マクロブロックが動き予測により参照した他のVOP内の2次元画素ブロック(参照画像)のVOP内における位置を示す参照画像位置情報を算出する。
【0015】
ピクセルカウンタは、動作クロックをカウントして、参照画像内の全ピクセルに対する参照画像上でのピクセル位置を発生する。
【0016】
領域外判定手段は、VOPのサイズ及び上記参照画像位置情報に基づき参照画像内の少なくとも1つのピクセルがVOPの領域外に位置するか否かを判断し、参照画像内の少なくとも1つのピクセルがVOPの領域外に位置する場合、領域外となっているピクセルの参照画像内における位置を示す領域外ピクセル位置、及び、参照画像がVOPの領域外にあることを示す領域外フラグを発生する。
【0017】
位置補正手段は、上記ピクセルカウンタから出力されたピクセル位置を補正する。
【0018】
アドレス生成手段は、上記ピクセルカウンタから出力されたピクセル位置、及び、上記参照画像基準位置に基づき、参照画像が含まれているVOP内における1つのピクセルのアドレスを生成する。さらに、位置補正手段は、領域外フラグが発生され、且つ、上記ピクセルカウンタから出力されたピクセル位置が領域外ピクセル位置と一致した場合には、ピクセルカウンタから発生された当該ピクセル位置を、VOPの領域内に含まれているピクセルの位置に補正する。
【0019】
補償手段は、上記アドレス生成手段により生成されたアドレスに基づき、参照画像が含まれているVOP内から順次ピクセルを読み出して、読み出したピクセルにより参照画像を生成し、生成した参照画像によりマクロブロックに対して動き補償を行う。
【0020】
このような構成の動き補償装置では、ピクセルカウンタによって、参照画像内の全ピクセルに対する参照画像上でのピクセル位置が発生され、基準位置算出手段によって、参照画像のVOP内における位置を示す参照画像位置情報が算出される。そして、この参照画像位置情報とピクセル位置情報とにより、VOPから参照画像が読み出される。
【0021】
さらに、上記動き補償装置では、参照画像がVOPの領域外に位置する場合には、位置補正手段によって、ピクセルカウンタから発生されたピクセル位置を、VOPの領域内に含まれているピクセルの位置に補正する。
【0022】
【発明の実施の形態】
以下、本発明の実施の形態として、本発明を適用した画像復号装置について説明をする。以下説明をする画像復号装置は、MPEG4ビジュアル圧縮符号化規格のシンプルプロファイルに対応した画像復号装置である。すなわち、矩形形状のビデオオブジェクトプレーン(VOP)から構成される動画像符号化データの復号を行う装置である。
【0023】
図1に、本発明の実施の形態の画像復号装置1のブロック構成図を示す。
【0024】
画像復号装置1は、図1に示すように、VLC復号回路2と、逆量子化回路3と、逆離散コサイン変換(DCT)回路4と、加算回路5と、フレームメモリ6と、動き補償回路7とを備えて構成される。
【0025】
VLC復号回路2には、MPEG4ビジュアル圧縮符号化規格に従って符号化されたデータストリームが入力される。VLC復号回路2は、入力されたデータストリームに対して可変長符号の復号処理を行う。入力されたデータストリームには、DCT係数データと動き情報(動きモード,動きベクトル等)が含まれている。VLC復号回路2は、DCT係数データを逆量子化回路3に供給し、動き情報を動き補償回路7に供給する。
【0026】
逆量子化回路3には、量子化された状態のDCT係数データが入力される。量子化回路3は、入力されたデータに対して所定の量子化スケールにより逆量子化処理を行う。逆量子化されたDCT係数データは、逆DCT回路4に供給される。
【0027】
逆DCT回路4は、入力されたDCT係数データに対して、逆離散コサイン変換を行い、画像データを生成する。
【0028】
加算回路5には、逆DCT回路4から出力された画像データが入力される。また、加算回路5には、入力された画像データがPピクチャ又はBピクチャである場合には、その画像データの予測画像が動き補償回路7から入力される。加算回路5は、インターマクロブロックが入力された場合には、入力されたマクロブロックに対して予測画像データを加算する。加算回路5は、イントラマクロブロックが入力された場合には、入力された画像データをそのまま出力する。
【0029】
フレームメモリ6は、加算回路5から出力された画像データをVOP単位で格納する。
【0030】
動き補償回路7は、フレームメモリ6に格納された画像データから、動きベクトルを参照して参照画像を抽出し、抽出した参照画像から現在処理中のマクロブロックに対する予測画像データを生成して加算回路5に供給する。
【0031】
以上のような画像復号装置1では、加算回路5から出力された画像データ(VOP)を出力する。
【0032】
つぎに、動き補償回路7についてさらに詳細に説明をする。
【0033】
図2に、動き補償回路7のブロック構成図を示す。
【0034】
動き補償回路7は、マクロブロック単位で動き補償処理を行う。MPEG4ビジュアル圧縮符号化規格では、輝度成分が16×16ピクセル、クロマ成分が8×8ピクセルでマクロブロックが構成されている。MPEG4ビジュアル圧縮符号化規格における動き補償は、輝度成分、クロマ成分のそれぞれのマクロブロックに対して独立に動き補償がされる。ただし、MPEG4ビジュアル圧縮符号化規格では、動きベクトルが輝度成分のみにしか付加されていないので、クロマ成分の動きベクトルは輝度成分の動きベクトルから算出されることとなる。
【0035】
動き補償回路7は、MV復号部11と、クロマMV演算部12と、MVセレクタ13と、参照画像位置算出部14と、境界外判定部15と、読出アドレス発生部16と、メモリインタフェース(メモリI/F)17と、輝度画像メモリ18と、クロマ画像メモリ19と、水平ピクセル位置発生部21及び垂直ピクセル位置発生部22とから構成されるピクセル位置発生部20と、モード発生部23と、アドレス算出部24と、画像セレクタ25と、補間部26とを備えている。
【0036】
動き補償回路7には、VLC復号回路2から、動き補償対象となるマクロブロックの動き情報が入力される。
【0037】
MV復号部11は、入力された動き情報から、動き補償対象となっているマクロブロックの動きベクトルMVを復号する。復号した動きベクトルMVは、クロマMV演算部12及びMVセレクタ13のそれぞれに入力される。
【0038】
クロマMV演算部12は、入力された動きベクトルMVから、クロマ成分のマクロブロックに対する動きベクトルMVを生成する。MPEG4ビジュアル圧縮符号化規格では、4MVモードと呼ぶ動き補償モードがある。4MVモードは、輝度成分のマクロブロックを8×8ピクセルから構成される4つのサブブロックに分割し、それぞれのサブブロック毎に動き補償を行うモードである。従って、4MVモードで動き補償を行う場合には、1つのマクロブロック内に、4つの動きベクトルMVが存在することとなる。輝度成分とクロマ成分は、通常のモードでは同じ値の動きベクトルMVを用いて動き補償を行うが、4MVモードの場合には、1つのマクロブロックに対して4つの動きベクトルMVがあるため、そのままではクロマ成分の動きベクトルとして用いることができない。そのため、クロマMV演算部12では、4MVモードの場合に、4つの動きベクトルMVを平均化して、クロマ成分用の動きベクトルMVを生成する処理を行う。クロマMV演算部12により生成されたクロマ用の動きベクトルMVは、MVセレクタ13に入力される。
【0039】
MVセレクタ13は、現在処理中のマクロブロックが、輝度成分のマクロブロックか或いはクロマ成分のマクロブロックかに応じて、輝度成分の動きベクトルMVとクロマ成分の動きベクトルMVのうちの一方を選択する。MVセレクタ13は、選択した動きベクトルMVを参照画像位置算出部14に供給する。
【0040】
参照画像位置算出部14は、現在処理中のマクロブロックのVOP上の位置(Hmb,Vmb)及び動きベクトルMVに基づき、参照画像のVOP上の位置(Href,Vref)を算出する。
【0041】
ここで、現在処理中のマクロブロックのVOP上の位置(Hmb,Vmb)、そのマクロブロックの参照画像の位置(Href,Vref)の関係を図3に示す。
【0042】
まず、2次元配列されたピクセルによって構成された空間上での任意のピクセル位置を(H,V)と表す(H,Vはともに整数値)。Hは、ピクセルの水平方向の位置を示し、Vは垂直方向の位置を示している。矩形形状のVOPの左端上端のピクセルは、当該空間上の原点位置(0,0)に配置されているものとする。さらに、矩形形状のVOPの右端下端のピクセルは、当該空間上の(Hmax,Vmax)に配置されているものとする。つまり、矩形形状のVOPの画像サイズは、(Hmax,Vmax)で表される。
【0043】
現在処理中のマクロブロックのVOP上の位置(Hmb,Vmb)は、マクロブロックの左端上端のピクセルの当該空間上における位置で表すものとする。また、参照画像のVOP上の位置(Href,Vref)も、参照画像の左端上端のピクセルの当該空間における位置で表すものとする。
【0044】
なお、マクロブロックのピクセル数は16×16ピクセルであるが、参照画像のピクセル数は18×18ピクセルとなっている。参照画像のピクセル数の方が、マクロブロックのピクセル数よりも水平方向及び垂直方向ともに2ピクセル分大きくなっているのは、ハーフペル予測を用いている場合の補間処理を考慮したものである。
【0045】
また、MPEG4ビジュアル圧縮符号化規格の場合、動き予測のモードとして4MVモードがある。4MVモードの場合、マクロブロック内が8×8ピクセルごとの4つのサブブロックに分割され、それぞれに異なる動きベクトルMVが与えられる。すなわち、各サブブロック毎に異なる参照画像が生成される。そのため、本動き補償装置7の参照画像位置算出部14は、動き予測モードが4MVかその他のモードかに関わらず、サブブロック毎に参照画像(9×9ピクセル)の位置を算出する。そして、以後のこの動き補償装置7では、この参照画像位置算出部14から、輝度画像メモリ18及びクロマ画像メモリ19までのパスでは、参照画像を9×9ピクセル単位で扱う。つまり、この参照画像位置算出部14から、輝度画像メモリ18及びクロマ画像メモリ19までの処理は、1つのマクロブロックに対して、輝度成分4回、クロマ成分1回の合計5回のパスが実行されることとなる。なお、サブブロックに対する参照画像(9×9)の位置は、9×9の参照画像の左端上端のピクセル位置で表すものとする。
【0046】
参照画像位置算出部14は、算出した参照画像(9×9)の位置(Href,Vref)を、境界外判定部15に供給する。
【0047】
境界外判定部15には、参照画像の位置(Href,Vref)及び矩形形状のVOPの画像サイズ(Hmax,Vmax)とに基づき、参照画像毎に、読出画像の位置(X,Y)、水平方向正負フラグHF、垂直方向正負フラグVF、水平方向領域外画素数HD及び垂直方向領域外画素数VDを算出する。
【0048】
読出画像位置(X,Y)は、フレームメモリ6から動き補償処理を行う画像として実際に読み出される読出画像の位置である。フレームメモリ6から読み出された読出画像は、輝度画像メモリ18又はクロマ画像メモリ19に格納される。通常の場合は、参照画像の位置(Href,Vref)が、そのまま読出画像位置(X,Y)となる。しかしながら、VOPの領域外に参照画像が設定された場合には、パディング処理を行うため、実際の参照画像の位置とは異なる位置から一旦画像の読出しを行い、輝度画像メモリ18及びクロマ画像メモリ19に格納する。
【0049】
VOPの領域外に参照画像が設定された場合の読出画像位置(X,Y)について具体的に図4及び図5を参照して説明をする。
【0050】
参照画像に水平方向負側の領域外ピクセルが含まれている場合、読出画像位置(X,Y)は、図4のAに示すように、全てのピクセルがVOP内に収まるように、参照画像位置(Href,Vref)が水平方向に正側に平行移動された位置となる。参照画像に垂直方向負側の領域外ピクセルが含まれている場合、読出画像位置(X,Y)は、図4のBに示すように、全てのピクセルがVOP内に収まるように、参照画像位置(Href,Vref)が垂直方向に正側に平行移動された位置となる。参照画像に垂直方向負側の領域外ピクセル及び水平方向負側の両者の領域外ピクセルが含まれている場合、読出画像位置(X,Y)は、図4のCに示すように、原点位置(0,0)となる。
【0051】
また、参照画像の全てのピクセルが水平方向正側の領域外ピクセルである場合、読出画像位置(X,Y)は、図5のAに示すように、水平方向の1ピクセルのみがVOP内に収まるように、参照画像位置(Href,Vref)が水平方向に負側に平行移動された位置となる。ただし、参照画像に水平方向正側の領域外ピクセルが含まれている場合であっても、1ピクセル以上のVOPの領域内のピクセルが水平方向に含まれている場合は、図5のBに示すように、参照画像位置(Href,Vref)がそのまま読出画像位置(X,Y)となる。また、参照画像の全てのピクセルが垂直方向正側の領域外ピクセルである場合、読出画像位置(X,Y)は、図5のCに示すように、垂直方向の1ピクセルのみがVOP内に収まるように、参照画像位置(Href,Vref)が垂直方向に負側に平行移動された位置となる。ただし、参照画像に垂直方向正側の領域外ピクセルが含まれている場合であっても、1ピクセル以上のVOPの領域内のピクセルが垂直方向に含まれている場合は、図5のDに示すように、参照画像位置(Href,Vref)がそのまま読出画像位置(X,Y)となる。また、参照画像の全てのピクセルが垂直方向正側の領域外ピクセル及び水平方向正側の両者の領域外ピクセルである場合には、図5のEに示すように、読出画像位置(X,Y)は、VOPの右端下端の位置(Hmax,Vmax)となる。
【0052】
水平方向正負フラグHFは、参照画像位置(X,Y)が原点位置(0,0)より水平方向の負側に位置するか否かを示すフラグである。つまり、Xが負の値であるか否かを示すフラグである。水平方向正負フラグHFは、図6のA,B,Cに示すように、参照画像位置(X,Y)が水平方向の負側に位置する場合には“1”となり、図6のD,E,F,Gに示すように、水平方向が0又は正側に位置する場合には“0”となる。垂直方向正負フラグDFは、参照画像位置(X,Y)が原点位置(0,0)より垂直方向の負側に位置するか否かを示すフラグである。つまり、Yが負の値であるか否かを示すフラグである。垂直方向正負フラグは、図6のA,D,Eに示すように、参照画像が垂直方向の負側に位置する場合には“1”となり、図6のB,C,F,Gに示すように、垂直方向が0又は正側に位置する場合には“0”となる。
【0053】
水平方向領域外画素数HDは、参照画像に含まれている境界外ピクセルの水平方向の数である。なお、水平方向領域外画素数HDは、例えば、図6のA,B,Cに示すように、水平方向負側の境界外ピクセルがある場合には、その値はマイナス値を示し、図6のEに示すように、水平方向正側の境界外ピクセルがある場合には、その値はプラスの値を示す。垂直方向領域外画素数VDは、参照画像に含まれている境界外ピクセルの垂直方向の数である。なお、垂直方向領域外画素数VDは、例えば、図6のA,D,Eに示すように、垂直方向負側の境界外ピクセルがある場合には、その値はマイナス値を示し、図6のC,Gに示すように、垂直方向正側の境界外ピクセルがある場合には、その値はプラスの値を示す。
【0054】
具体的に、読出画像位置(X,Y)、水平方向正負フラグHF、垂直方向正負フラグVF、水平方向領域外画素数HD、垂直方向領域外画素数VDの算出演算式を以下に示す。なお、Rsizeは、参照画像の水平方向の画素数から1を引いた値、すなわち、8である。
【0055】
まず、参照画像の水平方向の位置(Href)の値を判断する。
【0056】
Hrefが0より小さい(Href<0)場合は、
X =0 ,HF=1 ,HD=Href
と設定する。
【0057】
Hrefが0以上でありHmax以下(0≦Href≦Hmax)である場合は、
X =Href ,HF=0 ,HD=Href−(Hmax−Rsize)
と設定する。
【0058】
HrefがHmaxより大きい(Href>Hmax)場合は、
X =Hmax ,HF=0 ,HD=Href−(Hmax−Rsize)
と設定する。
【0059】
続いて、参照画像の垂直方向の位置(Vref)の値を判断する。
【0060】
Vrefが0より小さい(Vref<0)場合は、
Y =0 ,VF=1 ,VD=Vref
と設定する。
【0061】
Vrefが0以上でありVmax以下(0≦Vref≦Vmax)である場合は、
Y =Vref ,VF=0 ,VD=Href−(Vmax−Rsize)
と設定する。
【0062】
VrefがVmaxより大きい(Vref>Vmax)場合は、
Y =Vmax ,VF=0 ,VD=Vref−(Vmax−Rsize)
と設定する。
【0063】
以上のように境界外判定部15により算出された読出画像位置(X,Y)は、読出アドレス発生部16に供給される。境界外判定部15により算出された水平方向正負フラグHF及び水平方向領域外画素数HDは、ピクセル位置発生部20の水平ピクセル位置発生部21のに供給される。境界外判定部15により算出された垂直方向正負フラグVF及び垂直方向領域外画素数VDは、ピクセル位置発生部20の垂直ピクセル位置発生部22に供給される。
【0064】
読出アドレス発生部16は、読出画像位置(X,Y)に基づき、読出画像を構成する全ピクセル(9×9)のフレームメモリ6上のアドレスを生成する。読出アドレス発生部16は、生成した全ピクセルのアドレスとともにデータ読出し命令を、メモリI/F17を介してフレームメモリ6に与える。フレームメモリ6は、読出アドレス発生部16からデータ読出し命令が与えられると、指定されたアドレスのデータをメモリI/F17を介して輝度画像メモリ18又はクロマ画像メモリ19に転送する。すなわち、境界外判定部15により算出された読出画像が、フレームメモリ6から輝度画像メモリ18又はクロマ画像メモリ19に格納される。
【0065】
輝度画像メモリ18は、フレームメモリ6から転送された画像のうち、輝度成分の読出画像を格納する。クロマ画像メモリ19は、フレームメモリ6から転送された画像のうち、クロマ成分の画像を格納する。
【0066】
ピクセル位置発生部20は、輝度画像メモリ18及びクロマ画像メモリ19に格納されている読出画像を読み出すためのピクセル位置を発生する。ピクセル位置発生部20は、水平ピクセル位置発生部21と垂直ピクセル位置発生部22とから構成されている。水平ピクセル位置発生部21は、読出画像内の水平方向のピクセル位置(Hposi)を発生する。垂直ピクセル位置発生部22は、読出画像内の垂直方向のピクセル位置(Vposi)を発生する。輝度画像メモリ18及びクロマ画像メモリ19には、9×9ピクセルから構成される読出画像が格納されている。ピクセル位置発生部20は、通常の場合は、9×9ピクセルの読出画像に対して、右端上端のピクセルから、右から左、上から下という順序で、1ピクセル毎に順番にピクセルを指定していく。さらに、ピクセル位置発生部20は、参照画像に対してパディング処理を行う場合には、上述の通常の場合のピクセル位置の指定順序とは異なる順序で、読出画像内のピクセル位置を指定していく。水平ピクセル位置発生部21及び垂直ピクセル位置発生部22の構成及び動作については、その詳細な説明を後述する。
【0067】
ピクセル位置発生部20から発生されたピクセル位置(Hposi,Vposi)は、アドレス演算部24に供給される。
【0068】
モード発生部23は、現在処理中のマクロブロック(動き補償対象となっているマクロブロック)の動き補償モード情報MMを出力する。モード発生部23により発生された動き補償モード情報MMは、アドレス演算部24に供給される。
【0069】
アドレス演算部24は、ピクセル位置発生部20から出力されたピクセル位置情報を、動き補償モードに対応したピクセル位置に変換する。動き補償モードMMには、フィールド予測モード、フレーム予測モード又は4MVモード等の各種のモードがあるが、各モード毎に参照画像中から読み出すピクセルの順番が異なる。それに対して、ピクセル位置発生部20から出力されるピクセル位置の発生順序は、モードに関わらず一定となる。従って、アドレス演算部24は、動き補償モードMMに応じて、ピクセル位置発生部20から出力されたピクセル位置を補正する。そして、補正したピクセル位置に対応した輝度画像メモリ18及びクロマ画像メモリ19上のアドレスを演算し、そのアドレスから輝度画像メモリ18及びクロマ画像メモリ19に格納されているピクセルデータを出力する。
【0070】
画像セレクタ25は、現在処理をしている動き補償対象のマクロブロックが、輝度成分のマクロブロックか或いはクロマ成分のマクロブロックかに応じて、アドレス演算部24によって読み出された輝度画像又はクロマ画像のうちの一方を選択する。画像セレクタ25は、選択した画像データを補間部26に供給する。
【0071】
補間部26は、輝度画像メモリ18又はクロマ画像メモリ19から読み出された画像データのピクセル位置が、半画素分ずれた位相に位置している場合には、補間処理を行う。補間部26は、補間処理を行うと、サブブロック単位で処理がされてきた参照画像を合成して、16×16画素の予測画像を生成する。
【0072】
そして、以上のように構成される動き補償回路7により生成された予測画像は、現在処理をしている動き補償対象のマクロブロックに加算される。以上のように生成された予測画像をマクロブロックに対して加算することによって、当該マクロブロックに対する動き補償が行われることとなる。
【0073】
つぎに、水平ピクセル位置発生部21及び垂直ピクセル位置発生部22の回路構成について説明をする。
【0074】
水平ピクセル位置発生部21の回路構成を図7に示す。
【0075】
水平ピクセル位置発生部21は、カラムカウンタ31と、カラムカウンタ補正回路32とから構成されている。
【0076】
カラムカウンタ31は、本動き補償装置7の動作クロックに同期して、出力値を1ステップずつカウントアップする回路である。カラムカウンタ31の出力値の範囲は、0からmaxまでであり、0からmaxまでを巡回的にカウントしていく。maxは、読出画像の水平方向のピクセル数から1を引いた値である。すなわち、max=8であり、カラムカウンタ31は0から8までの値を巡回的に発生する。さらに、カラムカウンタ31は、8から0へ値を変化するときに、キャリーアウトCO信号(桁上がり信号)を発生する。
【0077】
カラムカウンタ補正回路32は、第1の加算器33と、第1のセレクタ34と、第2の加算器35と、第2のセレクタ36と、補正カウンタ37と、第3の加算器38と、比較器39とから構成されている。
【0078】
第1の加算器33は、カラムカウンタ31の出力値に、第1のセレクタ34から出力される第1の補正値を加算する。また、第1の加算器33は、加算結果が負の値となったときには、出力値を0にクリップする。第1のセレクタ34は、水平方向領域外画素数HD又は0のいずれかの値を、第1の補正値として出力する。第1のセレクタ34は、水平方向正負フラグHFが1のときには水平方向領域外画素数HDを第1の補正値に選択し、水平方向正負フラグHFが0のときには“0”を第1の補正値に選択する。なお、水平方向正負フラグHFが1となっているときは、水平方向領域外画素数HDは負の値となっている。
【0079】
第2の加算器35は、第1の加算器33から出力された値から、第2のセレクタ36から出力される第2の補正値を減算する。第2のセレクタ36は、補正カウンタ37の出力値又は0のいずれかの値を、第2の補正値として出力する。第2のセレクタ36は、水平方向正負フラグHFが1のときには“0”を第2の補正値に選択し、水平方向正負フラグHFが0のときには補正カウンタ37の出力値を第2の補正値に選択する。
【0080】
第3の加算器38は、“max”から水平方向領域外画素数HDを減算する。maxはカラムカウンタ31の最大カウント値であるので、ここでは、max=8である。第3の加算器38の出力値は、比較器39のマイナス入力端子に入力される。比較器39のプラス入力端子には、カラムカウンタ31の出力値が入力される。比較器39は、プラス入力端子に入力された値がマイナス入力端子に入力された値以上となった場合には、“1”を出力し、プラス入力端子に入力された値がマイナス入力端子に入力された値より小さい場合には、“0”を出力する。
【0081】
補正カウンタ37は、本動き補償装置7の動作クロックに同期して、出力値を1ステップずつカウントアップする回路である。補正カウンタ37の出力値の範囲は、0からmaxまでであり、0からmaxまでを1ステップずつカウントしていく。maxは、読出画像の水平方向のピクセル数から1を引いた値である。すなわち、max=8であり、補正カウンタ37は0から8までの数値を発生する。また、補正カウンタ37のイネーブル端子には、比較器39の出力値が入力される。補正カウンタ37のクリア端子には、比較器39の出力値の反転値が入力される。補正カウンタ37は、イネーブル端子に入力されている値が“1”のときのみ出力値を更新する。補正カウンタ37は、クリア端子に入力されている値が“0”のときには出力値を強制的に0とする。
【0082】
以上のような構成のカラムカウンタ補正回路32は、第2の加算器35の出力値を、水平ピクセル位置Hposiとして出力する。
【0083】
垂直ピクセル位置発生部22の構成を図8に示す。
【0084】
垂直ピクセル位置発生部22は、ラインカウンタ41と、ラインカウンタ補正回路42とから構成されている。
【0085】
ラインカウンタ41は、カラムカウンタ31のキャリーアウト信号(CO)に同期して、出力値を1ステップずつカウントアップする回路である。ラインカウンタ41の出力値の範囲は、0からmaxまでであり、0からmaxまでを巡回的にカウントしていく。maxは、読出画像の垂直方向のピクセル数から1を引いた値である。すなわち、max=8であり、ラインカウンタ41は0から8までの値を巡回的に発生する。
【0086】
ラインカウンタ補正回路42は、第1の加算器43と、第1のセレクタ44と、第2の加算器45と、第2のセレクタ46と、補正カウンタ37と、第3の加算器48と、比較器49とから構成されている。
【0087】
第1の加算器43は、ラインカウンタ41の出力値に、第1のセレクタ44から出力される第1の補正値を加算する。また、第1の加算器43は、加算結果が負の値となったときには、出力値を0にクリップする。第1のセレクタ44は、垂直方向領域外画素数VD又は0のいずれかの値を、第1の補正値として出力する。第1のセレクタ44は、垂直方向正負フラグVFが1のときには垂直方向領域外画素数VDを第1の補正値に選択し、垂直方向正負フラグVFが0のときには“0”を第1の補正値に選択する。なお、垂直方向正負フラグVFが1となっているときは、垂直方向領域外画素数VDは負の値となっている。
【0088】
第2の加算器45は、第1の加算器43から出力された値から、第2のセレクタ46から出力される第2の補正値を減算する。第2のセレクタ46は、補正カウンタ47の出力値又は0のいずれかの値を、第2の補正値として出力する。第2のセレクタ46は、垂直方向正負フラグVFが1のときには“0”を第2の補正値に選択し、垂直方向正負フラグVFが0のときには補正カウンタ47の出力値を第2の補正値に選択する。
【0089】
第3の加算器48は、“max”から垂直方向領域外画素数VDを減算する。maxはラインカウンタ41の最大カウント値であるので、ここでは、max=8である。第3の加算器48の出力値は、比較器49のマイナス入力端子に入力される。比較器49のプラス入力端子には、ラインカウンタ41の出力値が入力される。比較器49は、プラス入力端子に入力された値がマイナス入力端子に入力された値以上となった場合には、“1”を出力し、プラス入力端子に入力された値がマイナス入力端子に入力された値より小さい場合には、“0”を出力する。
【0090】
補正カウンタ47は、カラムカウンタ31から出力されたキャリーアウト信号(CO)に同期して、出力値を1ステップずつカウントアップする回路である。補正カウンタ47の出力値の範囲は、0からmaxまでであり、0からmaxまでを1ステップずつカウントしていく。maxは、読出画像の垂直方向のピクセル数から1を引いた値である。すなわち、max=8であり、補正カウンタ47は0から8までの数値を発生する。また、補正カウンタ47のイネーブル端子には、比較器49の出力値が入力される。補正カウンタ47のクリア端子には、比較器49の出力値の反転値が入力される。補正カウンタ47は、イネーブル端子に入力されている値が“1”のときのみ出力値を更新する。補正カウンタ47は、クリア端子に入力されている値が“0”のときには出力値を強制的に0とする。
【0091】
以上のような構成のラインカウンタ補正回路42は、第2の加算器45の出力値を、垂直ピクセル位置Vposiとして出力する。
【0092】
つぎに、以上のような構成の水平ピクセル位置発生部21(垂直ピクセル位置発生部22)内のカラムカウンタ31(ラインカウンタ41)の出力値と、水平ピクセル位置Hposi(垂直ピクセル位置Vposi)との関係について、図9及び図10を参照して説明をする。なお、カラムカウンタ31と水平ピクセル位置Hposiと関係、並びに、ラインカウンタ41と垂直ピクセル位置Vposiとの関係は、同一であるので、以下、水平方向についてのみ説明をする。
【0093】
HF=−1,HD=−1の場合、水平ピクセル位置Hposiは、図9(A)に示すようになる。また、HF=−1,HD=−5の場合、水平方向ピクセル位置Hposiは、図9(B)に示すようになる。すなわち、HF=−1の場合、水平ピクセル位置Hposiは、カラムカウンタ31の出力値にHDを加算した値となり、さらに、その加算値が負の値となる場合には常に0となる。
【0094】
参照画像が水平方向負側の領域外にずれて位置している場合、そのずれ分だけ水平方向の正側に平行移動させた読出画像が、輝度画像メモリ18及びクロマ画像メモリ19に格納されている。従って、カラムカウンタ補正回路32は、参照画像が水平方向負側の領域外にずれて位置している場合には、カラムカウンタ31の出力値に水平方向領域外画素数HDを加算することによって、カラムカウンタ31の出力値をそのずれ分だけ負側にシフトさせた水平方向ピクセル位置Hposiを発生する。このようにカラムカウンタ31の出力値を上記のずれ分だけシフトさせることにより、読出画像から、本来の参照画像を取得することができる。
【0095】
ただし、カラムカウンタ補正回路32は、水平ピクセル位置Hposiがマイナスの値となる場合、水平ピクセル位置Hposiを0にクリップしている。つまり、参照画像の水平方向のピクセルのうちVOPの負側の領域外に位置するピクセルに対しては、水平ピクセル位置Hposiとして、水平方向の位置が0のピクセル、つまり、VOPの水平方向の境界位置のピクセルを指定している。カラムカウンタ補正回路32は、以上のようにカラムカウンタ31の出力値の補正を行うことによって、VOPの負側の領域外に位置するピクセルのデータを、VOPの水平方向の境界位置のピクセルデータに置き換えている。すなわち、カラムカウンタ補正回路32は、水平方向負側の領域外のピクセルに対するパディング処理を行っている。
【0096】
HF=1,HD=1の場合、水平ピクセル位置Hposiは、図10(A)に示すようになる。HF=1,HD=2の場合、水平方向ピクセル位置Hposiは、図10(B)に示すようになる。HF=1,HD=3の場合、水平ピクセル位置Hposiは、図10(C)に示すようになる。また、HF=1,HD=−X (Xは、任意の自然数)の場合、水平ピクセル位置Hposiは、図10(D)に示すようになる。すなわち、HF=1の場合である場合には、水平ピクセル位置Hposiの値は、カラムカウンタ31の出力値が(8−HD)以下のときは、カラムカウンタ31の値となり、さらに、カラムカウンタ31の出力値が(8−HD)となった以後は(8−HD)で一定となる。
【0097】
参照画像が水平方向の正側に位置している場合、参照画像内のピクセルのうち少なくとも1つのピクセルが水平方向の領域内にあれば、参照画像と同じ位置から読み出された読出画像が輝度画像メモリ18及びクロマ画像メモリ19に格納されている。従って、カラムカウンタ補正回路32は、参照画像が水平方向の正側に位置している場合には、カラムカウンタ31の出力値をそのまま水平方向ピクセル位置Hposiとして出力する。このようにカラムカウンタ31の出力値をそのまま水平方向ピクセル位置Hposiとして出力することによって、読出画像から、本来の参照画像を取得することができる。
【0098】
もっとも、参照画像が水平方向の正側の領域外にずれて位置している場合には、その領域外のピクセル位置に対しては、水平方向の位置がHmaxのピクセル、すなわち、水平方向の正側の境界位置のピクセル位置を指定している。カラムカウンタ補正回路32は、以上のようにカラムカウンタ31の出力値の補正を行うことによって、VOPの正側の領域外に位置するピクセルのデータを、VOPの水平方向の境界位置のピクセルデータに置き換えている。すなわち、カラムカウンタ補正回路32は、水平方向正側の領域外のピクセルに対するパディング処理を行っている。
【0099】
以上のように動き補償装置7では、カラムカウンタ31及びラインカウンタ41によって参照画像のピクセル位置を発生し、カラムカウンタ補正回路32及びラインカウンタ補正回路42によって、そのピクセル位置が補正される。カラムカウンタ補正回路32及びラインカウンタ補正回路42では、参照画像がVOPの領域外に位置する場合には、カラムカウンタ31及びラインカウンタ41から発生されたピクセル位置を、VOPの領域内に含まれているピクセルの位置に補正する。
【0100】
以上のようにカウンタを用いることによって、動き補償装置7では、動き補償用のフレームメモリを拡張せずに、高速にパディング処理を行うことができる。
【0101】
【発明の効果】
本発明にかかる動き補償装置では、ピクセルカウンタによって、参照画像内の全ピクセルに対する参照画像上でのピクセル位置が発生され、基準位置算出手段によって、参照画像のVOP内における位置を示す参照画像位置情報が算出される。そして、この参照画像位置情報とピクセル位置情報とにより、VOPから参照画像が読み出される。さらに、本発明にかかる動き補償装置では、参照画像がVOPの領域外に位置する場合には、位置補正手段によって、ピクセルカウンタから発生されたピクセル位置を、VOPの領域内に含まれているピクセルの位置に補正する。
【0102】
このため、本発明にかかる動き補償装置では、動き補償用のフレームメモリを拡張せずに、高速にパディング処理を行うことができる。
【図面の簡単な説明】
【図1】本発明の実施の形態の画像復号装置のブロック構成図である。
【図2】上記画像復号装置に備えられている動き補償回路のブロック構成図である。
【図3】現在処理中のマクロブロックのVOP上の位置(Hmb,Vmb)、そのマクロブロックの参照画像の位置(Href,Vref)の関係を説明するための図である。
【図4】VOPの負側の領域外に参照画像が設定された場合の読出画像を示す図である。
【図5】VOPの正側の領域外に参照画像が設定された場合の読出画像を示す図である。
【図6】参照画像毎に算出される水平方向正負フラグHF及び垂直方向正負フラグVFの内容を説明するための図である。
【図7】水平ピクセル位置発生部の回路図である。
【図8】垂直ピクセル位置発生部の回路図である。
【図9】水平方向正負フラグ(HF)が負であった場合の、カラムカウンタ(ラインカウンタ)の出力値と、水平ピクセル位置Hposi(垂直ピクセル位置Vposi)との関係を示す図である。
【図10】水平方向正負フラグ(HF)が正であった場合の、カラムカウンタ(ラインカウンタ)の出力値と、水平ピクセル位置Hposi(垂直ピクセル位置Vposi)との関係を示す図である。
【図11】MPEG4で規定されているVOPについて説明をするための図である。
【図12】VOPの領域外にある参照画像について説明をするための図である。
【図13】水平方向のパディング処理について説明をするための図である。
【図14】垂直方向のパディング処理について説明をするための図である。
【図15】水平方向及び垂直方向のパディング処理について説明をするための図である。
【符号の説明】
1 画像復号装置、6 フレームメモリ、7 動き補償回路、14 参照画像位置算出部、15 境界外判定部、16 読出アドレス発生部、17 メモリI/F、18 輝度画像メモリ、19 クロマ画像メモリ、21 水平ピクセル位置発生部、22 垂直ピクセル位置発生部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a motion compensation device used in a decoding device for decoding moving image encoded data such as MPEG4 (ISO / IEC 14496-2).
[0002]
[Prior art]
In the MPEG4 visual compression coding standard (ISO / IEC 14496-2), image compression is performed in image units called video object planes (VOP). VOP means a two-dimensional image at a certain point in time of objects continuous in the time direction. The VOP is, for example, a rectangular object representing the background of the screen as shown in FIG. 11A, an arbitrarily shaped object representing a person or an object appearing in the screen as shown in FIG. Is a display image at an arbitrary time position. According to the MPEG4 visual compression encoding standard, one or more VOPs existing at the same time are encoded independently and decoded independently.
[0003]
In the MPEG4 visual compression coding standard, compression coding using image correlation in the time direction is performed using motion prediction. That is, when compression encoding is performed on a VOP at a certain time, motion prediction of an image from the past or the future to the current time is performed, and a predicted image from a past or future image is generated based on the amount of motion, The amount of information is compressed by subtracting the predicted image from this image. In the MPEG4 visual compression coding standard, motion prediction is performed in units of macroblocks composed of 16 × 16 (vertical × horizontal) pixels, similarly to MPEG2.
[0004]
By the way, in the MPEG4 visual compression encoding standard, when encoding is performed on a rectangular VOP, the reference image specified by the motion vector may be outside the region of the VOP. For example, some or all of the pixels of the reference image may be outside the horizontal region of the VOP as shown in FIG. 12A, or part or all of the reference image as shown in FIG. 12B. May be outside the vertical region of the VOP, or all the pixels of the reference image may be out of the region in both the horizontal and vertical directions of the VOP as shown in FIG.
[0005]
However, if some or all of the pixels in the reference image are outside the VOP area, there is no data in the area outside the VOP area. Processing cannot be performed. Therefore, in the MPEG4 visual compression coding standard, when some or all of the pixels of the reference image are outside the VOP area, it is necessary to generate data for pixels located outside the area (out-of-area pixels) at the time of decoding. There is. In the MPEG4 visual compression coding standard, a process for generating out-of-region pixel data is called a padding process.
[0006]
Examples of the reference image padding process are shown in FIGS.
[0007]
In general, the reference image is padded by copying pixel data in the VOP closest to the out-of-region pixel to the out-of-region pixel.
[0008]
For example, as shown in FIG. 13, when there is an out-of-region pixel outside the horizontal region of the VOP, the pixel data that is located at the horizontal boundary in the VOP and is closest to the out-of-region pixel Is padded to the out-of-region pixel. For example, as shown in FIG. 14, when there is an out-of-region pixel outside the vertical region of the VOP, the pixel data that is located at the vertical boundary in the VOP and is closest to the out-of-region pixel Is copied to out-of-region pixels to perform padding processing. For example, as shown in FIG. 15, when there are out-of-region pixels outside the region in both the horizontal and vertical directions of the VOP, the pixels (corner portion pixels) located at the horizontal and vertical boundaries in the VOP. The padding process is performed by copying the pixel data closest to the out-of-region pixel to the out-of-region pixel.
[0009]
[Problems to be solved by the invention]
However, conventionally, in order to perform the padding processing of the reference image, it has been necessary to generate an image in which the boundary pixels of the VOP are expanded in the horizontal direction and the vertical direction, and store the image in the frame memory to perform motion compensation. . Therefore, in the conventional padding process of the reference image, the process cannot be performed unless the size of the frame memory is expanded. Although it is possible to perform padding processing by software without expanding the frame memory, the processing time for padding processing is consumed, so the processing time is longer than normal motion compensation processing. .
[0010]
The present invention has been proposed in view of such a conventional situation, and an object of the present invention is to provide a motion compensation device capable of performing padding processing at high speed without expanding a frame memory for motion compensation. And
[0011]
[Means for Solving the Problems]
The motion compensation apparatus according to the present invention receives encoded data and performs motion compensation on an arbitrary macroblock of an arbitrary video object plane (VOP) of the encoded data.
[0012]
A VOP is a two-dimensional image in which pixels are arranged in a rectangular shape. The macro block is a two-dimensional pixel block having a predetermined number of pixels constituting the VOP. Further, the encoded data is obtained by encoding a moving image signal in which VOPs are arranged in the time direction, and is obtained by performing image compression using motion prediction for each macroblock for the encoding. .
[0013]
The motion compensation apparatus according to the present invention includes a reference position calculation unit, a pixel counter, an out-of-region determination unit, a position correction unit, an address generation unit, and a compensation unit.
[0014]
Based on the position information in the VOP of the macro block to be compensated for motion (target macro block) and the motion information of the target macro block, the reference position calculation means 2 in other VOPs referenced by the target macro block by motion prediction. Reference image position information indicating the position of the dimensional pixel block (reference image) in the VOP is calculated.
[0015]
The pixel counter counts the operating clock and generates pixel positions on the reference image for all pixels in the reference image.
[0016]
The out-of-region determination means determines whether at least one pixel in the reference image is located outside the region of the VOP based on the size of the VOP and the reference image position information, and the at least one pixel in the reference image is VOP If it is located outside the region, the out-of-region pixel position indicating the position of the pixel outside the region in the reference image and the out-of-region flag indicating that the reference image is outside the VOP region are generated.
[0017]
The position correction means corrects the pixel position output from the pixel counter.
[0018]
The address generation means generates an address of one pixel in the VOP including the reference image based on the pixel position output from the pixel counter and the reference image standard position. Further, when the out-of-region flag is generated and the pixel position output from the pixel counter coincides with the out-of-region pixel position, the position correcting unit determines the pixel position generated from the pixel counter as the VOP. Correct to the position of the pixels contained in the region.
[0019]
The compensation unit sequentially reads out pixels from the VOP including the reference image based on the address generated by the address generation unit, generates a reference image using the read pixel, and creates a macroblock using the generated reference image. Motion compensation is performed for this.
[0020]
In the motion compensation apparatus configured as described above, the pixel counter generates pixel positions on the reference image for all pixels in the reference image, and the reference position calculation means indicates the reference image position indicating the position of the reference image in the VOP. Information is calculated. A reference image is read from the VOP based on the reference image position information and the pixel position information.
[0021]
Further, in the motion compensation device, when the reference image is located outside the VOP region, the pixel position generated from the pixel counter by the position correction unit is changed to the pixel position included in the VOP region. to correct.
[0022]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an image decoding device to which the present invention is applied will be described as an embodiment of the present invention. The image decoding apparatus described below is an image decoding apparatus corresponding to the simple profile of the MPEG4 visual compression coding standard. That is, it is a device that decodes moving image encoded data composed of a rectangular video object plane (VOP).
[0023]
FIG. 1 shows a block configuration diagram of an image decoding apparatus 1 according to an embodiment of the present invention.
[0024]
As shown in FIG. 1, the image decoding apparatus 1 includes a VLC decoding circuit 2, an inverse quantization circuit 3, an inverse discrete cosine transform (DCT) circuit 4, an adder circuit 5, a frame memory 6, and a motion compensation circuit. 7.
[0025]
The VLC decoding circuit 2 receives a data stream encoded according to the MPEG4 visual compression encoding standard. The VLC decoding circuit 2 performs a variable length code decoding process on the input data stream. The input data stream includes DCT coefficient data and motion information (motion mode, motion vector, etc.). The VLC decoding circuit 2 supplies DCT coefficient data to the inverse quantization circuit 3 and supplies motion information to the motion compensation circuit 7.
[0026]
The inverse quantization circuit 3 is input with DCT coefficient data in a quantized state. The quantization circuit 3 performs inverse quantization processing on the input data using a predetermined quantization scale. The inversely quantized DCT coefficient data is supplied to the inverse DCT circuit 4.
[0027]
The inverse DCT circuit 4 performs inverse discrete cosine transform on the input DCT coefficient data to generate image data.
[0028]
Image data output from the inverse DCT circuit 4 is input to the adder circuit 5. Further, when the input image data is a P picture or a B picture, the prediction circuit of the image data is input from the motion compensation circuit 7 to the adder circuit 5. When an inter macroblock is input, the adder circuit 5 adds the predicted image data to the input macroblock. When an intra macroblock is input, the adder circuit 5 outputs the input image data as it is.
[0029]
The frame memory 6 stores the image data output from the adder circuit 5 in units of VOPs.
[0030]
The motion compensation circuit 7 extracts a reference image from the image data stored in the frame memory 6 with reference to a motion vector, generates predicted image data for the currently processed macroblock from the extracted reference image, and adds an adder circuit 5 is supplied.
[0031]
The image decoding apparatus 1 as described above outputs the image data (VOP) output from the adder circuit 5.
[0032]
Next, the motion compensation circuit 7 will be described in more detail.
[0033]
FIG. 2 shows a block diagram of the motion compensation circuit 7.
[0034]
The motion compensation circuit 7 performs motion compensation processing in units of macro blocks. In the MPEG4 visual compression coding standard, a macro block is composed of a luminance component of 16 × 16 pixels and a chroma component of 8 × 8 pixels. In motion compensation in the MPEG4 visual compression coding standard, motion compensation is performed independently for each macro block of the luminance component and the chroma component. However, in the MPEG4 visual compression coding standard, since the motion vector is added only to the luminance component, the motion vector of the chroma component is calculated from the motion vector of the luminance component.
[0035]
The motion compensation circuit 7 includes an MV decoding unit 11, a chroma MV calculation unit 12, an MV selector 13, a reference image position calculation unit 14, an out-of-boundary determination unit 15, a read address generation unit 16, a memory interface (memory I / F) 17, luminance image memory 18, chroma image memory 19, pixel position generation unit 20 including a horizontal pixel position generation unit 21 and a vertical pixel position generation unit 22, a mode generation unit 23, An address calculation unit 24, an image selector 25, and an interpolation unit 26 are provided.
[0036]
The motion compensation circuit 7 is input with motion information of a macroblock to be motion compensated from the VLC decoding circuit 2.
[0037]
The MV decoding unit 11 decodes the motion vector MV of the macroblock that is the target of motion compensation from the input motion information. The decoded motion vector MV is input to each of the chroma MV calculation unit 12 and the MV selector 13.
[0038]
The chroma MV calculation unit 12 generates a motion vector MV for the macro block of the chroma component from the input motion vector MV. In the MPEG4 visual compression coding standard, there is a motion compensation mode called a 4MV mode. The 4MV mode is a mode in which a macro block of a luminance component is divided into four sub blocks each composed of 8 × 8 pixels, and motion compensation is performed for each sub block. Therefore, when motion compensation is performed in the 4MV mode, there are four motion vectors MV in one macroblock. For the luminance component and the chroma component, motion compensation is performed using the motion vector MV having the same value in the normal mode. However, in the 4MV mode, there are four motion vectors MV for one macroblock. Therefore, it cannot be used as a motion vector for chroma components. Therefore, the chroma MV calculation unit 12 performs a process of averaging the four motion vectors MV to generate a chroma component motion vector MV in the 4MV mode. The chroma motion vector MV generated by the chroma MV calculation unit 12 is input to the MV selector 13.
[0039]
The MV selector 13 selects one of the luminance component motion vector MV and the chroma component motion vector MV depending on whether the macro block currently being processed is a luminance component macro block or a chroma component macro block. . The MV selector 13 supplies the selected motion vector MV to the reference image position calculation unit 14.
[0040]
The reference image position calculation unit 14 calculates the position (Href, Vref) on the VOP of the reference image based on the position (Hmb, Vmb) on the VOP of the currently processed macroblock and the motion vector MV.
[0041]
Here, FIG. 3 shows the relationship between the position (Hmb, Vmb) on the VOP of the currently processed macroblock and the position (Href, Vref) of the reference image of the macroblock.
[0042]
First, an arbitrary pixel position in a space constituted by two-dimensionally arranged pixels is represented as (H, V) (H and V are both integer values). H indicates the horizontal position of the pixel, and V indicates the vertical position. It is assumed that the pixel at the upper left end of the rectangular VOP is arranged at the origin position (0, 0) in the space. Further, it is assumed that the pixel at the lower right end of the rectangular VOP is arranged at (Hmax, Vmax) in the space. That is, the image size of the rectangular VOP is represented by (Hmax, Vmax).
[0043]
The position (Hmb, Vmb) on the VOP of the currently processed macroblock is represented by the position in the space of the upper leftmost pixel of the macroblock. Also, the position (Href, Vref) on the VOP of the reference image is also represented by the position in the space of the upper left pixel of the reference image.
[0044]
The number of pixels of the macroblock is 16 × 16 pixels, but the number of pixels of the reference image is 18 × 18 pixels. The reason why the number of pixels of the reference image is larger by 2 pixels in both the horizontal direction and the vertical direction than the number of pixels of the macroblock is that the interpolation processing in the case of using half-pel prediction is taken into consideration.
[0045]
In the case of the MPEG4 visual compression coding standard, there is a 4MV mode as a motion prediction mode. In the 4MV mode, the macroblock is divided into 4 sub-blocks every 8 × 8 pixels, and different motion vectors MV are given to each. That is, a different reference image is generated for each sub-block. Therefore, the reference image position calculation unit 14 of the motion compensation device 7 calculates the position of the reference image (9 × 9 pixels) for each sub-block regardless of whether the motion prediction mode is 4MV or other modes. In the subsequent motion compensation device 7, the reference image is handled in units of 9 × 9 pixels in the path from the reference image position calculation unit 14 to the luminance image memory 18 and the chroma image memory 19. In other words, the processing from the reference image position calculation unit 14 to the luminance image memory 18 and the chroma image memory 19 is performed for a total of five passes of four luminance components and one chroma component for one macroblock. Will be. Note that the position of the reference image (9 × 9) with respect to the sub-block is represented by the pixel position at the upper left end of the 9 × 9 reference image.
[0046]
The reference image position calculation unit 14 supplies the calculated position (Href, Vref) of the reference image (9 × 9) to the out-of-boundary determination unit 15.
[0047]
Based on the reference image position (Href, Vref) and the rectangular VOP image size (Hmax, Vmax), the out-of-boundary determination unit 15 determines the read image position (X, Y), horizontal, for each reference image. The direction positive / negative flag HF, the vertical direction positive / negative flag VF, the horizontal direction outside pixel number HD, and the vertical direction outside pixel number VD are calculated.
[0048]
The read image position (X, Y) is the position of the read image that is actually read from the frame memory 6 as an image on which motion compensation processing is performed. The read image read from the frame memory 6 is stored in the luminance image memory 18 or the chroma image memory 19. In a normal case, the position (Href, Vref) of the reference image becomes the read image position (X, Y) as it is. However, when a reference image is set outside the VOP area, padding processing is performed, so that the image is once read from a position different from the position of the actual reference image, and the luminance image memory 18 and the chroma image memory 19 are read out. To store.
[0049]
The read image position (X, Y) when the reference image is set outside the VOP area will be specifically described with reference to FIGS.
[0050]
When the reference image includes pixels outside the region on the negative side in the horizontal direction, the read image position (X, Y) is set so that all the pixels fall within the VOP as shown in A of FIG. The position (Href, Vref) is a position translated in the horizontal direction to the positive side. When the reference image includes a pixel outside the region on the negative side in the vertical direction, the read image position (X, Y) is set so that all the pixels are within the VOP as shown in B of FIG. The position (Href, Vref) is a position translated in the vertical direction to the positive side. When the reference image includes out-of-region pixels on the negative side in the vertical direction and out-of-region pixels on the negative side in the horizontal direction, the read image position (X, Y) is the origin position as shown in C of FIG. (0, 0).
[0051]
Further, when all pixels of the reference image are pixels outside the region on the positive side in the horizontal direction, the read image position (X, Y) is only one pixel in the horizontal direction within the VOP as shown in A of FIG. The reference image position (Href, Vref) is a position translated in the horizontal direction to the negative side so as to fit. However, even if the reference image includes a pixel outside the region on the positive side in the horizontal direction, if a pixel in the region of one or more VOPs is included in the horizontal direction, B in FIG. As shown, the reference image position (Href, Vref) becomes the read image position (X, Y) as it is. When all the pixels of the reference image are out-of-region pixels on the positive side in the vertical direction, the read image position (X, Y) is set so that only one pixel in the vertical direction is in the VOP as shown in FIG. The reference image position (Href, Vref) is translated to the negative side in the vertical direction so as to be within the range. However, even if the reference image includes pixels outside the positive region in the vertical direction, if the pixels in the VOP region of one or more pixels are included in the vertical direction, D in FIG. As shown, the reference image position (Href, Vref) becomes the read image position (X, Y) as it is. If all the pixels of the reference image are out-of-region pixels on the positive side in the vertical direction and out-of-region pixels on the positive side in the horizontal direction, as shown in E of FIG. ) Is the position (Hmax, Vmax) of the lower right end of the VOP.
[0052]
The horizontal direction positive / negative flag HF is a flag indicating whether or not the reference image position (X, Y) is positioned on the negative side in the horizontal direction from the origin position (0, 0). That is, it is a flag indicating whether or not X is a negative value. The horizontal direction positive / negative flag HF becomes “1” when the reference image position (X, Y) is positioned on the negative side in the horizontal direction, as shown by A, B, C in FIG. As indicated by E, F, G, when the horizontal direction is 0 or on the positive side, it is “0”. The vertical direction positive / negative flag DF is a flag indicating whether or not the reference image position (X, Y) is positioned on the negative side in the vertical direction from the origin position (0, 0). That is, it is a flag indicating whether or not Y is a negative value. The vertical direction positive / negative flag is “1” when the reference image is positioned on the negative side in the vertical direction as shown in A, D, and E of FIG. 6, and is shown by B, C, F, and G of FIG. 6. Thus, when the vertical direction is 0 or on the positive side, it is “0”.
[0053]
The number of pixels outside the horizontal region HD is the number of pixels outside the boundary included in the reference image in the horizontal direction. For example, as shown in FIGS. 6A, 6B, and 6C, when there is an out-of-boundary pixel on the negative side in the horizontal direction, the value HD indicates a negative value. As shown in E, when there is an out-of-boundary pixel on the positive side in the horizontal direction, the value indicates a positive value. The number VD of pixels outside the vertical region is the number of pixels outside the boundary included in the reference image in the vertical direction. For example, as illustrated in A, D, and E of FIG. 6, the number VD of pixels outside the vertical direction area indicates a negative value when there is a pixel outside the boundary on the negative side in the vertical direction. As shown in C and G, when there is an out-of-boundary pixel on the positive side in the vertical direction, the value indicates a positive value.
[0054]
Specifically, calculation formulas for the readout image position (X, Y), the horizontal direction positive / negative flag HF, the vertical direction positive / negative flag VF, the horizontal direction outside pixel number HD, and the vertical direction outside pixel number VD are shown below. Note that Rsize is a value obtained by subtracting 1 from the number of pixels in the horizontal direction of the reference image, that is, 8.
[0055]
First, the horizontal position (Href) value of the reference image is determined.
[0056]
If Href is less than 0 (Href <0),
X = 0, HF = 1, HD = Href
And set.
[0057]
When Href is 0 or more and Hmax or less (0 ≦ Href ≦ Hmax),
X = Href, HF = 0, HD = Href− (Hmax−Rsize)
And set.
[0058]
If Href is greater than Hmax (Href> Hmax),
X = Hmax, HF = 0, HD = Href− (Hmax−Rsize)
And set.
[0059]
Subsequently, the value of the position (Vref) in the vertical direction of the reference image is determined.
[0060]
If Vref is less than 0 (Vref <0),
Y = 0, VF = 1, VD = Vref
And set.
[0061]
When Vref is 0 or more and Vmax or less (0 ≦ Vref ≦ Vmax),
Y = Vref, VF = 0, VD = Href− (Vmax−Rsize)
And set.
[0062]
If Vref is greater than Vmax (Vref> Vmax),
Y = Vmax, VF = 0, VD = Vref− (Vmax−Rsize)
And set.
[0063]
The read image position (X, Y) calculated by the out-of-boundary determination unit 15 as described above is supplied to the read address generation unit 16. The horizontal direction positive / negative flag HF and the horizontal region outside pixel count HD calculated by the out-of-boundary determination unit 15 are supplied to the horizontal pixel position generation unit 21 of the pixel position generation unit 20. The vertical direction positive / negative flag VF and the number of pixels outside the vertical direction region VD calculated by the out-of-boundary determination unit 15 are supplied to the vertical pixel position generation unit 22 of the pixel position generation unit 20.
[0064]
Based on the read image position (X, Y), the read address generator 16 generates addresses on the frame memory 6 of all the pixels (9 × 9) constituting the read image. The read address generating unit 16 gives a data read command to the frame memory 6 through the memory I / F 17 together with the addresses of all the generated pixels. When a data read command is given from the read address generator 16, the frame memory 6 transfers the data at the designated address to the luminance image memory 18 or the chroma image memory 19 via the memory I / F 17. That is, the read image calculated by the out-of-boundary determination unit 15 is stored in the luminance image memory 18 or the chroma image memory 19 from the frame memory 6.
[0065]
The luminance image memory 18 stores a read image of luminance components among the images transferred from the frame memory 6. The chroma image memory 19 stores an image of a chroma component among the images transferred from the frame memory 6.
[0066]
The pixel position generation unit 20 generates a pixel position for reading a read image stored in the luminance image memory 18 and the chroma image memory 19. The pixel position generation unit 20 includes a horizontal pixel position generation unit 21 and a vertical pixel position generation unit 22. The horizontal pixel position generator 21 generates a horizontal pixel position (Hposi) in the read image. The vertical pixel position generator 22 generates a vertical pixel position (Vposi) in the read image. The luminance image memory 18 and the chroma image memory 19 store a read image composed of 9 × 9 pixels. In a normal case, the pixel position generation unit 20 designates pixels in order from the pixel at the upper right end, from right to left, and from top to bottom for the 9 × 9 pixel readout image. To go. Further, when performing the padding process on the reference image, the pixel position generation unit 20 designates the pixel positions in the read image in an order different from the designation order of the pixel positions in the normal case described above. . Detailed configurations and operations of the horizontal pixel position generation unit 21 and the vertical pixel position generation unit 22 will be described later.
[0067]
The pixel position (Hposi, Vposi) generated from the pixel position generator 20 is supplied to the address calculator 24.
[0068]
The mode generator 23 outputs the motion compensation mode information MM of the currently processed macroblock (the macroblock that is the target of motion compensation). The motion compensation mode information MM generated by the mode generator 23 is supplied to the address calculator 24.
[0069]
The address calculation unit 24 converts the pixel position information output from the pixel position generation unit 20 into a pixel position corresponding to the motion compensation mode. The motion compensation mode MM includes various modes such as a field prediction mode, a frame prediction mode, and a 4MV mode, but the order of pixels read out from the reference image is different for each mode. On the other hand, the generation order of pixel positions output from the pixel position generation unit 20 is constant regardless of the mode. Therefore, the address calculation unit 24 corrects the pixel position output from the pixel position generation unit 20 in accordance with the motion compensation mode MM. Then, the addresses on the luminance image memory 18 and the chroma image memory 19 corresponding to the corrected pixel position are calculated, and pixel data stored in the luminance image memory 18 and the chroma image memory 19 are output from the addresses.
[0070]
The image selector 25 selects the luminance image or chroma image read out by the address calculation unit 24 according to whether the current motion compensation target macroblock is a luminance component macroblock or a chroma component macroblock. Select one of them. The image selector 25 supplies the selected image data to the interpolation unit 26.
[0071]
The interpolation unit 26 performs interpolation processing when the pixel position of the image data read from the luminance image memory 18 or the chroma image memory 19 is located at a phase shifted by half a pixel. When the interpolation process is performed, the interpolation unit 26 combines the reference images that have been processed in units of sub-blocks, and generates a 16 × 16 pixel predicted image.
[0072]
Then, the predicted image generated by the motion compensation circuit 7 configured as described above is added to the motion compensation target macroblock currently being processed. By adding the predicted image generated as described above to the macroblock, motion compensation for the macroblock is performed.
[0073]
Next, the circuit configuration of the horizontal pixel position generator 21 and the vertical pixel position generator 22 will be described.
[0074]
A circuit configuration of the horizontal pixel position generator 21 is shown in FIG.
[0075]
The horizontal pixel position generator 21 includes a column counter 31 and a column counter correction circuit 32.
[0076]
The column counter 31 is a circuit that counts up the output value step by step in synchronization with the operation clock of the motion compensation device 7. The range of the output value of the column counter 31 is from 0 to max, and from 0 to max is counted cyclically. max is a value obtained by subtracting 1 from the number of pixels in the horizontal direction of the read image. That is, max = 8, and the column counter 31 cyclically generates values from 0 to 8. Further, the column counter 31 generates a carry-out CO signal (carry signal) when the value changes from 8 to 0.
[0077]
The column counter correction circuit 32 includes a first adder 33, a first selector 34, a second adder 35, a second selector 36, a correction counter 37, a third adder 38, And a comparator 39.
[0078]
The first adder 33 adds the first correction value output from the first selector 34 to the output value of the column counter 31. Further, the first adder 33 clips the output value to 0 when the addition result becomes a negative value. The first selector 34 outputs a value of either the number of pixels outside the horizontal direction HD or 0 as a first correction value. When the horizontal direction positive / negative flag HF is 1, the first selector 34 selects the number of pixels HD outside the horizontal direction as the first correction value, and when the horizontal direction positive / negative flag HF is 0, the first selector 34 sets “0” as the first correction value. Select a value. When the horizontal direction positive / negative flag HF is 1, the number of pixels HD outside the horizontal direction region is a negative value.
[0079]
The second adder 35 subtracts the second correction value output from the second selector 36 from the value output from the first adder 33. The second selector 36 outputs either the output value of the correction counter 37 or a value of 0 as the second correction value. The second selector 36 selects “0” as the second correction value when the horizontal direction positive / negative flag HF is 1, and outputs the output value of the correction counter 37 as the second correction value when the horizontal direction positive / negative flag HF is 0. Select
[0080]
The third adder 38 subtracts the number of pixels outside the horizontal direction HD from “max”. Since max is the maximum count value of the column counter 31, here, max = 8. The output value of the third adder 38 is input to the minus input terminal of the comparator 39. The output value of the column counter 31 is input to the plus input terminal of the comparator 39. The comparator 39 outputs “1” when the value input to the positive input terminal is equal to or greater than the value input to the negative input terminal, and the value input to the positive input terminal is output to the negative input terminal. If it is smaller than the input value, “0” is output.
[0081]
The correction counter 37 is a circuit that counts up the output value step by step in synchronization with the operation clock of the motion compensation device 7. The range of the output value of the correction counter 37 is from 0 to max, and from 0 to max is counted step by step. max is a value obtained by subtracting 1 from the number of pixels in the horizontal direction of the read image. That is, max = 8, and the correction counter 37 generates a numerical value from 0 to 8. Further, the output value of the comparator 39 is input to the enable terminal of the correction counter 37. An inverted value of the output value of the comparator 39 is input to the clear terminal of the correction counter 37. The correction counter 37 updates the output value only when the value input to the enable terminal is “1”. The correction counter 37 forcibly sets the output value to 0 when the value input to the clear terminal is “0”.
[0082]
The column counter correction circuit 32 configured as described above outputs the output value of the second adder 35 as the horizontal pixel position Hposi.
[0083]
The configuration of the vertical pixel position generator 22 is shown in FIG.
[0084]
The vertical pixel position generator 22 includes a line counter 41 and a line counter correction circuit 42.
[0085]
The line counter 41 is a circuit that counts up the output value step by step in synchronization with the carry-out signal (CO) of the column counter 31. The range of the output value of the line counter 41 is from 0 to max, and from 0 to max is counted cyclically. max is a value obtained by subtracting 1 from the number of pixels in the vertical direction of the read image. That is, max = 8, and the line counter 41 cyclically generates values from 0 to 8.
[0086]
The line counter correction circuit 42 includes a first adder 43, a first selector 44, a second adder 45, a second selector 46, a correction counter 37, a third adder 48, And a comparator 49.
[0087]
The first adder 43 adds the first correction value output from the first selector 44 to the output value of the line counter 41. Further, the first adder 43 clips the output value to 0 when the addition result becomes a negative value. The first selector 44 outputs a value of either the vertical direction out-of-region pixel number VD or 0 as the first correction value. When the vertical direction positive / negative flag VF is 1, the first selector 44 selects the vertical out-of-region pixel number VD as the first correction value, and when the vertical direction positive / negative flag VF is 0, the first selector 44 sets “0” as the first correction value. Select a value. When the vertical direction positive / negative flag VF is 1, the number VD of pixels outside the vertical direction region is a negative value.
[0088]
The second adder 45 subtracts the second correction value output from the second selector 46 from the value output from the first adder 43. The second selector 46 outputs either the output value of the correction counter 47 or a value of 0 as the second correction value. The second selector 46 selects “0” as the second correction value when the vertical direction positive / negative flag VF is 1, and outputs the output value of the correction counter 47 as the second correction value when the vertical direction positive / negative flag VF is 0. Select
[0089]
The third adder 48 subtracts the number VD of pixels outside the vertical direction from “max”. Since max is the maximum count value of the line counter 41, here, max = 8. The output value of the third adder 48 is input to the minus input terminal of the comparator 49. The output value of the line counter 41 is input to the plus input terminal of the comparator 49. The comparator 49 outputs “1” when the value input to the positive input terminal is equal to or greater than the value input to the negative input terminal, and the value input to the positive input terminal is output to the negative input terminal. If it is smaller than the input value, “0” is output.
[0090]
The correction counter 47 is a circuit that counts up the output value step by step in synchronization with the carry-out signal (CO) output from the column counter 31. The range of the output value of the correction counter 47 is from 0 to max, and from 0 to max is counted step by step. max is a value obtained by subtracting 1 from the number of pixels in the vertical direction of the read image. That is, max = 8, and the correction counter 47 generates a numerical value from 0 to 8. The output value of the comparator 49 is input to the enable terminal of the correction counter 47. An inverted value of the output value of the comparator 49 is input to the clear terminal of the correction counter 47. The correction counter 47 updates the output value only when the value input to the enable terminal is “1”. The correction counter 47 forcibly sets the output value to 0 when the value input to the clear terminal is “0”.
[0091]
The line counter correction circuit 42 configured as described above outputs the output value of the second adder 45 as the vertical pixel position Vposi.
[0092]
Next, the output value of the column counter 31 (line counter 41) in the horizontal pixel position generation unit 21 (vertical pixel position generation unit 22) configured as described above and the horizontal pixel position Hposi (vertical pixel position Vposi). The relationship will be described with reference to FIG. 9 and FIG. Since the relationship between the column counter 31 and the horizontal pixel position Hposi and the relationship between the line counter 41 and the vertical pixel position Vposi are the same, only the horizontal direction will be described below.
[0093]
When HF = −1 and HD = −1, the horizontal pixel position Hposi is as shown in FIG. When HF = −1 and HD = −5, the horizontal pixel position Hposi is as shown in FIG. That is, when HF = −1, the horizontal pixel position Hposi is a value obtained by adding HD to the output value of the column counter 31, and is always 0 when the added value is a negative value.
[0094]
When the reference image is shifted out of the region on the negative side in the horizontal direction, the read image translated in the horizontal direction by the amount corresponding to the shift is stored in the luminance image memory 18 and the chroma image memory 19. Yes. Accordingly, the column counter correction circuit 32 adds the number of pixels outside the horizontal direction area HD to the output value of the column counter 31 when the reference image is shifted out of the horizontal negative area. A horizontal pixel position Hposi is generated by shifting the output value of the column counter 31 to the negative side by the deviation. Thus, the original reference image can be acquired from the read image by shifting the output value of the column counter 31 by the deviation.
[0095]
However, the column counter correction circuit 32 clips the horizontal pixel position Hposi to 0 when the horizontal pixel position Hposi has a negative value. That is, for pixels located outside the negative side of the VOP among the horizontal pixels of the reference image, the horizontal pixel position Hposi is a pixel whose horizontal position is 0, that is, the horizontal boundary of the VOP. The position pixel is specified. The column counter correction circuit 32 corrects the output value of the column counter 31 as described above, thereby converting the pixel data located outside the negative region of the VOP into pixel data at the horizontal boundary position of the VOP. Replaced. That is, the column counter correction circuit 32 performs padding processing on pixels outside the horizontal negative region.
[0096]
When HF = 1 and HD = 1, the horizontal pixel position Hposi is as shown in FIG. When HF = 1 and HD = 2, the horizontal pixel position Hposi is as shown in FIG. When HF = 1 and HD = 3, the horizontal pixel position Hposi is as shown in FIG. When HF = 1 and HD = −X (X is an arbitrary natural number), the horizontal pixel position Hposi is as shown in FIG. That is, in the case of HF = 1, the value of the horizontal pixel position Hposi becomes the value of the column counter 31 when the output value of the column counter 31 is (8-HD) or less. After the output value becomes (8-HD), it becomes constant at (8-HD).
[0097]
When the reference image is located on the positive side in the horizontal direction, if at least one of the pixels in the reference image is in the horizontal region, the read image read from the same position as the reference image has the luminance They are stored in the image memory 18 and the chroma image memory 19. Accordingly, when the reference image is located on the positive side in the horizontal direction, the column counter correction circuit 32 outputs the output value of the column counter 31 as it is as the horizontal pixel position Hposi. Thus, the original reference image can be acquired from the read image by outputting the output value of the column counter 31 as it is as the horizontal pixel position Hposi.
[0098]
However, when the reference image is shifted out of the positive region in the horizontal direction, the pixel position outside the region is the pixel whose horizontal position is Hmax, that is, in the horizontal direction. The pixel position of the side boundary position is specified. The column counter correction circuit 32 corrects the output value of the column counter 31 as described above, thereby converting pixel data located outside the positive region of the VOP into pixel data at the horizontal boundary position of the VOP. Replaced. That is, the column counter correction circuit 32 performs padding processing for pixels outside the region on the positive side in the horizontal direction.
[0099]
As described above, in the motion compensation device 7, the pixel position of the reference image is generated by the column counter 31 and the line counter 41, and the pixel position is corrected by the column counter correction circuit 32 and the line counter correction circuit 42. In the column counter correction circuit 32 and the line counter correction circuit 42, when the reference image is located outside the VOP area, the pixel positions generated from the column counter 31 and the line counter 41 are included in the VOP area. Correct to the position of the existing pixel.
[0100]
By using the counter as described above, the motion compensation device 7 can perform the padding process at high speed without expanding the frame memory for motion compensation.
[0101]
【The invention's effect】
In the motion compensation apparatus according to the present invention, the pixel counter generates pixel positions on the reference image for all pixels in the reference image, and the reference position calculation means indicates reference image position information indicating the position of the reference image in the VOP. Is calculated. A reference image is read from the VOP based on the reference image position information and the pixel position information. Furthermore, in the motion compensation apparatus according to the present invention, when the reference image is located outside the VOP region, the pixel position generated from the pixel counter by the position correction unit is included in the VOP region. Correct the position.
[0102]
Therefore, the motion compensation apparatus according to the present invention can perform the padding process at a high speed without expanding the frame memory for motion compensation.
[Brief description of the drawings]
FIG. 1 is a block configuration diagram of an image decoding apparatus according to an embodiment of the present invention.
FIG. 2 is a block configuration diagram of a motion compensation circuit provided in the image decoding apparatus.
FIG. 3 is a diagram for explaining a relationship between a position (Hmb, Vmb) on a VOP of a macro block currently being processed and a position (Href, Vref) of a reference image of the macro block;
FIG. 4 is a diagram illustrating a read image when a reference image is set outside the negative region of the VOP.
FIG. 5 is a diagram showing a read image when a reference image is set outside a region on the positive side of the VOP.
FIG. 6 is a diagram for explaining the contents of a horizontal direction positive / negative flag HF and a vertical direction positive / negative flag VF calculated for each reference image.
FIG. 7 is a circuit diagram of a horizontal pixel position generator.
FIG. 8 is a circuit diagram of a vertical pixel position generator.
FIG. 9 is a diagram illustrating a relationship between an output value of a column counter (line counter) and a horizontal pixel position Hposi (vertical pixel position Vposi) when a horizontal direction positive / negative flag (HF) is negative.
FIG. 10 is a diagram illustrating a relationship between an output value of a column counter (line counter) and a horizontal pixel position Hposi (vertical pixel position Vposi) when a horizontal direction positive / negative flag (HF) is positive.
FIG. 11 is a diagram for explaining a VOP defined in MPEG4.
FIG. 12 is a diagram for explaining a reference image outside a VOP area;
FIG. 13 is a diagram for explaining horizontal padding processing;
FIG. 14 is a diagram for explaining padding processing in the vertical direction.
FIG. 15 is a diagram for explaining padding processing in the horizontal direction and the vertical direction;
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 Image decoding apparatus, 6 frame memory, 7 Motion compensation circuit, 14 Reference image position calculation part, 15 Out-of-boundary determination part, 16 Reading address generation part, 17 Memory I / F, 18 Luminance image memory, 19 Chroma image memory, 21 Horizontal pixel position generator, 22 Vertical pixel position generator

Claims (2)

矩形状にピクセルが配列された2次元の画像であるビデオオブジェクトプレーン(VOP)が時間方向に配列された動画像信号を符号化した符号化データであって、所定画素数の2次元の画素ブロック(マクロブロック)単位で動き予測を用いた画像圧縮を行った符号化データが、入力され、
入力された符号化データの任意のVOPの任意のマクロブロックに対して動き補償を行う動き補償装置において、
マクロブロックのVOP内における位置情報と当該マクロブロックの動き情報とに基づき、当該マクロブロックが動き予測により参照した参照画像のVOP内における位置を示す参照画像位置情報を算出する基準位置算出手段と、
動作クロックをカウントして、参照画像内の全ピクセルに対する参照画像内におけるピクセル位置を順次発生するピクセルカウンタと、
VOPのサイズ及び上記参照画像位置情報に基づき参照画像内の少なくとも1つのピクセルがVOPの領域外に位置するか否かを判断し、参照画像内の少なくとも1つのピクセルがVOPの領域外に位置する場合、領域外となっているピクセルの参照画像内における位置を示す領域外ピクセル位置、及び、参照画像がVOPの領域外にあることを示す領域外フラグを発生する領域外判定手段と、
上記ピクセルカウンタから出力されたピクセル位置を補正する位置補正手段と、
上記位置補正手段により補正された後のピクセル位置を、上記参照画像基準位置に基づき、VOP内におけるピクセル位置に変換するアドレス変換手段と、
上記アドレス変換手段により変換されたピクセル位置に基づき、VOP内から順次ピクセルを読み出して、読み出したピクセルにより予測画像を生成し、生成した予測画像によりマクロブロックに対して動き補償を行う補償手段とを備え、
上記領域外判定手段は、上記参照画像位置情報により参照画像の位置が原点位置より負側に位置することを示す正負フラグ及び領域外画素数を発生し、
上記位置補正手段は、
上記正負フラグが負側を示すとき上記領域外画素数を第1の補正値とし、上記正負フラグが0又は正側を示すとき0を第1の補正値とする第1のセレクタと、
上記ピクセルカウンタからの出力値と上記第1のセレクタからの出力値とを加算する第1の加算器と、
上記ピクセルカウンタからの値が、上記参照画像内の一方向のピクセル数−1の値から上記領域外画素数を減算した値以上となっている間、上記動作クロックをカウントする補正カウンタと、
上記正負フラグが負側を示すとき0を第2の補正値とし、上記正負フラグが0又は正側を示すとき上記補正カウンタからの出力値を第2の補正値とする第2のセレクタと、
上記第1の加算器からの出力値と上記第2のセレクタからの出力値とを加算する第2の加算器とを有し、
この第2の加算器からの出力値を補正された後のピクセル位置として上記アドレス変換手段に供給すること
を特徴とする動き補償装置。
A two-dimensional pixel block having a predetermined number of pixels, which is encoded data obtained by encoding a moving image signal in which a video object plane (VOP), which is a two-dimensional image in which pixels are arranged in a rectangular shape, is arranged in the time direction Encoded data subjected to image compression using motion prediction in units of (macroblock) is input,
In a motion compensation device that performs motion compensation on an arbitrary macroblock of an arbitrary VOP of input encoded data,
A reference position calculating means for calculating reference image position information indicating a position in the VOP of the reference image referred to by the macroblock based on the position information in the VOP of the macroblock and the motion information of the macroblock;
A pixel counter that counts operating clocks to sequentially generate pixel positions in the reference image for all pixels in the reference image;
Based on the size of the VOP and the reference image position information, it is determined whether at least one pixel in the reference image is located outside the VOP region, and at least one pixel in the reference image is located outside the VOP region. An out-of-region pixel position indicating a position in the reference image of a pixel that is out of the region, and an out-of-region determination unit that generates an out-of-region flag indicating that the reference image is out of the VOP region;
Position correcting means for correcting the pixel position output from the pixel counter;
Address conversion means for converting the pixel position corrected by the position correction means into a pixel position in a VOP based on the reference image standard position;
Compensation means for sequentially reading out pixels from the VOP based on the pixel position converted by the address conversion means, generating a prediction image by the read pixels, and performing motion compensation for the macroblock by the generated prediction image; Prepared,
The out-of-region determination means generates a positive / negative flag and a number of out-of-region pixels indicating that the position of the reference image is located on the negative side of the origin position based on the reference image position information,
The position correction means includes
A first selector that sets the number of out-of-region pixels as a first correction value when the positive / negative flag indicates a negative side, and sets the first correction value as 0 when the positive / negative flag indicates 0 or a positive side;
A first adder for adding the output value from the pixel counter and the output value from the first selector;
A correction counter that counts the operation clock while a value from the pixel counter is equal to or greater than a value obtained by subtracting the number of out-of-region pixels from a value of the number of pixels in one direction in the reference image minus 1;
A second selector that sets 0 as a second correction value when the positive / negative flag indicates a negative side, and sets an output value from the correction counter as a second correction value when the positive / negative flag indicates 0 or a positive side;
A second adder for adding the output value from the first adder and the output value from the second selector;
A motion compensation apparatus, wherein the output value from the second adder is supplied to the address conversion means as a pixel position after correction .
上記ピクセルカウンタは、参照画像の水平方向のピクセル数を0から巡回的にカウントするカラムカウンタと、参照画像の垂直方向のピクセル数を0から巡回的にカウントするラインカウンタとを有し、
上記領域外判定手段は、上記参照画像位置情報により参照画像の位置が原点位置より水平方向の負側に位置することを示す水平方向正負フラグHF、垂直方向の負側に位置するかを示す垂直方向正負フラグVF、水平方向領域外画素数HD及び垂直方向領域外画素数VDを発生し、
上記位置補正手段は、上記カラムカウンタからの出力値を補正するカラムカウンタ補正手段と上記ラインカウンタからの出力値を補正するラインカウンタ補正手段とから成り、
上記カラムカウンタ補正手段は、
上記水平方向正負フラグHFが負側を示すとき上記水平方向領域外画素数HDを第1の水平補正値とし、上記水平方向正負フラグHFが0又は正側を示すとき0を第1の水平補正値とする第1の水平セレクタと、
上記カラムカウンタからの出力値と上記第1の水平セレクタからの出力値とを加算する第1の水平加算器と、
上記カラムカウンタからの値が、上記参照画像内の水平方向のピクセル数−1の値から上記水平方向領域外画素数HDを減算した値以上となっている間、上記動作クロックをカウントする水平補正カウンタと、
上記水平方向正負フラグHFが負側を示すとき0を第2の水平補正値とし、上記水平方向正負フラグHFが0又は正側を示すとき上記水平補正カウンタからの出力値を第2の水平補正値とする第2の水平セレクタと、
上記第1の水平加算器からの出力値と上記第2の水平セレクタからの出力値とを加算する第2の水平加算器とを有し、
上記ラインカウンタ補正手段は、
上記垂直方向正負フラグHFが負側を示すとき上記垂直方向領域外画素数HDを第1の垂直補正値とし、上記垂直方向正負フラグHFが0又は正側を示すとき0を第1の垂直補正値とする第1の垂直セレクタと、
上記ラインカウンタからの出力値と上記第1の垂直セレクタからの出力値とを加算する第1の垂直加算器と、
上記ラインカウンタからの値が、上記参照画像内の垂直方向のピクセル数−1の値から上記垂直方向領域外画素数HDを減算した値以上となっている間、上記動作クロックをカウントする垂直補正カウンタと、
上記垂直方向正負フラグHFが負側を示すとき0を第2の垂直補正値とし、上記垂直方向正負フラグHFが0又は正側を示すとき上記垂直補正カウンタからの出力値を第2の垂直補正値とする第2の垂直セレクタと、
上記第1の垂直加算器からの出力値と上記第2の垂直セレクタからの出力値とを加算する第2の垂直加算器とを有し、
上記第2の水平加算器からの出力値を水平方向のピクセル位置Hposiとし、上記第2の垂直加算器からの出力値を垂直方向のピクセル位置Vposiとして上記アドレス変換手段に供給すること
を特徴とする請求項1記載の動き補償装置。
The pixel counter includes a column counter that cyclically counts the number of pixels in the horizontal direction of the reference image from 0, and a line counter that cyclically counts the number of pixels in the vertical direction of the reference image from 0,
The out-of-region determination means includes a horizontal positive / negative flag HF indicating that the position of the reference image is positioned on the negative side in the horizontal direction from the origin position based on the reference image position information, and a vertical indicating whether the position is positioned on the negative side in the vertical direction Generating a direction positive / negative flag VF, a horizontal region outside pixel number HD and a vertical direction region outside pixel number VD;
The position correction means comprises a column counter correction means for correcting an output value from the column counter and a line counter correction means for correcting an output value from the line counter,
The column counter correction means includes
When the horizontal direction positive / negative flag HF indicates the negative side, the number of pixels HD outside the horizontal direction area is set as the first horizontal correction value, and when the horizontal direction positive / negative flag HF indicates 0 or the positive side, 0 is the first horizontal correction. A first horizontal selector as a value;
A first horizontal adder for adding the output value from the column counter and the output value from the first horizontal selector;
Horizontal correction for counting the operation clock while the value from the column counter is equal to or greater than the value obtained by subtracting the number HD of pixels outside the horizontal direction area from the value of the number of horizontal pixels −1 in the reference image. A counter,
When the horizontal direction positive / negative flag HF indicates the negative side, 0 is set as the second horizontal correction value, and when the horizontal direction positive / negative flag HF indicates 0 or the positive side, the output value from the horizontal correction counter is set as the second horizontal correction value. A second horizontal selector as a value;
A second horizontal adder that adds the output value from the first horizontal adder and the output value from the second horizontal selector;
The line counter correction means is
When the vertical direction positive / negative flag HF indicates the negative side, the number of pixels outside the vertical direction area HD is set as the first vertical correction value, and when the vertical direction positive / negative flag HF indicates 0 or the positive side, 0 is the first vertical correction. A first vertical selector as a value;
A first vertical adder for adding the output value from the line counter and the output value from the first vertical selector;
Vertical correction for counting the operation clock while the value from the line counter is equal to or greater than the value obtained by subtracting the number of pixels outside the vertical direction area HD from the value of the number of vertical pixels in the reference image minus 1 A counter,
When the vertical direction positive / negative flag HF indicates the negative side, 0 is set as the second vertical correction value, and when the vertical direction positive / negative flag HF indicates 0 or the positive side, the output value from the vertical correction counter is set as the second vertical correction value. A second vertical selector as a value;
A second vertical adder for adding the output value from the first vertical adder and the output value from the second vertical selector;
The output value from the second horizontal adder is set as the horizontal pixel position Hposi, and the output value from the second vertical adder is supplied as the vertical pixel position Vposi to the address conversion means.
The motion compensator according to claim 1 .
JP2002196275A 2002-07-04 2002-07-04 Motion compensation device Expired - Fee Related JP4000928B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002196275A JP4000928B2 (en) 2002-07-04 2002-07-04 Motion compensation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002196275A JP4000928B2 (en) 2002-07-04 2002-07-04 Motion compensation device

Publications (2)

Publication Number Publication Date
JP2004040575A JP2004040575A (en) 2004-02-05
JP4000928B2 true JP4000928B2 (en) 2007-10-31

Family

ID=31704416

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002196275A Expired - Fee Related JP4000928B2 (en) 2002-07-04 2002-07-04 Motion compensation device

Country Status (1)

Country Link
JP (1) JP4000928B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100763914B1 (en) 2006-05-10 2007-10-05 삼성전자주식회사 Method and apparatus for recording of image data for access of a memory with high speed
JP4762095B2 (en) * 2006-09-20 2011-08-31 株式会社東芝 Image decoding apparatus and image decoding method
KR102139535B1 (en) 2007-10-16 2020-07-30 엘지전자 주식회사 A method and an apparatus for processing a video signal
KR101393489B1 (en) * 2008-01-09 2014-05-14 삼성전자주식회사 Apparatus and method for conversing pixel data in poterble terminal
JP5360688B2 (en) * 2009-07-21 2013-12-04 日本電気株式会社 Video decoding system, video decoding device, reference block generation method, and reference block generation program
JP2013030978A (en) * 2011-07-28 2013-02-07 Sony Corp Image processing device and method
JP5874461B2 (en) * 2012-03-16 2016-03-02 富士通株式会社 Data processing method, data processing program, and image compression apparatus
CN115037939B (en) 2016-05-27 2024-02-13 松下电器(美国)知识产权公司 Encoding device and decoding device

Also Published As

Publication number Publication date
JP2004040575A (en) 2004-02-05

Similar Documents

Publication Publication Date Title
JP3386142B2 (en) Image decoding device and image decoding method
KR100649463B1 (en) Motion estimation and compensation device with motion vector correction based on vertical component values
RU2251820C2 (en) Extrapolation of movement vector for video sequence code conversion
RU2307478C2 (en) Method for compensating global movement for video images
CN105850133B (en) Method, device and decoder for next generation video decoding
KR19980080012A (en) Motion estimation and compensation of video object plane for interlaced digital video
KR19980080014A (en) Method and apparatus for coding a digital video picture such as bi-directionally predicted video object plane
TW201545545A (en) Projected interpolation prediction generation for next generation video coding
JP2004336369A (en) Moving image encoder, moving image decoder, moving image encoding method, moving image decoding method, moving image encoding program and moving image decoding program
WO2002054777A1 (en) Mpeg-2 down-sampled video generation
JP2004096757A (en) Interpolation method and its apparatus for move compensation
JPH09261662A (en) Method and device for estimating motion in digital video encoder
US6909750B2 (en) Detection and proper interpolation of interlaced moving areas for MPEG decoding with embedded resizing
CN110719489B (en) Motion vector correction method, motion vector prediction method, motion vector encoding device, and storage device
JP4000928B2 (en) Motion compensation device
US6539058B1 (en) Methods and apparatus for reducing drift due to averaging in reduced resolution video decoders
JP3589480B2 (en) Video signal encoding method
JP2009218965A (en) Image processor, imaging device mounted with the same and image reproduction device
JP2002010267A (en) Motion vector conversion apparatus and its method
KR100240620B1 (en) Method and apparatus to form symmetric search windows for bidirectional half pel motion estimation
JP2004072732A (en) Coding apparatus, computer readable program, and coding method
JPH11136686A (en) Decoded image conversion circuit and decoded image converter
JP4779207B2 (en) Motion vector conversion apparatus and motion vector conversion method
JP4556286B2 (en) Motion vector conversion apparatus and method
JP2004349756A (en) Motion image coding apparatus, method, and motion image coding program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050518

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070426

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070501

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070702

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070806

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

Free format text: PAYMENT UNTIL: 20100824

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20100824

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees