JP2023181459A - Moving-image decoding device, moving-image encoding device, moving-image decoding method, and moving-image encoding method - Google Patents

Moving-image decoding device, moving-image encoding device, moving-image decoding method, and moving-image encoding method Download PDF

Info

Publication number
JP2023181459A
JP2023181459A JP2023187980A JP2023187980A JP2023181459A JP 2023181459 A JP2023181459 A JP 2023181459A JP 2023187980 A JP2023187980 A JP 2023187980A JP 2023187980 A JP2023187980 A JP 2023187980A JP 2023181459 A JP2023181459 A JP 2023181459A
Authority
JP
Japan
Prior art keywords
image
predicted image
prediction
unit
predicted
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
JP2023187980A
Other languages
Japanese (ja)
Inventor
健 中條
Takeshi Nakajo
瑛一 佐々木
Eiichi Sasaki
知宏 猪飼
Tomohiro Igai
友子 青野
Tomoko Aono
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.)
Sharp Corp
Original Assignee
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 Sharp Corp filed Critical Sharp Corp
Priority to JP2023187980A priority Critical patent/JP2023181459A/en
Publication of JP2023181459A publication Critical patent/JP2023181459A/en
Pending legal-status Critical Current

Links

Images

Abstract

To solve a problem that prediction to increase image quality utilizing gradient images does not lead to reduction in an amount of throughput.SOLUTION: There is provided a moving-image decoding method that generates a third prediction image by BDOF prediction, using a first prediction image, a second prediction image and a motion compensating correction value, the method including a step for deriving a difference absolute value sum of the first and second prediction images. The third prediction image is derived by the first and second prediction images, the motion compensating correction value, a first offset value, and a first shift value; the motion compensating correction value is derived by a gradient image in the horizontal and vertical directions of the first prediction image and a gradient image in the horizontal and vertical directions of the second prediction image; the gradient image in the horizontal and vertical directions of the first prediction image is derived by the first prediction image and the second shift value; and the gradient image in the horizontal and vertical directions of the second prediction image is derived by the second prediction image and the second shift value.SELECTED DRAWING: Figure 12

Description

本発明の実施形態は、動画像復号装置、動画像符号化装置、動画像復号方法および動画像符号化方法に関する。 Embodiments of the present invention relate to a video decoding device, a video encoding device, a video decoding method, and a video encoding method.

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

具体的な動画像符号化方式としては、例えば、H.264/AVCやHEVC(High-Efficiency Video Coding)方式などが挙げられる。 Specific video encoding methods include, for example, H.264/AVC and HEVC (High-Efficiency Video Coding).

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

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

また、近年の動画像符号化及び復号の技術として非特許文献が挙げられるが、特に、双予測の動き補償(補間画像)から予測画像を導出する際に勾配画像を利用して高画質化するBDOF技術が開示されている。 In addition, non-patent literature has been cited regarding recent video encoding and decoding techniques, and in particular, gradient images are used to improve image quality when deriving predicted images from bi-predictive motion compensation (interpolated images). BDOF technology is disclosed.

"Versatile Video Coding (Draft 5)", JVET-N1001, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 2019"Versatile Video Coding (Draft 5)", JVET-N1001, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11, 2019

非特許文献1では、BDOF技術において、処理単位毎に処理を行うか否かを判定するために、二つの補間画像の差分絶対値和の計算が必要であった。途中で処理を打ち切ることができるため、平均的には、処理量が削減できるが、追加の差分絶対値和の処理量があるため、最悪の場合の処理量の削減にはなっていなかったという問題があった。 In Non-Patent Document 1, the BDOF technique requires calculation of the sum of absolute differences between two interpolated images in order to determine whether or not to perform processing for each processing unit. Since processing can be aborted midway, the amount of processing can be reduced on average, but since there is an additional amount of processing for the sum of absolute differences, the amount of processing has not been reduced in the worst case. There was a problem.

本発明の一態様に係る動画像復号装置は、第1の予測画像、第2の予測画像及び動き補償修正値を用いて、BDOF予測により第3の予測画像を生成する動画像復号装置であって、サブブロック単位で、前記第1の予測画像及び前記第2の予測画像の差分絶対値和を導出するBDOF部を備え、前記第3の予測画像は、(i)前記第1の予測画像と、(ii)前記第2の予測画像と、(iii)前記動き補償修正値と、(iv)第1のオフセット値との加算値を、第1のシフト値で右シフトすることにより導出され、前記動き補償修正値は、前記第1の予測画像の水平方向の勾配画像と、前記第1の予測画像の垂直方向の勾配画像と、前記第2の予測画像の水平方向の勾配画像と、前記第2の予測画像の垂直方向の勾配画像と、を用いて導出され、前記第1の予測画像の水平方向の勾配画像は、前記第1の予測画像を第2のシフト値で右シフトした値の差分を取ることで導出され、前記第1の予測画像の垂直方向の勾配画像は、前記第1の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、前記第2の予測画像の水平方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、前記第2の予測画像の垂直方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出される。 A video decoding device according to one aspect of the present invention is a video decoding device that generates a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value. and a BDOF unit that derives the sum of absolute differences between the first predicted image and the second predicted image in subblock units, and the third predicted image is: (i) the first predicted image; and (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) the sum of the first offset value, which is derived by shifting the sum to the right by a first shift value. , the motion compensation correction value includes a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, and a horizontal gradient image of the second predicted image, a vertical gradient image of the second predicted image, and the horizontal gradient image of the first predicted image is obtained by right-shifting the first predicted image by a second shift value. The vertical gradient image of the first predicted image is derived by taking the difference between the values obtained by shifting the first predicted image to the right by the second shift value. , the horizontal gradient image of the second predicted image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value, and the vertical gradient image of the second predicted image The directional gradient image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value.

本発明の一態様に係る動画像符号化装置は、第1の予測画像、第2の予測画像及び動き補償修正値を用いて、BDOF予測により第3の予測画像を生成する動画像符号化装置であって、サブブロック単位で、前記第1の予測画像及び前記第2の予測画像の差分絶対値和を導出するBDOF部を備え、前記第3の予測画像は、(i)前記第1の予測画像と、(ii)前記第2の予測画像と、(iii)前記動き補償修正値と、(iv)第1のオフセット値との加算値を、第1のシフト値で右シフトすることにより導出され、前記動き補償修正値は、前記第1の予測画像の水平方向の勾配画像と、前記第1の予測画像の垂直方向の勾配画像と、前記第2の予測画像の水平方向の勾配画像と、前記第2の予測画像の垂直方向の勾配画像と、を用いて導出され、前記第1の予測画像の水平方向の勾配画像は、前記第1の予測画像を第2のシフト値で右シフトした値の差分を取ることで導出され、前記第1の予測画像の垂直方向の勾配画像は、前記第1の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、前記第2の予測画像の水平方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、前記第2の予測画像の垂直方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出される。 A video encoding device according to one aspect of the present invention generates a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value. The third predicted image includes: (i) a BDOF unit that derives the sum of absolute differences between the first predicted image and the second predicted image in sub-block units; By right-shifting the sum of the predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) the first offset value by a first shift value. The motion compensation correction value is derived from a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, and a horizontal gradient image of the second predicted image. and a vertical gradient image of the second predicted image, and the horizontal gradient image of the first predicted image shifts the first predicted image to the right by a second shift value. The vertical gradient image of the first predicted image is derived by taking the difference between the shifted values, and the vertical gradient image of the first predicted image is derived by taking the difference between the values of the first predicted image shifted to the right by the second shift value. The horizontal gradient image of the second predicted image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value, and the horizontal gradient image of the second predicted image The vertical gradient image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value.

本発明の一態様に係る動画像復号方法は、第1の予測画像、第2の予測画像及び動き補償修正値を用いて、BDOF予測により第3の予測画像を生成する動画像復号方法であって、サブブロック単位で、前記第1の予測画像及び前記第2の予測画像の差分絶対値和を導出するステップを少なくとも含み、前記第3の予測画像は、(i)前記第1の予測画像と、(ii)前記第2の予測画像と、(iii)前記動き補償修正値と、(iv)第1のオフセット値との加算値を、第1のシフト値で右シフトすることにより導出され、前記動き補償修正値は、前記第1の予測画像の水平方向の勾配画像と、前記第1の予測画像の垂直方向の勾配画像と、前記第2の予測画像の水平方向の勾配画像と、前記第2の予測画像の垂直方向の勾配画像と、を用いて導出され、前記第1の予測画像の水平方向の勾配画像は、前記第1の予測画像を第2のシフト値で右シフトした値の差分を取ることで導出され、前記第1の予測画像の垂直方向の勾配画像は、前記第1の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、前記第2の予測画像の水平方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、前記第2の予測画像の垂直方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出される。 A video decoding method according to one aspect of the present invention is a video decoding method that generates a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value. (i) the third predicted image includes at least the step of deriving the sum of absolute differences between the first predicted image and the second predicted image in sub-block units; and (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) the sum of the first offset value, which is derived by shifting the sum to the right by a first shift value. , the motion compensation correction value includes a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, and a horizontal gradient image of the second predicted image, a vertical gradient image of the second predicted image, and the horizontal gradient image of the first predicted image is obtained by right-shifting the first predicted image by a second shift value. The vertical gradient image of the first predicted image is derived by taking the difference between the values obtained by shifting the first predicted image to the right by the second shift value. , the horizontal gradient image of the second predicted image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value, and the vertical gradient image of the second predicted image The directional gradient image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value.

本発明の一態様に係る動画像符号化方法は、第1の予測画像、第2の予測画像及び動き補償修正値を用いて、BDOF予測により第3の予測画像を生成する動画像符号化方法であって、サブブロック単位で、前記第1の予測画像及び前記第2の予測画像の差分絶対値和を導出するステップを少なくとも含み、前記第3の予測画像は、(i)前記第1の予測画像と、(ii)前記第2の予測画像と、(iii)前記動き補償修正値と、(iv)第1のオフセット値との加算値を、第1のシフト値で右シフトすることにより導出され、前記動き補償修正値は、前記第1の予測画像の水平方向の勾配画像と、前記第1の予測画像の垂直方向の勾配画像と、前記第2の予測画像の水平方向の勾配画像と、前記第2の予測画像の垂直方向の勾配画像と、を用いて導出され、前記第1の予測画像の水平方向の勾配画像は、前記第1の予測画像を第2のシフト値で右シフトした値の差分を取ることで導出され、前記第1の予測画像の垂直方向の勾配画像は、前記第1の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、前記第2の予測画像の水平方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、前記第2の予測画像の垂直方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出される。 A video encoding method according to one aspect of the present invention is a video encoding method that generates a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value. The third predicted image includes at least the step of deriving the sum of absolute differences between the first predicted image and the second predicted image in sub-block units, and the third predicted image is: (i) the first predicted image; By right-shifting the sum of the predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) the first offset value by a first shift value. The motion compensation correction value is derived from a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, and a horizontal gradient image of the second predicted image. and a vertical gradient image of the second predicted image, and the horizontal gradient image of the first predicted image shifts the first predicted image to the right by a second shift value. The vertical gradient image of the first predicted image is derived by taking the difference between the shifted values, and the vertical gradient image of the first predicted image is derived by taking the difference between the values of the first predicted image shifted to the right by the second shift value. The horizontal gradient image of the second predicted image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value, and the horizontal gradient image of the second predicted image The vertical gradient image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value.

以上の構成によれば、上記問題の何れかの解決を図ることができる。 According to the above configuration, any of the above problems can be solved.

本実施形態に係る画像伝送システムの構成を示す概略図である。1 is a schematic diagram showing the configuration of an image transmission system according to the present embodiment. 本実施形態に係る動画像符号化装置を搭載した送信装置、および、動画像復号装置を搭載した受信装置の構成について示した図である。(a)は動画像符号化装置を搭載した送信装置を示しており、(b)は動画像復号装置を搭載した受信装置を示している。1 is a diagram showing the configurations of a transmitting device equipped with a video encoding device and a receiving device equipped with a video decoding device according to the present embodiment. FIG. (a) shows a transmitting device equipped with a video encoding device, and (b) shows a receiving device equipped with a video decoding device. 本実施形態に係る動画像符号化装置を搭載した記録装置、および、動画像復号装置を搭載した再生装置の構成について示した図である。(a)は動画像符号化装置を搭載した記録装置を示しており、(b)は動画像復号装置を搭載した再生装置を示している。1 is a diagram showing the configuration of a recording device equipped with a video encoding device and a playback device equipped with a video decoding device according to the present embodiment. (a) shows a recording device equipped with a video encoding device, and (b) shows a playback device equipped with a video decoding device. 符号化ストリームのデータの階層構造を示す図である。FIG. 3 is a diagram showing a hierarchical structure of data of an encoded stream. CTUの分割例を示す図である。FIG. 3 is a diagram showing an example of CTU division. 参照ピクチャおよび参照ピクチャリストの一例を示す概念図である。FIG. 2 is a conceptual diagram showing an example of a reference picture and a reference picture list. 動画像復号装置の構成を示す概略図である。1 is a schematic diagram showing the configuration of a moving image decoding device. インター予測パラメータ復号部の構成を示す概略図である。FIG. 2 is a schematic diagram showing the configuration of an inter prediction parameter decoding section. マージ予測パラメータ導出部、および、AMVP予測パラメータ導出部の構成を示す概略図である。FIG. 2 is a schematic diagram showing the configurations of a merge prediction parameter derivation unit and an AMVP prediction parameter derivation unit. インター予測画像生成部の構成を示す概略図である。FIG. 2 is a schematic diagram showing the configuration of an inter predicted image generation section. 本実施形態に係るBDOF予測を用いた動き補償機能を備える動き補償部が予測画像を導出する処理の流れを説明するフローチャート一例を示す図である。FIG. 3 is a diagram illustrating an example of a flowchart illustrating a process flow in which a motion compensation unit having a motion compensation function using BDOF prediction according to the present embodiment derives a predicted image. 本実施形態に係るBDOF部の構成を示す概略図である。FIG. 2 is a schematic diagram showing the configuration of a BDOF unit according to the present embodiment. 本実施形態に係るBDOF部が予測画像生成する処理の流れを説明するフローチャート一例を示す図である。FIG. 3 is a diagram illustrating an example of a flowchart illustrating the flow of processing in which the BDOF unit according to the present embodiment generates a predicted image. 本実施形態に係るBDOF部がBDOFパディングを実行する領域の一例を示す図である。FIG. 3 is a diagram illustrating an example of an area where the BDOF unit according to the present embodiment performs BDOF padding. 本実施形態に係るBDOF部のBDOFの処理の単位と読み込み領域の一例を示す図である。FIG. 3 is a diagram illustrating an example of a BDOF processing unit and a reading area of a BDOF unit according to the present embodiment. 動画像符号化装置の構成を示すブロック図である。FIG. 1 is a block diagram showing the configuration of a video encoding device. インター予測パラメータ符号化部の構成を示す概略図である。FIG. 2 is a schematic diagram showing the configuration of an inter prediction parameter encoding unit.

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

図1は、本実施形態に係る画像伝送システム1の構成を示す概略図である。 FIG. 1 is a schematic diagram showing the configuration of an 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 an encoded stream obtained by encoding an image to be encoded, decodes the transmitted encoded stream, and displays the image. The image transmission system 1 includes a video encoding device (image encoding device) 11, a network 21, a video decoding device (image decoding device) 31, and a video display device (image display device) 41. .

動画像符号化装置11には画像Tが入力される。 An image T is input to the moving image encoding 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 encoded stream Te generated by the video encoding device 11 to the video decoding device 31. The network 21 is the Internet, a wide area network (WAN), a local area network (LAN), or a combination thereof. The network 21 is not necessarily a bidirectional communication network, but may be a unidirectional communication network that transmits broadcast waves such as terrestrial digital broadcasting and satellite broadcasting. Further, the network 21 may be replaced by a storage medium on which the encoded stream Te is recorded, such as a DVD (Digital Versatile Disc: registered trademark) or a BD (Blue-ray Disc: registered trademark).

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

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

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

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

x?y:zは、xが真(0以外)の場合にy、xが偽(0)の場合にzをとる3項演算子である。 x?y:z is a ternary operator that takes y if x is true (other than 0) and z if 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, and returns a if c<a, returns b if c>b, and otherwise 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 the 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 (rounding down to the nearest whole number).

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

sign(a)はaの符号(sign)を返す関数である。sign(a) = a>0? 1 : a==0? 0 : -1
log2(a)はaの底を2とする対数を返す関数である。
sign(a) is a function that returns the sign of a. sign(a) = a>0? 1 : a==0? 0 : -1
log2(a) is a function that returns the logarithm of a with base 2.

Max(a, b)は、a>=bの時、a、a<bの時bを返す関数である。 Max(a, b) is a function that returns a when a>=b and b when a<b.

Min(a, b)は、a<=bの時、a、a>bの時bを返す関数である。 Min(a, b) is a function that returns a when a<=b and b when a>b.

Round(a)はaの丸め値を返す関数である。Round(a) = sign(a)*floor(abs(a)+0.5)。 Round(a) is a function that returns the rounded value of a. Round(a) = sign(a)*floor(abs(a)+0.5).

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

図4は、符号化ストリームTeにおけるデータの階層構造を示す図である。符号化ストリームTeは、例示的に、シーケンス、およびシーケンスを構成する複数のピクチャを含む。図4の(a)~(f)は、それぞれ、シーケンスSEQを既定する符号化ビデオシーケンス、ピクチャPICTを規定する符号化ピクチャ、スライスSを規定する符号化スライス、スライスデータを規定する符号化スライスデータ、符号化スライスデータに含まれる符号化ツリーユニット、符号化ツリーユニットに含まれる符号化ユニットを示す図である。 FIG. 4 is a diagram showing the hierarchical structure of data in the encoded stream Te. The encoded stream Te exemplarily includes a sequence and a plurality of pictures that constitute the sequence. (a) to (f) in FIG. 4 respectively represent an encoded video sequence that defines the sequence SEQ, an encoded picture that defines the picture PICT, an encoded slice that defines the slice S, and an encoded slice that defines the slice data. FIG. 3 is a diagram showing data, a coding tree unit included in coded slice data, and a coding unit included in the coding 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)
In the encoded video sequence, a set of data that the moving image decoding device 31 refers to in order to decode the sequence SEQ to be processed is defined. As shown in Figure 4(a), 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. Contains information SEI (Supplemental Enhancement Information).

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

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

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

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

なお、以下、スライス0~スライスNS-1のそれぞれを区別する必要が無い場合、符号の添え字を省略して記述することがある。また、以下に説明する符号化ストリームTeに含まれるデータであって、添え字を付している他のデータについても同様である。 Note that hereinafter, if there is no need to distinguish each of slices 0 to NS-1, the subscripts of the symbols may be omitted in the description. Further, the same applies to other data included in the encoded stream Te described below and having subscripts attached thereto.

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

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

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

なお、スライスヘッダは、ピクチャパラメータセットPPSへの参照(pic_parameter_set_id)を含んでいても良い。 Note that 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)と呼ぶこともある。
(encoded slice data)
The encoded slice data defines a set of data that the video decoding device 31 refers to in order to decode the slice data to be processed. The slice data includes CTUs, as shown in FIG. 4(d). A CTU is a block of fixed size (for example, 64x64) that constitutes a slice, and is also called a largest coding unit (LCU).

(符号化ツリーユニット)
図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自身も最上位の符号化ノードとして規定される。
(encoding tree unit)
In FIG. 4(e), a set of data that the video decoding device 31 refers to in order to decode the CTU to be processed is defined. CTU is the basic encoding process using recursive quad tree partitioning (QT (Quad Tree) partitioning), binary tree partitioning (BT (Binary Tree) partitioning), or ternary tree partitioning (TT (Ternary Tree) partitioning). It is divided into encoding units CU, which are standard units. The combination of BT partitioning and TT partitioning is called multi-tree partitioning (MT (Multi Tree) partitioning). A tree-structured node obtained by recursive quadtree partitioning is called a coding node. An intermediate node of a quadtree, a binary tree, and a tertiary tree is a coding node, and the CTU itself is defined as the topmost coding 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_flag)を含む。qt_split_cu_flag、mtt_split_cu_vertical_flag、mtt_split_cu_binary_flagは符号化ノード毎に伝送される。 CT includes, as CT information, a QT splitting flag (qt_split_cu_flag) indicating whether to perform QT splitting, an MT splitting flag (mtt_split_cu_flag) indicating whether or not to perform MT splitting, an MT splitting direction (mtt_split_cu_vertical_flag) indicating the splitting direction of MT splitting, Contains the MT split type (mtt_split_cu_binary_flag) that indicates the split type of MT split. qt_split_cu_flag, mtt_split_cu_vertical_flag, and 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 encoding node is divided into four encoding 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)). CU is the terminal node of the encoding node and is not further divided. A CU is a basic unit of encoding 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 encoding node is divided into MTs as follows. When mtt_split_cu_vertical_flag is 0 and mtt_split_cu_binary_flag is 1, the encoding node is horizontally divided into two encoding nodes (Figure 5(d)), and when mtt_split_cu_vertical_flag is 1 and mtt_split_cu_binary_flag is 1, the encoding node is horizontally divided into two encoding nodes. vertically divided into nodes (Figure 5(c)). Furthermore, when mtt_split_cu_vertical_flag is 0 and mtt_split_cu_binary_flag is 0, the encoding node is horizontally divided into 3 encoding nodes (Figure 5(f)), and when mtt_split_cu_vertical_flag is 1 and mtt_split_cu_binary_flag is 0, the encoding node is divided into 3 encoding nodes. It is vertically divided into two encoding nodes (Fig. 5(e)). These are shown in Figure 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画素の何れかをとり得る。 Also, 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 that the video decoding device 31 refers to in order to decode the encoding unit to be processed is defined. Specifically, the CU includes a CU header CUH, prediction parameters, transformation parameters, quantized transformation coefficients, and the like. The prediction mode etc. are defined in the CU header.

予測処理は、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 on a CU basis or on a sub-CU basis, which is obtained by further dividing a CU. If the sizes of the CU and sub-CU are equal, there is one sub-CU in the CU. If the CU is larger than the sub-CU size, the CU is divided into sub-CUs. For example, if the CU is 8x8 and the sub-CU is 4x4, the CU is divided into four sub-CUs, two horizontally and two vertically.

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

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

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

以下、インター予測の予測パラメータについて説明する。インター予測パラメータは、予測リスト利用フラグpredFlagL0、predFlagL1と、参照ピクチャインデックスrefIdxL0、refIdxL1と、動きベクトルmvL0、mvL1から構成される。予測リスト利用フラグpredFlagL0、predFlagL1は、各々L0リスト、L1リストと呼ばれる参照ピクチャリストが用いられるか否かを示すフラグであり、値が1の場合に対応する参照ピクチャリストが用いられる。なお、本明細書中「XXであるか否かを示すフラグ」と記す場合、フラグが0以外(たとえば1)をXXである場合、0をXXではない場合とし、論理否定、論理積などでは1を真、0を偽と扱う(以下同様)。但し、実際の装置や方法では真値、偽値として他の値を用いることもできる。 The prediction parameters for inter prediction will be explained below. The inter prediction parameters are composed of prediction list usage flags predFlagL0 and predFlagL1, reference picture indexes refIdxL0 and refIdxL1, and motion vectors mvL0 and mvL1. The prediction list usage flags predFlagL0 and predFlagL1 are flags indicating whether reference picture lists called L0 list and L1 list are used, respectively, and when the value is 1, the corresponding reference picture list is used. In this specification, when the term "flag indicating whether or not XX" is used, a flag other than 0 (for example, 1) is XX, and 0 is not XX, and logical negation, logical product, etc. Treat 1 as true and 0 as false (the same applies hereafter). However, in actual devices and methods, 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がある。 Syntax elements for deriving 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 precision. 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 of reference pictures stored in reference picture memory 306. FIG. 6 is a conceptual diagram showing an example of a reference picture and a reference picture list. In Figure 6(a), the rectangles are pictures, the arrows are reference relationships between pictures, the horizontal axis is time, I, P, and B in the rectangles are intra pictures, uni-predicted pictures, and bi-predicted pictures, and the numbers in the rectangles are decoding Indicates the order. As shown in the figure, the decoding order of pictures is I0, P1, B2, B3, B4, and the display order is I0, B3, B2, B4, P1. FIG. 6(b) shows an example of a reference picture list for picture B3 (target picture). The reference picture list is a list representing reference picture candidates, and one picture (slice) may have one or more reference picture lists. In the illustrated example, target picture B3 has two reference picture lists: L0 list RefPicList0 and L1 list RefPicList1. For each CU, the reference picture index refIdxLX specifies which picture in the reference picture list RefPicListX (X=0 or 1) is actually referred to. The figure shows an example where refIdxL0=2 and refIdxL1=0. Note that LX is a description method used when not distinguishing between L0 prediction and L1 prediction, and hereinafter, by replacing LX with L0 and L1, parameters for the L0 list and parameters for the L1 list are distinguished.

(マージ予測と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として符号化される。また、マージ予測モードの他に、アフィンフラグaffine_flagにより識別されるアフィン予測モードがあってもよい。マージ予測モードの一形態として、スキップフラグskip_flagにより識別されるスキップモードがあってもよい。なお、スキップモードとは、マージモードと同様の方法で予測パラメータを導出して用いるモードであり、かつ、予測誤差(残差画像)を符号化データに含めないモードである。換言すれば、スキップフラグskip_flagが1の場合、対象CUに関して、当該スキップフラグskip_flagとマージインデックスmerge_idxなどのマージモードに関連するシンタックスのみを含み、動きベクトルなどは符号化データに含まれない。このため、対象CUに対して、スキップフラグskip_flagがスキップモードを適用することを示している場合、当該スキップフラグskip_flag以外の予測パラメータの復号は省略される。
(Merge prediction and AMVP prediction)
Prediction parameter decoding (encoding) methods include merge prediction (merge) mode and AMVP (Advanced Motion Vector Prediction, adaptive motion vector prediction) mode, and the merge flag merge_flag is a flag for identifying these modes. Merge prediction mode is a mode used in which the prediction list usage flag predFlagLX (or inter prediction identifier inter_pred_idc), reference picture index refIdxLX, and motion vector mvLX are derived from the prediction parameters of already processed neighboring blocks without including them in the encoded data. . AMVP mode is a mode in which the inter prediction identifier inter_pred_idc, reference picture index refIdxLX, and motion vector mvLX are included in encoded data. Note that the motion vector mvLX is encoded as a predictive vector index mvp_LX_idx that identifies the predictive vector mvpLX, a difference vector mvdLX, and a motion vector accuracy mode amvr_mode. 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 merge prediction mode, there may be a skip mode identified by a skip flag skip_flag. Note that the skip mode is a mode in which prediction parameters are derived and used in the same manner as the merge mode, and a prediction error (residual image) is not included in encoded data. In other words, when the skip flag skip_flag is 1, for the target CU, only the skip flag skip_flag and syntax related to the merge mode such as the merge index merge_idx are included, and motion vectors and the like are not included in the encoded data. Therefore, when the skip flag skip_flag indicates that the skip mode is applied to the target CU, decoding of prediction parameters other than the skip flag skip_flag is omitted.

(動きベクトル)
動きベクトルmvLXは、異なる2つのピクチャ上のブロック間のシフト量を示す。動きベクトルmvLXに関する予測ベクトル、差分ベクトルを、それぞれ予測ベクトルmvpLX、差分ベクトルmvdLXと呼ぶ。
(motion vector)
The motion vector mvLX indicates the amount of shift between blocks on two different pictures. A predicted vector and a difference vector regarding the motion vector mvLX are called a predicted vector mvpLX and a 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 one of PRED_L0, PRED_L1, and PRED_BI. PRED_L0 and PRED_L1 indicate uni-prediction using one reference picture managed in the L0 list and L1 list, respectively. PRED_BI indicates bi-prediction BiPred using two reference pictures managed by L0 list and L1 list.

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

インター予測識別子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 they are mutually convertible.

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 bi-predictive biPred)
The flag biPred indicating whether it is bi-predictive BiPred can be derived depending on whether the two prediction list usage flags are both 1 or not. For example, it can be derived using the following formula.

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

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

パラメータ復号部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), which are not shown, and the CU decoding unit 3022 further includes a TU decoding unit 3024. ing. These may be collectively called a decoding module. The header decoding unit 3020 decodes parameter set information such as VPS, SPS, and PPS, and a slice header (slice information) from encoded data. CT information decoding section 3021 decodes CT from encoded data. CU decoding section 3022 decodes CU from encoded data. The TU decoding unit 3024 decodes QP update information (quantization correction value) and quantization prediction error (residual_coding) from encoded data when a prediction error is included in the TU.

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

また、以降では処理の単位としてCTU、CUを使用した例を記載するが、この例に限らず、サブCU単位で処理をしてもよい。あるいはCTU、CU、をブロック、サブCUをサブブロックと読み替え、ブロックあるいはサブブロック単位の処理としてもよい。 Furthermore, although an example will be described below in which CTUs and CUs are used as processing units, 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 and sub-CUs 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 encoded stream Te input from the outside, and decodes each code (syntax element).

エントロピー復号部301は、復号した符号をパラメータ復号部302に出力する。復号した符号とは、例えば、予測モードpredMode、マージフラグmerge_flag、マージインデックスmerge_idx、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、差分ベクトルmvdLX、動きベクトル精度モードamvr_mode等である。どの符号を復号するかの制御は、パラメータ復号部302の指示に基づいて行われる。 Entropy decoding section 301 outputs the decoded code to parameter decoding section 302. The decoded codes include, for example, 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, motion vector accuracy mode amvr_mode, and the like. Control of which code to decode is performed based on instructions from parameter decoding section 302.

(インター予測パラメータ復号部の構成)
インター予測パラメータ復号部303は、エントロピー復号部301から入力された符号に基づいて、予測パラメータメモリ307に記憶された予測パラメータを参照してインター予測パラメータを復号する。また、インター予測パラメータ復号部303は、復号したインター予測パラメータを予測画像生成部308に出力し、予測パラメータメモリ307に記憶する。
(Configuration of inter prediction parameter decoding unit)
Inter prediction parameter decoding section 303 decodes inter prediction parameters based on the code input from entropy decoding section 301 with reference to the prediction parameters stored in prediction parameter memory 307. Further, the inter prediction parameter decoding unit 303 outputs the decoded inter prediction parameter to the predicted 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 diagram showing the configuration of inter prediction parameter decoding section 303 according to this embodiment. The inter prediction parameter decoding unit 303 includes a merge prediction unit 30374, a DMVR unit 30375, a subblock prediction unit (affine prediction unit) 30372, an MMVD prediction unit (motion vector derivation unit) 30376, a Triangle prediction unit 30377, and an AMVP prediction parameter derivation unit 3032. , an addition section 3038. The merge prediction unit 30374 is configured to include a merge prediction parameter derivation unit 3036. The AMVP prediction parameter derivation unit 3032, merge prediction parameter derivation unit 3036, and affine prediction unit 30372 are means common to the video encoding device and the video decoding device, so they are collectively referred to as the motion vector derivation unit (motion vector It may also be called a derivation device).

インター予測パラメータ復号部303は、インター予測に関連するシンタックス要素の復号をエントロピー復号部301に指示し、符号化データに含まれるシンタックス要素、例えば、アフィンフラグaffine_flag、マージフラグmerge_flag、マージインデックスmerge_idx、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、差分ベクトルmvdLX、動きベクトル精度モードamvr_modeを抽出する。 The inter prediction parameter decoding unit 303 instructs the entropy decoding unit 301 to decode syntax elements related to inter prediction, and decodes syntax elements included in the encoded data, such as an affine flag affine_flag, a merge flag merge_flag, and a merge index merge_idx. , inter prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction vector index mvp_LX_idx, difference vector mvdLX, and motion vector accuracy mode amvr_mode are extracted.

アフィンフラグaffine_flagが1、すなわち、アフィン予測モードを示す場合、アフィン予測部30372は、サブブロックのインター予測パラメータを導出する。 When the affine flag affine_flag is 1, ie, indicates an affine prediction mode, the affine prediction unit 30372 derives the inter prediction parameter of the subblock.

マージフラグmerge_flagが1、すなわち、マージ予測モードを示す場合、マージインデックスmerge_idxを復号し、マージ予測パラメータ導出部3036に出力する。 When the merge flag merge_flag is 1, that is, indicates the merge prediction mode, the merge index merge_idx is decoded and output to the merge prediction parameter deriving unit 3036.

マージフラグmerge_flagが0、すなわち、AMVP予測モードを示す場合、AMVP予測パラメータとして、例えば、インター予測識別子inter_pred_idc、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、差分ベクトルmvdLXを復号する。AMVP予測パラメータ導出部3032は予測ベクトルインデックスmvp_LX_idxから予測ベクトルmvpLXを導出する。加算部3038では導出された予測ベクトルmvpLXと差分ベクトルmvdLXを加算し、動きベクトルmvLXを導出する。 When the merge flag merge_flag is 0, that is, indicates AMVP prediction mode, the inter prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction vector index mvp_LX_idx, and difference vector mvdLX are decoded as AMVP prediction parameters, for example. AMVP prediction parameter derivation unit 3032 derives prediction vector mvpLX from prediction vector index mvp_LX_idx. Addition unit 3038 adds the derived predicted vector mvpLX and difference vector mvdLX to derive a motion vector mvLX.

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

なお、アフィン予測部30372は、4パラメータMVDアフィン予測に用いるパラメータまたは6パラメータMVDアフィン予測に用いるパラメータを適宜導出してもよい。 Note that the affine prediction unit 30372 may appropriately derive parameters used for 4-parameter MVD affine prediction or parameters used for 6-parameter MVD affine prediction.

(マージ予測)
図9の(a)は、マージ予測部30374に含まれるマージ予測パラメータ導出部3036の構成を示す概略図である。マージ予測パラメータ導出部3036は、マージ候補導出部30361、マージ候補選択部30362を備える。なお、マージ候補は、予測リスト利用フラグpredFlagLX、動きベクトルmvLX、参照ピクチャインデックスrefIdxLXを含んで構成され、マージ候補リストに格納される。マージ候補リストに格納されたマージ候補には、所定の規則に従ってインデックスが割り当てられる。
(merge prediction)
FIG. 9(a) is a schematic diagram showing the configuration of the merge prediction parameter deriving 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. Note that the merging candidate includes a prediction list usage flag predFlagLX, a motion vector mvLX, and a reference picture index refIdxLX, and is stored in the merging candidate list. Merge candidates stored in the merge candidate list are assigned indexes according to predetermined rules.

マージ候補導出部30361は、復号済の隣接ブロックの動きベクトルと参照ピクチャインデックスrefIdxLXとをそのまま用いてマージ候補を導出する。それ以外に、マージ候補導出部30361は、後述する空間マージ候補導出処理、時間マージ候補導出処理、ペアワイズマージ候補導出処理、およびゼロマージ候補導出処理を適用してもよい。 The merging candidate deriving unit 30361 derives a merging candidate using the decoded motion vector of the adjacent block and the reference picture index refIdxLX as they are. In addition, the merging candidate deriving unit 30361 may apply a spatial merging candidate deriving process, a temporal merging candidate deriving process, a pairwise merging candidate deriving process, and a zero merging candidate deriving process, which will be described later.

空間マージ候補導出処理として、マージ候補導出部30361は、所定の規則に従って、予測パラメータメモリ307が記憶している予測パラメータを読み出し、マージ候補に設定する。参照ピクチャの指定方法は、例えば、対象ブロックから予め定めた範囲内にある隣接ブロック(例えば、対象ブロックの左A1、右B1、右上B0、左下A0、左上B2にそれぞれ接するブロックの全部または一部)のそれぞれに係る予測パラメータである。各々のマージ候補をA1,B1,B0,A0,B2と呼ぶ。 As a spatial merging candidate derivation process, the merging candidate deriving unit 30361 reads out the prediction parameters stored in the prediction parameter memory 307 according to a predetermined rule, and sets them as merging candidates. The reference picture can be specified by, for example, adjacent blocks within a predetermined range from the target block (for example, all or part of the blocks that are in contact with the left A1, right B1, upper right B0, lower left A0, and upper left B2 of the target block, respectively). ) are the prediction parameters for each of them. Each merge candidate is called A1, B1, B0, A0, and B2.

ここで、A1,B1,B0,A0,B2は各々、下記の座標を含むブロックから導出される動き情報である。 Here, A1, B1, B0, A0, and B2 are motion information derived from blocks including the following coordinates.

A1: (xCb - 1, yCb + cbHeight - 1)
B1: (xCb + cbWidth - 1, yCb - 1)
B0: (xCb + cbWidth, yCb - 1)
A0: (xCb - 1, yCb + cbHeight)
B2: (xCb - 1, yCb - 1)
時間マージ導出処理として、マージ候補導出部30361は、対象ブロックの右下CBR、あるいは、中央の座標を含む参照画像中のブロックCの予測パラメータを、予測パラメータメモリ307から読み出してマージ候補Colとし、マージ候補リストmergeCandList[]に格納する。
A1: (xCb - 1, yCb + cbHeight - 1)
B1: (xCb + cbWidth - 1, yCb - 1)
B0: (xCb + cbWidth, yCb - 1)
A0: (xCb - 1, yCb + cbHeight)
B2: (xCb - 1, yCb - 1)
As the temporal merge derivation process, the merging candidate deriving unit 30361 reads out the prediction parameters of the block C in the reference image including the lower right CBR or center coordinates of the target block from the prediction parameter memory 307 and sets it as a merging candidate Col. Store in the merge candidate list mergeCandList[].

ペアワイズ導出部は、ペアワイズ候補avgKを導出し、マージ候補リストmergeCandList[]に格納する。 The pairwise derivation unit derives the pairwise candidate avgK and stores it in the merge candidate list mergeCandList[].

マージ候補導出部30361は、参照ピクチャインデックスrefIdxLXが0…Mであり、動きベクトルmvLXのX成分、Y成分が共に0であるゼロマージ候補Z0,…,ZMを導出しマージ候補リストに格納する。 The merging candidate deriving unit 30361 derives zero merging candidates Z0,...,ZM in which the reference picture index refIdxLX is 0...M and the X component and Y component of the motion vector mvLX are both 0, and stores them in the merging candidate list.

マージ候補導出部30361またはペアワイズ導出部が各マージ候補をマージ候補リストmergeCandList[]に格納する順番は、例えば、空間マージ候補(A1,B1,B0,A0,B2)、時間マージ候補Col、ペアワイズ候補AvgK、ゼロマージ候補ZeroCandKである。なお、利用可能でない(ブロックがイントラ予測等)参照ブロックはマージ候補リストに格納しない。
i = 0
if( availableFlagA1 )
mergeCandList[ i++ ] = A1
if( availableFlagB1 )
mergeCandList[ i++ ] = B1
if( availableFlagB0 )
mergeCandList[ i++ ] = B0
if( availableFlagA0 )
mergeCandList[ i++ ] = A0
if( availableFlagB2 )
mergeCandList[ i++ ] = B2
if( availableFlagCol )
mergeCandList[ i++ ] = Col
if( availableFlagAvgK )
mergeCandList[ i++ ] = avgK
if( i < MaxNumMergeCand )
mergeCandList[ i++ ] = ZK
なお、対象ブロックの左上座標を(xCb, yCb)とし、対象ブロックの幅をcbWidthとし、対象ブロックの高さをcbHeightとする。
The order in which the merge candidate derivation unit 30361 or the pairwise derivation unit stores each merge candidate in the merge candidate list mergeCandList[] is, for example, spatial merge candidates (A1, B1, B0, A0, B2), temporal merge candidates Col, and pairwise candidates. AvgK, zero merge candidate ZeroCandK. Note that reference blocks that are not available (blocks are intra-predicted, etc.) are not stored in the merging candidate list.
i = 0
if( availableFlagA1 )
mergeCandList[ i++ ] = A1
if( availableFlagB1 )
mergeCandList[ i++ ] = B1
if( availableFlagB0 )
mergeCandList[ i++ ] = B0
if( availableFlagA0 )
mergeCandList[ i++ ] = A0
if( availableFlagB2 )
mergeCandList[ i++ ] = B2
if( availableFlagCol )
mergeCandList[ i++ ] = Col
if( availableFlagAvgK )
mergeCandList[ i++ ] = avgK
if( i < MaxNumMergeCand )
mergeCandList[ i++ ] = ZK
Note that the upper left coordinates of the target block are (xCb, yCb), the width of the target block is cbWidth, and the height of the target block is cbHeight.

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

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

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

(MMVD予測部30373)
MMVD予測部30373は、マージ候補導出部30361で導出した中心ベクトルmvdLX(マージ候補の動きベクトル)に、差分ベクトルmvdLXを加算して動きベクトルを導出する。
(MMVD Prediction Department 30373)
The MMVD prediction unit 30373 adds the difference vector mvdLX to the center vector mvdLX (motion vector of the merging candidate) derived by the merging candidate deriving unit 30361 to derive a motion vector.

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

MMVD予測部30376は、中心ベクトルmvLN[]をbase_candidate_idxで選択する。 The MMVD prediction unit 30376 selects the center vector mvLN[] using base_candidate_idx.

N = mergeCandList[base_candidate_idx]
MMVD予測部30376は、ベース距離(mvdUnit[0], mvdUnit[1])と距離DistFromBaseMVを導出する。
N = mergeCandList[base_candidate_idx]
The MMVD prediction unit 30376 derives the base distance (mvdUnit[0], mvdUnit[1]) and the distance DistFromBaseMV.

dir_table_x[] = { 8, -8, 0, 0, 6, -6, -6, 6 }
dir_table_y[] = { 0, 0, 8, -8, 6, -6, 6, -6 }
mvdUnit[0] = dir_table_x[direction_idx]
mvdUnit[1] = dir_table_y[direction_idx]
DistFromBaseMV = DistanceTable[distance_idx]
MMVD予測部30376は、差分ベクトルrefineMv[]を導出する。
dir_table_x[] = { 8, -8, 0, 0, 6, -6, -6, 6 }
dir_table_y[] = { 0, 0, 8, -8, 6, -6, 6, -6 }
mvdUnit[0] = dir_table_x[direction_idx]
mvdUnit[1] = dir_table_y[direction_idx]
DistFromBaseMV = DistanceTable[distance_idx]
The MMVD prediction unit 30376 derives a difference vector refineMv[].

firstMv[0] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[0]
firstMv[1] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[1]
ここでshiftMMVDは、動き補償部3091(補間部)での動きベクトルの精度MVPRECにあうように差分ベクトルの大きさを調整する値である。
firstMv[0] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[0]
firstMv[1] = (DistFromBaseMV<<shiftMMVD) * mvdUnit[1]
Here, shiftMMVD is a value that adjusts the magnitude of the difference vector to match the motion vector accuracy MVPREC in the motion compensation unit 3091 (interpolation unit).

refineMvL0[0] = firstMv[0]
refineMvL0[1] = firstMv[1]
refineMvL1[0] = -firstMv[0]
refineMvL1[1] = -firstMv[1]
最終的に、MMVD予測部30376は、差分ベクトルrefineMvLXと中心ベクトルmvLXNから以下のように、MMVDマージ候補の動きベクトルを導出する。
refineMvL0[0] = firstMv[0]
refineMvL0[1] = firstMv[1]
refineMvL1[0] = -firstMv[0]
refineMvL1[1] = -firstMv[1]
Finally, the MMVD prediction unit 30376 derives the motion vector of the MMVD merging candidate from the difference vector refineMvLX and the center vector mvLXN 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]
(AMVP予測)
図9(b)は、本実施形態に係るAMVP予測パラメータ導出部3032の構成を示す概略図である。AMVP予測パラメータ導出部3032は、ベクトル候補導出部3033とベクトル候補選択部3034を備える。ベクトル候補導出部3033は、参照ピクチャインデックスrefIdxLXに基づいて予測パラメータメモリ307が記憶する復号済みの隣接ブロックの動きベクトルmvLXから予測ベクトル候補を導出し、予測ベクトル候補リストmvpListLX[]に格納する。
mvL0[ 0 ] = mvL0N[ 0 ] + refineMvL0[0]
mvL0[ 1 ] = mvL0N[ 1 ] + refineMvL0[1]
mvL1[ 0 ] = mvL1N[ 0 ] + refineMvL1[0]
mvL1[ 1 ] = mvL1N[ 1 ] + refineMvL1[1]
(AMVP prediction)
FIG. 9(b) is a schematic diagram showing the configuration of the AMVP prediction parameter deriving unit 3032 according to this 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 a predicted 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 predicted 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 predictive vector index mvp_LX_idx from among the predictive vector candidates in the predictive vector candidate list mvpListLX[] as the predictive vector mvpLX. Vector candidate selection section 3034 outputs the selected predicted vector mvpLX to addition section 3038.

加算部3038は、AMVP予測パラメータ導出部3032から入力された予測ベクトルmvpLXと復号した差分ベクトルmvdLXを加算して動きベクトルmvLXを算出する。加算部3038は、算出した動きベクトルmvLXを予測画像生成部308および予測パラメータメモリ307に出力する。 Adding unit 3038 calculates motion vector mvLX by adding predicted vector mvpLX input from AMVP prediction parameter deriving unit 3032 and decoded difference vector mvdLX. Addition unit 3038 outputs the calculated motion vector mvLX to predicted image generation unit 308 and 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 precision mode amvr_mode is a syntax for switching the precision of motion vectors derived in AMVP mode. For example, when amvr_mode=0, 1, 2, the motion vector precision mode amvr_mode switches between 1/4 pixel, 1 pixel, and 4 pixel precision.

動きベクトルの精度を1/16精度とする場合、1/4, 1, 4画素精度の動きベクトル差分を1/16画素精度の動きベクトル差分に変更するために下記のように、amvr_modeから導出されるMvShift (=1<<amvr_mode)を用いて逆量子化してもよい。 If the motion vector precision is 1/16 precision, in order to change the motion vector difference with 1/4, 1, and 4 pixel precision to the motion vector difference with 1/16 pixel precision, it is derived from amvr_mode as shown below. Inverse quantization may be performed using MvShift (=1<<amvr_mode).

mvdLX[0] = mvdLX[0] << (MvShift + 2)
mvdLX[1] = mvdLX[1] << (MvShift + 2)
なお、さらにパラメータ復号部302は、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)
Note that the parameter decoding unit 302 may further derive mvdLX[] by decoding the following syntax.
・abs_mvd_greater0_flag
・abs_mvd_minus2
・mvd_sign_flag
Decrypt and do. 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 translational MVD (MotionModelIdc[ x ][ y ] ==0), and in the case of control point MVD (MotionModelIdc[ x ][ y ] != 0) Set to mvdCpLX.

if (MotionModelIdc[ x ][ y ] == 0)
mvdLX[ x0 ][ y0 ][ compIdx ] = lMvd[ compIdx ]
else
mvdCpLX[ x0 ][ y0 ][ compIdx ] = lMvd[ compIdx ]<<2
(DMVR)
続いて、DMVR部30375が行うDMVR(Decoder side Motion Vector Refinement)処理について説明する。DMVR部30375は、対象CUに対して、マージフラグmerge_flagがマージ予測モードを適用することを示している場合、又は、スキップフラグskip_flagがスキップモードを適用することを示している場合、マージ予測部30374が導出する当該対象CUの動きベクトルmvLXを、参照画像を用いて修正する。
if (MotionModelIdc[ x ][ y ] == 0)
mvdLX[ x0 ][ y0 ][ compIdx ] = lMvd[ compIdx ]
else
mvdCpLX[ x0 ][ y0 ][ compIdx ] = lMvd[ compIdx ]<<2
(DMVR)
Next, DMVR (Decoder side Motion Vector Refinement) processing performed by the DMVR unit 30375 will be described. If the merge flag merge_flag indicates that the merge prediction mode is applied to the target CU, or if the skip flag skip_flag indicates that the skip mode is applied to the target CU, the merge prediction unit 30374 The motion vector mvLX of the target CU derived by is corrected using the reference image.

具体的には、マージ予測部30374が導出する予測パラメータが双予測である場合において、2つの参照ピクチャに対応する動きベクトルから導出される予測画像を用いて、動きベクトルを修正する。修正後の動きベクトルmvLXは、インター予測画像生成部309に供給される。 Specifically, when the prediction parameters derived by the merge prediction unit 30374 are bi-prediction, the motion vector is modified using predicted images derived from motion vectors corresponding to two reference pictures. The corrected motion vector mvLX is supplied to the inter predicted image generation unit 309.

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

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

ループフィルタ305は、符号化ループ内に設けたフィルタで、ブロック歪やリンギング歪を除去し、画質を改善するフィルタである。ループフィルタ305は、加算部312が生成したCUの復号画像に対し、デブロッキングフィルタ、サンプル適応オフセット(SAO)、適応ループフィルタ(ALF)等のフィルタを施す。 The loop filter 305 is a filter provided in the encoding loop, and is a filter that removes block distortion and ringing distortion and improves 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 target CU.

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

予測画像生成部308には、予測モードpredMode、予測パラメータ等が入力される。また、予測画像生成部308は、参照ピクチャメモリ306から参照ピクチャを読み出す。予測画像生成部308は、予測モードpredModeが示す予測モードで、予測パラメータと読み出した参照ピクチャ(参照ピクチャブロック)を用いてブロックもしくはサブブロックの予測画像を生成する。ここで、参照ピクチャブロックとは、参照ピクチャ上の画素の集合(通常矩形であるのでブロックと呼ぶ)であり、予測画像を生成するために参照する領域である。 A prediction mode predMode, prediction parameters, etc. are input to the predicted image generation unit 308. The predicted image generation unit 308 also reads a reference picture from the reference picture memory 306. The predicted image generation unit 308 generates a predicted image of a block or subblock 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 a reference picture (usually called a block because it is rectangular), and is an area to be referenced to generate a predicted image.

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

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

(動き補償)
動き補償部3091(補間画像生成部3091)は、インター予測パラメータ復号部303から入力された、インター予測パラメータ(予測リスト利用フラグpredFlagLX、参照ピクチャインデックスrefIdxLX、動きベクトルmvLX)に基づいて、参照ピクチャメモリ306から、参照ピクチャインデックスrefIdxLXで指定された参照ピクチャRefPicLXにおける、対象ブロックの位置を起点として動きベクトルmvLXだけシフトした位置にあるブロックを読み出すことによって補間画像(動き補償画像)を生成する。ここで、動きベクトルmvLXの精度が整数精度でない場合には、動き補償フィルタと呼ばれる小数位置の画素を生成するためのフィルタを施して、動き補償画像を生成する。
(motion compensation)
The motion compensation unit 3091 (interpolation image generation unit 3091) generates a reference picture memory 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 306, an interpolated image (motion compensated image) is generated by reading a block located at a position shifted by the motion vector mvLX from the position of the target block in the reference picture RefPicLX specified by the reference picture index refIdxLX. Here, if the precision of the motion vector mvLX is not integer precision, a filter for generating pixels at decimal positions called a motion compensation filter is applied to generate a motion compensated image.

動き補償部3091は、まず、予測ブロック内座標(x,y)に対応する整数位置(xInt,yInt)および位相(xFrac,yFrac)を以下の式で導出する。 The motion compensation unit 3091 first derives the integer position (xInt, yInt) and phase (xFrac, yFrac) corresponding to the intra-prediction block coordinates (x, y) using 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) are the upper left coordinates of the bW*bH size block, x=0...bW-1, y=0...bH-1, and MVPREC is the precision of the motion vector mvLX (1/MVPREC pixel accuracy). 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. Σ below is the sum of k=0..NTAP-1 with respect to k, shift1 is a normalization parameter that adjusts the range of values, and 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
Next, the motion compensation unit 3091 performs vertical interpolation processing on the temporary image temp[][] to derive an interpolated image Pred[][]. Σ below is the sum of k=0..NTAP-1 with respect to k, shift2 is a normalization parameter that adjusts the range of values, and offset2=1<<(shift2-1).

Pred[x][y] = (ΣmcFilter[yFrac][k]*temp[x][y+k-NTAP/2+1]+offset2)>>shift2
以上の補間画像生成処理を、Interpolation(refImg,xPb,yPb,bW,bH,mvLX)で表してもよい。
Pred[x][y] = (ΣmcFilter[yFrac][k]*temp[x][y+k-NTAP/2+1]+offset2)>>shift2
The above interpolation image generation process may be expressed as Interpolation(refImg,xPb,yPb,bW,bH,mvLX).

(合成部)
合成部3095は、動き補償部3091から供給される補間画像、インター予測パラメータ復号部303から供給されるインター予測パラメータ、及び、イントラ予測画像生成部310から供給されるイントラ画像を参照して、予測画像を生成し、生成した予測画像を加算部312に供給する。
(Synthesis department)
The synthesis unit 3095 performs prediction by referring to the interpolation image supplied from the motion compensation unit 3091, the inter prediction parameters supplied from the inter prediction parameter decoding unit 303, and the intra image supplied from the intra prediction image generation unit 310. An image is generated, and the generated predicted image is supplied to the addition unit 312.

合成部3095は、Combined intra/inter合成部30951、Triangle合成部30952、BDOF部30954を備えている。 The synthesis section 3095 includes a combined intra/inter synthesis section 30951, a triangle synthesis section 30952, and a BDOF section 30954.

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

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

(BDOF処理)
BDOF部30954は、BDOF(Bi-directional optical flow;双予測勾配変化)処理を行うことによって、予測画像を生成する。BDOF部30954の詳細は、後述する。
(BDOF processing)
The BDOF unit 30954 generates a predicted image by performing BDOF (Bi-directional optical flow; bi-predictive gradient change) processing. Details of the BDOF section 30954 will be described later.

(重み予測)
重み予測では、動き補償画像PredLXに重み係数を乗算することによりブロックの予測画像を生成する。予測リスト利用フラグの一方(predFlagL0もしくはpredFlagL1)が1(単予測)、かつ、重み予測を用いない場合、動き補償画像PredLX(LXはL0もしくはL1)を画素ビット数bitDepthに合わせる以下の式の処理を行う。
(weight prediction)
In weight prediction, a predicted image of a block is generated by multiplying the motion compensated image PredLX by a weighting coefficient. If one of the prediction list usage flags (predFlagL0 or predFlagL1) is 1 (uni-prediction) and weight prediction is not used, process the following formula to match the motion compensated image PredLX (LX is L0 or L1) to the pixel bit number 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, offset1=1<<(shift1-1).
In addition, when both reference list usage flags (predFlagL0 and predFlagL1) are 1 (bi-prediction BiPred) and weight prediction is not used, the following formula is used to average motion compensated images PredL0 and PredL1 to match the number of pixel bits. conduct.

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).

さらに、単予測、かつ、重み予測を行う場合、合成部3095は重み予測係数w0とオフセットo0を符号化データから導出し、以下の式の処理を行う。 Furthermore, when performing uni-prediction and weight prediction, the synthesis unit 3095 derives a weight prediction coefficient w0 and an offset o0 from the encoded data, and performs processing according to 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、かつ、重み予測を行う場合、合成部3095は重み予測係数w0、w1、o0、o1を符号化データから導出し、以下の式の処理を行う。 Furthermore, when performing bi-prediction BiPred and weight prediction, the synthesis unit 3095 derives weight prediction coefficients w0, w1, o0, and o1 from the encoded data, and performs processing according to the following equation.

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

逆量子化・逆変換部311は、エントロピー復号部301から入力された量子化変換係数を逆量子化して変換係数を求める。この量子化変換係数は、符号化処理において、予測誤差に対してDCT(Discrete Cosine Transform、離散コサイン変換)、DST(Discrete Sine Transform、離散サイン変換)、等の周波数変換を行い量子化して得られる係数である。逆量子化・逆変換部311は、求めた変換係数について逆DCT、逆DST等の逆周波数変換を行い、予測誤差を算出する。逆量子化・逆変換部311は予測誤差を加算部312に出力する。 The inverse quantization/inverse transform unit 311 inversely quantizes the quantized transform coefficients input from the entropy decoding unit 301 to obtain transform coefficients. This quantized transform coefficient is obtained by performing frequency transform such as DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform) on the prediction error and quantizing it in the encoding process. It is a coefficient. The inverse quantization/inverse transform unit 311 performs inverse frequency transform such as inverse DCT and inverse DST on the obtained transform coefficients to calculate a prediction error. The inverse quantization/inverse transformation section 311 outputs the prediction error to the addition section 312.

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

(BDOF予測)
次に、BDOF部30954が行うBDOF処理を用いた予測(BDOF予測)の詳細について説明する。BDOF部30954は、双予測モードにおいて、2つの予測画像(第1の予測画像及び第2の予測画像)及び勾配補正項を参照して予測画像を生成する。
(BDOF prediction)
Next, details of prediction using BDOF processing (BDOF prediction) performed by the BDOF unit 30954 will be described. The BDOF unit 30954 generates a predicted image in bi-prediction mode by referring to two predicted images (a first predicted image and a second predicted image) and a gradient correction term.

図11は、予測画像を導出する処理の流れを説明するフローチャートである。 FIG. 11 is a flowchart illustrating the flow of processing for deriving a predicted image.

インター予測パラメータ復号部303がL0の単方向予測と判定(S101で、inter_pred_idcが0)した場合、動き補償部3091はL0予測画像PredL0[x][y]を生成(S102)する。インター予測パラメータ復号部303がL1の単方向予測と判定(S101で、inter_pred_idcが1)した場合、動き補償部3091はL1予測画像PredL1[x][y]を生成(S103)する。一方、インター予測パラメータ復号部303が双予測モードであると判定(S101で、inter_pred_idcが2)した場合、以下のS104の処理に続く。S104にて、合成部3095はBDOF処理を行うか否かを示すbdofFlagを参照しBDOF処理の要否を判定する。bdofFlagがTRUEを示すと、BDOF部30954はBDOF処理を実行して双方向予測画像を生成する(S106)。bdofFlagがFALSEを示すと、合成部3095は通常の双方予測画像生成で予測画像を生成する(S105)。 When the inter prediction parameter decoding unit 303 determines that L0 is unidirectionally predicted (inter_pred_idc is 0 in S101), the motion compensation unit 3091 generates an L0 predicted image PredL0[x][y] (S102). When the inter prediction parameter decoding unit 303 determines L1 unidirectional prediction (inter_pred_idc is 1 in S101), the motion compensation unit 3091 generates an L1 predicted image PredL1[x][y] (S103). On the other hand, if the inter prediction parameter decoding unit 303 determines that the bi-prediction mode is selected (inter_pred_idc is 2 in S101), the process continues to S104 below. In S104, the synthesis unit 3095 refers to bdofFlag, which indicates whether or not to perform BDOF processing, and determines whether BDOF processing is necessary. When bdofFlag indicates TRUE, the BDOF unit 30954 executes BDOF processing to generate a bidirectional predicted image (S106). When bdofFlag indicates FALSE, the synthesis unit 3095 generates a predicted image by normal bidirectional predicted image generation (S105).

BDOF処理を行うか否かを示すbdofFlagは、以下のような条件の場合、TRUEと設定する。 bdofFlag, which indicates whether or not to perform BDOF processing, is set to TRUE under the following conditions.

インター予測パラメータ復号部303はL0参照画像refImgL0及びL1参照画像refImgL1が異なる参照画像であって、かつ、対象ピクチャに対し2枚のピクチャが反対方向の場合に、bdofFlagにTRUEを導出してもよい。具体的には、対象画像をcurrPicとすると、DiffPicOrderCnt(currPic,refImgL0)*DiffPicOrderCnt(currPic,refImgL1)<0となる条件を満たす場合に、bdofFlagはTRUEを示す。ここで、DiffPicOrderCnt()は、以下のように2枚の画像のPOC(Picture Order Count:ピクチャの表示順序)の差分を導出する関数である。 The inter prediction parameter decoding unit 303 may derive TRUE to bdofFlag when the L0 reference image refImgL0 and the L1 reference image refImgL1 are different reference images, and the two pictures are in opposite directions with respect to the target picture. . Specifically, when the target image is currPic, if the condition of DiffPicOrderCnt(currPic,refImgL0)*DiffPicOrderCnt(currPic,refImgL1)<0 is satisfied, bdofFlag indicates TRUE. Here, DiffPicOrderCnt( ) is a function that derives the difference in POC (Picture Order Count: picture display order) between two images as follows.

DiffPicOrderCnt(picA,picB) = PicOrderCnt(picA)-PicOrderCnt(picB)
bdofFlagがTRUEを示す条件として、対象ブロックが、サブブロック予測(アフィン予測)でないという条件を追加してもよい。
DiffPicOrderCnt(picA,picB) = PicOrderCnt(picA)-PicOrderCnt(picB)
As a condition that bdofFlag is TRUE, a condition that the target block is not subblock prediction (affine prediction) may be added.

また、bdofFlagがTRUEを示す条件として、重み付き予測において、L0予測とL1予測のいずれもが、重み付き予測を行わない、という条件を加えてもよい。具体的には、L0予測ピクチャに輝度の重み係数w0とオフセットo0が存在するか否かを示すluma_weight_l0_flag[refIdxL0 ]と、L1予測ピクチャに輝度の重み係数w1とオフセットo1が存在するか否かを示すluma_weight_l1_flag[ refIdxL1 ]が両方ともFALSEの場合、bdofFlagがTRUEを示す条件とする。 Further, as a condition for bdofFlag to be TRUE, a condition may be added that neither L0 prediction nor L1 prediction performs weighted prediction in weighted prediction. Specifically, luma_weight_l0_flag[refIdxL0] indicates whether the luminance weighting coefficient w0 and offset o0 exist in the L0 predicted picture, and luma_weight_l0_flag[refIdxL0] indicates whether the luminance weighting coefficient w1 and offset o1 exist in the L1 predicted picture. If both of the indicated luma_weight_l1_flag[refIdxL1] are FALSE, the condition is that bdofFlag is TRUE.

図12を用いて、bdofFlagがTRUEの場合の、具体的なBDOF部30954が行う処理の内容について説明する。BDOF部30954は、L0,L1予測画像生成部309541と、フラグ設定部309542と、勾配画像生成部309543と、相関パラメータ計算部309544と、動き補償修正値導出部309545と、双方向予測画像生成部309546とを備えている。BDOF部30954は動き補償部3091から受信した補間画像と、インター予測パラメータ復号部303から受信したインター予測パラメータとから予測画像を生成し、生成した予測画像を加算部312に出力する。なお、勾配画像から動き補償修正値bdofOffset(動き補償修正画像)を導出し、PredL0、PredL1の予測画像を修正して導出する処理を、双方向勾配変化処理と呼ぶ。 The specific contents of the process performed by the BDOF unit 30954 when bdofFlag is TRUE will be described using FIG. 12. The BDOF unit 30954 includes an L0, L1 predicted image generation unit 309541, a flag setting unit 309542, a gradient image generation unit 309543, a correlation parameter calculation unit 309544, a motion compensation correction value derivation unit 309545, and a bidirectional predicted image generation unit 309546. The BDOF unit 30954 generates a predicted image from the interpolated image received from the motion compensation unit 3091 and the inter prediction parameters received from the inter prediction parameter decoding unit 303, and outputs the generated predicted image to the addition unit 312. Note that the process of deriving a motion compensation correction value bdofOffset (motion compensation correction image) from the gradient image and correcting and deriving the predicted images of PredL0 and PredL1 is called bidirectional gradient change processing.

まず、L0,L1予測画像生成部309541では、BDOF処理に用いられる、L0、L1予測画像を生成する。ここで、CUをサブブロックに分割する。これにより、サブブロック単位の並列処理を可能とし、一度の処理に必要なメモリ量を削減できる。 First, the L0, L1 predicted image generation unit 309541 generates L0, L1 predicted images used for BDOF processing. Here, the CU is divided into subblocks. This enables parallel processing in sub-block units and reduces the amount of memory required for one-time processing.

具体的な、サブブロックの基本のサイズは16x16であってもよい。例えばCUのサイズがcbWidth、cbHeightの場合、CU内の水平方向のサブブロック数numSbX、垂直方向のサブブロック数numSbY、サブブロックのサイズsbWidth、sbHeightは以下で導出される。 Specifically, the basic size of the sub-block may be 16x16. For example, when the size of a CU is cbWidth and cbHeight, the number of subblocks in the horizontal direction numSbX, the number of subblocks in the vertical direction numSbY, and the subblock sizes sbWidth and sbHeight in the CU are derived as follows.

numSbX = ( cbWidth > 16 ) ? ( cbWidth >> 4 ) : 1
numSbY = ( cbHeight > 16 ) ? ( cbHeight >> 4 ) : 1
sbWidth = cbWidth / numSbX
sbHeight = cbHeight / numSbY
次に、図14で示されるサブブロック単位毎のL0,L1予測画像をもとに、BDOF処理をおこなうが、勾配を求めるために、サブブロックの周囲1画素分の補間画像情報を追加で必要とする。この補間画像情報は、後述の勾配画像生成では、通常の補間フィルタではなく近傍の画素を用いる。それ以外の場合は、ピクチャの外側と同様に、周囲の画素をコピーしたパディング領域である。また、BDOF処理の単位は、サブブロック単位以下の4x4画素であり、処理自体は、周囲1画素を加えた、6x6の画素を用いて処理を行う。
numSbX = ( cbWidth > 16 ) ? ( cbWidth >> 4 ) : 1
numSbY = ( cbHeight > 16 ) ? ( cbHeight >> 4 ) : 1
sbWidth = cbWidth / numSbX
sbHeight = cbHeight / numSbY
Next, BDOF processing is performed based on the L0 and L1 predicted images for each subblock shown in Figure 14, but in order to obtain the gradient, interpolated image information for one pixel around the subblock is additionally required. shall be. For this interpolation image information, neighboring pixels are used instead of a normal interpolation filter in gradient image generation, which will be described later. Otherwise, it is a padding area that copies surrounding pixels, similar to the outside of the picture. Furthermore, the unit of BDOF processing is 4x4 pixels, which is a sub-block unit or less, and the processing itself is performed using 6x6 pixels, including one surrounding pixel.

フラグ設定部309542で、サブブロック単位のBDOF処理を行うか否かを示すフラグsbBdofFlagと、4x4画素単位でのBDOF処理を行うか否かを示すフラグbdofUtilizationFlag[xIdx][yIdx]の値の設定を行う。ここで、サブブロックの幅と高さの画素数をsbWidthとsbHeightとする。xIdxは、0から(sbWidth>>2)-1までの値をとる、4x4画素ブロックの水平方向のアドレスであり、yIdxは、0から(sbHeight>>2)-1までの値をとる、4x4画素ブロックの垂直方向のアドレスである。sbBdofFlagとbdofUtilizationFlag[xIdx][yIdx]は、TRUEの場合、BDOF処理を行い、FALSEの場合、双方向予測処理を行う。 The flag setting unit 309542 sets the values of the flag sbBdofFlag, which indicates whether to perform BDOF processing in sub-block units, and the flag bdofUtilizationFlag[xIdx][yIdx], which indicates whether to perform BDOF processing in 4x4 pixel units. conduct. Here, let the number of pixels of the width and height of the sub-block be sbWidth and sbHeight. xIdx is the horizontal address of a 4x4 pixel block, taking values from 0 to (sbWidth>>2)-1, and yIdx is the 4x4 pixel block taking values from 0 to (sbHeight>>2)-1. This is the vertical address of the pixel block. When sbBdofFlag and bdofUtilizationFlag[xIdx][yIdx] are TRUE, BDOF processing is performed, and when FALSE, bidirectional prediction processing is performed.

まず、サブブロック単位の閾値sbDiffThres、4x4画素ブロック単位の閾値bdofBlkDiffThres、およびサブブロック単位の差分絶対値和sbSumDiffは、次のように導出する。 First, the threshold value sbDiffThres in sub-block units, the threshold value bdofBlkDiffThres in 4x4 pixel block units, and the sum of absolute differences sbSumDiff in sub-block units are derived as follows.

sbDiffThres = 4 * sbWidth*sbHeight
bdofBlkDiffThres = 128
本実施の形態では、sbDiffThresは画素あたり4、bdofBlkDiffThresは128=8*4*4なので、画素あたり8の値を閾値としているが、この値以外を用いてもよい。例えば、2倍の値、sbDiffThres = 8 * sbWidth*sbHeight、bdofBlkDiffThres = 256でもよい。また、sbDiffThres=0とすることで、サブブロック単位の切り替えをオフにしてもよく、bdofBlkDiffThres=0とすることで、4x4画素ブロック単位の切り替えをオフにしてもよい。
sbDiffThres = 4 * sbWidth*sbHeight
bdofBlkDiffThres = 128
In this embodiment, sbDiffThres is 4 per pixel and bdofBlkDiffThres is 128=8*4*4, so a value of 8 per pixel is used as the threshold, but values other than these may be used. For example, double the value, sbDiffThres = 8 * sbWidth*sbHeight, bdofBlkDiffThres = 256. Further, by setting sbDiffThres=0, switching in units of sub-blocks may be turned off, and by setting bdofBlkDiffThres=0, switching in units of 4x4 pixel blocks may be turned off.

まず、sbSumDiffの値を下記のように設定する。 First, set the value of sbSumDiff as shown below.

sbSumDiff = 0
その上で、4x4画素ブロック毎のxIdx=0..(sbWidth>>2)-1およびyIdx=0..(sbHeight>>2)-1のループを回して、4x4画素単位での差分絶対値和bdofBlkSumDiffおよびbdofUtilizationFlag[xIdx][yIdx]は次のように導出される。
sbSumDiff = 0
Then, run a loop of xIdx=0..(sbWidth>>2)-1 and yIdx=0..(sbHeight>>2)-1 for each 4x4 pixel block, and calculate the absolute difference value in 4x4 pixel units. The sum bdofBlkSumDiff and bdofUtilizationFlag[xIdx][yIdx] are derived as follows.

bdofBlkSumDiff
= sum4(Abs((PredL0[(xIdx<<2)+1+i][(yIdx<<2)+1+j]>>shift4)
?(PredL1[(xIdx<<2)+1+i][(yIdx<<2)+1+j]>>shift4))) (式BDOF-1)
shift4=Max(InternalBitDepth-4, bitDepth+InternalBitDepth-16)
bdofUtilizationFlag[xIdx][yIdx] = (bdofBlkSumDiff >= bdofBlkDiffThres)
sbSumDiff += bdofBlkSumDiff
つまり、PredL0をshift4によりシフトした値と、PredL1をshift4によりシフトした値との差分の絶対値の総和を導出する。なお、(式BDOF-1)において、(x, y)=((xIdx<<2)+1+i, yIdx<<2)+1+j)の代わりに、(x,y)をさらにCUのサイズ(nCbW, nCbH)でクリップした値(hx, vy)を用いてもよい。この場合、境界を超える画素はパディングで導出される。
bdofBlkSumDiff
= sum4(Abs((PredL0[(xIdx<<2)+1+i][(yIdx<<2)+1+j]>>shift4)
?(PredL1[(xIdx<<2)+1+i][(yIdx<<2)+1+j]>>shift4))) (Formula BDOF-1)
shift4=Max(InternalBitDepth-4, bitDepth+InternalBitDepth-16)
bdofUtilizationFlag[xIdx][yIdx] = (bdofBlkSumDiff >= bdofBlkDiffThres)
sbSumDiff += bdofBlkSumDiff
In other words, the sum of the absolute values of the differences between the value obtained by shifting PredL0 by shift4 and the value obtained by shifting PredL1 by shift4 is derived. In addition, in (Formula BDOF-1), instead of (x, y)=((xIdx<<2)+1+i, yIdx<<2)+1+j), (x,y) is further converted to CU You may also use values (hx, vy) clipped by the size (nCbW, nCbH). In this case, pixels that cross the border are derived with padding.

hx = Clip3( 1, nCbW, x )
vy = Clip3( 1, nCbH, y )
ここで、sum4()は、i=0..3、j=0..3の引数で4x4画素ブロックの合計を求める関数とし、shift4は、後述する相関パラメータ計算部309544で定義するshift4と同一のものとする。なお、InternalBitDepthは、BDOF部内の計算精度のパラメータで、入力画素ビット長bitDepthとは独立な一定値で、7以上12以下の値とする。例えば、InternalBitDepth=8の場合、shift4はshift4=Max(4, bitDepth-8)となる。
hx = Clip3( 1, nCbW, x )
vy = Clip3( 1, nCbH, y )
Here, sum4() is a function that calculates the sum of 4x4 pixel blocks with arguments i=0..3 and j=0..3, and shift4 is the same as shift4 defined in the correlation parameter calculation unit 309544 described later. shall belong to. Note that InternalBitDepth is a parameter for calculation accuracy in the BDOF section, and is a constant value independent of the input pixel bit length bitDepth, and is a value of 7 or more and 12 or less. For example, when InternalBitDepth=8, shift4 becomes shift4=Max(4, bitDepth-8).

HEVCと同様の補間フィルタを用いる場合、PredL0とPredL1の値は、bitDepthが8から12ビットの範囲での演算精度は14ビットであり、InternalBitDepth=8の場合、shift4 = Max(4, bitDepth-8) = 4となり、(式BDOF-1)に示したPredL0, PredL1をshift4で右シフトした後の差分の絶対値和は、bitDepthにかかわらず10ビットの精度での差分絶対値和を計算していることになる。 When using an interpolation filter similar to HEVC, the values of PredL0 and PredL1 have a calculation precision of 14 bits when bitDepth is in the range of 8 to 12 bits, and when InternalBitDepth=8, shift4 = Max(4, bitDepth-8 ) = 4, and the sum of absolute values of the differences after right-shifting PredL0 and PredL1 shown in (Formula BDOF-1) with shift4 is calculated by calculating the sum of absolute differences with 10-bit precision regardless of bitDepth. There will be.

先行技術文献においては、bdofBlkDiffは、PredL0とPredL1の差分絶対値和を右シフトせずに直接求めていた。しかし、本実施の形態では、後述するBDOF部30954の相関パラメータ計算部309544で計算するtheta[x][y]の差分の計算(式BDOF-2)と同一にしており、フラグ設定部309542による閾値判定と、BDOF部30954の予測画像導出とで処理を共有することができる。この結果、先行技術文献では、フラグ設定部309542の計算は、単純に追加の演算量を必要としたが、本実施の形態では、差分の計算を共有できることから、追加部分は、絶対値和を求める部分のみになるため、演算量を大幅に削減できる。 In the prior art document, bdofBlkDiff directly calculates the sum of absolute differences between PredL0 and PredL1 without right-shifting. However, in this embodiment, the calculation of the difference of theta[x][y] (formula BDOF-2) calculated by the correlation parameter calculation unit 309544 of the BDOF unit 30954, which will be described later, is the same as the calculation by the flag setting unit 309542. Processing can be shared between threshold value determination and predicted image derivation by the BDOF unit 30954. As a result, in the prior art document, the calculation of the flag setting unit 309542 simply required an additional amount of calculation, but in this embodiment, since the calculation of the difference can be shared, the additional part calculates the sum of absolute values. Since only the required part is included, the amount of calculation can be significantly reduced.

bdofUtilizationFlag[xIdx][yIdx]は、bdofBlkSumDiffがbdofBlkDiffThres以上の場合、TRUEに設定し、そうでない場合、FALSEとする。 bdofUtilizationFlag[xIdx][yIdx] is set to TRUE if bdofBlkSumDiff is greater than or equal to bdofBlkDiffThres, otherwise set to FALSE.

また、sbSumDiffの値は、bdofBlkSumDiffの合計値とする。 Furthermore, the value of sbSumDiff is the total value of bdofBlkSumDiff.

最後に、sbBdofFlagは、もし、sbSumDiffがsbDiffThresより小さい場合、FALSEに設定し、そうでない場合は、TRUEに設定する。 Finally, sbBdofFlag is set to FALSE if sbSumDiff is less than sbDiffThres, otherwise set to TRUE.

差分の計算を共有することから、このような構成により、フラグ設定部309542では、sbBdofFlagと、bdofUtilizationFlag[xIdx][yIdx]の値の設定をより少ない処理量を行うことができる。 Since the calculation of the difference is shared, such a configuration allows the flag setting unit 309542 to set the values of sbBdofFlag and bdofUtilizationFlag[xIdx][yIdx] with a smaller amount of processing.

フラグ設定部309542の別の実施の形態としては、bdofBlkSumDiffを下式で計算する。 In another embodiment of the flag setting unit 309542, bdofBlkSumDiff is calculated using the following formula.

bdofBlkSumDiff
= sum42(Abs((PredL0[(xIdx<<2)+1+i][(yIdx<<2)+1+2*j]>>shift4)
?(PredL1[(xIdx<<2)+1+i][(yIdx<<2)+1+2*j]>>shift4)))
ここで、sum42()は、i=0..3、j=0..1の引数で4x2画素ブロックの合計を求める関数である。bdofBlkSumDiffは1ライン飛ばしの4x2画素の差分絶対値和としてもよい。この場合、sbDiffThres、bdofBlkDiffThresは、前記の実施例の半分の値を用いることにし、下記のように設定する。
bdofBlkSumDiff
= sum42(Abs((PredL0[(xIdx<<2)+1+i][(yIdx<<2)+1+2*j]>>shift4)
?(PredL1[(xIdx<<2)+1+i][(yIdx<<2)+1+2*j]>>shift4)))
Here, sum42() is a function that calculates the sum of 4x2 pixel blocks with arguments i=0..3 and j=0..1. bdofBlkSumDiff may be the sum of absolute differences of 4x2 pixels skipping one line. In this case, sbDiffThres and bdofBlkDiffThres are set to half the values of the previous example, and are set as follows.

sbDiffThres = 2 * sbWidth*sbHeight
bdofBlkDiffThres = 64
このような構成にすることにより、bdofBlkSumDiffの計算量を半分にすることができる。予測画像生成に直接影響する演算ではないため、処理削減による性能低下はほとんど生じない。
sbDiffThres = 2 * sbWidth*sbHeight
bdofBlkDiffThres = 64
With this configuration, the amount of calculation for bdofBlkSumDiff can be halved. Since this calculation does not directly affect predicted image generation, there is almost no performance deterioration due to processing reduction.

図13は、BDOF部30954が予測画像を生成する処理を説明するプローチャートである。まず、フラグ設定(S201)で、サブブロック単位のBDOF処理を行うか否かを示すフラグsbBdofFlagと、4x4画素単位でのBDOF処理を行うか否かを示すフラグbdofUtilizationFlag[xIdx][yIdx]の値の設定を行う。次に、sbBdofFlagの判定(S202)を行い、FALSEならば、サブブロック単位双方向予測画像生成(S203)を行い、TRUEならば、サブブロック単位のBDOF処理(S204)-(S210)を行う。Loop1((S204)から(S210))は、垂直方向のアドレスのループであり、Loop2((S205)から(S209))は、水平方向のアドレスのループである。bdofUtilizationFlag[xIdx][yIdx]の判定(S206)を行い、FALSEならば、4x4画素単位双方向予測画像生成(S207)を行い、TRUEならば、4x4画素単位BDOF処理(S208)を行う。 FIG. 13 is a flowchart illustrating the process by which the BDOF unit 30954 generates a predicted image. First, in flag setting (S201), the values of the flag sbBdofFlag, which indicates whether or not to perform BDOF processing in sub-block units, and the flag, bdofUtilizationFlag[xIdx][yIdx], which indicates whether or not to perform BDOF processing in 4x4 pixel units. Configure settings. Next, sbBdofFlag is determined (S202), and if FALSE, bidirectional predicted image generation is performed in sub-block units (S203), and if TRUE, BDOF processing (S204)-(S210) is performed in sub-block units. Loop1 ((S204) to (S210)) is a vertical address loop, and Loop2 ((S205) to (S209)) is a horizontal address loop. bdofUtilizationFlag[xIdx][yIdx] is determined (S206), and if FALSE, bidirectional predicted image generation in 4x4 pixel units is performed (S207), and if TRUE, 4x4 pixel unit BDOF processing is performed (S208).

この流れ図では、サブブロック単位と、4x4画素ブロック単位の2段階でBDOF処理を行うか否かを判定していたが、サブブロック単位だけ、或いは、4x4画素ブロック単位のみでも実現してもよい。 In this flowchart, it is determined whether or not to perform BDOF processing in two stages: in units of subblocks and in units of 4x4 pixel blocks, but it may also be implemented only in units of subblocks or only in units of 4x4 pixel blocks.

勾配画像生成部309543では勾配画像を生成する。勾配変化(Optical Flow)では、各点の画素値は変化せず、その位置のみが変化すると仮定する。これは、水平方向の画素値Iの変化(水平勾配値lx)とその位置の変化Vx、及び垂直方向の画素値Iの変化(垂直勾配値ly)とその位置の変化Vy、画素値Iの時間変化ltを用いて、下記で表すことができる。 The gradient image generation unit 309543 generates a gradient image. In gradient change (optical flow), it is assumed that the pixel value of each point does not change, but only its position changes. This is a change in pixel value I in the horizontal direction (horizontal gradient value lx) and a change in its position Vx, a change in pixel value I in the vertical direction (vertical gradient value ly) and a change in its position Vy, and a change in pixel value I in the vertical direction (vertical gradient value ly). It can be expressed as below using the time change lt.

lx * Vx + ly * Vy + lt = 0
以降では位置の変化(Vx,Vy)を補正重みベクトル(u,v)と呼ぶ。
lx * Vx + ly * Vy + lt = 0
Hereinafter, the change in position (Vx, Vy) will be referred to as a correction weight vector (u, v).

具体的には、勾配画像生成部309543は、以下の式から勾配画像lx0、ly0、lx1、ly1を導出する。lx0及びlx1は水平方向に沿った勾配を示し、ly0及びly1は垂直方向に沿った勾配を示す。 Specifically, the gradient image generation unit 309543 derives gradient images lx0, ly0, lx1, ly1 from the following equations. lx0 and lx1 indicate gradients along the horizontal direction, and ly0 and ly1 indicate gradients along the vertical direction.

具体的には、勾配画像生成部309543は、勾配画像lx0、ly0、lx1、ly1の導出を、以下のように行う。 Specifically, the gradient image generation unit 309543 derives the gradient images lx0, ly0, lx1, and ly1 as follows.

lx0[x][y] = (PredL0[x+1][y]-PredL0[x-1][y])>>shift0 (式BDOF-3)
ly0[x][y] = (PredL0[x][y+1]-PredL0[x][y-1])>>shift0
lx1[x][y] = (PredL1[x+1][y]-PredL1[x-1][y])>>shift0
ly1[x][y] = (PredL1[x][y+1]-PredL1[x][y-1])>>shift0
ここで、shift0=14-InternalBitDepthである。
lx0[x][y] = (PredL0[x+1][y]-PredL0[x-1][y])>>shift0 (formula BDOF-3)
ly0[x][y] = (PredL0[x][y+1]-PredL0[x][y-1])>>shift0
lx1[x][y] = (PredL1[x+1][y]-PredL1[x-1][y])>>shift0
ly1[x][y] = (PredL1[x][y+1]-PredL1[x][y-1])>>shift0
Here, shift0=14-InternalBitDepth.

勾配画像lx0、ly0、lx1、ly1の導出の別の方法としては、下式のように設定してもよい。 Another method for deriving the gradient images lx0, ly0, lx1, ly1 may be set as shown in the following formula.

lx0[x][y] = (PredL0[x+1][y]>>shift0)-(PredL0[x-1][y]>>shift0) (式BDOF-4)
ly0[x][y] = (PredL0[x][y+1]>>shift0)-(PredL0[x][y-1]>>shift0)
lx1[x][y] = (PredL1[x+1][y]>>shift0)-(PredL1[x-1][y]>>shift0)
ly1[x][y] = (PredL1[x][y+1]>>shift0)-(PredL1[x][y-1]>>shift0)
(式BDOF-3)の場合、PredL0とPredL1の最小値と最大値の範囲が16ビットとすると、差分が17ビットとなるため、32ビット演算が必要とされるが、(式BDOF-4)の場合、先に右シフトを行うため、すべての演算が16ビット演算で実行できるため、並列演算命令が使いやすいという利点がある。
lx0[x][y] = (PredL0[x+1][y]>>shift0)-(PredL0[x-1][y]>>shift0) (formula BDOF-4)
ly0[x][y] = (PredL0[x][y+1]>>shift0)-(PredL0[x][y-1]>>shift0)
lx1[x][y] = (PredL1[x+1][y]>>shift0)-(PredL1[x-1][y]>>shift0)
ly1[x][y] = (PredL1[x][y+1]>>shift0)-(PredL1[x][y-1]>>shift0)
In the case of (Formula BDOF-3), if the range of the minimum and maximum values of PredL0 and PredL1 is 16 bits, the difference will be 17 bits, so 32-bit operation is required, but (Formula BDOF-4) In this case, since the right shift is performed first, all operations can be performed using 16-bit operations, which has the advantage of making it easier to use parallel operation instructions.

いずれの場合も、HEVCと同様の補間フィルタを用いる場合、PredL0とPredL1の値は、bitDepthが8から12ビットの範囲ならば、演算精度は14ビットであり、最小値と最大値の範囲は、16ビットである。もし、bitDepthが12より大きい場合、演算精度は(bitDepth+2)ビットであり、最小値と最大値の範囲は、(bitDepth+4)ビットとなる。本実施形態では、InternalBitDepthに応じた値であるshift0だけ右シフトする。そのため、勾配画像lx0、ly0、lx1、ly1の演算精度は、BitDedepthが8以上12以下の場合は(InternalBitDepth+1)ビットとなり、bitDepthが13以上の場合は、(bitDepth+InternalBitDepth-11)となる。 In any case, when using an interpolation filter similar to HEVC, the values of PredL0 and PredL1 have a calculation precision of 14 bits if the bitDepth is in the range of 8 to 12 bits, and the range of the minimum and maximum values is It is 16 bit. If bitDepth is greater than 12, the calculation precision is (bitDepth+2) bits, and the range between the minimum value and maximum value is (bitDepth+4) bits. In this embodiment, it is shifted to the right by shift0, which is a value according to InternalBitDepth. Therefore, the calculation precision of gradient images lx0, ly0, lx1, ly1 is (InternalBitDepth+1) bits when BitDedepth is 8 or more and 12 or less, and (bitDepth+InternalBitDepth-11) when bitDepth is 13 or more. .

次に、相関パラメータ計算部309544は、サブブロック内の4x4画素のブロック毎に勾配積和s1,s2,s3,s5,s6を導出する。ここでは、ブロックの周囲1画素をさらに用いて6x6画素のブロックの画素でのsumからs1,s2,s3,s5,s6を計算する。 Next, the correlation parameter calculation unit 309544 derives gradient product sums s1, s2, s3, s5, s6 for each block of 4x4 pixels in the sub-block. Here, s1, s2, s3, s5, and s6 are calculated from the pixel sum of a 6x6 pixel block using one pixel around the block.

s1 = sum6(phiX[x][y]* phiX[x][y])
s2 = sum6(phiX[x][y]* phiY[x][y])
s3 = sum6(-theta[x][y]* phiX[x][y])
s5 = sum6(phiY[x][y]* phiY[x][y])
s6 = sum6(-theta[x][y]* phiY[x][y])
ここで、sum(a)は6x6画素のブロック内の座標(x,y)に対するaの総和を表す。
s1 = sum6(phiX[x][y]* phiX[x][y])
s2 = sum6(phiX[x][y]* phiY[x][y])
s3 = sum6(-theta[x][y]* phiX[x][y])
s5 = sum6(phiY[x][y]* phiY[x][y])
s6 = sum6(-theta[x][y]* phiY[x][y])
Here, sum(a) represents the sum of a for coordinates (x, y) within a 6x6 pixel block.

theta[x][y]= -(PredL1[x][y]>>shift4)+(PredL0[x][y]>>shift4) (式BDOF-2)
phiX[x][y] = (lx1[x][y] + lx0[x][y])>>shift5
phiY[x][y] = (ly1[x][y] + ly0[x][y])>>shift5
つまり、PredL0[x][y]をshift4によりシフトした値と、PredL1[x][y]をshift4によりシフトした値との差分からtheta[x][y]を導出する。これは、(式BDOF-1)において計算する差分値と同じである。
ここで、shift4、shift5は以下で導出する。
theta[x][y]= -(PredL1[x][y]>>shift4)+(PredL0[x][y]>>shift4) (formula BDOF-2)
phiX[x][y] = (lx1[x][y] + lx0[x][y])>>shift5
phiY[x][y] = (ly1[x][y] + ly0[x][y])>>shift5
That is, theta[x][y] is derived from the difference between the value of PredL0[x][y] shifted by shift4 and the value of PredL1[x][y] shifted by shift4. This is the same as the difference value calculated in (Formula BDOF-1).
Here, shift4 and shift5 are derived below.

shift4=Max(InternalBitDepth-4, bitDept+InternalBitDepth-16)
shift5=Max(InternalBitDepth-7, bitDepth+InternalBitDepth-19)
なお、(式BDOF-2)において、(x, y)の代わりにCUのサイズ(nCbW, nCbH)でクリップした値(hx, vy)を用いてもよい。この場合、境界を超える画素はパディングで導出される。また、x, yは各々x=xSb-1..xSb+4, y=ySb-1..ySb+4の範囲であってもよい。
shift4=Max(InternalBitDepth-4, bitDept+InternalBitDepth-16)
shift5=Max(InternalBitDepth-7, bitDepth+InternalBitDepth-19)
Note that in (Formula BDOF-2), values (hx, vy) clipped by the CU size (nCbW, nCbH) may be used instead of (x, y). In this case, pixels that cross the border are derived with padding. Further, x and y may be in the range of x=xSb-1..xSb+4 and y=ySb-1..ySb+4, respectively.

xSb = (xIdx<<2)+1, ySb = (yIdx<<2)+1
hx = Clip3( 1, nCbW, x )
vy = Clip3( 1, nCbH, y )
この時、thetaの値の演算精度は、bitDepthが8以上ならば常に、(19-InternalBitDepth)ビットとなる。また、画像のbitDepthが8以上ならば、phiXとphiYの演算精度は常に9ビットとなる。そこで、6x6画素のブロックの合計となるs1,s2,s5の演算精度は、bitDepthにかかわらず、23ビット程度である。また、同様に、6x6画素のブロックの合計となるs3,s6の演算精度は、(33-InternalBitDepth)ビット程度である。PredL0とPredL1の最小値、最大値は、bitDepthが8以上12以下の場合、16ビットの範囲であり、bitDepthが13ビット以上の場合、(bitDepth+4)ビットの範囲なので、32ビット整数演算で実現できる。
xSb = (xIdx<<2)+1, ySb = (yIdx<<2)+1
hx = Clip3( 1, nCbW, x )
vy = Clip3( 1, nCbH, y )
At this time, the calculation precision of the value of theta is always (19-InternalBitDepth) bits if bitDepth is 8 or more. Also, if the bitDepth of the image is 8 or more, the calculation precision of phiX and phiY is always 9 bits. Therefore, the calculation precision of s1, s2, and s5, which is the total of 6x6 pixel blocks, is about 23 bits regardless of bitDepth. Similarly, the calculation accuracy of s3 and s6, which is the total of 6x6 pixel blocks, is about (33-InternalBitDepth) bits. The minimum and maximum values of PredL0 and PredL1 are in the range of 16 bits if bitDepth is 8 or more and 12 or less, and if bitDepth is 13 or more bits, they are in the range of (bitDepth+4) bits, so 32-bit integer arithmetic is required. realizable.

より具体的に、InternalBitDepth=8とした場合は下式で実現する。 More specifically, when InternalBitDepth=8, this is achieved using the following formula.

shift0=6
shift4=Max(4, bitDepth-8)
shift5=Max(1, bitDepth-11)
InternalBitDepth=7とした場合には下式で実現する。
shift0=6
shift4=Max(4, bitDepth-8)
shift5=Max(1, bitDepth-11)
When InternalBitDepth=7, this is achieved using the following formula.

shift0=7
shift4=Max(3, bitDepth-9)
shift5=Max(0, bitDepth-12)
相関パラメータ計算部309544の別の構成としては、勾配積和s1,s2,s3,s5,s6は、6x6画素のブロックでなく、4x4画素のブロックで求めてもよい。4x4=16画素のブロックとなるため、6x6=36画素の合計と比べてsumの計算に必要な演算ビットが(Ceil(log2(36))-Ceil(log2(16)))=2ビット少なくてもすむ。
shift0=7
shift4=Max(3, bitDepth-9)
shift5=Max(0, bitDepth-12)
As another configuration of the correlation parameter calculation unit 309544, the gradient product sums s1, s2, s3, s5, s6 may be calculated using a 4x4 pixel block instead of a 6x6 pixel block. Since it is a block of 4x4=16 pixels, the calculation bits required to calculate sum are (Ceil(log2(36))-Ceil(log2(16)))=2 bits less than the total of 6x6=36 pixels. Mosumu.

shift4=Max(InternalBitDepth-5, bitDept+InternalBitDepth-15)
shift5=Max(InternalBitDepth-8, bitDepth+InternalBitDepth-18)
そのため、上式のようにそれぞれ1ビット小さい値を用いても、32ビット整数演算で実現できる。但し、この場合、InternalBitDepthの値は、8以上12以下とする。また、勾配積和の演算量も削減できる。図15のように、BDOF処理の単位と読み込み領域が一致するため、図14の場合と異なり、対象となるサブブロックの周囲1画素分のパディング領域は不要となる。
shift4=Max(InternalBitDepth-5, bitDept+InternalBitDepth-15)
shift5=Max(InternalBitDepth-8, bitDepth+InternalBitDepth-18)
Therefore, even if each value is 1 bit smaller as shown in the above equation, it can be realized using 32-bit integer operations. However, in this case, the value of InternalBitDepth should be 8 or more and 12 or less. Furthermore, the amount of computation for gradient product sum can be reduced. As shown in FIG. 15, since the unit of BDOF processing and the read area match, unlike the case of FIG. 14, a padding area of one pixel around the target sub-block is not required.

次に、動き補償修正値導出部309545は、導出した勾配積和s1,s2,s3,s5,s6を用いて、4x4画素単位の補正重みベクトル(u, v)を導出する。 Next, the motion compensation correction value deriving unit 309545 derives a correction weight vector (u, v) in 4x4 pixel units using the derived gradient product sums s1, s2, s3, s5, and s6.

u = (s3<<3) >> floor(log2(s1))
v = ((s6<<3)-((((u*s2m)<<12)+u*s2s)>>1)) >> floor(log2(s5))
ここでs2m=s2>>12、s2s=s2&((1<<12)-1)である。
u = (s3<<3) >> floor(log2(s1))
v = ((s6<<3)-((((u*s2m)<<12)+u*s2s)>>1)) >> floor(log2(s5))
Here, s2m=s2>>12, s2s=s2&((1<<12)-1).

なお、以下のようにさらにクリップを用いてu, vの範囲を制限しても良い。 Note that the range of u and v may be further limited by using clips as described below.

u=s1>0?Clip3(-th,th,-(s3<<3)>>floor(log2(s1))):0
v=s5>0?Clip3(-th,th,((s6<<3)-((((u*s2m)<<12)+u*s2s)>>1))>>floor(log2(s5))):0
ここで、thは下式で表現される。
u=s1>0?Clip3(-th,th,-(s3<<3)>>floor(log2(s1))):0
v=s5>0?Clip3(-th,th,((s6<<3)-((((u*s2m)<<12)+u*s2s)>>1))>>floor(log2(s5 ))):0
Here, th is expressed by the following formula.

th = Max(2, 1<<(13-InternalBitDepth))
thはbitDepthとは独立の値になることから、画素単位の補正重みベクトル(u, v)は、InternalBitDepthに関連した値でクリッピングされることになる。画素ビット長bitDepthにかかわらず、例えば、InternalBitDepth=8とすると、th=1<<(13-8)=32となる。また、InternalBitDepth=7とすると、th=1<<(13-7)=64となる。
th = Max(2, 1<<(13-InternalBitDepth))
Since th is a value independent of bitDepth, the pixel-by-pixel correction weight vector (u, v) is clipped by a value related to InternalBitDepth. Regardless of the pixel bit length bitDepth, for example, if InternalBitDepth=8, th=1<<(13-8)=32. Also, if InternalBitDepth=7, th=1<<(13-7)=64.

この時、画素単位の補正重みベクトル(u, v)は、動きベクトルの精度や、量子化幅に関係する値とも考えられることから、補正重みベクトル(u, v)の制限するためのしきい値thは、下式のように量子化幅Qpの関数で表現してもよい。 At this time, since the pixel-based correction weight vector (u, v) can be considered to be a value related to the accuracy of the motion vector and the quantization width, a threshold is used to limit the correction weight vector (u, v). The value th may be expressed as a function of the quantization width Qp as shown in the following equation.

th0 = Max(1, 1<<(12-InternalBitDepth))
th = th0 +floor((Qp-32)/6)
なお、勾配積和s3とs6の左3ビットシフトを行わず、下式で導出してもよい。
th0 = Max(1, 1<<(12-InternalBitDepth))
th = th0 +floor((Qp-32)/6)
Note that the gradient product sums s3 and s6 may be derived using the following formula without shifting 3 bits to the left.

u = s3 >> floor(log2(s1))
v = (s6-((((u*s2m)<<12)+u*s2s)>>1))>> floor(log2(s5))
但し、shift4は下式で導出する。
u = s3 >> floor(log2(s1))
v = (s6-((((u*s2m)<<12)+u*s2s)>>1))>> floor(log2(s5))
However, shift4 is derived using the formula below.

shift4=Max(InternalBitDepth-7, bitDepth+InternalBitDepth-19)
この場合、shift0及びshift5の変更は必要ない。具体的に、InternalBitDepth=8の場合、shift4は下式で導出する。
shift4=Max(InternalBitDepth-7, bitDepth+InternalBitDepth-19)
In this case, there is no need to change shift0 and shift5. Specifically, when InternalBitDepth=8, shift4 is derived using the following formula.

shift4=Max(1, bitDepth-11)
動き補償修正値導出部309545は、4x4画素単位の補正重みベクトル(u, v)と勾配画像lx0、ly0、lx1、ly1を用いて、動き補償修正値bdofOffsetを導出する。
shift4=Max(1, bitDepth-11)
The motion compensation correction value deriving unit 309545 derives a motion compensation correction value bdofOffset using the correction weight vector (u, v) in 4x4 pixel units and the gradient images lx0, ly0, lx1, ly1.

bdofOffset[x][y]=((lx1[x][y]-lx0[x][y])*u+(ly1[x][y]-ly0[x][y])*v+1)>>1
あるいはラウンド関数を用いて、bdofOffsetを以下のように導出してもよい。
bdofOffset[x][y]=((lx1[x][y]-lx0[x][y])*u+(ly1[x][y]-ly0[x][y])*v+1) >>1
Alternatively, bdofOffset may be derived as follows using a round function.

bdofOffset[x][y] = Round(((lx1[x][y]-lx0[x][y])*u)>>1)+Round(((ly1[x][y]-ly0[x][y])*v)>>1)
あるいは、勾配画像lx0、ly0、lx1、ly1の右シフト値のshift0の値を工夫することで、以下のように、右シフトやラウンド関数を用いずに導出することもできる。
bdofOffset[x][y] = Round(((lx1[x][y]-lx0[x][y])*u)>>1)+Round(((ly1[x][y]-ly0[ x][y])*v)>>1)
Alternatively, by modifying the value of shift0 of the right shift values of gradient images lx0, ly0, lx1, and ly1, it is also possible to derive without using right shift or round function as shown below.

bdofOffset[x][y]=(lx1[x][y]-lx0[x][y])*u+(ly1[x][y]-ly0[x][y])*v
shift0=15-InternalBitDepth
shift5=Max(InternalBitDepth-8, bitDepth+InternalBitDepth-20)
この場合、InternalBitDepthの選択範囲は、8以上12以下で、shift4の変更は必要ない。具体的に、InternalBitDepth=8の場合は、下式となる。
bdofOffset[x][y]=(lx1[x][y]-lx0[x][y])*u+(ly1[x][y]-ly0[x][y])*v
shift0=15-InternalBitDepth
shift5=Max(InternalBitDepth-8, bitDepth+InternalBitDepth-20)
In this case, the selection range of InternalBitDepth is between 8 and 12, and there is no need to change shift4. Specifically, when InternalBitDepth=8, the following formula is obtained.

shift0=7
shift5=Max(0, bitDepth-12)
双方向予測画像生成部309546は、上記のパラメータを用いて下式により、4x4画素の予測画像の画素値Predを導出する。
shift0=7
shift5=Max(0, bitDepth-12)
The bidirectional predicted image generation unit 309546 derives the pixel value Pred of the 4x4 pixel predicted image using the above-mentioned parameters according to the following formula.

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

以上のような構成であれば、サブブロック単位でのBDOF処理を行うか否かと示すフラグや、4x4画素単位でBDOF処理を行うか否かを示すフラグの設定のための演算量を抑えることができる。 With the above configuration, it is possible to reduce the amount of calculation required to set the flag indicating whether to perform BDOF processing in sub-block units or the flag indicating whether to perform BDOF processing in 4x4 pixel units. can.

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

予測画像生成部101は画像Tの各ピクチャを分割した領域であるCU毎に予測画像を生成する。予測画像生成部101は既に説明した予測画像生成部308と同じ動作であり、説明を省略する。 The predicted image generation unit 101 generates a predicted image for each CU, which is a region obtained by dividing each picture of the image T. The predicted image generation unit 101 operates in the same manner as the predicted image generation unit 308 already described, and the explanation 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 predicted image generation unit 101 from the pixel value of the image T to generate a prediction error. Subtraction section 102 outputs the prediction error to conversion/quantization section 103.

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

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

エントロピー符号化部104には、変換・量子化部103から量子化変換係数が入力され、パラメータ符号化部111から符号化パラメータが入力される。符号化パラメータには、例えば、参照ピクチャインデックスrefIdxLX、予測ベクトルインデックスmvp_LX_idx、差分ベクトルmvdLX、動きベクトル精度モードamvr_mode、予測モードpredMode、及びマージインデックスmerge_idx等の符号がある。 Entropy encoding section 104 receives quantized transform coefficients from transform/quantization section 103 and inputs encoding parameters from parameter encoding section 111. The encoding parameters include, for example, codes such as a reference picture index refIdxLX, a predicted vector index mvp_LX_idx, a difference vector mvdLX, a motion vector accuracy mode amvr_mode, a prediction mode predMode, and a merge index merge_idx.

エントロピー符号化部104は、分割情報、予測パラメータ、量子化変換係数等をエントロピー符号化して符号化ストリームTeを生成し、出力する。 Entropy encoding section 104 performs entropy encoding on division information, prediction parameters, quantization transform coefficients, etc., generates encoded stream Te, and outputs the encoded stream Te.

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

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

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

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

TU符号化部1114は、TUに予測誤差が含まれている場合に、QP更新情報(量子化補正値)と量子化予測誤差(residual_coding)を符号化する。 The TU encoding 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)、イントラ予測パラメータ、量子化変換係数等のシンタックス要素をエントロピー符号化部104に供給する。 The CT information encoding unit 1111 and the CU encoding unit 1112 encode 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), Syntax elements such as intra prediction parameters and quantized transform coefficients are supplied to entropy encoding section 104.

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

予測パラメータ符号化部112の構成について説明する。図17示すように、パラメータ符号化制御部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、subMvLX)、参照ピクチャインデックス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に出力する。 The configuration of prediction parameter encoding section 112 will be explained. As shown in FIG. 17, a parameter encoding control unit 1121, a merge prediction unit 30374, a subblock prediction unit (affine prediction unit) 30372, a DMVR unit 30375, an MMVD prediction unit 30376, a Triangle prediction unit 30377, an AMVP prediction parameter derivation unit 3032, It is configured to include a subtraction section 1123. The merge prediction unit 30374 includes a merge prediction parameter derivation unit 3036. The parameter encoding control unit 1121 includes a merge index deriving unit 11211 and a vector candidate index deriving unit 11212. Further, in the parameter encoding control unit 1121, a merge index deriving unit 11211 derives merge_idx, affine_flag, base_candidate_idx, distance_idx, direction_idx, etc., and a vector candidate index deriving unit 11212 derives mvpLX, etc. The merge prediction parameter derivation unit 3036, AMVP prediction parameter derivation unit 3032, affine prediction unit 30372, MMVD prediction unit 30376, and Triangle prediction unit 30377 may be collectively referred to as a motion vector derivation unit (motion vector derivation device). The parameter encoding unit 112 outputs the motion vector (mvLX, subMvLX), reference picture index refIdxLX, inter prediction identifier inter_pred_idc, or information indicating these to the predicted image generation unit 101. Parameter encoding section 112 also outputs merge_flag, skip_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_lX_idx, mvdLX, amvr_mode, and affine_flag to entropy encoding section 104.

マージインデックス導出部11211は、マージインデックスmerge_idxを導出し、マージ予測パラメータ導出部3036(マージ予測部)に出力する。ベクトル候補インデックス導出部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). Vector candidate index derivation unit 11212 derives predicted vector index mvp_lX_idx.

マージ予測パラメータ導出部3036は、マージインデックスmerge_idxに基づいて、インター予測パラメータを導出する。 The merge prediction parameter derivation unit 3036 derives inter prediction parameters 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 a prediction vector mvpLX based on the motion vector mvLX. AMVP prediction parameter derivation section 3032 outputs prediction vector mvpLX to subtraction section 1123. Note that the reference picture index refIdxLX and the predictive vector index mvp_lX_idx are output to the entropy encoding unit 104.

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

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

加算部106は、予測画像生成部101から入力されたブロックの予測画像の画素値と逆量子化・逆変換部105から入力された予測誤差を画素毎に加算して復号画像を生成する。加算部106は生成した復号画像を参照ピクチャメモリ109に記憶する。 Adding section 106 adds the pixel value of the predicted image of the block inputted from predicted image generation section 101 and the prediction error inputted from inverse quantization/inverse transformation section 105 for each pixel to generate a decoded image. Adding unit 106 stores the generated decoded image in 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. Note that the loop filter 107 does not necessarily need to include the above three types of filters, and may have a configuration including only a deblocking filter, for example.

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

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

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

符号化パラメータ決定部110は、複数のセットの各々について情報量の大きさと符号化誤差を示すRDコスト値を算出する。符号化パラメータ決定部110は、算出したコスト値が最小となる符号化パラメータのセットを選択する。これにより、エントロピー符号化部104は、選択した符号化パラメータのセットを符号化ストリームTeとして出力する。符号化パラメータ決定部110は決定した符号化パラメータを予測パラメータメモリ108に記憶する。 Encoding parameter determination section 110 calculates an RD cost value indicating the amount of information and encoding error for each of the plurality of sets. Encoding parameter determining section 110 selects a set of encoding parameters that minimizes the calculated cost value. Thereby, entropy encoding section 104 outputs the selected set of encoding parameters as encoded stream Te. Encoding parameter determining section 110 stores the determined encoding parameters in 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等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムを送信する場合の通信線のように、短時間、動的にプログラムを保持するもの、その場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリのように、一定時間プログラムを保持しているものも含んでも良い。また上記プログラムは、前述した機能の一部を実現するためのものであっても良く、さらに前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるものであっても良い。 Note that some of the video encoding device 11 and video decoding device 31 in the embodiment described above, such as the entropy decoding unit 301, the parameter decoding unit 302, the loop filter 305, the predicted image generation unit 308, and the dequantization/inverse Transform unit 311, addition unit 312, predicted image generation unit 101, subtraction unit 102, transformation/quantization unit 103, entropy encoding unit 104, inverse quantization/inverse transformation unit 105, loop filter 107, encoding parameter determination unit 110 , the parameter encoding unit 111 may be realized by a computer. In that case, a 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 into a computer system and executed. Note that the "computer system" herein refers to a computer system built into either the video encoding device 11 or the video decoding device 31, and includes hardware such as an OS and peripheral devices. Furthermore, the term "computer-readable recording medium" refers to portable media such as flexible disks, magneto-optical disks, ROMs, and CD-ROMs, and storage devices such as hard disks built into computer systems. Furthermore, a "computer-readable recording medium" refers to a medium that dynamically stores a program for a short period of time, such as a communication line when transmitting a program via a network such as the Internet or a communication line such as a telephone line. In that case, it may also include something that retains a program for a certain period of time, such as a volatile memory inside a computer system that is a server or a client. Further, the above-mentioned program may be one for realizing a part of the above-mentioned functions, or may be one that can realize 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, part or all of the video encoding device 11 and the video decoding device 31 in the embodiments described above may be realized as an integrated circuit such as an LSI (Large Scale Integration). Each functional block of the moving image encoding device 11 and the moving image decoding device 31 may be made into a processor individually, or some or all of them may be integrated into a processor. Moreover, the method of circuit integration is not limited to LSI, but may be implemented using a dedicated circuit or a general-purpose processor. Further, if an integrated circuit technology that replaces LSI emerges 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 above in detail with reference to the drawings, the specific configuration is not limited to that described above, and various design changes etc. may be made without departing from the gist of the present invention. It is possible to

〔応用例〕
上述した動画像符号化装置11及び動画像復号装置31は、動画像の送信、受信、記録、再生を行う各種装置に搭載して利用することができる。なお、動画像は、カメラ等により撮像された自然動画像であってもよいし、コンピュータ等により生成された人工動画像(CGおよびGUIを含む)であってもよい。
[Application example]
The above-described video encoding device 11 and video decoding device 31 can be used by being installed in various devices that transmit, receive, record, and reproduce video images. Note that 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 explained with reference to FIG. 2 that the above-described video encoding device 11 and video decoding device 31 can be used for transmitting and receiving video images.

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

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

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

図2(b)は、動画像復号装置31を搭載した受信装置PROD_Bの構成を示したブロック図である。図に示すように、受信装置PROD_Bは、変調信号を受信する受信部PROD_B1と、受信部PROD_B1が受信した変調信号を復調することによって符号化データを得る復調部PROD_B2と、復調部PROD_B2が得た符号化データを復号することによって動画像を得る復号部PROD_B3と、を備えている。上述した動画像復号装置31は、この復号部PROD_B3として利用される。 FIG. 2(b) 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 includes a receiving unit PROD_B1 that receives a modulated signal, a demodulating unit PROD_B2 that obtains encoded data by demodulating the modulated signal received by the receiving unit PROD_B1, and a demodulating unit PROD_B2 that obtains encoded data. It includes a decoding unit PROD_B3 that obtains a moving image by decoding encoded data. The above-mentioned moving image decoding device 31 is used as this decoding unit PROD_B3.

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

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

なお、変調信号を伝送する伝送媒体は、無線であってもよいし、有線であってもよい。また、変調信号を伝送する伝送態様は、放送(ここでは、送信先が予め特定されていない送信態様を指す)であってもよいし、通信(ここでは、送信先が予め特定されている送信態様を指す)であってもよい。すなわち、変調信号の伝送は、無線放送、有線放送、無線通信、及び有線通信の何れによって実現してもよい。 Note that the transmission medium for transmitting the modulated signal may be wireless or wired. Furthermore, the transmission mode for transmitting the modulated signal may be broadcasting (here, refers to a transmission mode in which the destination is not specified in advance), or communication (here, transmission mode in which the destination is specified in advance). ) may also be used. That is, 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 digital terrestrial broadcasting is an example of a transmitting device PROD_A/receiving device PROD_B that transmits and receives a modulated signal by wireless broadcasting. Further, a cable television broadcasting station (broadcasting equipment, etc.)/receiving station (television receiver, etc.) is an example of a transmitting device PROD_A/receiving device PROD_B that transmits and receives a modulated signal by wire 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.) for VOD (Video On Demand) services and video sharing services using the Internet are transmitting devices that transmit and receive modulated signals via communication. This is an example of PROD_A/receiving device PROD_B (generally, either wireless or wired is used as the transmission medium in LAN, and wired is used as the transmission medium in WAN). Here, the personal computer includes a desktop PC, a laptop PC, and a tablet PC. Smartphones also include multifunctional mobile phone terminals.

なお、動画共有サービスのクライアントは、サーバからダウンロードした符号化データを復号してディスプレイに表示する機能に加え、カメラで撮像した動画像を符号化してサーバにアップロードする機能を有している。すなわち、動画共有サービスのクライアントは、送信装置PROD_A及び受信装置PROD_Bの双方として機能する。 Note that the client of the video sharing service has a function of decoding encoded data downloaded from the server and displaying the decoded data on a display, as well as a function of encoding a moving image captured by a 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 explained with reference to FIG. 3 that the above-described moving image encoding device 11 and moving image decoding device 31 can be used for recording and reproducing moving images.

図3(a)は、上述した動画像符号化装置11を搭載した記録装置PROD_Cの構成を示したブロック図である。図に示すように、記録装置PROD_Cは、動画像を符号化することによって符号化データを得る符号化部PROD_C1と、符号化部PROD_C1が得た符号化データを記録媒体PROD_Mに書き込む書込部PROD_C2と、を備えている。上述した動画像符号化装置11は、この符号化部PROD_C1として利用される。 FIG. 3(a) is a block diagram showing the configuration of a recording device PROD_C equipped with the video encoding device 11 described above. As shown in the figure, the recording device PROD_C includes an encoding unit PROD_C1 that obtains encoded data by encoding a moving image, and a writing unit PROD_C2 that writes the encoded data obtained by the encoding unit PROD_C1 to a recording medium PROD_M. It is equipped with. The video encoding device 11 described above is used as this encoding 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に内蔵されたドライブ装置(不図示)に装填されるものであってもよい。 Note that the recording medium PROD_M may be of the type built into 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 the type connected to the recording device PROD_C, such as a card or USB (Universal Serial Bus) flash memory, or (3) DVD (Digital Versatile Disc: registered trademark) or BD (Blu-ray). Disc (registered trademark) may be loaded into a drive device (not shown) built into the recording device PROD_C.

また、記録装置PROD_Cは、符号化部PROD_C1に入力する動画像の供給源として、動画像を撮像するカメラPROD_C3、動画像を外部から入力するための入力端子PROD_C4、動画像を受信するための受信部PROD_C5、及び、画像を生成または加工する画像処理部PROD_C6を更に備えていてもよい。図においては、これら全てを記録装置PROD_Cが備えた構成を例示しているが、一部を省略しても構わない。 The recording device PROD_C also serves as a source of moving images input to the encoding unit PROD_C1, including a camera PROD_C3 for capturing moving images, an input terminal PROD_C4 for inputting moving images from the outside, and a reception terminal for receiving moving images. The image processing apparatus may further include a section PROD_C5 and an image processing section PROD_C6 that generates or processes images. Although the figure illustrates a configuration in which the recording device PROD_C includes all of these, some may be omitted.

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

このような記録装置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, BD recorder, HDD (Hard Disk Drive) recorder, etc. (In this case, the input terminal PROD_C4 or the receiving unit PROD_C5 is the main source of moving images) . In addition, camcorders (in this case, camera PROD_C3 is the main source of moving images), personal computers (in this case, receiver PROD_C5 or image processing section C6 are the main sources of moving images), smartphones (in this case, camera PROD_C3 is the main source of moving images), In this case, the camera PROD_C3 or the receiving unit PROD_C5 is the main source of moving images) is 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. 3(b) is a block diagram showing the configuration of a playback device PROD_D equipped with the video decoding device 31 described above. As shown in the figure, the playback device PROD_D includes a reading unit PROD_D1 that reads encoded data written in a recording medium PROD_M, and a decoding unit PROD_D2 that obtains a moving image by decoding the encoded data read by the reading unit PROD_D1. , is equipped with. The above-mentioned moving image decoding device 31 is used as this decoding unit PROD_D2.

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

また、再生装置PROD_Dは、復号部PROD_D2が出力する動画像の供給先として、動画像を表示するディスプレイPROD_D3、動画像を外部に出力するための出力端子PROD_D4、及び、動画像を送信する送信部PROD_D5を更に備えていてもよい。図においては、これら全てを再生装置PROD_Dが備えた構成を例示しているが、一部を省略しても構わない。 The playback device PROD_D also 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 transmitter for transmitting the moving image, as a supply destination of the moving image output by the decoding unit PROD_D2. It may further include PROD_D5. Although the figure illustrates a configuration in which the playback device PROD_D includes all of these, some of them may be omitted.

なお、送信部PROD_D5は、符号化されていない動画像を送信するものであってもよいし、記録用の符号化方式とは異なる伝送用の符号化方式で符号化された符号化データを送信するものであってもよい。後者の場合、復号部PROD_D2と送信部PROD_D5との間に、動画像を伝送用の符号化方式で符号化する符号化部(不図示)を介在させるとよい。 Note that the transmitter PROD_D5 may transmit unencoded moving images, or may transmit encoded data encoded using a transmission encoding method different from the recording encoding method. It may be something that does. In the latter case, it is preferable to interpose an encoding unit (not shown) that encodes the moving image using a transmission encoding method 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, BD player, HDD player, etc. (In this case, the output terminal PROD_D4 to which a television receiver etc. is connected is the main source of video images.) . In addition, television receivers (in this case, display PROD_D3 is the main source of moving images), digital signage (also called electronic billboards, electronic bulletin boards, etc.), and display PROD_D3 or transmitter PROD_D5 are the main source of moving images. ), a desktop PC (in this case, the output terminal PROD_D4 or the transmitter PROD_D5 is the main source of the video), a laptop or tablet PC (in this case, the display PROD_D3 or the transmitter PROD_D5 is the main source of the video) Examples of such a playback device PROD_D include a smartphone (in this case, the display PROD_D3 or the transmitter PROD_D5 is the main source of moving images).

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

後者の場合、上記各装置は、各機能を実現するプログラムの命令を実行するCPU、上記プログラムを格納したROM(Read Only Memory)、上記プログラムを展開するRAM(RandomAccess Memory)、上記プログラムおよび各種データを格納するメモリ等の記憶装置(記録媒体)などを備えている。そして、本発明の実施形態の目的は、上述した機能を実現するソフトウェアである上記各装置の制御プログラムのプログラムコード(実行形式プログラム、中間コードプログラム、ソースプログラム)をコンピュータで読み取り可能に記録した記録媒体を、上記各装置に供給し、そのコンピュータ(またはCPUやMPU)が記録媒体に記録されているプログラムコードを読み出し実行することによっても、達成可能である。 In the latter case, each of the above devices includes a CPU that executes instructions of programs that implement each function, a ROM (Read Only Memory) that stores the above programs, a RAM (Random Access Memory) that expands the above programs, and the above programs and various data. It is equipped with a storage device (recording medium) such as a memory for storing the information. The purpose of the embodiment of the present invention is to provide a computer-readable record of the program code (executable program, intermediate code program, source program) of the control program for each of the above devices, which is software that realizes the above-described functions. This can also be achieved by supplying a 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-rayDisc:登録商標)等の光ディスクを含むディスク類、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 tape and cassette tape, magnetic disks such as floppy (registered trademark) disks/hard disks, and CD-ROM (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), etc. ) / cards such as optical cards, mask ROM / EPROM (Erasable Programmable Read-Only Memory) / EEPROM (Electrically Erasable and Programmable Read-Only Memory: registered trademark) / semiconductor memory such as flash ROM, or PLD (Programmable Logic circuits such as FPGA (Field Programmable Gate Array) 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 program code may be supplied via the communication network. This communication network is not particularly limited as long as it can transmit program codes. Examples include the Internet, intranet, extranet, LAN (Local Area Network), ISDN (Integrated Services Digital Network), VAN (Value-Added Network), CATV (Community Antenna television/Cable Television) communications network, and Virtual Private Network (LAN). network), telephone line network, mobile communication network, satellite communication network, etc. Further, the transmission medium constituting this communication network may be any medium that can transmit program codes, and is not limited to a specific configuration or type. For example, IEEE (Institute of Electrical and Electronic Engineers) 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line), etc., wired lines, IrDA (Infrared Data Association), remote control, etc. , BlueTooth (registered trademark), IEEE802.11 wireless, HDR (High Data Rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance: registered trademark), mobile phone networks, satellite lines, terrestrial digital broadcasting networks, etc. It is also available wirelessly. Note that embodiments of the present invention may also be implemented in the form of a computer data signal embedded in a carrier wave, in which the program code is embodied in electronic transmission.

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

〔付記事項〕
上述の実施形態は以下のように表現することもできる。
[Additional notes]
The above embodiment can also be expressed as follows.

本発明の一態様に係る動画像復号装置は、二つの補間画像から、勾配変化によって予測画像を生成する双方向勾配変化処理を用いて予測画像生成部を有し、前記予測画像生成部は、二つの補間画像から、符号化単位毎のL0予測画像とL1予測画像を生成するL0,L1予測生成部と、前記L0予測画像とL1予測画像から、符号化単位毎に双方向勾配変化処理を行うか否かを判定するフラグ設定部と、前記L0予測画像とL1予測画像から、水平方向と、垂直方向の四つの勾配画像を生成する勾配画像生成部と、前記L0予測画像とL1予測画像と前記四つの勾配画像の積和演算から、処理単位毎の相関パラメータを計算する相関パラメータ計算部と、前記勾配画像と、前記相関パラメータから、双方向予測画像を修正する値を導出する動き補償修正値導出部と、前記L0予測画像とL1予測画像と前記動き補償修正値から予測画像を生成する双方向予測画像生成部を有し、前記フラグ設定部と前記相関パラメータ計算部において、前記L0予測画像とL1予測画像の差分の演算精度を同一にすることを特徴とする。 A video decoding device according to one aspect of the present invention includes a predicted image generation unit using bidirectional gradient change processing that generates a predicted image from two interpolated images by changing a gradient, and the predicted image generation unit includes: An L0 and L1 prediction generation unit generates an L0 predicted image and an L1 predicted image for each coding unit from two interpolated images, and bidirectional gradient change processing is performed for each coding unit from the L0 predicted image and L1 predicted image. a flag setting unit that determines whether or not to perform the above; a gradient image generation unit that generates four gradient images in a horizontal direction and a vertical direction from the L0 predicted image and the L1 predicted image; and the L0 predicted image and the L1 predicted image. and a correlation parameter calculation unit that calculates a correlation parameter for each processing unit from a product-sum operation of the four gradient images; and a motion compensation unit that derives a value for correcting a bidirectional predicted image from the gradient image and the correlation parameter. a correction value derivation unit; a bidirectional predicted image generation unit that generates a predicted image from the L0 predicted image, the L1 predicted image, and the motion compensation correction value; It is characterized by making the calculation accuracy of the difference between the predicted image and the L1 predicted image the same.

また、本発明の一態様に係る動画像復号装置は、前記フラグ設定部と前記相関パラメータ計算部において、前記L0予測画像とL1予測画像の差分の演算精度を画素ビット長にかかわらず一定にすることを特徴とする。 Further, in the video decoding device according to one aspect of the present invention, in the flag setting unit and the correlation parameter calculation unit, the calculation accuracy of the difference between the L0 predicted image and the L1 predicted image is made constant regardless of the pixel bit length. It is characterized by

〔構成1〕
二つの補間画像から、勾配変化によって予測画像を生成する双方向勾配変化処理を用いて予測画像生成部を有し、前記予測画像生成部は、二つの補間画像から、符号化単位ごとのL0予測画像とL1予測画像を生成するL0、L1予測生成部と、前記L0予測画像とL1予測画像から、符号化単位毎に双方向勾配変化処理を行うか否かを判定するフラグ設定部と、前記L0予測画像とL1予測画像から、水平方向と、垂直方向の四つの勾配画像を生成する勾配画像生成部と、前記L0予測画像とL1予測画像と前記四つの勾配画像の積和演算から、処理単位毎の相関パラメータを計算する相関パラメータ計算部と、前記勾配画像と、前記相関パラメータから、双方向予測画像を修正する値を導出する動き補償修正値導出部と、前記L0予測画像とL1予測画像と前記動き補償修正値から予測画像を生成する双方向予測画像生成部を有し、前記フラグ設定部と前記相関パラメータ計算部において、前記L0予測画像とL1予測画像の差分の演算精度を同一にすることを特徴とする動画像復号装置。
[Configuration 1]
It has a predicted image generation unit that uses bidirectional gradient change processing to generate a predicted image from two interpolated images by changing the gradient, and the predicted image generation unit generates L0 prediction for each coding unit from the two interpolated images. an L0 and L1 prediction generation unit that generates an image and an L1 prediction image; a flag setting unit that determines whether or not bidirectional gradient change processing is to be performed for each coding unit from the L0 prediction image and the L1 prediction image; A gradient image generation unit that generates four gradient images in the horizontal and vertical directions from the L0 predicted image and the L1 predicted image, and processing from the product-sum calculation of the L0 predicted image, the L1 predicted image, and the four gradient images. a correlation parameter calculation unit that calculates a correlation parameter for each unit; a motion compensation correction value derivation unit that derives a value for correcting a bidirectional predicted image from the gradient image and the correlation parameter; and the L0 prediction image and the L1 prediction. It has a bidirectional predicted image generation unit that generates a predicted image from the image and the motion compensation correction value, and the flag setting unit and the correlation parameter calculation unit have the same calculation precision for the difference between the L0 predicted image and the L1 predicted image. A moving image decoding device characterized by:

〔構成2〕
構成1の動画像復号装置の前記フラグ設定部と前記相関パラメータ計算部において、L0予測画像とL1予測画像の差分の演算精度を画素ビット長にかかわらず一定にすることを特徴とする動画像復号装置。
[Configuration 2]
Video decoding characterized in that in the flag setting section and the correlation parameter calculation section of the video decoding device according to Configuration 1, the calculation accuracy of the difference between the L0 predicted image and the L1 predicted image is made constant regardless of the pixel bit length. Device.

〔構成3〕
二つの補間画像から、勾配変化によって予測画像を生成する双方向勾配変化処理を用いて予測画像生成部を有し、前記予測画像生成部は、二つの補間画像から、符号化単位ごとのL0予測画像とL1予測画像を生成するL0、L1予測生成部と、前記L0予測画像とL1予測画像から、符号化単位毎に双方向勾配変化処理を行うか否かを判定するフラグ設定部と、前記L0予測画像とL1予測画像から、水平方向と、垂直方向の四つの勾配画像を生成する勾配画像生成部と、前記L0予測画像とL1予測画像と前記四つの勾配画像の積和演算から、処理単位毎の相関パラメータを計算する相関パラメータ計算部と、前記勾配画像と、前記相関パラメータから、双方向予測画像を修正する値を導出する動き補償修正値導出部と、前記L0予測画像とL1予測画像と前記動き補償修正値から予測画像を生成する双方向予測画像生成部を有し、前記フラグ設定部と前記相関パラメータ計算部において、前記L0予測画像とL1予測画像の差分の演算精度を同一にすることを特徴とする動画像符号化装置。
[Configuration 3]
It has a predicted image generation unit that uses bidirectional gradient change processing to generate a predicted image from two interpolated images by changing the gradient, and the predicted image generation unit generates L0 prediction for each coding unit from the two interpolated images. an L0 and L1 prediction generation unit that generates an image and an L1 prediction image; a flag setting unit that determines whether or not bidirectional gradient change processing is to be performed for each coding unit from the L0 prediction image and the L1 prediction image; A gradient image generation unit that generates four gradient images in the horizontal and vertical directions from the L0 predicted image and the L1 predicted image, and processing from the product-sum calculation of the L0 predicted image, the L1 predicted image, and the four gradient images. a correlation parameter calculation unit that calculates a correlation parameter for each unit; a motion compensation correction value derivation unit that derives a value for correcting a bidirectional predicted image from the gradient image and the correlation parameter; and the L0 prediction image and the L1 prediction. It has a bidirectional predicted image generation unit that generates a predicted image from the image and the motion compensation correction value, and the flag setting unit and the correlation parameter calculation unit have the same calculation precision for the difference between the L0 predicted image and the L1 predicted image. A video encoding device characterized by:

〔構成4〕
構成3の動画像符号化装置の前記フラグ設定部と前記相関パラメータ計算部において、L0予測画像とL1予測画像の差分の演算精度を画素ビット長にかかわらず一定にすることを特徴とする動画像符号化装置。
[Configuration 4]
A moving image characterized in that, in the flag setting section and the correlation parameter calculation section of the moving image encoding device according to configuration 3, the calculation accuracy of the difference between the L0 predicted image and the L1 predicted image is made constant regardless of the pixel bit length. Encoding device.

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

31 画像復号装置
301 エントロピー復号部
302 パラメータ復号部
3020 ヘッダ復号部
303 インター予測パラメータ復号部
304 イントラ予測パラメータ復号部
308 予測画像生成部
309 インター予測画像生成部
310 イントラ予測画像生成部
311 逆量子化・逆変換部
312 加算部
11 画像符号化装置
101 予測画像生成部
102 減算部
103 変換・量子化部
104 エントロピー符号化部
105 逆量子化・逆変換部
107 ループフィルタ
110 符号化パラメータ決定部
111 パラメータ符号化部
112 インター予測パラメータ符号化部
113 イントラ予測パラメータ符号化部
1110 ヘッダ符号化部
1111 CT情報符号化部
1112 CU符号化部( 予測モード符号化部)
1114 TU符号化部
30954 BDOF部
309541 L0,L1予測画像生成部
309542 フラグ設定部
309543 勾配画像生成部
309544 相関パラメータ計算部
309545 動き補償修正値導出部
309546 双方向予測画像生成部
31 Image decoding device
301 Entropy decoding section
302 Parameter decoding section
3020 Header decoding section
303 Inter prediction parameter decoding unit
304 Intra prediction parameter decoding unit
308 Predicted image generation unit
309 Inter predicted image generation unit
310 Intra predicted image generation unit
311 Inverse quantization/inverse transformation section
312 Addition section
11 Image encoding device
101 Predicted image generation unit
102 Subtraction section
103 Conversion/quantization section
104 Entropy encoder
105 Inverse quantization/inverse transformation section
107 Loop filter
110 Encoding parameter determination unit
111 Parameter encoding section
112 Inter prediction parameter encoder
113 Intra prediction parameter encoding unit
1110 Header encoder
1111 CT information encoder
1112 CU encoding unit (prediction mode encoding unit)
1114 TU encoding section
30954 BDOF section
309541 L0,L1 predicted image generation unit
309542 Flag setting section
309543 Gradient image generation unit
309544 Correlation parameter calculation section
309545 Motion compensation correction value derivation unit
309546 Bidirectional predictive image generation unit

Claims (5)

第1の予測画像、第2の予測画像及び動き補償修正値を用いて、BDOF予測により第3の予測画像を生成する動画像復号装置であって、
サブブロック単位で、前記第1の予測画像及び前記第2の予測画像の差分絶対値和を導出するBDOF部を備え、
前記第3の予測画像は、(i)前記第1の予測画像と、(ii)前記第2の予測画像と、(iii)前記動き補償修正値と、(iv)第1のオフセット値との加算値を、第1のシフト値で右シフトすることにより導出され、
前記動き補償修正値は、前記第1の予測画像の水平方向の勾配画像と、前記第1の予測画像の垂直方向の勾配画像と、前記第2の予測画像の水平方向の勾配画像と、前記第2の予測画像の垂直方向の勾配画像と、を用いて導出され、
前記第1の予測画像の水平方向の勾配画像は、前記第1の予測画像を第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第1の予測画像の垂直方向の勾配画像は、前記第1の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第2の予測画像の水平方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第2の予測画像の垂直方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出されることを特徴とする動画像復号装置。
A moving image decoding device that generates a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value,
comprising a BDOF unit that derives a sum of absolute differences between the first predicted image and the second predicted image in sub-block units;
The third predicted image is a combination of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) the first offset value. Derived by shifting the summation value to the right by the first shift value,
The motion compensation correction value includes a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, a horizontal gradient image of the second predicted image, and a horizontal gradient image of the first predicted image. a vertical gradient image of the second predicted image,
The horizontal gradient image of the first predicted image is derived by taking the difference between the values obtained by shifting the first predicted image to the right with a second shift value,
The vertical gradient image of the first predicted image is derived by taking the difference between the values obtained by shifting the first predicted image to the right by the second shift value,
The horizontal gradient image of the second predicted image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value,
A video decoding device characterized in that the vertical gradient image of the second predicted image is derived by taking a difference between values obtained by shifting the second predicted image to the right by the second shift value. .
前記第2のシフト値は、6であることを特徴とする請求項1に記載の動画像復号装置。 The moving image decoding device according to claim 1, wherein the second shift value is six. 第1の予測画像、第2の予測画像及び動き補償修正値を用いて、BDOF予測により第3の予測画像を生成する動画像符号化装置であって、
サブブロック単位で、前記第1の予測画像及び前記第2の予測画像の差分絶対値和を導出するBDOF部を備え、
前記第3の予測画像は、(i)前記第1の予測画像と、(ii)前記第2の予測画像と、(iii)前記動き補償修正値と、(iv)第1のオフセット値との加算値を、第1のシフト値で右シフトすることにより導出され、
前記動き補償修正値は、前記第1の予測画像の水平方向の勾配画像と、前記第1の予測画像の垂直方向の勾配画像と、前記第2の予測画像の水平方向の勾配画像と、前記第2の予測画像の垂直方向の勾配画像と、を用いて導出され、
前記第1の予測画像の水平方向の勾配画像は、前記第1の予測画像を第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第1の予測画像の垂直方向の勾配画像は、前記第1の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第2の予測画像の水平方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第2の予測画像の垂直方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出されることを特徴とする動画像符号化装置。
A video encoding device that generates a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value,
comprising a BDOF unit that derives a sum of absolute differences between the first predicted image and the second predicted image in sub-block units;
The third predicted image is a combination of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) the first offset value. Derived by right-shifting the summation value by the first shift value,
The motion compensation correction value includes a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, a horizontal gradient image of the second predicted image, and a horizontal gradient image of the first predicted image. a vertical gradient image of the second predicted image,
The horizontal gradient image of the first predicted image is derived by taking the difference between the values obtained by shifting the first predicted image to the right with a second shift value,
The vertical gradient image of the first predicted image is derived by taking the difference between the values obtained by shifting the first predicted image to the right by the second shift value,
The horizontal gradient image of the second predicted image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value,
Video encoding characterized in that the vertical gradient image of the second predicted image is derived by taking a difference between values obtained by shifting the second predicted image to the right by the second shift value. Device.
第1の予測画像、第2の予測画像及び動き補償修正値を用いて、BDOF予測により第3の予測画像を生成する動画像復号方法であって、
サブブロック単位で、前記第1の予測画像及び前記第2の予測画像の差分絶対値和を導出するステップを少なくとも含み、
前記第3の予測画像は、(i)前記第1の予測画像と、(ii)前記第2の予測画像と、(iii)前記動き補償修正値と、(iv)第1のオフセット値との加算値を、第1のシフト値で右シフトすることにより導出され、
前記動き補償修正値は、前記第1の予測画像の水平方向の勾配画像と、前記第1の予測画像の垂直方向の勾配画像と、前記第2の予測画像の水平方向の勾配画像と、前記第2の予測画像の垂直方向の勾配画像と、を用いて導出され、
前記第1の予測画像の水平方向の勾配画像は、前記第1の予測画像を第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第1の予測画像の垂直方向の勾配画像は、前記第1の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第2の予測画像の水平方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第2の予測画像の垂直方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出されることを特徴とする動画像復号方法。
A video decoding method for generating a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value, the method comprising:
At least the step of deriving the sum of absolute differences between the first predicted image and the second predicted image in sub-block units,
The third predicted image is a combination of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) the first offset value. Derived by shifting the summation value to the right by the first shift value,
The motion compensation correction value includes a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, a horizontal gradient image of the second predicted image, and a horizontal gradient image of the first predicted image. a vertical gradient image of the second predicted image,
The horizontal gradient image of the first predicted image is derived by taking the difference between the values obtained by shifting the first predicted image to the right with a second shift value,
The vertical gradient image of the first predicted image is derived by taking the difference between the values obtained by shifting the first predicted image to the right by the second shift value,
The horizontal gradient image of the second predicted image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value,
A video decoding method characterized in that the vertical gradient image of the second predicted image is derived by taking a difference between values obtained by shifting the second predicted image to the right by the second shift value. .
第1の予測画像、第2の予測画像及び動き補償修正値を用いて、BDOF予測により第3の予測画像を生成する動画像符号化方法であって、
サブブロック単位で、前記第1の予測画像及び前記第2の予測画像の差分絶対値和を導出するステップを少なくとも含み、
前記第3の予測画像は、(i)前記第1の予測画像と、(ii)前記第2の予測画像と、(iii)前記動き補償修正値と、(iv)第1のオフセット値との加算値を、第1のシフト値で右シフトすることにより導出され、
前記動き補償修正値は、前記第1の予測画像の水平方向の勾配画像と、前記第1の予測画像の垂直方向の勾配画像と、前記第2の予測画像の水平方向の勾配画像と、前記第2の予測画像の垂直方向の勾配画像と、を用いて導出され、
前記第1の予測画像の水平方向の勾配画像は、前記第1の予測画像を第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第1の予測画像の垂直方向の勾配画像は、前記第1の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第2の予測画像の水平方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出され、
前記第2の予測画像の垂直方向の勾配画像は、前記第2の予測画像を前記第2のシフト値で右シフトした値の差分を取ることで導出されることを特徴とする動画像符号化方法。
A video encoding method for generating a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value, the method comprising:
At least the step of deriving the sum of absolute differences between the first predicted image and the second predicted image in sub-block units,
The third predicted image is a combination of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) the first offset value. Derived by shifting the summation value to the right by the first shift value,
The motion compensation correction value includes a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, a horizontal gradient image of the second predicted image, and a horizontal gradient image of the first predicted image. a vertical gradient image of the second predicted image,
The horizontal gradient image of the first predicted image is derived by taking the difference between the values obtained by shifting the first predicted image to the right with a second shift value,
The vertical gradient image of the first predicted image is derived by taking the difference between the values obtained by shifting the first predicted image to the right by the second shift value,
The horizontal gradient image of the second predicted image is derived by taking the difference between the values obtained by shifting the second predicted image to the right by the second shift value,
Video encoding characterized in that the vertical gradient image of the second predicted image is derived by taking a difference between values obtained by shifting the second predicted image to the right by the second shift value. Method.
JP2023187980A 2019-06-07 2023-11-01 Moving-image decoding device, moving-image encoding device, moving-image decoding method, and moving-image encoding method Pending JP2023181459A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2023187980A JP2023181459A (en) 2019-06-07 2023-11-01 Moving-image decoding device, moving-image encoding device, moving-image decoding method, and moving-image encoding method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2019107061A JP7378968B2 (en) 2019-06-07 2019-06-07 Predicted image generation device, video decoding device, and video encoding device
JP2023187980A JP2023181459A (en) 2019-06-07 2023-11-01 Moving-image decoding device, moving-image encoding device, moving-image decoding method, and moving-image encoding method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2019107061A Division JP7378968B2 (en) 2019-06-07 2019-06-07 Predicted image generation device, video decoding device, and video encoding device

Publications (1)

Publication Number Publication Date
JP2023181459A true JP2023181459A (en) 2023-12-21

Family

ID=73742173

Family Applications (2)

Application Number Title Priority Date Filing Date
JP2019107061A Active JP7378968B2 (en) 2019-06-07 2019-06-07 Predicted image generation device, video decoding device, and video encoding device
JP2023187980A Pending JP2023181459A (en) 2019-06-07 2023-11-01 Moving-image decoding device, moving-image encoding device, moving-image decoding method, and moving-image encoding method

Family Applications Before (1)

Application Number Title Priority Date Filing Date
JP2019107061A Active JP7378968B2 (en) 2019-06-07 2019-06-07 Predicted image generation device, video decoding device, and video encoding device

Country Status (1)

Country Link
JP (2) JP7378968B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019010156A1 (en) 2017-07-03 2019-01-10 Vid Scale, Inc. Motion-compensation prediction based on bi-directional optical flow
JP7257524B2 (en) 2019-01-02 2023-04-13 テレフオンアクチーボラゲット エルエム エリクソン(パブル) Side motion refinement in video encoding/decoding systems
JP6867611B2 (en) 2019-03-11 2021-04-28 Kddi株式会社 Image decoding device, image decoding method and program

Also Published As

Publication number Publication date
JP7378968B2 (en) 2023-11-14
JP2020202454A (en) 2020-12-17

Similar Documents

Publication Publication Date Title
US20200021837A1 (en) Video decoding apparatus and video coding apparatus
WO2020184487A1 (en) Dynamic image decoding device
WO2021111962A1 (en) Video decoding device
WO2020137920A1 (en) Prediction image generating device, moving image decoding device, moving image encoding device, and prediction image generating method
JP7448349B2 (en) Video decoding device
WO2020045248A1 (en) Video decoding device and video coding device
US20220264142A1 (en) Image decoding apparatus, image coding apparatus, and image decoding method
JP2020096279A (en) Prediction image generation device, moving image decoding device, and moving image encoding device
JP2020145650A (en) Image decoding device and image coding device
JP2020088660A (en) Moving picture coding apparatus and moving picture decoding apparatus
JP2020108012A (en) Image decoding device and image encoding device
WO2021200658A1 (en) Dynamic image decoding device and dynamic image decoding method
US11044490B2 (en) Motion compensation filter apparatus, image decoding apparatus, and video coding apparatus
JP2020170901A (en) Predictive image generation device, video decoding device, and video coding device
JP7378968B2 (en) Predicted image generation device, video decoding device, and video encoding 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
RU2799802C2 (en) Prediction image generation device, video signal decoding device, video signal encoding device and method for project image generation
JP7465128B2 (en) Video encoding device and video decoding device
WO2021235448A1 (en) Video coding device and video decoding device
WO2020122130A1 (en) Predicted image generation device, moving image decoding device, moving image encoding device, and predicted image generation method
RU2812275C2 (en) Video signal decoding device
JP2020109919A (en) Predictive image generation device, moving image decoding device, and moving image encoding device
JP2022152121A (en) Image decoding device and image encoding device
JP2022087865A (en) Image decoder and image encoder

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20231101