JP4789719B2 - Motion vector detection apparatus, motion vector detection method, computer program, and storage medium - Google Patents

Motion vector detection apparatus, motion vector detection method, computer program, and storage medium Download PDF

Info

Publication number
JP4789719B2
JP4789719B2 JP2006186972A JP2006186972A JP4789719B2 JP 4789719 B2 JP4789719 B2 JP 4789719B2 JP 2006186972 A JP2006186972 A JP 2006186972A JP 2006186972 A JP2006186972 A JP 2006186972A JP 4789719 B2 JP4789719 B2 JP 4789719B2
Authority
JP
Japan
Prior art keywords
image data
motion vector
maelow
maemid
block size
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
JP2006186972A
Other languages
Japanese (ja)
Other versions
JP2008017209A (en
JP2008017209A5 (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2006186972A priority Critical patent/JP4789719B2/en
Priority to US11/772,630 priority patent/US8270490B2/en
Publication of JP2008017209A publication Critical patent/JP2008017209A/en
Publication of JP2008017209A5 publication Critical patent/JP2008017209A5/ja
Application granted granted Critical
Publication of JP4789719B2 publication Critical patent/JP4789719B2/en
Priority to US13/600,466 priority patent/US9264735B2/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, a motion vector detection method, a computer program, and a storage medium.

近年、マルチメディアに関連する情報のデジタル化が急進しており、それに伴い映像情報の高画質化に向けた要求が高まっている。具体的な例として放送メディアの従来の720×480画素のSDから、1920×1080画素のHDに移行が行われつつあることを挙げることが出来る。しかしながら、この高画質への要求は同時にデジタルデータの増大を引き起こし、従来の性能を上回る圧縮符号化技術及び復号化技術が求められている。   In recent years, the digitalization of information related to multimedia has been rapidly progressing, and the demand for higher image quality of video information has increased accordingly. As a concrete example, it can be mentioned that a conventional SD of 720 × 480 pixels of broadcasting media is being transferred to HD of 1920 × 1080 pixels. However, this demand for high image quality causes an increase in digital data at the same time, and a compression encoding technique and a decoding technique exceeding the conventional performance are required.

これらの要求に対し、ITU−T SG16やISO/IEC JTC1/SC29/WG11の活動で画像間の相関を利用したフレーム間予測を用いた符号化圧縮方式の標準化作業が進められている。   In response to these demands, standardization work of an encoding compression method using inter-frame prediction using correlation between images in the activities of ITU-T SG16 and ISO / IEC JTC1 / SC29 / WG11 is in progress.

この中でも、現状最も高能率符号化を実現しているといわれる符号化方式にH.264/MPEG−4 PART10(AVC)(以下、H.264と呼ぶ)がある。H.264の符号化・復号化の仕様については、例えば特許文献1に開示されている。   Among these, H.264 is an encoding method that is said to realize the most efficient encoding at present. H.264 / MPEG-4 PART10 (AVC) (hereinafter referred to as H.264). H. H.264 encoding / decoding specifications are disclosed in Patent Document 1, for example.

また、H.264で新たに導入された技術のひとつとして、図2に示すような予測符号化を行う画素ブロックのパーティションを複数種用意し、細かい画素単位の動き量を検出し、予測誤差が最小のものを選択して符号量をより低減する技術がある。このようなパーティションは、マクロブロックパーティションと呼ばれる。   H. As one of the technologies newly introduced in H.264, a plurality of types of pixel block partitions for performing predictive coding as shown in FIG. 2 are prepared, the amount of motion in fine pixel units is detected, and the one with the smallest prediction error is prepared. There is a technique for selecting and further reducing the code amount. Such a partition is called a macroblock partition.

ここで、図2を用いてマクロブロックパーティションについて詳細に説明する。H.264では、図2(i)に示すようにMPEG2で用いられているサイズである16×16画素を最大のブロックサイズを有するマクロブロックタイプとする。その上で、更に図2の(ii)から(iv)を含めた合計4種類の中から予測符号化に使用するマクロブロックパーティションを選ぶことが可能である。なお、このマクロブロックパーティションの選択は、予測符号化に使用するマクロブロックサイズを、16×16画素、16×8画素、8×16画素、8×8画素のいずれかから選択することと等価である。   Here, the macroblock partition will be described in detail with reference to FIG. H. In H.264, as shown in FIG. 2 (i), 16 × 16 pixels, which is the size used in MPEG2, is set as a macroblock type having the maximum block size. In addition, it is possible to select a macroblock partition to be used for predictive coding from a total of four types including (ii) to (iv) in FIG. The selection of the macroblock partition is equivalent to selecting the macroblock size used for predictive encoding from any of 16 × 16 pixels, 16 × 8 pixels, 8 × 16 pixels, and 8 × 8 pixels. is there.

更に、図2(iv)に示す8×8画素で構成されるマクロブロックについては、それぞれより細かいサブマクロブロックに分割できる。ここでは、図2(v)から(viii)に示すように、最小4×4画素のブロックサイズを有するサブマクロブロックを使用して、4種類のサブマクロブロックパーティションのいずれかに分割をすることが可能である。この場合、サブマクロブロックパーティションの選択は、予測符号化に使用するサブマクロブロックサイズを、8×8画素、8×4画素、4×8画素、4×4画素のいずれかから選択することと等価である。   Furthermore, the macroblock composed of 8 × 8 pixels shown in FIG. 2 (iv) can be divided into finer submacroblocks. Here, as shown in FIGS. 2 (v) to (viii), a sub-macro block having a block size of a minimum of 4 × 4 pixels is used and divided into any of four types of sub-macro block partitions. Is possible. In this case, the sub-macroblock partition is selected by selecting a sub-macroblock size used for predictive coding from 8 × 8 pixels, 8 × 4 pixels, 4 × 8 pixels, and 4 × 4 pixels. Is equivalent.

つまり、予測符号化に使用するマクロブロックパーティションは、全部で19種類の中から選ぶことになる。このうち、3種類は、サブマクロブロックパーティションの対象とならないマクロブロックパーティション(図2(i)から(iii))の数である。また、残りの16種類は、図2(iv)においてサブマクロブロックパーティションの対象となるマクロブロック数:4と、図2(v)から(viii)のサブマクロブロックパーティション数:4との積による。   That is, the macroblock partition used for predictive coding is selected from 19 types in total. Among these, three types are the number of macroblock partitions (FIG. 2 (i) to (iii)) that are not the target of the sub macroblock partition. Further, the remaining 16 types depend on the product of the number of macroblocks subject to sub-macroblock partitions in FIG. 2 (iv): 4 and the number of sub-macroblock partitions: 4 in FIGS. 2 (v) to (viii). .

また、H.264では、図5に示すように符号化対象フレーム(CF)内のマクロブロック毎に複数の参照フレーム(RF1〜RF5)から符号化効率の良い参照フレームを選択し、ブロック毎にどのフレームを用いるかを指定できる。よって、同一の符号化対象フレームCF内のマクロブロックであっても、異なる参照フレームが選択される場合がある。このように、H.264では、複数の参照フレームを用いて、動きベクトル検出のための複数の探索階層が設定されることとなる。   H. In H.264, as shown in FIG. 5, a reference frame with good coding efficiency is selected from a plurality of reference frames (RF1 to RF5) for each macroblock in the encoding target frame (CF), and which frame is used for each block. Can be specified. Therefore, different reference frames may be selected even for macroblocks in the same encoding target frame CF. In this way, H.C. In H.264, a plurality of search hierarchies for motion vector detection are set using a plurality of reference frames.

この結果、より細かい画像単位で動き情報を探索し、動き情報の精度の向上を実現している。
特開2005−167720号公報
As a result, the motion information is searched in finer image units, and the accuracy of the motion information is improved.
JP 2005-167720 A

しかしながら、MPEG2がマクロブロック1種類しか有しないのに比べ、H.264は、19種類ものパーティション数を有し、パーティションに含まれるブロックの全てについて動きベクトルの評価を行えば膨大な演算が必要となる。また、H.264では、複数の探索階層(複数の参照フレーム)を用いて動きベクトル検出を行えるため、各探索階層について全てのパーティションの評価を行おうとすれば、やはり膨大な演算が必要となる。   However, compared to MPEG 2 having only one type of macroblock, H.264 has as many as 19 types of partitions, and if the motion vectors are evaluated for all the blocks included in the partitions, a huge amount of computation is required. H. In H.264, since motion vector detection can be performed using a plurality of search layers (a plurality of reference frames), if all partitions are evaluated for each search layer, an enormous number of operations are required.

また、ビデオカムコーダなどのモバイル機器の場合には、演算負荷の増大は駆動するバッテリー消費量の増大に結びつき、撮影時間が短くなってしまう問題がある。   In addition, in the case of a mobile device such as a video camcorder, an increase in calculation load leads to an increase in driving battery consumption, and there is a problem in that shooting time is shortened.

本発明は、このような問題点に鑑みてなされたものであり、探索精度を維持しながらも計算量を大幅に軽減し、高能率に複数のブロックサイズによる動き探索を行って動きベクトルの検出を可能とすることを目的とする。   The present invention has been made in view of such problems, and greatly reduces the amount of calculation while maintaining search accuracy, and performs motion search using a plurality of block sizes with high efficiency to detect a motion vector. It aims to make it possible.

上記課題を解決するために、本発明は、処理対象画像データと複数の参照画像データとを用いて動きベクトルを検出する動きベクトル検出装置であって、前記処理対象画像データにおける第1のブロックサイズを有する第1の画像データとの第1のマッチング誤差が最小となる、前記複数の参照画像データのうち第1の参照画像データにおける前記第1のブロックサイズを有する第2の画像データを決定し、該第1の画像データと該第2の画像データとに基づく第1の動きベクトルを検出する第1の動きベクトル検出手段と、前記第1の画像データを、前記第1のブロックサイズより小さい第2のブロックサイズを有する複数の第3の画像データに分割し、最小となる前記第1のマッチング誤差から、該複数の第3の画像データのそれぞれに対応する複数の第2のマッチング誤差を抽出する第1の抽出手段と、前記第1の抽出手段により抽出された前記複数の第2のマッチング誤差のそれぞれを所定の閾値と比較し、各第2のマッチング誤差と前記所定の閾値との比較結果が予め定められた複数の条件の何れに適合するかを判定して、当該適合した条件に従って、前記複数の参照画像データを利用した動きベクトルの検出に用いる第3のブロックサイズを決定する第1の決定手段とを備えることを特徴とする。 In order to solve the above-described problem, the present invention provides a motion vector detection apparatus that detects a motion vector using processing target image data and a plurality of reference image data, and includes a first block size in the processing target image data. Determining the second image data having the first block size in the first reference image data from among the plurality of reference image data, wherein the first matching error with the first image data having the minimum is determined. A first motion vector detecting means for detecting a first motion vector based on the first image data and the second image data; and the first image data is smaller than the first block size. A plurality of third image data having a second block size is divided into a plurality of third image data from the first matching error that is minimized. First extracting means for extracting a plurality of second matching errors response, each of said plurality of extracted by the first extraction means second matching error is compared with a predetermined threshold value, the second The comparison result between the matching error and the predetermined threshold value is determined to match any of a plurality of predetermined conditions, and motion vectors are detected using the plurality of reference image data according to the matched conditions And a first determining means for determining a third block size used for.

本発明によれば、探索精度を維持しながらも計算量を大幅に軽減し、高能率に複数のブロックサイズによる動き探索を行って動きベクトルを検出することが可能となる。   According to the present invention, it is possible to significantly reduce the amount of calculation while maintaining search accuracy, and to detect a motion vector by performing a motion search with a plurality of block sizes with high efficiency.

以下に、添付する図面を参照して、本発明の実施形態を説明する。   Embodiments of the present invention will be described below with reference to the accompanying drawings.

まず、図1aに、本発明の実施形態に係る画像処理装置としての画像圧縮符号化装置の全体構成の一例を示す。   First, FIG. 1a shows an example of the overall configuration of an image compression coding apparatus as an image processing apparatus according to an embodiment of the present invention.

この動画像圧縮符号化装置は、カメラ部200、減算器2001、整数変換部2002、量子化部2003、エントロピー符号化部2004、逆量子化部2005、逆整数変換部2006、加算器2007を有する。また、フレームメモリ2008及び2012、イントラ予測部2009、スイッチ2010及び2015、デブロッキングフィルタ2011、インター予測部2013、動き検出部2014を更に有する。そして、カメラ部200から入力された画像データを分割することによりブロックを構成し、ブロック単位に符号化処理を行い符号化データを出力する。続いて、H.264の符号化処理について説明する。   The moving image compression encoding apparatus includes a camera unit 200, a subtracter 2001, an integer conversion unit 2002, a quantization unit 2003, an entropy encoding unit 2004, an inverse quantization unit 2005, an inverse integer conversion unit 2006, and an adder 2007. . In addition, frame memories 2008 and 2012, an intra prediction unit 2009, switches 2010 and 2015, a deblocking filter 2011, an inter prediction unit 2013, and a motion detection unit 2014 are further included. Then, the image data input from the camera unit 200 is divided to form a block, and an encoding process is performed on a block basis to output encoded data. Subsequently, H.C. The H.264 encoding process will be described.

まず、減算器2001はカメラ部からの入力される画像データから予測画像データを減算し画像残差データを出力する。予測画像データの生成については後述する。整数変換部2002は、減算器2001から出力された画像残差データを、DCT変換等により直交変換処理して変換係数を出力する。そして、量子化部2003は上記変換係数を所定の量子化パラメータを用いて量子化する。エントロピー符号化部2004は、量子化部2003で量子化された変換係数を入力し、これをエントロピー符号化して符号化データとして出力する。   First, the subtracter 2001 subtracts predicted image data from image data input from the camera unit, and outputs image residual data. The generation of predicted image data will be described later. The integer transform unit 2002 performs orthogonal transform processing on the image residual data output from the subtractor 2001 by DCT transform or the like, and outputs transform coefficients. Then, the quantization unit 2003 quantizes the transform coefficient using a predetermined quantization parameter. The entropy encoding unit 2004 receives the transform coefficient quantized by the quantization unit 2003, entropy encodes it, and outputs it as encoded data.

一方、量子化部2003で量子化された変換係数は予測画像データの生成にも使われる。逆量子化部2005は、量子化部2003で量子化された変換係数を逆量子化する。さらに、逆整数変換部2006は逆量子化部2005で逆量子化された変換係数を、逆DCT変換等により逆整数変換し、復号画像残差データとして出力する。加算器2007は、復号画像残差データと予測画像データとを加算し、再構成画像データとして出力する。   On the other hand, the transform coefficient quantized by the quantization unit 2003 is also used for generating predicted image data. The inverse quantization unit 2005 performs inverse quantization on the transform coefficient quantized by the quantization unit 2003. Further, the inverse integer transform unit 2006 performs inverse integer transform on the transform coefficient inversely quantized by the inverse quantization unit 2005 by inverse DCT transform or the like, and outputs the result as decoded image residual data. An adder 2007 adds the decoded image residual data and the predicted image data, and outputs the result as reconstructed image data.

再構成画像データはフレームメモリ2008に記録されるが、デブロッキングフィルタ処理を行う場合はデブロッキングフィルタ2011を介して記録される。また、デブロッキングフィルタ処理を行わない場合はデブロッキングフィルタ2011を介さずフレームメモリ2012に記録される。スイッチ2010は、デブロッキングフィルタ処理を行うか行わないか選択する選択部である。再構成画像データの中で、以降の予測で参照される可能性があるデータは、フレームメモリ2008または2012に参照フレームデータとして暫くの期間保存される。また、デブロッキングフィルタ2011はノイズを除去する為に用いられる。   The reconstructed image data is recorded in the frame memory 2008, but is recorded via the deblocking filter 2011 when the deblocking filter process is performed. Further, when the deblocking filter process is not performed, it is recorded in the frame memory 2012 without going through the deblocking filter 2011. The switch 2010 is a selection unit that selects whether to perform deblocking filter processing. Of the reconstructed image data, data that may be referred to in subsequent predictions is stored in the frame memory 2008 or 2012 as reference frame data for a period of time. The deblocking filter 2011 is used to remove noise.

イントラ予測部2009は、フレームメモリ2008に記録された画像データを用いてフレーム内予測処理を行い、予測画像データを生成する。また、インター予測部2013はフレームメモリ2012に記録された参照画像データを用いて動き検出部2014によって検出された動きベクトル情報に基づいてフレーム間予測処理を行い予測画像データを生成する。動き検出部2014は、フレームメモリ2012に記録された参照画像データを用いて、入力画像データにおける動きベクトルを検出し、検出した動きベクトル情報をインター予測部2013とエントロピー符号化部2004へ出力する。スイッチ2015は、イントラ予測、インター予測のどちらを用いるか選択するための選択部である。イントラ予測部2009からの出力とインター予測部2013からの出力の一方を選択して、選択された予測画像データを減算器2001、加算器2007へ出力する。   The intra prediction unit 2009 performs intra-frame prediction processing using the image data recorded in the frame memory 2008, and generates predicted image data. Also, the inter prediction unit 2013 performs inter-frame prediction processing based on the motion vector information detected by the motion detection unit 2014 using the reference image data recorded in the frame memory 2012, and generates predicted image data. The motion detection unit 2014 detects the motion vector in the input image data using the reference image data recorded in the frame memory 2012, and outputs the detected motion vector information to the inter prediction unit 2013 and the entropy encoding unit 2004. The switch 2015 is a selection unit for selecting which of intra prediction and inter prediction is used. One of the output from the intra prediction unit 2009 and the output from the inter prediction unit 2013 is selected, and the selected predicted image data is output to the subtracter 2001 and the adder 2007.

次に、本実施形態に対応する動きベクトル検出装置としての動き検出部の具体的構成及びその動作を説明する。図1bは、本実施形態に対応する動き検出部の具体的構成の一例を示す図である。また、図3は、本実施形態に対応する動き検出部における、入力画像データ中の1つのマクロブロックについて、動きベクトルを検出し、マクロブロックパーティションを決定する処理の一例を示すフローチャートである。なお、本実施例では符号化方式としてH.264の場合を例にあげて説明するが、本発明は他の符号化方式に適用してもよい。   Next, a specific configuration and operation of a motion detection unit as a motion vector detection device corresponding to the present embodiment will be described. FIG. 1 b is a diagram illustrating an example of a specific configuration of a motion detection unit corresponding to the present embodiment. FIG. 3 is a flowchart showing an example of processing for detecting a motion vector and determining a macroblock partition for one macroblock in input image data in the motion detection unit corresponding to the present embodiment. In this embodiment, the encoding method is H.264. The case of H.264 will be described as an example, but the present invention may be applied to other encoding methods.

入力端子1には、動きベクトル検出対象(処理対象)の画像信号である入力画像データが、カメラ部200から大ブロック動きベクトル検出部3に入力される。また、入力端子2には、既に符号化され局部復号化された画像信号が参照画像データとしてフレームメモリ2012から入力され、参照画像記憶部4に記憶される。   Input image data, which is an image signal of a motion vector detection target (processing target), is input from the camera unit 200 to the large block motion vector detection unit 3 at the input terminal 1. In addition, an image signal that has been encoded and locally decoded is input from the frame memory 2012 to the input terminal 2 as reference image data, and is stored in the reference image storage unit 4.

ステップS100では、探索階層が最上位の探索階層に設定される。本実施形態では、複数の探索階層、即ち複数の参照フレームについて動きベクトル検出を行うこととし、入力画像データの直近に符号化された参照フレームを「最上位の探索階層」とする。また、参照フレームのうち、最も符号化された時期が古いものを「最下位の探索階層」という。探索階層を更新する場合には、「最上位の探索階層」から「最下位の探索階層」まで、符号化時期の順に更新していく。例えば、図5の場合、RF1は「最上位の探索階層」に相当し、RF5は「最下位の探索階層」に相当する。また、探索階層を更新する場合には、RF1、RF2、RF3、RF4、RF5の順で更新される。なお、図5では、H.264の規格に従い探索階層を5階層としているが、これはあくまで例示であって、階層数はこれに限定されるものではない。   In step S100, the search hierarchy is set to the highest search hierarchy. In the present embodiment, motion vector detection is performed for a plurality of search layers, that is, a plurality of reference frames, and the reference frame encoded most recently in the input image data is set as the “highest search layer”. Of the reference frames, the oldest encoded time is referred to as the “lowest search hierarchy”. When the search hierarchy is updated, the "uppermost search hierarchy" to the "lowermost search hierarchy" are updated in the order of encoding time. For example, in the case of FIG. 5, RF1 corresponds to “the highest search hierarchy”, and RF5 corresponds to “the lowest search hierarchy”. When the search hierarchy is updated, the search hierarchy is updated in the order of RF1, RF2, RF3, RF4, and RF5. In FIG. Although the search hierarchy is five according to the H.264 standard, this is merely an example, and the number of hierarchies is not limited to this.

次に、ステップS101では、マッチング位置の設定処理が行われる。ここで、マッチング位置の設定とは、符号化処理対象フレームである入力画像データについて、参照フレーム(探索階層)における参照画像データの位置の決定を意味する。仮に、以前の探索階層において、参照フレームと入力画像データとの間に動きベクトルが検出済みでない場合には、初期動きベクトルとして零を設定し、入力画像データにおけるブロック位置と同じブロック位置にマッチング位置を設定する。この際、大ブロック探索モードをオフに設定する。大ブロック探索モードとは、16×16画素サイズのマクロブロック(大ブロック)での探索を下位の探索階層を通じて行うモードである。この大ブロック探索モードがオンに設定されている場合には、これ以降中ブロック或いは小ブロックによる探索は行われない。また、より上位の探索階層で動きベクトルが検出され、かつ、大ブロック探索モードがオンになっている場合には、当該動きベクトルを初期動きベクトルとして、マッチング位置を設定する。   Next, in step S101, a matching position setting process is performed. Here, the setting of the matching position means determination of the position of the reference image data in the reference frame (search hierarchy) for the input image data that is the frame to be encoded. If a motion vector has not been detected between the reference frame and the input image data in the previous search layer, zero is set as the initial motion vector, and the matching position is set to the same block position as the input image data. Set. At this time, the large block search mode is set to OFF. The large block search mode is a mode in which a search in a macro block (large block) of 16 × 16 pixel size is performed through a lower search hierarchy. When the large block search mode is set to ON, the search using the medium block or the small block is not performed thereafter. If a motion vector is detected in a higher search hierarchy and the large block search mode is on, the matching position is set with the motion vector as the initial motion vector.

次に、ステップS102では、大ブロック動きベクトル検出部3が、マッチング誤差MAEbigを算出する。このマッチング誤差MAEbigは、入力端子1からの入力画像データの16×16画素サイズのマクロブロック(大ブロック)と参照画像記憶部4から入力される大ブロックの参照画像データとについて算出される。マッチング誤差は、例えば、比較される両ブロックの画素値の差分を求めることにより算出することができる。マッチング誤差MAEbigは各探索階層について算出され、最終的に探索範囲(全探索階層)におけるマッチング誤差MAEbigが最も小さくなる時の動きベクトルと、その時のマッチング誤差とが求められる。この動きベクトルを「最終的な動きベクトル」という。   Next, in step S102, the large block motion vector detection unit 3 calculates a matching error MAEbig. This matching error MAEbig is calculated for the macroblock (large block) of 16 × 16 pixel size of the input image data from the input terminal 1 and the reference image data of the large block input from the reference image storage unit 4. The matching error can be calculated, for example, by obtaining a difference between pixel values of both blocks to be compared. The matching error MAEbig is calculated for each search layer, and finally, the motion vector when the matching error MAEbig in the search range (all search layers) becomes the smallest and the matching error at that time are obtained. This motion vector is referred to as a “final motion vector”.

次に、ステップS103では、大ブロック探索モードがオンに設定されているか否かを判定する。もし、大ブロック探索モードがオンならば(ステップS103において「YES」)、ステップS118に移行する。ステップS118では、探索階層が最下位の探索階層か否かを判定する。もし最下位の探索階層と判定された場合には(ステップS118において「YES」)、ステップS117へ移行する。ステップS117では、最終マクロブロックパーティション・最終動きベクトル決定部11が、マクロブロックパーティションが大ブロックであるという情報及び最終的な動きベクトルを、大ブロック動きベクトル検出部3から受信する一方、最下位の探索階層でないと判定された場合には(ステップS118において「NO」)、ステップS119に移行して、探索階層を1つ更新し、一つ下位の探索階層についてステップS101からの処理を継続する。 Next, in step S103, it is determined whether or not the large block search mode is set to ON. If the large block search mode is on (“YES” in step S103), the process proceeds to step S118. In step S118, it is determined whether the search hierarchy is the lowest search hierarchy. If it is determined that the search hierarchy is the lowest ("YES" in step S118), the process proceeds to step S117. In step S <b> 117, the final macroblock partition / final motion vector determination unit 11 receives information indicating that the macroblock partition is a large block and the final motion vector from the large block motion vector detection unit 3 . On the other hand, when it is determined that it is not the lowest search hierarchy (“NO” in step S118), the process proceeds to step S119, one search hierarchy is updated, and one lower search hierarchy from step S101 is updated. Continue processing.

一方、大ブロック探索モードがオフならば(ステップS103において「NO」)、ステップS104に移行する。ステップS104では、ステップS102で求めた動きベクトルとマッチング誤差MAEbigとを中ブロック誤差抽出部5に送信する。   On the other hand, if the large block search mode is off (“NO” in step S103), the process proceeds to step S104. In step S104, the motion vector obtained in step S102 and the matching error MAEbig are transmitted to the middle block error extraction unit 5.

中ブロック誤差抽出部5は、図4(a)に示すように大ブロック400を8×8画素サイズのマクロブロック401から404(以下、中ブロックと呼ぶ)に分割した後、各中ブロックのマッチング誤差を抽出する。ここで抽出されるマッチング誤差は、中ブロック401につきMAEmid(0)、中ブロック402につきMAEmid(1)、中ブロック403につきMAEmid(2)、中ブロック404につきMAEmid(3)とする。抽出された各マッチング誤差は、第一マクロブロックパーティション決定部6に送信される。なお、図4(a)は大ブロック400のマッチング誤差MAEbigが120の時、各中ブロックのマッチング誤差がMAEmid(0)=10、MAEmid(1)=10、MAEmid(2)=30、MAEmid(3)=70の例を示している。   The middle block error extraction unit 5 divides the large block 400 into 8 × 8 pixel macro blocks 401 to 404 (hereinafter referred to as middle blocks) as shown in FIG. Extract errors. The matching errors extracted here are MAEmid (0) for the middle block 401, MAEmid (1) for the middle block 402, MAEmid (2) for the middle block 403, and MAEmid (3) for the middle block 404. Each extracted matching error is transmitted to the first macroblock partition determination unit 6. 4A shows that when the matching error MAEbig of the large block 400 is 120, the matching errors of each middle block are MAEmid (0) = 10, MAEmid (1) = 10, MAEmid (2) = 30, MAEmid ( 3) An example of = 70 is shown.

次に、ステップS105において、第一マクロブロック(MB)パーティション決定部6は、現在の探索階層における各中ブロックのマッチング誤差と閾値とを比較し、以下のような条件でマクロブロックパーティションを決定する。ここでは、図2の(i)から(iv)のいずれかのマクロブロックパーティションが選択される。即ち、ここでは、16×16画素、16×8画素、8×16画素、又は、8×8画素のいずれかのブロックサイズが選択されることとなる。なお、以下において、閾値ThlとThmとの間には、Thl<Thmの関係が成立する。   Next, in step S105, the first macroblock (MB) partition determination unit 6 compares the matching error of each middle block in the current search hierarchy with a threshold value, and determines a macroblock partition under the following conditions. . Here, any one of the macroblock partitions (i) to (iv) in FIG. 2 is selected. That is, here, any block size of 16 × 16 pixels, 16 × 8 pixels, 8 × 16 pixels, or 8 × 8 pixels is selected. In the following, the relationship Thl <Thm is established between the threshold Thl and Thm.

(条件1)
MAEmid(0)<Thl, MAEmid(1)<Thl, MAEmid(2)<Thl, MAEmid(3)<Thl のとき、
マクロブロックパーティションを図2の(i)にする。
(Condition 1)
When MAEmid (0) <Thl, MAEmid (1) <Thl, MAEmid (2) <Thl, MAEmid (3) <Thl,
The macroblock partition is set to (i) in FIG.

(条件2)
MAEmid(0)<Thl, MAEmid(1)<Thl, MAEmid(2)<Thl, MAEmid(3)≧Thl のとき、
MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
MAEmid(1)+MAEmid(3)≧Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(1)+MAEmid(3)≧Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iv)にする。
(Condition 2)
When MAEmid (0) <Thl, MAEmid (1) <Thl, MAEmid (2) <Thl, MAEmid (3) ≧ Thl,
When MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (iii) in FIG.
When MAEmid (1) + MAEmid (3) ≧ Thm, MAEmid (2) + MAEmid (3) <Thm,
The macroblock partition is set to (ii) in FIG.
When MAEmid (1) + MAEmid (3) ≧ Thm, MAEmid (2) + MAEmid (3) ≧ Thm
The macroblock partition is set to (iv) in FIG.

(条件3)
MAEmid(0)<Thl, MAEmid(1)<Thl, MAEmid(2)≧Thl, MAEmid(3)<Thl のとき、
MAEmid(0)+MAEmid(2)<Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(0)+MAEmid(2)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
MAEmid(0)+MAEmid(2)≧Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(0)+MAEmid(2)≧Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iv)にする。
(Condition 3)
When MAEmid (0) <Thl, MAEmid (1) <Thl, MAEmid (2) ≧ Thl, MAEmid (3) <Thl,
When MAEmid (0) + MAEmid (2) <Thm, MAEmid (2) + MAEmid (3) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (0) + MAEmid (2) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (iii) in FIG.
When MAEmid (0) + MAEmid (2) ≧ Thm, MAEmid (2) + MAEmid (3) <Thm
The macroblock partition is set to (ii) in FIG.
When MAEmid (0) + MAEmid (2) ≧ Thm, MAEmid (2) + MAEmid (3) ≧ Thm
The macroblock partition is set to (iv) in FIG.

(条件4)
MAEmid(0)<Thl, MAEmid(1)<Thl, MAEmid(2)≧Thl, MAEmid(3)≧Thl のとき、
マクロブロックパーティションを図2の(ii)にする。
(Condition 4)
When MAEmid (0) <Thl, MAEmid (1) <Thl, MAEmid (2) ≧ Thl, MAEmid (3) ≧ Thl,
The macroblock partition is set to (ii) in FIG.

(条件5)
MAEmid(0)<Thl, MAEmid(1)≧Thl, MAEmid(2)<Thl, MAEmid(3)<Thl のとき、
MAEmid(1)+MAEmid(0)<Thm, MAEmid(1)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(1)+MAEmid(0)<Thm, MAEmid(1)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(1)+MAEmid(0)≧Thm, MAEmid(1)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
MAEmid(1)+MAEmid(0)≧Thm, MAEmid(1)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iv)にする。
(Condition 5)
When MAEmid (0) <Thl, MAEmid (1) ≧ Thl, MAEmid (2) <Thl, MAEmid (3) <Thl,
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (1) + MAEmid (3) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (1) + MAEmid (3) ≧ Thm
The macroblock partition is set to (ii) in FIG.
When MAEmid (1) + MAEmid (0) ≧ Thm, MAEmid (1) + MAEmid (3) <Thm,
The macroblock partition is set to (iii) in FIG.
When MAEmid (1) + MAEmid (0) ≧ Thm, MAEmid (1) + MAEmid (3) ≧ Thm
The macroblock partition is set to (iv) in FIG.

(条件6)
MAEmid(0)<Thl, MAEmid(1)≧Thl, MAEmid(2)<Thl, MAEmid(3)≧Thl のとき、
マクロブロックパーティションを図2の(iii)にする。
(Condition 6)
When MAEmid (0) <Thl, MAEmid (1) ≧ Thl, MAEmid (2) <Thl, MAEmid (3) ≧ Thl,
The macroblock partition is set to (iii) in FIG.

(条件7)
MAEmid(0)<Thl, MAEmid(1)≧Thl, MAEmid(2)≧Thl, MAEmid(3)<Thl のとき、
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)≧Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(1)+MAEmid(0)≧Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
それ以外の時
マクロブロックパーティションを図2の(iv)にする。
(Condition 7)
When MAEmid (0) <Thl, MAEmid (1) ≧ Thl, MAEmid (2) ≧ Thl, MAEmid (3) <Thl,
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) ≧ Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (ii) in FIG.
When MAEmid (1) + MAEmid (0) ≧ Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (iii) in FIG.
Otherwise, the macroblock partition is set to (iv) in FIG.

(条件8)
MAEmid(0)<Thl, MAEmid(1)≧Thl, MAEmid(2)≧Thl, MAEmid(3)≧Thl のとき、
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)≧Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(1)+MAEmid(0)≧Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
それ以外の時
マクロブロックパーティションを図2の(iv)にする。
(Condition 8)
When MAEmid (0) <Thl, MAEmid (1) ≧ Thl, MAEmid (2) ≧ Thl, MAEmid (3) ≧ Thl,
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) ≧ Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (ii) in FIG.
When MAEmid (1) + MAEmid (0) ≧ Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (iii) in FIG.
Otherwise, the macroblock partition is set to (iv) in FIG.

