JP2006180014A - Apparatus and method of motion compensation prediction coding - Google Patents

Apparatus and method of motion compensation prediction coding Download PDF

Info

Publication number
JP2006180014A
JP2006180014A JP2004368854A JP2004368854A JP2006180014A JP 2006180014 A JP2006180014 A JP 2006180014A JP 2004368854 A JP2004368854 A JP 2004368854A JP 2004368854 A JP2004368854 A JP 2004368854A JP 2006180014 A JP2006180014 A JP 2006180014A
Authority
JP
Japan
Prior art keywords
block
motion vector
motion
determination
iterations
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2004368854A
Other languages
Japanese (ja)
Other versions
JP2006180014A5 (en
JP4438949B2 (en
Inventor
Rei Hamada
玲 浜田
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 JP2004368854A priority Critical patent/JP4438949B2/en
Publication of JP2006180014A publication Critical patent/JP2006180014A/en
Publication of JP2006180014A5 publication Critical patent/JP2006180014A5/ja
Application granted granted Critical
Publication of JP4438949B2 publication Critical patent/JP4438949B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an apparatus and a method of motion compensation prediction coding which enable selection of the optimum block size while reducing a total arithmetic operation amount. <P>SOLUTION: In selecting either a first block or a second block obtained by dividing the first block into a plurality of blocks as a motion compensation prediction block, an estimated motion vector operating section 21 operates each of motion vectors of a plurality of second blocks at a first repetition of a searching algorithm or a less repetition not more than the maximum number of repetitions. If the motion vectors are equivalent, a first determining section 22 selects the first block. On the contrary, if the motion vectors are not equivalent, an SB searching section 25 operates each of motion vectors of the second block at the number of repetitions of a searching algorithm. A second determining section 26 determines the equivalence of the motion vector, selects the first block when it is equivalent, and selects the second block if it is not equivalent. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、動き補償予測符号化装置及び動き補償予測符号化方法に関し、詳しくは、動き補償予測ブロックのサイズを選択して使用できる動き補償予測符号化装置及び動き補償予測符号化方法に関する。   The present invention relates to a motion compensation prediction encoding apparatus and a motion compensation prediction encoding method, and more particularly, to a motion compensation prediction encoding apparatus and a motion compensation prediction encoding method that can be used by selecting a size of a motion compensation prediction block.

我々が目にする動画は、時間軸上に連続する多数のフレーム画像(静止画)の残像に過ぎない。ギクシャク感のないスムーズな動きにするには、残像効果が失われる前に次のフレーム画像を表示しなければならず、それには、たとえば、毎秒30フレームないしはそれ以上のフレーム画像を必要とするが、こうした多数のフレーム画像からなる動画は、その情報量が膨大なものとなり、蓄積媒体の容量や伝送経路の帯域を圧迫する。   The moving image we see is just an afterimage of a number of frame images (still images) that are continuous on the time axis. For smooth motion without jerky feeling, the next frame image must be displayed before the afterimage effect is lost, which requires, for example, 30 or more frame images per second. Such a moving image composed of a large number of frame images has an enormous amount of information and presses the capacity of the storage medium and the bandwidth of the transmission path.

そこで、動画の情報量を削減(圧縮)するための技術として、「動き補償予測符号化」が用いられる。   Therefore, “motion compensated prediction coding” is used as a technique for reducing (compressing) the information amount of moving images.

図16は、動き補償予測符号化の簡略化した概念図である。左列に符号化前(情報量削減前)の画像(以下、元画像)P1、P2、P3、・・・・、P7が並んでいる。並び順は時間軸に沿って上から下である。動き補償予測符号化では、少なくとも1枚の元画像P1(イントラ画像ともいう)はそのまま(無圧縮又は静止画の符号化技術で圧縮し)伝送路(又は蓄積媒体)を介して復号側に送出しなければならないが、残りの元画像P2、P3、・・・・、P7については、時間軸を過去に遡った一つ前の元画像(参照画像)との間の「動き情報」を取り出し、その動き情報からなる被符号化画像P2′、P3′、・・・・、P7′を伝送路を介して復号側に送出する。被符号化画像P2′、P3′、・・・・、P7′の情報量は、元画像P2、P3、・・・・、P7のそれよりも少ない。このため、伝送路上(または蓄積媒体)における情報量は、すべての元画像を送出する場合に比べて遙かに削減される。   FIG. 16 is a simplified conceptual diagram of motion compensation predictive coding. In the left column, images (hereinafter referred to as original images) P1, P2, P3,..., P7 before encoding (before information amount reduction) are arranged. The order is from top to bottom along the time axis. In motion compensation predictive coding, at least one original image P1 (also referred to as an intra image) is sent as it is (compressed with uncompressed or still image coding technology) to the decoding side via a transmission path (or storage medium). However, with respect to the remaining original images P2, P3,..., P7, the “motion information” between the previous original image (reference image) that goes back in time to the past is extracted. .., P7 ′, which are the motion information, are sent to the decoding side via the transmission path. The amount of information of the encoded images P2 ′, P3 ′,..., P7 ′ is smaller than that of the original images P2, P3,. For this reason, the amount of information on the transmission path (or storage medium) is much reduced compared to the case of sending all original images.

復号側では、イントラ画像(元画像P1)はそのまま復元画像P1″として用いるが、それ以外の復元画像P2′、P3′、・・・・、P7′については、時間軸を過去に遡った一つ前の復元画像と「動き情報」とにより画像を再生するという手順を繰り返すことにより、元画像P1、P2、P3、・・・・、P7と同じ並びの復元画像P1″、P2″、P3″、・・・・、P7″を得る。なお、図の説明では、時間軸を過去に遡った一つ“前”の元画像を「参照画像」としているが、これは伝送系メディアの場合である。蓄積系では時間軸上の未来の画像(一つ“後”の元画像)を「参照画像」とすることもある。   On the decoding side, the intra image (original image P1) is used as it is as the restored image P1 ″, but the other restored images P2 ′, P3 ′,. By repeating the procedure of reproducing an image with the previous restored image and “motion information”, the restored images P1 ″, P2 ″, P3 in the same arrangement as the original images P1, P2, P3,. “,..., P7” are obtained. In the description of the figure, the “previous” original image that goes back in time to the past is referred to as a “reference image”, but this is the case for transmission media. In the storage system, a future image on the time axis (one “after” original image) may be referred to as a “reference image”.

図17は、動き補償予測符号化における被符号化画像生成の概念図である(たとえば、特許文献1参照。)。この図において、動き補償予測符号化では、動画像を構成する元画像を16×16画素などの小さな動き補償予測ブロック(以下、単に「ブロック」という)に分割し、このブロック単位に、時間的に前(蓄積系では後の場合もある)に位置する参照画像から被符号化画像を作成する。   FIG. 17 is a conceptual diagram of generation of a coded image in motion compensation predictive coding (see, for example, Patent Document 1). In this figure, in motion compensated prediction coding, an original image constituting a moving image is divided into small motion compensated prediction blocks (hereinafter simply referred to as “blocks”) such as 16 × 16 pixels, and temporally divided into blocks. An encoded image is created from a reference image located before (possibly later in the storage system).

具体的には、たとえば、被符号化画像1がB1〜B25(Bはブロックの略)までの25個のブロックに分割されていると仮定した場合、まず、B1と同じ大きさのブロック(B1′)を参照画像2から取り出し、そのB1′とB1との画素毎の差分(残差信号)を取る。そして、参照画像2の上のB1′の位置を数画素ないしは1/m画素単位にずらしながら、逐次に残差信号を収集していき、残差信号が最小となったときのB1′(図ではB1″)とB1との相対的なズレの大きさ及びズレの方向をベクトル量3(動きベクトル)で検出する。これを、他のブロック(B2〜B25)についても同様に繰り返すことにより、最終的に、すべてのブロック(B1〜B25)の動きベクトルと残差信号とを得ることができる。復号側には、それらの動きベクトルと残差信号を各ブロック(B1〜B25)に格納した被符号化画像4を送出する。   Specifically, for example, when it is assumed that the encoded image 1 is divided into 25 blocks from B1 to B25 (B is an abbreviation of blocks), first, a block (B1 having the same size as B1) is assumed. ′) Is extracted from the reference image 2, and a difference (residual signal) for each pixel between B1 ′ and B1 is obtained. Then, the residual signals are sequentially collected while shifting the position of B1 'on the reference image 2 in units of several pixels or 1 / m pixels, and B1' when the residual signal is minimized (see FIG. Then, the magnitude of the relative deviation between B1 ″) and B1 and the direction of deviation are detected with the vector quantity 3 (motion vector). By repeating this for the other blocks (B2 to B25) in the same manner, Finally, the motion vectors and residual signals of all the blocks (B1 to B25) can be obtained, and these motion vectors and residual signals are stored in the respective blocks (B1 to B25) on the decoding side. The encoded image 4 is sent out.

復号側では、送られてきた被符号化画像4のB1〜B25の各動きベクトルを用いて、対象となる参照画像に相当する復元画像のブロックを選択し、そのブロックとB1〜B25の各残差信号を画素毎に加算して、B1〜B25を再現し、元画像と同じ復元画像を再構成する。   On the decoding side, using the received motion vectors B1 to B25 of the encoded image 4, the block of the restored image corresponding to the target reference image is selected, and the remaining blocks and the remaining blocks B1 to B25 are selected. The difference signal is added for each pixel, B1 to B25 are reproduced, and the same restored image as the original image is reconstructed.

ここで、ブロックサイズを小さくすると、よりきめ細かな動き予測を行うことができることから、初期の動画像符号化方式(MPEG−2:Moving Picture Experts Group )では「16×16」の一種類しかなかったブロックサイズが、その上位バージョン(MPEG−4)では「16×16」と「8×8」の二種類となり、さらに、最新バージョン(MPEG−4/AVC又はH.264/AVC)では「16×16」、「16×8」、「8×16」、「8×8」、「8×4」、「4×8」、「4×4」の7種類になった。   Here, if the block size is reduced, more detailed motion prediction can be performed, so that there was only one type of “16 × 16” in the initial moving picture coding system (MPEG-2: Moving Picture Experts Group). There are two types of block sizes, “16 × 16” and “8 × 8” in the higher version (MPEG-4), and “16 × in the latest version (MPEG-4 / AVC or H.264 / AVC)”. 16 types, “16 × 8”, “8 × 16”, “8 × 8”, “8 × 4”, “4 × 8”, and “4 × 4”.

これにより、小さなブロックを選択して動き予測の精度を高めることができるようになった。反面、小さなブロックは、符号化処理量の増加を招き、伝送情報量や処理のオーバヘッド及び電力消費を大きくすることから、とりわけ動きの少ない画像に用いて不適切であり、動きの量に対応した適切な大きさのブロックを選択できる技術が求められている。   As a result, a small block can be selected to improve the accuracy of motion prediction. On the other hand, a small block increases the amount of encoding processing, and increases the amount of transmission information, processing overhead, and power consumption. Therefore, it is inappropriate for small-motion images, and corresponds to the amount of motion. There is a need for a technique that can select an appropriately sized block.

動きの量に対応した適切な大きさのブロックを選択できる従来技術としては、たとえば、16×16動きベクトル検出部と、8×8動きベクトル検出部と、それらの二つの動き検出部で得られた動き補償予測結果のうちのどちらか一方を選択するベクトル選択部とを備えたものが知られている(たとえば、特許文献2参照)。   As a conventional technique capable of selecting a block having an appropriate size corresponding to the amount of motion, for example, a 16 × 16 motion vector detection unit, an 8 × 8 motion vector detection unit, and these two motion detection units can be used. In addition, a device including a vector selection unit that selects one of the motion compensation prediction results is known (see, for example, Patent Document 2).

これによれば、16×16ブロックと、そのブロックを4分割した8×8ブロックのそれぞれで得られた動き補償予測結果のうち適切な方を選択できる。このため、動きが少ない場合には大きなサイズの「16×16ブロック」を選択して伝送情報量の削減と電力消費の抑制及び処理のオーバヘッドの軽減を図り、一方、動きが大きい場合には小さなサイズの「8×8ブロック」を選択してよりきめ細かな動き予測を図ることができる。   According to this, it is possible to select an appropriate one of the motion compensation prediction results obtained for each of the 16 × 16 block and the 8 × 8 block obtained by dividing the block into four. For this reason, when there is little movement, a large size “16 × 16 block” is selected to reduce the amount of transmission information, reduce power consumption, and reduce processing overhead. By selecting the “8 × 8 block” of the size, it is possible to perform more detailed motion prediction.

特表2003−533142号公報Special table 2003-533142 gazette 特開2000−102016号公報JP 2000-102016 A

しかしながら、上記の従来技術にあっては、「16×16ブロック」と、そのブロックを4分割した「8×8ブロック」のそれぞれで動き補償予測を行っているため、たとえば、「全探索法」で予測を行った場合、トータルの演算量は、16×16ブロック1個分の演算量のほぼ2倍にも達する。これは、ブロックの面積に比例して演算量が増えるため、8×8ブロック4個分の演算量は、16×16ブロック1個分の演算量にほぼ匹敵するからである。   However, since the motion compensation prediction is performed in each of the “16 × 16 block” and the “8 × 8 block” obtained by dividing the block into four in the above-described conventional technology, for example, the “full search method” When the prediction is performed, the total calculation amount reaches almost twice the calculation amount for one 16 × 16 block. This is because the amount of calculation increases in proportion to the area of the block, and the amount of calculation for four 8 × 8 blocks is almost equal to the amount of calculation for one 16 × 16 block.

なお、このこと(演算量が2倍に増える)は「全探索法」よりも演算量が少ない他の探索法(最近傍探索法など)を用いた場合でも同じである。たとえば、最近傍探索法を行ったときの16×16ブロック1個分の演算量をAとするとき(このAは全探索法よりも少ないが)、同様に最近傍探索を行った8×8ブロック4個分の演算量もほぼAと同等になるため、トータルの演算量が、やはり2倍(≒2A)になるからである。   Note that this (the calculation amount increases twice) is the same even when another search method (such as the nearest neighbor search method) having a smaller calculation amount than the “full search method” is used. For example, when the calculation amount for one 16 × 16 block when performing the nearest neighbor search method is A (although this A is smaller than the full search method), the nearest neighbor search is similarly performed 8 × 8 This is because the calculation amount for the four blocks is almost equal to A, so the total calculation amount is also doubled (≈2A).

そこで、本発明の目的は、トータルの演算量を減らしつつ、最適なブロックサイズの選択を可能とする動き補償予測符号化装置及び動き補償予測符号化方法を提供することにある。   Accordingly, an object of the present invention is to provide a motion compensated prediction coding apparatus and a motion compensated prediction coding method capable of selecting an optimum block size while reducing the total amount of calculation.

請求項1記載の発明は、第一ブロックと該第一ブロックを複数に分割した第二ブロックのいずれか一方を動き補償予測ブロックとして選択するブロック選択手段を備えた動き補償予測符号化装置において、前記ブロック選択手段は、前記複数の第二ブロックの各々の動きベクトルを予め定められた反復数以下の少ない反復で所定の探索アルゴリズムにより演算する第一動きベクトル演算手段と、前記第一動きベクトル演算手段で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第一判定手段とを含み、前記第一判定手段の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する一方、前記第一判定手段の判定結果が否定の場合に前記第二ブロックを動き補償予測ブロックとして選択することを特徴とする動き補償予測符号化装置である。
この発明では、予め定められた反復数以下の少ない反復で所定の探索アルゴリズムを用いて複数の第二ブロックの各々の動きベクトルを演算し、それらの動きベクトルが完全等価又は近似等価である場合に、第一ブロックを動き補償予測ブロックとして選択する一方、それらの動きベクトルが完全等価又は近似等価でない場合に第二ブロックを動き補償予測ブロックとして選択する。ここで、第一ブロックを複数に分割したものが第二ブロックであるから、第一ブロックは「大きい動き補償予測ブロック」であり、第二ブロックは「小さい動き補償予測ブロック」である。
そして、複数の第二ブロック(小さい動き補償予測ブロック)の各々の動きベクトルが揃っている(完全等価又は近似等価している)ということは、各々の画像が同一方向且つ同一量に動いているということであり、これは、第一ブロック(大きい動き補償予測ブロック)の画像の動きを表すから、この場合は、演算量削減を意図として大きい動き補償予測ブロック、つまり、第一ブロックを選択する。
これに対して、複数の第二ブロック(小さい動き補償予測ブロック)の各々の動きベクトルが揃っていない(完全等価又は近似等価していない)場合は、各々の画像がバラバラに動いているということであり、この場合には、きめ細かな動きベクトルを検出するために、小さな動き補償予測ブロック、つまり、第二ブロックを選択する。
この発明の“ブロック選択”に要する時間は、もっぱら、複数の第二ブロックの各々の動きベクトルの演算時間で与えられるが、この演算は、探索アルゴリズムの“予め定められた反復数以下の少ない反復”で行われるため、探索アルゴリズムを予め定められた反復数で行った場合に比べて明らかに短い時間で済む。
したがって、トータルの演算量を減らしつつ、最適なブロックサイズの選択を可能とする動き補償予測符号化装置を提供できる。
請求項2記載の発明は、第一ブロックと該第一ブロックを複数に分割した第二ブロックのいずれか一方を動き補償予測ブロックとして選択するブロック選択手段を備えた動き補償予測符号化装置において、前記ブロック選択手段は、前記複数の第二ブロックの各々の動きベクトルを予め定められた第1の反復数以下の少ない反復で所定の探索アルゴリズムにより演算する第一動きベクトル演算手段と、前記第一動きベクトル演算手段で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第一判定手段と、前記第一判定手段の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する第一選択手段と、前記第一判定手段の判定結果が肯定の場合に前記第一ブロックの動きベクトルを予め定められた第2の反復数を上限にして所定の探索アルゴリズムにより演算する第二動きベクトル演算手段と、前記第一判定手段の判定結果が否定の場合に前記複数の第二ブロックの各々の動きベクトルを予め定められた第3の反復数を上限にして所定の探索アルゴリズムにより演算する第三動きベクトル演算手段と、前記第三動きベクトル演算手段で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第二判定手段と、前記第二判定手段の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する一方、前記第二判定手段の判定結果が否定の場合に前記第二ブロックを動き補償予測ブロックとして選択する第二選択手段とを備えたことを特徴とする動き補償予測符号化装置である。
この発明では、請求項1の発明に加えて、複数の第二ブロックの各々の動きベクトルが揃っていない(完全等価又は近似等価していない)場合には、第二ブロックの各々の動きベクトルを再探索する。この再探索は、予め定められた第3の反復数を上限にした所定の探索アルゴリズムの正確な演算で行われるので、第一動きベクトル演算手段の演算結果に比べて精度が高い。
このため、仮に、第二判定手段で逆の判定結果(等価)が得られた場合には、第一判定手段の判定結果が間違っていると判断して、大きい動き補償予測ブロック、つまり、第一ブロックを選択し、また、第二判定手段で同じ判定結果(等価でない)が得られた場合には、第一判定手段の判定結果が正しかったと判断して、小さい動き補償予測ブロック、つまり、第二ブロックを選択する。
したがって、仮に、第一判定手段の判定結果に誤りがあった場合でも、正しいブロック選択を行うことができ、実用上好ましいものとすることができる。
請求項3記載の発明は、前記所定の探索アルゴリズムは、最近傍探索法又はNステップ探索法若しくは対数探索法であることを特徴とする請求項1又は請求項2記載の動き補償予測符号化装置である。
請求項4記載の発明は、前記第二動きベクトル演算手段及び前記第三動きベクトル演算手段は、前記第一動きベクトル演算手段の反復がn′回のとき、n′+1回から反復を開始するとともに、その反復の初期値として、前記第一動きベクトル演算手段のn′反復で得られた中間値を使用することを特徴とする請求項2記載の動き補償予測符号化装置である。
この発明では、前記第一動きベクトル演算手段の演算で得られた中間値を、前記第二動きベクトル演算手段及び前記第三動きベクトル演算手段で流用するため、それらの第二動きベクトル演算手段及び第三動きベクトル演算手段の反復を少なくして、処理量の削減が図られる。
請求項5記載の発明は、第一ブロックと該第一ブロックを複数に分割した第二ブロックのいずれか一方を動き補償予測ブロックとして選択する際に、前記複数の第二ブロックの各々の動きベクトルを予め定められた反復数以下の少ない反復で所定の探索アルゴリズムにより演算する第一動きベクトル演算工程と、前記第一動きベクトル演算工程で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第一判定工程と、前記第一判定工程の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する一方、前記第一判定工程の判定結果が否定の場合に前記第二ブロックを動き補償予測ブロックとして選択する選択工程とを実行することを特徴とする動き補償予測符号化方法である。
請求項6記載の発明は、第一ブロックと該第一ブロックを複数に分割した第二ブロックのいずれか一方を動き補償予測ブロックとして選択する際に、前記複数の第二ブロックの各々の動きベクトルを予め定められた第1の反復数以下の少ない反復で所定の探索アルゴリズムにより演算する第一動きベクトル演算工程と、前記第一動きベクトル演算工程で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第一判定工程と、前記第一判定工程の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する第一選択工程と、前記第一判定工程の判定結果が肯定の場合に前記第一ブロックの動きベクトルを予め定められた第2の反復数を上限にして所定の探索アルゴリズムにより演算する第二動きベクトル演算工程と、前記第一判定工程の判定結果が否定の場合に前記複数の第二ブロックの各々の動きベクトルを予め定められた第3の反復数を上限にして所定の探索アルゴリズムにより演算する第三動きベクトル演算工程と、前記第三動きベクトル演算工程で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第二判定工程と、前記第二判定工程の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する一方、前記第二判定工程の判定結果が否定の場合に前記第二ブロックを動き補償予測ブロックとして選択する第二選択工程とを実行することを特徴とする動き補償予測符号化方法である。
請求項7記載の発明は、前記所定の探索アルゴリズムは、最近傍探索法又はNステップ探索法若しくは対数探索法であることを特徴とする請求項4又は請求項5記載の動き補償予測符号化方法である。
請求項8記載の発明は、前記第二動きベクトル演算工程及び前記第三動きベクトル演算工程は、前記第一動きベクトル演算工程の反復がn′回のとき、n′+1回から反復を開始するとともに、その反復の初期値として、前記第一動きベクトル演算工程のn′反復で得られた中間値を使用することを特徴とする請求項6記載の動き補償予測符号化方法である。
The invention according to claim 1 is a motion compensated prediction encoding apparatus comprising block selection means for selecting one of a first block and a second block obtained by dividing the first block as a plurality of motion compensated prediction blocks. The block selection means includes first motion vector calculation means for calculating a motion vector of each of the plurality of second blocks by a predetermined search algorithm with a small number of iterations equal to or less than a predetermined number of iterations, and the first motion vector calculation And a first determination unit that determines whether or not each motion vector of the second block calculated by the unit is completely equivalent or approximate equivalent, and the first determination unit determines if the determination result of the first determination unit is affirmative While one block is selected as a motion compensated prediction block, if the determination result of the first determination means is negative, the second block is selected as a motion compensated prediction block. A motion compensated predictive coding apparatus characterized by selecting as.
In the present invention, when a motion vector of each of a plurality of second blocks is calculated using a predetermined search algorithm with a small number of iterations equal to or less than a predetermined number of iterations, and the motion vectors are completely equivalent or approximate equivalent. The first block is selected as the motion compensated prediction block, while the second block is selected as the motion compensated prediction block when their motion vectors are not completely equivalent or approximate equivalent. Here, since the second block is obtained by dividing the first block into a plurality of blocks, the first block is a “large motion compensation prediction block” and the second block is a “small motion compensation prediction block”.
The fact that the motion vectors of the plurality of second blocks (small motion compensation prediction blocks) are aligned (completely equivalent or approximately equivalent) means that the images are moving in the same direction and in the same amount. This means that this represents the motion of the image of the first block (large motion compensation prediction block). In this case, a large motion compensation prediction block, that is, the first block is selected for the purpose of reducing the amount of calculation. .
On the other hand, when the motion vectors of the plurality of second blocks (small motion compensation prediction blocks) are not aligned (not completely equivalent or approximate equivalent), the images are moving apart. In this case, in order to detect a fine motion vector, a small motion compensation prediction block, that is, a second block is selected.
The time required for “block selection” according to the present invention is given solely by the calculation time of each motion vector of the plurality of second blocks, and this calculation is performed with a small number of iterations less than the “predetermined number of iterations” of the search algorithm. Therefore, the time required for the search algorithm is significantly shorter than when the search algorithm is performed with a predetermined number of iterations.
Therefore, it is possible to provide a motion compensated prediction encoding apparatus that can select an optimum block size while reducing the total amount of calculation.
According to a second aspect of the present invention, there is provided a motion compensated prediction encoding apparatus including block selection means for selecting any one of a first block and a second block obtained by dividing the first block as a plurality of motion compensated prediction blocks. The block selecting means includes first motion vector computing means for computing a motion vector of each of the plurality of second blocks by a predetermined search algorithm with a small number of iterations equal to or less than a predetermined first number of iterations; First determination means for determining whether or not each motion vector of the second block calculated by the motion vector calculation means is completely equivalent or approximate equivalent, and when the determination result of the first determination means is affirmative A first selection unit that selects the first block as a motion compensated prediction block; and a motion vector of the first block when the determination result of the first determination unit is affirmative. Second motion vector computing means for computing a predetermined number of second iterations with a predetermined search algorithm, and when the judgment result of the first judging means is negative, Third motion vector calculation means for calculating each motion vector by a predetermined search algorithm up to a predetermined third number of iterations, and each of the second blocks calculated by the third motion vector calculation means Second determination means for determining whether or not the motion vector is completely equivalent or approximate equivalent; and when the determination result of the second determination means is affirmative, the first block is selected as a motion compensated prediction block, Motion compensated prediction, comprising: a second selection unit that selects the second block as a motion compensated prediction block when the determination result of the second determination unit is negative It is a Goka apparatus.
In the present invention, in addition to the invention of claim 1, when the motion vectors of each of the plurality of second blocks are not aligned (completely equivalent or not approximately equivalent), the motion vectors of each of the second blocks are Search again. This re-search is performed by an accurate calculation of a predetermined search algorithm with a predetermined third number of iterations as an upper limit, and thus has higher accuracy than the calculation result of the first motion vector calculation means.
For this reason, if the reverse determination result (equivalent) is obtained by the second determination means, it is determined that the determination result of the first determination means is wrong, and the large motion compensation prediction block, that is, the first When one block is selected and the same determination result (not equivalent) is obtained by the second determination unit, it is determined that the determination result of the first determination unit is correct, and a small motion compensated prediction block, that is, Select the second block.
Therefore, even if there is an error in the determination result of the first determination means, correct block selection can be performed, which is practically preferable.
According to a third aspect of the present invention, the predetermined search algorithm is a nearest neighbor search method, an N-step search method, or a logarithmic search method. It is.
According to a fourth aspect of the present invention, the second motion vector computing means and the third motion vector computing means start repeating from n ′ + 1 times when the first motion vector computing means is repeated n ′ times. The motion compensated predictive coding apparatus according to claim 2, wherein an intermediate value obtained by n 'iteration of the first motion vector computing means is used as an initial value of the iteration.
In this invention, since the intermediate value obtained by the calculation of the first motion vector calculation means is diverted by the second motion vector calculation means and the third motion vector calculation means, the second motion vector calculation means, The amount of processing can be reduced by reducing the number of repetitions of the third motion vector calculation means.
According to a fifth aspect of the present invention, when one of the first block and the second block obtained by dividing the first block is selected as a motion compensated prediction block, each motion vector of the plurality of second blocks is selected. Or a first motion vector calculation step that calculates a predetermined number of iterations with a predetermined number of iterations or less, and each motion vector of the second block calculated in the first motion vector calculation step is completely equivalent or A first determination step for determining whether or not they are approximately equivalent; and when the determination result of the first determination step is affirmative, the first block is selected as a motion compensated prediction block, while the determination of the first determination step When the result is negative, a motion compensation prediction encoding method is provided, wherein a selection step of selecting the second block as a motion compensation prediction block is executed.
According to a sixth aspect of the present invention, when any one of the first block and the second block obtained by dividing the first block is selected as a motion compensated prediction block, each motion vector of the plurality of second blocks is selected. Are calculated by a predetermined search algorithm with a small number of iterations less than or equal to a predetermined first number of iterations, and each motion vector of the second block calculated in the first motion vector calculation step is A first determination step of determining whether or not they are completely equivalent or approximate equivalent, and a first selection step of selecting the first block as a motion compensated prediction block when the determination result of the first determination step is affirmative; When the determination result of the first determination step is affirmative, the motion vector of the first block is expressed by a predetermined search algorithm with an upper limit of a predetermined second iteration number. A predetermined search with a predetermined third iteration number as an upper limit for each motion vector of the plurality of second blocks when the determination result of the second motion vector calculation step and the first determination step is negative A third motion vector calculation step calculated by an algorithm, and a second determination step of determining whether or not each motion vector of the second block calculated in the third motion vector calculation step is completely equivalent or approximate equivalent When the determination result of the second determination step is affirmative, the first block is selected as a motion compensated prediction block, while when the determination result of the second determination step is negative, the second block is selected as a motion compensated prediction block. And a second selection step of selecting as a motion compensated predictive coding method.
The invention according to claim 7 is characterized in that the predetermined search algorithm is a nearest neighbor search method, an N-step search method or a logarithmic search method. It is.
In the invention according to claim 8, the second motion vector calculation step and the third motion vector calculation step start repeating from n ′ + 1 times when the first motion vector calculation step is repeated n ′ times. The motion compensated predictive coding method according to claim 6, wherein an intermediate value obtained by n 'iteration of the first motion vector calculation step is used as an initial value of the iteration.

本発明によれば、“ブロック選択”に要する時間が、もっぱら、複数の第二ブロックの各々の動きベクトルの演算時間で与えられる。この演算は、「予め定められた反復数以下の少ない反復」で行われるため、探索アルゴリズムを予め定められた反復数で行った場合に比べて明らかに短い時間で済む。
したがって、トータルの演算量を減らしつつ、最適なブロックサイズの選択を可能とする動き補償予測符号化装置を提供できる。
また、他の発明によれば、第一判定手段の誤判定をバックアップして、正しいブロック選択を行うことができ、実用上好ましいものとすることができる。
また、他の発明によれば、前記第一動きベクトル演算手段の演算で得られた中間値を、前記第二動きベクトル演算手段及び前記第三動きベクトル演算手段で流用するので、それらの第二動きベクトル演算手段及び第三動きベクトル演算手段の反復を少なくすることができ、処理量の削減を図ることができる。
According to the present invention, the time required for “block selection” is given solely by the motion vector calculation time for each of the plurality of second blocks. Since this calculation is performed with “a smaller number of iterations less than or equal to a predetermined number of iterations”, the time required for the search algorithm is clearly shorter than when the search algorithm is performed with a predetermined number of iterations.
Therefore, it is possible to provide a motion compensated prediction encoding apparatus that can select an optimum block size while reducing the total amount of calculation.
In addition, according to another invention, it is possible to back up the erroneous determination of the first determination means and perform correct block selection, which is practically preferable.
According to another invention, the intermediate value obtained by the calculation of the first motion vector calculation means is diverted by the second motion vector calculation means and the third motion vector calculation means. It is possible to reduce the repetition of the motion vector calculation means and the third motion vector calculation means, and to reduce the processing amount.

以下、本発明の実施形態を、図面を参照しながら説明する。なお、以下の説明における様々な細部の特定ないし実例および数値や文字列その他の記号の例示は、本発明の思想を明瞭にするための、あくまでも参考であって、それらのすべてまたは一部によって本発明の思想が限定されないことは明らかである。また、周知の手法、周知の手順、周知のアーキテクチャおよび周知の回路構成等(以下「周知事項」)についてはその細部にわたる説明を避けるが、これも説明を簡潔にするためであって、これら周知事項のすべてまたは一部を意図的に排除するものではない。かかる周知事項は本発明の出願時点で当業者の知り得るところであるので、以下の説明に当然含まれている。   Embodiments of the present invention will be described below with reference to the drawings. It should be noted that the specific details or examples in the following description and the illustrations of numerical values, character strings, and other symbols are only for reference in order to clarify the idea of the present invention, and the present invention may be used in whole or in part. Obviously, the idea of the invention is not limited. In addition, a well-known technique, a well-known procedure, a well-known architecture, a well-known circuit configuration, and the like (hereinafter, “well-known matter”) are not described in detail, but this is also to simplify the description. Not all or part of the matter is intentionally excluded. Such well-known matters are known to those skilled in the art at the time of filing of the present invention, and are naturally included in the following description.

<動き補償予測ブロック>
まず、動き補償予測ブロックについて説明する。
図1は、動き補償予測ブロックの種類を示す図である。(a)〜(h)は、それぞれMPEG−4/AVC(又はH.264/AVC)で使用が認められている7種類の動き補償予測ブロックである。詳しくは、(a)は「16×16」のサイズの動き補償予測ブロック、(b)は「16×16」の動き補償予測ブロックを上下に2分割したそれぞれ「16×8」のサイズの動き補償予測ブロック、(c)は同じく「16×16」の動き補償予測ブロックを左右に2分割したそれぞれ「8×16」のサイズの動き補償予測ブロック、(d)は同じく「16×16」の動き補償予測ブロックを上下左右に4分割したそれぞれ「8×8」のサイズの動き補償予測ブロックである。
<Motion compensation prediction block>
First, the motion compensation prediction block will be described.
FIG. 1 is a diagram illustrating types of motion compensation prediction blocks. (A) to (h) are seven types of motion-compensated prediction blocks each approved for use in MPEG-4 / AVC (or H.264 / AVC). Specifically, (a) is a motion compensated prediction block having a size of “16 × 16”, and (b) is a motion having a size of “16 × 8” obtained by dividing a motion compensated prediction block of “16 × 16” into two vertically. Compensated prediction block, (c) is a motion compensated prediction block having a size of “8 × 16” obtained by dividing a motion compensated prediction block of “16 × 16” into left and right parts, and (d) is also “16 × 16”. The motion compensation prediction block is a motion compensation prediction block having a size of “8 × 8”, which is obtained by dividing the motion compensation prediction block into four parts in the vertical and horizontal directions.

また、(e)は「8×8」の動き補償予測ブロック、(f)は「8×8」の動き補償予測ブロックを上下に2分割したそれぞれ「8×4」のサイズの動き補償予測ブロック、(g)は同じく「8×8」の動き補償予測ブロックを左右に2分割したそれぞれ「4×8」のサイズの動き補償予測ブロック、(h)は同じく「8×8」の動き補償予測ブロックを上下左右に4分割したそれぞれ「4×4」のサイズの動き補償予測ブロックである。   (E) is a motion compensated prediction block of “8 × 8”, and (f) is a motion compensated prediction block of the size of “8 × 4” obtained by dividing the motion compensated prediction block of “8 × 8” into two vertically. , (G) is a motion compensated prediction block having a size of “4 × 8” obtained by dividing a motion compensated prediction block of “8 × 8” into left and right parts, and (h) is a motion compensated prediction block of “8 × 8”. Each block is a motion-compensated prediction block having a size of “4 × 4” obtained by dividing the block into four parts vertically and horizontally.

動き補償予測ブロックの選択は、(a)〜(d)のグループの中で行われる。すなわち、最大サイズの「16×16」、最大サイズを上下に2分割した「16×8」、最大サイズを左右に2分割した「8×16」、及び、最大サイズを上下左右に4分割した「8×8」の中から選ばれる。また、選択された動き補償予測ブロックが(d)(「16×16」を上下左右に4分割した「8×8」)である場合は、それぞれの「8×8」ブロック毎に、さらに(e)〜(h)のグループの中から選択できるように階層化されている。   The selection of the motion compensation prediction block is performed in the groups (a) to (d). That is, the maximum size “16 × 16”, the maximum size divided into two up and down “16 × 8”, the maximum size divided into two left and right “8 × 16”, and the maximum size divided into four up and down and left and right It is selected from “8 × 8”. Further, when the selected motion compensation prediction block is (d) (“8 × 8” obtained by dividing “16 × 16” into four parts vertically and horizontally), for each “8 × 8” block, ( It is hierarchized so that it can be selected from the groups e) to (h).

なお、一般的に(a)の動き補償予測ブロック(「16×16」)は「マクロブロック」、(b)〜(h)の分割された動き補償予測ブロックは「サブブロック」と呼ばれる。   In general, the motion compensated prediction block (“16 × 16”) in (a) is called “macroblock”, and the divided motion compensated prediction blocks in (b) to (h) are called “subblocks”.

このように、動き補償予測ブロックの種類は多く、ブロック選択の組み合わせも多岐にわたるため、本実施形態では説明の簡単化のために、「16×16」の動き補償予測ブロック(a)と、それを四分割した大きさの「8×8」の動き補償予測ブロック(d)を選択するものとする。   As described above, since there are many types of motion compensated prediction blocks and there are various combinations of block selections, in this embodiment, for simplicity of explanation, a “16 × 16” motion compensated prediction block (a), It is assumed that a motion compensated prediction block (d) of “8 × 8” having a size obtained by dividing into four is selected.

図2は、本実施形態の便宜的な選択対象となる二つの動き補償予測ブロックを示す図である。この図においては、「16×16」の動き補償予測ブロックと、それを四分割した大きさの「8×8」の動き補償予測ブロックが例示されている。以下、上記の一般呼称に倣って、「16×16」の動き補償予測ブロックを「マクロブロック(略号:MB)」といい、それを四分割した大きさの「8×8」の動き補償予測ブロックを「サブブロック(略号:SB)」ということにする。但し、これは、両者のブロックを区別するための、あくまでも説明上の便宜であって、これらの呼び名(マクロ・・・・、サブ・・・・)から発明の外縁を把握してはならない。また、4個のSBの各々に左上から順に添え字0、1,2,3を付けて識別することにする。すなわち、左上のSBをSB0 、右上のSBをSB1 、左下のSBをSB2 、右下のSBをSB3 として識別することにする。 FIG. 2 is a diagram illustrating two motion compensated prediction blocks that are objects of convenient selection according to the present embodiment. In this figure, a “16 × 16” motion compensation prediction block and a “8 × 8” motion compensation prediction block having a size obtained by dividing the motion compensation prediction block into four are illustrated. Hereinafter, following the above general designation, a motion compensated prediction block of “16 × 16” is referred to as a “macroblock (abbreviation: MB)”, and a motion compensated prediction of “8 × 8” having a size obtained by dividing the block into four. The block is referred to as “sub-block (abbreviation: SB)”. However, this is merely an explanatory convenience for distinguishing both blocks, and the outer edge of the invention should not be grasped from these names (macro..., Sub...). Further, each of the four SBs is identified by adding subscripts 0, 1, 2, 3 in order from the upper left. That is, the upper left SB is identified as SB 0 , the upper right SB as SB 1 , the lower left SB as SB 2 , and the lower right SB as SB 3 .

<動き補償予測符号化装置の構成>
次に、動き補償予測符号化装置の構成を説明する。
<Configuration of Motion Compensated Predictive Encoding Device>
Next, the configuration of the motion compensated prediction encoding apparatus will be described.

図3は、動き補償予測符号化装置のブロック図である。動き補償予測符号化装置10は、入力されたビットストリーム中の現フレーム(元画像)と予測画像との差分をとる減算部11と、その差分を何らかの2次元関数の有限級数変換式(たとえば、2次元離散コサイン変換:DCT)として表示することにより圧縮する変換部12と、変換式の係数を量子化する量子化部13と、この量子化データと後述の動き情報及び分割モードとを符号化(たとえば、エントロピー符号化)して、その符号化ビットストリームを伝送媒体や蓄積媒体に出力する符号化部14と、量子化データを逆量子化する逆量子化部15と、逆量子化されたデータを逆変換して元の差分に戻す逆変換部16と、この差分と予測画像とを加算して復元画像を再生する加算部17と、復元画像を保持する復元画像メモリ18と、現在の元画像と復元画像メモリ18に保持されている一つ前の復元画像(参照画像)とに基づいて動き情報(動きベクトル等)やブロックの分割モードを推定する動き推定部19(ブロック選択手段)と、この動き情報に基づいて予測画像を生成する動き補償部20とを備える。   FIG. 3 is a block diagram of the motion compensated prediction encoding apparatus. The motion-compensated predictive coding apparatus 10 includes a subtractor 11 that takes a difference between a current frame (original image) in an input bitstream and a predicted image, and a finite series conversion equation (for example, a certain two-dimensional function) Two-dimensional discrete cosine transform (DCT) is displayed as a transform unit 12 for compression, a quantization unit 13 for quantizing the coefficients of the transform equation, and the quantized data and motion information and division mode to be described later are encoded. (For example, entropy encoding) and outputting the encoded bit stream to a transmission medium or a storage medium; an inverse quantization unit 15 for inversely quantizing the quantized data; An inverse transformation unit 16 that inversely transforms data to return to the original difference, an addition unit 17 that adds the difference and the predicted image to reproduce the restored image, a restored image memory 18 that holds the restored image, A motion estimation unit 19 (block selection) that estimates motion information (such as a motion vector) and a block division mode based on the current original image and the previous restored image (reference image) held in the restored image memory 18 Means) and a motion compensation unit 20 that generates a predicted image based on the motion information.

