JP5206772B2 - Moving picture coding apparatus, moving picture coding method, and moving picture coding program - Google Patents

Moving picture coding apparatus, moving picture coding method, and moving picture coding program Download PDF

Info

Publication number
JP5206772B2
JP5206772B2 JP2010260428A JP2010260428A JP5206772B2 JP 5206772 B2 JP5206772 B2 JP 5206772B2 JP 2010260428 A JP2010260428 A JP 2010260428A JP 2010260428 A JP2010260428 A JP 2010260428A JP 5206772 B2 JP5206772 B2 JP 5206772B2
Authority
JP
Japan
Prior art keywords
motion vector
motion
block
prediction
boundary
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2010260428A
Other languages
Japanese (ja)
Other versions
JP2012114590A (en
Inventor
勝義 西谷
茂 福島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JVCKenwood Corp
Original Assignee
JVCKenwood Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by JVCKenwood Corp filed Critical JVCKenwood Corp
Priority to JP2010260428A priority Critical patent/JP5206772B2/en
Publication of JP2012114590A publication Critical patent/JP2012114590A/en
Application granted granted Critical
Publication of JP5206772B2 publication Critical patent/JP5206772B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Description

本発明は、動画像の符号化技術に関し、特に動き補償予測を利用した動画像の符号化技術に関する。   The present invention relates to a moving picture coding technique, and more particularly to a moving picture coding technique using motion compensated prediction.

MPEG(Moving Picture Experts Group)に代表される動画像の圧縮符号化では、画面間の相関を利用して符号量を圧縮する動き補償予測が多く用いられる。MPEG等で用いられる動き補償予測では、所定サイズのブロック毎に、既に復号済の参照画像から、符号化対象画像と参照画像の相対位置関係を示す動きベクトルを用いて予測画像を生成する。その後、符号化側では、符号化対象原画像と動き補償予測により生成された予測画像との差分である予測誤差を算出し、予測誤差のみを復号側に伝送する。これにより、動き補償予測を用いない場合と比較して伝送する符号量を大幅に削減できる。   In compression coding of moving images represented by MPEG (Moving Picture Experts Group), motion compensation prediction that compresses a code amount by using correlation between screens is often used. In motion compensated prediction used in MPEG or the like, a predicted image is generated for each block of a predetermined size from a reference image that has already been decoded using a motion vector that indicates the relative positional relationship between the encoding target image and the reference image. Thereafter, the encoding side calculates a prediction error that is a difference between the original image to be encoded and a prediction image generated by motion compensated prediction, and transmits only the prediction error to the decoding side. Thereby, compared with the case where motion compensation prediction is not used, the code amount transmitted can be reduced significantly.

一般に、符号化・復号処理はマクロブロック(所定ブロックサイズの画素群、例えば16×16)単位で行われる。動き補償予測もマクロブロック単位で行われることが多いが、この場合、マクロブロックよりも小さな物体等の動きを捉えることが難しく、結果として符号化効率が低下する。そこで、動き補償予測をさらに効率良く機能させる方法として、マルチブロックパターン動き補償予測が用いられる。   In general, encoding / decoding processing is performed in units of macroblocks (pixel group having a predetermined block size, for example, 16 × 16). Motion compensation prediction is often performed in units of macroblocks, but in this case, it is difficult to capture the motion of an object or the like that is smaller than the macroblock, resulting in a decrease in coding efficiency. Therefore, multi-block pattern motion compensated prediction is used as a method for making motion compensated prediction function more efficiently.

マルチブロックパターン動き補償予測では、マクロブロック内をさらにサブブロックに分割し、サブブロック毎に異なる動きベクトルを用いて動き補償予測を行うことが可能である。使用する動き補償予測ブロックの分割パターンは、符号化側と復号側の同一規則として予め定義しておく。符号化側では定義されたブロックパターンの中から動き補償予測のブロックパターンを選択し、ブロックパターンの選択情報を復号側に伝送する。復号側では、受信したブロックパターンの選択情報に基づき動き補償予測を行う。マルチブロックパターン動き補償予測では、符号化側で動き補償予測に最適なブロックパターンを選択すると、動き補償予測後の予測誤差が減少し、符号化効率が向上する。   In multi-block pattern motion compensation prediction, a macro block can be further divided into sub blocks, and motion compensation prediction can be performed using different motion vectors for each sub block. The division pattern of the motion compensation prediction block to be used is defined in advance as the same rule on the encoding side and the decoding side. On the encoding side, a block pattern for motion compensation prediction is selected from the defined block patterns, and block pattern selection information is transmitted to the decoding side. On the decoding side, motion compensation prediction is performed based on the received block pattern selection information. In multi-block pattern motion compensated prediction, when the optimum block pattern for motion compensated prediction is selected on the encoding side, the prediction error after motion compensated prediction is reduced, and the encoding efficiency is improved.

具体的なブロックパターンの例として、ISO/IECとITU−Tの合同ビデオチーム(JVT)が国際標準化したMPEG−4 AVC(Advanced Video Coding)では、マクロブロック(16×16ブロック)内をさらに16×8/8×16/8×8/8×4/4×8/4×4のブロックパターンに分割して動き補償予測を行うことが可能である。符号化側では、ブロックパターンを選択し、ブロックパターンの選択情報をビットストリーム内に符号化する。復号側では、ビットストリーム内に符号化されているブロックパターンに応じてマクロブロックを領域分割し、分割された領域毎に動き補償予測を行う。   As an example of a specific block pattern, in MPEG-4 AVC (Advanced Video Coding) internationally standardized by a joint video team (JVT) of ISO / IEC and ITU-T, there are further 16 macroblocks (16 × 16 blocks). It is possible to perform motion compensation prediction by dividing into block patterns of × 8/8 × 16/8 × 8/8 × 4/4 × 8/4 × 4. On the encoding side, a block pattern is selected, and block pattern selection information is encoded in the bitstream. On the decoding side, the macroblock is divided into regions according to the block pattern encoded in the bitstream, and motion compensation prediction is performed for each divided region.

更に、特許文献1や特許文献2には、さまざまな動き補償予測形状パターンを定義し、より柔軟な形状で動き補償予測を行う技術が開示されている。   Furthermore, Patent Literature 1 and Patent Literature 2 disclose techniques for defining motion compensation prediction shape patterns and performing motion compensation prediction with a more flexible shape.

特許第4025570号公報Japanese Patent No. 4025570 再公表特許第WO2003−026315号公報Republished Patent No. WO2003-026315

しかしながら、特許文献1や特許文献2に開示された方法では、定義する動き補償予測形状パターンを増やした場合、形状パターン数が増加するにつれ、伝送する形状パターンの選択情報に費やす符号量が多くなってしまう。つまり、形状パターンが増加したことによる予測誤差の減少と、形状パターン選択に関する符号量増加はトレードオフ関係にあるため、単に形状パターン数を増やすだけでは全体的な符号化効率を向上させることは難しい。   However, in the methods disclosed in Patent Document 1 and Patent Document 2, when the number of motion compensated prediction shape patterns to be defined is increased, the amount of code consumed for selection information of the shape pattern to be transmitted increases as the number of shape patterns increases. End up. In other words, a decrease in prediction error due to an increase in shape patterns and an increase in code amount related to shape pattern selection are in a trade-off relationship, so it is difficult to improve overall coding efficiency simply by increasing the number of shape patterns. .

このように従来の動画像符号化/復号では、予め定義した形状パターンの動き補償予測しか行えないため、最適な形状で動き補償予測を行うことができず、符号化効率を向上させることができない。また、定義する動き補償予測形状パターンを増やした場合、動き補償予測形状パターンの選択に関する付加情報の符号量が増加するため、全体的な符号化効率が向上するとは限らない。   As described above, in the conventional moving image encoding / decoding, only motion compensation prediction of a predefined shape pattern can be performed. Therefore, motion compensation prediction cannot be performed with an optimal shape, and encoding efficiency cannot be improved. . In addition, when the number of motion compensation predicted shape patterns to be defined is increased, the amount of additional information related to the selection of motion compensated predicted shape patterns increases, and thus the overall coding efficiency is not always improved.

本発明はこうした状況に鑑みてなされたものであり、その目的は、動き補償予測のブロックパターンに関する付加情報の符号量を増加させることなく、さまざまなブロックパターンでの動き補償予測を可能にすることで、予測誤差を減少させて符号化効率を向上させる技術を提供することにある。   The present invention has been made in view of such circumstances, and an object of the present invention is to enable motion compensation prediction in various block patterns without increasing the amount of additional information regarding the block pattern of motion compensation prediction. Therefore, an object of the present invention is to provide a technique for improving the coding efficiency by reducing the prediction error.

上記課題を解決するために、本発明のある態様の動画像符号化装置は、符号化対象ブロックを所定の仮境界で複数の仮領域に分割する仮領域分割部(101)と、前記符号化対象ブロックに隣接する符号化済みブロックと接している部分が最も少ない第1の仮領域の動きベクトルを、画像間の動き推定により検出する第1の動きベクトル検出部(102)と、前記第1の仮領域以外の仮領域のそれぞれに対して、前記符号化対象ブロックに隣接する符号化済みブロックの動き情報を用いて動きベクトルを検出する第2の動きベクトル検出部(110)と、各仮領域の動きベクトルを用いて、参照画像から前記符号化対象ブロックに対応した複数の予測ブロックを生成し、複数の予測ブロックのアクティビティに基づいて本境界を決定し、前記各予測ブロックを前記本境界で分割して得た領域を前記各予測ブロック間で結合させることにより、合成予測ブロックを生成する動き補償部(103)と、前記合成予測ブロックを前記符号化対象ブロックより減算した予測差分ブロックと、第1の仮領域の動きベクトルとを符号化する符号化部(105)とを備える。   In order to solve the above problems, a moving picture encoding apparatus according to an aspect of the present invention includes a temporary area dividing unit (101) that divides an encoding target block into a plurality of temporary areas at a predetermined temporary boundary, and the encoding. A first motion vector detection unit (102) for detecting a motion vector of a first temporary region that has the least portion in contact with an encoded block adjacent to a target block by motion estimation between images; A second motion vector detecting unit (110) for detecting a motion vector using motion information of an encoded block adjacent to the encoding target block for each of the temporary regions other than the temporary region; Generating a plurality of prediction blocks corresponding to the encoding target block from a reference image using a motion vector of the region, determining a main boundary based on activities of the plurality of prediction blocks, A motion compensation unit (103) that generates a combined prediction block by combining regions obtained by dividing a prediction block at the main boundary between the prediction blocks, and the combined prediction block from the encoding target block The encoding part (105) which encodes the subtracted prediction difference block and the motion vector of a 1st temporary area | region is provided.

本発明の別の態様は、動画像符号化方法である。この方法は、符号化対象ブロックを所定の仮境界で複数の仮領域に分割するステップと、前記符号化対象ブロックに隣接する符号化済みブロックと接している部分が最も少ない第1の仮領域の動きベクトルを、画像間の動き推定により検出するステップと、前記第1の仮領域以外の仮領域のそれぞれに対して、前記符号化対象ブロックに隣接する符号化済みブロックの動き情報を用いて動きベクトルを検出するステップと、各仮領域の動きベクトルを用いて、参照画像から前記符号化対象ブロックに対応した複数の予測ブロックを生成し、複数の予測ブロックのアクティビティに基づいて本境界を決定し、前記各予測ブロックを前記本境界で分割して得た領域を前記各予測ブロック間で結合させることにより、合成予測ブロックを生成するステップと、前記合成予測ブロックを前記符号化対象ブロックより減算した予測差分ブロックと、第1の仮領域の動きベクトルとを符号化するステップとを備える。   Another aspect of the present invention is a video encoding method. In this method, a block to be encoded is divided into a plurality of temporary regions at a predetermined temporary boundary, and the first temporary region having the least portion in contact with the encoded block adjacent to the target block is encoded. A motion vector is detected by motion estimation between images, and motion is performed using motion information of an encoded block adjacent to the encoding target block for each of the temporary regions other than the first temporary region. A plurality of prediction blocks corresponding to the coding target block are generated from a reference image using a vector detecting step and a motion vector of each temporary region, and the boundary is determined based on the activities of the plurality of prediction blocks. A combined prediction block is generated by combining regions obtained by dividing the prediction blocks at the main boundary between the prediction blocks. Tsu comprising a flop, and the combined predicted prediction difference block to block by subtracting from the encoding target block, and encoding the motion vector of the first temporary area.

なお、以上の構成要素の任意の組合せ、本発明の表現を方法、装置、システム、記録媒体、コンピュータプログラムなどの間で変換したものもまた、本発明の態様として有効である。   It should be noted that any combination of the above-described constituent elements and a conversion of the expression of the present invention between a method, an apparatus, a system, a recording medium, a computer program, etc. are also effective as an aspect of the present invention.

本発明によれば、動き補償予測のブロックパターンに関する付加情報の符号量を増加させることなく、さまざまなブロックパターンでの動き補償予測を可能にすることで、予測誤差を減少させて符号化効率を向上させることができる。   According to the present invention, it is possible to reduce the prediction error and increase the coding efficiency by enabling the motion compensation prediction in various block patterns without increasing the code amount of the additional information regarding the block pattern of the motion compensation prediction. Can be improved.

実施の形態1の動画像符号化装置の構成を示すブロック図である。1 is a block diagram illustrating a configuration of a moving image encoding apparatus according to Embodiment 1. FIG. 実施の形態1の動画像復号装置の構成を示すブロック図である。1 is a block diagram illustrating a configuration of a moving image decoding apparatus according to Embodiment 1. FIG. マクロブロックを水平方向に2分割するパターンを説明する図である。It is a figure explaining the pattern which divides a macroblock into 2 in a horizontal direction. マクロブロックを垂直方向に2分割するパターンを説明する図である。It is a figure explaining the pattern which divides a macroblock into 2 in the perpendicular direction. マクロブロックの仮領域毎に検出される動きベクトルを示す図である。It is a figure which shows the motion vector detected for every temporary area | region of a macroblock. 符号化対象ブロックの仮領域の分割方向と、第2動きベクトル検出部110が行う動き検出に用いられる隣接ブロックの関係を説明する図である。It is a figure explaining the relationship between the division | segmentation direction of the temporary area | region of an encoding object block, and the adjacent block used for the motion detection which the 2nd motion vector detection part 110 performs. 従来のMPEG−4 AVC/H.264におけるマクロブロック単位の動き検出の方法を説明する図である。Conventional MPEG-4 AVC / H. 2 is a diagram illustrating a method of motion detection in units of macroblocks in H.264. 本実施の形態の第2動きベクトル検出部110による動き検出の方法を説明する図である。It is a figure explaining the method of the motion detection by the 2nd motion vector detection part 110 of this Embodiment. マクロブロックを分割する方向にもとづいて、動きベクトルを参照する周囲マクロブロックを選択する方法を説明する図である。It is a figure explaining the method of selecting the surrounding macroblock which refers a motion vector based on the direction which divides | segments a macroblock. 動きベクトルを参照する周囲マクロブロックを選択する別の方法を説明する図である。It is a figure explaining another method of selecting the surrounding macroblock which refers to a motion vector. 仮領域毎に検出された動きベクトルから生成される動き補償予測画像を示す図である。It is a figure which shows the motion compensation estimated image produced | generated from the motion vector detected for every temporary area | region. 各仮領域の動きベクトルから生成される動き補償予測画像を合成して得られる合成動き補償予測画像を示す図である。It is a figure which shows the synthetic | combination motion compensation prediction image obtained by synthesize | combining the motion compensation prediction image produced | generated from the motion vector of each temporary area | region. 各仮領域の動きベクトルから生成される動き補償予測画像を合成して合成動き補償予測画像を生成する方法を説明する図である。It is a figure explaining the method of synthesize | combining the motion compensation estimated image produced | generated from the motion vector of each temporary area | region, and producing | generating a synthetic | combination motion compensation prediction image. 動き検出の3つのモードと、各モードで算出された動きベクトルの中から最適値を求める処理を示すフローチャートである。It is a flowchart which shows the process which calculates | requires an optimal value from three modes of motion detection, and the motion vector calculated by each mode. 図1の本領域分割・動き補償部による本境界の決定手順を説明するフローチャートである。6 is a flowchart for explaining a main boundary determination procedure by the main region dividing / motion compensating unit in FIG. 1. 動き補償予測画像についての本境界決定に関するアクティビティを説明する図である。It is a figure explaining the activity regarding this boundary determination about a motion compensation prediction image. 実施の形態2の動画像符号化装置の第2動きベクトル検出部110による第2動きベクトルの検出方法を説明する図である。It is a figure explaining the detection method of the 2nd motion vector by the 2nd motion vector detection part 110 of the moving image encoder of Embodiment 2. FIG. 実施の形態1〜2の動画像符号化装置により符号化される動画像のビットストリームの第一のシンタックスパターンを示す図である。It is a figure which shows the 1st syntax pattern of the bit stream of the moving image encoded by the moving image encoding apparatus of Embodiment 1-2. マクロブロック単位で動き補償予測の形状を復号側で自動的に決定するかどうかを示す第2フラグを伝送する第二のシンタックスパターンを示す。The second syntax pattern which transmits the 2nd flag which shows whether the shape of motion compensation prediction is automatically determined by the decoding side in a macroblock unit is shown. スライスレベルで動き補償予測の形状を復号側で自動的に決定するアルゴリズムを切り替える第三のシンタックスパターンを示す図である。It is a figure which shows the 3rd syntax pattern which switches the algorithm which determines automatically the shape of a motion compensation prediction at the slice level by the decoding side. マクロブロック単位で領域分割の有無と方向を復号側で自動的に決定するかどうかを示す第4フラグを伝送する第四のシンタックスパターンを示す図である。It is a figure which shows the 4th syntax pattern which transmits the 4th flag which shows whether the presence or absence of area division and a direction are automatically determined by a decoding side per macroblock. 図21の第4フラグの値の意味の一例を示したテーブルである。It is the table which showed an example of the meaning of the value of the 4th flag of FIG.

以下、本発明の実施の形態について図面を参照して説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

(実施の形態1)
図1は、実施の形態1の動画像符号化装置の構成を示すブロック図である。実施の形態1の動画像符号化装置は、仮領域分割部101、第1動きベクトル検出部102、本領域分割・動き補償部103、直交変換・量子化部104、可変長符号化部105、逆量子化・逆直交変換部106、メモリ107、減算部108、加算部109、および第2動きベクトル検出部110を備える。
(Embodiment 1)
FIG. 1 is a block diagram showing a configuration of the moving picture encoding apparatus according to the first embodiment. The moving image encoding apparatus according to Embodiment 1 includes a temporary region dividing unit 101, a first motion vector detecting unit 102, a main region dividing / motion compensating unit 103, an orthogonal transform / quantizing unit 104, a variable length encoding unit 105, An inverse quantization / inverse orthogonal transform unit 106, a memory 107, a subtraction unit 108, an addition unit 109, and a second motion vector detection unit 110 are provided.

仮領域分割部101は、例えば16×16マクロブロックなどの符号化対象となっている画素群について、任意の境界で領域を分割する。この領域分割は動きベクトル検出のための符号化側の独自手法であり、どのような境界で領域分割しても構わないが、動き補償予測の効率が向上する境界で領域分割するのが望ましい。ここでは、最も単純な仮領域分割として、水平方向又は垂直方向にのみマクロブロックを2分割する場合を例として挙げて説明する。   The temporary area dividing unit 101 divides an area at an arbitrary boundary for a pixel group to be encoded, such as a 16 × 16 macroblock. This region division is a unique method on the coding side for motion vector detection, and the region may be divided at any boundary, but it is desirable to perform region division at a boundary that improves the efficiency of motion compensation prediction. Here, as the simplest provisional area division, a case where a macroblock is divided into two only in the horizontal direction or the vertical direction will be described as an example.

図3(a)〜(c)は、マクロブロックを水平方向に2分割するパターンを説明する図である。図3(a)は、上から4画素目の水平境界でマクロブロックを16×4の上側領域と16×12の下側領域に2分割したパターンであり、図3(b)は、上から8画素目の水平境界でマクロブロックを16×8の上側領域と16×8の下側領域に2分割したパターンであり、図3(c)は、上から12画素目の水平境界でマクロブロックを16×12の上側領域と16×4の下側領域に2分割したパターンである。   FIGS. 3A to 3C are diagrams for explaining a pattern in which a macroblock is divided into two in the horizontal direction. FIG. 3A shows a pattern in which a macroblock is divided into a 16 × 4 upper region and a 16 × 12 lower region at the horizontal boundary of the fourth pixel from the top, and FIG. This is a pattern in which the macroblock is divided into a 16 × 8 upper area and a 16 × 8 lower area at the horizontal boundary of the eighth pixel, and FIG. 3C shows the macroblock at the horizontal boundary of the twelfth pixel from the top. Is divided into a 16 × 12 upper region and a 16 × 4 lower region.

図4(a)〜(c)は、マクロブロックを垂直方向に2分割するパターンを説明する図である。図4(a)は、左から4画素目の垂直境界でマクロブロックを4×16の左側領域と12×16の右側領域に2分割したパターンであり、図4(b)は、左から8画素目の垂直境界でマクロブロックを8×16の左側領域と8×16の右側領域に2分割したパターンであり、図4(c)は、左から12画素目の垂直境界でマクロブロックを12×16の左側領域と4×16の右側領域に2分割したパターンである。   FIGS. 4A to 4C are diagrams for explaining a pattern in which a macroblock is divided into two in the vertical direction. FIG. 4A shows a pattern in which a macroblock is divided into a 4 × 16 left region and a 12 × 16 right region at the vertical boundary of the fourth pixel from the left, and FIG. The macroblock is divided into two 8 × 16 left and 8 × 16 right regions at the vertical boundary of the pixel, and FIG. 4C shows 12 macroblocks at the vertical boundary of the 12th pixel from the left. The pattern is divided into two parts, a left side area of x16 and a right side area of 4x16.

仮領域分割部101により決められるマクロブロックの境界を「仮境界」(provisional boundary)と呼び、仮境界により分割されたマクロブロック内の各領域を「仮領域」(provisional region)と呼ぶ。   The boundary of the macroblock determined by the provisional region dividing unit 101 is called a “provisional boundary”, and each region in the macroblock divided by the provisional boundary is called a “provisional region”.

ここでは、水平方向または垂直方向に2分割するパターンを3つ示したが、水平境界または垂直境界の候補位置を増やして4以上の分割パターンを設けてもよい。また、斜め方向の境界で分割したり、折れ曲がった境界で分割してもよい。   Here, three patterns that are divided into two in the horizontal direction or the vertical direction are shown, but four or more division patterns may be provided by increasing the candidate positions of the horizontal boundary or the vertical boundary. Further, it may be divided at an oblique boundary or may be divided at a bent boundary.

仮領域分割部101は、符号化対象となる原画像信号について、各水平境界に関する水平アクティビティ、または各垂直境界に関する垂直アクティビティを計算する。後述のように、折れ曲がった境界でマクロブロックを分割した場合は、折れ曲がった境界に沿ってアクティビティを計算する。   The temporary area dividing unit 101 calculates a horizontal activity related to each horizontal boundary or a vertical activity related to each vertical boundary for the original image signal to be encoded. As described later, when a macroblock is divided at a bent boundary, the activity is calculated along the bent boundary.

画像信号のアクティビティとは、画素に対して何らかの演算を施した値のことである。マクロブロックを領域分割する境界に関するアクティビティとして、たとえば、境界をまたぐ2画素間の絶対差分和(SAD)を用いることができる。例えば、マクロブロック内のX座標をi、Y座標をjとして、点(i,j)における画素値をAi,jとすると、上からj画素目の水平境界jの水平アクティビティは以下のように定義される。
水平アクティビティ=Σi=0 15|Ai,j−Ai,jー1
ここで、Σi=0 15は、添え字iを0から15まで動かした場合の総和である。
The activity of the image signal is a value obtained by performing some operation on the pixel. For example, an absolute difference sum (SAD) between two pixels across the boundary can be used as an activity related to the boundary for dividing the macroblock. For example, assuming that the X coordinate in the macroblock is i, the Y coordinate is j, and the pixel value at the point (i, j) is Ai, j , the horizontal activity at the horizontal boundary j of the jth pixel from the top is as follows: Defined in
Horizontal activity = Σ i = 0 15 | A i, j −A i, j−1 |
Here, Σ i = 0 15 is the total sum when the subscript i is moved from 0 to 15.

ただし、アクティビティは絶対差分和(SAD)でなくてもよい。以下に示すような絶対二乗和(SSD)であってもよい。
水平アクティビティ=Σi=0 15(Ai,j−Ai,jー1
However, the activity may not be an absolute difference sum (SAD). An absolute sum of squares (SSD) as shown below may be used.
Horizontal activity = Σ i = 0 15 (A i, j −A i, j−1 ) 2

同様に、マクロブロックの左からi画素目の垂直境界iの垂直アクティビティは以下のように定義される。
垂直アクティビティ=Σj=0 15|Ai,j−Aiー1,j
Similarly, the vertical activity at the vertical boundary i of the i-th pixel from the left of the macroblock is defined as follows.
Vertical activity = Σ j = 0 15 | A i, j −A i−1, j |

アクティビティは物体のエッジなどで大きい値になる。仮領域分割部101は、アクティビティ値が最も大きい境界でマクロブロックの領域を仮分割する。   The activity becomes a large value at the edge of the object. The temporary area dividing unit 101 tentatively divides a macroblock area at a boundary having the largest activity value.

仮領域分割部101により分割された各仮領域について動きベクトルを検出する。仮領域の動きベクトルの検出は、第1動きベクトル検出部102または第2動きベクトル検出部110によって行われる。   A motion vector is detected for each temporary area divided by the temporary area dividing unit 101. The detection of the motion vector of the temporary area is performed by the first motion vector detection unit 102 or the second motion vector detection unit 110.

図5は、マクロブロックの仮領域毎に検出される動きベクトルを示す図である。仮領域分割部101が、マクロブロックを図3(a)のように上から4画素目の水平境界で仮分割した場合を例に取ると、図5に示すように、16×4の上側領域と16×12の下側領域のそれぞれについて動きベクトルを検出する。   FIG. 5 is a diagram showing motion vectors detected for each temporary area of the macroblock. For example, when the temporary area dividing unit 101 tentatively divides the macroblock at the horizontal boundary of the fourth pixel from the top as shown in FIG. 3A, a 16 × 4 upper area is obtained as shown in FIG. And a motion vector for each of the lower regions of 16 × 12.

図6(a)、(b)は、符号化対象ブロックの仮領域の分割方向と、第2動きベクトル検出部110が行う動き検出に用いられる隣接ブロックの関係を説明する図である。図6(a)、(b)はそれぞれ、水平方向、垂直方向に分割された符号化対象のマクロブロックとその周囲に隣接する3つの符号化済みのマクロブロックMBA、MBB、MBCを示す。   6A and 6B are diagrams for explaining the relationship between the division direction of the temporary area of the encoding target block and the adjacent blocks used for motion detection performed by the second motion vector detection unit 110. FIG. FIGS. 6A and 6B respectively show a macroblock to be encoded divided in the horizontal direction and the vertical direction and three encoded macroblocks MBA, MBB, and MBC adjacent to the periphery.

図6(a)に示すように符号化対象のマクロブロックが水平方向に分割される場合、水平境界より上側の仮領域は、2つの周囲マクロブロックMBA、MBBに隣接するが、水平境界より下側の仮領域は、1つの周囲マクロブロックMBAにしか隣接しない。図6(b)に示すように符号化対象のマクロブロックが垂直方向に分割される場合、垂直境界より左側の仮領域は、2つの周囲マクロブロックMBA、MBBに隣接するが、垂直境界より右側の仮領域は、1つの周囲マクロブロックMBBにしか隣接しない。   When the encoding target macroblock is divided in the horizontal direction as shown in FIG. 6A, the temporary area above the horizontal boundary is adjacent to the two surrounding macroblocks MBA and MBB, but below the horizontal boundary. The temporary area on the side is adjacent to only one surrounding macroblock MBA. When the encoding target macroblock is divided in the vertical direction as shown in FIG. 6B, the temporary area on the left side of the vertical boundary is adjacent to the two surrounding macroblocks MBA and MBB, but on the right side of the vertical boundary. The temporary area is adjacent to only one surrounding macroblock MBB.

符号化対象ブロックの分割された仮領域のうち、符号化済みの周囲マクロブロックに隣接している部分が最も少ない仮領域(「第1仮領域」と呼ぶ)については第1動きベクトル検出部102が従来の動き検出を行い、それ以外の仮領域(2分割の場合は、「第2仮領域」と呼ぶ)については第2動きベクトル検出部110が周囲マクロブロックの動き情報を利用して動きベクトルを検出する。   The first motion vector detection unit 102 is used for a temporary region (referred to as a “first temporary region”) that has the least number of portions adjacent to the encoded surrounding macroblock among the divided temporary regions of the encoding target block. Performs the conventional motion detection, and the second motion vector detection unit 110 uses the motion information of the surrounding macroblocks for other temporary regions (referred to as “second temporary region” in the case of two divisions). Detect vectors.

図6(a)の水平分割の場合であれば、上側の仮領域、図6(b)の垂直分割の場合であれば、左側の仮領域については、第2動きベクトル検出部110が周囲マクロブロックの動き情報から動きベクトルを求める。もう一方の仮領域、すなわち、図6(a)の水平分割の場合であれば、下側の仮領域、図6(b)の垂直分割の場合であれば、右側の仮領域については、第1動きベクトル検出部102が通常の方法で動きベクトルを検出する。   In the case of the horizontal division in FIG. 6A, the second motion vector detection unit 110 performs the surrounding macro for the upper temporary region and in the vertical division of FIG. 6B for the left temporary region. A motion vector is obtained from the motion information of the block. The other temporary area, that is, the lower temporary area in the case of horizontal division in FIG. 6A, and the right temporary area in the case of vertical division in FIG. One motion vector detection unit 102 detects a motion vector by a normal method.

第1動きベクトル検出部102は、ブロックマッチング法を用いて動きベクトルを検出する。動きベクトル検出のアルゴリズムは指定した探索領域内の候補ベクトルをすべて評価するフルサーチの他、さまざまな動き特性から探索する候補ベクトルを絞り込んで探索する高速サーチなどいろいろな方法が存在する。仮領域分割部101で分割したブロック毎に動きベクトルを検出することができるものであれば、どのような動きベクトル検出アルゴリズムを用いることも可能である。   The first motion vector detection unit 102 detects a motion vector using a block matching method. As a motion vector detection algorithm, there are various methods such as a full search that evaluates all candidate vectors in a designated search region and a high-speed search that narrows down and searches candidate vectors based on various motion characteristics. Any motion vector detection algorithm can be used as long as a motion vector can be detected for each block divided by the temporary region dividing unit 101.

第2動きベクトル検出部110の動作をより詳しく説明する。第2動きベクトル検出部110は、符号化済みの周囲マクロブロックの動き情報を利用することで第2動きベクトルを検出する。第2動きベクトル検出部110の動作を説明する前に、図7(a)〜(c)を参照して、従来のマクロブロック単位の動き検出の方法を説明し、その後、図8(a)、(b)を参照して、本実施の形態の第2動きベクトル検出部110の動作を説明する。   The operation of the second motion vector detection unit 110 will be described in more detail. The second motion vector detection unit 110 detects the second motion vector by using the motion information of the encoded surrounding macroblock. Before describing the operation of the second motion vector detection unit 110, a conventional motion detection method in units of macroblocks will be described with reference to FIGS. 7A to 7C, and then FIG. , (B), the operation of the second motion vector detection unit 110 of the present embodiment will be described.

図7(a)〜(c)は、従来のMPEG−4 AVC/H.264におけるマクロブロック単位の動き検出の方法を説明する図である。   7 (a) to 7 (c) show conventional MPEG-4 AVC / H. 2 is a diagram illustrating a method of motion detection in units of macroblocks in H.264.

図7(b)は符号化対象ピクチャであり、符号化対象となる16×16画素で構成されるマクロブロックを太い点線で示し、符号化対象ブロックの周囲にある4つの符号化済みブロックを細い点線で示す。図7(b)に示すピクチャは時刻t1において表示されるものであり、時刻t1よりも表示時刻が前である時刻t0(<t1)におけるピクチャを図7(a)または図7(c)に示す。これら2つのピクチャは、図7(b)の符号化対象ピクチャの動き予測の参照先ピクチャとして使用される。図7(a)〜(c)に示すように、時刻t0から時刻t1にかけて、ピクチャ内の点描の円は、左から右に平行移動し、背景の縞模様は下から上に移動している。   FIG. 7B shows an encoding target picture. A macro block composed of 16 × 16 pixels to be encoded is indicated by a thick dotted line, and four encoded blocks around the encoding target block are thin. Shown with dotted lines. The picture shown in FIG. 7B is displayed at time t1, and the picture at time t0 (<t1) whose display time is earlier than time t1 is shown in FIG. 7A or FIG. 7C. Show. These two pictures are used as reference pictures for motion prediction of the current picture in FIG. 7B. As shown in FIGS. 7A to 7C, from time t0 to time t1, the stipple circle in the picture moves in parallel from left to right, and the background stripe pattern moves from bottom to top. .

図7(a)は、16×16画素のマクロブロックで動き検出を行った場合を示す。図7(b)に示す符号化対象ブロック内で点描の円の占める割合が大きいため、図7(a)の太い点線枠で示される符号化対象ブロックから太い実線枠で示される位置への移動を示す白抜き矢印が動きベクトルとして検出される。この動きベクトルを用いて動き補償を行うと、図7(a)において斜線で示す部分が画像間の予測誤差となる。   FIG. 7A shows a case where motion detection is performed with a macro block of 16 × 16 pixels. Since the ratio of the stipple circle in the encoding target block shown in FIG. 7B is large, the movement from the encoding target block indicated by the thick dotted line frame in FIG. 7A to the position indicated by the thick solid line frame A white arrow indicating is detected as a motion vector. When motion compensation is performed using this motion vector, a hatched portion in FIG. 7A becomes a prediction error between images.

図7(c)は、マクロブロック内を16×8画素の領域に分割し、それぞれについて動き検出を行った場合の一例である。下側の領域は点描の円の占める割合が大きいため、図7(a)の場合と同様の動き検出が行われ、左向きの白抜き矢印が動きベクトルとして検出される。一方、上側の領域は縞模様の背景の動きを捉えることになり、符号化対象ブロックの真上の位置への移動を示す上向きの白抜き矢印が動きベクトルとして検出される。これら二つの動きベクトルを用いて動き補償を行うと、図7(c)において斜線で示す部分が画像間の予測誤差となる。   FIG. 7C shows an example in which the macroblock is divided into 16 × 8 pixel regions, and motion detection is performed for each. Since the proportion of the stipple circle is large in the lower area, the same motion detection as in FIG. 7A is performed, and a left-pointing white arrow is detected as a motion vector. On the other hand, the upper region captures the motion of the striped background, and an upward white arrow indicating movement to a position directly above the block to be encoded is detected as a motion vector. When motion compensation is performed using these two motion vectors, a hatched portion in FIG. 7C becomes a prediction error between images.

従来のMPEG−4 AVC/H.264で規定されるマクロブロックのタイプに応じて動き検出を行うと、16×16画素単位の場合では予測誤差の発生箇所が多くなるため、符号化効率が低下する。一方、16×8画素に上下に分割した場合は、予測画素の発生箇所が16×16画素単位に比べて少なく、符号化効率が向上するが、上下の領域毎に動きベクトル等の動き情報を符号化して伝送する必要がある。   Conventional MPEG-4 AVC / H. When motion detection is performed according to the type of macroblock defined by H.264, the number of occurrences of prediction errors increases in the case of 16 × 16 pixels, and coding efficiency decreases. On the other hand, when divided vertically into 16 × 8 pixels, the number of predicted pixel occurrences is smaller than that in a 16 × 16 pixel unit, and the coding efficiency is improved. However, motion information such as a motion vector is added to each upper and lower region. It is necessary to encode and transmit.

本実施の形態では、このように符号化対象のマクロブロック内を分割する場合は、分割領域の動きは、分割の境界よりも上側または左側に隣接する符号化済みの周囲マクロブロックの動きに類似すると仮定して、周囲マクロブロックの動き情報を参照する。   In this embodiment, when the macroblock to be encoded is divided in this way, the movement of the divided area is similar to the movement of the encoded surrounding macroblock adjacent to the upper side or the left side of the division boundary. Assuming that, the motion information of surrounding macroblocks is referred to.

図8(a)、(b)は、本実施の形態の第2動きベクトル検出部110による動き検出の方法を説明する図である。   FIGS. 8A and 8B are diagrams for explaining a method of motion detection by the second motion vector detection unit 110 according to the present embodiment.

図8(b)は時刻t1の符号化対象ピクチャであり、符号化対象となる16×16画素で構成されるマクロブロックを太い点線で示し、符号化対象ブロックの周囲にある4つの符号化済みブロックを細い点線で示す。図8(a)は時刻t0におけるピクチャであり、図8(b)の符号化対象ピクチャの動き予測の参照先ピクチャとして使用される。図7(a)および図7(b)で示したのと同様に、時刻t0から時刻t1にかけて、ピクチャ内の点描の円は、左から右に平行移動し、背景の縞模様は下から上に移動している。   FIG. 8B is a picture to be encoded at time t1, and a macroblock composed of 16 × 16 pixels to be encoded is indicated by a thick dotted line, and four encoded data around the encoding target block are shown. The block is indicated by a thin dotted line. FIG. 8A shows a picture at time t0, which is used as a reference picture for motion prediction of the current picture in FIG. 8B. As shown in FIGS. 7 (a) and 7 (b), from time t0 to time t1, the stipple circle in the picture is translated from left to right, and the background stripe pattern is from top to bottom. Has moved to.

図8(a)は、符号化対象ブロック内を領域分割し、分割された各領域の動き検出を行う様子を示す。符号化対象となるマクロブロックが水平に分割される場合、水平分割の境界の上側にある領域は境界の下側にある領域よりも、符号化対象ブロックの上または左に隣接している符号化済みのマクロブロックと同じ動きを示すことが多い。そのため、上側領域が真上の周囲マクロブロックの動きと同じになると仮定し、図8(a)で黒塗り矢印で示される真上のマクロブロックの動きベクトルを使用して動き補償を行う。この動きベクトルは周囲マクロブロックにより得られるものであり、符号化・伝送を行う必要がないから、符号量を抑制することができる。   FIG. 8A shows a state in which the encoding target block is divided into regions, and motion detection is performed for each of the divided regions. When the macroblock to be encoded is divided horizontally, the area above the boundary of the horizontal division is adjacent to the block above or to the left of the area below the boundary. It often shows the same movement as a finished macroblock. Therefore, assuming that the upper region is the same as the motion of the surrounding macroblock immediately above, motion compensation is performed using the motion vector of the macroblock immediately above indicated by the black arrow in FIG. Since this motion vector is obtained by surrounding macroblocks and it is not necessary to perform encoding / transmission, the amount of codes can be suppressed.

第2動きベクトル検出部110は、このように符号化対象のマクロブロックに隣接する符号化済みの周囲マクロブロックの動き情報を利用して、符号化対象のマクロブロックの分割領域の動きベクトルを求める。隣接する周囲マクロブロックのいずれの動きベクトルを利用するかは、符号化対象のマクロブロックの分割する方向にもとづいて決定する。   The second motion vector detection unit 110 obtains the motion vector of the divided region of the encoding target macroblock using the motion information of the encoded surrounding macroblock adjacent to the encoding target macroblock in this way. . Which motion vector of neighboring macroblocks to use is determined based on the division direction of the macroblock to be encoded.

図9(a)、(b)は、マクロブロックを分割する方向にもとづいて、動きベクトルを参照する周囲マクロブロックを選択する方法を説明する図である。   FIGS. 9A and 9B are diagrams illustrating a method for selecting surrounding macroblocks that refer to motion vectors based on the direction in which the macroblocks are divided.

図9(a)に示すように、符号化対象のマクロブロックが水平方向に分割され、上側領域について第2動きベクトル検出部110が第2動きベクトルMV2を求め、下側領域について第1動きベクトル検出部102が第1動きベクトルMV1を求める。このとき、上側領域は真上に隣接するマクロブロックMBBと類似する動きを示すことが推測されるので、第2動きベクトル検出部110は、動き情報として真上のマクロブロックMBBの動きベクトルを参照する。   As shown in FIG. 9A, the encoding target macroblock is divided in the horizontal direction, the second motion vector detection unit 110 obtains the second motion vector MV2 for the upper region, and the first motion vector for the lower region. The detection unit 102 obtains the first motion vector MV1. At this time, it is presumed that the upper region shows a similar motion to the macroblock MBB immediately above it, so the second motion vector detection unit 110 refers to the motion vector of the macroblock MBB directly above as motion information. To do.

符号化済みのマクロブロックの各種情報は、メモリ107に蓄積されており、第2動きベクトル検出部110は、符号化対象のマクロブロックの位置に対応するアドレスに基づいて、メモリ107から参照すべき周囲マクロブロックMBBの情報を読み出すことができる。第2動きベクトル検出部110は、読み出された周囲マクロブロックMBBの動きベクトルMVBを符号化対象のマクロブロックの上側領域に対する第2動きベクトルMV2とする。   Various types of encoded macroblock information are stored in the memory 107, and the second motion vector detection unit 110 should refer to the memory 107 based on the address corresponding to the position of the macroblock to be encoded. Information on the surrounding macroblock MBB can be read. The second motion vector detection unit 110 sets the read motion vector MVB of the surrounding macroblock MBB as the second motion vector MV2 for the upper region of the macroblock to be encoded.

ここで、周囲マクロブロックMBBのマクロブロックタイプが画面内符号化(イントラ)タイプである場合には動きベクトルが存在しないため、参照する周囲マクロブロックとして左側のマクロブロックMBAまたは右斜め上のマクロブロックMBCを代わりに用いて、マクロブロックMBA、MBCの動きベクトルを符号化対象のマクロブロックの上側領域に対する第2動きベクトルMV2としてもよい。   Here, when the macroblock type of the surrounding macroblock MBB is an intra-frame coding (intra) type, there is no motion vector, so the left macroblock MBA or the macroblock on the upper right as the surrounding macroblock to be referred to MBC may be used instead, and the motion vectors of macroblocks MBA and MBC may be used as second motion vector MV2 for the upper region of the macroblock to be encoded.

図9(b)に示すように、符号化対象のマクロブロックが垂直方向に分割され、左側領域について第2動きベクトル検出部110が動きベクトルを求める場合、左側領域は左に隣接するマクロブロックMBAと類似する動きを示すことが推測されるので、第2動きベクトル検出部110は、動き情報として左のマクロブロックMBAの動きベクトルをメモリ107から読み出して参照する。第2動きベクトル検出部110は、読み出された周囲マクロブロックMBAの動きベクトルMVAを符号化対象のマクロブロックの左側領域に対する第2動きベクトルMV2とする。   As shown in FIG. 9B, when the macroblock to be encoded is divided in the vertical direction and the second motion vector detection unit 110 obtains a motion vector for the left region, the left region is a macroblock MBA adjacent to the left. Therefore, the second motion vector detection unit 110 reads out the motion vector of the left macroblock MBA as the motion information from the memory 107 and refers to it. The second motion vector detection unit 110 sets the read motion vector MVA of the surrounding macroblock MBA as the second motion vector MV2 for the left region of the macroblock to be encoded.

図10は、動きベクトルを参照する周囲マクロブロックを選択する別の方法を説明する図である。図9(a)では、符号化対象のマクロブロックの上側領域に隣接する部分が多い真上のマクロブロックMBBを選択して、そのマクロブロックMBBの動きベクトルMVBを当該上側領域に対する第2動きベクトルMV2とした。図10では、符号化済みの周囲マクロブロックの選択範囲を広げ、隣接する4つの周囲マクロブロックMBA、MBB、MBC、MBDの動きベクトルMVA、MVB、MVC、MVDを当該上側領域に対する第2動きベクトルMV2の候補とする。第2動きベクトル検出部110は、これらの4つの動きベクトルの中のいずれか一つを当該上側領域に対する第2動きベクトルMV2とする。   FIG. 10 is a diagram illustrating another method of selecting surrounding macroblocks that refer to motion vectors. In FIG. 9 (a), a macro block MBB located immediately above the upper region of the macro block to be encoded is selected, and the motion vector MVB of the macro block MBB is selected as the second motion vector for the upper region. It was set as MV2. In FIG. 10, the selection range of the encoded surrounding macroblock is expanded, and the motion vectors MVA, MVB, MVC, and MVD of four adjacent surrounding macroblocks MBA, MBB, MBC, and MBD are used as the second motion vector for the upper region. Let it be a candidate for MV2. The second motion vector detection unit 110 sets any one of these four motion vectors as the second motion vector MV2 for the upper region.

図1に戻り、本領域分割・動き補償部103は、第1動きベクトル検出部102および第2動きベクトル検出部110で検出された各仮領域の動きベクトルを用いて、メモリ107に蓄積されている参照画像から動き補償予測を行う。本領域分割・動き補償部103は、後述の手順で、各仮領域の動きベクトルから生成される複数の動き補償予測画像を合成して合成動き補償予測画像を生成する。   Returning to FIG. 1, the region segmentation / motion compensation unit 103 is stored in the memory 107 using the motion vectors of the temporary regions detected by the first motion vector detection unit 102 and the second motion vector detection unit 110. Motion compensation prediction is performed from the reference image. The region segmentation / motion compensation unit 103 synthesizes a plurality of motion compensated prediction images generated from the motion vectors of the temporary regions in a procedure described later to generate a combined motion compensated prediction image.

図11(a)、(b)は、仮領域毎に検出された動きベクトルから生成される動き補償予測画像を示す。図12(a)〜(c)は、各仮領域の動きベクトルから生成される動き補償予測画像を合成して得られる合成動き補償予測画像を示す。   FIGS. 11A and 11B show motion compensated prediction images generated from motion vectors detected for each temporary region. FIGS. 12A to 12C show synthesized motion compensated predicted images obtained by synthesizing motion compensated predicted images generated from the motion vectors of the temporary regions.

仮領域分割部101が、マクロブロックを図3(a)に示すように上から4画素目の水平境界で仮分割した場合を例に説明する。動きベクトル検出部102は、図5に示すように、16×4の上側領域と16×12の下側領域のそれぞれについて動きベクトルを検出した結果、符号化対象マクロブロックには2つの動きベクトル(第1、第2動きベクトル)が存在する。本領域分割・動き補償部103は、図11(a)、(b)に示すように、動きベクトル検出部102により検出された動きベクトル毎に、参照画像を用いて、仮に当該マクロブロックの大きさ(ここでは16×16)で動き補償予測した場合の画像を生成する。図11(a)は、16×4の上側領域の第1動きベクトルを用いて生成された第1動き補償予測画像であり、図11(b)は、16×12の下側領域の第2動きベクトルを用いて生成された第2動き補償予測画像である。   An example will be described in which the temporary region dividing unit 101 tentatively divides a macroblock at the horizontal boundary of the fourth pixel from the top as shown in FIG. As illustrated in FIG. 5, the motion vector detection unit 102 detects motion vectors for each of the 16 × 4 upper region and the 16 × 12 lower region, and as a result, the motion target macroblock includes two motion vectors ( There are first and second motion vectors). As shown in FIGS. 11A and 11B, the region dividing / motion compensating unit 103 uses a reference image for each motion vector detected by the motion vector detecting unit 102, and temporarily determines the size of the macroblock. Then, an image in the case of motion compensation prediction is generated at (here, 16 × 16). FIG. 11A is a first motion-compensated prediction image generated using the first motion vector of the 16 × 4 upper region, and FIG. 11B is a second image of the lower region of 16 × 12. It is the 2nd motion compensation prediction picture generated using a motion vector.

本領域分割・動き補償部103は、図11(a)、(b)に示す第1、第2動き補償予測画像を、図12に示す(a)〜(c)のいずれかのパターンに合成して合成動き補償予測画像を生成する。第1、第2動き補償予測画像は符号化対象マクロブロックと同一の大きさであり、合成動き補償予測画像を生成するために、ある境界で分割される。本領域分割・動き補償部103により決められるマクロブロックの境界を「本境界」(actual boundary)と呼び、本境界により分割されたマクロブロックの領域を「本領域」(actual region)と呼び、仮領域分割部101により決められる「仮境界」、「仮領域」と区別する。   The region segmentation / motion compensation unit 103 synthesizes the first and second motion compensated prediction images shown in FIGS. 11A and 11B into any one of the patterns (a) to (c) shown in FIG. Thus, a combined motion compensated prediction image is generated. The first and second motion compensated prediction images are the same size as the encoding target macroblock, and are divided at a certain boundary in order to generate a combined motion compensation prediction image. The boundary of the macroblock determined by the region dividing / motion compensating unit 103 is referred to as “actual boundary”, the region of the macroblock divided by the boundary is referred to as “actual region”. It is distinguished from “temporary boundary” and “temporary region” determined by the region dividing unit 101.

図12(a)〜(c)は、本領域分割・動き補償部103が決定する本境界の候補を示したものである。図12(a)は上から4画素目の水平境界を本境界とし、図12(b)は上から8画素目の水平境界を本境界とし、図12(c)は上から12画素目の水平境界を本境界として、それぞれ、本境界より上側の本領域は第1動き補償予測画像の対応する領域、本境界より下側の本領域は第2動き補償予測画像の対応する領域で表したものである。   FIGS. 12A to 12C show main boundary candidates determined by the main region dividing / motion compensating unit 103. FIG. 12A, the horizontal boundary of the fourth pixel from the top is the main boundary, FIG. 12B is the horizontal boundary of the eighth pixel from the top, and FIG. 12C is the twelfth pixel from the top. With the horizontal boundary as the main boundary, the main region above the main boundary is represented by the region corresponding to the first motion compensated prediction image, and the main region below the main boundary is represented by the region corresponding to the second motion compensated prediction image. Is.

本領域分割・動き補償部103は、エッジ強度などを表す評価値にもとづいて、本境界を決定し、決定された本境界で第1、第2動き補償予測画像を分割して合成する。   The main region dividing / motion compensating unit 103 determines the main boundary based on the evaluation value indicating the edge strength and the like, and divides and synthesizes the first and second motion compensated prediction images at the determined main boundary.

図13(a)〜(c)は、各仮領域の動きベクトルから生成される動き補償予測画像を合成して合成動き補償予測画像を生成する方法を説明する図である。本領域分割・動き補償部103は、本境界決定後、図13(a)の第1動きベクトルに対応する第1動き補償予測画像と図13(b)の第2動きベクトルに対応する第2動き補償予測画像を用いて、本境界より上の領域を第1動き補償予測画像として動き補償予測し、本境界より下の領域を第2動き補償予測画像として動き補償予測する。この例では、本境界より上の16×4の領域には、第1動き補償予測画像の対応する領域が複製され、本境界より下の16×12の領域には、第2動き補償予測画像の対応する領域が複製される。   FIGS. 13A to 13C are diagrams illustrating a method of generating a combined motion compensated prediction image by combining motion compensated prediction images generated from the motion vectors of the temporary regions. After the boundary determination, the main segmentation / motion compensation unit 103 determines the first motion compensated prediction image corresponding to the first motion vector in FIG. 13A and the second motion vector corresponding to the second motion vector in FIG. Using the motion compensated prediction image, motion compensation prediction is performed using the region above the main boundary as the first motion compensation prediction image, and the region below the main boundary is used as the second motion compensation prediction image. In this example, the corresponding region of the first motion compensated prediction image is duplicated in the 16 × 4 region above the main boundary, and the second motion compensated prediction image is reproduced in the 16 × 12 region below the main boundary. The corresponding region of is duplicated.

ここまでは2分割の例として水平方向の領域分割について説明をしたが、マクロブロック内部では必ずしも水平方向にのみ領域分割が存在するとは限らず、垂直方向に対する領域分割も考えられる。また、従来の16×16画素単位で予測を行う場合と同様にマクロブロック16×16画素内で領域分割が存在しない場合も考えられる。そのため、仮領域分割部101、第1動きベクトル検出部102、第2動きベクトル検出部110、および本領域分割・動き補償部103は、水平方向の領域分割だけでなく、垂直方向の領域分割、領域分割無しのそれぞれについて動き検出を行い、その中から最適な動きベクトルと領域分割の境界を判定する必要がある。   Up to this point, horizontal region division has been described as an example of two divisions. However, region division does not necessarily exist only in the horizontal direction inside the macroblock, and region division in the vertical direction is also conceivable. In addition, as in the case where prediction is performed in units of conventional 16 × 16 pixels, there may be a case where there is no region division within the macroblock 16 × 16 pixels. Therefore, the temporary region dividing unit 101, the first motion vector detecting unit 102, the second motion vector detecting unit 110, and the main region dividing / motion compensating unit 103 not only perform horizontal region division, but also perform vertical region division, It is necessary to perform motion detection for each of the regions without segmentation, and to determine the optimum motion vector and the region segmentation boundary.

図14は、動き検出の3つのモードと、各モードで算出された動きベクトルの中から最適値を求める処理を示すフローチャートである。水平方向への領域分割、垂直方向への領域分割および領域分割無しの各分割モードにおいて動きベクトルを検出し、各分割モードで算出された動きベクトルの中から最適値を判定する。   FIG. 14 is a flowchart showing three modes of motion detection and a process for obtaining an optimum value from motion vectors calculated in each mode. A motion vector is detected in each division mode in which the region is divided in the horizontal direction, the region is divided in the vertical direction, and no region is divided, and an optimum value is determined from the motion vectors calculated in each division mode.

太い実線で示すように、ステップS201とS202の処理は仮領域分割部101が行い、ステップS203aと203cの処理は第1動きベクトル検出部102が行い、ステップS203bの処理は第2動きベクトル検出部110が行い、ステップS204〜S209の処理は本領域分割・動き補償部103が行う。   As indicated by the bold solid line, the processing of steps S201 and S202 is performed by the temporary region dividing unit 101, the processing of steps S203a and 203c is performed by the first motion vector detecting unit 102, and the processing of step S203b is performed by the second motion vector detecting unit. 110, and the region division / motion compensation unit 103 performs the processing of steps S204 to S209.

水平分割モードにおいて、仮領域分割部101は、水平分割の仮領域検出を行う(S201)。第1動きベクトル検出部102は、分割された仮領域の内、符号化対象のマクロブロックに隣接する符号化済みの周囲マクロブロックと隣接している辺が最も少ない第1仮領域に対して、第1動きベクトルを検出する(S203a)。第2動きベクトル検出部110は、第2仮領域に対して、周囲マクロブロックの動き情報を用いて第2動きベクトルを検出する(S203b)。具体的には、水平分割の場合、真上の周囲マクロブロックの動きベクトルを第2仮領域の第2動きベクトルとする。   In the horizontal division mode, the temporary area division unit 101 performs horizontal division temporary area detection (S201). The first motion vector detection unit 102, for the first temporary region that has the fewest sides adjacent to the encoded surrounding macroblock adjacent to the encoding target macroblock among the divided temporary regions, A first motion vector is detected (S203a). The second motion vector detection unit 110 detects the second motion vector for the second temporary area using the motion information of the surrounding macroblocks (S203b). Specifically, in the case of horizontal division, the motion vector of the immediately surrounding macroblock is set as the second motion vector of the second temporary area.

同様に、垂直分割モードにおいて、仮領域分割部101は、垂直分割の仮領域検出を行う(S202)。第1動きベクトル検出部102は、分割された仮領域の内、符号化対象のマクロブロックに隣接する符号化済みの周囲マクロブロックと隣接している辺が最も少ない第1仮領域に対して、第1動きベクトルを検出する(S203a)。第2動きベクトル検出部110は、第2仮領域に対して、周囲マクロブロックの動き情報を用いて第2動きベクトルを検出する(S203b)。具体的には、垂直分割の場合、左の周囲マクロブロックの動きベクトルを第2仮領域の第2動きベクトルとする。   Similarly, in the vertical division mode, the temporary area dividing unit 101 performs vertical division temporary area detection (S202). The first motion vector detection unit 102, for the first temporary region that has the fewest sides adjacent to the encoded surrounding macroblock adjacent to the encoding target macroblock among the divided temporary regions, A first motion vector is detected (S203a). The second motion vector detection unit 110 detects the second motion vector for the second temporary area using the motion information of the surrounding macroblocks (S203b). Specifically, in the case of vertical division, the motion vector of the left surrounding macroblock is set as the second motion vector of the second temporary area.

分割無しの場合、マクロブロック内に分割境界が存在しないので、従来の16×16画素で動き検出を実施する。この処理は、水平または垂直方向の分割位置が0画素目である場合と等価であることから、第1動きベクトル検出部102が第1動きベクトルを検出する(S203c)。この場合、第2動きベクトルを持つ領域は存在しないので、第2動きベクトルは検出されない。   In the case of no division, there is no division boundary in the macroblock, so motion detection is performed with the conventional 16 × 16 pixels. Since this process is equivalent to the case where the horizontal or vertical division position is the 0th pixel, the first motion vector detection unit 102 detects the first motion vector (S203c). In this case, since there is no region having the second motion vector, the second motion vector is not detected.

本領域分割・動き補償部103は、各分割モードで検出された各仮領域の第1動きベクトルおよび第2動きベクトルを用いて、メモリ107に蓄積されている参照画像から動き補償予測を行う。   The region segmentation / motion compensation unit 103 performs motion compensation prediction from the reference image stored in the memory 107 using the first motion vector and the second motion vector of each temporary region detected in each segment mode.

水平分割モードの場合、本領域分割・動き補償部103は、本領域分割・動き補償部103は水平分割の本境界検出を行い(S204)、水平方向の本境界において、第1動きベクトルによる第1動き補償予測画像と、第2動きベクトルによる第2動き補償予測画像とを合成して合成動き補償予測画像を生成する(S206)。実施の形態1では分割方向に基づいて第2動きベクトルを決定しているので、水平分割モードの場合、第2動き補償予測画像は水平分割で得られた第2動きベクトルを用いて生成される。一方、第1動き補償予測画像は各分割モードで検出された第1動きベクトルを用いて生成されるため、3つの分割モードに対応して3種類の第1動き補償予測画像が生成される。したがって、水平分割モードの場合、3種類の第1動き補償予測画像のそれぞれに第2動き補償予測画像を合成した3種類の合成動き補償予測画像が生成される。   In the horizontal division mode, the main region division / motion compensation unit 103 performs main division detection of the horizontal division (S204), and the first motion vector based on the first motion vector is detected in the horizontal main boundary. The synthesized motion compensated predicted image is generated by synthesizing the first motion compensated predicted image and the second motion compensated predicted image based on the second motion vector (S206). Since the second motion vector is determined based on the division direction in the first embodiment, in the horizontal division mode, the second motion compensated prediction image is generated using the second motion vector obtained by the horizontal division. . On the other hand, since the first motion compensated prediction image is generated using the first motion vector detected in each division mode, three types of first motion compensation prediction images are generated corresponding to the three division modes. Therefore, in the case of the horizontal division mode, three types of synthesized motion compensated predicted images are generated by synthesizing the second motion compensated predicted image with each of the three types of first motion compensated predicted images.

垂直分割モードの場合、本領域分割・動き補償部103は、本領域分割・動き補償部103は垂直分割の本境界検出を行い(S205)、垂直方向の本境界において、第1動きベクトルによる第1動き補償予測画像と、第2動きベクトルによる第2動き補償予測画像とを合成して合成動き補償予測画像を生成する(S207)。水平分割モードの場合と同様、垂直分割で得られた第2動きベクトルを用いて第2動き補償予測画像が生成され、各分割モードで検出された第1動きベクトルを用いて3種類の第1動き補償予測画像が生成され、3種類の第1動き補償予測画像のそれぞれに第2動き補償予測画像を合成した3種類の合成動き補償予測画像が生成される。   In the case of the vertical division mode, the main region division / motion compensation unit 103 performs main division detection of the vertical division (S205), and the first motion vector based on the first motion vector is detected at the main boundary in the vertical direction. The synthesized motion compensated predicted image is generated by synthesizing the first motion compensated predicted image and the second motion compensated predicted image based on the second motion vector (S207). As in the case of the horizontal division mode, a second motion compensated prediction image is generated using the second motion vector obtained by the vertical division, and three types of first motion vectors are detected using the first motion vector detected in each division mode. A motion compensation predicted image is generated, and three types of synthesized motion compensated predicted images are generated by synthesizing the second motion compensated predicted image with each of the three types of first motion compensated predicted images.

分割無しモードの場合、本領域分割・動き補償部103は、各分割モードの第1動きベクトルのみによる3種類の動き補償予測画像が生成する(S208)。   In the non-division mode, the region division / motion compensation unit 103 generates three types of motion compensated prediction images based only on the first motion vector in each division mode (S208).

水平分割モード、垂直分割モード、分割無しモードの各モードで3種類ずつ合成動き補償予測画像が生成されるため、合計9種類の合成動き補償予測画像が生成されることになる。   Since three types of combined motion compensated prediction images are generated in each of the horizontal division mode, the vertical division mode, and the no division mode, a total of nine types of combined motion compensated prediction images are generated.

こうして生成された合成動き補償予測画像に対して、本領域分割・動き補償部103は、後述するエッジ強度などを表す評価値に基づいて、領域分割の有無、領域分割が存在するならその方向(水平または垂直方向)および領域分割位置を示す本境界を決定する(S209)。本領域分割・動き補償部103は、決定された本境界において、選択された第1および第2動きベクトルから第1および第2動き補償予測画像を生成し、それらを合成して最終的な合成動き補償予測画像を生成する。本領域分割・動き補償部103により決定された第2動きベクトル等の動き情報は、次のマクロブロックの符号化処理で利用するためにメモリ107に蓄積される。   For the synthesized motion compensated prediction image generated in this way, the region segmentation / motion compensation unit 103 determines the presence / absence of region segmentation and the direction (if any), based on an evaluation value representing edge strength, which will be described later. The main boundary indicating the horizontal or vertical direction) and the region division position is determined (S209). The main region division / motion compensation unit 103 generates first and second motion compensated prediction images from the selected first and second motion vectors at the determined main boundary, and synthesizes them to perform final synthesis. A motion compensated prediction image is generated. The motion information such as the second motion vector determined by the region division / motion compensation unit 103 is stored in the memory 107 for use in the encoding process of the next macroblock.

ここでは、本境界候補を図12(a)〜(c)の3通りとする場合を説明したが、本境界の候補をさらに増やしてもよい。ただし、後述するように、直交変換・量子化部104の直交変換サイズとの関係を十分に考慮しておく必要がある。   Here, the case has been described where the main boundary candidates are the three types of FIGS. 12A to 12C, but the main boundary candidates may be further increased. However, as described later, it is necessary to sufficiently consider the relationship with the orthogonal transform size of the orthogonal transform / quantization unit 104.

図1に戻り、減算部108は、符号化対象原画像と本領域分割・動き補償部103で算出した動き補償予測画像との差分により、予測残差成分を算出し、直交変換・量子化部104に与える。直交変換・量子化部104は、予測残差成分の直交変換・量子化を行う。   Returning to FIG. 1, the subtraction unit 108 calculates a prediction residual component based on the difference between the original image to be encoded and the motion compensated prediction image calculated by the main region division / motion compensation unit 103, and generates an orthogonal transform / quantization unit. 104. The orthogonal transform / quantization unit 104 performs orthogonal transform / quantization of the prediction residual component.

ここで、直交変換・量子化部104は、動き補償予測のサイズに対応した直交変換サイズを使用して直交変換を行う。つまり、動き補償予測のサイズとして16×4/16×8/16×12(垂直方向に4の倍数)が許容されている場合、少なくとも16×4又は8×4又は4×4(垂直方向に4の倍数)の直交変換サイズを使用できるようにする。他の例として、動き補償予測のサイズとして16×2/16×4/16×6/16×8/16×10/16×12(垂直方向に2の倍数)が許容されている場合、少なくとも16×2又は8×2又は4×2(垂直方向に2の倍数)の直交変換サイズを使用できるようにする。これにより、動き補償予測の予測誤差を直交変換する際に、直交変換する予測誤差集合の中に動き補償予測の境界が含まれることがなくなる。これにより、動き補償予測の境界をまたいだ画素を予測誤差として一緒に直交変換することによる直交変換効率の低下を防止することができ、符号化効率を一層向上させる効果を奏する。   Here, the orthogonal transform / quantization unit 104 performs orthogonal transform using an orthogonal transform size corresponding to the size of motion compensation prediction. That is, when 16 × 4/16 × 8/16 × 12 (multiple of 4 in the vertical direction) is allowed as the size of motion compensation prediction, at least 16 × 4, 8 × 4, or 4 × 4 (vertical direction) An orthogonal transform size of a multiple of 4). As another example, when 16 × 2/16 × 4/16 × 6/16 × 8/16 × 10/16 × 12 (a multiple of 2 in the vertical direction) is allowed as the size of motion compensation prediction, at least An orthogonal transform size of 16 × 2 or 8 × 2 or 4 × 2 (a multiple of 2 in the vertical direction) can be used. As a result, when the prediction error of motion compensation prediction is orthogonally transformed, the motion compensation prediction boundary is not included in the prediction error set to be orthogonally transformed. As a result, it is possible to prevent a decrease in orthogonal transform efficiency caused by performing orthogonal transform together as a prediction error on pixels that straddle the boundary of motion compensation prediction, and the effect of further improving the coding efficiency is achieved.

