JP2020145650A - Image decoding device and image coding device - Google Patents

Image decoding device and image coding device Download PDF

Info

Publication number
JP2020145650A
JP2020145650A JP2019042613A JP2019042613A JP2020145650A JP 2020145650 A JP2020145650 A JP 2020145650A JP 2019042613 A JP2019042613 A JP 2019042613A JP 2019042613 A JP2019042613 A JP 2019042613A JP 2020145650 A JP2020145650 A JP 2020145650A
Authority
JP
Japan
Prior art keywords
unit
prediction
sad
motion vector
dmvr
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.)
Pending
Application number
JP2019042613A
Other languages
Japanese (ja)
Inventor
瑛一 佐々木
Eiichi Sasaki
瑛一 佐々木
天洋 周
Tianyang Zhou
天洋 周
知典 橋本
Tomonori Hashimoto
知典 橋本
知宏 猪飼
Tomohiro Igai
知宏 猪飼
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.)
FG Innovation Co Ltd
Sharp Corp
Original Assignee
FG Innovation Co Ltd
Sharp 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 FG Innovation Co Ltd, Sharp Corp filed Critical FG Innovation Co Ltd
Priority to JP2019042613A priority Critical patent/JP2020145650A/en
Publication of JP2020145650A publication Critical patent/JP2020145650A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

To realize an image decoding device capable of suppressing a decrease in coding efficiency at a high compression rate.SOLUTION: A moving image decoding device includes an MMVD unit that obtains a motion vector by adding a difference vector of a predetermined distance and a predetermined direction to the motion vector, and a DMVR unit that refines the motion vector according to a plurality of cost values derived from a L0 predicted image and a L1 predicted image, and the DMVR unit sets a DMVR flag at 1 when motion information is bi-predicted, the target CU size is larger than a predetermined size, and MMVD mode is off or MMVD mode is on, and the distance of the MMVD is greater than or equal to a predetermined threshold value, and sets the DMVR flag at 0 in other cases, and derives a refinement motion vector by adding the refinement value derived from the cost value to the motion vector when the DMVR flag is 1.SELECTED DRAWING: Figure 22

Description

本発明の実施形態は、画像復号装置および画像符号化装置に関する。 Embodiments of the present invention relate to an image decoding device and an image coding device.

動画像を効率的に伝送または記録するために、動画像を符号化することによって符号化データを生成する動画像符号化装置、および、当該符号化データを復号することによって復号画像を生成する動画像復号装置が用いられている。 In order to efficiently transmit or record a moving image, a moving image coding device that generates encoded data by encoding the moving image, and a moving image that generates a decoded image by decoding the encoded data. An image decoding device is used.

具体的な動画像符号化方式としては、例えば、H.264/AVCやHEVC(High-Efficiency Video Coding)方式などが挙げられる。 Specific examples of the moving image coding method include H.264 / AVC and HEVC (High-Efficiency Video Coding) method.

このような動画像符号化方式においては、動画像を構成する画像(ピクチャ)は、画像を分割することにより得られるスライス、スライスを分割することにより得られる符号化ツリーユニット(CTU:Coding Tree Unit)、符号化ツリーユニットを分割することで得られる符号化単位(符号化ユニット(Coding Unit:CU)と呼ばれることもある)、及び、符号化単位を分割することより得られる変換ユニット(TU:Transform Unit)からなる階層構造により管理され、CU毎に符号化/復号される。 In such a moving image coding method, the image (picture) constituting the moving image is a slice obtained by dividing the image and a coding tree unit (CTU) obtained by dividing the slice. ), A coding unit obtained by dividing a coding tree unit (sometimes called a coding unit (CU)), and a conversion unit (TU:) obtained by dividing a coding unit. It is managed by a hierarchical structure consisting of (Transform Unit), and is encoded / decoded for each CU.

また、このような動画像符号化方式においては、通常、入力画像を符号化/復号することによって得られる局所復号画像に基づいて予測画像が生成され、当該予測画像を入力画像(原画像)から減算して得られる予測誤差(「差分画像」または「残差画像」と呼ぶこともある)が符号化される。予測画像の生成方法としては、画面間予測(インター予測)、および、画面内予測(イントラ予測)が挙げられる。 Further, in such a moving image coding method, a predicted image is usually generated based on a locally decoded image obtained by encoding / decoding an input image, and the predicted image is obtained from the input image (original image). The prediction error obtained by subtraction (sometimes referred to as "difference image" or "residual image") is encoded. Examples of the method for generating a prediction image include inter-screen prediction (inter-screen prediction) and in-screen prediction (intra-prediction).

また、近年の動画像符号化及び復号の技術として非特許文献1から2が挙げられる。 In addition, Non-Patent Documents 1 and 2 can be mentioned as recent moving image coding and decoding techniques.

"Versatile Video Coding (Draft 4)", JVET-M1001-v5, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 2019-02-27"Versatile Video Coding (Draft 4)", JVET-M1001-v5, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29/WG 11, 2019-02-27 "CE9: Results of DMVR related Tests CE9.2.1 and CE9.2.2", JVET-M0147-v2, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 2019-1-4"CE9: Results of DMVR related Tests CE9.2.1 and CE9.2.2", JVET-M0147-v2, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29/WG 11 , 2019-1-4

非特許文献1および非特許文献2の技術では、DMVRは通常マージモードの時のみ適用される。非特許文献2のMMVDがオンの時はDMVRが禁止され、符号化効率が低下している。 In the techniques of Non-Patent Document 1 and Non-Patent Document 2, DMVR is usually applied only in the merge mode. When MMVD of Non-Patent Document 2 is on, DMVR is prohibited and the coding efficiency is lowered.

非特許文献1および非特許文献2の技術では、整数画像探索後、そのコスト計算の結果のみを用いて小数画素ベースのMV補正を実施するが、この補正値が大きすぎることがあり符号化効率が低下している。 In the techniques of Non-Patent Document 1 and Non-Patent Document 2, after an integer image search, MV correction based on a decimal pixel is performed using only the result of the cost calculation, but this correction value may be too large and the coding efficiency. Is declining.

非特許文献1および非特許文献2の技術では、整数画像探索後、そのコスト計算の結果のみを用いて小数画素ベースのMV補正を実施する。この計算には除算が必要なので簡略化
をする必要がある。
In the techniques of Non-Patent Document 1 and Non-Patent Document 2, after an integer image search, MV correction based on a decimal pixel is performed using only the result of the cost calculation. This calculation requires division and needs to be simplified.

動きベクトルに所定の距離及び所定の方向の差分ベクトルを加算することで動きベクトルを得るMMVD部と、L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、動き情報が双予測、かつ、対象CUサイズが所定のサイズ以上、かつ、(MMVDモードがオフ、もしくは、MMVDモードがオンで、かつ、前記MMVDの距離が所定の閾値以上)の場合に、DMVRフラグを1とし、それ以外の場合にDMVRフラグを0とし、
DMVRフラグが1の場合に、上記コスト値SADから導出されるリファインメント値dX,dYを動きベクトルmvLXに加算してリファインメント動きベクトルrefMvLXを導出することを特徴とする。
The motion vector is refined according to the MMVD part that obtains the motion vector by adding the difference vector of the predetermined distance and the predetermined direction to the motion vector, and the multiple cost values SAD derived from the L0 predicted image and the L1 predicted image. In a motion image decoding device provided with a DMVR unit
In the DMVR unit, the motion information is bi-predicted, the target CU size is equal to or larger than a predetermined size, and (MMVD mode is off or MMVD mode is on, and the distance of the MMVD is equal to or greater than a predetermined threshold value). In some cases, the DMVR flag is set to 1, and in other cases, the DMVR flag is set to 0.
When the DMVR flag is 1, the refinement values dX and dY derived from the above cost value SAD are added to the motion vector mvLX to derive the refinement motion vector refMvLX.

L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、左のSADと右のSADの差の定数倍A1、上のSADと下のSADの和から中心のSADの2倍に所定の定数を加算した値A2からA1とA2の比率を導出し動きベクトルの修正値dXを導出することを特徴とする。
In a moving image decoding device provided with a DMVR unit that refines a motion vector according to a plurality of cost values SAD derived from the L0 predicted image and the L1 predicted image.
The DMVR section calculates the ratio of A1 to A2 from A2, which is a constant multiple A1 of the difference between the left SAD and the right SAD, and the sum of the upper SAD and the lower SAD to twice the center SAD plus a predetermined constant. It is characterized by deriving and deriving the correction value dX of the motion vector.

DMVR部は、上のSADと下のSADの差の定数倍を分子A1、上のSADと下のSADの和から中心のSADの2倍に所定の定数を加算した値A2とする値からA1とA2の比率を導出し動きベクトルの修正値dYを導出することを特徴とする動画像復号装置。 In the DMVR section, the constant multiple of the difference between the upper SAD and the lower SAD is the numerator A1, and the sum of the upper SAD and the lower SAD is double the central SAD plus a predetermined constant, which is the value A2. A moving image decoding device characterized by deriving the ratio of and A2 and deriving the correction value dY of the motion vector.

L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、2つのペアのSADの差分値が所定の閾値を超える場合に、動きベクトルの修正値dXを所定の値に設定し、上記とは別の2つのSADのペアの差分値が所定の閾値を超える場合に、動きベクトルの修正値dYを所定の値に設定することを特徴とする。
In a moving image decoding device provided with a DMVR unit that refines a motion vector according to a plurality of cost values SAD derived from the L0 predicted image and the L1 predicted image.
The DMVR unit sets the motion vector correction value dX to a predetermined value when the difference value of the SADs of the two pairs exceeds a predetermined threshold value, and the difference value of the pair of two SADs different from the above is predetermined. When the threshold value of is exceeded, the correction value dY of the motion vector is set to a predetermined value.

L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、左と中心のSAD差分値と、右と中心のSAD差分値の比が閾値を超えたら、dXを所定の値に設定し、上と中心のSAD差分値と、下と中心のSAD差分値の比が閾値を超えたら、dYを所定の値に設定することを特徴とする動画像復号装置。
In a moving image decoding device provided with a DMVR unit that refines a motion vector according to a plurality of cost values SAD derived from the L0 predicted image and the L1 predicted image.
When the ratio of the left and center SAD difference value and the right and center SAD difference value exceeds the threshold value, the DMVR section sets dX to a predetermined value, and sets the top and center SAD difference values and the bottom and center SAD difference values. A moving image decoding device characterized in that dY is set to a predetermined value when the ratio of SAD difference values exceeds a threshold value.

L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、左右のSADの絶対値差分値(abs(mrSadL-mrSadR))がmin (mrSadL,mrSadR)と中心のSAD(mrSadC)との差分よりも大きければ、dXを所定の値に設定し、上下のSADの絶対値差分値(abs(mrSadT-mrSadB))がmin (mrSadT,mrSadB)と中心のSAD(mrSadC)との差分よりも大きければ、dYを所定の値に設定することを特徴とする。
In a moving image decoding device provided with a DMVR unit that refines a motion vector according to a plurality of cost values SAD derived from the L0 predicted image and the L1 predicted image.
In the DMVR section, if the absolute value difference value (abs (mrSadL-mrSadR)) of the left and right SAD is larger than the difference between min (mrSadL, mrSadR) and the center SAD (mrSadC), dX is set to a predetermined value. If the absolute value difference (abs (mrSadT-mrSadB)) of the upper and lower SAD is larger than the difference between min (mrSadT, mrSadB) and the center SAD (mrSadC), dY is set to a predetermined value. And.

動きベクトルに所定の距離及び所定の方向の差分ベクトルを加算することで動きベクトルを得るMMVD部と、L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、動き情報が双予測、かつ、対象CUサイズが所定のサイズ以上、かつ、(MMVDモードがオフ、もしくは、MMVDモードがオンで、かつ、前記MMVDの距離が所定の閾値以上)の場合に、DMVRフラグを1とし、それ以外の場合にDMVRフラグを0とし、
DMVRフラグが1の場合に、上記コスト値SADから導出されるリファインメント値dX,dYを動きベクトルmvLXに加算してリファインメント動きベクトルrefMvLXを導出することを特
徴とする。
The motion vector is refined according to the MMVD part that obtains the motion vector by adding the difference vector of the predetermined distance and the predetermined direction to the motion vector, and the multiple cost values SAD derived from the L0 predicted image and the L1 predicted image. In a motion image decoding device provided with a DMVR unit
In the DMVR unit, the motion information is bi-predicted, the target CU size is equal to or larger than a predetermined size, and (MMVD mode is off or MMVD mode is on, and the distance of the MMVD is equal to or greater than a predetermined threshold value). In some cases, the DMVR flag is set to 1, and in other cases, the DMVR flag is set to 0.
When the DMVR flag is 1, the refinement values dX and dY derived from the above cost value SAD are added to the motion vector mvLX to derive the refinement motion vector refMvLX.

MMVDとDMVRを好適に動作させることができるので符号化効率を向上させるる効果を奏する。SADをより好適な方法で利用することで符号化効率を向上させる効果を奏する。また、SADを、利用した動きベクトルのリファインメントを少ない演算量で導出する効果を奏する。 Since the MMVD and DMVR can be operated suitably, the effect of improving the coding efficiency is obtained. By using SAD in a more preferable method, it is possible to improve the coding efficiency. In addition, SAD has the effect of deriving the refinement of the motion vector used with a small amount of calculation.

本実施形態に係る画像伝送システムの構成を示す概略図である。It is the schematic which shows the structure of the image transmission system which concerns on this embodiment. 本実施形態に係る動画像符号化装置を搭載した送信装置、および、動画像復号装置を搭載した受信装置の構成について示した図である。(a)は動画像符号化装置を搭載した送信装置を示しており、(b)は動画像復号装置を搭載した受信装置を示している。It is a figure which showed the structure of the transmission device which mounted the moving image coding device which concerns on this embodiment, and the receiving device which mounted on moving image decoding device. (a) shows a transmitting device equipped with a moving image coding device, and (b) shows a receiving device equipped with a moving image decoding device. 本実施形態に係る動画像符号化装置を搭載した記録装置、および、動画像復号装置を搭載した再生装置の構成について示した図である。(a)は動画像符号化装置を搭載した記録装置を示しており、(b)は動画像復号装置を搭載した再生装置を示している。It is a figure which showed the structure of the recording apparatus which carried out the moving image coding apparatus which concerns on this embodiment, and the reproduction apparatus which mounted on moving image decoding apparatus. (a) shows a recording device equipped with a moving image coding device, and (b) shows a reproducing device equipped with a moving image decoding device. 符号化ストリームのデータの階層構造を示す図である。It is a figure which shows the hierarchical structure of the data of a coded stream. CTUの分割例を示す図である。It is a figure which shows the division example of CTU. 参照ピクチャおよび参照ピクチャリストの一例を示す概念図である。It is a conceptual diagram which shows an example of a reference picture and a reference picture list. 動画像復号装置の構成を示す概略図である。It is a schematic diagram which shows the structure of the moving image decoding apparatus. インター予測パラメータ復号部の構成を示す概略図である。It is the schematic which shows the structure of the inter prediction parameter decoding part. マージ予測パラメータ導出部、および、AMVP予測パラメータ導出部の構成を示す概略図である。It is a schematic diagram which shows the structure of the merge prediction parameter derivation part and AMVP prediction parameter derivation part. アフィン予測の動きベクトルspMvLX[xi][yi]を示す図である。It is a figure which shows the motion vector spMvLX [xi] [yi] of affine prediction. インター予測画像生成部の構成を示す概略図である。It is the schematic which shows the structure of the inter prediction image generation part. 動画像符号化装置の構成を示すブロック図である。It is a block diagram which shows the structure of the moving image coding apparatus. パラメータ符号化部の構成を示す概略図である。It is the schematic which shows the structure of the parameter coding part. MMVDモードにおいて用いられるインデックスの一例を示す図であって、(a)は、マージ候補リストmergeCandList[]のマージ候補を示すインデックスbase_candidate_idxの一例を示す図であり、(b)は、対象ブロックに隣接するブロックの一例を示す図であり、(c)は、distance_idxの一例を示す図であり、(d)は、direction_idxの一例を示す図である。It is a figure which shows an example of the index used in MMVD mode, (a) is a figure which shows an example of the index base_candidate_idx which shows the merge candidate of the merge candidate list mergeCandList [], and (b) is adjacent to the target block. It is a figure which shows an example of the block to perform, (c) is a figure which shows an example of distance_idx, (d) is a figure which shows an example of direction_idx. 動画像符号化装置における探索距離の候補数および導出方向の候補数の一例を示す図である。It is a figure which shows an example of the candidate number of the search distance and the candidate number of the derivation direction in a moving image coding apparatus. 動画像復号装置における予測モードの選択処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the selection process of the prediction mode in a moving image decoding apparatus. 本実施形態に係る予測モードの選択処理を示すシンタックスを示す図である。It is a figure which shows the syntax which shows the selection process of the prediction mode which concerns on this embodiment. 動画像復号装置における予測モードの選択処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the selection process of the prediction mode in a moving image decoding apparatus. 本実施形態に係る予測モードの選択処理を示すシンタックスを示す図である。It is a figure which shows the syntax which shows the selection process of the prediction mode which concerns on this embodiment. 動画像復号装置における予測モードの選択処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the selection process of the prediction mode in a moving image decoding apparatus. 本実施形態に係る予測モードの選択処理を示すシンタックスを示す図である。It is a figure which shows the syntax which shows the selection process of the prediction mode which concerns on this embodiment. 本実施形態に係るDMVR判定部の処理を示すフローチャートである。It is a flowchart which shows the process of the DMVR determination part which concerns on this embodiment. 本実施形態に係るSADの配置と、パラメトリック動きベクトルリファインメントの動作を説明する図である。It is a figure explaining the arrangement of SAD and the operation of parametric motion vector refinement which concerns on this embodiment. 本実施形態に係るSADの配置と、パラメトリック動きベクトルリファインメントの動作を説明する別の図である。It is another figure explaining the arrangement of SAD and the operation of parametric motion vector refinement which concerns on this embodiment. 本実施形態に係る利用するSADとパラメトリック動きベクトルリファインメントの動作を説明する別の図である。It is another figure explaining the operation of the SAD and the parametric motion vector refinement used which concerns on this embodiment. 本実施形態に係るパラメトリック動きベクトルリファインメントの動作を説明するフローチャートである。It is a flowchart explaining the operation of the parametric motion vector refinement which concerns on this embodiment.

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

図1は、本実施形態に係る画像伝送システム1の構成を示す概略図である。 FIG. 1 is a schematic view showing the configuration of the image transmission system 1 according to the present embodiment.

画像伝送システム1は、符号化対象画像を符号化した符号化ストリームを伝送し、伝送された符号化ストリームを復号し画像を表示するシステムである。画像伝送システム1は、動画像符号化装置(画像符号化装置)11、ネットワーク21、動画像復号装置(画像復号装置)31、及び動画像表示装置(画像表示装置)41を含んで構成される。 The image transmission system 1 is a system that transmits a coded stream in which a coded image is encoded, decodes the transmitted coded stream, and displays an image. The image transmission system 1 includes a moving image coding device (image coding device) 11, a network 21, a moving image decoding device (image decoding device) 31, and a moving image display device (image display device) 41. ..

動画像符号化装置11には画像Tが入力される。 The image T is input to the moving image coding device 11.

ネットワーク21は、動画像符号化装置11が生成した符号化ストリームTeを動画像復号装置31に伝送する。ネットワーク21は、インターネット(Internet)、広域ネットワーク(WAN:Wide Area Network)、小規模ネットワーク(LAN:Local Area Network)またはこれらの組み合わせである。ネットワーク21は、必ずしも双方向の通信網に限らず、地上デジタル放送、衛星放送等の放送波を伝送する一方向の通信網であっても良い。また、ネットワーク21は、DVD(Digital Versatile Disc:登録商標)、BD(Blue-ray Disc:登録商標)等の符号化ストリームTeを記録した記憶媒体で代替されても良い。 The network 21 transmits the coded stream Te generated by the moving image coding device 11 to the moving image decoding device 31. The network 21 is an Internet (Internet), a wide area network (WAN: Wide Area Network), a small network (LAN: Local Area Network), or a combination thereof. The network 21 is not necessarily limited to a two-way communication network, but may be a one-way communication network that transmits broadcast waves such as terrestrial digital broadcasting and satellite broadcasting. Further, the network 21 may be replaced with a storage medium such as a DVD (Digital Versatile Disc: registered trademark) or BD (Blue-ray Disc: registered trademark) on which an encoded stream Te is recorded.

動画像復号装置31は、ネットワーク21が伝送した符号化ストリームTeのそれぞれを復号し、復号した1または複数の復号画像Tdを生成する。 The moving image decoding device 31 decodes each of the coded streams Te transmitted by the network 21 and generates one or a plurality of decoded images Td.

動画像表示装置41は、動画像復号装置31が生成した1または複数の復号画像Tdの全部または一部を表示する。動画像表示装置41は、例えば、液晶ディスプレイ、有機EL(Electro-luminescence)ディスプレイ等の表示デバイスを備える。ディスプレイの形態としては、据え置き、モバイル、HMD等が挙げられる。また、動画像復号装置31が高い処理能力を有する場合には、画質の高い画像を表示し、より低い処理能力しか有しない場合には、高い処理能力、表示能力を必要としない画像を表示する。 The moving image display device 41 displays all or a part of one or a plurality of decoded images Td generated by the moving image decoding device 31. The moving image display device 41 includes, for example, a display device such as a liquid crystal display or an organic EL (Electro-luminescence) display. Examples of the display form include stationary, mobile, and HMD. Further, when the moving image decoding device 31 has a high processing capacity, a high-quality image is displayed, and when the moving image decoding device 31 has a lower processing power, an image that does not require a high processing power and a display power is displayed. ..

<演算子>
本明細書で用いる演算子を以下に記載する。
<Operator>
The operators used herein are described below.

>>は右ビットシフト、<<は左ビットシフト、&はビットワイズAND、|はビットワイズOR、|=はOR代入演算子であり、||は論理和を示す。 >> is the right bit shift, << is the left bit shift, & is the bitwise AND, | is the bitwise OR, | = is the OR assignment operator, and || is the OR.

x?y:zは、xが真(0以外)の場合にy、xが偽(0)の場合にzをとる3項演算子である。 x? y: z is a ternary operator that takes y when x is true (other than 0) and z when x is false (0).

Clip3(a,b,c)は、cをa以上b以下の値にクリップする関数であり、c<aの場合にはaを返し、c>bの場合にはbを返し、その他の場合にはcを返す関数である(ただし、a<=b)。 Clip3 (a, b, c) is a function that clips c to a value greater than or equal to a and less than or equal to b, returning a if c <a, returning b if c> b, and other cases. Is a function that returns c (where a <= b).

abs(a)はaの絶対値を返す関数である。 abs (a) is a function that returns the absolute value of a.

Int(a)はaの整数値を返す関数である。 Int (a) is a function that returns an integer value of a.

floor(a)はa以下の最大の整数を返す関数である。 floor (a) is a function that returns the largest integer less than or equal to a.

ceil(a)はa以上の最小の整数を返す関数である。 ceil (a) is a function that returns the smallest integer greater than or equal to a.

a/dはdによるaの除算(小数点以下切り捨て)を表す。 a / d represents the division of a by d (rounded down to the nearest whole number).

sign(a)はaの符号(sign)を返す関数である。 sign (a) is a function that returns the sign of a.

a^bは、aのb乗を表す。 a ^ b represents a to the bth power.

<符号化ストリームTeの構造>
本実施形態に係る動画像符号化装置11および動画像復号装置31の詳細な説明に先立って、動画像符号化装置11によって生成され、動画像復号装置31によって復号される符号化ストリームTeのデータ構造について説明する。
<Structure of coded stream Te>
Prior to the detailed description of the moving image coding device 11 and the moving image decoding device 31 according to the present embodiment, the data of the coded stream Te generated by the moving image coding device 11 and decoded by the moving image decoding device 31. The structure will be described.

図4は、符号化ストリームTeにおけるデータの階層構造を示す図である。符号化ストリームTeは、例示的に、シーケンス、およびシーケンスを構成する複数のピクチャを含む。図4の(a)〜(f)は、それぞれ、シーケンスSEQを既定する符号化ビデオシーケンス、ピクチャPICTを規定する符号化ピクチャ、スライスSを規定する符号化スライス、スライスデータを規定する符号化スライスデータ、符号化スライスデータに含まれる符号化ツリーユニット、符号化ツリーユニットに含まれる符号化ユニットを示す図である。 FIG. 4 is a diagram showing a hierarchical structure of data in the coded stream Te. The coded stream Te typically includes a sequence and a plurality of pictures that make up the sequence. In FIGS. 4 (a) to 4 (f), a coded video sequence that defines the sequence SEQ, a coded picture that defines the picture PICT, a coded slice that defines the slice S, and a coded slice that defines the slice data, respectively. It is a figure which shows the coded tree unit included in the data, the coded slice data, and the coded unit included in a coded tree unit.

(符号化ビデオシーケンス)
符号化ビデオシーケンスでは、処理対象のシーケンスSEQを復号するために動画像復号装置31が参照するデータの集合が規定されている。シーケンスSEQは、図4(a)に示すように、ビデオパラメータセット(Video Parameter Set)、シーケンスパラメータセットSPS(Sequence Parameter Set)、ピクチャパラメータセットPPS(Picture Parameter Set)、ピクチャPICT、及び、付加拡張情報SEI(Supplemental Enhancement Information)を含んでいる。
(Encoded video sequence)
The coded video sequence defines a set of data that the moving image decoding device 31 refers to in order to decode the sequence SEQ to be processed. As shown in FIG. 4A, the sequence SEQ includes a video parameter set (Video Parameter Set), a sequence parameter set SPS (Sequence Parameter Set), a picture parameter set PPS (Picture Parameter Set), a picture PICT, and an additional extension. Information SEI (Supplemental Enhancement Information) is included.

ビデオパラメータセットVPSは、複数のレイヤから構成されている動画像において、複数の動画像に共通する符号化パラメータの集合および動画像に含まれる複数のレイヤおよび個々のレイヤに関連する符号化パラメータの集合が規定されている。 The video parameter set VPS is a set of coding parameters common to a plurality of moving images in a moving image composed of a plurality of layers, and a set of coding parameters related to the plurality of layers included in the moving image and individual layers. The set is defined.

シーケンスパラメータセットSPSでは、対象シーケンスを復号するために動画像復号装置31が参照する符号化パラメータの集合が規定されている。例えば、ピクチャの幅や高さが規定される。なお、SPSは複数存在してもよい。その場合、PPSから複数のSPSの何れかを選択する。 The sequence parameter set SPS defines a set of coding parameters that the moving image decoding device 31 refers to in order to decode the target sequence. For example, the width and height of the picture are specified. In addition, there may be a plurality of SPS. In that case, select one of multiple SPSs from PPS.

ピクチャパラメータセットPPSでは、対象シーケンス内の各ピクチャを復号するために動画像復号装置31が参照する符号化パラメータの集合が規定されている。例えば、ピクチャの復号に用いられる量子化幅の基準値(pic_init_qp_minus26)や重み付き予測の適用を示すフラグ(weighted_pred_flag)が含まれる。なお、PPSは複数存在してもよい。その場合、対象シーケンス内の各ピクチャから複数のPPSの何れかを選択する。 The picture parameter set PPS defines a set of coding parameters that the moving image decoding device 31 refers to in order to decode each picture in the target sequence. For example, a reference value of the quantization width used for decoding a picture (pic_init_qp_minus26) and a flag indicating the application of weighted prediction (weighted_pred_flag) are included. There may be a plurality of PPSs. In that case, one of a plurality of PPSs is selected from each picture in the target sequence.

(符号化ピクチャ)
符号化ピクチャでは、処理対象のピクチャPICTを復号するために動画像復号装置31が参照するデータの集合が規定されている。ピクチャPICTは、図4(b)に示すように、スライス0〜スライスNS-1を含む(NSはピクチャPICTに含まれるスライスの総数)。
(Encoded picture)
The coded picture defines a set of data referred to by the moving image decoding device 31 in order to decode the picture PICT to be processed. The picture PICT includes slices 0 to NS-1 as shown in FIG. 4 (b) (NS is the total number of slices contained in the picture PICT).

なお、以下、スライス0〜スライスNS-1のそれぞれを区別する必要が無い場合、符号の
添え字を省略して記述することがある。また、以下に説明する符号化ストリームTeに含まれるデータであって、添え字を付している他のデータについても同様である。
In the following, when it is not necessary to distinguish between slice 0 and slice NS-1, the subscripts of the symbols may be omitted. The same applies to the data included in the coded stream Te described below and the other data having a subscript.

(符号化スライス)
符号化スライスでは、処理対象のスライスSを復号するために動画像復号装置31が参照するデータの集合が規定されている。スライスは、図4(c)に示すように、スライスヘッダ、および、スライスデータを含んでいる。
(Coded slice)
The coded slice defines a set of data referred to by the moving image decoding device 31 in order to decode the slice S to be processed. The slice contains a slice header and slice data as shown in FIG. 4 (c).

スライスヘッダには、対象スライスの復号方法を決定するために動画像復号装置31が参照する符号化パラメータ群が含まれる。スライスタイプを指定するスライスタイプ指定情報(slice_type)は、スライスヘッダに含まれる符号化パラメータの一例である。 The slice header contains a group of coding parameters referred to by the moving image decoding device 31 to determine the decoding method of the target slice. The slice type specification information (slice_type) that specifies the slice type is an example of the coding parameters included in the slice header.

スライスタイプ指定情報により指定可能なスライスタイプとしては、(1)符号化の際にイントラ予測のみを用いるIスライス、(2)符号化の際に単方向予測、または、イントラ予測を用いるPスライス、(3)符号化の際に単方向予測、双方向予測、または、イントラ予測を用いるBスライスなどが挙げられる。なお、インター予測は、単予測、双予測に限定されず、より多くの参照ピクチャを用いて予測画像を生成してもよい。以下、P、Bスライスと呼ぶ場合には、インター予測を用いることができるブロックを含むスライスを指す。 The slice types that can be specified by the slice type specification information include (1) I slices that use only intra-prediction during coding, and (2) P-slices that use unidirectional prediction or intra-prediction during coding. (3) B-slice using unidirectional prediction, bidirectional prediction, or intra prediction at the time of coding can be mentioned. Note that the inter-prediction is not limited to single prediction and bi-prediction, and a prediction image may be generated using more reference pictures. Hereinafter, when referred to as P and B slices, they refer to slices containing blocks for which inter-prediction can be used.

なお、スライスヘッダは、ピクチャパラメータセットPPSへの参照(pic_parameter_set_id)を含んでいても良い。 The slice header may include a reference (pic_parameter_set_id) to the picture parameter set PPS.

(符号化スライスデータ)
符号化スライスデータでは、処理対象のスライスデータを復号するために動画像復号装置31が参照するデータの集合が規定されている。スライスデータは、図4(d)に示すように、CTUを含んでいる。CTUは、スライスを構成する固定サイズ(例えば64x64)のブロックであり、最大符号化単位(LCU:Largest Coding Unit)と呼ぶこともある。
(Coded slice data)
The coded slice data defines a set of data referred to by the moving image decoding device 31 in order to decode the slice data to be processed. The slice data includes the CTU, as shown in Figure 4 (d). A CTU is a fixed-size (for example, 64x64) block that constitutes a slice, and is sometimes called a maximum coding unit (LCU: Largest Coding Unit).

(符号化ツリーユニット)
図4(e)には、処理対象のCTUを復号するために動画像復号装置31が参照するデータの集合が規定されている。CTUは、再帰的な4分木分割(QT(Quad Tree)分割)、2分木分割(BT(Binary Tree)分割)あるいは3分木分割(TT(Ternary Tree)分割)により符号化処理の基本的な単位である符号化ユニットCUに分割される。BT分割とTT分割を合わせてマルチツリー分割(MT(Multi Tree)分割)と呼ぶ。再帰的な4分木分割により得られる木構造のノードのことを符号化ノード(Coding Node)と称する。4分木、2分木、及び3分木の中間ノードは、符号化ノードであり、CTU自身も最上位の符号化ノードとして規定される。
(Encoded tree unit)
FIG. 4 (e) defines a set of data referred to by the moving image decoding device 31 in order to decode the CTU to be processed. CTU is the basis of coding processing by recursive quadtree division (QT (Quad Tree) division), quadtree division (BT (Binary Tree) division) or ternary tree division (TT (Ternary Tree) division). It is divided into a coding unit CU, which is a typical unit. The combination of BT division and TT division is called multi-tree division (MT (Multi Tree) division). A tree-structured node obtained by recursive quadtree division is called a coding node. The intermediate nodes of the quadtree, binary, and ternary tree are coded nodes, and the CTU itself is defined as the highest level coded node.

CTは、CT情報として、QT分割を行うか否かを示すQT分割フラグ(qt_split_cu_flag)、MT分割の有無を示すMT分割フラグ(mtt_split_cu_flag)、MT分割の分割方向を示すMT分割方向(mtt_split_cu_vertical_flag)、MT分割の分割タイプを示すMT分割タイプ(mtt_split_cu_binary_flage)を含む。qt_split_cu_flag、mtt_split_cu_flag、mtt_split_cu_vertical_flag、mtt_split_cu_binary_flagは符号化ノード毎に伝送される。 CT has a QT division flag (qt_split_cu_flag) indicating whether or not to perform QT division, an MT division flag (mtt_split_cu_flag) indicating the presence or absence of MT division, an MT division direction (mtt_split_cu_vertical_flag) indicating the division direction of MT division, and CT information. Includes MT split type (mtt_split_cu_binary_flage) indicating the split type of MT split. qt_split_cu_flag, mtt_split_cu_flag, mtt_split_cu_vertical_flag, mtt_split_cu_binary_flag are transmitted for each encoding node.

図5は、CTUの分割例を示す図である。qt_split_cu_flagが1の場合、符号化ノードは4つの符号化ノードに分割される(図5(b))。 FIG. 5 is a diagram showing an example of CTU division. When qt_split_cu_flag is 1, the coding node is divided into 4 coding nodes (Fig. 5 (b)).

qt_split_cu_flagが0の時、mtt_split_cu_flagが0の場合に符号化ノードは分割されず1つのCUをノードとして持つ(図5(a))。CUは符号化ノードの末端ノードであり、これ
以上分割されない。CUは、符号化処理の基本的な単位となる。
When qt_split_cu_flag is 0 and mtt_split_cu_flag is 0, the encoding node is not divided and has one CU as a node (Fig. 5 (a)). The CU is the terminal node of the encoding node and is not divided any further. CU is the basic unit of coding processing.

mtt_split_cu_flagが1の場合に符号化ノードは以下のようにMT分割される。mtt_split_cu_vertical_flagが0、かつmtt_split_cu_binary_flagが1の場合に符号化ノードは2つの符号化ノードに水平分割され(図5(d))、mtt_split_cu_vertical_flagが1、かつmtt_split_cu_binary_flagが1の場合に符号化ノードは2つの符号化ノードに垂直分割される(図5(c))。また、mtt_split_cu_vertical_flagが0、かつmtt_split_cu_binary_flagが0の場合に符号化ノードは3つの符号化ノードに水平分割され(図5(f))、mtt_split_cu_vertical_flagが1、かつmtt_split_cu_binary_flagが0の場合に符号化ノードは3つの符号化ノードに垂直分割される(図5(e))。これらを図5(g)に示す。 When mtt_split_cu_flag is 1, the coded node is MT-divided as follows. When mtt_split_cu_vertical_flag is 0 and mtt_split_cu_binary_flag is 1, the coded node is horizontally divided into two coded nodes (Fig. 5 (d)), and when mtt_split_cu_vertical_flag is 1 and mtt_split_cu_binary_flag is 1, there are two coded nodes. It is vertically divided into conversion nodes (Fig. 5 (c)). When mtt_split_cu_vertical_flag is 0 and mtt_split_cu_binary_flag is 0, the coded node is horizontally divided into 3 coded nodes (Fig. 5 (f)), and when mtt_split_cu_vertical_flag is 1 and mtt_split_cu_binary_flag is 0, the coded node is 3. It is vertically divided into two coding nodes (Fig. 5 (e)). These are shown in Fig. 5 (g).

また、CTUのサイズが64x64画素の場合には、CUのサイズは、64x64画素、64x32画素、32x64画素、32x32画素、64x16画素、16x64画素、32x16画素、16x32画素、16x16画素、64x8画素、8x64画素、32x8画素、8x32画素、16x8画素、8x16画素、8x8画素、64x4画素、4x64画素、32x4画素、4x32画素、16x4画素、4x16画素、8x4画素、4x8画素、及び、4x4画素の何れかをとり得る。 If the CTU size is 64x64 pixels, the CU size is 64x64 pixels, 64x32 pixels, 32x64 pixels, 32x32 pixels, 64x16 pixels, 16x64 pixels, 32x16 pixels, 16x32 pixels, 16x16 pixels, 64x8 pixels, 8x64 pixels. , 32x8 pixels, 8x32 pixels, 16x8 pixels, 8x16 pixels, 8x8 pixels, 64x4 pixels, 4x64 pixels, 32x4 pixels, 4x32 pixels, 16x4 pixels, 4x16 pixels, 8x4 pixels, 4x8 pixels, and 4x4 pixels. ..

(符号化ユニット)
図4(f)に示すように、処理対象の符号化ユニットを復号するために動画像復号装置31が参照するデータの集合が規定されている。具体的には、CUは、CUヘッダCUH、予測パラメータ、変換パラメータ、量子化変換係数等から構成される。CUヘッダでは予測モード等が規定される。
(Encoding unit)
As shown in FIG. 4 (f), a set of data referred to by the moving image decoding device 31 in order to decode the coding unit to be processed is defined. Specifically, the CU is composed of a CU header CUH, prediction parameters, conversion parameters, quantization conversion coefficients, and the like. The CU header defines the prediction mode and so on.

予測処理は、CU単位で行われる場合と、CUをさらに分割したサブCU単位で行われる場合がある。CUとサブCUのサイズが等しい場合には、CU中のサブCUは1つである。CUがサブCUのサイズよりも大きい場合、CUは、サブCUに分割される。たとえばCUが8x8、サブCUが4x4の場合、CUは水平2分割、垂直2分割からなる、4つのサブCUに分割される。 The prediction process may be performed in CU units or in sub-CU units that are further divided CUs. If the size of the CU and the sub CU are equal, there is only one sub CU in the CU. If the CU is larger than the size of the sub CU, the CU is split into sub CUs. For example, when the CU is 8x8 and the sub CU is 4x4, the CU is divided into four sub CUs consisting of two horizontal divisions and two vertical divisions.

予測の種類(予測モード)は、イントラ予測と、インター予測の2つがある。イントラ予測は、同一ピクチャ内の予測であり、インター予測は、互いに異なるピクチャ間(例えば、表示時刻間)で行われる予測処理を指す。 There are two types of prediction (prediction mode): intra prediction and inter prediction. Intra-prediction is prediction within the same picture, and inter-prediction refers to prediction processing performed between different pictures (for example, between display times).

変換・量子化処理はCU単位で行われるが、量子化変換係数は4x4等のサブブロック単位でエントロピー符号化してもよい。 The conversion / quantization process is performed in CU units, but the quantization conversion coefficient may be entropy-encoded in subblock units such as 4x4.

(予測パラメータ)
予測画像は、ブロックに付随する予測パラメータによって導出される。予測パラメータには、イントラ予測とインター予測の予測パラメータがある。
(Prediction parameter)
The prediction image is derived by the prediction parameters associated with the block. Prediction parameters include intra-prediction and inter-prediction prediction parameters.

以下、インター予測の予測パラメータについて説明する。インター予測パラメータは、予測リスト利用フラグpredFlagL0、predFlagL1と、参照ピクチャインデックスrefIdxL0、refIdxL1と、動きベクトルmvL0、mvL1から構成される。予測リスト利用フラグpredFlagL0、predFlagL1は、各々L0リスト、L1リストと呼ばれる参照ピクチャリストが用いられるか否かを示すフラグであり、値が1の場合に対応する参照ピクチャリストが用いられる。なお、本明細書中「XXであるか否かを示すフラグ」と記す場合、フラグが0以外(たとえば1)をXXである場合、0をXXではない場合とし、論理否定、論理積などでは1を真、0を偽と扱う(以下同様)。但し、実際の装置や方法では真値、偽値として他の値を用いることもできる。 Hereinafter, the prediction parameters of the inter-prediction will be described. The inter-prediction parameter is composed of the prediction list usage flags predFlagL0 and predFlagL1, the reference picture indexes refIdxL0 and refIdxL1, and the motion vectors mvL0 and mvL1. The prediction list usage flags predFlagL0 and predFlagL1 are flags indicating whether or not the reference picture list called the L0 list and the L1 list is used, respectively, and the reference picture list corresponding to the case where the value is 1 is used. In the present specification, when "a flag indicating whether or not it is XX" is described, it is assumed that a flag other than 0 (for example, 1) is XX, 0 is not XX, and logical negation, logical product, etc. Treat 1 as true and 0 as false (same below). However, in an actual device or method, other values can be used as true values and false values.

インター予測パラメータを導出するためのシンタックス要素には、例えば、アフィンフ
ラグaffine_flag、マージフラグmerge_flag、マージインデックスmerge_idx、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、差分ベクトルmvdLX、動きベクトル精度モードamvr_modeがある。
The syntax elements for deriving the inter-prediction parameters include, for example, affine flag affine_flag, merge flag merge_flag, merge index merge_idx, inter-prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction vector index mvp_LX_idx, difference vector mvdLX, motion vector accuracy. There is a mode amvr_mode.

(参照ピクチャリスト)
参照ピクチャリストは、参照ピクチャメモリ306に記憶された参照ピクチャからなるリストである。図6は、参照ピクチャおよび参照ピクチャリストの一例を示す概念図である。図6(a)において、矩形はピクチャ、矢印はピクチャの参照関係、横軸は時間、矩形中のI、P、Bは各々イントラピクチャ、単予測ピクチャ、双予測ピクチャ、矩形中の数字は復号順を示す。図に示すように、ピクチャの復号順は、I0、P1、B2、B3、B4であり、表示順は、I0、B3、B2、B4、P1である。図6(b)に、ピクチャB3(対象ピクチャ)の参照ピクチャリストの例を示す。参照ピクチャリストは、参照ピクチャの候補を表すリストであり、1つのピクチャ(スライス)が1つ以上の参照ピクチャリストを有してもよい。図の例では、対象ピクチャB3は、L0リストRefPicList0およびL1リストRefPicList1の2つの参照ピクチャリストを持つ。個々のCUでは、参照ピクチャリストRefPicListX(X=0または1)中のどのピクチャを実際に参照するかを参照ピクチャインデックスrefIdxLXで指定する。図は、refIdxL0=2、refIdxL1=0の例である。なお、LXは、L0予測とL1予測を区別しない場合に用いられる記述方法であり、以降では、LXをL0、L1に置き換えることでL0リストに対するパラメータとL1リストに対するパラメータを区別する。
(Reference picture list)
The reference picture list is a list composed of reference pictures stored in the reference picture memory 306. FIG. 6 is a conceptual diagram showing an example of a reference picture and a reference picture list. In Fig. 6 (a), the rectangle is the picture, the arrow is the reference relationship of the picture, the horizontal axis is the time, I, P, B in the rectangle are the intra picture, the single prediction picture, the bi-prediction picture, and the numbers in the rectangle are decoded. Show the order. As shown in the figure, the decoding order of the pictures is I0, P1, B2, B3, B4, and the display order is I0, B3, B2, B4, P1. Figure 6 (b) shows an example of the reference picture list of picture B3 (target picture). The reference picture list is a list representing candidates for reference pictures, and one picture (slice) may have one or more reference picture lists. In the example of the figure, the target picture B3 has two reference picture lists, L0 list RefPicList0 and L1 list RefPicList1. In each CU, the reference picture index refIdxLX specifies which picture in the reference picture list RefPicListX (X = 0 or 1) is actually referenced. The figure is an example of refIdxL0 = 2 and refIdxL1 = 0. Note that LX is a description method used when the L0 prediction and the L1 prediction are not distinguished, and thereafter, the parameters for the L0 list and the parameters for the L1 list are distinguished by replacing LX with L0 and L1.

(マージ予測とAMVP予測)
予測パラメータの復号(符号化)方法には、マージ予測(merge)モードとAMVP(Advanced Motion Vector Prediction、適応動きベクトル予測)モードがあり、マージフラグmerge_flagは、これらを識別するためのフラグである。マージ予測モードは、予測リスト利用フラグpredFlagLX(またはインター予測識別子inter_pred_idc)、参照ピクチャインデックスrefIdxLX、動きベクトルmvLXを符号化データに含めずに、既に処理した近傍ブロックの予測パラメータから導出する用いるモードである。AMVPモードは、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、動きベクトルmvLXを符号化データに含めるモードである。なお、動きベクトルmvLXは、予測ベクトルmvpLXを識別する予測ベクトルインデックスmvp_LX_idxと差分ベクトルmvdLX、動きベクトル精度モードamvr_modeとして符号化される。マージ予測モードは、隣接ブロックの動き情報等から導出されるマージ候補を選択して動きベクトルmvLX(動きベクトル情報)を得るモードである。また、マージ予測モードの他に、アフィンフラグaffine_flagにより識別されるアフィン予測モードがあってもよい。マージ予測モードの一形態として、スキップフラグskip_flagにより識別されるスキップモードがあってもよい。なお、スキップモードとは、マージモードと同様の方法で予測パラメータを導出する用いるモードであり、かつ、予測誤差(残差画像、残差情報)を符号化データに含めないモードである。換言すれば、スキップフラグskip_flagが1の場合、対象CUに関して、当該スキップフラグskip_flagとマージインデックスmerge_idxなどのマージモードに関連するシンタックスのみを含み、動きベクトルや残差情報などは符号化データに含まれない。
(Merge Prediction and AMVP Prediction)
The decoding (encoding) method of the prediction parameters includes a merge prediction (merge) mode and an AMVP (Advanced Motion Vector Prediction) mode, and the merge flag merge_flag is a flag for identifying these. The merge prediction mode is a mode used to derive the prediction list usage flag predFlagLX (or inter prediction identifier inter_pred_idc), the reference picture index refIdxLX, and the motion vector mvLX from the prediction parameters of the already processed neighborhood blocks without including them in the coded data. .. The AMVP mode is a mode in which the inter-prediction identifier inter_pred_idc, the reference picture index refIdxLX, and the motion vector mvLX are included in the encoded data. The motion vector mvLX is encoded as a prediction vector index mvp_LX_idx that identifies the prediction vector mvpLX, a difference vector mvdLX, and a motion vector accuracy mode amvr_mode. The merge prediction mode is a mode in which a motion vector mvLX (motion vector information) is obtained by selecting a merge candidate derived from motion information of adjacent blocks. In addition to the merge prediction mode, there may be an affine prediction mode identified by the affine flag affine_flag. As one form of the merge prediction mode, there may be a skip mode identified by the skip flag skip_flag. The skip mode is a mode in which the prediction parameters are derived by the same method as the merge mode, and the prediction error (residual image, residual information) is not included in the coded data. In other words, when the skip flag skip_flag is 1, only the syntax related to the merge mode such as the skip flag skip_flag and the merge index merge_idx is included for the target CU, and the motion vector and residual information are included in the coded data. I can't.

(動きベクトル)
動きベクトルmvLXは、異なる2つのピクチャ上のブロック間のシフト量を示す。動きベクトルmvLXに関する予測ベクトル、差分ベクトルを、それぞれ予測ベクトルmvpLX、差分ベクトルmvdLXと呼ぶ。
(Motion vector)
The motion vector mvLX indicates the amount of shift between blocks on two different pictures. The prediction vector and difference vector related to the motion vector mvLX are called the prediction vector mvpLX and the difference vector mvdLX, respectively.

(インター予測識別子inter_pred_idcと予測リスト利用フラグpredFlagLX)
インター予測識別子inter_pred_idcは、参照ピクチャの種類および数を示す値であり、PRED_L0、PRED_L1、PRED_BIの何れかの値をとる。PRED_L0、PRED_L1は、各々L0リスト、L1リストで管理された1枚の参照ピクチャを用いる単予測を示す。PRED_BIはL0リストとL1リストで管理された2枚の参照ピクチャを用いる双予測BiPredを示す。
(Inter prediction identifier inter_pred_idc and prediction list usage flag predFlagLX)
The inter-prediction identifier inter_pred_idc is a value indicating the type and number of reference pictures, and takes any of PRED_L0, PRED_L1, and PRED_BI values. PRED_L0 and PRED_L1 indicate a simple prediction using one reference picture managed by the L0 list and the L1 list, respectively. PRED_BI indicates a bipredictive BiPred that uses two reference pictures managed by the L0 list and the L1 list.

マージインデックスmerge_idxは、処理が完了したブロックから導出される予測パラメータ候補(マージ候補)のうち、いずれの予測パラメータを対象ブロックの予測パラメータとして用いるかを示すインデックスである。 The merge index merge_idx is an index indicating which of the prediction parameter candidates (merge candidates) derived from the processed block is used as the prediction parameter of the target block.

インター予測識別子inter_pred_idcと、予測リスト利用フラグpredFlagL0、predFlagL1の関係は以下のとおりであり、相互に変換可能である。 The relationship between the inter-prediction identifier inter_pred_idc and the prediction list usage flags predFlagL0 and predFlagL1 is as follows and can be converted to each other.

inter_pred_idc = (predFlagL1<<1)+predFlagL0
predFlagL0 = inter_pred_idc & 1
predFlagL1 = inter_pred_idc >> 1
(双予測biPredの判定)
双予測BiPredであるかのフラグbiPredは、2つの予測リスト利用フラグがともに1であるかによって導出できる。例えば以下の式で導出できる。
inter_pred_idc = (predFlagL1 << 1) + predFlagL0
predFlagL0 = inter_pred_idc & 1
predFlagL1 = inter_pred_idc >> 1
(Judgment of bipred biPred)
The bipred BiPred flag biPred can be derived depending on whether the two prediction list usage flags are both 1. For example, it can be derived by the following formula.

biPred = (predFlagL0==1 && predFlagL1==1)
あるいは、フラグbiPredは、インター予測識別子が2つの予測リスト(参照ピクチャ)を使うことを示す値であるか否かによっても導出できる。例えば以下の式で導出できる。
biPred = (predFlagL0 == 1 && predFlagL1 == 1)
Alternatively, the flag biPred can also be derived by whether or not the inter-prediction identifier is a value indicating that two prediction lists (reference pictures) are used. For example, it can be derived by the following formula.

biPred = (inter_pred_idc==PRED_BI) ? 1 : 0
(動画像復号装置の構成)
本実施形態に係る動画像復号装置31(図7)の構成について説明する。
biPred = (inter_pred_idc == PRED_BI)? 1: 0
(Configuration of moving image decoding device)
The configuration of the moving image decoding device 31 (FIG. 7) according to the present embodiment will be described.

動画像復号装置31は、エントロピー復号部301、パラメータ復号部302、ループフィルタ305、参照ピクチャメモリ306、予測パラメータメモリ307、予測画像生成部(予測画像生成装置)308、逆量子化・逆変換部311、及び加算部312を含んで構成される。なお、後述の動画像符号化装置11に合わせ、動画像復号装置31にループフィルタ305が含まれない構成もある。 The moving image decoding device 31 includes an entropy decoding unit 301, a parameter decoding unit 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generation unit (prediction image generation device) 308, and an inverse quantization / inverse conversion unit. It is composed of 311 and an addition unit 312. In addition, in accordance with the moving image coding device 11 described later, there is also a configuration in which the moving image decoding device 31 does not include the loop filter 305.

パラメータ復号部302は、さらに、図示しない、ヘッダ復号部3020、CT情報復号部3021、及びCU復号部3022(予測モード復号部)を備えており、CU復号部3022はさらにTU復号部3024を備えている。これらを総称して復号モジュールと呼んでもよい。ヘッダ復号部3020は、符号化データからVPS、SPS、PPSなどのパラメータセット情報、スライスヘッダ(スライス情報)を復号する。CT情報復号部3021は、符号化データからCTを復号する。CU復号部3022は符号化データからCUを復号する。TU復号部3024は、TUに予測誤差が含まれている場合に、符号化データからQP更新情報(量子化補正値)と量子化予測誤差(residual_coding)を復号する。 The parameter decoding unit 302 further includes a header decoding unit 3020, a CT information decoding unit 3021, and a CU decoding unit 3022 (prediction mode decoding unit) (not shown), and the CU decoding unit 3022 further includes a TU decoding unit 3024. ing. These may be generically called a decoding module. The header decoding unit 3020 decodes the parameter set information such as VPS, SPS, and PPS, and the slice header (slice information) from the encoded data. The CT information decoding unit 3021 decodes the CT from the encoded data. The CU decoding unit 3022 decodes the CU from the encoded data. The TU decoding unit 3024 decodes the QP update information (quantization correction value) and the quantization prediction error (residual_coding) from the coded data when the TU contains a prediction error.

TU復号部3024は、スキップモード以外(skip_mode==0)の場合に、符号化データからQP更新情報(量子化補正値)と量子化予測誤差(residual_coding)を復号する。より具体的には、TU復号部3024は、skip_mode==0の場合に、対象ブロックに量子化予測誤差が含まれているか否かを示すフラグcu_cbpを符号化データから復号し、cu_cbpが1の場合に量子化予測誤差を復号する。cu_cbpが符号化データに存在しない場合には、TU復号部3024はcu_cbpを0と導出する。 The TU decoding unit 3024 decodes the QP update information (quantization correction value) and the quantization prediction error (residual_coding) from the encoded data when the mode is other than the skip mode (skip_mode == 0). More specifically, when skip_mode == 0, the TU decoding unit 3024 decodes the flag cu_cbp indicating whether or not the target block contains a quantization prediction error from the encoded data, and cu_cbp is 1. Decrypt the quantization prediction error if. If cu_cbp does not exist in the encoded data, the TU decoding unit 3024 derives cu_cbp as 0.

また、パラメータ復号部302は、図示しないインター予測パラメータ復号部303及びイントラ予測パラメータ復号部304を含んで構成される。予測画像生成部308は、インター予測画像生成部309及びイントラ予測画像生成部310を含んで構成される。 Further, the parameter decoding unit 302 includes an inter-prediction parameter decoding unit 303 and an intra-prediction parameter decoding unit 304 (not shown). The prediction image generation unit 308 includes an inter prediction image generation unit 309 and an intra prediction image generation unit 310.

また、以降では処理の単位としてCTU、CUを使用した例を記載するが、この例に限らず、サブCU単位で処理をしてもよい。あるいはCTU、CUをブロック、サブCUをサブブロックと読み替え、ブロックあるいはサブブロック単位の処理としてもよい。 In the following, an example in which CTU and CU are used as the processing unit will be described, but the processing is not limited to this example, and processing may be performed in sub-CU units. Alternatively, CTU and CU may be read as blocks, sub-CUs may be read as sub-blocks, and processing may be performed in units of blocks or sub-blocks.

エントロピー復号部301は、外部から入力された符号化ストリームTeに対してエントロピー復号を行って、個々の符号(シンタックス要素)を復号する。復号された符号には、予測画像を生成するための予測情報および、差分画像を生成するための予測誤差などがある。 The entropy decoding unit 301 performs entropy decoding on the coded stream Te input from the outside, and decodes each code (syntax element). The decoded code includes prediction information for generating a prediction image, prediction error for generating a difference image, and the like.

エントロピー復号部301は、復号した符号をパラメータ復号部302に出力する。復号した符号とは、例えば、predMode、merge_flag、merge_idx、inter_pred_idc、refIdxLX、mvp_LX_idx、mvdLX、amvr_mode等である。どの符号を復号するかの制御は、パラメータ復号部302の指示に基づいて行われる。 The entropy decoding unit 301 outputs the decoded code to the parameter decoding unit 302. The decoded code is, for example, predMode, merge_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_LX_idx, mvdLX, amvr_mode and the like. The control of which code is decoded is performed based on the instruction of the parameter decoding unit 302.

(インター予測パラメータ復号部の構成)
インター予測パラメータ復号部303は、エントロピー復号部301から入力された符号に基づいて、予測パラメータメモリ307に記憶された予測パラメータを参照してインター予測パラメータを復号する。また、インター予測パラメータ復号部303は、復号したインター予測パラメータを予測画像生成部308に出力し、予測パラメータメモリ307に記憶する。
(Structure of inter-prediction parameter decoding unit)
The inter-prediction parameter decoding unit 303 decodes the inter-prediction parameter with reference to the prediction parameter stored in the prediction parameter memory 307 based on the code input from the entropy decoding unit 301. Further, the inter-prediction parameter decoding unit 303 outputs the decoded inter-prediction parameter to the prediction image generation unit 308 and stores it in the prediction parameter memory 307.

図8は、本実施形態に係るインター予測パラメータ復号部303の構成を示す概略図である。インター予測パラメータ復号部303は、マージ予測部30374、DMVR部30375、サブブロック予測部(アフィン予測部)30372、MMVD予測部30376、Triangle予測部30377、AMVP予測パラメータ導出部3032、加算部3038を含んで構成される。マージ予測部30374は、マージ予測パラメータ導出部3036を含んで構成される。AMVP予測パラメータ導出部3032、マージ予測パラメータ導出部3036、アフィン予測部30372は、動画像符号化装置、動画像復号装置で共通する手段であるので、これらを総称して動きベクトル導出部(動きベクトル導出装置)と称してもよい。 FIG. 8 is a schematic view showing the configuration of the inter-prediction parameter decoding unit 303 according to the present embodiment. The inter-prediction parameter decoding unit 303 includes a merge prediction unit 30374, a DMVR unit 30375, a sub-block prediction unit (affine prediction unit) 30372, an MMVD prediction unit 30376, a Triangle prediction unit 30377, an AMVP prediction parameter derivation unit 3032, and an addition unit 3038. Consists of. The merge prediction unit 30374 includes a merge prediction parameter derivation unit 3036. The AMVP prediction parameter derivation unit 3032, the merge prediction parameter derivation unit 3036, and the affine prediction unit 30372 are common means for the moving image coding device and the moving image decoding device. It may be called a derivation device).

(アフィン予測部)
アフィン予測部30372は対象ブロックのアフィン予測パラメータを導出する。本実施形態では、アフィン予測パラメータとして、対象ブロックの2つの制御点(V0、V1)の動きベクトル(mv0_x,mv0_y)(mv1_x,mv1_y)を導出する。具体的には、対象ブロックの隣接ブロックの動きベクトルから予測することにより、各制御点の動きベクトルを導出してもよいし、制御点の動きベクトルとして導出された予測ベクトルと符号化データから導出される差分ベクトルの和により、各制御点の動きベクトルを導出してもよい。
(Affine prediction department)
The affine prediction unit 30372 derives the affine prediction parameters of the target block. In the present embodiment, the motion vectors (mv0_x, mv0_y) (mv1_x, mv1_y) of the two control points (V0, V1) of the target block are derived as affine prediction parameters. Specifically, the motion vector of each control point may be derived by predicting from the motion vector of the adjacent block of the target block, or derived from the prediction vector derived as the motion vector of the control point and the coded data. The motion vector of each control point may be derived from the sum of the difference vectors to be obtained.

図10は、対象ブロック(bW×bH)を構成する各サブブロックの動きベクトルspMvLXを、制御点V0の動きベクトル(mv0_x,mv0_y)およびV1の動きベクトル(mv1_x,mv1_y)から導出する例を示す図である。各サブブロックの動きベクトルspMvLXは、図に示すように、各サブブロックの中心に位置する点毎の動きベクトルとして導出される。 FIG. 10 shows an example of deriving the motion vector spMvLX of each subblock constituting the target block (bW × bH) from the motion vector (mv0_x, mv0_y) of the control point V0 and the motion vector (mv1_x, mv1_y) of V1. It is a figure. As shown in the figure, the motion vector spMvLX of each subblock is derived as a motion vector for each point located at the center of each subblock.

アフィン予測部30372は対象ブロックのアフィン予測パラメータに基づいて、対象ブロック中の各サブブロックの動きベクトルspMvLX[xi][yi] (xi=xPb+sbW*i, yj=yPb+sbH*j, i=0,1,2,…,bW/sbW-1、j=0,1,2,…,bH/sbH-1)を下記の式を用いて、導出する。 The affine prediction unit 30372 uses the motion vector spMvLX [xi] [yi] (xi = xPb + sbW * i, yj = yPb + sbH * j, i) of each subblock in the target block based on the affine prediction parameters of the target block. = 0,1,2, ..., bW / sbW-1, j = 0,1,2, ..., bH / sbH-1) is derived using the following equation.

spMvLX[xi][yi][0] = mv0_x+(mv1_x-mv0_x)/bW*(xi+sbW/2)-(mv1_y-mv0_y)/bH*(yi+sbH/2)
spMvLX[xi][yi][1] = mv0_y+(mv1_y-mv0_y)/bW*(xi+sbW/2)+(mv1_x-mv0_x)/bH*(yi+sbH/2)
(マージ予測)
図9(a)は、マージ予測部30374に含まれるマージ予測パラメータ導出部3036の構成を示す概略図である。マージ予測パラメータ導出部3036は、マージ候補導出部30361、マージ候補選択部30362を備える。なお、マージ候補は、予測リスト利用フラグpredFlagLX、動きベクトルmvLX、参照ピクチャインデックスrefIdxLXを含んで構成され、マージ候補リストに格納される。マージ候補リストに格納されたマージ候補には、所定の規則に従ってインデックスが割り当てられる。
spMvLX [xi] [yi] [0] = mv0_x + (mv1_x-mv0_x) / bW * (xi + sbW / 2)-(mv1_y-mv0_y) / bH * (yi + sbH / 2)
spMvLX [xi] [yi] [1] = mv0_y + (mv1_y-mv0_y) / bW * (xi + sbW / 2) + (mv1_x-mv0_x) / bH * (yi + sbH / 2)
(Merge prediction)
FIG. 9A is a schematic diagram showing the configuration of the merge prediction parameter derivation unit 3036 included in the merge prediction unit 30374. The merge prediction parameter derivation unit 3036 includes a merge candidate derivation unit 30361 and a merge candidate selection unit 30362. The merge candidate is configured to include the prediction list usage flag predFlagLX, the motion vector mvLX, and the reference picture index refIdxLX, and is stored in the merge candidate list. The merge candidates stored in the merge candidate list are indexed according to a predetermined rule.

マージ候補導出部30361は、復号済の隣接ブロックの動きベクトルと参照ピクチャインデックスrefIdxLXをそのまま用いてマージ候補を導出する。 The merge candidate derivation unit 30361 derives the merge candidate by using the motion vector of the decoded adjacent block and the reference picture index refIdxLX as they are.

マージ候補リストmergeCandList[]に格納する順番は、例えば、空間マージ候補A1,B1,B0,A0,B2、時間マージ候補Col、ペアワイズマージ候補avgK、ゼロマージ候補ZK、である。なお、利用可能でない(ブロックがイントラ予測等)参照ブロックはマージ候補リストに格納しない。 The order of storage in the merge candidate list mergeCandList [] is, for example, spatial merge candidates A1, B1, B0, A0, B2, time merge candidate Col, pairwise merge candidate avgK, and zero merge candidate ZK. Reference blocks that are not available (blocks are intra-predicted, etc.) are not stored in the merge candidate list.

マージ候補選択部30362は、マージ候補リストに含まれるマージ候補のうち、マージインデックスmerge_idxが示すマージ候補Nを以下の式で選択する。 The merge candidate selection unit 30362 selects the merge candidate N indicated by the merge index merge_idx from the merge candidates included in the merge candidate list by the following formula.

N = mergeCandList[merge_idx]
ここでNは、マージ候補を示すラベルであり、A1,B1,B0,A0,B2,Col,avgK,ZKなどをとる。ラベルNで示されるマージ候補の動き情報は(mvLXN[0], mvLXN[1])、predFlagLXN, refIdxLXNで示される。
N = mergeCandList [merge_idx]
Here, N is a label indicating a merge candidate, and takes A1, B1, B0, A0, B2, Col, avgK, ZK, and the like. The motion information of the merge candidate indicated by the label N (mvLXN [0], mvLXN [1]) is indicated by predFlagLXN and refIdxLXN.

選択されたマージ候補の動き情報(mvLXN[0], mvLXN[1])、predFlagLXN, refIdxLXNを、対象ブロックのインター予測パラメータとして選択する。
マージ候補選択部30362は選択したマージ候補のインター予測パラメータを予測パラメータメモリ307に記憶するとともに、予測画像生成部308に出力する。
The motion information (mvLXN [0], mvLXN [1]), predFlagLXN, and refIdxLXN of the selected merge candidates are selected as the inter-prediction parameters of the target block.
The merge candidate selection unit 30362 stores the inter-prediction parameters of the selected merge candidates in the prediction parameter memory 307 and outputs them to the prediction image generation unit 308.

(AMVP予測)
図9(b)は、本実施形態に係るAMVP予測パラメータ導出部3032の構成を示す概略図である。AMVP予測パラメータ導出部3032は、ベクトル候補導出部3033とベクトル候補選択部3034を備える。ベクトル候補導出部3033は、参照ピクチャインデックスrefIdxLXに基づいて予測パラメータメモリ307が記憶する復号済みの隣接ブロックの動きベクトルmvLXから予測ベクトル候補を導出し、予測ベクトル候補リストmvpListLX[]に格納する。
(AMVP forecast)
FIG. 9B is a schematic diagram showing the configuration of the AMVP prediction parameter derivation unit 3032 according to the present embodiment. The AMVP prediction parameter derivation unit 3032 includes a vector candidate derivation unit 3033 and a vector candidate selection unit 3034. The vector candidate derivation unit 3033 derives the prediction vector candidate from the motion vector mvLX of the decoded adjacent block stored in the prediction parameter memory 307 based on the reference picture index refIdxLX, and stores it in the prediction vector candidate list mvpListLX [].

ベクトル候補選択部3034は、予測ベクトル候補リストmvpListLX[]の予測ベクトル候補のうち、予測ベクトルインデックスmvp_LX_idxが示す動きベクトルmvpListLX[mvp_LX_idx]を予測ベクトルmvpLXとして選択する。ベクトル候補選択部3034は選択した予測ベクトルmvpLXを加算部3038に出力する。 The vector candidate selection unit 3034 selects the motion vector mvpListLX [mvp_LX_idx] indicated by the prediction vector index mvp_LX_idx from the prediction vector candidates of the prediction vector candidate list mvpListLX [] as the prediction vector mvpLX. The vector candidate selection unit 3034 outputs the selected prediction vector mvpLX to the addition unit 3038.

なお、予測ベクトル候補は、対象ブロックから予め定めた範囲の復号済隣接ブロックの動きベクトルをスケーリングすることで導出される。なお、隣接ブロックは、対象ブロックに空間的に隣接するブロック、例えば、左ブロック、上ブロックの他、対象ブロックに時間的に隣接する領域、例えば、対象ブロックと同じ位置を含み、表示時刻が異なるブロックの予測パラメータから得られた領域を含む。 The prediction vector candidate is derived by scaling the motion vector of the decoded adjacent block in a predetermined range from the target block. The adjacent block includes a block spatially adjacent to the target block, for example, a left block, an upper block, and an area temporally adjacent to the target block, for example, the same position as the target block, and the display time is different. Includes the region obtained from the predictive parameters of the block.

加算部3038は、AMVP予測パラメータ導出部3032から入力された予測ベクトルmvpLXと復号した差分ベクトルmvdLXを加算して動きベクトルmvLXを算出する。加算部3038は、算出した動きベクトルmvLXを予測画像生成部308および予測パラメータメモリ307に出力する。 The addition unit 3038 calculates the motion vector mvLX by adding the prediction vector mvpLX input from the AMVP prediction parameter derivation unit 3032 and the decoded difference vector mvdLX. The addition unit 3038 outputs the calculated motion vector mvLX to the prediction image generation unit 308 and the prediction parameter memory 307.

mvLX[0] = mvpLX[0]+mvdLX[0]
mvLX[1] = mvpLX[1]+mvdLX[1]
動きベクトル精度モードamvr_modeは、AMVPモードで導出される動きベクトルの精度を切り替えるシンタックスである、例えば、amvr_mode=0,1,2において、1/4画素、1画素、4画素精度を切り替える。
mvLX [0] = mvpLX [0] + mvdLX [0]
mvLX [1] = mvpLX [1] + mvdLX [1]
The motion vector accuracy mode amvr_mode is a syntax for switching the accuracy of the motion vector derived in the AMVP mode. For example, in amvr_mode = 0,1,2, the accuracy of 1/4 pixel, 1 pixel, and 4 pixels is switched.

動きベクトルの精度を1/16精度(MVPREC=16)とする場合、1/4,1,4画素精度の動きベクトル差分を1/16画素精度の動きベクトル差分に変更するために下記のように、amvr_modeから導出されるMvShift (=1<<amvr_mode)を用いて逆量子化してもよい。 When the accuracy of the motion vector is 1/16 accuracy (MVPREC = 16), the following is used to change the motion vector difference with 1 / 4,1,4 pixel accuracy to the motion vector difference with 1/16 pixel accuracy. , MvShift derived from amvr_mode (= 1 << amvr_mode) may be used for inverse quantization.

mvdLX[0] = mvdLX[0] << (MvShift + 2)
mvdLX[1] = mvdLX[1] << (MvShift + 2)
なお、さらにパラメータ復号部302は、上記MvShiftでシフトする前のmvdLX[]を以下のシンタックスを復号して導出してもよい。
・abs_mvd_greater0_flag
・abs_mvd_minus2
・mvd_sign_flag
そして、パラメータ復号部302は、以下の式を用いることによって、シンタックスから差分ベクトルlMvd[]を復号する。
mvdLX [0] = mvdLX [0] << (MvShift + 2)
mvdLX [1] = mvdLX [1] << (MvShift + 2)
Further, the parameter decoding unit 302 may derive the mvdLX [] before shifting by the above MvShift by decoding the following syntax.
・ Abs_mvd_greater0_flag
・ Abs_mvd_minus2
・ Mvd_sign_flag
Then, the parameter decoding unit 302 decodes the difference vector lMvd [] from the syntax by using the following equation.

lMvd[compIdx] = abs_mvd_greater0_flag[compIdx] * (abs_mvd_minus2[compIdx]+2) *
(1-2*mvd_sign_flag[compIdx])
さらに復号した差分ベクトルlMvd[]は、並進MVDの場合(MotionModelIdc[x][y] == 0)にはMvdLXに設定し、制御点MVDの場合(MotionModelIdc[x][y] != 0)には、MvdCpLXに設定する。
lMvd [compIdx] = abs_mvd_greater0_flag [compIdx] * (abs_mvd_minus2 [compIdx] +2) *
(1-2 * mvd_sign_flag [compIdx])
Furthermore, the decoded difference vector lMvd [] is set to MvdLX in the case of translation MVD (MotionModelIdc [x] [y] == 0), and in the case of control point MVD (MotionModelIdc [x] [y]! = 0). Is set to MvdCpLX.

if (MotionModelIdc[x][y] == 0)
mvdLX[x0][y0][compIdx] = lMvd[compIdx]
else
mvdCpLX[x0][y0][compIdx] = lMvd[compIdx]<<2
(動きベクトルスケーリング)
動きベクトルのスケーリングの導出方法を説明する。動きベクトルMv(参照動きベクトル)、Mvをもつブロックを含むピクチャPicMv、Mvの参照ピクチャPicMvRef、スケーリング後の動きベクトルsMv、sMvをもつブロックを含むピクチャCurPic、sMvが参照する参照ピクチャCurPicRefとすると、sMvの導出関数MvScale(Mv,PicMv,PicMvRef,CurPic,CurPicRef)は下式で表される。
if (MotionModelIdc [x] [y] == 0)
mvdLX [x0] [y0] [compIdx] = lMvd [compIdx]
else else
mvdCpLX [x0] [y0] [compIdx] = lMvd [compIdx] << 2
(Motion vector scaling)
The method of deriving the scaling of the motion vector will be described. If the motion vector Mv (reference motion vector), the picture PicMv containing the block with Mv, the reference picture PicMvRef of Mv, the motion vector sMv after scaling, the picture CurPic containing the block with sMv, and the reference picture CurPicRef referenced by sMv, The sMv derivation function MvScale (Mv, PicMv, PicMvRef, CurPic, CurPicRef) is expressed by the following equation.

sMv = MvScale(Mv,PicMv,PicMvRef,CurPic,CurPicRef)
= Clip3(-R1,R1-1,sign(distScaleFactor*Mv)*((abs(distScaleFactor*Mv)+round1-1)>>shift1))
distScaleFactor = Clip3(-R2,R2-1,(tb*tx+round2)>>shift2)
tx = (16384+abs(td)>>1)/td
td = DiffPicOrderCnt(PicMv,PicMvRef)
tb = DiffPicOrderCnt(CurPic,CurPicRef)
ここで、round1、round2、shift1、shift2は、逆数を用いて除算を行うためのラウンド値及びシフト値で、例えば、round1=1<<(shift1-1)、round2=1<<(shift2-1)、shift1=8、shift2=6などである。DiffPicOrderCnt(Pic1,Pic2)はPic1とPic2の時間情報(例えばPOC)の差を返す関数である。R1、R2は処理を限られた精度で行うために値域を制限するもので例えば、R1=32768、R2=4096などである。
sMv = MvScale (Mv, PicMv, PicMvRef, CurPic, CurPicRef)
= Clip3 (-R1, R1-1, sign (distScaleFactor * Mv) * ((abs (distScaleFactor * Mv) + round1-1) >> shift1))
distScaleFactor = Clip3 (-R2, R2-1, (tb * tx + round2) >> shift2)
tx = (16384 + abs (td) >> 1) / td
td = DiffPicOrderCnt (PicMv, PicMvRef)
tb = DiffPicOrderCnt (CurPic, CurPicRef)
Here, round1, round2, shift1, and shift2 are round values and shift values for performing division using the reciprocal, for example, round1 = 1 << (shift1-1), round2 = 1 << (shift2-1). ), Shift1 = 8, shift2 = 6, etc. DiffPicOrderCnt (Pic1, Pic2) is a function that returns the difference between the time information (for example, POC) between Pic1 and Pic2. R1 and R2 limit the range in order to perform processing with limited accuracy. For example, R1 = 32768 and R2 = 4096.

