JP4385875B2 - Motion vector detection device and program - Google Patents

Motion vector detection device and program Download PDF

Info

Publication number
JP4385875B2
JP4385875B2 JP2004205467A JP2004205467A JP4385875B2 JP 4385875 B2 JP4385875 B2 JP 4385875B2 JP 2004205467 A JP2004205467 A JP 2004205467A JP 2004205467 A JP2004205467 A JP 2004205467A JP 4385875 B2 JP4385875 B2 JP 4385875B2
Authority
JP
Japan
Prior art keywords
integer
search
block
pixel
difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2004205467A
Other languages
Japanese (ja)
Other versions
JP2006033112A (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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2004205467A priority Critical patent/JP4385875B2/en
Publication of JP2006033112A publication Critical patent/JP2006033112A/en
Application granted granted Critical
Publication of JP4385875B2 publication Critical patent/JP4385875B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、動きベクトル検出装置、および、プログラムに関し、特に、ブロックマッチング方式の動き検出に好適な動きベクトル検出装置、および、プログラムに関する。   The present invention relates to a motion vector detection device and a program, and more particularly to a motion vector detection device and a program suitable for block matching motion detection.

動画像データを圧縮するための符号化処理においては、すでに符号化された画像を復号して得られる参照画像(参照フレーム)と符号化対象である現画像(現フレーム)との差分を検出するため、所定数の画素群であるマクロブロックを基準に動きベクトルを検出することが一般的である。すなわち、現画像上に設定したマクロブロックとの誤差が最小となる参照画像上のブロック(参照ブロック)を探索し、マクロブロック上の基準座標と参照ブロック上の基準座標との間の動きベクトルを検出する。   In encoding processing for compressing moving image data, a difference between a reference image (reference frame) obtained by decoding an already encoded image and a current image (current frame) to be encoded is detected. Therefore, it is common to detect a motion vector based on a macroblock which is a predetermined number of pixel groups. That is, a block (reference block) on the reference image that minimizes an error from the macroblock set on the current image is searched, and a motion vector between the reference coordinates on the macroblock and the reference coordinates on the reference block is obtained. To detect.

このような参照画像上での参照ブロックの探索方法として、例えば、「フルサーチ手順」が知られている。この方法は、参照画像上の探索領域内すべてのブロックパターンについて演算をおこなうものである。ここで、ブロック間の動きベクトル検出には、例えば、差分絶対値和演算(Sum of Absolute Difference: SAD)が一般的に用いられるため、すべてのブロックパターンを対象とするフルサーチ手順では、検出が確実である反面、動きベクトル検出のための総演算量が莫大となってしまう。また、画像の変化が少ない場合でもすべてのブロックについて演算してしまうため、処理が効率的でない場合がある。   As a method for searching for a reference block on such a reference image, for example, a “full search procedure” is known. In this method, calculation is performed for all block patterns in the search area on the reference image. Here, for example, since sum of absolute difference (SAD) is generally used for motion vector detection between blocks, detection is performed in a full search procedure for all block patterns. While it is certain, the total calculation amount for motion vector detection becomes enormous. In addition, even if there is little change in the image, the calculation is performed for all blocks, so the processing may not be efficient.

一方で、すべてのブロックパターンについて演算をおこなわず、複数段階の手順を経ることで簡易的に動きベクトル検出をおこなう「ステップサーチ手順」(多段探索)も知られている。特に分数画素単位までの探索をおこなう場合、ステップサーチ手順とすることで演算量の減少を図ることができる。すなわち、ステップサーチ手順では、第1段階で整数画素単位の粗い探索(整数探索)をおこない、差分値が最小となる整数位置の周辺で、分数画素単位の細かい探索(分数探索)を第2段階としておこなう。第1段階の粗い探索を導入することにより、フルサーチ手順より演算量を減少させることができる。   On the other hand, a “step search procedure” (multi-stage search) is also known in which a motion vector is simply detected by performing a plurality of steps without performing calculations for all block patterns. In particular, when searching for a fractional pixel unit, the amount of calculation can be reduced by using a step search procedure. That is, in the step search procedure, a coarse search (integer search) in units of integer pixels is performed in the first stage, and a fine search (fractional search) in units of fractional pixels is performed in the second stage around the integer position where the difference value is minimum. Do as. By introducing a coarse search in the first stage, the amount of calculation can be reduced compared to the full search procedure.

しかしながら、第2段階での分数探索では、整数探索での探索された最適位置の周囲8方向を分数画素精度で差分絶対値和演算をおこなうので、第2段階での演算量は多くなる。このような問題を解消するため、第2段階での演算量を減少させる手法が提案されている(例えば、特許文献1)。   However, in the fractional search in the second stage, the difference absolute value sum calculation is performed with the fractional pixel accuracy in the eight directions around the optimum position searched in the integer search, so that the calculation amount in the second stage increases. In order to solve such a problem, a method for reducing the amount of calculation in the second stage has been proposed (for example, Patent Document 1).

特許文献1の手法では、第1段階の整数探索で探索したブロックのうち、マッチング結果が最も良好なブロック(最良ブロック)と、2番目に良好なブロック(次点ブロック)を特定し、最良ブロックからみた次点ブロックの方向を、最良ブロックの中心近傍における分数探索の対象分数位置の方向としている。すなわち、最良ブロックの中心を示すvector_minと、次点ブロックの中心を示すvector_secondを用いて、分数探索対象とする分数位置を決定し、該当する分数位置でのみマッチングをとることで、分数探索(第2段階)での演算量の減少を図っている。   In the method of Patent Document 1, the block having the best matching result (best block) and the second best block (next block) are identified from the blocks searched by the integer search in the first stage, and the best block is determined. The direction of the next block viewed from the viewpoint is the direction of the target fraction position of the fraction search in the vicinity of the center of the best block. That is, by using the vector_min indicating the center of the best block and the vector_second indicating the center of the next block, the fractional position to be subjected to the fractional search is determined, and matching is performed only at the relevant fractional position to obtain the fractional search (first The amount of computation is reduced in two stages.

上記手法では、ブロック単位のマッチング順位によりvector_minとvector_secondを決め、これに基づいて分数探索方向を決定している。このため、例えば、整数探索範囲が比較的広い場合などには、最良ブロックと位置的に離れたブロックが次点ブロックとされることも考えられる。このような場合、探索中心からみた次点ブロックまでの距離が、最良ブロックよりも遠くなる場合がある。ここで、最良整数位置(vector_min)付近での分数ベクトルを検出することが多段探索における分数探索(第2段階)の目的であるが、上記のように、最良ブロックよりも遠い位置のブロックが次点ブロックとされた場合、最良ブロックから次点ブロックに対する方向(すなわち、vector_minとvector_secondで求める方向)は、最良整数位置(vector_min)から実際の最良分数位置に対する方向と異なってしまう可能性がある。この場合、最良ではない分数位置に基づいて分数ベクトルが求められてしまうため、分数探索の結果が良好でない場合がある。   In the above method, vector_min and vector_second are determined based on the matching order in units of blocks, and the fractional search direction is determined based on this. For this reason, for example, when the integer search range is relatively wide, a block that is distant from the best block may be considered as the next block. In such a case, the distance from the search center to the next block may be longer than the best block. Here, the purpose of the fraction search (second stage) in the multistage search is to detect a fraction vector near the best integer position (vector_min). As described above, the block far from the best block is the next one. In the case of a point block, the direction from the best block to the next block (that is, the direction obtained by vector_min and vector_second) may be different from the direction from the best integer position (vector_min) to the actual best fractional position. In this case, since the fraction vector is obtained based on the fractional position that is not the best, the result of the fraction search may not be good.

また、整数探索時に、ブロックの近傍4点(もしくは8点)の整数位置について現フレーム(符号化対象フレーム)との差分をとり、良好な結果値となった整数位置の方向にブロックを移動させることで、探索範囲の全領域にわたってブロックを移動させることなく、最良のブロックを探索する方法も知られている。一方、特許文献1に記載の手法では、整数探索におけるブロック単位に順位をとっているので、探索範囲内のすべてのブロックについて評価値を得なければならない。そのため、上記のようなブロック移動量を減少させる手法には適用できず、効果的な演算量の減少を図ることが困難である。
特開平10−247242号公報
Also, at the time of integer search, a difference from the current frame (encoding target frame) is taken for the integer positions of 4 points (or 8 points) in the vicinity of the block, and the block is moved in the direction of the integer position where a good result value is obtained. Thus, a method for searching for the best block without moving the block over the entire region of the search range is also known. On the other hand, in the method described in Patent Document 1, since ranking is performed in units of blocks in integer search, it is necessary to obtain evaluation values for all blocks within the search range. Therefore, it cannot be applied to the method for reducing the block movement amount as described above, and it is difficult to effectively reduce the calculation amount.
JP-A-10-247242

本発明は上記実状に鑑みてなされたもので、分数探索での演算量を減少させるとともに、良好な分数探索結果を得ることができる動き検出装置等を提供することを目的とする。   The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a motion detection device and the like that can reduce the amount of calculation in the fraction search and obtain a good fraction search result.

上記目的を達成するため、本発明の第1の観点にかかる動きベクトル検出装置は、
参照フレーム上で整数探索および分数探索して、現フレーム上の現ブロックについての動きベクトルを検出する動きベクトル検出装置であって、
整数単位の探索の結果、参照フレームの画素と現ブロックの画素との差分が最小である整数位置を第1の整数位置とし、第1の整数位置の近傍周囲の整数位置の内、前記第1の整数位置の次に参照フレームの画素と現ブロックの画素との差分が小さい整数位置を第2の整数位置として特定する第2整数位置特定手段と、
前記第1の整数位置と前記第2の整数位置とに基づいて、所定の精度の分数位置を推定する分数位置推定手段と、
前記第1の整数位置と、前記分数位置推定手段が推定した分数位置とに基づいて、前記所定の精度より高精度の分数探索をおこなう分数探索手段と、
を備え、
前記分数探索手段は、
前記第1の整数位置における参照フレームの画素と現ブロックの画素との差分と、前記分数位置推定手段が推定した分数位置における参照フレームの画素と現ブロックの画素との差分とを比較し、より差分の小さい位置がいずれかであるかを判定する判定手段と、
前記判定手段によってより差分が小さいと判定された位置を前記所定の精度より高精度の分数探索における探索中心に指定する探索中心指定手段と、
さらに備えることを特徴とする。
In order to achieve the above object, a motion vector detection device according to a first aspect of the present invention includes:
A motion vector detection device for detecting a motion vector for a current block on a current frame by performing integer search and fractional search on a reference frame,
Results of the search of the integer unit, the difference between pixels of the reference frame and the pixel of the current block is an integer position is minimum as the first integer positions, among integer position near the periphery of the first integer position, the first a second integer position specifying means for specifying the difference is small integer position of the pixel and the pixel of the current block of the reference frame to the next integer position as the second integer position of,
A fractional position estimating means for estimating a fractional position with a predetermined accuracy based on the first integer position and the second integer position;
A fraction search means for performing a fraction search with higher accuracy than the predetermined accuracy based on the first integer position and the fraction position estimated by the fraction position estimation means;
With
The fraction search means includes:
Comparing the difference between the reference frame pixel at the first integer position and the current block pixel with the difference between the reference frame pixel at the fractional position estimated by the fractional position estimation means and the current block pixel; and A determination means for determining whether the position where the difference is small is either;
Search center designating means for designating a position determined by the determining means as having a smaller difference as a search center in a fractional search with higher accuracy than the predetermined accuracy;
Is further provided.

上記動きベクトル検出装置において、
前記第2整数位置特定手段は、前記第1の整数位置に隣接する整数位置の中から第2の整数位置を特定することが望ましい。
In the motion vector detection device,
It is desirable that the second integer position specifying unit specifies a second integer position from among integer positions adjacent to the first integer position.

この場合、
前記第2整数位置特定手段は、前記第1の整数位置の周囲8方向に隣接する整数位置の中から第2の整数位置を特定することが望ましい。
in this case,
Preferably, the second integer position specifying means specifies a second integer position from integer positions adjacent to each other in eight directions around the first integer position.

上記動きベクトル検出装置において、
前記分数位置推定手段は、前記第1の整数位置と前記第2の整数位置との間の中間位置を前記所定の精度の分数位置であると推定することが望ましい。
In the motion vector detection device,
The fractional position estimating means preferably estimates an intermediate position between the first integer position and the second integer position as the fractional position with the predetermined accuracy.

上記動きベクトル検出装置において、
前記第2整数位置特定手段は、前記第1の整数位置における参照フレームの画素と現ブロックの画素との差分が、前記推定された分数位置における参照フレームの画素と現ブロックの画素との差分より小さい場合、第1の整数位置の近傍周囲の整数位置の内、前記第2の整数位置の次に参照フレームの画素と現ブロックの画素との差分が小さい整数位置を新たな第2の整数位置としてもよい。
In the motion vector detection device,
The second integer position specifying means, the difference between pixels of the first reference frame at integer positions pixel and the current block is, from the difference between the pixel of the pixel and the current block of the reference frame in the estimated fractional position If small, of the integer positions in the vicinity around the first integer position, the second integer positions the new difference is small integer positions of the pixels in the reference frame to the next pixel of the current block of the second integer positions It is good.

上記目的を達成するため、本発明の第2の観点にかかるプログラムは、
コンピュータで動画像の動きベクトル検出をおこなうためのプログラムであって、
コンピュータに、
参照フレーム上で整数単位の探索をおこなって、参照フレームの画素と現フレームの現ブロックの画素との差分が最小である整数位置を第1の整数位置とし、第1の整数位置の近傍周囲の整数位置の内、前記第1の整数位置の次に参照フレームの画素と現ブロックの画素との差分が小さい整数位置を第2の整数位置として特定する機能と、
前記第1の整数位置と前記第2の整数位置との間の中間位置を、所定の精度の分数位置と推定する機能と、
前記第1の整数位置における参照フレームの画素と現ブロックの画素との差分と、前記推定された分数位置における参照フレームの画素と現ブロックの画素との差分とを比較し、より差分の小さい位置がいずれかであるかを判定する機能と、
前記判定手段によってより差分が小さいと判定された位置を探索中心として、前記所定の精度より高精度の分数探索をおこなう機能と、
分数探索の結果に基づき、現ブロックについての動きベクトルを算出する機能と、
を実現させることを特徴とする。
In order to achieve the above object, a program according to the second aspect of the present invention is:
A program for detecting a motion vector of a moving image on a computer,
On the computer,
An integer unit search is performed on the reference frame, and the integer position where the difference between the pixel of the reference frame and the pixel of the current block of the current frame is the minimum is set as the first integer position. of integer positions, a function of specifying the difference is small integer position of the pixel of the first next to the reference frame pixel and the current block of integer positions as a second integer positions,
A function of estimating an intermediate position between the first integer position and the second integer position as a fractional position with a predetermined accuracy;
The difference between the reference frame pixel at the first integer position and the current block pixel is compared with the difference between the reference frame pixel at the estimated fractional position and the current block pixel, and the difference is smaller. A function to determine whether or not
A function for performing a fractional search with higher accuracy than the predetermined accuracy, with the position determined by the determining means as having a smaller difference as a search center;
A function to calculate a motion vector for the current block based on the result of the fraction search;
It characterized in that to realize.

上記プログラムは、
前記コンピュータに、
前記第1の整数位置における参照フレームの画素と現ブロックの画素との差分が、前記推定された分数位置における参照フレームの画素と現ブロックの画素との差分より小さい場合、第1の整数位置の近傍周囲の整数位置の内、前記第2の整数位置の次に参照フレームの画素と現ブロックの画素との差分が小さい整数位置を新たな第2の整数位置とする機能、
をさらに実現させることを特徴とする。
The above program
In the computer,
The difference between the pixel and the current block pixels in the reference frame in said first integer position, when the pixels of the reference frame in the estimated fractional positions less than the difference between the pixel of the current block, the first integer position among integer positions around the vicinity, functions as a second integer position difference new a small integer position of the pixel of the second of the next reference frame of integer positions pixel and the current block,
Is further realized.

本発明によれば、整数探索で得られた第1の整数位置(最良整数位置)の近傍周囲で、最良整数位置の次に現ブロックとの差分が小さい第2の整数位置(次点整数位置)を特定し、最良整数位置と次点整数位置との中間位置(例えば、1/2pel位置)を、所定の精度(例えば、1/2pel)の分数探索で得られる分数位置と推定する。そして、推定された分数位置(暫定分数位置)と最良整数位置のうち、現ブロックとの差分がより小さい位置を探索中心として、より高精度(例えば、1/4pel)の分数探索をおこなう。このため、例えば、「整数探索(第1段階)→1/2pel探索(第2段階)→1/4pel探索(第3段階)」というような多段探索で動きベクトルを検出する場合に、すでに実行された整数探索の結果から第2段階での結果を推定するので、第2段階での演算量を減少させることができる。これにより、動画像の符号化などにおける処理の高速化や装置の省電力化等を図ることができる。   According to the present invention, the second integer position (next-point integer position) having the smallest difference from the current block next to the best integer position around the vicinity of the first integer position (best integer position) obtained by integer search. ) And an intermediate position (for example, 1/2 pel position) between the best integer position and the next integer position is estimated as a fractional position obtained by a fractional search with a predetermined accuracy (for example, 1/2 pel). Then, among the estimated fraction positions (provisional fraction positions) and the best integer positions, a fraction search with higher accuracy (for example, 1/4 pel) is performed with a position having a smaller difference from the current block as a search center. Therefore, for example, when a motion vector is detected by a multi-stage search such as “integer search (first stage) → 1/2 pel search (second stage) → 1/4 pel search (third stage)” Since the result in the second stage is estimated from the result of the integer search, the amount of computation in the second stage can be reduced. As a result, it is possible to increase the processing speed in the encoding of moving images, reduce the power consumption of the apparatus, and the like.

ここで、次点整数位置を最良整数位置の近傍周囲、より詳細には、最良整数位置に隣接する整数位置の中から特定している。このため、探索範囲内のブロック単位で最良整数位置と次点整数位置とを特定することで生じうる、実際の分数動きベクトルとは相関しない位置を次点整数位置としてしまうことがない。さらに、特定した次点整数位置に基づいて推定した分数位置における現ブロックとの差分より、最良整数位置における現ブロックとの差分の方が小さい場合は、最良整数位置の近傍周囲で、当該次点整数位置の次に現ブロックとの差分が小さい位置を次点整数位置としている。このため、種々の条件等により、最良整数位置の次に差分が小さい位置が実際の分数動きベクトルと相関が高くない場合であっても、実際の分数動きベクトルとの相関が高い位置を探索するので、高速な処理を安定的におこなうことができる。   Here, the next integer position is identified from the vicinity of the best integer position, more specifically, from the integer positions adjacent to the best integer position. For this reason, a position that does not correlate with an actual fractional motion vector, which can be generated by specifying the best integer position and the next integer position in units of blocks within the search range, does not become the next integer position. Furthermore, if the difference from the current block at the best integer position is smaller than the difference from the current block at the fractional position estimated based on the specified next integer position, the next point around the best integer position The position where the difference from the current block is next to the integer position is the next integer position. For this reason, even if the position with the next smallest difference after the best integer position is not highly correlated with the actual fractional motion vector due to various conditions or the like, a position having a high correlation with the actual fractional motion vector is searched. Therefore, high-speed processing can be performed stably.

(実施形態1)
本発明にかかる実施形態を、以下図面を参照して説明する。本実施形態では、動画像データの符号化を行う符号化装置に本発明を適用した場合を例に以下説明する。本実施形態にかかる符号化装置100は、入力される動画像データを構成する所定単位(例えば、フレームやフィールド)の画像間での動き補償により次の画像を予測する予測差分符号化方式で動画像データを符号化するものとする。本実施形態では、入力される単位画像を「フレーム」とする。すなわち、本実施形態にかかる符号化装置100は、インターフレーム予測による符号化をおこなう。なお、画像単位はフレームに限られず任意であり、例えば「フィールド」などであってもよい。
(Embodiment 1)
Embodiments according to the present invention will be described below with reference to the drawings. In the present embodiment, a case where the present invention is applied to an encoding apparatus that encodes moving image data will be described below as an example. The encoding apparatus 100 according to the present embodiment uses a predictive differential encoding method that predicts a next image by motion compensation between images of a predetermined unit (for example, a frame or a field) constituting input moving image data. Assume that image data is encoded. In this embodiment, an input unit image is a “frame”. That is, the encoding apparatus 100 according to the present embodiment performs encoding by inter-frame prediction. Note that the image unit is not limited to a frame and is arbitrary, and may be, for example, a “field”.

本実施形態にかかる符号化装置100の構成を図1を参照して説明する。図1は、本実施形態にかかる符号化装置100の機能構成を示す機能ブロック図である。   A configuration of the encoding apparatus 100 according to the present embodiment will be described with reference to FIG. FIG. 1 is a functional block diagram illustrating a functional configuration of the encoding device 100 according to the present embodiment.

図示するように、本実施形態にかかる符号化装置100は、変換部110と、量子化部120と、符号化部130と、逆量子化部140と、逆変換部150と、復元画像メモリ160と、動き検出部170と、動き補償部180と、から構成される。   As illustrated, the encoding apparatus 100 according to the present embodiment includes a transform unit 110, a quantizer 120, an encoder 130, an inverse quantizer 140, an inverse transform unit 150, and a restored image memory 160. And a motion detection unit 170 and a motion compensation unit 180.

変換部110は、入力されたフレームおよび差分データについて変換符号化をおこなうことでデータ圧縮をおこなう。ここでは、例えば、4×4ブロックの整数変換(Integer Transform)をおこなうことで、動画像データを空間周波数領域に変換する。すなわち、隣接画素との相関を利用して低域周波数領域に変換係数を偏らせることでデータ圧縮を行う。   The conversion unit 110 performs data compression by performing conversion encoding on the input frame and difference data. Here, for example, the moving image data is converted into the spatial frequency domain by performing integer transform of 4 × 4 blocks. That is, data compression is performed by biasing the transform coefficient in the low frequency range using the correlation with adjacent pixels.

量子化部120は、変換部110による変換係数の値を、例えば、量子化ステップ幅の倍数で表して量子化し、データ圧縮を行う。すなわち、変換部110での変換に用いられた変換係数が離散的なレベルにマッピングされる。このような量子化によって高い周波数の符号量を軽減する。   The quantization unit 120 quantizes the value of the transform coefficient obtained by the transform unit 110 by, for example, representing a multiple of the quantization step width, and performs data compression. That is, the conversion coefficient used for conversion in the conversion unit 110 is mapped to a discrete level. Such quantization reduces the amount of high frequency code.

符号化部130は、量子化部120で量子化されたデータを、例えば、エントロピー符号化して出力するものであり、VLC(Variable Length Coding:可変長符号化)方式などの符号を用いて符号化する。より詳細には、例えば、指数ゴロム符号(Exponential Golomb Coding)や、CAVLC(Context-based Adaptive Variable Length Coding)などを用いる。さらに、生成する符号量を削減するために、CABAC(Context-based Adaptive Binary Arithmetic Coding)などの算術符号を用いて符号化してもよい。符号化部130で符号化されたデータ(以下、「符号化ビットストリーム」とする)は、所定の伝送媒体や記録媒体などに出力される。出力された符号化ビットストリームは、所定の復号化装置によって復号されて動画像データが再生される。   The encoding unit 130 outputs, for example, entropy encoding the data quantized by the quantization unit 120 and encodes it using a code such as a VLC (Variable Length Coding) method. To do. More specifically, for example, Exponential Golomb Coding or CAVLC (Context-based Adaptive Variable Length Coding) is used. Furthermore, in order to reduce the amount of codes to be generated, encoding may be performed using an arithmetic code such as CABAC (Context-based Adaptive Binary Arithmetic Coding). Data encoded by the encoding unit 130 (hereinafter referred to as “encoded bit stream”) is output to a predetermined transmission medium, recording medium, or the like. The output encoded bit stream is decoded by a predetermined decoding device to reproduce moving image data.

逆量子化部140は、量子化部120で量子化されたデータを逆量子化し、逆変換部150は、逆量子化部140で逆量子化されたデータを逆変換することで、量子化された入力データ(量子化フレーム)を復元する。   The inverse quantization unit 140 performs inverse quantization on the data quantized by the quantization unit 120, and the inverse transform unit 150 performs quantization by performing inverse transform on the data quantized by the inverse quantization unit 140. The input data (quantized frame) is restored.

復元画像メモリ160は、例えば、半導体記憶素子などから構成される記憶装置であり、逆変換部150で復元されたフレーム(以下、「復元フレーム」とする)を格納する、いわゆるフレームメモリである。すなわち、出力された符号化フレームについての符号化前のデータを格納する。復元画像メモリ160に格納された復元フレームは、インター予測で参照される「参照フレーム」として用いられる。   The restored image memory 160 is a storage device configured by, for example, a semiconductor storage element, and is a so-called frame memory that stores a frame restored by the inverse conversion unit 150 (hereinafter referred to as “restored frame”). That is, the pre-encoding data for the output encoded frame is stored. The restored frame stored in the restored image memory 160 is used as a “reference frame” referred to in inter prediction.

動き検出部170は、現在の入力フレーム(現フレーム)と、現フレームの前のフレーム(参照フレーム)との差分を検出することで画像中の動体の動きを検出し、その動きのベクトル(動きベクトル)を求める。本実施形態では、現フレーム上に所定数の画素から構成されるマクロブロック(Macro Block: MB)を設定し、参照フレーム上でマクロブロックとの差分が最小となるブロック(参照ブロック)を探索し、これらの間の差分を示すベクトルを動きベクトルとして検出する、いわゆる「ブロック・マッチング法」による動き検出をおこなう。   The motion detector 170 detects the motion of the moving object in the image by detecting the difference between the current input frame (current frame) and the frame before the current frame (reference frame), and the motion vector (motion Vector). In this embodiment, a macro block (Macro Block: MB) composed of a predetermined number of pixels is set on the current frame, and a block (reference block) having the smallest difference from the macro block is searched on the reference frame. Then, motion detection is performed by a so-called “block matching method” in which a vector indicating a difference between these is detected as a motion vector.

ここで、本実施形態の動き検出部170は、整数画素単位で動きベクトルを探索した後に分数画素単位で探索をおこなう、いわゆる「多段探索」により、分数単位までの動きベクトルを検出する。ここで、整数画素単位での探索を「整数探索」、分数画素単位での探索を「分数探索」とする。   Here, the motion detection unit 170 of the present embodiment detects motion vectors up to a fractional unit by so-called “multi-stage search”, in which a search is performed in units of fractional pixels after searching for motion vectors in units of integer pixels. Here, the search in units of integer pixels is referred to as “integer search”, and the search in units of fractional pixels is referred to as “fractional search”.

動き補償部180は、動き検出部170が検出した動きベクトルに基づいて、前のフレームに対して動き補償する。すなわち、検出した動きベクトルに基づいて予測フレームを作成する。そして、入力フレームと予測フレームの差分が符号化対象となる。   The motion compensation unit 180 performs motion compensation on the previous frame based on the motion vector detected by the motion detection unit 170. That is, a prediction frame is created based on the detected motion vector. Then, the difference between the input frame and the prediction frame is an encoding target.

本発明の実施形態にかかる動き検出部170は、例えば、「整数探索(第1段階)→1/2pel探索(第2段階)→1/4pel探索(第3段階)」のような多段探索で動きベクトルを検出する場合に、第2段階の演算量を減少させることで、処理速度の高速化とフレームレートの向上を図るものである。このような動作を行う動き検出部170の構成を図2を参照して説明する。   The motion detection unit 170 according to the embodiment of the present invention is a multi-stage search such as “integer search (first stage) → 1/2 pel search (second stage) → 1/4 pel search (third stage)”. When detecting a motion vector, the processing amount is increased and the frame rate is improved by reducing the amount of calculation in the second stage. The configuration of the motion detection unit 170 that performs such an operation will be described with reference to FIG.

図2は、動き検出部170の構成を示すブロック図である。図示するように、動き検出部170は、整数探索部171、最良整数位置判定部172、周囲整数位置評価部173、1/2pel演算部174、探索中心判定部175、1/4pel演算部176、ベクトル算出部177、を備える。   FIG. 2 is a block diagram illustrating a configuration of the motion detection unit 170. As shown in the figure, the motion detection unit 170 includes an integer search unit 171, a best integer position determination unit 172, a surrounding integer position evaluation unit 173, a 1/2 pel calculation unit 174, a search center determination unit 175, a 1/4 pel calculation unit 176, A vector calculation unit 177;

整数探索部171は、入力された現フレームで符号化対象ブロックとして指定されたマクロブロック(以下、「現ブロック」とする)の画素値と、入力された参照フレーム上の探索ブロックの画素値との差分を整数探索により求める。本実施形態では、所定の探索範囲を参照フレーム上に設定し、この探索フレーム内で探索ブロックを整数画素分ずつずらしながら、各探索ブロックの画素値と現ブロックの画素値との差分を、例えば、差分絶対値和演算(Sum of Absolute Difference: SAD)で求め、各演算結果を各探索ブロック毎の評価値として出力する。   The integer search unit 171 includes a pixel value of a macroblock (hereinafter referred to as “current block”) designated as an encoding target block in the input current frame, a pixel value of a search block on the input reference frame, and Is obtained by integer search. In the present embodiment, a predetermined search range is set on the reference frame, and the search block is shifted by an integer number of pixels within the search frame, and the difference between the pixel value of each search block and the pixel value of the current block is, for example, Then, the sum of absolute differences (SAD) is obtained, and the result of each operation is output as an evaluation value for each search block.

最良整数位置判定部172は、整数探索部171が出力した評価値に基づいて、現ブロックとの差分が最小となったブロック(以下、「最良整数ブロック」とする)がいずれであるかを判定し、最良整数位置(第1の整数位置)として特定する。   The best integer position determination unit 172 determines, based on the evaluation value output from the integer search unit 171, which block has the smallest difference from the current block (hereinafter referred to as “best integer block”). And identified as the best integer position (first integer position).

周囲整数位置評価部173は、整数探索部171が出力した評価値に基づいて、最良整数位置判定部172が判定した最良整数ブロックの周囲8方向に隣接する整数ブロックのうちで評価値が最良のブロック(以下、「次点整数ブロック」とする)を判定し、次点整数位置(第2の整数位置)として特定する。   The surrounding integer position evaluation unit 173 has the best evaluation value among the integer blocks adjacent in the eight directions around the best integer block determined by the best integer position determination unit 172 based on the evaluation value output by the integer search unit 171. A block (hereinafter referred to as “next-point integer block”) is determined and specified as the next-point integer position (second integer position).

1/2pel演算部174は、周囲整数位置評価部173が判定した次点整数ブロックと最良整数ブロックとに基づいて、1/2画素(1/2pel)単位の探索(1/2pel探索)で得られる分数位置と推定される分数位置(以下、「暫定分数位置」とする)を特定し、暫定分数位置における探索ブロック(以下、「暫定分数ブロック」とする)の画素値と、現ブロックの画素値との差分を、例えば、差分絶対値和演算により演算し、演算結果を評価値として出力する。   The 1 / 2pel calculation unit 174 is obtained by a 1/2 pixel (1 / 2pel) unit search (1 / 2pel search) based on the next integer block and the best integer block determined by the surrounding integer position evaluation unit 173. A fractional position to be estimated and a fractional position estimated (hereinafter referred to as “provisional fractional position”), a pixel value of a search block (hereinafter referred to as “provisional fractional block”) at the provisional fractional position, and a pixel of the current block A difference from the value is calculated by, for example, a difference absolute value sum calculation, and the calculation result is output as an evaluation value.

探索中心判定部175は、次点整数ブロックの評価値と暫定分数ブロックの評価値とを比較し、いずれの評価値がより良好であるか、すなわち、差分がより小さいかを判定する。探索中心判定部175は、判定結果に基づき、続いて実行する分数探索(1/4画素精度)の探索中心を判定する。   The search center determination unit 175 compares the evaluation value of the next integer block and the evaluation value of the provisional fractional block, and determines which evaluation value is better, that is, whether the difference is smaller. The search center determination unit 175 determines the search center of the subsequent fraction search (1/4 pixel accuracy) based on the determination result.

1/4pel演算部176は、探索中心判定部175が判定した探索中心に基づいて1/4画素(1/4pel)単位の分数探索(1/4pel探索)をおこなう。ここでは、探索ブロックを1/4画素分ずつずらしながら、各ずらし位置での画素値と現ブロックの画素値との差分を、例えば、差分絶対値和演算により求め、最も良好な評価値となったブロック(以下、「最良分数ブロック」とする)を特定する。   The 1 / 4pel calculation unit 176 performs a fractional search (1 / 4pel search) in units of 1/4 pixel (1 / 4pel) based on the search center determined by the search center determination unit 175. Here, while the search block is shifted by 1/4 pixel, the difference between the pixel value at each shift position and the pixel value of the current block is obtained by, for example, the sum of absolute differences, and the best evaluation value is obtained. Block (hereinafter referred to as “best fractional block”).

ベクトル算出部177は、整数探索部171による整数探索、および、1/4pel演算部176による1/4pel探索での得られた結果に基づいて、現ブロックについての「動きベクトル」を算出して出力する。   The vector calculation unit 177 calculates and outputs a “motion vector” for the current block based on the result obtained by the integer search by the integer search unit 171 and the 1/4 pel search by the 1 / 4pel operation unit 176. To do.

このような動き検出部170の各構成は、所定の制御信号によって制御されるものとする。このような制御信号は、例えば、CPU(Central Processing Unit:中央演算処理装置)などから構成される符号化装置100の制御部(不図示)より各部に供給されるものとすることができる他、外部装置などから供給されてもよい。   Each configuration of the motion detection unit 170 is controlled by a predetermined control signal. Such a control signal can be supplied to each unit from a control unit (not shown) of the encoding device 100 including, for example, a CPU (Central Processing Unit). It may be supplied from an external device or the like.

上記のように構成された符号化装置100は、次のような手順で動画像データを符号化する。   The encoding apparatus 100 configured as described above encodes moving image data in the following procedure.

符号化装置100に入力された動画像データは、フレーム単位で変換部110および動き検出部170へ送られる。動き検出部170では入力フレームと参照フレームとの差分を検出することで動きベクトルを検出する。動き補償部180は、その動きベクトルに基づいて参照フレームを動き補償して予測フレームを生成する。そして、入力フレームと予測フレームとの差分が取られ、その差分データは、変換部110による変換と、量子化部120による量子化が行われた後に、符号化部130で符号化される。動き検出部170が検出した動きベクトルデータも符号化部130で符号化され、両データは多重化されて出力される。   The moving image data input to the encoding device 100 is sent to the conversion unit 110 and the motion detection unit 170 in units of frames. The motion detection unit 170 detects a motion vector by detecting a difference between the input frame and the reference frame. The motion compensation unit 180 compensates the reference frame based on the motion vector to generate a prediction frame. Then, the difference between the input frame and the predicted frame is taken, and the difference data is encoded by the encoding unit 130 after being converted by the conversion unit 110 and quantized by the quantization unit 120. The motion vector data detected by the motion detector 170 is also encoded by the encoder 130, and both data are multiplexed and output.

一方、量子化部120で量子化された差分データは、逆量子化部140で逆量子化され、逆変換部150で逆変換されることにより復元される。復元された差分データと、動き補償部180が生成した予測フレームとが加算され、復元画像メモリ160に「復元フレーム」(復元画像)として格納される。復元画像メモリ160に格納された復元フレームは、「参照フレーム」(参照画像)として動き検出部170に入力される。動き検出部170では、入力された参照フレームと現フレームとの差分を示す動きベクトルを検出する。   On the other hand, the difference data quantized by the quantization unit 120 is restored by being inversely quantized by the inverse quantization unit 140 and inversely transformed by the inverse transform unit 150. The restored difference data and the predicted frame generated by the motion compensation unit 180 are added and stored in the restored image memory 160 as a “restored frame” (restored image). The restored frame stored in the restored image memory 160 is input to the motion detection unit 170 as a “reference frame” (reference image). The motion detection unit 170 detects a motion vector indicating a difference between the input reference frame and the current frame.

本実施形態にかかる動き検出部170は、いわゆるブロックマッチング法により現フレームと参照フレームとの差分ベクトルを求めるものである。すなわち、現フレーム上のマクロブロックと近似するブロックを参照フレーム上で探索し、探索されたブロック(参照ブロック)とマクロブロックとの差分ベクトルを動きベクトルとして検出する。   The motion detection unit 170 according to the present embodiment obtains a difference vector between the current frame and the reference frame by a so-called block matching method. That is, a block that approximates a macroblock on the current frame is searched on the reference frame, and a difference vector between the searched block (reference block) and the macroblock is detected as a motion vector.

ここで、本実施形態では、「整数探索(第1段階)→1/2pel探索(第2段階)→1/4pel探索(第3段階)」の順で探索する「多段探索」により動きベクトルを検出する。この場合の動き検出部170の動作(「動きベクトル検出処理1」)を図3に示すフローチャートを参照して説明する。この「動きベクトル検出処理1」は、動き検出部170に現フレームが入力されたことを契機に開始される。   Here, in this embodiment, motion vectors are obtained by “multi-stage search” in which search is performed in the order of “integer search (first stage) → 1/2 pel search (second stage) → 1/4 pel search (third stage)”. To detect. The operation of the motion detector 170 in this case (“motion vector detection process 1”) will be described with reference to the flowchart shown in FIG. This “motion vector detection process 1” is started when the current frame is input to the motion detection unit 170.

動き検出部170に現フレームが入力されると、整数探索部171によって整数探索がおこなわれる(ステップS101)。   When the current frame is input to the motion detection unit 170, an integer search is performed by the integer search unit 171 (step S101).

本実施形態では、整数探索の場合、図4(a)に示すように、現フレームCF上で指定された現ブロックCBと同一の位置およびサイズのブロックを探索ブロックSB1_INTとして参照フレームRF上に規定する。本実施形態では、整数探索、すなわち、第1段階の探索で用いる探索ブロックを探索ブロックSB1と表記する。なお、現ブロックCBおよび探索ブロックSB1のブロックサイズは任意であり、以下「探索ブロックサイズ」と表記する。   In the present embodiment, in the case of integer search, as shown in FIG. 4A, a block having the same position and size as the current block CB specified on the current frame CF is defined on the reference frame RF as a search block SB1_INT. To do. In the present embodiment, an integer search, that is, a search block used in the first stage search is denoted as a search block SB1. Note that the block sizes of the current block CB and the search block SB1 are arbitrary, and are hereinafter referred to as “search block size”.

整数探索の動作を図4(b)を参照して説明する。整数探索部171は、参照フレーム上に設定した探索ブロックSB1_INTを中心とする所定サイズの探索範囲SA1を規定し、この探索範囲SA1内で、探索ブロックSB1_INTを起点に、同サイズのブロック(探索ブロックSB1)を1整数画素ずつずらしながら、現ブロックCBの画素値と、各探索ブロックSB1の画素値との差分を、例えば、差分絶対値和演算により演算し、演算結果を各探索ブロックSB1の評価値として最良整数位置判定部172に出力する。   The operation of integer search will be described with reference to FIG. The integer search unit 171 defines a search range SA1 of a predetermined size centered on the search block SB1_INT set on the reference frame, and within this search range SA1, starts from the search block SB1_INT (block of the same size (search block) While SB1) is shifted by one integer pixel, the difference between the pixel value of the current block CB and the pixel value of each search block SB1 is calculated, for example, by calculating the sum of absolute differences, and the calculation result is evaluated for each search block SB1. The value is output to the best integer position determination unit 172 as a value.

なお、本実施形態では、ブロック内の画素のいずれかを基準点とし、その基準点の位置を指定することにより、ブロックの位置などを決定するものとする。ここでは、図4(b)に示すように、ブロックの左上頂部の整数位置を基準点とするものとし、整数探索で用いられる探索ブロックSB1についての基準点を基準点OP1と表記する。   In the present embodiment, one of the pixels in the block is used as a reference point, and the position of the reference point is designated to determine the position of the block. Here, as shown in FIG. 4B, the integer position at the upper left corner of the block is assumed to be a reference point, and the reference point for the search block SB1 used in the integer search is expressed as a reference point OP1.

最良整数位置判定部172は、整数探索部171が出力した評価値の内、評価が最も良好、すなわち、現ブロックとの差分が最小であるブロック(最良整数ブロックSB_min)がいずれであるかを判定し、最良整数位置(第1の整数位置)として特定する(ステップS102)。すなわち、探索ブロックSB1_INTを起点に、整数探索範囲SA1内を1整数画素ずつずらしたブロックの中から、現ブロックとの差分が整数単位で最小となるブロックを最良整数ブロックSB1_minとする(図4(b)参照)。   The best integer position determination unit 172 determines which of the evaluation values output from the integer search unit 171 is the best evaluation, that is, the block having the smallest difference from the current block (best integer block SB_min). Then, it is specified as the best integer position (first integer position) (step S102). That is, the block having the smallest difference from the current block in integer units among the blocks in which the integer search range SA1 is shifted by one integer pixel starting from the search block SB1_INT is defined as the best integer block SB1_min (FIG. 4 ( b)).

最良整数位置判定部172は、特定した最良整数ブロックSB1_minの位置を示す位置情報を周囲整数位置評価部173とベクトル算出部177に出力する。この場合、例えば、最良整数ブロックSB1_minの基準点OP1_minの座標を示す情報を位置情報として出力する。最良整数位置判定部172はまた、整数探索部171から取得した各探索ブロックSB1の評価値を周囲整数位置評価部173に出力する。   The best integer position determination unit 172 outputs position information indicating the position of the identified best integer block SB1_min to the surrounding integer position evaluation unit 173 and the vector calculation unit 177. In this case, for example, information indicating the coordinates of the reference point OP1_min of the best integer block SB1_min is output as position information. The best integer position determination unit 172 also outputs the evaluation value of each search block SB1 acquired from the integer search unit 171 to the surrounding integer position evaluation unit 173.

周囲整数位置評価部173は、整数探索で得られた最良整数ブロックSB1_minの近傍で、最良整数ブロックSB1_minの次に現ブロックとの差分が小さいブロック(次点整数ブロックSB1_min2)がいずれであるかを判定し、次点整数位置(第2の整数位置)として特定する(ステップS103)。本実施形態では、最良整数ブロックSB1_minの周囲8方向に隣接するブロックの中から次点整数ブロックSB1_min2を特定する。   The surrounding integer position evaluation unit 173 determines which block (next-point integer block SB1_min2) has the smallest difference from the current block next to the best integer block SB1_min in the vicinity of the best integer block SB1_min obtained by the integer search. The next point integer position (second integer position) is determined and determined (step S103). In the present embodiment, the next integer block SB1_min2 is specified from among the blocks adjacent in the eight directions around the best integer block SB1_min.

周囲整数位置評価部173は、最良整数位置判定部172から取得した最良整数ブロックSB1_minの位置情報に基づいて最良整数ブロックSB1_minを特定すると、その最良整数ブロックSB1_minの周囲8方向に隣接するブロックを含む範囲を規定するための、図5(a)に示すような「周囲ブロック探索範囲SA1’」を設定する。図5(b)に示すように、この周囲ブロック探索範囲SA1’は、最良整数ブロックSB1_minの基準点OP1_minの周囲8方向に隣接する3×3整数画素の範囲である。この場合、基準点OP1_minの周囲8方向に隣接する整数画素(整数位置)を整数画素A〜H(整数位置A〜H)とする。   When the best integer block SB1_min is identified based on the position information of the best integer block SB1_min acquired from the best integer position determination unit 172, the surrounding integer position evaluation unit 173 includes blocks adjacent in the eight directions around the best integer block SB1_min. A “surrounding block search range SA1 ′” as shown in FIG. 5A for defining the range is set. As shown in FIG. 5B, the surrounding block search range SA1 'is a range of 3 × 3 integer pixels adjacent in the eight directions around the reference point OP1_min of the best integer block SB1_min. In this case, integer pixels (integer positions) adjacent in the eight directions around the reference point OP1_min are set as integer pixels A to H (integer positions A to H).

周囲整数位置評価部173は、この周囲ブロック探索範囲SA1’内の各整数位置が基準点となる探索ブロックSB1を特定する。すなわち、これらの探索ブロックSB1は、図6(a)〜(h)に示すような、最良整数ブロックSB1_minの周囲8方向に隣接する探索ブロックSB1a〜SB1hである。   The surrounding integer position evaluation unit 173 specifies a search block SB1 in which each integer position in the surrounding block search range SA1 'is a reference point. That is, these search blocks SB1 are search blocks SB1a to SB1h adjacent to the best integer block SB1_min in the eight directions as shown in FIGS. 6 (a) to (h).

このような探索ブロックSB1a〜SB1hが整数探索範囲SA1内にある場合、ステップS101の整数探索において、これらのブロックの評価値が得られていることになる。したがって、周囲整数位置評価部173は、取得した探索ブロックSB1の評価値から探索ブロックSB1a〜SB1hの評価値を抽出し、この中で、最も差分が最小であるブロックがいずれであるかを特定する。   When such search blocks SB1a to SB1h are in the integer search range SA1, the evaluation values of these blocks are obtained in the integer search in step S101. Therefore, the surrounding integer position evaluation unit 173 extracts the evaluation values of the search blocks SB1a to SB1h from the acquired evaluation value of the search block SB1, and identifies which block has the smallest difference among them. .

ここで、最良整数ブロックSB1_minが、例えば、整数探索範囲SA1の最縁部などに位置していた場合には、探索ブロックSB1a〜SB1hの一部は、整数探索において演算されていない場合もある。このような場合は、周囲整数位置評価部173が該当するブロックの位置情報を整数探索部171に出力して指示することにより、随時必要な部分の整数探索を実施して、探索ブロックSB1a〜SB1hのすべての評価値を得るものとする。   Here, when the best integer block SB1_min is located at the edge of the integer search range SA1, for example, some of the search blocks SB1a to SB1h may not be calculated in the integer search. In such a case, the surrounding integer position evaluation unit 173 outputs the position information of the corresponding block to the integer search unit 171 and instructs the integer search unit 171 to perform an integer search of a necessary part at any time, and search blocks SB1a to SB1h All evaluation values of are obtained.

ここで、分数補間した画像での動きベクトル位置は、整数探索で求められた最良整数位置の近傍で2番目に小さい差分となる位置との相関が非常に高い。このため、ステップS102で特定した最良整数ブロックSB1_minの位置と、ステップS103で特定した次点整数ブロックSB1_min2の位置とに基づいて、分数探索で求める動きベクトル位置(分数位置)を暫定的に推定することができる。   Here, the motion vector position in the fractionally interpolated image has a very high correlation with the position having the second smallest difference in the vicinity of the best integer position obtained by the integer search. For this reason, based on the position of the best integer block SB1_min specified in step S102 and the position of the next integer block SB1_min2 specified in step S103, the motion vector position (fractional position) obtained by the fractional search is temporarily estimated. be able to.

すなわち、1/2pel演算部174は、ステップS102で特定した最良整数ブロックSB1_minと、ステップS103で特定した次点整数ブロックSB1_min2とに基づいて、1/2pel探索によって得られる分数位置を推定する(ステップS104)。すなわち、通常の探索動作では、探索中心の周囲8方向(もしくは4方向)について探索して分数位置を求めるが、ここでは、1回の演算によってこの分数位置が推定されることになる。推定された分数位置は、より高精度の分数探索(すなわち、1/4pel探索)の探索中心候補となる分数位置(以下、「暫定分数位置HP」とする)である。   That is, the 1/2 pel calculation unit 174 estimates the fractional position obtained by the 1/2 pel search based on the best integer block SB1_min identified in step S102 and the next integer block SB1_min2 identified in step S103 (step S104). That is, in a normal search operation, the search is performed in eight directions (or four directions) around the search center to obtain the fractional position. Here, the fractional position is estimated by one calculation. The estimated fractional position is a fractional position (hereinafter referred to as “provisional fractional position HP”) that is a search center candidate for a higher-accuracy fractional search (ie, 1 / 4pel search).

ここで、例えば、次点整数ブロックSB1_min2が探索ブロックSB1c(図6(c))である場合、図7(a)に示すように、最良整数ブロックSB1_minの基準点OP1_minと、次点整数ブロックSB1_min2の基準点、すなわち、周囲ブロック探索範囲SA1’の整数位置Cとの間の中間位置(1/2位置)を暫定分数位置HPとする。この場合、整数単位で現ブロックとの差分が最小のブロックが最良整数ブロックSB1_minであり、この最良整数ブロックSB1_minの近傍周囲において、最良整数ブロックSB1_minの次に差分が小さいブロック(次点整数ブロックSB1_min2)が探索ブロックSB1cということになる。   Here, for example, when the next integer block SB1_min2 is the search block SB1c (FIG. 6C), as shown in FIG. 7A, the reference point OP1_min of the best integer block SB1_min and the next integer block SB1_min2 , That is, the intermediate position (1/2 position) between the surrounding block search range SA1 ′ and the integer position C is defined as the provisional fraction position HP. In this case, the block having the smallest difference from the current block in integer units is the best integer block SB1_min, and the block having the next smallest difference next to the best integer block SB1_min (next-point integer block SB1_min2) around the best integer block SB1_min. ) Is the search block SB1c.

