JP2004040575A - Motion-compensating unit - Google Patents

Motion-compensating unit Download PDF

Info

Publication number
JP2004040575A
JP2004040575A JP2002196275A JP2002196275A JP2004040575A JP 2004040575 A JP2004040575 A JP 2004040575A JP 2002196275 A JP2002196275 A JP 2002196275A JP 2002196275 A JP2002196275 A JP 2002196275A JP 2004040575 A JP2004040575 A JP 2004040575A
Authority
JP
Japan
Prior art keywords
pixel
vop
reference image
image
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.)
Granted
Application number
JP2002196275A
Other languages
Japanese (ja)
Other versions
JP4000928B2 (en
Inventor
Yoshio Isogai
磯貝 芳夫
Yukio Yanagida
柳田 幸雄
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

Abstract

<P>PROBLEM TO BE SOLVED: To enable high-speed padding processing, without expanding a frame memory for motion compensation. <P>SOLUTION: A motion compensation unit 7 generates the pixel location of a reference image using a column counter 31 and a line counter 41, and corrects the pixel location, using a column counter correction circuit 32 and a line counter correction circuit 42. The column counter correction circuit 32 and the line counter correction circuit 42 correct the pixel location generated by the column counter 31 and the line counter 41, into a pixel location included in a VOP (video object plane) area, when the reference image is located outside of the VOP area. <P>COPYRIGHT: (C)2004,JPO

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]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a motion compensation device used for a decoding device that decodes encoded video data such as MPEG4 (ISO / IEC 14496-2).
[0002]
[Prior art]
According to the MPEG4 visual compression coding standard (ISO / IEC 14496-2), image compression is performed in image units called video object planes (VOPs). VOP means a two-dimensional image of a continuous object at a certain point in time. The VOP is, for example, a rectangular object representing the background of the screen as shown in FIG. 11A, an arbitrary-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 coding standard, encoding is performed independently on one or more VOPs existing at the same time, and decoding is performed independently.
[0003]
According to the MPEG4 visual compression coding standard, compression coding is performed using temporal image correlation using motion prediction. That is, when compression encoding is performed on a VOP at a certain point in time, motion prediction of an image from the past or the future to the present time is performed, and a predicted image from a past or future image is generated based on the motion amount. The information amount is compressed by subtracting the predicted image from the image. According to 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, according to the MPEG4 visual compression coding standard, when coding a rectangular VOP, a reference image specified by a motion vector may be outside the VOP area. 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 some or all of the reference image as shown in FIG. 12B. May be outside the vertical region of the VOP, or as shown in FIG. 12C, all pixels of the reference image may be outside the region in both the horizontal and vertical directions of the VOP.
[0005]
However, when some or all of the pixels of the reference image are outside the VOP area, no data exists in the area outside the VOP. Processing cannot be performed. Therefore, according to 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 of pixels located outside the area (out-of-area pixels) during decoding. There is. In the MPEG4 visual compression coding standard, a process of generating data of a pixel outside a region is called a padding process.
[0006]
FIGS. 13, 14 and 15 show examples of padding processing of the reference image.
[0007]
Generally, padding processing of a reference image is performed by copying pixel data in a VOP that is closest to the pixel outside the region to the pixel outside the region.
[0008]
For example, as shown in FIG. 13, when there is an out-of-region pixel outside the horizontal region of the VOP, data of a pixel located at a horizontal boundary in the VOP and closest to the out-of-region pixel Is copied to pixels outside the region to perform padding processing. For example, as shown in FIG. 14, when there is an out-of-region pixel outside the vertical region of the VOP, data of a pixel located at a vertical boundary in the VOP and closest to the out-of-region pixel Is copied to pixels outside the region 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 direction and the vertical direction of the VOP, the pixels located at the boundaries in the horizontal and vertical directions (pixels in the corner portions) in the VOP The padding process is performed by copying the data of the pixel which is present and closest to the pixel outside the region to the pixel outside the region.
[0009]
[Problems to be solved by the invention]
However, conventionally, in order to perform the padding process of the reference image, it is 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 the motion compensation. . Therefore, in the conventional reference image padding processing, the processing cannot be performed unless the size of the frame memory is expanded. In addition, padding processing can be performed by software without expanding the frame memory, but the processing cycle for padding processing is consumed, so that the processing time is longer than that of 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 high-speed padding processing 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. A macro block is a two-dimensional pixel block having a predetermined number of pixels constituting a 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 in macroblock units 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]
The reference position calculation means calculates, based on the position information in the VOP of the macroblock to be motion-compensated (target macroblock) and the motion information of the target macroblock, the target macroblock in the other VOP referenced by the motion prediction. Reference image position information indicating the position of the two-dimensional pixel block (reference image) in the VOP is calculated.
[0015]
The pixel counter counts the operating clock to generate a pixel position on the reference image for all pixels in the reference image.
[0016]
The out-of-region determining 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 determines whether at least one pixel in the reference image is VOP. When the pixel is located outside the region, a pixel position outside the region indicating the position of the pixel outside the region in the reference image and an outside 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 reference position. Further, when the out-of-region flag is generated and the pixel position output from the pixel counter matches the out-of-region pixel position, the position correction unit determines the pixel position generated from the pixel counter as the VOP of the VOP. Correct the position of the pixel included in the area.
[0019]
The compensating means reads out pixels sequentially from the VOP including the reference image based on the address generated by the address generating means, generates a reference image by the read pixels, and forms a macroblock by the generated reference image. Then, motion compensation is performed.
[0020]
In the motion compensation device having such a configuration, a pixel counter generates a pixel position on the reference image with respect to all pixels in the reference image, and the reference position calculation means indicates a reference image position indicating a position of the reference image in the VOP. Information is calculated. The 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 area, the position correction unit changes the pixel position generated from the pixel counter to the position of a pixel included in the VOP area. to correct.
[0022]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an image decoding apparatus to which the present invention is applied will be described as an embodiment of the present invention. The image decoding device described below is an image decoding device compatible with the simple profile of the MPEG4 visual compression coding standard. That is, it is an apparatus for decoding moving image encoded data composed of a rectangular video object plane (VOP).
[0023]
FIG. 1 shows a block diagram of an image decoding apparatus 1 according to an embodiment of the present invention.
[0024]
As shown in FIG. 1, the image decoding device 1 includes a VLC decoding circuit 2, an inverse quantization circuit 3, an inverse discrete cosine transform (DCT) circuit 4, an addition circuit 5, a frame memory 6, a motion compensation circuit 7 is provided.
[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 the DCT coefficient data to the inverse quantization circuit 3 and supplies the motion information to the motion compensation circuit 7.
[0026]
The DCT coefficient data in a quantized state is input to the inverse quantization circuit 3. The quantization circuit 3 performs an inverse quantization process 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]
The image data output from the inverse DCT circuit 4 is input to the addition circuit 5. When the input image data is a P picture or a B picture, a predicted image of the image data is input from the motion compensation circuit 7 to the addition circuit 5. When an inter macroblock is input, the adding circuit 5 adds predicted image data to the input macroblock. When an intra macroblock is input, the adding circuit 5 outputs the input image data as it is.
[0029]
The frame memory 6 stores the image data output from the adding circuit 5 on a VOP basis.
[0030]
The motion compensation circuit 7 extracts a reference image from the image data stored in the frame memory 6 with reference to the motion vector, generates predicted image data for the macroblock currently being processed from the extracted reference image, and 5
[0031]
In the image decoding device 1 as described above, the image data (VOP) output from the addition circuit 5 is output.
[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 a motion compensation process on a macroblock basis. According to the MPEG4 visual compression coding standard, a macroblock is composed of a luminance component of 16 × 16 pixels and a chroma component of 8 × 8 pixels. In the motion compensation in the MPEG4 visual compression coding standard, motion compensation is independently performed on each macroblock of a luminance component and a chroma component. However, in the MPEG4 visual compression coding standard, since the motion vector is added only to the luminance component, the chroma component motion vector is calculated from the luminance component motion vector.
[0035]
The motion compensation circuit 7 includes an MV decoder 11, a chroma MV calculator 12, an MV selector 13, a reference image position calculator 14, an out-of-bounds determiner 15, a read address generator 16, a memory interface (memory An I / F 17, a luminance image memory 18, a chroma image memory 19, a pixel position generator 20 including a horizontal pixel position generator 21 and a vertical pixel position generator 22, and a mode generator 23. An address calculator 24, an image selector 25, and an interpolator 26 are provided.
[0036]
The motion compensation circuit 7 receives, from the VLC decoding circuit 2, motion information of a macroblock to be subjected to motion compensation.
[0037]
The MV decoding unit 11 decodes a motion vector MV of a macroblock to be subjected to motion compensation from the input motion information. The decoded motion vector MV is input to each of the chroma MV calculator 12 and the MV selector 13.
[0038]
The chroma MV calculator 12 generates a motion vector MV for a chroma component macroblock 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 macroblock of a luminance component is divided into four subblocks composed of 8 × 8 pixels, and motion compensation is performed for each subblock. Therefore, when performing motion compensation in the 4MV mode, four motion vectors MV exist in one macroblock. For the luminance component and the chroma component, motion compensation is performed using a motion vector MV having the same value in the normal mode. However, in the 4MV mode, since there are four motion vectors MV for one macroblock, Cannot be used as the motion vector of the chroma component. Therefore, in the case of the 4MV mode, the chroma MV calculation unit 12 performs a process of averaging the four motion vectors MV to generate a chroma component motion vector MV. The chroma motion vector MV generated by the chroma MV calculator 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 according to whether the currently processed macroblock is a luminance component macroblock or a chroma component macroblock. . The MV selector 13 supplies the selected motion vector MV to the reference image position calculator 14.
[0040]
The reference image position calculation unit 14 calculates the position (Href, Vref) of the reference image on the VOP based on the position (Hmb, Vmb) of the currently processed macroblock on the VOP and the motion vector MV.
[0041]
FIG. 3 shows the relationship between the position (Hmb, Vmb) of the currently processed macroblock on the VOP and the position (Href, Vref) of the reference image of the macroblock.
[0042]
First, an arbitrary pixel position on a space formed by two-dimensionally arranged pixels is represented as (H, V) (H and V are both integer values). H indicates the position of the pixel in the horizontal direction, and V indicates the position in the vertical direction. It is assumed that the pixel at the upper left end of the rectangular VOP is located at the origin (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) of the macroblock currently being processed on the VOP is represented by the position in the space of the pixel at the upper left end of the macroblock. The position (Href, Vref) on the VOP of the reference image is also represented by the position in the space of the pixel at the upper left end of the reference image.
[0044]
The number of pixels of the macro block is 16 × 16 pixels, while 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 than the number of pixels of the macroblock by two pixels in both the horizontal direction and the vertical direction is in consideration of the interpolation process when half-pel prediction is used.
[0045]
In the case of the MPEG4 visual compression coding standard, there is a 4MV mode as a motion prediction mode. In the case of the 4MV mode, the inside of a macroblock is divided into four subblocks each having 8 × 8 pixels, and different motion vectors MV are given to the respective subblocks. 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 another mode. In the following motion compensating device 7, in the path from the reference image position calculation unit 14 to the luminance image memory 18 and the chroma image memory 19, the reference image is handled in 9 × 9 pixel units. 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 one macroblock, in which a total of five passes of four luminance components and one chroma component are executed. Will be done. Note that the position of the reference image (9 × 9) with respect to the sub-block is represented by a 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-bounds determination unit 15.
[0047]
Based on the position (Href, Vref) of the reference image and the image size (Hmax, Vmax) of the rectangular VOP, the out-of-bounds determination unit 15 determines the position (X, Y) of the read image, The direction positive / negative flag HF, the vertical direction positive / negative flag VF, the number HD of pixels outside the horizontal direction area, and the number VD of pixels outside the vertical direction area are calculated.
[0048]
The read image position (X, Y) is the position of a 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 the reference image is set outside the VOP area, the image is temporarily read from a position different from the actual position of the reference image to perform padding processing, and the luminance image memory 18 and the chroma image memory 19 are read. 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 a pixel outside the area 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 FIG. The position (Href, Vref) is a position translated in the horizontal direction toward the positive side. When the reference image includes a pixel outside the area on the negative side in the vertical direction, the read image position (X, Y) is set so that all pixels fall within the VOP as shown in FIG. The position (Href, Vref) is a position translated in the vertical direction toward the positive side. When the reference image includes both pixels outside the region on the negative side in the vertical direction and pixels outside the region on both the negative side in the horizontal direction, the read image position (X, Y) is set to the origin position as shown in FIG. (0, 0).
[0051]
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 such that only one pixel in the horizontal direction is within the VOP as shown in 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 pixels outside the region on the positive side in the horizontal direction, if pixels within the region of one or more VOPs are included in the horizontal direction, the pixel in FIG. As shown, the reference image position (Href, Vref) becomes the read image position (X, Y) as it is. When all pixels of the reference image are pixels outside the area on the positive side in the vertical direction, the read image position (X, Y) is such that only one pixel in the vertical direction is within the VOP as shown in FIG. The reference image position (Href, Vref) is shifted to the negative side in the vertical direction so as to fit. However, even if the reference image includes a pixel outside the region on the positive side in the vertical direction, if pixels in the region of one or more VOPs 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. When all pixels of the reference image are pixels outside the region on the positive side in the vertical direction and pixels outside the region on both the positive side in the horizontal direction, as shown in FIG. 5E, the read image position (X, Y ) Is the position (Hmax, Vmax) at 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 located 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 located on the negative side in the horizontal direction, as shown in A, B, and C in FIG. As shown in E, F, and G, when the horizontal direction is located at 0 or the positive side, the value is “0”. The vertical direction positive / negative flag DF is a flag indicating whether or not the reference image position (X, Y) is located 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 becomes “1” when the reference image is located on the negative side in the vertical direction, as shown in A, D, and E in FIG. 6, and is shown in B, C, F, and G in FIG. As described above, when the vertical direction is located at 0 or the positive side, it is “0”.
[0053]
The number HD of pixels outside the horizontal direction is the number of pixels outside the boundary included in the reference image in the horizontal direction. The number of pixels HD outside the horizontal direction is a negative value when there is a pixel outside the boundary on the negative side in the horizontal direction as shown in, for example, A, B, and C in FIG. When there is a pixel outside the boundary on the positive side in the horizontal direction, the value indicates a positive value as shown by E in FIG. The number of pixels VD outside the vertical direction region is the number of pixels outside the boundary included in the reference image in the vertical direction. Note that the number of pixels VD outside the vertical direction region is a negative value when there is a pixel outside the boundary on the negative side in the vertical direction as shown in, for example, A, D, and E in FIG. When there is a pixel outside the boundary on the positive side in the vertical direction as shown in C and G of FIG.
[0054]
Specifically, the calculation formulas for calculating the read image position (X, Y), the horizontal direction positive / negative flag HF, the vertical direction positive / negative flag VF, the number HD of pixels outside the horizontal direction area, and the number VD of pixels outside the vertical direction area 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, Rsize.
[0055]
First, the value of the horizontal position (Href) of the reference image is determined.
[0056]
When Href is smaller than 0 (Href <0),
X = 0, HF = 1, HD = Href
And set.
[0057]
When Href is equal to or greater than 0 and equal to or less than Hmax (0 ≦ Href ≦ Hmax),
X = Href, HF = 0, HD = Href- (Hmax-Rsize)
And set.
[0058]
When Href is larger 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]
When Vref is smaller than 0 (Vref <0),
Y = 0, VF = 1, VD = Vref
And set.
[0061]
When Vref is equal to or more than 0 and equal to or less than Vmax (0 ≦ Vref ≦ Vmax),
Y = Vref, VF = 0, VD = Href- (Vmax-Rsize)
And set.
[0062]
When Vref is larger 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-bounds determination unit 15 as described above is supplied to the read address generation unit 16. The horizontal direction positive / negative flag HF and the number HD of pixels outside the horizontal direction calculated by the out-of-bounds 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 VD outside the vertical direction region calculated by the out-of-bounds determination unit 15 are supplied to the vertical pixel position generation unit 22 of the pixel position generation unit 20.
[0064]
The read address generator 16 generates addresses of all the pixels (9 × 9) constituting the read image on the frame memory 6 based on the read image position (X, Y). The read address generator 16 gives a data read command together with the generated addresses of all pixels to the frame memory 6 via the memory I / F 17. When a data read command is given from the read address generator 16, the frame memory 6 transfers data at a specified 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-bounds 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 luminance component read image out of 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 generator 20 generates a pixel position for reading out a read image stored in the luminance image memory 18 and the chroma image memory 19. The pixel position generator 20 includes a horizontal pixel position generator 21 and a vertical pixel position generator 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. A read image composed of 9 × 9 pixels is stored in the luminance image memory 18 and the chroma image memory 19. Normally, the pixel position generation unit 20 specifies pixels in a readout image of 9 × 9 pixels in order from right to left and from top to bottom from the pixel at the upper right end in order from pixel to pixel. To go. Further, when padding processing is performed on the reference image, the pixel position generating unit 20 specifies the pixel positions in the read image in an order different from the above-described normal pixel position specification order. . The configuration and operation of the horizontal pixel position generator 21 and the vertical pixel position generator 22 will be described later in detail.
[0067]
The pixel position (Hposi, Vposi) generated from the pixel position generator 20 is supplied to the address calculator 24.
[0068]
The mode generation unit 23 outputs the motion compensation mode information MM of the macroblock currently being processed (the macroblock that is a motion compensation target). The motion compensation mode information MM generated by the mode generator 23 is supplied to the address calculator 24.
[0069]
The address calculator 24 converts the pixel position information output from the pixel position generator 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, and the order of pixels read from the reference image differs for each mode. On the other hand, the generation order of the 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 according to the motion compensation mode MM. Then, an address on the luminance image memory 18 and the chroma image memory 19 corresponding to the corrected pixel position is calculated, and the pixel data stored in the luminance image memory 18 and the chroma image memory 19 is output from the address.
[0070]
The image selector 25 outputs the luminance image or the chroma image read out by the address calculation unit 24 according to whether the currently processed motion compensation target macroblock is a luminance component macroblock or a chroma component macroblock. Select one of The image selector 25 supplies the selected image data to the interpolation unit 26.
[0071]
The interpolation unit 26 performs an interpolation process 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. After performing the interpolation processing, the interpolation unit 26 combines the reference images processed in sub-block units to generate a predicted image of 16 × 16 pixels.
[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 prediction image generated as described above to a 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]
FIG. 7 shows a circuit configuration of the horizontal pixel position generator 21.
[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 one step at a time 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 counts from 0 to max 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 a value 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 HD of pixels outside the horizontal direction area or 0 as a first correction value. The first selector 34 selects the number HD of pixels outside the horizontal direction as the first correction value when the horizontal direction positive / negative flag HF is 1, and sets “0” to the first correction value when the horizontal direction positive / negative flag HF is 0. Select to a value. When the horizontal direction positive / negative flag HF is 1, the number HD of pixels outside the horizontal direction area has 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 a 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 sets the output value of the correction counter 37 to the second correction value when the horizontal direction positive / negative flag HF is 0. To choose.
[0080]
The third adder 38 subtracts the number HD of pixels outside the horizontal direction from “max”. Since max is the maximum count value of the column counter 31, max = 8 here. 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 plus input terminal is equal to or greater than the value input to the minus input terminal, and outputs the value input to the plus input terminal to the minus input terminal. If the value is smaller than the input value, “0” is output.
[0081]
The correction counter 37 is a circuit that counts up the output value one step at a time 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 counting from 0 to max is performed 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. 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 having the above configuration outputs the output value of the second adder 35 as the horizontal pixel position Hposi.
[0083]
FIG. 8 shows the configuration of the vertical pixel position generator 22.
[0084]
The vertical pixel position generating section 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 one step at a time 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 counts from 0 to max 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 a value 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 number VD of pixels outside the vertical direction area or 0 as a first correction value. The first selector 44 selects the number of pixels VD outside the vertical direction region as a first correction value when the vertical direction positive / negative flag VF is 1, and sets “0” to the first correction value when the vertical direction positive / negative flag VF is 0. Select to a value. When the vertical direction positive / negative flag VF is 1, the number VD of pixels outside the vertical direction region has 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 a 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 sets the output value of the correction counter 47 to the second correction value when the vertical direction positive / negative flag VF is 0. To choose.
[0089]
The third adder 48 subtracts the number VD of pixels outside the vertical direction area 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 plus input terminal is equal to or more than the value input to the minus input terminal, and outputs the value input to the plus input terminal to the minus input terminal. If the value is smaller than the input value, “0” is output.
[0090]
The correction counter 47 is a circuit that counts up the output value one step at a time 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 counting from 0 to max is performed 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 terminal of the comparator 49 is input to the enable terminal of the correction counter 47. The 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 generator 21 (vertical pixel position generator 22) having the above configuration and the horizontal pixel position Hposi (vertical pixel position Vposi) are calculated. The relationship will be described with reference to FIGS. Note that 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, and therefore 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. 9B. 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 area on the negative side in the horizontal direction, the read image shifted in parallel to the positive side in the horizontal direction by the shift amount is stored in the luminance image memory 18 and the chroma image memory 19. I have. Therefore, the column counter correction circuit 32 adds the number HD of pixels outside the horizontal direction to the output value of the column counter 31 when the reference image is located outside the negative region in the horizontal direction. A horizontal pixel position Hposi is generated by shifting the output value of the column counter 31 to the negative side by the shift. As described above, by shifting the output value of the column counter 31 by the above-described shift, the original reference image can be obtained from the read image.
[0095]
However, when the horizontal pixel position Hposi has a negative value, the column counter correction circuit 32 clips the horizontal pixel position Hposi to zero. That is, among the pixels in the horizontal direction of the reference image, the pixels located outside the negative side of the VOP are defined as the horizontal pixel position Hposi, the pixel whose horizontal position is 0, that is, the horizontal boundary of the VOP. The pixel at the position is specified. The column counter correction circuit 32 corrects the output value of the column counter 31 as described above, and converts the data of the pixels located outside the negative region of the VOP into the pixel data at the horizontal boundary position of the VOP. Has been replaced. That is, the column counter correction circuit 32 performs padding processing on pixels outside the region on the negative side in the horizontal direction.
[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, when 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 equal to or less than (8-HD), and furthermore, the column counter 31 Is constant at (8-HD) after the output value of (8-HD) becomes (8-HD).
[0097]
When the reference image is located on the positive side in the horizontal direction, if at least one pixel among the pixels in the reference image is in the horizontal area, the read image read from the same position as the reference image has a luminance. It is stored in the image memory 18 and the chroma image memory 19. Therefore, 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. By outputting the output value of the column counter 31 as it is as the horizontal pixel position Hposi, the original reference image can be obtained from the read image.
[0098]
However, if the reference image is shifted out of the area on the positive side in the horizontal direction, the pixel position in the horizontal direction is Hmax, ie, the pixel in the horizontal direction, Specifies the pixel position of the side boundary position. The column counter correction circuit 32 corrects the output value of the column counter 31 as described above, and converts the data of the pixels located outside the positive region of the VOP into the pixel data at the boundary position in the horizontal direction of the VOP. Has been replaced. That is, the column counter correction circuit 32 performs padding processing on pixels outside the region on the positive side in the horizontal direction.
[0099]
As described above, in the motion compensator 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. 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 by the column counter 31 and the line counter 41 are included in the VOP area. To the position of the pixel that is
[0100]
By using the counter as described above, the motion compensation device 7 can perform the padding processing 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 with respect to all the pixels in the reference image, and the reference position calculation means generates reference image position information indicating the position of the reference image in the VOP. Is calculated. The reference image is read from the VOP based on the reference image position information and the pixel position information. Further, in the motion compensation apparatus according to the present invention, when the reference image is located outside the VOP area, the position correction means can use the pixel position generated from the pixel counter by the pixel included in the VOP area. To the position of.
[0102]
For this reason, the motion compensation device according to the present invention can perform high-speed padding processing without expanding the frame memory for motion compensation.
[Brief description of the drawings]
FIG. 1 is a block diagram of an image decoding apparatus according to an embodiment of the present invention.
FIG. 2 is a block diagram of a motion compensation circuit provided in the image decoding device.
FIG. 3 is a diagram for explaining a relationship between a position (Hmb, Vmb) of a macroblock currently being processed on a VOP and a position (Href, Vref) of a reference image of the macroblock.
FIG. 4 is a diagram illustrating a read image when a reference image is set outside a negative region of a VOP.
FIG. 5 is a diagram illustrating a read image when a reference image is set outside a region on the positive side of a 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 describing a VOP defined by MPEG4.
FIG. 12 is a diagram for describing a reference image outside a VOP area.
FIG. 13 is a diagram for describing horizontal padding processing.
FIG. 14 is a diagram for describing vertical padding processing.
FIG. 15 is a diagram for describing horizontal and vertical padding processing.
[Explanation of symbols]
Reference Signs List 1 image decoding device, 6 frame memory, 7 motion compensation circuit, 14 reference image position calculation unit, 15 out-of-bounds determination unit, 16 read address generation unit, 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内から順次ピクセルを読み出して、読み出したピクセルにより予測画像を生成し、生成した予測画像によりマクロブロックに対して動き補償を行う補償手段とを備え、
上記位置補正手段は、領域外フラグが発生され、且つ、上記ピクセルカウンタから出力されたピクセル位置が領域外ピクセル位置と一致した場合には、ピクセルカウンタから発生された当該ピクセル位置を、VOPの領域内のピクセルの位置に補正すること
を特徴とする動き補償装置。
Video object plane (VOP), which is a two-dimensional image in which pixels are arranged in a rectangular shape, is encoded data obtained by encoding a moving image signal in which the pixels are arranged in the time direction, and is a two-dimensional pixel block having a predetermined number of pixels. Encoded data obtained by performing image compression using motion prediction in (macroblock) units 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 unit that calculates reference image position information indicating a position in the VOP of a reference image referred to by the macro block by motion prediction based on position information in the VOP of the macro block and motion information of the macro block;
A pixel counter that counts an operating clock and sequentially generates pixel positions in the reference image for all pixels in the reference image;
It is determined whether at least one pixel in the reference image is located outside the VOP region based on the size of the VOP and the reference image position information, and at least one pixel in the reference image is located outside the VOP region. In the case, an out-of-area determining unit that generates an out-of-area pixel position indicating a position of a pixel outside the area in the reference image and an out-of-area flag indicating that the reference image is out of the VOP area,
Position correction 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 reference position;
Compensating means for sequentially reading pixels from within the VOP based on the pixel positions converted by the address converting means, generating a predicted image using the read pixels, and performing motion compensation on a macroblock using the generated predicted image. Prepare,
When the out-of-region flag is generated and the pixel position output from the pixel counter matches the out-of-region pixel position, the position correction unit converts the pixel position generated from the pixel counter into the VOP region. A motion compensating device that corrects the position of a pixel within the pixel.
上記位置補正手段は、ピクセルカウンタから出力されたピクセル位置が領域外ピクセル位置と一致した場合には、ピクセルカウンタから発生された当該ピクセル位置を、その領域外ピクセル位置の最も近傍に位置するVOP内のピクセル位置に補正すること
を特徴とする動き補償装置。
When the pixel position output from the pixel counter coincides with the pixel position outside the region, the position correction means compares the pixel position generated from the pixel counter with the VOP located closest to the pixel position outside the region. A motion compensating device that corrects the position of the pixel.
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 true JP2004040575A (en) 2004-02-05
JP4000928B2 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)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008078871A (en) * 2006-09-20 2008-04-03 Toshiba Corp Image decoding device, and image decoding method
JP2011501555A (en) * 2007-10-16 2011-01-06 エルジー エレクトロニクス インコーポレイティド Video signal processing method and apparatus
JP2011024161A (en) * 2009-07-21 2011-02-03 Nec Corp Moving picture decoding system, moving picture decoding apparatus, reference block generating-out method, and reference block generation program
US8189675B2 (en) 2006-05-10 2012-05-29 Samsung Electonics Co., Ltd. Method, medium and system storing image data for fast memory access
WO2013015118A1 (en) * 2011-07-28 2013-01-31 ソニー株式会社 Image processing apparatus and method
JP2013197646A (en) * 2012-03-16 2013-09-30 Fujitsu Ltd Data processing method in image compression system, data processing program, and image compression device
KR101393489B1 (en) * 2008-01-09 2014-05-14 삼성전자주식회사 Apparatus and method for conversing pixel data in poterble terminal
JP2021145378A (en) * 2016-05-27 2021-09-24 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Coding device
US11962804B2 (en) 2021-07-12 2024-04-16 Panasonic Intellectual Property Corporation Of America Encoder, decoder, encoding method, and decoding method

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8189675B2 (en) 2006-05-10 2012-05-29 Samsung Electonics Co., Ltd. Method, medium and system storing image data for fast memory access
JP2008078871A (en) * 2006-09-20 2008-04-03 Toshiba Corp Image decoding device, and image decoding method
US8867607B2 (en) 2007-10-16 2014-10-21 Lg Electronics Inc. Method and an apparatus for processing a video signal
US10306259B2 (en) 2007-10-16 2019-05-28 Lg Electronics Inc. Method and an apparatus for processing a video signal
JP2013009421A (en) * 2007-10-16 2013-01-10 Lg Electronics Inc Method and apparatus for processing video signal
US10820013B2 (en) 2007-10-16 2020-10-27 Lg Electronics Inc. Method and an apparatus for processing a video signal
US8462853B2 (en) 2007-10-16 2013-06-11 Lg Electronics Inc. Method and an apparatus for processing a video signal
US9813702B2 (en) 2007-10-16 2017-11-07 Lg Electronics Inc. Method and an apparatus for processing a video signal
JP2015046926A (en) * 2007-10-16 2015-03-12 エルジー エレクトロニクス インコーポレイティド Video signal processing method and device
US8750369B2 (en) 2007-10-16 2014-06-10 Lg Electronics Inc. Method and an apparatus for processing a video signal
US8750368B2 (en) 2007-10-16 2014-06-10 Lg Electronics Inc. Method and an apparatus for processing a video signal
US8761242B2 (en) 2007-10-16 2014-06-24 Lg Electronics Inc. Method and an apparatus for processing a video signal
JP2011501555A (en) * 2007-10-16 2011-01-06 エルジー エレクトロニクス インコーポレイティド Video signal processing method and apparatus
KR101393489B1 (en) * 2008-01-09 2014-05-14 삼성전자주식회사 Apparatus and method for conversing pixel data in poterble terminal
JP2011024161A (en) * 2009-07-21 2011-02-03 Nec Corp Moving picture decoding system, moving picture decoding apparatus, reference block generating-out method, and reference block generation program
WO2013015118A1 (en) * 2011-07-28 2013-01-31 ソニー株式会社 Image processing apparatus and method
JP2013197646A (en) * 2012-03-16 2013-09-30 Fujitsu Ltd Data processing method in image compression system, data processing program, and image compression device
JP2021145378A (en) * 2016-05-27 2021-09-24 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Coding device
US11962804B2 (en) 2021-07-12 2024-04-16 Panasonic Intellectual Property Corporation Of America Encoder, decoder, encoding method, and decoding method

Also Published As

Publication number Publication date
JP4000928B2 (en) 2007-10-31

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
TWI572196B (en) Projected interpolation prediction generation for next generation video coding
RU2251820C2 (en) Extrapolation of movement vector for video sequence code conversion
JP5238523B2 (en) Moving picture encoding apparatus, moving picture decoding apparatus, and moving picture decoding method
US8514939B2 (en) Method and system for motion compensated picture rate up-conversion of digital video using picture boundary processing
JP4574090B2 (en) Movie data converter and movie data conversion program
KR19980080012A (en) Motion estimation and compensation of video object plane for interlaced digital video
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
KR19980080014A (en) Method and apparatus for coding a digital video picture such as bi-directionally predicted video object plane
JP2001197501A (en) Motion vector searching device and motion vector searching method, and moving picture coder
WO2002054777A1 (en) Mpeg-2 down-sampled video generation
JP2008131643A (en) Method of transcoding data from mpeg2 standard to mpeg4 standard
JPH1169356A (en) Dynamic image encoding system and dynamic image decoding system
JP2004328633A (en) Motion predicting and compensating apparatus and method thereof
JP4000928B2 (en) Motion compensation device
US6539058B1 (en) Methods and apparatus for reducing drift due to averaging in reduced resolution video decoders
JP2004529569A (en) Detection and proper interpolation of interlaced moving area for MPEG decoding with embedded resizing function
CN110719489B (en) Motion vector correction method, motion vector prediction method, motion vector encoding device, and storage device
JP2009218965A (en) Image processor, imaging device mounted with the same and image reproduction device
JP2002010267A (en) Motion vector conversion apparatus and its method
JPH09322175A (en) Method and device for decoding time varying image
JP2004072732A (en) Coding apparatus, computer readable program, and coding method
KR100240620B1 (en) Method and apparatus to form symmetric search windows for bidirectional half pel motion estimation
JP4779207B2 (en) Motion vector conversion apparatus and motion vector conversion method

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