<動き推定部の構成と動作>
図4は、動き推定部19の概念的なブロック図である。動き推定部19は、推定動きベクトル演算部21(第一動きベクトル演算手段)、第一判定部22(第一判定手段)、MB(マクロブロック)探索部23(第二動きベクトル演算手段)、第一MB動きベクトル出力部24(第一選択手段)、SB(サブブロック)探索部25(第三動きベクトル演算手段)、第二判定部26(第二判定手段)、第二MB動きベクトル出力部27(第二選択手段)、SB動きベクトル出力部28(第二選択手段)を備える。
<Configuration and operation of motion estimation unit>
FIG. 4 is a conceptual block diagram of the motion estimator 19. The motion estimation unit 19 includes an estimated motion vector calculation unit 21 (first motion vector calculation unit), a first determination unit 22 (first determination unit), an MB (macroblock) search unit 23 (second motion vector calculation unit), First MB motion vector output unit 24 (first selection unit), SB (sub-block) search unit 25 (third motion vector calculation unit), second determination unit 26 (second determination unit), second MB motion vector output A unit 27 (second selection unit) and an SB motion vector output unit 28 (second selection unit).

推定動きベクトル演算部21は、SB0 〜SB3 (図2参照)の各々について、探索アルゴリズム(たとえば、最近傍探索法などの高速探索アルゴリズム)の第1反復(発明の要旨に記載の「予め定められた反復数又は予め定められた第1の反復数以下の少ない反復」に相当)だけを行って、SB0 〜SB3 の大まかな推定動きベクトルfv0 〜fv3 を演算出力する。この演算に関する詳細は、後述の推定動きベクトル演算処理(図10及び図11参照)で説明する。 The estimated motion vector calculation unit 21 performs, for each of SB 0 to SB 3 (see FIG. 2), a first iteration of a search algorithm (for example, a fast search algorithm such as nearest neighbor search method). Only a predetermined number of iterations or a smaller number of iterations equal to or less than a first predetermined number of iterations) is performed, and rough estimated motion vectors fv 0 to fv 3 of SB 0 to SB 3 are calculated and output. Details regarding this calculation will be described later in an estimated motion vector calculation process (see FIGS. 10 and 11).