分数画素精度の動きベクトル(分数動きベクトル)は、このような次点整数ブロックとの相関が高い傾向にあるので、最良整数ブロックSB1_minに対する次点整数ブロックSB1_min2の位置に基づいて、実際の分数動きベクトルを推定することができる。図7(a)の場合、次点整数ブロックSB1_min2が探索ブロックSB1cであるので、最良整数ブロックSB1_minの基準点OP1_minと、探索ブロックSB1cの基準点との間の分数位置を示すベクトルを実際の分数動きベクトルと推定できる。   Since a motion vector with a fractional pixel accuracy (fractional motion vector) tends to be highly correlated with such a next integer block, the actual fractional motion is based on the position of the next integer block SB1_min2 with respect to the best integer block SB1_min. A vector can be estimated. In the case of FIG. 7A, since the next integer block SB1_min2 is the search block SB1c, a vector indicating the fractional position between the reference point OP1_min of the best integer block SB1_min and the reference point of the search block SB1c is an actual fraction. It can be estimated as a motion vector.

暫定分数位置HPを特定すると、図7(b)に示すような、この暫定分数位置HPが基準点(以下、「基準点OP2」とする)となるブロック(以下、「暫定分数ブロックSB2」とする)を規定する。この暫定分数ブロックSB2のブロックサイズは、探索ブロックサイズと同一である。1/2pel演算部174は、暫定分数ブロックSB2の範囲に含まれる画素に対し、例えば、「6tap FIR」などの補間手法により、各整数画素間の中間位置(1/2位置)での画素値が得られるよう1/2画素補間を行い(図8(a)参照)、現ブロックとの差分演算(1/2pel演算)をおこなう(ステップS105)。   When the provisional fraction position HP is specified, as shown in FIG. 7B, the provisional fraction position HP becomes a reference point (hereinafter referred to as “reference point OP2”) (hereinafter referred to as “provisional fraction block SB2”). Stipulate). The block size of the provisional fractional block SB2 is the same as the search block size. The 1 / 2pel calculation unit 174 performs pixel values at intermediate positions (1/2 positions) between the integer pixels by using an interpolation method such as “6tap FIR” for the pixels included in the range of the provisional fractional block SB2. ½ pixel interpolation is performed (see FIG. 8A), and a difference calculation with the current block (1/2 pel calculation) is performed (step S105).