(条件9)
MAEmid(0)≧Thl, MAEmid(1)<Thl, MAEmid(2)<Thl, MAEmid(3)<Thl のとき、
MAEmid(0)+MAEmid(1)<Thm, MAEmid(0)+MAEmid(2)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(0)+MAEmid(1)<Thm, MAEmid(0)+MAEmid(2)≧Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(0)+MAEmid(1)≧Thm, MAEmid(0)+MAEmid(2)<Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
MAEmid(0)+MAEmid(1)≧Thm, MAEmid(0)+MAEmid(2)≧Thm のとき、
マクロブロックパーティションを図2の(iv)にする。
(Condition 9)
When MAEmid (0) ≧ Thl, MAEmid (1) <Thl, MAEmid (2) <Thl, MAEmid (3) <Thl,
When MAEmid (0) + MAEmid (1) <Thm, MAEmid (0) + MAEmid (2) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (0) + MAEmid (1) <Thm, MAEmid (0) + MAEmid (2) ≧ Thm
The macroblock partition is set to (ii) in FIG.
When MAEmid (0) + MAEmid (1) ≧ Thm, MAEmid (0) + MAEmid (2) <Thm,
The macroblock partition is set to (iii) in FIG.
When MAEmid (0) + MAEmid (1) ≧ Thm, MAEmid (0) + MAEmid (2) ≧ Thm
The macroblock partition is set to (iv) in FIG.

(条件10)
MAEmid(0)≧Thl, MAEmid(1)<Thl, MAEmid(2)<Thl, MAEmid(3)≧Thl のとき、
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)≧Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(1)+MAEmid(0)≧Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
それ以外の時
マクロブロックパーティションを図2の(iv)にする。
(Condition 10)
When MAEmid (0) ≧ Thl, MAEmid (1) <Thl, MAEmid (2) <Thl, MAEmid (3) ≧ Thl,
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) ≧ Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (ii) in FIG.
When MAEmid (1) + MAEmid (0) ≧ Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (iii) in FIG.
Otherwise, the macroblock partition is set to (iv) in FIG.

(条件11)
MAEmid(0)≧Thl, MAEmid(1)<Thl, MAEmid(2)≧Thl, MAEmid(3)<Thl のとき、
マクロブロックパーティションを図2の(ii)にする。
(Condition 11)
When MAEmid (0) ≧ Thl, MAEmid (1) <Thl, MAEmid (2) ≧ Thl, MAEmid (3) <Thl,
The macroblock partition is set to (ii) in FIG.

(条件12)
MAEmid(0)≧Thl, MAEmid(1)<Thl, MAEmid(2)≧Thl, MAEmid(3)≧Thl のとき、
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)≧Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(1)+MAEmid(0)≧Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
それ以外の時
マクロブロックパーティションを図2の(iv)にする。
(Condition 12)
When MAEmid (0) ≧ Thl, MAEmid (1) <Thl, MAEmid (2) ≧ Thl, MAEmid (3) ≧ Thl,
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) ≧ Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (ii) in FIG.
When MAEmid (1) + MAEmid (0) ≧ Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (iii) in FIG.
Otherwise, the macroblock partition is set to (iv) in FIG.

(条件13)
MAEmid(0)≧Thl, MAEmid(1)≧Thl, MAEmid(2)<Thl, MAEmid(3)<Thl のとき、
マクロブロックパーティションを図2の(ii)にする。
(Condition 13)
When MAEmid (0) ≧ Thl, MAEmid (1) ≧ Thl, MAEmid (2) <Thl, MAEmid (3) <Thl,
The macroblock partition is set to (ii) in FIG.

(条件14)
MAEmid(0)≧Thl, MAEmid(1)≧Thl, MAEmid(2)<Thl, MAEmid(3)≧Thl のとき、
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)≧Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(1)+MAEmid(0)≧Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
それ以外の時
マクロブロックパーティションを図2の(iv)にする。
(Condition 14)
When MAEmid (0) ≧ Thl, MAEmid (1) ≧ Thl, MAEmid (2) <Thl, MAEmid (3) ≧ Thl,
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) ≧ Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (ii) in FIG.
When MAEmid (1) + MAEmid (0) ≧ Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (iii) in FIG.
Otherwise, the macroblock partition is set to (iv) in FIG.

(条件15)
MAEmid(0)≧Thl, MAEmid(1)≧Thl, MAEmid(2)≧Thl, MAEmid(3)<Thl のとき、
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)≧Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(1)+MAEmid(0)≧Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
それ以外の時
マクロブロックパーティションを図2の(iv)にする。
(Condition 15)
When MAEmid (0) ≧ Thl, MAEmid (1) ≧ Thl, MAEmid (2) ≧ Thl, MAEmid (3) <Thl,
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) ≧ Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (ii) in FIG.
When MAEmid (1) + MAEmid (0) ≧ Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (iii) in FIG.
Otherwise, the macroblock partition is set to (iv) in FIG.

(条件16)
MAEmid(0)≧Thl, MAEmid(1)≧Thl, MAEmid(2)≧Thl, MAEmid(3)≧Thl のとき、
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)<Thm のとき、
マクロブロックパーティションを図2の(ii)及び(iii)にする。
MAEmid(1)+MAEmid(0)<Thm, MAEmid(0)+MAEmid(2)≧Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(ii)にする。
MAEmid(1)+MAEmid(0)≧Thm, MAEmid(0)+MAEmid(2)<Thm, MAEmid(1)+MAEmid(3)<Thm, MAEmid(2)+MAEmid(3)≧Thm のとき、
マクロブロックパーティションを図2の(iii)にする。
それ以外の時
マクロブロックパーティションを図2の(iv)にする。
(Condition 16)
When MAEmid (0) ≧ Thl, MAEmid (1) ≧ Thl, MAEmid (2) ≧ Thl, MAEmid (3) ≧ Thl,
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) <Thm,
Macroblock partitions are set to (ii) and (iii) in FIG.
When MAEmid (1) + MAEmid (0) <Thm, MAEmid (0) + MAEmid (2) ≧ Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (ii) in FIG.
When MAEmid (1) + MAEmid (0) ≧ Thm, MAEmid (0) + MAEmid (2) <Thm, MAEmid (1) + MAEmid (3) <Thm, MAEmid (2) + MAEmid (3) ≧ Thm,
The macroblock partition is set to (iii) in FIG.
Otherwise, the macroblock partition is set to (iv) in FIG.

ここで、例えばThl=15、Thm=40とすると図4(a)の例では、上記の(条件4)の場合が適用され、マクロブロックパーティションとして図2の(ii)が選択される。なお、マクロブロックパーティションが図2の(i)になった場合には、大ブロック探索モードがオンに設定される。また、図2の(i)以外のマクロブロックパーティションが選択された場合は、大ブロック探索モードの設定はオフのまま維持される。   Here, for example, assuming that Thl = 15 and Thm = 40, in the example of FIG. 4A, the case of the above (condition 4) is applied, and (ii) of FIG. 2 is selected as the macroblock partition. When the macroblock partition becomes (i) in FIG. 2, the large block search mode is set to ON. When a macroblock partition other than (i) in FIG. 2 is selected, the large block search mode setting is kept off.

次に、ステップS106では、大ブロック探索モードがオンに設定されているか否かを再度判定する。上記のように、ステップS105において、マクロブロックパーティションとして図2の(i)のタイプが選択された場合には大ブロック探索モードがオンに設定される。そこで、大ブロック探索モードがオンに設定されていると判定された場合には(ステップS106において「YES」)、ステップS120に移行して、探索階層を1つ更新してステップS101に戻る。ステップS101では、ステップS102において大ブロック動きベクトル検出部3で既に算出済の動きベクトルを用いて新たなマッチング位置を設定し、最下位階層まで大ブロックでの探索を繰り返す。   Next, in step S106, it is determined again whether the large block search mode is set to ON. As described above, in step S105, when the type (i) of FIG. 2 is selected as the macroblock partition, the large block search mode is set to ON. Therefore, when it is determined that the large block search mode is set to ON (“YES” in step S106), the process proceeds to step S120, one search hierarchy is updated, and the process returns to step S101. In step S101, a new matching position is set using the motion vector already calculated by the large block motion vector detection unit 3 in step S102, and the search in the large block is repeated up to the lowest layer.

このように、下位階層の探索で用いるマクロブロックパーティションを限定することで、全てのマクロブロックパーティションで探索を行った場合に比べ、演算処理を大幅に削減することができる。   As described above, by limiting the macroblock partitions used in the search of the lower hierarchy, the arithmetic processing can be greatly reduced as compared with the case where the search is performed in all the macroblock partitions.

一方、大ブロック探索モードがオフに設定されていると判定された場合には(ステップS106において「NO」)、ステップS107に移行する。ステップS107では、中ブロック動きベクトル検出部7が、第一マクロブロックパーティション決定部6からマクロブロックパーティションと動きベクトルを取得し、該動きベクトルを用いてマッチング位置を決定する。   On the other hand, when it is determined that the large block search mode is set to OFF (“NO” in step S106), the process proceeds to step S107. In step S107, the middle block motion vector detection unit 7 acquires a macroblock partition and a motion vector from the first macroblock partition determination unit 6, and determines a matching position using the motion vector.

次に、ステップS108では、取得したマクロブロックパーティションを用いて、各ブロック毎に参照画像記憶部4から入力される参照画像データとのマッチング誤差MAEmidを算出する。マッチング誤差MAEmidは各探索階層について算出され、最終的に探索範囲(全探索階層)におけるマッチング誤差MAEmidが最も小さくなる時の動きベクトルと、その時のマッチング誤差とが求められる。この動きベクトルを「最終的な動きベクトル」という。なお、このとき、マクロブロックパーティションとして図2(iv)以外が選択されている場合には、中ブロック探索モードをオンに設定する。一方、図2(iv)が選択されている場合には、中ブロック探索モードをオフに設定する。   Next, in step S108, a matching error MAEmid with reference image data input from the reference image storage unit 4 is calculated for each block using the acquired macroblock partition. The matching error MAEmid is calculated for each search layer, and finally, a motion vector when the matching error MAEmid in the search range (all search layers) becomes the smallest and the matching error at that time are obtained. This motion vector is referred to as a “final motion vector”. At this time, when a macro block partition other than FIG. 2 (iv) is selected, the middle block search mode is set to ON. On the other hand, when FIG. 2 (iv) is selected, the middle block search mode is set to OFF.

次に、ステップS109では、中ブロック探索モードがオンに設定されているか否かを判定する。中ブロック探索モードとは、「中ブロック」での探索を下位の探索階層を通じて行うモードである。この中ブロック探索モードがオンに設定されている場合には、これ以降大ブロック或いは小ブロックによる探索は行われない。   Next, in step S109, it is determined whether or not the middle block search mode is set to ON. The middle block search mode is a mode in which a search in “medium block” is performed through a lower search hierarchy. When the middle block search mode is set to ON, the search using the large block or the small block is not performed thereafter.

ステップS109で、中ブロック探索モードがオンに設定されていると判定された場合には(ステップS109において「YES」)、ステップS121に移行する。ステップS121では、探索階層が最下位の探索階層か否かを判定する。もし最下位の探索階層と判定された場合には(ステップS121において「YES」)、ステップS117へ移行する。ステップS117では、最終マクロブロックパーティション・最終動きベクトル決定部11が、そのときのマクロブロックパーティションの情報と最終的な動きベクトルとを中ブロック動きベクトル検出部7から受信する。一方、最下位の探索階層でないと判定された場合には(ステップS121において「NO」)、ステップS122に移行して、探索階層を1つ更新し、一つ下位の探索階層についてステップS107からの処理を継続する。   If it is determined in step S109 that the middle block search mode is set to ON (“YES” in step S109), the process proceeds to step S121. In step S121, it is determined whether the search hierarchy is the lowest search hierarchy. If it is determined that the search hierarchy is the lowest ("YES" in step S121), the process proceeds to step S117. In step S117, the final macroblock partition / final motion vector determination unit 11 receives the macroblock partition information and the final motion vector at that time from the middle block motion vector detection unit 7. On the other hand, if it is determined that it is not the lowest search hierarchy (“NO” in step S121), the process proceeds to step S122, one search hierarchy is updated, and one lower search hierarchy from step S107 is updated. Continue processing.

これにより、下位階層の探索で用いるマクロブロックパーティションを限定することで、全てのマクロブロックパーティションで探索を行った場合に比べ、演算処理を大幅に削減することができる。   As a result, by limiting the macroblock partitions used in the search of the lower hierarchy, the arithmetic processing can be greatly reduced as compared with the case where the search is performed in all the macroblock partitions.

ステップS109で、中ブロック探索モードがオフに設定されていると判定された場合には(ステップS109において「NO」)、ステップS110に移行する。ステップS110では、中ブロック誤差抽出部5で用いられたマクロブロックパーティションが図2(iv)のパターンであるか否かを判定する。もし、図2(iv)のパターンでないと判定された場合は(ステップS110において「NO」)、ステップS121に移行して上記の処理を行う。一方、図2(iv)のパターンであると判定された場合には(ステップS110において「YES」)、ステップS111に移行する。   If it is determined in step S109 that the medium block search mode is set to OFF (“NO” in step S109), the process proceeds to step S110. In step S110, it is determined whether or not the macroblock partition used in the middle block error extraction unit 5 has the pattern shown in FIG. If it is determined that the pattern is not the pattern shown in FIG. 2 (iv) (“NO” in step S110), the process proceeds to step S121 and the above processing is performed. On the other hand, if it is determined that the pattern is that of FIG. 2 (iv) (“YES” in step S110), the process proceeds to step S111.

ステップS111では、小ブロック誤差抽出部8が、中ブロック動きベクトル探索部7から、中ブロックでの各マッチング誤差と動きベクトルを取得する。   In step S <b> 111, the small block error extraction unit 8 acquires each matching error and motion vector in the middle block from the middle block motion vector search unit 7.

小ブロック誤差抽出部8は、図4(b)に示すように8×8画素のマクロブロック410を更に4×4画素サイズのサブマクロブロック411から414(以下、小ブロックと呼ぶ)に分割した後、各小ブロックごとのマッチング誤差を抽出する。ここで抽出されるマッチング誤差は、小ブロック411につきMAElow(0)、小ブロック412につきMAElow(1)、小ブロック413につきMAElow(2)、小ブロック414につきMAElow(3)とする。抽出された各マッチング誤差は、サブマクロブロックパーティション決定部9に送信される。なお、図4(b)はマクロブロック410のマッチング誤差MAElowが30の時、各小ブロックのマッチング誤差がMAElow(0)=3、MAElow(1)=3、MAElow(2)=7、MAElow(3)=17の例を示している。   The small block error extraction unit 8 further divides the 8 × 8 pixel macroblock 410 into sub-macroblocks 411 to 414 (hereinafter referred to as small blocks) having a 4 × 4 pixel size, as shown in FIG. 4B. After that, the matching error for each small block is extracted. The matching errors extracted here are MAElow (0) for the small block 411, MAElow (1) for the small block 412, MAElow (2) for the small block 413, and MAElow (3) for the small block 414. Each extracted matching error is transmitted to the sub macroblock partition determination unit 9. 4B, when the matching error MAElow of the macroblock 410 is 30, the matching error of each small block is MAElow (0) = 3, MAElow (1) = 3, MAElow (2) = 7, MAElow ( 3) = 17 example.

なお、ステップS111移行の処理は、図2(iv)の8×8画素のマクロブロックの1つずつについて、それぞれ実行される。これにより、各マクロブロック毎に、サブマクロブロックパーティションが決定され、決定されたサブマクロブロックパーティションに応じた動きベクトルの検出が行われる。   Note that the process of step S111 is executed for each of the 8 × 8 pixel macroblocks in FIG. Thereby, a sub macroblock partition is determined for each macroblock, and a motion vector corresponding to the determined submacroblock partition is detected.

ステップS112においてサブマクロブロック(SMB)パーティション決定部9は、現在の探索階層における各小ブロックのマッチング誤差と閾値を比較し、以下のような条件でサブマクロブロックパーティションを決定する。ここでは、図2の(v)から(viii)のいずれかのサブマクロブロックパーティションが選択される。即ち、ここでは、8×8画素、8×4画素、4×8画素、又は、4×4画素のいずれかのブロックサイズが選択されることとなる。なお、以下において、閾値ThllとThmlとの間には、Thll<Thmlの関係が成立する。   In step S112, the sub-macroblock (SMB) partition determination unit 9 compares the matching error of each small block in the current search hierarchy with a threshold value, and determines a sub-macroblock partition under the following conditions. Here, any one of the sub-macroblock partitions (v) to (viii) in FIG. 2 is selected. That is, here, any block size of 8 × 8 pixels, 8 × 4 pixels, 4 × 8 pixels, or 4 × 4 pixels is selected. In the following, a relationship of Thll <Thml is established between the threshold values Thll and Thml.

(条件1’)
MAElow(0)<Thll, MAElow(1)<Thll, MAElow(2)<Thll, MAElow(3)<Thll のとき、
サブマクロブロックパーティションを図2の(v)にする。
(Condition 1 ')
When MAElow (0) <Thll, MAElow (1) <Thll, MAElow (2) <Thll, MAElow (3) <Thll,
The sub macroblock partition is set to (v) in FIG.

(条件2’)
MAElow(0)<Thll, MAElow(1)<Thll, MAElow(2)<Thll, MAElow(3)≧Thll のとき、
MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
MAElow(1)+MAElow(3)≧Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(1)+MAElow(3)≧Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 2 ')
When MAElow (0) <Thll, MAElow (1) <Thll, MAElow (2) <Thll, MAElow (3) ≧ Thll,
When MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) <Thml,
The sub macroblock partitions are set to (vi) and (vii) in FIG.
When MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml,
The sub macroblock partition is set to (vii) in FIG.
When MAElow (1) + MAElow (3) ≧ Thml, MAElow (2) + MAElow (3) <Thml,
The sub macroblock partition is set to (vi) in FIG.
When MAElow (1) + MAElow (3) ≧ Thml, MAElow (2) + MAElow (3) ≧ Thml,
The sub macroblock partition is set to (viii) in FIG.

(条件3’)
MAElow(0)<Thll, MAElow(1)<Thll, MAElow(2)≧Thll, MAElow(3)<Thll のとき、
MAElow(0)+MAElow(2)<Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(0)+MAElow(2)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
MAElow(0)+MAElow(2)≧Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(0)+MAElow(2)≧Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 3 ')
When MAElow (0) <Thll, MAElow (1) <Thll, MAElow (2) ≧ Thll, MAElow (3) <Thll,
When MAElow (0) + MAElow (2) <Thml, MAElow (2) + MAElow (3) <Thml,
The sub macroblock partitions are set to (vi) and (vii) in FIG.
When MAElow (0) + MAElow (2) <Thml, MAElow (2) + MAElow (3) ≧ Thml,
The sub macroblock partition is set to (vii) in FIG.
When MAElow (0) + MAElow (2) ≧ Thml, MAElow (2) + MAElow (3) <Thml,
The sub macroblock partition is set to (vi) in FIG.
When MAElow (0) + MAElow (2) ≧ Thml, MAElow (2) + MAElow (3) ≧ Thml,
The sub macroblock partition is set to (viii) in FIG.

(条件4’)
MAElow(0)<Thll, MAElow(1)<Thll, MAElow(2)≧Thll, MAElow(3)≧Thll のとき、
サブマクロブロックパーティションを図2の(vi)にする。
(Condition 4 ')
When MAElow (0) <Thll, MAElow (1) <Thll, MAElow (2) ≧ Thll, MAElow (3) ≧ Thll
The sub macroblock partition is set to (vi) in FIG.

(条件5’)
MAElow(0)<Thll, MAElow(1)≧Thll, MAElow(2)<Thll, MAElow(3)<Thll のとき、
MAElow(1)+MAElow(0)<Thml, MAElow(1)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(1)+MAElow(0)<Thml, MAElow(1)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(1)+MAElow(0)≧Thml, MAElow(1)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
MAElow(1)+MAElow(0)≧Thml, MAElow(1)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 5 ')
When MAElow (0) <Thll, MAElow (1) ≧ Thll, MAElow (2) <Thll, MAElow (3) <Thll,
When MAElow (1) + MAElow (0) <Thml, MAElow (1) + MAElow (3) <Thml,
The sub macroblock partitions are set to (vi) and (vii) in FIG.
When MAElow (1) + MAElow (0) <Thml, MAElow (1) + MAElow (3) ≧ Thml,
The sub macroblock partition is set to (vi) in FIG.
When MAElow (1) + MAElow (0) ≧ Thml, MAElow (1) + MAElow (3) <Thml,
The sub macroblock partition is set to (vii) in FIG.
When MAElow (1) + MAElow (0) ≧ Thml, MAElow (1) + MAElow (3) ≧ Thml,
The sub macroblock partition is set to (viii) in FIG.

(条件6’)
MAElow(0)<Thll, MAElow(1)≧Thll, MAElow(2)<Thll, MAElow(3)≧Thll のとき、
サブマクロブロックパーティションを図2の(vii)にする。
(Condition 6 ')
When MAElow (0) <Thll, MAElow (1) ≧ Thll, MAElow (2) <Thll, MAElow (3) ≧ Thll,
The sub macroblock partition is set to (vii) in FIG.

(条件7’)
MAElow(0)<Thll, MAElow(1)≧Thll, MAElow(2)≧Thll, MAElow(3)<Thll のとき、
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)≧Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(1)+MAElow(0)≧Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
それ以外の時
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 7 ')
When MAElow (0) <Thll, MAElow (1) ≧ Thll, MAElow (2) ≧ Thll, MAElow (3) <Thll,
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) <Thml
The sub macroblock partitions are set to (vi) and (vii) in FIG.
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) ≧ Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vi) in FIG.
MAElow (1) + MAElow (0) ≧ Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vii) in FIG.
In other cases, the sub-macroblock partition is set to (viii) in FIG.

(条件8’)
MAElow(0)<Thll, MAElow(1)≧Thll, MAElow(2)≧Thll, MAElow(3)≧Thll のとき、
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)≧Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(1)+MAElow(0)≧Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
それ以外の時
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 8 ')
When MAElow (0) <Thll, MAElow (1) ≧ Thll, MAElow (2) ≧ Thll, MAElow (3) ≧ Thll
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) <Thml
The sub macroblock partitions are set to (vi) and (vii) in FIG.
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) ≧ Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vi) in FIG.
MAElow (1) + MAElow (0) ≧ Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vii) in FIG.
In other cases, the sub-macroblock partition is set to (viii) in FIG.

(条件9’)
MAElow(0)≧Thll, MAElow(1)<Thll, MAElow(2)<Thll, MAElow(3)<Thll のとき、
MAElow(0)+MAElow(1)<Thml, MAElow(0)+MAElow(2)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(0)+MAElow(1)<Thml, MAElow(0)+MAElow(2)≧Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(0)+MAElow(1)≧Thml, MAElow(0)+MAElow(2)<Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
MAElow(0)+MAElow(1)≧Thml, MAElow(0)+MAElow(2)≧Thml のとき、
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 9 ')
When MAElow (0) ≧ Thll, MAElow (1) <Thll, MAElow (2) <Thll, MAElow (3) <Thll,
When MAElow (0) + MAElow (1) <Thml, MAElow (0) + MAElow (2) <Thml,
The sub macroblock partitions are set to (vi) and (vii) in FIG.
When MAElow (0) + MAElow (1) <Thml, MAElow (0) + MAElow (2) ≧ Thml,
The sub macroblock partition is set to (vi) in FIG.
When MAElow (0) + MAElow (1) ≧ Thml, MAElow (0) + MAElow (2) <Thml,
The sub macroblock partition is set to (vii) in FIG.
When MAElow (0) + MAElow (1) ≧ Thml, MAElow (0) + MAElow (2) ≧ Thml,
The sub macroblock partition is set to (viii) in FIG.

(条件10’)
MAElow(0)≧Thll, MAElow(1)<Thll, MAElow(2)<Thll, MAElow(3)≧Thll のとき、
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)≧Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(1)+MAElow(0)≧Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
それ以外の時
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 10 ')
When MAElow (0) ≧ Thll, MAElow (1) <Thll, MAElow (2) <Thll, MAElow (3) ≧ Thll,
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) <Thml
The sub macroblock partitions are set to (vi) and (vii) in FIG.
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) ≧ Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vi) in FIG.
MAElow (1) + MAElow (0) ≧ Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vii) in FIG.
In other cases, the sub-macroblock partition is set to (viii) in FIG.

(条件11’)
MAElow(0)≧Thll, MAElow(1)<Thll, MAElow(2)≧Thll, MAElow(3)<Thll のとき、
サブマクロブロックパーティションを図2の(vi)にする。
(Condition 11 ')
When MAElow (0) ≧ Thll, MAElow (1) <Thll, MAElow (2) ≧ Thll, MAElow (3) <Thll,
The sub macroblock partition is set to (vi) in FIG.

(条件12’)
MAElow(0)≧Thll, MAElow(1)<Thll, MAElow(2)≧Thll, MAElow(3)≧Thll のとき、
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)≧Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(1)+MAElow(0)≧Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
それ以外の時
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 12 ')
When MAElow (0) ≧ Thll, MAElow (1) <Thll, MAElow (2) ≧ Thll, MAElow (3) ≧ Thll,
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) <Thml
The sub macroblock partitions are set to (vi) and (vii) in FIG.
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) ≧ Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vi) in FIG.
MAElow (1) + MAElow (0) ≧ Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vii) in FIG.
In other cases, the sub-macroblock partition is set to (viii) in FIG.

(条件13’)
MAElow(0)≧Thll, MAElow(1)≧Thll, MAElow(2)<Thll, MAElow(3)<Thll のとき、
サブマクロブロックパーティションを図2の(vi)にする。
(Condition 13 ')
When MAElow (0) ≧ Thll, MAElow (1) ≧ Thll, MAElow (2) <Thll, MAElow (3) <Thll,
The sub macroblock partition is set to (vi) in FIG.

(条件14’)
MAElow(0)≧Thll, MAElow(1)≧Thll, MAElow(2)<Thll, MAElow(3)≧Thll のとき、
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)≧Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(1)+MAElow(0)≧Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
それ以外の時
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 14 ')
When MAElow (0) ≧ Thll, MAElow (1) ≧ Thll, MAElow (2) <Thll, MAElow (3) ≧ Thll
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) <Thml
The sub macroblock partitions are set to (vi) and (vii) in FIG.
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) ≧ Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vi) in FIG.
MAElow (1) + MAElow (0) ≧ Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vii) in FIG.
In other cases, the sub-macroblock partition is set to (viii) in FIG.

(条件15’)
MAElow(0)≧Thll, MAElow(1)≧Thll, MAElow(2)≧Thll, MAElow(3)<Thll のとき、
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)≧Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(1)+MAElow(0)≧Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
それ以外の時
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 15 ')
When MAElow (0) ≧ Thll, MAElow (1) ≧ Thll, MAElow (2) ≧ Thll, MAElow (3) <Thll,
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) <Thml
The sub macroblock partitions are set to (vi) and (vii) in FIG.
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) ≧ Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vi) in FIG.
MAElow (1) + MAElow (0) ≧ Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vii) in FIG.
In other cases, the sub-macroblock partition is set to (viii) in FIG.

(条件16’)
MAElow(0)≧Thll, MAElow(1)≧Thll, MAElow(2)≧Thll, MAElow(3)≧Thll のとき、
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)<Thml のとき、
サブマクロブロックパーティションを図2の(vi)及び(vii)にする。
MAElow(1)+MAElow(0)<Thml, MAElow(0)+MAElow(2)≧Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vi)にする。
MAElow(1)+MAElow(0)≧Thml, MAElow(0)+MAElow(2)<Thml, MAElow(1)+MAElow(3)<Thml, MAElow(2)+MAElow(3)≧Thml のとき、
サブマクロブロックパーティションを図2の(vii)にする。
それ以外の時
サブマクロブロックパーティションを図2の(viii)にする。
(Condition 16 ')
When MAElow (0) ≧ Thll, MAElow (1) ≧ Thll, MAElow (2) ≧ Thll, MAElow (3) ≧ Thll,
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) <Thml
The sub macroblock partitions are set to (vi) and (vii) in FIG.
MAElow (1) + MAElow (0) <Thml, MAElow (0) + MAElow (2) ≧ Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vi) in FIG.
MAElow (1) + MAElow (0) ≧ Thml, MAElow (0) + MAElow (2) <Thml, MAElow (1) + MAElow (3) <Thml, MAElow (2) + MAElow (3) ≧ Thml
The sub macroblock partition is set to (vii) in FIG.
In other cases, the sub-macroblock partition is set to (viii) in FIG.

ここで、例えばThll=4、Thml=10とすると図4(b)の例では、上記の(条件4’)の場合が適用され、サブマクロブロックパーティションとして図2の(vi)が選択される。なお、サブマクロブロックパーティションが図2の(v)になった場合には、中ブロック探索モードがオンに設定される。また、図2の(v)以外のサブマクロブロックパーティションが選択された場合は、中ブロック探索モードの設定はオフのまま、小ブロック探索モードがオンに設定される。   Here, for example, assuming that Thll = 4 and Thml = 10, in the example of FIG. 4B, the above-mentioned case (condition 4 ′) is applied, and (vi) of FIG. 2 is selected as the sub macroblock partition. . When the sub macroblock partition becomes (v) in FIG. 2, the middle block search mode is set to ON. In addition, when a sub macroblock partition other than (v) in FIG. 2 is selected, the small block search mode is set to ON while the setting of the medium block search mode remains OFF.

次に、ステップS113において、小ブロック探索モードがオンに設定されているか否かが判定される。小ブロック探索モードがオンの場合には(ステップS113において「YES」)、ステップS114に移行する。この場合、8×8画素のマクロブロックが、図2(v)以外のサブマクロブロックパーティションが選択されたこととなる。一方、小ブロック探索モードがオフの場合には(ステップS113において「NO」)、中ブロック探索モードがオンに設定されており、ステップS121に移行する。この場合、8×8画素のマクロブロックについて、図2(v)のサブマクロブロックパーティションが選択されたこととなるので、8×8画素の中ブロックについて動きベクトル検出が行われる。   Next, in step S113, it is determined whether or not the small block search mode is set to ON. When the small block search mode is on (“YES” in step S113), the process proceeds to step S114. In this case, a sub-macroblock partition other than that of FIG. 2 (v) is selected as the 8 × 8 pixel macroblock. On the other hand, when the small block search mode is OFF (“NO” in step S113), the medium block search mode is set to ON, and the process proceeds to step S121. In this case, since the sub macroblock partition of FIG. 2 (v) is selected for the 8 × 8 pixel macroblock, motion vector detection is performed for the middle block of 8 × 8 pixels.

ステップS114では、小ブロック動きベクトル探索部10が、中ブロック動きベクトル検出部7から、サブマクロブロックパーティションの情報と動きベクトルとを取得する。小ブロック動きベクトル探索部10は、該動きベクトルを用いて新たなマッチング位置を設定する。   In step S <b> 114, the small block motion vector search unit 10 acquires the sub macroblock partition information and the motion vector from the middle block motion vector detection unit 7. The small block motion vector search unit 10 sets a new matching position using the motion vector.

次に、ステップS115では、小ブロック動きベクトル探索部10が、サブマクロブロックパーティションで参照画像記憶部4から入力される参照画像データとの探索範囲におけるマッチング誤差MAElowを算出する。マッチング誤差MAElowは各探索階層について算出され、最終的に探索範囲(全探索階層)におけるマッチング誤差MAElowが最も小さくなる時の動きベクトルと、その時のマッチング誤差とが求められる。この動きベクトルを「最終的な動きベクトル」という。   Next, in step S115, the small block motion vector search unit 10 calculates a matching error MAElow in the search range with reference image data input from the reference image storage unit 4 in the sub macroblock partition. The matching error MAElow is calculated for each search layer, and finally, the motion vector when the matching error MAElow in the search range (all search layers) becomes the smallest and the matching error at that time are obtained. This motion vector is referred to as a “final motion vector”.

続くステップS116では、探索階層が最下位の探索階層か否かを判定する。もし最下位の探索階層と判定された場合には(ステップS116において「YES」)、ステップS117へ移行する。ステップS117では、最終マクロブロックパーティション・最終動きベクトル決定部11が、そのときのサブマクロブロックパーティションの情報と最終的な動きベクトルとを小ブロック動きベクトル探索部10から受信する。一方、最下位の探索階層でないと判定された場合には(ステップS116において「NO」)、ステップS123に移行して、探索階層を1つ更新し、一つ下位の探索階層についてステップS114からの処理を継続する。   In a succeeding step S116, it is determined whether or not the search hierarchy is the lowest search hierarchy. If it is determined that the search hierarchy is the lowest ("YES" in step S116), the process proceeds to step S117. In step S117, the final macroblock partition / final motion vector determination unit 11 receives the sub-macroblock partition information and the final motion vector at that time from the small block motion vector search unit 10. On the other hand, when it is determined that it is not the lowest search hierarchy (“NO” in step S116), the process proceeds to step S123, one search hierarchy is updated, and one search hierarchy from step S114 is updated. Continue processing.