また、スケーリング関数MvScale(Mv,PicMv,PicMvRef,CurPic,CurPicRef)は以下の式でもよい。 Further, the scaling function MvScale (Mv, PicMv, PicMvRef, CurPic, CurPicRef) may be expressed by the following equation.

MvScale(Mv,PicMv,PicMvRef,CurPic,CurPicRef) =
Mv*DiffPicOrderCnt(CurPic,CurPicRef)/DiffPicOrderCnt(PicMv,PicMvRef)
すなわち、CurPicとCurPicRefの時間情報の差と、PicMvとPicMvRefの時間情報の差との比に応じてMvをスケーリングしてもよい。
MvScale (Mv, PicMv, PicMvRef, CurPic, CurPicRef) =
Mv * DiffPicOrderCnt (CurPic, CurPicRef) / DiffPicOrderCnt (PicMv, PicMvRef)
That is, Mv may be scaled according to the ratio of the time information difference between CurPic and CurPicRef and the time information difference between PicMv and PicMvRef.

(DMVR)
続いて、DMVR部30375が行うDMVR(Decoder side Motion Vector Refinement)処理について説明する。DMVR処理とは、2枚の参照ピクチャを用いて動きベクトルmvL0およびmvL1を修正する処理である。
(DMVR)
Next, the DMVR (Decoder side Motion Vector Refinement) process performed by the DMVR unit 30375 will be described. The DMVR process is a process of modifying the motion vectors mvL0 and mvL1 using two reference pictures.

DMVR部30375は、
・対象ブロックの左上位置(xCb,yCb)
・対象ブロックの幅bW
・対象ブロックの高さbH
・1/16画素精度の動きベクトルmvL0およびmvL1
・参照ピクチャrefPicL0LおよびrefPicL1L
を参照して、mvL0およびmvL1を修正するための動きベクトルの変化量dmvL0及びdmvL1を導出する。
DMVR section 30375
・ Upper left position of the target block (xCb, yCb)
・ Width bW of target block
・ Height of target block bH
・ Motion vectors with 1/16 pixel accuracy mvL0 and mvL1
-Reference pictures refPicL0L and refPicL1L
With reference to, the change amounts dmvL0 and dmvL1 of the motion vector for modifying mvL0 and mvL1 are derived.

DMVR部30375は、以下の条件が全て真の場合に、dmvrFlagを1に設定し、後続のDMVR処理を行って、動きベクトルを修正する。それ以外の場合にdmvrFlagを0に設定する。
・DMVRオンオフフラグdmvr_enabled_flagが1である
・マージフラグmerge_flagが1である
・双予測である(predFlagL0とpredFlagL1が1)
・mmvd_flagが0である
・L0参照ピクチャRefPicList[0][refIdxL0]と対象ピクチャのcurrPicのPOC差分が、L1参照ピクチャRefPicList[1][refIdxL1]と対象ピクチャのcurrPicのPOC差分に等しい。
・CUのサイズが所定のサイズ以上である(例えばcbHeight>=8かつcbHeight*cbWidth>=64)
なお、dmvr_enabled_flagは、SPSで符号化するフラグであってもよい。またPOC差分に関する制限はなくてもよいし、上記とは異なる条件式でもよい。またCUのサイズが所定のサイズ以上である条件は上記によらず、cbWidth>=8かつcbHeight>=8などの判定でもよい。
The DMVR unit 30375 sets dmvrFlag to 1 and performs subsequent DMVR processing to correct the motion vector when all of the following conditions are true. Otherwise, set dmvrFlag to 0.
-DMVR on / off flag dmvr_enabled_flag is 1.- Merge flag merge_flag is 1.-Bi-prediction (predFlagL0 and predFlagL1 are 1).
-Mmvd_flag is 0-The POC difference between the L0 reference picture RefPicList [0] [refIdxL0] and the currPic of the target picture is equal to the POC difference between the L1 reference picture RefPicList [1] [refIdxL1] and the currPic of the target picture.
-The size of the CU is greater than or equal to the specified size (for example, cbHeight> = 8 and cbHeight * cbWidth> = 64).
Note that dmvr_enabled_flag may be a flag encoded by SPS. Further, there may be no restriction on the POC difference, or a conditional expression different from the above may be used. Further, the condition that the size of the CU is equal to or larger than the predetermined size may be determined such that cbWidth> = 8 and cbHeight> = 8 regardless of the above.

図22に、本実施形態の別の形態のDMVR判定処理のフローチャートを示す。本実施形態の別の形態のDMVR判定処理において、DMVR部30375は、以下の条件が全て真の場合に、dmvrFlagを1に設定し(S305)、後続のDMVR処理を行って、動きベクトルを修正する。それ以外の場合にdmvrFlagを0に設定する(S306)。
・DMVRオンオフフラグdmvr_enabled_flagが1である
・マージフラグmerge_flagが1である
・双予測である(S301、例えばpredFlagL0とpredFlagL1が1)
・MMVDフラグが0である(S302)、もしくはMMVDフラグが1であって、MMVDの動きベクトル長DistFromBaseMVが所定の長さ以上である(S303、MMVD距離条件)
・L0参照ピクチャRefPicList[0][refIdxL0]と対象ピクチャのcurrPicのPOC差分が、L1参照ピクチャRefPicList[ 1 ][ refIdxL1 ]と対象ピクチャのcurrPicのPOC差分に等しい。
・CUのサイズが所定のサイズ以上である(S304、例えばcbHeight>=8かつcbHeight*cb
Width>=64)
ここで、所定の長さは、1/16の動き精度で64(4画素に相当する)などを利用することができる。また、64に限定されず32や128などでもよい。また、1/4画素精度で8,16,32などでもよい。
FIG. 22 shows a flowchart of the DMVR determination process of another embodiment of the present embodiment. In the DMVR determination process of another embodiment of the present embodiment, the DMVR unit 30375 sets the dmvrFlag to 1 (S305) when all of the following conditions are true, performs the subsequent DMVR process, and corrects the motion vector. To do. In other cases, dmvrFlag is set to 0 (S306).
-DMVR on / off flag dmvr_enabled_flag is 1.- Merge flag merge_flag is 1.-Bi-prediction (S301, for example, predFlagL0 and predFlagL1 are 1).
-The MMVD flag is 0 (S302), or the MMVD flag is 1, and the motion vector length DistFromBaseMV of MMVD is equal to or longer than a predetermined length (S303, MMVD distance condition).
-The POC difference between the L0 reference picture RefPicList [0] [refIdxL0] and the currPic of the target picture is equal to the POC difference between the L1 reference picture RefPicList [1] [refIdxL1] and the currPic of the target picture.
-The size of the CU is greater than or equal to the specified size (S304, for example, cbHeight> = 8 and cbHeight * cb
Width> = 64)
Here, as the predetermined length, 64 (corresponding to 4 pixels) or the like can be used with a motion accuracy of 1/16. Moreover, it is not limited to 64, and may be 32 or 128. Further, it may be 8, 16, 32 or the like with 1/4 pixel accuracy.

図のフローチャートでは、MMVD部分の判定を強調するため、マージフラグの判定とPOCの判定は省略している。マージフラグの判定を組み合わせることで、マージモードにDMVR処理が限定されるため精度が向上する。また、POCに関する判定も、参照ピクチャが互いに異なる方向にあって、さらに距離が同じことを判定にする。この判定によって、動き探索の精度が向上がする。なお、POCの判定は、単に参照ピクチャが互いに異なる方向になる、という緩い判定でもよい。 In the flowchart of the figure, the judgment of the merge flag and the judgment of POC are omitted in order to emphasize the judgment of the MMVD part. By combining the judgment of the merge flag, the DMVR processing is limited to the merge mode, which improves the accuracy. Further, the determination regarding POC also determines that the reference pictures are in different directions and the distances are the same. This determination improves the accuracy of motion search. The POC determination may be a loose determination that the reference pictures are in different directions.

なお、この構成は図16、図17に示すように、マージフラグmerge_flagが1である場合に、mmvd_flagを復号する構成に対応する。マージモードもしくはMMVD予測が用いられる場合とは、merge_flag==1もしくはmmvd_flag==1で導出できる。本構成ではさらに、MMVD処理を行う場合であってもMMVDの動きベクトル長DistFromBaseMVが所定の長さ以上である場合にDMVR処理を限定することが特徴である。以下のように場合分けできる。
merge_flag==1 かつ mmvd_flag == 0 :DMVRオン
merge_flag==1 かつ mmvd_flag == 1 かつ DistFromBaseMv>=TH :DMVRオン
merge_flag==1 かつ mmvd_flag == 1 かつ DistFromBaseMv<TH :DMVRオフ
merge_flag==0:DMVRオフ
上記の判定は以下のように簡略化できる。
merge_flag==1 かつ (mmvd_flag == 0 もしくは(mmvd_flag == 1 かつ DistFromBaseMv>=TH))
別の構成例として、DMVR部30375は、以下の条件が全て真の場合に、dmvrFlagを1に設定し(S305)、後続のDMVR処理を行って、動きベクトルを修正してもよい。
・DMVRオンオフフラグdmvr_enabled_flagが1である
・双予測である(例えばpredFlagL0とpredFlagL1が1)
・マージフラグが1である、もしくはMMVDフラグが1であって、MMVDの動きベクトル長DistFromBaseMVが所定の長さ以上である(MMVD距離条件)
・L0参照ピクチャRefPicList[0][refIdxL0]と対象ピクチャのcurrPicのPOC差分が、L1参照ピクチャRefPicList[ 1 ][ refIdxL1 ]と対象ピクチャのcurrPicのPOC差分に等しい。
・CUのサイズが所定のサイズ以上である(例えばcbHeight>=8かつcbHeight*cbWidth>=64)
上記判定は、図18、図19に示すように、マージフラグmerge_flagが0である場合に、mmvd_flagを復号する構成に対応する。マージモードもしくはMMVD予測が用いられる場合とは、merge_flag==1もしくはmmvd_flag==1で導出できる。本構成ではさらに、mmvd_flag==1かつMMVDの動きベクトル長DistFromBaseMVが所定の長さ以上である場合にDMVR処理を限定することが特徴である。
merge_flag==1:DMVRオン
merge_flag==0 かつ mmvd_flag == 1 かつ DistFromBaseMv>=TH :DMVRオン
merge_flag==0 かつ mmvd_flag == 1 かつ DistFromBaseMv<TH :DMVRオフ
merge_flag==0 かつ mmvd_flag == 0:DMVRオフ
上記の判定は以下のように簡略化できる。
merge_flag==1 もしくは (mmvd_flag == 1 かつDistFromBaseMv>=TH)
上記の構成によれば、MMVDフラグが1の場合、すなわち、中心ベクトルに所定の距離及び所定の方向の差分ベクトルを加算することで動きベクトルを得るモードであるMMVDモードである場合においても、dmvrFlagを1に設定し、さらにマッチング探索による動きベクトル修正を行うことで符号化効率を向上させる効果を奏する。
As shown in FIGS. 16 and 17, this configuration corresponds to a configuration in which mmvd_flag is decoded when the merge flag merge_flag is 1. When merge mode or MMVD prediction is used, it can be derived with merge_flag == 1 or mmvd_flag == 1. Further, this configuration is further characterized in that DMVR processing is limited when the motion vector length DistFromBaseMV of MMVD is longer than a predetermined length even when MMVD processing is performed. The cases can be divided as follows.
merge_flag == 1 and mmvd_flag == 0: DMVR on
merge_flag == 1 and mmvd_flag == 1 and DistFromBaseMv> = TH: DMVR on
merge_flag == 1 and mmvd_flag == 1 and DistFromBaseMv <TH: DMVR off
merge_flag == 0: DMVR off The above judgment can be simplified as follows.
merge_flag == 1 and (mmvd_flag == 0 or (mmvd_flag == 1 and DistFromBaseMv> = TH))
As another configuration example, the DMVR unit 30375 may set dmvrFlag to 1 (S305) and perform subsequent DMVR processing to correct the motion vector when all of the following conditions are true.
-DMVR on / off flag dmvr_enabled_flag is 1.-Bi-prediction (for example, predFlagL0 and predFlagL1 are 1).
-The merge flag is 1, or the MMVD flag is 1, and the motion vector length DistFromBaseMV of MMVD is greater than or equal to the predetermined length (MMVD distance condition).
-The POC difference between the L0 reference picture RefPicList [0] [refIdxL0] and the currPic of the target picture is equal to the POC difference between the L1 reference picture RefPicList [1] [refIdxL1] and the currPic of the target picture.
-The size of the CU is greater than or equal to the specified size (for example, cbHeight> = 8 and cbHeight * cbWidth> = 64)
As shown in FIGS. 18 and 19, the above determination corresponds to a configuration in which mmvd_flag is decoded when the merge flag merge_flag is 0. When merge mode or MMVD prediction is used, it can be derived with merge_flag == 1 or mmvd_flag == 1. Another feature of this configuration is that DMVR processing is limited when mmvd_flag == 1 and the motion vector length DistFromBaseMV of MMVD is longer than a predetermined length.
merge_flag == 1: DMVR on
merge_flag == 0 and mmvd_flag == 1 and DistFromBaseMv> = TH: DMVR on
merge_flag == 0 and mmvd_flag == 1 and DistFromBaseMv <TH: DMVR off
merge_flag == 0 and mmvd_flag == 0: DMVR off The above judgment can be simplified as follows.
merge_flag == 1 or (mmvd_flag == 1 and DistFromBaseMv> = TH)
According to the above configuration, even when the MMVD flag is 1, that is, in the MMVD mode in which a motion vector is obtained by adding a difference vector of a predetermined distance and a predetermined direction to the center vector, the dmvrFlag Is set to 1, and further, the motion vector is corrected by the matching search, which has the effect of improving the coding efficiency.

なお、MMVDもDMVRも中心ベクトルに対して動きベクトル差分を加算して動きベクトルを修正するという意味で効果が被る。具体的には、MMVDは送付するシンタックス要素によって動きベクトル差分を導出し、DMVRは、マッチング探索により動きベクトル差分を導出する。MMVDとDMVRの修正範囲を両方作用させる場合には、エンコーダが定めた好適なMMVDによる修正後の動きベクトルを、DMVRにより導出される動きベクトル差分の加算により悪化させることにより、符号化効率が逆に低下することがあった。そのため、MMVDフラグを0に限定してdmvrFlagを1に設定していた。上記構成では、MMVDによる動きベクトル修正量が所定の範囲を超える場合(MMVD距離DistFromBaseMVが所定の値以上の場合)にDMVRによる動きベクトル修正をオンとする(dmvrFlagを1に設定する)ことで、DMVRにより動きベクトルを悪化させることなく、MMVDとDMVRの両方の効果を得ることができる。これにより、DMVRの探索範囲が通常小範囲(たとえば中心から2画素範囲)であることから、MMVDの調整範囲が大きい(例えば4画素以上)の場合に限定することで、両者の効果が被らないようにすることができる。 Both MMVD and DMVR have an effect in the sense that the motion vector is corrected by adding the motion vector difference to the center vector. Specifically, MMVD derives the motion vector difference by the syntax element to be sent, and DMVR derives the motion vector difference by the matching search. When both the correction range of MMVD and DMVR are applied, the coding efficiency is reversed by deteriorating the motion vector after correction by the suitable MMVD defined by the encoder by adding the motion vector difference derived by DMVR. May drop to. Therefore, the MMVD flag was limited to 0 and the dmvrFlag was set to 1. In the above configuration, when the motion vector correction amount by MMVD exceeds the predetermined range (when the MMVD distance DistFromBaseMV is equal to or more than the predetermined value), the motion vector correction by DMVR is turned on (dmvrFlag is set to 1). With DMVR, the effects of both MMVD and DMVR can be obtained without deteriorating the motion vector. As a result, since the search range of DMVR is usually a small range (for example, a range of 2 pixels from the center), the effects of both can be obtained by limiting the adjustment range of MMVD to a large range (for example, 4 pixels or more). Can be avoided.

DMVR部30375は、dmvrFlagが1の場合に以下の処理を行う(S307)。dmvrFlagが0の場合には、動きベクトルの変更処理は行わずに、DMVR部30375の処理をここで終了する。 The DMVR unit 30375 performs the following processing when the dmvrFlag is 1 (S307). When dmvrFlag is 0, the processing of the DMVR unit 30375 ends here without changing the motion vector.

まず、DMVR部30375は、
・対象サブブロックの左上位置(xSb,ySb)
・輝度サンプルの対象サブブロックの幅sbW
・輝度サンプルの対象サブブロックの高さsbH
・動きベクトルmvLX(X=0,1)
・参照ピクチャrefPicLXL(X=0,1)
を参照して、(sbW)*(sbH)のサイズを有する予測画像predSamplesLXLを導出する。
First, the DMVR section 30375
・ Upper left position of the target subblock (xSb, ySb)
・ Width sbW of the target subblock of the brightness sample
・ Height of target subblock of brightness sample sbH
・ Motion vector mvLX (X = 0,1)
・ Reference picture refPicLXL (X = 0,1)
To derive the predicted image predSamplesLXL having the size of (sbW) * (sbH) with reference to.

DMVR部30375は、以下の式により動きベクトルMvLsX(X=0,1)を導出する。 The DMVR unit 30375 derives the motion vector MvLsX (X = 0,1) by the following equation.

MvLsX[0] = MvLX[0]-32
MvLsX[1] = MvLX[1]-32
また、DMVR部30375は、変数srRange、offsetH[0]、offsetV[0]、offsetH[1]、offsetV[1]の値をそれぞれ2に設定する。
MvLsX [0] = MvLX [0]-32
MvLsX [1] = MvLX [1]-32
Further, the DMVR unit 30375 sets the values of the variables srRange, offsetH [0], offsetV [0], offsetH [1], and offsetV [1] to 2, respectively.

対象ブロック中の画素位置(xL,yL)に対応する、参照ブロックの整数画素単位での画素の位置を(xIntL,yIntL)とする。また、(xIntL,yIntL)からの1/16画素単位でのオフセットを(xFracL,yFracL)とする。これらの座標は、動きベクトル(mvLX[0],mvLX[1])の整数成分(mvLX[0]>>4,mvLX[1]>>4)と小数成分(mvLX[0]&15,mvLX[1]&15)から導出され、参照ピクチャrefPicLXL内における、小数精度での画素の位置を示す。predSamplesLXLにおける位置が(xL,yL) (xL=0, ..., sbW-1, yL=0, ..., sbH-1)である画素について、DMVR部30375は、xIntL、yIntL、xFracLおよびyFracLを以下の式により導出する。 Let (xIntL, yIntL) be the position of the pixel in the integer pixel unit of the reference block corresponding to the pixel position (xL, yL) in the target block. The offset from (xIntL, yIntL) in 1/16 pixel units is (xFracL, yFracL). These coordinates are the integer component (mvLX [0] >> 4, mvLX [1] >> 4) and decimal component (mvLX [0] & 15, mvLX [" of the motion vector (mvLX [0], mvLX [1]). Derived from 1] & 15), it shows the position of the pixel with decimal precision in the reference picture refPicLXL. For pixels whose positions in predSamplesLXL are (xL, yL) (xL = 0, ..., sbW-1, yL = 0, ..., sbH-1), the DMVR unit 30375 has xIntL, yIntL, xFracL and yFracL is derived by the following formula.

xIntL = xSb + (mvLX[0]>>4) + xL
yIntL = ySb + (mvLX[1]>>4) + yL
xFracL = mvLX[0]&15
yFracL = mvLX[1]&15
続いて、DMVR部30375は、
・(xIntL, yIntL)
・(xFracL, yFracL)
・refPicLXL
を参照して、predSampleLXLを導出する。
xIntL = xSb + (mvLX [0] >> 4) + xL
yIntL = ySb + (mvLX [1] >> 4) + yL
xFracL = mvLX [0] & 15
yFracL = mvLX [1] & 15
Next, DMVR section 30375
・ (XIntL, yIntL)
・ (XFracL, yFracL)
・ RefPicLXL
Refer to to derive predSampleLXL.

まず、DMVR部30375は、変数shift1、shift2、shift3およびshift4を以下の式により導出する。 First, the DMVR unit 30375 derives the variables shift1, shift2, shift3 and shift4 by the following equations.

shift1 = Min(6, BitDepthY - 6)
shift2 = 4
shift3 = Max(2, 10-BitDepthY) (BitDepthY <= 10)
shift4 = Max(2, BitDepthY - 10) (BitDepthY > 10)
なお、上記の式において、BitDepthYは画素ビット数である。
shift1 = Min (6, BitDepthY -6)
shift2 = 4
shift3 = Max (2, 10-BitDepthY) (BitDepthY <= 10)
shift4 = Max (2, BitDepthY -10) (BitDepthY> 10)
In the above equation, BitDepthY is the number of pixel bits.

次に、DMVR部30375は、picWをピクチャの幅pic_width_in_luma_samplesの値と等しく設定する。また、DMVR部30375は、picHのピクチャの高さpic_height_in_luma_samplesの値と等しく設定する。 Next, the DMVR unit 30375 sets picW equal to the value of the picture width pic_width_in_luma_samples. In addition, the DMVR unit 30375 sets the height of the picH picture equal to the value of pic_height_in_luma_samples.

その後、DMVR部30375は、predSampleLXLを以下のとおり導出する。以下の説明において、fbL[p]は1/16画素精度での画素値を導出するためのフィルタ係数を示す。fbL[p]の値は、1/16画素精度での位置p(p=1, 2, ..., 15)に依存する。位置pは、xFracLまたはyFracLと等しい。pの値の増大により、fbL[p][0]は単調減少し、fbL[p][1]の値は単調増加する。 After that, the DMVR unit 30375 derives the predSampleLXL as follows. In the following description, fbL [p] indicates the filter coefficient for deriving the pixel value with 1/16 pixel accuracy. The value of fbL [p] depends on the position p (p = 1, 2, ..., 15) with 1/16 pixel accuracy. Position p is equal to xFracL or yFracL. As the value of p increases, fbL [p] [0] decreases monotonically and the value of fbL [p] [1] increases monotonically.

まず、DMVR部30375は、xFracLおよびyFracLがそれぞれ0であるか否か判定する。xFracLおよびyFracLがいずれも0である場合、DMVR部30375は、BitDepthYの値に応じて、以下のいずれかの式によりpredSampleLXLを導出する。 First, the DMVR unit 30375 determines whether or not xFracL and yFracL are 0, respectively. When both xFracL and yFracL are 0, the DMVR unit 30375 derives predSampleLXL by one of the following equations according to the value of BitDepthY.

predSampleLXL = refPicLXL[xIntL][yIntL] << shift3 (BitDepthY <= 10)
predSampleLXL = refPicLXL[xIntL][yIntL] >> shift4 (BitDepthY > 10)
xFracLが0でなく、yFracLが0である場合、DMVR部30375は、以下の式によりpredSampleLXLを導出する。
predSampleLXL = refPicLXL [xIntL] [yIntL] << shift3 (BitDepthY <= 10)
predSampleLXL = refPicLXL [xIntL] [yIntL] >> shift4 (BitDepthY> 10)
When xFracL is not 0 and yFracL is 0, DMVR unit 30375 derives predSampleLXL by the following formula.

predSampleLXL = (fbL[xFracL][0] * refPicLXL[Clip3(0,picW-1,xIntL)][yIntL] + fbL[xFracL][1] * refPicLXL[Clip3(0,picW-1,xIntL+1)][yIntL])>>shift1
xFracLが0であり、yFracLが0でない場合、DMVR部30375は、以下の式によりpredSampleLXLを導出する。
predSampleLXL = (fbL [xFracL] [0] * refPicLXL [Clip3 (0, picW-1, xIntL)] [yIntL] + fbL [xFracL] [1] * refPicLXL [Clip3 (0, picW-1, xIntL + 1) ] [yIntL]) >> shift1
When xFracL is 0 and yFracL is not 0, DMVR unit 30375 derives predSampleLXL by the following formula.

predSampleLXL = (fbL[yFracL][0] * refPicLXL[xIntL][Clip3(0,picH-1,yIntL)] + fbL[yFracL][1] * refPicLXL[xIntL][Clip3(0,picH-1,yIntL+1)])>>shift1
xFracLおよびyFracLがいずれも0でない場合、DMVR部30375は、predSampleLXLを以下のとおり導出する。まず、DMVR部30375は、以下の式によりtemp[n]を導出する。
predSampleLXL = (fbL [yFracL] [0] * refPicLXL [xIntL] [Clip3 (0, picH-1, yIntL)] + fbL [yFracL] [1] * refPicLXL [xIntL] [Clip3 (0, picH-1, yIntL) +1)]) >> shift1
If neither xFracL nor yFracL is 0, DMVR unit 30375 derives predSampleLXL as follows. First, the DMVR unit 30375 derives temp [n] by the following equation.

yPosL = Clip3(0, PicH-1, yIntL+n-3)
temp[n] = (fbL[xFracL][0] * refPicLXL[Clip3(0,picW-1,xIntL)][yPosL] + fbL[xFracL][1] * refPicLXL[Clip3(0,picW-1,xIntL+1)][yPosL])>>shift1
その後、DMVR部30375は、以下の式によりpredSampleLXLを導出する。
yPosL = Clip3 (0, PicH-1, yIntL + n-3)
temp [n] = (fbL [xFracL] [0] * refPicLXL [Clip3 (0, picW-1, xIntL)] [yPosL] + fbL [xFracL] [1] * refPicLXL [Clip3 (0, picW-1, xIntL)] +1)] [yPosL]) >> shift1
After that, the DMVR unit 30375 derives the predSampleLXL by the following formula.

predSampleLXL = (fbL[yFracL][0] * temp[0] + fbL[yFracL][1] * temp[1])>>shift2
DMVR部30375は、
・対象ブロックの幅nCbW
・対象ブロックの高さnCbH
・(nCbW+4)x(nCbH+4) のサイズを有する2つの予測画像predSampleL1およびpredSampleL2
・変数offsetH[0]、offsetH[1]、offsetV[0]、およびoffsetV[1]
を参照して、predSampleL1およびpredSampleL2に含まれる画素値の絶対差分和 (sum of absolute differences) のリストSad1および変数centerPointSadを導出する。
predSampleLXL = (fbL [yFracL] [0] * temp [0] + fbL [yFracL] [1] * temp [1]) >> shift2
DMVR section 30375
-Target block width nCbW
・ Height of target block nCbH
Two predicted images with sizes of (nCbW + 4) x (nCbH + 4) predSampleL1 and predSampleL2
-Variables offsetH [0], offsetH [1], offsetV [0], and offsetV [1]
To derive the list Sad1 and the variable centerPointSad of the sum of absolute differences of the pixel values contained in predSampleL1 and predSampleL2.

DMVR部30375は、2×9の配列bCの、各要素の値を以下の式のとおり設定する。 The DMVR unit 30375 sets the value of each element of the 2 × 9 array bC as shown in the following formula.

bC[0][0] = -1 bC[1][0] = -1
bC[0][1] = -1 bC[1][1] = 0
bC[0][2] = -1 bC[1][2] = 1
bC[0][3] = 0 bC[1][3] = -1
bC[0][4] = 0 bC[1][4] = 0
bC[0][5] = 0 bC[1][5] = 1
bC[0][6] = 1 bC[1][6] = -1
bC[0][7] = 1 bC[1][7] = 0
bC[0][8] = 1 bC[1][8] = 1
DMVR部30375は、Sad1の要素mrSad[i](i=0, ... ,8)をL0予測画像とL1予測画像の絶対値差分から以下の式により導出する。
bC [0] [0] = -1 bC [1] [0] = -1
bC [0] [1] = -1 bC [1] [1] = 0
bC [0] [2] = -1 bC [1] [2] = 1
bC [0] [3] = 0 bC [1] [3] = -1
bC [0] [4] = 0 bC [1] [4] = 0
bC [0] [5] = 0 bC [1] [5] = 1
bC [0] [6] = 1 bC [1] [6] = -1
bC [0] [7] = 1 bC [1] [7] = 0
bC [0] [8] = 1 bC [1] [8] = 1
The DMVR unit 30375 derives the element mrSad [i] (i = 0, ..., 8) of Sad1 from the absolute value difference between the L0 predicted image and the L1 predicted image by the following formula.

mrSad[i] = ΣΣabs(predSamplesL0[x+bC[0][i]+offsetH[0]][2*y+bC[1][i]+offsetV[0]] - predSamplesL1[x-bC[0][i]+offsetH[1]][2*y-bC[1][i]+offsetV[1]])
ここで最初のΣはx=0..nCbW-1の和、2番目のΣはy=0..nCbH/2-1の和を表す。
mrSad [i] = ΣΣabs (predSamplesL0 [x + bC [0] [i] + offsetH [0]] [2 * y + bC [1] [i] + offsetV [0]] --predSamplesL1 [x-bC [0] ] [i] + offsetH [1]] [2 * y-bC [1] [i] + offsetV [1]])
Here, the first Σ represents the sum of x = 0..nCbW-1 and the second Σ represents the sum of y = 0..nCbH / 2-1.

さらに、DMVR部30375は、centerPointSadをL0予測画像とL1予測画像の絶対値差分から以下の式により導出する。 Further, the DMVR unit 30375 derives the centerPointSad from the absolute value difference between the L0 predicted image and the L1 predicted image by the following formula.

centerPointSad =ΣΣabs(predSamplesL0[x+offsetH[0]][2*y+offsetV[0]] - predSamplesL1[x+offsetH[1]][2*y+offsetV[1]])
ここで最初のΣはx=0..nCbW-1の和、2番目のΣはy=0..nCbH/2-1の和を表す。
centerPointSad = ΣΣabs (predSamplesL0 [x + offsetH [0]] [2 * y + offsetV [0]] --predSamplesL1 [x + offsetH [1]] [2 * y + offsetV [1]])
Here, the first Σ represents the sum of x = 0..nCbW-1 and the second Σ represents the sum of y = 0..nCbH / 2-1.

DMVR部30375は、centerSadが(bH>>1)*(bW)*64以上であるか否かを判定する。 The DMVR unit 30375 determines whether or not the centerSad is (bH >> 1) * (bW) * 64 or more.

centerSadが(bH>>1)*(bW)*64以上である場合、DMVR部30375は、
・探索点数n
・探索点の絶対差分和Sad1の要素mrSad
を参照してインデックスbestIdxを導出する。nは正の整数である。
If centerSad is (bH >> 1) * (bW) * 64 or higher, DMVR section 30375 will
・ Search points n
・ Element of absolute difference sum of search points Sad1 mrSad
To derive the index bestIdx by referring to. n is a positive integer.

上述の計算では、中心位置、左、右、上、下のmrSadをmrSadC,mrSadL,mrSadR,mrSadT,mrSadBとおく、上述の計算では、mrSadC,mrSadL,mrSadR,mrSadT,mrSadBは、各々mrSad[4],mrSad[3],mrSad[5],mrSad[1],mrSad[7]に対応する。 In the above calculation, the central position, left, right, top, and bottom mrSad are set as mrSadC, mrSadL, mrSadR, mrSadT, mrSadB. In the above calculation, mrSadC, mrSadL, mrSadR, mrSadT, mrSadB are respectively mrSad [4. ], MrSad [3], mrSad [5], mrSad [1], mrSad [7].

(n=9の場合、M=3,N=3)
以下、n=9である場合について説明する。DMVR部30375は、mrSadT < mrSadBであるか否か、および、mrSadL < mrSadRであるか否かを判定する。
(If n = 9, M = 3, N = 3)
The case where n = 9 will be described below. The DMVR unit 30375 determines whether or not mrSadT <mrSadB and whether or not mrSadL <mrSadR.

mrSadT < mrSadBかつmrSadL < mrSadRである場合、DMVR部30375は、idxの値を0に設定する。その後、DMVR部30375は、mrSadT < mrSadLであるか否か判定する。DMVR部30375は、bestIdxの値を、mrSadT < mrSadLである場合には1に設定し、mrSadT < mrSadLでない場合には3に設定する。 When mrSadT <mrsSadB and mrSadL <mrsSadR, the DMVR unit 30375 sets the idx value to 0. After that, the DMVR unit 30375 determines whether or not mrSadT <mrsSadL. The DMVR unit 30375 sets the value of bestIdx to 1 when mrSadT <mrsSadL, and 3 when mrSadT <mrsSadL is not.

そうでない場合、mrSadT >= mrSadBかつmrSadL < mrSadRである場合、DMVR部30375は、
idxの値を6に設定する。その後、DMVR部30375は、mrSadB < mrSadLであるか否か判定する。DMVR部30375は、bestIdxの値を、mrSadB < mrSadLである場合には7に設定し、mrSadB < mrSadLでない場合には3に設定する。
Otherwise, if mrSadT> = mrSadB and mrSadL <mrsadR, the DMVR unit 30375 will
Set the idx value to 6. After that, the DMVR unit 30375 determines whether or not mrSadB <mrsSadL. The DMVR unit 30375 sets the value of bestIdx to 7 when mrSadB <mrsSadL, and 3 when mrSadB <mrsSadL is not.

そうでない場合、mrSadT < mrSadBかつmrSadL >= mrSadRである場合、DMVR部30375は、idxの値を2に設定する。その後、DMVR部30375は、mrSadT < mrSadRであるか否か判定する。DMVR部30375は、bestIdxの値を、mrSadT < mrSadRである場合には1に設定し、mrSadT < mrSadRでない場合には5に設定する。 Otherwise, if mrSadT <mrSadB and mrSadL> = mrSadR, the DMVR unit 30375 sets the idx value to 2. After that, the DMVR unit 30375 determines whether or not mrSadT <mrsSadR. The DMVR unit 30375 sets the value of bestIdx to 1 when mrSadT <mrsSadR, and 5 when mrSadT <mrSadR is not.

そうでない場合、mrSadT >= mrSadBかつmrSadL >= mrSadRである場合、DMVR部30375は、idxの値を8に設定する。その後、DMVR部30375は、mrSadB < mrSadRであるか否か判定する。DMVR部30375は、bestIdxの値を、mrSadB < mrSadRである場合には7に設定し、mrSadB < mrSadRでない場合には5に設定する。 Otherwise, if mrSadT> = mrSadB and mrSadL> = mrSadR, the DMVR unit 30375 sets the idx value to 8. After that, the DMVR unit 30375 determines whether or not mrSadB <mrsSadR. The DMVR unit 30375 sets the value of bestIdx to 7 when mrSadB <mrsSadR, and 5 when mrSadB <mrsSadR is not.

さらに、DMVR部30375は、mrSadC <= mrSad[bestIdx]であるか否かを判定する。mrSadC <= mrSad[bestIdx]である場合には、DMVR部30375は、bestIdxの値を4に更新する。一方、mrSadC <= mrSad[bestIdx]でない場合には、DMVR部30375は、bestIdxの値を更新しない。 Further, the DMVR unit 30375 determines whether or not mrSadC <= mrSad [bestIdx]. If mrSadC <= mrSad [bestIdx], DMVR unit 30375 updates the value of bestIdx to 4. On the other hand, if mrSadC <= mrSad [bestIdx], the DMVR unit 30375 does not update the value of bestIdx.

さらに、DMVR部30375は、mrSad[idx] < mrSad[bestIdx]であるか否かを判定する。mrSad[idx] < mrSad[bestIdx] である場合には、DMVR部30375は、bestIdxをidxにセットする。一方、mrSad[idx] < mrSad[bestIdx] でない場合には、DMVR部30375は、bestIdxの値を更新しない。 Further, the DMVR unit 30375 determines whether or not mrSad [idx] <mrsSad [bestIdx]. When mrSad [idx] <mrSad [bestIdx], DMVR unit 30375 sets bestIdx to idx. On the other hand, if mrSad [idx] <mrSad [bestIdx] is not satisfied, the DMVR unit 30375 does not update the value of bestIdx.

DMVR部30375は、bestIdxの値が4であるか否かを判定する。bestIdxの値が4である場合、DMVR部30375は、subPelFlagをtrueに設定する。 The DMVR unit 30375 determines whether or not the value of bestIdx is 4. If the value of bestIdx is 4, DMVR unit 30375 sets subPelFlag to true.

bestIdxの値が4でない場合、DMVR部30375は、以下の式により変数dmvxおよびdmvyの値を算出する。 If the value of bestIdx is not 4, DMVR unit 30375 calculates the values of variables dmvx and dmvy by the following formula.

dmvx = (bestIdx/3 - 1)
dmvy = (bestIdx%3 - 1)
さらに、DMVR部30375は、以下の式によりoffsetHおよびoffsetVを更新する。
dmvx = (bestIdx / 3-1)
dmvy = (bestIdx% 3-1)
Further, the DMVR unit 30375 updates offsetH and offsetV by the following equations.

offsetH[0] = offsetH[0] + dmvx, offsetV[0] = offsetV[0] + dmvy
offsetH[1] = offsetH[1] - dmvx, offsetV[1] = offsetV[1] - dmvy
DMVR部30375は、更新したoffsetHおよびoffsetVを用いて、上述したSad1を導出する処理と同様の処理により、Sad2を導出する。さらに、DMVR部30375は、Sad1の代わりにSad2を用いてbestIdxを再度導出する。
offsetH [0] = offsetH [0] + dmvx, offsetV [0] = offsetV [0] + dmvy
offsetH [1] = offsetH [1] --dmvx, offsetV [1] = offsetV [1] --dmvy
The DMVR unit 30375 uses the updated offsetH and offsetV to derive Sad2 by the same process as the above-mentioned process for deriving Sad1. Further, the DMVR unit 30375 uses Sad2 instead of Sad1 to derive the bestIdx again.

DMVR部30375は、最後に導出したbestIdxの値が4であるか否かを判定する。bestIdxの値が4である場合、DMVR部30375は、subPelFlagをtrueに設定する。 The DMVR unit 30375 determines whether or not the value of the bestIdx derived last is 4. If the value of bestIdx is 4, DMVR unit 30375 sets subPelFlag to true.

bestIdxの値が4でない場合、DMVR部30375は、以下の式によりdmvxおよびdmvyを算出する。 If the value of bestIdx is not 4, DMVR unit 30375 calculates dmvx and dmvy by the following formula.

dmvx = (bestIdx/3 - 1), dmvy = (bestIdx%3 - 1)
さらに、DMVR部30375は、以下の式によりdmvL0およびdmvL1を算出する。
dmvx = (bestIdx / 3-1), dmvy = (bestIdx% 3-1)
Further, the DMVR unit 30375 calculates dmvL0 and dmvL1 by the following formula.

dmvL0[0] = 16*dmvx, dmvL0[1] = 16*dmvy
dmvL1[0] = -16*dmvx, dmvL1[1] = -16*dmvy
(M×N点DMVR処理)
上記処理では、3x3のSADを複数回に分けて繰り返してサーチを行う、いわゆるステップサーチで動きベクトルリファインメントを行っていたが、DMVR部30375は、MxN点のSADを一度だけ導出してラスタスキャンなどにより1回の処理で動きベクトルリファインメントを行ってもよい。例えばM=5,N=5の25点のSADを導出して最小のSADをもつ位置へのピクセル単位のdmvx,dmvyを導出してもよい。以下、M2=M/2、N2=N/2とする。M=5,N=5の場合、M2=N2=2である。
dmvL0 [0] = 16 * dmvx, dmvL0 [1] = 16 * dmvy
dmvL1 [0] = -16 * dmvx, dmvL1 [1] = -16 * dmvy
(M x N point DMVR processing)
In the above process, motion vector refinement was performed by so-called step search, in which 3x3 SAD is repeatedly searched by dividing it into multiple times, but DMVR unit 30375 derives SAD at MxN point only once and performs raster scan. The motion vector refinement may be performed by one process such as. For example, 25 SADs with M = 5 and N = 5 may be derived to derive pixel-based dmvx and dmvy to the position with the smallest SAD. Hereinafter, M2 = M / 2 and N2 = N / 2. When M = 5 and N = 5, M2 = N2 = 2.

DMVR部30375は、i=0, ... ,(M*N-1)について2×25の配列bCの、各要素の値を以下の式のとおり設定する。 The DMVR unit 30375 sets the value of each element of the 2 × 25 array bC for i = 0, ..., (M * N-1) as shown in the following formula.

bC[0][0] = i % N - M2 bC[1][0] = i / N - N2
DMVR部30375は、Sad1の要素mrSad[i](i=0, ... ,(M*N-1))を既に説明した式により導出する。
bC [0] [0] = i% N --M2 bC [1] [0] = i / N --N2
The DMVR unit 30375 derives the element mrSad [i] (i = 0, ..., (M * N-1)) of Sad1 by the equation already described.

DMVR部30375は、Sad1の要素mrSad[i]のうち最小値となる点bestIdxを導出する。bestIdxから以下の式によりdmvx,dmvyを導出する。 The DMVR unit 30375 derives the bestIdx point, which is the minimum value among the elements mrSad [i] of Sad1. Dmvx and dmvy are derived from bestIdx by the following formula.

dmvx = (bestIdx/M - M2), dmvy = (bestIdx%M - N2)
さらに、DMVR部30375は、以下の式によりdmvL0およびdmvL1を算出する。
dmvx = (bestIdx / M --M2), dmvy = (bestIdx% M --N2)
Further, the DMVR unit 30375 calculates dmvL0 and dmvL1 by the following formula.

dmvL0[0] = 16*dmvx, dmvL0[1] = 16*dmvy
dmvL1[0] = -16*dmvx, dmvL1[1] = -16*dmvy
なお、ここでは2次元の偏差に対応するSADを1次元配列に格納していたが2次元配列に格納して処理してもよい。
dmvL0 [0] = 16 * dmvx, dmvL0 [1] = 16 * dmvy
dmvL1 [0] = -16 * dmvx, dmvL1 [1] = -16 * dmvy
Here, the SAD corresponding to the two-dimensional deviation is stored in the one-dimensional array, but it may be stored in the two-dimensional array for processing.

(パラメトリック動きベクトルリファインメント処理)
subPelFlagがtrueである場合、DMVR部30375は、パラメトリック動きベクトルリファインメント処理を行う。パラメトリック動きベクトルリファインメント処理は、導出された中心ベクトルのSADの値(mrSadC)の左のSADの値(mrSadL)と右のSADの値(mrSadR)、及び上のSADの値(mrSadT)と下のSADの値(mrSadB)に応じて、動きベクトルの位置をさらに修正する処理である。dmvL0およびdmvL1は以下のとおり修正される。なお、以下のmrSadはSad2が存在する場合はSad2の要素であり、Sad2が存在しない場合はSad1の要素である。
(Parametric motion vector refinement processing)
If subPelFlag is true, the DMVR unit 30375 performs parametric motion vector refinement processing. The parametric motion vector refinement process is performed on the left SAD value (mrSadL) and right SAD value (mrSadR) of the derived center vector SAD value (mrSadC), and the upper SAD value (mrSadT) and lower. This is a process to further correct the position of the motion vector according to the SAD value (mrSadB) of. dmvL0 and dmvL1 are modified as follows. The following mrSad is an element of Sad2 when Sad2 exists, and an element of Sad1 when Sad2 does not exist.

図23は、本実施形態に係るSADの配置と、パラメトリック動きベクトルリファインメントの動作を説明する図である。図23(a)に示すように、動きベクトル(L0参照画像のブロックとL1参照画像のブロック)を整数単位でずらした位置に対応するSADをmrSad[x]、x=0..8で導出する。ここでは中心のSADがmrSadCであり左右にmrSadの[3]と[5]、上下に[1]と[7]が対応する。 FIG. 23 is a diagram illustrating the arrangement of the SAD and the operation of the parametric motion vector refinement according to the present embodiment. As shown in Fig. 23 (a), the SAD corresponding to the position where the motion vector (the block of the L0 reference image and the block of the L1 reference image) is shifted by an integer unit is derived by mrSad [x] and x = 0.8. To do. Here, the central SAD is mrSadC, and mrSad [3] and [5] correspond to the left and right, and [1] and [7] correspond to the top and bottom.

図23(b)は、中心からみて水平方向に3点のSADの値を並べた図である。3点をとおる近似曲線を記す。図に示すように、整数画素単位でずらした位置のSADだけをサーチした場合においても、近似曲線の極小点に対応する位置を用いる(サブペル精度で動きベクトルをシフトさせる)ことで、小数画素精度の動きベクトルのリファインメントができる。近似曲線としては、3点を通る2次関数を用いてもよいし、別の例に示すように近似曲線をもちいず、中心の左右のSADのうちSADの小さい方向にシフトしたり、シフト演算によりシフト量を調整しても良い。また、左右のSADの差が大きい場合により移動量を大きくすることが好適である。なお、図23(c)は、中心からみて垂直方向に3点のSADの値を並べた図である。パラメトリック動きベクトルリファインメントの処理は水平方向と同一である。以下、動きベクトルのシフト量(サブペル補正値)をdX,dYで表す。 FIG. 23 (b) is a diagram in which the SAD values of three points are arranged in the horizontal direction when viewed from the center. Draw an approximate curve through the three points. As shown in the figure, even when searching only the SADs at positions shifted in integer pixel units, the decimal pixel accuracy is achieved by using the position corresponding to the minimum point of the approximate curve (shifting the motion vector with subpel accuracy). You can refine the motion vector of. As the approximate curve, a quadratic function that passes through three points may be used, or as shown in another example, the approximate curve may be used, and the SAD on the left and right of the center may be shifted in the direction of the smaller SAD, or a shift operation may be performed. The shift amount may be adjusted accordingly. In addition, it is preferable to increase the amount of movement when the difference between the left and right SADs is large. Note that FIG. 23 (c) is a diagram in which the SAD values of three points are arranged in the vertical direction when viewed from the center. The processing of parametric motion vector refinement is the same as in the horizontal direction. Hereinafter, the shift amount (subpel correction value) of the motion vector is represented by dX and dY.

まず、DMVR部30375は、mrSadT + mrSadB == mrSadCであるか否かを判定する。mrSadT +
mrSadB == mrSadCである場合、DMVR部30375は、dY=0とする。mrSadT + mrSadB == mrSadCでない場合、DMVR部30375は、dYを以下の式により算出する。
First, the DMVR unit 30375 determines whether or not mrSadT + mrSadB == mrSadC. mrSadT +
When mrSadB == mrSadC, DMVR unit 30375 sets dY = 0. If mrSadT + mrSadB == mrSadC, DMVR unit 30375 calculates dY by the following formula.

dY = ((mrSadT - mrSadB)<<3)/(mrSadT + mrSadB - (mrSadC<<1))
また、上記の処理において、分母に所定の値biasを加えることによって、dYを近似曲線の極小値の位置よりも0に近い値になるように導出してもよい。つまり、上のSADと下のSADの差の定数倍を分子A1、上のSADと下のSADの和から中心のSADの2倍に所定の定数を加算した値を分母A2とする値からdYを導出する。このとき、除算を行わずに、分子の倍数(1/4,1/2,1,2,4などを含む)と分母の定数倍の比較を行ってA1/A2に相当する比率を導出しdYを導出してもよい。
dY = ((mrSadT --mrsSadB) << 3) / (mrSadT + mrSadB-(mrSadC << 1))
Further, in the above processing, dY may be derived so as to be closer to 0 than the position of the minimum value of the approximate curve by adding a predetermined value bias to the denominator. That is, dY from the value where the constant multiple of the difference between the upper SAD and the lower SAD is the numerator A1, and the value obtained by adding a predetermined constant to twice the central SAD from the sum of the upper SAD and the lower SAD is the denominator A2. Is derived. At this time, the ratio corresponding to A1 / A2 is derived by comparing the multiples of the molecule (including 1/4, 1/2, 1,2,4, etc.) and the constant multiple of the denominator without dividing. You may derive dY.

dY = ((mrSadT - mrSadB)<<3)/(mrSadT + mrSadB - (mrSadC<<1) + bias)
ここでbiasは所定の値である。biasはブロックの大きさによらない定数Cでもよいし、例えばブロックのサイズに応じて変化する値(bias=C*bW*bH、Cは定数)でもよい。上記所定の値を分母に加えることによって、必要以上に変化することがなくなるため符号化効率が向上する効果を奏する。
dY = ((mrSadT --mrsSadB) << 3) / (mrSadT + mrSadB-(mrSadC << 1) + bias)
Here, bias is a predetermined value. The bias may be a constant C that does not depend on the size of the block, or may be, for example, a value that changes according to the size of the block (bias = C * bW * bH, C is a constant). By adding the above-mentioned predetermined value to the denominator, it does not change more than necessary, so that the coding efficiency is improved.

この処理では、上のSAD(mrSadT)と下のSAD(mrSadB)を比較して、上のSADが小さい場合に、動きベクトルを1画素以下の負の値だけ動かす(dYに0以下-8以上の値を設定する)。下のSADが小さい場合には、動きベクトルを1画素以下の正の値だけ動かす(dYに0以上8以下の値を設定する)。dYの大きさは動きベクトルの精度が1/16の場合の値である。 In this process, the upper SAD (mrSadT) and the lower SAD (mrSadB) are compared, and when the upper SAD is small, the motion vector is moved by a negative value of 1 pixel or less (0 or less to dY-8 or more). Set the value of). If the lower SAD is small, move the motion vector by a positive value of 1 pixel or less (set dY to a value of 0 or more and 8 or less). The magnitude of dY is the value when the accuracy of the motion vector is 1/16.

次に、DMVR部30375は、mrSadL + mrSadR == mrSadCであるか否かを判定する。mrSadL +
mrSadR == mrSadCである場合、DMVR部30375は、dX=0とする。mrSadL + mrSadR == mrSadCでない場合、DMVR部30375は、dXを以下の式により算出する。
Next, the DMVR unit 30375 determines whether or not mrSadL + mrSadR == mrSadC. mrSadL +
When mrSadR == mrSadC, DMVR unit 30375 sets dX = 0. If mrSadL + mrSadR == mrSadC, DMVR unit 30375 calculates dX by the following formula.

dX = ((mrSadL - mrSadR)<<3)/(mrSadL + mrSadR - (mrSadC<<1))
また、dXの導出においても、分母に所定の値biasを加えることによって、dYを近似曲線の極小値の位置よりも0に近い値になるように導出してもよい。効果はdYの場合と同じである。つまり、左のSADと右のSADの差の定数倍を分子A1、左のSADと下のSADの和から中心のSADの2倍に所定の定数を加算した値を分母A2とする値からdXを導出する。ここでもA1とA2の比率を比較によって導出してもよい。
dX = ((mrSadL --mrSadR) << 3) / (mrSadL + mrSadR-(mrSadC << 1))
Further, in the derivation of dX, dY may be derived so that the value is closer to 0 than the position of the minimum value of the approximate curve by adding a predetermined value bias to the denominator. The effect is the same as for dY. In other words, dX from the value where the constant multiple of the difference between the left SAD and the right SAD is the numerator A1, and the value obtained by adding a predetermined constant to twice the center SAD from the sum of the left SAD and the lower SAD is the denominator A2. Is derived. Again, the ratio of A1 and A2 may be derived by comparison.

dX = ((mrSadL - mrSadR)<<3)/(mrSadL + mrSadR - (mrSadC<<1)+bias)
この処理では、左のSAD(mrSadL)と右のSAD(mrSadR)を比較して、左のSADが小さい場合に、動きベクトルを1画素以下の負の値だけ動かす(dYに0以下-8以上の値を設定する)。右のSADが小さい場合には、動きベクトルを1画素以下の正の値だけ動かす(dYに0以上8以下の値を設定する)。dYの大きさは動きベクトルの精度が1/16の場合の値である。
dX = ((mrSadL --mrsSadR) << 3) / (mrSadL + mrSadR-(mrSadC << 1) + bias)
In this process, the left SAD (mrSadL) and the right SAD (mrSadR) are compared, and when the left SAD is small, the motion vector is moved by a negative value of 1 pixel or less (dY is 0 or less-8 or more). Set the value of). If the SAD on the right is small, move the motion vector by a positive value of 1 pixel or less (set dY to a value of 0 or more and 8 or less). The magnitude of dY is the value when the accuracy of the motion vector is 1/16.

さらに、DMVR部30375は、動きベクトルmvL0およびmvL1を、以下の式により修正する。 Further, the DMVR unit 30375 modifies the motion vectors mvL0 and mvL1 by the following equations.

dmvL0[0] = dmvL0[0] + dX
dmvL0[1] = dmvL0[1] + dY
dmvL1[0] = dmvL1[0] - dX
dmvL1[1] = dmvL1[1] - dY
DMVR部30375は、dmvrFlagが1の場合、マージ予測部30374から入力された動きベクトルmvLXに導出した差分ベクトルdmvLXを加算して補間用動きベクトルrefMvLXを導出する。
補間用動きベクトルrefMvLXは、動き補償部3091(補間部)で利用される。DMVR部30375は
、mvLXを予測画像生成部308および予測パラメータメモリ307に出力する。
dmvL0 [0] = dmvL0 [0] + dX
dmvL0 [1] = dmvL0 [1] + dY
dmvL1 [0] = dmvL1 [0] --dX
dmvL1 [1] = dmvL1 [1] --dY
When the dmvrFlag is 1, the DMVR unit 30375 adds the difference vector dmvLX derived from the motion vector mvLX input from the merge prediction unit 30374 to derive the motion vector refMvLX for interpolation.
The motion vector refMvLX for interpolation is used by the motion compensation unit 3091 (interference unit). The DMVR unit 30375 outputs mvLX to the prediction image generation unit 308 and the prediction parameter memory 307.

refMvLX[0] = mvLX[0]+dmvLX[0]
refMvLX[1] = mvLX[1]+dmvLX[1]
DMVR部30375は、dmvrFlag=0の場合、マージ予測部30374から入力された動きベクトルmvLXをrefMvLxに設定し、動き補償部3091(補間部)に出力する。
refMvLX [0] = mvLX [0] + dmvLX [0]
refMvLX [1] = mvLX [1] + dmvLX [1]
When dmvrFlag = 0, the DMVR unit 30375 sets the motion vector mvLX input from the merge prediction unit 30374 to refMvLx and outputs it to the motion compensation unit 3091 (interference unit).

refMvLX[0] = mvLX[0]
refMvLX[1] = mvLX[1]
なお、dYおよびdXの値は、mrSadのビット数に関わらず所定の範囲(例えば-7から7、-8から8ま)に制限してもよい。
refMvLX [0] = mvLX [0]
refMvLX [1] = mvLX [1]
The values of dY and dX may be limited to a predetermined range (for example, -7 to 7, -8 to 8) regardless of the number of bits of mrSad.

以下の説明では、中心mrSadCと前後のSADからなる3つのSAD値を用いて、サブペル補正値を導出する処理をparametricFuncと記す。なおparametricFunc関数としては上述の説明の他、以下で説明する別の例を用いてもよい。 In the following description, the process of deriving the subpel correction value using three SAD values consisting of the central mrSadC and the SADs before and after is described as parametricFunc. As the parametricFunc function, in addition to the above description, another example described below may be used.

dX = parametricFunc(mrSadL, mrSadC, mrSadR)
dY = parametricFunc(mrSadT, mrSadC, mrSadB)
例えば、上記の例では、
parametricFunc(x, y, z) = ((x - z)<<3)/(x + z - (y<<1))
また、以下でもよい。
dX = parametricFunc (mrSadL, mrSadC, mrSadR)
dY = parametricFunc (mrSadT, mrSadC, mrSadB)
For example, in the above example
parametricFunc (x, y, z) = ((x --z) << 3) / (x + z-(y << 1))
It may also be as follows.

parametricFunc(x, y, z) = ((x - z)<<3)/(x + z - (y<<1) + bias)
(パラメトリック動きベクトルリファインメント処理の別の例)
DMVR部30375は、動きベクトルmvLX[]に加算するサブペル補正値dX,dYを別の処理によって導出してもよい。例えば、対象ブロックの左右のSAD(ここでは左のSAD(mrSadL)と右のSAD(mrSadR))の差分値が所定の閾値を超える場合に、dXを所定の値DMVsubrefに設定しても良い。dXの符号は、左右のSADの差分値の符号sign(mrSadL- mrSadR)に応じて設定する。
parametricFunc (x, y, z) = ((x --z) << 3) / (x + z-(y << 1) + bias)
(Another example of parametric motion vector refinement processing)
The DMVR unit 30375 may derive the subpel correction values dX and dY to be added to the motion vector mvLX [] by another process. For example, when the difference value between the left and right SADs of the target block (here, the left SAD (mrSadL) and the right SAD (mrSadR)) exceeds a predetermined threshold value, dX may be set to a predetermined value DMV subref. The sign of dX is set according to the sign sign (mrSadL-mrsSadR) of the difference value of the left and right SADs.

dSAD = mrSadL - mrSadR
dX = abs(dSAD) > TH ? sign(dSAD) * DMVsubref : 0
これは以下の処理と等価である。
dSAD = mrSadL --mrsSadR
dX = abs (dSAD)> TH? Sign (dSAD) * DMVsubref: 0
This is equivalent to the following processing.

if (abs(dSAD))
dX = dSAD > 0 ? DMVsubref : - DMVsubref
else
dX = 0
例えば、TH = dx * dy << 5、DMVsubref = 1でもよい。
if (abs (dSAD))
dX = dSAD> 0? DMVsubref: --DMVsubref
else else
dX = 0
For example, TH = dx * dy << 5, DMVsubref = 1.

dYも同様に、対象ブロックの上下のSAD(ここでは上のSAD(mrSadT)と下のSAD(mrSadB))の差分値が所定の閾値を超える場合に、dYを所定の値DMVsubrefに設定しても良い。dYの符号は、上下のSADの差分値の符号sign(mrSadT- mrSadB)に応じて設定する。 Similarly, for dY, when the difference value between the upper and lower SADs of the target block (here, the upper SAD (mrSadT) and the lower SAD (mrSadB)) exceeds a predetermined threshold value, dY is set to a predetermined value DMV subref. Is also good. The sign of dY is set according to the sign sign (mrSadT-mrsadB) of the difference value of the upper and lower SADs.

dSAD = mrSadT - mrSadB
dY = abs(dSAD) > TH ? sign(dSAD) * DMVsubref : 0
以下でもよい。
dSAD = mrSadT --mrbSadB
dY = abs (dSAD)> TH? Sign (dSAD) * DMVsubref: 0
It may be as follows.

if (abs(dSAD) > TH)
dY = dSAD > 0 ? DMVsubref : - DMVsubref
else
dY = 0
除算を用いたサブペル補正値dX,dYの導出では、整数演算を用いる場合にも例えば以下のような複数回の比較が必要であり、導出に必要な複雑度(オペレーションサイクル数)が大きい。それに対して、上記の構成では、より少ない回数の比較によりサブペル補正値dX,dYの導出を導出することができるので演算量を削減する効果を奏する。
if (abs (dSAD)> TH)
dY = dSAD> 0? DMVsubref: --DMVsubref
else else
dY = 0
In deriving the subpel correction values dX and dY using division, for example, the following multiple comparisons are required even when using integer arithmetic, and the complexity (number of operation cycles) required for deriving is large. On the other hand, in the above configuration, the derivation of the subpel correction values dX and dY can be derived by comparing a smaller number of times, which has the effect of reducing the amount of calculation.

(パラメトリック動きベクトルリファインメント処理の別の例2)
DMVR部30375は、動きベクトルmvLX[]に加算するサブペル補正値dX,dYを別の処理によって導出してもよい。
(Another example 2 of parametric motion vector refinement processing)
The DMVR unit 30375 may derive the subpel correction values dX and dY to be added to the motion vector mvLX [] by another process.

例えば、左と中心のSAD差分値(ここではmrSadL-mrSadC)と、右と中心のSAD差分値(ここではmrSadR-mrSadC)の比が閾値を超えたら、dXを所定の値DMVsubrefに設定しても良い。dXの符号は左右のSADの差分値の符号sign(SAD[3]-SAD[5])に応じて設定する。 For example, if the ratio of the left and center SAD difference value (here mrSadL-mrSadC) and the right and center SAD difference value (here mrSadR-mrSadC) exceeds the threshold value, set dX to the predetermined value DMV subref. Is also good. The sign of dX is set according to the sign sign (SAD [3] -SAD [5]) of the difference value of the left and right SAD.

同様にdYも、上と中心のSAD差分値(ここではmrSadT-mrSadC)と、下と中心のSAD差分値(ここではmrSadB-mrSadC)の比が閾値を超えたら、dYを所定の値DMVsubrefに設定しても良い。dYの符号は、上下のSADの差分値の符号sign(SAD[1]-SAD[7])に応じて設定する。上記の構成では、より少ない回数の比較によりサブペル補正値dX, dYの導出を導出することができるので演算量を削減する効果を奏する。 Similarly, for dY, if the ratio of the upper and center SAD difference values (here mrSadT-mrSadC) and the lower and center SAD difference values (here mrSadB-mrSadC) exceeds the threshold value, dY is set to the predetermined value DMV subref. You may set it. The sign of dY is set according to the sign sign (SAD [1] -SAD [7]) of the difference value of the upper and lower SADs. In the above configuration, the derivation of the subpel correction values dX and dY can be derived by comparing a smaller number of times, which has the effect of reducing the amount of calculation.

(パラメトリック動きベクトルリファインメント処理の別の例3)
DMVR部30375は、動きベクトルmvLX[]に加算するサブペル補正値dX,dYを別の処理によって導出してもよい。
(Another example 3 of parametric motion vector refinement processing)
The DMVR unit 30375 may derive the subpel correction values dX and dY to be added to the motion vector mvLX [] by another process.

例えば、対象ブロックの左右のSADの絶対値差分値(abs(mrSadL-mrSadR))がmin(mrSadL,mrSadR)と中心のSAD(mrSadC)との差分よりも大きければ、dXを所定の値DMVsubrefに設定しても良い。dXの符号は、左右のSADの差分値の符号sign(mrSadL-mrSadR)に応じて設定する。 For example, if the absolute difference value (abs (mrSadL-mrSadR)) of the left and right SADs of the target block is larger than the difference between min (mrSadL, mrSadR) and the central SAD (mrSadC), dX is set to the predetermined value DMV subref. You may set it. The sign of dX is set according to the sign sign (mrSadL-mrSadR) of the difference value of the left and right SADs.

dSAD = mrSadL - mrSadR
TH = min(mrSadL,mrSadR) - mrSadC
dX = abs(dSAD) > TH ? sign(dSAD) * DMVsubref : 0
これは以下の処理と等価である。
dSAD = mrSadL --mrsSadR
TH = min (mrSadL, mrSadR) --mrsSadC
dX = abs (dSAD)> TH? Sign (dSAD) * DMVsubref: 0
This is equivalent to the following processing.

TH = min(mrSadL,mrSadR) - mrSadC
if (abs(dSAD) > TH)
dX = dSAD > 0 ? DMVsubref : - DMVsubref
else
dX = 0
例えば、TH = (min(SadL, SadR) - SadC) * 1、DMVsubref = 2でもよい。
TH = min (mrSadL, mrSadR) --mrsSadC
if (abs (dSAD)> TH)
dX = dSAD> 0? DMVsubref: --DMVsubref
else else
dX = 0
For example, TH = (min (SadL, SadR) --SadC) * 1 and DMVsubref = 2.

dYも同様に、対象ブロックの上下のSAD(ここでは上のSAD(mrSadT)と下のSAD(mrSadB))の差分値が所定の閾値を超える場合に、dYを所定の値DMVsubrefに設定しても良い。dYの符号は、上下のSADの差分値の符号sign(mrSadT- mrSadR)に応じて設定する。 Similarly, for dY, when the difference value between the upper and lower SADs of the target block (here, the upper SAD (mrSadT) and the lower SAD (mrSadB)) exceeds a predetermined threshold value, dY is set to a predetermined value DMV subref. Is also good. The sign of dY is set according to the sign sign (mrSadT-mrsSadR) of the difference value of the upper and lower SADs.

dSAD = mrSadT - mrSadB
TH = min(mrSadT,mrSadB) - mrSadC
dY = abs(dSAD) > TH ? sign(dSAD) * DMVsubref : 0
以下でもよい。
dSAD = mrSadT --mrbSadB
TH = min (mrSadT, mrSadB) --mrsSadC
dY = abs (dSAD)> TH? Sign (dSAD) * DMVsubref: 0
It may be as follows.

TH = min(mrSadT,mrSadB) - mrSadC
if (abs(dSAD) > TH)
dY = dSAD > 0 ? DMVsubref : - DMVsubref
else
dY = 0
上記の構成では、より少ない回数の比較によりサブペル補正値dX,dYの導出を導出することができるので演算量を削減する効果を奏する。
TH = min (mrSadT, mrSadB) --mrsSadC
if (abs (dSAD)> TH)
dY = dSAD> 0? DMVsubref: --DMVsubref
else else
dY = 0
In the above configuration, the derivation of the subpel correction values dX and dY can be derived by comparing a smaller number of times, which has the effect of reducing the amount of calculation.

(パラメトリック動きベクトルリファインメント処理の別の例4)
DMVR部30375は、動きベクトルmvLX[]に加算するサブペル補正値dX,dYを別の処理によって導出してもよい。
(Another example 4 of parametric motion vector refinement processing)
The DMVR unit 30375 may derive the subpel correction values dX and dY to be added to the motion vector mvLX [] by another process.

例えば、左右のSADの差(mrSadL-mrSadR)であるdA1と、左右のSADの和と中心のSADの2倍の差dA2=((mrSadL + mrSadR - (mrSadC<<1)))を導出し、dA1をdA2の2の対数値で右シフトすることによって、dXを導出する。 For example, dA1 which is the difference between the left and right SADs (mrSadL-mrSadR) and dA2 = ((mrSadL + mrSadR-(mrSadC << 1))), which is the sum of the left and right SADs and twice the difference between the center SADs, are derived. , DX is derived by right-shifting dA1 by the logarithm of 2 of dA2.

dA1 = ((mrSadL - mrSadR)<<3)
dA2 = (mrSadL + mrSadR - (mrSadC<<1))
dX = dA1 >> IntegerLog2(dA2+bias)
ここでbiasは所定の定数である。biasはブロックの大きさによらない定数でもよいし、例えばブロックのサイズに応じて変化する値でもよい。IntergerLog2は整数として導出される2の対数であり、例えば以下の式で導出してもよい。
dA1 = ((mrSadL --mrsSadR) << 3)
dA2 = (mrSadL + mrSadR-(mrSadC << 1))
dX = dA1 >> IntegerLog2 (dA2 + bias)
Here, bias is a predetermined constant. The bias may be a constant that does not depend on the size of the block, or may be a value that changes according to the size of the block, for example. IntergerLog2 is a logarithm of 2 derived as an integer, and may be derived by, for example, the following equation.

IntegerLog2(x) = floor(log2(x))
また、以下の式で導出してもよい。
IntegerLog2 (x) = floor (log2 (x))
Further, it may be derived by the following formula.

IntegerLog2(x) = ceil(log2(x))
なお、dA1が正と負の場合で、場合分けをして処理しても良い。
IntegerLog2 (x) = ceil (log2 (x))
In addition, when dA1 is positive and negative, it may be processed in different cases.

dX = dA1 > 0 ? abs(dA1)>> IntegerLog2(dA2+bias) : -(abs(dA1)>> IntegerLog2(dA2+bias))
dYも同様に、例えば、上下のSADの差(mrSadT-mrSadB)であるdB1と、左右のSADの和と中心のSADの2倍の差dA2((mrSadT + mrSadB - (mrSadC<<1)))を導出し、dB1をdB2の2の対数値で右シフトすることによって、dYを導出する。
dX = dA1> 0? abs (dA1) >> IntegerLog2 (dA2 + bias):-(abs (dA1) >> IntegerLog2 (dA2 + bias))
Similarly for dY, for example, dB1 which is the difference between the upper and lower SADs (mrSadT-mrSadB) and dA2 which is the sum of the left and right SADs and twice the difference between the central SADs dA2 ((mrSadT + mrSadB-(mrSadC << 1))) ) Is derived, and dY is derived by shifting dB1 to the right by the logarithm of 2 of dB2.

dB1 = ((mrSadL - mrSadR)<<3)
dB2 = (mrSadL + mrSadR - (mrSadC<<1))
dY = dB1 >> IntegerLog2(dB2+bias)
なお、dB1が正と負の場合で、場合分けをして処理しても良い。
dB1 = ((mrSadL --mrsSadR) << 3)
dB2 = (mrSadL + mrSadR-(mrSadC << 1))
dY = dB1 >> IntegerLog2 (dB2 + bias)
In addition, when dB1 is positive and negative, it may be processed by dividing into cases.

dY = dB1 > 0 ? dB1>> IntegerLog2(dB2+bias) : -((-dB1)>> IntegerLog2(dB2+bias))
上記の構成では、高速なシフト演算によりサブペル補正値dX,dYの導出を導出することができるので演算量を削減する効果を奏する。
dY = dB1> 0? dB1 >> IntegerLog2 (dB2 + bias):-((-dB1) >> IntegerLog2 (dB2 + bias))
In the above configuration, the derivation of the subpel correction values dX and dY can be derived by high-speed shift calculation, which has the effect of reducing the amount of calculation.

(MxN点パラメトリック動きベクトルリファインメント処理)
図24は、本実施形態に係るMxN点SADの配置と、パラメトリック動きベクトルリファインメントの動作を説明する図である。図25は、利用するSADとパラメトリック動きベクトルリファインメントの動作を説明する図である。図26は、パラメトリック動きベクトル
リファインメントの動作を説明するフローチャートである。
図24(a)に示すように、動きベクトル(L0参照画像のブロックとL1参照画像のブロック)を整数単位でずらした位置に対応するSADをMxN(水平方向M、垂直方向N)のmrSad[x]、x=0..(M*N-1)で導出する。ここではM=5,N=5の例であり、中心のSADがmrSad[M*N/2]である。ここでの/は小数点数切り捨ての整数除算であり、M*N/2=12。DMVR部30375は、動きベクトルmvLX[]に加算するサブペル補正値dX,dY(サブペル補正値)を、MxN個のmrSadの最小値の位置(整数探索後の中心ベクトルの位置cx,cy)に応じて導出する。以下、M2=M/2、N2=N/2である。M=5,N=5の場合、M2=N2=2。
(MxN point parametric motion vector refinement processing)
FIG. 24 is a diagram illustrating the arrangement of the MxN point SAD and the operation of the parametric motion vector refinement according to the present embodiment. FIG. 25 is a diagram illustrating the operation of the SAD and the parametric motion vector refinement to be used. FIG. 26 is a flowchart illustrating the operation of the parametric motion vector refinement.
As shown in FIG. 24 (a), the SAD corresponding to the position where the motion vector (the block of the L0 reference image and the block of the L1 reference image) is shifted by an integer unit is mrSad of MxN (horizontal direction M, vertical direction N) [ Derived with x] and x = 0.. (M * N-1). Here is an example of M = 5, N = 5, and the central SAD is mrSad [M * N / 2]. Here, / is an integer division with the decimal point truncated, and M * N / 2 = 12. The DMVR unit 30375 sets the sub-pel correction values dX and dY (sub-pel correction values) to be added to the motion vector mvLX [] according to the position of the minimum value of MxN mrSad (position of the center vector after integer search). To derive. Hereinafter, M2 = M / 2 and N2 = N / 2. If M = 5 and N = 5, M2 = N2 = 2.

より具体的には、図24(b)に示すように、横パターンで示す位置に探索結果の中心ベクトル位置がある場合(cy==0もしくはcy==N-1の場合、dmvx==-M2もしくはdmvx==M2の場合、S401でYES)には、図25(a)に示すように左右のmrSadを参照して、サブペル補正値dXを導出し、dY=0とする(S402)。ここではmrSad[c-1]、mrSad[c]、mrSad[c+1]のSADを参照する。ここでc=bestIdx=cx*M+cy。3点のSADからdXを導出する方法は既に説明した各種の方法を用いることができる。例えば、以下の式で導出しても良い。 More specifically, as shown in FIG. 24 (b), when the center vector position of the search result is located at the position indicated by the horizontal pattern (when cy == 0 or cy == N-1, dmvx ==- In the case of M2 or dmvx == M2, YES in S401), the subpel correction value dX is derived by referring to the left and right mrSad as shown in Fig. 25 (a), and dY = 0 is set (S402). Here, we refer to the SAD of mrSad [c-1], mrSad [c], and mrSad [c + 1]. Where c = bestIdx = cx * M + cy. As the method for deriving dX from the three points of SAD, various methods already described can be used. For example, it may be derived by the following equation.

dX = ((mrSadL - mrSadR)<<3)/(mrSadL + mrSadR - (mrSadC<<1))
ここでは、mrSadL = mrSad[c-1]、mrSadC = mrSad[c]、mrSadR = mrSad[c+1]を代入して導出する。さらに、mrSadT= mrSadB= mrSad[c]のように上下のSADに中心のSAD(mrSad[c])を代入して、dXに加えdYを導出してもよい。この場合、dY=0が導出される。
dX = ((mrSadL --mrSadR) << 3) / (mrSadL + mrSadR-(mrSadC << 1))
Here, mrSadL = mrSad [c-1], mrSadC = mrSad [c], mrSadR = mrSad [c + 1] is substituted and derived. Further, the central SAD (mrSad [c]) may be substituted for the upper and lower SADs such as mrSadT = mrSadB = mrSad [c] to derive dY in addition to dX. In this case, dY = 0 is derived.