すなわち、1/2pel演算部174は、暫定分数ブロックSB2の画素値を参照フレームから求め、現ブロックCBの画素値との差分を、例えば、差分絶対値和演算により求める。1/2pel演算部174は、求めた差分値を、暫定分数ブロックSB2の評価値として探索中心判定部175に出力する。   In other words, the 1 / 2pel calculation unit 174 calculates the pixel value of the provisional fractional block SB2 from the reference frame, and calculates the difference from the pixel value of the current block CB by, for example, the difference absolute value sum calculation. The 1 / 2pel calculation unit 174 outputs the obtained difference value to the search center determination unit 175 as the evaluation value of the provisional fractional block SB2.

探索中心判定部175は、1/2pel演算部174から暫定分数ブロックSB2の評価値を取得するとともに、最良整数位置判定部172から最良整数ブロックSB1_minの評価値を取得する。そして、暫定分数ブロックSB2の評価値と最良整数ブロックSB1_minの評価値とを比較し、いずれのブロックがより良好な評価値であるか、すなわち、より差分の小さい評価値となったブロックがいずれであるかを判定する。すなわち、暫定分数位置HPに基づく暫定分数ブロックSB2と、最良整数ブロックSB1_minの内、より小さい差分値を示しているブロックがいずれであるかを判定する(ステップS106)。   The search center determination unit 175 acquires the evaluation value of the provisional fractional block SB2 from the 1 / 2pel calculation unit 174 and also acquires the evaluation value of the best integer block SB1_min from the best integer position determination unit 172. Then, the evaluation value of the provisional fractional block SB2 and the evaluation value of the best integer block SB1_min are compared, and which block has a better evaluation value, that is, which block has a smaller evaluation value. Determine if there is. That is, it is determined which of the provisional fraction block SB2 based on the provisional fraction position HP and the block showing the smaller difference value is the best integer block SB1_min (step S106).

探索中心判定部175は、この判定結果に応じて、次に実行する1/4画素単位の分数探索(1/4pel探索)の探索中心とすべき位置を判定する。すなわち、暫定分数ブロックSB2の差分値の方が小さい場合(ステップS106:Yes)、探索中心判定部175は、1/4pel探索の探索中心を暫定分数ブロックSB2とする(ステップS107)。   The search center determination unit 175 determines a position to be used as the search center of a fractional search (1/4 pel search) to be executed next in 1/4 pixel units according to the determination result. That is, when the difference value of the provisional fraction block SB2 is smaller (step S106: Yes), the search center determination unit 175 sets the search center of the 1/4 pel search as the provisional fraction block SB2 (step S107).

一方、最良整数ブロックSB1_minの差分値の方が小さい場合(ステップS106:No)、探索中心判定部175は、分数探索の探索中心を最良整数ブロックSB1_minとする(ステップS108)。   On the other hand, when the difference value of the best integer block SB1_min is smaller (step S106: No), the search center determination unit 175 sets the search center for fractional search as the best integer block SB1_min (step S108).

探索中心判定部175は、1/4pel探索の探索中心とした位置を示す位置情報を1/4pel演算部176に出力する。ここでは、暫定分数ブロックSB2が探索中心に指定された場合、暫定分数ブロックSB2の基準点OP2の座標を示す情報を位置情報として出力し、最良整数ブロックSB1_minが探索中心に指定された場合は、最良整数ブロックSB1_minの基準点OP1_minの座標を示す情報を位置情報として出力する。   The search center determination unit 175 outputs position information indicating the position as the search center of the 1/4 pel search to the 1/4 pel calculation unit 176. Here, when the provisional fraction block SB2 is designated as the search center, information indicating the coordinates of the reference point OP2 of the provisional fraction block SB2 is output as position information, and when the best integer block SB1_min is designated as the search center, Information indicating the coordinates of the reference point OP1_min of the best integer block SB1_min is output as position information.

1/4pel演算部176は、探索中心判定部175が判定した探索中心位置を示す位置情報に基づいて、1/4画素単位の分数探索(1/4pel探索)を実行する(ステップS109)。ここでは、探索中心判定部175が出力した位置情報が示す位置を探索中心とする探索範囲(以下、「探索範囲SA2」とする)を規定し、この探索範囲SA2内で、探索ブロックサイズ相当のブロック(以下、「探索ブロックSB3」とする)を1/4画素ずつずらしながら、各ブロックの画素値と、現ブロックCBの画素値との差分を演算する。   The 1/4 pel calculation unit 176 performs a fractional search (1/4 pel search) in units of 1/4 pixels based on the position information indicating the search center position determined by the search center determination unit 175 (step S109). Here, a search range whose search center is the position indicated by the position information output by the search center determination unit 175 (hereinafter referred to as “search range SA2”) is defined, and the search block size corresponding to the search block size is defined within this search range SA2. While shifting a block (hereinafter referred to as “search block SB3”) by ¼ pixel, the difference between the pixel value of each block and the pixel value of the current block CB is calculated.

1/4画素単位の分数探索を実行するにあたり、1/4pel演算部176は、少なくとも、探索ブロックSB3が探索範囲SA2にしたがって移動する範囲に対して1/4画素補間をおこなう。この場合、図8(a)に示すような1/2画素補間されている画素に対し、例えば、「線形補間」などの補間手法により、図8(b)に示すような、各1/2位置間の中間位置(1/4位置)での画素値が得られるよう補間する。   In performing the fractional search in units of 1/4 pixel, the 1 / 4pel calculation unit 176 performs 1/4 pixel interpolation on at least the range in which the search block SB3 moves according to the search range SA2. In this case, for each of the pixels subjected to ½ pixel interpolation as shown in FIG. 8A, for example, by using an interpolation method such as “linear interpolation”, each ½ as shown in FIG. Interpolation is performed so that a pixel value at an intermediate position (1/4 position) between the positions is obtained.