最終マクロブロックパーティション・最終動きベクトル決定部11は、ステップS117において、マクロブロックパーティションの情報と最終的な動きベクトルの情報とを受信する。これらの情報は、上記のように、大ブロック動きベクトル検出部3、中ブロック動きベクトル検出部7及び小ブロック動きベクトル検出部10のいずれかから送信される。続くステップS124では、最終マクロブロックパーティション・最終動きベクトル決定部11は、受信した情報を、動き検出部2014の外部のインター予測部2013とエントロピー符号化部2004に送信する。   In step S117, the final macroblock partition / final motion vector determination unit 11 receives macroblock partition information and final motion vector information. These pieces of information are transmitted from any one of the large block motion vector detection unit 3, the medium block motion vector detection unit 7, and the small block motion vector detection unit 10 as described above. In subsequent step S <b> 124, the final macroblock partition / final motion vector determination unit 11 transmits the received information to the inter prediction unit 2013 and the entropy coding unit 2004 outside the motion detection unit 2014.

以上の実施形態では、全てのブロックサイズについて探索画素精度を水平方向、垂直方向ともに一画素として実施することができる。その一方で、探索階層に応じて探索精度を異ならせても良い。   In the above embodiment, the search pixel accuracy can be implemented as one pixel in both the horizontal direction and the vertical direction for all block sizes. On the other hand, the search accuracy may be varied depending on the search hierarchy.

例えば、上位階層で水平方向での探索精度を1画素飛びにし、下位階層では水平方向、垂直方向ともに一画素精度で探索を行う場合を考える。
ここで、上位階層で水平方向、垂直方向ともに一画素精度で探索を行っていた時のマクロブロックのサイズが水平16×垂直16だった場合、探索精度が水平1画素飛びで同一探索範囲に相当するマクロブロックサイズは水平8×垂直16になる。この時、ブロックの分割は水平4×垂直8で行い、閾値との比較を行うことができる。その結果に従い、下位階層で使用するブロックサイズを決定し、下位階層では水平方向、垂直方向ともに一画素精度の探索を行うことができる。
For example, consider a case in which the search accuracy in the horizontal direction is skipped by one pixel in the upper layer, and the search is performed with one pixel accuracy in the horizontal and vertical directions in the lower layer.
Here, when the size of the macroblock is 16 × vertical 16 when searching at one pixel accuracy in both the horizontal and vertical directions in the upper layer, the search accuracy is equivalent to the same search range with one horizontal pixel skip. The macroblock size to be performed is horizontal 8 × vertical 16. At this time, the block is divided horizontally 4 × vertically 8 and can be compared with a threshold value. According to the result, the block size to be used in the lower hierarchy is determined, and a search with one pixel accuracy can be performed in the horizontal and vertical directions in the lower hierarchy.

以上の発明の実施形態によれば、大きなサイズのマクロブロックタイプから、複数の探索階層について使用する適切なマクロブロックパーティションを絞り込んでいくことが可能である。これにより、複数の参照フレームのそれぞれについて、全てのマクロブロックパーティション及びサブマクロブロックパーティションに対して動き探索を行わなくてもよい。よって、動き検出に関する演算負荷を大幅に低減することができる。その結果として、装置のバッテリー消費量を押さえることができ、高画質対応のビデオカメラシステムでも長時間撮影を実現することができる。   According to the embodiments of the invention described above, it is possible to narrow down appropriate macroblock partitions to be used for a plurality of search hierarchies from a large size macroblock type. Thereby, it is not necessary to perform motion search for all macroblock partitions and sub-macroblock partitions for each of a plurality of reference frames. Therefore, the calculation load regarding motion detection can be significantly reduced. As a result, the battery consumption of the apparatus can be reduced, and long-time shooting can be realized even with a video camera system compatible with high image quality.

[その他の実施形態]
なお、本発明は、複数の機器(例えばホストコンピュータ、インタフェイス機器、リーダ、プリンタなど)から構成されるシステムに適用しても、一つの機器からなる装置(例えば、複写機、ファクシミリ装置など)に適用してもよい。
[Other Embodiments]
Note that the present invention can be applied to a system including a plurality of devices (for example, a host computer, an interface device, a reader, and a printer), and a device (for example, a copying machine and a facsimile device) including a single device. You may apply to.

また、本発明の目的は、前述した機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システムに供給し、そのシステムがプログラムコードを読み出し実行することによっても達成される。この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現し、そのプログラムコードを記憶した記憶媒体は本発明を構成する。また、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているオペレーティングシステム(OS)などが実際の処理の一部または全部を行い、その処理によって前述した機能が実現される場合も含まれる。   The object of the present invention can also be achieved by supplying a storage medium storing software program codes for realizing the above-described functions to the system, and the system reading and executing the program codes. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the program code constitutes the present invention. In addition, an operating system (OS) running on a computer performs part or all of actual processing based on an instruction of the program code, and the above-described functions are realized by the processing.

さらに、以下の形態で実現しても構わない。すなわち、記憶媒体から読み出されたプログラムコードを、コンピュータに挿入された機能拡張カードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込む。そして、そのプログラムコードの指示に基づき、その機能拡張カードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行って、前述した機能が実現される場合も含まれる。   Furthermore, you may implement | achieve with the following forms. That is, the program code read from the storage medium is written into a memory provided in a function expansion card inserted into the computer or a function expansion unit connected to the computer. Then, based on the instruction of the program code, the case where the above-described functions are realized by the CPU included in the function expansion card or the function expansion unit performing part or all of the actual processing is also included.

本発明を上記記憶媒体に適用する場合、その記憶媒体には、先に説明したフローチャートに対応するプログラムコードが格納されることになる。   When the present invention is applied to the storage medium, the storage medium stores program codes corresponding to the flowcharts described above.

発明の実施形態に対応する画像処理装置の全体構の一例を示す図である。It is a figure which shows an example of the whole structure of the image processing apparatus corresponding to embodiment of invention. 発明の実施形態に対応する動きベクトル検出装置の構成の一例を示す図である。It is a figure which shows an example of a structure of the motion vector detection apparatus corresponding to embodiment of invention. 動きベクトル検出のために用いるブロックサイズの一例を示す図である。It is a figure which shows an example of the block size used for a motion vector detection. 発明の実施形態に対応する動き検出部における、入力画像データ中の1つのマクロブロックについて、動きベクトルを検出し、マクロブロックパーティションを決定する処理の一例を示すフローチャートである。It is a flowchart which shows an example of the process which detects a motion vector about one macroblock in input image data, and determines a macroblock partition in the motion detection part corresponding to embodiment of invention. 発明の実施形態に対応する、大ブロック、中ブロック、小ブロックにおけるマッチング誤差の内訳を説明するための図である。It is a figure for demonstrating the breakdown of the matching error in a large block, a medium block, and a small block corresponding to embodiment of invention. 複数の参照フレームから動き情報を検出する概念を説明するための図である。It is a figure for demonstrating the concept which detects motion information from a some reference frame.

Claims (12)