縦パターンで示す位置に探索結果の中心ベクトル位置がある場合(cx==0もしくはcx==M-1の場合、dmvy==-N2もしくはdmvy==N2の場合、S403でYES)には、図25(b)に示すように上下のmrSadを参照して、サブペル補正値dYを導出しdX=0とする(S404)。ここではmrSad[c-M2]、mrSad[c]、mrSad[c+M2]のSADを参照する。例えば、以下の式で導出しても良い。 If the center vector position of the search result is located at the position indicated by the vertical pattern (YES in S403 for cx == 0 or cx == M-1, dmvy ==-N2 or dmvy == N2) As shown in Fig. 25 (b), the subpel correction value dY is derived with reference to the upper and lower mrSad, and dX = 0 is set (S404). Here, the SADs of mrSad [c-M2], mrSad [c], and mrSad [c + M2] are referred to. For example, it may be derived by the following equation.

dY = ((mrSadT - mrSadB)<<3)/(mrSadT + mrSadB - (mrSadC<<1))
ここでは、mrSadT = mrSad[c-M]、mrSadC = mrSad[c]、mrSadB = mrSad[c+M]を代入して導出する。さらに、mrSadL= mrSadR= mrSad[c]のように左右のSADに中心のSAD(mrSad[c])を代入して、dYに加えdXを導出してもよい。この場合dY=0が導出される。
dY = ((mrSadT --mrsSadB) << 3) / (mrSadT + mrSadB-(mrSadC << 1))
Here, mrSadT = mrSad [cM], mrSadC = mrSad [c], mrSadB = mrSad [c + M] is substituted and derived. Further, the central SAD (mrSad [c]) may be substituted for the left and right SADs such as mrSadL = mrSadR = mrSad [c] to derive dX in addition to dY. In this case, dY = 0 is derived.

格子パターンで示す位置に探索結果の中心ベクトル位置がある場合(cx==1..M-2、かつ、cy=0..N-2の場合、dmvx==-M2+1..M2-1、かつ、dmvy==-N2+1..N2-1の場合の場合、S405でYES)では、図25(c)に示すように上下左右のmrSadを参照して、サブペル補正値dX,dYを導出する(S406)。ここではmrSad[c-M]、mrSad[c-1],mrSad[c]、mrSad[c+1],mrSad[c+M]のSADを参照する。 If the center vector position of the search result is at the position indicated by the grid pattern (cx == 1..M-2 and cy = 0..N-2, dmvx ==-M2 + 1..M2- 1 and in the case of dmvy ==-N2 + 1..N2-1, YES in S405), refer to mrSad up, down, left and right as shown in Fig. 25 (c), and subpel correction value dX, Derivation of dY (S406). Here, we refer to the SADs of mrSad [c-M], mrSad [c-1], mrSad [c], mrSad [c + 1], and mrSad [c + M].

以下の式で導出しても良い。 It may be derived by the following formula.

dX = ((mrSadL - mrSadR)<<3)/(mrSadL + mrSadR - (mrSadC<<1))
dY = ((mrSadT - mrSadB)<<3)/(mrSadT + mrSadB - (mrSadC<<1))
ここでは、mrSadT = mrSad[c-M]、mrSadL = mrSad[c-1]、mrSadC = mrSad[c]、mrSadR = mrSad[c+1]、mrSadB = mrSad[c+M]を代入して導出する。
dX = ((mrSadL --mrSadR) << 3) / (mrSadL + mrSadR-(mrSadC << 1))
dY = ((mrSadT --mrsSadB) << 3) / (mrSadT + mrSadB-(mrSadC << 1))
Here, mrSadT = mrSad [cM], mrSadL = mrSad [c-1], mrSadC = mrSad [c], mrSadR = mrSad [c + 1], mrSadB = mrSad [c + M] are substituted and derived.

なお、サブペル補正値の導出方法は上記に限定されず、SADの比較によって導出してもよいし、SADから得られる値の2の対数によるシフト演算により導出してもよい。 The method for deriving the subpel correction value is not limited to the above, and may be derived by comparing SADs or by a shift operation using a logarithm of 2 of the values obtained from the SADs.

上記処理は図26(a)のフローチャートに示すように以下のように処理できる。 The above processing can be performed as follows as shown in the flowchart of FIG. 26 (a).

S401 DMVR部30375は、最小値bestIdxとなる点が、SADを導出したM×Nのブロックに
おいて、コーナー以外で上辺もしくは下辺の場合(横線パターンの場合)、S402に移行し、それ以外の場合S403に移行する。
In the S401 DMVR section 30375, if the point where the minimum value is the bestIdx is the upper side or the lower side (in the case of the horizontal line pattern) other than the corner in the M × N block from which the SAD is derived, it shifts to S402, otherwise it shifts to S403. Move to.

S402 DMVR部30375は、左右のmrSadを参照して、サブペル補正値dX,dYを導出する。なお図では簡単のためbestIdxを省略している。
dX = parametricFunc(mrSad[bextIdx-1], mrSad[bextIdx], mrSad[bextIdx+1])
dY = 0
S403 DMVR部30375は、最小値bestIdxとなる点が、SADを導出したM×Nのブロックにおいて、コーナー以外で左辺もしくは右辺の場合(縦線パターンの場合)、S404に移行し、それ以外の場合S405に移行する。
The S402 DMVR unit 30375 derives the subpel correction values dX and dY with reference to the left and right mrSad. In the figure, bestIdx is omitted for simplicity.
dX = parametricFunc (mrSad [bextIdx-1], mrSad [bextIdx], mrSad [bextIdx + 1])
dY = 0
In the S403 DMVR section 30375, if the point where the minimum value is the bestIdx is the left side or the right side (in the case of the vertical line pattern) other than the corner in the M × N block from which the SAD is derived, it shifts to S404, and in other cases. Migrate to S405.

S404 DMVR部30375は、上下のmrSadを参照して、サブペル補正値dX,dYを導出する。なお図では簡単のためbestIdxを省略している。
dX = 0
dY = parametricFunc(mrSad[bextIdx-M],mrSad[bextIdx], mrSad[bextIdx+M])
S405 DMVR部30375は、最小値bestIdxとなる点が、SADを導出したM×Nのブロックにおいて、コーナー以外で中心の場合(格子パターンの場合)、S406に移行する。
The S404 DMVR unit 30375 derives the subpel correction values dX and dY with reference to the upper and lower mrSad. In the figure, bestIdx is omitted for simplicity.
dX = 0
dY = parametricFunc (mrSad [bextIdx-M], mrSad [bextIdx], mrSad [bextIdx + M])
The S405 DMVR unit 30375 shifts to S406 when the point at which the minimum value is the bestIdx is the center other than the corner in the M × N block from which the SAD is derived (in the case of the grid pattern).

S406 DMVR部30375は、左右のmrSadを参照して、サブペル補正値dX,dYを導出する。なお図では簡単のためbestIdxを省略している。
dX = parametricFunc(mrSad[bextIdx-1], mrSad[bextIdx], mrSad[bextIdx+1])
dY = parametricFunc(mrSad[bextIdx-M], mrSad[bextIdx], mrSad[bextIdx+M])
なお分岐の順序は上記に限定されない。
The S406 DMVR unit 30375 derives the subpel correction values dX and dY with reference to the left and right mrSad. In the figure, bestIdx is omitted for simplicity.
dX = parametricFunc (mrSad [bextIdx-1], mrSad [bextIdx], mrSad [bextIdx + 1])
dY = parametricFunc (mrSad [bextIdx-M], mrSad [bextIdx], mrSad [bextIdx + M])
The order of branching is not limited to the above.

なお、図26(b)に示す以下の処理でもよい。 The following processing shown in FIG. 26 (b) may be used.

S501 DMVR部30375は、最小値bestIdxとなる点が、SADを導出したM×Nのブロックにおいて、コーナー以外で上辺もしくは下辺の場合(横線パターンの場合)、S502に移行し、それ以外の場合S503に移行する。 The S501 DMVR unit 30375 shifts to S502 when the point where the minimum value is the bestIdx is the upper side or the lower side (in the case of the horizontal line pattern) other than the corner in the M × N block from which the SAD is derived, and S503 in other cases. Move to.

S502 DMVR部30375は、上下のSADとして中心のSADを設定してS506に移行する。 The S502 DMVR unit 30375 sets the central SAD as the upper and lower SADs and shifts to the S506.

mrSadT = mrSadB = mrSadC
例えば、
mrSad[bextIdx-M] = mrSad[bextIdx+M] = mrSad[bextIdx]
S503 DMVR部30375は、最小値bestIdxとなる点が、SADを導出したM×Nのブロックにおいて、コーナー以外で左辺もしくは右辺の場合(縦線パターンの場合)、S504に移行し、それ以外の場合S505に移行する。
mrSadT = mrSadB = mrSadC
For example
mrSad [bextIdx-M] = mrSad [bextIdx + M] = mrSad [bextIdx]
In the S503 DMVR section 30375, if the point where the minimum value is the bestIdx is the left side or the right side (in the case of the vertical line pattern) other than the corner in the M × N block from which the SAD is derived, it shifts to S504, and in other cases. Move to S505.

S504 DMVR部30375は、左右のSADとして中心のSADを設定してS506に移行する。 The S504 DMVR unit 30375 sets the central SAD as the left and right SADs and shifts to the S506.

mrSadL = mrSadR = mrSadC
例えば、
mrSad[bextIdx-1] = mrSad[bextIdx+1] = mrSad[bextIdx]
S505 DMVR部30375は、最小値bestIdxとなる点が、SADを導出したM×Nのブロックにおいて、コーナー以外で中心の場合(格子パターンの場合)、S506に移行する。
mrSadL = mrSadR = mrSadC
For example
mrSad [bextIdx-1] = mrSad [bextIdx + 1] = mrSad [bextIdx]
The S505 DMVR unit 30375 shifts to S506 when the point at which the minimum value is the bestIdx is the center other than the corner in the M × N block from which the SAD is derived (in the case of the grid pattern).

S506 DMVR部30375は、左右のmrSadを参照して、サブペル補正値dX, dYを導出する。なお図では簡単のためbestIdxを省略している。
dX = parametricFunc(mrSadL, mrSadC, mrSadR)
dY = parametricFunc(mrSadT, mrSadC, mrSadB)
例えば
dX = parametricFunc(mrSad[bextIdx-1], mrSad[bextIdx], mrSad[bextIdx+1])
dY = parametricFunc(mrSad[bextIdx-M], mrSad[bextIdx], mrSad[bextIdx+M])
なお、コーナー位置(dmvx!=-M2もしくはdmvx!=M2もしくはdmvy!=-N2もしくはdmvy!=-N2ではない場合)では、上下左右のSADとして中心のSADを設定してS506に移行してもよい。
The S506 DMVR unit 30375 derives the subpel correction values dX and dY with reference to the left and right mrSad. In the figure, bestIdx is omitted for simplicity.
dX = parametricFunc (mrSadL, mrSadC, mrSadR)
dY = parametricFunc (mrSadT, mrSadC, mrSadB)
For example
dX = parametricFunc (mrSad [bextIdx-1], mrSad [bextIdx], mrSad [bextIdx + 1])
dY = parametricFunc (mrSad [bextIdx-M], mrSad [bextIdx], mrSad [bextIdx + M])
At the corner position (when not dmvx! =-M2 or dmvx! = M2 or dmvy! =-N2 or dmvy! =-N2), set the center SAD as the top, bottom, left and right SAD and move to S506. May be good.

mrSadL = mrSadR = mrSadT = mrSadB = mrSadC
例えば
mrSad[bextIdx-M] = mrSad[bextIdx+M] = mrSad[bextIdx]
mrSad[bextIdx-1] = mrSad[bextIdx+1] = mrSad[bextIdx]
上記例では、取得できない位置のSADを中心位置のSADで置き換えることにより、全ての位置で同一(S506)の適用することを可能とする。
mrSadL = mrSadR = mrSadT = mrSadB = mrSadC
For example
mrSad [bextIdx-M] = mrSad [bextIdx + M] = mrSad [bextIdx]
mrSad [bextIdx-1] = mrSad [bextIdx + 1] = mrSad [bextIdx]
In the above example, by replacing the SAD at the position that cannot be acquired with the SAD at the center position, it is possible to apply the same (S506) at all positions.

このように、中心ベクトルの位置に応じて水平方向のdXのみもしくは垂直方向のdYのみが非0となる場合も、サブペル補正値dX, dYを導出することにより、水平かつ垂直のサブペル補正値を導出する場合よりも広い範囲で、サブベル補正値を導出することができ、符号化効率向上の効果を奏する。 In this way, even when only the horizontal dX or the vertical dY is non-zero depending on the position of the center vector, the horizontal and vertical subpel correction values can be obtained by deriving the subpel correction values dX and dY. The subbell correction value can be derived in a wider range than in the case of derivation, and the effect of improving the coding efficiency is achieved.

(Triangle予測)
続いてTriangle予測について説明する。Triangle予測では、対角線又は反対角線を境界として、対象CUが2つの三角形の予測単位に分割される。それぞれの三角形予測単位における予測画像は、対象CU(三角形予測単位を含む矩形ブロック)の予測画像の各画素に画素の位置に応じた重みつけマスク処理を施すことで導出する。例えば、矩形領域内の三角形領域の画素を1、三角形以外の領域を0とするマスクを乗ずることにより、矩形画像から三角形画像を導出できる。予測画像の適応的な重み付け処理は対角線を挟んだ双方の領域に対して適用され、2つの予測画像を用いた適応的重みつけ処理により対象CU(矩形ブロック)の1つの予測画像が導出される。この処理を、Triangle合成処理と呼ぶ。変換(逆変換)及び量子化(逆量子化)処理が対象CUの全体に対して適用される。なお、Triangle予測は、マージ予測モード又はスキップモードの場合にのみ適用される。
(Triangle prediction)
Next, the Triangle prediction will be described. In Triangle prediction, the target CU is divided into two triangular prediction units with the diagonal or opposite diagonal as the boundary. The prediction image in each triangle prediction unit is derived by applying a weighting mask process to each pixel of the prediction image of the target CU (rectangular block including the triangle prediction unit) according to the pixel position. For example, a triangular image can be derived from a rectangular image by multiplying a mask in which the pixels of the triangular region in the rectangular region are 1 and the region other than the triangle is 0. The adaptive weighting process of the predicted image is applied to both regions across the diagonal line, and one predicted image of the target CU (rectangular block) is derived by the adaptive weighting process using the two predicted images. .. This process is called Triangle composition process. Transformation (inverse transformation) and quantization (inverse quantization) processing is applied to the entire target CU. Note that the Triangle prediction is applied only in the merge prediction mode or the skip mode.

Triangle予測部30377は、Triangle予測に用いられる2つの三角形領域に対応する予測パラメータを導出し、インター予測画像生成部309に出力する。Triangle予測では処理の簡略化のために、双予測を用いない構成でもよい。この場合、1つの三角形領域において単方向予測のインター予測パラメータを導出する。なお、2つの予測画像の導出及び予測画像を用いた合成は、動き補償部3091、Triangle合成部30952で行う。 The Triangle prediction unit 30377 derives prediction parameters corresponding to the two triangular regions used for the Triangle prediction and outputs them to the inter-prediction image generation unit 309. In Triangle prediction, in order to simplify the processing, a configuration that does not use bi-prediction may be used. In this case, the inter-prediction parameters for unidirectional prediction are derived in one triangular region. The derivation of the two predicted images and the composition using the predicted images are performed by the motion compensation unit 3091 and the Triangle composition unit 30952.

(MMVD予測部30376)
MMVD予測部30376は、MMVD(Merge with Motion Vector Differece)モードにおける処理を行う。MMVDモードは、マージ候補から導出される動きベクトル(隣接ブロックの動きベクトルなどから導出される動きベクトル)に、所定の距離及び所定の方向の差分ベクトルを加算することで動きベクトルを得るモードである。MMVDモードにおいては、MMVD予測部30376は、マージ候補を用いるとともに、差分ベクトルの値域を所定の距離(例えば8通り)及び所定の方向(例えば4方向, 8方向など)に制限することで、効率的に動きベクトルを導出する。
(MMVD Prediction Unit 30376)
The MMVD prediction unit 30376 performs processing in the MMVD (Merge with Motion Vector Differece) mode. The MMVD mode is a mode in which a motion vector is obtained by adding a difference vector of a predetermined distance and a predetermined direction to a motion vector derived from a merge candidate (a motion vector derived from a motion vector of an adjacent block). .. In the MMVD mode, the MMVD prediction unit 30376 uses merge candidates and limits the range of the difference vector to a predetermined distance (for example, 8 ways) and a predetermined direction (for example, 4 directions, 8 directions, etc.) for efficiency. Derivation of motion vector.

MMVD予測部30376は、マージ候補mergeCandList[]と符号化データから復号もしくは符号化データに符号化するシンタックスbase_candidate_idx、direction_idx、distance_idxを用いて動きベクトルmvLX[]を導出する。さらに、MMVD予測部30376は、距離テーブルを選択するシンタックスdistance_list_idxを符号化もしくは復号して利用してもよい。 The MMVD prediction unit 30376 derives the motion vector mvLX [] using the merge candidate mergeCandList [] and the syntax base_candidate_idx, direction_idx, and distance_idx that decode or encode the encoded data into encoded data. Further, the MMVD prediction unit 30376 may encode or decode the syntax distance_list_idx for selecting the distance table and use it.

MMVD予測部30376は、対象CUに対して、merge_flagがマージモードを適用することを示している場合、又は、skip_flagがスキップモードを適用することを示している場合に、MMVDフラグを復号する。さらに、MMVD予測部30376は、MMVDフラグがMMVDモードを適用することを示している場合(mmvd_flag=1)には、MMVDモードを適用する。 The MMVD prediction unit 30376 decodes the MMVD flag when the merge_flag indicates that the merge mode is applied to the target CU, or when the skip_flag indicates that the skip mode is applied. Further, the MMVD prediction unit 30376 applies the MMVD mode when the MMVD flag indicates that the MMVD mode is applied (mmvd_flag = 1).

MMVD予測部30376は、マージ候補リストの先頭から2個の候補のいずれかの予測ベクトルと、方向および距離で表した差分ベクトル(MVD:motion vector difference)とで、動きベクトルを導出する。さらに、MMVD予測部30376は、予測ベクトルと差分ベクトルから動きベクトルを導出する。 The MMVD prediction unit 30376 derives a motion vector from the prediction vector of one of the two candidates from the beginning of the merge candidate list and the difference vector (MVD: motion vector difference) expressed by the direction and the distance. Further, the MMVD prediction unit 30376 derives a motion vector from the prediction vector and the difference vector.

図15は、MMVD予測部30376において導出される差分ベクトルmvdLXの候補を示す。図に示す例では、中央の黒丸が予測ベクトルmvLXN(中心ベクトル)の指す位置である。 FIG. 15 shows candidates for the difference vector mvdLX derived by the MMVD prediction unit 30376. In the example shown in the figure, the black circle in the center is the position pointed to by the prediction vector mvLXN (center vector).

図14の(a)はmergeCandList[]のインデックスbase_candidate_idxとmvLXNの関係を示し、mvLXNにはmergeCandList[base_candidate_idx]の動きベクトルがセットされる。この中心ベクトルが指す位置(図15の黒丸)と実際の動きベクトルの差が差分ベクトルmvdLXである。 (A) in FIG. 14 shows the relationship between the index base_candidate_idx of mergeCandList [] and mvLXN, and the motion vector of mergeCandList [base_candidate_idx] is set in mvLXN. The difference between the position pointed to by this center vector (black circle in Fig. 15) and the actual motion vector is the difference vector mvdLX.

図14の(b)は、対象ブロックに隣接するブロックの一例を示す図である。例えば、mergeCandList[]={A1,B1,B0,A0,B2}の場合、復号したbase_candidate_idxが0を示すと、MMVD予測部30376は図14の(b)に示すブロックA1の動きベクトルを予測ベクトルmvLXNとして選択する。また、復号したbase_candidate_idxが1を示すと、MMVD予測部30376は図14の(b)に示すブロックB1の動きベクトルを予測ベクトルmvLXNとして選択する。なお、base_candidate_idxが符号化データで通知されない場合には、base_candidate_idx=0と推定してもよい。 FIG. 14B is a diagram showing an example of a block adjacent to the target block. For example, in the case of mergeCandList [] = {A1, B1, B0, A0, B2}, if the decoded base_candidate_idx indicates 0, the MMVD prediction unit 30376 predicts the motion vector of block A1 shown in FIG. 14 (b). Select as mvLXN. Further, when the decoded base_candidate_idx indicates 1, the MMVD prediction unit 30376 selects the motion vector of the block B1 shown in FIG. 14 (b) as the prediction vector mvLXN. If base_candidate_idx is not notified by encoded data, it may be estimated that base_candidate_idx = 0.

また、MMVD予測部30376は、差分ベクトルmvdLXの長さを示すインデックスdistance_idxおよびmvdLXの方向を示すインデックスdirection_idxを用いてmvdLXを導出する。 Further, the MMVD prediction unit 30376 derives mvdLX using the index distance_idx indicating the length of the difference vector mvdLX and the index direction_idx indicating the direction of mvdLX.

図14の(c)は、distance_idxの一例を示す図である。図14の(c)に示すように、distance_idxにおいて、0、1、2、3、4、5、6および7の値は、1/4pel、1/2pel、1pel、2pel、4pel、8pel、16pelおよび32pelの8つの距離(長さ)のそれぞれに対応付けられている。 FIG. 14 (c) is a diagram showing an example of distance_idx. As shown in (c) of FIG. 14, in distance_idx, the values of 0, 1, 2, 3, 4, 5, 6 and 7 are 1 / 4pel, 1 / 2pel, 1pel, 2pel, 4pel, 8pel, 16pel. And 32pel are associated with each of the eight distances (lengths).

図14の(d)は、direction_idxの一例を示す図である。図14の(d)に示すように、direction_idxにおいて、0,1,2および3の値は、x軸が正の方向、x軸が負の方向、y軸が正の方向、y軸が負の方向に各々対応付けられている。MMVD予測部30376は、direction_idxから方向テーブルDirectionTableを参照して基本動きベクトル(mvdUnit[0],mvdUnit[1])を導出する。(mvdUnit[0],mvdUnit[1])は、(sign[0],sign[1])と記述されてもよい。
また、MMVD予測部30376は、距離テーブルDistanceTableにおいてdistance_idxの示す距離DistanceTable[distance_idx]から、ベースとなる差分ベクトルの大きさDistFromBaseMV(=MmvdDistance)を下式で導出する。
FIG. 14D is a diagram showing an example of direction_idx. As shown in (d) of FIG. 14, in direction_idx, the values of 0, 1, 2 and 3 have a positive x-axis direction, a negative x-axis direction, a positive y-axis direction, and a negative y-axis direction. They are associated with each other in the direction of. The MMVD prediction unit 30376 derives a basic motion vector (mvdUnit [0], mvdUnit [1]) from the direction_idx by referring to the direction table DirectionTable. (mvdUnit [0], mvdUnit [1]) may be described as (sign [0], sign [1]).
Further, the MMVD prediction unit 30376 derives the magnitude DistFromBaseMV (= MmvdDistance) of the base difference vector from the distance DistanceTable [distance_idx] indicated by distance_idx in the distance table DistanceTable by the following equation.

DistFromBaseMV = DistanceTable[distance_idx]
また、フラグに応じて、DistanceTableを以下の2つから選択してもよい。
DistFromBaseMV = DistanceTable [distance_idx]
Further, the Distance Table may be selected from the following two depending on the flag.

DistanceTable[] = {1, 2, 4, 8, 16, 32, 64, 128}
DistanceTable[] = {4, 8, 16, 32, 64, 128, 256, 512}
また、動きベクトルの精度(例えば1/16)にあわせて左シフトにより大きさをあわせてもよい。
DistanceTable [] = {1, 2, 4, 8, 16, 32, 64, 128}
DistanceTable [] = {4, 8, 16, 32, 64, 128, 256, 512}
Further, the magnitude may be adjusted by shifting to the left according to the accuracy of the motion vector (for example, 1/16).

DistFromBaseMV = DistFromBaseMV << 2
(4方向以外の場合)
上記では、基本動きベクトル(mvdUnit[0], mvdUnit[1])が上下左右の4方向の場合を説明したが、4方向に限定されず8方向でもよい。基本動きベクトルを8方向とする場合の方向テーブルDirectionTableのx成分dir_table_x[]およびy成分dir_table_y[]の例を以下に示す。
DistFromBaseMV = DistFromBaseMV << 2
(In cases other than 4 directions)
In the above, the case where the basic motion vector (mvdUnit [0], mvdUnit [1]) is in four directions of up, down, left, and right has been described, but it is not limited to four directions and may be eight directions. An example of the x component dir_table_x [] and the y component dir_table_y [] of the direction table Direction Table when the basic motion vector is 8 directions is shown below.

dir_table_x[] = { 8, -8, 0, 0, 6, -6, -6, 6 }
dir_table_y[] = { 0, 0, 8, -8, 6, -6, 6, -6 }
なお、方向テーブルの大きさや順序は上記以外でもよい。
dir_table_x [] = {8, -8, 0, 0, 6, -6, -6, 6}
dir_table_y [] = {0, 0, 8, -8, 6, -6, 6, -6}
The size and order of the direction table may be other than the above.

MMVD予測部30376は、direction_idxからDirectionTableを参照して基本動きベクトル(mvdUnit[0], mvdUnit[1])を導出する。 The MMVD prediction unit 30376 derives the basic motion vector (mvdUnit [0], mvdUnit [1]) from the direction_idx by referring to the DirectionTable.

mvdUnit[0] = dir_table_x[direction_idx]
mvdUnit[1] = dir_table_y[direction_idx]
また、例えば以下のような方向テーブルを用いることで、4、6、12、16方向としてもよい。
・6方向の場合
dir_table_x[] = { 8, -8, 2, -2, -2, 2 }
dir_table_y[] = { 0, 0, 4, -4, 4, -4 }
もしくは
dir_table_x[] = { 8, -8, 3, -3, -3, 3 }
dir_table_y[] = { 0, 0, 6, -6, 6, -6 }
・12方向の場合
dir_table_x[] = { 8, -8, 0, 0, 4, 2, -4, -2, -2, -4, 2, 4 }
dir_table_y[] = { 0, 0, 8, -8, 2, 4, -2, -4, 4, 2, -4, -2 }
もしくは
dir_table_x[] = { 8, -8, 0, 0, 6, 3, -6, -3, -3, -6, 3, 6 }
dir_table_y[] = { 0, 0, 8, -8, 3, 6, -3, -6, 6, 3, -6, -3 }
・16方向の場合
dir_table_x[] = {8, -8, 0, 0, 4, -4, -4, 4, 6, 2, -6, -2, -2, -6, 2, 6 }
dir_table_y[] = {0, 0, 8, -8, 4, -4, 4, -4, 2, 6, -2, -6, 6, 2, -6, -2 }
勿論、4方向の場合も以下のようになる。
mvdUnit [0] = dir_table_x [direction_idx]
mvdUnit [1] = dir_table_y [direction_idx]
Further, for example, by using the following direction table, the directions may be 4, 6, 12, or 16.
・ In the case of 6 directions
dir_table_x [] = {8, -8, 2, -2, -2, 2}
dir_table_y [] = {0, 0, 4, -4, 4, -4}
Or
dir_table_x [] = {8, -8, 3, -3, -3, 3}
dir_table_y [] = {0, 0, 6, -6, 6, -6}
・ In the case of 12 directions
dir_table_x [] = {8, -8, 0, 0, 4, 2, -4, -2, -2, -4, 2, 4}
dir_table_y [] = {0, 0, 8, -8, 2, 4, -2, -4, 4, 2, -4, -2}
Or
dir_table_x [] = {8, -8, 0, 0, 6, 3, -6, -3, -3, -6, 3, 6}
dir_table_y [] = {0, 0, 8, -8, 3, 6, -3, -6, 6, 3, -6, -3}
・ In the case of 16 directions
dir_table_x [] = {8, -8, 0, 0, 4, -4, -4, 4, 6, 2, -6, -2, -2, -6, 2, 6}
dir_table_y [] = {0, 0, 8, -8, 4, -4, 4, -4, 2, 6, -2, -6, 6, 2, -6, -2}
Of course, the case of four directions is as follows.

dir_table_x[] = { 1, -1, 0, 0 }
dir_table_y[] = { 0, 0, 1, -1 }
なお、方向テーブルの大きさや順序は上記以外でもよい。
dir_table_x [] = {1, -1, 0, 0}
dir_table_y [] = {0, 0, 1, -1}
The size and order of the direction table may be other than the above.

(複数の距離テーブル)
また、距離テーブルは1つに限定されず複数でもよい。例えば、MMVD予測部30376は、第1の距離テーブルDistanceTable1[]と第2の距離テーブルDistanceTable2[]から以下のようにDistFromBaseMVを導出しても良い。
(Multiple distance tables)
Further, the distance table is not limited to one, and may be plural. For example, the MMVD prediction unit 30376 may derive DistFromBaseMV from the first distance table DistanceTable1 [] and the second distance table DistanceTable2 [] as follows.

MMVD予測部30376は、さらに符号化データから復号もしくは導出したdistance_list_idxが示すDistanceTable[]を用いて、差分ベクトルmvdLXの長さを導出する。 The MMVD prediction unit 30376 further derives the length of the difference vector mvdLX by using the DistanceTable [] indicated by the distance_list_idx decoded or derived from the encoded data.

DistanceTable1 [] = {1, 2, 3, 5}
DistanceTable2 [] = {4, 8, 16, 32}
DistanceTable = DistanceTable1 (distance_list_idx == 0)
DistanceTable = DistanceTable2 (distance_list_idx == 1)
DistFromBaseMV = DistanceTable[distance_idx]
また、MMVD予測部30376は、2次元テーブルDistanceTable2dを用いて2つの距離テーブルを切り替えてもよい。
DistanceTable1 [] = {1, 2, 3, 5}
DistanceTable2 [] = {4, 8, 16, 32}
DistanceTable = DistanceTable1 (distance_list_idx == 0)
DistanceTable = DistanceTable2 (distance_list_idx == 1)
DistFromBaseMV = DistanceTable [distance_idx]
Further, the MMVD prediction unit 30376 may switch between two distance tables using the two-dimensional table DistanceTable2d.

DistanceTable2d [] = {{1, 2, 3, 5},{4, 8, 16, 32}}
DistFromBaseMV = DistanceTable2d[distance_list_idx][distance_idx]
(差分ベクトルの導出)
MMVD予測部30376は、基本動きベクトルと差分ベクトルの大きさDistFromBaseMVからrefineMvLXを導出する。中心ベクトルに関するマージ候補NがL0参照ピクチャからの単予測(predFlagL0N = 1, predFlagL1N = 0)の場合、MMVD予測部30376は、L0の差分ベクトルrefineMvL0を、基本動きベクトルと差分ベクトルの大きさDistFromBaseMVから導出する。
DistanceTable2d [] = {{1, 2, 3, 5}, {4, 8, 16, 32}}
DistFromBaseMV = DistanceTable2d [distance_list_idx] [distance_idx]
(Drivation of difference vector)
The MMVD prediction unit 30376 derives refineMvLX from the magnitudes of the basic motion vector and the difference vector, DistFromBaseMV. When the merge candidate N for the center vector is a simple prediction from the L0 reference picture (predFlagL0N = 1, predFlagL1N = 0), the MMVD prediction unit 30376 sets the difference vector refineMvL0 of L0 from the size of the basic motion vector and the difference vector DistFromBaseMV. Derived.

refineMvL0[0] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[0]
refineMvL0[1] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[1]
refineMvL1[0] = 0
refineMvL1[1] = 0
ここでshiftMMVDは、動き補償部3091(補間部)での動きベクトルの精度MVPRECにあうように差分ベクトルの大きさを調整する値である。例えばMVPRECが16、つまり1/16画素の動きベクトル精度で、4方向、つまりmvdUnit[0], mvdUnit[1]が0もしくは1の場合には、2を用いることが適当である。また、shiftMMVDのシフト方向は左シフトの限定されない。例えば、6、8、12、16方向など、mvdUnit[0], mvdUnit[1]が0もしくは1以外の値(例えば8)などを用いる場合には、MMVD予測部30376は、シフト方向を右シフトとしてもよい。例えば、MMVD予測部30376は、以下のように基本動きベクトル(mvdUnit[0], mvdUnit[1])を乗算した後で右シフトをしてもよい。
refineMvL0 [0] = (DistFromBaseMV << shiftMMVD) * mvdUnit [0]
refineMvL0 [1] = (DistFromBaseMV << shiftMMVD) * mvdUnit [1]
refineMvL1 [0] = 0
refineMvL1 [1] = 0
Here, shiftMMVD is a value for adjusting the magnitude of the difference vector so as to match the accuracy MVPREC of the motion vector in the motion compensation unit 3091 (interference unit). For example, when MVPREC is 16, that is, the motion vector accuracy is 1/16 pixel, and 4 directions, that is, mvdUnit [0] and mvdUnit [1] are 0 or 1, it is appropriate to use 2. Moreover, the shift direction of shiftMMVD is not limited to the left shift. For example, when mvdUnit [0], mvdUnit [1] uses a value other than 0 or 1 (for example, 8) such as 6, 8, 12, and 16, the MMVD prediction unit 30376 shifts the shift direction to the right. May be. For example, the MMVD prediction unit 30376 may shift to the right after multiplying the basic motion vectors (mvdUnit [0], mvdUnit [1]) as follows.

refineMvL0[0] = (DistFromBaseMV * mvdUnit[0]) >> shiftMMVD
refineMvL0[1] = (DistFromBaseMV * mvdUnit[1]) >> shiftMMVD
また、MMVD予測部30376は、動きベクトルの大きさと符号に分けて計算してもよい。以後、差分ベクトルの他の導出方法においても同様である。
refineMvL0 [0] = (DistFromBaseMV * mvdUnit [0]) >> shiftMMVD
refineMvL0 [1] = (DistFromBaseMV * mvdUnit [1]) >> shiftMMVD
Further, the MMVD prediction unit 30376 may calculate by dividing the magnitude and the sign of the motion vector. Hereinafter, the same applies to other derivation methods of the difference vector.

refineMvL0[0] = ((DistFromBaseMV * abs(mvdUnit[0])) >> shiftMMVD) * sign(mvdUnit[0])
refineMvL0[1] = ((DistFromBaseMV * abs(mvdUnit[1])) >> shiftMMVD) * sign(mvdUnit[1])
上記以外、中心ベクトルに関するマージ候補NがL1参照ピクチャからの単予測(predFlagL0N = 0, predFlagL1N = 1)の場合、MMVD予測部30376は、L1の差分ベクトルrefineMvL1を、基本動きベクトルと差分ベクトルの大きさDistFromBaseMVから導出する。
refineMvL0 [0] = ((DistFromBaseMV * abs (mvdUnit [0])) >> shiftMMVD) * sign (mvdUnit [0])
refineMvL0 [1] = ((DistFromBaseMV * abs (mvdUnit [1])) >> shiftMMVD) * sign (mvdUnit [1])
Other than the above, when the merge candidate N for the center vector is a simple prediction from the L1 reference picture (predFlagL0N = 0, predFlagL1N = 1), the MMVD prediction unit 30376 sets the difference vector refineMvL1 of L1 to the size of the basic motion vector and the difference vector. Derived from DistFromBaseMV.

refineMvL0[0] = 0
refineMvL0[1] = 0
refineMvL1[0] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[0]
refineMvL1[1] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[1]
もしくは
refineMvL1[0] = (DistFromBaseMV * mvdUnit[0]) >> shiftMMVD
refineMvL1[1] = (DistFromBaseMV * mvdUnit[1]) >> shiftMMVD
上記以外、中心ベクトルに関するマージ候補Nが双予測(predFlagL0N = 1, predFlagL1N = 1)の場合、MMVD予測部30376は、第1差分ベクトルfirstMvを、基本動きベクトルと差分ベクトルの大きさDistFromBaseMVから導出する。
refineMvL0 [0] = 0
refineMvL0 [1] = 0
refineMvL1 [0] = (DistFromBaseMV << shiftMMVD) * mvdUnit [0]
refineMvL1 [1] = (DistFromBaseMV << shiftMMVD) * mvdUnit [1]
Or
refineMvL1 [0] = (DistFromBaseMV * mvdUnit [0]) >> shiftMMVD
refineMvL1 [1] = (DistFromBaseMV * mvdUnit [1]) >> shiftMMVD
Other than the above, when the merge candidate N for the center vector is bi-prediction (predFlagL0N = 1, predFlagL1N = 1), the MMVD prediction unit 30376 derives the first difference vector firstMv from the magnitudes of the basic motion vector and the difference vector DistFromBaseMV. ..

firstMv[0] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[0]
firstMv[1] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[1]
もしくは
firstMv = (DistFromBaseMV * mvdUnit[0]) >> shiftMMVD
firstMv = (DistFromBaseMV * mvdUnit[1]) >> shiftMMVD
ここで、第1差分ベクトルrefineMvは、対象ピクチャと参照ピクチャのPOC距離(POCの差)が大きい方の差分ベクトルに対応する。つまり、参照ピクチャリストL0と参照ピクチャリストL1の参照ピクチャの内、対象ピクチャと参照ピクチャのPOC距離(POCの差)が大きい方の参照ピクチャを参照ピクチャリストLXの参照ピクチャとすると、POC距離(POCの差)が大きい方(LX)の参照ピクチャの参照画像と対象ピクチャ上の対象ブロックの差分ベクトルである。
firstMv [0] = (DistFromBaseMV << shiftMMVD) * mvdUnit [0]
firstMv [1] = (DistFromBaseMV << shiftMMVD) * mvdUnit [1]
Or
firstMv = (DistFromBaseMV * mvdUnit [0]) >> shiftMMVD
firstMv = (DistFromBaseMV * mvdUnit [1]) >> shiftMMVD
Here, the first difference vector refineMv corresponds to the difference vector having the larger POC distance (difference in POC) between the target picture and the reference picture. That is, if the reference picture having the larger POC distance (difference in POC) between the target picture and the reference picture among the reference pictures of the reference picture list L0 and the reference picture list L1 is used as the reference picture of the reference picture list LX, the POC distance (POC distance) This is the difference vector between the reference image of the reference picture of the reference picture with the larger POC difference) and the target block on the target picture.

続いて、MMVD予測部30376は、第1動きベクトルfirstMvをスケーリングすることで、もう一方の参照ピクチャ(参照リストLY(Y=1-X))の第2動きベクトル(POC距離の小さい方の参照ピクチャの動きベクトルsecondMv)を導出してもよい。 Subsequently, the MMVD prediction unit 30376 scales the first motion vector firstMv to refer to the second motion vector (reference to the smaller POC distance) of the other reference picture (reference list LY (Y = 1-X)). The motion vector secondMv) of the picture may be derived.

例えば、対象ピクチャcurrPicとL0ピクチャRefPicList0[ refIdxLN0 ]の距離が、対象ピクチャとL1ピクチャRefPicList1[ refIdxLN1 ]との距離よりも大きい場合には、第1ベクトルfirstMvはL0差分ベクトルrefineMvL0に対応する。さらに、MMVD予測部30376は、第1ベクトルfirstMvをスケーリングしてL1差分ベクトルrefineMvL1を導出してもよい。 For example, when the distance between the target picture currPic and the L0 picture RefPicList0 [refIdxLN0] is larger than the distance between the target picture and the L1 picture RefPicList1 [refIdxLN1], the first vector firstMv corresponds to the L0 difference vector refineMvL0. Further, the MMVD prediction unit 30376 may scale the first vector firstMv to derive the L1 difference vector refineMvL1.

refineMvL0[0] = firstMv[0]
refineMvL0[1] = firstMv[1]
refineMvL1[0] = Clip3( -32768, 32767, Sign( distScaleFactor * firstMv[0]) *
( ( Abs( distScaleFactor * refineMvL0[0]) + 127 ) >> 8 ) )
refineMvL1[1] = Clip3( -32768, 32767, Sign( distScaleFactor * firstMv[1]) *
( ( Abs( distScaleFactor * refineMvL0[1]) + 127 ) >> 8 ) )
ここでMMVD予測部30376は、distScaleFactor を、currPicとL0参照ピクチャのPOC差DiffPicOrderCnt( currPic, RefPicList0[ refIdxLN0 ]とcurrPicとL1参照ピクチャのPOC差DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1 ]から以下のように導出する。
distScaleFactor = Clip3( -4096, 4095, ( tb * tx + 32 ) >> 6 )
tx = ( 16384 + ( Abs( td ) >> 1 ) ) / td
td = Clip3( -128, 127, DiffPicOrderCnt( currPic, RefPicList0[ refIdxLN0 ]) )
tb = Clip3( -128, 127, DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1 ]) )
上記以外、対象ピクチャcurrPicとL0ピクチャRefPicList0[ refIdxLN0 ]の距離が、対象ピクチャとL1ピクチャRefPicList1[ refIdxLN1 ]との距離以下の場合には、第1ベクトルfirstMvはL1差分ベクトルrefineMvL1に対応する。この場合、MMVD予測部30376は、第1ベクトルfirstMvをスケーリングしてL0差分ベクトルrefineMvL0を導出してもよい。
refineMvL0 [0] = firstMv [0]
refineMvL0 [1] = firstMv [1]
refineMvL1 [0] = Clip3 (-32768, 32767, Sign (distScaleFactor * firstMv [0]) *
((Abs (distScaleFactor * refineMvL0 [0]) + 127) >> 8))
refineMvL1 [1] = Clip3 (-32768, 32767, Sign (distScaleFactor * firstMv [1]) *
((Abs (distScaleFactor * refineMvL0 [1]) + 127) >> 8))
Here, the MMVD prediction unit 30376 derives the distScaleFactor from the POC difference between currPic and the L0 reference picture DiffPicOrderCnt (currPic, RefPicList0 [refIdxLN0] and the POC difference between the currPic and the L1 reference picture DiffPicOrderCnt (from currPic, RefPicList1 [refIdxLN1]). To do.
distScaleFactor = Clip3 (-4096, 4095, (tb * tx + 32) >> 6)
tx = (16384 + (Abs (td) >> 1)) / td
td = Clip3 (-128, 127, DiffPicOrderCnt (currPic, RefPicList0 [refIdxLN0]))
tb = Clip3 (-128, 127, DiffPicOrderCnt (currPic, RefPicList1 [refIdxLN1]))
Other than the above, when the distance between the target picture currPic and the L0 picture RefPicList0 [refIdxLN0] is less than or equal to the distance between the target picture and the L1 picture RefPicList1 [refIdxLN1], the first vector firstMv corresponds to the L1 difference vector refineMvL1. In this case, the MMVD prediction unit 30376 may scale the first vector firstMv to derive the L0 difference vector refineMvL0.

refineMvL0[0] = Clip3( -32768, 32767, Sign( distScaleFactor * firstMv[0]) *
( ( Abs( distScaleFactor * firstMv[0]) + 127 ) >> 8 ) )
refineMvL0[1] = Clip3( -32768, 32767, Sign( distScaleFactor * firstMv[1]) *
( ( Abs( distScaleFactor * firstMv[1]) + 127 ) >> 8 ) )
refineMvL1[0] = firstMv[0]
refineMvL1[1] = firstMv[1]
ここでMMVD予測部30376は、distScaleFactor を、currPicとL0参照ピクチャのPOC差DiffPicOrderCnt( currPic, RefPicList0[ refIdxLN0 ]とcurrPicとL1参照ピクチャのPOC差DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1 ]から以下のように導出する。
distScaleFactor = Clip3( -4096, 4095, ( tb * tx + 32 ) >> 6 )
tx = ( 16384 + ( Abs( td ) >> 1 ) ) / td
td = Clip3( -128, 127, DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1 ]) )
tb = Clip3( -128, 127, DiffPicOrderCnt( currPic, RefPicList0[ refIdxLN0 ]) )
なお、対象ピクチャcurrPicとL0ピクチャRefPicList0[ refIdxLN0 ]の距離が、対象ピクチャとL1ピクチャRefPicList1[ refIdxLN1 ]との距離と等しい場合には、MMVD予測部30376は、firstMv[]をスケーリングすることなく、以下の処理(処理Aもしくは処理B)からrefineMv[]に設定してもよい。
処理A:
refineMvL0[0] = firstMv[0]
refineMvL0[1] = firstMv[1]
refineMvL1[0] = -firstMv[0]
refineMvL1[1] = -firstMv[1]
処理B:
refineMvL0[0] = firstMv[0]
refineMvL0[1] = firstMv[1]
refineMvL1[0] = firstMv[0]
refineMvL1[1] = firstMv[1]
より具体的には、MMVD予測部30376は、refineMv[]を、L0参照ピクチャと、対象ピクチャcurrPicと、L1対象ピクチャと、が時間順に並ぶ場合には処理Aで導出し、それ以外の場合には処理Bで導出する。
refineMvL0 [0] = Clip3 (-32768, 32767, Sign (distScaleFactor * firstMv [0]) *
((Abs (distScaleFactor * firstMv [0]) + 127) >> 8))
refineMvL0 [1] = Clip3 (-32768, 32767, Sign (distScaleFactor * firstMv [1]) *
((Abs (distScaleFactor * firstMv [1]) + 127) >> 8))
refineMvL1 [0] = firstMv [0]
refineMvL1 [1] = firstMv [1]
Here, the MMVD prediction unit 30376 derives the distScaleFactor from the POC difference between currPic and the L0 reference picture DiffPicOrderCnt (currPic, RefPicList0 [refIdxLN0] and the POC difference between the currPic and the L1 reference picture DiffPicOrderCnt (from currPic, RefPicList1 [refIdxLN1]). To do.
distScaleFactor = Clip3 (-4096, 4095, (tb * tx + 32) >> 6)
tx = (16384 + (Abs (td) >> 1)) / td
td = Clip3 (-128, 127, DiffPicOrderCnt (currPic, RefPicList1 [refIdxLN1]))
tb = Clip3 (-128, 127, DiffPicOrderCnt (currPic, RefPicList0 [refIdxLN0]))
If the distance between the target picture currPic and the L0 picture RefPicList0 [refIdxLN0] is equal to the distance between the target picture and the L1 picture RefPicList1 [refIdxLN1], the MMVD prediction unit 30376 does not scale the firstMv []. It may be set to refineMv [] from the process (process A or process B) of.
Process A:
refineMvL0 [0] = firstMv [0]
refineMvL0 [1] = firstMv [1]
refineMvL1 [0] = -firstMv [0]
refineMvL1 [1] = -firstMv [1]
Process B:
refineMvL0 [0] = firstMv [0]
refineMvL0 [1] = firstMv [1]
refineMvL1 [0] = firstMv [0]
refineMvL1 [1] = firstMv [1]
More specifically, the MMVD prediction unit 30376 derives refineMv [] in process A when the L0 reference picture, the target picture currPic, and the L1 target picture are arranged in chronological order, and in other cases, Is derived in process B.

なお、時間順に並ぶ場合とは
(POC_L0 - POC_curr) * (POC_L1 - POC_curr) < 0の場合、すなわち、
DiffPicOrderCnt( RefPicList0[ refIdxLN0 ], currPic) * DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1 ] ) > 0の場合である。
In addition, when arranging in chronological order
(POC_L0 --POC_curr) * (POC_L1 --POC_curr) <0, that is,
DiffPicOrderCnt (RefPicList0 [refIdxLN0], currPic) * DiffPicOrderCnt (currPic, RefPicList1 [refIdxLN1])> 0.

ここで、POC_L0、POC_L1、POC_currは、各々L0参照ピクチャ、L1参照ピクチャ、対象ピクチャのPicture Order Countを示す。 Here, POC_L0, POC_L1, and POC_curr indicate the Picture Order Count of the L0 reference picture, the L1 reference picture, and the target picture, respectively.

その逆の場合(時間順序の逆)とは、
(POC_L0 - POC_curr) * (POC_L1 - POC_curr) > 0の場合、すなわち、
DiffPicOrderCnt( RefPicList0[ refIdxLN0 ], currPic) * DiffPicOrderCnt( currPic, RefPicList1[ refIdxLN1 ] ) < 0の場合である。
The opposite case (reverse of time order) is
If (POC_L0 --POC_curr) * (POC_L1 --POC_curr)> 0, that is,
DiffPicOrderCnt (RefPicList0 [refIdxLN0], currPic) * DiffPicOrderCnt (currPic, RefPicList1 [refIdxLN1]) <0.

なお、POC間の距離が異なる場合においても、MMVD予測部30376は、上記POC間の距離が等しい場合で説明したrefineMvLX[]を先に導出した後に、参照ピクチャと対象ピクチャのPOC距離に応じてrefineMvLX[]をスケールし最終的なrefineMvLX[]を導出しても構わない。 Even if the distances between the POCs are different, the MMVD prediction unit 30376 first derives the refineMvLX [] described in the case where the distances between the POCs are the same, and then determines the POC distance between the reference picture and the target picture. You may scale refineMvLX [] to derive the final refineMvLX [].

(中心ベクトルと差分ベクトルの加算)
最終的に、MMVD予測部30376は、差分ベクトルrefineMv[](mvdLX[])と中心ベクトルmvLXN[](mvpLX[])とから以下のように、MMVDマージ候補の動きベクトルを導出する。
mvL0[ 0 ] = mvL0N[ 0 ] + refineMvL0[0]
mvL0[ 1 ] = mvL0N[ 1 ] + refineMvL0[1]
mvL1[ 0 ] = mvL1N[ 0 ] + refineMvL1[0]
mvL1[ 1 ] = mvL1N[ 1 ] + refineMvL1[1]
(まとめ)
このように、予測ベクトルが双予測であっても、MMVD予測部30376は、1方の動きベクトルの情報(direction_idx、distance_idx)を1組だけ通知する。そして1組の情報から2つの動きベクトルを導出する。MMVD予測部30376は、2つの参照ピクチャのそれぞれ
のPOCと対象ピクチャのPOCとの差から、必要に応じて動きベクトルのスケーリングを行う。POC距離(POCの差)が大きい方の参照ピクチャLXの参照画像と対象ピクチャ上の対象ブロックの差分ベクトルが通知される動きベクトル(firstMv)に対応する。
(Addition of center vector and difference vector)
Finally, the MMVD prediction unit 30376 derives the motion vector of the MMVD merge candidate from the difference vector refineMv [] (mvdLX []) and the center vector mvLXN [] (mvpLX []) as follows.
mvL0 [0] = mvL0N [0] + refineMvL0 [0]
mvL0 [1] = mvL0N [1] + refineMvL0 [1]
mvL1 [0] = mvL1N [0] + refineMvL1 [0]
mvL1 [1] = mvL1N [1] + refineMvL1 [1]
(Summary)
In this way, even if the prediction vector is bi-prediction, the MMVD prediction unit 30376 notifies only one set of information (direction_idx, distance_idx) of one motion vector. Then, two motion vectors are derived from one set of information. The MMVD prediction unit 30376 scales the motion vector as necessary from the difference between the POC of each of the two reference pictures and the POC of the target picture. Corresponds to the motion vector (firstMv) in which the difference vector between the reference image of the reference picture LX and the target block on the target picture, which has the larger POC distance (difference in POC), is notified.

firstMv[0] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[0]
firstMv[1] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[1]
MMVD予測部30376は、POC距離の小さい方の参照ピクチャLY (Y = 1 - X)の動きベクトルmvdLY(secondMv)を、ピクチャ間のPOC距離の比(POCS/POCL)でスケーリングすることで導出する。
firstMv [0] = (DistFromBaseMV << shiftMMVD) * mvdUnit [0]
firstMv [1] = (DistFromBaseMV << shiftMMVD) * mvdUnit [1]
The MMVD prediction unit 30376 derives the motion vector mvdLY (secondMv) of the reference picture LY (Y = 1 --X) having the smaller POC distance by scaling the ratio of the POC distances between the pictures (POCS / POCL). ..

secondY = (DistFromBaseMV<<shiftMMVD) * mvdUnit[0] *POCS/POCL
secondMv[1] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[1] *POCS/POCL
なお、POC距離の小さい方の参照ピクチャとは、対象ピクチャと参照ピクチャのPOC距離(POCの差)が小さい方に対応する。ここで、POCSは対象ピクチャに近い参照ピクチャとのPOC差の差分値、POCLは対象ピクチャから遠い参照ピクチャとのPOC差の差分値である。あるいは動きベクトルmvdLYを下式で導出してもよい。
secondY = (DistFromBaseMV << shiftMMVD) * mvdUnit [0] * POCS / POCL
secondMv [1] = (DistFromBaseMV << shiftMMVD) * mvdUnit [1] * POCS / POCL
The reference picture having the smaller POC distance corresponds to the one having the smaller POC distance (difference in POC) between the target picture and the reference picture. Here, POCS is the difference value of the POC difference from the reference picture close to the target picture, and POCL is the difference value of the POC difference from the reference picture far from the target picture. Alternatively, the motion vector mvdLY may be derived by the following equation.

mvdLY = MvScale(DistFromBaseMV,CurPic,PicLX,CurPic,PicLY)
ここで、CurPic,PicLX, PicLYは対象ピクチャ、対象ピクチャから遠いほうの参照ピクチャ、対象ピクチャから近いほうの参照ピクチャを表す。
mvdLY = MvScale (DistFromBaseMV, CurPic, PicLX, CurPic, PicLY)
Here, CurPic, PicLX, PicLY represent the target picture, the reference picture farther from the target picture, and the reference picture closer to the target picture.

以上のように、MMVD予測部30376はmvpLX[](mvLXN[])とmvdLX[](refineMv[])を導出し、これらを用いて対象ブロックの動きベクトルmvLX[]を導出する。 As described above, the MMVD prediction unit 30376 derives mvpLX [] (mvLXN []) and mvdLX [] (refineMv []), and uses these to derive the motion vector mvLX [] of the target block.

mvLX[0] = mvpLX[0]+mvdLX[0]
mvLX[1] = mvpLX[1]+mvdLX[1]
(動きベクトルの整数丸め)
MMVD予測部30376は、中心ベクトルに加算する差分ベクトルmvdLXの大きさが所定の閾値よりも大きい場合に、対象ブロックの動きベクトルmvLXが整数画素位置を示すように修正してもよい。例えば、MMVD予測部30376は、DistFromBaseMVが所定の閾値16以上の場合に整数化をおこなってもよい。
mvLX [0] = mvpLX [0] + mvdLX [0]
mvLX [1] = mvpLX [1] + mvdLX [1]
(Motion vector integer rounding)
The MMVD prediction unit 30376 may modify the motion vector mvLX of the target block to indicate an integer pixel position when the magnitude of the difference vector mvdLX to be added to the center vector is larger than a predetermined threshold value. For example, the MMVD prediction unit 30376 may perform integer conversion when DistFromBaseMV is a predetermined threshold value of 16 or more.

また、MMVD予測部30376は、距離テーブルを選択するインデクスdistance_list_idxが特定の距離テーブル(例えばDistanceTable2)であり、かつ距離テーブルの要素を選択する(距離の係数を選択する)インデクスdistance_idxが特定の範囲(例えば、distance_idxが2や3)の場合に、整数化をおこなってもよい。例えば、MMVD予測部30376は、distance_list_idx == 1 かつ、distance_idx >= 2のとき、以下の式からmvLXを修正してもよい。 In the MMVD prediction unit 30376, the index distance_list_idx for selecting the distance table is a specific distance table (for example, DistanceTable2), and the index distance_idx for selecting the elements of the distance table (selecting the coefficient of the distance) is a specific range (for example). For example, when distance_idx is 2 or 3), integer conversion may be performed. For example, the MMVD prediction unit 30376 may modify mvLX from the following equation when distance_list_idx == 1 and distance_idx> = 2.

mvLX[0] = (mvLX[0] / MVPREC) * MVPREC
mvLX[1] = (mvLX[1] / MVPREC) * MVPREC
またMMVD予測部30376は、シフトを用いてmvLXを導出しても良い。
mvLX [0] = (mvLX [0] / MVPREC) * MVPREC
mvLX [1] = (mvLX [1] / MVPREC) * MVPREC
Further, the MMVD prediction unit 30376 may derive mvLX using the shift.

mvLX[0] = (mvLX[0] >> MVBIT) << MVBIT
mvLX[1] = (mvLX[1] >> MVBIT) << MVBIT
ここでMVBIT = log2(MVPREC)。例えば4。また、正と負を考慮して以下で導出しても良い。
mvLX [0] = (mvLX [0] >> MVBIT) << MVBIT
mvLX [1] = (mvLX [1] >> MVBIT) << MVBIT
Where MVBIT = log2 (MVPREC). For example 4. Further, it may be derived as follows in consideration of positive and negative.

mvLX[0] = mvLX[0] >=0 ? (mvLX[0] >> MVBIT) << MVBIT : -((-mvLX[0] >> MVBIT) <<
MVBIT)
mvLX[1] = mvLX[1] >=0 ? (mvLX[1] >> MVBIT) << MVBIT : -((-mvLX[1] >> MVBIT) <<
MVBIT)
このように、動きベクトルを整数に丸めることにより、予測画像生成の演算量を削減することが可能となる。
(シンタックス)
次に、図16及び図17を参照して、MMVD予測部30376における予測モードの選択処理の流れについて説明する。図16は、MMVD予測部30376における予測モードの選択処理の流れを示すフローチャートである。図17は、本実施形態に係る予測モードの選択処理を示すシンタックスを示す図であり、図16に示す処理の一部に対応するシンタックステーブルである。
mvLX [0] = mvLX [0]> = 0? (MvLX [0] >> MVBIT) << MVBIT:-((-mvLX [0] >> MVBIT) <<
MVBIT)
mvLX [1] = mvLX [1]> = 0? (MvLX [1] >> MVBIT) << MVBIT:-((-mvLX [1] >> MVBIT) <<
MVBIT)
By rounding the motion vector to an integer in this way, it is possible to reduce the amount of calculation for generating the predicted image.
(Syntax)
Next, the flow of the prediction mode selection process in the MMVD prediction unit 30376 will be described with reference to FIGS. 16 and 17. FIG. 16 is a flowchart showing the flow of the prediction mode selection process in the MMVD prediction unit 30376. FIG. 17 is a diagram showing a syntax showing a prediction mode selection process according to the present embodiment, and is a syntax table corresponding to a part of the process shown in FIG.

図16に示すように、本実施形態では、パラメータ復号部302は、まず、スキップフラグ(図17におけるskip_flag)を復号する(S1301)。スキップフラグがスキップモードであることを示している場合(S1302でYES)、パラメータ復号部302はMMVDフラグ(図17におけるmmvd_flag)を復号する(S1303)。MMVDフラグがMMVDモードであることを示していない場合(S1304でNO)、予測モードはスキップモードである(S1305)。スキップモードでは、図17に示すように、パラメータ復号部302は、マージインデックス(図17におけるmerge_idx)を復号する。 As shown in FIG. 16, in the present embodiment, the parameter decoding unit 302 first decodes the skip flag (skip_flag in FIG. 17) (S1301). When the skip flag indicates that the mode is skip (YES in S1302), the parameter decoding unit 302 decodes the MMVD flag (mmvd_flag in FIG. 17) (S1303). If the MMVD flag does not indicate that it is in MMVD mode (NO in S1304), the predictive mode is skip mode (S1305). In the skip mode, as shown in FIG. 17, the parameter decoding unit 302 decodes the merge index (merge_idx in FIG. 17).

MMVDフラグがMMVDモードであることを示している場合(S1304でYES)、予測モードはMMVDモードである(S1305)。MMVDモードでは、図17に示すように、パラメータ復号部302はbase_candidate_idx、distance_idx、及びdirection_idxを復号する。 If the MMVD flag indicates that it is in MMVD mode (YES in S1304), then the predictive mode is MMVD mode (S1305). In the MMVD mode, as shown in FIG. 17, the parameter decoding unit 302 decodes base_candidate_idx, distance_idx, and direction_idx.

スキップフラグがスキップモードであることを示していない場合(S1302でNO)、パラメータ復号部302は、マージフラグ(図17におけるmerge_flag)を復号する(S1307)。マージフラグがマージモードであることを示している場合(S1308でYES)、パラメータ復号部302は、MMVDフラグ(図17におけるmmvd_flag)を復号する(S1309)。MMVDフラグがMMVDモードであることを示していない場合(S1310でNO)、予測モードはマージモードである(S1311)。マージモードでは、図17に示すように、パラメータ復号部302は、マージインデックス(図17におけるmerge_idx)を復号する。 If the skip flag does not indicate that it is in skip mode (NO in S1302), the parameter decoding unit 302 decodes the merge flag (merge_flag in FIG. 17) (S1307). When the merge flag indicates that the merge mode is set (YES in S1308), the parameter decoding unit 302 decodes the MMVD flag (mmvd_flag in FIG. 17) (S1309). If the MMVD flag does not indicate that it is in MMVD mode (NO in S1310), then the predictive mode is merge mode (S1311). In the merge mode, as shown in FIG. 17, the parameter decoding unit 302 decodes the merge index (merge_idx in FIG. 17).

MMVDフラグがMMVDモードであることを示している場合(S1310でYES)、予測モードはMMVDモードである(S1312)。MMVDモードでは、図17に示すように、パラメータ復号部302はbase_candidate_idx、distance_idx、及びdirection_idxを復号する。 If the MMVD flag indicates that it is in MMVD mode (YES in S1310), then the predictive mode is MMVD mode (S1312). In the MMVD mode, as shown in FIG. 17, the parameter decoding unit 302 decodes base_candidate_idx, distance_idx, and direction_idx.

マージフラグがマージモードであることを示していない場合(S1308でNO)、予測モードはAMVPモードである(S1313)。 If the merge flag does not indicate that it is in merge mode (NO in S1308), the predictive mode is AMVP mode (S1313).

スキップモード、マージモードにおいては、パラメータ復号部302は、merge_idxを復号する。 In the skip mode and the merge mode, the parameter decoding unit 302 decodes merge_idx.

MMVDモードにおいては、パラメータ復号部302は、base_candidate_idx、distance_idxおよびdirection_idxを復号する。MMVD予測部30376はこれらのパラメータを用いて、mvpLX、mvdLXを導出する。そしてmvLXを導出する。 In the MMVD mode, the parameter decoding unit 302 decodes base_candidate_idx, distance_idx and direction_idx. The MMVD prediction unit 30376 derives mvpLX and mvdLX using these parameters. Then derive mvLX.

次に、図18及び図19を参照して、本発明の別の実施の形態のMMVD予測部30376における予測モードの選択処理の流れについて説明する。図18は、MMVD予測部30376における予測モードの選択処理の流れを示すフローチャートである。図19は、本実施形態に係る予測モードの選択処理を示すシンタックスを示す図であり、図18に示す処理の一部に対応するシンタックステーブルである。 Next, the flow of the prediction mode selection process in the MMVD prediction unit 30376 of another embodiment of the present invention will be described with reference to FIGS. 18 and 19. FIG. 18 is a flowchart showing the flow of the prediction mode selection process in the MMVD prediction unit 30376. FIG. 19 is a diagram showing a syntax showing a prediction mode selection process according to the present embodiment, and is a syntax table corresponding to a part of the process shown in FIG.

図16のフローチャート及び図17のシンタックスでは、スキップモードおよびマージモードにおいて、MMVDフラグを復号する処理が存在する。高い圧縮率で、符号化、復号を行いたい場合、相対的にスキップモードやマージモードが多く選択されるが、その場合、MMVDフラグの存在がオーバヘッドとなる。図18のフローチャート及び図19のシンタックスでは、MMVD予測部30376は、スキップモードおよびマージモードのいずれも選択されなかった場合にMMVDモードを選択する。 In the flowchart of FIG. 16 and the syntax of FIG. 17, there is a process of decoding the MMVD flag in the skip mode and the merge mode. If you want to perform coding and decoding with a high compression rate, relatively many skip modes and merge modes are selected, but in that case, the presence of the MMVD flag becomes an overhead. In the flowchart of FIG. 18 and the syntax of FIG. 19, the MMVD prediction unit 30376 selects the MMVD mode when neither the skip mode nor the merge mode is selected.

図18に示すように、本実施形態では、パラメータ復号部302は、まず、スキップフラグ(図19におけるskip_flag)を復号する(S1401)。スキップフラグがスキップモードであることを示している場合(S1402でYES)、予測モードはスキップモードである(S1403)。スキップモードでは、図19に示すように、パラメータ復号部302は、マージインデックス(図19におけるmerge_idx)を復号する。 As shown in FIG. 18, in the present embodiment, the parameter decoding unit 302 first decodes the skip flag (skip_flag in FIG. 19) (S1401). If the skip flag indicates skip mode (YES in S1402), the predictive mode is skip mode (S1403). In the skip mode, as shown in FIG. 19, the parameter decoding unit 302 decodes the merge index (merge_idx in FIG. 19).

スキップフラグがスキップモードであることを示していない場合(S1402でNO)、パラメータ復号部302は、マージフラグ(図19におけるmerge_flag)を復号する(S1404)。マージフラグがマージモードであることを示している場合(S1405でYES)、予測モードはマージモードである(S1406)。マージモードでは、図19に示すように、パラメータ復号部302は、マージインデックス(図19におけるmerge_idx)を復号する。 If the skip flag does not indicate that it is in skip mode (NO in S1402), the parameter decoding unit 302 decodes the merge flag (merge_flag in FIG. 19) (S1404). If the merge flag indicates that it is in merge mode (YES in S1405), then the predictive mode is in merge mode (S1406). In the merge mode, as shown in FIG. 19, the parameter decoding unit 302 decodes the merge index (merge_idx in FIG. 19).

マージフラグがマージモードであることを示していない場合(S1405でNO)、パラメータ復号部302は、MMVDフラグ(図19におけるmmvd_flag)を復号する(S1407)。MMVDフラグがMMVDモードであることを示していない場合(S1408でNO)、予測モードはAMVPモードである(S1409)。MMVDフラグがMMVDモードであることを示している場合(S1408でYES)、予測モードはMMVDモードである(S1410)。MMVDモードでは、図19に示すように、パラメータ復号部302はbase_candidate_idx、distance_idx、及びdirection_idxを復号する。パラメータ符号化部111は、同様の動作でシンタックスを符号化する。 If the merge flag does not indicate that it is in merge mode (NO in S1405), the parameter decoding unit 302 decodes the MMVD flag (mmvd_flag in FIG. 19) (S1407). If the MMVD flag does not indicate that it is in MMVD mode (NO in S1408), the predictive mode is AMVP mode (S1409). If the MMVD flag indicates that it is in MMVD mode (YES in S1408), then the predictive mode is MMVD mode (S1410). In the MMVD mode, as shown in FIG. 19, the parameter decoding unit 302 decodes base_candidate_idx, distance_idx, and direction_idx. The parameter coding unit 111 encodes the syntax in the same manner.

尚、マージモードである場合は、スキップモードとの違いは、予測画像生成において、予測残差を用いるか否かであるため、パラメータ復号部302は、図18及び図19の処理の後に、逆変換処理があるか否かを示すフラグをシンタックスとして復号する必要はない。一方、MMVDモードである場合は、スキップモードとは異なる予測画像生成が可能であるため、パラメータ復号部302は、逆変換処理があるか否かを示すフラグをシンタックスとして復号する必要がある。 In the merge mode, the difference from the skip mode is whether or not the predicted residual is used in the predicted image generation. Therefore, the parameter decoding unit 302 reverses after the processing of FIGS. 18 and 19. It is not necessary to decode the flag indicating whether or not there is conversion processing as a syntax. On the other hand, in the MMVD mode, it is possible to generate a predicted image different from the skip mode, so that the parameter decoding unit 302 needs to decode a flag indicating whether or not there is an inverse conversion process as a syntax.

このような構成をとることで、高い圧縮率で符号化された時に、多数のスキップフラグが予測残差の存在しないスキップモードを示す場合には、MMVDフラグを復号する必要がないために、符号化効率が低下しない。 With such a configuration, when a large number of skip flags indicate a skip mode in which there is no predicted residual when encoded at a high compression ratio, it is not necessary to decode the MMVD flag. The conversion efficiency does not decrease.

次に、図20及び図21を参照して、本発明の実施の形態のMMVD予測部30376における予測モードの選択処理の流れについて説明する。図20は、MMVD予測部30376における予測モードの選択処理の流れを示すフローチャートである。図21は、本実施形態に係る予測モードの選択処理を示すシンタックスを示す図であり、図20に示す処理の一部に対応するシンタックステーブルである。 Next, with reference to FIGS. 20 and 21, the flow of the prediction mode selection process in the MMVD prediction unit 30376 according to the embodiment of the present invention will be described. FIG. 20 is a flowchart showing the flow of the prediction mode selection process in the MMVD prediction unit 30376. FIG. 21 is a diagram showing a syntax showing a prediction mode selection process according to the present embodiment, and is a syntax table corresponding to a part of the process shown in FIG. 20.

図20のフローチャート及び図21のシンタックスでは、スキップモードでは、MMVD予測を行わず、マージモードの時のみにMMVD予測を選択可能とする。 In the flowchart of FIG. 20 and the syntax of FIG. 21, MMVD prediction is not performed in the skip mode, and MMVD prediction can be selected only in the merge mode.

図20に示すように、本実施形態では、パラメータ復号部302(予測パラメータ復号部)は、まず、スキップフラグ(図21におけるskip_flag)を復号する(S1501)。スキップフラグがスキップモードであることを示している場合(S1502でYES)、予測モードはスキップ
モードである(S1503)。スキップモードでは、図20に示すように、パラメータ復号部302は、マージインデックス(図21におけるmerge_idx)を復号する。
As shown in FIG. 20, in the present embodiment, the parameter decoding unit 302 (predicted parameter decoding unit) first decodes the skip flag (skip_flag in FIG. 21) (S1501). If the skip flag indicates skip mode (YES in S1502), the predictive mode is skip mode (S1503). In the skip mode, as shown in FIG. 20, the parameter decoding unit 302 decodes the merge index (merge_idx in FIG. 21).

スキップフラグがスキップモードであることを示していない場合(S1502でNO)、パラメータ復号部302は、マージフラグ(図21におけるmerge_flag)を復号する(S1504)。マージフラグがマージモードであることを示している場合(S1505でYES)、パラメータ復号部302は、MMVDフラグ(図21におけるmmvd_flag)を復号する(S1506)。MMVDフラグがMMVDモードであることを示していない場合(S1507でNO)、予測モードはマージモードである(S1508)。マージモードでは、図21に示すように、パラメータ復号部302は、マージインデックス(図21におけるmerge_idx)を復号する。MMVDフラグがMMVDモードであることを示している場合(S1507でYES)、予測モードはMMVDモードである(S1509)。MMVDモードでは、図21に示すように、パラメータ復号部302はbase_candidate_idx、distance_idx、及びdirection_idxを復号する。 If the skip flag does not indicate that it is in skip mode (NO in S1502), the parameter decoding unit 302 decodes the merge flag (merge_flag in FIG. 21) (S1504). When the merge flag indicates that the merge mode is set (YES in S1505), the parameter decoding unit 302 decodes the MMVD flag (mmvd_flag in FIG. 21) (S1506). If the MMVD flag does not indicate that it is in MMVD mode (NO in S1507), then the predictive mode is merge mode (S1508). In the merge mode, as shown in FIG. 21, the parameter decoding unit 302 decodes the merge index (merge_idx in FIG. 21). If the MMVD flag indicates that it is in MMVD mode (YES in S1507), then the predictive mode is MMVD mode (S1509). In the MMVD mode, as shown in FIG. 21, the parameter decoding unit 302 decodes base_candidate_idx, distance_idx, and direction_idx.

マージフラグがマージモードであることを示していない場合(S1505でNO)、予測モードはAMVPモードである(S1510)。パラメータ符号化部111は、同様の動作でシンタックスを符号化する。 If the merge flag does not indicate that it is in merge mode (NO in S1505), the predictive mode is AMVP mode (S1510). The parameter coding unit 111 encodes the syntax in the same manner.

尚、マージモードかつMMVDモードでない場合は、スキップモードとの違いは、予測画像生成において、予測残差を用いるか否かであるため、パラメータ復号部302は、図20及び図21の処理の後に、逆変換処理があるか否かを示すフラグをシンタックスとして復号する必要はない。一方、マージモードでなくMMVDモードである場合は、スキップモードとは異なる予測画像生成が可能であるため、パラメータ復号部302は、逆変換処理があるか否かを示すフラグをシンタックスとして復号する必要がある。 In the case of the merge mode and not the MMVD mode, the difference from the skip mode is whether or not the predicted residual is used in the predicted image generation. Therefore, the parameter decoding unit 302 performs after the processing of FIGS. 20 and 21. , It is not necessary to decode the flag indicating whether or not there is an inverse conversion process as a syntax. On the other hand, in the case of the MMVD mode instead of the merge mode, it is possible to generate a predicted image different from the skip mode, so that the parameter decoding unit 302 decodes the flag indicating whether or not there is an inverse conversion process as syntax. There is a need.

このような構成をとることで、高い圧縮率で符号化された時に、多数のスキップフラグが予測残差の存在しないスキップモードを示す場合にMMVDフラグを復号する必要がないために、符号化効率が低下しない。 With such a configuration, when encoded at a high compression rate, it is not necessary to decode the MMVD flag when a large number of skip flags indicate a skip mode in which there is no predicted residual, so that the coding efficiency is high. Does not decrease.

ループフィルタ305は、符号化ループ内に設けたフィルタで、ブロック歪やリンギング歪を除去し、画質を改善するフィルタである。ループフィルタ305は、加算部312が生成したCUの復号画像に対し、デブロッキングフィルタ、サンプル適応オフセット(SAO)、適応ループフィルタ(ALF)等のフィルタを施す。 The loop filter 305 is a filter provided in the coding loop, which removes block distortion and ringing distortion to improve image quality. The loop filter 305 applies filters such as a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the decoded image of the CU generated by the addition unit 312.

参照ピクチャメモリ306は、加算部312が生成したCUの復号画像を、対象ピクチャ及び対象CU毎に予め定めた位置に記憶する。 The reference picture memory 306 stores the decoded image of the CU generated by the addition unit 312 at a predetermined position for each target picture and the target CU.

予測パラメータメモリ307は、復号対象のCTUあるいはCU毎に予め定めた位置に予測パラメータを記憶する。具体的には、予測パラメータメモリ307は、パラメータ復号部302が復号したパラメータ及びエントロピー復号部301が復号した予測モードpredMode等を記憶する。 The prediction parameter memory 307 stores the prediction parameters at a predetermined position for each CTU or CU to be decoded. Specifically, the prediction parameter memory 307 stores the parameters decoded by the parameter decoding unit 302, the prediction mode predMode decoded by the entropy decoding unit 301, and the like.

予測画像生成部308には、予測モードpredMode、予測パラメータ等が入力される。また、予測画像生成部308は、参照ピクチャメモリ306から参照ピクチャを読み出す。予測画像生成部308は、予測モードpredModeが示す予測モードで、予測パラメータと読み出した参照ピクチャ(参照ピクチャブロック)を用いてブロックもしくはサブブロックの予測画像を生成する。ここで、参照ピクチャブロックとは、参照ピクチャ上の画素の集合(通常矩形であるのでブロックと呼ぶ)であり、予測画像を生成するために参照する領域である。 The prediction mode predMode, prediction parameters, and the like are input to the prediction image generation unit 308. Further, the prediction image generation unit 308 reads the reference picture from the reference picture memory 306. The prediction image generation unit 308 generates a prediction image of a block or a subblock by using the prediction parameter and the read reference picture (reference picture block) in the prediction mode indicated by the prediction mode predMode. Here, the reference picture block is a set of pixels on the reference picture (usually called a block because it is rectangular), and is an area to be referred to for generating a predicted image.

(インター予測画像生成部309)
予測モードpredModeがインター予測モードを示す場合、インター予測画像生成部309は、インター予測パラメータ復号部303から入力されたインター予測パラメータと読み出した参照ピクチャを用いてインター予測によりブロックもしくはサブブロックの予測画像を生成する。
(Inter-prediction image generation unit 309)
When the prediction mode predMode indicates the inter-prediction mode, the inter-prediction image generation unit 309 uses the inter-prediction parameter input from the inter-prediction parameter decoding unit 303 and the reference picture read out to perform inter-prediction to block or sub-block the prediction image. To generate.

図11は、本実施形態に係る予測画像生成部308に含まれるインター予測画像生成部309の構成を示す概略図である。インター予測画像生成部309は、動き補償部(予測画像生成装置)3091、合成部3095を含んで構成される。 FIG. 11 is a schematic view showing the configuration of the inter-prediction image generation unit 309 included in the prediction image generation unit 308 according to the present embodiment. The inter-prediction image generation unit 309 includes a motion compensation unit (prediction image generation device) 3091 and a composition unit 3095.

(動き補償)
動き補償部3091(補間画像生成部)は、インター予測パラメータ復号部303から入力された、インター予測パラメータ(予測リスト利用フラグpredFlagLX、参照ピクチャインデックスrefIdxLX、動きベクトルmvLX)に基づいて、参照ピクチャメモリ306から、参照ピクチャインデックスrefIdxLXで指定された参照ピクチャRefPicLXにおける、対象ブロックの位置を起点として動きベクトルmvLXだけシフトした位置にあるブロックを読み出すことによって補間画像(動き補償画像)を生成する。なお、動き補償部3091は、補間画像生成に用いる動きベクトルmvLXとして、DMVR部30375で変更されたrefMvLXを用いてもよい。ここで、動きベクトルmvLXの精度が整数精度でない場合には、動き補償フィルタと呼ばれる小数位置の画素を生成するためのフィルタを施して、補間画像を生成する。
(Motion compensation)
The motion compensation unit 3091 (interpolated image generation unit) is based on the inter-prediction parameters (prediction list usage flag predFlagLX, reference picture index refIdxLX, motion vector mvLX) input from the inter-prediction parameter decoding unit 303. From, an interpolated image (motion compensation image) is generated by reading out a block in the reference picture RefPicLX specified by the reference picture index refIdxLX, which is shifted by the motion vector mvLX from the position of the target block. The motion compensation unit 3091 may use the refMvLX modified by the DMVR unit 30375 as the motion vector mvLX used for generating the interpolated image. Here, when the accuracy of the motion vector mvLX is not integer accuracy, an interpolated image is generated by applying a filter called a motion compensation filter for generating pixels at decimal positions.

動き補償部3091は、まず、予測ブロック内座標(x,y)に対応する整数位置(xInt,yInt)および位相(xFrac,yFrac)を以下の式で導出する。 First, the motion compensation unit 3091 derives the integer position (xInt, yInt) and the phase (xFrac, yFrac) corresponding to the coordinates (x, y) in the prediction block by the following equations.

xInt = xPb+(mvLX[0]>>(log2(MVPREC)))+x
xFrac = mvLX[0]&(MVPREC-1)
yInt = yPb+(mvLX[1]>>(log2(MVPREC)))+y
yFrac = mvLX[1]&(MVPREC-1)
ここで、(xPb,yPb)は、bW*bHサイズのブロックの左上座標、x=0…bW-1、y=0…bH-1であり、MVPRECは、動きベクトルmvLXの精度(1/MVPREC画素精度)を示す。例えばMVPREC=16であってよい。
xInt = xPb + (mvLX [0] >> (log2 (MVPREC))) + x
xFrac = mvLX [0] & (MVPREC-1)
yInt = yPb + (mvLX [1] >> (log2 (MVPREC))) + y
yFrac = mvLX [1] & (MVPREC-1)
Here, (xPb, yPb) is the upper left coordinate of the block of bW * bH size, x = 0… bW-1, y = 0… bH-1, and MVPREC is the accuracy of the motion vector mvLX (1 / MVPREC). Pixel accuracy) is shown. For example, MVPREC = 16.

動き補償部3091は、参照ピクチャrefImgに補間フィルタを用いて水平補間処理を行うことで、一時的画像temp[][]を導出する。以下のΣはk=0..NTAP-1のkに関する和、shift1は値のレンジを調整する正規化パラメータ、offset1=1<<(shift1-1)である。 The motion compensation unit 3091 derives a temporary image temp [] [] by performing horizontal interpolation processing on the reference picture refImg using an interpolation filter. The following Σ is the sum of k = 0..NTAP-1 with respect to k, shift1 is the normalization parameter that adjusts the range of values, offset1 = 1 << (shift1-1).

temp[x][y] = (ΣmcFilter[xFrac][k]*refImg[xInt+k-NTAP/2+1][yInt]+offset1)>>shift1
続いて、動き補償部3091は、一時的画像temp[][]を垂直補間処理により、補間画像Pred[][]を導出する。以下のΣはk=0..NTAP-1のkに関する和、shift2は値のレンジを調整する正規化パラメータ、offset2=1<<(shift2-1)である。
temp [x] [y] = (ΣmcFilter [xFrac] [k] * refImg [xInt + k-NTAP / 2 + 1] [yInt] + offset1) >> shift1
Subsequently, the motion compensation unit 3091 derives the interpolated image Pred [] [] by vertically interpolating the temporary image temp [] []. The following Σ is the sum of k = 0..NTAP-1 with respect to k, shift2 is the normalization parameter that adjusts the range of values, offset2 = 1 << (shift2-1).

Pred[x][y] = (ΣmcFilter[yFrac][k]*temp[x][y+k-NTAP/2+1]+offset2)>>shift2
(合成部)
合成部3095は、動き補償部3091から入力される補間画像、インター予測パラメータ復号部303から入力されるインター予測パラメータ、及び、イントラ予測画像生成部310から入力されるイントラ画像を参照して、予測画像を生成し、生成した予測画像を加算部312に出力する。
Pred [x] [y] = (ΣmcFilter [yFrac] [k] * temp [x] [y + k-NTAP / 2 + 1] + offset2) >> shift2
(Synthesis part)
The compositing unit 3095 makes a prediction by referring to the interpolated image input from the motion compensation unit 3091, the inter-prediction parameter input from the inter-prediction parameter decoding unit 303, and the intra-image input from the intra-prediction image generation unit 310. An image is generated, and the generated predicted image is output to the addition unit 312.

合成部3095は、Combined intra/inter合成部30951、Triangle合成部30952、OBMC部30953、BIO部30954を備えている。 The compositing unit 3095 includes a combined intra / inter compositing unit 30951, a Triangle compositing unit 30952, an OBMC unit 30953, and a BIO unit 30954.

(Combined intra/inter合成処理)
Combined intra/inter合成部30951は、AMVPにおける単方向予測、スキップモード、マージモード、及びイントラ予測を複合的に用いることによって予測画像を生成する。
(Combined intra / inter compositing process)
The Combined intra / inter combine unit 30951 generates a prediction image by using the unidirectional prediction, the skip mode, the merge mode, and the intra prediction in AMVP in combination.

(Triangle合成処理)
Triangle合成部30952は、上述したTriangle予測を用いた予測画像を生成する。
(Triangle composition process)
The Triangle compositing unit 30952 generates a prediction image using the above-mentioned Triangle prediction.

(OBMC処理)
OBMC部30953は、OBMC(Overlapped block motion compensation)処理を用いて予測画像を生成する。OBMC処理には以下の処理が含まれる。
・対象サブブロックに付加されたインター予測パラメータを用いて生成される補間画像(PU補間画像)と、対象サブブロックの隣接サブブロックの動きパラメータを用いて生成される補間画像(OBMC補間画像)とを用いて、対象サブブロックの補間画像(動き補償画像)を生成する。
・OBMC補間画像とPU補間画像とを加重平均することにより、予測画像を生成する。
(OBMC processing)
The OBMC unit 30953 generates a predicted image using OBMC (Overlapped block motion compensation) processing. The OBMC processing includes the following processing.
-An interpolated image (PU interpolated image) generated using the inter-prediction parameters added to the target subblock and an interpolated image (OBMC interpolated image) generated using the motion parameters of the adjacent subblocks of the target subblock. Is used to generate an interpolated image (motion compensation image) of the target subblock.
-A predicted image is generated by weighted averaging the OBMC interpolated image and the PU interpolated image.

(BIO処理)
BIO部30954は、BIO(Bi-directional optical flow;双予測勾配変化)処理を行うことによって、予測画像を生成する。BIO処理では、動き補償画像PredL0及びPredL1と、勾配補正項とを参照して予測画像を生成する。BIO部30954は、後述する重み予測を行うことによって予測画像を生成する構成としてもよい。
(BIO processing)
The BIO unit 30954 generates a predicted image by performing BIO (Bi-directional optical flow; bi-predicted gradient change) processing. In the BIO processing, a prediction image is generated by referring to the motion compensation images PredL0 and PredL1 and the gradient correction term. The BIO unit 30954 may be configured to generate a predicted image by performing weight prediction described later.

(重み予測)
重み予測では、動き補償画像PredLXに重み係数を乗算することによりブロックの予測画像を生成する。予測リスト利用フラグの一方(predFlagL0もしくはpredFlagL1)が1(単予測)、かつ、重み予測を用いない場合、動き補償画像PredLX(LXはL0もしくはL1)を画素ビット数bitDepthに合わせる以下の式の処理を行う。
(Weight prediction)
In weight prediction, a block prediction image is generated by multiplying the motion compensation image PredLX by a weighting coefficient. When one of the prediction list usage flags (predFlagL0 or predFlagL1) is 1 (single prediction) and weight prediction is not used, the motion compensation image PredLX (LX is L0 or L1) is adjusted to the number of pixel bits bitDepth. I do.

Pred[x][y] = Clip3(0,(1<<bitDepth)-1,(PredLX[x][y]+offset1)>>shift1)
ここで、shift1=14-bitDepth、offset1=1<<(shift1-1)である。
また、参照リスト利用フラグの両者(predFlagL0とpredFlagL1)が1(双予測BiPred)、かつ、重み予測を用いない場合、動き補償画像PredL0、PredL1を平均し画素ビット数に合わせる以下の式の処理を行う。
Pred [x] [y] = Clip3 (0, (1 << bitDepth) -1, (PredLX [x] [y] + offset1) >> shift1)
Here, shift1 = 14-bitDepth and offset1 = 1 << (shift1-1).
If both of the reference list usage flags (predFlagL0 and predFlagL1) are 1 (bipred BiPred) and weight prediction is not used, the motion compensation images PredL0 and PredL1 are averaged to match the number of pixel bits. Do.

Pred[x][y] = Clip3(0,(1<<bitDepth)-1,(PredL0[x][y]+PredL1[x][y]+offset2)>>shift2)
ここで、shift2=15-bitDepth、offset2=1<<(shift2-1)である。
Pred [x] [y] = Clip3 (0, (1 << bitDepth) -1, (PredL0 [x] [y] + PredL1 [x] [y] + offset2) >> shift2)
Here, shift2 = 15-bitDepth, offset2 = 1 << (shift2-1).

さらに、単予測、かつ、重み予測を行う場合、重み予測部3094は重み予測係数w0とオフセットo0を符号化データから導出し、以下の式の処理を行う。 Further, in the case of simple prediction and weight prediction, the weight prediction unit 3094 derives the weight prediction coefficient w0 and the offset o0 from the coded data, and performs the processing of the following equation.

Pred[x][y] = Clip3(0,(1<<bitDepth)-1,((PredLX[x][y]*w0+2^(log2WD-1))>>log2WD)+o0)
ここで、log2WDは所定のシフト量を示す変数である。
Pred [x] [y] = Clip3 (0, (1 << bitDepth) -1, ((PredLX [x] [y] * w0 + 2 ^ (log2WD-1)) >> log2WD) + o0)
Here, log2WD is a variable indicating a predetermined shift amount.

さらに、双予測BiPred、かつ、重み予測を行う場合、重み予測部3094は重み予測係数w0、w1、o0、o1を符号化データから導出し、以下の式の処理を行う。 Further, in the case of double prediction BiPred and weight prediction, the weight prediction unit 3094 derives the weight prediction coefficients w0, w1, o0, and o1 from the coded data, and performs the processing of the following equation.

Pred[x][y] = Clip3(0,(1<<bitDepth)-1,(PredL0[x][y]*w0+PredL1[x][y]*w1+((o0+o
1+1)<<log2WD))>>(log2WD+1))
そして、生成したブロックの予測画像を加算部312に出力する。
Pred [x] [y] = Clip3 (0, (1 << bitDepth) -1, (PredL0 [x] [y] * w0 + PredL1 [x] [y] * w1 + ((o0 + o)
1 + 1) << log2WD)) >> (log2WD + 1))
Then, the predicted image of the generated block is output to the addition unit 312.

逆量子化・逆変換部311は、エントロピー復号部301から入力された量子化変換係数を逆量子化して変換係数を求める。この量子化変換係数は、符号化処理において、予測誤差に対してDCT(Discrete Cosine Transform、離散コサイン変換)、DST(Discrete Sine Transform、離散サイン変換)等の周波数変換を行い量子化して得られる係数である。逆量子化・逆変換部311は、求めた変換係数について逆DCT、逆DST等の逆周波数変換を行い、予測誤差を算出する。逆量子化・逆変換部311は予測誤差を加算部312に出力する。逆量子化・逆変換部311は、skip_flagが1の場合もしくはcu_cbpが0の場合に予測誤差を全て0と設定する。 The inverse quantization / inverse conversion unit 311 inversely quantizes the quantization conversion coefficient input from the entropy decoding unit 301 to obtain the conversion coefficient. This quantization transform coefficient is a coefficient obtained by performing frequency conversion such as DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform) on the prediction error in the coding process. Is. The inverse quantization / inverse transform unit 311 performs inverse frequency conversion such as inverse DCT and inverse DST on the obtained conversion coefficient, and calculates a prediction error. The inverse quantization / inverse conversion unit 311 outputs the prediction error to the addition unit 312. The inverse quantization / inverse conversion unit 311 sets all prediction errors to 0 when skip_flag is 1 or cu_cbp is 0.

加算部312は、予測画像生成部308から入力されたブロックの予測画像と逆量子化・逆変換部311から入力された予測誤差を画素毎に加算して、ブロックの復号画像を生成する。加算部312はブロックの復号画像を参照ピクチャメモリ306に記憶し、また、ループフィルタ305に出力する。 The addition unit 312 adds the prediction image of the block input from the prediction image generation unit 308 and the prediction error input from the inverse quantization / inverse conversion unit 311 for each pixel to generate a decoded image of the block. The addition unit 312 stores the decoded image of the block in the reference picture memory 306, and outputs the decoded image to the loop filter 305.

(動画像符号化装置の構成)
次に、本実施形態に係る動画像符号化装置11の構成について説明する。図12は、本実施形態に係る動画像符号化装置11の構成を示すブロック図である。動画像符号化装置11は、予測画像生成部101、減算部102、変換・量子化部103、逆量子化・逆変換部105、加算部106、ループフィルタ107、予測パラメータメモリ(予測パラメータ記憶部、フレームメモリ)108、参照ピクチャメモリ(参照画像記憶部、フレームメモリ)109、符号化パラメータ決定部110、パラメータ符号化部111、エントロピー符号化部104を含んで構成される。
(Configuration of moving image encoding device)
Next, the configuration of the moving image coding device 11 according to the present embodiment will be described. FIG. 12 is a block diagram showing a configuration of the moving image coding device 11 according to the present embodiment. The moving image coding device 11 includes a prediction image generation unit 101, a subtraction unit 102, a conversion / quantization unit 103, an inverse quantization / inverse conversion unit 105, an addition unit 106, a loop filter 107, and a prediction parameter memory (prediction parameter storage unit). , Frame memory) 108, reference picture memory (reference image storage unit, frame memory) 109, coding parameter determination unit 110, parameter coding unit 111, and entropy coding unit 104.

予測画像生成部101は画像Tの各ピクチャを分割した領域であるCU毎に予測画像を生成する。予測画像生成部101は既に説明した予測画像生成部308と同じ動作であり、説明を省略する。 The prediction image generation unit 101 generates a prediction image for each CU, which is a region in which each picture of the image T is divided. The prediction image generation unit 101 has the same operation as the prediction image generation unit 308 described above, and the description thereof will be omitted.

減算部102は、予測画像生成部101から入力されたブロックの予測画像の画素値を、画像Tの画素値から減算して予測誤差を生成する。減算部102は予測誤差を変換・量子化部103に出力する。 The subtraction unit 102 subtracts the pixel value of the predicted image of the block input from the prediction image generation unit 101 from the pixel value of the image T to generate a prediction error. The subtraction unit 102 outputs the prediction error to the conversion / quantization unit 103.

変換・量子化部103は、減算部102から入力された予測誤差に対し、周波数変換によって変換係数を算出し、量子化によって量子化変換係数を導出する。変換・量子化部103は、量子化変換係数をエントロピー符号化部104及び逆量子化・逆変換部105に出力する。 The conversion / quantization unit 103 calculates the conversion coefficient by frequency conversion with respect to the prediction error input from the subtraction unit 102, and derives the quantization conversion coefficient by quantization. The conversion / quantization unit 103 outputs the quantization conversion coefficient to the entropy coding unit 104 and the inverse quantization / inverse conversion unit 105.

逆量子化・逆変換部105は、動画像復号装置31における逆量子化・逆変換部311(図7)と同じであり、説明を省略する。算出した予測誤差は加算部106に出力される。 The inverse quantization / inverse conversion unit 105 is the same as the inverse quantization / inverse conversion unit 311 (FIG. 7) in the moving image decoding device 31, and the description thereof will be omitted. The calculated prediction error is output to the addition unit 106.

エントロピー符号化部104には、変換・量子化部103から量子化変換係数が入力され、パラメータ符号化部111から符号化パラメータが入力される。符号化パラメータには、例えば、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、差分ベクトルmvdLX、動きベクトル精度モードamvr_mode、予測モードpredMode、及びマージインデックスmerge_idx等の符号がある。 A quantization conversion coefficient is input to the entropy coding unit 104 from the conversion / quantization unit 103, and a coding parameter is input from the parameter coding unit 111. Coding parameters include, for example, reference picture index refIdxLX, prediction vector index mvp_LX_idx, difference vector mvdLX, motion vector precision mode amvr_mode, prediction mode predMode, and merge index merge_idx.

エントロピー符号化部104は、分割情報、予測パラメータ、量子化変換係数等をエントロピー符号化して符号化ストリームTeを生成し、出力する。 The entropy coding unit 104 entropy-encodes the division information, prediction parameters, quantization conversion coefficient, etc. to generate a coded stream Te and outputs it.

パラメータ符号化部111は、図示しないヘッダ符号化部1110、CT情報符号化部1111、CU
符号化部1112(予測モード符号化部)、およびパラメータ符号化部112を備えている。CU符号化部1112はさらにTU符号化部1114を備えている。
The parameter coding unit 111 includes a header coding unit 1110 (not shown), a CT information coding unit 1111 and a CU.
It includes a coding unit 1112 (prediction mode coding unit) and a parameter coding unit 112. The CU coding unit 1112 further includes a TU coding unit 1114.

以下、各モジュールの概略動作を説明する。パラメータ符号化部111はヘッダ情報、分割情報、予測情報、量子化変換係数等のパラメータの符号化処理を行う。 The outline operation of each module will be described below. The parameter coding unit 111 performs parameter coding processing such as header information, division information, prediction information, and quantization conversion coefficient.

CT情報符号化部1111は、符号化データからQT、MT(BT、TT)分割情報等を符号化する。 The CT information coding unit 1111 encodes QT, MT (BT, TT) division information and the like from the coded data.

CU符号化部1112はCU情報、予測情報、TU分割フラグsplit_transform_flag、CU残差フラグcbf_cb、cbf_cr、cbf_luma等を符号化する。 The CU coding unit 1112 encodes CU information, prediction information, TU split flag split_transform_flag, CU residual flags cbf_cb, cbf_cr, cbf_luma and the like.

TU符号化部1114は、TUに予測誤差が含まれている場合に、QP更新情報(量子化補正値)と量子化予測誤差(residual_coding)を符号化する。 The TU coding unit 1114 encodes the QP update information (quantization correction value) and the quantization prediction error (residual_coding) when the TU includes a prediction error.

CT情報符号化部1111、CU符号化部1112は、インター予測パラメータ(予測モードpredMode、マージフラグmerge_flag、マージインデックスmerge_idx、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、差分ベクトルmvdLX)、イントラ予測パラメータ(prev_intra_luma_pred_flag、mpm_idx、rem_selected_mode_flag、rem_selected_mode、rem_non_selected_mode、)、量子化変換係数等のシンタックス要素をエントロピー符号化部104に出力する。 The CT information coding unit 1111 and the CU coding unit 1112 include inter prediction parameters (prediction mode predMode, merge flag merge_flag, merge index merge_idx, inter prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction vector index mvp_LX_idx, difference vector mvdLX). The vector elements such as the intra prediction parameters (prev_intra_luma_pred_flag, mpm_idx, rem_selected_mode_flag, rem_selected_mode, rem_non_selected_mode,) and the quantization conversion coefficient are output to the entropy encoding unit 104.

(パラメータ符号化部の構成)
パラメータ符号化部112は、符号化パラメータ決定部110から入力された予測パラメータに基づいて、インター予測パラメータを導出する。パラメータ符号化部112は、インター予測パラメータ復号部303がインター予測パラメータを導出する構成と一部同一の構成を含む。
(Structure of parameter coding part)
The parameter coding unit 112 derives an inter-prediction parameter based on the prediction parameter input from the coding parameter determination unit 110. The parameter coding unit 112 includes a configuration that is partially the same as the configuration in which the inter prediction parameter decoding unit 303 derives the inter prediction parameter.

図13は、パラメータ符号化部112の構成を示す概略図である。パラメータ符号化部112の構成について説明する。図13に示すように、パラメータ符号化部112は、パラメータ符号化制御部1121、マージ予測部30374、サブブロック予測部(アフィン予測部)30372、DMVR部30375、MMVD予測部30376、Triangle予測部30377、AMVP予測パラメータ導出部3032、減算部1123を含んで構成される。マージ予測部30374は、マージ予測パラメータ導出部3036を備えている。パラメータ符号化制御部1121は、マージインデックス導出部11211とベクトル候補インデックス導出部11212を含む。また、パラメータ符号化制御部1121は、マージインデックス導出部11211でmerge_idx、affine_flag、base_candidate_idx、distance_idx、direction_idx等を導出し、ベクトル候補インデックス導出部11212でmvpLX等を導出する。マージ予測パラメータ導出部3036、AMVP予測パラメータ導出部3032、アフィン予測部30372、MMVD予測部30376、Triangle予測部30377を総称して動きベクトル導出部(動きベクトル導出装置)と称してもよい。パラメータ符号化部112は、動きベクトルmvLX、参照ピクチャインデックスrefIdxLX、インター予測識別子inter_pred_idc、あるいはこれらを示す情報を予測画像生成部101に出力する。またパラメータ符号化部112は、merge_flag、skip_flag、merge_idx、inter_pred_idc、refIdxLX、mvp_lX_idx、mvdLX、amvr_mode、affine_flagをエントロピー符号化部104に出力する。 FIG. 13 is a schematic view showing the configuration of the parameter coding unit 112. The configuration of the parameter coding unit 112 will be described. As shown in FIG. 13, the parameter coding unit 112 includes a parameter coding control unit 1121, a merge prediction unit 30374, a subblock prediction unit (affin prediction unit) 30372, a DMVR unit 30375, an MMVD prediction unit 30376, and a Triangle prediction unit 30377. , AMVP Prediction Parameter Derivation Unit 3032, Subtraction Unit 1123. The merge prediction unit 30374 includes a merge prediction parameter derivation unit 3036. The parameter coding control unit 1121 includes a merge index derivation unit 11211 and a vector candidate index derivation unit 11212. Further, the parameter coding control unit 1121 derives merge_idx, affine_flag, base_candidate_idx, distance_idx, direction_idx, etc. in the merge index derivation unit 11211, and derives mvpLX, etc. in the vector candidate index derivation unit 11212. The merge prediction parameter derivation unit 3036, the AMVP prediction parameter derivation unit 3032, the affine prediction unit 30372, the MMVD prediction unit 30376, and the Triangle prediction unit 30377 may be collectively referred to as a motion vector derivation unit (motion vector derivation device). The parameter coding unit 112 outputs the motion vector mvLX, the reference picture index refIdxLX, the inter-prediction identifier inter_pred_idc, or the information indicating these to the prediction image generation unit 101. Further, the parameter coding unit 112 outputs merge_flag, skip_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_lX_idx, mvdLX, amvr_mode, and affine_flag to the entropy coding unit 104.

パラメータ符号化制御部1121は差分ベクトルを表すパラメータ(base_candidate_idx、distance_idx、direction_idx等)を導出し、MMVD予測部30376に出力する。図15を参照してパラメータ符号化制御部1121におけるの差分ベクトル導出を説明する。図の中央の黒丸が予測ベクトルmvpLXの指す位置であり、この位置を中心にして、4(上、下、左、右)方向に各々8つの探索距離を探索する。mvpLXはマージ候補リストの先頭と2番目の候補の動きベクトルであり、各々に対し探索を実施する。マージ候補リストの予測ベクトルが
2つ(リストの1番目と2番目)あり、探索距離が8、探索方向が4であるので、mvdLXには64通りの候補がある。探索した中で最もコストの小さいmvdLXを、base_candidate_idx、distance_idxおよびdirection_idxで表す。
The parameter coding control unit 1121 derives the parameters representing the difference vector (base_candidate_idx, distance_idx, direction_idx, etc.) and outputs them to the MMVD prediction unit 30376. The difference vector derivation in the parameter coding control unit 1121 will be described with reference to FIG. The black circle in the center of the figure is the position pointed to by the prediction vector mvpLX, and eight search distances are searched in each of the four (up, down, left, right) directions around this position. mvpLX is the motion vector of the first and second candidates in the merge candidate list, and searches for each. Since there are two prediction vectors in the merge candidate list (first and second in the list), the search distance is 8, and the search direction is 4, there are 64 candidates in mvdLX. The lowest cost mvdLX searched is represented by base_candidate_idx, distance_idx and direction_idx.

このようにMMVDモードは、予測ベクトルを中心として限られた候補点を探索し、適切な動きベクトルを導出するモードである。 In this way, the MMVD mode is a mode in which a limited candidate point is searched around the prediction vector and an appropriate motion vector is derived.

マージインデックス導出部11211は、マージインデックスmerge_idxを導出し、マージ予測パラメータ導出部3036(マージ予測部)に出力する。MMVDモードにおいては、マージインデックス導出部11211は、マージインデックスmerge_idxの値をbase_candidate_idxの値と同じ値に設定する。ベクトル候補インデックス導出部11212は予測ベクトルインデックスmvp_lX_idxを導出する。 The merge index derivation unit 11211 derives the merge index merge_idx and outputs it to the merge prediction parameter derivation unit 3036 (merge prediction unit). In the MMVD mode, the merge index derivation unit 11211 sets the value of the merge index merge_idx to the same value as the value of base_candidate_idx. The vector candidate index derivation unit 11212 derives the prediction vector index mvp_lX_idx.

マージ予測パラメータ導出部3036は、マージインデックスmerge_idxに基づいて、インター予測パラメータを導出する。 The merge prediction parameter derivation unit 3036 derives the inter prediction parameter based on the merge index merge_idx.

AMVP予測パラメータ導出部3032は動きベクトルmvLXに基づいて予測ベクトルmvpLXを導出する。AMVP予測パラメータ導出部3032は予測ベクトルmvpLXを減算部1123に出力する。なお、参照ピクチャインデックスrefIdxLX及び予測ベクトルインデックスmvp_lX_idxは、エントロピー符号化部104に出力される。 The AMVP prediction parameter derivation unit 3032 derives the prediction vector mvpLX based on the motion vector mvLX. The AMVP prediction parameter derivation unit 3032 outputs the prediction vector mvpLX to the subtraction unit 1123. The reference picture index refIdxLX and the prediction vector index mvp_lX_idx are output to the entropy encoding unit 104.

アフィン予測部30372は、サブブロックのインター予測パラメータ(アフィン予測パラメータ)を導出する。 The affine prediction unit 30372 derives the inter-prediction parameter (affine prediction parameter) of the subblock.

減算部1123は、符号化パラメータ決定部110から入力された動きベクトルmvLXから、AMVP予測パラメータ導出部3032の出力である予測ベクトルmvpLXを減算して差分ベクトルmvdLXを生成する。差分ベクトルmvdLXはエントロピー符号化部104に出力される。 The subtraction unit 1123 generates the difference vector mvdLX by subtracting the prediction vector mvpLX, which is the output of the AMVP prediction parameter derivation unit 3032, from the motion vector mvLX input from the coding parameter determination unit 110. The difference vector mvdLX is output to the entropy encoding unit 104.

加算部106は、予測画像生成部101から入力されたブロックの予測画像の画素値と逆量子化・逆変換部105から入力された予測誤差を画素毎に加算して復号画像を生成する。加算部106は生成した復号画像を参照ピクチャメモリ109に記憶する。 The addition unit 106 generates a decoded image by adding the pixel value of the prediction image of the block input from the prediction image generation unit 101 and the prediction error input from the inverse quantization / inverse conversion unit 105 for each pixel. The addition unit 106 stores the generated decoded image in the reference picture memory 109.

ループフィルタ107は加算部106が生成した復号画像に対し、デブロッキングフィルタ、SAO、ALFを施す。なお、ループフィルタ107は、必ずしも上記3種類のフィルタを含まなくてもよく、例えばデブロッキングフィルタのみの構成であってもよい。 The loop filter 107 applies a deblocking filter, SAO, and ALF to the decoded image generated by the addition unit 106. The loop filter 107 does not necessarily have to include the above three types of filters, and may have, for example, a configuration of only a deblocking filter.

予測パラメータメモリ108は、符号化パラメータ決定部110が生成した予測パラメータを、対象ピクチャ及びCU毎に予め定めた位置に記憶する。 The prediction parameter memory 108 stores the prediction parameters generated by the coding parameter determination unit 110 at predetermined positions for each target picture and CU.

参照ピクチャメモリ109は、ループフィルタ107が生成した復号画像を対象ピクチャ及びCU毎に予め定めた位置に記憶する。 The reference picture memory 109 stores the decoded image generated by the loop filter 107 at a predetermined position for each target picture and CU.

符号化パラメータ決定部110は、符号化パラメータの複数のセットのうち、1つのセットを選択する。符号化パラメータとは、上述したQT、BTあるいはTT分割情報、予測パラメータ、あるいはこれらに関連して生成される符号化の対象となるパラメータである。予測画像生成部101は、これらの符号化パラメータを用いて予測画像を生成する。 The coding parameter determination unit 110 selects one set from the plurality of sets of coding parameters. The coding parameter is the above-mentioned QT, BT or TT division information, prediction parameter, or a parameter to be coded generated in connection with these. The prediction image generation unit 101 generates a prediction image using these coding parameters.

符号化パラメータ決定部110は、複数のセットの各々について情報量の大きさと符号化誤差を示すRDコスト値を算出する。符号化パラメータ決定部110は、算出したコスト値が最小となる符号化パラメータのセットを選択する。これにより、エントロピー符号化部10
4は、選択した符号化パラメータのセットを符号化ストリームTeとして出力する。符号化パラメータ決定部110は決定した符号化パラメータを予測パラメータメモリ108に記憶する。
The coding parameter determination unit 110 calculates an RD cost value indicating the magnitude of the amount of information and the coding error for each of the plurality of sets. The coding parameter determination unit 110 selects the set of coding parameters that minimizes the calculated cost value. As a result, the entropy encoding unit 10
4 outputs the selected set of coding parameters as a coding stream Te. The coding parameter determination unit 110 stores the determined coding parameter in the prediction parameter memory 108.

なお、上述した実施形態における動画像符号化装置11、動画像復号装置31の一部、例えば、エントロピー復号部301、パラメータ復号部302、ループフィルタ305、予測画像生成部308、逆量子化・逆変換部311、加算部312、予測画像生成部101、減算部102、変換・量子化部103、エントロピー符号化部104、逆量子化・逆変換部105、ループフィルタ107、符号化パラメータ決定部110、パラメータ符号化部111をコンピュータで実現するようにしても良い。その場合、この制御機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することによって実現しても良い。なお、ここでいう「コンピュータシステム」とは、動画像符号化装置11、動画像復号装置31のいずれかに内蔵されたコンピュータシステムであって、OSや周辺機器等のハードウェアを含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD-ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、短時間、動的にプログラムを保持するもの、その場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリのように、一定時間プログラムを保持しているものも含んでも良い。また上記プログラムは、前述した機能の一部を実現するためのものであっても良く、さらに前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるものであっても良い。 A part of the moving image coding device 11 and the moving image decoding device 31 in the above-described embodiment, for example, the entropy decoding unit 301, the parameter decoding unit 302, the loop filter 305, the predicted image generation unit 308, and the inverse quantization / reverse. Conversion unit 311, Addition unit 312, Prediction image generation unit 101, Subtraction unit 102, Conversion / quantization unit 103, Entropy coding unit 104, Inverse quantization / inverse conversion unit 105, Loop filter 107, Coding parameter determination unit 110 , The parameter coding unit 111 may be realized by a computer. In that case, the program for realizing this control function may be recorded on a computer-readable recording medium, and the program recorded on the recording medium may be read by the computer system and executed. The "computer system" referred to here is a computer system built into either the moving image coding device 11 or the moving image decoding device 31, and includes hardware such as an OS and peripheral devices. Further, the "computer-readable recording medium" refers to a portable medium such as a flexible disk, a magneto-optical disk, a ROM, or a CD-ROM, or a storage device such as a hard disk built in a computer system. Furthermore, a "computer-readable recording medium" is a device that dynamically holds a program for a short period of time, such as a communication line when a program is transmitted via a network such as the Internet or a communication line such as a telephone line. In that case, a program may be held for a certain period of time, such as a volatile memory inside a computer system serving as a server or a client. Further, the above-mentioned program may be a program for realizing a part of the above-mentioned functions, and may be a program for realizing the above-mentioned functions in combination with a program already recorded in the computer system.

また、上述した実施形態における動画像符号化装置11、動画像復号装置31の一部、または全部を、LSI(Large Scale Integration)等の集積回路として実現しても良い。動画像符号化装置11、動画像復号装置31の各機能ブロックは個別にプロセッサ化しても良いし、一部、または全部を集積してプロセッサ化しても良い。また、集積回路化の手法はLSIに限らず専用回路、または汎用プロセッサで実現しても良い。また、半導体技術の進歩によりLSIに代替する集積回路化の技術が出現した場合、当該技術による集積回路を用いても良い。 Further, a part or all of the moving image coding device 11 and the moving image decoding device 31 in the above-described embodiment may be realized as an integrated circuit such as an LSI (Large Scale Integration). Each functional block of the moving image coding device 11 and the moving image decoding device 31 may be made into a processor individually, or a part or all of them may be integrated into a processor. Further, the method of making an integrated circuit is not limited to LSI, and may be realized by a dedicated circuit or a general-purpose processor. Further, when an integrated circuit technology that replaces an LSI appears due to advances in semiconductor technology, an integrated circuit based on this technology may be used.

以上、図面を参照してこの発明の一実施形態について詳しく説明してきたが、具体的な構成は上述のものに限られることはなく、この発明の要旨を逸脱しない範囲内において様々な設計変更等をすることが可能である。 Although one embodiment of the present invention has been described in detail with reference to the drawings, the specific configuration is not limited to the above, and various design changes and the like are made without departing from the gist of the present invention. It is possible to do.

〔応用例〕
上述した動画像符号化装置11及び動画像復号装置31は、動画像の送信、受信、記録、再生を行う各種装置に搭載して利用することができる。なお、動画像は、カメラ等により撮像された自然動画像であってもよいし、コンピュータ等により生成された人工動画像(CGおよびGUIを含む)であってもよい。
[Application example]
The moving image coding device 11 and the moving image decoding device 31 described above can be mounted on and used in various devices for transmitting, receiving, recording, and reproducing moving images. The moving image may be a natural moving image captured by a camera or the like, or an artificial moving image (including CG and GUI) generated by a computer or the like.

まず、上述した動画像符号化装置11及び動画像復号装置31を、動画像の送信及び受信に利用できることを、図2を参照して説明する。 First, it will be described with reference to FIG. 2 that the moving image coding device 11 and the moving image decoding device 31 described above can be used for transmitting and receiving moving images.

図2(a)は、動画像符号化装置11を搭載した送信装置PROD_Aの構成を示したブロック図である。図に示すように、送信装置PROD_Aは、動画像を符号化することによって符号化データを得る符号化部PROD_A1と、符号化部PROD_A1が得た符号化データで搬送波を変調することによって変調信号を得る変調部PROD_A2と、変調部PROD_A2が得た変調信号を送信する送信部PROD_A3と、を備えている。上述した動画像符号化装置11は、この符号化部PROD_A1と
して利用される。
FIG. 2A is a block diagram showing the configuration of the transmission device PROD_A equipped with the moving image coding device 11. As shown in the figure, the transmitter PROD_A has a coding unit PROD_A1 that obtains encoded data by encoding a moving image, and a modulation signal by modulating a carrier wave with the coded data obtained by the coding unit PROD_A1. It includes a modulation unit PROD_A2 to obtain and a transmission unit PROD_A3 to transmit the modulation signal obtained by the modulation unit PROD_A2. The moving image coding device 11 described above is used as the coding unit PROD_A1.

送信装置PROD_Aは、符号化部PROD_A1に入力する動画像の入力源として、動画像を撮像するカメラPROD_A4、動画像を記録した記録媒体PROD_A5、動画像を外部から入力するための入力端子PROD_A6、及び、画像を生成または加工する画像処理部A7を更に備えていてもよい。図においては、これら全てを送信装置PROD_Aが備えた構成を例示しているが、一部を省略しても構わない。 The transmitter PROD_A has a camera PROD_A4 for capturing a moving image, a recording medium PROD_A5 for recording a moving image, an input terminal PROD_A6 for inputting a moving image from the outside, and a moving image input source for inputting to the coding unit PROD_A1. , An image processing unit A7 for generating or processing an image may be further provided. In the figure, the configuration in which the transmitter PROD_A is provided with all of these is illustrated, but some of them may be omitted.

なお、記録媒体PROD_A5は、符号化されていない動画像を記録したものであってもよいし、伝送用の符号化方式とは異なる記録用の符号化方式で符号化された動画像を記録したものであってもよい。後者の場合、記録媒体PROD_A5と符号化部PROD_A1との間に、記録媒体PROD_A5から読み出した符号化データを記録用の符号化方式に従って復号する復号部(不図示)を介在させるとよい。 The recording medium PROD_A5 may be a recording of an unencoded moving image, or a moving image encoded by a recording coding method different from the transmission coding method. It may be a thing. In the latter case, a decoding unit (not shown) that decodes the coded data read from the recording medium PROD_A5 according to the recording coding method may be interposed between the recording medium PROD_A5 and the coding unit PROD_A1.

図2(b)は、動画像復号装置31を搭載した受信装置PROD_Bの構成を示したブロック図である。図に示すように、受信装置PROD_Bは、変調信号を受信する受信部PROD_B1と、受信部PROD_B1が受信した変調信号を復調することによって符号化データを得る復調部PROD_B2と、復調部PROD_B2が得た符号化データを復号することによって動画像を得る復号部PROD_B3と、を備えている。上述した動画像復号装置31は、この復号部PROD_B3として利用される。 FIG. 2B is a block diagram showing the configuration of the receiving device PROD_B equipped with the moving image decoding device 31. As shown in the figure, the receiving device PROD_B is obtained by a receiving unit PROD_B1 that receives a modulated signal, a demodulating unit PROD_B2 that obtains coded data by demodulating the modulated signal received by the receiving unit PROD_B1, and a demodulating unit PROD_B2. It includes a decoding unit PROD_B3 that obtains a moving image by decoding the coded data. The moving image decoding device 31 described above is used as the decoding unit PROD_B3.

受信装置PROD_Bは、復号部PROD_B3が出力する動画像の出力先として、動画像を表示するディスプレイPROD_B4、動画像を記録するための記録媒体PROD_B5、及び、動画像を外部に出力するための出力端子PROD_B6を更に備えていてもよい。図においては、これら全てを受信装置PROD_Bが備えた構成を例示しているが、一部を省略しても構わない。 The receiving device PROD_B has a display PROD_B4 for displaying the moving image, a recording medium PROD_B5 for recording the moving image, and an output terminal for outputting the moving image to the outside as the output destination of the moving image output by the decoding unit PROD_B3. It may also have PROD_B6. In the figure, the configuration in which the receiving device PROD_B is provided with all of these is illustrated, but some of them may be omitted.

なお、記録媒体PROD_B5は、符号化されていない動画像を記録するためのものであってもよいし、伝送用の符号化方式とは異なる記録用の符号化方式で符号化されたものであってもよい。後者の場合、復号部PROD_B3と記録媒体PROD_B5との間に、復号部PROD_B3から取得した動画像を記録用の符号化方式に従って符号化する符号化部(不図示)を介在させるとよい。 The recording medium PROD_B5 may be used for recording an unencoded moving image, or may be encoded by a recording encoding method different from the transmission coding method. You may. In the latter case, a coding unit (not shown) that encodes the moving image acquired from the decoding unit PROD_B3 according to the recording coding method may be interposed between the decoding unit PROD_B3 and the recording medium PROD_B5.

なお、変調信号を伝送する伝送媒体は、無線であってもよいし、有線であってもよい。また、変調信号を伝送する伝送態様は、放送(ここでは、送信先が予め特定されていない送信態様を指す)であってもよいし、通信(ここでは、送信先が予め特定されている送信態様を指す)であってもよい。すなわち、変調信号の伝送は、無線放送、有線放送、無線通信、及び有線通信の何れによって実現してもよい。 The transmission medium for transmitting the modulated signal may be wireless or wired. Further, the transmission mode for transmitting the modulated signal may be broadcasting (here, a transmission mode in which the destination is not specified in advance) or communication (here, transmission in which the destination is specified in advance). Refers to an aspect). That is, the transmission of the modulated signal may be realized by any of wireless broadcasting, wired broadcasting, wireless communication, and wired communication.

例えば、地上デジタル放送の放送局(放送設備など)/受信局(テレビジョン受像機など)は、変調信号を無線放送で送受信する送信装置PROD_A/受信装置PROD_Bの一例である。また、ケーブルテレビ放送の放送局(放送設備など)/受信局(テレビジョン受像機など)は、変調信号を有線放送で送受信する送信装置PROD_A/受信装置PROD_Bの一例である。 For example, a broadcasting station (broadcasting equipment, etc.) / receiving station (television receiver, etc.) of terrestrial digital broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by radio broadcasting. Further, a broadcasting station (broadcasting equipment, etc.) / receiving station (television receiver, etc.) of cable television broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by wired broadcasting.

また、インターネットを用いたVOD(Video On Demand)サービスや動画共有サービスなどのサーバ(ワークステーションなど)/クライアント(テレビジョン受像機、パーソナルコンピュータ、スマートフォンなど)は、変調信号を通信で送受信する送信装置PROD_A/受信装置PROD_Bの一例である(通常、LANにおいては伝送媒体として無線または有線の何れかが用いられ、WANにおいては伝送媒体として有線が用いられる)。ここで、パーソナルコンピュータには、デスクトップ型PC、ラップトップ型PC、及びタブレット型PCが含まれる。また、スマートフォンには、多機能携帯電話端末も含まれる。 In addition, servers (workstations, etc.) / clients (television receivers, personal computers, smartphones, etc.) such as VOD (Video On Demand) services and video sharing services using the Internet are transmitters that send and receive modulated signals via communication. This is an example of PROD_A / receiver PROD_B (usually, in LAN, either wireless or wired is used as a transmission medium, and in WAN, wired is used as a transmission medium). Here, personal computers include desktop PCs, laptop PCs, and tablet PCs. Smartphones also include multifunctional mobile phone terminals.

なお、動画共有サービスのクライアントは、サーバからダウンロードした符号化データを復号してディスプレイに表示する機能に加え、カメラで撮像した動画像を符号化してサーバにアップロードする機能を有している。すなわち、動画共有サービスのクライアントは、送信装置PROD_A及び受信装置PROD_Bの双方として機能する。 The client of the video sharing service has a function of decoding the encoded data downloaded from the server and displaying it on the display, as well as a function of encoding the moving image captured by the camera and uploading it to the server. That is, the client of the video sharing service functions as both the transmitting device PROD_A and the receiving device PROD_B.

次に、上述した動画像符号化装置11及び動画像復号装置31を、動画像の記録及び再生に利用できることを、図3を参照して説明する。 Next, it will be described with reference to FIG. 3 that the moving image coding device 11 and the moving image decoding device 31 described above can be used for recording and reproducing a moving image.

図3(a)は、上述した動画像符号化装置11を搭載した記録装置PROD_Cの構成を示したブロック図である。図に示すように、記録装置PROD_Cは、動画像を符号化することによって符号化データを得る符号化部PROD_C1と、符号化部PROD_C1が得た符号化データを記録媒体PROD_Mに書き込む書込部PROD_C2と、を備えている。上述した動画像符号化装置11は、この符号化部PROD_C1として利用される。 FIG. 3A is a block diagram showing the configuration of the recording device PROD_C equipped with the above-mentioned moving image coding device 11. As shown in the figure, the recording device PROD_C has a coding unit PROD_C1 that obtains coded data by encoding a moving image and a writing unit PROD_C2 that writes the coded data obtained by the coding unit PROD_C1 to the recording medium PROD_M. And have. The moving image coding device 11 described above is used as the coding unit PROD_C1.

なお、記録媒体PROD_Mは、(1)HDD(Hard Disk Drive)やSSD(Solid State Drive)などのように、記録装置PROD_Cに内蔵されるタイプのものであってもよいし、(2)SDメモリカードやUSB(Universal Serial Bus)フラッシュメモリなどのように、記録装置PROD_Cに接続されるタイプのものであってもよいし、(3)DVD(Digital Versatile Disc:登録商標)やBD(Blu-ray Disc:登録商標)などのように、記録装置PROD_Cに内蔵されたドライブ装置(不図示)に装填されるものであってもよい。 The recording medium PROD_M may be of a type built in the recording device PROD_C, such as (1) HDD (Hard Disk Drive) or SSD (Solid State Drive), or (2) SD memory. It may be of a type that is connected to the recording device PROD_C, such as a card or USB (Universal Serial Bus) flash memory, and (3) DVD (Digital Versatile Disc: registered trademark) or BD (Blu-ray). It may be loaded in a drive device (not shown) built in the recording device PROD_C, such as Disc (registered trademark).

また、記録装置PROD_Cは、符号化部PROD_C1に入力する動画像の入力源として、動画像を撮像するカメラPROD_C3、動画像を外部から入力するための入力端子PROD_C4、動画像を受信するための受信部PROD_C5、及び、画像を生成または加工する画像処理部PROD_C6を更に備えていてもよい。図においては、これら全てを記録装置PROD_Cが備えた構成を例示しているが、一部を省略しても構わない。 Further, the recording device PROD_C has a camera PROD_C3 that captures a moving image, an input terminal PROD_C4 for inputting a moving image from the outside, and a reception for receiving the moving image as an input source of the moving image to be input to the coding unit PROD_C1. A unit PROD_C5 and an image processing unit PROD_C6 for generating or processing an image may be further provided. In the figure, the configuration provided by the recording device PROD_C is illustrated, but some of them may be omitted.

なお、受信部PROD_C5は、符号化されていない動画像を受信するものであってもよいし、記録用の符号化方式とは異なる伝送用の符号化方式で符号化された符号化データを受信するものであってもよい。後者の場合、受信部PROD_C5と符号化部PROD_C1との間に、伝送用の符号化方式で符号化された符号化データを復号する伝送用復号部(不図示)を介在させるとよい。 The receiving unit PROD_C5 may receive an unencoded moving image, or receives coded data encoded by a transmission coding method different from the recording coding method. It may be something to do. In the latter case, a transmission decoding unit (not shown) that decodes the coded data encoded by the transmission coding method may be interposed between the receiving unit PROD_C5 and the coding unit PROD_C1.

このような記録装置PROD_Cとしては、例えば、DVDレコーダ、BDレコーダ、HDD(Hard Disk Drive)レコーダなどが挙げられる(この場合、入力端子PROD_C4または受信部PROD_C5が動画像の主な入力源となる)。また、カムコーダ(この場合、カメラPROD_C3が動画像の主な入力源となる)、パーソナルコンピュータ(この場合、受信部PROD_C5または画像処理部C6が動画像の主な入力源となる)、スマートフォン(この場合、カメラPROD_C3または受信部PROD_C5が動画像の主な入力源となる)なども、このような記録装置PROD_Cの一例である。 Examples of such a recording device PROD_C include a DVD recorder, a BD recorder, and an HDD (Hard Disk Drive) recorder (in this case, the input terminal PROD_C4 or the receiving unit PROD_C5 is the main input source of the moving image). .. In addition, a camcorder (in this case, the camera PROD_C3 is the main input source for the moving image), a personal computer (in this case, the receiving unit PROD_C5 or the image processing unit C6 is the main input source for the moving image), and a smartphone (this). In this case, the camera PROD_C3 or the receiver PROD_C5 is the main input source for moving images), which is also an example of such a recording device PROD_C.

図3(b)は、上述した動画像復号装置31を搭載した再生装置PROD_Dの構成を示したブロックである。図に示すように、再生装置PROD_Dは、記録媒体PROD_Mに書き込まれた符号化データを読み出す読出部PROD_D1と、読出部PROD_D1が読み出した符号化データを復号することによって動画像を得る復号部PROD_D2と、を備えている。上述した動画像復号装置31は、この復号部PROD_D2として利用される。 FIG. 3B is a block showing the configuration of the playback device PROD_D equipped with the above-mentioned moving image decoding device 31. As shown in the figure, the playback device PROD_D includes a reading unit PROD_D1 that reads the coded data written in the recording medium PROD_M, and a decoding unit PROD_D2 that obtains a moving image by decoding the coded data read by the reading unit PROD_D1. , Is equipped. The moving image decoding device 31 described above is used as the decoding unit PROD_D2.

なお、記録媒体PROD_Mは、(1)HDDやSSDなどのように、再生装置PROD_Dに内蔵される
タイプのものであってもよいし、(2)SDメモリカードやUSBフラッシュメモリなどのように、再生装置PROD_Dに接続されるタイプのものであってもよいし、(3)DVDやBDなどのように、再生装置PROD_Dに内蔵されたドライブ装置(不図示)に装填されるものであってもよい。
The recording medium PROD_M may be of a type built into the playback device PROD_D, such as (1) HDD or SSD, or (2) such as an SD memory card or USB flash memory. It may be of a type connected to the playback device PROD_D, or may be loaded into a drive device (not shown) built in the playback device PROD_D, such as (3) DVD or BD. Good.

また、再生装置PROD_Dは、復号部PROD_D2が出力する動画像の出力先として、動画像を表示するディスプレイPROD_D3、動画像を外部に出力するための出力端子PROD_D4、及び、動画像を送信する送信部PROD_D5を更に備えていてもよい。図においては、これら全てを再生装置PROD_Dが備えた構成を例示しているが、一部を省略しても構わない。 Further, the playback device PROD_D has a display PROD_D3 for displaying the moving image, an output terminal PROD_D4 for outputting the moving image to the outside, and a transmitting unit for transmitting the moving image as the output destination of the moving image output by the decoding unit PROD_D2. It may also have PROD_D5. In the figure, the configuration in which the playback device PROD_D is provided with all of these is illustrated, but some of them may be omitted.

なお、送信部PROD_D5は、符号化されていない動画像を送信するものであってもよいし、記録用の符号化方式とは異なる伝送用の符号化方式で符号化された符号化データを送信するものであってもよい。後者の場合、復号部PROD_D2と送信部PROD_D5との間に、動画像を伝送用の符号化方式で符号化する符号化部(不図示)を介在させるとよい。 The transmission unit PROD_D5 may transmit an unencoded moving image, or transmits coded data encoded by a transmission coding method different from the recording coding method. It may be something to do. In the latter case, it is preferable to interpose a coding unit (not shown) that encodes the moving image by a coding method for transmission between the decoding unit PROD_D2 and the transmitting unit PROD_D5.

このような再生装置PROD_Dとしては、例えば、DVDプレイヤ、BDプレイヤ、HDDプレイヤなどが挙げられる(この場合、テレビジョン受像機等が接続される出力端子PROD_D4が動画像の主な出力先となる)。また、テレビジョン受像機(この場合、ディスプレイPROD_D3が動画像の主な出力先となる)、デジタルサイネージ(電子看板や電子掲示板等とも称され、ディスプレイPROD_D3または送信部PROD_D5が動画像の主な出力先となる)、デスクトップ型PC(この場合、出力端子PROD_D4または送信部PROD_D5が動画像の主な出力先となる)、ラップトップ型またはタブレット型PC(この場合、ディスプレイPROD_D3または送信部PROD_D5が動画像の主な出力先となる)、スマートフォン(この場合、ディスプレイPROD_D3または送信部PROD_D5が動画像の主な出力先となる)なども、このような再生装置PROD_Dの一例である。 Examples of such a playback device PROD_D include a DVD player, a BD player, an HDD player, and the like (in this case, the output terminal PROD_D4 to which a television receiver or the like is connected is the main output destination of the moving image). .. In addition, a television receiver (in this case, the display PROD_D3 is the main output destination of the moving image), digital signage (also called an electronic signage or an electronic bulletin board, etc., and the display PROD_D3 or the transmitter PROD_D5 is the main output destination of the moving image). (Before), desktop PC (in this case, output terminal PROD_D4 or transmitter PROD_D5 is the main output destination of moving images), laptop or tablet PC (in this case, display PROD_D3 or transmitter PROD_D5 is video) An example of such a playback device PROD_D is a smartphone (in this case, the display PROD_D3 or the transmitter PROD_D5 is the main output destination of the moving image), which is the main output destination of the image.

(ハードウェア的実現およびソフトウェア的実現)
また、上述した動画像復号装置31および動画像符号化装置11の各ブロックは、集積回路(ICチップ)上に形成された論理回路によってハードウェア的に実現してもよいし、CPU(Central Processing Unit)を用いてソフトウェア的に実現してもよい。
(Hardware realization and software realization)
Further, each block of the moving image decoding device 31 and the moving image coding device 11 described above may be realized in hardware by a logic circuit formed on an integrated circuit (IC chip), or may be realized by a CPU (Central Processing). It may be realized by software using Unit).

後者の場合、上記各装置は、各機能を実現するプログラムの命令を実行するCPU、上記プログラムを格納したROM(Read Only Memory)、上記プログラムを展開するRAM(Random
Access Memory)、上記プログラムおよび各種データを格納するメモリ等の記憶装置(記録媒体)などを備えている。そして、本発明の実施形態の目的は、上述した機能を実現するソフトウェアである上記各装置の制御プログラムのプログラムコード(実行形式プログラム、中間コードプログラム、ソースプログラム)をコンピュータで読み取り可能に記録した記録媒体を、上記各装置に供給し、そのコンピュータ(またはCPUやMPU)が記録媒体に記録されているプログラムコードを読み出し実行することによっても、達成可能である。
In the latter case, each of the above devices is a CPU that executes instructions of a program that realizes each function, a ROM (Read Only Memory) that stores the above program, and a RAM (Random) that expands the above program.
Access Memory), a storage device (recording medium) such as a memory for storing the above programs and various data. Then, an object of the embodiment of the present invention is a record in which the program code (execution format program, intermediate code program, source program) of the control program of each of the above devices, which is software for realizing the above-mentioned functions, is recorded readable by a computer. It can also be achieved by supplying the medium to each of the above devices and having the computer (or CPU or MPU) read and execute the program code recorded on the recording medium.

上記記録媒体としては、例えば、磁気テープやカセットテープ等のテープ類、フロッピー(登録商標)ディスク/ハードディスク等の磁気ディスクやCD-ROM(Compact Disc Read-Only Memory)/MOディスク(Magneto-Optical disc)/MD(Mini Disc)/DVD(Digital Versatile Disc:登録商標)/CD-R(CD Recordable)/ブルーレイディスク(Blu-ray Disc:登録商標)等の光ディスクを含むディスク類、ICカード(メモリカードを含む)/光カード等のカード類、マスクROM/EPROM(Erasable Programmable Read-Only Memory)/EEPROM(Electrically Erasable and Programmable Read-Only Memory:登録商標)/フラッシュROM等の半導体メモリ類、あるいはPLD(Programmable logic device)やFPGA(Field Programmable Gate Array)等の論理回路類などを用いることができる。 Examples of the recording medium include tapes such as magnetic tapes and cassette tapes, magnetic disks such as floppy (registered trademark) disks / hard disks, and CD-ROMs (Compact Disc Read-Only Memory) / MO disks (Magneto-Optical discs). ) / MD (Mini Disc) / DVD (Digital Versatile Disc: registered trademark) / CD-R (CD Recordable) / Blu-ray Disc (registered trademark) and other disks including magneto-optical disks, IC cards (memory cards) (Including) / Cards such as optical cards, mask ROM / EPROM (Erasable Programmable Read-Only Memory) / EEPROM (Electrically Erasable and Programmable Read-Only Memory: registered trademark) / Semiconductor memories such as flash ROM, or PLD ( Logic circuits such as Programmable logic device) and FPGA (Field Programmable Gate Array) can be used.

また、上記各装置を通信ネットワークと接続可能に構成し、上記プログラムコードを通信ネットワークを介して供給してもよい。この通信ネットワークは、プログラムコードを伝送可能であればよく、特に限定されない。例えば、インターネット、イントラネット、エキストラネット、LAN(Local Area Network)、ISDN(Integrated Services Digital Network)、VAN(Value-Added Network)、CATV(Community Antenna television/Cable Television)通信網、仮想専用網(Virtual Private Network)、電話回線網、移動体通信網、衛星通信網等が利用可能である。また、この通信ネットワークを構成する伝送媒体も、プログラムコードを伝送可能な媒体であればよく、特定の構成または種類のものに限定されない。例えば、IEEE(Institute of Electrical and Electronic Engineers)1394、USB、電力線搬送、ケーブルTV回線、電話線、ADSL(Asymmetric Digital Subscriber Line)回線等の有線でも、IrDA(Infrared Data Association)やリモコンのような赤外線、BlueTooth(登録商標)、IEEE802.11無線、HDR(High Data Rate)、NFC(Near Field Communication)、DLNA(Digital Living Network Alliance:登録商標)、携帯電話網、衛星回線、地上デジタル放送網等の無線でも利用可能である。なお、本発明の実施形態は、上記プログラムコードが電子的な伝送で具現化された、搬送波に埋め込まれたコンピュータデータ信号の形態でも実現され得る。 Further, each of the above devices may be configured to be connectable to a communication network, and the above program code may be supplied via the communication network. This communication network is not particularly limited as long as it can transmit the program code. For example, Internet, Intranet, Extranet, LAN (Local Area Network), ISDN (Integrated Services Digital Network), VAN (Value-Added Network), CATV (Community Antenna television / Cable Television) communication network, Virtual Private network (Virtual Private) Network), telephone line network, mobile communication network, satellite communication network, etc. can be used. Further, the transmission medium constituting this communication network may be any medium as long as it can transmit the program code, and is not limited to a specific configuration or type. For example, even wired such as IEEE (Institute of Electrical and Electronic Engineers) 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, infrared data such as IrDA (Infrared Data Association) and remote control , BlueTooth (registered trademark), IEEE802.11 wireless, HDR (High Data Rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance: registered trademark), mobile phone network, satellite line, terrestrial digital broadcasting network, etc. It is also available wirelessly. The embodiment of the present invention can also be realized in the form of a computer data signal embedded in a carrier wave in which the program code is embodied by electronic transmission.

本発明の実施形態は上述した実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能である。すなわち、請求項に示した範囲で適宜変更した技術的手段を組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。 The embodiment of the present invention is not limited to the above-described embodiment, and various modifications can be made within the scope of the claims. That is, an embodiment obtained by combining technical means appropriately modified within the scope of the claims is also included in the technical scope of the present invention.

本発明の実施形態は、画像データが符号化された符号化データを復号する動画像復号装置、および、画像データが符号化された符号化データを生成する動画像符号化装置に好適に適用することができる。また、動画像符号化装置によって生成され、動画像復号装置によって参照される符号化データのデータ構造に好適に適用することができる。 The embodiment of the present invention is suitably applied to a moving image decoding device that decodes encoded data in which image data is encoded, and a moving image coding device that generates encoded data in which image data is encoded. be able to. Further, it can be suitably applied to the data structure of the coded data generated by the moving image coding device and referenced by the moving image decoding device.

31 画像復号装置
301 エントロピー復号部
302 パラメータ復号部
3020 ヘッダ復号部
303 インター予測パラメータ復号部
304 イントラ予測パラメータ復号部
308 予測画像生成部
309 インター予測画像生成部
310 イントラ予測画像生成部
311 逆量子化・逆変換部
312 加算部
11 画像符号化装置
101 予測画像生成部
102 減算部
103 変換・量子化部
104 エントロピー符号化部
105 逆量子化・逆変換部
107 ループフィルタ
110 符号化パラメータ決定部
111 パラメータ符号化部
112 パラメータ符号化部
1110 ヘッダ符号化部
1111 CT情報符号化部
1112 CU符号化部(予測モード符号化部)
1114 TU符号化部
31 Image decoder
301 Entropy Decryptor
302 Parameter decoder
3020 Header decoder
303 Inter prediction parameter decoding unit
304 Intra Prediction Parameter Decoder
308 Prediction image generator
309 Inter-prediction image generator
310 Intra prediction image generator
311 Inverse quantization / inverse conversion
312 Addition part
11 Image encoder
101 Prediction image generator
102 Subtraction section
103 Conversion / Quantization Department
104 Entropy encoding section
105 Inverse quantization / inverse conversion
107 Loop filter
110 Coded parameter determination unit
111 Parameter encoding section
112 Parameter encoding section
1110 Header encoding
1111 CT information coding unit
1112 CU encoding unit (prediction mode encoding unit)
1114 TU coder

Claims (6)

動きベクトルに所定の距離及び所定の方向の差分ベクトルを加算することで動きベクトルを得るMMVD部と、L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、動き情報が双予測、かつ、対象CUサイズが所定のサイズ以上、かつ、(MMVDモードがオフ、もしくは、MMVDモードがオンで、かつ、前記MMVDの距離が所定の閾値以上)の場合に、DMVRフラグを1とし、それ以外の場合にDMVRフラグを0とし、
DMVRフラグが1の場合に、上記コスト値SADから導出されるリファインメント値dX, dYを動きベクトルmvLXに加算してリファインメント動きベクトルrefMvLXを導出することを特徴とする動画像復号装置。
The motion vector is refined according to the MMVD part that obtains the motion vector by adding the difference vector of the predetermined distance and the predetermined direction to the motion vector, and the multiple cost values SAD derived from the L0 predicted image and the L1 predicted image. In a motion image decoding device provided with a DMVR unit
In the DMVR unit, the motion information is bi-predicted, the target CU size is equal to or larger than a predetermined size, and (MMVD mode is off or MMVD mode is on, and the distance of the MMVD is equal to or greater than a predetermined threshold value). In some cases, the DMVR flag is set to 1, and in other cases, the DMVR flag is set to 0.
A moving image decoding device characterized in that when the DMVR flag is 1, the refinement values dX and dY derived from the above cost value SAD are added to the motion vector mvLX to derive the refinement motion vector refMvLX.
L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、左のSADと右のSADの差の定数倍A1、左のSADと右のSADの和から中心のSADの2倍に所定の定数を加算した値A2からA1とA2の比率を導出し、
DMVR部は、上のSADと下のSADの差の定数倍を分子A1、上のSADと下のSADの和から中心のSADの2倍に所定の定数を加算した値A2とする値からA1とA2の比率を導出し動きベクトルの修正値dYを導出することを特徴とする動画像復号装置。
In a moving image decoding device provided with a DMVR unit that refines a motion vector according to a plurality of cost values SAD derived from the L0 predicted image and the L1 predicted image.
The DMVR section calculates the ratio of A1 to A2 from A2, which is a constant multiple A1 of the difference between the left SAD and the right SAD, and the sum of the left SAD and the right SAD to twice the center SAD plus a predetermined constant. Derived and
In the DMVR section, the constant multiple of the difference between the upper SAD and the lower SAD is the numerator A1, and the sum of the upper SAD and the lower SAD is double the central SAD plus a predetermined constant, which is the value A2. A moving image decoding device characterized by deriving the ratio of and A2 and deriving the correction value dY of the motion vector.
L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、2つのペアのSADの差分値が所定の閾値を超える場合に、動きベクトルの修正値dXを所定の値に設定し、上記とは別の2つのSADのペアの差分値が所定の閾値を超える場合に、動きベクトルの修正値dYを所定の値に設定することを特徴とする動画像復号装置。
In a moving image decoding device provided with a DMVR unit that refines a motion vector according to a plurality of cost values SAD derived from the L0 predicted image and the L1 predicted image.
The DMVR unit sets the motion vector correction value dX to a predetermined value when the difference value of the SADs of the two pairs exceeds a predetermined threshold value, and the difference value of the pair of two SADs different from the above is predetermined. A moving image decoding device, characterized in that a motion vector correction value dY is set to a predetermined value when the threshold value of is exceeded.
L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、左と中心のSAD差分値と、右と中心のSAD差分値の比が閾値を超えたら、dXを所定の値に設定し、上と中心のSAD差分値と、下と中心のSAD差分値の比が閾値を超えたら、dYを所定の値に設定することを特徴とする動画像復号装置。
In a moving image decoding device provided with a DMVR unit that refines a motion vector according to a plurality of cost values SAD derived from the L0 predicted image and the L1 predicted image.
When the ratio of the left and center SAD difference value and the right and center SAD difference value exceeds the threshold value, the DMVR section sets dX to a predetermined value, and sets the top and center SAD difference values and the bottom and center SAD difference values. A moving image decoding device characterized in that dY is set to a predetermined value when the ratio of SAD difference values exceeds a threshold value.
L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、左右のSADの絶対値差分値(abs(mrSadL-mrSadR))がmin (mrSadL,mrSadR)と中心のSAD(mrSadC)との差分よりも大きければ、dXを所定の値に設定し、上下のSADの絶対値差分値(abs(mrSadT-mrSadB))がmin (mrSadT,mrSadB)と中心のSAD(mrSadC)との差分よりも大きければ、dYを所定の値に設定することを特徴とする動画像復号装置。
In a moving image decoding device provided with a DMVR unit that refines a motion vector according to a plurality of cost values SAD derived from the L0 predicted image and the L1 predicted image.
In the DMVR section, if the absolute value difference value (abs (mrSadL-mrSadR)) of the left and right SAD is larger than the difference between min (mrSadL, mrSadR) and the center SAD (mrSadC), dX is set to a predetermined value. If the absolute value difference (abs (mrSadT-mrSadB)) of the upper and lower SAD is larger than the difference between min (mrSadT, mrSadB) and the center SAD (mrSadC), dY is set to a predetermined value. Video decoding device.
動きベクトルに所定の距離及び所定の方向の差分ベクトルを加算することで動きベクトルを得るMMVD部と、L0予測画像とL1予測画像から導出される複数のコスト値SADに応じて、動きベクトルをリファイメントするDMVR部を備える動画像復号装置において、
DMVR部は、動き情報が双予測、かつ、対象CUサイズが所定のサイズ以上、かつ、(MMVDモードがオフ、もしくは、MMVDモードがオンで、かつ、前記MMVDの距離が所定の閾値以上)の場合に、DMVRフラグを1とし、それ以外の場合にDMVRフラグを0とし、
DMVRフラグが1の場合に、上記コスト値SADから導出されるリファインメント値dX, dYを動きベクトルmvLXに加算してリファインメント動きベクトルrefMvLXを導出することを特徴とする動画像符号化装置。
The motion vector is refined according to the MMVD part that obtains the motion vector by adding the difference vector of the predetermined distance and the predetermined direction to the motion vector, and the multiple cost values SAD derived from the L0 predicted image and the L1 predicted image. In a motion image decoding device provided with a DMVR unit
In the DMVR unit, the motion information is bi-predicted, the target CU size is equal to or larger than a predetermined size, and (MMVD mode is off or MMVD mode is on, and the distance of the MMVD is equal to or greater than a predetermined threshold value). In some cases, the DMVR flag is set to 1, and in other cases, the DMVR flag is set to 0.
A moving image encoding device characterized in that when the DMVR flag is 1, the refinement values dX and dY derived from the above cost value SAD are added to the motion vector mvLX to derive the refinement motion vector refMvLX.
JP2019042613A 2019-03-08 2019-03-08 Image decoding device and image coding device Pending JP2020145650A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019042613A JP2020145650A (en) 2019-03-08 2019-03-08 Image decoding device and image coding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019042613A JP2020145650A (en) 2019-03-08 2019-03-08 Image decoding device and image coding device

Publications (1)

Publication Number Publication Date
JP2020145650A true JP2020145650A (en) 2020-09-10

Family

ID=72354608

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019042613A Pending JP2020145650A (en) 2019-03-08 2019-03-08 Image decoding device and image coding device

Country Status (1)

Country Link
JP (1) JP2020145650A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022553594A (en) * 2019-09-24 2022-12-26 オッポ広東移動通信有限公司 Inter-prediction method and device, equipment, storage medium
WO2023249006A1 (en) * 2022-06-24 2023-12-28 シャープ株式会社 Video decoding device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022553594A (en) * 2019-09-24 2022-12-26 オッポ広東移動通信有限公司 Inter-prediction method and device, equipment, storage medium
JP7437426B2 (en) 2019-09-24 2024-02-22 オッポ広東移動通信有限公司 Inter prediction method and device, equipment, storage medium
US11924459B2 (en) 2019-09-24 2024-03-05 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method for inter prediction method, video picture encoder and decoder
WO2023249006A1 (en) * 2022-06-24 2023-12-28 シャープ株式会社 Video decoding device

Similar Documents

Publication Publication Date Title
WO2020116456A1 (en) Moving image decoding device
WO2020184487A1 (en) Dynamic image decoding device
WO2018110203A1 (en) Moving image decoding apparatus and moving image encoding apparatus
WO2020137920A1 (en) Prediction image generating device, moving image decoding device, moving image encoding device, and prediction image generating method
CN111886867A (en) Motion vector derivation device, moving picture decoding device, and moving picture encoding device
JP2020053924A (en) Video encoding device and video decoding device
WO2020045248A1 (en) Video decoding device and video coding device
JP2023181459A (en) Moving-image decoding device, moving-image encoding device, moving-image decoding method, and moving-image encoding method
JP2019201254A (en) Image decoding apparatus and image encoding apparatus
JP2020145650A (en) Image decoding device and image coding device
JPWO2018037723A1 (en) Image decoding apparatus and image encoding apparatus
JP2020108012A (en) Image decoding device and image encoding device
JP2020096279A (en) Prediction image generation device, moving image decoding device, and moving image encoding device
JP2020088660A (en) Moving picture coding apparatus and moving picture decoding apparatus
JP2020036101A (en) Image decoder, and image encoder
US11044490B2 (en) Motion compensation filter apparatus, image decoding apparatus, and video coding apparatus
JP2022087865A (en) Image decoder and image encoder
JP2020170901A (en) Predictive image generation device, video decoding device, and video coding device
JP2020088577A (en) Predictive image generation device, moving image decoding device, and moving image encoding device
JP2020096329A (en) Prediction image generation device, moving image decoding device, and moving image encoding device
RU2812275C2 (en) Video signal decoding device
JP2021057621A (en) Moving image encoding device, moving image decoding device, and prediction image generation device
CN113170190B (en) Prediction image generating apparatus and method for generating prediction image from two prediction images
JP2021016018A (en) Video coding device, video decoding device, and motion vector derivation device
RU2799802C2 (en) Prediction image generation device, video signal decoding device, video signal encoding device and method for project image generation