可変長符号化部105は、直交変換・量子化部104で直交変換・量子化された予測残差成分を可変長符号化するとともに、本領域分割・動き補償部103で選択された第1動きベクトルを可変長符号化する。第2動きベクトル検出部110で検出された第2動きベクトルは、隣接する符号化済みマクロブロックを参照して算出されたものなので、復号側で同様の処理を施すことが可能である。したがって、第2動きベクトルは符号化する必要はない。   The variable length coding unit 105 performs variable length coding on the prediction residual component orthogonally transformed and quantized by the orthogonal transformation / quantization unit 104 and also selects the first motion selected by the region division / motion compensation unit 103. Variable-length encode the vector. Since the second motion vector detected by the second motion vector detection unit 110 is calculated with reference to an adjacent encoded macroblock, the same processing can be performed on the decoding side. Therefore, the second motion vector need not be encoded.

逆量子化・逆直交変換部106は、直交変換・量子化部104によって直交変換・量子化された予測残差成分に対して、逆直交変換及び逆量子化を行う。直交変換・量子化部104と同様に、動き補償予測のサイズに対応したサイズで逆直交変換できるようにしておく。   The inverse quantization / inverse orthogonal transform unit 106 performs inverse orthogonal transform and inverse quantization on the prediction residual component orthogonally transformed / quantized by the orthogonal transform / quantization unit 104. Similar to the orthogonal transform / quantization unit 104, inverse orthogonal transform can be performed with a size corresponding to the size of motion compensation prediction.

加算部109は、逆量子化・逆直交変換部106により復号された予測残差成分と、本領域分割・動き補償部103により算出された動き補償予測画像とを加算することで参照画像を生成し、メモリ107に格納する。   The adding unit 109 generates a reference image by adding the prediction residual component decoded by the inverse quantization / inverse orthogonal transform unit 106 and the motion compensated prediction image calculated by the region division / motion compensation unit 103. And stored in the memory 107.

図2は、実施の形態1の動画像復号装置の構成を示すブロック図である。実施の形態1の動画像復号装置は、可変長復号部201、本領域分割・動き補償部203、逆量子化・逆直交変換部206、加算部209、メモリ207、および動きベクトル検出部210を備える。   FIG. 2 is a block diagram illustrating a configuration of the moving picture decoding apparatus according to the first embodiment. The moving image decoding apparatus according to Embodiment 1 includes a variable length decoding unit 201, a main region division / motion compensation unit 203, an inverse quantization / inverse orthogonal transform unit 206, an addition unit 209, a memory 207, and a motion vector detection unit 210. Prepare.

可変長復号部201は、直交変換・量子化されている予測残差成分信号及び動きベクトルを可変長復号する。図1の動画像符号化装置により符号化されたビットストリームでは、マクロブロックに対して1つの動きベクトルが符号化されており、後述する動きベクトル検出部210により検出される動きベクトル(「第2動きベクトル」)との混同を避ける為、ここでは符号化ストリームから復号される動きベクトルを「第1動きベクトル」と呼ぶことにする。   The variable length decoding unit 201 performs variable length decoding on the prediction residual component signal and the motion vector that have been orthogonally transformed and quantized. In the bit stream encoded by the moving image encoding device in FIG. 1, one motion vector is encoded for a macroblock, and a motion vector (“second” detected by a motion vector detection unit 210 described later is included. In order to avoid confusion with the “motion vector”), a motion vector decoded from the encoded stream is referred to as a “first motion vector”.

本領域分割・動き補償部203は、図1の動画像符号化装置の本領域分割・動き補償部103と同一の機能を持ち、可変長復号部201で復号された第1動きベクトルと動きベクトル検出部210により検出された第2動きベクトルとを用いてメモリ207に蓄積されている参照画像から動き補償予測を行う。本領域分割・動き補償部203は、図1の動画像符号化装置の本領域分割・動き補償部103と同様の手順で、各分割領域の動きベクトルから生成される複数の動き補償予測画像を合成して合成動き補償予測画像を生成する。   The region segmentation / motion compensation unit 203 has the same function as the region segmentation / motion compensation unit 103 of the moving image encoding apparatus in FIG. 1, and the first motion vector and motion vector decoded by the variable length decoding unit 201. Using the second motion vector detected by the detection unit 210, motion compensation prediction is performed from the reference image stored in the memory 207. The region segmentation / motion compensation unit 203 performs a plurality of motion compensated prediction images generated from the motion vectors of each segment region in the same procedure as the region segmentation / motion compensation unit 103 of the video encoding device in FIG. A combined motion compensated prediction image is generated by combining.

逆量子化・逆直交変換部206は、図1の動画像符号化装置の逆量子化・逆直交変換部106と同一の機能を持ち、可変長復号部201で復号された予測残差成分に対して逆直交変換及び逆量子化を行う。   The inverse quantization / inverse orthogonal transform unit 206 has the same function as the inverse quantization / inverse orthogonal transform unit 106 of the moving image coding apparatus in FIG. 1, and uses the prediction residual component decoded by the variable length decoding unit 201. On the other hand, inverse orthogonal transform and inverse quantization are performed.

加算部209は、逆量子化・逆直交変換部206により復号された予測残差成分と、本領域分割・動き補償部203により算出された動き補償予測画像とを加算することにより、画像信号を復号する。メモリ207は、図1の動画像符号化装置のメモリ107と同一であり、復号された参照画像および復号済みの動きベクトル等の各種情報を蓄積する。   The addition unit 209 adds the prediction residual component decoded by the inverse quantization / inverse orthogonal transformation unit 206 and the motion compensated prediction image calculated by the region division / motion compensation unit 203, thereby obtaining an image signal. Decrypt. The memory 207 is the same as the memory 107 of the moving image encoding apparatus in FIG. 1 and stores various information such as a decoded reference image and a decoded motion vector.

動きベクトル検出部210は、図1の動画像符号化装置の第2動きベクトル検出部110と同一の機能を持ち、メモリ207に蓄積された復号対象のマクロブロックに隣接するマクロブロックの動き情報を利用して第2動きベクトルを検出する。   The motion vector detection unit 210 has the same function as that of the second motion vector detection unit 110 of the moving picture encoding device in FIG. 1, and the motion information of the macroblock adjacent to the decoding target macroblock stored in the memory 207 The second motion vector is detected using this.

以上の構成による動画像符号化装置及び動画像復号装置で共通する動作、特に、本領域分割・動き補償部103及び本領域分割・動き補償部203の動作を説明する。   Operations common to the moving image encoding apparatus and the moving image decoding apparatus having the above-described configuration, particularly operations of the region dividing / motion compensating unit 103 and the region dividing / motion compensating unit 203 will be described.

動画像符号化装置の本領域分割・動き補償部103と動画像復号装置の本領域分割・動き補償部203の基本的な動作は同じであるが、符号化装置では最適な本分割領域を検出するための候補となる各分割モードの第1動きベクトルがあり、復号装置では第1動きベクトルがビットストリームから復号されたものしかない点が異なる。そのため、符号化側の本領域分割・動き補償部103では、復号側の本領域分割・動き補償部203に対して、各分割モードで得られた第1動きベクトルを指定する処理部、その第1動きベクトルを用いて生成された動き補償予測画像から得られる評価値と以前に処理した評価値最小の分割モードの第1動きベクトルやその他の情報を記録しておく記憶部、以上の処理を分割モード毎に実施するためのループ処理部を備える点が異なる。   The basic operation of the main region division / motion compensation unit 103 of the moving image encoding device and the main region division / motion compensation unit 203 of the moving image decoding device are the same, but the encoding device detects an optimal main division region. There is a first motion vector of each division mode that is a candidate for the operation, and the decoding apparatus is different in that only the first motion vector is decoded from the bit stream. For this reason, the encoding-side main region division / motion compensation unit 103 specifies a first motion vector obtained in each division mode for the decoding-side main region division / motion compensation unit 203, A storage unit for recording an evaluation value obtained from a motion compensated prediction image generated using one motion vector, a first motion vector of a division mode with the smallest evaluation value previously processed, and other information, and the above processing The difference is that a loop processing unit is provided for each division mode.

また、動画像復号装置では、図14のステップS201とS202の処理を行う仮領域分割部101がないため、動画像復号装置の動きベクトル検出部210は、本領域分割・動き補償部203において求めようとする境界候補の方向を決定し、その方向に応じて復号対象ブロックに隣接する復号済みブロックの中からブロックを選択し、選択されたブロックの動き情報を用いて動きベクトルを検出すると共に、決定した境界候補の方向に関する情報を本領域分割・動き補償部203に供給し、本領域分割・動き補償部203が最終的に最適な境界の方向と位置を決定することになる。   Further, since the moving image decoding apparatus does not include the temporary area dividing unit 101 that performs the processes of steps S201 and S202 in FIG. 14, the motion vector detecting unit 210 of the moving image decoding apparatus is obtained by the main area dividing / motion compensating unit 203. The direction of the boundary candidate to be determined is determined, a block is selected from among the decoded blocks adjacent to the decoding target block according to the direction, a motion vector is detected using the motion information of the selected block, and Information on the determined boundary candidate direction is supplied to the region dividing / motion compensating unit 203, and the region dividing / motion compensating unit 203 finally determines the optimum boundary direction and position.

以下では、本領域分割・動き補償部103及び本領域分割・動き補償部203との共通部分となる本領域の決定手順について説明する。   In the following, a procedure for determining a main region that is a common part of the main region dividing / motion compensating unit 103 and the main region dividing / motion compensating unit 203 will be described.

図15は、本領域分割・動き補償部103による本領域の決定手順を説明するフローチャートである。   FIG. 15 is a flowchart for explaining the determination procedure of the main region by the main region division / motion compensation unit 103.

まず、仮領域分割部101により分割されたN個(N≧2)の仮領域毎に動きベクトルを検出する。ここではN=2とする。第1動きベクトル検出部102で検出した第1動きベクトルを用いて、マクロブロックと同一の大きさで動き補償予測し、第1動き補償予測画像を生成する(S01)。第2動きベクトル検出部110で検出した第2動きベクトルを用いて、マクロブロックと同一の大きさで動き補償予測し、第2動き補償予測画像を生成する(S02)。   First, a motion vector is detected for each of N (N ≧ 2) temporary regions divided by the temporary region dividing unit 101. Here, N = 2. Using the first motion vector detected by the first motion vector detection unit 102, motion compensation prediction is performed with the same size as the macroblock, and a first motion compensation predicted image is generated (S01). Using the second motion vector detected by the second motion vector detection unit 110, motion compensation prediction is performed with the same size as the macroblock, and a second motion compensation predicted image is generated (S02).

次に、本境界の候補すなわちマクロブロック内を分割する位置の候補を設定する。水平方向の分割の場合、マクロブロックの左隅の画素から下に0〜15番目の画素、垂直方向の分割の場合、左隅の画素から右に0〜15番目の画素を、分割位置の候補として設定する。   Next, a candidate for this boundary, that is, a candidate for a position to divide the macroblock is set. In the case of horizontal division, 0-15th pixels below the left corner pixel of the macroblock are set as candidates for division positions, and in the case of vertical division, the 0-15th pixels rightward from the left corner pixels are set as candidates for division positions. To do.

水平または垂直方向の領域分割により境界判定した結果、本境界が隣接する周囲マクロブロックとの境界と一致する場合は分割無しと判定されるが、この場合の分割位置は0番目の画素に相当する。分割位置が0番目の画素の場合は、隣接する周囲マクロブロックとの境界判定を行うため、以下のアクティビティ算出のステップ(S004〜S007)において、境界を跨ぐ画素間の差分を算出する際、隣接する周囲マクロブロックの画素値を取得する処理が必要となる。   As a result of the boundary determination by horizontal or vertical region division, if this boundary coincides with the boundary with the adjacent surrounding macroblock, it is determined that there is no division. In this case, the division position corresponds to the 0th pixel. . When the division position is the 0th pixel, in order to determine the boundary with the adjacent surrounding macroblock, when calculating the difference between the pixels across the boundary in the following activity calculation steps (S004 to S007), Processing to acquire the pixel values of the surrounding macroblocks is necessary.

設定された本境界の各候補について、図16(a)〜(d)に示す第1〜第4アクティビティを算出する(S03〜S06)。ただし、ステップS03〜S06は順不同で行うことが可能である。また、ステップS03〜S06のすべてを行わずに、境界評価に使用したいアクティビティだけを算出することももちろん可能である。   The first to fourth activities shown in FIGS. 16A to 16D are calculated for each candidate of the set main boundary (S03 to S06). However, steps S03 to S06 can be performed in any order. Further, it is of course possible to calculate only the activity that is desired to be used for boundary evaluation without performing all of steps S03 to S06.

まず、図16(a)のように、第1動き補償予測画像について、本境界候補に関する境界アクティビティ(第1アクティビティ)を算出する(S03)。ここで、アクティビティには本境界候補をまたぐ2画素間の絶対差分和(SAD)を用いる。第1アクティビティは物体のエッジなどで値が大きくなるため、値が大きいほど該当境界で領域を分割した方が動き補償予測の予測効率が向上する。同様に、図16(b)のように、第2動き補償予測画像について、本境界候補に関する境界アクティビティ(第2アクティビティ)を算出する(S04)。第2アクティビティは第1アクティビティと同様に、値が大きいほど該当境界で領域を分割した方が動き補償予測の予測効率が向上する。   First, as shown in FIG. 16A, a boundary activity (first activity) related to the boundary candidate is calculated for the first motion compensated prediction image (S03). Here, the absolute difference sum (SAD) between two pixels straddling the boundary candidate is used for the activity. Since the value of the first activity increases at the edge of the object, the prediction efficiency of the motion compensation prediction is improved by dividing the region at the corresponding boundary as the value increases. Similarly, as shown in FIG. 16B, a boundary activity (second activity) regarding the boundary candidate is calculated for the second motion compensated prediction image (S04). Similar to the first activity, the second activity improves the prediction efficiency of motion compensation prediction by dividing the region at the corresponding boundary as the value increases.

続いて、図16(c)のように、マクロブロック内の本境界候補より上の領域を第1動き補償予測画像として動き補償予測し、本境界候補より下の領域を第2動き補償予測画像として合成した合成動き補償予測画像について、本境界候補に関する境界アクティビティ(第3アクティビティ)を算出する(S05)。第3アクティビティは本境界候補をまたぐ2画素間の絶対差分和であるから、本境界候補の上下に位置する第1動き補償予測画像の画素と第2動き補償予測画像の画素の値の絶対差分の和になる。したがって、第3アクティビティは値が小さいほど、合成動き補償予測画像の境界が滑らかになり、予測誤差信号に高周波成分が発生しにくいため、動き補償予測の予測効率が向上する。   Subsequently, as shown in FIG. 16C, motion compensation prediction is performed using the region above the main boundary candidate in the macroblock as the first motion compensated prediction image, and the region below the main boundary candidate is the second motion compensated prediction image. As for the synthesized motion compensated prediction image synthesized as follows, a boundary activity (third activity) related to this boundary candidate is calculated (S05). Since the third activity is the sum of absolute differences between two pixels straddling the boundary candidate, the absolute difference between the values of the pixels of the first motion compensated prediction image and the pixels of the second motion compensated prediction image located above and below the boundary candidate. The sum of Therefore, the smaller the value of the third activity, the smoother the boundary of the synthesized motion compensated prediction image, and the high frequency component is less likely to be generated in the prediction error signal, so that the prediction efficiency of motion compensation prediction is improved.

最後に、図16(d)のように、第1動き補償予測画像と第2動き補償予測画像の差分画像について、本境界候補に関する境界アクティビティ(第4アクティビティ)を算出する(S06)。第4アクティビティは、物体の境界などで値が大きくなるため、値が大きいほど該当境界で領域を分割した方が動き補償予測の予測効率が向上する。   Finally, as shown in FIG. 16D, a boundary activity (fourth activity) regarding the boundary candidate is calculated for the difference image between the first motion compensated predicted image and the second motion compensated predicted image (S06). Since the value of the fourth activity increases at the boundary of the object, the prediction efficiency of the motion compensation prediction is improved by dividing the region at the boundary as the value increases.

境界評価に使用するアクティビティをすべて算出した後に、予め定義した評価値を用いて本境界候補を評価する(S07)。例えば、評価値は以下のように定義する。
評価値=−A*ACT1−B*ACT2+C*ACT3−D*ACT4
ここで、ACT1は第1アクティビティ値を表し、ACT2は第2アクティビティ値を表し、ACT3は第3アクティビティ値を表し、ACT4は第4アクティビティ値を表す。また、A,B,C,Dはそれぞれ0以上の定数である。
After all the activities used for the boundary evaluation are calculated, this boundary candidate is evaluated using a predefined evaluation value (S07). For example, the evaluation value is defined as follows.
Evaluation value = −A * ACT1-B * ACT2 + C * ACT3-D * ACT4
Here, ACT1 represents a first activity value, ACT2 represents a second activity value, ACT3 represents a third activity value, and ACT4 represents a fourth activity value. A, B, C, and D are constants of 0 or more.

上記評価値をすべての本境界候補について算出し、最小値を持つ本境界候補を最終的な本境界に決定する(S08)。   The evaluation value is calculated for all main boundary candidates, and the main boundary candidate having the minimum value is determined as the final main boundary (S08).

ここで、本境界と仮境界は同一になることが望ましいが、決定された本境界は必ずしも仮境界とは同一にならない。動きベクトル検出用の仮境界は、符号化側で最適な動きベクトルを求めるための境界であり、符号化側のみ利用可能な符号化対象原画像も使用して算出することができる。一方、本境界は符号化側・復号側共に一意的に算出可能でなければならず、算出した(復号側では伝送されてきた)動きベクトルと、その動き補償予測画像(すなわち予測残差成分が加算される前の画像)で判断している。そのため、本境界と仮境界は同一でなくても符号化側と復号側のミスマッチなどは発生しない。   Here, it is desirable that the main boundary and the temporary boundary are the same, but the determined main boundary is not necessarily the same as the temporary boundary. The temporary boundary for motion vector detection is a boundary for obtaining an optimal motion vector on the encoding side, and can be calculated using an original image to be encoded that can be used only on the encoding side. On the other hand, this boundary must be uniquely calculated on both the encoding side and the decoding side, and the calculated motion vector (transmitted on the decoding side) and its motion compensated prediction image (that is, the prediction residual component) Image before addition). For this reason, there is no mismatch between the encoding side and the decoding side even if the main boundary and the temporary boundary are not the same.

(実施の形態2)
実施の形態2の動画像符号化装置は、図1に示される実施の形態1の動画像符号化装置と同一の構成であるが、第2動きベクトル検出部110における第2動きベクトルの検出方法が異なる。
(Embodiment 2)
The moving picture coding apparatus according to the second embodiment has the same configuration as that of the moving picture coding apparatus according to the first embodiment shown in FIG. 1, but the second motion vector detecting unit 110 detects the second motion vector. Is different.

図17(a)、(b)は、実施の形態2の動画像符号化装置の第2動きベクトル検出部110による第2動きベクトルの検出方法を説明する図である。   FIGS. 17A and 17B are diagrams illustrating a second motion vector detection method performed by the second motion vector detection unit 110 of the video encoding device according to the second embodiment.

図17(a)で示すように、符号化対象のマクロブロックに隣接する周囲マクロブロックとして、左隣のマクロブロックMBA、真上のマクロブロックMBB、および右斜め上のマクロブロックMBCの3個があり、それぞれの動きベクトルをMVA、MVBおよびMVCとする。   As shown in FIG. 17 (a), three macroblocks MBA adjacent to the left, macroblock MBB immediately above, and macroblock MBC diagonally above right are three neighboring macroblocks adjacent to the macroblock to be encoded. Yes, the respective motion vectors are MVA, MVB and MVC.

符号化対象のマクロブロックの動きベクトルを符号化する際、これらの3個の周囲マクロブロックMBA、MBBおよびMBCの動きベクトルMVA、MVBおよびMVCから中間値ベクトルPMVを決定し、符号化対象のマクロブロックの動きベクトルからPMVを減算した差分値を算出する。   When encoding the motion vector of the macroblock to be encoded, the intermediate value vector PMV is determined from the motion vectors MVA, MVB and MVC of these three surrounding macroblocks MBA, MBB and MBC, and the macro to be encoded is determined. A difference value obtained by subtracting PMV from the motion vector of the block is calculated.

図17(b)は、3個の周囲マクロブロックの動きベクトルMVA、MVBおよびMVCから中間値ベクトルPMVを求める方法を説明する図である。各周囲マクロブロックの動きベクトルのx成分およびy成分を以下のように表す。
MVA=(MVAx,MVAy)
MVB=(MVBx,MVBy)
MVC=(MVCx,MVCy)
FIG. 17B is a diagram for explaining a method of obtaining the intermediate value vector PMV from the motion vectors MVA, MVB, and MVC of three surrounding macroblocks. The x component and y component of the motion vector of each surrounding macroblock are expressed as follows.
MVA = (MVAx, MVAy)
MVB = (MVBx, MVBy)
MVC = (MVCx, MVCy)

3個の動きベクトルのX成分およびY成分のそれぞれの中間値をとることによって、図17(b)に示す事例の場合、3個の周囲マクロブロックの中間値ベクトルPMVは次のように表される。
PMV=med(MVA,MVB,MVC)=(MVAx,MVBy)
ここで、関数med()は、括弧内の動きベクトルから中間値を算出する関数である。
By taking the intermediate values of the X and Y components of the three motion vectors, the intermediate value vector PMV of the three surrounding macroblocks is expressed as follows in the case shown in FIG. The
PMV = med (MVA, MVB, MVC) = (MVAx, MVBy)
Here, the function med () is a function for calculating an intermediate value from the motion vector in parentheses.

判定された中間値ベクトルPMVは、符号化対象のマクロブロックの動きベクトルを符号化する際に中間値ベクトルPMVとの差分を取って符号化効率を上げるにために使用される値であり、動き検出を行うための参照先のピクチャ番号を持たない。そのため、中間値ベクトルPMVは、通常の動きベクトルのように動き補償予測により予測画像を生成するために用いることはできない。   The determined intermediate value vector PMV is a value used to increase the encoding efficiency by taking the difference from the intermediate value vector PMV when encoding the motion vector of the macroblock to be encoded. It does not have a reference picture number for detection. Therefore, the intermediate value vector PMV cannot be used for generating a predicted image by motion compensation prediction like a normal motion vector.

そこで、実施の形態2では、3個の周囲のマクロブロックの内、中間値ベクトルPMVに最も近い動きベクトルを持つマクロブロックを判定し、そのマクロブロックを参照先のピクチャとする。判定のために、次式のように、中間値ベクトルPMVと3個の周囲マクロブロックの動きベクトルの絶対差分和(SAD)を求める。
SADi=|MVix−PMVx|+|MViy−PMVy|
ここで、添え字iは周囲マクロブロックMBA、MBB、MBCの識別子A、B、Cのいずれかであり、PMVxおよびPMVyは中間値ベクトルPMVのx成分およびy成分を表す。
Therefore, in Embodiment 2, a macroblock having a motion vector closest to the intermediate value vector PMV among the three surrounding macroblocks is determined, and the macroblock is set as a reference destination picture. For the determination, an absolute difference sum (SAD) of the intermediate value vector PMV and the motion vectors of the three surrounding macroblocks is obtained as in the following equation.
SADi = | MVix−PMVx | + | MViy−PMVy |
Here, the subscript i is one of the identifiers A, B, and C of the surrounding macro blocks MBA, MBB, and MBC, and PMVx and PMVy represent the x component and the y component of the intermediate value vector PMV.

上式により絶対差分和SADiが最小となる周囲マクロブロックの動きベクトルを選択する。例えば、図17(b)に示す事例であれば、中間値ベクトルPMVとの絶対差分和SADiが最小となるのは、マクロブロックMBBの動きベクトルMBVであり、第2動きベクトル検出部110は、この動きベクトルMBVを符号化対象のマクロブロックの上側領域に対する第2動きベクトルとして検出する。   The motion vector of the surrounding macro block that minimizes the absolute difference sum SADi is selected by the above equation. For example, in the case shown in FIG. 17B, the absolute difference sum SADi with the intermediate value vector PMV is the minimum for the motion vector MBV of the macroblock MBB, and the second motion vector detection unit 110 This motion vector MBV is detected as the second motion vector for the upper region of the macroblock to be encoded.

ここでは、判定のための評価値として、中間値ベクトルPMVと周囲マクロブロックの動きベクトルの絶対差分和(SAD)を用いたが、中間値ベクトルPMVと周囲マクロブロックの動きベクトルの絶対自乗和(SSD)を用いてもよく、中間値ベクトルPMVと周囲マクロブロックの動きベクトルの類似度を測る尺度であれば、特に限定されない。   Here, the absolute difference sum (SAD) between the intermediate value vector PMV and the motion vectors of the surrounding macroblocks is used as the evaluation value for determination, but the absolute square sum of the intermediate value vector PMV and the motion vectors of the surrounding macroblocks ( SSD) may be used, and is not particularly limited as long as it is a scale for measuring the similarity between the intermediate value vector PMV and the motion vectors of surrounding macroblocks.

次に、実施の形態1および2の動画像符号化装置により符号化される動画像のビットストリームのシンタックスについて説明する。   Next, the syntax of a moving image bit stream encoded by the moving image encoding apparatuses according to Embodiments 1 and 2 will be described.

図18は、MPEG−4 AVCのシンタックスをベースとした第一のシンタックスパターンを示す。図18(a)のように、まず、スライス単位で予測画像の特徴量を用いて動き補償予測の形状を復号側で自動的に決定するかどうかを示す第1フラグ(use_auto_mc_size)を伝送する。第1フラグuse_auto_mc_sizeがOFFの場合は、従来通り図18(b)に示すマクロブロックタイプmb_typeに基づきマクロブロックを固定的に分割して動き補償予測を行う。第1フラグuse_auto_mc_sizeがONの場合、予測画像の特徴量を用いて動き補償予測の形状を復号側で自動的に決定して動き補償予測を行う。マクロブロック単位では、MPEG−4 AVCと同様に、mb_typeを伝送して動き補償予測の形状を判断する。   FIG. 18 shows a first syntax pattern based on the MPEG-4 AVC syntax. As shown in FIG. 18A, first, a first flag (use_auto_mc_size) indicating whether or not the shape of motion compensated prediction is automatically determined on the decoding side using the feature amount of the predicted image in units of slices is transmitted. When the first flag use_auto_mc_size is OFF, the macroblock is fixedly divided based on the macroblock type mb_type shown in FIG. 18B as before, and motion compensation prediction is performed. When the first flag use_auto_mc_size is ON, motion compensated prediction is performed by automatically determining the shape of motion compensated prediction on the decoding side using the feature amount of the predicted image. In the macro block unit, as in MPEG-4 AVC, mb_type is transmitted to determine the shape of motion compensation prediction.

図19は、スライスレベルだけでなく、マクロブロック単位でも動き補償予測の形状を復号側で自動的に決定するかどうかを示す第2フラグ(auto_mc_size_enable)を伝送する第二のシンタックスパターンを示す。第2フラグauto_mc_size_enableがOFFの場合、スライスレベルで第1フラグuse_auto_mc_sizeがOFFになった場合と同様に、従来通りマクロブロックタイプmb_typeに基づきマクロブロックを固定的に分割して動き補償予測を行う。第2フラグauto_mc_size_enableがONの場合、予測画像の特徴量を用いて動き補償予測の形状を復号側で自動的に決定して動き補償予測を行う。第二のシンタックスを用いると、マクロブロックの本境界を自動的に決定してしまうことで予測効率が低下するのを防ぐことができる。   FIG. 19 shows a second syntax pattern for transmitting a second flag (auto_mc_size_enable) indicating whether the shape of motion compensated prediction is automatically determined on the decoding side not only at the slice level but also in macroblock units. When the second flag auto_mc_size_enable is OFF, as in the case where the first flag use_auto_mc_size is OFF at the slice level, the macroblock is fixedly divided based on the macroblock type mb_type as before, and motion compensation prediction is performed. When the second flag auto_mc_size_enable is ON, motion compensated prediction is performed by automatically determining the shape of motion compensated prediction on the decoding side using the feature amount of the predicted image. When the second syntax is used, it is possible to prevent the prediction efficiency from being lowered by automatically determining the main boundary of the macroblock.

図20は、スライスレベルで動き補償予測の形状を復号側で自動的に決定するアルゴリズムを切り替える第三のシンタックスパターンを示す。スライス単位で第1フラグuse_auto_mc_sizeがONの場合、動き補償予測の形状を復号側で自動的に決定するアルゴリズムタイプを示す第3フラグauto_mc_algorithmを伝送する。例えば、第3フラグauto_mc_algorithm=0の場合、第1〜第4アクティビティACT1〜ACT4のすべてを用いた評価値に基づき動き補償予測の形状を決定する。アルゴリズムタイプauto_mc_algorithm=1の場合、第4アクティビティACT4を除いた第1〜第3アクティビティACT1〜ACT3だけを用いて評価値に基づき動き補償予測の形状を決定する等である。このように、第3フラグauto_mc_algorithmの値に使用するアクティビティの種類を対応づけることで、動き補償予測の形状を決定するアルゴリズムを切り替えることができる。第三のシンタックスを用いると、符号化側で最適なアルゴリズムタイプを判断して復号側で領域の自動分割を行わせることが可能になるため、符号化効率が更に向上する。   FIG. 20 shows a third syntax pattern for switching an algorithm for automatically determining the shape of motion compensation prediction at the slice level on the decoding side. When the first flag use_auto_mc_size is ON for each slice, a third flag auto_mc_algorithm indicating the algorithm type for automatically determining the shape of motion compensated prediction on the decoding side is transmitted. For example, when the third flag auto_mc_algorithm = 0, the shape of the motion compensation prediction is determined based on the evaluation value using all of the first to fourth activities ACT1 to ACT4. When the algorithm type auto_mc_algorithm = 1, the shape of the motion compensation prediction is determined based on the evaluation value using only the first to third activities ACT1 to ACT3 excluding the fourth activity ACT4. In this way, by associating the type of activity used with the value of the third flag auto_mc_algorithm, the algorithm for determining the shape of the motion compensation prediction can be switched. When the third syntax is used, it is possible to determine an optimal algorithm type on the encoding side and to perform automatic segmentation on the decoding side, thereby further improving the encoding efficiency.

図21は、マクロブロック単位で領域分割の有無と方向を復号側で自動的に決定するかどうかを示す第4フラグboundary_direc_modeを伝送する第四のシンタックスパターンを示す。第4フラグboundary_direc_modeのシンタックスとして、2通りの手法があり、第1の手法は第4フラグboundary_direc_modeの符号量を固定とし、第4フラグboundary_direc_modeの値に対して領域分割の有無や方向を予め設定してテーブル化しておく場合であり、第2の手法は復号側において復号対象のマクロブロックに隣接する復号済みの周囲マクロブロックの状態に応じて第4フラグboundary_direc_modeの意味付けや符号量を変えて符号化することである。   FIG. 21 shows a fourth syntax pattern for transmitting a fourth flag boundary_direc_mode indicating whether or not the decoding side automatically determines the presence / absence and the direction of region division for each macroblock. There are two methods as the syntax of the fourth flag boundary_direc_mode. The first method fixes the code amount of the fourth flag boundary_direc_mode, and presets the presence / absence and direction of region division for the value of the fourth flag boundary_direc_mode. The second method is to change the meaning of the fourth flag boundary_direc_mode and the code amount according to the state of the decoded surrounding macroblock adjacent to the macroblock to be decoded on the decoding side. It is to encode.

第1の手法では、領域分割の有無を表す第1のビットと分割方向を表す第2のビットの計2ビットの組み合わせで第4フラグboundary_direc_modeを表す。図22は、第4フラグboundary_direc_modeの値の意味の一例を示したテーブルである。第4フラグboundary_direc_modeの値を10進数で表し、括弧内は2進数で表している。第4フラグboundary_direc_modeの2ビット信号のうち上位ビットが領域分割の有無を表す第1のビット、下位ビットが分割方向を表す第2のビットとして構成される。   In the first method, the fourth flag boundary_direc_mode is represented by a combination of a total of 2 bits, that is, a first bit indicating the presence or absence of area division and a second bit indicating the division direction. FIG. 22 is a table showing an example of the meaning of the value of the fourth flag boundary_direc_mode. The value of the fourth flag boundary_direc_mode is represented by a decimal number, and the value in parentheses is represented by a binary number. Of the 2-bit signal of the fourth flag boundary_direc_mode, the upper bit is configured as a first bit indicating the presence / absence of region division, and the lower bit is configured as a second bit indicating the division direction.

第4フラグboundary_direc_modeが「0」の場合、スライスレベルで第1フラグuse_auto_mc_sizeがOFFになった場合と同様であり、領域分割せず動き補償予測を行う。第2フラグauto_mc_size_enableがONの場合、第4フラグboundary_direc_modeの値に応じて、水平または垂直方向の領域分割に限定し、動き補償予測を行い、予測画像の特徴量を用いて動き補償予測の形状を復号側で自動的に決定する。   When the fourth flag boundary_direc_mode is “0”, it is the same as when the first flag use_auto_mc_size is turned OFF at the slice level, and motion compensation prediction is performed without segmentation. When the second flag auto_mc_size_enable is ON, it is limited to horizontal or vertical region division according to the value of the fourth flag boundary_direc_mode, performs motion compensation prediction, and uses the feature amount of the predicted image to change the shape of motion compensation prediction. Automatically determined on the decryption side.

第2の手法では、復号対象のマクロブロックに隣接する復号済みの周囲マクロブロックが持つ復号情報に応じて、第4フラグboundary_direc_modeの意味付けを変える。ここでは、実施の形態1において動きベクトルの参照先として判定した周囲マクロブロックの状態を一例として説明する。復号対象のマクロブロックに隣接する真上のマクロブロックと左隣のマクロブロックの状態に応じて第4フラグboundary_direc_modeの取り得る符号長と符号の意味を変える。真上のマクロブロックと左隣のマクロブロックが共に有効、すなわち動き情報を備えている場合、領域分割としては分割無し、水平方向分割、垂直方向分割の3つの可能性が考えられ、これら3つの状態をそれぞれ2ビットで表現する。例えば、分割無しは「0」、水平方向分割は「1」、垂直方向分割は「2」として表される。   In the second method, the meaning of the fourth flag boundary_direc_mode is changed according to the decoding information held by the decoded surrounding macroblock adjacent to the decoding target macroblock. Here, the state of surrounding macroblocks determined as reference destinations of motion vectors in Embodiment 1 will be described as an example. The code length and the meaning of the code that the fourth flag boundary_direc_mode can take are changed according to the state of the macroblock immediately above and the macroblock on the left adjacent to the macroblock to be decoded. When both the macroblock immediately above and the macroblock on the left are valid, that is, with motion information, there are three possibilities for area division: no division, horizontal division, and vertical division. Each state is expressed by 2 bits. For example, “0” indicates no division, “1” indicates horizontal division, and “2” indicates vertical division.

真上のマクロブロック或いは左隣のマクロブロックのどちらか一方が有効、すなわち動き情報を備えている場合、参照先として有効なマクロブロックを把握することができ、分割方向は一意に決定され、領域分割としては分割無し或いは分割有りの2つの状態に限定される。この場合、2つの状態を1ビットで表現され、例えば、分割無しを「0」、分割有りを「1」として表す。   If either the macroblock immediately above or the macroblock on the left is valid, that is, it has motion information, it is possible to grasp the valid macroblock as a reference destination, the division direction is uniquely determined, and the region The division is limited to two states with no division or with division. In this case, the two states are represented by 1 bit, for example, “0” indicates no division and “1” indicates that there is division.

真上のマクロブロックと左隣のマクロブロックが共に無効、例えば共にマクロブロックのタイプが画面内符号化モード(イントラモード)であり、動き情報が存在しないから場合、領域分割処理を実施しないことが一意に決定される。この場合、第4フラグboundary_direc_modeは伝送しないこととなり、スライスレベルで第1フラグuse_auto_mc_sizeがOFFになった場合と同様であり、領域分割せず動き補償予測を行う。   If the macroblock directly above and the macroblock on the left are both invalid, for example, if the type of both macroblocks is the intra-frame coding mode (intra mode) and there is no motion information, the region division process may not be performed. Determined uniquely. In this case, the fourth flag boundary_direc_mode is not transmitted, and is the same as when the first flag use_auto_mc_size is turned OFF at the slice level, and motion compensation prediction is performed without segmentation.

第四のシンタックスを用いると、本境界の決定を復号側で自動決定する処理の効率を向上させる共に、復号側で本境界を誤って判定することを防止することができる。   When the fourth syntax is used, it is possible to improve the efficiency of the process of automatically determining the main boundary on the decoding side and to prevent the decoding side from erroneously determining the main boundary.

以上述べたように、本発明の実施の形態によれば、符号化対象のマクロブロックに対して領域分割を行い、符号化済みの周囲のマクロブロックの動き情報を利用して動き補償予測をすることで、動き情報の伝送に必要な符号量を抑えるとともに、分割された各領域において適切な動き補償が行われ、予測誤差を削減することができ、符号化効率及び画質の向上が実現される。   As described above, according to the embodiment of the present invention, region division is performed on a macroblock to be encoded, and motion compensation prediction is performed using motion information of surrounding macroblocks that have been encoded. As a result, the amount of code required for transmission of motion information is suppressed, and appropriate motion compensation is performed in each divided region, so that prediction errors can be reduced, and encoding efficiency and image quality are improved. .

実施の形態では、MPEGのPピクチャ等で用いられる片方向予測について説明してきたが、Bピクチャ等で用いられる双方向予測(通常は前方向予測と後方向予測)に対しても本発明は適用可能である。   In the embodiment, unidirectional prediction used in MPEG P pictures and the like has been described, but the present invention is also applied to bidirectional prediction (usually forward prediction and backward prediction) used in B pictures and the like. Is possible.

また、実施の形態では、符号化装置の第2動きベクトル検出部110および復号装置の動きベクトル検出部210において、符号化対象のマクロブロックが参照する周囲マクロブロックを同一ピクチャ内で隣接するマクロブロックから選択したが、時間的に近いピクチャから選択してもよい。例えば、符号化対象のマクロブロックと同位置にある時間的に近いピクチャのマクロブロックの動き情報を用いて、第2動きベクトルを検出する等の方法が考えられる。   In the embodiment, in the second motion vector detection unit 110 of the encoding device and the motion vector detection unit 210 of the decoding device, neighboring macroblocks referred to by the macroblock to be encoded are adjacent to each other in the same picture. However, it may be selected from pictures that are close in time. For example, a method of detecting the second motion vector using the motion information of a macroblock of a picture close in time that is at the same position as the macroblock to be encoded can be considered.

以上の符号化及び復号に関する処理は、ハードウェアを用いた伝送、蓄積、受信装置として実現することができるのは勿論のこと、ROM(リード・オンリ・メモリ)やフラッシュメモリ等に記憶されているファームウェアや、コンピュータ等のソフトウェアによっても実現することができる。そのファームウェアプログラム、ソフトウェアプログラムをコンピュータ等で読み取り可能な記録媒体に記録して提供することも、有線あるいは無線のネットワークを通してサーバから提供することも、地上波あるいは衛星ディジタル放送のデータ放送として提供することも可能である。   The above processing relating to encoding and decoding can be realized as a transmission, storage, and reception device using hardware, and is stored in a ROM (Read Only Memory), a flash memory, or the like. It can also be realized by firmware or software such as a computer. The firmware program and software program can be recorded on a computer-readable recording medium, provided from a server through a wired or wireless network, or provided as a data broadcast of terrestrial or satellite digital broadcasting Is also possible.

以上、本発明を実施の形態をもとに説明した。実施の形態は例示であり、それらの各構成要素や各処理プロセスの組合せにいろいろな変形例が可能なこと、またそうした変形例も本発明の範囲にあることは当業者に理解されるところである。   The present invention has been described based on the embodiments. The embodiments are exemplifications, and it will be understood by those skilled in the art that various modifications can be made to combinations of the respective constituent elements and processing processes, and such modifications are within the scope of the present invention. .

101 仮領域分割部、 102 第1動きベクトル検出部、 103 本領域分割・動き補償部、 104 直交変換・量子化部、 105 可変長符号化部、 106 逆量子化・逆直交変換部、 107 メモリ、 108 減算部、 109 加算部、 110 第2動きベクトル検出部、 201 可変長復号部、 203 本領域分割・動き補償部、 206 逆量子化・逆直交変換部、 207 メモリ、 209 加算部、 210 動きベクトル検出部。   101 Temporary region dividing unit, 102 First motion vector detecting unit, 103 Region dividing / motion compensating unit, 104 Orthogonal transformation / quantization unit, 105 Variable length coding unit, 106 Inverse quantization / inverse orthogonal transformation unit, 107 Memory , 108 subtraction unit, 109 addition unit, 110 second motion vector detection unit, 201 variable length decoding unit, 203 area division / motion compensation unit, 206 inverse quantization / inverse orthogonal transform unit, 207 memory, 209 addition unit, 210 Motion vector detection unit.

Claims (6)

符号化対象ブロックを所定の仮境界で複数の仮領域に分割する仮領域分割部と、
前記符号化対象ブロックに隣接する符号化済みブロックと接している部分が最も少ない第1の仮領域の動きベクトルを、画像間の動き推定により検出する第1の動きベクトル検出部と、
前記第1の仮領域以外の仮領域のそれぞれに対して、前記符号化対象ブロックに隣接する符号化済みブロックの動き情報を用いて動きベクトルを検出する第2の動きベクトル検出部と、
各仮領域の動きベクトルを用いて、参照画像から前記符号化対象ブロックに対応した複数の予測ブロックを生成し、複数の予測ブロックのアクティビティに基づいて本境界を決定し、前記各予測ブロックを前記本境界で分割して得た領域を前記各予測ブロック間で結合させることにより、合成予測ブロックを生成する動き補償部と、
前記合成予測ブロックを前記符号化対象ブロックより減算した予測差分ブロックと、第1の仮領域の動きベクトルとを符号化する符号化部とを備えることを特徴とする動画像符号化装置。
A temporary area dividing unit that divides the encoding target block into a plurality of temporary areas at a predetermined temporary boundary;
A first motion vector detection unit that detects a motion vector of a first temporary region that has a minimum portion in contact with an encoded block adjacent to the encoding target block by motion estimation between images;
A second motion vector detection unit that detects a motion vector using motion information of an encoded block adjacent to the encoding target block for each of the temporary regions other than the first temporary region;
A plurality of prediction blocks corresponding to the coding target block is generated from a reference image using a motion vector of each temporary region, a main boundary is determined based on activities of the plurality of prediction blocks, and each prediction block is A motion compensation unit that generates a combined prediction block by combining regions obtained by dividing the boundary between the prediction blocks;
A moving picture encoding apparatus comprising: a prediction difference block obtained by subtracting the combined prediction block from the encoding target block; and an encoding unit that encodes a motion vector of a first temporary area.
前記第2の動きベクトル検出部は、前記仮領域分割部によって分割される前記符号化対象ブロックの分割方向に応じて、前記符号化対象ブロックに隣接する符号化済みブロックの中からブロックを選択し、選択されたブロックの動き情報を用いて動きベクトルを検出する請求項1に記載の動画像符号化装置。   The second motion vector detection unit selects a block from encoded blocks adjacent to the encoding target block according to a division direction of the encoding target block divided by the temporary region dividing unit. The moving picture coding apparatus according to claim 1, wherein a motion vector is detected using the motion information of the selected block. 前記第2の動きベクトル検出部は、前記符号化対象ブロックに隣接する符号化済みブロックの動きベクトルから中間値ベクトルを生成し、前記符号化対象ブロックに隣接する符号化済みブロックの中から当該中間値ベクトルに最も近い動きベクトルを持つブロックを選択し、選択されたブロックの動き情報を用いて動きベクトルを検出する請求項1に記載の動画像符号化装置。   The second motion vector detection unit generates an intermediate value vector from a motion vector of an encoded block adjacent to the encoding target block, and selects the intermediate vector from the encoded blocks adjacent to the encoding target block. The moving picture coding apparatus according to claim 1, wherein a block having a motion vector closest to a value vector is selected, and a motion vector is detected using motion information of the selected block. 前記予測ブロックのアクティビティは、前記予測ブロックが分割される本境界を介して隣接するそれぞれの画素の画素値を評価した境界アクティビティであることを特徴とする請求項1から3のいずれかに記載の動画像符号化装置。   The activity of the prediction block is a boundary activity obtained by evaluating a pixel value of each pixel adjacent through a main boundary into which the prediction block is divided. Video encoding device. 符号化対象ブロックを所定の仮境界で複数の仮領域に分割するステップと、
前記符号化対象ブロックに隣接する符号化済みブロックと接している部分が最も少ない第1の仮領域の動きベクトルを、画像間の動き推定により検出するステップと、
前記第1の仮領域以外の仮領域のそれぞれに対して、前記符号化対象ブロックに隣接する符号化済みブロックの動き情報を用いて動きベクトルを検出するステップと、
各仮領域の動きベクトルを用いて、参照画像から前記符号化対象ブロックに対応した複数の予測ブロックを生成し、複数の予測ブロックのアクティビティに基づいて本境界を決定し、前記各予測ブロックを前記本境界で分割して得た領域を前記各予測ブロック間で結合させることにより、合成予測ブロックを生成するステップと、
前記合成予測ブロックを前記符号化対象ブロックより減算した予測差分ブロックと、第1の仮領域の動きベクトルとを符号化するステップとを備えることを特徴とする動画像符号化方法。
Dividing the block to be encoded into a plurality of temporary regions at a predetermined temporary boundary;
Detecting a motion vector of a first provisional region having a minimum portion in contact with an encoded block adjacent to the encoding target block by motion estimation between images;
Detecting a motion vector using motion information of an encoded block adjacent to the encoding target block for each of the temporary regions other than the first temporary region;
A plurality of prediction blocks corresponding to the coding target block is generated from a reference image using a motion vector of each temporary region, a main boundary is determined based on activities of the plurality of prediction blocks, and each prediction block is Generating a synthesized prediction block by combining regions obtained by dividing at the boundary between the prediction blocks;
A moving picture coding method comprising: a prediction difference block obtained by subtracting the combined prediction block from the coding target block; and a step of coding a motion vector of a first temporary area.
符号化対象ブロックを所定の仮境界で複数の仮領域に分割する機能と、
前記符号化対象ブロックに隣接する符号化済みブロックと接している部分が最も少ない第1の仮領域の動きベクトルを、画像間の動き推定により検出する機能と、
前記第1の仮領域以外の仮領域のそれぞれに対して、前記符号化対象ブロックに隣接する符号化済みブロックの動き情報を用いて動きベクトルを検出する機能と、
各仮領域の動きベクトルを用いて、参照画像から前記符号化対象ブロックに対応した複数の予測ブロックを生成し、複数の予測ブロックのアクティビティに基づいて本境界を決定し、前記各予測ブロックを前記本境界で分割して得た領域を前記各予測ブロック間で結合させることにより、合成予測ブロックを生成する機能と、
前記合成予測ブロックを前記符号化対象ブロックより減算した予測差分ブロックと、第1の仮領域の動きベクトルとを符号化する機能とをコンピュータに実現させることを特徴とする動画像符号化プログラム。
A function of dividing the block to be encoded into a plurality of temporary areas at a predetermined temporary boundary;
A function of detecting a motion vector of a first temporary region with a minimum portion in contact with an encoded block adjacent to the encoding target block by motion estimation between images;
A function for detecting a motion vector using motion information of an encoded block adjacent to the encoding target block for each of the temporary regions other than the first temporary region;
A plurality of prediction blocks corresponding to the coding target block is generated from a reference image using a motion vector of each temporary region, a main boundary is determined based on activities of the plurality of prediction blocks, and each prediction block is A function of generating a combined prediction block by combining regions obtained by dividing at the boundary between the prediction blocks;
A moving picture coding program that causes a computer to realize a prediction difference block obtained by subtracting the synthesized prediction block from the coding target block and a motion vector of a first temporary area.
JP2010260428A 2010-11-22 2010-11-22 Moving picture coding apparatus, moving picture coding method, and moving picture coding program Active JP5206772B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010260428A JP5206772B2 (en) 2010-11-22 2010-11-22 Moving picture coding apparatus, moving picture coding method, and moving picture coding program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010260428A JP5206772B2 (en) 2010-11-22 2010-11-22 Moving picture coding apparatus, moving picture coding method, and moving picture coding program

Publications (2)

Publication Number Publication Date
JP2012114590A JP2012114590A (en) 2012-06-14
JP5206772B2 true JP5206772B2 (en) 2013-06-12

Family

ID=46498341

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010260428A Active JP5206772B2 (en) 2010-11-22 2010-11-22 Moving picture coding apparatus, moving picture coding method, and moving picture coding program

Country Status (1)

Country Link
JP (1) JP5206772B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11544034B2 (en) 2017-10-16 2023-01-03 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Method for setting parameters for individual adaptation of an audio signal

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6248648B2 (en) * 2014-01-23 2017-12-20 富士通株式会社 Information processing apparatus, coding unit selection method, and program
WO2018008678A1 (en) * 2016-07-08 2018-01-11 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ Decoding device, coding device, decoding method and coding method

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2507199B2 (en) * 1991-06-17 1996-06-12 松下電器産業株式会社 Image coding method and apparatus
JP2003348597A (en) * 2002-05-29 2003-12-05 Sony Corp Device and method for encoding image
JP4437772B2 (en) * 2004-06-30 2010-03-24 シャープ株式会社 Image processing system, image processing method, program, and recording medium therefor
EP1809041A1 (en) * 2006-01-11 2007-07-18 Mitsubishi Electric Information Technology Centre Europe B.V. Error concealement for scalable video coding
JP4649355B2 (en) * 2006-03-27 2011-03-09 富士通株式会社 Block noise detection method and apparatus, and block noise reduction method and apparatus
JP2009147807A (en) * 2007-12-17 2009-07-02 Fujifilm Corp Image processing apparatus
PL3567855T3 (en) * 2009-03-23 2023-03-13 Ntt Docomo, Inc. Image predictive encoding device, image predictive encoding method, image predictive encoding program, image predictive decoding device, image predictive decoding method, and image predictive decoding program
US8218869B2 (en) * 2009-03-29 2012-07-10 Mitsubishi Electric Research Laboratories, Inc. Image segmentation using spatial random walks
KR20140017018A (en) * 2010-04-07 2014-02-10 가부시키가이샤 제이브이씨 켄우드 Moving image encoding device, moving image encoding method, moving image encoding program, moving image decoding device, moving image decoding method, and moving image decoding program
US9100655B2 (en) * 2010-04-13 2015-08-04 Panasonic Intellectual Property Corporation Of America Motion compensation method, image decoding method, image coding method, motion compensation apparatus, program, and integrated circuit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11544034B2 (en) 2017-10-16 2023-01-03 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Method for setting parameters for individual adaptation of an audio signal

Also Published As

Publication number Publication date
JP2012114590A (en) 2012-06-14

Similar Documents

Publication Publication Date Title
JP6679782B2 (en) Encoding device, encoding method, decoding device, decoding method, and program
KR101420957B1 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
JP5862824B2 (en) Moving picture coding apparatus, moving picture coding method, moving picture coding program, transmission apparatus, transmission method, and transmission program
WO2011125299A1 (en) Moving image encoding device, moving image encoding method, moving image encoding program, moving image decoding device, moving image decoding method, and moving image decoding program
KR20130119465A (en) Block based sampling coding systems
JP6065088B2 (en) Moving picture coding apparatus, moving picture coding method, moving picture coding program, transmission apparatus, transmission method, and transmission program
JP2012070277A (en) Video encoding device, video encoding method and video encoding program
KR101380460B1 (en) Image processing apparatus and image processing method
JP5206772B2 (en) Moving picture coding apparatus, moving picture coding method, and moving picture coding program
JP2012070278A (en) Video decoding device, video decoding method and video decoding program
JP5206773B2 (en) Moving picture decoding apparatus, moving picture decoding method, and moving picture decoding program
JP5880758B2 (en) Moving picture decoding apparatus, moving picture decoding method, moving picture decoding program, receiving apparatus, receiving method, and receiving program
JP5513333B2 (en) Moving picture coding apparatus, moving picture coding method, and program
WO2012090425A1 (en) Moving image encoding device, moving image encoding method, and moving image encoding program, as well as moving image decoding device, moving image decoding method, and moving image decoding program
JP5880742B2 (en) Moving picture decoding apparatus, moving picture decoding method, moving picture decoding program, receiving apparatus, receiving method, and receiving program
JP5842803B2 (en) Moving picture coding apparatus, moving picture coding method, moving picture coding program, transmission apparatus, transmission method, and transmission program
JP2011234338A (en) Dynamic image decoder, dynamic image decoding method and dynamic image decoding program
JP2011254395A (en) Moving image encoding apparatus, moving image encoding method and moving image encoding program
JP2011254396A (en) Moving image decoding apparatus, moving image decoding method and moving image decoding program
JP2011234337A (en) Moving image encoding apparatus, moving image encoding method and moving image encoding program
JP2012095099A (en) Moving image encoding device, moving image encoding method, moving image encoding program, moving image decoding device, moving image decoding method, and moving image decoding program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120724

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130115

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130122

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130204

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

Free format text: PAYMENT UNTIL: 20160301

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 5206772

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150