JP5286573B2 - Motion vector detection apparatus, motion vector detection method and program - Google Patents

Motion vector detection apparatus, motion vector detection method and program Download PDF

Info

Publication number
JP5286573B2
JP5286573B2 JP2009287853A JP2009287853A JP5286573B2 JP 5286573 B2 JP5286573 B2 JP 5286573B2 JP 2009287853 A JP2009287853 A JP 2009287853A JP 2009287853 A JP2009287853 A JP 2009287853A JP 5286573 B2 JP5286573 B2 JP 5286573B2
Authority
JP
Japan
Prior art keywords
motion vector
block
search
motion
image
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.)
Active
Application number
JP2009287853A
Other languages
Japanese (ja)
Other versions
JP2011130264A (en
Inventor
隆之 大西
卓 佐野
裕江 岩崎
一人 上倉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2009287853A priority Critical patent/JP5286573B2/en
Publication of JP2011130264A publication Critical patent/JP2011130264A/en
Application granted granted Critical
Publication of JP5286573B2 publication Critical patent/JP5286573B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、動きベクトル検出装置、動きベクトル検出方法およびプログラムに関する。   The present invention relates to a motion vector detection device, a motion vector detection method, and a program.

動画像を圧縮符号化する動画像符号化方式として、MPEG(Moving Picture Experts Group)符号化方式や、H.264/AVC符号化方式などが知られている。MPEG符号化方式として、ディジタル放送やDVDなどの高画質用途にはMPEG−2符号化方式が用いられ、携帯テレビ電話などの低ビットレート用途にはMPEG−4符号化方式が広く用いられている。また、H.264/AVC符号化方式は、ITU−T(The International Telecommunication Union Telecommunication Standardization Sector)とMPEGとが共同で標準化を行った符号化方式であり、高画質と高圧縮率とを両立する新たな方式として注目を集めている。   As a moving picture coding method for compressing and coding a moving picture, MPEG (Moving Picture Experts Group) coding method, The H.264 / AVC encoding method and the like are known. As an MPEG encoding method, the MPEG-2 encoding method is used for high image quality applications such as digital broadcasting and DVD, and the MPEG-4 encoding method is widely used for low bit rate applications such as mobile videophones. . H. The H.264 / AVC encoding system is an encoding system jointly standardized by ITU-T (The International Telecommunication Union Telecommunication Standardization Sector) and MPEG, and is a new system that achieves both high image quality and high compression rate. It attracts attention.

これらの動画像符号化方式では、一般に、動き予測(インター予測)を行って符号量の削減を図っている。動き予測は、ある一枚の画像(フレーム(Frame))を分割した一部分であるマクロブロック(Macroblock;MB)を符号化する際に、時間的に過去ないし未来に位置する画像(参照画像)の中から、符号化対象のマクロブロック、あるいは、このマクロブロックをさらに分割したブロックと画像が類似する領域を探索し、探索によって検出した領域の画像と符号化対象の画像との差分を取って符号化を行う技術であり、時間的に連続して存在する被写体を示す符号量を大きく削減することができる。この、符号化対象のマクロブロックまたはブロックと画像が類似する領域を探索する作業を、動き探索と呼ぶ。
MPEG方式や、H.264/AVC方式では、符号化対象の画像は、Iピクチャ(Intra-coded Picture)とPピクチャ(Predicated Picture)とBピクチャ(Bi-directed Picture)との3種類に分類される。Iピクチャは、動き予測を行わない画像であり、PピクチャやBピクチャで参照される。Pピクチャは、時間的に過去に位置するIピクチャまたはPピクチャを用いて、1方向の動き予測を行う画像である。Bピクチャは、時間的に過去に位置するIピクチャまたはPピクチャ、および、未来に位置するIピクチャまたはPピクチャを用いて、双方向の動き予測を行う画像である。
In these moving image encoding methods, generally, motion prediction (inter prediction) is performed to reduce the code amount. In motion prediction, when a macroblock (MB), which is a part obtained by dividing a single image (frame), is encoded, an image (reference image) positioned in the past or future in time is encoded. Search for a macroblock to be encoded, or a region where the image is similar to a block obtained by further dividing this macroblock, and code the difference between the image detected in the search and the image to be encoded. The amount of code indicating a subject that exists continuously in time can be greatly reduced. This operation of searching for an encoding target macroblock or an area similar to an image of a block is called motion search.
MPEG system, H.264, etc. In the H.264 / AVC format, images to be encoded are classified into three types of I pictures (Intra-coded Pictures), P pictures (Predicated Pictures), and B pictures (Bi-directed Pictures). The I picture is an image for which motion prediction is not performed, and is referred to as a P picture or a B picture. A P picture is an image in which motion prediction in one direction is performed using an I picture or P picture located in the past in time. A B picture is an image that performs bidirectional motion prediction using an I picture or P picture located in the past in time and an I picture or P picture located in the future.

図7は、MPEG−2やH.264/AVCの動き予測において参照する画像の例を示す図である。
MPEG−2の動き予測では、PピクチャやBピクチャで参照する画像は、直前や直後に位置する画像に一意に定まる。Pピクチャの動き予測で参照する画像は、直前のIピクチャまたはPピクチャである。図7(a)の例では、時間順に5枚の画像P715〜P711が示されており、P715とP713とP711とがPピクチャであり、P714とP712とがBピクチャである。このうち、PピクチャP711の動き予測を行う際に、直前のPピクチャP713を参照している。また、Bピクチャの動き予測で参照する画像は、直前のIピクチャまたはPピクチャ、および、直後のIピクチャまたはPピクチャである。図7(a)の例では、BピクチャP712の動き予測を行う際に、直前のPピクチャP713と直後のPピクチャP711とを参照している。
FIG. 7 shows MPEG-2 and H.264. 2 is a diagram illustrating an example of an image referred to in H.264 / AVC motion prediction.
In the motion prediction of MPEG-2, an image referred to by a P picture or a B picture is uniquely determined as an image located immediately before or after. The picture referred to in the motion prediction of the P picture is the immediately preceding I picture or P picture. In the example of FIG. 7A, five images P715 to P711 are shown in time order, P715, P713, and P711 are P pictures, and P714 and P712 are B pictures. Among them, the previous P picture P713 is referred to when motion prediction of the P picture P711 is performed. In addition, the images referred to in the motion prediction of the B picture are the immediately preceding I picture or P picture, and the immediately following I picture or P picture. In the example of FIG. 7A, when the motion prediction of the B picture P712 is performed, the immediately preceding P picture P713 and the immediately following P picture P711 are referred to.

これに対し、H.264/AVC符号化方式では、符号化効率を高めるため、動き予測に使用する参照画像を、多数の候補の中から選択することができる。
図7(b)の例では、時間順に5枚の画像P725〜P721が示されており、P725とP723とP721とがPピクチャであり、P724とP722とがBピクチャである。このうち、PピクチャP25の動き予測を行う際に、時間的に前方向のIピクチャおよびPピクチャ(かつ参照画像メモリから削除されていないもの)から、参照画像としてPピクチャP725およびP723を選択している。また、図7(b)の例では、BピクチャP24の動き予測を行う際に、時間的に前方向のPピクチャP725およびP723と、時間的に後方向のPピクチャP721とを選択している。
On the other hand, H.H. In the H.264 / AVC encoding scheme, a reference image used for motion prediction can be selected from a large number of candidates in order to increase encoding efficiency.
In the example of FIG. 7B, five images P725 to P721 are shown in time order, P725, P723, and P721 are P pictures, and P724 and P722 are B pictures. Among these, when performing motion prediction of P picture P25, P pictures P725 and P723 are selected as reference pictures from temporally forward I and P pictures (and not deleted from the reference picture memory). ing. In the example of FIG. 7B, when performing motion prediction of the B picture P24, temporally forward P pictures P725 and P723 and temporally backward P picture P721 are selected. .

図8は、H.264/AVC符号化方式で、動き予測を行う単位となるブロックのサイズを示す図である。
MPEG−2符号化方式では、動き予測を行う単位は、横16×縦16画素のマクロブロック単位(、あるいは、符号化モードによっては横16×縦8画素のブロック単位)に限定されている。これに対して、H.264/AVC符号化方式では、図8に示す横16×縦16画素ブロックB811、横16×縦8画素ブロックB821およびB822、横8×縦16画素ブロックB831およびB832、横8×縦8画素ブロックB841〜B844、さらには横8×縦8画素ブロックの各々をさらに分割した横8×縦4画素のサブブロックB851およびB852、横4×縦8画素のサブブロックB861およびB862、横4×縦4画素のサブブロックB871〜B874の中から、いずれかの分割方法を選択する。そして、ブロック毎あるいはサブブロック毎に、符号化対象の画像のブロックまたはサブブロックに類似する参照画像上の領域を探索する動き探索を行って、この領域を示す動きベクトル(符号化対象の画像のブロックまたはサブブロックからの相対座標)を算出し、ブロック毎あるいはサブブロック毎に動き予測を行うことができる。もっとも、リアルタイム処理を要求される符号化器においては、処理の煩雑さを避けるため、横8×縦8画素以上のブロックサイズを選択して動き予測を行うことが多い。
FIG. 2 is a diagram illustrating the size of a block serving as a unit for performing motion prediction in the H.264 / AVC encoding scheme. FIG.
In the MPEG-2 encoding method, the unit for motion prediction is limited to a macro block unit of horizontal 16 × vertical 16 pixels (or a block unit of horizontal 16 × vertical 8 pixels depending on the encoding mode). On the other hand, H.H. In the H.264 / AVC encoding method, the horizontal 16 × vertical 16 pixel block B811, the horizontal 16 × vertical 8 pixel block B821 and B822, the horizontal 8 × vertical 16 pixel block B831 and B832, and the horizontal 8 × vertical 8 pixel block shown in FIG. B841 to B844, further subdivided into horizontal 8 × vertical 4 pixel sub-blocks B851 and B852, each of horizontal 8 × vertical 8 pixel blocks, sub-blocks B861 and B862 of horizontal 4 × vertical 8 pixels, horizontal 4 × vertical 4 One of the division methods is selected from the pixel sub-blocks B871 to B874. Then, for each block or sub-block, a motion search is performed to search for a region on the reference image similar to the block or sub-block of the image to be encoded, and a motion vector indicating the region (of the image to be encoded) Relative coordinates from the block or sub-block) can be calculated, and motion prediction can be performed for each block or sub-block. However, in an encoder that requires real-time processing, motion prediction is often performed by selecting a block size of 8 × 8 pixels or more in order to avoid processing complexity.

H.264/AVC符号化方式のように、参照画像および符号化対象ブロックサイズを多くの候補から選択できる場合、符号化効率を向上させるために、理想的にはすべての参照画像とブロックサイズとを候補として動き探索を行い、最適な参照画像およびブロックサイズを決定することが望ましい。しかし、全ての参照画像とブロックサイズとについて動き探索を行うと、演算量が膨大になってしまう。そこで、一般的な符号化器では、2段階で動き探索を行うことにより、演算量を削減する。この場合、まず、限定したブロックサイズについて、複数の参照画像に対する広範囲な動き探索を行う一次探索により、参照画像とブロックサイズとの候補を絞り込む。そして、一次探索の結果に基づいて、その他のブロックサイズも含めた詳細な動き探索である二次探索を、一次探索の結果得られたベクトルの近傍に限定して行い、最終的な参照画像やブロックサイズを決定する。   When the reference image and the encoding target block size can be selected from a large number of candidates as in the H.264 / AVC encoding scheme, all reference images and block sizes are ideally selected in order to improve the encoding efficiency. It is desirable to perform a motion search using as candidates and determine an optimal reference image and block size. However, if motion search is performed for all reference images and block sizes, the amount of computation becomes enormous. Therefore, in a general encoder, the amount of calculation is reduced by performing motion search in two stages. In this case, first, candidates for a reference image and a block size are narrowed down by a primary search that performs a wide range of motion searches for a plurality of reference images for a limited block size. Then, based on the result of the primary search, a secondary search that is a detailed motion search including other block sizes is limited to the vicinity of the vector obtained as a result of the primary search, and the final reference image or Determine the block size.

また、一次探索において、参照画像上から、符号化対象の部分と、より類似性の高い部分を検出するためには、参照画像上の広い範囲を動き探索する必要があり、演算量が非常に大きくなる。そこで、一般的な符号化器では、符号化対象の画像および参照画像を縮小して一次探索を行う。例えば、符号化対象の画像および参照画像を、縦横共に2分の1に縮小することにより、比較する画素数を4分の1に減らすことができ、より少ない演算量で広い範囲を動き探索することができる。
さらに、特許文献1の段落0028〜0032では、テレスコピック探索法と呼ばれる動き探索方法が示されている。テレスコピック探索法では、比較的小さな範囲の探索の繰り返しによって、参照画像上での物体の大きな動きに追従することができる。
Further, in the primary search, in order to detect a part that is more similar to the part to be encoded from the reference image, it is necessary to perform a motion search over a wide range on the reference image, and the calculation amount is very large. growing. Therefore, a general encoder performs a primary search by reducing the image to be encoded and the reference image. For example, by reducing the image to be encoded and the reference image by a factor of two both vertically and horizontally, the number of pixels to be compared can be reduced to a quarter, and a wide range is searched for motion with a smaller amount of computation. be able to.
Furthermore, paragraphs 0028 to 0032 of Patent Document 1 show a motion search method called a telescopic search method. In the telescopic search method, it is possible to follow a large movement of an object on a reference image by repeating a search in a relatively small range.

図9は、テレスコピック探索の例を示す図である。
同図において、符号化対象画像P91と参照画像P94とは、非参照画像P92およびP93を挟み、時間方向に3画像ぶん離れている。テレスコピック探索では、符号化対象画像P91の符号化対象ブロックが参照する、参照画像P94中の部分を決定する際に、参照画像P94を直接動き探索するのではなく、まず時間的に隣接する非参照画像P92に、符号化対象ブロックの座標に応じた探索範囲を設定し、動き探索を行う。動き探索により、探索結果R92として、符号化対象ブロックB91に類似する領域を示す相対座標(動きベクトル)が得られたら、この探索結果R92が示す座標を中心として、非参照画像P93に探索範囲を設定し、動き探索を行う。探索結果R93が得られたら、この探索結果R93が示す座標を中心として、参照画像P94に探索範囲を設定し、動き探索を行う。そして、この動き探索によって得られる探索結果R94を、最終的な動き探索結果とする。
このように、時間的に隣接する画像で順に動き探索を行うことにより、符号化対象ブロックの被写体の動きを追うことができる。これにより、各回の動き探索の対象領域は比較的狭い範囲としつつ、最終的な参照画像P94に対しては、広い範囲を動き探索の対象領域とすることができる。
FIG. 9 is a diagram illustrating an example of telescopic search.
In the figure, the encoding target image P91 and the reference image P94 are separated by three images in the time direction with the non-reference images P92 and P93 interposed therebetween. In the telescopic search, when determining a portion in the reference image P94 that is referenced by the encoding target block of the encoding target image P91, the reference image P94 is not directly searched for motion, but is first temporally adjacent non-reference. A search range corresponding to the coordinates of the encoding target block is set in the image P92, and a motion search is performed. If relative coordinates (motion vectors) indicating a region similar to the encoding target block B91 are obtained as a search result R92 by the motion search, a search range is set in the non-reference image P93 with the coordinates indicated by the search result R92 as the center. Set and perform motion search. When the search result R93 is obtained, a search range is set in the reference image P94 around the coordinates indicated by the search result R93, and a motion search is performed. The search result R94 obtained by this motion search is used as the final motion search result.
In this way, by performing motion search sequentially on temporally adjacent images, it is possible to follow the motion of the subject of the encoding target block. Accordingly, the target area for each motion search can be a relatively narrow range, and a wide range can be set as the target area for motion search for the final reference image P94.

H.264/AVC符号化方式のように、小さなブロックサイズを使用した動き予測が可能な場合、画面中の物体の動きを細かく追うためには、なるべく小さなブロックサイズで一次探索を行うことが望ましい。例えば、横8×縦8画素のブロックサイズと横16×縦16画素のブロックサイズとの何れかで一次探索を行う符号化器においては、8×8画素のブロックサイズで一次探索を行うほうが、横16×縦16画素で一次探索を行うよりも、より詳細な動き探索を行うことができる。具体的には、符号化対象の画像に物体と背景との境界が含まれる場合に、小さなブロックサイズを用いることにより、物体のブロックと背景のブロックとを区別し、それぞれの動きを細かく追うことができる。
しかしながら、横8×縦8画素のブロックサイズの一次探索を、縦横2分の1に縮小した画像で行う場合、動き探索に使用する画像が横4×縦4画素=16画素という小さなサイズとなるため、画像中のノイズ等による擾乱の影響を受けて、物体の動きを正確に追うことが困難になる場合がある。例えばテレスコピック探索を使用する場合、動体の追跡に一度失敗すると、探索の中心点がずれ、以降の探索も失敗する確率が高い。また、1マクロブロックあたり4つのブロックそれぞれについて、テレスコピック探索を独立して行うと、演算量も大きくなる。
H. When motion prediction using a small block size is possible as in the H.264 / AVC encoding method, it is desirable to perform a primary search with as small a block size as possible in order to closely track the motion of an object on the screen. For example, in an encoder that performs a primary search with either a block size of 8 × 8 pixels or a block size of 16 × 16 pixels, it is better to perform a primary search with a block size of 8 × 8 pixels. A more detailed motion search can be performed than when a primary search is performed with 16 horizontal pixels × 16 vertical pixels. Specifically, when the image to be encoded includes a boundary between the object and the background, a small block size is used to distinguish the object block from the background block and to follow each movement in detail. Can do.
However, when the primary search of the block size of horizontal 8 × vertical 8 pixels is performed with an image reduced to half the vertical and horizontal, the image used for motion search has a small size of horizontal 4 × vertical 4 pixels = 16 pixels. Therefore, it may be difficult to accurately follow the movement of the object due to the influence of disturbance due to noise or the like in the image. For example, when using telescopic search, once tracking of a moving object fails, the center point of the search shifts, and there is a high probability that the subsequent search will also fail. In addition, if the telescopic search is performed independently for each of the four blocks per macroblock, the amount of calculation increases.

そこで、一次探索において、マクロブロック単位で動き探索を行う方法が考えられる。例えば、縦横2分の1に縮小した画像上で、横8×縦8画素=64画素のテレスコピック探索を行う。これにより、ノイズによる擾乱を防ぐことができ、また、演算量を削減することができる。
この場合、1つのマクロブロックに対して1つの動きベクトルが得られるのみとなる。そこで、横16×縦8画素または横8×縦16画素または横8×縦8画素のブロックなどの動き予測に対応するためには、二次探索において一次探索結果の動きベクトルの近傍を横8×縦8画素ブロック単位で探索することや、二次探索においてゼロベクトルの近傍や動きベクトル予測値(予測動きベクトル、Predicted Motion Vector;PMV)の近傍を横8×縦8画素ブロック単位で探索することができる。
Therefore, a method of performing motion search in units of macroblocks in the primary search can be considered. For example, a telescopic search of horizontal 8 × vertical 8 pixels = 64 pixels is performed on an image reduced to half the vertical and horizontal dimensions. As a result, disturbance due to noise can be prevented, and the amount of calculation can be reduced.
In this case, only one motion vector is obtained for one macroblock. Therefore, in order to cope with motion prediction such as a block of horizontal 16 × vertical 8 pixels or horizontal 8 × vertical 16 pixels or horizontal 8 × vertical 8 pixels, the vicinity of the motion vector of the primary search result in the secondary search is horizontal 8 Search in units of vertical 8 pixel blocks, or search in the vicinity of zero vectors and motion vector prediction values (predicted motion vectors (PMV)) in units of horizontal 8 × vertical 8 pixel blocks in a secondary search. be able to.

ここでいう「ゼロベクトル」は、原点を示すベクトルである。ゼロベクトルは、参照画像上での符号化対象のブロックの位置を、符号化対象のブロックの位置からの相対座標で示している。ゼロベクトル近傍の探索は、静止している背景等の検出に有効である。
また、「動きベクトル予測値」は、符号化対象のブロックの上または右上または左上または左に隣接する、既に動きベクトルを検出済みの各ブロックの動きベクトルから、H.264/AVC等の符号化標準で定められた手順に基づいて算出されるベクトルである。例えば、図8で説明した横16×縦8画素ブロックB821およびB822の場合、上側のブロックB821では、このブロックB821に上隣接するブロックの動きベクトルから動きベクトル予測値を算出する。また、下側のブロックB822では、このブロックB822に左隣接するブロックの動きベクトルから動きベクトル予測値を算出する。
動きベクトル予測値は、周辺のブロックの動きを代表したベクトル値であり、符号化対象のブロックの画像が、周辺のブロックの画像と同様の動きを示している場合は、この符号化対象のブロックの動きベクトルが動きベクトル予測値とほぼ同じ値となることが期待される。例えば、H.264/AVCの符号化標準に従って動きベクトルを符号化する場合、動きベクトルと動きベクトル予測値との差分をとって符号化を行う。このため、動きベクトルの値が動きベクトル予測値に近いほど、動きベクトルを表現するための符号量が少なくて済む。
The “zero vector” here is a vector indicating the origin. The zero vector indicates the position of the block to be encoded on the reference image in relative coordinates from the position of the block to be encoded. Searching near the zero vector is effective for detecting a stationary background or the like.
In addition, the “motion vector prediction value” is obtained from the motion vector of each block that has already detected a motion vector adjacent to the top, upper right, upper left, or left of the block to be encoded. It is a vector calculated based on a procedure defined by an encoding standard such as H.264 / AVC. For example, in the case of the horizontal 16 × vertical 8 pixel blocks B821 and B822 described with reference to FIG. 8, the upper block B821 calculates a motion vector prediction value from the motion vector of the block adjacent to the block B821. Further, in the lower block B822, a motion vector prediction value is calculated from the motion vector of the block adjacent to the left of this block B822.
The motion vector prediction value is a vector value that represents the motion of the surrounding block, and when the image of the encoding target block shows the same motion as the image of the surrounding block, the encoding target block Is expected to be almost the same value as the motion vector prediction value. For example, H.M. When a motion vector is encoded according to the H.264 / AVC encoding standard, encoding is performed by taking the difference between the motion vector and the motion vector prediction value. For this reason, the closer the motion vector value is to the motion vector prediction value, the smaller the amount of code for expressing the motion vector.

特開2000−242554号公報JP 2000-242554 A

一次探索をマクロブロック単位で探索する場合、動体と背景など、物体の境界に位置するマクロブロックでは、動体を正確に追うことができない場合がある。
図10は、動体と背景の境界に位置するマクロブロックの例を示す図である。
同図のマクロブロックB101は、横16×縦16画素の領域全体が「移動している自動車」の画像であり、マクロブロック単位の動き探索で画像の動きを追うことができる。
これに対して、マクロブロックB102は、上半分の横16×縦8画素の領域が「背景」の画像であり、下半分の横16×縦8画素の領域が「移動している自動車」の画像である。このため、マクロブロック単位の探索では、背景領域に影響を受け、移動している車の動きベクトルを適切に検出できない場合がある。
When the primary search is performed in units of macroblocks, there are cases in which a moving object cannot be accurately followed by a macroblock located at the boundary between objects, such as a moving object and a background.
FIG. 10 is a diagram illustrating an example of a macroblock located at the boundary between the moving object and the background.
The macroblock B101 in the figure is an image of a “moving automobile” in which the entire area of 16 × 16 pixels is “moving car”, and the movement of the image can be followed by a motion search in units of macroblocks.
On the other hand, in the macro block B102, the upper half 16 × 8 pixels area is the “background” image, and the lower half 16 × 8 pixels area is “moving car”. It is an image. For this reason, in the search in units of macroblocks, the motion vector of a moving car may not be detected properly due to the influence of the background area.

マクロブロックB102の上半分の「背景」部分については、例えば二次探索においてゼロベクトル近傍を横8×縦8画素ブロック単位で探索することによって、動きベクトルを得ることが期待できる。あるいは、背景が移動(パン)している場合でも、前述の動きベクトル予測値が、周辺の背景の動きを反映している。そこで、動きベクトル予測値の近傍を探索することにより、背景部分をある程度正確に動き予測することができる。
しかし、背景の影響を受けて正確に探索ができなかったマクロブロックB102の下半分の動体領域については、二次探索を行う元の座標が得られず、二次探索によって対処することはできない。その結果、例えば、符号化対象のマクロブロックと類似性の低い画像との差分を取って動き予測を行う、あるいは、Iピクチャと同様に動き予測を使用しないイントラ予測を行うなど、符号量の増大や復号画像の画質低下の原因となる。
For the “background” portion of the upper half of the macroblock B102, it can be expected that a motion vector is obtained by searching the vicinity of the zero vector in units of 8 × 8 pixels in the secondary search, for example. Alternatively, even when the background is moving (panning), the motion vector prediction value reflects the motion of the surrounding background. Therefore, by searching for the vicinity of the motion vector prediction value, it is possible to predict the motion of the background portion with a certain degree of accuracy.
However, for the moving object region in the lower half of the macroblock B102 that cannot be accurately searched due to the influence of the background, the original coordinates for performing the secondary search cannot be obtained and cannot be dealt with by the secondary search. As a result, the amount of code increases, for example, motion prediction is performed by taking the difference between a macroblock to be encoded and an image with low similarity, or intra prediction that does not use motion prediction as in the case of an I picture. Or the image quality of the decoded image is degraded.

本発明は、このような事情を考慮してなされたものであり、その目的は、画像中のノイズ等の擾乱の影響を受けにくく、演算量が少なく、かつ、物体の境界に位置するマクロブロックでも動きベクトルを適切に検出できる動きベクトル検出装置、動きベクトル検出方法およびプログラムを提供することにある。   The present invention has been made in consideration of such circumstances, and the object thereof is a macroblock that is less affected by disturbances such as noise in an image, has a small amount of calculation, and is located at the boundary of an object. However, it is to provide a motion vector detection apparatus, a motion vector detection method, and a program capable of appropriately detecting a motion vector.

[1]この発明は上述した課題を解決するためになされたもので、本発明の一態様による動きベクトル検出装置は、入力動画像のマクロブロックを分割したブロック毎に、参照画像上で前記ブロックに対応する領域の位置を示す動きベクトルを検出する動きベクトル検出装置であって、前記マクロブロックを分割したブロック毎に、前記参照画像上での当該ブロックの位置を示すゼロベクトルの周辺と、当該ブロックに隣接するブロックの動きベクトルに基づいて定まる動きベクトル予測値の周辺との動きベクトルの候補の各々について、当該ブロックの画素と前記参照画像の画素との差分に基づいて動きベクトル評価値を算出し、所定の閾値以下の動きベクトル評価値の有無を判定する事前近傍探索器と、前記マクロブロックに対する一次動きベクトルを、前記事前近傍探索器が所定の閾値以下の動きベクトル評価値無しと判定した各ブロックの画素と前記参照画像の画素との差分に基づく、マクロブロック単位での動き探索によって検出する一次探索器と、前記事前近傍探索器が所定の閾値以下の動きベクトル評価値無しと判定したブロックの各々については、前記一次動きベクトルの周辺の動き探索を行って動きベクトルを検出し、前記事前近傍探索器が所定の閾値以下の動きベクトル評価値有りと判定したブロックの各々については、前記動きベクトル評価値が所定の閾値以下の動きベクトルの候補を当該ブロックの動きベクトルとする二次探索器と、を具備することを特徴とする。
ここでいう「一次動きベクトル」とは、近傍探索(二次探索)に先立って行う動き探索である一次探索によって得られる動きベクトルであり、二次探索の中心を示す。
[1] The present invention has been made to solve the above-described problems, and a motion vector detection device according to an aspect of the present invention provides a block on a reference image for each block obtained by dividing a macroblock of an input moving image. a motion vector detecting apparatus for detecting a motion vector indicating the position of the region corresponding to, for each block obtained by dividing the macro block, and surrounding the zero vector indicating the position of the block on the reference image, the for each of the candidate motion vectors of the surrounding motion vector prediction value determined on the basis of the motion vectors of blocks adjacent to the block, calculates the motion vector evaluation value based on a difference between pixels of the pixel and the reference picture of the block A pre-neighbor searcher for determining the presence or absence of a motion vector evaluation value below a predetermined threshold, and a primary for the macroblock The can vector, the pre vicinity searcher is based on the difference between the pixel of the pixel and the reference image of each block is determined that the following motion vector evaluation value without a predetermined threshold value, detected by the motion search in the macro block unit For each of the primary searcher and the blocks determined by the prior neighborhood searcher as having no motion vector evaluation value equal to or less than a predetermined threshold, a motion vector is detected by performing a motion search around the primary motion vector, For each block for which the pre-article neighborhood searcher determines that there is a motion vector evaluation value equal to or less than a predetermined threshold, a secondary motion vector candidate whose motion vector evaluation value is equal to or less than the predetermined threshold is used as the motion vector of the block. And a searcher.
The “primary motion vector” here is a motion vector obtained by a primary search, which is a motion search performed prior to a neighborhood search (secondary search), and indicates the center of the secondary search.

[2]また、本発明の一形態による動きベクトル検出方法は、入力動画像のマクロブロックを分割したブロック毎に、参照画像上で前記ブロックに対応する領域の位置を示す動きベクトルを検出する動きベクトル検出装置の動きベクトル検出方法であって、前記マクロブロックを分割したブロック毎に、前記参照画像上での当該ブロックの位置を示すゼロベクトルの周辺と、当該ブロックに隣接するブロックの動きベクトルに基づいて定まる動きベクトル予測値の周辺との、動きベクトルの候補の各々について、当該ブロックの画素と前記参照画像の画素との差分に基づいて動きベクトル評価値を算出し、所定の閾値以下の動きベクトル評価値の有無を判定する事前近傍探索ステップと、前記マクロブロックに対する一次動きベクトルを、前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値無しと判定した各ブロックの画素と前記参照画像の画素との差分に基づく、マクロブロック単位での動き探索によって検出する一次探索ステップと、前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値無しと判定したブロックの各々については、前記一次動きベクトルの周辺の動き探索を行って動きベクトルを検出し、前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値有りと判定したブロックの各々については、前記動きベクトル評価値が前記所定の閾値以下の前記動きベクトルの候補を当該ブロックの動きベクトルとする二次探索ステップと、を具備することを特徴とする。 [2] A motion vector detection method according to an aspect of the present invention is a motion vector detection method for detecting a motion vector indicating a position of an area corresponding to a block on a reference image for each block obtained by dividing a macroblock of an input moving image. a motion vector detecting method of the vector detecting device, for each block obtained by dividing the macro block, and surrounding the zero vector indicating the position of the block on the reference image, the motion vectors of blocks adjacent to the block a peripheral motion vector prediction value, which is determined, for each of the candidate motion vectors, and calculates a motion vector evaluation value based on a difference between pixels of the pixel and the reference picture of the block, following the motion predetermined threshold A prior neighborhood search step for determining the presence or absence of a vector evaluation value, and a primary motion vector for the macroblock, Based on the difference between the pixel of the pixel and the reference image of each block is determined that the predetermined following motion vector evaluation value without the threshold at pre vicinity search step, a first search step of detecting the motion search in the macro block unit, For each block determined to have no motion vector evaluation value equal to or less than a predetermined threshold in the prior neighborhood search step, a motion vector is detected by performing a motion search around the primary motion vector, and the prior neighborhood search For each block that is determined to have a motion vector evaluation value less than or equal to a predetermined threshold in the step, a secondary search using the motion vector candidates whose motion vector evaluation value is less than or equal to the predetermined threshold as the motion vector of the block And a step.

[3]また、本発明の一形態によるプログラムは、コンピュータに、入力動画像のマクロブロックを分割したブロック毎に、参照画像上で前記ブロックに対応する領域の位置を示す動きベクトルを出力させるためのプログラムであって、前記マクロブロックを分割したブロック毎に、前記参照画像上での当該ブロックの位置を示すゼロベクトルの周辺と、当該ブロックに隣接するブロックの動きベクトルに基づいて定まる動きベクトル予測値の周辺との、動きベクトルの候補の各々について、当該ブロックの画素と前記参照画像の画素との差分に基づいて動きベクトル評価値を算出し、所定の閾値以下の動きベクトル評価値の有無を判定する事前近傍探索ステップと、前記マクロブロックに対する一次動きベクトルを、前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値無しと判定した各ブロックの画素と前記参照画像の画素との差分に基づく、マクロブロック単位での動き探索によって検出する一次探索ステップと、前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値無しと判定したブロックの各々については、前記一次動きベクトルの周辺の動き探索を行って動きベクトルを検出し、前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値有りと判定したブロックの各々については、前記動きベクトル評価値が前記所定の閾値以下の前記動きベクトルの候補を当該ブロックの動きベクトルとする二次探索ステップと、を前記コンピュータに実行させるためのプログラムである。
[3] A program according to an aspect of the present invention causes a computer to output a motion vector indicating a position of an area corresponding to a block on a reference image for each block obtained by dividing a macroblock of an input moving image. a program, the macro block for each block obtained by dividing the periphery of the zero vector indicating the position of the block on the reference image, the motion vector prediction determined based on motion vectors of blocks adjacent to the block with the surrounding values, for each of the candidate motion vectors, and calculates a motion vector evaluation value based on a difference between pixels of the pixel and the reference picture of the block, whether the following motion vector evaluation value predetermined threshold A pre-neighbor search step for determining, and a primary motion vector for the macroblock, the pre-neighbor search step; Based on the difference between the pixel of the reference image and the pixel of each block is determined that the predetermined following motion vector evaluation value without the threshold at-flop, a first search step of detecting the motion search in the macro block unit, the pre For each of the blocks determined as having no motion vector evaluation value equal to or less than a predetermined threshold in the neighborhood search step, a motion vector is detected by performing a motion search around the primary motion vector, and in the prior neighborhood search step For each block determined to have a motion vector evaluation value less than or equal to a predetermined threshold, a secondary search step in which the motion vector candidate whose motion vector evaluation value is less than or equal to the predetermined threshold is the motion vector of the block; Is a program for causing the computer to execute.

この発明によれば、画像中のノイズ等の擾乱の影響を受けにくく、演算量が少なく、かつ、物体の境界に位置するマクロブロックでも動きベクトルを適切に検出できる。   According to the present invention, it is difficult to be affected by disturbances such as noise in an image, the amount of calculation is small, and a motion vector can be appropriately detected even in a macroblock located at the boundary of an object.

本発明の一実施形態における動きベクトル検出装置の概略構成を示す構成図である。It is a block diagram which shows schematic structure of the motion vector detection apparatus in one Embodiment of this invention. 同実施形態における一次探索器6の概略構成を示す構成図である。It is a block diagram which shows schematic structure of the primary searcher 6 in the embodiment. 同実施形態において近傍探索器8が事前近傍探索の対象とする位置および各ブロックの動きベクトルに対する評価の例を示す図である。It is a figure which shows the example of the evaluation with respect to the position and the motion vector of each block which the neighborhood searcher 8 makes the object of prior neighborhood search in the embodiment. 同実施形態において一次探索器6が行う、動きベクトルに対する評価の例を示す図である。It is a figure which shows the example of evaluation with respect to a motion vector which the primary searcher 6 performs in the embodiment. 同実施形態において一次探索器6がテレスコピック探索を行う例を示す図である。It is a figure which shows the example in which the primary searcher 6 performs a telescopic search in the same embodiment. 同実施形態において動きベクトル検出装置100が、符号化対象のマクロブロックC121に対する動きベクトルを検出する処理手順を示すフローチャートである。5 is a flowchart illustrating a processing procedure in which the motion vector detection apparatus 100 detects a motion vector for a macro block C121 to be encoded in the embodiment. MPEG−2やH.264/AVCの動き予測において参照する画像の例を示す図である。MPEG-2 and H.264 2 is a diagram illustrating an example of an image referred to in H.264 / AVC motion prediction. H.264/AVC符号化方式で、動き予測を行う単位となるブロックのサイズを示す図である。H. 2 is a diagram illustrating the size of a block serving as a unit for performing motion prediction in the H.264 / AVC encoding scheme. FIG. テレスコピック探索の例を示す図である。It is a figure which shows the example of a telescopic search. 動体と背景の境界に位置するマクロブロックの例を示す図である。It is a figure which shows the example of the macroblock located in the boundary of a moving body and a background.

以下、図面を参照して、本発明の一実施形態について説明する。
図1は、本発明の一実施形態における動きベクトル検出装置の概略構成を示す構成図である。
同図において、動きベクトル検出装置100は、画像メモリ1と、探索範囲切り出し器2と、画像縮小器3および12と、縮小画像キャッシュメモリ4と、画像キャッシュメモリ5と、一次探索器6と、探索中心指示器7と、近傍探索器(事前近傍探索器、二次探索器)8とを具備する。
画像縮小器12は、入力動画像をマクロブロック単位に分割した、符号化対象のマクロブロック画像C121の入力を受け、この符号化対象のマクロブロック画像C121を縦横共に2分の1の画素数に縮小し、縮小した画像C122を一次探索器6に出力する。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
FIG. 1 is a configuration diagram showing a schematic configuration of a motion vector detection device according to an embodiment of the present invention.
In the figure, a motion vector detecting device 100 includes an image memory 1, a search range segmenter 2, image reducers 3 and 12, a reduced image cache memory 4, an image cache memory 5, a primary searcher 6, A search center indicator 7 and a neighborhood searcher (pre-neighbor searcher, secondary searcher) 8 are provided.
The image reducer 12 receives an input of an encoding target macroblock image C121 obtained by dividing an input moving image in units of macroblocks, and the encoding target macroblock image C121 is reduced to half the number of pixels both vertically and horizontally. The reduced image C122 is output to the primary searcher 6.

画像メモリ1は、ローカル復号画像C11の入力を受け、このローカル復号画像C11を蓄積する。画像メモリ1が記憶するローカル復号画像は、動き探索のために使用する参照画像を切り出す元の画像となる。なお、ここでいう「ローカル復号画像」とは、動きベクトル検出装置100を含む動画像符号化装置が、入力画像を符号化し、さらに復号した画像である。ローカル復号画像は、動画像復号装置も生成する画像であり、このローカル復号画像を用いて動き探索を行うことにより、符号化および復号による画像誤差を抑制することができる。なお、画像メモリ1が、ローカル復号画像に代えて入力画像を蓄積するようにしてもよい。入力画像を用いて動き探索を行うと、ローカル復号画像の生成や転送を待つことなく動き探索を行うことができるため、動画像符号化装置の構成の自由度が増す。   The image memory 1 receives the input of the local decoded image C11 and accumulates the local decoded image C11. The local decoded image stored in the image memory 1 is an original image from which a reference image used for motion search is cut out. Here, the “local decoded image” is an image obtained by encoding and further decoding an input image by a moving image encoding apparatus including the motion vector detection apparatus 100. The local decoded image is an image generated also by the video decoding device, and by performing motion search using the local decoded image, image errors due to encoding and decoding can be suppressed. Note that the image memory 1 may store the input image instead of the local decoded image. When the motion search is performed using the input image, the motion search can be performed without waiting for the generation and transfer of the local decoded image, so that the degree of freedom of the configuration of the moving image coding apparatus is increased.

探索範囲切り出し器2は、画像メモリ1が蓄積する画像C12を読み出し、一次探索器6と近傍探索器8とが動き探索の対象とする範囲として符号化対象のマクロブロックを中心に設定される範囲の画像を切り出して、画像縮小器3と画像キャッシュメモリ5とに出力する。例えば、符号化対象のマクロブロックが画像C12の左上に位置する場合、一次探索器6と近傍探索器8とが動き探索の対象とする範囲は、この符号化対象のマクロブロックを中心として画像C12の左上に設定され、探索範囲切り出し器2は、この範囲の画像を切り出して、画像縮小器3と画像キャッシュメモリ5とに出力する。
画像縮小器3は、探索範囲切り出し器2から出力される画像C21を、縦横共に2分の1の画素数に縮小して縮小画像C31を生成し、縮小画像キャッシュメモリ4に出力する。縮小画像キャッシュメモリ4は、一次探索器6が行う一次探索用の参照画像として、画像縮小器3が出力する縮小画像C31を記憶する。一方、画像キャッシュメモリ5は、近傍探索器8が行う二次探索用の参照画像として、探索範囲切り出し器2から出力される画像C21を記憶する。
探索中心指示器7は、ゼロベクトルおよび動きベクトル予測値C71を、近傍探索器8に出力する。前述したように、ゼロベクトルは、参照画像上での符号化対象のブロックの位置を示す。また、動きベクトル予測値は、周辺のブロックの動きを代表したベクトル値であり、符号化標準で規定される方法に基づいて計算される。なお、符号化対象のブロックの左に位置するマクロブロックの符号化モードが確定していない場合など、正確な動きベクトル予測値を得ることができない場合には、探索中心指示器7が、仮の動きベクトル予測値を生成して近傍探索器8に出力するようにしてもよい。ここでいう「仮の動きベクトル予測値」とは、動きベクトル予測値に近い値を示すと期待される推測値である。仮の動きベクトル予測値は、例えば、符号化対象のマクロブロックの上または右上または左上または左に隣接する各マクロブロックに対する一次探索器6の動き探索が終了している場合に、この一次探索器6の動き探索の結果得られた各動きベクトルC61を用いて、自マクロブロックおよび上・右上・左上・左マクロブロックがすべて横16画素×縦16画素のブロックサイズであると仮定し、符号化標準で定められた手順に基づいて算出する。なお、以下では一次探索器6が行う動き探索を「一次探索」ともいい、一次探索の結果得られる動きベクトルを「一次動きベクトル」ともいう。一次動きベクトルは、符号化対象のマクロブロックに対して2画素単位の精度で得られる動きベクトルであり、近傍探索器8が行う動き探索(二次探索)の中心を示す。
The search range extractor 2 reads the image C12 stored in the image memory 1, and a range set around the encoding target macroblock as a range for which the primary searcher 6 and the neighborhood searcher 8 are subject to motion search. Are cut out and output to the image reducer 3 and the image cache memory 5. For example, when the encoding target macroblock is located at the upper left of the image C12, the range that the primary searcher 6 and the neighborhood searcher 8 are subject to motion search is centered on the encoding target macroblock. The search range clipper 2 cuts out an image in this range and outputs it to the image reducer 3 and the image cache memory 5.
The image reducer 3 reduces the image C21 output from the search range extractor 2 to half the number of pixels both vertically and horizontally, generates a reduced image C31, and outputs the reduced image C31 to the reduced image cache memory 4. The reduced image cache memory 4 stores a reduced image C31 output from the image reducer 3 as a reference image for primary search performed by the primary searcher 6. On the other hand, the image cache memory 5 stores an image C21 output from the search range extractor 2 as a reference image for secondary search performed by the neighborhood searcher 8.
The search center indicator 7 outputs the zero vector and the motion vector prediction value C71 to the neighborhood searcher 8. As described above, the zero vector indicates the position of the block to be encoded on the reference image. The motion vector prediction value is a vector value representing the motion of the surrounding blocks, and is calculated based on a method defined by the coding standard. Note that if an accurate motion vector prediction value cannot be obtained, such as when the encoding mode of a macroblock located to the left of the block to be encoded is not fixed, the search center indicator 7 A motion vector prediction value may be generated and output to the neighborhood searcher 8. The “provisional motion vector predicted value” here is an estimated value expected to indicate a value close to the motion vector predicted value. The tentative motion vector prediction value is obtained when, for example, the motion search of the primary searcher 6 for each macroblock adjacent to the upper, upper right, upper left, or left of the macroblock to be encoded has been completed. Using the respective motion vectors C61 obtained as a result of the motion search of 6, encoding is performed assuming that the own macroblock and the upper, upper right, upper left, and left macroblocks all have a block size of horizontal 16 pixels × vertical 16 pixels. Calculate based on the standard procedure. Hereinafter, the motion search performed by the primary searcher 6 is also referred to as “primary search”, and the motion vector obtained as a result of the primary search is also referred to as “primary motion vector”. The primary motion vector is a motion vector obtained with an accuracy of two pixels for the macroblock to be encoded, and indicates the center of the motion search (secondary search) performed by the neighborhood searcher 8.

近傍探索器8は、符号化対象のマクロブロックC121を横8×縦8画素ブロックに分割し、分割したブロック毎に、探索中心指示器7から出力されるゼロベクトルおよび動きベクトル予測値C71に基づいて、参照画像C51上でのゼロベクトル周辺や動きベクトル予測値周辺の各位置を候補として動き探索を行う。以下では、近傍探索器8が、ゼロベクトル周辺や動きベクトル予測値周辺の各位置を候補として行う動き探索を「事前近傍探索」ともいう。近傍探索器8は、事前近傍探索の結果、動きベクトルを検出できなかったブロックを示す情報C82を、一次探索器6に出力する。
また、近傍探索器8は、事前近傍探索で動きベクトルを検出できなかった各ブロックについて、一次探索器6が出力する一次動きベクトルC61に基づいて(具体的には、一次動きベクトルC61が示す参照画像C51上の位置を中心とする探索範囲を設定して)、参照画像C51上での動き探索を行う。以下では、近傍探索器8が、一次動きベクトルC61に基づいて行う動き探索を「二次探索」ともいう。
近傍探索器8は、事前近傍探索および二次探索で検出した動きベクトルC201を、動きベクトル検出装置100の外部(例えば、この動きベクトル検出装置100を含む動画像符号化装置の予測画像生成手段)に出力する。
The neighborhood searcher 8 divides the encoding target macroblock C121 into horizontal 8 × vertical 8 pixel blocks, and based on the zero vector and the motion vector prediction value C71 output from the search center indicator 7 for each of the divided blocks. Thus, the motion search is performed using the positions around the zero vector and the motion vector prediction value on the reference image C51 as candidates. Hereinafter, the motion search performed by the neighborhood searcher 8 using each position around the zero vector and the motion vector prediction value as a candidate is also referred to as “pre-neighbor search”. The neighborhood searcher 8 outputs information C82 indicating a block in which a motion vector cannot be detected as a result of the prior neighborhood search to the primary searcher 6.
Further, the neighborhood searcher 8 uses the primary motion vector C61 output from the primary searcher 6 (specifically, the reference indicated by the primary motion vector C61) for each block for which the motion vector could not be detected by the prior neighborhood search. A search range centered on a position on the image C51 is set), and a motion search on the reference image C51 is performed. Hereinafter, the motion search performed by the neighborhood searcher 8 based on the primary motion vector C61 is also referred to as “secondary search”.
The neighborhood searcher 8 uses the motion vector C201 detected by the prior neighborhood search and the secondary search to the outside of the motion vector detection device 100 (for example, a predicted image generation unit of a video encoding device including the motion vector detection device 100). Output to.

一次探索器6は、画像縮小器12が出力する符号化対象マクロブロックの縮小画像C122を用いて、縮小参照画像C41上での一次探索をマクロブロック単位で行い、一次動きベクトルC61を生成して近傍探索器8に出力する。一次探索を行う際、一次探索器6は、近傍探索器8が、事前近傍探索で動きベクトルを検出できなかったブロックの画素と縮小参照画像C41の画素との差分の絶対値の和を用いて動きベクトルの評価を行い、この評価結果に基づいて、一次動きベクトルC61を検出する。   The primary searcher 6 performs a primary search on the reduced reference image C41 in units of macroblocks using the reduced image C122 of the encoding target macroblock output from the image reducer 12, and generates a primary motion vector C61. Output to the neighborhood searcher 8. When performing the primary search, the primary searcher 6 uses the sum of the absolute values of the differences between the pixels of the block in which the neighborhood searcher 8 could not detect the motion vector in the prior neighborhood search and the pixels of the reduced reference image C41. The motion vector is evaluated, and the primary motion vector C61 is detected based on the evaluation result.

図2は、一次探索器6の概略構成を示す構成図である。
同図において、一次探索器6は、差分絶対値和算出器611と差分絶対値和加算制御器621と差分絶対値和加算器631と評価器641とを具備する。
差分絶対値和算出器611は、画像縮小器12が出力する、符号化対象マクロブロックの横8×縦8画素の縮小画像C122を横4×縦4画素ブロックに4分割する。そして、差分絶対値和算出器611は、分割したブロック毎に、当該ブロックと、縮小参照画像C41上で当該ブロックに対応する領域との、画素毎の差分の絶対値の和(以下では「差分絶対値和」ともいう)を算出し、算出した差分絶対値和を差分絶対値和加算制御器621に出力する。
FIG. 2 is a configuration diagram showing a schematic configuration of the primary searcher 6.
In the figure, the primary searcher 6 includes a difference absolute value sum calculator 611, a difference absolute value sum addition controller 621, a difference absolute value sum adder 631, and an evaluator 641.
The difference absolute value sum calculator 611 divides the reduced image C122 of 8 × 8 pixels of the encoding target macroblock output from the image reducer 12 into 4 × 4 pixel blocks. Then, the difference absolute value sum calculator 611 calculates, for each divided block, the sum of absolute values of differences for each pixel between the block and the area corresponding to the block on the reduced reference image C41 (hereinafter referred to as “difference”). (Also referred to as “absolute value sum”), and the calculated difference absolute value sum is output to the difference absolute value sum addition controller 621.

差分絶対値和加算制御器621は、差分絶対値和算出器611から出力されるブロック毎の差分絶対値和のうち、近傍探索器8が事前近傍探索において動きベクトルを検出できなかったブロックの差分絶対値和を差分絶対値和加算器631に出力する。差分絶対値和加算器631は、差分絶対値和加算制御器621から出力される差分絶対値和の和を算出し、評価器641に出力する。評価器641は、差分絶対値和加算器631から出力される差分絶対値和の和に基づいて一次動きベクトルの候補の各々を評価し、一次動きベクトルを選択する。ここで、一次動きベクトルの候補は、例えば、縮小参照画像C41上での符号化対象のマクロブロックの位置を中心として予め定められた範囲内に含まれる、横8×縦8画素の各領域を示す動きベクトル(符号化対象のマクロブロックの位置からの相対座標)である。   The difference absolute value sum addition controller 621 is a difference between blocks in which the neighborhood searcher 8 cannot detect a motion vector in the prior neighborhood search among the absolute difference sums for each block output from the difference absolute value sum calculator 611. The absolute value sum is output to the difference absolute value sum adder 631. The difference absolute value sum adder 631 calculates the sum of the difference absolute value sums output from the difference absolute value sum addition controller 621 and outputs the sum to the evaluator 641. The evaluator 641 evaluates each of the primary motion vector candidates based on the sum of the absolute difference sums output from the absolute difference sum adder 631, and selects a primary motion vector. Here, the primary motion vector candidates are, for example, each area of 8 × 8 pixels included in a predetermined range centered on the position of the macroblock to be encoded on the reduced reference image C41. The motion vector shown (relative coordinates from the position of the macroblock to be encoded).

図3は、近傍探索器8が事前近傍探索の対象とする位置および各ブロックの動きベクトルに対する評価の例を示す図である。
探索中心指示器7から、マクロブロックの左上端の相対座標にてゼロベクトルが出力され示されると、近傍探索器8は、このゼロベクトル周辺の動き探索を行う。具体的には、近傍探索器8は、ゼロベクトルおよび縦横にそれぞれ予め定められた画素のずれ量以内でずれた位置を候補として動き探索を行う。例えば、同図の例では、ゼロベクトルおよび縦横にそれぞれ1画素ずれた、合計9点を候補として動き探索を行う。なお、近傍探索器8が探索を行う候補は同図に示す9点に限らない。例えば、中心から2画素ずれた点、あるいは、0.5画素や0.25画素など、整数値以外の画像だけずれた点も探索するなど、より多くの点を動き探索の候補とするようにしてもよい。これにより、0.5画素精度あるいは0.25画素精度の動きベクトルが得られるなど、より精度の高い動き探索を行うことができる。動きベクトル予測値についても同様である。
FIG. 3 is a diagram showing an example of the evaluation of the position and the motion vector of each block that are used by the neighborhood searcher 8 as a target for the advance neighborhood search.
When a zero vector is output and indicated by the relative coordinates at the upper left corner of the macroblock from the search center indicator 7, the neighborhood searcher 8 performs a motion search around this zero vector. Specifically, the neighborhood searcher 8 performs a motion search by using a position shifted within a predetermined amount of shift of the pixel in the vertical direction and the horizontal direction as candidates. For example, in the example shown in the figure, the motion search is performed using a total of nine points, which are shifted by one pixel in the vertical direction and the horizontal direction, respectively. Note that the candidates for the search by the neighborhood searcher 8 are not limited to the nine points shown in FIG. For example, more points are selected as candidates for motion search, such as searching for a point shifted by 2 pixels from the center or a point shifted by an image other than an integer value such as 0.5 pixel or 0.25 pixel. May be. Thereby, a motion search with higher accuracy can be performed, for example, a motion vector with 0.5 pixel accuracy or 0.25 pixel accuracy can be obtained. The same applies to the motion vector prediction value.

近傍探索器8は、候補の点が示す横16×縦16画素のマクロブロック領域を、横8×縦8画素の4つのブロックB21〜B24に分割し、ブロック毎に動きベクトル評価値を算出する。ここでいう、「動きベクトル評価値」とは、ブロック内の各画素と対応する参照画像の各画素との差分の絶対値の和に、動きベクトルや符号化モードを記述するために必要なビット量(符号化コスト)に相当する値を加えた値である。動きベクトル評価値は、当該動きベクトルを用いて動き予測を行った場合の符号量や画像誤差を示す指標であり、動きベクトル評価値が小さい動きベクトルほど、符号化対象のマクロブロックに対する動き予測に用いるのに適している。
近傍探索器8は、十分正確な動きベクトルが得られているかどうかを判定するために、式(1)を満たす動きベクトルが存在するか否かを判定する。
The neighborhood searcher 8 divides the 16 × 16 macroblock region indicated by the candidate point into four blocks B21 to B24 of 8 × 8 pixels, and calculates a motion vector evaluation value for each block. . Here, the “motion vector evaluation value” is a bit necessary to describe the motion vector and the coding mode in the sum of absolute values of differences between each pixel in the block and each pixel of the corresponding reference image. It is a value obtained by adding a value corresponding to the amount (encoding cost). The motion vector evaluation value is an index indicating a code amount or an image error when motion prediction is performed using the motion vector, and a motion vector having a smaller motion vector evaluation value is used for motion prediction for a macroblock to be encoded. Suitable for use.
In order to determine whether or not a sufficiently accurate motion vector is obtained, the neighborhood searcher 8 determines whether or not there is a motion vector that satisfies Equation (1).

Figure 0005286573
Figure 0005286573

ここで、αは、評価値の閾値を示す。このαは、例えば予め定められた定数である。あるいは、αは、直前の画像(フレーム)の解析結果に応じて定められる値であってもよい。例えば、直前の画像(フレーム)において、ゼロベクトル近傍または動きベクトル評価値近傍の位置を動きベクトルとするブロックが多い場合、静止する画像のブロックや、周辺のブロックと同様の動きをする画像のブロックが多いと考えられる。そして、この画像(フレーム)に時間的に隣接する、符号化対象の画像(フレーム)においても、静止する画像のブロックや、周辺のブロックと同様の動きをする画像のブロックが多いことが予測される。そこで、αの値を大きくして、動きベクトルとしてゼロベクトル近傍または動きベクトル評価値近傍の位置を選択し易くすることにより、近傍探索器8が、より適切な動きベクトルを検出することが期待できる。逆に、直前の画像(フレーム)において、ゼロベクトル近傍または動きベクトル評価値近傍の位置を動きベクトルとするブロックが少ない場合には、αの値を小さくして、直前の画像(フレーム)と同様に、動きベクトルとしてゼロベクトル近傍または動きベクトル評価値近傍の位置を選択し難くする。   Here, α represents a threshold value of the evaluation value. This α is a predetermined constant, for example. Alternatively, α may be a value determined according to the analysis result of the immediately preceding image (frame). For example, in the previous image (frame), if there are many blocks whose motion vectors are in the vicinity of the zero vector or near the motion vector evaluation value, the still image block or the image block that moves in the same manner as the surrounding blocks It is thought that there are many. Also, in the image (frame) to be encoded that is temporally adjacent to this image (frame), it is predicted that there are many blocks of still images and images that move in the same manner as the surrounding blocks. The Therefore, by increasing the value of α so that the position near the zero vector or the vicinity of the motion vector evaluation value can be easily selected as the motion vector, it can be expected that the neighborhood searcher 8 detects a more appropriate motion vector. . Conversely, in the previous image (frame), if there are few blocks whose motion vector is in the vicinity of the zero vector or near the motion vector evaluation value, the value of α is decreased to be the same as the previous image (frame). Further, it is difficult to select a position near the zero vector or the position near the motion vector evaluation value as the motion vector.

あるいは、αは、符号化対象の画像(フレーム)の事前解析結果に応じて定められる値であってもよい。例えば、縦横共に8分の1画素など、小さい画素数に縮小した画像(フレーム)を用いて符号化対象の画像(フレーム)から時間的に直前の画像(フレーム)との画素毎の類似度(例えば、画素値の差分絶対値和)を算出し、類似度が高い場合にはαの値を大きくして、近傍探索器8が、動きベクトルとしてゼロベクトル近傍または動きベクトル評価値近傍の位置を選択し易くする。逆に類似度が小さい低い場合にはαの値を小さくする。   Alternatively, α may be a value that is determined according to a pre-analysis result of the encoding target image (frame). For example, the degree of similarity for each pixel from the image (frame) to be encoded using the image (frame) reduced to a small number of pixels, such as 1/8 pixel both vertically and horizontally, from the temporally immediately preceding image (frame) ( For example, if the similarity is high, the value of α is increased, and the neighborhood searcher 8 determines the position near the zero vector or the motion vector evaluation value as a motion vector. Make it easy to select. Conversely, if the similarity is low and low, the value of α is decreased.

あるいは、符号化対象マクロブロックの分散値ないしアクティビティに基づいてαの値を変更するようにしてもよい。ここでいう符号化対象マクロブロックの「アクティビティ」は、マクロブロック内の画素値のばらつきを示す値の1つである。アクティビティは、マクロブロックを横8×縦8画素の4つのブロックに分割し、ブロック毎に分散値を算出し、算出した分散値のうち最小のものに1を加えることにより得られる。
一般的に、分散値ないしアクティビティが小さいマクロブロックでは動きベクトルのずれによる動きベクトル評価値の差が小さく、逆に分散値ないしアクティビティの大きなマクロブロックでは、動きベクトルのずれによる動きベクトル評価値の差が大きくなる。したがって、αの値を分散値ないしアクティビティの値に応じて、例えば、分散値ないしアクティビティの値に比例した値に設定したり、あるいは、分散値ないしアクティビティが、ある閾値Sを超える場合と超えない場合とでそれぞれ異なるαを設定したりすることにより、判定を行う際にマクロブロックの性質の影響を受けにくくすることができる。なお、上記閾値Sは1つに限らず、複数の閾値Skとそれぞれに対応する複数のαkを設定することにより、符号化対象マクロブロックの分散値ないしアクティビティに応じて、αkの中から上記αを選択するようにしてもよい。
Alternatively, the value of α may be changed based on the variance value or activity of the encoding target macroblock. The “activity” of the encoding target macroblock here is one of the values indicating variations in pixel values in the macroblock. The activity is obtained by dividing the macroblock into four blocks of 8 × 8 pixels, calculating a variance value for each block, and adding 1 to the smallest of the calculated variance values.
In general, a macro block with a small variance value or activity has a small difference in motion vector evaluation value due to a motion vector shift, and conversely, a macro block with a large variance value or activity has a difference in motion vector evaluation value due to a motion vector shift. Becomes larger. Accordingly, the value of α is set to a value proportional to the value of the variance or activity, for example, or the variance or activity exceeds or exceeds a certain threshold value S according to the variance or activity value. By setting a different α depending on the case, it is possible to make it less susceptible to the influence of the properties of the macroblock when performing the determination. Note that the threshold S is not limited to one, and by setting a plurality of αk corresponding to each of the plurality of thresholds Sk, the α can be selected from αk according to the variance value or activity of the encoding target macroblock. May be selected.

近傍探索器8は、事前近傍探索において、式(1)を満たす動きベクトルが存在するブロックについては、動きベクトルの評価値が最小の動きベクトルを、当該ブロックの動きベクトルとして選択する。一方、式(1)を満たす動きベクトルが存在しないブロックについては、当該ブロックの動きベクトルを検出できなかったと判定する。
例えば、図3の上側の横8×縦8画素ブロックB21およびB22が静止する背景画像の領域である場合など、ゼロベクトルを動きベクトルとすると動きベクトル評価値が最小となり、かつ、式(1)を満たす場合は、近傍探索器8は、ブロックB21およびB22の各々について、式(1)を満たす動きベクトルが存在することを判定し、ブロックB21およびB22の各々の動きベクトルとして、動きベクトル評価値が最小となるゼロベクトルを検出する。
In the prior neighborhood search, the neighborhood searcher 8 selects a motion vector having the smallest motion vector evaluation value as a motion vector of the block for a block having a motion vector satisfying the expression (1). On the other hand, for a block that does not have a motion vector that satisfies Equation (1), it is determined that the motion vector of the block has not been detected.
For example, when the upper horizontal 8 × vertical 8 pixel blocks B21 and B22 in FIG. 3 are still background image regions, the motion vector evaluation value is minimized when the zero vector is a motion vector, and the expression (1) When satisfying, the neighborhood searcher 8 determines that there is a motion vector satisfying the expression (1) for each of the blocks B21 and B22, and uses the motion vector evaluation value as the motion vector of each of the blocks B21 and B22. The zero vector that minimizes is detected.

一方、図3の下側の横8×縦8画素ブロックB23およびB24が動体の画像の領域である場合など、事前近傍探索では式(1)を満たす動きベクトルが検出されない場合は、近傍探索器8は、ブロックB23およびB24の各々について、式(1)を満たす動きベクトルが存在しないことを判定することにより、当該ブロックの動きベクトルを検出できなかったと判定する。
近傍探索器8は、動きベクトルを検出できなかったと判定したブロックを示す情報を一次探索器6に出力する。図3の例では、近傍探索器8は、ブロックB23およびB24を示す情報を一次探索器6に出力する。
On the other hand, in the case where the motion vector satisfying the expression (1) is not detected in the prior neighborhood search, such as when the lower 8 × 8 pixel blocks B23 and B24 on the lower side of FIG. 8 determines that the motion vector of the block cannot be detected by determining that there is no motion vector satisfying the expression (1) for each of the blocks B23 and B24.
The neighborhood searcher 8 outputs information indicating a block determined to have failed to detect a motion vector to the primary searcher 6. In the example of FIG. 3, the neighborhood searcher 8 outputs information indicating the blocks B <b> 23 and B <b> 24 to the primary searcher 6.

図4は、一次探索器6が行う、動きベクトルに対する評価の例を示す図である。
同図のブロックB41およびB42は、例えば、静止する背景画像の領域であり、近傍探索器8が事前近傍探索において動きベクトルを検出したブロックである。一方、ブロックB43およびB44は、例えば、動体の画像の領域であり、近傍探索器8が事前近傍探索において動きベクトルを検出できなかったと判定したブロックである。
一次探索器6は、動き探索を行う際に、事前近傍探索で近傍探索器8が動きベクトルを検出できなかったと判定したブロックの画素を用いて、動き探索結果を評価する。図4の例では、差分絶対値和算出器611が、ブロックB41〜B44の各々について、符号化対象のマクロブロックの縮小画像C122上の画素と縮小参照画像C41上の画素との差分絶対値和C341〜C344を算出し、差分絶対値和加算制御器621に出力する。差分絶対値和加算制御器621は、差分絶対値和算出器611が出力する差分絶対値和C341〜C344のうち、事前近傍探索で近傍探索器8が動きベクトルを検出できなかったと判定したブロックB43およびB44の差分絶対値和C343およびC344のみを差分絶対値和加算器631に出力する。
FIG. 4 is a diagram illustrating an example of evaluation for a motion vector performed by the primary searcher 6.
Blocks B41 and B42 in the figure are, for example, areas of a stationary background image, and are blocks in which the neighborhood searcher 8 has detected a motion vector in the prior neighborhood search. On the other hand, the blocks B43 and B44 are, for example, moving image regions, and are the blocks that the neighborhood searcher 8 has determined that a motion vector could not be detected in the prior neighborhood search.
When performing a motion search, the primary searcher 6 evaluates a motion search result using a pixel of a block that is determined to have not been detected by the neighborhood searcher 8 in the prior neighborhood search. In the example of FIG. 4, the difference absolute value sum calculator 611 calculates, for each of the blocks B41 to B44, the difference absolute value sum between the pixel on the reduced image C122 of the encoding target macroblock and the pixel on the reduced reference image C41. C341 to C344 are calculated and output to the difference absolute value sum addition controller 621. The difference absolute value sum addition controller 621 determines that the neighborhood searcher 8 cannot detect the motion vector in the prior neighborhood search among the difference absolute value sums C341 to C344 output from the difference absolute value sum calculator 611. And only the difference absolute value sum C343 and C344 of B44 are output to the difference absolute value sum adder 631.

一方、事前近傍探索で近傍探索器8が動きベクトルを検出したブロックB41およびB42の差分絶対値和C341およびC342については、差分絶対値和加算制御器621は何もしない(捨てる)。差分絶対値和加算器631は、差分絶対値和加算制御器621から出力される差分絶対値和C343とC344との和を算出して評価器641に出力する。評価器641は、差分絶対値和加算器631から出力される差分絶対値和の和に基づいて動きベクトルの評価を行う。   On the other hand, the difference absolute value sum addition controller 621 does nothing (discards) for the difference absolute value sums C341 and C342 of the blocks B41 and B42 in which the neighborhood searcher 8 has detected the motion vector in the prior neighborhood search. The difference absolute value sum adder 631 calculates the sum of the difference absolute value sums C343 and C344 output from the difference absolute value sum addition controller 621 and outputs the sum to the evaluator 641. The evaluator 641 evaluates the motion vector based on the sum of the absolute difference sums output from the absolute difference sum adder 631.

このように、一次探索器6は、事前近傍探索で近傍探索器8が動きベクトルを検出したブロックの画素を動きベクトルの評価対象から除外して動きベクトルを評価するので、近傍探索器8が、ゼロベクトルの近傍の動き探索で動きベクトルを検出する静止した背景画像のブロックや、近傍探索器8が、動きベクトル評価値の近傍の動き探索で動きベクトルを検出する移動(パン)する背景画像のブロックの影響を受けずに、動体の画像のブロックのみに基づいて動きベクトルを評価できる。これにより、符号化対象のマクロブロックが動体と背景の境界に位置する場合など、動体の境界を含む場合でも、動体を追跡することができる。   In this way, the primary searcher 6 evaluates the motion vector by excluding the pixel of the block from which the neighborhood searcher 8 detected the motion vector in the prior neighborhood search from the motion vector evaluation target. A block of a stationary background image that detects a motion vector by a motion search near the zero vector, or a background image that the neighborhood searcher 8 detects (moves) a motion vector by a motion search near the motion vector evaluation value. The motion vector can be evaluated based on only the block of the moving image without being influenced by the block. Thereby, even when the encoding target macroblock is located at the boundary between the moving object and the background, the moving object can be tracked.

図5は、一次探索器6がテレスコピック探索を行う例を示す図である。同図において、符号化対象画像P51と参照画像P54とは、非参照画像P52およびP53を挟み、時間方向に3画像ぶん離れている。
テレスコピック探索を行う場合、一次探索器6は、隣接する画像で行う各回の動き探索において、図4で説明したように、近傍探索器8が事前近傍探索において動きベクトルを検出できなかったと判定したブロックの画素のみを用いて動きベクトルを評価する。
まず、一次探索器6は、符号化対象画像P51に隣接する非参照画像P52に、符号化対象ブロックB51の座標に応じた探索範囲を設定し、動き探索を行う。この際、一次探索器6は、事前近傍探索で近傍探索器8が動きベクトルを検出できなかったと判定したブロックの画素のみを用いて動きベクトルを評価する。図5の例では、マクロブロックを4分割したブロックのうち、上側2つのブロックは、事前近傍探索で近傍探索器8が動きベクトルを検出したブロックであり、一次探索器6は、これらの画素を動きベクトルの評価に用いない。一方、下側2つのブロックは、事前近傍探索で近傍探索器8が動きベクトルを検出できなかったと判定したブロックであり、一次探索器6は、これらの画素を用いて動きベクトルを評価する。
FIG. 5 is a diagram illustrating an example in which the primary searcher 6 performs a telescopic search. In the figure, the encoding target image P51 and the reference image P54 are separated by three images in the time direction with the non-reference images P52 and P53 interposed therebetween.
When performing a telescopic search, the primary searcher 6 determines that, in each motion search performed on adjacent images, the neighborhood searcher 8 cannot detect a motion vector in the prior neighborhood search, as described with reference to FIG. The motion vector is evaluated using only the pixels.
First, the primary searcher 6 sets a search range corresponding to the coordinates of the encoding target block B51 in the non-reference image P52 adjacent to the encoding target image P51, and performs a motion search. At this time, the primary searcher 6 evaluates the motion vector using only the pixels of the block that the neighborhood searcher 8 has determined not to detect the motion vector in the prior neighborhood search. In the example of FIG. 5, among the blocks obtained by dividing the macroblock into four, the upper two blocks are blocks in which the neighborhood searcher 8 has detected a motion vector in the prior neighborhood search, and the primary searcher 6 uses these pixels. Not used for motion vector evaluation. On the other hand, the lower two blocks are blocks that the neighbor searcher 8 has determined to be unable to detect the motion vector in the prior neighbor search, and the primary searcher 6 evaluates the motion vector using these pixels.

次に、一次探索器6は、非参照画像P52に隣接する非参照画像P53に、非参照画像P52での探索結果R52が示す座標を中心とした探索範囲を設定し、動き探索を行う。ここでも、一次探索器6は、下側2つのブロックの画素を用いて動きベクトルを評価する。
さらに、一次探索器6は、非参照画像P53に隣接する参照画像P54に、非参照画像P53での探索結果R53が示す座標を中心とした探索範囲を設定し、動き探索を行う。ここでも、一次探索器6は、下側2つのブロックの画素を用いて動きベクトルを評価する。そして、一次探索器6は、この動き探索によって得られる探索結果R54を、最終的な動き探索結果(一次動きベクトル)とする。
このように、一次探索器6は、動きベクトルを評価する際に、事前近傍探索で近傍探索器8が動きベクトルを検出したブロックの画素を除外して評価を行うことにより、例えば、符号化対象のマクロブロックが動体の画像と背景の画像とを含む場合に、背景の画像に影響されずに動体の動きを追うことができる。
Next, the primary searcher 6 sets a search range centered on the coordinates indicated by the search result R52 in the non-reference image P52 in the non-reference image P53 adjacent to the non-reference image P52, and performs a motion search. Again, the primary searcher 6 evaluates the motion vector using the pixels of the lower two blocks.
Further, the primary searcher 6 sets a search range centered on the coordinates indicated by the search result R53 in the non-reference image P53 to the reference image P54 adjacent to the non-reference image P53, and performs a motion search. Again, the primary searcher 6 evaluates the motion vector using the pixels of the lower two blocks. The primary searcher 6 sets the search result R54 obtained by this motion search as the final motion search result (primary motion vector).
As described above, when the primary searcher 6 evaluates the motion vector, the primary searcher 6 performs evaluation by excluding the pixel of the block in which the neighborhood searcher 8 has detected the motion vector in the prior neighborhood search. When the macroblock includes a moving object image and a background image, the movement of the moving object can be tracked without being influenced by the background image.

図6は、動きベクトル検出装置100が、符号化対象のマクロブロックC121に対する動きベクトルを検出する処理手順を示すフローチャートである。
ステップS11において、探索中心指示器7は、近傍探索器8にゼロベクトルを出力し、近傍探索器8は、符号化対処のマクロブロックC121を横8×縦8画素の4つのブロックに分割し、ブロック毎に、画像キャッシュメモリ5から読み出す参照画像C51のゼロベクトルの周辺を動き探索する。
ステップS12において、探索中心指示器7は、近傍探索器8に動きベクトル予測値を出力し、近傍探索器8は、符号化対処のマクロブロックC121を分割したブロック毎に、参照画像C51の動きベクトル予測値の周辺を動き探索する。近傍探索器8は、ステップS11およびステップS12で動きベクトルを検出できなかったブロックを示す情報C82を一次探索器6に出力する。
FIG. 6 is a flowchart illustrating a processing procedure in which the motion vector detection apparatus 100 detects a motion vector for the encoding target macroblock C121.
In step S11, the search center indicator 7 outputs a zero vector to the neighborhood searcher 8, and the neighborhood searcher 8 divides the macro block C121 for encoding into 4 blocks of 8 × 8 pixels, For each block, a motion search is performed around the zero vector of the reference image C51 read from the image cache memory 5.
In step S12, the search center indicator 7 outputs the motion vector prediction value to the neighborhood searcher 8, and the neighborhood searcher 8 performs the motion vector of the reference image C51 for each block obtained by dividing the macro block C121 to be encoded. A motion search is performed around the predicted value. The neighborhood searcher 8 outputs to the primary searcher 6 information C82 indicating a block for which a motion vector could not be detected in steps S11 and S12.

ステップS13において、画像縮小器12は、符号化対象のマクロブロックC121を縦横共に2分の1の画素数に縮小した画像C122を生成して、一次探索器6に出力し、一次探索器6は、縮小画像C122を用いて、縮小画像キャッシュメモリ4から読み出す縮小参照画像C41上での動き探索をマクロブロック単位で行い、一次動きベクトルC61を生成して近傍探索器8に出力する。その際、一次探索器6は、近傍探索器8がステップS11およびステップS12で動きベクトルを検出できなかったブロックの画素を用いて動きベクトルの評価を行い、この評価結果に基づいて、一次動きベクトルC61を検出する。
ステップS14において、近傍探索器8は、ステップS11およびステップS12で動きベクトルを検出できなかった各ブロックについて、一次探索器6が出力する一次動きベクトルC61周辺の動き探索を行う。具体的には、近傍探索器8は、参照画像C51上に、一次動きベクトルに応じた探索範囲を設定して(すなわち、一次動きベクトルおよび予め定められた画素のずれ量以内でずれた位置を候補として)動き探索を行う。近傍探索器8は、ステップS11またはステップS12またはステップS14で検出した動きベクトルC201を、動きベクトル検出装置100の外部に出力する。具体的には、ステップS11またはステップS12で動きベクトルを検出できたブロックについては、その動きベクトルを出力する。一方、ステップS11またはステップS12で動きベクトルを検出できなかったブロックについては、ステップS14で検出した動きベクトルを出力する。その後、符号化対象のマクロブロックC121に対する動きベクトルを検出する処理を終了する。
In step S13, the image reducer 12 generates an image C122 in which the encoding target macroblock C121 is reduced to half the number of pixels both vertically and horizontally, and outputs the image C122 to the primary searcher 6. The primary searcher 6 Using the reduced image C122, a motion search on the reduced reference image C41 read from the reduced image cache memory 4 is performed in units of macroblocks, and a primary motion vector C61 is generated and output to the neighborhood searcher 8. At that time, the primary searcher 6 evaluates the motion vector using the pixels of the block in which the neighborhood searcher 8 could not detect the motion vector in steps S11 and S12, and based on the evaluation result, the primary motion vector C61 is detected.
In step S14, the neighborhood searcher 8 performs a motion search around the primary motion vector C61 output by the primary searcher 6 for each block for which a motion vector could not be detected in steps S11 and S12. Specifically, the neighborhood searcher 8 sets a search range corresponding to the primary motion vector on the reference image C51 (that is, a position shifted within a predetermined amount of shift between the primary motion vector and a predetermined pixel). Perform motion search (as a candidate). The neighborhood searcher 8 outputs the motion vector C201 detected in step S11, step S12, or step S14 to the outside of the motion vector detection device 100. Specifically, for a block for which a motion vector has been detected in step S11 or step S12, the motion vector is output. On the other hand, the motion vector detected in step S14 is output for the block whose motion vector could not be detected in step S11 or step S12. Thereafter, the process of detecting a motion vector for the encoding target macroblock C121 ends.

以上のように、動きベクトル検出装置100は、横16×縦16画素のマクロブロック単位の一次探索を行うに先立ち、マクロブロックサイズ未満のブロックサイズ、例えば横8×縦8画素のブロック単位でゼロベクトル周辺や動きベクトル予測値周辺の近傍探索を予め行っておく。そして、動きベクトルを検出できたブロックがあった場合、一次探索では、そのブロックの画素を差分絶対値和の演算から除外して探索を行う。
この動きベクトル検出装置100は、マクロブロック単位で一次探索を行うので、画像中のノイズ等の擾乱の影響を受けにくく、また、テレスコピック探索を行う場合でも比較的演算量が少ない。また、ゼロベクトル周辺や動きベクトル予測値周辺の近傍探索で動きベクトルを検出できたブロックを、差分絶対値和の演算から除外して一次探索を行うので、例えば、マクロブロックが物体の境界に位置する場合でも背景等の影響を受けにくく、動きベクトルを適切に検出できる。
As described above, the motion vector detection apparatus 100 has a block size smaller than the macroblock size, for example, zero in block units of 8 × 8 pixels, prior to the primary search in units of macroblocks of 16 × 16 pixels. A neighborhood search around the vector and the motion vector prediction value is performed in advance. If there is a block in which a motion vector can be detected, the primary search is performed by excluding the pixel of the block from the calculation of the sum of absolute differences.
Since the motion vector detection apparatus 100 performs a primary search in units of macroblocks, it is not easily affected by disturbances such as noise in an image, and the amount of computation is relatively small even when performing a telescopic search. In addition, since a block in which a motion vector was detected in the neighborhood search around the zero vector and the motion vector prediction value is excluded from the calculation of the sum of absolute differences, a primary search is performed. The motion vector can be detected appropriately without being affected by the background.

なお、一次探索器6が一次探索を行う際に用いる参照画像の縮小比率は、上述した縦横2分の1倍に限らない。また、近傍探索器8が二次探索を行う際に用いる参照画像は非縮小のものに限らない。例えば、一次探索器6が縦横4分の1の縮小比率の参照画像を用いて一次探索を行い、近傍探索器8が縦横2分の1の縮小比率の参照画像を用いて二次探索を行うようにしてもよい。あるいは、一次探索器6が非縮小の参照画像を用いて整数画素単位の一次探索を行い、近傍探索器8が非縮小の参照画像を用いて0.5画素単位あるいは0.25画素単位の二次探索を行うようにしてもよい。   Note that the reduction ratio of the reference image used when the primary searcher 6 performs the primary search is not limited to the above-mentioned half of the vertical and horizontal directions. Further, the reference image used when the neighborhood searcher 8 performs the secondary search is not limited to the non-reduced one. For example, the primary searcher 6 performs a primary search using a reference image with a reduction ratio of 1/4 in the vertical and horizontal directions, and the neighborhood searcher 8 performs a secondary search using a reference image with a reduction ratio of 1/2 in the vertical and horizontal directions. You may do it. Alternatively, the primary searcher 6 performs a primary search in units of integer pixels using a non-reduced reference image, and the neighborhood searcher 8 uses a non-reduced reference image to perform a second search in units of 0.5 pixels or 0.25 pixels. A next search may be performed.

なお、動きベクトル検出装置100の全部または一部の機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することにより各部の処理を行ってもよい。なお、ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。
また、「コンピュータシステム」は、WWWシステムを利用している場合であれば、ホームページ提供環境(あるいは表示環境)も含むものとする。
また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、短時間の間、動的にプログラムを保持するもの、その場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリのように、一定時間プログラムを保持しているものも含むものとする。また上記プログラムは、前述した機能の一部を実現するためのものであっても良く、さらに前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるものであっても良い。
Note that a program for realizing all or part of the functions of the motion vector detection apparatus 100 is recorded on a computer-readable recording medium, and the program recorded on the recording medium is read into a computer system and executed. You may process each part by. Here, the “computer system” includes an OS and hardware such as peripheral devices.
Further, the “computer system” includes a homepage providing environment (or display environment) if a WWW system is used.
The “computer-readable recording medium” refers to a storage device such as a flexible medium, a magneto-optical disk, a portable medium such as a ROM and a CD-ROM, and a hard disk incorporated in a computer system. Furthermore, the “computer-readable recording medium” dynamically holds a program for a short time like a communication line when transmitting a program via a network such as the Internet or a communication line such as a telephone line. In this case, a volatile memory in a computer system serving as a server or a client in that case, and a program that holds a program for a certain period of time are also included. The program may be a program for realizing a part of the functions described above, and may be a program capable of realizing the functions described above in combination with a program already recorded in a computer system.

以上、この発明の実施形態を図面を参照して詳述してきたが、具体的な構成はこの実施形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計変更等も含まれる。   The embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and includes design changes and the like within a scope not departing from the gist of the present invention.

本発明は、例えば、動画像のディジタル信号をMPEG(Moving Picture Experts Group)方式、あるいは、ITU−T(The International Telecommunication Union Telecommunication Standardization Sector)Hシリーズ方式に従って符号化する映像符号化器など、動き予測を行う映像符号化器において、動きベクトルを出力する動きベクトル検出装置、動きベクトル検出方法およびプログラムに用いて好適である。   The present invention provides motion prediction such as a video encoder that encodes a moving picture digital signal in accordance with the Moving Picture Experts Group (MPEG) method or the International Telecommunication Union Telecommunication Standardization Sector (ITU-T) H series method. In the video encoder that performs the above, it is suitable for use in a motion vector detection device, a motion vector detection method, and a program that output a motion vector.

1 画像メモリ
2 探索範囲切り出し器
3、12 画像縮小器
4 縮小画像キャッシュメモリ
5 画像キャッシュメモリ
6 一次探索器
7 探索中心指示器
8 近傍探索器
100 動きベクトル検出装置
611 差分絶対値和算出器
621 差分絶対値和加算制御器
631 差分絶対値和加算器
641 評価器
DESCRIPTION OF SYMBOLS 1 Image memory 2 Search range cutout device 3, 12 Image reducer 4 Reduced image cache memory 5 Image cache memory 6 Primary searcher 7 Search center indicator 8 Neighbor searcher 100 Motion vector detection apparatus 611 Difference absolute value sum calculator 621 Difference Absolute value sum addition controller 631 Difference absolute value sum adder 641 Evaluator

Claims (3)

入力動画像のマクロブロックを分割したブロック毎に、参照画像上で前記ブロックに対応する領域の位置を示す動きベクトルを検出する動きベクトル検出装置であって、
前記マクロブロックを分割したブロック毎に、前記参照画像上での当該ブロックの位置を示すゼロベクトルの周辺と、当該ブロックに隣接するブロックの動きベクトルに基づいて定まる動きベクトル予測値の周辺との動きベクトルの候補の各々について、当該ブロックの画素と前記参照画像の画素との差分に基づいて動きベクトル評価値を算出し、所定の閾値以下の動きベクトル評価値の有無を判定する事前近傍探索器と、
前記マクロブロックに対する一次動きベクトルを、前記事前近傍探索器が所定の閾値以下の動きベクトル評価値無しと判定した各ブロックの画素と前記参照画像の画素との差分に基づく、マクロブロック単位での動き探索によって検出する一次探索器と、
前記事前近傍探索器が所定の閾値以下の動きベクトル評価値無しと判定したブロックの各々については、前記一次動きベクトルの周辺の動き探索を行って動きベクトルを検出し、前記事前近傍探索器が所定の閾値以下の動きベクトル評価値有りと判定したブロックの各々については、前記動きベクトル評価値が所定の閾値以下の動きベクトルの候補を当該ブロックの動きベクトルとする二次探索器と、
を具備することを特徴とする動きベクトル検出装置。
A motion vector detection device that detects a motion vector indicating a position of a region corresponding to a block on a reference image for each block obtained by dividing a macro block of an input moving image,
For each block obtained by dividing the macro block, and surrounding the zero vector indicating the position of the block on the reference image, the motion of the surrounding motion vector prediction value determined on the basis of the motion vectors of blocks adjacent to the block for each candidate vector, and calculates a motion vector evaluation value based on a difference between pixels of the pixel and the reference picture of the block, and determines in advance the vicinity searcher whether the following motion vector evaluation value predetermined threshold ,
The primary motion vector for the macroblock is determined in units of macroblocks based on the difference between the pixel of each block determined by the prior neighborhood searcher as having no motion vector evaluation value equal to or less than a predetermined threshold and the pixel of the reference image . A primary searcher to detect by motion search;
For each block determined by the prior neighborhood searcher as having no motion vector evaluation value equal to or less than a predetermined threshold, a motion vector is detected by performing a motion search around the primary motion vector, and the prior neighborhood searcher For each of the blocks determined as having a motion vector evaluation value equal to or less than a predetermined threshold, a secondary searcher that uses a motion vector candidate whose motion vector evaluation value is equal to or less than a predetermined threshold as a motion vector of the block;
A motion vector detection apparatus comprising:
入力動画像のマクロブロックを分割したブロック毎に、参照画像上で前記ブロックに対応する領域の位置を示す動きベクトルを検出する動きベクトル検出装置の動きベクトル検出方法であって、
前記マクロブロックを分割したブロック毎に、前記参照画像上での当該ブロックの位置を示すゼロベクトルの周辺と、当該ブロックに隣接するブロックの動きベクトルに基づいて定まる動きベクトル予測値の周辺との、動きベクトルの候補の各々について、当該ブロックの画素と前記参照画像の画素との差分に基づいて動きベクトル評価値を算出し、所定の閾値以下の動きベクトル評価値の有無を判定する事前近傍探索ステップと、
前記マクロブロックに対する一次動きベクトルを、前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値無しと判定した各ブロックの画素と前記参照画像の画素との差分に基づく、マクロブロック単位での動き探索によって検出する一次探索ステップと、
前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値無しと判定したブロックの各々については、前記一次動きベクトルの周辺の動き探索を行って動きベクトルを検出し、前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値有りと判定したブロックの各々については、前記動きベクトル評価値が前記所定の閾値以下の前記動きベクトルの候補を当該ブロックの動きベクトルとする二次探索ステップと、
を具備することを特徴とする動きベクトル検出方法。
A motion vector detection method of a motion vector detection apparatus that detects a motion vector indicating a position of an area corresponding to a block on a reference image for each block obtained by dividing a macro block of an input moving image,
The macro block for each block obtained by dividing the periphery of the zero vector indicating the position of the block on the reference image, the periphery of the motion vector prediction value determined on the basis of the motion vectors of blocks adjacent to the block, for each of the candidate motion vectors, and calculates a motion vector evaluation value based on a difference between pixels of the pixel and the reference picture of the block, pre-neighbor searching step determines the presence or absence of a predetermined threshold value or less of the motion vector evaluation value When,
A primary motion vector for the macroblock is determined in units of macroblocks based on a difference between a pixel of each block determined as having no motion vector evaluation value equal to or less than a predetermined threshold in the prior neighborhood search step and a pixel of the reference image. A primary search step detected by motion search of
For each block determined to have no motion vector evaluation value equal to or less than a predetermined threshold in the prior neighborhood search step, a motion vector is detected by performing a motion search around the primary motion vector, and the prior neighborhood search For each block that is determined to have a motion vector evaluation value less than or equal to a predetermined threshold in the step, a secondary search using the motion vector candidates whose motion vector evaluation value is less than or equal to the predetermined threshold as the motion vector of the block Steps,
A motion vector detection method comprising:
コンピュータに、入力動画像のマクロブロックを分割したブロック毎に、参照画像上で前記ブロックに対応する領域の位置を示す動きベクトルを出力させるためのプログラムであって、
前記マクロブロックを分割したブロック毎に、前記参照画像上での当該ブロックの位置を示すゼロベクトルの周辺と、当該ブロックに隣接するブロックの動きベクトルに基づいて定まる動きベクトル予測値の周辺との、動きベクトルの候補の各々について、当該ブロックの画素と前記参照画像の画素との差分に基づいて動きベクトル評価値を算出し、所定の閾値以下の動きベクトル評価値の有無を判定する事前近傍探索ステップと、
前記マクロブロックに対する一次動きベクトルを、前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値無しと判定した各ブロックの画素と前記参照画像の画素との差分に基づく、マクロブロック単位での動き探索によって検出する一次探索ステップと、
前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値無しと判定したブロックの各々については、前記一次動きベクトルの周辺の動き探索を行って動きベクトルを検出し、前記事前近傍探索ステップにて所定の閾値以下の動きベクトル評価値有りと判定したブロックの各々については、前記動きベクトル評価値が前記所定の閾値以下の前記動きベクトルの候補を当該ブロックの動きベクトルとする二次探索ステップと、
を前記コンピュータに実行させるためのプログラム。
A program for causing a computer to output a motion vector indicating a position of an area corresponding to a block on a reference image for each block obtained by dividing a macro block of an input moving image,
The macro block for each block obtained by dividing the periphery of the zero vector indicating the position of the block on the reference image, the periphery of the motion vector prediction value determined on the basis of the motion vectors of blocks adjacent to the block, for each of the candidate motion vectors, and calculates a motion vector evaluation value based on a difference between pixels of the pixel and the reference picture of the block, pre-neighbor searching step determines the presence or absence of a predetermined threshold value or less of the motion vector evaluation value When,
A primary motion vector for the macroblock is determined in units of macroblocks based on a difference between a pixel of each block determined as having no motion vector evaluation value equal to or less than a predetermined threshold in the prior neighborhood search step and a pixel of the reference image. A primary search step detected by motion search of
For each block determined to have no motion vector evaluation value equal to or less than a predetermined threshold in the prior neighborhood search step, a motion vector is detected by performing a motion search around the primary motion vector, and the prior neighborhood search For each block that is determined to have a motion vector evaluation value less than or equal to a predetermined threshold in the step, a secondary search using the motion vector candidates whose motion vector evaluation value is less than or equal to the predetermined threshold as the motion vector of the block Steps,
For causing the computer to execute.
JP2009287853A 2009-12-18 2009-12-18 Motion vector detection apparatus, motion vector detection method and program Active JP5286573B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009287853A JP5286573B2 (en) 2009-12-18 2009-12-18 Motion vector detection apparatus, motion vector detection method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009287853A JP5286573B2 (en) 2009-12-18 2009-12-18 Motion vector detection apparatus, motion vector detection method and program

Publications (2)

Publication Number Publication Date
JP2011130264A JP2011130264A (en) 2011-06-30
JP5286573B2 true JP5286573B2 (en) 2013-09-11

Family

ID=44292340

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009287853A Active JP5286573B2 (en) 2009-12-18 2009-12-18 Motion vector detection apparatus, motion vector detection method and program

Country Status (1)

Country Link
JP (1) JP5286573B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6538609B2 (en) * 2016-05-11 2019-07-03 日本電信電話株式会社 Motion vector detection device, motion vector detection method and motion vector detection program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR0181069B1 (en) * 1995-11-08 1999-05-01 배순훈 Motion estimation apparatus
JP2008109632A (en) * 2006-09-28 2008-05-08 Toshiba Corp Motion vector detector and its method

Also Published As

Publication number Publication date
JP2011130264A (en) 2011-06-30

Similar Documents

Publication Publication Date Title
US11109054B2 (en) Video encoding method and video decoding method
CN116248898A (en) Motion vector correction for multi-reference prediction
KR100325253B1 (en) Motion vector search method and apparatus
JP4166781B2 (en) Motion vector detection apparatus and motion vector detection method
JP5216710B2 (en) Decryption processing method
CA2788952A1 (en) Motion vector predictive encoding method, motion vector predictive decoding method, moving picture encoding apparatus, moving picture decoding apparatus, and programs thereof
KR20130126698A (en) Video encoding device, video encoding method and video encoding program
JP5185244B2 (en) Motion vector detection apparatus, motion vector detection method and program
CN111901590B (en) Refined motion vector storage method and device for inter-frame prediction
JP5286573B2 (en) Motion vector detection apparatus, motion vector detection method and program
JP2005167976A (en) Motion vector detecting device and motion vector detecting program
JP2012129791A (en) Image encoder
CN114040209A (en) Motion estimation method, motion estimation device, electronic equipment and storage medium
JP2008236096A (en) Movement search method, movement search apparatus, movement search program, and computer readable record medium recording its program
JP2006033433A (en) Method and apparatus for motion estimation, and program
JP2006014183A (en) Image encoding device and method, and program therefor
JP5788952B2 (en) Video decoding method
JP5913911B2 (en) Image encoding device
JP5754120B2 (en) Motion vector detection apparatus, motion vector detection method and program
JP5887020B1 (en) Video decoding method
JP5890933B1 (en) Video decoding method
JP5864022B2 (en) Video decoding method
JP2016136741A (en) Moving image decoding method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120217

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121031

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121113

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130110

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130514

R150 Certificate of patent or registration of utility model

Ref document number: 5286573

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350