第一判定部22は、推定動きベクトルfv0 〜fv3 の等価(fv0 =fv1 =fv2 =fv3 )を判定し、等価であれば、MB探索部23を起動し、等価でなければ、SB探索部25を起動する。 First determination unit 22 determines the equivalent estimated motion vector fv 0 ~fv 3 (fv 0 = fv 1 = fv 2 = fv 3), if equivalent, start MB search unit 23, be equivalent Then, the SB search unit 25 is activated.

MB探索部23は、推定動きベクトルfv0 〜fv3 が等価(fv0 =fv1 =fv2 =fv3 )の場合に、16×16分割モードを出力するとともに、たとえば、最近傍探索法などによりMBの動きベクトルmvを求め、その動きベクトルmvを、第一MB動きベクトル出力部24を介して出力する。 When the estimated motion vectors fv 0 to fv 3 are equivalent (fv 0 = fv 1 = fv 2 = fv 3 ), the MB search unit 23 outputs a 16 × 16 division mode and, for example, a nearest neighbor search method or the like Thus, the motion vector mv of the MB is obtained, and the motion vector mv is output via the first MB motion vector output unit 24.

SB探索部25は、推定動きベクトルfv0 〜fv3 が等価(fv0 =fv1 =fv2 =fv3 )でない場合に、たとえば、最近傍探索法などによりSB0 、SB1 、SB2 及びSB3 のそれぞれの動きベクトルmv0 、mv1 、mv2 、mv3 を求める。 When the estimated motion vectors fv 0 to fv 3 are not equivalent (fv 0 = fv 1 = fv 2 = fv 3 ), the SB search unit 25 performs SB 0 , SB 1 , SB 2 and The respective motion vectors mv 0 , mv 1 , mv 2 , mv 3 of SB 3 are obtained.

第二判定部26は、SB0 、SB1 、SB2 及びSB3 のそれぞれの動きベクトルmv0 、mv1 、mv2 、mv3 の等価(mv0 =mv1 =mv2 =mv3 )を判定し、等価であれば、第二MB動きベクトル出力部27を介して16×16分割モードと一つの動きベクトル(mv0 )を出力する一方、等価でなければ、SB動きベクトル出力部28を介して、8×8分割モードと四つの動きベクトル(mv0 、mv1 、mv2 、mv3 )を出力する。 The second determination unit 26 calculates the equivalent (mv 0 = mv 1 = mv 2 = mv 3 ) of the motion vectors mv 0 , mv 1 , mv 2 , and mv 3 of SB 0 , SB 1 , SB 2, and SB 3. If it is determined that it is equivalent, the 16 × 16 division mode and one motion vector (mv 0 ) are output via the second MB motion vector output unit 27, while if not equivalent, the SB motion vector output unit 28 is Via the 8 × 8 division mode and four motion vectors (mv 0 , mv 1 , mv 2 , mv 3 ).

図5及び図6は、動き推定部19の動作を説明するための概念図である。まず、図5に示すように、推定動きベクトル演算部21で計算された4つのサブブロック(SB0 、SB1 、SB2 、SB3 )の推定動きベクトル(fv0 、fv1 、fv2 、fv3 )が等価である場合は、それらの4つのサブブロックに対応するマクロブロック(MB)の動きベクトル(mv)も高い蓋然性でほぼ同じになる。つまり、4つのサブブロックの推定動きベクトル(fv0 、fv1 、fv2 、fv3 )が等価である(揃っている)ということは、それらの4つのサブブロック内の各画像が同一方向に且つ同一量だけ動いているということであり、これは、すなわち、それらの4つのサブブロックに対応するマクロブロック(MB)の画像の動きを表しているからである。ゆえに、この場合は、演算量の削減及び消費電力の抑制並びに処理のオーバヘッドを減らす観点から、大きい分割モード(たとえば、「16×16」)を選択(第一MB動きベクトル出力部24)する。 5 and 6 are conceptual diagrams for explaining the operation of the motion estimation unit 19. First, as shown in FIG. 5, the estimated motion vectors (fv 0 , fv 1 , fv 2 ) of the four sub-blocks (SB 0 , SB 1 , SB 2 , SB 3 ) calculated by the estimated motion vector calculator 21 are When fv 3 ) is equivalent, the motion vectors (mv) of the macroblocks (MB) corresponding to these four sub-blocks are almost the same with high probability. That is, the estimated motion vectors (fv 0 , fv 1 , fv 2 , fv 3 ) of the four sub-blocks are equivalent (equal), so that the images in the four sub-blocks are in the same direction. In addition, the movement is the same amount, that is, it represents the movement of the image of the macroblock (MB) corresponding to those four sub-blocks. Therefore, in this case, a large division mode (for example, “16 × 16”) is selected (first MB motion vector output unit 24) from the viewpoint of reducing the amount of calculation, suppressing power consumption, and reducing processing overhead.

一方、図6に示すように、推定動きベクトル演算部21で計算された4つのサブブロック(SB0 、SB1 、SB2 、SB3 )の推定動きベクトル(fv0 、fv1 、fv2 、fv3 )が等価でない場合(不揃いの場合)は、それらの4つのサブブロック内の各画像がバラバラに動いていることを示唆する。但し、この示唆は正しくないかも知れない。推定動きベクトル(fv0 、fv1 、fv2 、fv3 )は1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)だけのあくまでも“推定値”であって、完全なものではないからである。最終判断は、SB探索部25で4つのサブブロック(SB0 、SB1 、SB2 、SB3 )の正確な動きベクトル(mv0 、mv1 、mv2 、mv3 )を求め、第二判定部26でそれらの等価(mv0 =mv1 =mv2 =mv3 )を判定して行う。そして、その最終判断でも、やはり等価でなければ、上記の“示唆”は正しかったから、サブブロック毎の正確な動きを検出するために、小さな分割モード(たとえば、4つの「8×8」)を選択(SB動きベクトル出力部28)する。一方、第二判定部26の判定結果が“等価でない”場合は、上記の“示唆”は誤りであると判断し、演算量の削減等を意図して大きい分割モード(たとえば、「16×16」)を選択(第二MB動きベクトル出力部27)する。 On the other hand, as shown in FIG. 6, the estimated motion vectors (fv 0 , fv 1 , fv 2 ) of the four sub-blocks (SB 0 , SB 1 , SB 2 , SB 3 ) calculated by the estimated motion vector computing unit 21 If fv 3 ) is not equivalent (uneven), it indicates that the images in those four sub-blocks are moving apart. However, this suggestion may not be correct. The estimated motion vector (fv 0 , fv 1 , fv 2 , fv 3 ) is only an “estimated value” of only one iteration (a predetermined number of iterations or a smaller number of iterations equal to or less than a predetermined number of first iterations). Because it is not perfect. In the final determination, the SB search unit 25 obtains accurate motion vectors (mv 0 , mv 1 , mv 2 , mv 3 ) of the four sub-blocks (SB 0 , SB 1 , SB 2 , SB 3 ) and performs the second determination. The unit 26 determines the equivalence (mv 0 = mv 1 = mv 2 = mv 3 ). And even in the final judgment, if it is still not equivalent, the above “suggestion” was correct, so in order to detect the accurate motion for each sub-block, a small division mode (for example, four “8 × 8”) is used. Select (SB motion vector output unit 28). On the other hand, when the determination result of the second determination unit 26 is “not equivalent”, it is determined that the above “suggestion” is an error, and a large division mode (for example, “16 × 16” is intended to reduce the amount of calculation). ") Is selected (second MB motion vector output unit 27).

<動き推定部の詳細動作>
次に、上記の動き推定部19の動作をより詳しく説明する。なお、ここではフローチャートの形で説明するが、これには二つの意味合いがある。第一の意味は、フローに沿って順番に動作説明を行うことにより理解を助ける点にあり、第二の意味は、上記の動き推定部19のそれぞれの機能をハードロジックで構成する実施態様だけでなく、このようなフローチャートの流れに沿って設計されたソフトウェアとコンピュータとの有機的結合によって実現される実施態様も排除しない点にある。
<Detailed operation of motion estimation unit>
Next, the operation of the motion estimation unit 19 will be described in more detail. In addition, although demonstrated in the form of a flowchart here, this has two implications. The first meaning is to help understanding by explaining the operations in order along the flow, and the second meaning is only an embodiment in which each function of the motion estimation unit 19 is configured by hardware logic. In addition, an embodiment realized by an organic combination of software and a computer designed along the flow of such a flowchart is not excluded.

まず、フローチャートで用いられる用語等について説明する。
図7は、元画像のブロック位置(座標)とブロックサイズを説明する図である。この図において、元画像29の升目30のそれぞれはブロック(MB又はSB)であり、それらのブロック位置は、たとえば、その升目30の左上隅の画素座標(x,y)で表されるものとする。また、ブロックサイズは横方向(行方向)をsx、縦方向(列方向)をsyとして表されるものとする。
First, terms used in the flowchart will be described.
FIG. 7 is a diagram for explaining the block position (coordinates) and block size of the original image. In this figure, each cell 30 of the original image 29 is a block (MB or SB), and the block position thereof is expressed by pixel coordinates (x, y) of the upper left corner of the cell 30, for example. To do. The block size is expressed as sx in the horizontal direction (row direction) and sy in the vertical direction (column direction).

図8は、参照画像に与えるオフセットを示す図である。この図において、参照画像31の上のブロック32のオフセットは(ox,oy)で表されるものとする。   FIG. 8 is a diagram illustrating an offset given to the reference image. In this figure, it is assumed that the offset of the block 32 on the reference image 31 is represented by (ox, oy).

<動き推定部の動作フロー>
図9は、動き推定部19の動作フローチャートを示す図である。このフローチャートを開始すると、まず、SB0 〜SB3 (図2参照)の各々について、探索アルゴリズム(たとえば、最近傍探索法などの高速探索アルゴリズム)の第1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)だけを行って、SB0 〜SB3 の大まかな推定動きベクトルfv0 〜fv3 を演算出力する推定動きベクトル演算処理(ステップS10:第一動きベクトル演算工程)を実行する。次いで、式「fv0 =fv1 =fv2 =fv3 」を評価(ステップS11:第一判定工程)して、その評価結果が“True”であるか否かを判定する(ステップS12)。そして、その判定結果が“True”であれば、次に、MB探索処理(ステップS13:第二動きベクトル演算工程)を実行し、そのMB探索処理で得られたMB動きベクトル(mv)と大きい分割モード(たとえば、「16×16」)とを出力(ステップS14:選択工程、第一選択工程)した後、フローチャートを終了する。
<Operation flow of motion estimation unit>
FIG. 9 is a diagram showing an operation flowchart of the motion estimator 19. When this flowchart is started, first, for each of SB 0 to SB 3 (see FIG. 2), a first iteration (for example, a predetermined number of iterations or a predetermined number of iterations) Estimated motion vector arithmetic processing (step S10: first motion) in which only rough estimated motion vectors fv 0 to fv 3 of SB 0 to SB 3 are calculated and output by performing only a small number of iterations equal to or less than the predetermined first number of iterations. Vector calculation step) is executed. Next, the expression “fv 0 = fv 1 = fv 2 = fv 3 ” is evaluated (step S11: first determination step), and it is determined whether or not the evaluation result is “True” (step S12). If the determination result is “True”, then the MB search process (step S13: second motion vector calculation step) is executed, which is larger than the MB motion vector (mv) obtained by the MB search process. After outputting the division mode (for example, “16 × 16”) (step S14: selection step, first selection step), the flowchart is ended.

一方、ステップS12の判定結果が“True”でなければ、SB探索処理(ステップS15:第三動きベクトル演算工程)を実行し、式「mv0 =mv1 =mv2 =mv3 」を評価(ステップS16:第二判定工程)して、その評価結果が“True”であるか否かを判定する(ステップS17)。そして、その判定結果が“True”であれば、次に、MB動きベクトル(mv0 )と大きい分割モード(たとえば、「16×16」)とを出力(ステップS18:選択工程、第二選択工程)してフローチャートを終了し、その判定結果が“True”でなければ、SB動きベクトル(mv0 〜mv3 )と小さい分割モード(たとえば、「8×8」)とを出力(ステップS19:選択工程、第二選択工程)してフローチャートを終了する。 On the other hand, if the determination result in step S12 is not “True”, an SB search process (step S15: third motion vector calculation step) is executed, and the expression “mv 0 = mv 1 = mv 2 = mv 3 ” is evaluated ( Step S16: second determination step), it is determined whether or not the evaluation result is “True” (Step S17). If the determination result is “True”, then an MB motion vector (mv 0 ) and a large division mode (for example, “16 × 16”) are output (step S18: selection step, second selection step). ) To end the flowchart, and if the determination result is not “True”, an SB motion vector (mv 0 to mv 3 ) and a small division mode (for example, “8 × 8”) are output (step S19: selection) Step, second selection step) and the flowchart is terminated.

<推定動きベクトル演算処理>
図10及び図11は、推定動きベクトル演算処理の動作フローチャートを示す図である。このフローチャートを開始すると、まず、ブロックサイズ変数sx、syとループ変数iにそれぞれ初期値をセットする(ステップS20)。iの初期値は“0”、sxとsyの初期値はSBの横サイズと縦サイズに相当する“8”である。
<Estimated motion vector calculation processing>
10 and 11 are flowcharts showing the operation of the estimated motion vector calculation process. When this flowchart is started, first, initial values are respectively set in the block size variables sx and sy and the loop variable i (step S20). The initial value of i is “0”, and the initial values of sx and sy are “8” corresponding to the horizontal size and vertical size of SB.

初回(i=0):
まず、i=0を判定し(ステップS21)、x=X、y=Yをセットする(ステップS22)。X及びYはSB0 の位置座標を表している。したがって、この回(i=0)では、図2の左上のサブブロック(SB0 )を対象にした処理が行われる。
First time (i = 0):
First, i = 0 is determined (step S21), and x = X and y = Y are set (step S22). X and Y represent the position coordinates of the SB 0. Therefore, at this time (i = 0), the processing for the upper left sub-block (SB 0 ) in FIG. 2 is performed.

次に、SAD関数を用いて、探索中心(x0 ,y0 )の残差評価値A、探索中心(x0 ,y0 )の1画素右(x0 +1、y0 )の残差評価値B、探索中心(x0 ,y0 )の1画素左(x0 −1、y0 )の残差評価値C、探索中心(x0 ,y0 )の1画素上(x0 、y0 +1)の残差評価値D、及び、探索中心(x0 ,y0 )の1画素下(x0 、y0 −1)の残差評価値Eを演算する(ステップS23〜ステップS27)。SAD関数とは、差分絶対値和(sum of absolute difference)を計算するための関数である。 Next, using the SAD function, residuals evaluation of residual evaluation value A of the search center (x 0, y 0), 1 pixel right search center (x 0, y 0) ( x 0 + 1, y 0) value B, the search center (x 0, y 0) 1 pixel left (x 0 -1, y 0) of the residual evaluation value C for the search center (x 0, y 0) of 1 on the pixel (x 0, y 0 + 1) residual evaluation value D and the residual evaluation value E one pixel below the search center (x 0 , y 0 ) (x 0 , y 0 −1) are calculated (steps S23 to S27). . The SAD function is a function for calculating a sum of absolute difference.

なお、探索中心のオフセット(x0 ,y0 )は、ゼロベクトルとしてもよいし、何らかの方法(たとえば、H.264に定められているメディアン予測)によって与えられた予測ベクトルとしてもよい。 Note that the search center offset (x 0 , y 0 ) may be a zero vector or a prediction vector given by some method (for example, median prediction defined in H.264).

SAD関数は、残差評価値A〜Eごとに計算される。すなわち、
A=SAD(x,y,x0 、y0 ,sx,sy)
B=SAD(x,y,x0 +1、y0 ,sx,sy)
C=SAD(x,y,x0 −1、y0 ,sx,sy)
D=SAD(x,y,x0 、y0 +1,sx,sy)
E=SAD(x,y,x0 、y0 −1,sx,sy)
の5回計算される。
The SAD function is calculated for each of the residual evaluation values A to E. That is,
A = SAD (x, y, x 0 , y 0 , sx, sy)
B = SAD (x, y, x 0 +1, y 0 , sx, sy)
C = SAD (x, y, x 0 -1, y 0 , sx, sy)
D = SAD (x, y, x 0 , y 0 +1, sx, sy)
E = SAD (x, y, x 0 , y 0 −1, sx, sy)
Is calculated five times.

今、x=X、y=Y、sx=8、sy=8であるから、
A=SAD(X,Y,x0 、y0 ,8,8)
B=SAD(X,Y,x0 +1、y0 ,8,8)
C=SAD(X,Y,x0 −1、y0 ,8,8)
D=SAD(X,Y,x0 、y0 +1,8,8)
E=SAD(X,Y,x0 、y0 −1,8,8)
となる。これらの式は、たとえば、最近傍探索法などの高速探索アルゴリズムの1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)分に相当する。
Since x = X, y = Y, sx = 8, and sy = 8,
A = SAD (X, Y, x 0, y 0, 8,8)
B = SAD (X, Y, x 0 +1, y 0 , 8, 8)
C = SAD (X, Y, x 0 -1, y 0 , 8, 8)
D = SAD (X, Y, x 0 , y 0 +1, 8, 8)
E = SAD (X, Y, x 0, y 0 -1,8,8)
It becomes. These expressions correspond to, for example, one iteration of a fast search algorithm such as the nearest neighbor search method (a predetermined number of iterations or a smaller number of iterations equal to or less than a predetermined first number of iterations).

次に、Min関数を用いて、A、B、C、D、Eの最小値を取り出し(ステップS28)、その最小値を変数SADminに格納する。   Next, using the Min function, the minimum values of A, B, C, D, and E are extracted (step S28), and the minimum values are stored in the variable SADmin.

次に、SADminに格納されている最小値がA〜Eのいずれであるかを判定する(ステップS29〜ステップS32)。そして、SADmin=Aであれば、fv(i)に(0,0)をセットし(ステップS33)、SADmin=Bであれば、fv(i)に(1,0)をセットし(ステップS34)、SADmin=Cであれば、fv(i)に(−1,0)をセットし(ステップS35)、SADmin=Dであれば、fv(i)に(0,1)をセットし(ステップS36)、SADmin=Eであれば、fv(i)に(0,−0)をセットする(ステップS37)。   Next, it is determined which of A to E is the minimum value stored in SADmin (steps S29 to S32). If SADmin = A, (0,0) is set to fv (i) (step S33), and if SADmin = B, (1,0) is set to fv (i) (step S34). ), If SADmin = C, set (−1, 0) to fv (i) (step S35), and if SADmin = D, set (0, 1) to fv (i) (step S35). (S36) If SADmin = E, (0, −0) is set in fv (i) (step S37).

今、i=0であるから、このfv(i)はfv0 である。したがって、この段階で、図2の左上のサブブロック(SB0 )の推定動きベクトルfv0 が得られる。この推定動きベクトルfv0 は、最近傍探索法などの高速探索アルゴリズムの1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)分に相当する演算を行って得られたものであり、同アルゴリズムを最大反復(予め定められた反復数又は予め定められた第1の反復数)回行って得られた値と比べて精度は劣るが、大凡の動きベクトルの傾向を把握する(推定する)値として差し支えないものである。 Since i = 0 now, this fv (i) is fv 0 . Accordingly, at this stage, the estimated motion vector fv 0 of the upper left sub-block (SB 0 ) in FIG. 2 is obtained. The estimated motion vector fv 0 is subjected to an operation corresponding to one iteration of a fast search algorithm such as the nearest neighbor search method (a predetermined number of iterations or a smaller number of iterations equal to or less than a predetermined first number of iterations). Although the accuracy is inferior to the value obtained by performing the algorithm the maximum number of iterations (predetermined number of iterations or predetermined number of first iterations), the approximate motion vector It can be used as a value for grasping (estimating) the tendency.

第一回目のループ(i=1):
次に、ループ変数iを+1し(ステップS38)、i>3であるか否かを判定する(ステップS29)。今、i=1であるからループし、i=1を判定して(ステップS40)、x=X+8、y=Yをセットする(ステップS41)。X+8及びYはSB1 の位置座標を表している。したがって、この回(i=1)では、図2の右上のサブブロック(SB1 )を対象にした処理が行われる。
First loop (i = 1):
Next, the loop variable i is incremented by 1 (step S38), and it is determined whether or not i> 3 (step S29). Since i = 1, a loop is made, i = 1 is determined (step S40), and x = X + 8 and y = Y are set (step S41). X + 8 and Y represent the position coordinates of SB 1 . Therefore, in this time (i = 1), the process for the upper right sub-block (SB 1 ) in FIG. 2 is performed.

次に、SAD関数を用いて、探索中心(x0 ,y0 )の残差評価値A、探索中心(x0 ,y0 )の1画素右(x0 +1、y0 )の残差評価値B、探索中心(x0 ,y0 )の1画素左(x0 −1、y0 )の残差評価値C、探索中心(x0 ,y0 )の1画素上(x0 、y0 +1)の残差評価値D、及び、探索中心(x0 ,y0 )の1画素下(x0 、y0 −1)の残差評価値Eを演算する(ステップS23〜ステップS27)。 Next, using the SAD function, residuals evaluation of residual evaluation value A of the search center (x 0, y 0), 1 pixel right search center (x 0, y 0) ( x 0 + 1, y 0) value B, the search center (x 0, y 0) 1 pixel left (x 0 -1, y 0) of the residual evaluation value C for the search center (x 0, y 0) of 1 on the pixel (x 0, y 0 + 1) residual evaluation value D and the residual evaluation value E one pixel below the search center (x 0 , y 0 ) (x 0 , y 0 −1) are calculated (steps S23 to S27). .

初回と同様に、SAD関数は、残差評価値A〜Eごとに計算される。すなわち、
A=SAD(x,y,x0 、y0 ,sx,sy)
B=SAD(x,y,x0 +1、y0 ,sx,sy)
C=SAD(x,y,x0 −1、y0 ,sx,sy)
D=SAD(x,y,x0 、y0 +1,sx,sy)
E=SAD(x,y,x0 、y0 −1,sx,sy)
の5回計算される。
Similar to the first time, the SAD function is calculated for each of the residual evaluation values A to E. That is,
A = SAD (x, y, x 0 , y 0 , sx, sy)
B = SAD (x, y, x 0 +1, y 0 , sx, sy)
C = SAD (x, y, x 0 -1, y 0 , sx, sy)
D = SAD (x, y, x 0 , y 0 +1, sx, sy)
E = SAD (x, y, x 0 , y 0 −1, sx, sy)
Is calculated five times.

今、x=X+8、y=Y、sx=8、sy=8であるから、
A=SAD(X+8,Y,x0 、y0 ,8,8)
B=SAD(X+8,Y,x0 +1、y0 ,8,8)
C=SAD(X+8,Y,x0 −1、y0 ,8,8)
D=SAD(X+8,Y,x0 、y0 +1,8,8)
E=SAD(X+8,Y,x0 、y0 −1,8,8)
となる。これらの式は、たとえば、最近傍探索法などの高速探索アルゴリズムの1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)分に相当する。
Since x = X + 8, y = Y, sx = 8, and sy = 8,
A = SAD (X + 8, Y, x 0 , y 0 , 8, 8)
B = SAD (X + 8, Y, x 0 +1, y 0 , 8, 8)
C = SAD (X + 8, Y, x 0 -1, y 0, 8,8)
D = SAD (X + 8, Y, x 0 , y 0 +1, 8, 8)
E = SAD (X + 8, Y, x 0 , y 0 −1, 8, 8)
It becomes. These expressions correspond to, for example, one iteration of a fast search algorithm such as the nearest neighbor search method (a predetermined number of iterations or a smaller number of iterations equal to or less than a predetermined first number of iterations).

次に、Min関数を用いて、A、B、C、D、Eの最小値を取り出し(ステップS28)、その最小値を変数SADminに格納する。   Next, using the Min function, the minimum values of A, B, C, D, and E are extracted (step S28), and the minimum values are stored in the variable SADmin.

次に、SADminに格納されている最小値がA〜Eのいずれであるかを判定する(ステップS29〜ステップS32)。そして、SADmin=Aであれば、fv(i)に(0,0)をセットし(ステップS33)、SADmin=Bであれば、fv(i)に(1,0)をセットし(ステップS34)、SADmin=Cであれば、fv(i)に(−1,0)をセットし(ステップS35)、SADmin=Dであれば、fv(i)に(0,1)をセットし(ステップS36)、SADmin=Eであれば、fv(i)に(0,−0)をセットする(ステップS37)。   Next, it is determined which of A to E is the minimum value stored in SADmin (steps S29 to S32). If SADmin = A, (0,0) is set to fv (i) (step S33), and if SADmin = B, (1,0) is set to fv (i) (step S34). ), If SADmin = C, set (−1, 0) to fv (i) (step S35), and if SADmin = D, set (0, 1) to fv (i) (step S35). (S36) If SADmin = E, (0, −0) is set in fv (i) (step S37).

今、i=1であるから、このfv(i)はfv1 である。したがって、この段階で、図2の右上のサブブロック(SB1 )の推定動きベクトルfv1 が得られる。この推定動きベクトルfv1 も、上記の推定動きベクトルfv0 と同様に、最近傍探索法などの高速探索アルゴリズムの1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)分に相当する演算を行って得られたものであり、同アルゴリズムを最大反復(予め定められた反復数又は予め定められた第1の反復数)回行って得られた値と比べて精度は劣るが、大凡の動きベクトルの傾向を把握する(推定する)値として差し支えないものである。 Since i = 1 at this time, fv (i) is fv 1 . Therefore, at this stage, the estimated motion vector fv 1 of the upper right sub-block (SB 1 ) in FIG. 2 is obtained. Similarly to the estimated motion vector fv 0 , the estimated motion vector fv 1 is also one iteration of a fast search algorithm such as the nearest neighbor search method (a predetermined iteration number or a predetermined first iteration number or less). It is obtained by performing an operation corresponding to a small number of iterations), and is compared with a value obtained by performing the same algorithm the maximum number of iterations (a predetermined number of iterations or a predetermined first number of iterations). Although it is inferior in accuracy, it can be used as a value for grasping (estimating) the tendency of an approximate motion vector.

第二回目のループ(i=2):
次に、ループ変数iを+1し(ステップS38)、i>3であるか否かを判定する(ステップS29)。今、i=2であるからループし、i=2を判定して(ステップS42)、x=X、y=Y+8をセットする(ステップS43)。X及びY+8はSB2 の位置座標を表している。したがって、この回(i=2)では、図2の左下のサブブロック(SB2 )を対象にした処理が行われる。
Second loop (i = 2):
Next, the loop variable i is incremented by 1 (step S38), and it is determined whether or not i> 3 (step S29). Since i = 2, a loop is made, i = 2 is determined (step S42), and x = X and y = Y + 8 are set (step S43). X and Y + 8 represents the position coordinates of SB 2. Therefore, in this time (i = 2), the processing for the lower left sub-block (SB 2 ) in FIG. 2 is performed.

次に、SAD関数を用いて、探索中心(x0 ,y0 )の残差評価値A、探索中心(x0 ,y0 )の1画素右(x0 +1、y0 )の残差評価値B、探索中心(x0 ,y0 )の1画素左(x0 −1、y0 )の残差評価値C、探索中心(x0 ,y0 )の1画素上(x0 、y0 +1)の残差評価値D、及び、探索中心(x0 ,y0 )の1画素下(x0 、y0 −1)の残差評価値Eを演算する(ステップS23〜ステップS27)。 Next, using the SAD function, residuals evaluation of residual evaluation value A of the search center (x 0, y 0), 1 pixel right search center (x 0, y 0) ( x 0 + 1, y 0) value B, the search center (x 0, y 0) 1 pixel left (x 0 -1, y 0) of the residual evaluation value C for the search center (x 0, y 0) of 1 on the pixel (x 0, y 0 + 1) residual evaluation value D and the residual evaluation value E one pixel below the search center (x 0 , y 0 ) (x 0 , y 0 −1) are calculated (steps S23 to S27). .

初回及び第一回のループと同様に、SAD関数は、残差評価値A〜Eごとに計算される。すなわち、
A=SAD(x,y,x0 、y0 ,sx,sy)
B=SAD(x,y,x0 +1、y0 ,sx,sy)
C=SAD(x,y,x0 −1、y0 ,sx,sy)
D=SAD(x,y,x0 、y0 +1,sx,sy)
E=SAD(x,y,x0 、y0 −1,sx,sy)
の5回計算される。
Similar to the first and first loops, the SAD function is calculated for each of the residual evaluation values A to E. That is,
A = SAD (x, y, x 0 , y 0 , sx, sy)
B = SAD (x, y, x 0 +1, y 0 , sx, sy)
C = SAD (x, y, x 0 -1, y 0 , sx, sy)
D = SAD (x, y, x 0 , y 0 +1, sx, sy)
E = SAD (x, y, x 0 , y 0 −1, sx, sy)
Is calculated five times.

今、x=X、y=Y+8、sx=8、sy=8であるから、
A=SAD(X,Y+8,x0 、y0 ,8,8)
B=SAD(X,Y+8,x0 +1、y0 ,8,8)
C=SAD(X,Y+8,x0 −1、y0 ,8,8)
D=SAD(X,Y+8,x0 、y0 +1,8,8)
E=SAD(X,Y+8,x0 、y0 −1,8,8)
となる。これらの式は、たとえば、最近傍探索法などの高速探索アルゴリズムの1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)分に相当する。
Since x = X, y = Y + 8, sx = 8, and sy = 8,
A = SAD (X, Y + 8, x 0 , y 0 , 8, 8)
B = SAD (X, Y + 8, x 0 +1, y 0 , 8, 8)
C = SAD (X, Y + 8, x 0 -1, y 0 , 8, 8)
D = SAD (X, Y + 8, x 0 , y 0 +1, 8, 8)
E = SAD (X, Y + 8, x 0, y 0 -1,8,8)
It becomes. These expressions correspond to, for example, one iteration of a fast search algorithm such as the nearest neighbor search method (a predetermined number of iterations or a smaller number of iterations equal to or less than a predetermined first number of iterations).

次に、Min関数を用いて、A、B、C、D、Eの最小値を取り出し(ステップS28)、その最小値を変数SADminに格納する。   Next, using the Min function, the minimum values of A, B, C, D, and E are extracted (step S28), and the minimum values are stored in the variable SADmin.

次に、SADminに格納されている最小値がA〜Eのいずれであるかを判定する(ステップS29〜ステップS32)。そして、SADmin=Aであれば、fv(i)に(0,0)をセットし(ステップS33)、SADmin=Bであれば、fv(i)に(1,0)をセットし(ステップS34)、SADmin=Cであれば、fv(i)に(−1,0)をセットし(ステップS35)、SADmin=Dであれば、fv(i)に(0,1)をセットし(ステップS36)、SADmin=Eであれば、fv(i)に(0,−0)をセットする(ステップS37)。   Next, it is determined which of A to E is the minimum value stored in SADmin (steps S29 to S32). If SADmin = A, (0,0) is set to fv (i) (step S33), and if SADmin = B, (1,0) is set to fv (i) (step S34). ), If SADmin = C, set (−1, 0) to fv (i) (step S35), and if SADmin = D, set (0, 1) to fv (i) (step S35). (S36) If SADmin = E, (0, −0) is set in fv (i) (step S37).

今、i=2であるから、このfv(i)はfv2 である。したがって、この段階で、図2の左下のサブブロック(SB2 )の推定動きベクトルfv2 が得られる。この推定動きベクトルfv2 も、上記の推定動きベクトルfv0 、fv1 と同様に、最近傍探索法などの高速探索アルゴリズムの1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)分に相当する演算を行って得られたものであり、同アルゴリズムを最大反復(予め定められた反復数又は予め定められた第1の反復数)回行って得られた値と比べて精度は劣るが、大凡の動きベクトルの傾向を把握する(推定する)値として差し支えないものである。 Now, since it is i = 2, the fv (i) is a fv 2. Therefore, at this stage, the estimated motion vector fv 2 of the lower left sub-block (SB 2 ) in FIG. 2 is obtained. Similarly to the estimated motion vectors fv 0 and fv 1 , this estimated motion vector fv 2 is one iteration of a fast search algorithm such as the nearest neighbor search method (a predetermined number of iterations or a predetermined first iteration). Obtained by performing an operation corresponding to the number of iterations (less than a few iterations), and obtained by performing the same maximum number of iterations (a predetermined number of iterations or a predetermined number of first iterations). Although the accuracy is inferior to the value, it can be used as a value for grasping (estimating) the tendency of a general motion vector.

第三回目のループ(i=3):
次に、ループ変数iを+1し(ステップS38)、i>3であるか否かを判定する(ステップS29)。今、i=3であるからループし、i=3を判定して(ステップS42の“NO”)、x=X+8、y=Y+8をセットする(ステップS44)。X+8及びY+8はSB3 の座標を表す。したがって、この回(i=3)では、図2の左下のサブブロック(SB3 )を対象にした処理が行われる。
Third loop (i = 3):
Next, the loop variable i is incremented by 1 (step S38), and it is determined whether or not i> 3 (step S29). Since i = 3, a loop is performed, i = 3 is determined (“NO” in step S42), and x = X + 8 and y = Y + 8 are set (step S44). X + 8 and Y + 8 represent the coordinates of SB 3 . Therefore, in this time (i = 3), the process for the lower left sub-block (SB 3 ) in FIG. 2 is performed.

次に、SAD関数を用いて、探索中心(x0 ,y0 )の残差評価値A、探索中心(x0 ,y0 )の1画素右(x0 +1、y0 )の残差評価値B、探索中心(x0 ,y0 )の1画素左(x0 −1、y0 )の残差評価値C、探索中心(x0 ,y0 )の1画素上(x0 、y0 +1)の残差評価値D、及び、探索中心(x0 ,y0 )の1画素下(x0 、y0 −1)の残差評価値Eを演算する(ステップS23〜ステップS27)。 Next, using the SAD function, residuals evaluation of residual evaluation value A of the search center (x 0, y 0), 1 pixel right search center (x 0, y 0) ( x 0 + 1, y 0) value B, the search center (x 0, y 0) 1 pixel left (x 0 -1, y 0) of the residual evaluation value C for the search center (x 0, y 0) of 1 on the pixel (x 0, y 0 + 1) residual evaluation value D and the residual evaluation value E one pixel below the search center (x 0 , y 0 ) (x 0 , y 0 −1) are calculated (steps S23 to S27). .

初回〜第二回のループと同様に、SAD関数は、残差評価値A〜Eごとに計算される。すなわち、
A=SAD(x,y,x0 、y0 ,sx,sy)
B=SAD(x,y,x0 +1、y0 ,sx,sy)
C=SAD(x,y,x0 −1、y0 ,sx,sy)
D=SAD(x,y,x0 、y0 +1,sx,sy)
E=SAD(x,y,x0 、y0 −1,sx,sy)
の5回計算される。
Similar to the first to second loops, the SAD function is calculated for each of the residual evaluation values A to E. That is,
A = SAD (x, y, x 0 , y 0 , sx, sy)
B = SAD (x, y, x 0 +1, y 0 , sx, sy)
C = SAD (x, y, x 0 -1, y 0 , sx, sy)
D = SAD (x, y, x 0 , y 0 +1, sx, sy)
E = SAD (x, y, x 0 , y 0 −1, sx, sy)
Is calculated five times.

今、x=X+8、y=Y+8、sx=8、sy=8であるから、
A=SAD(X+8,Y+8,x0 、y0 ,8,8)
B=SAD(X+8,Y+8,x0 +1、y0 ,8,8)
C=SAD(X+8,Y+8,x0 −1、y0 ,8,8)
D=SAD(X+8,Y+8,x0 、y0 +1,8,8)
E=SAD(X+8,Y+8,x0 、y0 −1,8,8)
となる。これらの式は、たとえば、最近傍探索法などの高速探索アルゴリズムの1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)分に相当する。
Since x = X + 8, y = Y + 8, sx = 8, and sy = 8,
A = SAD (X + 8, Y + 8, x 0 , y 0 , 8, 8)
B = SAD (X + 8, Y + 8, x 0 +1, y 0 , 8, 8)
C = SAD (X + 8, Y + 8, x 0 -1, y 0 , 8, 8)
D = SAD (X + 8, Y + 8, x 0 , y 0 +1, 8, 8)
E = SAD (X + 8, Y + 8, x 0 , y 0 −1, 8, 8)
It becomes. These expressions correspond to, for example, one iteration of a fast search algorithm such as the nearest neighbor search method (a predetermined number of iterations or a smaller number of iterations equal to or less than a predetermined first number of iterations).

次に、Min関数を用いて、A、B、C、D、Eの最小値を取り出し(ステップS28)、その最小値を変数SADminに格納する。   Next, using the Min function, the minimum values of A, B, C, D, and E are extracted (step S28), and the minimum values are stored in the variable SADmin.

次に、SADminに格納されている最小値がA〜Eのいずれであるかを判定する(ステップS29〜ステップS32)。そして、SADmin=Aであれば、fv(i)に(0,0)をセットし(ステップS33)、SADmin=Bであれば、fv(i)に(1,0)をセットし(ステップS34)、SADmin=Cであれば、fv(i)に(−1,0)をセットし(ステップS35)、SADmin=Dであれば、fv(i)に(0,1)をセットし(ステップS36)、SADmin=Eであれば、fv(i)に(0,−0)をセットする(ステップS37)。   Next, it is determined which of A to E is the minimum value stored in SADmin (steps S29 to S32). If SADmin = A, (0,0) is set to fv (i) (step S33), and if SADmin = B, (1,0) is set to fv (i) (step S34). ), If SADmin = C, set (−1, 0) to fv (i) (step S35), and if SADmin = D, set (0, 1) to fv (i) (step S35). (S36) If SADmin = E, (0, −0) is set in fv (i) (step S37).

今、i=3であるから、このfv(i)はfv3 である。したがって、この段階で、図2の右下のサブブロック(SB3 )の推定動きベクトルfv3 が得られる。この推定動きベクトルfv3 も、上記の推定動きベクトルfv0 、fv1 、fv2 と同様に、最近傍探索法などの高速探索アルゴリズムの1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)分に相当する演算を行って得られたものであり、同アルゴリズムを最大反復(予め定められた反復数又は予め定められた第1の反復数)回行って得られた値と比べて精度は劣るが、大凡の動きベクトルの傾向を把握する(推定する)値として差し支えないものである。 Now, since i = a 3, the fv (i) is a fv 3. Therefore, at this stage, the estimated motion vector fv 3 of the lower right sub-block (SB 3 ) in FIG. 2 is obtained. Similarly to the estimated motion vectors fv 0 , fv 1 , and fv 2 , this estimated motion vector fv 3 is also one iteration of a fast search algorithm such as nearest neighbor search (a predetermined number of iterations or a predetermined number of iterations). Obtained by performing an operation corresponding to the number of iterations equal to or less than one iteration), and performing the maximum number of iterations (predetermined number of iterations or predetermined number of first iterations). Although the accuracy is inferior to the obtained value, it can be used as a value for grasping (estimating) the tendency of an approximate motion vector.

次に、ループ変数iを+1し(ステップS38)、i>3であるか否かを判定するが(ステップS29)、i=4であるので、ループを抜けてフローチャートを終了する。   Next, the loop variable i is incremented by 1 (step S38), and it is determined whether i> 3 (step S29). Since i = 4, the process exits the loop and ends the flowchart.

この推定動きベクトル演算処理によれば、図2の4つのサブブロック(SB0 〜SB3 )の各々の大まかな推定動きベクトルfv0 〜fv3 が得られる。 According to the estimated motion vector calculation processing, the respective rough estimate motion vectors fv 0 ~fv 3 of the four sub-blocks in FIG. 2 (SB 0 ~SB 3) is obtained.

すなわち、SB0 の探索中心(x0 ,y0 )の残差評価値A、探索中心(x0 ,y0 )の1画素右(x0 +1、y0 )の残差評価値B、探索中心(x0 ,y0 )の1画素左(x0 −1、y0 )の残差評価値C、探索中心(x0 ,y0 )の1画素上(x0 、y0 +1)の残差評価値D、及び、探索中心(x0 ,y0 )の1画素下(x0 、y0 −1)の残差評価値Eのうち最小のものを「fv0 」として、
また、SB1 の探索中心(x0 ,y0 )の残差評価値A、探索中心(x0 ,y0 )の1画素右(x0 +1、y0 )の残差評価値B、探索中心(x0 ,y0 )の1画素左(x0 −1、y0 )の残差評価値C、探索中心(x0 ,y0 )の1画素上(x0 、y0 +1)の残差評価値D、及び、探索中心(x0 ,y0 )の1画素下(x0 、y0 −1)の残差評価値Eのうち最小のものを「fv1 」として、
また、SB2 の探索中心(x0 ,y0 )の残差評価値A、探索中心(x0 ,y0 )の1画素右(x0 +1、y0 )の残差評価値B、探索中心(x0 ,y0 )の1画素左(x0 −1、y0 )の残差評価値C、探索中心(x0 ,y0 )の1画素上(x0 、y0 +1)の残差評価値D、及び、探索中心(x0 ,y0 )の1画素下(x0 、y0 −1)の残差評価値Eのうち最小のものを「fv2 」として、
また、SB3 の探索中心(x0 ,y0 )の残差評価値A、探索中心(x0 ,y0 )の1画素右(x0 +1、y0 )の残差評価値B、探索中心(x0 ,y0 )の1画素左(x0 −1、y0 )の残差評価値C、探索中心(x0 ,y0 )の1画素上(x0 、y0 +1)の残差評価値D、及び、探索中心(x0 ,y0 )の1画素下(x0 、y0 −1)の残差評価値Eのうち最小のものを「fv3 」として、それぞれ得られる。
That is, the residual evaluation value A of the searching center of the SB 0 (x 0, y 0), the search center (x 0, y 0) residual evaluation value of one pixel right (x 0 + 1, y 0 ) B, search center (x 0, y 0) 1 pixel left (x 0 -1, y 0) of the residual evaluation value C for the search center (x 0, y 0) of 1 on the pixel (x 0, y 0 +1) Among the residual evaluation value D and the residual evaluation value E one pixel below (x 0 , y 0 −1) of the search center (x 0 , y 0 ), the smallest one is defined as “fv 0 ”.
Also, the search center of SB 1 (x 0, y 0) residual evaluation value A, the search center (x 0, y 0) residual evaluation value of one pixel right (x 0 + 1, y 0 ) B, search center (x 0, y 0) 1 pixel left (x 0 -1, y 0) of the residual evaluation value C for the search center (x 0, y 0) of 1 on the pixel (x 0, y 0 +1) The smallest one of the residual evaluation value D and the residual evaluation value E one pixel below (x 0 , y 0 −1) of the search center (x 0 , y 0 ) is defined as “fv 1 ”.
Also, the search center of SB 2 (x 0, y 0) residual evaluation value A, the search center (x 0, y 0) residual evaluation value of one pixel right (x 0 + 1, y 0 ) B, search center (x 0, y 0) 1 pixel left (x 0 -1, y 0) of the residual evaluation value C for the search center (x 0, y 0) of 1 on the pixel (x 0, y 0 +1) The smallest one of the residual evaluation value D and the residual evaluation value E one pixel below (x 0 , y 0 −1) of the search center (x 0 , y 0 ) is defined as “fv 2 ”.
Also, the search center of SB 3 (x 0, y 0) residual evaluation value A, the search center (x 0, y 0) residual evaluation value of one pixel right (x 0 + 1, y 0 ) B, search center (x 0, y 0) 1 pixel left (x 0 -1, y 0) of the residual evaluation value C for the search center (x 0, y 0) of 1 on the pixel (x 0, y 0 +1) Of the residual evaluation value D and the residual evaluation value E one pixel below (x 0 , y 0 −1) of the search center (x 0 , y 0 ), the smallest one is obtained as “fv 3 ”. It is done.

これらの推定動きベクトルfv0 〜fv3 は、SB0 〜SB3 のそれぞれで5回のSAD演算を行うことによって得られたものであり、この演算は、最近傍探索法などの高速探索アルゴリズムの1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)分に相当するから、当該高速探索アルゴリズムの全反復(予め定められた反復数又は予め定められた第1の反復数)演算に比べて短時間で結果が得られ、しかも、演算の処理量も少ない。 These estimated motion vectors fv 0 to fv 3 are obtained by performing five SAD operations on each of SB 0 to SB 3 , and this calculation is performed by a fast search algorithm such as the nearest neighbor search method. Since this corresponds to one iteration (a predetermined number of iterations or a smaller number of iterations less than or equal to a predetermined number of first iterations), all the iterations of the fast search algorithm (a predetermined number of iterations or a predetermined number of iterations) The number of iterations of 1) results can be obtained in a shorter time than the calculation, and the processing amount of the calculation is also small.

<MB探索処理>
図12は、MB探索処理の動作フローチャートを示す図である。このフローチャートを開始すると、まず、fv0 が初期値(x0 ,y0 )であるか否かを判定し(ステップS50)、初期値である場合はmvに(x0 ,y0 )をセット(ステップS51)した後、フローチャートを終了する。
<MB search process>
FIG. 12 is a diagram showing an operation flowchart of the MB search process. When this flowchart is started, first, it is determined whether or not fv 0 is an initial value (x 0 , y 0 ) (step S50). If it is an initial value, (x 0 , y 0 ) is set to mv. After (step S51), the flowchart ends.

一方、fv0 が初期値(x0 ,y0 )でなかった場合は、まず、x=X,y=Y、ox=fv0 、oy=fv0 、sx=16、sy=16、n=14をセット(ステップS52)する。次いで、それらを引数にしてNNS関数処理(図14又は図15)を実行し、その関数の戻り値をmvにセットして(ステップS53)、フローチャートを終了する。ここで、x=X,y=Y、ox=fv0 、oy=fv0 、sx=16、sy=16、n=14であるから、NNS(X,Y,fv0 ,fv0 ,16,16,14)となる。NNS関数は、与えられた引数を条件にして最近傍探索(Nearest Neighbours Search)を行い、その結果(動きベクトル)を返す関数である。NNS関数の処理内容については後述する(図13及び図14)。 On the other hand, if fv 0 is not the initial value (x 0 , y 0 ), first, x = X, y = Y, ox = fv 0 , oy = fv 0 , sx = 16, sy = 16, n = 14 is set (step S52). Next, NNS function processing (FIG. 14 or FIG. 15) is executed using them as arguments, the return value of the function is set to mv (step S53), and the flowchart ends. Here, since x = X, y = Y, ox = fv 0 , oy = fv 0 , sx = 16, sy = 16, and n = 14, NNS (X, Y, fv 0 , fv 0 , 16, 16, 14). The NNS function is a function that performs a Nearest Neighbors Search on condition of a given argument and returns a result (motion vector). The processing contents of the NNS function will be described later (FIGS. 13 and 14).

このように、このMB探索処理では、高速探索アルゴリズム、たとえば、最近傍探索法のNNS関数を用い、その最大反復回数(n)を、たとえば、14回(この回数は、発明の要旨に記載の「予め定められた第2の反復数」に相当する)にして、一つのマクロブロック(MB)の正確な動きベクトル(mv)を演算する。   Thus, in this MB search process, a fast search algorithm, for example, the NNS function of the nearest neighbor search method is used, and the maximum number of iterations (n) is, for example, 14 times (this number is described in the gist of the invention). (Corresponding to “predetermined second number of iterations”), an accurate motion vector (mv) of one macroblock (MB) is calculated.

<SB探索処理>
図13は、SB探索処理の動作フローチャートを示す図である。このフローチャートを開始すると、まず、sx=8、sy=8、n=14をセットする(ステップS60)。次いで、x=X、y=Y、ox=fv0 、oy=fv0 をセットし(ステップS61)、それらを引数にしてNNS関数処理(図14又は図15)を実行し、その関数の戻り値をmv0 にセットする(ステップS62)。ここで、x=X、y=Y、ox=fv0 、oy=fv0 、sx=8、sy=8、n=14であるから、NNS(X,Y,fv0 ,fv0 ,8,8,14)となる。
<SB search process>
FIG. 13 is a diagram illustrating an operation flowchart of the SB search process. When this flowchart is started, first, sx = 8, sy = 8, and n = 14 are set (step S60). Next, x = X, y = Y, ox = fv 0 , oy = fv 0 are set (step S 61), NNS function processing (FIG. 14 or FIG. 15) is executed using them as arguments, and the function returns. The value is set to mv 0 (step S62). Here, since x = X, y = Y, ox = fv 0 , oy = fv 0 , sx = 8, sy = 8, and n = 14, NNS (X, Y, fv 0 , fv 0 , 8, 8, 14).

次いで、x=X+8、y=Y、ox=fv1 、oy=fv1 をセットし(ステップS63)、それらを引数にしてNNS関数処理(図14又は図15)を実行し、その関数の戻り値をmv1 にセットする(ステップS64)。ここで、x=X+8、y=Y、ox=fv1 、oy=fv1 、sx=8、sy=8、n=14であるから、NNS(X+8,Y,fv1 ,fv1 ,8,8,14)となる。 Next, x = X + 8, y = Y, ox = fv 1 , oy = fv 1 are set (step S 63), NNS function processing (FIG. 14 or FIG. 15) is executed using them as arguments, and the function returns The value is set to mv 1 (step S64). Here, since x = X + 8, y = Y, ox = fv 1 , oy = fv 1 , sx = 8, sy = 8, and n = 14, NNS (X + 8, Y, fv 1 , fv 1 , 8, 8, 14).

次いで、x=X、y=Y+8、ox=fv2 、oy=fv2 をセットし(ステップS65)、それらを引数にしてNNS関数処理(図14又は図15)を実行し、その関数の戻り値をmv2 にセットする(ステップS66)。ここで、x=X、y=Y+8、ox=fv2 、oy=fv2 、sx=8、sy=8、n=14であるから、NNS(X,Y+8,fv2 ,fv2 ,8,8,14)となる。 Next, x = X, y = Y + 8, ox = fv 2 , oy = fv 2 are set (step S65), NNS function processing (FIG. 14 or FIG. 15) is executed with these as arguments, and the function returns The value is set to mv 2 (step S66). Here, since x = X, y = Y + 8, ox = fv 2 , oy = fv 2 , sx = 8, sy = 8, and n = 14, NNS (X, Y + 8, fv 2 , fv 2 , 8, 8, 14).

次いで、x=X+8、y=Y+8、ox=fv3 、oy=fv3 をセットし(ステップS67)、それらを引数にしてNNS関数処理(図14又は図15)を実行して、その関数の戻り値をmv3 にセットする(ステップS68)。ここで、x=X+8、y=Y+8、ox=fv3 、oy=fv3 、sx=8、sy=8、n=14であるから、NNS(X+8,Y+8,fv3 ,fv3 ,8,8,14)となる。 Next, x = X + 8, y = Y + 8, ox = fv 3 , oy = fv 3 are set (step S 67), and NNS function processing (FIG. 14 or FIG. 15) is executed using them as arguments. The return value is set to mv 3 (step S68). Here, since x = X + 8, y = Y + 8, ox = fv 3 , oy = fv 3 , sx = 8, sy = 8, and n = 14, NNS (X + 8, Y + 8, fv 3 , fv 3 , 8, 8, 14).

このように、このSB探索処理では、高速探索アルゴリズム、たとえば、最近傍探索法のNNS関数を用い、その最大反復回数(n)を、たとえば、14回(この回数は、発明の要旨に記載の「予め定められた第3の反復数」に相当する)にして、各サブブロック(SB0 、SB1 、SB2 、SB3)毎の正確な動きベクトル(mv0 、mv1 、mv2 、mv3 )を演算する。 Thus, in this SB search process, a fast search algorithm, for example, the NNS function of the nearest neighbor search method is used, and the maximum number of iterations (n) is, for example, 14 times (this number is described in the gist of the invention). (Corresponding to a “predetermined third number of iterations”), the accurate motion vectors (mv 0 , mv 1 , mv 2 ) for each sub-block (SB 0 , SB 1 , SB 2 , SB 3 ) mv 3 ) is calculated.

なお、以上の例では、MB探索処理の最大反復数n(予め定められた第2の反復数)とSB探索処理の最大反復数n(予め定められた第3の反復数)とを同一の値(“14”)にしているが、これに限定されない。異なる値であってもよい。   In the above example, the maximum number n of MB search processes (predetermined second iteration number) and the maximum number of SB search processes n (predetermined third iteration number) are the same. Although the value (“14”) is set, the present invention is not limited to this. It may be a different value.

<NNS関数処理>
図14は、NNS関数処理のフローチャートを示す図である。この関数は与えられた引数(x:ブロックX座標,y:ブロックY座標,ox:オフセットX座標,oy:オフセットY座標,sx:ブロックサイズX,sy:ブロックサイズY,n:最大反復数)に従って高速探索アルゴリズムの一つである最近傍探索法を実行し、その結果を戻り値として返す。
<NNS function processing>
FIG. 14 is a flowchart of the NNS function process. This function is given arguments (x: block X coordinate, y: block Y coordinate, ox: offset X coordinate, oy: offset Y coordinate, sx: block size X, sy: block size Y, n: maximum number of iterations) The nearest neighbor search method which is one of the fast search algorithms is executed according to, and the result is returned as a return value.

NNS関数は、まず、反復のためのループ変数iに初期値0をセットし(ステップS70)、次いで、探索中心の残差評価値A、探索中心の1画素右の残差評価値B、探索中心の1画素左の残差評価値C、探索中心の1画素上の残差評価値D、及び、探索中心の1画素下の残差評価値Eを演算する(ステップS71)。これらの残差評価値A〜Eは、前記の推定動きベクトル演算処理(図10及び図11参照)と同様に、SAD関数を用いて求めることができる。   The NNS function first sets an initial value 0 to a loop variable i for iteration (step S70), then a residual evaluation value A at the search center, a residual evaluation value B right one pixel from the search center, a search A residual evaluation value C left one pixel at the center, a residual evaluation value D one pixel above the search center, and a residual evaluation value E one pixel below the search center are calculated (step S71). These residual evaluation values A to E can be obtained using the SAD function in the same manner as the estimated motion vector calculation process (see FIGS. 10 and 11).

次に、A〜Eのうちの最小値を求める(ステップS72)。この最小値も、前記の推定動きベクトル演算処理(図10及び図11参照)と同様に、Min関数を用いて求めることができる。   Next, the minimum value among A to E is obtained (step S72). This minimum value can also be obtained using the Min function in the same manner as the estimated motion vector calculation process (see FIGS. 10 and 11).

次に、最小値が探索中心で得られたものであるか否かを判定する(ステップS73)。そして、最小値が探索中心で得られたものであれば、その探索中心の座標を戻り値にして(ステップS74)、フローを終了(反復を終了)する。   Next, it is determined whether or not the minimum value is obtained at the search center (step S73). If the minimum value is obtained at the search center, the coordinates of the search center are set as return values (step S74), and the flow is ended (iteration is ended).

一方、最小値が探索中心で得られたものでなければ、最小値が得られた画素を新たな探索中心にセットする(ステップS75)。すなわち、最小値=Bであれば探索中心の1画素右を新たな探索中心にセットし、最小値=Cであれば探索中心の1画素左を新たな探索中心にセットし、最小値=Dであれば探索中心の1画素上を新たな探索中心にセットし、又は、最小値=Eであれば探索中心の1画素下を新たな探索中心にセットする。
次いで、ループ変数iを+1して(ステップS76)、そのiが最大反復数nを超えているか否かを判定し(ステップS77)、超えていなければ、ステップS71に戻って以上の処理を繰り返し(反復し)、超えていれば、そのときの探索中心の座標を戻り値にして(ステップS74)、フローを終了(反復を終了)する。
On the other hand, if the minimum value is not obtained at the search center, the pixel from which the minimum value is obtained is set as a new search center (step S75). That is, if the minimum value = B, one pixel right of the search center is set as a new search center, and if the minimum value = C, one pixel left of the search center is set as a new search center, and the minimum value = D If so, one pixel above the search center is set as a new search center, or if the minimum value = E, one pixel below the search center is set as a new search center.
Next, the loop variable i is incremented by 1 (step S76), and it is determined whether or not i exceeds the maximum number of iterations n (step S77). If not, the process returns to step S71 and the above processing is repeated. If it has exceeded (repeated), the coordinates of the search center at that time are set as return values (step S74), and the flow is terminated (repetition is terminated).

このように、NNS関数処理では、与えられた引数の最大反復数nを上限にして反復を繰り返しながら逐次に探索を行い、正確な動きベクトルを返すことができる。   As described above, in the NNS function processing, it is possible to perform a search sequentially while repeating iterations up to the maximum number of iterations n of a given argument, and return an accurate motion vector.

ところで、このNNS関数処理では、第一反復(i=0)から処理を開始しているが、先の推定動きベクトル演算処理(図10及び図11参照)においても、この第一反復に相当する処理(ステップS23〜ステップS27)を行っているため、二重の演算であり無駄であるから、次のように改良することが望ましい。   By the way, in this NNS function processing, the processing is started from the first iteration (i = 0), but this is also equivalent to this first iteration in the estimated motion vector calculation processing (see FIGS. 10 and 11). Since the processing (step S23 to step S27) is performed, it is a double operation and is useless, so it is desirable to improve as follows.

図15は、改良されたNNS関数処理の要部フローチャートを示す図である。改良前との違いは、探索中心及びその探索中心近傍4点の計5個の残差評価値A〜Eを演算する(ステップS71)前に、新たな処理(ステップS78)を行う点にある。   FIG. 15 is a diagram showing a main part flowchart of the improved NNS function process. The difference from before the improvement is that a new process (step S78) is performed before calculating a total of five residual evaluation values A to E of the search center and four points in the vicinity of the search center (step S71). .

この処理(ステップS78)では、i=0であるか否かを判定(つまり、第一反復であるか否か)し(ステップS78a)、第一反復でなければ(第二反復、第三反復、・・・・であれば)、改良前と同様に探索中心及びその探索中心近傍4点の計5個の残差評価値A〜Eを演算する(ステップS71)が、第一反復である場合には、「推定動きベクトル演算処理の中間値(図10のステップS23〜ステップS27で求められたA〜E)を取り込み、それらを探索中心及びその探索中心近傍4点の計5個の残差評価値A〜Eとして流用する」(ステップS78b)。   In this process (step S78), it is determined whether i = 0 (that is, whether it is the first iteration) (step S78a), and if it is not the first iteration (second iteration, third iteration). ,...), A total of five residual evaluation values A to E of the search center and four points in the vicinity of the search center are calculated in the same way as before the improvement (step S71). In this case, “the intermediate value of the estimated motion vector calculation process (A to E obtained in step S23 to step S27 in FIG. 10) is taken, and these are left as a total of five remaining points including the search center and four points in the vicinity of the search center. It is used as the difference evaluation values A to E "(step S78b).

したがって、この改良されたNNS関数処理によれば、推定動きベクトル演算処理の中間値を、MB探索処理(図12)やSB探索処理(図13)の反復の初期値として再利用するので、それらのMB探索処理やSB探索処理の反復数を少なくして、処理時間を短縮できる。この処理時間の短縮効果は、たとえ、推定動きベクトル演算処理の反復数が最小(第一反復だけ)であったとしても絶大である。   Therefore, according to the improved NNS function process, the intermediate value of the estimated motion vector calculation process is reused as the initial value of the iteration of the MB search process (FIG. 12) and the SB search process (FIG. 13). The processing time can be shortened by reducing the number of iterations of the MB search process and SB search process. The effect of shortening the processing time is enormous even if the number of iterations of the estimated motion vector calculation process is minimum (only the first iteration).

MB探索処理やSB探索処理は、ブロックの数だけ実行する必要があり、且つ、一つのビデオストリームあたり「ブロック数×フレーム数」の膨大な量の探索処理が行われるからであり、それゆえ、たとえ、推定動きベクトル演算処理の反復数が最小(第一反復だけ)であったとしても、トータルで見た場合、「ブロック数×フレーム数」に相当する大量の反復処理を省略できるからである。   This is because MB search processing and SB search processing need to be executed by the number of blocks, and a huge amount of search processing of “number of blocks × number of frames” is performed per video stream. Even if the number of iterations of the estimated motion vector calculation process is the smallest (only the first iteration), a large amount of iterations corresponding to “number of blocks × number of frames” can be omitted when viewed in total. .

<実施形態のまとめ>
このように、本実施形態によれば、最近傍探索法の第1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)に相当する演算だけを行って得られた各サブブロック(SB0 〜SB3 )の各々の推定動きベクトル(fv0 〜fv3 )に基づいてマクロブロック(MB)内の動きが一様に近いか否かを早い段階で判断し、その判断結果に従って探索ブロックの分割方法(大きい分割モードにするか、小さい分割モードにするか)を決定するので、従来技術に比べて、その決定に要する時間を短くすることができ、しかも、次に述べる理由より、計算量をほぼ半減することもできる。
<Summary of Embodiment>
As described above, according to the present embodiment, only the operation corresponding to the first iteration of the nearest neighbor search method (predetermined number of iterations or a smaller number of iterations equal to or less than the predetermined number of first iterations) is obtained. Based on the estimated motion vectors (fv 0 to fv 3 ) of the sub-blocks (SB 0 to SB 3 ), it is determined at an early stage whether or not the motion in the macroblock (MB) is nearly uniform. Since the search block division method (large division mode or small division mode) is determined according to the determination result, the time required for the determination can be shortened compared to the prior art, For the following reasons, the amount of calculation can be almost halved.

計算量をほぼ半減できる理由は、次のとおりである。従来技術では一つのマクロブロック(16×16ブロック)と、そのマクロブロックを分割した4つのサブブロック(8×8ブロック)のそれぞれで動き補償予測を行ってから探索ブロックの分割方法を決めていたため、一つのマクロブロックの計算量をAとすると、4つのサブブロックの計算量もほぼA相当となり、結局、トータルの計算量が略2倍(≒2A)になっていた。   The reason why the amount of calculation can be almost halved is as follows. In the prior art, the search block division method is determined after performing motion compensation prediction for each macro block (16 × 16 block) and four sub-blocks (8 × 8 block) obtained by dividing the macro block. When the calculation amount of one macroblock is A, the calculation amount of the four sub-blocks is substantially equivalent to A, and the total calculation amount is almost doubled (≈2A).

これに対して、本実施形態では、MB探索(図4のMB探索部23/図9のステップS13のMB探索処理)とSB探索(図4のSB探索部25/図9のステップS15のSB探索処理)のいずれか一方しか行わないため、それらの計算量をAとすると、トータルの計算量は、このAに、図4の推定動きベクトル演算部21(又は図9のステップS10の推定動きベクトル演算処理)の計算量αを加えた程度(A+α)で済む。しかも、推定動きベクトル演算部21(又は図9のステップS10の推定動きベクトル演算処理)の計算量αは、最近傍探索法などの高速探索アルゴリズムの1反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)分に相当(したがって、A>>α)するから、結局、本実施形態のトータルの計算量(A+α)を、従来技術のそれ(≒2A)に比べてほぼ半減することができるのである。   In contrast, in the present embodiment, MB search (MB search unit 23 in FIG. 4 / MB search process in step S13 in FIG. 9) and SB search (SB search unit 25 in FIG. 4 / SB in step S15 in FIG. 9). 4) Since the calculation amount is A, the total calculation amount is calculated by adding the estimated motion vector calculation unit 21 in FIG. 4 (or the estimated motion in step S10 in FIG. 9). It is only necessary to add (A + α) to the amount of calculation α in the vector calculation process. Moreover, the calculation amount α of the estimated motion vector calculation unit 21 (or the estimated motion vector calculation process in step S10 of FIG. 9) is one iteration (a predetermined number of iterations or a predetermined number) of a fast search algorithm such as the nearest neighbor search method. Therefore, the total calculation amount (A + α) of the present embodiment is changed to that of the prior art (≈2A). In comparison, it can be almost halved.

また、上記の改良されたNNS関数処理(図15)を用いると、推定動きベクトル演算処理(図10及び図11)の途中で得られる中間値(ステップS23〜ステップS27で得られるA〜E)、つまり、探索アルゴリズムの予め定められた反復数又は予め定められた第1の反復数以下の少ない反復(n′)で演算された複数の第二ブロックの各々の動きベクトルを、MB探索処理(図12)やSB探索処理(図13)の反復の初期値として再利用できる。これにより、MB探索処理やSB探索処理の反復数を少なく(−n′)して、処理時間を短縮できる。   Further, when the above-described improved NNS function processing (FIG. 15) is used, intermediate values (A to E obtained in steps S23 to S27) obtained in the middle of the estimated motion vector calculation processing (FIGS. 10 and 11). That is, the motion vector of each of the plurality of second blocks calculated by a predetermined number of iterations of the search algorithm or a small number of iterations (n ′) equal to or less than the predetermined number of first iterations is subjected to MB search processing ( It can be reused as an initial value for iteration of FIG. 12) or SB search processing (FIG. 13). As a result, the number of iterations of MB search processing and SB search processing can be reduced (-n '), and the processing time can be shortened.

本発明は上記の実施形態に限定されない。その技術思想の範囲内において、様々な変形例を含むことはもちろんであり、たとえば、以下のようにしてもよい。
(1)サブブロックのサイズ、個数、形状は任意である。また、分割方法に階層関係があれば同様に適用できる。例えば、H.264では「16×16」を分割した「8×8」をさらに「4×8」、「8×4」、「4×4」に分割することができ、階層構造が二重になっているが、このいずれかの階層間で、または両方の階層間で行うことができる。
(2)残差評価値はSADの代わりにSSD(sum of squared difference:差分二乗和)等であってもよい。サブブロック評価値の集まりからブロック評価値を計算可能であれば、全く同様に適用できる。また、動きベクトルの符号割り当てコストを評価値に加えてもよい。
(3)推定動きベクトル(fv0 〜fv3 )を求めるための反復(予め定められた反復数又は予め定められた第1の反復数以下の少ない反復)は1回だけとしたが、2回ないしはそれ以上の反復を行ってもよい。少なくとも最大反復数(予め定められた反復数又は予め定められた第1の反復数)以下であればよい。反復回数を増やすほど、推定の確実さが高まる。
(4)推定動きベクトル(fv0 〜fv3 )の等価判別は、完全等価のみならず、各成分の差分絶対値が所定値以内などの近似等価によって行ってもよい。
(5)動き推定のための探索アルゴリズムは、最近傍探索法だけでなく、たとえば、Nステップ探索法や対数探索法など他のアルゴリズムを用いてもよい。
The present invention is not limited to the above embodiment. Of course, various modifications are included within the scope of the technical idea, and for example, the following may be adopted.
(1) The size, number and shape of the sub-block are arbitrary. Also, if the division method has a hierarchical relationship, it can be similarly applied. For example, H.M. In H.264, “8 × 8” obtained by dividing “16 × 16” can be further divided into “4 × 8”, “8 × 4”, and “4 × 4”, and the hierarchical structure is doubled. Can be done between any of these hierarchies or between both hierarchies.
(2) The residual evaluation value may be SSD (sum of squared difference) or the like instead of SAD. If block evaluation values can be calculated from a collection of sub-block evaluation values, the same applies. Also, the code allocation cost of the motion vector may be added to the evaluation value.
(3) Although the number of iterations for obtaining the estimated motion vector (fv 0 to fv 3 ) (a predetermined number of iterations or a smaller number of iterations equal to or less than the predetermined number of first iterations) is set to one time, two times One or more iterations may be performed. It may be at least equal to or less than the maximum number of repetitions (a predetermined number of repetitions or a predetermined first number of repetitions). The greater the number of iterations, the greater the certainty of the estimation.
(4) The equivalence determination of the estimated motion vectors (fv 0 to fv 3 ) may be performed not only by complete equivalence but also by approximate equivalence such that the difference absolute value of each component is within a predetermined value.
(5) As a search algorithm for motion estimation, not only the nearest neighbor search method but also other algorithms such as an N-step search method and a logarithmic search method may be used.

動き補償予測ブロックの種類を示す図である。It is a figure which shows the kind of motion compensation prediction block. 本実施形態の便宜的な選択対象となる二つの動き補償予測ブロックを示す図である。It is a figure which shows the two motion compensation prediction blocks used as the selection object for convenience of this embodiment. 動き補償予測符号化装置のブロック図である。It is a block diagram of a motion compensation predictive coding apparatus. 動き推定部19の概念的なブロック図である。3 is a conceptual block diagram of a motion estimation unit 19. FIG. 動き推定部19の動作を説明するための概念図(1/2)である。It is a conceptual diagram (1/2) for demonstrating operation | movement of the motion estimation part 19. FIG. 動き推定部19の動作を説明するための概念図(2/2)である。6 is a conceptual diagram (2/2) for explaining the operation of the motion estimation unit 19; FIG. 図元画像のブロック位置(座標)とブロックサイズを説明するである。This is a description of the block position (coordinates) and block size of the original image. 参照画像に与えるオフセットを示す図である。It is a figure which shows the offset given to a reference image. 動き推定部19の動作フローチャートを示す図である。It is a figure which shows the operation | movement flowchart of the motion estimation part 19. FIG. 推定動きベクトル演算処理の動作フローチャートを示す図(1/2)である。It is a figure (1/2) which shows the operation | movement flowchart of an estimated motion vector calculation process. 推定動きベクトル演算処理の動作フローチャートを示す図(2/2)である。It is a figure (2/2) which shows the operation | movement flowchart of an estimated motion vector calculation process. MB探索処理の動作フローチャートを示す図である。It is a figure which shows the operation | movement flowchart of MB search process. SB探索処理の動作フローチャートを示す図である。It is a figure which shows the operation | movement flowchart of SB search processing. NNS関数処理のフローチャートを示す図である。It is a figure which shows the flowchart of a NNS function process. 改良されたNNS関数処理のフローチャートを示す図である。It is a figure which shows the flowchart of the improved NNS function process. 動き補償予測符号化の簡略化した概念図である。It is the conceptual diagram which simplified the motion compensation prediction encoding. 動き補償予測符号化における被符号化画像生成の概念図である。It is a conceptual diagram of the encoding image production | generation in motion compensation prediction encoding.

符号の説明Explanation of symbols

S10 推定動きベクトル演算処理(第一動きベクトル演算工程)
S11 第一判定処理(第一判定工程)
S13 MB探索処理(第二動きベクトル演算工程)
S14 MB動きベクトル出力(選択工程、第一選択工程)
S15 SB探索処理(第三動きベクトル演算工程)
S16 第二判定処理(第二判定工程)
S18 MB動きベクトル出力(選択工程、第二選択工程)
S19 SB動きベクトル出力(選択工程、第二選択工程)
10 動き補償予測符号化装置
19 動き推定部(ブロック選択手段)
21 推定動きベクトル演算部(第一動きベクトル演算手段)
22 第一判定部(第一判定手段)
23 MB探索部(第二動きベクトル演算手段)
24 第一MB動きベクトル出力部(第一選択手段)
25 SB探索部(第三動きベクトル演算手段)
26 第二判定部(第二判定手段)
27 第二MB動きベクトル出力部(第二選択手段)
28 SB動きベクトル出力部(第二選択手段)
S10 Estimated motion vector calculation process (first motion vector calculation step)
S11 First determination process (first determination step)
S13 MB search process (second motion vector calculation step)
S14 MB motion vector output (selection process, first selection process)
S15 SB search process (third motion vector calculation step)
S16 Second determination process (second determination step)
S18 MB motion vector output (selection process, second selection process)
S19 SB motion vector output (selection step, second selection step)
DESCRIPTION OF SYMBOLS 10 Motion compensation prediction encoding apparatus 19 Motion estimation part (block selection means)
21 Estimated motion vector calculation unit (first motion vector calculation means)
22 1st determination part (1st determination means)
23 MB search unit (second motion vector calculation means)
24 First MB motion vector output unit (first selection means)
25 SB search unit (third motion vector calculation means)
26 Second determination unit (second determination means)
27 Second MB motion vector output unit (second selection means)
28 SB motion vector output unit (second selection means)

Claims (8)

第一ブロックと該第一ブロックを複数に分割した第二ブロックのいずれか一方を動き補償予測ブロックとして選択するブロック選択手段を備えた動き補償予測符号化装置において、
前記ブロック選択手段は、
前記複数の第二ブロックの各々の動きベクトルを予め定められた反復数以下の少ない反復で所定の探索アルゴリズムにより演算する第一動きベクトル演算手段と、
前記第一動きベクトル演算手段で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第一判定手段とを含み、
前記第一判定手段の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する一方、前記第一判定手段の判定結果が否定の場合に前記第二ブロックを動き補償予測ブロックとして選択することを特徴とする動き補償予測符号化装置。
In the motion compensated prediction encoding apparatus including block selection means for selecting either the first block or the second block obtained by dividing the first block into a plurality of motion compensation prediction blocks,
The block selection means includes
First motion vector computing means for computing a motion vector of each of the plurality of second blocks by a predetermined search algorithm with a small number of iterations equal to or less than a predetermined number of iterations;
First determination means for determining whether or not each motion vector of the second block calculated by the first motion vector calculation means is completely equivalent or approximate equivalent,
When the determination result of the first determination means is affirmative, the first block is selected as a motion compensated prediction block, while when the determination result of the first determination means is negative, the second block is selected as a motion compensated prediction block. A motion-compensated predictive coding apparatus, characterized by:
第一ブロックと該第一ブロックを複数に分割した第二ブロックのいずれか一方を動き補償予測ブロックとして選択するブロック選択手段を備えた動き補償予測符号化装置において、
前記ブロック選択手段は、
前記複数の第二ブロックの各々の動きベクトルを予め定められた第1の反復数以下の少ない反復で所定の探索アルゴリズムにより演算する第一動きベクトル演算手段と、
前記第一動きベクトル演算手段で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第一判定手段と、
前記第一判定手段の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する第一選択手段と、
前記第一判定手段の判定結果が肯定の場合に前記第一ブロックの動きベクトルを予め定められた第2の反復数を上限にして所定の探索アルゴリズムにより演算する第二動きベクトル演算手段と、
前記第一判定手段の判定結果が否定の場合に前記複数の第二ブロックの各々の動きベクトルを予め定められた第3の反復数を上限にして所定の探索アルゴリズムにより演算する第三動きベクトル演算手段と、
前記第三動きベクトル演算手段で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第二判定手段と、
前記第二判定手段の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する一方、前記第二判定手段の判定結果が否定の場合に前記第二ブロックを動き補償予測ブロックとして選択する第二選択手段と
を備えたことを特徴とする動き補償予測符号化装置。
In the motion compensated prediction encoding apparatus including block selection means for selecting either the first block or the second block obtained by dividing the first block into a plurality of motion compensation prediction blocks,
The block selection means includes
First motion vector computing means for computing a motion vector of each of the plurality of second blocks by a predetermined search algorithm with a small number of iterations equal to or less than a predetermined first number of iterations;
First determination means for determining whether or not each motion vector of the second block calculated by the first motion vector calculation means is completely equivalent or approximate equivalent;
First selection means for selecting the first block as a motion compensated prediction block when the determination result of the first determination means is affirmative;
Second motion vector computing means for computing a motion vector of the first block by a predetermined search algorithm with an upper limit of a predetermined second iteration number when the judgment result of the first judging means is affirmative;
A third motion vector calculation for calculating a motion vector of each of the plurality of second blocks with a predetermined third iteration number as an upper limit when the determination result of the first determination means is negative Means,
Second determination means for determining whether or not each motion vector of the second block calculated by the third motion vector calculation means is completely equivalent or approximate equivalent;
When the determination result of the second determination means is affirmative, the first block is selected as a motion compensated prediction block, while when the determination result of the second determination means is negative, the second block is selected as a motion compensated prediction block. A motion-compensated predictive coding apparatus comprising: a second selecting means for selecting.
前記所定の探索アルゴリズムは、最近傍探索法又はNステップ探索法若しくは対数探索法であることを特徴とする請求項1又は請求項2記載の動き補償予測符号化装置。 3. The motion compensated predictive coding apparatus according to claim 1, wherein the predetermined search algorithm is a nearest neighbor search method, an N-step search method, or a logarithmic search method. 前記第二動きベクトル演算手段及び前記第三動きベクトル演算手段は、前記第一動きベクトル演算手段の反復がn′回のとき、n′+1回から反復を開始するとともに、その反復の初期値として、前記第一動きベクトル演算手段のn′反復で得られた中間値を使用することを特徴とする請求項2記載の動き補償予測符号化装置。 The second motion vector computing means and the third motion vector computing means start the iteration from n ′ + 1 times when the first motion vector computing means is repeated n ′ times, and as initial values of the iterations The motion compensated predictive coding apparatus according to claim 2, wherein an intermediate value obtained by n 'iteration of the first motion vector computing means is used. 第一ブロックと該第一ブロックを複数に分割した第二ブロックのいずれか一方を動き補償予測ブロックとして選択する際に、
前記複数の第二ブロックの各々の動きベクトルを予め定められた反復数以下の少ない反復で所定の探索アルゴリズムにより演算する第一動きベクトル演算工程と、
前記第一動きベクトル演算工程で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第一判定工程と、
前記第一判定工程の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する一方、前記第一判定工程の判定結果が否定の場合に前記第二ブロックを動き補償予測ブロックとして選択する選択工程と
を実行することを特徴とする動き補償予測符号化方法。
When selecting one of the first block and the second block obtained by dividing the first block into a plurality of motion compensation prediction blocks,
A first motion vector calculation step of calculating a motion vector of each of the plurality of second blocks by a predetermined search algorithm with a small number of iterations equal to or less than a predetermined number of iterations;
A first determination step of determining whether or not each motion vector of the second block calculated in the first motion vector calculation step is completely equivalent or approximate equivalent;
When the determination result of the first determination step is positive, the first block is selected as a motion compensated prediction block, while when the determination result of the first determination step is negative, the second block is selected as a motion compensated prediction block. And a selection step of selecting. A motion compensated predictive encoding method, comprising:
第一ブロックと該第一ブロックを複数に分割した第二ブロックのいずれか一方を動き補償予測ブロックとして選択する際に、
前記複数の第二ブロックの各々の動きベクトルを予め定められた第1の反復数以下の少ない反復で所定の探索アルゴリズムにより演算する第一動きベクトル演算工程と、
前記第一動きベクトル演算工程で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第一判定工程と、
前記第一判定工程の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する第一選択工程と、
前記第一判定工程の判定結果が肯定の場合に前記第一ブロックの動きベクトルを予め定められた第2の反復数を上限にして所定の探索アルゴリズムにより演算する第二動きベクトル演算工程と、
前記第一判定工程の判定結果が否定の場合に前記複数の第二ブロックの各々の動きベクトルを予め定められた第3の反復数を上限にして所定の探索アルゴリズムにより演算する第三動きベクトル演算工程と、
前記第三動きベクトル演算工程で演算された第二ブロックの各々の動きベクトルが完全等価又は近似等価であるか否かを判定する第二判定工程と、
前記第二判定工程の判定結果が肯定の場合に前記第一ブロックを動き補償予測ブロックとして選択する一方、前記第二判定工程の判定結果が否定の場合に前記第二ブロックを動き補償予測ブロックとして選択する第二選択工程と
を実行することを特徴とする動き補償予測符号化方法。
When selecting one of the first block and the second block obtained by dividing the first block into a plurality of motion compensation prediction blocks,
A first motion vector calculation step of calculating a motion vector of each of the plurality of second blocks by a predetermined search algorithm with a small number of iterations equal to or less than a predetermined first iteration number;
A first determination step of determining whether or not each motion vector of the second block calculated in the first motion vector calculation step is completely equivalent or approximate equivalent;
A first selection step of selecting the first block as a motion compensated prediction block when the determination result of the first determination step is positive;
A second motion vector calculation step of calculating a motion vector of the first block by a predetermined search algorithm with an upper limit of a predetermined second iteration number when the determination result of the first determination step is affirmative;
A third motion vector calculation for calculating a motion vector of each of the plurality of second blocks by a predetermined search algorithm up to a predetermined third number of iterations when the determination result of the first determination step is negative Process,
A second determination step of determining whether or not each motion vector of the second block calculated in the third motion vector calculation step is completely equivalent or approximate equivalent;
When the determination result of the second determination step is positive, the first block is selected as a motion compensated prediction block, while when the determination result of the second determination step is negative, the second block is selected as a motion compensated prediction block. A motion-compensated predictive encoding method comprising: performing a second selection step.
前記所定の探索アルゴリズムは、最近傍探索法又はNステップ探索法若しくは対数探索法であることを特徴とする請求項5又は請求項6記載の動き補償予測符号化方法。 7. The motion compensated predictive coding method according to claim 5, wherein the predetermined search algorithm is a nearest neighbor search method, an N-step search method or a logarithmic search method. 前記第二動きベクトル演算工程及び前記第三動きベクトル演算工程は、前記第一動きベクトル演算工程の反復がn′回のとき、n′+1回から反復を開始するとともに、その反復の初期値として、前記第一動きベクトル演算工程のn′反復で得られた中間値を使用することを特徴とする請求項6記載の動き補償予測符号化方法。
In the second motion vector calculation step and the third motion vector calculation step, when the first motion vector calculation step is repeated n 'times, the iteration starts from n' + 1 times and is used as an initial value of the iteration. The motion compensated predictive encoding method according to claim 6, wherein an intermediate value obtained by n 'iteration of the first motion vector calculation step is used.
JP2004368854A 2004-12-21 2004-12-21 Motion compensated predictive coding apparatus, motion compensated predictive coding method, and program Active JP4438949B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004368854A JP4438949B2 (en) 2004-12-21 2004-12-21 Motion compensated predictive coding apparatus, motion compensated predictive coding method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004368854A JP4438949B2 (en) 2004-12-21 2004-12-21 Motion compensated predictive coding apparatus, motion compensated predictive coding method, and program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2009264503A Division JP4957780B2 (en) 2009-11-20 2009-11-20 Motion compensated predictive coding apparatus, motion compensated predictive coding method, and program

Publications (3)

Publication Number Publication Date
JP2006180014A true JP2006180014A (en) 2006-07-06
JP2006180014A5 JP2006180014A5 (en) 2007-11-29
JP4438949B2 JP4438949B2 (en) 2010-03-24

Family

ID=36733722

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004368854A Active JP4438949B2 (en) 2004-12-21 2004-12-21 Motion compensated predictive coding apparatus, motion compensated predictive coding method, and program

Country Status (1)

Country Link
JP (1) JP4438949B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010515305A (en) * 2006-12-22 2010-05-06 クゥアルコム・インコーポレイテッド Choosing a coding mode using information from other coding modes
EP2736254A1 (en) * 2011-07-22 2014-05-28 Hitachi, Ltd. Video decoding method and image encoding method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010515305A (en) * 2006-12-22 2010-05-06 クゥアルコム・インコーポレイテッド Choosing a coding mode using information from other coding modes
EP2736254A1 (en) * 2011-07-22 2014-05-28 Hitachi, Ltd. Video decoding method and image encoding method
EP2736254A4 (en) * 2011-07-22 2015-04-15 Hitachi Ltd Video decoding method and image encoding method
CN103703780B (en) * 2011-07-22 2016-12-07 株式会社日立制作所 Dynamic image decoding method and method for encoding images

Also Published As

Publication number Publication date
JP4438949B2 (en) 2010-03-24

Similar Documents

Publication Publication Date Title
JP5373626B2 (en) Method, apparatus, encoder, decoder, and decoding method for estimating a motion vector using a plurality of motion vector predictors
CN101283600B (en) Reference image selection method and device
KR102085498B1 (en) Method and device for encoding a sequence of images and method and device for decoding a sequence of images
US20110261886A1 (en) Image prediction encoding device, image prediction encoding method, image prediction encoding program, image prediction decoding device, image prediction decoding method, and image prediction decoding program
KR100510137B1 (en) Method of determining reference picture and block mode, the apparatus therefor, method of determining block mode, and the apparatus therefor for fast motion estimation
CN101326550A (en) Motion estimation using prediction guided decimated search
JP4523023B2 (en) Image coding apparatus and method
JP2011114572A (en) Image encoding apparatus, image decoding apparatus, image encoding method, and image decoding method
JP2007189276A (en) Image compression apparatus and image compression program
CN101888546A (en) Motion estimation method and device
JP4957780B2 (en) Motion compensated predictive coding apparatus, motion compensated predictive coding method, and program
CN108924551B (en) Method for predicting video image coding mode and related equipment
CN114079792A (en) Compression method, coding method and device for video coding reference block
JP4257789B2 (en) Video encoding device
US20020168008A1 (en) Method and apparatus for coding moving pictures
JP4438949B2 (en) Motion compensated predictive coding apparatus, motion compensated predictive coding method, and program
WO2019150411A1 (en) Video encoding device, video encoding method, video decoding device, and video decoding method, and video encoding system
JP4547668B2 (en) Motion compensated predictive coding apparatus and motion compensated predictive coding method
US20130195190A1 (en) Method for deciding motion partition mode and encoder
CN113794883B (en) Encoding and decoding method, device and equipment
CN110662074B (en) Motion vector determination method and device
JP2012120108A (en) Interpolation image generating apparatus and program, and moving image decoding device and program
US20240064336A1 (en) Image decoding apparatus and image encoding apparatus using ai, and methods performed thereby
JPH10164596A (en) Motion detector
JP2005354174A (en) Motion-searching apparatus

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071011

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071011

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090917

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090924

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091120

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

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

Free format text: PAYMENT UNTIL: 20130115

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4438949

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091229

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

Free format text: PAYMENT UNTIL: 20130115

Year of fee payment: 3