ステップS107で、暫定分数位置HPが分数探索の探索中心とされた場合の分数探索の動作を以下説明する。図9(a)は、1/4画素補間された暫定分数ブロックSB2を示す図である。1/4pel演算部176は、このような暫定分数ブロックSB2上で、1/4pel探索の探索範囲を規定する。この場合、1/4pel演算部176は、例えば、図9(b)に示すように、暫定分数ブロックSB2の基準点OP2を中心として、その周囲8方向に隣接する1/4位置を含む範囲を探索範囲SA2とする。   The operation of the fraction search when the provisional fraction position HP is set as the search center of the fraction search in step S107 will be described below. FIG. 9A is a diagram illustrating the provisional fractional block SB <b> 2 interpolated by ¼ pixel. The 1/4 pel calculation unit 176 defines a search range for 1/4 pel search on such a provisional fractional block SB2. In this case, for example, as shown in FIG. 9B, the 1 / 4pel calculation unit 176 has a range including 1/4 positions adjacent to each other in eight directions around the reference point OP2 of the provisional fractional block SB2. The search range is SA2.

1/4pel演算部176は、このような探索範囲SA2内の各分数位置が基準点(すなわち、ブロック左上頂部位置)となるブロックを1/4pel探索の探索ブロックSB3として順次指定し、各探索ブロックSB3の画素値と、現ブロックCBの画素値との差分演算(1/4pel演算)をおこなう。ここでは、図10(a)に示すような暫定分数ブロックSB2を起点として1/4pel探索をおこなう。   The 1 / 4pel calculation unit 176 sequentially designates blocks in which each fractional position in the search range SA2 is a reference point (that is, the top left position of the block) as a search block SB3 for 1 / 4pel search. Difference calculation (1/4 pel calculation) between the pixel value of SB3 and the pixel value of the current block CB is performed. Here, a 1/4 pel search is performed starting from the provisional fractional block SB2 as shown in FIG.

すなわち、1/4pel演算部176は、図10(b)に示すように、暫定分数ブロックSB2の基準点OP2から1分数画素分(1/4画素分)ずらした位置を、1/4pel探索でのマッチング対象となる探索ブロックSB3の基準点OP3とし、この基準点OP3がブロックの左上頂部位置となる探索ブロックSB3を指定する。探索ブロックSB3のブロックサイズは、探索ブロックサイズ相当である。 That is, as shown in FIG. 10B, the 1 / 4pel calculation unit 176 performs a 1 / 4pel search for a position shifted by one fractional pixel (one quarter pixel) from the reference point OP2 of the provisional fractional block SB2. of a reference point OP3 1 search block SB3 1 as a matching target, the reference point OP3 1 specifies the search block SB3 1 as the upper left apex position of the block. The block size of the search block SB3 is equivalent to the search block size.

1/4pel演算部176は、探索ブロックSB3について、現ブロックCBとの差分演算をおこなう。すなわち、参照フレームから探索ブロックSB3の画素値を取得し、現ブロックCBの画素値との差分をとる。この場合、1/4pel演算部176は、例えば、差分絶対値和演算により差分値を求め、求めた差分値を探索ブロックSB3の評価値とする。 1 / pel operation unit 176, the search block SB3 1, performs difference calculation between the current block CB. That is, to get the pixel values of the search block SB3 1 from the reference frame, calculating a difference between the pixel value of the current block CB. In this case, the 1 / pel operation unit 176, for example, obtains a difference value by the difference absolute value sum calculation, a difference value obtained as the evaluation value of the search block SB3 1.

探索ブロックSB31についての評価値を取得すると、基準点OP3を1分数画素分ずらした位置を次の基準点OP3とし、探索ブロックSB3の場合と同様に探索ブロックSB3について差分演算をおこなう。このようにして、1/4pel演算部176は、暫定分数ブロックSB2の基準点OP2を起点として、探索範囲SA2内の各分数位置が基準点となる探索ブロックSB3〜SB3を順次指定し、各探索ブロックSB3毎に現ブロックCBとのマッチングをとる。この場合、例えば、図10(c)の矢印で示す順序で探索ブロックSB3〜SB3を順次指定する。 When the evaluation value for the search block SB31 is acquired, the position obtained by shifting the reference point OP3 1 by one fractional pixel is set as the next reference point OP3 2, and the difference calculation is performed on the search block SB3 2 as in the case of the search block SB3 1. . In this way, the 1 / 4pel calculation unit 176 sequentially specifies the search blocks SB3 1 to SB3 8 in which each fractional position in the search range SA2 is a reference point, starting from the reference point OP2 of the provisional fractional block SB2. Each search block SB3 is matched with the current block CB. In this case, for example, the search blocks SB3 1 to SB3 8 are sequentially specified in the order indicated by the arrows in FIG.

1/4pel演算部176は、求めた探索ブロックSB3〜SB3の評価値の内、最も良好な評価値、すなわち、差分値が最小であったブロック(以下、「探索ブロックSB3_min」とする)がいずれであるかを判別し、その探索ブロックSB3_minの位置を示す位置情報をベクトル算出部177に出力する。この場合、例えば、当該探索ブロックSB3_minの基準点OP3_minの座標を示す情報を位置情報として出力する。 The 1 / 4pel calculation unit 176 has the best evaluation value among the obtained evaluation values of the search blocks SB3 1 to SB3 8 , that is, the block having the smallest difference value (hereinafter referred to as “search block SB3_min”). And position information indicating the position of the search block SB3_min is output to the vector calculation unit 177. In this case, for example, information indicating the coordinates of the reference point OP3_min of the search block SB3_min is output as position information.

以上が、暫定分数位置HPに基づく暫定分数ブロックSB2の評価が最良整数ブロックSB1_minよりも良好であった場合の1/4pel探索である。   The above is the 1/4 pel search when the evaluation of the provisional fraction block SB2 based on the provisional fraction position HP is better than the best integer block SB1_min.

一方、暫定分数ブロックSB2よりも最良整数ブロックSB1_minの評価が良好であった場合は、最良整数ブロックSB1_minを探索中心として1/4pel探索をおこなう。この場合の動作を以下説明する。   On the other hand, if the evaluation of the best integer block SB1_min is better than that of the provisional fractional block SB2, a 1/4 pel search is performed with the best integer block SB1_min as the search center. The operation in this case will be described below.

図11(a)は、1/4画素補間された最良整数ブロックSB1_minを示す図である。1/4pel演算部176は、このような最良整数ブロックSB1_min上で、1/4pel探索の探索範囲を規定する。この場合、図11(b)に示すように、最良整数ブロックSB1_minの基準点OP1_minの周囲8方向に隣接する1/4位置を含む範囲を探索範囲SA2とする。   FIG. 11A is a diagram illustrating the best integer block SB1_min subjected to 1/4 pixel interpolation. The 1 / 4pel calculation unit 176 defines a search range for 1 / 4pel search on the best integer block SB1_min. In this case, as shown in FIG. 11B, a range including quarter positions adjacent in the eight directions around the reference point OP1_min of the best integer block SB1_min is set as a search range SA2.

1/4pel演算部176は、このように規定した探索範囲SA2内の各分数位置が基準点OP3となる探索ブロックSB3を順次指定し、各探索ブロックSB3と現ブロックCBとの差分を演算する。この動作は、上述した暫定分数ブロックSB2を探索中心とした場合の探索動作と同様である(図10参照)。   The 1 / 4pel calculation unit 176 sequentially specifies the search block SB3 in which each fractional position in the search range SA2 thus defined is the reference point OP3, and calculates the difference between each search block SB3 and the current block CB. This operation is the same as the search operation when the provisional fractional block SB2 is used as the search center (see FIG. 10).

すなわち、1/4pel演算部176は、探索ブロックSB3〜SB3の評価値を求め、この内、最も良好な評価値、すなわち、差分値が最小である探索ブロックSB3_minがいずれであるかを判別し、その探索ブロックSB3_minの位置を示す位置情報をベクトル算出部177に出力する。この場合、例えば、当該探索ブロックSB3_minの基準点OP3_minの座標を示す情報を位置情報として出力する。 That is, the 1 / 4pel calculation unit 176 obtains the evaluation values of the search blocks SB3 1 to SB3 8 and determines which one of the search values SB3_min is the best evaluation value, that is, the difference value is the smallest. The position information indicating the position of the search block SB3_min is output to the vector calculation unit 177. In this case, for example, information indicating the coordinates of the reference point OP3_min of the search block SB3_min is output as position information.

ベクトル算出部177は、整数探索で求められた整数位置と、分数探索で求められた分数位置とに基づいて、現ブロックCBについての「動きベクトル」を算出する(ステップS110)。すなわち、現ブロックCBに対応する探索ブロックSB1_INTと、分数探索で現ブロックCBとの差分が最小とされた探索ブロックSB3_minとのずれを示すベクトルが、当該ブロックにおける「動きベクトル」ということになる。したがって、ベクトル算出部177は、整数探索部171から取得した探索ブロックSB1_INTの基準点OP1_INTの座標を示す位置情報と、1/4pel演算部176から取得した探索ブロックSB3_minの基準点OP3_minの座標を示す位置情報とに基づいて「動きベクトル」を算出する。すなわち、基準点OP1_INTを原点として、基準点OP3_minに対するずれ量と方向を示すベクトルを「動きベクトル」として算出する。   The vector calculation unit 177 calculates a “motion vector” for the current block CB based on the integer position obtained by the integer search and the fraction position obtained by the fraction search (step S110). That is, the vector indicating the difference between the search block SB1_INT corresponding to the current block CB and the search block SB3_min in which the difference between the current block CB and the fractional search is minimized is the “motion vector” in the block. Accordingly, the vector calculation unit 177 indicates position information indicating the coordinates of the reference point OP1_INT of the search block SB1_INT acquired from the integer search unit 171 and the coordinates of the reference point OP3_min of the search block SB3_min acquired from the 1 / 4pel calculation unit 176. Based on the position information, a “motion vector” is calculated. That is, a vector indicating a deviation amount and direction with respect to the reference point OP3_min is calculated as a “motion vector” with the reference point OP1_INT as the origin.

なお、ベクトル算出部177は、動き補償にかかる処理に応じて、整数単位の動きベクトル(整数動きベクトル)と分数単位の動きベクトル(分数動きベクトル)とを個別に求めてもよい。ここで、「整数動きベクトル」は、探索ブロックSB1_INTと最良整数ブロックSB1_minとのずれを示すベクトルであるので、ベクトル算出部177は、探索ブロックSB1_INTの基準点OP1_INTの位置と、最良整数ブロックSB1_minの基準点OP1_minの位置に基づいて「整数動きベクトル」を算出することができる。また、「分数動きベクトル」は、最良整数ブロックSB1_minと探索ブロックSB3_minとのずれを示すベクトルであるので、ベクトル算出部177は、最良整数ブロックSB1_minの基準点OP1_minの位置と、探索ブロックSB3_minの基準点OP3_minの位置とに基づいて「分数動きベクトル」を算出することができる。   Note that the vector calculation unit 177 may individually obtain an integer unit motion vector (integer motion vector) and a fractional unit motion vector (fractional motion vector) in accordance with the processing related to motion compensation. Here, since the “integer motion vector” is a vector indicating a deviation between the search block SB1_INT and the best integer block SB1_min, the vector calculation unit 177 determines the position of the reference point OP1_INT of the search block SB1_INT and the best integer block SB1_min. An “integer motion vector” can be calculated based on the position of the reference point OP1_min. Further, since the “fractional motion vector” is a vector indicating a deviation between the best integer block SB1_min and the search block SB3_min, the vector calculation unit 177 determines the position of the reference point OP1_min of the best integer block SB1_min and the reference of the search block SB3_min. A “fractional motion vector” can be calculated based on the position of the point OP3_min.

ベクトル算出部177は、このようにして求めた「動きベクトル」を動き補償部180に出力して処理を終了する。動き補償部180では、動き検出部170から出力された動きベクトルに基づいて動き補償し、予測フレームが作成される。そして、予測フレームと現フレームとの差分のみが符号化部130で符号化されて、符号化ビットストリームとして出力される。   The vector calculation unit 177 outputs the “motion vector” obtained in this way to the motion compensation unit 180 and ends the process. The motion compensation unit 180 performs motion compensation based on the motion vector output from the motion detection unit 170 and creates a prediction frame. Then, only the difference between the predicted frame and the current frame is encoded by the encoding unit 130 and output as an encoded bit stream.

以上説明したように、上記実施形態1にかかる動き検出部170によれば、整数探索で検出された最良整数ブロックSB1_minの位置(第1の整数位置)と、その周辺において、最良整数ブロックSB1_minの次に評価のよい次点整数ブロックSB1_min2の位置(第2の整数位置)とに基づいて、1/2pel探索で求められる分数位置を推定する。すなわち、分数探索で得られる実際の分数動きベクトルは、整数単位での最良位置の周辺で次に評価の良好な整数位置の方向と相関が高い傾向にあるため、最良整数位置と次点整数位置との間の1/2位置を、1/2pel探索で求められる分数位置と推定する(暫定分数位置)。これにより、1/2pel探索でおこなう差分演算を、暫定分数位置についてのみ行うので、8方向分の差分演算をおこなう場合に比べ、演算量を減少させることができる。   As described above, according to the motion detection unit 170 according to the first embodiment, the position of the best integer block SB1_min (first integer position) detected by the integer search and the periphery of the best integer block SB1_min Next, the fractional position obtained by the 1/2 pel search is estimated based on the position (second integer position) of the next-point integer block SB1_min2 with good evaluation. That is, the actual fractional motion vector obtained by the fractional search tends to be highly correlated with the direction of the next best evaluated integer position around the best position in integer units. The 1/2 position between and is estimated as the fractional position obtained by the 1 / 2pel search (provisional fractional position). Thereby, since the difference calculation performed by a 1 / 2pel search is performed only about a provisional fraction position, the amount of calculation can be reduced compared with the case where the difference calculation for eight directions is performed.

ここで、上記実施形態1によれば、次点整数ブロックSB1_min2を最良整数ブロックSB1_minの周辺に隣接するブロックから求めている。これにより、整数探索の探索範囲内でブロック単位に最良整数位置と次点整数位置を求める従来技術で生じうる問題を回避することができる。   Here, according to the first embodiment, the next-point integer block SB1_min2 is obtained from blocks adjacent to the periphery of the best integer block SB1_min. As a result, it is possible to avoid a problem that may occur in the conventional technique for obtaining the best integer position and the next integer position for each block within the search range of the integer search.

すなわち、探索範囲内で最良位置と次点位置をブロック単位に決定した場合、最良整数位置を含むブロックから離れたブロックが次点となる可能性がある。ここで、求めるべき分数動きベクトルは、最良整数位置と実際の最良位置との間の分数レベルの誤差を示すものであるから、最良整数位置の近傍にない次点整数位置に基づいて分数探索の探索中心を決定しても、実際の分数動きベクトルとは相関しない可能性がある。したがって、上記実施形態1の如く、最良整数ブロックSB1_minの周囲8方向に隣接するブロックの中から次点整数ブロックSB1_min2を決定することで、迅速かつ正確に分数単位の動きベクトルを検出することができる。   That is, when the best position and the next point position are determined in block units within the search range, a block far from the block including the best integer position may be the next point. Here, since the fractional motion vector to be obtained indicates a fractional level error between the best integer position and the actual best position, the fractional search vector based on the next integer position that is not in the vicinity of the best integer position is used. Even if the search center is determined, it may not be correlated with the actual fractional motion vector. Therefore, by determining the next integer block SB1_min2 from the blocks adjacent in the eight directions around the best integer block SB1_min as in the first embodiment, it is possible to detect the motion vector in fractional units quickly and accurately. .

(実施形態2)
上述したように、分数探索で検出される分数動きベクトルは、整数探索で検出された最良整数ブロックの近傍の次点整数ブロックとの相関が高い傾向にあるため、上記実施形態1では、このような傾向に基づいて暫定分数位置を求めた。しかしながら、種々の条件等によっては、最良整数ブロックの近傍周囲における次点整数ブロックであっても実際の分数動きベクトルと相関が高くない場合もあり得る。このような場合においても、正確かつ迅速に分数動きベクトルを検出する動き検出部170の動作を実施形態2として以下説明する。なお、本実施形態にかかる動き検出部170の構成は、実施形態1の動き検出部170の構成と同一である。また、ブロックなどに関する表記についても実施形態1と同様である。したがって、実施形態1と同一または同様の構成等については、同一の参照符号を付して説明する。
(Embodiment 2)
As described above, the fractional motion vector detected by the fractional search tends to have a high correlation with the next integer block near the best integer block detected by the integer search. Tentative fractional positions were determined based on various trends. However, depending on various conditions, even the next integer block around the best integer block may not be highly correlated with the actual fractional motion vector. Even in such a case, the operation of the motion detection unit 170 that detects a fractional motion vector accurately and quickly will be described below as a second embodiment. Note that the configuration of the motion detection unit 170 according to the present embodiment is the same as the configuration of the motion detection unit 170 of the first embodiment. In addition, the notation relating to the block and the like is the same as in the first embodiment. Therefore, the same or similar configurations as in the first embodiment will be described with the same reference numerals.

本実施形態にかかる動き検出部170の動作(「動きベクトル検出処理2」)を図12、13に示すフローチャートを参照して説明する。この「動きベクトル検出処理2」は、実施形態1にかかる「動きベクトル検出処理1」と同様に、動き検出部170に現フレームが入力されたことを契機に開始される。   The operation of the motion detection unit 170 according to the present embodiment (“motion vector detection process 2”) will be described with reference to the flowcharts shown in FIGS. This “motion vector detection process 2” is started when the current frame is input to the motion detection unit 170, similarly to the “motion vector detection process 1” according to the first embodiment.

処理が開始されると、整数探索部171により「整数探索」が実行される(ステップS201)。ここでの整数探索は、上記実施形態1と同様の動作である。すなわち、整数探索部171が、探索ブロックSB1_INTの基準点OP1_INTを中心とした所定の探索範囲SA1を設定し、探索ブロックSB1を1整数画素分ずつずらしながら現ブロックCBとの差分を求め、各位置での評価値として最良整数位置判定部172と探索中心判定部175に出力する。そして、評価値に基づいて、最良整数位置判定部172が、現ブロックCBとの差分が最小となる最良整数ブロックSB1_min(第1の整数位置)を特定する。   When the processing is started, “integer search” is executed by the integer search unit 171 (step S201). The integer search here is the same operation as in the first embodiment. That is, the integer search unit 171 sets a predetermined search range SA1 centered on the reference point OP1_INT of the search block SB1_INT, obtains a difference from the current block CB while shifting the search block SB1 by one integer pixel, Is output to the best integer position determination unit 172 and the search center determination unit 175 as the evaluation value. Based on the evaluation value, the best integer position determination unit 172 identifies the best integer block SB1_min (first integer position) that minimizes the difference from the current block CB.

最良整数ブロックSB1_minが特定されると、周囲整数位置評価部173は、上記実施形態1の場合と同様に、最良整数ブロックSB1_minの周囲8方向に隣接する探索ブロックSB1a〜SB1hを特定し、これら8つの探索ブロックSB1についての評価値を得る。   When the best integer block SB1_min is specified, the surrounding integer position evaluation unit 173 specifies search blocks SB1a to SB1h adjacent in the eight directions around the best integer block SB1_min as in the case of the first embodiment. Evaluation values for two search blocks SB1 are obtained.

ここで、周囲整数位置評価部173は、得られた評価値に基づいて、評価のよい順、すなわち、差分値の小さい順に探索ブロックSB1a〜SB1hを順位付けする(ステップS202)。この場合、例えば、周囲整数位置評価部173は所定の記憶領域を有しているものとし、各ブロックの位置(例えば、基準点の座標)を示す情報と順位とを対応付けて記憶するものとする。なお、この記憶領域は、周囲整数位置評価部173以外の部分に構成されていてもよい。   Here, the surrounding integer position evaluation unit 173 ranks the search blocks SB1a to SB1h based on the obtained evaluation values in the order of good evaluation, that is, in ascending order of the difference values (step S202). In this case, for example, the surrounding integer position evaluation unit 173 has a predetermined storage area, and stores information indicating the position of each block (for example, the coordinates of the reference point) and the rank in association with each other. To do. This storage area may be configured in a portion other than the surrounding integer position evaluation unit 173.

周囲整数位置評価部173は、対象とする順位を指定する順位ポインタを「1位」を示す初期値「1」に設定し(ステップS203)、順位ポインタが示す順位の探索ブロックSB1の基準点OP1(第2の整数位置)と、最良整数ブロックSB1_minの基準点OP1_minとの間の1/2位置を暫定分数位置HPとして特定する(ステップS204)。   The surrounding integer position evaluation unit 173 sets a rank pointer for designating the target rank to an initial value “1” indicating “first rank” (step S203), and the reference point OP1 of the search block SB1 with the rank indicated by the rank pointer A half position between the (second integer position) and the reference point OP1_min of the best integer block SB1_min is specified as the provisional fraction position HP (step S204).

1/2pel演算部174は、上記実施形態1と同様の動作により、特定した暫定分数位置HPに基づく暫定分数ブロックSB2の画素値と、現ブロックCBの画素値との差分を演算し、評価値として探索中心判定部175に出力する(ステップS205)。   The 1 / 2pel calculation unit 174 calculates the difference between the pixel value of the provisional fractional block SB2 based on the specified provisional fraction position HP and the pixel value of the current block CB by the same operation as in the first embodiment, and evaluates the evaluation value. Is output to the search center determination unit 175 (step S205).

探索中心判定部175は、最良整数ブロックSB1_minの評価値と、暫定分数ブロックSB2の評価値とを比較し、暫定分数ブロックSB2の評価値の方が良好であるか否か、すなわち、最良整数ブロックSB1_minと現ブロックCBの差分値より、暫定分数ブロックSB2と現ブロックCBの差分値の方が小さいか否かを判別する(ステップS206)。   The search center determining unit 175 compares the evaluation value of the best integer block SB1_min with the evaluation value of the provisional fractional block SB2, and determines whether the evaluation value of the provisional fractional block SB2 is better, that is, the best integer block It is determined whether or not the difference value between the provisional fractional block SB2 and the current block CB is smaller than the difference value between the SB1_min and the current block CB (step S206).

暫定分数ブロックSB2の評価の方が良好であった場合(ステップS206:Yes)、探索中心判定部175は、暫定分数ブロックSB2を1/4pel探索の探索中心とする(ステップS207)。この場合、上記実施形態1と同様の動作により、1/4pel探索が実行され(ステップS208)、現ブロックとの差分が最小である探索ブロックSB3_minが特定される。そして、探索ベクトル算出部177が、特定された探索ブロックSB3_minに基づいて、現ブロックについての「動きベクトル」を算出し、動き補償部180に出力して(ステップS209)、処理を終了する。   When the evaluation of the provisional fraction block SB2 is better (step S206: Yes), the search center determination unit 175 sets the provisional fraction block SB2 as the search center of the 1/4 pel search (step S207). In this case, a 1/4 pel search is executed by the same operation as in the first embodiment (step S208), and the search block SB3_min having the smallest difference from the current block is specified. Then, the search vector calculation unit 177 calculates a “motion vector” for the current block based on the specified search block SB3_min, outputs it to the motion compensation unit 180 (step S209), and ends the process.

一方、暫定分数ブロックSB2の評価値より、最良整数ブロックSB1_minの評価値の方が良好である場合(ステップS206:No)、周囲整数位置評価部173は、順位ポインタが現在指定している順位よりも下位のブロックがまだあるか否かを判別する(ステップS210:図13)。   On the other hand, when the evaluation value of the best integer block SB1_min is better than the evaluation value of the provisional fractional block SB2 (step S206: No), the surrounding integer position evaluation unit 173 determines the rank from the rank currently designated by the rank pointer. It is determined whether there are still lower blocks (step S210: FIG. 13).

現在の順位より下位のブロックが存在する場合(ステップS210:Yes)、周囲整数位置評価部173は、順位ポインタを+1し(ステップS211)、ステップS204(図12)に進む。すなわち、次の順位の探索ブロックSB1を新たな次点整数ブロックSB1_min2(第2の整数位置)とし、このブロックの基準点OP1と、最良整数ブロックSB1_minの基準点OP1_minとの間の1/2位置を新たな暫定分数位置HPとする。そして、新たに指定した暫定分数位置HPに基づく暫定分数ブロックSB2の評価値と最良整数ブロックSB1_minの評価値とが比較される(ステップS204〜206)。   When a block lower than the current rank exists (step S210: Yes), the surrounding integer position evaluation unit 173 increments the rank pointer by 1 (step S211), and proceeds to step S204 (FIG. 12). That is, the search block SB1 of the next rank is set as a new next-point integer block SB1_min2 (second integer position), and a 1/2 position between the reference point OP1 of this block and the reference point OP1_min of the best integer block SB1_min. Is a new provisional fractional position HP. Then, the evaluation value of the provisional fraction block SB2 based on the newly designated provisional fraction position HP is compared with the evaluation value of the best integer block SB1_min (steps S204 to 206).

一方、現在の順位より下位のブロックが存在しない場合、すなわち、現在の順位ポインタが「8位」を示す「8」を指示している場合(ステップS210:No)、周囲整数位置評価部173は、その旨を示す情報を探索中心判定部175に出力する。この場合、探索中心判定部175は、最良整数ブロックSB1_minを、1/4pel探索の探索中心に設定し(ステップS220)、ステップS208(図12)に進む。   On the other hand, when there is no block lower than the current rank, that is, when the current rank pointer indicates “8” indicating “8th place” (step S210: No), the surrounding integer position evaluation unit 173 , Information indicating that is output to search center determination section 175. In this case, the search center determination unit 175 sets the best integer block SB1_min as the search center of the 1/4 pel search (step S220), and proceeds to step S208 (FIG. 12).

この場合、上記実施形態1と同様の動作により、最良整数ブロックSB1_minを探索中心とした1/4pel探索をおこない、差分が最小となる探索ブロックSB3_minに基づき、ベクトル算出部177が動きベクトルを算出して動き補償部180に出力する。   In this case, by the same operation as in the first embodiment, a 1/4 pel search is performed with the best integer block SB1_min as the search center, and the vector calculation unit 177 calculates a motion vector based on the search block SB3_min with the smallest difference. To the motion compensation unit 180.

すなわち、本発明の実施形態2にかかる動き検出部170では、最良整数ブロックSB1_minの周囲に隣接する探索ブロックSB1a〜SBhを、それぞれの評価値(現ブロックとの差分値)に基づいて順位付けし、順位の高いブロックから暫定分数位置HPを求める。そして、求めた暫定分数位置HPに基づく暫定分数ブロックSB2の評価値と最良整数ブロックSB1_minの評価値とを比較し、暫定分数ブロックSB2の評価値の方が良好であれば、当該暫定分数位置HPを1/4pel探索の探索中心にする。   In other words, in the motion detection unit 170 according to the second embodiment of the present invention, the search blocks SB1a to SBh adjacent to the periphery of the best integer block SB1_min are ranked based on the respective evaluation values (difference values from the current block). The provisional fractional position HP is obtained from the block having a higher rank. Then, the evaluation value of the provisional fraction block SB2 based on the calculated provisional fraction position HP is compared with the evaluation value of the best integer block SB1_min, and if the evaluation value of the provisional fraction block SB2 is better, the provisional fraction position HP To the search center of 1 / 4pel search.

一方、当該暫定分数ブロックSB2よりも最良整数ブロックSB1_minの評価の方が良好である場合は、次の順位の探索ブロックSB1に基づいて暫定分数位置HPを決定し、同様に、最良整数ブロックSB1_minと比較する。このようにして、探索ブロックSB1a〜SB1hの順位順に決定された暫定分数位置HPに基づく暫定分数ブロックSB2の方が最良整数ブロックSB1_minより評価がよい場合は、その暫定分数ブロックSB2を探索中心として、1/4pel探索をおこなう。   On the other hand, if the evaluation of the best integer block SB1_min is better than that of the provisional fraction block SB2, the provisional fraction position HP is determined based on the search block SB1 of the next rank. Similarly, the best integer block SB1_min Compare. In this way, when the provisional fraction block SB2 based on the provisional fraction position HP determined in order of the search blocks SB1a to SB1h is better evaluated than the best integer block SB1_min, the provisional fraction block SB2 is used as a search center. Perform a 1 / 4pel search.

また、探索ブロックSB1a〜SB1hに基づく暫定分数ブロックSB2のいずれもが、最良整数ブロックSB_minよりも評価が良好でない場合は、最良整数ブロックSB1_minを探索中心として1/4pel探索をおこなう。   If any of the provisional fractional blocks SB2 based on the search blocks SB1a to SB1h is not evaluated better than the best integer block SB_min, a 1/4 pel search is performed with the best integer block SB1_min as the search center.

このように、本発明の実施形態2にかかる動き検出部170では、最良整数ブロックSB_min(最良整数位置)の近傍で次に差分の小さいブロック(次点整数位置)に基づいた暫定分数ブロックSB2の評価が、最良整数ブロックSB1_minより良好でない場合、最良整数位置の近傍周囲で次点整数位置の次の順位の位置、すなわち、次点整数位置の次に現ブロックとの差分が小さいブロックに基づいて暫定分数位置HPを求める。このため、種々の条件等により、次点整数ブロックと実際の分数動きベクトルとの相関が高くなかった場合であっても、実際の分数動きベクトルとの相関が高い暫定分数位置を求めて分数探索することができる。   As described above, in the motion detection unit 170 according to the second embodiment of the present invention, the provisional fractional block SB2 based on the block with the next smallest difference (next integer position) in the vicinity of the best integer block SB_min (best integer position). If the evaluation is not better than the best integer block SB1_min, it is based on the position of the next rank of the next integer position around the best integer position, that is, the block having the smallest difference from the current block next to the next integer position. The provisional fractional position HP is obtained. For this reason, even if the correlation between the next integer block and the actual fractional motion vector is not high due to various conditions, etc., a fractional search is performed by finding a provisional fractional position that has a high correlation with the actual fractional motion vector. can do.

この場合、暫定分数位置を求めるための演算を、最良整数ブロックSB1_minに隣接する探索ブロックSB1a〜hの内の順位の高い方からおこなうので、より良好な評価値が得られた時点で1/2画素補間演算や評価値演算を終了させることができる。したがって、次点整数位置と実際の分数動きベクトルとの相関が高くなかった場合でも、暫定分数位置となる1/2位置を効率的に求めることができる。   In this case, the calculation for obtaining the provisional fractional position is performed from the search block SB1a-h adjacent to the best integer block SB1_min in the higher order, and therefore, 1/2 when the better evaluation value is obtained. Pixel interpolation calculation and evaluation value calculation can be terminated. Therefore, even when the correlation between the next-point integer position and the actual fractional motion vector is not high, it is possible to efficiently obtain the 1/2 position as the provisional fractional position.

上記実施形態2では、下位ブロックが無くなるまで順位ポインタを+1していったが、許容すべき演算量などに応じて、下位ブロックが無くなる前にこの操作を打ち切っても良い。また、上記実施形態2では、暫定分数位置を1点ずつ指定したが、1度に複数の暫定分数位置を指定するようにしてもよい。すなわち、次点整数位置が必ずしも実際の分数レベルの動きベクトルとの相関に影響しないという前提であれば、1位となった位置の他に、次の順位に基づく暫定分数位置も予め候補としておき、2つの暫定分数位置と最良整数位置の3点と現ブロックとの差分を比較して分数探索の探索中心を決定してもよい。ここで、1/2pel探索の演算回数が、周囲8点についておこなう8回よりも少なければ演算量の削減に効果が生じることになるので、この範囲内で候補とする暫定分数位置の個数を決めればよい。   In the second embodiment, the order pointer is incremented by 1 until there is no lower block. However, this operation may be terminated before the lower block disappears, depending on the amount of calculation to be allowed. In the second embodiment, provisional fraction positions are designated one by one. However, a plurality of provisional fraction positions may be designated at a time. That is, if it is assumed that the next integer position does not necessarily affect the correlation with the actual fraction level motion vector, in addition to the first position, the provisional fraction position based on the next rank is also set as a candidate in advance. The search center of the fraction search may be determined by comparing the difference between the three points of the two provisional fraction positions and the best integer position and the current block. Here, if the number of computations of 1/2 pel search is less than 8 performed for the surrounding 8 points, the amount of computation will be reduced, so the number of provisional fractional positions that are candidates within this range can be determined. That's fine.

以上説明したように、上記各実施形態にかかる動き検出部170によれば、例えば、「整数探索→1/2pel探索→1/4pel探索」の順で探索する多段探索で動きベクトルを検出する場合に、整数探索で得られた最良整数位置(第1の整数位置)と、その最良整数位置の近傍周囲の整数位置のうちで最良整数位置に続いて差分の小さい位置(第2の整数位置)とに基づいて、1/2pelでの分数位置を推定して絞り込むので、1/2pel探索演算の演算量が減少する。これにより、分数単位の動きベクトルを正確に検出するとともに、全体としての演算量を減少させることができる。すなわち、分数精度の探索によるフレームレートの向上と、処理高速化や省電力化の両立を図ることができる。   As described above, according to the motion detection unit 170 according to each of the above embodiments, for example, when a motion vector is detected by a multistage search in the order of “integer search → 1/2 pel search → 1/4 pel search”. Next, the best integer position obtained by the integer search (first integer position) and the integer positions in the vicinity of the best integer position, the position with the smallest difference following the best integer position (second integer position) Based on the above, the fractional position at 1 / 2pel is estimated and narrowed down, so that the amount of computation of 1 / 2pel search operation is reduced. As a result, it is possible to accurately detect a motion vector in a fractional unit and reduce the amount of calculation as a whole. That is, it is possible to achieve both improvement of the frame rate by the search with fractional accuracy, speeding up of processing, and power saving.

なお、このような符号化装置100から出力された符号化ビットストリームを復号する復号装置で動き検出をおこなう部分も、上記符号化装置100の動き検出部170と同様の構成・動作とすることができる。すなわち、動画像データの符号化あるいは復号において、ブロックマッチングによる動き検出をおこなう部分を上記動き検出部170と同様の構成とすることにより、動画像の符号化および復号において、フレームレートの向上と処理高速化の両立を図ることができる。   It should be noted that the part that performs motion detection in the decoding device that decodes the encoded bitstream output from the encoding device 100 may have the same configuration and operation as the motion detection unit 170 of the encoding device 100. it can. In other words, in the coding or decoding of moving image data, the portion that performs motion detection by block matching is configured in the same manner as the motion detecting unit 170, thereby improving the frame rate and processing in moving image coding and decoding. Both speeding up can be achieved.

なお、上記実施形態にかかる動き検出部170の機能をソフトウェア処理によって実現してもよい。この場合、例えば、パーソナルコンピュータや動画像記録再生装置などの汎用装置で、これらの機能を実現するためのプログラムを実行することで、動き検出部170の機能を実現することができる。   Note that the function of the motion detection unit 170 according to the above embodiment may be realized by software processing. In this case, for example, the function of the motion detection unit 170 can be realized by executing a program for realizing these functions on a general-purpose device such as a personal computer or a moving image recording / reproducing device.

すなわち、汎用装置の記憶部に当該プログラムをインストールし、CPUなどの制御部がプログラムを実行する。この場合、以下のようなプログラムが実行されることで、汎用装置で本発明の実施形態にかかる動き検出部170の機能を実現することができる。
(1−1)「整数探索プログラム」:探索範囲内を整数画素単位で探索し、現ブロックとの差分が最小となる整数位置(第1の整数位置)を検出するためのプログラム
(1−2)「周囲点評価プログラム」:整数探索で得られた最良整数位置の近傍周囲における現ブロックとの差分を評価し、最良整数位置の次に差分の小さい次点整数位置(第2の整数位置)を特定、もしくは、各周囲点での評価を順位付けするためのプログラム
(1−3)「分数位置推定プログラム」:次点整数位置もしくは所定順位の周囲点を指定し、最良整数位置と指定した周囲位置とに基づいて、所定の探索精度の分数探索(1/2pel探索)で得られる分数位置を推定して暫定分数位置を指定するためのプログラム
(1−4)「比較判定プログラム」:最良整数位置での現ブロックとの差分と、暫定分数位置での現ブロックとの差分とを比較し、いずれの差分がより小さいかを判定するためのプログラム
(1−5)「次点整数位置指定プログラム」:暫定分数位置での差分より、最良整数位置での差分がより小さい場合に、次点整数位置(第2の整数位置)の次の順位の周囲点を新たな次点整数位置(第2の整数位置)として指定するためのプログラム
(1−6)「分数探索プログラム」:最良整数位置と暫定分数位置のうち、より差分が小さいと判定された位置を探索中心として、所定の探索精度(1/2pel)より高精度な分数探索(1/4pel探索)をおこない、現ブロックとの差分が最小となる分数位置を検出するためのプログラム
(1−7)「ベクトル算出プログラム」:現ブロックとの差分が最小となる整数位置および分数位置に基づいて、現ブロックにおける動きベクトルを算出するためのプログラム
That is, the program is installed in the storage unit of the general-purpose device, and a control unit such as a CPU executes the program. In this case, the function of the motion detection unit 170 according to the embodiment of the present invention can be realized by a general-purpose device by executing the following program.
(1-1) “Integer search program”: a program for searching the search range in units of integer pixels and detecting an integer position (first integer position) at which the difference from the current block is minimum (1-2) ) "Ambient point evaluation program": Evaluates the difference with the current block around the best integer position obtained by integer search, and next integer position (second integer position) with the next smallest difference after the best integer position (1-3) “fractional position estimation program”: Specify next-point integer position or a predetermined-order peripheral point, and specify the best integer position Program (1-4) “Comparison determination program” for estimating a fractional position obtained by a fractional search (1 / 2pel search) with a predetermined search accuracy based on the surrounding position and designating a provisional fractional position: best In integer positions Program for comparing the difference between the block and the difference between the current block at the provisional fraction position and determining which difference is smaller (1-5) “next integer position designation program”: provisional fraction When the difference at the best integer position is smaller than the difference at the position, the next next integer position (second integer position) is set to the surrounding point of the next rank after the next integer position (second integer position). Program (1-6) for designating as: “Fraction search program”: Predetermined search accuracy (1/2 pel) with the position determined to have a smaller difference between the best integer position and the provisional fraction position as the search center A program (1-7) “vector calculation program” for performing a higher-accuracy fractional search (1 / 4pel search) and detecting a fractional position where the difference from the current block is minimum: the difference from the current block is minimum Integer places And based on the fractional position, a program for calculating a motion vector in the current block

上記プログラムを汎用装置で実行した場合、CPUなどの制御装置が、整数探索部171、最良整数位置判定部172、周囲整数位置評価部173、1/2pel演算部174、探索中心判定部175、1/4pel演算部176、ベクトル算出部177、などとして機能し、例えば、主記憶装置や外部記憶装置などの記憶装置が所定の記憶領域などとして機能することとなる。   When the above program is executed by a general-purpose device, a control device such as a CPU performs an integer search unit 171, a best integer position determination unit 172, a surrounding integer position evaluation unit 173, a 1/2 pel calculation unit 174, a search center determination unit 175, 1 For example, a storage device such as a main storage device or an external storage device functions as a predetermined storage area or the like.

これらのプログラムは、汎用装置等に予め組み込んで提供することができる他、プログラム自体を独立して提供してもよい。この場合のプログラムの配布方法は任意であり、例えば、CD-ROMやメモリカードなどの記録媒体に格納して配布可能であることはもとより、例えば、インターネットなどの通信媒体を介して配布してもよい。そして、配布されたプログラムを汎用コンピュータ装置等にインストールし、OS(Operation System:基本ソフトウェア)との協働などによって実行することで、上記動き検出部170の機能を実現することができる。   These programs can be provided by being incorporated in a general-purpose device in advance, or the programs themselves may be provided independently. The distribution method of the program in this case is arbitrary. For example, the program can be distributed by being stored in a recording medium such as a CD-ROM or a memory card, or can be distributed via a communication medium such as the Internet. Good. Then, the function of the motion detection unit 170 can be realized by installing the distributed program in a general-purpose computer device or the like and executing it in cooperation with an OS (Operation System: basic software).

また、本発明にかかる機能を実現するためのプログラムは、動画像の符号化・復号をおこなうための既存のプログラムとの協働により動作するようにしてもよい。すなわち、既存の動画像符号化・復号化プログラムに対する、いわゆるアップデートプログラムとして提供することで、既存の動画像符号化・復号化処理に上記のような動き検出動作を追加し、フレームレートの向上と処理の高速化を図ることができる。   The program for realizing the function according to the present invention may be operated in cooperation with an existing program for encoding / decoding moving images. In other words, by providing a so-called update program for the existing video encoding / decoding program, the motion detection operation as described above is added to the existing video encoding / decoding process, and the frame rate is improved. Processing speed can be increased.

上記各実施形態の記載は、本発明を適用するための一例であり、本発明の範囲は上記各実施形態によって限定されるものではない。すなわち、上記実施形態以外の種々の形態で本発明が適用されてもよく、それらは本発明の範囲に含まれるものである。   The descriptions of the above embodiments are examples for applying the present invention, and the scope of the present invention is not limited by the above embodiments. That is, the present invention may be applied in various forms other than the above-described embodiments, and these are included in the scope of the present invention.

例えば、上記実施形態では、「整数探索(第1段階)→1/2pel探索(第2段階)→1/4pel探索(第3段階)」の多段探索の場合を例示したが、異なる探索精度で段階的に探索をおこなうのであれば、探索精度や段数は任意のものであってもよい。例えば、「整数探索(第1段階)→1/2pel探索(第2段階)」とする多段探索に本発明を適用することでも処理の高速化を実現することができる。この場合、暫定分数位置に基づく暫定分数ブロックの評価値が最良整数ブロックの評価値よりも良好であれば、当該暫定分数ブロックを示すベクトルを1/2pelの分数動きベクトルとすることができる。これにより、通常、8方向についておこなう差分演算が1回で済むので、第2段階における演算量が減少し、処理を高速化することができる。   For example, in the above embodiment, the case of multi-stage search of “integer search (first stage) → 1/2 pel search (second stage) → 1/4 pel search (third stage)” is illustrated, but with different search accuracy If the search is performed in stages, the search accuracy and the number of stages may be arbitrary. For example, the processing speed can be increased by applying the present invention to a multi-stage search such as “integer search (first stage) → 1/2 pel search (second stage)”. In this case, if the evaluation value of the provisional fraction block based on the provisional fraction position is better than the evaluation value of the best integer block, the vector indicating the provisional fraction block can be a 1/2 pel fractional motion vector. As a result, the difference calculation normally performed in the eight directions only needs to be performed once, so that the amount of calculation in the second stage is reduced and the processing can be speeded up.

また、上記実施形態では、最良整数ブロックの周囲8方向から次点整数位置を求めたが、例えば、周囲4方向などに間引きして求めてもよい。これは1/4pel探索についても同様である。   In the above embodiment, the next-point integer position is obtained from the eight directions around the best integer block, but may be obtained by thinning out, for example, in the four surrounding directions. The same applies to 1 / 4pel search.