処理対象画像データと複数の参照画像データとを用いて動きベクトルを検出する動きベクトル検出装置であって、
前記処理対象画像データにおける第1のブロックサイズを有する第1の画像データとの第1のマッチング誤差が最小となる、前記複数の参照画像データのうち第1の参照画像データにおける前記第1のブロックサイズを有する第2の画像データを決定し、該第1の画像データと該第2の画像データとに基づく第1の動きベクトルを検出する第1の動きベクトル検出手段と、
前記第1の画像データを、前記第1のブロックサイズより小さい第2のブロックサイズを有する複数の第3の画像データに分割し、最小となる前記第1のマッチング誤差から、該複数の第3の画像データのそれぞれに対応する複数の第2のマッチング誤差を抽出する第1の抽出手段と、
前記第1の抽出手段により抽出された前記複数の第2のマッチング誤差のそれぞれを所定の閾値と比較し、各第2のマッチング誤差と前記所定の閾値との比較結果が予め定められた複数の条件の何れに適合するかを判定して、当該適合した条件に従って、前記複数の参照画像データを利用した動きベクトルの検出に用いる第3のブロックサイズを決定する第1の決定手段と
を備えることを特徴とする動きベクトル検出装置。
A motion vector detection device that detects a motion vector using processing target image data and a plurality of reference image data,
The first block in the first reference image data among the plurality of reference image data, wherein the first matching error with the first image data having the first block size in the processing target image data is minimized. First motion vector detecting means for determining second image data having a size and detecting a first motion vector based on the first image data and the second image data;
The first image data is divided into a plurality of third image data having a second block size smaller than the first block size, and the plurality of third image data is calculated based on the first matching error that is minimized. First extraction means for extracting a plurality of second matching errors corresponding to each of the image data;
Each of the plurality of second matching errors extracted by the first extracting means is compared with a predetermined threshold value, and a plurality of predetermined comparison results between each second matching error and the predetermined threshold value are determined. First determination means for determining which of the conditions is met, and determining a third block size used for motion vector detection using the plurality of reference image data according to the adapted conditions. A motion vector detection device characterized by the above.
前記第3のブロックサイズが第1のブロックサイズと一致する場合に、
前記第1の動きベクトル検出手段は、前記第1のブロックサイズを用いて、前記第1の参照画像データ以外の参照画像データを利用して前記第1の動きベクトルを更に検出することを特徴とする請求項1に記載の動きベクトル検出装置。
If the third block size matches the first block size,
The first motion vector detection means further detects the first motion vector using reference image data other than the first reference image data using the first block size. The motion vector detection device according to claim 1.
前記第1の決定手段は、前記複数の第2のマッチング誤差のうち、第1の閾値よりも大きい第2のマッチング誤差が存在する場合に、前記第3のブロックサイズを前記第1のブロックサイズを予め定められた条件に従って分割したブロックサイズに決定することを特徴とする請求項1又は2に記載の動きベクトル検出装置。   The first determining means determines the third block size as the first block size when there is a second matching error larger than a first threshold among the plurality of second matching errors. The motion vector detection device according to claim 1, wherein the block size is determined according to a predetermined condition. 前記第3のブロックサイズが、第1のブロックサイズより小さく前記第2のブロックサイズより大きい場合に、
前記処理対象画像データにおける前記第3のブロックサイズを有する第4の画像データとの第3のマッチング誤差が最小となる、前記複数の参照画像データにおける前記第3のブロックサイズを有する第5の画像データを決定し、該第4の画像データと該第5の画像データとに基づく第2の動きベクトルを検出する第2の動きベクトル検出手段を更に備えることを特徴とする請求項1乃至3のいずれか1項に記載の動きベクトル検出装置。
When the third block size is smaller than the first block size and larger than the second block size,
A fifth image having the third block size in the plurality of reference image data, in which a third matching error with the fourth image data having the third block size in the processing target image data is minimized. 4. The apparatus according to claim 1, further comprising second motion vector detecting means for determining data and detecting a second motion vector based on the fourth image data and the fifth image data. The motion vector detection device according to any one of the above.
前記第3のブロックサイズが、前記第2のブロックサイズである場合に、
前記第1の画像データにおける前記第2のブロックサイズを有する第4の画像データとの第3のマッチング誤差が最小となる、前記第1の参照画像データにおける前記第2のブロックサイズを有する第5の画像データを決定し、該第4の画像データと該第5の画像データとに基づく第2の動きベクトルを検出する第2の動きベクトル検出手段と、
前記第4の画像データを、前記第2のブロックサイズより小さい第4のブロックサイズを有する複数の第6の画像データに分割し、最小となる前記第3のマッチング誤差から、該複数の第6の画像データのそれぞれに対応する複数の第4のマッチング誤差を抽出する第2の抽出手段と、
前記第2の抽出手段により抽出された前記複数の第4のマッチング誤差に基づいて、前記複数の参照画像データを利用した動きベクトルの検出に用いる第5のブロックサイズを決定する第2の決定手段と
を更に備えることを特徴とする請求項1乃至3のいずれか1項に記載の動きベクトル検出装置。
When the third block size is the second block size,
A fifth block having the second block size in the first reference image data, wherein a third matching error with the fourth image data having the second block size in the first image data is minimized. Second motion vector detection means for determining a second motion vector based on the fourth image data and the fifth image data;
The fourth image data is divided into a plurality of sixth image data having a fourth block size smaller than the second block size, and the plurality of sixth image data are calculated based on the third matching error that is minimized. Second extraction means for extracting a plurality of fourth matching errors corresponding to each of the image data;
Second determination means for determining a fifth block size used for motion vector detection using the plurality of reference image data based on the plurality of fourth matching errors extracted by the second extraction means. The motion vector detection device according to claim 1, further comprising:
前記第5のブロックサイズが前記第2のブロックサイズと一致する場合に、
前記第2の動きベクトル検出手段は、前記第2のブロックサイズを用いて、前記第1の参照画像データ以外の参照画像データを利用して前記第2の動きベクトルを更に検出することを特徴とする請求項5に記載の動きベクトル検出装置。
When the fifth block size matches the second block size,
The second motion vector detection means further detects the second motion vector using reference image data other than the first reference image data using the second block size. The motion vector detection device according to claim 5.
前記第2の決定手段は、前記複数の第4のマッチング誤差のうち、第2の閾値よりも大きい第4のマッチング誤差が存在する場合に、前記第5のブロックサイズを前記第2のブロックサイズを予め定められた条件に従って分割したブロックサイズに決定することを特徴とする請求項5又は6に記載の動きベクトル検出装置。   The second determining means determines the fifth block size as the second block size when there is a fourth matching error larger than a second threshold among the plurality of fourth matching errors. The motion vector detection device according to claim 5, wherein the block size is determined according to a predetermined condition. 前記第5のブロックサイズが前記第2のブロックサイズと一致しない場合に、
前記処理対象画像データにおける前記第5のブロックサイズを有する第7の画像データとの第5のマッチング誤差が最小となる、前記複数の参照画像データにおける前記第5のブロックサイズを有する第8の画像データを決定し、該第7の画像データと該第8の画像データとに基づく第3の動きベクトルを検出する第3の動きベクトル検出手段を更に備えることを特徴とする請求項5乃至7のいずれか1項に記載の動きベクトル検出装置。
If the fifth block size does not match the second block size,
An eighth image having the fifth block size in the plurality of reference image data, in which a fifth matching error with the seventh image data having the fifth block size in the processing target image data is minimized. 8. The apparatus according to claim 5, further comprising third motion vector detecting means for determining data and detecting a third motion vector based on the seventh image data and the eighth image data. The motion vector detection device according to any one of the above.
前記第1のブロックサイズは、16画素×16画素のブロックサイズであって、
前記第2のブロックサイズは、8画素×8画素のブロックサイズであって、
前記第4のブロックサイズは、4画素×4画素のブロックサイズであることを特徴とする請求項5乃至8のいずれか1項に記載の動きベクトル検出装置。
The first block size is a block size of 16 pixels × 16 pixels,
The second block size is a block size of 8 pixels × 8 pixels,
The motion vector detection device according to claim 5, wherein the fourth block size is a block size of 4 pixels × 4 pixels.
処理対象画像データと複数の参照画像データとを用いて動きベクトルを検出する動きベクトル検出方法であって、
前記処理対象画像データにおける第1のブロックサイズを有する第1の画像データとの第1のマッチング誤差が最小となる、前記複数の参照画像データのうち第1の参照画像データにおける前記第1のブロックサイズを有する第2の画像データを決定し、該第1の画像データと該第2の画像データとに基づく第1の動きベクトルを検出する第1の動きベクトル検出工程と、
前記第1の画像データを、前記第1のブロックサイズより小さい第2のブロックサイズを有する複数の第3の画像データに分割し、最小となる前記第1のマッチング誤差から、該複数の第3の画像データのそれぞれに対応する複数の第2のマッチング誤差を抽出する第1の抽出工程と、
前記第1の抽出工程において抽出された前記複数の第2のマッチング誤差のそれぞれを所定の閾値と比較し、各第2のマッチング誤差と前記所定の閾値との比較結果が予め定められた複数の条件の何れに適合するかを判定して、当該適合した条件に従って、前記複数の参照画像データを利用した動きベクトルの検出に用いる第3のブロックサイズを決定する第1の決定工程と
を備えることを特徴とする動きベクトル検出方法。
A motion vector detection method for detecting a motion vector using processing target image data and a plurality of reference image data,
The first block in the first reference image data among the plurality of reference image data, wherein the first matching error with the first image data having the first block size in the processing target image data is minimized. A first motion vector detection step of determining second image data having a size and detecting a first motion vector based on the first image data and the second image data;
The first image data is divided into a plurality of third image data having a second block size smaller than the first block size, and the plurality of third image data is calculated based on the first matching error that is minimized. A first extraction step of extracting a plurality of second matching errors corresponding to each of the image data;
Each of the plurality of second matching errors extracted in the first extraction step is compared with a predetermined threshold, and a comparison result between each second matching error and the predetermined threshold is determined in advance. A first determination step of determining which of the conditions is met, and determining a third block size used for motion vector detection using the plurality of reference image data according to the adapted conditions. A motion vector detection method characterized by the above.
請求項10に記載の動きベクトル検出方法をコンピュータに実行させるためのコンピュータプログラム。 A computer program for causing a computer to execute the motion vector detection method according to claim 10. 請求項11に記載のコンピュータプログラムを記憶したコンピュータで読み取り可能な記憶媒体。 A computer-readable storage medium storing the computer program according to claim 11.
JP2006186972A 2006-07-06 2006-07-06 Motion vector detection apparatus, motion vector detection method, computer program, and storage medium Expired - Fee Related JP4789719B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2006186972A JP4789719B2 (en) 2006-07-06 2006-07-06 Motion vector detection apparatus, motion vector detection method, computer program, and storage medium
US11/772,630 US8270490B2 (en) 2006-07-06 2007-07-02 Motion vector detection apparatus, motion vector detection method, image encoding apparatus, image encoding method, and computer program
US13/600,466 US9264735B2 (en) 2006-07-06 2012-08-31 Image encoding apparatus and method for allowing motion vector detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006186972A JP4789719B2 (en) 2006-07-06 2006-07-06 Motion vector detection apparatus, motion vector detection method, computer program, and storage medium

Publications (3)

Publication Number Publication Date
JP2008017209A JP2008017209A (en) 2008-01-24
JP2008017209A5 JP2008017209A5 (en) 2009-08-20
JP4789719B2 true JP4789719B2 (en) 2011-10-12

Family

ID=39073820

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006186972A Expired - Fee Related JP4789719B2 (en) 2006-07-06 2006-07-06 Motion vector detection apparatus, motion vector detection method, computer program, and storage medium

Country Status (1)

Country Link
JP (1) JP4789719B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014183544A (en) * 2013-03-21 2014-09-29 Fujitsu Ltd Image processing unit and image processing method
WO2014155543A1 (en) * 2013-03-26 2014-10-02 富士通株式会社 Encoding device, method, program, computer system and recording medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2702488B2 (en) * 1988-01-18 1998-01-21 富士通株式会社 Video predictive coding
PT1449385E (en) * 2001-11-21 2015-10-15 Google Technology Holdings LLC Macroblock level adaptive frame/field coding for digital video content
JP4841101B2 (en) * 2002-12-02 2011-12-21 ソニー株式会社 Motion prediction compensation method and motion prediction compensation device
JP2005268879A (en) * 2004-03-16 2005-09-29 Matsushita Electric Ind Co Ltd Image coding method and apparatus thereof
JP2005323299A (en) * 2004-05-11 2005-11-17 Ntt Software Corp Method for searching motion vector, and encoding device

Also Published As

Publication number Publication date
JP2008017209A (en) 2008-01-24

Similar Documents

Publication Publication Date Title
KR100946790B1 (en) Video encoding method and apparatus, video decoding method and apparatus, and storage media for storing the programs
JP5837992B2 (en) Video decoding method in merge mode
JP5111127B2 (en) Moving picture coding apparatus, control method therefor, and computer program
US9264735B2 (en) Image encoding apparatus and method for allowing motion vector detection
KR100987765B1 (en) Prediction method and apparatus in video encoder
TWI735257B (en) Image predictive decoding method, image predictive coding method, image predictive decoder, image predictive encoder, and non-transitory recording medium storing computer programs
KR101108681B1 (en) Frequency transform coefficient prediction method and apparatus in video codec, and video encoder and decoder therewith
US20070098067A1 (en) Method and apparatus for video encoding/decoding
WO2006106935A1 (en) Image decoding apparatus and image decoding method
US8189667B2 (en) Moving picture encoding apparatus
AU2008258910A1 (en) Image prediction encoding device, image prediction decoding device, image prediction encoding method, image prediction decoding method, image prediction encoding program, and image prediction decoding program
JP5795525B2 (en) Image encoding method, image decoding method, image encoding device, image decoding device, image encoding program, and image decoding program
JP4762938B2 (en) Data embedding device, data extracting device, data embedding method, and data extracting method
JP4732184B2 (en) Moving picture encoding apparatus and control method therefor, computer program, and storage medium
US20070133689A1 (en) Low-cost motion estimation apparatus and method thereof
JP2007013298A (en) Image coding apparatus
JP2010193401A (en) Image encoding method and apparatus
US9055292B2 (en) Moving image encoding apparatus, method of controlling the same, and computer readable storage medium
JP5649296B2 (en) Image encoding device
US20120141041A1 (en) Image filtering method using pseudo-random number filter and apparatus thereof
JP4789719B2 (en) Motion vector detection apparatus, motion vector detection method, computer program, and storage medium
JP5381571B2 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
JP5235813B2 (en) Moving picture coding apparatus, moving picture coding method, and computer program
JP5885886B2 (en) Image analysis apparatus and image analysis method
JP4926912B2 (en) Video encoding apparatus and method

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090703

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090703

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101125

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101129

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110118

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

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

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

Free format text: PAYMENT UNTIL: 20140729

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees