JP2010016780A - Motion vector detection apparatus and motion vector detection method - Google Patents

Motion vector detection apparatus and motion vector detection method Download PDF

Info

Publication number
JP2010016780A
JP2010016780A JP2008177405A JP2008177405A JP2010016780A JP 2010016780 A JP2010016780 A JP 2010016780A JP 2008177405 A JP2008177405 A JP 2008177405A JP 2008177405 A JP2008177405 A JP 2008177405A JP 2010016780 A JP2010016780 A JP 2010016780A
Authority
JP
Japan
Prior art keywords
motion vector
vector detection
stage
unit
block
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.)
Withdrawn
Application number
JP2008177405A
Other languages
Japanese (ja)
Inventor
Tsutomu Ando
勉 安藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2008177405A priority Critical patent/JP2010016780A/en
Publication of JP2010016780A publication Critical patent/JP2010016780A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To suppress hardware scale when performing motion vector detection in accordance with a step search method, by applying an MBAFF (macro block adaptive field/frame) to encoding. <P>SOLUTION: A global search that is a first step of a step search method, is performed only for a predetermined macro block pair structure in a frame structure or a field structure. On the basis of a result, it is determined which one of the macro block pair structure of the frame structure or the field structure is to be used for performing a motion vector search of succeeding steps for a macro block to be encoded. One motion vector search section is enough for performing the global search and scale of a motion vector detection section is reduced. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

この発明は、動画像データの1画面を所定に分割したブロック単位で動きベクトルを検出する動きベクトル検出装置および動きベクトル検出方法に関する。   The present invention relates to a motion vector detection apparatus and a motion vector detection method for detecting a motion vector in units of blocks obtained by dividing one screen of moving image data.

動画像データの圧縮符号化方式として、従来から、MPEG1方式、MPEG2方式やMPEG4方式が広く用いられている。このような圧縮符号化方式では、1フレームまたは1フィールドをマクロブロックと呼ばれる所定画素数の領域に分割し、このマクロブロックを単位にして、動き補償を用いた予測符号化や直交変換処理、量子化処理、可変長符号化を施す。   Conventionally, MPEG1 system, MPEG2 system, and MPEG4 system are widely used as compression encoding systems for moving image data. In such a compression coding method, one frame or one field is divided into regions of a predetermined number of pixels called macroblocks, and prediction coding or orthogonal transform processing using motion compensation, quantum processing is performed in units of the macroblocks. Processing and variable length coding.

また、近年では、より高い符号化効率を実現するH.264/MPEG−4 AVC(以下、H.264と略称する)方式が制定され、その実用化が急速に進んでいる。H.264では、上述の従来の方式に対し、直交変換処理をアダマール変換および整数精度DCTを用いて行うことにより誤差の蓄積を抑制する。それと共に、フレーム内予測符号化および動き補償を用いたフレーム間予測符号化とを行い、より精度の高い予測符号化を実現している。   In recent years, H.264 has been realized to achieve higher encoding efficiency. The H.264 / MPEG-4 AVC (hereinafter abbreviated as H.264) system has been established and its practical application is rapidly progressing. H. H.264 suppresses error accumulation by performing orthogonal transform processing using Hadamard transform and integer precision DCT, as compared to the above-described conventional method. At the same time, intra-frame predictive coding and inter-frame predictive coding using motion compensation are performed to realize more accurate predictive coding.

さらに、H.264では、インタレース信号を扱う場合に、マクロブロックレベルで適応的にフレーム構造およびフィールド構造を切り替える機能が、符号化のオプション機能として盛り込まれている。この機能を、MBAFF(Macro Block Adaptive Field/Frame)と呼ぶ。MBAFFを用いて符号化を行うMBAFFモードでは、垂直方向に隣接する2個のマクロブロックからなるマクロブロックペア単位で、フレームまたはフィールドの符号化を行う。   Further, H.C. In H.264, when an interlace signal is handled, a function of adaptively switching the frame structure and the field structure at the macroblock level is incorporated as an optional function of encoding. This function is called MBAFF (Macro Block Adaptive Field / Frame). In the MBAFF mode in which encoding is performed using MBAFF, a frame or a field is encoded in units of a macroblock pair including two macroblocks adjacent in the vertical direction.

図7は、マクロブロックペアの構造を概略的に示す。マクロブロックペア901がフレーム構造を持つマクロブロックペアを示す。また、マクロブロックペア902がフィールド構造を持つマクロブロックペアを示す。1つのマクロブロックは、16画素×16ラインからなり、マクロブロックペアは、16画素×32ラインのサイズを有する。   FIG. 7 schematically shows the structure of a macroblock pair. The macroblock pair 901 indicates a macroblock pair having a frame structure. The macroblock pair 902 indicates a macroblock pair having a field structure. One macroblock consists of 16 pixels × 16 lines, and a macroblock pair has a size of 16 pixels × 32 lines.

フィールド構造のマクロブロックペア902は、フレーム構造のマクロブロックペア901の奇数ラインを上側のマクロブロックに纏め、偶数ラインを下側のマクロブロックに纏めた構造となっている。換言すれば、フィールド構造のマクロブロックペア902の上側のマクロブロックは、トップフィールドの画像データから構成され、下側のマクロブロックは、ボトムフィールドの画像データから構成される。   The field-structure macroblock pair 902 has a structure in which the odd-numbered lines of the frame-structured macroblock pair 901 are collected in the upper macroblock and the even-numbered lines are collected in the lower macroblock. In other words, the upper macroblock of the field-structured macroblock pair 902 is composed of top field image data, and the lower macroblock is composed of bottom field image data.

マクロブロックペアに対する符号化は、マクロブロックペアを構成する上下のマクロブロックそれぞれに対して行われる。したがって、フィールド構造のマクロブロックペア902については、トップフィールドおよびボトムフィールドそれぞれに対して、マクロブロック単位で符号化を行うことができる。   Coding for the macroblock pair is performed for each of the upper and lower macroblocks constituting the macroblock pair. Therefore, the macroblock pair 902 having a field structure can be encoded on a macroblock basis for each of the top field and the bottom field.

周知のように、フィールドは、フレーム画像を奇数ラインと偶数ラインとに分けた画像であって、奇数ラインによるフィールドと偶数ラインによるフィールドとをフレーム間隔の1/2の時間間隔で交互に表示することで、1枚のフレーム画像を表現している。1枚のフレーム画像を構成する2枚のフィールド画像の間には、無視できない時間差がある。そのため、動きのある部分と無い部分とが混在する映像に対しては、マクロブロックペアの構造をフレーム構造およびフィールド構造とで適応的に切り替えて符号化すると、画面全体で構造を固定した場合に比べ、符号化効率が向上することが知られている。   As is well known, a field is an image obtained by dividing a frame image into odd lines and even lines, and a field by odd lines and a field by even lines are alternately displayed at a time interval ½ of the frame interval. Thus, one frame image is expressed. There is a non-negligible time difference between two field images constituting one frame image. Therefore, for a video with both moving parts and non-moving parts, if the structure of the macroblock pair is adaptively switched between the frame structure and the field structure and encoded, the structure is fixed throughout the screen. In comparison, it is known that the encoding efficiency is improved.

図8は、動きのある部分と無い部分とが混在した映像の例を示す。図8において、人物の部分が動きのある部分であって、風景の部分が動きの無い部分であるものとする。マクロブロックペアの構造として、動きのある部分に対してはフィールド構造が適しており、動きの無い部分に対してはフレーム構造が適している。符号化の際には、画面をマクロブロックに分割し、上下2個のマクロブロックのペア毎に映像を解析して、当該マクロブロックペアの構造をフレーム構造およびフィールド構造の何れにするかを、マクロブロックペア毎に適応的に判断する。   FIG. 8 shows an example of a video in which a portion with motion and a portion without motion are mixed. In FIG. 8, it is assumed that the person portion is a moving portion and the landscape portion is a non-moving portion. As a structure of the macroblock pair, a field structure is suitable for a portion with motion, and a frame structure is suitable for a portion without motion. At the time of encoding, the screen is divided into macro blocks, the video is analyzed for each pair of upper and lower two macro blocks, and whether the structure of the macro block pair is a frame structure or a field structure, Judgment is made adaptively for each macroblock pair.

図9は、MBAFFにより、1画面にフレーム構造のマクロブロックペア901とフィールド構造のマクロブロックペア902とを混在させた例を示す。フレーム構造のマクロブロックペア901と、フィールド構造のマクロブロックペア902とが任意の順序で配列していることが分かる。   FIG. 9 shows an example in which a macro block pair 901 having a frame structure and a macro block pair 902 having a field structure are mixed on one screen by MBAFF. It can be seen that the macroblock pairs 901 having the frame structure and the macroblock pairs 902 having the field structure are arranged in an arbitrary order.

なお、H.264の規格では、上述のようなマクロブロックペア構造を取ることが可能なシンタクスが規定されているに過ぎない。つまり、符号化過程においてどのような方法を用いてフィールド構造およびフレーム構造をマクロブロックペア単位で変更するかは、符号化装置の実装方法に委ねられている。   H. The H.264 standard only defines a syntax that can take the macroblock pair structure as described above. That is, what method is used to change the field structure and the frame structure in units of macroblock pairs in the encoding process is left to the mounting method of the encoding device.

ところで、上述のMPEG2やMPEG4、H.264といった、動き補償を用いた予測符号化を行う符号化装置をハードウェア規模で見た場合、動きベクトル検出機能の全体に占める割合が支配的であることが知られている。そのため、動きベクトルの検出処理を簡略化するための動きベクトル検出アルゴリズムは、従来から様々に提案されている。   By the way, the above-mentioned MPEG2, MPEG4, H.264, etc. It is known that when a coding apparatus that performs predictive coding using motion compensation, such as H.264, is viewed on a hardware scale, the ratio of the motion vector detection function to the whole is dominant. For this reason, various motion vector detection algorithms for simplifying the motion vector detection processing have been proposed.

このようなアルゴリズムとして、近年では、ステップサーチ(階層的検索)法が最も広く用いられている。ステップサーチ法では、動きベクトルの探索を複数のステップに分けて行う。探索精度をステップ毎に段階的に高め、探索対象を順次絞り込んでいくことで、動きベクトル検出の負荷を軽減することができる。   In recent years, the step search (hierarchical search) method is most widely used as such an algorithm. In the step search method, the motion vector search is divided into a plurality of steps. The load of motion vector detection can be reduced by increasing the search accuracy step by step and narrowing down the search target sequentially.

図10は、ステップサーチ法を用いて動きベクトル探索を行う例を概略的に示す。図10の例では、以下の3ステップで動きベクトル探索を行っている。なお、H.264においては、1/4画素精度までの動きベクトルを用いることができる。
第1ステップ:大域サーチ
第2ステップ:1画素精度サーチ
第3ステップ:1/4画素精度サーチ
FIG. 10 schematically shows an example of performing a motion vector search using the step search method. In the example of FIG. 10, the motion vector search is performed in the following three steps. H. In H.264, motion vectors up to 1/4 pixel accuracy can be used.
1st step: Global search 2nd step: 1 pixel accuracy search 3rd step: 1/4 pixel accuracy search

第1ステップで画面内の大まかな動きベクトルを検出し、第2ステップで、第1ステップで検出された動きベクトルの周辺エリアで整数精度での動きベクトルを検出する。そして、第3ステップで、第2ステップで検出された動きベクトルの周辺エリアで1/4精度での動きベクトルを検出する。   In the first step, a rough motion vector in the screen is detected, and in the second step, a motion vector with integer precision is detected in the peripheral area of the motion vector detected in the first step. Then, in the third step, a motion vector with ¼ accuracy is detected in the peripheral area of the motion vector detected in the second step.

図10において、先ず第1ステップの大域サーチにより、動きベクトルを検出すべきマクロブロック701の動きベクトル702が検出される。次に、第2ステップの1画素精度サーチにより、大域サーチにより検出された動きベクトル702に基づき、探索範囲703内で動きベクトルが探索される。最後に、第3ステップの1/4画素精度サーチにより、1画素精度サーチにより検出された動きベクトル704に基づき探索を行う範囲が探索範囲705に絞り込まれ、この探索範囲705内で動きベクトルが探索される。1/4画素精度サーチによる探索で検出された動きベクトル706に基づき、最終的な動きベクトル707を得る。   In FIG. 10, the motion vector 702 of the macroblock 701 whose motion vector is to be detected is first detected by the global search in the first step. Next, a motion vector is searched in the search range 703 based on the motion vector 702 detected by the global search by the one-pixel accuracy search in the second step. Finally, a search range based on the motion vector 704 detected by the one-pixel accuracy search is narrowed down to the search range 705 by the 1/4 pixel accuracy search in the third step, and a motion vector is searched within the search range 705. Is done. A final motion vector 707 is obtained based on the motion vector 706 detected by the search by the 1/4 pixel accuracy search.

図11は、上述した3ステップのステップサーチを実現するための、従来技術による動きベクトル検出装置の一例の構成を示す。この図11に示される構成は、フレーム構造またはフィールド構造のみに対応した動きベクトル検出装置の例である。   FIG. 11 shows a configuration of an example of a motion vector detection device according to the prior art for realizing the above-described three-step step search. The configuration shown in FIG. 11 is an example of a motion vector detection apparatus that supports only a frame structure or a field structure.

図11において、フレームメモリまたはフィールドメモリであるメモリ601に、符号化対象となる1フレーム分または1フィールド分の画像データと、参照画像データとなる画像データとが格納される。メモリ601に格納される参照画像データは、入力画像データと予測画像データとの差分を直交変換および量子化し、さらに逆量子化および逆直交変換して予測画像データを加算することで再構築したものである。以下では、煩雑さを避けるために、メモリ601をフレームメモリとし、符号化対象となる画像データは、1フレーム分がメモリ601に格納されるものとする。   In FIG. 11, a frame memory or a field memory 601 stores image data for one frame or field to be encoded and image data to be reference image data. The reference image data stored in the memory 601 is reconstructed by orthogonally transforming and quantizing the difference between the input image data and the predicted image data, and further adding the predicted image data by performing inverse quantization and inverse orthogonal transform. It is. In the following, in order to avoid complexity, the memory 601 is assumed to be a frame memory, and one frame of image data to be encoded is stored in the memory 601.

第1ステージME部602、第2ステージME部603および第3ステージME部604は、それぞれ上述した大域サーチ、1画素精度サーチおよび1/4画素精度サーチを行う。なお、MEは、Motion Estimationの略である。先ず、第1ステージME部602がメモリ601から符号化対象となる画像データのマクロブロック701と、参照画像データとを読み出し、大域的に動きベクトルの探索を行う。その結果検出された動きベクトル702は、第2ステージME部603に供給される。   The first stage ME unit 602, the second stage ME unit 603, and the third stage ME unit 604 perform the global search, the one-pixel accuracy search, and the quarter-pixel accuracy search described above, respectively. Note that ME is an abbreviation for Motion Estimation. First, the first stage ME unit 602 reads the macroblock 701 of the image data to be encoded and the reference image data from the memory 601 and searches for a motion vector globally. The motion vector 702 detected as a result is supplied to the second stage ME unit 603.

第2ステージME部603は、第1ステージME部602から供給された動きベクトル702に基づき探索範囲703を設定し、メモリ601から、当該探索範囲703の符号化対象の画像データを読み出すと共に、参照画像データを読み出す。そして、読み出されたデータに基づき1画素精度サーチによる動きベクトルの探索を行う。その結果検出された動きベクトル704は、第3ステージME部604に供給される。   The second stage ME unit 603 sets a search range 703 based on the motion vector 702 supplied from the first stage ME unit 602, reads out the image data to be encoded in the search range 703 from the memory 601, and refers to it. Read image data. Based on the read data, a motion vector search is performed by a one-pixel accuracy search. The detected motion vector 704 is supplied to the third stage ME unit 604.

第3ステージME部604でも同様に、第2ステージME部603から供給された動きベクトル704に基づき探索範囲705を設定し、メモリ601から、当該探索範囲705の符号化対象の画像データを読み出すと共に、参照画像データを読み出す。そして、読み出されたデータに基づき、1/4画素精度サーチによる動きベクトル706の探索を行う。   Similarly, in the third stage ME unit 604, a search range 705 is set based on the motion vector 704 supplied from the second stage ME unit 603, and image data to be encoded in the search range 705 is read from the memory 601. The reference image data is read out. Based on the read data, the motion vector 706 is searched by a 1/4 pixel accuracy search.

第3ステージME部604は、動きベクトル探索の結果を示す動きベクトル検出結果を出力する。この動きベクトル検出結果は、マクロブロックタイプ判定部605に供給される。マクロブロックタイプ判定部605は、供給された動きベクトル検出結果に基づき動きベクトル707を出力する。また、マクロブロックタイプ判定部605は、この動きベクトル検出結果を評価し、符号化対象のマクロブロックがイントラ符号化およびインター符号化の何れに適しているかを判定し、判定結果をマクロブロックタイプとして出力する。   The third stage ME unit 604 outputs a motion vector detection result indicating the result of the motion vector search. This motion vector detection result is supplied to the macroblock type determination unit 605. The macroblock type determination unit 605 outputs a motion vector 707 based on the supplied motion vector detection result. Further, the macro block type determination unit 605 evaluates the motion vector detection result, determines whether the macro block to be encoded is suitable for intra coding or inter coding, and sets the determination result as the macro block type. Output.

特許文献1には、MBAFFモードで、コスト計算に基づいてマクロブロック単位の符号化モードを決定する技術が記載されている。
特開2006−80925号公報
Patent Document 1 describes a technique for determining an encoding mode in units of macroblocks based on cost calculation in the MBAFF mode.
JP 2006-80925 A

ここで、上述したMBAFFをステップサーチ法に適用した場合について考える。既に説明したように、MBAFFでは、マクロブロックペアを解析して、マクロブロックペアの構造をフレーム構造およびフィールド構造の何れにするかを決定する必要がある。この決定処理は、フレーム構造のマクロブロックペアとフィールド構造のマクロブロックペアのそれぞれで実際に動きベクトルを検出し、検出結果を評価することで行われる。   Here, consider the case where the above-described MBAFF is applied to the step search method. As already described, in MBAFF, it is necessary to analyze a macroblock pair and determine whether the structure of the macroblock pair is a frame structure or a field structure. This determination process is performed by actually detecting a motion vector in each of the macroblock pair having the frame structure and the macroblock pair having the field structure, and evaluating the detection result.

図12は、ステップサーチ法をMBAFFに適用した場合の、従来技術による動きベクトル検出装置の一例の構成を示す。動きベクトル検出装置は、図示されるように、フレーム構造のマクロブロックペアに対してステップサーチ法による動きベクトル検出を行うための第1ステージME部1105、第2ステージME部1106および第3ステージME部1107を持つ。さらに、この動きベクトル検出装置は、フィールド構造のマクロブロックペアに対してステップサーチ法による動きベクトル検出を行うための第1ステージME部1102、第2ステージME部1103および第3ステージME部1104を持つ。   FIG. 12 shows a configuration of an example of a motion vector detection apparatus according to the prior art when the step search method is applied to MBAFF. As shown in the figure, the motion vector detection apparatus includes a first stage ME unit 1105, a second stage ME unit 1106, and a third stage ME for performing motion vector detection by a step search method for a macroblock pair having a frame structure. Part 1107. Further, this motion vector detection apparatus includes a first stage ME unit 1102, a second stage ME unit 1103, and a third stage ME unit 1104 for performing motion vector detection by a step search method on a macroblock pair having a field structure. Have.

これら第1ステージME部1105、第2ステージME部1106および第3ステージME部1107は、図11を用いて説明した第1ステージME部602、第2ステージME部603および第3ステージME部604とそれぞれ同様の処理を行う。さらに、第1ステージME部1102、第2ステージME部1103および第3ステージME部1104も、上述の第1ステージME部602、第2ステージME部603および第3ステージME部604とそれぞれ同様の処理を行う。   The first stage ME unit 1105, the second stage ME unit 1106, and the third stage ME unit 1107 are the first stage ME unit 602, the second stage ME unit 603, and the third stage ME unit 604 described with reference to FIG. The same processing is performed respectively. Further, the first stage ME unit 1102, the second stage ME unit 1103, and the third stage ME unit 1104 are the same as the first stage ME unit 602, the second stage ME unit 603, and the third stage ME unit 604, respectively. Process.

より具体的には、第1ステージME部1102および第1ステージME部1105は、それぞれメモリ1101から同一のマクロブロックペアを読み出し、大域サーチによる動きベクトル検出を行う。以降、フィールド構造で処理を行う第2ステージME部1103および第3ステージME部1104は、既に説明したように、順次、前段の動きベクトル検出結果を受け取って、メモリ1101からデータを読み出して動きベクトル検出を行う。フレーム構造で処理を行う第2ステージME部1106および第3ステージME部1107でも同様に、順次、前段の動きベクトル検出結果を受け取って、メモリ1101から読み出したデータに対して動きベクトル検出を行う。   More specifically, the first stage ME unit 1102 and the first stage ME unit 1105 each read the same macroblock pair from the memory 1101 and perform motion vector detection by a global search. Thereafter, as described above, the second stage ME unit 1103 and the third stage ME unit 1104 that perform processing in the field structure sequentially receive the motion vector detection results of the previous stage, read out data from the memory 1101, and perform motion vectors. Perform detection. Similarly, second stage ME unit 1106 and third stage ME unit 1107 that perform processing in the frame structure sequentially receive the motion vector detection results of the previous stage and perform motion vector detection on the data read from memory 1101.

第3ステージME部1104の動きベクトル検出結果および第3ステージME部1107の動きベクトル検出結果は、それぞれモード判定部1108に供給される。モード判定部1108は、第3ステージME部1104および第3ステージME部1107から供給された動きベクトル検出結果を評価し、符号化対象のマクロブロックペアの構造をフレーム構造およびフィールド構造の何れにするかを決定する。また、この決定結果に従い、第3ステージME部1104および第3ステージME部1107から供給された動きベクトル検出結果に基づく動きベクトルを選択する。   The motion vector detection result of the third stage ME unit 1104 and the motion vector detection result of the third stage ME unit 1107 are supplied to the mode determination unit 1108, respectively. The mode determination unit 1108 evaluates the motion vector detection results supplied from the third stage ME unit 1104 and the third stage ME unit 1107, and changes the structure of the macroblock pair to be encoded to either the frame structure or the field structure. To decide. Further, according to the determination result, a motion vector based on the motion vector detection result supplied from the third stage ME unit 1104 and the third stage ME unit 1107 is selected.

このように、MBAFFをステップサーチ法に適用した場合には、図11で説明したフレーム構造またはフィールド構造の一方のみに対応した動きベクトル検出装置に比べ、動きベクトル検出部(ステージ)が各ステップで複数になっている。同一の機能を有する動きベクトル検出部をステップサーチ法によるステップ毎に、それぞれ独立して複数具備することは、ハードウェア規模を増大することになり、コストアップの要因になるという問題点があった。   As described above, when MBAFF is applied to the step search method, the motion vector detection unit (stage) is performed at each step as compared with the motion vector detection device corresponding to only one of the frame structure and the field structure described in FIG. There are multiple. Providing a plurality of motion vector detection units having the same function independently for each step according to the step search method increases the hardware scale and causes a cost increase. .

なお、上述の特許文献1は、フレーム構造のマクロブロックペアおよびフィールド構造のマクロブロックペアのそれぞれに対して、予測信号および予測誤差信号の生成、直交変換、量子化、ならびに、ハフマン符号化からなる仮符号化を行う。そして、仮符号化の結果に基づき、実際の符号化をフィールド構造のマクロブロックペアに対して行うか、フレーム構造のマクロブロックペアに対して行うかを決定している。そのため、特許文献1においては、フレーム構造のマクロブロックペアおよびフィールド構造のマクロブロックペアのそれぞれについて、仮符号化を行うための構成が必要となり、その分のハードウェア規模が増大してしまう。   The above-mentioned Patent Document 1 includes generation of a prediction signal and a prediction error signal, orthogonal transformation, quantization, and Huffman coding for each of a macroblock pair having a frame structure and a macroblock pair having a field structure. Provisional encoding is performed. Then, based on the result of provisional encoding, it is determined whether the actual encoding is performed on the field-structured macroblock pair or the frame-structured macroblock pair. For this reason, in Patent Document 1, a configuration for performing temporary encoding is required for each of the macroblock pair having the frame structure and the macroblock pair having the field structure, and the hardware scale increases accordingly.

したがって、この発明の目的は、符号化にMBAFFを適用し、動きベクトル検出をステップサーチ法で行う場合のハードウェア規模を抑制できる動きベクトル検出装置および動きベクトル検出方法を提供することにある。   Therefore, an object of the present invention is to provide a motion vector detection device and a motion vector detection method that can suppress the hardware scale when MBAFF is applied to encoding and motion vector detection is performed by the step search method.

本発明は、上述した課題を解決するために、インタレース方式の動画像フレームを所定サイズに分割してなる符号化ブロックを、動画像フレームのトップフィールドおよびボトムフィールドのラインが交互に配置されるフレーム構造と、トップフィールドおよびボトムフィールドの何れか一方のラインからなるフィールド構造とを適応的に切り替えて形成し、符号化ブロックについて検出された動きベクトルに基づき符号化ブロックの予測符号化を行う符号化装置に用いられ、探索範囲の動画像データに対して段階的に精度を上げると共に段階的に探索範囲を狭めてN(Nは2以上の整数)段階で動きベクトルの検出を行う動きベクトル検出装置であって、探索範囲に応じたサイズで、フレーム構造のブロックと、フィールド構造のブロックの少なくとも一方を形成するブロック形成手段と、ブロック形成手段で形成されたフィールド構造またはフレーム構造のブロックに対して、N段階のうち最も精度が低く且つ最も探索範囲が広い方からM(ただしM<N)段階目までの動きベクトル検出を行う第1の動きベクトル検出手段と、ブロック形成手段で形成されたフィールド構造のブロックに対して、N段階のうち最も精度の高いN段階目までの動きベクトル検出を、(M+1)段階目から段階毎に精度を上げて順次行い、(M+1)段階目の動きベクトル検出のための探索範囲の位置を第1の動きベクトル検出手段により検出された動きベクトルに基づき決定する第2の動きベクトル検出手段と、ブロック形成手段で形成されたフレーム構造のブロックに対して、N段階のうち最も精度の高いN段階目までの動きベクトル検出を、(M+1)段階目から段階毎に精度を上げて順次行い、(M+1)段階目の動きベクトル検出のための探索範囲の位置を第1の動きベクトル検出手段により検出された動きベクトルに基づき決定する第3の動きベクトル検出手段と、第2の動きベクトル検出手段および第3の動きベクトル検出手段それぞれのN段階目の動きベクトル検出結果に基づき、符号化ブロックをフィールド構造またはフレーム構造のうち何方で形成するかを決定すると共に、第2の動きベクトル検出手段および第3の動きベクトル検出手段のそれぞれにより検出された動きベクトルのうち何方を出力するかを判定する決定手段と、第1の動きベクトル検出手段で検出された動きベクトルを、第1の動きベクトル検出手段が動きベクトル検出の対象としたブロックの構造とは別の構造に対応させて補正する動きベクトル補正手段とを有し、第2または第3の動きベクトル検出手段は、第1の動きベクトル検出手段で検出に用いたブロックの構造とは別の構造に対して(M+1)段階目の動きベクトル検出を行う場合に、(M+1)段階目の動きベクトル検出のための探索範囲の位置を、動きベクトル補正手段で補正された動きベクトルにより決定することを特徴とする動きベクトル検出装置である。   In order to solve the above-described problem, the present invention has an encoding block obtained by dividing an interlaced moving image frame into a predetermined size, and top and bottom field lines of the moving image frame are alternately arranged. A code that adaptively switches between a frame structure and a field structure consisting of one of the top field and bottom field lines, and performs predictive coding of the coding block based on the motion vector detected for the coding block Motion vector detection that is used in an image processing apparatus and that increases the accuracy of moving image data in the search range in stages and narrows the search range in steps to detect motion vectors in N (N is an integer of 2 or more) stages. A device with a frame structure and a field structure block in a size corresponding to the search range For the block forming means forming at least one and the block of the field structure or frame structure formed by the block forming means, M has the lowest accuracy and the widest search range among N stages (where M <N ) The first motion vector detecting means for detecting motion vectors up to the stage and the motion vector detection up to the Nth stage with the highest accuracy among the N stages for the field structure block formed by the block forming means. Are sequentially performed from stage (M + 1) with increasing accuracy for each stage, and the position of the search range for motion vector detection at stage (M + 1) is based on the motion vector detected by the first motion vector detection means. Of the N stages, the second motion vector detection means to be determined and the block of the frame structure formed by the block formation means The motion vector detection from the (M + 1) th stage to the Nth stage with high accuracy is sequentially performed with increasing accuracy for each stage, and the position of the search range for the (M + 1) th stage motion vector detection is set to the first motion. Based on the third motion vector detection means determined based on the motion vector detected by the vector detection means, the motion vector detection results of the Nth stage of each of the second motion vector detection means and the third motion vector detection means, It is determined which one of the field structure or the frame structure is used to form the encoded block, and which one of the motion vectors detected by the second motion vector detecting means and the third motion vector detecting means is output. And a motion vector detected by the first motion vector detection means is used as a first motion vector detection means. The stage has a motion vector correction unit that corrects the motion vector according to a structure different from the structure of the block that is the target of motion vector detection, and the second or third motion vector detection unit is configured to detect the first motion vector. When the (M + 1) -th stage motion vector detection is performed on a structure different from the block structure used for detection by the means, the position of the search range for the (M + 1) -th stage motion vector detection It is a motion vector detection device characterized by being determined by a motion vector corrected by a vector correction means.

また、本発明は、インタレース方式の動画像フレームを所定サイズに分割してなる符号化ブロックを、動画像フレームのトップフィールドおよびボトムフィールドのラインが交互に配置されるフレーム構造と、トップフィールドおよびボトムフィールドの何れか一方のラインからなるフィールド構造とを適応的に切り替えて形成し、符号化ブロックについて検出された動きベクトルに基づき符号化ブロックの予測符号化を行う符号化装置に用いられ、探索範囲の動画像データに対して段階的に精度を上げると共に段階的に探索範囲を狭めてN(Nは2以上の整数)段階で動きベクトルの検出を行う動きベクトル検出方法であって、探索範囲に応じたサイズで、フレーム構造のブロックと、フィールド構造のブロックの少なくとも一方を形成するブロック形成ステップと、ブロック形成ステップで形成されたフィールド構造またはフレーム構造のブロックに対して、N段階のうち最も精度が低く且つ最も探索範囲が広い方からM(ただしM<N)段階目までの動きベクトル検出を行う第1の動きベクトル検出ステップと、ブロック形成ステップで形成されたフィールド構造のブロックに対して、N段階のうち最も精度の高いN段階目までの動きベクトル検出を、(M+1)段階目から段階毎に精度を上げて順次行い、(M+1)段階目の動きベクトル検出のための探索範囲の位置を第1の動きベクトル検出ステップにより検出された動きベクトルに基づき決定する第2の動きベクトル検出ステップと、ブロック形成ステップで形成されたフレーム構造のブロックに対して、N段階のうち最も精度の高いN段階目までの動きベクトル検出を、(M+1)段階目から段階毎に精度を上げて順次行い、(M+1)段階目の動きベクトル検出のための探索範囲の位置を第1の動きベクトル検出ステップにより検出された動きベクトルに基づき決定する第3の動きベクトル検出ステップと、第2の動きベクトル検出ステップおよび第3の動きベクトル検出ステップそれぞれのN段階目の動きベクトル検出結果に基づき、符号化ブロックをフィールド構造またはフレーム構造のうち何方で形成するかを決定すると共に、第2の動きベクトル検出ステップおよび第3の動きベクトル検出ステップのそれぞれにより検出された動きベクトルのうち何方を出力するかを判定する決定ステップと、第1の動きベクトル検出ステップで検出された動きベクトルを、第1の動きベクトル検出ステップが動きベクトル検出の対象としたブロックの構造とは別の構造に対応させて補正する動きベクトル補正ステップとを有し、第2または第3の動きベクトル検出ステップは、第1の動きベクトル検出ステップで検出に用いたブロックの構造とは別の構造に対して(M+1)段階目の動きベクトル検出を行う場合に、(M+1)段階目の動きベクトル検出のための探索範囲の位置を、動きベクトル補正ステップで補正された動きベクトルにより決定することを特徴とする動きベクトル検出方法である。   Further, the present invention provides an encoding block obtained by dividing an interlaced moving image frame into a predetermined size, a frame structure in which top field and bottom field lines of the moving image frame are alternately arranged, a top field, A field structure consisting of any one line of the bottom field is formed by adaptively switching and used in a coding apparatus that performs predictive coding of a coded block based on a motion vector detected for the coded block. A motion vector detection method for detecting motion vectors in N (N is an integer of 2 or more) stages by gradually increasing the accuracy for moving image data in a range and narrowing the search range in stages. At least one of a frame structure block and a field structure block From the block formation step and the field structure or frame structure block formed in the block formation step, from the N stages with the lowest accuracy and the widest search range to the M (where M <N) stages For the first motion vector detection step for performing motion vector detection and the block of the field structure formed in the block formation step, motion vector detection up to the Nth stage with the highest accuracy among the N stages is performed as (M + 1). A second step of determining the position of the search range for detecting the motion vector of the (M + 1) -th stage based on the motion vector detected by the first motion vector detecting step; The frame structure block formed in the motion vector detection step and the block formation step is subjected to N stages. The motion vector detection from the (M + 1) th stage to the Nth stage with the highest accuracy is sequentially performed with increasing accuracy for each stage, and the position of the search range for the (M + 1) th stage motion vector detection is set to the first level. A third motion vector detection step determined based on the motion vector detected by the motion vector detection step, and a motion vector detection result at the Nth stage in each of the second motion vector detection step and the third motion vector detection step Determining which of the field structure or the frame structure the encoding block is to be formed, and outputting which of the motion vectors detected by each of the second motion vector detection step and the third motion vector detection step A determination step for determining whether to perform the motion detected in the first motion vector detection step A motion vector correction step for correcting the vector in correspondence with a structure different from the structure of the block that is the target of motion vector detection in the first motion vector detection step, and the second or third motion vector detection In the step, when (M + 1) -th motion vector detection is performed on a structure different from the block structure used for detection in the first motion vector detection step, the (M + 1) -th motion vector detection is performed. This is a motion vector detection method characterized in that the position of the search range is determined by the motion vector corrected in the motion vector correction step.

本発明は、上述した構成を有するため、符号化にMBAFFを適用し、動きベクトル検出をステップサーチ法で行う場合のハードウェア規模を抑制できる。   Since the present invention has the above-described configuration, it is possible to suppress the hardware scale when MBAFF is applied to encoding and motion vector detection is performed by the step search method.

以下、本発明の実施形態を、図面を参照しながら説明する。本発明では、インタレース方式の動画像データの符号化をMBAFFにより行い、動画像データの動きベクトルをステップサーチ法を用いて検出する構成に関する。すなわち、本発明では、ステップサーチ法による最初のステップである大域サーチを、フレーム構造またはフィールド構造のうち予め決められたマクロブロックペア構造に対してのみ行う。そして、その結果に基づき、符号化対象のマクロブロックに対する以降のステップの動きベクトル探索を、フレーム構造およびフィールド構造の何れのマクロブロックペア構造を用いて行うかを決定する。大域サーチを行うための動きベクトル探索部が1つで済み、動きベクトル検出部の規模を削減することができる。   Embodiments of the present invention will be described below with reference to the drawings. The present invention relates to a configuration in which interlaced moving image data is encoded by MBAFF and a motion vector of moving image data is detected using a step search method. That is, in the present invention, the global search, which is the first step by the step search method, is performed only on a predetermined macroblock pair structure of the frame structure or the field structure. Then, based on the result, it is determined which macroblock pair structure of the frame structure or the field structure is used for the motion vector search in the subsequent steps for the macroblock to be encoded. Only one motion vector search unit for performing the global search is required, and the scale of the motion vector detection unit can be reduced.

図1は、本発明に適用可能な符号化装置1の一例の構成を示す。符号化装置1に対して、インタレース方式の動画像データが入力される。この動画像データは、動画像フレームのトップフィールドおよびボトムフィールドの画像データが1フレームの奇数ラインおよび偶数ラインにそれぞれ配置されて、フレーム単位で入力される。   FIG. 1 shows a configuration of an example of an encoding apparatus 1 applicable to the present invention. Interlaced moving image data is input to the encoding device 1. The moving image data is input in units of frames by arranging the image data of the top field and the bottom field of the moving image frame on odd lines and even lines of one frame, respectively.

符号化装置1に入力された動画像データは、フレーム単位でフレームメモリ10に格納される。フレームメモリ10に格納された動画像データは、所定サイズ、例えば符号化ブロックとしての16画素×16ラインのマクロブロックが画面の垂直方向に2個並べられた、マクロブロックペア単位で読み出される。このマクロブロックペア単位の動画像データは、動きベクトル検出部23に供給される。   The moving image data input to the encoding device 1 is stored in the frame memory 10 in units of frames. The moving image data stored in the frame memory 10 is read in units of macroblock pairs in which two macroblocks of a predetermined size, for example, 16 pixels × 16 lines as coding blocks are arranged in the vertical direction of the screen. The moving image data in units of macroblock pairs is supplied to the motion vector detection unit 23.

動きベクトル検出部23は、後述するフレームメモリ21から読み出された再構成画像データを参照画像データとして、フレームメモリ10から読み出されたマクロブロックペアの動きベクトルを検出する。それと共に、動きベクトル検出部23は、動きベクトルの検出結果に基づき、後述する方法により、符号化対象のマクロブロックペアをフレーム構造として扱うか、フィールド構造として扱うかを決定する。動きベクトル検出部23で検出された動きベクトルは、インター予測部22に供給される。また、マクロブロックペアの構造を示す情報(MBP情報と呼ぶ)は、インター予測部22および動き補償(減算)部11にそれぞれ供給される。   The motion vector detection unit 23 detects the motion vector of the macroblock pair read from the frame memory 10 using reconstructed image data read from the frame memory 21 described later as reference image data. At the same time, based on the motion vector detection result, the motion vector detection unit 23 determines whether to handle the macro block pair to be encoded as a frame structure or a field structure by a method described later. The motion vector detected by the motion vector detection unit 23 is supplied to the inter prediction unit 22. Information indicating the structure of the macroblock pair (referred to as MBP information) is supplied to the inter prediction unit 22 and the motion compensation (subtraction) unit 11, respectively.

動き補償(減算)部11は、フレームメモリ10から画像データをマクロブロックペア単位で読み出し、この読み出された画像データから、後述するインター予測部22から供給される予測画像データを減算し、画像残差データを生成する。   The motion compensation (subtraction) unit 11 reads image data from the frame memory 10 in units of macroblock pairs, subtracts prediction image data supplied from an inter prediction unit 22 described later from the read image data, Generate residual data.

なお、動き補償(減算)部11は、動きベクトル検出部23から供給されたMBP情報に基づき、フレームメモリ10から読み出された画像データの並べ替えを行い、並べ替えられた画像データに対して減算処理を行う。すなわち、動き補償(減算)部11は、MBPモードがフィールド構造を示していれば、マクロブロックペアの奇数ラインのデータを上側のマクロブロックに纏め、偶数ラインのデータを下側のマクロブロックに纏める。これにより、トップフィールドのデータからなるマクロブロックが上側に配置され、ボトムフィールドのデータからなるマクロブロックが下側に配置されたマクロブロックペアが形成される。MBPモードがフレーム構造を示していれば、動き補償(減算)部11は、フレームメモリ10から読み出したマクロブロックペアのデータをそのまま用いる。   The motion compensation (subtraction) unit 11 rearranges the image data read from the frame memory 10 based on the MBP information supplied from the motion vector detection unit 23, and performs the rearrangement on the rearranged image data. Perform subtraction. That is, if the MBP mode indicates the field structure, the motion compensation (subtraction) unit 11 collects the odd line data of the macroblock pair in the upper macroblock and the even line data in the lower macroblock. . As a result, a macroblock pair is formed in which the macroblocks composed of the top field data are arranged on the upper side and the macroblocks composed of the bottom field data are arranged on the lower side. If the MBP mode indicates a frame structure, the motion compensation (subtraction) unit 11 uses the data of the macroblock pair read from the frame memory 10 as it is.

動き補償(減算)部11から出力された画像残差データは、整数変換部12に供給される。整数変換部12は、供給されたマクロブロックペアを上下のマクロブロックに分解し、さらに8画素×8ラインや4画素×4ラインといったブロックに分割する。そして、分割されたブロックを単位として、画像データに対してアダマール変換や整数精度DCTといった直交変換処理を行い、DCT係数に変換する。DCT係数は、量子化部13に供給される。   The image residual data output from the motion compensation (subtraction) unit 11 is supplied to the integer conversion unit 12. The integer conversion unit 12 decomposes the supplied macroblock pair into upper and lower macroblocks and further divides the block into blocks of 8 pixels × 8 lines or 4 pixels × 4 lines. Then, using the divided blocks as units, orthogonal transformation processing such as Hadamard transformation or integer precision DCT is performed on the image data to convert it into DCT coefficients. The DCT coefficient is supplied to the quantization unit 13.

量子化部13は、量子化制御部14の制御に従い、供給されたDCT係数の量子化をマクロブロック単位で行う。量子化部13から出力された量子化値は、2値化部15に供給される。2値化部15は、供給された量子化値や、量子化を行ったマクロブロックに付随する各種データを2値化して出力する。2値化部15の出力は、エントロピー符号化部16に供給され、エントロピー符号化されてビットストリームとして出力される。   The quantization unit 13 performs quantization of the supplied DCT coefficient in units of macroblocks under the control of the quantization control unit 14. The quantized value output from the quantizing unit 13 is supplied to the binarizing unit 15. The binarization unit 15 binarizes and outputs the supplied quantized value and various data associated with the quantized macroblock. The output of the binarization unit 15 is supplied to the entropy encoding unit 16, and is entropy encoded and output as a bit stream.

一方、量子化部13から出力された量子化値は、逆量子化部17にも供給される。量子化値は、逆量子化部17で逆量子化され、逆整数変換部18で逆整数変換され、ローカルデコード画像データとされる。ローカルデコード画像データは、加算部19に供給される。加算部19は、ローカルデコード画像データと後述するインター予測部22から供給される予測画像データとを加算し、再構成画像データを形成する。この再構成画像データは、フレームメモリ24に格納されると共に、デブロッキングフィルタ20に供給される。   On the other hand, the quantization value output from the quantization unit 13 is also supplied to the inverse quantization unit 17. The quantized value is inversely quantized by the inverse quantizing unit 17 and inversely integer transformed by the inverse integer transforming unit 18 to be locally decoded image data. The local decoded image data is supplied to the adding unit 19. The adder 19 adds local decoded image data and predicted image data supplied from an inter prediction unit 22 described later to form reconstructed image data. The reconstructed image data is stored in the frame memory 24 and supplied to the deblocking filter 20.

デブロッキングフィルタ20は、供給された再構成画像データに対してフィルタ処理を施し、符号化歪みを軽減させる。デブロッキングフィルタ20で符号化歪みが軽減された再構成画像データは、フレームメモリ21に格納される。   The deblocking filter 20 performs a filtering process on the supplied reconstructed image data to reduce coding distortion. The reconstructed image data whose coding distortion has been reduced by the deblocking filter 20 is stored in the frame memory 21.

インター予測部22は、動きベクトル検出部23で検出された動きベクトルに基づき、フレームメモリ21から再構成画像データをマクロブロックペア単位で読み出す。インター予測部22は、フレームメモリ21から読み出した再構成画像データと、動きベクトル検出部23で検出された動きベクトルとに基づきフレーム間予測処理を行い、予測画像データを生成する。生成された予測画像データは、スイッチ26の一方の入力端に供給される。   The inter prediction unit 22 reads the reconstructed image data from the frame memory 21 in units of macroblock pairs based on the motion vector detected by the motion vector detection unit 23. The inter prediction unit 22 performs inter-frame prediction processing based on the reconstructed image data read from the frame memory 21 and the motion vector detected by the motion vector detection unit 23, and generates predicted image data. The generated predicted image data is supplied to one input terminal of the switch 26.

イントラ予測部25は、フレームメモリ24に格納された再構成画像データを用いてフレーム内予測処理を行い、予測画像データを生成する。イントラ予測部25から出力されたイントラ予測画像データは、スイッチ26の他方の入力端に供給される。   The intra prediction unit 25 performs intra-frame prediction processing using the reconstructed image data stored in the frame memory 24, and generates predicted image data. The intra predicted image data output from the intra prediction unit 25 is supplied to the other input terminal of the switch 26.

スイッチ26は、イントラ予測およびインター予測の何方を用いるかを選択する。イントラ予測部25から出力されたイントラ予測画像データと、インター予測部22から出力されたインター予測画像データとのうち一方を選択し、選択された予測画像データを動き補償(減算)部11に供給すると共に、加算部19に供給する。   The switch 26 selects which of intra prediction and inter prediction is used. One of the intra prediction image data output from the intra prediction unit 25 and the inter prediction image data output from the inter prediction unit 22 is selected, and the selected prediction image data is supplied to the motion compensation (subtraction) unit 11. At the same time, it is supplied to the adder 19.

なお、図1では、フレームメモリ10および21がそれぞれ独立した構成であるように示されているが、これはこの例に限定されない。すなわち、フレームメモリ10および21を1つのメモリの異なる領域としてもよい。   In FIG. 1, the frame memories 10 and 21 are shown as having independent structures, but this is not limited to this example. That is, the frame memories 10 and 21 may be different areas of one memory.

また、この符号化装置1は、図示されないCPUにより、所定のプログラムに従って制御される。CPUは、符号化装置1を専用に制御するものでもよいし、この符号化装置1が組み込まれるより上位のシステムを制御するものでもよい。CPUは、図示されないROMおよびRAMを有し、ROMに予め格納されたプログラムに従いRAMをワークメモリとして動作し、符号化装置1の各部を制御する。   The encoding device 1 is controlled by a CPU (not shown) according to a predetermined program. The CPU may control the encoding device 1 exclusively, or may control a higher-order system in which the encoding device 1 is incorporated. The CPU includes a ROM and a RAM (not shown), operates as a work memory according to a program stored in advance in the ROM, and controls each unit of the encoding device 1.

<第1の実施形態>
次に、本発明の第1の実施形態について説明する。本発明は、図1を用いて説明した符号化装置1の構成のうち、動きベクトル検出部23に適用される。図2は、本発明の第1の実施形態による動きベクトル検出部23の一例の構成を示す。なお、図2において、フレームまたはフィールドメモリ107は、図1におけるフレームメモリ10および21に対応する。フレームまたはフィールドメモリ107は、符号化装置1に対して入力された動画像データと、デブロッキングフィルタ20から供給された再構成画像データとが、それぞれ異なる領域に格納されるものとする。以下、フレームまたはフィールドメモリ107を、メモリ107と略称する。
<First Embodiment>
Next, a first embodiment of the present invention will be described. The present invention is applied to the motion vector detection unit 23 in the configuration of the encoding device 1 described with reference to FIG. FIG. 2 shows an exemplary configuration of the motion vector detection unit 23 according to the first embodiment of the present invention. In FIG. 2, a frame or field memory 107 corresponds to the frame memories 10 and 21 in FIG. Assume that the frame or field memory 107 stores moving image data input to the encoding device 1 and reconstructed image data supplied from the deblocking filter 20 in different areas. Hereinafter, the frame or field memory 107 is abbreviated as the memory 107.

図2に例示される動きベクトル検出部23は、大域サーチ、1画素精度サーチおよび1/4画素精度サーチの3つのステージにより、3ステップで動きベクトルの探索を行い、動きベクトルを検出する。   The motion vector detection unit 23 illustrated in FIG. 2 searches for a motion vector in three steps by three stages of a global search, a 1-pixel accuracy search, and a 1 / 4-pixel accuracy search, and detects a motion vector.

図2において上側に示される第1ステージME部101、第2ステージME部102および第3ステージME部103は、それぞれ、フィールド構造のマクロブロックペアに対する大域サーチ、1画素精度サーチおよび1/4画素精度サーチを行う。また、図2において下側に示される第2ステージME部105および第3ステージME部106は、それぞれ、フレーム構造のマクロブロックペアに対する1画素精度サーチおよび1/4画素精度サーチを行う。   The first stage ME unit 101, the second stage ME unit 102, and the third stage ME unit 103 shown on the upper side in FIG. 2 are respectively a global search, a one-pixel accuracy search, and a ¼ pixel for a macroblock pair having a field structure. Perform an accuracy search. In addition, the second stage ME unit 105 and the third stage ME unit 106 shown on the lower side in FIG. 2 perform a 1-pixel accuracy search and a 1 / 4-pixel accuracy search for a macroblock pair having a frame structure, respectively.

本発明の第1の実施形態では、第1ステージME部101の、フィールド構造のマクロブロックペアに対する大域サーチの結果に基づき、1画素精度サーチ及び1/4画素精度サーチを行うマクロブロックペアの構造(フレーム構造/フィールド構造)を決定する。   In the first embodiment of the present invention, the structure of a macroblock pair that performs a 1-pixel precision search and a 1 / 4-pixel precision search based on the result of a global search for a field-structured macroblock pair in the first stage ME unit 101. (Frame structure / field structure) is determined.

第1ステージME部101は、メモリ107から符号化対象となる画像データのマクロブロックペアを読み出してデータの並び替えを行い、それぞれトップフィールドおよびボトムフィールドの画像データから構成される2つのマクロブロックを形成する。また、第1ステージME部101は、メモリ107から参照画像としての再構成画像データを読み出して、トップフィールドおよびボトムフィールドそれぞれの参照画像データを形成する。そして、マクロブロックペアを構成するマクロブロック毎に動きベクトルの探索を行い、動きベクトルを検出する。第1ステージME部101は、第1の動きベクトル検出手段として機能する。   The first stage ME unit 101 reads out the macroblock pairs of the image data to be encoded from the memory 107 and rearranges the data. The first stage ME unit 101 converts the two macroblocks composed of the top field and bottom field image data, respectively. Form. Further, the first stage ME unit 101 reads the reconstructed image data as the reference image from the memory 107, and forms reference image data for each of the top field and the bottom field. Then, a motion vector is searched for each macro block constituting the macro block pair, and a motion vector is detected. The first stage ME unit 101 functions as first motion vector detection means.

第2ステージME部102は、第1ステージME部101により検出された動きベクトルに基づき探索範囲を設定する。探索範囲は、トップフィールドおよびボトムフィールドそれぞれに対して設定されることになる。第2ステージME部102は、メモリ107から、設定されたそれぞれの探索範囲のブロックの画像データと、当該探索範囲に対応するそれぞれの参照画像データを読み出す。そして、それぞれの符号化対象の画像データについて、1画素精度サーチにより動きベクトルの探索を行い、動きベクトルを検出する。   Second stage ME unit 102 sets a search range based on the motion vector detected by first stage ME unit 101. The search range is set for each of the top field and the bottom field. The second stage ME unit 102 reads, from the memory 107, the image data of each set search range block and the respective reference image data corresponding to the search range. Then, for each image data to be encoded, a motion vector is searched by a one-pixel accuracy search to detect a motion vector.

第3ステージME部103は、第2ステージME部102により検出された動きベクトルに基づき、トップフィールドおよびボトムフィールドそれぞれに対して探索範囲を設定する。第3ステージME部103は、メモリ107から、設定されたそれぞれの探索範囲からなるブロックの画像データと、当該探索範囲に対応するそれぞれの参照画像データを読み出す。そして、それぞれの符号化対処の画像データについて、1/4画素精度サーチにより動きベクトルの探索を行い、動きベクトルを検出する。第3ステージME部103による、トップフィールドおよびボトムフィールドそれぞれの検出結果は、モード判定部110に供給される。モード判定部110の処理については、後述する。第2ステージME部102および第3ステージME部103は、第2の動きベクトル検出手段として機能する。   The third stage ME unit 103 sets a search range for each of the top field and the bottom field based on the motion vector detected by the second stage ME unit 102. The third stage ME unit 103 reads out, from the memory 107, image data of a block including each set search range and each reference image data corresponding to the search range. Then, a motion vector is searched for each encoded image data by a 1/4 pixel accuracy search to detect a motion vector. The detection results of the top field and the bottom field by the third stage ME unit 103 are supplied to the mode determination unit 110. The processing of the mode determination unit 110 will be described later. Second stage ME unit 102 and third stage ME unit 103 function as second motion vector detection means.

一方、フレームモードによる動きベクトル検出を行う第2ステージME部105は、後述する動きベクトル補正部104から供給される動きベクトルに基づき、探索範囲を設定する。探索範囲は、マクロブロックペアの上側および下側の2つのマクロブロックのそれぞれに対して設定されることになる。第2ステージME部105は、メモリ107から、設定されたそれぞれの探索範囲のブロックの画像データと、当該探索範囲に対応するそれぞれの参照画像データを読み出す。そして、それぞれの符号化対象の画像データについて、1画素精度サーチにより動きベクトルの探索を行い、動きベクトルを検出する。   On the other hand, the second stage ME unit 105 that performs motion vector detection in the frame mode sets a search range based on a motion vector supplied from a motion vector correction unit 104 described later. The search range is set for each of the two upper and lower macroblocks of the macroblock pair. The second stage ME unit 105 reads, from the memory 107, the image data of each set search range block and the respective reference image data corresponding to the search range. Then, for each image data to be encoded, a motion vector is searched by a one-pixel accuracy search to detect a motion vector.

第3ステージME部106は、第2ステージME部105により検出された動きベクトルに基づき、マクロブロックペアの上側および下側の2つのマクロブロックのそれぞれに対して探索範囲を設定する。第3ステージME部106は、メモリ107から、設定されたそれぞれの探索範囲のブロックの画像データと、当該探索範囲に対応するそれぞれの参照画像データを読み出す。そして、それぞれの符号化対処の画像データについて、1/4画素精度サーチにより動きベクトルの探索を行い、動きベクトルを検出する。第3ステージME部106による、マクロブロックペアの上側および下側の2つのマクロブロックそれぞれの検出結果は、モード判定部110に供給される。第2ステージME部105および第3ステージME部106は、第3の動きベクトル検出手段として機能する。   Based on the motion vector detected by second stage ME unit 105, third stage ME unit 106 sets a search range for each of the two upper and lower macroblocks of the macroblock pair. The third stage ME unit 106 reads, from the memory 107, image data of each set search range block and each reference image data corresponding to the search range. Then, a motion vector is searched for each encoded image data by a 1/4 pixel accuracy search to detect a motion vector. The detection results of the upper and lower macroblocks of the macroblock pair by the third stage ME unit 106 are supplied to the mode determination unit 110. Second stage ME unit 105 and third stage ME unit 106 function as third motion vector detection means.

なお、符号化装置1が備えるCPUをブロック形成手段として機能させることができる。例えば、第1ステージME部101、第2ステージME部102および第3ステージME部103におけるフィールド構造のブロックを、このCPUの制御により形成することができる。第2ステージME部105および第3ステージME部106におけるフレーム構造のブロックについても、同様である。   The CPU included in the encoding device 1 can function as a block forming unit. For example, the field structure blocks in the first stage ME unit 101, the second stage ME unit 102, and the third stage ME unit 103 can be formed under the control of the CPU. The same applies to the blocks of the frame structure in the second stage ME unit 105 and the third stage ME unit 106.

判定手段としての差分値評価部108は、第1ステージME部101で検出された動きベクトルの評価を行う。評価は、第1ステージME部101において動きベクトルの検出過程で算出された、符号化対象の画像データと、参照画像データとの画素毎の差分の絶対値を合計した、差分絶対値和を用いて行う。   The difference value evaluation unit 108 as a determination unit evaluates the motion vector detected by the first stage ME unit 101. The evaluation uses the sum of absolute differences, which is the sum of the absolute values of the differences for each pixel between the image data to be encoded and the reference image data, calculated in the motion vector detection process in the first stage ME unit 101. Do it.

第1ステージME部101において、符号化対象のマクロブロックに対して、参照画像データを例えば1乃至数画素ステップで順次移動させる。そして、各ステップ毎に、次式(1)により画素毎に画素値の差分を取り、この差分の絶対値をマクロブロックについて合計し、差分絶対値和Sを求める。なお、数式(1)において、Cx,yは、符号化対象のマクロブロックにおける画素の輝度成分の値(以下、輝度値と呼ぶ)を示す。Rx,yは、参照画像データにおける画素の輝度値を示す。 In the first stage ME unit 101, the reference image data is sequentially moved, for example, in one to several pixel steps with respect to the macroblock to be encoded. Then, for each step, the difference between the pixel values is calculated for each pixel by the following equation (1), and the absolute value of the difference is summed for the macroblock to obtain the difference absolute value sum S. In Equation (1), C x, y represents the value of the luminance component of the pixel in the macroblock to be encoded (hereinafter referred to as the luminance value). R x, y indicates the luminance value of the pixel in the reference image data.

Figure 2010016780
Figure 2010016780

参照画像データを符号化対象のマクロブロックに対して移動させたときに、この差分絶対値和Sが最も小さい位置の動きベクトルが、第1ステージME部101の検出結果として選択される。   When the reference image data is moved with respect to the macro block to be encoded, the motion vector at the position where the difference absolute value sum S is the smallest is selected as the detection result of the first stage ME unit 101.

差分値評価部108では、この、第1ステージME部101の検出結果として選択された差分絶対値和Sの評価を行う。この差分絶対値和Sの値が小さいほど、第1ステージME部101で検出された動きベクトルがより確からしいといえる。換言すれば、差分絶対値和Sは、第1ステージME部101で検出された動きベクトルの確からしさを示す値である。以下、差分絶対値和Sの逆数を取った値Pを、第1ステージME部101で検出された動きベクトルの確からしさを示す値として用いることにする。この場合、値Pが大きいほど、第1ステージME部101で検出された動きベクトルがより確からしいことを示す。本第1の実施形態では、実験的に求めた閾値Tを用い、この閾値Tと確からしさを示す値Pとを比較することで、差分絶対値和Sを評価し、下記の制御を行う。 The difference value evaluation unit 108 evaluates the difference absolute value sum S selected as the detection result of the first stage ME unit 101. It can be said that the smaller the value of the sum of absolute differences S is, the more likely the motion vector detected by the first stage ME unit 101 is. In other words, the difference absolute value sum S is a value indicating the probability of the motion vector detected by the first stage ME unit 101. Hereinafter, a value P obtained by taking the reciprocal of the sum of absolute differences S will be used as a value indicating the probability of the motion vector detected by the first stage ME unit 101. In this case, the larger the value P, the more likely the motion vector detected by the first stage ME unit 101 is. In the first embodiment, the threshold value T 1 obtained experimentally is used, and the difference absolute value sum S is evaluated by comparing the threshold value T 1 with the value P indicating the probability, and the following control is performed. Do.

(a) P>Tのとき:フレーム構造での動きベクトル検出を行わない。
(b) P≦Tのとき:第2ステージ以降は、フレーム構造およびフィールド構造での動きベクトル検出を併用する。
(a) P> When T 1: do not perform motion vector detection in frame structure.
(b) when P ≦ T 1: the second stage or later, a combination of motion vector detection in frame structure and field structure.

すなわち、P>T(値Pが閾値より大きい)のときは、フィールド構造での動きベクトル検出を行う第1ステージME部101による検出結果の精度が十分と判断する。そして、以降、第2ステージME部102および第2ステージME部103により、そのまま、フィールド構造での動きベクトル検出を行う。 That is, when P> T 1 (value P is greater than the threshold value), it is determined that the accuracy of the detection result by the first stage ME unit 101 that performs motion vector detection in the field structure is sufficient. Thereafter, the second stage ME unit 102 and the second stage ME unit 103 perform motion vector detection in the field structure as it is.

一方、P≦T(値Pが閾値以下)のときは、符号化対象のマクロブロックが、フィールド構造での動きベクトル検出に適していない可能性があると判断する。この場合、第2ステージME部102および第3ステージME部103で、フィールド構造での動きベクトル検出を行うと共に、第2ステージME部105および第3ステージME部106でのフレーム構造での動きベクトル検出も行う。 On the other hand, when P ≦ T 1 (value P is equal to or less than the threshold value), it is determined that there is a possibility that the macroblock to be encoded is not suitable for motion vector detection in the field structure. In this case, the second stage ME unit 102 and the third stage ME unit 103 perform motion vector detection in the field structure, and the motion vector in the frame structure in the second stage ME unit 105 and the third stage ME unit 106. Detection is also performed.

このように、本第1の実施形態では、フィールド構造での動きベクトル検出は、常時、第1ステージME部101、第2ステージME部102および第3ステージME部103の全てで行う。そして、第1ステージME部101での動きベクトル検出結果に応じて、フレーム構造での動きベクトル検出を、第2ステージME部105および第3ステージME部106にてさらに行うか否かを決定する。この第2ステージME部105および第3ステージME部106に対する動きベクトル検出の実行制御は、差分値評価部108の上述した評価結果に基づき、適応的フレーム構造ME実行制御部109において行われる。   Thus, in the first embodiment, motion vector detection in the field structure is always performed by all of the first stage ME unit 101, the second stage ME unit 102, and the third stage ME unit 103. Then, according to the motion vector detection result in the first stage ME unit 101, it is determined whether or not the second stage ME unit 105 and the third stage ME unit 106 further perform motion vector detection in the frame structure. . The execution control of motion vector detection for the second stage ME unit 105 and the third stage ME unit 106 is performed by the adaptive frame structure ME execution control unit 109 based on the above-described evaluation result of the difference value evaluation unit 108.

なお、第1ステージME部101による動きベクトル検出は、マクロブロックペアを構成する2つのマクロブロックのそれぞれについて行われる。そのため、上述した差分絶対値和Sと閾値Tの比較による判定結果が、この2つのマクロブロック間で異なる場合が起こり得る。すなわち、マクロブロックペアを構成する一方のマクロブロックではS<Tとなり、他方のマクロブロックではS≧Tとなることが有り得る。このような場合には、何らかの方法を用いて判定結果のうち一方を選択する必要がある。 Note that the motion vector detection by the first stage ME unit 101 is performed for each of the two macroblocks constituting the macroblock pair. Therefore, the determination result by the comparison of the difference absolute value sum S and thresholds T 1 described above, may occur if the different between the two macroblocks. That is, it is possible that S <T 1 in one macro block constituting the macro block pair, and S ≧ T 1 in the other macro block. In such a case, it is necessary to select one of the determination results using some method.

一例として、差分絶対値和Sと閾値Tとの差分の絶対値|D|を2つのマクロブロックのそれぞれについて求める。そして、この差分の絶対値|D|が小さい方のマクロブロックに対応する判定結果を、当該マクロブロックペアの判定結果として採用することが考えられる。 As an example, the absolute value of the difference between the difference absolute value sum S with the threshold T 1 | D | of determining for each of two macroblocks. Then, it can be considered that the determination result corresponding to the macroblock having the smaller absolute value | D | of the difference is adopted as the determination result of the macroblock pair.

動きベクトルの検出においては、動きベクトルを探索する探索範囲を、各ステージ毎に予め指定しておく必要がある。本第1の実施形態では、フレーム構造での動きベクトル検出を行う第2ステージME部105における探索範囲を、フィールド構造での動きベクトル検出を行う第1ステージME部101で検出された動きベクトルを補正した値に基づき設定する。   In detecting a motion vector, a search range for searching for a motion vector needs to be designated in advance for each stage. In the first embodiment, the search range in the second stage ME unit 105 that performs motion vector detection in the frame structure is used, and the motion vector detected in the first stage ME unit 101 that performs motion vector detection in the field structure is used. Set based on the corrected value.

この動きベクトルの補正処理は、動きベクトル補正手段としての動きベクトル補正部104において行われる。例えば、適応的フレーム構造ME実行制御部109は、第1ステージME部101で得られた動きベクトルを差分値評価部108を介して受け取り、動きベクトル補正部104に渡す。動きベクトル補正部104は、この受け取った動きベクトルを後述するようにして補正し、補正された動きベクトルを第2ステージME部105に渡す。   This motion vector correction process is performed in the motion vector correction unit 104 as a motion vector correction unit. For example, the adaptive frame structure ME execution control unit 109 receives the motion vector obtained by the first stage ME unit 101 via the difference value evaluation unit 108 and passes it to the motion vector correction unit 104. The motion vector correction unit 104 corrects the received motion vector as will be described later, and passes the corrected motion vector to the second stage ME unit 105.

より具体的には、以下のようになる。すなわち、フィールド構造のマクロブロックペアのマクロブロックに対して第1ステージME部101で検出された動きベクトルを(FIx,FIy)とする。また、フレーム構造のマクロブロックペアのマクロブロックに対して第2ステージME部105が探索範囲を設定するための初期ベクトルを(FRx,FRy)とする。この場合、ベクトル(FIx,FIy)とベクトル(FRx,FRy)との関係は、以下の数式(2)および数式(3)により求められる。   More specifically, it is as follows. That is, the motion vector detected by the first stage ME unit 101 with respect to the macroblock of the macroblock pair having the field structure is defined as (FIx, FIy). In addition, an initial vector for the second stage ME unit 105 to set a search range for a macroblock of a macroblock pair having a frame structure is set to (FRx, FRy). In this case, the relationship between the vector (FIx, FIy) and the vector (FRx, FRy) is obtained by the following equations (2) and (3).

FRx=FIx ・・・(2)
FRy=2×FIy ・・・(3)
FRx = FIx (2)
FRy = 2 × FIy (3)

このように、動きベクトル補正部104で、フィールド構造のマクロブロックペアのマクロブロックより検出された動きベクトルの、垂直成分のみを2倍する補正を行った動きベクトルを算出する。そして、この補正された動きベクトルを、フレーム構造での1画素精度サーチを行う、第2ステージの探索範囲の設定に用いている。なお、探索範囲の設定は、探索範囲の中央に対して行うものとする。   In this way, the motion vector correction unit 104 calculates a motion vector that has been corrected to double only the vertical component of the motion vector detected from the macroblock of the macroblock pair of the field structure. The corrected motion vector is used for setting the search range of the second stage in which a one-pixel accuracy search is performed in the frame structure. The search range is set for the center of the search range.

モード判定部110における処理について説明する。決定手段としてのモード判定部110は、フィールド構造のマクロブロックペアについて求められた動きベクトルと、フレーム構造のマクロブロックペアについて求められた動きベクトルとを評価する。そして、評価結果に基づき、符号化対象のマクロブロックペアの構造として、フィールド構造およびフレーム構造の何れを適用するかを決定する。それと共に、モード判定部110は、評価結果に基づき、符号化対象のマクロブロックペアのマクロブロックタイプを決定する。   Processing in the mode determination unit 110 will be described. The mode determination unit 110 as a determining unit evaluates the motion vector obtained for the field-structured macroblock pair and the motion vector obtained for the frame-structured macroblock pair. Based on the evaluation result, it is determined which of the field structure and the frame structure is applied as the structure of the macroblock pair to be encoded. At the same time, the mode determination unit 110 determines the macroblock type of the macroblock pair to be encoded based on the evaluation result.

符号化対象のマクロブロックペアの構造は、以下のようにして決定する。モード判定部110は、第3ステージME部103がフィールド構造のマクロブロックペアのマクロブロックについて最終的に求めた動きベクトルで示される、16画素×16ラインのブロックに上述した数式(1)を適用し、差分絶対値和Siを求める。同様に、第3ステージME部106がフレーム構造のマクロブロックペアのマクロブロックについて最終的に求めた動きベクトルで示される、16画素×16ラインのブロックに数式(1)を適用し、差分絶対値和Srを求める。そして、差分絶対値和Siと差分絶対値和Srとを比較し、下記のように、マクロブロックペアの構造を決定する。そして、決定されたマクロブロックペアの構造に対応する動きベクトルを、この動きベクトル検出部23から出力する。また、決定された符号化モードを示す情報は、インター予測部22および動き補償(減算)部11に供給される。   The structure of the macroblock pair to be encoded is determined as follows. The mode determination unit 110 applies the above formula (1) to the block of 16 pixels × 16 lines indicated by the motion vector finally obtained by the third stage ME unit 103 for the macroblock of the macroblock pair having the field structure. Then, the difference absolute value sum Si is obtained. Similarly, Equation (1) is applied to a block of 16 pixels × 16 lines indicated by the motion vector finally obtained by the third stage ME unit 106 for the macroblock of the macroblock pair of the frame structure, and the absolute difference value The sum Sr is obtained. Then, the difference absolute value sum Si and the difference absolute value sum Sr are compared, and the structure of the macroblock pair is determined as follows. Then, a motion vector corresponding to the determined structure of the macroblock pair is output from the motion vector detection unit 23. Information indicating the determined encoding mode is supplied to the inter prediction unit 22 and the motion compensation (subtraction) unit 11.

(a) Sr≧Siのとき:マクロブロックペアの構造をフィールド構造とする。
(b) Sr<Siのとき:マクロブロックペアの構造をフレーム構造とする。
(a) When Sr ≧ Si: The structure of the macroblock pair is a field structure.
(b) When Sr <Si: The structure of the macroblock pair is a frame structure.

さらに、実験的に求めた閾値Ithを導入し、差分絶対値和SiおよびSrと閾値Ithとを比較することで、マクロブロックモードを選択することができる。なお、マクロブロックモードは、マクロブロックに対する予測符号化をイントラ予測(イントラモード)およびインター予測(インターモード)の何れで行うかを示す。関数min( )は、括弧内の値の最小値を求める関数であるものとする。モード判定部110は、マクロブロックモードの選択結果に応じて、スイッチ26を制御する。 Furthermore, by introducing a threshold I th determined experimentally, by comparing the sum of absolute differences Si and Sr and the threshold I th, it is possible to select a macroblock mode. The macroblock mode indicates whether the prediction coding for the macroblock is performed by intra prediction (intra mode) or inter prediction (inter mode). The function min () is assumed to be a function for obtaining the minimum value in parentheses. The mode determination unit 110 controls the switch 26 according to the selection result of the macro block mode.

(a) min(Sr,Si)≧Ithのとき:イントラモードとする。
(b) min(Sr,Si)<Ithのとき:インターモードとする。
(a) min (Sr, Si ) when ≧ I th: the intra mode.
(b) min (Sr, Si ) < When I th: the inter mode.

ところで、動きベクトル検出機能においては、参照画像データに対して広範囲に亘って探索を行う。そのため、参照画像データを格納しているメモリのアクセス帯域(一定時間当たりのアクセスバイト数)が大きくなり、これが設計時の重要な課題となっている。また、参照画像データを格納しているメモリに対するアクセス量が多いと、消費電力も増大してしまう。   By the way, in the motion vector detection function, the reference image data is searched over a wide range. For this reason, the access bandwidth (the number of access bytes per fixed time) of the memory storing the reference image data is increased, which is an important issue at the time of design. Further, if the access amount to the memory storing the reference image data is large, the power consumption increases.

図3は、動きベクトル検出において参照画像データを格納しているメモリに対する、従来技術によるメモリアクセス量と、本発明を適用した場合のメモリアクセス量とを比較して示す。図3に示す値は、実験的に求めた値であり、実装方法や探索範囲のサイズなどにより値が異なる。しかしながら、どのような実装においても典型的なのは、探索範囲が異なる複数のステージのうち、大域サーチを行う第1ステージのアクセス量が支配的であるということである。これは、第1ステージが大域サーチにより最も広範囲の参照画像データをメモリから読み出すため、自明である。   FIG. 3 shows a comparison between a memory access amount according to the prior art and a memory access amount when the present invention is applied to a memory storing reference image data in motion vector detection. The values shown in FIG. 3 are values obtained experimentally, and differ depending on the mounting method, the size of the search range, and the like. However, in any implementation, a typical example is that the access amount of the first stage for performing the global search is dominant among the plurality of stages having different search ranges. This is obvious because the first stage reads the widest range of reference image data from the memory by the global search.

図3においては、フィールド構造での大域サーチを行う第1ステージのアクセス量を1.0として正規化している。この正規化された第1ステージのアクセス量に対し、第2ステージのアクセス量が0.1、第3ステージのアクセス量が0.01と対比される。そのため、従来技術における、フィールド構造のみでステップサーチ法による動き探索を行った場合のメモリアクセス量Afは、数式(4)のように求められる。
Af=1.0+0.1+0.01=1.11 ・・・(4)
In FIG. 3, the access amount of the first stage for performing the global search in the field structure is normalized as 1.0. The normalized access amount of the first stage is compared with the access amount of the second stage being 0.1 and the access amount of the third stage being 0.01. Therefore, the memory access amount Af when the motion search by the step search method is performed only with the field structure in the prior art can be obtained as in Expression (4).
Af = 1.0 + 0.1 + 0.01 = 1.11 (4)

また、従来技術にて図12を用いて説明した、総当たり法(ブルートフォース法)においては、全てのステージの探索処理をフィールド構造およびフレーム構造の両方のマクロブロックペアに対して行う。そのため、総当たり法による処理量は、フィールド構造のみ、あるいは、フレーム構造のみのマクロブロックペアに対して動き探索を行った場合の処理量の2倍となる。したがって、総当たり法を用いてMBAFFを実行した場合の、メモリに対する総アクセス量Amは、数式(5)のように求められる。
Am=(1.0+0.1+0.01)×2=2.22 ・・・(5)
In the round-robin method (brute force method) described with reference to FIG. 12 in the prior art, all stages of search processing are performed on both field structure and frame structure macroblock pairs. Therefore, the processing amount based on the brute force method is twice the processing amount when the motion search is performed on the macroblock pair having only the field structure or only the frame structure. Therefore, the total access amount Am to the memory when MBAFF is executed using the brute force method is obtained as shown in Equation (5).
Am = (1.0 + 0.1 + 0.01) × 2 = 2.22 (5)

一方、本発明の第1の実施形態によれば、差分値評価部108における評価結果に基づきフィールド構造での動き探索とフレーム構造での動き探索とを共に実行する場合、第1ステージの処理が一系統削減される。したがって、メモリアクセス量Adは、数式(6)のように求められる。
Ad=1.0+(0.1+0.01)×2=1.22 ・・・(6)
On the other hand, according to the first embodiment of the present invention, when both the motion search in the field structure and the motion search in the frame structure are executed based on the evaluation result in the difference value evaluation unit 108, the first stage processing is performed. One system is reduced. Therefore, the memory access amount Ad is obtained as in Expression (6).
Ad = 1.0 + (0.1 + 0.01) × 2 = 1.22 (6)

上述した数式(5)の結果と比較すると、Ad/Af≒1.1となり、従来技術による、フィールド構造のみで動き探索を行った場合に対して略1割のメモリアクセス量の増加だけで、MBAFFを実行することができる。これは、差分値評価部108における評価結果に基づきフィールド構造のみで動き探索を行う場合には、メモリアクセス量がさらに少なくなる。   Compared with the result of the above formula (5), Ad / Af≈1.1, which is an increase in the memory access amount of about 10% compared to the case where the motion search is performed only by the field structure according to the conventional technique. MBAFF can be executed. This is because the memory access amount is further reduced when a motion search is performed using only the field structure based on the evaluation result in the difference value evaluation unit 108.

<第2の実施形態>
次に、本発明の第2の実施形態について説明する。上述した第1の実施形態では、フィールド構造での第1ステージの動きベクトル検出結果に基づき、第2ステージ以降の処理を決定した。これに対して、本第2の実施形態では、第2ステージ以降の処理を、フレーム構造での第1ステージの動きベクトル検出結果に基づき決定するようにしている。
<Second Embodiment>
Next, a second embodiment of the present invention will be described. In the first embodiment described above, the processing after the second stage is determined based on the motion vector detection result of the first stage in the field structure. On the other hand, in the second embodiment, the processing after the second stage is determined based on the motion vector detection result of the first stage in the frame structure.

図4は、本発明の第2の実施形態による動きベクトル検出部23の一例の構成を示す。なお、図4において、上述の図2と共通する部分には同一の符号を付し、詳細な説明を省略する。   FIG. 4 shows an exemplary configuration of a motion vector detection unit 23 according to the second embodiment of the present invention. In FIG. 4, the same reference numerals are given to portions common to FIG. 2 described above, and detailed description thereof is omitted.

第1の動きベクトル検出手段としての第1ステージME部202は、フレーム構造での大域サーチを行う。すなわち、第1ステージME部202は、メモリ107から参照画像としての再構成画像データを読み出す。また、第1ステージME部202は、メモリ107から読み出した、マクロブロックペアの上側のマクロブロックと下側のマクロブロックのそれぞれについて、例えば1乃至数画素ステップで動きベクトルの探索を行い、動きベクトルの検出を行う。   The first stage ME unit 202 as the first motion vector detection means performs a global search with a frame structure. That is, the first stage ME unit 202 reads reconstructed image data as a reference image from the memory 107. Further, the first stage ME unit 202 searches for a motion vector, for example, in one to several pixel steps, for each of the upper macroblock and the lower macroblock of the macroblock pair read out from the memory 107, and the motion vector Detection is performed.

差分値評価部108は、第1ステージME部202で検出された動きベクトルの評価を行う。すなわち、差分値評価部108は、第1ステージME部202において動きベクトルの検出過程で算出された、符号化対象の画像データと、参照画像データとの差分絶対値和Sを、上述した数式(1)を用いて求める。そして、求められた差分絶対値和Sの逆数を取った確からしさを示す値Pと、実験的に求めた閾値Tとを比較することで、差分絶対値和Sを評価し、下記の制御を行う。 The difference value evaluation unit 108 evaluates the motion vector detected by the first stage ME unit 202. That is, the difference value evaluation unit 108 calculates the difference absolute value sum S between the image data to be encoded and the reference image data, calculated in the motion vector detection process in the first stage ME unit 202, by the above-described mathematical formula ( Obtained using 1). Then, by comparing the value P indicating the likelihood that took the inverse of the difference absolute value sum S obtained with a threshold value T 2 determined experimentally, and evaluate the difference absolute value sum S, the following control I do.

(a) P>Tのとき:フィールド構造での動きベクトル検出を行わない。
(b) P≦Tのとき:第2ステージ以降は、フレーム構造およびフィールド構造での動きベクトル検出を併用する。
(a) When P> T 2 : The motion vector is not detected in the field structure.
(b) When P ≦ T 2 : After the second stage, motion vector detection in the frame structure and field structure is used together.

すなわち、P>Tのときは、フレーム構造での動きベクトルの検出を行う第1ステージME部202による検出結果の精度が十分と判断する。そして、以降、第2ステージME部105および第2ステージME部106により、そのまま、フレーム構造での動きベクトル検出を行う。 That is, when the P> T 2, the detection result of the accuracy of the first stage ME unit 202 for detecting a motion vector in the frame structure is determined to sufficiently. Thereafter, the second stage ME unit 105 and the second stage ME unit 106 perform motion vector detection with the frame structure as it is.

一方、P≦Tのときは、符号化対象のマクロブロックが、フレーム構造での動きベクトル検出に適していない可能性があると判断する。この場合、第2ステージME部105および第3ステージME部106で、フレーム構造での動きベクトル検出を行うと共に、第2ステージME部102および第3ステージME部103でのフィールド構造での動きベクトル検出も行う。 On the other hand, when the P ≦ T 2, the macroblock to be coded is determined that there may not be suitable for the motion vector detection in frame structure. In this case, the second stage ME unit 105 and the third stage ME unit 106 perform motion vector detection in the frame structure, and the motion vector in the field structure in the second stage ME unit 102 and the third stage ME unit 103. Detection is also performed.

すなわち、本第2の実施形態は、符号化対象となる画像に、より動きが少ない場合に有効であると考えられる。   That is, the second embodiment is considered effective when there is less motion in the image to be encoded.

このように、本第2の実施形態では、フレーム構造のマクロブロックペアに対する動きベクトル検出は、常時、第1ステージME部202、第2ステージME部105および第3ステージME部106の全てで行う。そして、フレームモードにおける第1ステージME部202での動きベクトル検出結果に応じて、フィールド構造のマクロブロックペアに対する動きベクトル検出を、第2ステージME部102および第3ステージME部103においてさらに行うか否かを決定する。この第2ステージME部102および第3ステージME部103に対する動きベクトル検出の実行制御は、差分値評価部108の上述した評価結果に基づき、適応的フィールド構造ME実行制御部200において行われる。   Thus, in the second embodiment, motion vector detection for a macroblock pair having a frame structure is always performed by all of the first stage ME unit 202, the second stage ME unit 105, and the third stage ME unit 106. . Whether the second stage ME unit 102 and the third stage ME unit 103 further perform motion vector detection for the macroblock pair having the field structure in accordance with the motion vector detection result in the first stage ME unit 202 in the frame mode. Decide whether or not. The execution control of motion vector detection for the second stage ME unit 102 and the third stage ME unit 103 is performed in the adaptive field structure ME execution control unit 200 based on the above-described evaluation result of the difference value evaluation unit 108.

動きベクトル補正手段としての動きベクトル補正部201は、数式(7)および(8)に示されるように、フレーム構造のマクロブロックについて第1ステージME部202で検出された動きベクトルに対して、垂直成分のみ1/2倍にする補正を行う。なお、数式(7)および(8)において、ベクトル(FRx,FRy)は、フレーム構造のマクロブロックペアのマクロブロックに対して第1ステージME部202で検出された動きベクトルである。また、ベクトル(FIx,FIy)は、フィールド構造のマクロブックペアのマクロブロックに対して第2ステージME部102が探索範囲を設定するための初期ベクトルである。   The motion vector correction unit 201 as a motion vector correction unit is perpendicular to the motion vector detected by the first stage ME unit 202 for the macroblock of the frame structure, as shown in equations (7) and (8). Only the component is corrected to 1/2. In equations (7) and (8), the vector (FRx, FRy) is a motion vector detected by the first stage ME unit 202 with respect to the macroblock of the macroblock pair having the frame structure. Further, the vector (FIx, FIy) is an initial vector for the second stage ME unit 102 to set a search range for the macroblock of the field-structured macrobook pair.

FIx=FRx ・・・(7)
FIy=FRy/2 ・・・(8)
FIx = FRx (7)
FIy = FRy / 2 (8)

なお、値FIyは、値FRyを2で除することで求めているため、小数点以下の端数を持った値となることがある。大域サーチにより得られたベクトル(FRx,FRy)は、大雑把なベクトル値であって、特に正確さを要求されない。そのため、FRyの除算後の丸め処理については、切り捨てあるいは四捨五入など、方法を問わない。   Since the value FIy is obtained by dividing the value FRy by 2, it may be a value having a fraction after the decimal point. The vector (FRx, FRy) obtained by the global search is a rough vector value and is not particularly required to be accurate. Therefore, the rounding process after the division of FRy may be any method such as truncation or rounding off.

<第3の実施形態>
次に、本発明の第3の実施形態について説明する。本第3の実施形態は、上述した第1の実施形態による動きベクトル検出と、第2の実施形態による動きベクトル検出との何方を実行するか、予めフレーム単位で決定するための機能を備えている。図5は、本発明の第3の実施形態による動きベクトル検出部23の一例の構成を示す。なお、図5において、上述した図2および図4と共通する部分には同一の符号を付し、詳細な説明を省略する。
<Third Embodiment>
Next, a third embodiment of the present invention will be described. The third embodiment has a function for determining in advance in frame units which one of the motion vector detection according to the first embodiment and the motion vector detection according to the second embodiment is to be executed. Yes. FIG. 5 shows an exemplary configuration of the motion vector detection unit 23 according to the third embodiment of the present invention. In FIG. 5, the same reference numerals are given to the portions common to FIGS. 2 and 4 described above, and detailed description thereof is omitted.

図5において、グローバルベクトル探索手段としてのグローバルベクトル探索部300は、時間的に隣接するフレームまたはフィールド間で、フレームまたはフィールド全体での動き量を推定する。このフレームまたはフィールド全体での動き量の推定方法は、様々な方法が提案および実用化されている。一例として、時間的に隣接するフレームまたはフィールド間で、位置が対応するライン同士を比較することで、フレームまたはフィールド全体の動きを推定することが考えられる。この方法では、画面内の左右方向の動きを推定することができる。一般的に、このような、フレームまたはフィールド全体の動きを推定する目的で検出されたベクトルを、グローバルベクトルと呼ぶ。   In FIG. 5, a global vector search unit 300 as a global vector search means estimates a motion amount in a frame or field as a whole between temporally adjacent frames or fields. Various methods have been proposed and put to practical use for estimating the amount of motion in the entire frame or field. As an example, it is conceivable to estimate the motion of an entire frame or field by comparing lines corresponding in position between temporally adjacent frames or fields. In this method, it is possible to estimate the horizontal movement in the screen. In general, such a vector detected for the purpose of estimating the motion of the entire frame or field is called a global vector.

グローバルベクトル探索部300は、例えば、フレームメモリ10に格納されたフレームと、フレームメモリ10に入力されるフレームとが入力され、対応するラインを順次比較して、グローバルベクトル(VGx,VGy)を求める。これに限らず、例えば符号化装置1が搭載される画像処理装置において、表示パネルに動画像データを出力する際に行われる、インタレース/プログレッシブ変換(I/P変換)を利用して、グローバルベクトルを求めることもできる。   For example, the global vector search unit 300 receives a frame stored in the frame memory 10 and a frame input to the frame memory 10 and sequentially compares corresponding lines to obtain a global vector (VGx, VGy). . However, the present invention is not limited to this. For example, in an image processing apparatus in which the encoding apparatus 1 is mounted, the interlace / progressive conversion (I / P conversion) that is performed when moving image data is output to the display panel is used. You can also find a vector.

本第3の実施形態では、このグローバルベクトル(VGx,VGy)の値を評価して、上述した第1の実施形態による動きベクトル検出と、第2の実施形態による動きベクトル検出との何方を実行するかを判定する。具体的には、グローバルベクトルの水平成分であるベクトルVGxと、実験的に求めた閾値VTxとを比較することで、下記の制御を行う。   In the third embodiment, the value of the global vector (VGx, VGy) is evaluated, and either the motion vector detection according to the first embodiment described above or the motion vector detection according to the second embodiment is executed. Judge whether to do. Specifically, the following control is performed by comparing the vector VGx, which is the horizontal component of the global vector, with the threshold value VTx obtained experimentally.

(a) VGx>VTxのとき:第1の実施形態による動きベクトル検出を行う。
(b) VGx≦VTxのとき:第2の実施形態による動きベクトル検出を行う。
(a) When VGx> VTx: Motion vector detection according to the first embodiment is performed.
(b) When VGx ≦ VTx: Motion vector detection according to the second embodiment is performed.

これによれば、画像データにおいて水平方向の動きが一定以上あり、グローバルベクトルによる水平方向の動きベクトルが閾値VTxを越えたときに、フィールド構造での動き探索を優先的に処理する。一方、画像データにおいて水平方向の動きが少なく、グローバルベクトルによる水平方向の動きベクトルが閾値VTx以下のときに、フレーム構造での動き探索を優先的に処理する。   According to this, when the horizontal motion in the image data is above a certain level and the horizontal motion vector by the global vector exceeds the threshold value VTx, the motion search in the field structure is preferentially processed. On the other hand, when the horizontal motion in the image data is small and the horizontal motion vector based on the global vector is less than or equal to the threshold value VTx, the motion search in the frame structure is preferentially processed.

なお、グローバルベクトルは、必ずしも1フレームに対して1つではなく、例えばフレーム内を所定に分割した広域エリア毎に検出するようにもできる。この場合、当該広域エリア毎に、同様な判定を行うことができる。   Note that the global vector is not necessarily one for each frame, and for example, it can be detected for each wide area divided into a predetermined frame. In this case, the same determination can be performed for each wide area.

グローバルベクトル探索部300による判定結果は、第1ステージME部303に供給される。第1ステージME部303は、大域サーチによる動きベクトル検出を、マクロブロックペアの構造をフレーム構造とフィールド構造で切り替えて実行可能に構成される。第1ステージME部303は、グローバルベクトル探索部300から供給された判定結果に応じて、動きベクトルの検出をフィールド構造およびフレーム構造のうち何れを用いて行うかを決定する。   The determination result by the global vector search unit 300 is supplied to the first stage ME unit 303. First stage ME unit 303 is configured to be able to execute motion vector detection by global search by switching the structure of a macroblock pair between a frame structure and a field structure. The first stage ME unit 303 determines which of the field structure and the frame structure is used for motion vector detection according to the determination result supplied from the global vector search unit 300.

動きベクトルの検出をフレーム構造のマクロブックペアに対して行う場合、メモリ107から読み出した符号化対象のマクロブロックペアの上下2つのマクロブロックに対して、それぞれ動きベクトルの検出を行う。一方、動きベクトルの検出をフィールド構造のマクロブックペアに対して行う場合、メモリ107から読み出した符号化対象のマクロブロックペアから、トップフィールドおよびボトムフィールドのマクロブロックをそれぞれ形成する。そして、トップフィールドおよびボトムフィールドそれぞれのマクロブロックに対して動きベクトル検出を行う。   When motion vector detection is performed on a frame-structured macrobook pair, motion vector detection is performed on each of the upper and lower macroblocks of the encoding target macroblock pair read from the memory 107. On the other hand, when motion vector detection is performed on a field-structured macrobook pair, top-field and bottom-field macroblocks are formed from the macroblock pair to be encoded read from the memory 107, respectively. Then, motion vector detection is performed for each macroblock of the top field and the bottom field.

適応的ME実行制御部301は、図4における差分値評価部108と適応的フィールド構造ME実行制御部200とを含む。すなわち、適応的ME実行制御部301は、第1ステージME部303においてフレーム構造での動きベクトル検出を行った場合、当該動きベクトルの検出過程で算出された差分絶対値和Sと閾値Tとを比較する。比較結果に応じて、第2ステージ以降、フレーム構造での動きベクトル検出のみを行うか、フレーム構造およびフィールド構造での動きベクトル検出を併用して行うかを判定する。 Adaptive ME execution control unit 301 includes difference value evaluation unit 108 and adaptive field structure ME execution control unit 200 in FIG. 4. That is, adaptive ME execution control unit 301, when performing motion vector detection in frame structure in the first stage ME section 303, a difference absolute value sum S calculated by the process of detecting the motion vector and the threshold T 2 Compare In accordance with the comparison result, it is determined whether the motion vector detection only in the frame structure is performed after the second stage or the motion vector detection in the frame structure and the field structure is performed in combination.

そして、判定結果に基づき、第2ステージME部102および第3ステージME部103による動きベクトル検出の実行制御を行う。フレーム構造およびフィールド構造での動きベクトル検出を併用して行う場合、第1ステージME部303で検出された、フレーム構造のマクロブロックペアに対する動きベクトルが、第2ステージME部105に供給される。   Based on the determination result, execution control of motion vector detection by the second stage ME unit 102 and the third stage ME unit 103 is performed. When the motion vector detection in the frame structure and the field structure is performed in combination, the motion vector for the macroblock pair in the frame structure detected by the first stage ME unit 303 is supplied to the second stage ME unit 105.

適応的ME実行制御部302も、上述の適応的ME実行制御部301と同様である。すなわち、適応的ME実行制御部302は、差分値評価部108と、図2における適応的フレーム構造ME実行制御部109とを含む。すなわち、適応的ME実行制御部302は、第1ステージME部303においてフィールド構造での動きベクトル検出を行った場合、当該動きベクトルの検出過程で算出された差分絶対値和Sと閾値Tとを比較する。比較結果に応じて、第2ステージ以降、フィールド構造での動きベクトル検出のみを行うか、フレーム構造およびフィールド構造での動きベクトル検出を併用して行うかを判定する。 The adaptive ME execution control unit 302 is the same as the adaptive ME execution control unit 301 described above. That is, adaptive ME execution control unit 302 includes difference value evaluation unit 108 and adaptive frame structure ME execution control unit 109 in FIG. That is, adaptive ME execution control unit 302, when performing motion vector detection in field structure in the first stage ME section 303, a difference absolute value sum S calculated by the process of detecting the motion vector and the thresholds T 1 Compare In accordance with the comparison result, it is determined whether the motion vector detection only in the field structure is performed after the second stage or the motion vector detection in the frame structure and the field structure is performed in combination.

そして、判定結果に基づき、第2ステージME部105および第3ステージME部106による動きベクトル検出の実行制御を行う。フレーム構造およびフィールド構造での動きベクトル検出を併用して行う場合、第1ステージME部303で検出された、フィールド構造のマクロブックペアに対する動きベクトルが、第2ステージME部105に供給される。   Based on the determination result, execution control of motion vector detection by the second stage ME unit 105 and the third stage ME unit 106 is performed. When the motion vector detection in the frame structure and the field structure is performed in combination, the motion vector for the field structure macro book pair detected by the first stage ME unit 303 is supplied to the second stage ME unit 105.

図6は、本第3の実施形態による一例の処理を示すフローチャートである。符号化対象の1フレーム分の画像データが符号化装置1に入力されると、ステップS300で、グローバルベクトル探索部300によりグローバルベクトルVGが検出される。そして、次のステップS301で、グローバルベクトルの水平成分VGxと閾値VTxとが比較される。比較の結果、グローバルベクトルの水平成分VGxが閾値VTxを越えていると判断されれば、処理はステップS302に移行される。   FIG. 6 is a flowchart showing an example of processing according to the third embodiment. When image data for one frame to be encoded is input to the encoding apparatus 1, the global vector search unit 300 detects the global vector VG in step S300. Then, in the next step S301, the horizontal component VGx of the global vector and the threshold value VTx are compared. As a result of the comparison, if it is determined that the horizontal component VGx of the global vector exceeds the threshold value VTx, the process proceeds to step S302.

ステップS302では、第1ステージME部303において、フィールド構造のマクロブロックペアに対して、大域サーチによる動きベクトル検出が行われる。そして、次のステップS3303で、適応的ME実行制御部302において、第1ステージME部303による動きベクトルの検出過程で算出された差分絶対値和の逆数Pと閾値Tとが比較される。比較の結果、値Pが閾値Tより大きいと判断されたら、処理はステップS304およびステップS307に移行され、フィールド構造およびフレーム構造のマクロブロックペアを併用して、動きベクトルの検出を行う。 In step S302, the first stage ME unit 303 performs motion vector detection by a global search for a field-structured macroblock pair. In the next step S3303, the adaptive ME execution control unit 302, the inverse P and the threshold T 1 of the sum of absolute differences calculated by the process of detecting a motion vector by the first stage ME 303 are compared. As a result of the comparison, when the value P is determined to be larger than the threshold value T 1, the process proceeds to step S304 and step S307, a combination of macroblock pair of a field structure and a frame structure, to detect the motion vector.

ステップS304〜ステップS306の処理と、ステップS307およびステップS308の処理とは、並列的に実行することが可能である。ステップS304で、動きベクトル補正部104において、上述した数式(2)および数式(3)により、第1ステージME部303で検出されたフィールド構造による動きベクトルが補正されて、フレーム構造による動きベクトルとされる。そして、次のステップS305で、ステップS304で補正された動きベクトルに基づき、第2ステージME部105でフレーム構造での1画素精度サーチが行われる。そして、ステップS306で、ステップS305で検出された動きベクトルに基づき、第3ステージME部106でフレーム構造での1/4画素精度サーチが行われる。   The processes in steps S304 to S306 and the processes in steps S307 and S308 can be executed in parallel. In step S304, the motion vector correction unit 104 corrects the motion vector based on the field structure detected by the first stage ME unit 303 by the above-described mathematical formulas (2) and (3), and Is done. In the next step S305, based on the motion vector corrected in step S304, the second stage ME unit 105 performs a one-pixel accuracy search in the frame structure. In step S306, based on the motion vector detected in step S305, the third stage ME unit 106 performs a 1/4 pixel accuracy search in the frame structure.

一方、ステップS307では、第1ステージME部303で検出された動きベクトルに基づき、第2ステージME部102でフィールド構造での1画素精度サーチが行われる。そして、次のステップS308で、ステップS307で検出された動きベクトルに基づき、第3ステージME部103でフィールド構造での1/4画素精度サーチが行われる。   On the other hand, in step S307, based on the motion vector detected by the first stage ME unit 303, the second stage ME unit 102 performs a one-pixel accuracy search in the field structure. In the next step S308, based on the motion vector detected in step S307, the third stage ME unit 103 performs a 1/4 pixel accuracy search in the field structure.

ステップS306の処理およびステップS308の処理が終了すると、処理はステップS309に移行される。ステップS309では、モード判定部110により、ステップS306で動きベクトルを検出する過程の差分絶対値和Srと、ステップS308で動きベクトルを検出する過程の差分絶対値和Siとを比較して、マクロブロックペアの構造を決定する。そして、ステップS330で、差分絶対値和SrおよびSiと、閾値Ithとを比較して、マクロブロックモードを選択する。 When the process of step S306 and the process of step S308 are completed, the process proceeds to step S309. In step S309, the mode determination unit 110 compares the difference absolute value sum Sr in the process of detecting the motion vector in step S306 with the difference absolute value sum Si in the process of detecting the motion vector in step S308, and the macroblock Determine the structure of the pair. Then, at step S330, it compares the absolute value sum Sr and Si difference with a threshold value I th, selects the macroblock mode.

一方、上述のステップS303において、値Pと閾値Tとの比較の結果、差分絶対値和Sの逆数Pが閾値T以下だと判断されたら、処理はステップS310に移行され、フィールド構造のマクロブロックペアに対する動きベクトルの検出のみが行われる。ステップS310では、第2ステージME部102により、第1ステージME部303で検出された動きベクトルに基づき、フィールド構造での1画素精度サーチが行われる。そして、次のステップS311で、第3ステージME部103により、第2ステージME部102で検出された動きベクトルに基づき、フィールド構造での1/4画素精度サーチが行われる。 On the other hand, in step S303 described above, the result of the comparison between the value P and the thresholds T 1, When the inverse P of the difference absolute value sum S is determined that it thresholds T 1 or less, the process proceeds to step S310, the field structure Only the motion vector detection for the macroblock pair is performed. In step S310, the second stage ME unit 102 performs a one-pixel accuracy search in the field structure based on the motion vector detected by the first stage ME unit 303. In the next step S311, the third stage ME unit 103 performs a 1/4 pixel accuracy search in the field structure based on the motion vector detected by the second stage ME unit 102.

この場合は、フィールド構造のマクロブロックペアに対する動きベクトルの検出のみが行われているので、モード判定部110によるマクロブロックペアの構造の判定は行われない。処理はステップS331に移行され、モード判定部110により、マクロブロックモードが選択される。ここでは、ステップS311で動きベクトルを検出する過程の差分絶対値和Siと閾値Ithとを比較して、マクロブロックモードの選択を行う。 In this case, since only the motion vector is detected for the macroblock pair having the field structure, the mode determination unit 110 does not determine the structure of the macroblock pair. The processing moves to step S331, and the macro block mode is selected by the mode determination unit 110. Here, by comparing the sum of absolute differences Si and the threshold I th the process of detecting a motion vector at step S311, selects a macroblock mode.

上述したステップS301で、グローバルベクトルの水平成分VGxと閾値VTxとの比較の結果、グローバルベクトルの水平成分VGxが閾値VTx以下だと判断されたら、処理はステップS320に移行される。   If it is determined in step S301 described above that the horizontal component VGx of the global vector is equal to or smaller than the threshold value VTx as a result of the comparison between the horizontal component VGx of the global vector and the threshold value VTx, the process proceeds to step S320.

ステップS320では、第1ステージME部303において、フレーム構造のマクロブロックペアに対して大域サーチによる動きベクトル検出が行われる。そして、次のステップS321で、適応的ME実行制御部301において、第1ステージME部303による動きベクトルの検出過程で算出された差分絶対値和Sの逆数Pと閾値Tとが比較される。比較の結果、値Pが閾値Tより大きいと判断されたら、処理はステップS326およびステップS324に移行され、フィールド構造およびフレーム構造のマクロブロックペアを併用して、動きベクトルの検出を行う。 In step S320, the first stage ME unit 303 performs motion vector detection by a global search for a macroblock pair having a frame structure. Then, at the next step S321, the adaptive ME execution control unit 301, the inverse P and the threshold T 2 of the first stage ME unit 303 according to the detection process by the differential absolute value sum S calculated by the motion vectors are compared . As a result of the comparison, when the value P is determined to be larger than the threshold value T 2, the process proceeds to step S326 and step S324, a combination of macroblock pair of a field structure and a frame structure, to detect the motion vector.

ステップS326〜ステップS328の処理と、ステップS324およびステップS325の処理とは、並列的に実行することが可能である。ステップS326で、動きベクトル補正部201において、上述した数式(7)および数式(8)により、第1ステージME部303で検出されたフレーム構造による動きベクトルが補正されて、フィールド構造による動きベクトルとされる。そして、次のステップS327で、ステップS326で補正された動きベクトルに基づき、第2ステージME部102でフィールド構造での1画素精度サーチが行われる。そして、ステップS328で、ステップS327で検出された動きベクトルに基づき、第3ステージME部103でフィールド構造での1/4画素精度サーチが行われる。   The processes in steps S326 to S328 and the processes in steps S324 and S325 can be executed in parallel. In step S326, the motion vector correction unit 201 corrects the motion vector based on the frame structure detected by the first stage ME unit 303 by the above-described mathematical expressions (7) and (8). Is done. In the next step S327, based on the motion vector corrected in step S326, the second stage ME unit 102 performs a one-pixel accuracy search in the field structure. In step S328, a 1/4 pixel accuracy search in the field structure is performed in the third stage ME unit 103 based on the motion vector detected in step S327.

一方、ステップS324では、第1ステージME部303で検出された動きベクトルに基づき、第2ステージME部105でフレームド構造での1画素精度サーチが行われる。そして、次のステップS325で、ステップS324で検出された動きベクトルに基づき、第3ステージME部106でフレーム構造での1/4画素精度サーチが行われる。   On the other hand, in step S324, based on the motion vector detected by the first stage ME unit 303, the second stage ME unit 105 performs a one-pixel accuracy search in the framed structure. Then, in the next step S325, based on the motion vector detected in step S324, the third stage ME unit 106 performs a 1/4 pixel accuracy search in the frame structure.

ステップS328の処理およびステップS325の処理が終了すると、処理はステップS329に移行される。ステップS329では、モード判定部110により、ステップS325で動きベクトルを検出する過程の差分絶対値和Srと、ステップS328で動きベクトルを検出する過程の差分絶対値和Siとを比較して、マクロブロックペアの構造を決定する。そして、ステップS333で、差分絶対値和SrおよびSiと、閾値Ithとを比較して、マクロブロックモードを選択する。 When the process of step S328 and the process of step S325 are completed, the process proceeds to step S329. In step S329, the mode determination unit 110 compares the difference absolute value sum Sr in the process of detecting the motion vector in step S325 with the difference absolute value sum Si in the process of detecting the motion vector in step S328, and the macroblock Determine the structure of the pair. Then, at step S333, it compares the absolute value sum Sr and Si difference with a threshold value I th, selects the macroblock mode.

一方、上述のステップS321において、差分絶対値和Sの逆数Pと閾値Tとの比較の結果、値Pが閾値T以下だったら、処理はステップS322に移行され、フレーム構造のマクロブロックペアに対する動きベクトルの検出のみが行われる。ステップS322では、第2ステージME部105により、第1ステージME部303で検出された動きベクトルに基づき、フレーム構造での1画素精度サーチが行われる。そして、次のステップS323で、第3ステージME部106により、第2ステージME部105で検出された動きベクトルに基づき、フレーム構造での1/4画素精度サーチが行われる。 On the other hand, if the value P is equal to or smaller than the threshold T 2 as a result of the comparison between the reciprocal P of the difference absolute value sum S and the threshold T 2 in step S321 described above, the process proceeds to step S322, and the macroblock pair having the frame structure Only motion vectors are detected for. In step S322, the second stage ME unit 105 performs a one-pixel accuracy search in the frame structure based on the motion vector detected by the first stage ME unit 303. In the next step S323, the third stage ME unit 106 performs a 1/4 pixel accuracy search in the frame structure based on the motion vector detected by the second stage ME unit 105.

この場合は、フレーム構造のマクロブロックペアに対する動きベクトル検出のみが行われているため、モード判定部110によるマクロブロックペアの構造の判定は行われない。処理はステップS332に移行され、モード判定部110により、マクロブロックモードが選択される。ここでは、ステップS323で動きベクトルを検出する過程の差分絶対値和Srと閾値Ithとを比較して、マクロブロックモードの選択を行う。 In this case, since only motion vector detection is performed on the macroblock pair having the frame structure, the mode determination unit 110 does not determine the structure of the macroblock pair. The process proceeds to step S332, and the macro block mode is selected by the mode determination unit 110. Here, by comparing the sum of absolute differences Sr and the threshold I th the process of detecting a motion vector at step S323, selects a macroblock mode.

このように、本発明の第3の実施形態では、フレーム構造およびフィールド構造のマクロブロックペアの何方に対する動きベクトル検出を優先して行うかを、グローバルベクトルに基づき、適応的に制御することができる。そのため、画像の全体的な動きに応じてマクロブロックペアの構造を適切に設定することが可能となり、符号化効率を向上させることができる。また、メモリアクセス量が多い大域サーチを行う第1ステージの動きベクトル検出部が1つのみで済むため、ステップサーチ法を用い、MBAFFに対応した動きベクトル検出装置を、より小規模なハードウェア構成で実現することができる。   As described above, in the third embodiment of the present invention, it is possible to adaptively control which of the macroblock pairs of the frame structure and the field structure is to be prioritized based on the global vector. . Therefore, the structure of the macroblock pair can be appropriately set according to the overall motion of the image, and the encoding efficiency can be improved. In addition, since only one first stage motion vector detection unit that performs a global search with a large memory access amount is required, a motion vector detection device corresponding to MBAFF using a step search method can be realized with a smaller hardware configuration. Can be realized.

なお、上述した各実施形態では、ステップサーチ法により、大域サーチ、1画素精度サーチおよび1/4画素精度サーチの3ステージにより、3ステップで動き探索を行っているが、これはこの例に限定されない。すなわち、本発明は、段階的に探索精度を上げると共に探索範囲を狭めて動き探索を行う処理を、N(ただしNは2以上の整数)ステップに拡張しN段階で行うようにできる。例えば、探索精度が最も低く、且つ、探索範囲が最も広い1段階目の動き探索から、段階毎に、探索精度を高めると共に探索範囲を狭めて、動き探索を順次行う。N段階目で検出された動きベクトルが最終的な動きベクトルとされる。   In each of the above-described embodiments, the motion search is performed in three steps by the three steps of the global search, the one-pixel accuracy search, and the quarter-pixel accuracy search by the step search method, but this is limited to this example. Not. That is, according to the present invention, the process of increasing the search accuracy stepwise and narrowing the search range and performing a motion search can be extended to N (where N is an integer of 2 or more) steps and performed in N steps. For example, from the first-stage motion search with the lowest search accuracy and the widest search range, the search is sequentially performed by increasing the search accuracy and narrowing the search range for each step. The motion vector detected in the Nth stage is the final motion vector.

また、上述した各実施例では、大域サーチを行う第1ステージをフィールド構造またはフレーム構造の何れかに対してのみ行うようにしていた。そして、その結果に基づき、第2ステージ以降を、フィールド構造での動きベクトル検出とフレーム構造での動きベクトル検出とを併用して行うか否かを判断していた。これはこの例に限らず、探索精度が粗く且つ探索範囲が広い方い第1ステージから第Mステージ(ただしM<N)までを、フィールド構造またはフレーム構造の何れかに対してのみ行うようにもできる。この場合、第Mステージの動きベクトル検出結果に基づき、第(M+1)ステージ以降をフィールド構造での動きベクトル検出とフレーム構造での動きベクトル検出とを併用して行うか否かを判断することになる。   In each of the above-described embodiments, the first stage for performing the global search is performed only for either the field structure or the frame structure. Then, based on the result, it is determined whether or not to perform the second stage and later using both the motion vector detection in the field structure and the motion vector detection in the frame structure. This is not limited to this example, and the first stage to the Mth stage (where M <N) having a coarse search accuracy and a wide search range are performed only for either the field structure or the frame structure. You can also. In this case, based on the motion vector detection result of the Mth stage, it is determined whether or not to perform the (M + 1) th stage and later using both the motion vector detection in the field structure and the motion vector detection in the frame structure. Become.

<他の実施形態>
上述の各実施形態は、システム或は装置のコンピュータ(或いはCPU、MPU等)によりソフトウェア的に実現することも可能である。
<Other embodiments>
Each of the above-described embodiments can be realized by software by a computer of a system or apparatus (or CPU, MPU, etc.).

従って、上述の各実施形態をコンピュータで実現するために、該コンピュータに供給されるコンピュータプログラム自体も本発明を実現するものである。つまり、上述の各実施形態の機能を実現するためのコンピュータプログラム自体も本発明の一つである。   Accordingly, the computer program itself supplied to the computer in order to realize the above-described embodiments by the computer also realizes the present invention. That is, the computer program itself for realizing the functions of the above-described embodiments is also one aspect of the present invention.

なお、上述の各実施形態を実現するためのコンピュータプログラムは、コンピュータで読み取り可能であれば、どのような形態であってもよい。例えば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等で構成することができるが、これらに限るものではない。   Note that the computer program for realizing each of the above-described embodiments may be in any form as long as it can be read by a computer. For example, it can be composed of object code, a program executed by an interpreter, script data supplied to the OS, but is not limited thereto.

上述の各実施形態を実現するためのコンピュータプログラムは、記憶媒体又は有線/無線通信によりコンピュータに供給される。プログラムを供給するための記憶媒体としては、例えば、フレキシブルディスク、ハードディスク、磁気テープ等の磁気記憶媒体、MO、CD、DVD等の光/光磁気記憶媒体、不揮発性の半導体メモリなどがある。   The computer program for realizing each of the above-described embodiments is supplied to the computer via a storage medium or wired / wireless communication. Examples of the storage medium for supplying the program include a magnetic storage medium such as a flexible disk, a hard disk, and a magnetic tape, an optical / magneto-optical storage medium such as an MO, CD, and DVD, and a nonvolatile semiconductor memory.

有線/無線通信を用いたコンピュータプログラムの供給方法としては、コンピュータネットワーク上のサーバを利用する方法がある。この場合、本発明を形成するコンピュータプログラムとなりうるデータファイル(プログラムファイル)をサーバに記憶しておく。プログラムファイルとしては、実行形式のものであっても、ソースコードであっても良い。   As a computer program supply method using wired / wireless communication, there is a method of using a server on a computer network. In this case, a data file (program file) that can be a computer program forming the present invention is stored in the server. The program file may be an executable format or a source code.

そして、このサーバにアクセスしたクライアントコンピュータに、プログラムファイルをダウンロードすることによって供給する。この場合、プログラムファイルを複数のセグメントファイルに分割し、セグメントファイルを異なるサーバに分散して配置することも可能である。   The program file is supplied by downloading to a client computer that has accessed the server. In this case, the program file can be divided into a plurality of segment files, and the segment files can be distributed and arranged on different servers.

つまり、上述の各実施形態を実現するためのプログラムファイルをクライアントコンピュータに提供するサーバ装置も本発明の一つである。   That is, a server apparatus that provides a client computer with a program file for realizing each of the above-described embodiments is also one aspect of the present invention.

また、上述の各実施形態を実現するためのコンピュータプログラムを暗号化して格納した記憶媒体を配布し、所定の条件を満たしたユーザに、暗号化を解く鍵情報を供給し、ユーザの有するコンピュータへのインストールを許可してもよい。鍵情報は、例えばインターネットを介してホームページからダウンロードさせることによって供給することができる。   In addition, a storage medium that encrypts and stores a computer program for realizing each of the above-described embodiments is distributed, and key information for decryption is supplied to a user who satisfies a predetermined condition, and the computer has the computer. May be allowed to install. The key information can be supplied by being downloaded from a homepage via the Internet, for example.

また、上述の各実施形態を実現するためのコンピュータプログラムは、すでにコンピュータ上で稼働するOSの機能を利用するものであってもよい。   In addition, the computer program for realizing each of the above-described embodiments may use an OS function already running on the computer.

さらに、上述の各実施形態を実現するためのコンピュータプログラムは、その一部をコンピュータに装着される拡張ボード等のファームウェアで構成してもよいし、拡張ボード等が備えるCPUで実行するようにしてもよい。   Further, a part of the computer program for realizing each of the above embodiments may be configured by firmware such as an expansion board mounted on the computer, or may be executed by a CPU provided in the expansion board. Also good.

本発明に適用可能な符号化装置の一例の構成を示すブロック図である。It is a block diagram which shows the structure of an example of the encoding apparatus applicable to this invention. 本発明の第1の実施形態による動きベクトル検出部の一例の構成を示すブロック図である。It is a block diagram which shows the structure of an example of the motion vector detection part by the 1st Embodiment of this invention. 動きベクトル検出において参照画像データを格納しているメモリに対する、従来技術によるメモリアクセス量と、本発明を適用した場合のメモリアクセス量とを比較して示す略線図である。FIG. 5 is a schematic diagram showing a comparison between a memory access amount according to a conventional technique and a memory access amount when the present invention is applied to a memory storing reference image data in motion vector detection. 本発明の第2の実施形態による動きベクトル検出部の一例の構成を示すブロック図である。It is a block diagram which shows the structure of an example of the motion vector detection part by the 2nd Embodiment of this invention. 本発明の第3の実施形態による動きベクトル検出部の一例の構成を示すブロック図である。It is a block diagram which shows the structure of an example of the motion vector detection part by the 3rd Embodiment of this invention. 本第3の実施形態による一例の処理を示すフローチャートである。It is a flowchart which shows an example of processing by the 3rd Embodiment. マクロブロックペアの構造を概略的に示す略線図である。It is a basic diagram which shows the structure of a macroblock pair roughly. 動きのある部分と無い部分とが混在した映像の例を示す略線図である。It is a basic diagram which shows the example of the image | video in which the part with a motion and the part which does not exist are mixed. MBAFFにより、1画面にフレーム構造のマクロブロックペアとフィールド構造のマクロブロックペアとを混在させた例を示す略線図である。It is a basic diagram which shows the example which mixed the macroblock pair of the frame structure and the macroblock pair of the field structure on one screen by MBAFF. ステップサーチ法を用いて動きベクトル探索を行う例を概略的に示す略線図である。It is a basic diagram which shows roughly the example which performs a motion vector search using the step search method. 3ステップのステップサーチを実現するための、従来技術による動きベクトル検出装置の一例の構成を示すブロック図である。It is a block diagram which shows the structure of an example of the motion vector detection apparatus by a prior art for implement | achieving step search of 3 steps. MBAFFをステップサーチ法に適用した場合の、従来技術による動きベクトル検出装置の一例の構成を示すブロック図である。It is a block diagram which shows the structure of an example of the motion vector detection apparatus by a prior art at the time of applying MBAFF to a step search method.

符号の説明Explanation of symbols

1 符号化装置
10 フレームメモリ
20 デブロッキングフィルタ
21 フレームメモリ
22 インター予測部
23 動きベクトル検出部
101 第1ステージME部
102 第2ステージME部
103 第3ステージME部
104 動きベクトル補正部
105 第2ステージME部
106 第3ステージME部
107 フレームまたはフィールドメモリ
108 差分値評価部
109,302 適応的フレーム構造ME実行制御部
110 モード判定部
200,301 適応的フィールド構造ME実行制御部
201 動きベクトル補正部
202 第1ステージME部
300 グローバルベクトル探索部
303 第1ステージME部
1 Coding Device 10 Frame Memory 20 Deblocking Filter 21 Frame Memory 22 Inter Prediction Unit 23 Motion Vector Detection Unit 101 First Stage ME Unit 102 Second Stage ME Unit 103 Third Stage ME Unit 104 Motion Vector Correction Unit 105 Second Stage ME unit 106 Third stage ME unit 107 Frame or field memory 108 Difference value evaluation unit 109, 302 Adaptive frame structure ME execution control unit 110 Mode determination unit 200, 301 Adaptive field structure ME execution control unit 201 Motion vector correction unit 202 First stage ME unit 300 Global vector search unit 303 First stage ME unit

Claims (7)

インタレース方式の動画像フレームを所定サイズに分割してなる符号化ブロックを、該動画像フレームのトップフィールドおよびボトムフィールドのラインが交互に配置されるフレーム構造と、該トップフィールドおよびボトムフィールドの何れか一方のラインからなるフィールド構造とを適応的に切り替えて形成し、該符号化ブロックについて検出された動きベクトルに基づき該符号化ブロックの予測符号化を行う符号化装置に用いられ、探索範囲の動画像データに対して段階的に精度を上げると共に段階的に該探索範囲を狭めてN(ただしNは2以上の整数)段階で該動きベクトルの検出を行う動きベクトル検出装置であって、
探索範囲に応じたサイズで、前記フレーム構造のブロックと、前記フィールド構造のブロックの少なくとも一方を形成するブロック形成手段と、
前記ブロック形成手段で形成された前記フィールド構造または前記フレーム構造の前記ブロックに対して、前記N段階のうち最も精度が低く且つ最も探索範囲が広い方からM(ただしM<N)段階目までの動きベクトル検出を行う第1の動きベクトル検出手段と、
前記ブロック形成手段で形成された前記フィールド構造の前記ブロックに対して、前記N段階のうち最も精度の高いN段階目までの動きベクトル検出を、(M+1)段階目から段階毎に精度を上げて順次行い、該(M+1)段階目の動きベクトル検出のための探索範囲の位置を前記第1の動きベクトル検出手段により検出された前記動きベクトルに基づき決定する第2の動きベクトル検出手段と、
前記ブロック形成手段で形成された前記フレーム構造の前記ブロックに対して、前記N段階のうち最も精度の高いN段階目までの動きベクトル検出を、(M+1)段階目から段階毎に精度を上げて順次行い、該(M+1)段階目の動きベクトル検出のための探索範囲の位置を前記第1の動きベクトル検出手段により検出された前記動きベクトルに基づき決定する第3の動きベクトル検出手段と、
前記第2の動きベクトル検出手段および前記第3の動きベクトル検出手段それぞれの前記N段階目の動きベクトル検出結果に基づき、前記符号化ブロックを前記フィールド構造または前記フレーム構造のうち何方で形成するかを決定すると共に、該第2の動きベクトル検出手段および前記第3の動きベクトル検出手段のそれぞれにより検出された動きベクトルのうち何方を出力するかを判定する決定手段と、
前記第1の動きベクトル検出手段で検出された動きベクトルを、該第1の動きベクトル検出手段が前記動きベクトル検出の対象とした前記ブロックの前記構造とは別の前記構造に対応させて補正する動きベクトル補正手段と
を有し、
前記第2または前記第3の動きベクトル検出手段は、
前記第1の動きベクトル検出手段で検出に用いた前記ブロックの前記構造とは別の前記構造に対して前記(M+1)段階目の動きベクトル検出を行う場合に、該(M+1)段階目の動きベクトル検出のための前記探索範囲の位置を、前記動きベクトル補正手段で補正された動きベクトルにより決定する
ことを特徴とする動きベクトル検出装置。
An encoding block obtained by dividing an interlaced moving image frame into a predetermined size has a frame structure in which the lines of the top field and the bottom field of the moving image frame are alternately arranged, and any one of the top field and the bottom field. The field structure consisting of either one of the lines is adaptively switched to be used in an encoding device that performs predictive encoding of the encoded block based on the motion vector detected for the encoded block. A motion vector detection device for detecting motion vectors in N (where N is an integer of 2 or more) stages by gradually increasing the accuracy of moving image data and narrowing the search range in stages.
Block forming means for forming at least one of the block of the frame structure and the block of the field structure with a size according to a search range;
With respect to the block of the field structure or the frame structure formed by the block forming means, the lowest accuracy and the widest search range of the N stages to the M (where M <N) stages. First motion vector detection means for performing motion vector detection;
For the block of the field structure formed by the block forming means, the motion vector detection from the (M + 1) th stage to the stage is increased for each stage with the highest precision among the N stages. Second motion vector detection means that sequentially performs determination of the position of the search range for motion vector detection at the (M + 1) -th stage based on the motion vector detected by the first motion vector detection means;
For the block of the frame structure formed by the block forming means, the motion vector detection from the (M + 1) th stage to the Nth stage with the highest accuracy is performed for the most accurate motion vector detection among the N stages. Third motion vector detection means that sequentially performs determination of the position of the search range for motion vector detection at the (M + 1) -th stage based on the motion vector detected by the first motion vector detection means;
Which of the field structure and the frame structure is used to form the coding block based on the motion vector detection result of the Nth stage of each of the second motion vector detection means and the third motion vector detection means Determining means for determining which one of the motion vectors detected by each of the second motion vector detecting means and the third motion vector detecting means is to be output;
The motion vector detected by the first motion vector detection means is corrected in correspondence with the structure different from the structure of the block that is the target of the motion vector detection by the first motion vector detection means. Motion vector correction means,
The second or third motion vector detecting means is
When the (M + 1) -th motion vector detection is performed on the structure different from the structure of the block used for detection by the first motion vector detection means, the (M + 1) -th motion A motion vector detection apparatus, wherein a position of the search range for vector detection is determined by a motion vector corrected by the motion vector correction means.
前記第1の動きベクトル検出手段により検出された前記動きベクトルの確からしさを示す値と閾値とを比較し、比較の結果に基づき、前記第2の動きベクトル検出手段による動きベクトル検出と前記第3の動きベクトル検出手段による動きベクトル検出とを併用して行うか否かを判定する判定手段をさらに有し、
前記判定手段は、前記比較の結果、前記確からしさを示す値が前記閾値以下だと判断したら、前記第2の動きベクトル検出手段による動きベクトル検出と前記第3の動きベクトル検出手段による動きベクトル検出とを併用して行うと判定する
ことを特徴とする請求項1に記載の動きベクトル検出装置。
A value indicating the probability of the motion vector detected by the first motion vector detection means is compared with a threshold value, and based on the comparison result, the motion vector detection by the second motion vector detection means and the third Determination means for determining whether or not to perform motion vector detection in combination with motion vector detection means of
If the determination means determines that the value indicating the probability is less than or equal to the threshold value as a result of the comparison, the motion vector detection by the second motion vector detection means and the motion vector detection by the third motion vector detection means The motion vector detection device according to claim 1, wherein the motion vector detection device is determined to be performed in combination.
前記第1の動きベクトル検出手段は、前記フィールド構造の前記ブロックに対して動きベクトル検出を行い、
前記判定手段は、前記動きベクトルの確からしさを示す値が前記閾値より大きいと判定したら、前記第3の動きベクトル検出手段による動きベクトル検出を行わず、前記第2の動きベクトル検出手段による動きベクトル検出を行うと判定し、
前記決定手段は、前記第2の動きベクトル検出手段により検出された動きベクトルを出力すると共に、前記符号化ブロックを前記フィールド構造で形成するように決定する
ことを特徴とする請求項2に記載の動きベクトル検出装置。
The first motion vector detection means performs motion vector detection on the block of the field structure,
If the determination means determines that the value indicating the probability of the motion vector is greater than the threshold value, the motion vector detection by the second motion vector detection means is not performed, but the motion vector detection by the third motion vector detection means is not performed. It is determined to detect,
The said determination means outputs the motion vector detected by the said 2nd motion vector detection means, and determines so that the said encoding block may be formed with the said field structure. Motion vector detection device.
前記第1の動きベクトル検出手段は、前記フレーム構造の前記ブロックに対して動きベクトル検出を行い、
前記判定手段は、前記動きベクトルの確からしさを示す値が前記閾値より大きいと判定したら、前記第2の動きベクトル検出手段による動きベクトル検出を行わず、前記第3の動きベクトル検出手段による動きベクトル検出を行うと判定し、
前記決定手段は、前記第3の動きベクトル検出手段により検出された動きベクトルを出力すると共に、前記符号化ブロックを前記フレーム構造で形成するように決定する
ことを特徴とする請求項2に記載の動きベクトル検出装置。
The first motion vector detection means performs motion vector detection on the block of the frame structure,
If the determination means determines that the value indicating the certainty of the motion vector is greater than the threshold, the motion vector detection by the third motion vector detection means is not performed, but the motion vector detection by the second motion vector detection means is not performed. It is determined to detect,
3. The determination unit according to claim 2, wherein the determination unit outputs the motion vector detected by the third motion vector detection unit and determines to form the encoded block with the frame structure. Motion vector detection device.
前記動画像データのフレームまたはフィールド全体での動き量を示すグローバルベクトルを推定するグローバルベクトル探索手段をさらに有し、
前記第1の動きベクトル検出手段は、前記グローバルベクトル探索手段により探索された前記グローバルベクトルを閾値と比較し、該グローバルベクトルが該閾値より大きいと判断したら、前記フィールド構造の前記ブロックに対して動きベクトル検出を行うと決定し、該グローバルベクトルが該閾値以下であると判断したら、前記フィールド構造の前記ブロックに対して動きベクトル検出を行うと決定する
ことを特徴とする請求項1乃至請求項4の何れか1項に記載の動きベクトル検出装置。
A global vector search means for estimating a global vector indicating a motion amount in the entire frame or field of the moving image data;
The first motion vector detection means compares the global vector searched by the global vector search means with a threshold value, and determines that the global vector is larger than the threshold value, the motion to the block of the field structure 5. The method according to claim 1, wherein when it is determined that vector detection is to be performed and it is determined that the global vector is equal to or less than the threshold value, it is determined that motion vector detection is to be performed on the block of the field structure. The motion vector detection device according to any one of the above.
インタレース方式の動画像フレームを所定サイズに分割してなる符号化ブロックを、該動画像フレームのトップフィールドおよびボトムフィールドのラインが交互に配置されるフレーム構造と、該トップフィールドおよびボトムフィールドの何れか一方のラインからなるフィールド構造とを適応的に切り替えて形成し、該符号化ブロックについて検出された動きベクトルに基づき該符号化ブロックの予測符号化を行う符号化装置に用いられ、探索範囲の動画像データに対して段階的に精度を上げると共に段階的に該探索範囲を狭めてN(Nは2以上の整数)段階で該動きベクトルの検出を行う動きベクトル検出方法であって、
探索範囲に応じたサイズで、前記フレーム構造のブロックと、前記フィールド構造のブロックの少なくとも一方を形成するブロック形成ステップと、
前記ブロック形成ステップで形成された前記フィールド構造または前記フレーム構造の前記ブロックに対して、前記N段階のうち最も精度が低く且つ最も探索範囲が広い方からM(ただしM<N)段階目までの動きベクトル検出を行う第1の動きベクトル検出ステップと、
前記ブロック形成ステップで形成された前記フィールド構造の前記ブロックに対して、前記N段階のうち最も精度の高いN段階目までの動きベクトル検出を、(M+1)段階目から段階毎に精度を上げて順次行い、該(M+1)段階目の動きベクトル検出のための探索範囲の位置を前記第1の動きベクトル検出ステップにより検出された前記動きベクトルに基づき決定する第2の動きベクトル検出ステップと、
前記ブロック形成ステップで形成された前記フレーム構造の前記ブロックに対して、前記N段階のうち最も精度の高いN段階目までの動きベクトル検出を、(M+1)段階目から段階毎に精度を上げて順次行い、該(M+1)段階目の動きベクトル検出のための探索範囲の位置を前記第1の動きベクトル検出ステップにより検出された前記動きベクトルに基づき決定する第3の動きベクトル検出ステップと、
前記第2の動きベクトル検出ステップおよび前記第3の動きベクトル検出ステップそれぞれの前記N段階目の動きベクトル検出結果に基づき、前記符号化ブロックを前記フィールド構造または前記フレーム構造のうち何方で形成するかを決定すると共に、該第2の動きベクトル検出ステップおよび前記第3の動きベクトル検出ステップのそれぞれにより検出された動きベクトルのうち何方を出力するかを判定する決定ステップと、
前記第1の動きベクトル検出ステップで検出された動きベクトルを、該第1の動きベクトル検出ステップが前記動きベクトル検出の対象とした前記ブロックの前記構造とは別の前記構造に対応させて補正する動きベクトル補正ステップと
を有し、
前記第2または前記第3の動きベクトル検出ステップは、
前記第1の動きベクトル検出ステップで検出に用いた前記ブロックの前記構造とは別の前記構造に対して前記(M+1)段階目の動きベクトル検出を行う場合に、該(M+1)段階目の動きベクトル検出のための前記探索範囲の位置を、前記動きベクトル補正ステップで補正された動きベクトルにより決定する
ことを特徴とする動きベクトル検出方法。
An encoding block obtained by dividing an interlaced moving image frame into a predetermined size has a frame structure in which the lines of the top field and the bottom field of the moving image frame are alternately arranged, and any one of the top field and the bottom field. The field structure consisting of either one of the lines is adaptively switched to be used in an encoding device that performs predictive encoding of the encoded block based on the motion vector detected for the encoded block. A motion vector detection method for detecting motion vectors in N (N is an integer of 2 or more) stages by gradually increasing the accuracy of moving image data and narrowing the search range in stages.
A block forming step for forming at least one of the frame structure block and the field structure block in a size according to a search range;
For the block of the field structure or the frame structure formed in the block forming step, from the one with the lowest accuracy and the widest search range among the N steps to the M (where M <N) steps. A first motion vector detection step for performing motion vector detection;
For the block of the field structure formed in the block forming step, the motion vector detection from the (M + 1) th stage to the stage is increased for each stage with the highest accuracy among the N stages. A second motion vector detection step that sequentially performs determination of the position of the search range for motion vector detection at the (M + 1) -th stage based on the motion vector detected by the first motion vector detection step;
For the block of the frame structure formed in the block forming step, the motion vector detection from the (M + 1) -th stage to the N-th stage with the highest accuracy is performed for each stage. A third motion vector detection step that sequentially performs determination of the position of the search range for motion vector detection at the (M + 1) -th stage based on the motion vector detected by the first motion vector detection step;
Which of the field structure and the frame structure is used to form the coding block based on the motion vector detection results of the Nth stage in each of the second motion vector detection step and the third motion vector detection step And determining which one of the motion vectors detected by each of the second motion vector detection step and the third motion vector detection step is to be output;
The motion vector detected in the first motion vector detection step is corrected in correspondence with the structure different from the structure of the block which is the target of the motion vector detection in the first motion vector detection step. A motion vector correction step,
The second or third motion vector detection step includes:
When the (M + 1) -th motion vector detection is performed on the structure different from the structure of the block used for the detection in the first motion vector detection step, the (M + 1) -th motion A motion vector detection method comprising: determining a position of the search range for vector detection based on the motion vector corrected in the motion vector correction step.
コンピュータを請求項1乃至請求項5の何れか1項に記載の動きベクトル検出装置として機能させるためのプログラム。   A program for causing a computer to function as the motion vector detecting device according to any one of claims 1 to 5.
JP2008177405A 2008-07-07 2008-07-07 Motion vector detection apparatus and motion vector detection method Withdrawn JP2010016780A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008177405A JP2010016780A (en) 2008-07-07 2008-07-07 Motion vector detection apparatus and motion vector detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008177405A JP2010016780A (en) 2008-07-07 2008-07-07 Motion vector detection apparatus and motion vector detection method

Publications (1)

Publication Number Publication Date
JP2010016780A true JP2010016780A (en) 2010-01-21

Family

ID=41702428

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008177405A Withdrawn JP2010016780A (en) 2008-07-07 2008-07-07 Motion vector detection apparatus and motion vector detection method

Country Status (1)

Country Link
JP (1) JP2010016780A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012004615A (en) * 2010-06-14 2012-01-05 Nippon Telegr & Teleph Corp <Ntt> Motion vector search method, motion vector search apparatus and program therefor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012004615A (en) * 2010-06-14 2012-01-05 Nippon Telegr & Teleph Corp <Ntt> Motion vector search method, motion vector search apparatus and program therefor

Similar Documents

Publication Publication Date Title
JP4851741B2 (en) Method and apparatus for encoding a sequence of source images
CN110741640B (en) Optical flow estimation for motion compensated prediction in video coding
US7426308B2 (en) Intraframe and interframe interlace coding and decoding
EP1675403B1 (en) Moving-picture compression encoding method, apparatus and program
JP4698186B2 (en) Prediction of motion vectors for fields in forward-predicted interlaced video frames
JP4529919B2 (en) Adaptive quantization apparatus and adaptive quantization program
JP5321426B2 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
WO2010001917A1 (en) Image processing device and method
JP2006074474A (en) Moving image encoder, encoding method, and encoding program
JP2007150913A (en) Image encoding device
JP4937224B2 (en) Image encoding device
JP2011199362A (en) Device and method for encoding of moving picture, and device and method for decoding of moving picture
JP2013115583A (en) Moving image encoder, control method of the same, and program
JP3866624B2 (en) Moving picture encoding method, moving picture decoding method, moving picture encoding apparatus, and moving picture decoding apparatus
JP5625512B2 (en) Encoding device, encoding method, program, and recording medium
JP2001128179A (en) Device and method for encoding moving picture
JP2006180195A (en) Moving picture compression coding method, moving picture compression coding apparatus, and program
JPH0846969A (en) System for encoding video signal
US20020168008A1 (en) Method and apparatus for coding moving pictures
JP5174062B2 (en) Intra prediction apparatus, encoder, decoder, and program
JP2010161747A (en) Apparatus and method for generating sub-pixel, and motion compensating apparatus
JP2010016780A (en) Motion vector detection apparatus and motion vector detection method
JP4719650B2 (en) Image encoding device
JP4222274B2 (en) Encoding mode selection device and encoding mode selection program
JP4697802B2 (en) Video predictive coding method and apparatus

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20111004