本発明の実施形態1にかかる「符号化装置」の構成を示すブロック図である。It is a block diagram which shows the structure of the "encoding apparatus" concerning Embodiment 1 of this invention. 図1に示す「動き検出部」の構成を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration of a “motion detection unit” illustrated in FIG. 1. 本発明の実施形態1にかかる「動きベクトル検出処理1」を説明するためのフローチャートである。It is a flowchart for demonstrating "the motion vector detection process 1" concerning Embodiment 1 of this invention. 「整数探索」を説明するための図であり、(a)は探索ブロックの例を示し、(b)は整数探索時の探索範囲と探索ブロックの例を示す。It is a figure for demonstrating "integer search", (a) shows the example of a search block, (b) shows the example of the search range at the time of an integer search, and a search block. 次点整数ブロックを探索する動作を説明するための図であり、(a)は周囲ブロック探索範囲が設定される位置の例を示し、(b)は周囲ブロック探索範囲の例を示す。It is a figure for demonstrating the operation | movement which searches for a next point integer block, (a) shows the example of the position where a surrounding block search range is set, (b) shows the example of a surrounding block search range. 次点整数ブロックを判定する動作を説明するための図であり、(a)〜(h)は、最良整数ブロックに隣接する探索ブロックの例を示す。It is a figure for demonstrating the operation | movement which determines a next-point integer block, (a)-(h) shows the example of the search block adjacent to the best integer block. 「暫定分数位置」を特定する動作を説明するための図であり、(a)は特定された暫定分数位置の例を示し、(b)は暫定分数位置に基づいて規定される暫定分数ブロックの例を示す。It is a figure for demonstrating the operation | movement which specifies "provisional fraction position", (a) shows the example of the specified provisional fraction position, (b) is the provisional fraction block prescribed | regulated based on provisional fraction position. An example is shown. 分数画素補間を説明するための図であり、(a)は1/2画素補間の例を示し、(b)は1/4画素補間の例を示す。It is a figure for demonstrating fraction pixel interpolation, (a) shows the example of 1/2 pixel interpolation, (b) shows the example of 1/4 pixel interpolation. 暫定分数ブロックを探索中心とした1/4pel探索を説明するための図であり、(a)は1/4画素補間された暫定分数ブロックの例を示し、(b)は1/4pel探索の探索範囲の例を示す。It is a figure for demonstrating 1 / 4pel search centering on a provisional fraction block, (a) shows the example of the provisional fraction block by which 1/4 pixel interpolation was performed, (b) is the search of 1 / 4pel search An example of a range is shown. 1/4pel探索の動作を説明するための図であり、(a)は探索の起点となる暫定分数ブロックの例を示し、(b)は1分数画素分ずらした探索ブロックの例を示し、(c)は探索順序の例を示す。It is a figure for demonstrating the operation | movement of a 1 / 4pel search, (a) shows the example of the temporary fraction block used as the starting point of a search, (b) shows the example of the search block shifted by 1 fraction pixel, ( c) shows an example of the search order. 最良整数ブロックを探索中心とした1/4pel探索を説明するための図であり、(a)は1/4画素補間された最良整数ブロックの例を示し、(b)は1/4pel探索の探索範囲の例を示す。It is a figure for demonstrating 1 / 4pel search centering on the best integer block, (a) shows the example of the best integer block interpolated by 1/4 pixel, (b) is the search of 1 / 4pel search An example of a range is shown. 本発明の実施形態2にかかる「動きベクトル検出処理2」を説明するためのフローチャートである。It is a flowchart for demonstrating "the motion vector detection process 2" concerning Embodiment 2 of this invention. 本発明の実施形態2にかかる「動きベクトル検出処理2」を説明するためのフローチャートである。It is a flowchart for demonstrating "the motion vector detection process 2" concerning Embodiment 2 of this invention.

符号の説明Explanation of symbols

100…符号化装置、110…変換部、120…量子化部、130…符号化部、140…逆量子化部、150…逆変換部、160…復元画像メモリ、170…動き検出部、171…整数探索部、172…最良整数位置判定部、173…周囲整数位置評価部、174…1/2pel演算部、175…探索中心判定部、176…1/4pel演算部、177…ベクトル算出部、180…動き補償部 DESCRIPTION OF SYMBOLS 100 ... Coding apparatus, 110 ... Conversion part, 120 ... Quantization part, 130 ... Encoding part, 140 ... Inverse quantization part, 150 ... Inverse transformation part, 160 ... Restoration image memory, 170 ... Motion detection part, 171 ... Integer ... search unit, 172 ... best integer position determination unit, 173 ... surrounding integer position evaluation unit, 174 ... 1 / 2pel calculation unit, 175 ... search center determination unit, 176 ... 1 / 4pel calculation unit, 177 ... vector calculation unit, 180 ... Motion compensation unit

Claims (7)

参照フレーム上で整数探索および分数探索して、現フレーム上の現ブロックについての動きベクトルを検出する動きベクトル検出装置であって、
整数単位の探索の結果、参照フレームの画素と現ブロックの画素との差分が最小である整数位置を第1の整数位置とし、第1の整数位置の近傍周囲の整数位置の内、前記第1の整数位置の次に参照フレームの画素と現ブロックの画素との差分が小さい整数位置を第2の整数位置として特定する第2整数位置特定手段と、
前記第1の整数位置と前記第2の整数位置とに基づいて、所定の精度の分数位置を推定する分数位置推定手段と、
前記第1の整数位置と、前記分数位置推定手段が推定した分数位置とに基づいて、前記所定の精度より高精度の分数探索をおこなう分数探索手段と、
を備え、
前記分数探索手段は、
前記第1の整数位置における参照フレームの画素と現ブロックの画素との差分と、前記分数位置推定手段が推定した分数位置における参照フレームの画素と現ブロックの画素との差分とを比較し、より差分の小さい位置がいずれかであるかを判定する判定手段と、
前記判定手段によってより差分が小さいと判定された位置を前記所定の精度より高精度の分数探索における探索中心に指定する探索中心指定手段と、
さらに備えることを特徴とする動きベクトル検出装置。
A motion vector detection device for detecting a motion vector for a current block on a current frame by performing integer search and fractional search on a reference frame,
Results of the search of the integer unit, the difference between pixels of the reference frame and the pixel of the current block is an integer position is minimum as the first integer positions, among integer position near the periphery of the first integer position, the first a second integer position specifying means for specifying the difference is small integer position of the pixel and the pixel of the current block of the reference frame to the next integer position as the second integer position of,
A fractional position estimating means for estimating a fractional position with a predetermined accuracy based on the first integer position and the second integer position;
A fraction search means for performing a fraction search with higher accuracy than the predetermined accuracy based on the first integer position and the fraction position estimated by the fraction position estimation means;
With
The fraction search means includes:
Comparing the difference between the reference frame pixel at the first integer position and the current block pixel with the difference between the reference frame pixel at the fractional position estimated by the fractional position estimation means and the current block pixel; and A determination means for determining whether the position where the difference is small is either;
Search center designating means for designating a position determined by the determining means as having a smaller difference as a search center in a fractional search with higher accuracy than the predetermined accuracy;
The motion vector detecting device further comprising:
前記第2整数位置特定手段は、前記第1の整数位置に隣接する整数位置の中から第2の整数位置を特定する、
ことを特徴とする請求項に記載の動きベクトル検出装置。
The second integer position specifying means specifies a second integer position from integer positions adjacent to the first integer position;
The motion vector detection apparatus according to claim 1 , wherein:
前記第2整数位置特定手段は、前記第1の整数位置の周囲8方向に隣接する整数位置の中から第2の整数位置を特定する、
ことを特徴とする請求項に記載の動きベクトル検出装置。
The second integer position specifying means specifies a second integer position from among the integer positions adjacent in the eight directions around the first integer position.
The motion vector detection apparatus according to claim 2 , wherein
前記分数位置推定手段は、前記第1の整数位置と前記第2の整数位置との間の中間位置を前記所定の精度の分数位置であると推定する、
ことを特徴とする請求項1乃至のいずれか1項に記載の動きベクトル検出装置。
The fractional position estimating means estimates an intermediate position between the first integer position and the second integer position as the fractional position of the predetermined accuracy;
The motion vector detection device according to any one of claims 1 to 3 , wherein
前記第2整数位置特定手段は、前記第1の整数位置における参照フレームの画素と現ブロックの画素との差分が、前記推定された分数位置における参照フレームの画素と現ブロックの画素との差分より小さい場合、第1の整数位置の近傍周囲の整数位置の内、前記第2の整数位置の次に参照フレームの画素と現ブロックの画素との差分が小さい整数位置を新たな第2の整数位置とする、
ことを特徴とする請求項1乃至のいずれか1項に記載の動きベクトル検出装置。
The second integer position specifying means, the difference between pixels of the first reference frame at integer positions pixel and the current block is, from the difference between the pixel of the pixel and the current block of the reference frame in the estimated fractional position If small, of the integer positions in the vicinity around the first integer position, the second integer positions the new difference is small integer positions of the pixels in the reference frame to the next pixel of the current block of the second integer positions And
Motion vector detection device according to any one of claims 1 to 4, characterized in that.
コンピュータで動画像の動きベクトル検出をおこなうためのプログラムであって、
コンピュータに、
参照フレーム上で整数単位の探索をおこなって、参照フレームの画素と現フレームの現ブロックの画素との差分が最小である整数位置を第1の整数位置とし、第1の整数位置の近傍周囲の整数位置の内、前記第1の整数位置の次に参照フレームの画素と現ブロックの画素との差分が小さい整数位置を第2の整数位置として特定する機能と、
前記第1の整数位置と前記第2の整数位置との間の中間位置を、所定の精度の分数位置と推定する機能と、
前記第1の整数位置における参照フレームの画素と現ブロックの画素との差分と、前記推定された分数位置における参照フレームの画素と現ブロックの画素との差分とを比較し、より差分の小さい位置がいずれかであるかを判定する機能と、
前記判定手段によってより差分が小さいと判定された位置を探索中心として、前記所定の精度より高精度の分数探索をおこなう機能と、
分数探索の結果に基づき、現ブロックについての動きベクトルを算出する機能と、
を実現させることを特徴とするプログラム。
A program for detecting a motion vector of a moving image on a computer,
On the computer,
An integer unit search is performed on the reference frame, and the integer position where the difference between the pixel of the reference frame and the pixel of the current block of the current frame is the minimum is set as the first integer position. of integer positions, a function of specifying the difference is small integer position of the pixel of the first next to the reference frame pixel and the current block of integer positions as a second integer positions,
A function of estimating an intermediate position between the first integer position and the second integer position as a fractional position with a predetermined accuracy;
The difference between the reference frame pixel at the first integer position and the current block pixel is compared with the difference between the reference frame pixel at the estimated fractional position and the current block pixel, and the difference is smaller. A function to determine whether or not
A function for performing a fractional search with higher accuracy than the predetermined accuracy, with the position determined by the determining means as having a smaller difference as a search center;
A function to calculate a motion vector for the current block based on the result of the fraction search;
A program characterized by realizing.
前記コンピュータに、
前記第1の整数位置における参照フレームの画素と現ブロックの画素との差分が、前記推定された分数位置における参照フレームの画素と現ブロックの画素との差分より小さい場合、第1の整数位置の近傍周囲の整数位置の内、前記第2の整数位置の次に参照フレームの画素と現ブロックの画素との差分が小さい整数位置を新たな第2の整数位置とする機能、
をさらに実現させることを特徴とする請求項に記載のプログラム。
In the computer,
The difference between the pixel and the current block pixels in the reference frame in said first integer position, when the pixels of the reference frame in the estimated fractional positions less than the difference between the pixel of the current block, the first integer position among integer positions around the vicinity, functions as a second integer position difference new a small integer position of the pixel of the second of the next reference frame of integer positions pixel and the current block,
The program according to claim 6 , further realizing the above.
JP2004205467A 2004-07-13 2004-07-13 Motion vector detection device and program Expired - Fee Related JP4385875B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004205467A JP4385875B2 (en) 2004-07-13 2004-07-13 Motion vector detection device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004205467A JP4385875B2 (en) 2004-07-13 2004-07-13 Motion vector detection device and program

Publications (2)

Publication Number Publication Date
JP2006033112A JP2006033112A (en) 2006-02-02
JP4385875B2 true JP4385875B2 (en) 2009-12-16

Family

ID=35898974

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004205467A Expired - Fee Related JP4385875B2 (en) 2004-07-13 2004-07-13 Motion vector detection device and program

Country Status (1)

Country Link
JP (1) JP4385875B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5136295B2 (en) * 2007-11-29 2013-02-06 ソニー株式会社 Motion vector detection apparatus, motion vector detection method, and program
CN104967858B (en) * 2015-06-30 2018-01-26 北京奇艺世纪科技有限公司 A kind of sub-pixel motion is to amount estimation method and device

Also Published As

Publication number Publication date
JP2006033112A (en) 2006-02-02

Similar Documents

Publication Publication Date Title
US7444026B2 (en) Image processing apparatus and method of motion vector detection in a moving picture, and recording medium used therewith
EP2627091B1 (en) Video coding using template matching
JP4898467B2 (en) Coding mode determination method and apparatus for variable block size motion prediction
JP5277257B2 (en) Video decoding method and video encoding method
US9204154B2 (en) Image encoding device and image decoding device
JP2013505615A (en) Video weighted motion compensation
JP2006074474A (en) Moving image encoder, encoding method, and encoding program
JP4762938B2 (en) Data embedding device, data extracting device, data embedding method, and data extracting method
JP2019041165A (en) Image encoding device, image decoding device, image processing method, and image processing program
US8144772B2 (en) Moving picture processor, method for processing a moving picture, and computer program product for executing an application for a moving picture processor
JP4385875B2 (en) Motion vector detection device and program
JP7361838B2 (en) Video encoding device, video decoding device, and these programs
KR102570374B1 (en) Video encoding apparatus, video encoding method, video encoding program, video decoding apparatus, video decoding method, and video decoding program
KR20070000702A (en) Apparatus and method for fast motion estimation based on reduced search ranges
JP4576930B2 (en) Motion vector detection device and program
JP6019797B2 (en) Moving picture coding apparatus, moving picture coding method, and program
JP4429996B2 (en) Moving picture coding program, moving picture coding method, and moving picture coding apparatus
US11528485B2 (en) Encoding apparatus and program
JP4385869B2 (en) Motion vector detection device, moving image encoding device, and program
JP4032049B2 (en) Motion vector detection method and apparatus
JP6696889B2 (en) IMAGE ENCODING DEVICE, IMAGE ENCODING METHOD, AND COMPUTER PROGRAM
JP5281596B2 (en) Motion vector prediction method, motion vector prediction apparatus, and motion vector prediction program
JP5281597B2 (en) Motion vector prediction method, motion vector prediction apparatus, and motion vector prediction program
JP5202558B2 (en) Intra prediction apparatus, encoder, decoder, and program
JP5200981B2 (en) Motion detection circuit and moving picture coding apparatus including the motion detection circuit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070508

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090210

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090224

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090420

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090921

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20121009

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20121009

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20131009

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees