JP4035903B2 - Motion vector detection method and apparatus - Google Patents
Motion vector detection method and apparatus Download PDFInfo
- Publication number
- JP4035903B2 JP4035903B2 JP30147898A JP30147898A JP4035903B2 JP 4035903 B2 JP4035903 B2 JP 4035903B2 JP 30147898 A JP30147898 A JP 30147898A JP 30147898 A JP30147898 A JP 30147898A JP 4035903 B2 JP4035903 B2 JP 4035903B2
- Authority
- JP
- Japan
- Prior art keywords
- motion vector
- block
- cpu
- macroblock
- adjacent
- 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
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、例えばMPEG(Moving Picture Image Coding Experts Group)に準拠した画像符号化処理を行うときに用いられる動きベクトルを検出する動きベクトル検出方法及び装置に関する。
【0002】
【従来の技術】
MPEG方式は、画面内におけるDCT(Discrete Cosine Transform)と画像間における動き補償予測と可変長符号化とを組み合わせて動画像データの圧縮を行う符号化方式である。
【0003】
一般に、画像間の動き補償予測においてなされる動きベクトルの検出処理は、所謂ブロックマッチングによって行われていた。このブロックマッチングは、処理の対象となる基準画像において所定の画素数に分割された基準ブロックに対して、参照画像内における同位置を起点として動きベクトルに対応する参照ブロックと上記所定の画素数と同じ画素数を有する領域を抽出し、基準ブロックと参照ブロックの対応する画素の差分の絶対値を演算し、基準ブロック内の全ての画素について差分の絶対値の和を演算する処理を行う。そして、動きベクトルを検出するときには、参照画像の探索領域内で抽出する領域を1画素ずつ移動させながら上述のブロックマッチングを繰り返して行い、上記差分の絶対値の和が最も小さい値を示した点を基点として動きベクトルを検出する。
【0004】
【発明が解決しようとする課題】
しかし、上述のブロックマッチングを行うときは、参照画像についての動きベクトルを求めたときの探索領域と、基準画像についての動きベクトルを求めたときの探索領域と同じサイズの範囲となされて行われている。また、基準画像についての動きベクトルを求めるときには、基準ブロックの動きベクトルがある程度予測できる場合であっても、参照画像の動きベクトルを基準として、ある一定の大きさの領域を探索領域として基準画像の動きベクトルを検出していた。
【0005】
更に、上述したブロックマッチングにより動きベクトルを検出する処理は、ブロックマッチングを行うときなされる上記差分の絶対値の和を求める処理についての演算量が非常に膨大となっており、MPEG等の画像圧縮処理の大半の時間がこれに費やされ、ソフトウェアで実現するときの障害となっており、演算量の削減が望まれている。
【0006】
そこで、本発明は、上述したような実情に鑑みて提案されたものであり、動きベクトルの検出を行うときのブロックマッチングを行う回数を削減して動きベクトルを検出するときの演算量の削減及び処理時間の短縮を図ることができる動きベクトル検出方法及び装置を提供することを目的とする。
【0007】
【課題を解決するための手段】
本発明者は、上述の目的を達成するために鋭意研究を重ねた結果、動きベクトルを検出するとき、相互に隣接する画素ブロックの動きベクトルにおける相関が高いことが、動きベクトルの予測に用いることが可能であることを見い出した。
【0008】
本発明は、水平方向又は垂直方向に交互に位置する第1のブロックと第2のブロックを有する複数のブロックからなる画像についての動きベクトルを検出する動きベクトル検出方法において、各第1のブロックについて、それぞれ第1の探索領域で動きベクトルを検出し、各第2のブロックについて、それぞれ第2の探索領域で動きベクトルを検出するにあたり、上記第2のブロックと水平方向又は垂直方向における両側に隣接する上記第1のブロックについての各動きベクトルの差分の絶対値を演算し、得られた絶対値が所定値よりも小さい場合には、上記隣接する第1のブロックについての各動きベクトルの平均動きベクトルを演算して、得られた平均動きベクトルで示される座標位置を中心とする上記第2の探索領域を設定し、また、得られた絶対値が所定値よりも大きい場合には、上記隣接する第1のブロックについての各動きベクトルで示される座標位置を中心とする上記第2の探索領域を設定し、上記第2のブロックについての動きベクトルを上記第1の探索領域よりも小さい上記第2の探索領域でブロックマッチングを行って検出することを特徴とする。
また、本発明は、水平方向又は垂直方向に交互に位置する第1のブロックと第2のブロックを有する複数のブロックからなる画像についての動きベクトルを検出する動きベクトル検出装置において、各第1のブロックについて、それぞれ第1の探索領域で動きベクトルを検出する第1の動きベクトル検出手段と、各第2のブロックについて、それぞれ第2の探索領域で動きベクトルを検出するにあたり、上記第2のブロックと水平方向又は垂直方向における両側に隣接する上記第1のブロックについての各動きベクトルの差分の絶対値を演算し、得られた絶対値が所定値よりも小さい場合には、上記隣接する第1のブロックについての各動きベクトルの平均動きベクトルを演算して、得られた平均動きベクトルで示される座標位置を中心とする上記第2の探索領域を設定し、また、得られた絶対値が所定値よりも大きい場合には、上記隣接する第1のブロックについての各動きベクトルで示される座標位置を中心とする上記第2の探索領域を設定する探索領域設定手段と、上記第2のブロックについての動きベクトルを上記第1の探索領域よりも小さい上記第2の探索領域でブロックマッチングを行って検出する第2の動きベクトル検出手段とを備えることを特徴とする。
【0009】
このような動きベクトル検出方法及び装置によれば、上記第1のブロックについては第1の探索領域でブロックマッチングを行って動きベクトルの検出を行い、上記第1のブロックに隣接する第2のブロックについては、隣接する第1のブロックについての動きベクトルを用いて第2の探索領域を設定して上記所定の探索領域とは異なるサイズの第2の探索領域でブロックマッチングを行って第2のブロックについての動きベクトルの検出を行う。
【0010】
【発明の実施の形態】
以下、本発明の実施の形態について図面を参照しながら詳細に説明する。
【0011】
本発明は、例えば図1に示すように構成された動きベクトル検出装置1に適用される。
【0012】
この動きベクトル検出装置1は、動画像を構成する複数のフレーム画像についてMPEG2規格に準拠した画像符号化処理における動きベクトルを検出する処理を行うCPU(Central Processing Unit)2を備えている。このCPU2は、動きベクトル検出プログラム起動することで、動きベクトルを検出する処理を行う。このCPU2は、動きベクトルを検出するときには、メモリ3に格納された画像データ及び動きベクトル検出プログラムを用いる。このとき、CPU2は、制御信号をメモリ3及びHDD(Hard Disc Drive)4に出力することで、HDD4に格納された画像データ及び動きベクトル検出プログラムをメモリ3に格納するように制御する。
【0013】
また、このCPU2は、例えばMPEG2方式に準拠した画像圧縮処理を行うときには、I(Intra)ピクチャについてDCT(Discrete Cosine Transform)処理を行うとともに、B(Bidirectionally predictive),P(Predictive)ピクチャを動き補償予測をすることで画像圧縮処理を行う。このとき、CPU2は、フレーム画像について動きベクトルを求めるときには、動きベクトルを探索するときの探索領域を設定し、前記探索領域において例えば8×8画素からなるマクロブロック単位でブロックマッチングを行うことで動きベクトルを検出する。具体的には、CPU2は、マクロブロック毎にフレーム画像を分割し、相互に隣接するマクロブロックの動きベクトルを用いてブロックマッチングを行うときの探索領域を設定する。
【0014】
このCPU2が行う上記ブロックマッチングとは、動きベクトルを検出する処理の対象となる基準画像において所定の画素数に分割された例えばマクロブロック単位の基準ブロックに対して、参照画像内における同位置を起点として動きベクトルに対応する参照ブロックと上記所定の画素数と同じ画素数を有する領域を基準画像内から抽出し、基準ブロックと参照ブロックの対応する画素の差分の絶対値を演算し、基準ブロック内の全ての画素について差分の絶対値の和を演算する処理である。
【0015】
そして、CPU2は、動きベクトルを検出するとき、参照画像の探索領域内で抽出する領域を1画素ずつ移動させながら上述のブロックマッチングを繰り返して行い、上記差分の絶対値の和が最も小さい値を示した点を基点として動きベクトルを検出する。なお、このCPU2が行う上記探索領域を設定して動きベクトルを検出するときの処理手順の詳細については後述する。
【0016】
メモリ3は、上記CPU2により制御されることで、格納する内容が制御される。このメモリ3は、CPU2からの制御信号に応じてHDD4から動きベクトル検出プログラム及び画像データが格納されるとともに、格納された動きベクトル検出プログラム及び画像データが読み込まれる。
【0017】
HDD4は、画像データ及び動きベクトル検出プログラムを格納する。そして、このHDD4は、CPU2からの制御信号に応じて指定された画像データをメモリ3に出力する。
【0018】
このHDD4に格納される画像データは、フレーム画像が時系列に配列されてなり、CPU2により動きベクトルを検出する処理がされるときには、図2に示すように、例えばマクロブロック単位に分割される。そして、CPU2は、動きベクトルを検出するときには、先ず図2中の網掛け部分で示すように1つおきにマクロブロックを所定の探索領域でブロックマッチングを行うことで動きベクトルを検出する処理を行う。続いて、CPU2は、図2中の白抜き部分におけるマクロブロックを上記網掛け部分におけるマクロブロックについての動きベクトルを用いて探索領域を演算し、当該探索領域でブロックマッチングを行うことで白抜き部分のマクロブロックについての動きベクトルを検出する処理を行う。
【0019】
I/F(インターフェイス)回路5は、例えば外部から画像データが入力されるとともに、CPU2からの制御信号に応じて画像データを外部に出力する。このI/F回路5は、例えば外部から画像データが入力されたときには、HDD4に当該画像データを出力する。
【0020】
このように構成された動きベクトル検出装置1は、CPU2によりフレーム画像の画像データについて動きベクトルを検出するとき、HDD4に格納された動きベクトル検出プログラムを実行することで図3及び図4のフローチャートに示すような処理を行う。
【0021】
先ずステップS1において、CPU2は、図2に示すような複数のマクロブロックが水平方向に配列されてなるライン(Line)のアドレスを指定することでラインの番号(No.)を指定する処理を行う。ここで、CPU2は、マクロブロック(MB)が水平方向に配列する複数のラインのうち、最も上部に位置するライン「0」の番号を指定する。ここで、上記ラインの番号は、上部から0,1,2,・・・,ボトム(Bottm)からなる。
【0022】
次のステップS2において、CPU2は、上述のステップS1において指定したライン「0」のうち、動きベクトルを検出するマクロブロックの番号「0」を指定する処理を行う。各ラインを構成する複数のマクロブロックの番号は、左端から右端に向かって、0,1,2,・・・,ライト(Right)からなる。
【0023】
次のステップS3において、CPU2は、上述のステップS2で指定された番号のマクロブロックについて探索領域を設定する。ここで、CPU2は、探索領域を所定の画素数からなるサーチレンジRに設定する。このとき、CPU2は、例えばマクロブロックの中心位置を示す座標から(±R,±R)の対角点を有する矩形領域を探索領域として設定する。また、CPU2は、例えばサーチレンジRの探索領域として、32×32画素からなる矩形領域を設定する。そして、このCPU2は、所定の画素数からなる探索領域において時間的に前後するフレーム画像の対応するマクロブロックを用いて上述したブロックマッチングを行うことで動きベクトルを検出する処理を行う。
【0024】
次のステップS4において、CPU2は、上述のステップS3において動き検出を行ったマクロブロックと水平方向の左右に2つの番号だけずれたマクロブロックを指定する処理を行う。
【0025】
次に、ステップS5において、CPU2は、上述のステップS4で指定したマクロブロックが、フレーム画像の右端に位置するか否かを判断する。そして、CPU2は、指定したマクロブロックがフレーム画像の右端に位置すると判断したときにはステップS6に進み、右端に位置しないと判断したときにはステップS3に戻る。すなわち、CPU2は、上述のステップS3〜ステップS5に示す処理を行うことにより、指定したラインのうち、左端に位置するマクロブロックから右端に向かって2つの番号毎に上記ステップS3で説明した所定の探索領域で動きベクトルを検出する処理を行う。
【0026】
次のステップS6において、CPU2は、上述のステップS2で指定した番号「0」のマクロブロックに右側に隣接する番号「1」のマクロブロックを指定する処理を行う。
【0027】
次のステップS7において、CPU2は、上述のステップS6又は後述のステップS14で指定された番号におけるマクロブロックの右側に隣接するマクロブロックが存在するか否かを判断する。そして、CPU2は、指定した番号におけるマクロブロックの右側に隣接するマクロブロックが存在しないと判断したときにはステップS8に進み、指定した番号におけるマクロブロックの右側に隣接するマクロブロックが存在すると判断したときにはステップS9に進む。
【0028】
ステップS8において、CPU2は、上述のステップS7において右側に隣接するマクロブロックが存在しないと判断されたマクロブロックについて、上述のステップS3における上記所定の探索領域を設定して、当該探索領域でブロックマッチングを行うことで動きベクトルを検出する処理を行ってステップS14に進む。
【0029】
一方、ステップS9において、CPU2は、上述のステップS6又は後述のステップS14で指定したマクロブロックの両側に隣接するマクロブロックの動きベクトルの差分を演算し、当該差分の絶対値ΔVを演算する。ここで、上記動きベクトルの差分の絶対値ΔVは、マクロブロックの両側に隣接するマクロブロックの動きベクトルの指し示す方向が略同方向であるときには小さな値となり、マクロブロックの両側に隣接するマクロブロックの動きベクトルの指し示す方向が異なるほど大きな値となる。
【0030】
次のステップS10において、CPU2は、上述のステップS9で演算して得た差分の絶対値ΔVがサーチレンジrよりも十分に大きいか否かを判断する。ここで、「r」は任意の値であり、サーチレンジrとは点(−r,−r)と点(+r,+r)とを対角点に有する矩形領域である。また、このサーチレンジrで定義される矩形領域は、上述したステップS3におけるサーチレンジRで定義される矩形領域よりも占める領域が小さく、例えば6×6画素からなる矩形領域である。そして、CPU2は、差分の絶対値ΔVがサーチレンジrよりも十分に大きいとき、すなわち隣接するマクロブロックの各動きベクトルの指し示す方向が異なる場合にはステップS11に進み、差分の絶対値ΔVがサーチレンジrよりも十分に大きくないとき、すなわち隣接するマクロブロックの各動きベクトルの指し示す方向が略同方向である場合にはステップS12に進む。
【0031】
ステップS11において、CPU2は、上述のステップS6又は後述のステップS14で指定されたマクロブロックの水平方向における両側に隣接するマクロブロックについての各動きベクトルを図5に示すように指定されたマクロブロックの左上の座標位置とし、指し示す点を中心としてサーチレンジrで定義される探索領域A,Bをそれぞれ設定する。そして、CPU2は、各探索領域A,Bにおいてブロックマッチングを行うことで動きベクトルを検出してステップS14に進む。
【0032】
一方、ステップS12において、CPU2は、ステップS6又はステップS14で指定されたマクロブロックの水平方向における両側に隣接するマクロブロックについての各動きベクトルを用いて、図6に示すような平均動きベクトルAveV(h,v)を演算する。
【0033】
次のステップS13において、CPU2は、平均動きベクトルAveV(h,v)の先端が指し示す座標位置(h,v)を中心とし、点(−r,−r)と点(+r,+r)とを対角点とした矩形の探索領域Cを設定する。そして、CPU2は、設定した探索領域Cにおいてブロックマッチングを行うことでステップS6又はステップS14で指定したマクロブロックについての動きベクトルを検出する。
【0034】
次のステップS14において、CPU2は、上述のステップS13で動きベクトルを検出したマクロブロックから水平方向における右側に向かって2番号だけ進める処理を行う。
【0035】
次のステップS15において、CPU2は、上述のステップS14で指定した番号のマクロブロックがラインにおける右端に位置するか否かを判断する。そして、CPU2は、指定したマクロブロックがラインにおける右端に位置すると判断したときにはステップS16に進み、指定したマクロブロックがラインにおける右端に位置しないと判断したときにはステップS7に戻る。すなわち、CPU2は、上述のステップS2〜ステップS15までの処理を繰り返すことにより、上述の処理を行っているラインを構成する全てのマクロブロックについて動きベクトルを検出する。
【0036】
ステップS16において、CPU2は、上述したステップS3からステップS15までの処理を行ったラインから2つの番号だけボトムに向かって進めて新たなラインを指定する処理を行う。
【0037】
次のステップS17において、CPU2は、上述のステップS16で指定したラインの番号がボトムであるか否かを判断する。そして、CPU2は、指定したラインがボトムであると判断したときには図4に示すステップS18に進み、指定したラインがボトムでないと判断したときにはステップS2に戻って指定したラインについて上述のステップS2〜ステップS15に示す処理を行う。すなわち、CPU2は、ステップS1〜ステップS17までの処理を行うことで、フレーム画像の番号「0」のラインからボトムのラインに向かって2つの番号毎に上述のステップS2〜ステップS15に示す処理を行う。
【0038】
次のステップS18において、CPU2は、図2に示すような複数のマクロブロックが垂直方向に配列されてなるラインの番号を指定する処理を行う。ここで、CPU2は、マクロブロックが水平方向に配列する複数のラインのうち、上端から1つの番号だけ下側に隣接するライン「1」の番号を指定する。
【0039】
次のステップS19において、CPU2は、上述のステップS18において指定したライン「1」のうち、動きベクトルを検出するマクロブロックの番号「0」を指定する処理を行う。
【0040】
次のステップS20において、CPU2は、上述のステップS19で指定したマクロブロックの下側にマクロブロックが存在するか否かを判断する。そして、CPU2は、指定したマクロブロックの下側にマクロブロックが存在しないと判断したときにはステップS21に進み、指定したマクロブロックの下側にマクロブロックが存在すると判断したときにはステップS22に進む。
【0041】
ステップS21において、CPU2は、上述のステップS20において下側に隣接するマクロブロックが存在しないと判断されたマクロブロックについて、上述のステップS3におけるサーチレンジRの探索領域を設定して、当該探索領域でブロックマッチングを行うことで動きベクトルを検出する処理を行ってステップS27に進む。
【0042】
一方、ステップS22において、CPU2は、上述のステップS19又は後述のステップS27で指定したマクロブロックの垂直方向において隣接するマクロブロックの動きベクトルの差分を演算し、当該差分の絶対値ΔVを演算する。
【0043】
次のステップS23において、CPU2は、上述のステップS22で演算して得た差分の絶対値ΔVがサーチレンジrよりも大きいか否かを判断する。そして、CPU2は、差分の絶対値ΔVがサーチレンジrよりも大きいときにはステップS24に進み、差分の絶対値ΔVがサーチレンジrよりも大きくないときにはステップS25に進む。
【0044】
ステップS24において、CPU2は、上述のステップS19又は後述のステップS27で指定されたマクロブロックの垂直方向において隣接するマクロブロックについての各動きベクトルを図7に示すように指定されたマクロブロックの左上の座標位置とし、指し示す点を中心としてサーチレンジrで定義される探索領域D,Eをそれぞれ設定する。そして、CPU2は、各探索領域D,Eにおいてブロックマッチングを行うことで動きベクトルを検出してステップS27に進む。
【0045】
一方、ステップS25において、CPU2は、ステップS19又はステップS27で指定されたマクロブロックの垂直方向において隣接するマクロブロックについての各動きベクトルを用いて、図8に示すような平均動きベクトルAveV(h,v)を演算する。
【0046】
次のステップS26において、CPU2は、平均動きベクトルAveV(h,v)の先端が指し示す座標位置(h,v)を中心とし、点(−r,−r)と点(+r,+r)とを対角点とした矩形の探索領域Fを設定する。そして、CPU2は、設定した探索領域においてブロックマッチングを行うことでステップS19又はステップS27で指定したマクロブロックについての動きベクトルを検出する。
【0047】
次のステップS27において、CPU2は、上述のステップS26で動きベクトルを検出したマクロブロックから水平方向における右側に向かって1つの番号だけ進める処理を行う。
【0048】
次のステップS28において、CPU2は、上述のステップS27で指定した番号のマクロブロックがラインにおける右端に位置するか否かを判断する。そして、CPU2は、指定したマクロブロックがラインにおける右端に位置すると判断したときにはステップS29に進み、指定したマクロブロックがラインにおける右端に位置しないと判断したときにはステップS20に戻る。すなわち、CPU2は、上述のステップS20〜ステップS28までの処理を繰り返すことにより、上述の処理を行っているラインを構成する全てのマクロブロックについて動きベクトルを検出する。
【0049】
ステップS29において、CPU2は、上述したステップS19からステップS28までの処理を行ったラインから2つの番号だけ下端に向かって進めて新たなラインを指定する処理を行う。
【0050】
次のステップS30において、CPU2は、上述のステップS29で指定したラインの番号がボトムであるか否かを判断する。そして、CPU2は、指定したラインがボトムであると判断したときには処理を終了し、指定したラインがボトムでないと判断したときにはステップS19に戻って指定したラインについて上述のステップS2〜ステップS28に示す処理を行う。すなわち、CPU2は、ステップS18〜ステップS30までの処理を行うことで、フレーム画像の垂直方向において、番号「0」のラインからボトムのラインに向かって2つの番号毎に上述のステップS19〜ステップS28に示す処理を行う。
【0051】
上述した動きベクトル検出装置1は、ステップS1〜ステップS17に示す処理を実行することにより指定したラインのうち水平方向に配列する全てのマクロブロックについて動きベクトルを検出し、ステップS18〜ステップS30に示す処理を実行することにより上記ステップS1〜ステップS17で処理の対象となっていないラインを指定して垂直方向に隣接するマクロブロックを用いて動きベクトルを検出することでフレーム画像を構成する全てのマクロブロックについて動きベクトルを検出する。
【0052】
したがって、このような動きベクトル検出装置1によれば、ステップS3に示す処理を行うことで、フレーム画像を構成する一部のマクロブロックについて所定の画素サイズの探索領域にてブロックマッチングを行って動きベクトルを検出する処理を行い、他のマクロブロックについては隣接するマクロブロックの動きベクトルを参照することで上記所定の画素サイズよりも小さい画素サイズの探索領域にてブロックマッチングを行って動きベクトルを検出するので、フレーム画像を構成する全てのマクロブロックについて上記所定の画素サイズの探索領域にてブロックマッチングを行って動きベクトルを検出する場合と比較して探索領域を削減することができ、ブロックマッチングを行う回数を削減することができる。したがって、この動きベクトル検出装置1によれば、動きベクトルを検出するのに要する処理時間を大幅に短縮することができる。具体的には、動きベクトル検出装置1は、上述のステップS3におけるサーチレンジRを32×32画素とし、隣接するマクロブロックの動きベクトルを参照した場合の上記サーチレンジrを6×6画素としたとき、フレーム画像を構成する全てのマクロブロックについて動きベクトルを検出するための処理時間を1/100程度に短縮することができる。
【0053】
また、この動きベクトル検出装置1によれば、ステップS9及びステップS10で示す処理を行うことで動きベクトルを検出するマクロブロックに隣接するマクロブロックの動きベクトルが指し示す方向を判断し、各動きベクトルが指し示す方向に応じて設定する探索範囲を変化させるので、隣接するマクロブロックの動きベクトルが異なる方向を指し示していても、高精度な動きベクトルの検出を行うことができる。
【0054】
【発明の効果】
以上詳細に説明したように、本発明によれば、水平方向又は垂直方向に交互に位置する第1のブロックと第2のブロックを有する複数のブロックからなる画像の各第1のブロックについて、それぞれ第1の探索領域で動きベクトルを検出し、各第2のブロックについて、それぞれ第2の探索領域で動きベクトルを検出するにあたり、上記第2のブロックと水平方向又は垂直方向における両側に隣接する上記第1のブロックについての各動きベクトルの差分の絶対値を演算し、得られた絶対値が所定値よりも小さい場合には、上記隣接する第1のブロックについての各動きベクトルの平均動きベクトルを演算して、得られた平均動きベクトルで示される座標位置を中心とする上記第2の探索領域を設定し、また、得られた絶対値が所定値よりも大きい場合には、上記隣接する第1のブロックについての各動きベクトルで示される座標位置を中心とする上記第2の探索領域を設定し、上記第2のブロックについての動きベクトルを上記第1の探索領域よりも小さい上記第2の探索領域でブロックマッチングを行って検出するので、第2のブロックに隣接する第1のブロックについての動きベクトルに応じて第2の探索領域を第1の探索領域と比較して小さな画素サイズとすることができ、動きベクトルの検出を行うときのブロックマッチングを行う回数を削減して動きベクトルを検出するときの演算量の削減及び処理時間の短縮を図ることができる。
【図面の簡単な説明】
【図1】本発明を適用した動きベクトル検出装置の構成を示すブロック図である。
【図2】本発明を適用した動きベクトル検出装置に備えられるCPUにより動きベクトルを検出する処理がされるときに、フレーム画像がマクロブロック単位に分割されることを説明するための図である。
【図3】本発明を適用した動きベクトル検出装置に備えられるCPUが動きベクトル検出プログラムにしたがって動きベクトルを検出する処理手順を示すフローチャートである。
【図4】本発明を適用した動きベクトル検出装置に備えられるCPUが動きベクトル検出プログラムにしたがって動きベクトルを検出する処理手順を示すフローチャートである。
【図5】水平方向において隣接するマクロブロックが異なる方向を指し示しているときにおいて、隣接するマクロブロックの動きベクトルを用いて探索領域を設定して動きベクトルを検出することを説明するための図である。
【図6】水平方向において隣接するマクロブロックが略同方向を指し示しているときにおいて、隣接するマクロブロックの動きベクトルを用いて探索領域を設定して動きベクトルを検出することを説明するための図である。
【図7】垂直方向において隣接するマクロブロックが異なる方向を指し示しているときにおいて、隣接するマクロブロックの動きベクトルを用いて探索領域を設定して動きベクトルを検出することを説明するための図である。
【図8】水平方向において隣接するマクロブロックが略同方向を指し示しているときにおいて、隣接するマクロブロックの動きベクトルを用いて探索領域を設定して動きベクトルを検出することを説明するための図である。
【符号の説明】
1 動きベクトル検出装置、2 CPU[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a motion vector detection method and apparatus for detecting a motion vector used when performing an image encoding process compliant with, for example, MPEG (Moving Picture Image Coding Experts Group).
[0002]
[Prior art]
The MPEG method is a coding method that compresses moving image data by combining DCT (Discrete Cosine Transform) in a screen, motion compensation prediction between images, and variable length coding.
[0003]
In general, motion vector detection processing performed in motion compensation prediction between images is performed by so-called block matching. This block matching is based on the reference block corresponding to the motion vector starting from the same position in the reference image and the predetermined number of pixels with respect to the reference block divided into the predetermined number of pixels in the reference image to be processed. A region having the same number of pixels is extracted, the absolute value of the difference between corresponding pixels of the base block and the reference block is calculated, and the sum of the absolute values of the differences is calculated for all the pixels in the base block. When detecting a motion vector, the above-mentioned block matching is repeated while moving the region to be extracted within the reference image search region pixel by pixel, and the sum of the absolute values of the differences is the smallest. The motion vector is detected from the base point.
[0004]
[Problems to be solved by the invention]
However, when performing the block matching described above, the search area when the motion vector for the reference image is obtained and the search area when the motion vector for the base image is obtained are made the same size range. Yes. In addition, when obtaining a motion vector for a reference image, even if the motion vector of the reference block can be predicted to some extent, an area of a certain size is used as a search area based on the motion vector of the reference image. A motion vector was detected.
[0005]
Furthermore, the above-described processing for detecting a motion vector by block matching has an enormous amount of calculation for the processing for obtaining the sum of the absolute values of the differences performed when block matching is performed. Most of the processing time is spent on this, which is an obstacle to the realization with software, and a reduction in the amount of calculation is desired.
[0006]
Therefore, the present invention has been proposed in view of the above-described circumstances, and the amount of calculation when detecting a motion vector by reducing the number of times of performing block matching when detecting a motion vector, and It is an object of the present invention to provide a motion vector detection method and apparatus capable of shortening the processing time.
[0007]
[Means for Solving the Problems]
As a result of intensive research to achieve the above-mentioned object, the present inventor uses a high correlation between motion vectors of pixel blocks adjacent to each other when detecting a motion vector. Found that it was possible.
[0008]
The present invention relates to a motion vector detection method for detecting a motion vector for an image composed of a plurality of blocks each having a first block and a second block that are alternately positioned in the horizontal direction or the vertical direction. When detecting a motion vector in each first search area and detecting a motion vector in each second search area for each second block, the second block is adjacent to both sides in the horizontal direction or the vertical direction. When the absolute value of the difference of each motion vector for the first block is calculated and the obtained absolute value is smaller than a predetermined value, the average motion of each motion vector for the adjacent first block Calculating the vector, setting the second search area centered on the coordinate position indicated by the obtained average motion vector, and If the obtained absolute value is larger than a predetermined value, the second search area centered on the coordinate position indicated by each motion vector for the adjacent first block is set, and the second block The motion vector is detected by performing block matching in the second search area smaller than the first search area.
The present invention also provides a motion vector detection apparatus for detecting a motion vector for an image composed of a plurality of blocks each having a first block and a second block that are alternately positioned in the horizontal direction or the vertical direction. First motion vector detection means for detecting a motion vector in the first search area for each block, and the second block for detecting a motion vector in the second search area for each second block, respectively. When the absolute value of the difference between the motion vectors for the first block adjacent to both sides in the horizontal direction or the vertical direction is calculated and the obtained absolute value is smaller than a predetermined value, the adjacent first Calculate the average motion vector of each motion vector for the block, and center the coordinate position indicated by the obtained average motion vector. When the second search area is set and the obtained absolute value is larger than a predetermined value, the second search area is centered on the coordinate position indicated by each motion vector for the adjacent first block. Search area setting means for setting two search areas, and a second motion for detecting a motion vector for the second block by performing block matching in the second search area smaller than the first search area Vector detection meansIt is characterized by that.
[0009]
According to such a motion vector detection method and apparatus, the first block is subjected to block matching in the first search region to detect a motion vector, and the second block adjacent to the first block. For the second block, a second search area is set using a motion vector for the adjacent first block, and block matching is performed in the second search area having a size different from the predetermined search area. A motion vector is detected for.
[0010]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0011]
The present invention is applied to, for example, a motion
[0012]
The motion
[0013]
For example, when performing image compression processing conforming to the MPEG2 system, the
[0014]
The block matching performed by the
[0015]
Then, when detecting the motion vector, the
[0016]
The
[0017]
The
[0018]
The image data stored in the
[0019]
The I / F (interface)
[0020]
The motion
[0021]
First, in step S1, the
[0022]
In the next step S2, the
[0023]
In the next step S3, the
[0024]
In the next step S4, the
[0025]
Next, in step S5, the
[0026]
In the next step S6, the
[0027]
In the next step S7, the
[0028]
In step S8, the
[0029]
On the other hand, in step S9, the
[0030]
In the next step S10, the
[0031]
In step S11, the
[0032]
On the other hand, in step S12, the
[0033]
In the next step S13, the
[0034]
In the next step S14, the
[0035]
In the next step S15, the
[0036]
In step S16, the
[0037]
In the next step S17, the
[0038]
In the next step S18, the
[0039]
In the next step S19, the
[0040]
In the next step S20, the
[0041]
In step S21, the
[0042]
On the other hand, in step S22, the
[0043]
In the next step S23, the
[0044]
In step S24, the
[0045]
On the other hand, in step S25, the
[0046]
In the next step S26, the
[0047]
In the next step S27, the
[0048]
In the next step S28, the
[0049]
In step S29, the
[0050]
In the next step S30, the
[0051]
The motion
[0052]
Therefore, according to such a motion
[0053]
Further, according to the motion
[0054]
【The invention's effect】
As explained in detail above,According to the present invention, for each first block of an image composed of a plurality of blocks each having a first block and a second block that are alternately positioned in the horizontal direction or the vertical direction, a motion vector in the first search region. And detecting motion vectors in each second search area for each second block, each motion for the first block adjacent to the second block on both sides in the horizontal or vertical direction. When the absolute value of the vector difference is calculated and the obtained absolute value is smaller than the predetermined value, the average motion vector of the respective motion vectors for the adjacent first block is calculated and the obtained average The second search area centered on the coordinate position indicated by the motion vector is set, and if the obtained absolute value is larger than a predetermined value, the adjacent search area is set. The second search area centered on the coordinate position indicated by each motion vector for the first block is set, and the motion vector for the second block is smaller than the first search area. Since block matching is performed in the search area,The second search area can be made smaller in pixel size compared to the first search area in accordance with the motion vector for the first block adjacent to the second block. It is possible to reduce the amount of calculation and the processing time when detecting a motion vector by reducing the number of times of performing block matching.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a motion vector detection apparatus to which the present invention is applied.
FIG. 2 is a diagram for explaining that a frame image is divided into macroblock units when a process of detecting a motion vector is performed by a CPU provided in a motion vector detection apparatus to which the present invention is applied.
FIG. 3 is a flowchart showing a processing procedure in which a CPU provided in a motion vector detection apparatus to which the present invention is applied detects a motion vector according to a motion vector detection program.
FIG. 4 is a flowchart showing a processing procedure in which a CPU provided in a motion vector detection apparatus to which the present invention is applied detects a motion vector according to a motion vector detection program.
FIG. 5 is a diagram for explaining that a motion vector is detected by setting a search region using motion vectors of adjacent macroblocks when adjacent macroblocks point in different directions in the horizontal direction; is there.
FIG. 6 is a diagram for explaining that a motion vector is detected by setting a search region using a motion vector of an adjacent macroblock when adjacent macroblocks in the horizontal direction indicate substantially the same direction. It is.
FIG. 7 is a diagram for explaining that a motion vector is detected by setting a search region using a motion vector of an adjacent macroblock when adjacent macroblocks point in different directions in the vertical direction; is there.
FIG. 8 is a diagram for explaining that a motion vector is detected by setting a search region using a motion vector of an adjacent macroblock when adjacent macroblocks in the horizontal direction indicate substantially the same direction; It is.
[Explanation of symbols]
1 motion vector detection device, 2 CPU
Claims (2)
各第1のブロックについて、それぞれ第1の探索領域で動きベクトルを検出し、
各第2のブロックについて、それぞれ第2の探索領域で動きベクトルを検出するにあたり、
上記第2のブロックと水平方向又は垂直方向における両側に隣接する上記第1のブロックについての各動きベクトルの差分の絶対値を演算し、
得られた絶対値が所定値よりも小さい場合には、上記隣接する第1のブロックについての各動きベクトルの平均動きベクトルを演算して、得られた平均動きベクトルで示される座標位置を中心とする上記第2の探索領域を設定し、
また、得られた絶対値が所定値よりも大きい場合には、上記隣接する第1のブロックについての各動きベクトルで示される座標位置を中心とする上記第2の探索領域を設定し、
上記第2のブロックについての動きベクトルを上記第1の探索領域よりも小さい上記第2の探索領域でブロックマッチングを行って検出することを特徴とする動きベクトル検出方法。 In a motion vector detection method for detecting a motion vector for an image composed of a plurality of blocks each having a first block and a second block alternately positioned in the horizontal direction or the vertical direction ,
For each first block, detect a motion vector in the first search region ,
In detecting a motion vector in the second search region for each second block,
Calculating the absolute value of the difference of each motion vector for the first block adjacent to the second block on both sides in the horizontal or vertical direction;
When the obtained absolute value is smaller than a predetermined value, the average motion vector of each motion vector for the adjacent first block is calculated, and the coordinate position indicated by the obtained average motion vector is the center. Set the second search area to
When the obtained absolute value is larger than a predetermined value, the second search area centered on the coordinate position indicated by each motion vector for the adjacent first block is set.
A motion vector detection method comprising: detecting a motion vector for the second block by performing block matching in the second search region smaller than the first search region .
各第1のブロックについて、それぞれ第1の探索領域で動きベクトルを検出する第1の動きベクトル検出手段と、
各第2のブロックについて、それぞれ第2の探索領域で動きベクトルを検出するにあたり、
上記第2のブロックと水平方向又は垂直方向における両側に隣接する上記第1のブロックについての各動きベクトルの差分の絶対値を演算し、
得られた絶対値が所定値よりも小さい場合には、上記隣接する第1のブロックについての各動きベクトルの平均動きベクトルを演算して、得られた平均動きベクトルで示される座標位置を中心とする上記第2の探索領域を設定し、また、得られた絶対値が所定値よりも大きい場合には、上記隣接する第1のブロックについての各動きベクトルで示される座標位置を中心とする上記第2の探索領域を設定する探索領域設定手段と、
上記第2のブロックについての動きベクトルを上記第1の探索領域よりも小さい上記第2の探索領域でブロックマッチングを行って検出する第2の動きベクトル検出手段とを備える
ことを特徴とする動きベクトル検出装置。 In a motion vector detection device for detecting a motion vector for an image composed of a plurality of blocks each having a first block and a second block alternately positioned in the horizontal direction or the vertical direction ,
First motion vector detection means for detecting a motion vector in the first search region for each first block ;
In detecting a motion vector in the second search region for each second block,
Calculating the absolute value of the difference of each motion vector for the first block adjacent to the second block on both sides in the horizontal or vertical direction;
When the obtained absolute value is smaller than a predetermined value, the average motion vector of each motion vector for the adjacent first block is calculated, and the coordinate position indicated by the obtained average motion vector is the center. The second search area is set, and when the obtained absolute value is larger than a predetermined value, the coordinate position indicated by each motion vector for the adjacent first block is the center. Search area setting means for setting a second search area ;
A motion vector comprising: second motion vector detection means for detecting a motion vector of the second block by performing block matching in the second search region smaller than the first search region. Detection device.
Priority Applications (12)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP30147898A JP4035903B2 (en) | 1998-10-22 | 1998-10-22 | Motion vector detection method and apparatus |
TW088117602A TW444507B (en) | 1998-10-22 | 1999-10-12 | Detecting method and device for motion vector |
AU61242/99A AU751909B2 (en) | 1998-10-22 | 1999-10-18 | Motion vector detecting method and device |
CNB031530419A CN1222173C (en) | 1998-10-22 | 1999-10-18 | Method and device for checking motion vector |
EP99947946A EP1051040A1 (en) | 1998-10-22 | 1999-10-18 | Motion vector detecting method and device |
CA002314976A CA2314976C (en) | 1998-10-22 | 1999-10-18 | Motion vector detecting method and device |
KR1020007006895A KR100659627B1 (en) | 1998-10-22 | 1999-10-18 | Moving vector detection method and apparatus |
CNB998031798A CN1148069C (en) | 1998-10-22 | 1999-10-18 | Motion vector detecting method and device |
PCT/JP1999/005735 WO2000024202A1 (en) | 1998-10-22 | 1999-10-18 | Motion vector detecting method and device |
CNB031530427A CN1222174C (en) | 1998-10-22 | 1999-10-18 | Method and device for checking motion vector |
US09/582,156 US6594314B1 (en) | 1998-10-22 | 1999-10-18 | Motion vector detection method and apparatus |
MYPI99004526A MY125635A (en) | 1998-10-22 | 1999-10-20 | Motion vector detection method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP30147898A JP4035903B2 (en) | 1998-10-22 | 1998-10-22 | Motion vector detection method and apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2000134628A JP2000134628A (en) | 2000-05-12 |
JP4035903B2 true JP4035903B2 (en) | 2008-01-23 |
Family
ID=17897397
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP30147898A Expired - Fee Related JP4035903B2 (en) | 1998-10-22 | 1998-10-22 | Motion vector detection method and apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4035903B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6671319B1 (en) * | 1999-12-28 | 2003-12-30 | Sony Corporation | Methods and apparatus for motion estimation using neighboring macroblocks |
JP3968712B2 (en) | 2003-04-28 | 2007-08-29 | ソニー株式会社 | Motion prediction compensation apparatus and method |
JP2008061162A (en) * | 2006-09-04 | 2008-03-13 | Fujitsu Ltd | Motion vector search apparatus and motion vector search method |
TWI838914B (en) | 2017-04-13 | 2024-04-11 | 美商松下電器(美國)知識產權公司 | Coding device, decoding device and non-transitory computer-readable medium |
CN110495177B (en) * | 2017-04-13 | 2023-10-20 | 松下电器(美国)知识产权公司 | Decoding device, decoding method, and storage medium |
-
1998
- 1998-10-22 JP JP30147898A patent/JP4035903B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2000134628A (en) | 2000-05-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7953154B2 (en) | Image coding device and image coding method | |
JP3538055B2 (en) | Motion vector detection device | |
KR100659627B1 (en) | Moving vector detection method and apparatus | |
KR100843418B1 (en) | Apparatus and method for image coding | |
JP4035903B2 (en) | Motion vector detection method and apparatus | |
JP2007124408A (en) | Motion vector detector and motion vector detecting method | |
CN101822058A (en) | Video encoding using pixel decimation | |
JPH089379A (en) | Motion vector detection method | |
JPH10327401A (en) | Motion vector detection method and image signal coding method and apparatus using the same | |
JP4196447B2 (en) | Motion vector detection method and apparatus | |
JP2008177630A (en) | Motion vector detector | |
JPH1042300A (en) | Motion vector detection device | |
JP3309519B2 (en) | Motion vector detection device | |
JP2004229150A (en) | Motion vector searching method and device | |
JPH11113003A (en) | Motion vector detector and motion vector detection method | |
JP4078733B2 (en) | Motion vector detection method and apparatus | |
JP4241021B2 (en) | Motion vector detection method, motion vector detection device, and image encoding device | |
WO1999044369A1 (en) | Device and method for coding image | |
JPH08242454A (en) | Method for detecting global motion parameter | |
JPH09182078A (en) | Motion vector detection device and motion vector detection method | |
JPH11205816A (en) | Moving vector detection device | |
JP2002501697A (en) | Computer-aided motion estimation method and apparatus for image elements of an image to be encoded | |
JP2000069481A (en) | Motion vector detection device | |
JP4304912B2 (en) | Motion vector detection apparatus and method | |
JPH06217294A (en) | Image data compressing device and image data transmitting method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050617 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070710 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070910 |
|
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: 20071009 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20071022 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101109 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |