Moving picture decoding device

By optimizing the acquisition process of motion vectors by using the parameter decoding unit and prediction unit in the moving image decoding device, and combining the skip flag, merge flag and MMVD flag, the problem of reduced coding efficiency at high compression rates is solved and more efficient images are achieved Decoding and encoding.

CN118764643APending Publication Date: 2024-10-11SHARP KK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411121391.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-12-07
Filing Date
2019-12-03
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

When achieving a high compression rate, the flag information of the prediction parameter information becomes overhead, resulting in a problem of reduced coding efficiency.

Method used

Using a moving image decoding device, the parameter decoding unit decodes the parameters in the motion vector difference merging mode, uses the difference vector and the motion vector derived from the index of the merging candidate list, and combines the skip flag, the merging flag and the MMVD flag to decode and Encoding, optimizing the motion vector acquisition process.

Benefits of technology

It effectively suppresses the decrease in coding efficiency under high compression rates and improves the performance of image decoding and encoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764643A_ABST
    Figure CN118764643A_ABST
Patent Text Reader

Abstract

Provided is an image decoding device capable of suppressing a decrease in encoding efficiency when a high compression ratio is achieved. An image decoding device includes a parameter decoding unit that decodes a skip flag indicating whether or not to be in a skip mode, decodes a merge flag indicating whether or not to be in a merge mode when the skip flag does not indicate the skip mode, and decodes the merge flag indicating whether or not to be in the merge mode when the merge flag does not indicate the merge mode. An MMVD flag indicating whether the mode is an MMVD mode is decoded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to a moving picture decoding device and a moving picture encoding device. Background Art

[0002] In order to efficiently transmit or record moving images, a moving image encoding device that generates encoded data by encoding the moving image and a moving image decoding device that generates a decoded image by decoding the encoded data are used.

[0003] Specific moving picture coding methods include, for example, H.264 / AVC and HEVC (High-Efficiency Video Coding).

[0004] In such a motion image coding method, images (pictures) constituting the motion image are managed through a hierarchical structure and encoded / decoded for each CU. The hierarchical structure includes slices obtained by dividing the image, coding tree units (CTU: Coding Tree Unit) obtained by dividing the slices, coding units (sometimes also called coding units (Coding Unit: CU)) obtained by dividing the coding tree units, and transform units (TU: Transform Unit) obtained by dividing the coding units.

[0005] In such a moving picture coding method, a prediction image is usually generated based on a local decoded image obtained by encoding / decoding an input image, and a prediction error (sometimes also referred to as a "difference image" or "residual image") obtained by subtracting the prediction image from the input image (original image) is encoded. Examples of methods for generating a prediction image include inter-picture prediction (inter-frame prediction) and intra-picture prediction (intra-frame prediction).

[0006] In addition, Non-Patent Documents 1 to 3 are cited as recent moving picture encoding and decoding techniques. Prior art literature Non-patent literature

[0007] Non-patent document 1: "Versatile Video Coding (Draft 3)", JVET-L1001-v4, Joint Video Experts Team (JVET) of ITU-T SG 16WP3 and ISO / IEC JTC 1 / SC 29 / WG11.2018-12-03 Non-patent document 2: “CE4 Ultimate motion vector expression (Test 4.5.4)”, JVET-L0054-v4, Joint Video Exploration Team (JVET) of ITU-T SG 16WP 3 and ISO / IEC JTC1 / SC 29 / WG 11, 2018-10-11 Non-patent document 3: “Simplified DMVR for inclusion in VVC”, JVET-L0670-v 1, Joint Video Exploration Team (JVET) of ITU-T SG 16WP 3and ISO / IEC JTC 1 / SC 29 / WG 11, 2018-10-6 Summary of the invention Problem that the invention aims to solve

[0008] When achieving a high compression rate, there is a problem that the flag information of the added prediction parameter information becomes an overhead and the encoding efficiency decreases.

[0009] An object of the embodiments of the present invention is to realize an image decoding device and an image encoding device that can suppress a decrease in encoding efficiency when a high compression rate is achieved. Technical Solution

[0010] In order to solve the above-mentioned problem, a moving picture decoding device according to one embodiment of the present invention comprises: a parameter decoding unit that decodes a parameter for generating a predicted picture; and a prediction unit that obtains a motion vector by adding a differential vector to a motion vector derived from an index of a merge candidate list when a Merge with Motion Vector Difference (MMVD) mode is used.

[0011] The parameter decoding unit decodes a skip flag indicating whether it is a skip mode in which there is no prediction residual. When the skip flag does not indicate the skip mode, the unit decodes a merge flag indicating whether it is a merge mode in which motion vector information is obtained from a merge candidate. When the merge flag indicates the merge mode, the unit decodes an MMVD flag indicating whether it is an MMVD mode in which motion vector information is obtained by decoding differential motion vector information in a specified direction from encoded data. When the MMVD flag indicates the MMVD mode, the unit decodes an index of the merge candidate list, a first index indicating the length of the differential vector, and a second index indicating the direction of the differential vector. When the MMVD flag does not indicate the MMVD mode, the unit decodes a merge index. The prediction unit derives the motion vector from the index of the merge candidate list, and derives the differential vector from the first index and the second index.

[0012] In addition, in order to solve the above problems,

[0013] A moving picture decoding device according to one embodiment of the present invention comprises: a parameter decoding unit that decodes parameters for generating a predicted image in a motion vector difference merging (MMVD) mode; and The MMVD prediction unit obtains a motion vector of a merge candidate by adding a differential vector to a motion vector derived from an index of the merge candidate list, The parameter decoding unit decodes the index of the merge candidate list, the first index indicating the length of the differential vector, and the second index indicating the direction of the differential vector. The MMVD prediction unit derives the motion vector of the merge candidate from the index of the merge candidate list. In the case where the merge candidate is bidirectionally predicted, a first vector is derived from the first index and the second index, When the distance between the object image and the first image is greater than the distance between the object image and the second image, the first vector is set to a first differential vector between the object block on the object image and the first image, and the first differential vector is scaled to derive a second differential vector between the object block and the second image. Beneficial Effects

[0014] According to the above configuration, it is possible to realize an image decoding device and an image encoding device that can suppress a decrease in encoding efficiency when a high compression rate is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a schematic diagram showing the configuration of the image transmission system according to the present embodiment. Figure 2 This is a diagram showing the configuration of a transmitting device equipped with a moving picture encoding device according to this embodiment and a receiving device equipped with a moving picture decoding device. Figure 2 (a) represents a transmitting device equipped with a motion picture encoding device, Figure 2 (b) represents a receiving device equipped with a motion picture decoding device. Figure 3 This is a diagram showing the configuration of a recording device equipped with a moving picture encoding device according to this embodiment and a reproducing device equipped with a moving picture decoding device. Figure 3 (a) represents a recording device equipped with a motion picture encoding device, Figure 3 (b) shows a reproduction device equipped with a motion picture decoding device. Figure 4 This is a diagram showing the hierarchical structure of the data of the coded stream. Figure 5 This is a diagram showing an example of CTU segmentation. Figure 6 This is a conceptual diagram showing an example of a reference picture and a reference picture list. Figure 7 This is a schematic diagram showing the structure of a moving picture decoding device. Figure 8 This is a schematic diagram showing the structure of an inter-frame prediction parameter decoding unit. Fig. 9 It is a schematic diagram showing the structure of the combined prediction parameter derivation unit and the AMVP prediction parameter derivation unit. Fig.10 It is a diagram showing the affine predicted motion vector spMvLX[xi][yi]. Fig.11 This is a schematic diagram showing the structure of an inter-frame prediction image generation unit. Fig.12 This is a block diagram showing the structure of a moving picture encoding device. Fig.13 This is a schematic diagram showing the structure of a parameter encoding unit. Fig.14 is a diagram showing an example of an index used in MMVD mode, where Fig.14 (a) is a diagram showing an example of an index base_candidate_idx representing a merge candidate of a merge candidate list mergeCandList[], Fig.14 (b) is a diagram showing an example of a block adjacent to the object block. Fig.14 (c) is a diagram showing an example of distance_idx. Fig.14(d) is a diagram showing an example of direction_idx. Fig.15 This is a diagram showing an example of the number of candidates for the search distance and the number of candidates for the derivation direction in the moving picture encoding device. Fig.16 This is a flowchart showing the flow of prediction mode selection processing in a moving picture decoding device. Fig.17 : is a diagram showing the syntax indicating the prediction mode selection process according to the present embodiment. Fig.18 This is a flowchart showing the flow of prediction mode selection processing in a moving picture decoding device. Fig.19 : is a diagram showing the syntax indicating the prediction mode selection process according to the present embodiment. Fig. 20 This is a flowchart showing the flow of prediction mode selection processing in a moving picture decoding device. Fig.21 : is a diagram showing the syntax indicating the prediction mode selection process according to the present embodiment. DETAILED DESCRIPTION (First Embodiment)

[0016] Hereinafter, embodiments of the present invention will be described with reference to the drawings.

[0017] Figure 1 It is a schematic diagram showing the configuration of the image transmission system 1 according to the present embodiment.

[0018] The image transmission system 1 is a system for transmitting a coded stream obtained by encoding a coding target image, decoding the transmitted coded stream and displaying the image. The image transmission system 1 is configured to include: a moving image encoding device (image encoding device) 11, a network 21, a moving image decoding device (image decoding device) 31, and a moving image display device (image display device) 41.

[0019] The video image encoding device 11 receives the image T as input.

[0020] The network 21 transmits the encoded stream Te generated by the moving image encoding device 11 to the moving image 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 limited to a two-way communication network, and may also be a one-way communication network that transmits broadcast waves such as terrestrial digital broadcasts and satellite broadcasts. In addition, the network 21 may be replaced by a storage medium such as a DVD (Digital Versatile Disc, registered trademark) or a BD (Blue-ray Disc, registered trademark) on which the encoded stream Te is recorded.

[0021] The moving image decoding device 31 decodes the encoded stream Te transmitted by the network 21 respectively, and generates one or more decoded images Td after decoding.

[0022] The moving image display device 41 displays all or part of the one or more decoded images Td generated by the moving image decoding device 31. The moving image display device 41 includes, for example, a display device such as a liquid crystal display or an organic EL (Electro-luminescence) display. As the form of the display, a fixed type, a mobile type, an HMD, etc. can be cited. In addition, when the moving image decoding device 31 has high processing power, an image with high image quality is displayed, and when it only has low processing power, an image that does not require high processing power and high display ability is displayed. <Operator>

[0023] The following describes the operators used in this specification.

[0024] >> is a right shift, << is a left shift, & is a bitwise AND, | is a bitwise OR, |= is an OR assignment operator, and || represents a logical OR.

[0025] x? y : z is a ternary operator that takes y when x is true (other than 0) and takes z when x is false (0).

[0026] Clip3(a, b, c) is a function that clips c to a value above a and below b, and returns a when c < a, returns b when c > b, and returns c in other cases (where a <= b).

[0027] abs(a) is a function that returns the absolute value of a.

[0028] Int(a) is a function that returns the integer value of a.

[0029] floor(a) is a function that returns the largest integer below a.

[0030] ceil(a) is a function that returns the smallest integer greater than a.

[0031] a / d means a divided by d (discarding decimal places).

[0032] sign(a) is a function that returns the sign of a.

[0033] a^b means a raised to the power of b. <Structure of coded stream Te>

[0034] Before describing in detail the moving picture encoding device 11 and the moving picture decoding device 31 of the present embodiment, the data structure of the coded stream Te generated by the moving picture encoding device 11 and decoded by the moving picture decoding device 31 will be described.

[0035] Figure 4 : is a diagram showing the hierarchical structure of data in the coded stream Te. The coded stream Te exemplarily includes a sequence and a plurality of pictures constituting the sequence. Figure 4 (a) to (f) are diagrams respectively representing a coded video sequence of a given sequence SEQ, a coded picture of a given picture PICT, a coded slice of a given slice S, coded slice data of the given slice data, a coding tree unit included in the coded slice data, and a coding unit included in the coding tree unit. (Encoded video sequence)

[0036] In the coded video sequence, a set of data is defined for reference by the video decoding device 31 in order to decode the sequence SEQ to be processed. Figure 4 As shown in (a), it 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 supplemental enhancement information SEI (Supplemental Enhancement Information).

[0037] The video parameter set VPS defines a set of coding parameters common to a plurality of moving images in a moving image composed of multiple layers, and a set of coding parameters associated with the multiple layers included in the moving image and with each layer.

[0038] In the sequence parameter set SPS, a set of coding parameters is specified for reference by the motion image decoding device 31 in order to decode the object sequence. For example, the width and height of the picture are specified. It should be noted that there can be multiple SPSs. In this case, any one of the multiple SPSs is selected from the PPS.

[0039] In the picture parameter set PPS, a set of coding parameters is specified for reference by the motion image decoding device 31 to decode each picture in the target sequence. For example, it includes a reference value (pic_init_qp_minus26) of the quantization width used for decoding the picture and a flag (weighted_pred_flag) indicating the application of weighted prediction. It should be noted that there can be multiple PPSs. In this case, any one of the multiple PPSs is selected from each picture in the target sequence. (Encoded image)

[0040] In the coded picture, a set of data is defined for reference by the video decoding device 31 in order to decode the picture PICT to be processed. Figure 4 As shown in (b), it includes slices 0 to NS-1 (NS is the total number of slices included in the picture PICT).

[0041] It should be noted that, in the following, when there is no need to distinguish between slices 0 to NS-1, the code subscript may be omitted for description. The same applies to other data with subscripts included in the coded stream Te described below. (Encoding slice)

[0042] In the coded slice, a set of data is defined for reference by the video decoding device 31 to decode the slice S to be processed. Figure 4 (c) includes a slice header and slice data.

[0043] The slice header includes a coding parameter group that the moving picture decoding device 31 refers to in order to determine a decoding method of a target slice. Slice type designation information (slice_type) that designates a slice type is one example of a coding parameter included in the slice header.

[0044] Examples of slice types that can be specified by the slice type specification information include: (1) I slices that use only intra-frame prediction when encoding, (2) P slices that use unidirectional prediction or intra-frame prediction when encoding, and (3) B slices that use unidirectional prediction, bidirectional prediction, or intra-frame prediction when encoding. It should be noted that inter-frame prediction is not limited to unidirectional prediction and bidirectional prediction, and more reference pictures can be used to generate predicted images. Hereinafter, the cases referred to as P and B slices refer to slices that include blocks that can use inter-frame prediction.

[0045] It should be noted that the slice header may also include a reference to the picture parameter set PPS (pic_parameterset_id). (Encoded slice data)

[0046] The coded slice data specifies a set of data that the video decoding device 31 refers to in order to decode the slice data to be processed. Figure 4 (d) includes CTU. CTU is a block of a fixed size (for example, 64×64) constituting a slice, and is also called the largest coding unit (LCU). (Coding Tree Unit)

[0047] exist Figure 4 In (e), a set of data is specified for reference by the motion image decoding device 31 in order to decode the CTU of the processing object. The CTU is divided into coding units CU, which are basic units of encoding processing, by recursive quadtree partitioning (QT (Quad Tree) partitioning), binary tree partitioning (BT (Binary Tree) partitioning) or ternary tree partitioning (TT (Ternary Tree) partitioning). BT partitioning and TT partitioning are collectively referred to as multi-tree partitioning (MT (Multi Tree) partitioning). The nodes of the tree structure obtained by recursive quadtree partitioning are called coding nodes (Coding Node). The intermediate nodes of the quadtree, binary tree and ternary tree are coding nodes, and the CTU itself is also specified as the top-level coding node.

[0048] CT includes the following information as CT information: a QT split flag (qt_split_cu_flag) indicating whether QT splitting is performed, an MT split flag (mtt_split_cu_flag) indicating whether MT splitting is performed, an MT split direction (mtt_split_cu_vertical_flag) indicating the splitting direction of MT splitting, and an MT split type (mtt_split_cu_binary_flag) indicating the splitting type of MT splitting. qt_split_cu_flag, mtt_split_cu_flag, mtt_split_cu_vertical_flag, and mtt_split_cu_binary_flag are transmitted for each coding node.

[0049] Figure 5 This is a diagram showing an example of CTU segmentation. When qt_split_cu_flag is 1, the coding node is segmented into 4 coding nodes ( Figure 5 (b)).

[0050] When qt_split_cu_flag is 0 and mtt_split_cu_flag is 0, the coding node is not split and 1 CU is kept as a node ( Figure 5 (a)). CU is the terminal node of the coding node and is not further divided. CU is the basic unit of the coding process.

[0051] When mtt_split_cu_flag is 1, the coding node is MT split as follows. When mtt_split_cu_vertical_flag is 0 and mtt_split_cu_binary_flag is 1, the coding node is horizontally split into 2 coding nodes ( Figure 5 (d)), when mtt_split_cu_vertical_flag is 1 and mtt_split_cu_binary_flag is 1, the coding node is vertically split into 2 coding nodes ( Figure 5 (c)). In addition, when mtt_split_cu_vertical_flag is 0 and mtt_split_cu_binary_flag is 0, the coding node is horizontally split into 3 coding nodes ( Figure 5 (f)), when mtt_split_cu_vertical_flag is 1 and mtt_split_cu_binary_flag is 0, the coding node is vertically split into 3 coding nodes ( Figure 5 (e)). Place them in Figure 5is shown in (g).

[0052] In addition, when the size of CTU is 64×64 pixels, the size of CU can be any one of 64×64 pixels, 64×32 pixels, 32×64 pixels, 32×32 pixels, 64×16 pixels, 16×64 pixels, 32×16 pixels, 16×32 pixels, 16×16 pixels, 64×8 pixels, 8×64 pixels, 32×8 pixels, 8×32 pixels, 16×8 pixels, 8×16 pixels, 8×8 pixels, 64×4 pixels, 4×64 pixels, 32×4 pixels, 4×32 pixels, 16×4 pixels, 4×16 pixels, 8×4 pixels, 4×8 pixels and 4×4 pixels. (Coding unit)

[0053] like Figure 4 As shown in (f), a set of data is specified for reference by the video decoding device 31 to decode the coding unit to be processed. Specifically, the CU is composed of a CU header CUH, prediction parameters, transform parameters, quantized transform coefficients, etc. The prediction mode, etc. are specified in the CU header.

[0054] The prediction process may be performed in units of CU or in units of sub-CUs obtained by further dividing the CU. When the size of the CU and the sub-CU are equal, there is one sub-CU in the CU. When the size of the CU is larger than the size of the sub-CU, the CU is divided into sub-CUs. For example, when the CU is 8×8 and the sub-CU is 4×4, the CU is divided into 4 sub-CUs, including two parts divided horizontally and two parts divided vertically.

[0055] There are two types of prediction (prediction modes): intra prediction and inter prediction. Intra prediction is prediction within the same picture, and inter prediction is prediction processing performed between different pictures (for example, between display times).

[0056] The transform / quantization process is performed in units of CUs, but the quantized transform coefficients may be entropy-coded in units of 4×4 or other sub-blocks. (Prediction parameters)

[0057] The predicted image is derived from prediction parameters attached to the block. The prediction parameters include prediction parameters for intra-frame prediction and inter-frame prediction.

[0058] The following describes the prediction parameters of inter-frame prediction. The inter-frame prediction parameters are composed of prediction list utilization flags predFlagL0 and predFlagL1, reference picture indexes refIdxL0 and refIdxL1, and motion vectors mvL0 and mvL1. The prediction list utilization flags predFlagL0 and predFlagL1 are flags indicating whether to use the reference picture lists called L0 list and L1 list, respectively. When the value is 1, the corresponding reference picture list is used. It should be noted that in the present specification, when it is described as "a flag indicating whether it is ××", a flag other than 0 (for example, 1) is set to be ××, and a flag of 0 is set to be not ××. In logical NOT, logical product, etc., 1 is regarded as true and 0 is regarded as false (the same applies below). However, other values ​​can also be used as true values ​​and false values ​​in actual devices and methods.

[0059] The syntax elements used to derive inter-frame prediction parameters include, for example, an affine flag affine_flag, a merge flag merge_flag, a merge index merge_idx, an inter-frame prediction identifier inter_pred_idc, a reference picture index refIdxLX, a prediction vector index mvp_LX_idx, a differential vector mvdLX, and a motion vector accuracy mode amvr_mode. (See picture list)

[0060] The reference picture list is a list consisting of reference pictures stored in the reference picture memory 306 . Figure 6 is a conceptual diagram showing an example of a reference picture and a reference picture list. Figure 6 In (a), the rectangle represents the picture, the arrow represents the reference relationship of the picture, the horizontal axis represents time, the I, P, and B in the rectangle represent intra-frame pictures, unidirectional prediction pictures, and bidirectional prediction pictures, respectively, and the numbers in the rectangle represent the decoding order. Figure 6 As shown in (a), the decoding order of the pictures is I0, P1, B2, B3, B4, and the display order is I0, B3, B2, B4, P1. Figure 6 (b) of FIG. 4 shows an example of a reference picture list of picture B3 (target picture). A reference picture list is a list indicating candidates for reference pictures, and one picture (slice) can have more than one reference picture list. Figure 6 In the example of (b), the target picture B3 has two reference picture lists, L0 list RefPicList0 and L1 list RefPicList1. In each CU, a reference picture index refIdxLX specifies which picture in the reference picture list RefPicListX (X=0 or 1) is actually referenced. Figure 6(b) is an example of refIdxL0 = 2, refIdxL1 = 0. It should be noted that LX is a description method used when L0 prediction and L1 prediction are not distinguished. In the following, LX is replaced with L0 and L1 to distinguish parameters for the L0 list and parameters for the L1 list. (Combined forecast and AMVP forecast)

[0061] The decoding (encoding) methods of prediction parameters include merge prediction mode and AMVP (Advanced Motion Vector Prediction) mode, and the merge flag merge_flag is a flag used to identify them. The merge prediction mode is a mode in which the prediction list is not included in the encoded data using the flag predFlagLX (or inter-frame prediction identifier inter_pred_idc), the reference picture index refIdxLX, and the motion vector mvLX, but is derived and used from the prediction parameters of the processed nearby blocks. The AMVP mode is a mode in which the inter-frame prediction identifier inter_pred_idc, the reference picture index refIdxLX, and the motion vector mvLX are included in the encoded data. It should be noted that the motion vector mvLX is encoded as the prediction vector index mvp_LX_idx that identifies the prediction vector mvpLX, the differential vector mvdLX, and the motion vector accuracy mode amvr_mode. The merge prediction mode is a mode for obtaining a motion vector mvLX (motion vector information) by selecting a merge candidate derived from motion information of adjacent blocks, etc. In addition, in addition to the merge prediction mode, there can also be an affine prediction mode identified by an affine flag affine_flag. As a method of the merge prediction mode, there can be a skip mode identified by a skip flag skip_flag. It should be noted that the skip mode refers to a mode in which prediction parameters are derived and used by the same method as the merge mode, and is a mode in which the prediction error (residual image, residual information) is not included in the encoded data. In other words, when the skip flag skip_flag is 1, with respect to the object CU, only the syntax associated with the merge mode, such as the skip flag skip_flag and the merge index merge_idx, is included, and the motion vector, residual information, etc. are not included in the encoded data. (Motion Vector)

[0062] The motion vector mvLX indicates the amount of shift between blocks on two different pictures. The prediction vector and the difference vector related to the motion vector mvLX are referred to as a prediction vector mvpLX and a difference vector mvdLX, respectively. (Inter prediction identifier inter_pred_idc and prediction list use flag predFlagLX)

[0063] The inter-frame prediction identifier inter_pred_idc is a value indicating the type and number of reference pictures, and takes any value of PRED_L0, PRED_L1, and PRED_BI. PRED_L0 and PRED_L1 respectively indicate unidirectional prediction using a reference picture managed in the L0 list and the L1 list. PRED_BI indicates bidirectional prediction BiPred using two reference pictures managed in the L0 list and the L1 list.

[0064] The merge index merge_idx is an index indicating whether any prediction parameter among the prediction parameter candidates (merge candidates) derived from the processed block is to be used as the prediction parameter of the target block.

[0065] The relationship between the inter-frame prediction identifier inter_pred_idc and the prediction list utilization flags predFlagL0 and predFlagL1 can be converted to each other as follows. inter_pred_idc=(predFlagL1<<1)+predFlagL0 predFlagL0=inter_pred_idc&1 predFlagL1=inter_pred_idc>>1 (Bidirectional prediction biPred determination)

[0066] The flag biPred indicating whether the prediction is bidirectional BiPred can be derived from whether the two prediction list utilization flags are both 1. For example, it can be derived by the following formula. biPred=(predFlagL0==1&&predFlagL1==1)

[0067] Alternatively, the flag biPred can also be derived based on whether the inter-frame prediction identifier is 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 (Configuration of Moving Image Decoding Device)

[0068] The video decoding device 31 ( Figure 7 ) is described below.

[0069] The moving image decoding device 31 is configured to include an entropy decoding unit 301, a parameter decoding unit 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generation unit (prediction image generation device) 308, an inverse quantization / inverse transformation unit 311, and an addition unit 312. It should be noted that, according to the moving image encoding device 11 described later, there is also a configuration in which the loop filter 305 is not included in the moving image decoding device 31.

[0070] The parameter decoding unit 302 also 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 in the figure. The CU decoding unit 3022 also includes a TU decoding unit 3024. They can also be collectively referred to as decoding modules. The header decoding unit 3020 decodes parameter set information such as VPS, SPS, PPS, and slice header (slice information) from the encoded data. The CT information decoding unit 3021 decodes CT from the encoded data. The CU decoding unit 3022 decodes CU from the encoded data. When the prediction error is included in the TU, the TU decoding unit 3024 decodes QP update information (quantization correction value) and quantization prediction error (residual_coding) from the encoded data.

[0071] The TU decoding unit 3024 decodes Qp update information (quantization correction value) and quantization prediction error (residual_coding) from the coded data when the skip mode is not selected (skip_mode==0). More specifically, the TU decoding unit 3024 decodes the flag cu_cbp indicating whether the target block includes the quantization prediction error from the coded data when skip_mode==0, and decodes the quantization prediction error when cu_cbp is 1. When cu_cbp does not exist in the coded data, the TU decoding unit 3024 derives cu_cbp as 0.

[0072] The parameter decoding unit 302 includes an inter prediction parameter decoding unit 303 and an intra prediction parameter decoding unit 304 (not shown). The predicted image generation unit 308 includes an inter prediction image generation unit 309 and an intra prediction image generation unit 310 .

[0073] In addition, the following describes an example of using CTU and CU as processing units, but the present invention is not limited thereto, and processing may be performed in sub-CU units. Alternatively, CTU and CU may be replaced with blocks, and sub-CU may be replaced with sub-blocks, and processing may be performed in blocks or sub-blocks.

[0074] The entropy decoding unit 301 performs entropy decoding on the coded stream Te input from the outside, and decodes each code (syntax element). The decoded code includes prediction information for generating a predicted image and a prediction error for generating a differential image.

[0075] The entropy decoding unit 301 outputs the decoded code to the parameter decoding unit 302. The decoded code is, for example, predMode, merge_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_LX_idx, mvdLX, amvr_mode, etc. Based on the instruction of the parameter decoding unit 302, control is performed on which code is decoded. (Configuration of Inter-frame Prediction Parameter Decoding Unit)

[0076] The inter prediction parameter decoding unit 303 decodes the inter prediction parameter based on the code input from the entropy decoding unit 301, referring to the prediction parameter stored in the prediction parameter memory 307. In addition, the inter prediction parameter decoding unit 303 outputs the decoded inter prediction parameter to the prediction image generation unit 308, and stores it in the prediction parameter memory 307.

[0077] Figure 8 1 is a schematic diagram showing the structure of the inter-frame prediction parameter decoding unit 303 of the present embodiment. The inter-frame prediction parameter decoding unit 303 is configured to include: a merge prediction unit 30374, a DMVR unit 30375, a sub-block prediction unit (affine prediction unit) 30372, an MMVD prediction unit 30376, a triangle prediction unit 30377, an AMVP prediction parameter derivation unit 3032, and an addition unit 3038. The merge prediction unit 30374 is configured to include a merge prediction parameter derivation unit 3036. The AMVP prediction parameter derivation unit 3032, the merge prediction parameter derivation unit 3036, and the affine prediction unit 30372 are common units in a motion picture encoding device and a motion picture decoding device, and therefore, these may also be collectively referred to as a motion vector derivation unit (motion vector derivation device). (Affine prediction unit)

[0078] The affine prediction unit 30372 derives affine prediction parameters of the object block. In the present embodiment, motion vectors (mv0_x, mv0_y) (mv1_x, mv1_y) of two control points (V0, V1) of the object block are derived as affine prediction parameters. Specifically, the motion vector of each control point may be derived by predicting based on the motion vector of the adjacent block of the object block, or the motion vector of each control point may be derived by the sum of the predicted vector derived as the motion vector of the control point and the differential vector derived from the encoded data.

[0079] Fig.10: is a diagram showing an example of deriving motion vectors spMvLX of each sub-block constituting the target block (bW×bH) from the motion vectors (mv0_x, mv0_y) of the control points V0 and V1. The motion vectors spMvLX of each sub-block are as follows: Fig.10 As shown, a motion vector is derived for each point located at the center of each sub-block.

[0080] The affine prediction unit 30372 uses the following formula to derive the motion vector spMvLX[xi][yi] (xi=xPb+sbW*i, yj=yPb+sbH*j, i=0, 1, 2...bW / sbW-1, j=0, 1, 2...bH / sbH-1) of each sub-block in the object block based on the affine prediction parameters of the object block. spMvLX[xi][yi][0]=mv0_x+(mv1_x-mv0_x) / bW*(xi+sbW / 2)-(mv1_y-mv0_y) / bH*(yi+sbH / 2) spMvLX[xi][yi][1]=mv0_y+(mv1_y-mv0_y) / bW*(xi+sbW / 2)+(mv1_x-mv0_x) / bH*(yi+sbH / 2) (Combined forecast)

[0081] Fig. 9 (a) is a schematic diagram showing the structure of the merge prediction parameter derivation unit 3036 included in the merge prediction unit 30374. The merge prediction parameter derivation unit 3036 includes a merge candidate derivation unit 30361 and a merge candidate selection unit 30362. It should be noted that the merge candidate is composed of: a prediction list utilization flag predFlagLX, a motion vector mvLX, and a reference picture index refIdxLX, which are stored in the merge candidate list. The index is assigned to the merge candidate stored in the merge candidate list according to a prescribed rule.

[0082] The merge candidate derivation unit 30361 directly uses the decoded motion vector of the adjacent block and the reference picture index refIdxLX to derive the merge candidate.

[0083] The order of the merge candidate list mergeCandList[] is, for example, spatial merge candidate A1, B1, B0, A0, B2, temporal merge candidate Col, paired merge candidate avgK, zero merge candidate ZK. It should be noted that unusable reference blocks (blocks for intra-frame prediction, etc.) are not stored in the merge candidate list.

[0084] The merge candidate selection unit 30362 selects a merge candidate N indicated by a merge index merge_idx from among the merge candidates included in the merge candidate list using the following formula. N = mergeCandList[merge_idx]

[0085] Here, N is a label indicating a merge candidate, and may be A1, B1, B0, A0, B2, Col, avgK, ZK, etc. The motion information of the merge candidate indicated by label N is represented by (mvLXN[0], mvLXN[1]), predFlagLXN, and refIdxLXN.

[0086] The merge candidate selection unit 30362 selects the motion information (mvLXN[0], mvLXN[1]), predFlagLXN, and refIdxLXN of the selected merge candidate as the inter-frame prediction parameters of the target block. The merge candidate selection unit 30362 stores the inter-frame prediction parameters of the selected merge candidate in the prediction parameter memory 307 and outputs them to the predicted image generation unit 308. (AMVP prediction)

[0087] Fig. 9 (b) is a schematic diagram showing the structure of the AMVP prediction parameter derivation unit 3032 of 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 prediction vector candidate based on the reference picture index refIdxLX and the motion vector mvLX of the decoded adjacent block stored in the prediction parameter memory 307, and stores it in the prediction vector candidate list mvpListLX[].

[0088] The vector candidate selection unit 3034 selects the motion vector mvpListLX[mvp_LX_idx] indicated by the predictor index mvp_LX_idx from among the predictor candidates in the predictor candidate list mvpListLX[] as the predictor mvpLX. The vector candidate selection unit 3034 outputs the selected predictor mvpLX to the addition unit 3038 .

[0089] It should be noted that the prediction vector candidate is derived by scaling the motion vector of the decoded adjacent block within a preset range from the object block. It should be noted that the adjacent block includes not only the blocks that are spatially adjacent to the object block, such as the left block and the upper block, but also the area that is temporally adjacent to the object block, for example, the area obtained based on the prediction parameters of the block that contains the same position as the object block but different display time.

[0090] The adder 3038 adds the predicted vector mvpLX input from the AMVP prediction parameter derivation unit 3032 and the decoded differential vector mvdLX to calculate the motion vector mvLX. The adder 3038 outputs the calculated motion vector mvLX to the predicted image generation unit 308 and the prediction parameter memory 307. mvLX[0] = mvpLX[0] + mvdLX[0] mvLX[1] = mvpLX[1] + mvdLX[1]

[0091] The motion vector precision mode amvr_mode is a syntax for switching the precision of the motion vector derived in the AMVP mode. For example, when amvr_mode = 0, 1, 2, it switches the precision to 1 / 4 pixel, 1 pixel, and 4 pixels respectively.

[0092] When the precision of the motion vector is set to 1 / 16 precision (MVPREC = 16), the MvShift (= 1 << amvr_mode) derived from amvr_mode can be used as follows for inverse quantization to change the motion vector difference with 1 / 4, 1, and 4 pixel precisions to a motion vector difference with 1 / 16 pixel precision. mvdLX[0] = mvdLX[0] << (MvShift + 2) mvdLX[1] = mvdLX[1] << (MvShift + 2)

[0093] It should be noted that the parameter decoding unit 302 can also decode the following syntax to derive mvdLX[] before being shifted by the above MvShift. · abs_mvd_greater0_flag · abs_mvd_minus2 · mvd_sign_flag

[0094] Then, the parameter decoding unit 302 decodes the differential vector lMvd[] from the syntax using the following formula. lMvd[compIdx] = abs_mvd_greater0_flag[compIdx] * (abs_mvd_minus2[compIdx] + 2) * (1 - 2 * mvd_sign_flag[compIdx])

[0095] Moreover, in the case of translation MVD (MotionModelIdc[x][y]==0), the decoded differential vector lMvd[] is set to MvdLX, and in the case of control point MVD (MotionModelIdc[x][y]!=0), the decoded differential vector 1Mvd[] is set to MvdCpLX. if (MotionModelIdc[x][y] == 0) mvdLX[x0][y0][compIdx]=lMvd[compIdx] else mvdCpLX[x0][y0][compIdx]=lMvd[compIdx]<<2 (Motion Vector Scaling)

[0096] The derivation method of motion vector scaling is described below. When a motion vector Mv (reference motion vector), a picture PicMv including a block having Mv, a reference picture PicMvRef of Mv, a scaled motion vector sMv, a picture CurPic including a block having sMv, and a reference picture CurPicRef referenced by sMv are used, the derivation function MvScale(Mv, PicMv, PicMvRef, CurPic, CurPicRef) of sMv is expressed by the following formula. sMv=MvScale(Mv, PicMv, PicMvRef, CurPic, CurPicRef) =Clip3(-R1, R1-1, sign(distScaleFactor*Mv)*((abs(distScaleFactor*Mv)+round1-1)>>shift1)) distScaleFactor=Clip3(-R2, R2-1, (tb*tx+round2)>>shift2) tx=(16384+abs(td)>>1) / td td=DiffPicOrderCnt(PicMv,PicMvRef) tb=DiffPicOrderCnt(CurPic, CurPicRef)

[0097] Here, round1, round2, shift1, shift2 are rounding values ​​and shift values ​​for division using reciprocals, for example, round1=1<<(shift1-1), round2=1<<(shift2-1), shift1=8, shift2=6, etc. DiffPicOrderCnt(Pic1, Pic2) is a function that returns the difference between the time information (e.g., POC) of Pic1 and Pic2. R1 and R2 are values ​​that limit the value range to be processed with limited precision, for example, R1=32768, R2=4096, etc.

[0098] In addition, the scaling function MvScale(Mv, PicMv, PicMvRef, CurPic, CurPicRef) can be the following formula. MvScale(Mv, PicMv, PicMvRef, CurPic, CurPicRef) = Mv*DiffPicOrderCnt(CurPic, CurPicRef) / DiffPicOrderCnt(PicMv, PicMvRef)

[0099] That is, Mv may be scaled according to the ratio of the difference between the time information of CurPic and CurPicRef and the difference between the time information of PicMv and PicMvRef. (DMVR)

[0100] Next, the DMVR (Decoder side Motion Vector Refinement) process performed by the DMVR unit 30375 is described. When the following conditions are satisfied for the target CU, the DMVR unit 30375 corrects the motion vector mvLX of the target CU derived by the merge prediction unit 30374 using the reference image. -Indicates that for the target CU, merge_flag applies the merge mode or skip_flag applies the skip mode. - Indicates that for the target CU, affine_flag does not use affine mode. -The target CU is bidirectionally predicted. - The reference picture satisfies the following equation (the two reference pictures are in opposite directions relative to the target picture and have the same POC distance (POC difference) from the target picture). POC_current-POC0=POC1-POC_current -The size of the target CU is larger than the specified value. For example, the sum of the width and height of the CU is larger than 12.

[0101] The DMVR process consists of the following steps. Step 0: Get the initial vector indicated by the merge index. At this time, the value of the motion vector is rounded to an integer and set as the initial integer vector. Step 1: Find the average pixel value of the block at the search point. Step 2: Calculate the MRSAD cost of the point pointed to by the merge candidate motion vector (initial vector) and the four points near it, and find the point with the minimum cost. Step 3: Calculate the MRSAD cost of the point with the minimum cost in step 2 and its 8 nearby points, find the point with the minimum cost, correct the initial vector (not integerized) to the integer pixel of the minimum point, and set it as the refined motion vector. Step 4: If the motion vector has not changed from the initial integer vector in steps 2 and 3, an error surface equation is used to obtain a refinement motion vector with fractional precision. Step 5: Based on the refined motion vector, an 8-tap interpolation filter is used to obtain the final predicted image.

[0102] In steps 2 and 3, the MRSAD cost is calculated by the following formula. MRSAD=∑Zabs(Temp_L0[xi][yi]-Temp_L1[xi][yi]-AVE(Temp_L0)+AVE(Temp_L1))

[0103] Here, AVE is the average value of the pixel values ​​in the block. AVE(Temp_L0)=∑∑Temp_L0[xi][yi] / (BH*BW)

[0104] AVE(Temp_L1)=∑∑Temp_L1[xi][yi] / (BH*BW) BH is the number of pixels in the vertical direction of the block, and BW is the number of pixels in the horizontal direction of the block.

[0105] In step 4, the error surface equation is as follows. E(x,y)=A(x-x0)^2+B(y-y0)^2+C

[0106] Here, the costs of the four nearby positions (-1, 0), (0, -1), (1, 0), and (0, 1) centered at the point (0, 0) pointed to by the initial vector are set to E(-1, 0), E(0, -1), E(1, 0), and E(0, 1) to derive (x0, y0). x0=(E(-1,0)-E(1,0)) / (2(E(-1,0)+E(1,0)-2E(0,0))) y0=(E(0,-1)-E(0,1)) / (2(E(0,-1)+E(0,1)-2E(0,0)))

[0107] It should be noted that the refined motion vectors mvL0', mvL1' and the motion vectors mvL0, mvL1 before refinement satisfy the following equation. mvL0'-mvL0=mvL1-mvL1'

[0108] The refined motion vector mvLX is supplied to the inter-prediction image generation unit 309 .

[0109] The refined motion vector mvLX can be used for deblocking and temporal motion vector prediction.

[0110] In addition, the refined motion vector mvLX from the upper and upper left CTUs is used in spatial motion vector prediction. However, when the motion vector of the merge candidate is not the upper and upper left CTUs, the unrefined motion vector is used.

[0111] Here, a method using MRSAD as an error evaluation value is shown, but a SAD value SAD=∑∑abs(Temp_L0[xi][yi]-Temp_L1[xi][yi]) which is a sum of absolute difference may be used. In this case, the process of finding the average value of the block in step 1 is not necessary. (Triangle prediction)

[0112] Next, triangle prediction is explained. In triangle prediction, the object CU is divided into two triangular prediction units with the diagonal line or the opposite diagonal line as the boundary. The predicted image in each triangular prediction unit is derived by weighting each pixel of the predicted image of the object CU (including the rectangular block of the triangle prediction unit) corresponding to the position of the pixel and applying mask processing. For example, a triangular image can be derived from a rectangular image by multiplying a mask that sets the pixels of the triangular area within the rectangular area to 1 and the areas outside the triangle to 0. Adaptive weighting processing of the predicted image is applied to the areas on both sides of the diagonal line, and a predicted image of the object CU (rectangular block) is derived by using adaptive weighting processing of the two predicted images. This process is called triangle synthesis processing. In the triangle synthesis process, transformation (inverse transformation) and quantization (inverse quantization) processing are applied to the entire object CU. It should be noted that triangle prediction is only applied in merge prediction mode or skip mode.

[0113] The triangle prediction unit 30377 derives prediction parameters corresponding to the two triangle regions used for triangle prediction and supplies them to the inter-frame prediction image generation unit 309. In triangle prediction, in order to simplify the processing, it is also possible to not use a bidirectional prediction. In this case, inter-frame prediction parameters for unidirectional prediction are derived in one triangle region. It should be noted that the derivation of two prediction images and the synthesis using the prediction images are performed in the motion compensation unit 3091 and the triangle synthesis unit 30952. (MMVD Prediction Department 30376)

[0114] The MMVD prediction unit 30376 performs processing in the MMVD (Merge with Motion Vector Differece) mode. The MMVD mode is a mode in which a motion vector is obtained by adding a differential vector of a specified distance and a specified direction to a motion vector derived from a merge candidate (a motion vector derived from a motion vector of an adjacent block, etc.). In the MMVD mode, the MMVD prediction unit 30376 efficiently derives a motion vector by using a merge candidate and limiting the value range of the differential vector to a specified distance (e.g., 8 types) and a specified direction (e.g., 4 directions, 8 directions, etc.).

[0115] The MMVD prediction unit 30376 derives the motion vector mvLX[] using the syntax base_candidate_idx, direction_idx, and distance_idx decoded from the merge candidate mergeCandList[] and the encoded data or encoded the encoded data. In addition, the MMVD prediction unit 30376 may encode or decode the syntax distance_list_idx for selecting the distance table for use.

[0116] The MMVD prediction unit 30376 decodes the MMVD flag when the merge_flag indicates that the merge mode is applied or the skip_flag indicates that the skip mode is applied for the target CU. Also, when the MMVD flag indicates that the MMVD mode is applied (mmvd_flag=1), the MMVD prediction unit 30376 applies the MMVD mode.

[0117] The MMVD prediction unit 30376 derives a motion vector from the prediction vector of any one of the two candidates from the starting point of the merge candidate list and a difference vector (MVD: motion vector difference) expressed in direction and distance. Furthermore, the MMVD prediction unit 30376 derives a motion vector from the prediction vector and the difference vector.

[0118] Fig.15represents a candidate of the differential vector mvdLX derived in the MMVD prediction unit 30376. Fig.15 In the example shown, the central black dot is the position pointed to by the prediction vector mvLXN (center vector).

[0119] Fig.14 (a) represents the relationship between the index base_candidate_idx of mergeCandList[] and mvLXN, and sets the motion vector of mergeCandList[base_candidate_idx] for mvLXN. The position pointed to by the center vector ( Fig.15 The difference between the black dot (shown in the figure) and the actual motion vector is the differential vector mvdLX.

[0120] Fig.14 (b) is a diagram showing an example of a block adjacent to the object block. For example, in the case of mergeCandList[] = {A1, B1, B0, A0, B2}, when the decoded base_candidate_idx indicates 0, the MMVD prediction unit 30376 selects Fig.14 The motion vector of block A1 shown in (b) is used as the prediction vector mvLXN. In addition, when the decoded base_candidate_idx indicates 1, the MMVD prediction unit 30376 selects Fig.14 The motion vector of the block B1 shown in (b) is used as the prediction vector mvLXN. It should be noted that, when base_candidate_idx is not notified by the coded data, it can be estimated that base_candidate_idx=0.

[0121] Furthermore, the MMVD prediction unit 30376 derives mvdLX using the index distance_idx indicating the length of the differential vector mvdLX and the index direction_idx indicating the direction of mvdLX.

[0122] Fig.14 (c) is a diagram showing an example of distance_idx. Fig.14 As shown in (c), in distance_idx, the values ​​of 0, 1, 2, 3, 4, 5, 6 and 7 correspond to eight distances (lengths) of 1 / 4pel, 1 / 2pel, 1pel, 2pel, 4pel, 8pel, 16pel and 32pel, respectively.

[0123] Fig.14 (d) is a diagram showing an example of direction_idx. Fig.14As shown in (d), in direction_idx, the values ​​of 0, 1, 2, and 3 correspond to the positive direction of the x-axis, the negative direction of the x-axis, the positive direction of the y-axis, and the negative direction of the y-axis, respectively. The MMVD prediction unit 30376 refers to the direction table DirectionTable to derive the basic motion vector (mvdUnit[0], mvdUnit[1]) from direction_idx. (mvdUnit[0], mvdUnit[1]) can also be expressed as (sign[0], sign[1]). In addition, the MMVD prediction unit 30376 derives the size DistFromBaseMV as the basic differential vector from the distance DistanceTable[distance_idx] shown in distance_idx in the distance table DistanceTable through the following formula. DistFromBaseMV=DistanceTable[distance_idx] (Other than 4 directions)

[0124] The above description is for the case where the basic motion vector (mvdUnit[0], mvdUnit[1]) is in four directions, namely, up, down, left, and right. However, the direction is not limited to four directions and can be eight directions. The following is an example of the x component dir_table_x[] and y component dir_table_y[] of the direction table DirectionTable when the basic motion vector is set to eight directions. dir_table_x[]={8,-8,0,0,6,-6,-6,6} dir_table_y[]={0, 0, 8, -8, 6, -6, 6, -6}

[0125] It should be noted that the size and order of the direction table may be other than those described above.

[0126] The MMVD prediction unit 30376 refers to the DirectionTable and derives the basic motion vector (mvdUnit[0], mvdUnit[1]) from direction_idx. mvdUnit[0]=dir_table_x[direction_idx] mvdUnit[1]=dir_table_y[direction_idx]

[0127] In addition, for example, the direction table shown below can be used to set the direction to 4, 6, 12, or 16 directions. ·6 directions dir_table_x[]={8,-8,2,-2,-2,2} dir_table_y[]={0, 0, 4, -4, 4, -4} or dir_table_x[]={8,-8,3,-3,-3,3} dir_table_y[]={0, 0, 6, -6, 6, -6} ·12 directions dir_table_x[]=={8,-8,0,0,4,2,-4,-2,-2,-4,2,4} dir_table_y[]=={0,0,8,-8,2,4,-2,-4,4,2,-4,-2} or dir_table_x[]=={8,-8,0,0,6,3,-6,-3,-3,-6,3,6} dir_table_y[]=={0, 0, 8, -8, 3, 6, -3, -6, 6, 3, -6, -3} 16 directions dir_table_x[]=={8,-8,0,0,4,-4,-4,4,6,2,-6,-2,-2,-6,2,6} dir_table_y[]={0, 0, 8, -8, 4, -4, 4, -4, 2, 6, -2, -6, 6, 2, -6, -2}

[0128] Of course, the situations in the four directions are also as described below. dir_table_x[]={1,-1,0,0} dir_table_y[]={0, 0, 1, -1}

[0129] It should be noted that the size and order of the direction table may be other than those described above. (Multiple distance tables)

[0130] In addition, the distance table is not limited to one, and may be multiple. For example, the MMVD prediction unit 30376 may derive DistFromBaseMV from the first distance table DistanceTable1[] and the second distance table DistanceTable2[] as described below.

[0131] The MMVD prediction unit 30376 further derives the length of the difference vector mvdLX using the DistanceTable[] indicated by distance_list_idx decoded or derived from the encoded data. DistanceTable1[]={1, 2, 3, 5} DistanceTable2[]={4, 8, 16, 32} DistanceTable=DistanceTable1(distance_list_idx==0) DistanceTable=DistanceTable2(distance_list_idx==1) DistFromBaseMV=DistanceTable[distance_idx]

[0132] In addition, the MMVD prediction unit 30376 can use the two-dimensional table DistanceTable2d to switch between the two distance tables. DistanceTable2d[]={{1, 2, 3, 5}, {4, 8, 16, 32}} DistFromBaseMV=DistanceTable2d[distance_list_idx][distance_idx] (Derivation of differential vector)

[0133] The MMVD prediction unit 30376 derives refineMvLX from the size of the basic motion vector and the differential vector DistFromBaseMV. When the merge candidate N related to the center vector is a unidirectional prediction based on the L0 reference picture (predFlagL0N=1, predFlagL1N=0), the MMVD prediction unit 30376 derives the L0 differential vector refineMvL0 from the size of the basic motion vector and the differential vector DistFromBaseMV. refineMvL0[0]=(DistFromBaseMV< <shiftMMVD)*mvdUnit[0] refineMvL0[1]=(DistFromBaseMV< <shiftMMVD)*mvdUnit[1] refineMvL1[0]=0 refineMvL1[1]=0

[0134] Here, shiftMMVD is a value that adjusts the size of the differential vector to match the accuracy MVPREC of the motion vector in the motion compensation unit 3091 (interpolation unit). For example, when MVPREC is 16, that is, when the motion vector accuracy is 1 / 16 pixels and there are 4 directions, that is, when mvdUnit[0] and mvdUnit[1] are 0 or 1, it is appropriate to use 2. In addition, the shift direction of shiftMMVD is not limited to left shift. For example, in 6, 8, 12, 16 directions, etc., when mvdUnit[0] and mvdUnit[1] use values ​​other than 0 or 1 (for example, 8), the MMVD prediction unit 30376 can set the shift direction to right shift. For example, the MMVD prediction unit 30376 can right shift after multiplying the basic motion vector (mvdUnit[0], mvdUnit[1]) as shown below. refineMvL0[0]=(DistFromBaseMV*mvdUnit[0])>>shiftMMVD refineMvL0[1]=(DistFromBaseMV*mvdUnit[1])>>shiftMMVD

[0135] In addition, the MMVD prediction unit 30376 can be divided into the size and code of the motion vector for calculation. Afterwards, the same is true in other derivation methods of the differential vector. refineMvL0[0]=((DistFromBaseMV*abs(mvdUnit[0]))>>shiftMMVD)*sign(mvdUnit[0]) refineMvL0[1]=((DistFromBaseMV*abs(mvdUnit[1]))>>shiftMMVD)*sign(mvdUnit[1])

[0136] In addition to the above, when the merge candidate N related to the center vector is a unidirectional prediction based on the L1 reference picture (predFlagL0N=0, predFlagLlN=1), the MMVD prediction unit 30376 derives the L1 differential vector refineMvL1 from the size of the basic motion vector and the differential vector DistFromBaseMV. refineMvL0[0]=0 refineMvL0[1]=0 refineMvL1[0]=(DistFromBaseMV< <shiftMMVD)*mvdUnit[0] refineMvL1[1]=(DistFromBaseMV< <shiftMMVD)*mvdUnit[1] or refineMvL1[0]=(DistFromBaseMV*mvdUnit[0])>>shiftMMVD refineMvL1[1]=(DistFromBaseMV*mvdUnit[1])>>shiftMMVD

[0137] In addition to the above, when the merge candidate N related to the center vector is bidirectionally predicted (predFlagL0N=1, predFlagL1N=1), the MMVD prediction unit 30376 derives the first differential vector firstMv from the size of the basic motion vector and the differential vector DistFromBaseMV. firstMv[0]=(DistFromBaseMV< <shiftMMVD)*mvdUnit[0] firstMv[1]=(DistFromBaseMV< <shiftMMVD)*mvdUnit[1] or firstMv=(DistFromBaseMV*mvdUnit[0])>>shiftMMVD firstMv=(DistFromBaseMV*mvdUnit[1])>>shiftMMVD

[0138] Here, the first difference vector refineMv corresponds to the difference vector of the larger POC distance (POC difference) between the target picture and the reference picture. That is, when the reference picture of the reference picture list L0 and the reference picture list L1 having the larger POC distance (POC difference) between the target picture and the reference picture is set as the reference picture of the reference picture list LX, it is the difference vector between the reference picture of the reference picture list LX having the larger POC distance (POC difference) and the target block on the target picture.

[0139] Next, the MMVD prediction unit 30376 can derive the second motion vector (motion vector secondMv of the reference picture with a smaller POC distance) of the other reference picture (reference list LY (Y=1-X)) by scaling the first motion vector firstMv.

[0140] For example, when the distance between the target picture currPic and the L0 picture RefPicList0[refIdxLN0] is greater than the distance between the target picture and the L1 picture RefPicList1[refIdxLN1], the first vector firstMv corresponds to the L0 differential vector refineMvL0. Furthermore, the MMVD prediction unit 30376 may scale the first vector firstMv to derive the L1 differential vector refineMvL1. refineMvL0[0]=firstMv[0] refineMvL0[1] = firstMv[1] refineMvL1[0]=Clip3(-32768, 32767, Sign(distScaleFactor*firstMv[0])*((Abs(distScaleFactor*refineMvL0[0])+127)>>8)) refineMvL1[1]=Clip3(-32768, 32767, Sign(distScaleFactor*firstMv[1])*((Abs(distScaleFactor*refineMvL0[1])+127)>>8))

[0141] Here, the MMVD prediction unit 30376 derives distScaleFactor as shown below from the POC difference DiffPicOrderCnt(currPic, RefPicList0[refIdxLN0]) between currPic and the L0 reference picture and the POC difference DiffPicOrderCnt(currPic, RefPicList1[refIdxLN1]) between currPic and the L1 reference picture. distScaleFactor=Clip3(-4096, 4095, (tb*tx+32)>>6) tx=(16384+(Abs(td)>>1)) / td td=Clip3(-128, 127, DiffPicOrderCnt(currPic, RefPicList0[refIdxLN0])) tb=Clip3(-128, 127, DiffPicOrderCnt(currPic, RefPicList1[refIdxLN1]))

[0142] In addition to the above, when the distance between the target picture currPic and the L0 picture RefPicList0[refIdxLN0] is less than the distance between the target picture and the L1 picture RefPicList1[refIdxLN1], the first vector firstMv corresponds to the L1 difference vector refineMvL1. In this case, the MMVD prediction unit 30376 can scale the first vector firstMv to derive the L0 difference vector refineMvL0. refineMvL0[0]=Clip3(-32768, 32767, Sign(distScaleFactor*firstMv[0])*((Abs(distScaleFactor*firstMv[0])+127)>>8)) refineMvL0[1]=Clip3(-32768, 32767, Sign(distScaleFactor*firstMv[1])*((Abs(distScaleFactor*firstMv[1])+127)>>8)) refineMvL1[0]=firstMv[0] refineMvL1[1]=firstMv[1]

[0143] Here, the MMVD prediction unit 30376 derives distScaleFactor as shown below from the POC difference DiffPicOrderCnt(currPic, RefPicList0[refIdxLN0]) between currPic and the L0 reference picture and the POC difference DiffPicOrderCnt(currPic, RefPicList1[refIdxLN1]) between currPic and the L1 reference picture. distScaleFactor=Clip3(-4096, 4095, (tb*tx+32)>>6) tx=(16384+(Abs(td)>>1)) / td td=Clip3(-128, 127, DiffPicOrderCnt(currPic, RefPicList1[refIdxLN1])) tb=Clip3(-128, 127, DiffPicOrderCnt(currPic, RefPicList0[refIdxLN0]))

[0144] It should be noted that when the distance between the object picture currPic and the L0 picture RefPicList0[refIdxLN0] is equal to the distance between the object picture and the L1 picture RefPicList1[refIdxLN1], the MMVD prediction unit 30376 may not scale firstMv[] but may set it to refineMv[] by the following processing (processing A or processing B). Process A: refineMvL0[0]=firstMv[0] refineMvL0[1] = firstMv[1] refineMvL1[0]=-firstMv[0] refineMvL1[1]=-firstMv[1] Treatment B: refineMvL0[0]=firstMv[0] refineMvL0[1] = firstMv[1] refineMvL1[0]=firstMv[0] refineMvL1[1]=firstMv[1]

[0145] More specifically, the MMVD prediction unit 30376 derives refineMv[ ] through processing A when the L0 reference picture, the target picture currPic, and the L1 target picture are arranged in chronological order, and derives refineMv[ ] through processing B in other cases.

[0146] It should be noted that the arrangement in chronological order refers to: The case where (POC_L0-POC_curr)*(POC_L1-POC_curr)<0, that is, the case where DiffPicOrderCnt(RefPicList0[refIdxLN0], currPic)*DiffPicOrderCnt(currPic, RefPicList1[refIdxLN1])>0.

[0147] Here, POC_L0, POC_L1, and POC_curr represent the picture order counts (Picture Order Count) of the L0 reference picture, the L1 reference picture, and the target picture, respectively.

[0148] The opposite of this (in reverse chronological order) is: The case where (POC_L0-POC_curr)*(POC_L1-POC_curr)>0, that is, the case where DiffPicOrderCnt(RefPicList0[refIdxLN0], currPic)*DiffPicOrderCnt(currPic, RefPicList1[refIdxLN1])<0.

[0149] It should be noted that even when the distances between POCs are different, the MMVD prediction unit 30376 can first derive the refineMvLX[] explained above when the distances between POCs are equal, and then derive the final refineMvLX[] based on the POC distance between the reference image and the object image using refineMvLX[] as a scale. (Addition of center vector and difference vector)

[0150] Finally, the MMVD prediction unit 30376 derives the motion vector of the MMVD merge candidate from the differential vector refineMv[] (mvdLX[]) and the center vector mvLXN[] (mvpLX[]) as described below. mvL0[0]=mvL0N[0]+refineMvL0[0] mvL0[1]=mvL0N[1]+refineMvL0[1] mvL1[0]=mvL1N[0]+refineMvL1[0] mvL1[1]=mvL1N[1]+refineMvL1[1] (Summarize)

[0151] In this way, even if the prediction vector is bidirectionally predicted, the MMVD prediction unit 30376 only notifies a set of information (direction_idx, distance_idx) of the motion vector in one direction. Then, two motion vectors are derived from the information of one set. The MMVD prediction unit 30376 scales the motion vector according to the difference between the POC of each of the two reference pictures and the POC of the target picture as needed. The difference vector between the reference image of the reference picture LX with the larger POC distance (POC difference) and the target block on the target picture corresponds to the notified motion vector (firstMv). firstMv[0]=(DistFromBaseMV< <shiftMMVD)*mvdUnit[0] firstMv[1]=(DistFromBaseMV< <shiftMMVD)*mvdUnit[1]

[0152] The MMVD prediction unit 30376 derives the motion vector mvdLY(secondMv) of the reference picture LY (Y=1-X) having the smaller POC distance by scaling it according to the ratio of the POC distances between the pictures (POCS / POCL). secondMv[0]=(DistFromBaseMV< <shiftMMVD)*mvdUnit[0]*POCS / POCL secondMv[1]=(DistFromBaseMV< <shiftMMVD)*mvdUnit[1]*POCS / POCL

[0153] It should be noted that the reference picture with a smaller POC distance corresponds to the one with a smaller POC distance (POC difference) between the target picture and the reference picture. Here, POCS is the difference value of the POC difference of the reference picture close to the target picture, and POCL is the difference value of the POC difference of the reference picture far from the target picture. Alternatively, the motion vector mvdLY can be derived by the following formula. mvdLY=MvScale(DistFromBaseMV, CurPic, PicLX, CurPic, PicLY)

[0154] Here, CurPic, PicLX, and PicLY represent a target picture, a reference picture far from the target picture, and a reference picture near the target picture.

[0155] As described above, the MMVD prediction unit 30376 derives mvpLX[] (mvLXN[]) and mvdLX[] (refineMv[]), and uses these to derive the motion vector mvLX[] of the target block. mvLX[0]=mvpLX[0]+mvdLX[0] mvLX[1]=mvpLX[1]+mvdLX[1] (Rounding of motion vector)

[0156] The MMVD prediction unit 30376 may perform correction when the size of the difference vector mvdLX added to the center vector is greater than a predetermined threshold value so that the motion vector mvLX of the object block represents an integer pixel position. For example, the MMVD prediction unit 30376 may perform integerization when DistFromBaseMV is greater than a predetermined threshold value of 16.

[0157] In addition, the MMVD prediction unit 30376 may perform integerization when the index distance_list_idx of the selected distance table is a specific distance table (e.g., DistanceTable2) and the index distance_idx of the element of the selected distance table (the coefficient of the selected distance) is within a specific range (e.g., distance_idx is 2, 3). For example, the MMVD prediction unit 30376 may modify mvLX according to the following formula when distance_list_idx==1 and distance_idx>=2. mvLX[0]=(mvLX[0] / MVPREC)*MVPREC mvLX[1]=(mvLX[1] / MVPREC)*MVPREC

[0158] In addition, the MMVD prediction unit 30376 can derive mvLX using the shift. mvLX[0]=(mvLX[0]>>MVBIT)< <MVBIT mvLX[1]=(mvLX[1]>>MVBIT)< <MVBIT

[0159] Here, MVBIT=log2(MVPREC). For example, 4. In addition, the positive and negative values ​​can be considered and derived as follows. mvLX[0]=mvLX[0]>=0? (mvLX[0]>>MVBIT)<<MVBIT:-((-mvLX[0]> >MVBIT) <MVBIT) mvLX[1]=mvLX[1]>=0? (mvLX[1]>>MVBIT)<<MVBIT:-((-mvLX[1]> >MVBIT) <MVBIT)

[0160] In this way, the amount of calculation required for generating a predicted image can be reduced by rounding the motion vector. (grammar)

[0161] Next, refer to Fig.16 and Fig.17 , the process of selecting the prediction mode in the MMVD prediction unit 30376 is explained. Fig.16 This is a flowchart showing the flow of the prediction mode selection process in the MMVD prediction unit 30376. Fig.17 is a diagram showing the syntax of the prediction mode selection process according to the present embodiment, and is Fig.16 A syntax table corresponding to a portion of the processing shown.

[0162] like Fig.16As shown, in this embodiment, the parameter decoding unit 302 first decodes the skip flag ( Fig.17 In the case where the skip flag indicates the skip mode (YES in S1302), the parameter decoding unit 302 decodes the MMVD flag ( Fig.17 In the case where the MMVD flag does not indicate the MMVD mode (NO in S1304), the prediction mode is the skip mode (S1305). In the skip mode, Fig.17 As shown, the parameter decoding unit 302 performs the merge index ( Fig.17 The merge_idx in is decoded.

[0163] When the MMVD flag indicates the MMVD mode (Yes in S1304), the prediction mode is the MMVD mode (S1306). Fig.17 As shown, the parameter decoding unit 302 decodes base_candidate_idx, distance_idx, and direction_idx.

[0164] When the skip flag does not indicate the skip mode (No in S1302), the parameter decoding unit 302 sets the merge flag ( Fig.17 In the case where the merge flag indicates the merge mode (yes in S1308), the parameter decoding unit 302 decodes the MMVD flag ( Fig.17 In the case where the MMVD flag does not indicate the MMVD mode (No in S1310), the prediction mode is the merge mode (S1311). In the merge mode, Fig.17 As shown, the parameter decoding unit 302 performs the merge index ( Fig.17 The merge_idx in is decoded.

[0165] When the MMVD flag indicates the MMVD mode (Yes in S1310), the prediction mode is the MMVD mode (S1312). Fig.17 As shown, the parameter decoding unit 302 decodes base_candidate_idx, distance_idx, and direction_idx.

[0166] When the merge flag does not indicate the merge mode (No in 1308 ), the prediction mode is the AMVP mode ( S1313 ).

[0167] In the skip mode or merge mode, the parameter decoding unit 302 decodes merge_idx.

[0168] In MMVD mode, the parameter decoding unit 302 decodes base_candidate_idx, distance_idx and direction_idx. The MMVD prediction unit 30376 uses these parameters to derive mvpLX and mvdLX, and then derives mvLX.

[0169] Next, refer to Fig.18 and Fig.19 , the process of selecting the prediction mode in the MMVD prediction unit 30376 of another embodiment of the present invention is explained. Fig.18 This is a flowchart showing the flow of the prediction mode selection process in the MMVD prediction unit 30376. Fig.19 is a diagram showing the syntax of the prediction mode selection process according to the present embodiment, and is Fig.18 A syntax table corresponding to a portion of the processing shown.

[0170] exist Fig.16 Flowchart and Fig.17 In the syntax of , there is a process for decoding the MMVD flag in the skip mode and merge mode. When you want to encode and decode at a high compression rate, you can select relatively more skip modes and merge modes, but in this case, the existence of the MMVD flag becomes an overhead. Fig.18 Flowchart and Fig.19 In the syntax of , the MMVD prediction unit 30376 selects the MMVD mode without selecting either the skip mode or the merge mode.

[0171] like Fig.18 As shown, in this embodiment, the parameter decoding unit 302 first decodes the skip flag ( Fig.19 In the case where the skip flag indicates skip mode (yes in S1402), the prediction mode is skip mode (S1403). In skip mode, Fig.19 As shown, the parameter decoding unit 302 performs the merge index ( Fig.19 The merge_idx in is decoded.

[0172] When the skip flag does not indicate the skip mode (No in S1402), the parameter decoding unit 302 sets the merge flag ( Fig.19 In the case where the merge flag indicates the merge mode (yes in 1405), the prediction mode is the merge mode (S1406). In the merge mode, Fig.19 As shown, the parameter decoding unit 302 performs the merge index ( Fig.19 The merge_idx in is decoded.

[0173] When the merge flag does not indicate the merge mode (No in S1405), the parameter decoding unit 302 sets the MMVD flag ( Fig.19 In the case where the MMVD flag does not indicate the MMVD mode (No in S1408), the prediction mode is the AMVP mode (S1409). In the case where the MMVD flag indicates the MMVD mode (Yes in S1408), the prediction mode is the MMVD mode (S1410). In the MMVD mode, Fig.19 As shown, the parameter decoding unit 302 decodes base_candidate_idx, distance_idx, and direction_idx. The parameter encoding unit 111 encodes the syntax through the same operation.

[0174] It should be noted that in the case of the merge mode, the difference from the skip mode is whether the prediction residual is used in the prediction image generation. Therefore, the parameter decoding unit 302 does not need to use the prediction residual in the prediction image generation. Fig.18 and Fig.19 After the processing, the flag indicating whether the inverse transform processing is performed is decoded into syntax. On the other hand, in the case of MMVD mode, a prediction image generation different from the skip mode can be performed, so the parameter decoding unit 302 needs to decode the flag indicating whether the inverse transform processing is performed into syntax.

[0175] By adopting the above configuration, when encoding is performed at a high compression rate, when many skip flags indicate a skip mode in which there is no prediction residual, it is not necessary to decode the MMVD flag, and thus the encoding efficiency is not reduced.

[0176] Next, refer to Fig. 20 and Fig.21 , the process of selecting the prediction mode in the MMVD prediction unit 30376 of the embodiment of the present invention is explained. Fig. 20 This is a flowchart showing the flow of the prediction mode selection process in the MMVD prediction unit 30376. Fig.21 is a diagram showing the syntax of the prediction mode selection process according to the present embodiment, and is Fig. 20 A syntax table corresponding to a portion of the processing shown.

[0177] exist Fig. 20 Flowchart and Fig.21 In the syntax of , MMVD prediction is not performed in skip mode, and MMVD prediction can only be selected in merge mode.

[0178] like Fig. 20 As shown, in this embodiment, the parameter decoding unit 302 (prediction parameter decoding unit) first sets the skip flag ( Fig.21 In the case where the skip flag indicates skip mode (yes in S1502), the prediction mode is skip mode (S1503). In skip mode, Fig. 20 As shown, the parameter decoding unit 302 performs the merge index ( Fig.21 The merge_idx in is decoded.

[0179] When the skip flag does not indicate the skip mode (No in S1502), the parameter decoding unit 302 sets the merge flag ( Fig.21 In the case where the merge flag indicates the merge mode (Yes in S1505), the parameter decoding unit 302 decodes the MMVD flag ( Fig.21 In the case where the MMVD flag does not indicate the MMVD mode (No in S1507), the prediction mode is the merge mode (S1508). In the merge mode, Fig.21 As shown, the parameter decoding unit 302 performs the merge index ( Fig.21 In the case where the MMVD flag indicates MMVD mode (yes in S1507), the prediction mode is MMVD mode (S1509). In MMVD mode, Fig.21 As shown, the parameter decoding unit 302 decodes base_candidate_idx, distance_idx, and direction_idx.

[0180] When the merge flag does not indicate the merge mode (No in 1505 ), the prediction mode is the AMVP mode ( S1510 ). The parameter encoding unit 111 encodes the syntax in the same manner.

[0181] It should be noted that, in the case of neither the merge mode nor the MMVD mode, the difference from the skip mode is whether the prediction residual is used in the prediction image generation. Therefore, the parameter decoding unit 302 does not need to use the prediction residual in the prediction image generation. Fig. 20 and 21 After the processing, the flag indicating whether the inverse transform processing is performed is decoded into syntax. On the other hand, in the case of MMVD mode instead of merge mode, a predicted image generation different from the skip mode can be performed, so the parameter decoding unit 302 needs to decode the flag indicating whether the inverse transform processing is performed into syntax.

[0182] By adopting the above configuration, when encoding is performed at a high compression rate, when many skip flags indicate a skip mode in which there is no prediction residual, it is not necessary to decode the MMVD flag, and thus the encoding efficiency is not reduced.

[0183] The loop filter 305 is a filter provided in the encoding loop, and is a filter for improving image quality by removing block distortion and ringing distortion. The loop filter 305 performs filtering such as deblocking filtering, sample adaptive offset (SAO), and adaptive loop filtering (ALF) on the decoded image of the CU generated by the adding unit 312.

[0184] The reference picture memory 306 stores the CU decoded image generated by the adding unit 312 at a predetermined position for each target picture and target CU.

[0185] The prediction parameter memory 307 stores the prediction parameters at a predetermined position for each CTU or CU to be decoded. Specifically, the prediction parameter memory 307 stores the parameters decoded by the parameter decoding unit 302 and the prediction mode predMode decoded by the entropy decoding unit 301 .

[0186] The prediction image generation unit 308 receives the prediction mode predMode, prediction parameters, and the like as input. In addition, the prediction image generation unit 308 reads a reference picture from the reference picture memory 306. The prediction image generation unit 308 generates a prediction image of a block or a sub-block using the prediction parameters and the read reference picture (reference picture block) in the prediction mode indicated by the prediction mode predMode. Here, the reference picture block refers to a set of pixels on the reference picture (usually rectangular, so it is called a block), which is a region referenced to generate a prediction image. (Inter-frame prediction image generation unit 309)

[0187] When the prediction mode predMode indicates the inter prediction mode, the inter prediction image generator 309 generates a prediction image of a block or a subblock by inter prediction using the inter prediction parameters input from the inter prediction parameter decoder 303 and the read reference picture.

[0188] Fig.11 1 is a schematic diagram showing the configuration of the inter-prediction image generation unit 309 included in the prediction image generation unit 308 according to the present embodiment. The inter-prediction image generation unit 309 is configured to include a motion compensation unit (prediction image generation device) 3091 and a synthesis unit 3095 . (Motion Compensation)

[0189] The motion compensation unit 3091 (interpolation image generation unit 3091) generates an interpolation image (motion compensation image) by reading a block located in the reference picture RefPicLX specified by the reference picture index refIdxLX from the position of the target block, which is shifted by the motion vector mvLX from the position of the target block, from the reference picture memory 306 based on the inter prediction parameters (prediction list utilization flag predFlagLX, reference picture index refIdxLX, motion vector mvLX) input from the inter prediction parameter decoding unit 303. Here, when the accuracy of the motion vector mvLX is not integer accuracy, filtering for generating pixels at decimal positions, called motion compensation filtering, is performed to generate an interpolation image.

[0190] The motion compensation unit 3091 first derives the integer position (xInt, yInt) and phase (xFrac, yFrac) corresponding to the coordinates (x, y) in the prediction block through the following formula. xInt=xPb+(mvLX[0]>>(log2(MVPREC)))+x xFrac = mvLX[0] & (MVPREC - 1) yInt=yPb+(mvLX[1]>>(log2(MVPREC)))+y yFrac=mvLX[1]&(MVPREC-1)

[0191] Here, (xPb, yPb) is the upper left coordinate of the block of size bW*bH, x=0...bW-1, y=0...bH-1, and MVPREC represents the accuracy of the motion vector mvLX (1 / MVPREC pixel accuracy). For example, MVPREC=16.

[0192] The motion compensation unit 3091 performs horizontal interpolation processing on the reference image refImg using an interpolation filter, thereby deriving a temporary image temp[][]. The following ∑ is a sum related to k of k=0..NTAP-1, shift1 is a normalization parameter of the interval of the adjustment value, and offset1=1<<(shift1-1). temp[x][y]=(∑mcFilter[xFrac][k]*refImg[xInt+k-NTAP / 2+1][yInt]+offset1)>>shift1

[0193] Next, the motion compensation unit 3091 performs vertical interpolation processing on the temporary image temp[][] to derive an interpolated image Pred[][]. The following ∑ is a sum related to k of k=0..NTAP-1, shift2 is a normalization parameter of the interval of the adjustment value, and offset2=1<<(shift2-1). Pred[x][y]=(∑mcFilter[yFrac][k]*temp[x][y+k-NTAP / 2+1]+offset2)>>shift2 (Synthesis Department)

[0194] The synthesis unit 3095 generates a predicted image with reference to the interpolated image supplied by the motion compensation unit 3091 , the inter prediction parameters supplied by the inter prediction parameter decoding unit 303 , and the intra image supplied by the intra prediction image generating unit 310 , and supplies the generated predicted image to the adding unit 312 .

[0195] The synthesis unit 3095 includes a combined intra / inter synthesis unit 30951 , a triangle synthesis unit 30952 , an OBMC unit 30953 , and a BIO unit 30954 . (Combined intra / inter compositing processing)

[0196] The combined intra / inter synthesis unit 30951 generates a predicted image by compositely using unidirectional prediction, skip mode, merge mode, and intra prediction in AMVP. (Triangle synthesis processing)

[0197] The triangle synthesis unit 30952 generates a predicted image using the above-mentioned triangle prediction. (OBMC processing)

[0198] The OBMC unit 30953 generates a predicted image using OBMC (Overlapped block motion compensation) processing. The OBMC processing includes the following processing. An interpolated image (motion compensated image) of the target subblock is generated using an interpolated image (PU interpolated image) generated using interpolated images (PU interpolated images) added to the target subblock and an interpolated image (OBMC interpolated image) generated using motion parameters of adjacent subblocks of the target subblock. Generate a predicted image by taking a weighted average of the OBMC interpolated image and the PU interpolated image. (BIO treatment)

[0199] The BIO unit 30954 generates a predicted image by performing BIO (Bi-directional optical flow) processing. In the BIO processing, the predicted image is generated by referring to the motion compensation images PredL0 and PredL1 and the gradient correction term. The BIO unit 30954 may generate a predicted image by performing weighted prediction described later. (Weighted Forecast)

[0200] In weighted prediction, a predicted image of a block is generated by multiplying a motion compensation image PredLX by a weighting coefficient. When one of the prediction list utilization flags (predFlagL0 or predFlagL1) is 1 (unidirectional prediction) and weighted prediction is not used, the following calculation is performed to match the motion compensation image PredLX (LX is L0 or L1) with the pixel bit number bitDepth. Pred[x][y]=Clip3(0,(1<<bitDepth)-1,(PredLX[x][y]+offset1)> >shift1)

[0201] Here, shiftl=14-bitDepth, offsetl=1<<(shiftl-1). In addition, when both reference list utilization flags (predFlagL0 and predFlagL1) are 1 (bidirectional prediction BiPred) and weighted prediction is not used, the motion compensation images PredL0 and PredL1 are averaged and the average is matched to the number of pixel bits using the following calculation process. Pred[x][y]=C1ip3(0,(1<<bitDepth)-1,(PredL0[x][y]+PredL1[x][y]+offset2)> >shift2)

[0202] Here, shift2=15-bitDepth, offset2=1<<(shift2-1).

[0203] Furthermore, when unidirectional prediction and weighted prediction are performed, the weighted prediction unit 3094 derives a weighted prediction coefficient w0 and an offset value o0 from the encoded data, and performs the following calculation processing. Pred[x][y]=Clip3(0,(1<<bitDepth)-1,((PredLX[x][y]*w0+2^(log2WD-1))> >log2WD)+o0)

[0204] Here, log2WD is a variable representing a predetermined shift amount.

[0205] Furthermore, when bidirectional prediction BiPred and weighted prediction are performed, the weighted prediction unit 3094 derives weighted prediction coefficients w0, w1, o0, and o1 from the encoded data, and performs the following calculation processing. Pred[x][y]=Clip3(0,(1< <bitDepth)-1,(PredL0[x][y]*w0+PredL1[x][y]*w1+((o0+ol+1)<<log2WD))> >(log2WD+1))

[0206] Then, the generated predicted image of the block is output to the adding section 312 .

[0207] The inverse quantization / inverse transformation unit 311 inversely quantizes the quantized transform coefficients input from the entropy decoding unit 301 to obtain transform coefficients. The quantized transform coefficients are coefficients obtained by performing frequency transformation such as DCT (Discrete Cosine Transform) and DST (Discrete Sine Transform) on the prediction error in the encoding process and quantizing it. The inverse quantization / inverse transformation unit 311 performs inverse frequency transformation such as inverse DCT and inverse DST on the obtained transform coefficients to calculate the prediction error. The inverse quantization / inverse transformation unit 311 outputs the prediction error to the addition unit 312. The inverse quantization / inverse transformation unit 311 sets all prediction errors to 0 when skip_flag is 1 or cu_cbp is 0.

[0208] The adder 312 adds the predicted image of the block input from the predicted image generator 308 and the prediction error input from the inverse quantization / inverse transform unit 311 for each pixel to generate a decoded image of the block. The adder 312 stores the decoded image of the block in the reference picture memory 306 and outputs it to the loop filter 305. (Configuration of Moving Image Coding Device)

[0209] Next, the configuration of the moving picture encoding device 11 according to this embodiment will be described. Fig.12 1 is a block diagram showing the structure of the video encoding device 11 of the present embodiment. The video encoding device 11 includes a prediction image generation unit 101, a subtraction unit 102, a transformation / quantization unit 103, an inverse quantization / inverse transformation unit 105, an addition unit 106, a loop filter 107, a prediction parameter memory (prediction parameter storage unit, frame memory) 108, a reference picture memory (reference picture storage unit, frame memory) 109, a coding parameter determination unit 110, a parameter coding unit 111, and an entropy coding unit 104.

[0210] The predicted image generation unit 101 generates a predicted image for each CU which is a region obtained by dividing each picture of each image T. The predicted image generation unit 101 performs the same operation as the predicted image generation unit 308 described above, and the description thereof is omitted here.

[0211] The subtraction unit 102 generates a prediction error by subtracting 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. The subtraction unit 102 outputs the prediction error to the transformation / quantization unit 103 .

[0212] The transform / quantization unit 103 calculates transform coefficients by frequency transforming the prediction error input from the subtraction unit 102 , and derives quantized transform coefficients by quantization. The transform / quantization unit 103 outputs the quantized transform coefficients to the entropy coding unit 104 and the inverse quantization / inverse transform unit 105 .

[0213] The inverse quantization / inverse transformation unit 105 and the inverse quantization / inverse transformation unit 311 ( Figure 7 The calculated prediction error is input to the adding unit 106.

[0214] The entropy coding unit 104 receives the quantized transform coefficients from the transform / quantization unit 103 and the coding parameters from the parameter coding unit 111. The coding parameters include codes such as the reference picture index refIdxLX, the prediction vector index mvp_LX_idx, the difference vector mvdLX, the motion vector accuracy mode amvr_mode, the prediction mode predMode, and the merge index merge_idx.

[0215] The entropy coding unit 104 performs entropy coding on the partition information, prediction parameters, quantized transform coefficients, etc. to generate a coded stream Te and output it.

[0216] The parameter coding unit 111 includes a header coding unit 1110 , a CT information coding unit 1111 , a CU coding unit 1112 (prediction mode coding unit), and a parameter coding unit 112 . The CU coding unit 1112 further includes a TU coding unit 1114 .

[0217] The following is a description of the schematic operation of each module. The parameter coding unit 111 performs coding processing of parameters such as header information, partition information, prediction information, and quantized transform coefficients.

[0218] The CT information encoding unit 1111 encodes QT, MT (BT, TT) division information and the like from the encoded data.

[0219] The CU encoding unit 1112 encodes CU information, prediction information, TU split flag split_transform_flag, CU residual flags cbf_cb, cbf_cr, cbf_luma, and the like.

[0220] When a prediction error is included in a TU, the TU coding unit 1114 codes the QP update information (quantization correction value) and the quantized prediction error (residual_coding).

[0221] The CT information encoding unit 1111 and the CU encoding unit 1112 supply syntax elements such as inter-frame prediction parameters (prediction mode predMode, merge flag merge_flag, merge index merge_idx, inter-frame prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction vector index mvp_LX_idx, differential vector mvdLX), intra-frame prediction parameters (prev_intra_lumapred_flag, mpmidx, rem_selected_mode_flag, rem_selected_mode, rem_non_selected_mode), and quantized transform coefficients to the entropy encoding unit 104. (Configuration of parameter encoding unit)

[0222] The parameter encoding unit 112 derives the inter prediction parameter based on the prediction parameter input from the encoding parameter determination unit 110. The parameter encoding unit 112 includes the same configuration as that of the inter prediction parameter decoding unit 303 for deriving the inter prediction parameter.

[0223] Fig.13 1 is a schematic diagram showing the structure of the parameter encoding unit 112. The structure of the parameter encoding unit 112 is described below. Fig.13As shown, the parameter coding unit 112 is composed of: a parameter coding control unit 1121, a merge prediction unit 30374, a sub-block 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, and a subtraction unit 1123. The merge prediction unit 30374 is provided with a merge prediction parameter derivation unit 3036. The parameter coding control unit 1121 includes a merge index derivation unit 11211 and a vector candidate index derivation unit 11212. In addition, the parameter coding control unit 1121 derives merge_idx, affine_flag, base_candidate_idx, distance_idx, direction_idx, etc. through the merge index derivation unit 11211, and derives mvpLX, etc. through the vector candidate index derivation unit 11212. The merge prediction parameter derivation unit 3036, the AMVP prediction parameter derivation unit 3032, the affine prediction unit 30372, the MMVD prediction unit 30376, and the triangle prediction unit 30377 may be collectively referred to as a motion vector derivation unit (motion vector derivation device). The parameter encoding unit 112 outputs the motion vector mvLX, the reference picture index refIdxLX, the inter-frame prediction identifier inter_pred_idc, or information indicating these to the predicted image generation unit 101. In addition, the parameter encoding unit 112 outputs merge_flag, skip_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_lX_idx, mvdLX, amvr_mode, and affine_flag to the entropy encoding unit 104.

[0224] The parameter encoding control unit 1121 derives parameters (base_candidate_idx, distance_idx, direction_idx, etc.) representing the difference vector and outputs them to the MMVD prediction unit 30376. Fig.15 The differential vector derivation in the parameter encoding control unit 1121 is described. Fig.15 The black dot in the center is the position pointed to by the prediction vector mvpLX. With this position as the center, 8 search distances are searched in 4 directions (up, down, left, and right). mvpLX is the starting point of the merged candidate list and the motion vector of the second candidate, and searches are performed on them respectively. There are two prediction vectors of the merged candidate list (the first and second in the list), the search distance is 8, and the search direction is 4. Therefore, there are 64 candidates in mvdLX. The mvdLX with the lowest cost among the searches is represented by base_candidate_idx, distance_idx, and direction_idx.

[0225] As described above, the MMVD mode is a mode for deriving an appropriate motion vector by searching for candidate points limited to those centered on a prediction vector.

[0226] The merge index derivation unit 11211 derives the merge index merge_idx and outputs it to the merge prediction parameter derivation unit 3036 (merge prediction unit). In MMVD mode, the merge index derivation unit 11211 sets the value of the merge index merge_idx to the same value as the value of base_candidate_idx. The vector candidate index derivation unit 11212 derives the prediction vector index mvp_1X_idx.

[0227] The merge prediction parameter derivation unit 3036 derives the inter prediction parameter based on the merge index merge_idx.

[0228] The AMVP prediction parameter derivation unit 3032 derives the prediction vector mvpLX based on the motion vector mvLX. The AMVP prediction parameter derivation unit 3032 outputs the prediction vector mvpLX to the subtraction unit 1123. It should be noted that the reference picture index refIdxLX and the prediction vector index mvp_1X_idx are output to the entropy coding unit 104.

[0229] The affine prediction unit 30372 derives the inter-frame prediction parameters (affine prediction parameters) of the sub-block.

[0230] The subtraction unit 1123 subtracts the prediction vector mvpLX output by the AMVP prediction parameter derivation unit 3032 from the motion vector mvLX input by the encoding parameter determination unit 110 , thereby generating a difference vector mvdLX. The subtraction unit 1123 outputs the difference vector mvdLX to the entropy encoding unit 104 .

[0231] The adder 106 generates a decoded image by adding pixel values ​​of the block prediction image input from the prediction image generator 101 and the prediction error input from the inverse quantization / inverse transform unit 105 for each pixel. The adder 106 stores the generated decoded image in the reference picture memory 109.

[0232] The loop filter 107 performs deblocking filtering, SAO, and ALF on the decoded image generated by the adding unit 106. It should be noted that the loop filter 107 does not necessarily include the above three filters, and may include only a deblocking filter, for example.

[0233] The prediction parameter memory 108 stores the prediction parameter generated by the encoding parameter determination unit 110 in a predetermined position for each target picture and CU.

[0234] The reference picture memory 109 stores the decoded image generated by the loop filter 107 at a predetermined position for each target picture and CU.

[0235] The coding parameter determination unit 110 selects one of a plurality of sets of coding parameters. The coding parameters refer to the QT, BT or TT partition information, prediction parameters or parameters generated in association with them as the coding target. The predicted image generation unit 101 generates a predicted image using these coding parameters.

[0236] The coding parameter determination unit 110 calculates the RD cost value indicating the amount of information and the coding error for each of the plurality of sets. The coding parameter determination unit 110 selects the set of coding parameters with the smallest calculated cost value. Thus, the entropy coding unit 104 outputs the selected set of coding parameters as the coding stream Te. The coding parameter determination unit 110 stores the determined coding parameters in the prediction parameter memory 108.

[0237] It should be noted that a part of the moving image encoding device 11 and the moving image decoding device 31 in the above-mentioned embodiment can be implemented by a computer, for example, the entropy decoding unit 301, the parameter decoding unit 302, the loop filter 305, the predicted image generation unit 308, the inverse quantization / inverse transformation unit 311, the addition unit 312, the predicted image generation unit 101, the subtraction unit 102, the transformation / quantization unit 103, the entropy encoding unit 104, the inverse quantization / inverse transformation unit 105, the loop filter 107, the encoding parameter determination unit 110 and the parameter encoding unit 111. In this case, the program for realizing the control function can be recorded in a computer-readable recording medium, and the computer system can read the program recorded in the recording medium and execute it. It should be noted that the "computer system" mentioned here refers to a computer system built into any one of the moving image encoding device 11 and the moving image decoding device 31, and a computer system including hardware such as an OS and peripheral devices is used. In addition, "computer-readable recording medium" refers to removable media such as floppy disks, magneto-optical disks, ROMs, CD-ROMs, and storage devices such as hard disks built into computer systems. Moreover, "computer-readable recording medium" may also include: recording media that dynamically store programs for a short period of time, such as communication lines when sending programs via networks such as the Internet or communication lines such as telephone lines; and recording media that store programs for a fixed period of time, such as volatile memories inside computer systems that serve as servers or clients in this case. In addition, the above-mentioned program may be a program for realizing a part of the above-mentioned functions, or a program that can realize the above-mentioned functions by combining with programs already recorded in the computer system.

[0238] In addition, part or all of the moving picture encoding device 11 and the moving picture decoding device 31 in the above-mentioned embodiment can also be implemented as an integrated circuit such as LSI (Large Scale Integration). Each functional block of the moving picture encoding device 11 and the moving picture decoding device 31 can be individually processor-based, or part or all of them can be integrated to be processor-based. In addition, the method of integrated circuitization is not limited to LSI, and it can also be implemented by a dedicated circuit or a general-purpose processor. In addition, when a technology for integrated circuitization that replaces LSI appears with the advancement of semiconductor technology, an integrated circuit based on this technology can also be used.

[0239] As mentioned above, one embodiment of the present invention has been described in detail with reference to the drawings, but the specific configuration is not limited to the above embodiment, and various design changes and the like can be made within the scope not departing from the gist of the present invention. [Application Examples]

[0240] The above-mentioned moving picture encoding device 11 and moving picture decoding device 31 can be mounted on various devices for sending, receiving, recording, and reproducing moving pictures. It should be noted that the moving pictures can be natural moving pictures taken by a camera or the like, or artificial moving pictures (including CG and GUI) generated by a computer or the like.

[0241] First, refer to Figure 2 A case where the above-mentioned moving picture encoding device 11 and moving picture decoding device 31 can be used for transmission and reception of moving pictures will be described.

[0242] Figure 2 (a) is a block diagram showing the structure of a transmitting device PROD_A equipped with a motion picture encoding device 11. Figure 2 As shown in (a), the transmitting device PROD_A includes: an encoding unit PROD_A1 that obtains encoded data by encoding a moving image, a modulation unit PROD_A2 that obtains a modulated signal by modulating a carrier using the encoded data obtained by the encoding unit PROD_A1, and a transmitting unit PROD_A3 that transmits the modulated signal obtained by the modulation unit PROD_A2. The moving image encoding device 11 described above is used as the encoding unit PROD_A1.

[0243] As a source of motion images input to the encoding unit PROD_A1, the transmitting device PROD_A may further include: a camera PROD_A4 for shooting motion images, a recording medium PROD_A5 for recording motion images, an input terminal PROD_A6 for inputting motion images from the outside, and an image processing unit A7 for generating or processing images. Figure 2(a) shows an example in which the transmitting device PROD_A has all of these structures, but some of them may be omitted.

[0244] It should be noted that the recording medium PROD_A5 may be a medium on which an uncoded moving image is recorded, or may be a medium on which a moving image coded in a recording coding method different from a transmission coding method is recorded. In the latter case, it is preferred that a decoding unit (not shown) that decodes coded data read from the recording medium PROD_A5 in accordance with the recording coding method is interposed between the recording medium PROD_A5 and the coding unit PROD_A1.

[0245] Figure 2 (b) is a block diagram showing the structure of a receiving device PROD_B equipped with a motion picture decoding device 31. Figure 2 As shown in (b), the receiving device PROD_B includes: a receiving unit PROD_B1 that receives a modulated signal, a demodulating unit PROD_B2 that obtains coded data by demodulating the modulated signal received by the receiving unit PROD_B1, and a decoding unit PROD_B3 that obtains a moving image by decoding the coded data obtained by the demodulating unit PROD_B2. The moving image decoding device 31 described above is used as the decoding unit PROD_B3.

[0246] The receiving device PROD_B, as a supply destination of the moving image output by the decoding unit PROD_B3, may further include a display PROD_B4 for displaying the moving image, a recording medium PROD_B5 for recording the moving image, and an output terminal PROD_B6 for outputting the moving image to the outside. Figure 2 (b) shows an example in which the receiving device PROD_B has all of these structures, but some of them may be omitted.

[0247] It should be noted that the recording medium PROD_B5 may be a medium for recording uncoded moving images, or may be a medium coded in a recording coding method different from a transmission coding method. In the latter case, it is preferred that a coding unit (not shown) that codes the moving images obtained from the decoding unit PROD_B3 in a recording coding method is interposed between the decoding unit PROD_B3 and the recording medium PROD_B5.

[0248] It should be noted that the transmission medium for transmitting the modulated signal can be wireless or wired. In addition, the transmission scheme for transmitting the modulated signal can be broadcast (here, it refers to a transmission scheme in which the transmission destination is not predetermined) or communication (here, it refers to a transmission scheme in which the transmission destination is predetermined). That is, the transmission of the modulated signal can be achieved through any one of wireless broadcasting, wired broadcasting, wireless communication and wired communication.

[0249] For example, a broadcasting station (broadcasting equipment, etc.) / receiving station (television receiver, etc.) of terrestrial digital broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals via wireless broadcasting. In addition, a broadcasting station (broadcasting equipment, etc.) / receiving station (television receiver, etc.) of cable television broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals via wired broadcasting.

[0250] In addition, a server (workstation, etc.) / client (television receiver, personal computer, smart phone, etc.) of a VOD (Video On Demand) service or a motion picture sharing service using the Internet is an example of a transmitter PROD_A / receiver PROD_B that transmits and receives a modulated signal through communication (usually, a wireless or wired transmission medium is used as a transmission medium in a LAN, and a wired transmission medium is used as a transmission medium in a WAN). Here, a personal computer includes a desktop PC, a laptop PC, and a tablet PC. In addition, a smart phone also includes a multifunctional portable phone terminal.

[0251] It should be noted that the client of the moving image sharing service has the function of decoding the encoded data downloaded from the server and displaying it on the display, and also has the function of encoding the moving images captured by the camera and uploading them to the server. That is, the client of the moving image sharing service plays the role of both the sending device PROD_A and the receiving device PROD_B.

[0252] Next, refer to Figure 3 , a description is given of a case where the above-mentioned motion image encoding device 11 and motion image decoding device 31 can be used for recording and reproducing motion images.

[0253] Figure 3 (a) is a block diagram showing the structure of a recording device PROD_C equipped with the above-mentioned motion picture encoding device 11. Figure 3As shown in (a) of FIG. 1 , the recording device PROD_C includes a coding unit PROD_C1 for obtaining coded data by coding a moving picture, and a writing unit PROD_C2 for writing the coded data obtained by the coding unit PROD_C1 into the recording medium PROD_M. The moving picture coding device 11 described above is used as the coding unit PROD_C1.

[0254] It should be noted that the recording medium PROD_M can be (1) a type of recording medium built into the recording device PROD_C such as an HDD (Hard Disk Drive) or an SSD (Solid State Drive), or (2) a type of recording medium connected to the recording device PROD_C such as an SD memory card or a USB (Universal Serial Bus) flash memory, or (3) a recording medium loaded into a drive device (not shown) built into the recording device PROD_C such as a DVD (Digital Versatile Disc, registered trademark) or a BD (Blu-ray Disc, registered trademark).

[0255] In addition, as a supply source of moving images input to the encoding unit PROD_C1, the recording device PROD_C may further include: a camera PROD_C3 for shooting moving images, an input terminal PROD_C4 for inputting moving images from the outside, a receiving unit PROD_C5 for receiving moving images, and an image processing unit PROD_C6 for generating or processing images. Figure 3 (a) shows an example in which the recording device PROD_C has all of these structures, but some of them may be omitted.

[0256] It should be noted that the receiving unit PROD_C5 can receive uncoded moving images, or can receive coded data coded in a transmission coding method different from the recording coding method. In the latter case, it is preferable to place a transmission decoding unit (not shown) that decodes the coded data coded in the transmission coding method between the receiving unit PROD_C5 and the coding unit PROD_C1.

[0257] Examples of such a recording device PROD_C include a DVD recorder, a BD recorder, and a HDD (Hard Disk Drive) recorder (in this case, the input terminal PROD_C4 or the receiving unit PROD_C5 is the main source of motion images). In addition, a portable camera (in this case, the camera PROD_C3 is the main source of motion images), a personal computer (in this case, the receiving unit PROD_C5 or the image processing unit C6 is the main source of motion images), and a smart phone (in this case, the camera PROD_C3 or the receiving unit PROD_C5 is the main source of motion images) are also examples of such a recording device PROD_C.

[0258] Figure 3 (b) is a block diagram showing the structure of a playback device PROD_D equipped with the above-mentioned motion picture decoding device 31. Figure 3 As shown in (b) of FIG. 1 , the playback device PROD_D includes a reading unit PROD_D1 for reading coded data written in the recording medium PROD_M and a decoding unit PROD_D2 for obtaining a moving image by decoding the coded data read by the reading unit PROD_D1. The moving image decoding device 31 described above is used as the decoding unit PROD_D2.

[0259] It should be noted that the recording medium PROD_M can be (1) a type of recording medium built into the reproduction device PROD_D such as an HDD, SSD, etc., or (2) a type of recording medium connected to the reproduction device PROD_D such as an SD memory card, USB flash memory, etc., or (3) a recording medium loaded into a drive device (not shown) built into the reproduction device PROD_D such as a DVD, BD, etc.

[0260] In addition, as a supply destination of the moving image output by the decoding unit PROD_D2, the reproduction device PROD_D may further include: a display PROD_D3 for displaying the moving image, an output terminal PROD_D4 for outputting the moving image to the outside, and a transmission unit PROD_D5 for transmitting the moving image. Figure 3 (b) shows an example in which the playback device PROD_D has all of these structures, but some of them may be omitted.

[0261] It should be noted that the sending unit PROD_D5 can send uncoded moving images or can send coded data coded in a transmission coding method different from the recording coding method. In the latter case, it is better to place a coding unit (not shown) that encodes the moving images in the transmission coding method between the decoding unit PROD_D2 and the sending unit PROD_D5.

[0262] Examples of such a reproduction device PROD_D include a DVD player, a BD player, and an HDD player (in this case, the output terminal PROD_D4 connected to a television receiver or the like is the main supply destination of the motion image). In addition, a television receiver (in this case, the display PROD_D3 is the main supply destination of the motion image), a digital signage (also called an electronic billboard, an electronic bulletin board, etc., the display PROD_D3 or the transmission unit PROD_D5 is the main supply destination of the motion image), a desktop PC (in this case, the output terminal PROD_D4 or the transmission unit PROD_D5 is the main supply destination of the motion image), a laptop or tablet PC (in this case, the display PROD_D3 or the transmission unit PROD_D5 is the main supply destination of the motion image), and a smartphone (in this case, the display PROD_D3 or the transmission unit PROD_D5 is the main supply destination of the motion image) are also examples of such a reproduction device PROD_D. (Hardware implementation and software implementation)

[0263] Furthermore, each block of the above-described moving picture decoding device 31 and moving picture encoding device 11 may be implemented in hardware by a logic circuit formed on an integrated circuit (IC chip), or may be implemented in software by using a CPU (Central Processing Unit).

[0264] In the latter case, each of the above-mentioned devices has: a CPU that executes commands of a program that realizes each function, a ROM (Read Only Memory) that stores the above-mentioned program, a RAM (Random Access Memory) that expands the above-mentioned program, and a storage device (recording medium) such as a memory that stores the above-mentioned program and various data. Then, the purpose of the embodiment of the present invention can also be achieved in the following manner: a recording medium that records the program code (executable form program, intermediate code program, source program) of the control program of the software that realizes the above-mentioned functions, i.e., the above-mentioned each device in a computer-readable manner is supplied to the above-mentioned each device, and the computer (or CPU, MPU) reads the program code recorded in the recording medium and executes it.

[0265] As the above-mentioned recording medium, for example, the following tapes can be used: tapes such as magnetic tapes and cassette tapes; disks including floppy disks (registered trademark) / hard disks, CD-ROMs (Compact Disc Read-Only Memory) / MO disks (Magneto-Optical disc) / MD (Mini Disc) / DVD (Digital Versatile Disc) / CD-R (CD Recordable) / Blu-ray Discs (registered trademark) and the like; cards such as IC cards (including memory cards) / optical cards; semiconductor memories such as mask ROMs / EPROMs (Erasable Programmable Read-Only Memory) / EEPROMs (Electrically Erasable and Programmable Read-Only Memory) / flash ROMs; or logic circuits such as PLDs (Programmable logic device) and FPGAs (Field Programmable Gate Array), etc.

[0266] In addition, each of the above-mentioned devices can also be configured to be connected to a communication network, and the above-mentioned program code can be supplied via the communication network. The communication network can transmit program codes without being particularly limited. For example, the Internet, intranet, extranet, LAN (Local Area Network), ISDN (Integrated Services Digital Network), VAN (Value-Added Network), CATV (Community Antenna television / Cable Television) communication network, virtual private network (Virtual Private Network), telephone line network, mobile communication network, satellite communication network, etc. can be used. In addition, the transmission medium constituting the communication network can also be a medium capable of transmitting program codes, and is not limited to a specific structure or type. For example, it can be used in wired communication such as IEEE (Institute of Electrical and Electronic Engineers) 1394, USB, power line transmission, wired TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, or wireless communication such as IrDA (Infrared Data Association), infrared such as remote controller, BlueTooth (registered trademark), IEEE802.11 wireless, HDR (High Data Rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance, registered trademark), mobile phone network, satellite line, terrestrial digital broadcasting network, etc. It should be noted that the embodiments of the present invention can be implemented in the form of a computer data signal embedded in a carrier wave to embody the above-mentioned program code through electronic transmission.

[0267] The embodiments of the present invention are not limited to the above-mentioned embodiments, and various modifications can be made within the scope of the claims. That is, embodiments obtained by combining technical solutions appropriately modified within the scope of the claims are also included in the technical scope of the present invention. (Cross-reference of related applications)

[0268] This application claims the benefit of priority to Japanese Patent Application No. 2018-230199 filed on December 7, 2018, the entire contents of which are incorporated herein by reference. (Other expressions of the present invention)

[0269] It should be noted that the present invention can also be expressed as follows.

[0270] That is, an image decoding device according to one embodiment of the present invention includes a parameter decoding unit that decodes parameters for generating a predicted image, the parameter decoding unit decodes a skip flag indicating whether it is a skip mode in which there is no prediction residual, and when the skip flag does not indicate the skip mode, decodes a merge flag indicating whether it is a merge mode in which motion vector information is obtained from a merge candidate, and when the merge flag does not indicate the merge mode, decodes an MMVD flag indicating whether it is an MMVD mode in which motion vector information is obtained by decoding differential motion vector information in a specified direction from encoded data in addition to the motion vector information obtained from the merge candidate.

[0271] In addition, an image decoding device of one embodiment of the present invention has a parameter decoding unit that decodes parameters for generating a predicted image, the parameter decoding unit decodes a skip flag indicating whether it is a skip mode in which there is no prediction residual, and when the skip flag does not indicate the skip mode, decodes a merge flag indicating whether it is a merge mode in which motion vector information is obtained from a merge candidate, and when the merge flag indicates the merge mode, decodes an MMVD flag indicating whether it is an MMVD mode in which motion vector information is obtained by decoding differential motion vector information in a specified direction from encoded data in addition to the motion vector information obtained from the merge candidate.

[0272] In addition, an image encoding device of one embodiment of the present invention is characterized in that it has a parameter encoding unit that encodes parameters for generating a predicted image, the parameter encoding unit encodes a skip flag indicating whether it is a skip mode in which there is no prediction residual, and when the skip flag does not indicate the skip mode, encodes a merge flag indicating whether it is a merge mode in which motion vector information is obtained from a merge candidate, and when the merge flag does not indicate the merge mode, encodes an MMVD flag indicating whether it is an MMVD mode in which motion vector information is obtained by encoding differential motion vector information in a specified direction in addition to the motion vector information obtained from the merge candidate.

[0273] In addition, an image encoding device of one embodiment of the present invention has a parameter encoding unit that encodes parameters for generating a predicted image, the parameter encoding unit encodes a skip flag indicating whether it is a skip mode in which there is no prediction residual, and when the skip flag does not indicate the skip mode, encodes a merge flag indicating whether it is a merge mode in which motion vector information is obtained from a merge candidate, and when the merge flag indicates the merge mode, encodes an MMVD flag indicating whether it is an MMVD mode in which motion vector information is obtained by encoding differential motion vector information in a specified direction in addition to the motion vector information obtained from the merge candidate.

[0274] In addition, an image decoding device of one embodiment of the present invention has a parameter decoding unit that decodes parameters for generating a predicted image, the parameter decoding unit decodes an MMVD flag indicating whether the MMVD mode is to obtain motion vector information by decoding differential motion vector information in a specified direction from encoded data, an index indicating a distance table, and an index for selecting an element of the distance table, and has an MMVD prediction unit that obtains a motion vector by adding a differential vector of a specified distance and a specified direction to a motion vector derived from a merge candidate, and the MMVD prediction unit converts the motion vector into integer precision when selecting a specific element of the distance table.

[0275] By adopting the above configuration, when encoding an image at a high compression rate, when many prediction parameters indicate the absence of prediction residuals by skipping flags, there is no need to decode the merge flag or the MMVD flag, thereby preventing a decrease in encoding efficiency.

[0276] In addition, an image decoding device of one embodiment of the present invention is characterized in that it has a prediction parameter decoding unit that decodes parameters for generating a predicted image, and the prediction parameter decoding unit decodes a skip flag indicating that there is no prediction residual, and then decodes a merge flag for implicitly obtaining motion vector information when there is a prediction residual, and when it is not a merge mode, decodes an MMVD flag for obtaining motion vector information by decoding differential motion vector information from encoded data in addition to the implicitly obtained motion vector information.

[0277] By adopting the above configuration, when many prediction parameters indicate the absence of prediction residuals through skip flags at low rates, there is no need to decode the merge flag or the MMVD flag, thereby not reducing the coding efficiency. Industrial Applicability

[0278] The embodiments of the present invention can be preferably applied to a motion picture decoding device that decodes coded data obtained by encoding image data, and a motion picture encoding device that generates coded data obtained by encoding image data. In addition, the embodiments of the present invention can be preferably applied to a data structure of coded data generated by a motion picture encoding device and referred to by a motion picture decoding device. Description of Reference Numerals 31 Image decoding device 301 Entropy Decoding Unit 302 Parameter decoding unit 3020 Header decoding unit 303 Inter-frame prediction parameter decoding unit 304 Intra-frame prediction parameter decoding unit 308 Prediction image generation unit 309 Inter-frame prediction image generation unit 310 Intra-frame prediction image generation unit 311 Inverse quantization / inverse transformation unit 312 Addition 11 Image Coding Device 101 Prediction image generation unit 102 Subtraction Department 103 Transformation / Quantization Unit 104 Entropy Coding Unit 105 Inverse quantization / inverse transform unit 107 Loop Filter 110 Coding parameter determination unit 111 Parameter encoding unit 112 Parameter encoding unit 1110 Header encoding unit 1111 CT Information Coding Department 1112 CU encoding unit (prediction mode encoding unit) 1114 TU Coding Department

Claims

1. A moving image decoding apparatus, the moving image decoding apparatus comprising: A parameter decoding unit configured to receive an encoded unit syntax, decode a skip flag from the encoded unit syntax, decode a merge flag from the encoded unit syntax based on the skip flag, decode an MMVD flag from the encoded unit syntax based on the skip flag or the merge flag, and decode a first syntax element base_candidate_idx indicating an index of a merge candidate list, a second syntax element distance_idx indicating a length of a differential vector, and a third syntax element direction_idx indicating a direction of the differential vector from the encoded unit syntax based on the MMVD flag; An MMVD prediction unit configured to derive a motion vector by adding the differential vector to a motion vector for merging; and A predicted image generation unit configured to generate a predicted picture by using the motion vector, wherein The MMVD prediction unit sets the motion vector for merging to be equal to mergeCandList[base_candidate_idx], Derives a variable DistFromBaseMV from a distance DistanceTable[distance_idx] indicated by the second syntax element distance_idx in a distance table DistanceTable, Refers to a direction list DirectionTable and derives a basic motion vector mvdUnit from the third syntax element direction_idx, Derives a first vector firstMv by the following formula: firstMv = (DistFromBaseMV << shiftMMVD) * mvdUnit, When a distance between a target picture and an L0 picture is equal to a distance between the target picture and an L1 picture, derives the differential vector by scaling the first vector.