Moving image decoding device and moving image encoding device

JP2023043219A5Active Publication Date: 2024-09-20SHARP KK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2021150710
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2021-09-16
Publication Date
2024-09-20
Estimated Expiration
2041-09-16

AI Technical Summary

Technical Problem

Existing video coding methods, such as those described in Non-Patent Document 1 and Patent Document 1, face inefficiencies due to the inability to utilize information from surrounding blocks in Geometric Partition Mode (GPM) and the inability to describe line segments accurately, which affects coding efficiency.

Method used

A video decoding device that decodes GPM parameters using a table associating intersection coordinates, block sizes, and prediction modes to derive predicted images, accounting for whether adjacent blocks intersect with the target block, and applies weights based on derived partition indices to improve coding efficiency.

Benefits of technology

This approach enhances coding efficiency by accurately utilizing surrounding block information and improving prediction accuracy, leading to more efficient video coding and decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

To provide moving image encoding and decoding devices which can improve the encoding efficiency.SOLUTION: A moving image decoding device according to an embodiment of the present invention uses a table which associates a block size of an adjacent block and a prediction mode number of the adjacent block and a coordinate position of an intersection with each other, and a table which associates a block size of an object block and a prediction mode number of the object block and the coordinate position of the intersection with each other to derive a partition index of a non-rectangular prediction mode of the object block.SELECTED DRAWING: Figure 19
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to a moving image decoding apparatus and a moving image encoding apparatus.

Background Art

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

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

[0004] In such a moving image encoding method, an image (picture) constituting the moving image is managed by a hierarchical structure including a slice obtained by dividing the image, a coding tree unit (CTU: Coding Tree Unit) obtained by dividing the slice, a coding unit (sometimes called a Coding Unit: CU) obtained by dividing the coding tree unit, and a transform unit (TU: Transform Unit) obtained by dividing the coding unit, and is encoded / decoded for each CU.

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

[0006] Furthermore, Non-Patent Document 1 discloses a GPM (Geometric partition mode) mode in which the target block is divided into shapes other than rectangles, and different interpretations are performed for each region. By dividing the target block into shapes other than rectangles in this way, predictions can be made more accurately even for complex textures, and coding efficiency is improved.

[0007] Patent Document 1 describes a method for identifying a line segment using a point through which a line segment passes and its slope, stating that "in the division method decoding step, if the division method of the block is division by an arbitrary line segment, and the division line segment information includes a point through which the line segment passes, based on a division point on a line tangent to the block and a surrounding block, and the slope of the line segment, then the line segment information is identified from the point through which the line segment passes and the slope of the line segment, and the information of the line segment is notified to the division step." [Prior art documents] [Patent Documents]

[0008] [Patent Document 1] Patent No. 4313710 [Non-patent literature]

[0009] [Non-Patent Document 1] ITU-T Rec. H.266 [Overview of the Initiative] [Problems that the invention aims to solve]

[0010] The method described in Non-Patent Document 1 encodes GPM information for each block, which has the drawback of not being able to utilize information from surrounding blocks.

[0011] Furthermore, the method described in Patent Document 1 has the problem of not being able to describe the point through which the line segment passes in the GPM mode described in Non-Patent Document 1. [Means for solving the problem]

[0012] To solve the above problems, a video decoding device according to one aspect of the present invention is provided. An image decoding device comprising a parameter decoding unit that decodes the GPM parameters of a target block from encoded data, and a prediction unit that derives a predicted image from two predicted images and weights, The parameter decoding unit is characterized in that the parameters to be decoded differ depending on whether or not the target block has an intersection with the predicted dividing line of the adjacent block, and the derivation of the intersection point is based on a table that associates the block size of the adjacent block, the prediction mode number of the adjacent block, and the coordinate position of the intersection point. The prediction unit, when the prediction division line of an adjacent block intersects with the target block, uses the division angle derived from the index indicating the decoded division angle, the block size of the adjacent block, the prediction mode number of the adjacent block, and the coordinate position of the intersection, as well as the block size of the target block, the prediction mode number of the target block, and the coordinate position of the intersection, to derive the partition index of the prediction mode of the target block. The prediction unit derives weights for making the prediction based at least on the derived partition index values ​​and a table that associates partition indexes with angle indexes and distance indexes. The method is characterized by deriving the predicted image using the aforementioned weights. [Effects of the Invention]

[0013] According to an aspect of the present invention, the encoding efficiency in video encoding and decoding processing can be improved. [Brief explanation of the drawing]

[0014] [Figure 1] This is a schematic diagram showing the configuration of the image transmission system according to this embodiment. [Figure 2] This diagram shows the hierarchical structure of the encoded stream data. [Figure 3] It is a schematic diagram showing the configuration of a moving image decoding device. [Figure 4] It is a schematic diagram showing the configuration of an inter-prediction image generation unit. [Figure 5] It is a schematic diagram showing the configuration of an inter-prediction parameter derivation unit. [Figure 6] It is a flowchart for explaining the schematic operation of a moving image decoding device. [Figure 7] It is a syntax diagram for explaining the encoding parameters of GPM prediction. [Figure 8] It is a diagram for explaining GPM prediction. [Figure 9] In GPM prediction, it is a diagram showing the structure of a table indicating the correspondence between merge_gpm_partition_idx (mergeGpmPartitionIdx), angleIdx, and distanceIdx. It is a diagram showing the structure of a table indicating the correspondence between idx and DisLut[idx] used in the weight coefficient derivation process and the motion vector storage process in GPM prediction. [Figure 10] It is a flowchart showing the processing flow of GPM prediction. [Figure 11] It is a syntax diagram for explaining the encoding parameters in the mode number prediction of GPM prediction. [Figure 12] In the mode number prediction of GPM prediction, it is a table for deriving the x coordinate of the intersection point between the GPM division line of the upper adjacent block and the target block. [Figure 13] In the mode number prediction of GPM prediction, it is a table for deriving the y coordinate of the intersection point between the GPM division line of the left adjacent block and the target block. [Figure 14] In the mode number prediction of GPM prediction, it is a table for deriving the x coordinate of the intersection point between the GPM division line of the target block and the upper adjacent block. [Figure 15] In the mode number prediction of GPM prediction, it is a table for deriving the y coordinate of the intersection point between the GPM division line of the target block and the left adjacent block. [Figure 16]This figure shows the structure of the table that indicates the correspondence between merge_gpm_angle_idx and angleIdx in the mode number prediction of GPM prediction. [Figure 17] This flowchart shows the processing flow for mode number prediction in GPM forecasting. [Figure 18] This is another flowchart showing the processing flow for mode number prediction in GPM forecasting. [Figure 19] This diagram illustrates the GPM dividing lines of adjacent blocks and line segments that could potentially become GPM dividing lines in the target block. [Figure 20] This is a block diagram showing the configuration of a video encoding device. [Figure 21] This is a schematic diagram showing the configuration of the interprediction parameter coding unit. [Modes for carrying out the invention]

[0015] (First Embodiment) Embodiments of the present invention will be described below with reference to the drawings.

[0016] Figure 1 is a schematic diagram showing the configuration of the image transmission system 1 according to this embodiment.

[0017] Image transmission system 1 is a system that transmits an encoded stream containing an encoded target image, decodes the transmitted encoded stream, and displays the image. Image transmission system 1 is composed of a video encoding device (image encoding device) 11, a network 21, a video decoding device (image decoding device) 31, and a video display device (image display device) 41.

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

[0019] Network 21 transmits the encoded stream Te generated by the video encoding device 11 to the video decoding device 31. Network 21 is the Internet, a wide area network (WAN), a local area network (LAN), or a combination thereof. Network 21 is not necessarily limited to a bidirectional communication network; it may also be a unidirectional communication network that transmits broadcast waves such as terrestrial digital broadcasting or satellite broadcasting. Furthermore, network 21 may be replaced by a storage medium that records the encoded stream Te, such as a DVD (Digital Versatile Disc: registered trademark) or a BD (Blu-ray Disc: registered trademark).

[0020] The video decoding device 31 decodes each of the encoded streams Te transmitted by the network 21 and generates one or more decoded images Td.

[0021] The video display device 41 displays all or part of one or more decoded images Td generated by the video decoding device 31. The video display device 41 includes a display device such as a liquid crystal display or an organic EL (electro-luminescence) display. Examples of display forms include stationary, mobile, and HMD (head-mounted display). Furthermore, if the video decoding device 31 has high processing power, it displays high-quality images, and if it has lower processing power, it displays images that do not require high processing power or display power.

[0022] <operators> The operators used in this specification are listed below.

[0023] >> represents a right bit shift, << represents a left bit shift, & represents a bitwise AND, | represents a bitwise OR, and |= represents the OR assignment operator.

[0024] x?y:z is a ternary operator that takes the value y if x is true (non-zero) and z if x is false (0).

[0025] Clip3(a, b, c) is a function that clips c to a value between a and b. If c < a, it returns a; if c > b, it returns b; otherwise, it returns c (where a <= b).

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

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

[0028] floor(a) is a function that returns the largest integer less than or equal to a.

[0029] ceil(a) is a function that returns the smallest integer greater than or equal to a.

[0030] a / d represents the division of a by d (truncating the decimal part).

[0031] a % d represents the remainder of the division of a by d.

[0032] x || y represents the OR operation between x and y. || can also be written as x + y.

[0033] x && y represents the AND operation between x and y. && can also be written as x * y.

[0034] x++ increments x by 1. When written as Tbl[x++], it means that after using the value of Tbl[x], x is incremented by 1.

[0035] <Structure of the Encoded Stream Te>[[]]END]] Prior to the detailed description of the moving image encoding device 11 and the moving image decoding device 31 according to this embodiment, the data structure of the encoded stream Te generated by the moving image encoding device 11 and decoded by the moving image decoding device 31 will be described.

[0036] Figure 2 shows the hierarchical structure of data in the encoded stream Te. The encoded stream Te includes, exemplarily, a sequence and multiple pictures that make up the sequence. Figures 2(a) to (f) show the encoded video sequence that defines the sequence SEQ, the encoded picture that defines the picture PICT, the encoded slice that defines the slice S, the encoded slice data that defines the slice data, the encoded tree unit contained in the encoded slice data, and the encoded unit contained in the encoded tree unit, respectively.

[0037] (Encoded video sequence) In an encoded video sequence, a set of data that the video decoding device 31 references to decode the sequence SEQ to be processed is defined. As shown in Figure 2, the sequence SEQ includes a Video Parameter Set, a Sequence Parameter Set SPS, a Picture Parameter Set PPS, an Adaptation Parameter Set (APS), a Picture PICT, and Supplemental Enhancement Information SEI.

[0038] The Video Parameter Set (VPS) defines a set of encoding parameters common to multiple video layers in a video composed of multiple layers, as well as a set of encoding parameters associated with the multiple layers included in the video and with each individual layer.

[0039] The sequence parameter set (SPS) defines a set of encoding parameters that the video decoding device 31 references to decode the target sequence. For example, the width and height of the picture are defined. Note that there may be multiple SPSs. In that case, one of the multiple SPSs is selected from the PPS. Select this option.

[0040] The Picture Parameter Set (PPS) defines a set of encoding parameters that the video decoding device 31 references to decode each picture in the target sequence. For example, it includes a reference value for the quantization width used for decoding the picture (pic_init_qp_minus26) and a flag indicating the application of weighted prediction (weighted_pred_flag). Multiple PPSs may exist. In that case, one of the multiple PPSs is selected for each picture in the target sequence.

[0041] (Encoded picture) The encoded picture specifies the set of data that the video decoding device 31 references to decode the picture PICT to be processed. As shown in Figure 2, the picture PICT includes slices 0 to NS-1 (NS being the total number of slices included in the picture PICT).

[0042] In the following, if it is not necessary to distinguish between slices 0 through NS-1, the code subscripts may be omitted. The same applies to other data included in the coded stream Te described below that have subscripts.

[0043] (Encoded slice) In an encoded slice, a set of data that the video decoding device 31 references to decode the slice S to be processed is defined. As shown in Figure 2, the slice includes a slice header and slice data.

[0044] The slice header contains a set of encoding parameters that the video decoding device 31 references to determine the decoding method for the target slice. The slice type specification information (slice_type), which specifies the slice type, is an example of the encoding parameters included in the slice header.

[0045] The slice types that can be specified by the slice type specification information include (1) I slices that use only intra prediction during encoding, (2) P slices that use unidirectional prediction or intra prediction during encoding, and (3) B slices that use unidirectional prediction, bidirectional prediction or intra prediction during encoding. Note that interpretation is not limited to single or bidirectional prediction, and prediction images may be generated using more reference pictures. Hereinafter, when referring to P slices and B slices, we mean slices that contain blocks on which interpretation can be used.

[0046] The slice header may also include a reference to the picture parameter set PPS (pic_parameter_set_id).

[0047] (Encoded slice data) The encoded slice data defines the set of data that the video decoding device 31 references in order to decode the slice data to be processed. As shown in Figure 2(d), the slice data includes CTUs. A CTU is a fixed-size (e.g., 64x64) block that makes up a slice, and is sometimes called a Largest Coding Unit (LCU).

[0048] (Code tree unit) Figure 2 defines the set of data that the video decoding device 31 references to decode the CTU to be processed. The CTU is divided into coding units CU, which are the basic units of encoding processing, by recursive quad tree partitioning (QT), binary tree partitioning (BT), or ternary tree partitioning (TT). BT and TT partitioning together are called multi-tree partitioning (MT). The nodes of the tree structure obtained by recursive quad tree partitioning are called coding nodes. The intermediate nodes of a branch tree are coding nodes, and the CTU itself is defined as the top-level coding node. The lowest-level coding node is defined as the coding unit.

[0049] (Encoding Unit) Figure 2 defines the set of data that the video decoding device 31 references to decode the encoding unit to be processed. Specifically, the CU consists of a CU header CUH, prediction parameters, transformation parameters, quantization transformation coefficients, etc. The CU header defines the prediction mode, etc.

[0050] Prediction processing can be performed at the CU (Unit) level or at the subCU level, which is a further division of the CU. If the size of the CU and the subCU are equal, there is one subCU within the CU. If the CU is larger than the size of the subCU, the CU is divided into subCUs. For example, if the CU is 8x8 and the subCU is 4x4, the CU will be divided into four subCUs, each consisting of two horizontal and two vertical divisions.

[0051] There are three types of prediction (prediction modes): intra-prediction (MODE_INTRA), inter-prediction (MODE_INTER), and intra-block copy (MODE_IBC). Intra-prediction is prediction within the same picture, while inter-prediction refers to prediction processing performed between different pictures (e.g., between display times, between layer images).

[0052] The transformation and quantization processes are performed in units of CUs, but the quantization transformation coefficients may be entropy-encoded in subblock units such as 4x4.

[0053] (Prediction parameters) The predicted image is derived from the prediction parameters associated with the block. These prediction parameters include intra-prediction and inter-prediction parameters.

[0054] (Prediction parameters for interpretation) This section describes the prediction parameters for interpretation. The interpretation parameters consist of prediction list usage flags predFlagL0 and predFlagL1, reference picture indices refIdxL0 and refIdxL1, and motion vectors mvL0 and mvL1. predFlagL0 and predFlagL1 are flags that indicate whether or not a reference picture list (L0 list, L1 list) is used, and if the value is 1, the corresponding reference picture list is used. In this specification, when referring to "flags indicating whether or not XX is true," a flag value other than 0 (e.g., 1) is considered XX, and 0 is considered not XX. In logical negation, logical AND, etc., 1 is treated as true and 0 as false (the same applies below). However, in actual devices and methods, other values ​​may be used as true and false values.

[0055] Syntax elements for deriving inter-prediction parameters include, for example, the merge flag merge_flag (general_merge_flag), the merge index merge_idx, merge_subblock_flag and regular_merge_flag indicating whether to use inter-prediction at the subblock level, the intra-inter flag ciip_flag, the GPM_flag indicating whether to use GPM mode (Geometric partitioning merge mode), merge_gpm_partition_idx indicating the partition shape in GPM mode, merge_gpm_idx0 and merge_gpm_idx1 indicating the GPM merge index, the inter-prediction identifier inter_pred_idc for selecting the reference picture to use in AMVP mode, the reference picture index refIdxLX, the prediction vector index mvp_LX_idx for deriving the motion vector, the difference vector mvdLX, and the motion vector accuracy mode amvr_mode. The partition shape of the target block is not limited to the syntax element merge_gpm_partition_idx; mergeGpmPartitionIdx, which can be predicted from the surrounding blocks, may also be used.

[0056] (Reference picture list) The reference picture list is a list of reference pictures stored in the reference picture memory 306. In each CU, any of the pictographs in the reference picture list RefPicListX (X=0 or 1) The refIdxLX parameter specifies whether to actually reference the Kucha. Note that LX is a notation used when there is no distinction between L0 predictions and L1 predictions. Hereafter, parameters for the L0 list and parameters for the L1 list will be distinguished by replacing LX with L0 and L1.

[0057] (Merge prediction and AMVP prediction) There are two methods for decoding (encoding) prediction parameters: merge mode and AMVP (Advanced Motion Vector Prediction). merge_flag is a flag used to distinguish between these modes. Merge mode is a prediction mode that omits some or all of the motion vector difference. It derives the prediction list usage flag predFlagLX, reference picture index refIdxLX, and motion vector mvLX from the prediction parameters of already processed neighboring blocks, without including them in the encoded data. AMVP mode includes inter_pred_idc, refIdxLX, and mvLX in the encoded data. Note that mvLX is encoded as mvp_LX_idx, which identifies the prediction vector mvpLX, and the difference vector mvdLX. The general term for prediction modes that omit or simplify the motion vector difference is general merge mode, and general_merge_flag can be used to select between general merge mode and AMVP prediction. Furthermore, you may transmit a regular_merge_flag and select either the normal merge mode or MMVD if the regular_merge_flag is 1, or CIIP mode or GPM mode otherwise.

[0058] inter_pred_idc is a value that indicates the type and number of reference pictures, and can take one of the following values: PRED_L0, PRED_L1, or PRED_BI. PRED_L0 and PRED_L1 indicate single prediction using one reference picture managed in the L0 list and L1 list, respectively. PRED_BI indicates biprediction using two reference pictures managed in the L0 list and L1 list.

[0059] merge_idx is an index that indicates which of the candidate predictive parameters (merge candidates) derived from the completed block will be used as the predictive parameters for the target block.

[0060] (Motion vector) mvLX represents the amount of shift between blocks in two different pictures. The prediction vector and difference vector for mvLX are called mvpLX and mvdLX, respectively.

[0061] (Interpretation identifier inter_pred_idc and prediction list usage flag predFlagLX) The relationship between inter_pred_idc, predFlagL0, and predFlagL1 is as follows, and they are mutually convertible.

[0062] inter_pred_idc = (predFlagL1<<1)+predFlagL0 predFlagL0 = inter_pred_idc & 1 predFlagL1 = inter_pred_idc >> 1 The inter-prediction parameters may use either the prediction list usage flag or the inter-prediction identifier. Furthermore, the determination using the prediction list usage flag may be replaced with the determination using the inter-prediction identifier. Conversely, the determination using the inter-prediction identifier may be replaced with the determination using the prediction list usage flag.

[0063] (Biprediction of biPred) The flag `biPred`, which indicates whether a system uses two prediction lists, can be derived by checking if both of the prediction list usage flags are set to 1.

[0064] Alternatively, biPred can also be derived by determining whether the interpretation identifier is a value that indicates the use of two prediction lists (reference pictures).

[0065] (Configuration of the video decoding device) The configuration of the video decoding device 31 (Figure 3) according to this embodiment will be described below.

[0066] The video decoding device 31 includes an entropy decoding unit 301, a parameter decoding unit (predictive image decoding device) 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generation unit (predictive image generation device) 308, an inverse quantization / inverse transform unit 311, and an addition unit 312 and a prediction parameter derivation unit 320. Note that, in accordance with the video encoding device 11 described later, there is also a configuration in the video decoding device 31 that does not include the loop filter 305.

[0067] The parameter decoding unit 302 further comprises a header decoding unit 3020, a CT information decoding unit 3021, and a CU decoding unit 3022 (prediction mode decoding unit), and the CU decoding unit 3022 further comprises a TU decoding unit 3024. These may be collectively referred to as a decoding module. The header decoding unit 3020 decodes parameter set information such as VPS, SPS, PPS, and APS, and slice headers (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. The TU decoding unit 3024 decodes QP update information (quantization correction value) and quantization prediction error (residual_coding) from the encoded data if the TU contains a prediction error.

[0068] The sps_gpm_enabled_flag indicates whether the GPM prediction mode is used in the target sequence, which is encoded and decoded by SPS. In SPS, sps_max_num_merge_cand_minus_max_num_gpm_cand is encoded and decoded. sps_max_num_merge_cand_minus_max_num_gpm_cand is a parameter used to derive MaxNumGpmMergeCand, the maximum number of merge candidates for GPM prediction. When MaxNumGpmMergeCand is 0, GPM prediction is disabled.

[0069] The predictive image generation unit 308 includes an inter-predictive image generation unit 309 (Figure 4) and an intra-predictive image generation unit 310.

[0070] The prediction parameter derivation unit 320 is comprised of an inter-prediction parameter derivation unit 303 (Figure 5) and an intra-prediction parameter derivation unit.

[0071] Furthermore, while the following examples use CTU and CU as processing units, processing may be performed in sub-CU units, or the system may be reinterpreted as blocks (CTU and CU) and sub-CU as sub-blocks (sub-CU), and processing may be performed in block or sub-block units.

[0072] The entropy decoding unit 301 performs entropy decoding on the encoded stream Te input from the outside to decode individual codes (syntax elements). Entropy coding can be performed in two ways: one method uses a context (probability model) adaptively selected according to the type of syntax element and the surrounding circumstances to encode the syntax elements by a variable length, and the other method uses a predetermined table or calculation formula to encode the syntax elements by a variable length.

[0073] The entropy decoding unit 301 outputs the decoded codes to the parameter decoding unit 302. The decoded codes include, for example, the prediction mode predMode, merge_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_LX_idx, mvdLX, amvr_mode, etc. The control of which codes to decode is performed based on the instructions of the parameter decoding unit 302.

[0074] (Basic Flow) Figure 6 is a flowchart illustrating the general operation of the video decoding device 31.

[0075] (S1100: Parameter set information decoding) The header decoding unit 3020 decodes the VPS and SP from the encoded data. Decodes parameter set information such as S and PPS.

[0076] (S1200: Slice information decoding) The header decoding unit 3020 decodes the slice header (slice information) from the encoded data.

[0077] The video decoding device 31 then derives a decoded image for each CTU by repeating the processing from S1300 to S5000 for each CTU included in the target picture.

[0078] (S1300: CTU information decoding) The CT information decoding unit 3021 decodes the CTU from the encoded data.

[0079] (S1400: CT information decoding) The CT information decoding unit 3021 decodes the CT from the encoded data.

[0080] (S1500: CU Decoding) The CU decoding unit 3022 performs S1510 and S1520 to decode the CU from the encoded data.

[0081] (S1510: CU information decoding) The CU decoding unit 3022 decodes CU information, prediction information, TU partitioning flag, CU residual flag, etc. from the encoded data.

[0082] (S1520: TU information decoding) The TU decoding unit 3024 decodes the quantization prediction error, transformation index lfnst_idx, etc. from the encoded data if the TU contains a prediction error.

[0083] (S2000: Predictive image generation) The predictive image generation unit 308 generates a predictive image for each block included in the target CU based on the prediction information.

[0084] (S3000: Inverse Quantization / Inverse Transform) The inverse quantization / inverse transform unit 311 performs inverse quantization / inverse transform processing for each TU included in the target CU.

[0085] (S4000: Decoded image generation) The summing unit 312 generates a decoded image of the target CU by adding the predicted image supplied from the predicted image generation unit 308 and the prediction error supplied from the inverse quantization / inverse transformation unit 311.

[0086] (S5000: Loop filter) Loop filter 305 applies loop filters such as a deblocking filter, SAO, and ALF to the decoded image to generate a decoded image.

[0087] The loop filter 305 is a filter installed within the encoding loop that removes block distortion and ringing distortion, thereby improving image quality. The loop filter 305 applies filters such as a deblocking filter, sample-adaptive offset (SAO), and adaptive loop filter (ALF) to the decoded CU image generated by the summing unit 312.

[0088] The reference picture memory 306 stores the decoded image of the CU generated by the adder 312 at a predetermined location for each target picture and target CU.

[0089] The prediction parameter memory 307 stores prediction parameters at predetermined locations 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 separated by the entropy decoding unit 301.

[0090] The prediction image generation unit 308 receives the prediction mode (predMode), prediction parameters, etc. The prediction image generation unit 308 also reads a reference picture from the reference picture memory 306. The prediction image generation unit 308 generates a block or subblock prediction image using the prediction mode indicated by the prediction mode (predMode), the prediction parameters, and the read reference picture (reference picture block). Here, a reference picture block is a collection of pixels on the reference picture (usually rectangular, hence called a block), and is the area referenced to generate the prediction image.

[0091] (Configuration of the Interpretation Parameter Derivation Unit) As shown in Figure 5, the inter-prediction parameter derivation unit 303 derives inter-prediction parameters by referring to the prediction parameters stored in the prediction parameter memory 307 based on the syntax elements input from the parameter decoding unit 302. It also outputs the inter-prediction parameters to the inter-prediction image generation unit 309 and the prediction parameter memory 307. The inter-prediction parameter derivation unit 303 and its internal elements, the AMVP prediction parameter derivation unit 3032, the merge prediction parameter derivation unit 3036, the GPM prediction unit 30377, and the MV addition unit 3038, are common means in both the video encoding device and the video decoding device, and therefore may be collectively referred to as the motion vector derivation unit (motion vector derivation device).

[0092] If merge_flag is 1, i.e., indicates merge prediction mode, merge_idx is derived and output to the merge prediction parameter derivation unit 3036.

[0093] If merge_flag is 0, i.e., indicates AMVP prediction mode, the AMVP prediction parameter derivation unit 3032 derives mvpLX from inter_pred_idc, refIdxLX or mvp_LX_idx.

[0094] If GPM_flag is 1, that is, if the target block is encoded in GPM prediction mode, the GPM prediction unit 30377 derives the GPM prediction parameters. The derivation of GPM_flag will be described later.

[0095] (MV addition section) The MV adder 3038 adds the derived mvpLX and mvdLX to derive mvLX.

[0096] (Merge prediction) The merge prediction parameter derivation unit 3036 comprises a merge candidate derivation unit 30361 and a merge candidate selection unit 30362. The merge candidates are composed of prediction parameters (predFlagLX, mvLX, refIdxLX) and are stored in a merge candidate list. An index is assigned to the merge candidates stored in the merge candidate list according to a predetermined rule.

[0097] The merge candidate derivation unit 30361 derives merge candidates using the decoded motion vectors and refIdxLX of adjacent blocks as they are. In addition, the merge candidate derivation unit 30361 may apply spatial merge candidate derivation processing, temporal merge candidate derivation processing, etc., as described later.

[0098] As part of the spatial merge candidate derivation process, the merge candidate derivation unit 30361 reads the prediction parameters stored in the prediction parameter memory 307 according to predetermined rules and sets them as merge candidates. For example, it reads the prediction parameters for the positions A1, B1, B0, A0, and B2 below.

[0099] A1: (xCb-1, yCb+cbHeight-1) B1: (xCb+cbWidth-1, yCb-1) B0: (xCb+cbWidth, yCb-1) A0: (xCb-1, yCb+cbHeight) B2: (xCb-1, yCb-1) Let the top-left coordinates of the target block be (xCb, yCb), the width be cbWidth, and the height be cbHeight.

[0100] As part of the time merge derivation process, the merge candidate derivation unit 30361 reads the predicted parameters of block C in the reference image, including the coordinates of the lower right CBR or the center of the target block, from the predicted parameter memory 307 to use as merge candidate Col, and stores it in the merge candidate list mergeCandList[]. ru.

[0101] The order in which the mergeCandList[] is stored is, for example, spatial merge candidates (B1, A1, B0, A0, B2) followed by temporal merge candidates (Col). Note that reference blocks that are unavailable (e.g., blocks that are intra-predicted) are not stored in the merge candidate list. i = 0 if(availableFlagB1) mergeCandList[i++] = B1 if(availableFlagA1) mergeCandList[i++] = A1 if(availableFlagB0) mergeCandList[i++] = B0 if(availableFlagA0) mergeCandList[i++] = A0 if(availableFlagB2) mergeCandList[i++] = B2 if(availableFlagCol) mergeCandList[i++] = Col Furthermore, you may add the history merge candidate HmvpCand, the average merge candidate avgCand, and the zero merge candidate zeroCandm to mergeCandList[] and use them.

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

[0103] N = mergeCandList[merge_idx] Here, N is a label indicating a merge candidate, and can take the form of A1, B1, B0, A0, B2, Col, etc. The movement information of the merge candidate indicated by label N is shown by (mvLXN[0], mvLXN[1]), predFlagLXN, and refIdxLXN.

[0104] The selected (mvLXN[0], mvLXN[0]), predFlagLXN, and refIdxLXN are selected as interprediction parameters for the target block. The merge candidate selection unit 30362 stores the interprediction parameters of the selected merge candidates in the prediction parameter memory 307 and outputs them to the interprediction image generation unit 309.

[0105] (GPM forecast) GPM prediction is a prediction method used in GPM mode, and generates a predicted image using two non-rectangular prediction units that divide the target CU by line segments. An example of a line segment is shown in Figure 8(a). A line segment spanning the target CU is defined by the angle index angleIdx (angle variable) and distance index distanceIdx (distance variable) shown in Figure 8(b). angleIdx represents the angle φ between the vertical line and the line segment. distanceIdx represents the distance ρ from the center of the target CU to the line segment. angleIdx is an integer value assigned to the angle of the line segment; for example, if 360 degrees is roughly divided into 32 equal parts, the value shown in Figure 8(c) is assigned. Note that in this example, as indicated by "roughly," it is not a perfect division, but rather 360 degrees divided into 32 parts using a square scale (coordinates). Alternatively, 360 degrees could be divided into 64 parts, and a more detailed angle index could be sent.

[0106] In GPM prediction image generation, two "rectangular" prediction images (temporary prediction images) containing non-rectangular prediction units may be derived, and these two rectangular regions may be weighted according to the shape of the prediction units. The motion compensation unit 3091 derives two temporary prediction images of the target CU, and the GPM synthesis unit 30952 performs a weighting process on each pixel of the two temporary prediction images according to the pixel position. This process is used to derive a predicted image. This process is called GPM synthesis. Processes other than prediction (e.g., transformation (inverse transformation) and quantization (inverse quantization)) are applied to the entire target CU.

[0107] The GPM prediction unit 30377 derives prediction parameters for two non-rectangular regions and supplies them to the inter-prediction image generation unit 309. In GPM prediction, a configuration without dual prediction is also possible to simplify processing. In this case, inter-prediction parameters for unidirectional prediction are derived for the non-rectangular regions.

[0108] (Decoding of syntax elements in GPM prediction) Figure 7 shows the syntax configuration notified by merge_data(). The parameter decoding unit 302 decodes the syntax elements in the encoded data, and the GPM prediction unit 30377 (inter-prediction parameter derivation unit 303) derives the parameters for GPM prediction.

[0109] general_merge_flag is a flag that indicates whether or not to use merge mode, and is notified when the target block is not in skip mode. If it is in skip mode, the inter-prediction parameter derivation unit 303 sets general_merge_flag=1.

[0110] If ciip_flag is 0, the parameter decoding unit 302 (CU decoding unit 3022) decodes the GPM prediction syntax elements merge_gpm_partition_idx, merge_gpm_idx0, and merge_gpm_idx1. Alternatively, merge_gpm_partition_idx and merge_gpm_idx0 may be decoded, and merge_gpm_idx1 may be decoded if MaxNumGpmMergeCand > 2. merge_gpm_partition_idx (mergeGpmPartitionIdx) is an index (partition index) that indicates the partition pattern (mode number) of the GPM prediction mode. The partition index indicates a combination of angleIdx and distanceIdx that identifies the linear segment spanning the target block in order to divide the target block into two regions. The motion information used for generating the prediction image of the GPM prediction is the merge candidate. merge_gpm_idx0 and merge_gpm_idx1 are merge candidate indices that represent motion information for two regions, respectively. The number of partition index options (number of partition patterns, number of GPM modes) is NumGPMFull, and merge_gpm_partition_idx takes any integer value between 0 and NumGPMFull-1 (=63). Hereinafter, the parameters that indicate the shape for deriving the predicted image of the GPM prediction will be called GPM parameters. The GPM parameter may be merge_gpm_partition_idx (mergeGpmPartitionIdx), or it may be a pair of angleIdx and distanceIdx.

[0111] MergeGpmFlag is a flag that indicates whether or not to perform GPM prediction on the target block. If at least the following conditions (GPM determination conditions) are met, the GPM prediction unit 30377 sets MergeGpmFlag=1 (GPM prediction on), otherwise the GPM prediction unit 30377 sets MergeGpmFlag=0. (GPM judgment conditions) ·sps_gpm_enabled_flag=1 ·sps_gpm_lfnst_enabled_flag=1 ·slice_type is B slice ·general_merge_flag=1 cbWidth>=8 and cbHeight>=8 cbWidth < 8 * cbHeight and cbHeight < 8 * cbWidth ·regular_merge_flag=0 · merge_subblock_flag=0 ·ciip_flag=0 The GPM prediction unit 30377 outputs the derived parameters to the GPM synthesis unit 30952.

[0112] (Motion information derivation process in GPM forecasting) The GPM prediction unit 30377 uses the following syntax to indicate motion information for two non-rectangular regions. Derive merge indices m and n from merge_gpm_idx0 and merge_gpm_idx1.

[0113] m = merge_gpm_idx0 n = merge_gpm_idx1 + (merge_gpm_idx1 >= m) ? 1 : 0 In the following, the merge candidate pointed to by merge index m is shown as M, and the merge candidate pointed to by merge index n is shown as N.

[0114] The merge prediction parameter derivation unit 3036 derives motion information (mvLXM, mvLXN, refIdxLXM, refIdxLXN, predFlagLXM, predFlagLXN, bcwIdx, mergeCandList, etc.) for merge candidates M and N using the method described in (Merge Prediction). The GPM prediction unit 30377 uses this motion information to set the motion vectors mvA and mvB for merge_gpm_idx0 and merge_gpm_idx1, the reference indices refIdxA and refIdxB, and the prediction list flags predListFlagA and predListFlagB as follows.

[0115] mvA[0] = mvLXM[0] mvA[1] = mvLXM[1] refIdxA = refIdxLXM predListFlagA = X Here, the GPM prediction unit 30377 sets the lower bit of m to X (m & 0x01). If predFlagLXM is 0, the GPM prediction unit 30377 sets X to (1-X).

[0116] mvB[0] = mvLXN[0] mvB[1] = mvLXN[1] refIdxB = refIdxLXN predListFlagB = X Here, the GPM prediction unit 30377 sets X to the lower bit of n (n & 0x01). If predFlagLXN is 0, the GPM prediction unit 30377 sets X to (1-X).

[0117] This motion information is referenced to generate a transient prediction image of two non-rectangular regions.

[0118] The GPM prediction unit 30377 derives angleIdx and distanceIdx corresponding to merge_gpm_partition_idx (mergeGpmPartitionIdx) according to the table shown in Figure 9.

[0119] (Storage of motion vectors in GPM prediction) The GPM prediction unit 30377 processes the motion vectors (mvA, mvB) of non-rectangular regions A and B and the reference picture information (predFlagA, prefFlagB, refIdxLA, Store refIdxLB) in memory in 4x4 subblock units.

[0120] The following describes the processes common to both the first and second examples.

[0121] numSbX and numSbY are the number of 4x4 subblocks in the horizontal and vertical directions of the target block, respectively. The GPM prediction unit 30377 sets numSbX = cbWidth >> 2 and numSbY = cbHeight >> 2. The GPM prediction unit 30377 derives the variables displacementX, displacementY, isFlip, and shiftHor as follows.

[0122] TDX = angleIdx displacementY = (angleIdx + 8) % 32 isFlip = (angleIdx>=13 && angleIdx<=27) ? 1 : 0 shiftHor = (angleIdx%16==8 || (angleIdx%16!=0 && cbHeight>=cbWidth)) ? 0 : 1 If shiftHor is 0, the GPM prediction unit 30377 derives offsetX and offsetY as follows.

[0123] offsetX = (-cbWidth) >> 1 offsetY = ((-cbHeight) >> 1) + ((angleIdx<16) ? (distanceIdx * cbHeight) >> 3 : -((distanceIdx * cbHeight) >> 3)) If shiftHor is 1, the GPM prediction unit 30377 derives offsetX and offsetY as follows.

[0124] offsetX = ((-cbWidth) >> 1) + ((angleIdx<16) ? (distanceIdx * cbWidth) >> 3 : -((distanceIdx * cbWidth) >> 3)) offsetY = (-cbHeight) >> 1 The GPM prediction unit 30377 performs the following processing for each position (xSbIdx, ySbIdx) of a 4x4 subblock where xSbIdx = 0..numSbX-1 and ySbIdx = 0..numSbY-1.

[0125] The GPM prediction unit 30377 calculates motionIdx using the disLut shown in Figure 9 as follows.

[0126] motionIdx = (((4 * xSbIdx + offsetX) << 1) + 5) * disLut[displacementX] + (((4 * ySbIdx + offsetY) << 1) + 5) * disLut[displacementY] The GPM prediction unit 30377 derives sType as follows:

[0127] sType = (abs(motionIdx)<32) ? 2 : ((motionIdx<=0) ? (1-isFlip) : isFlip) If sType is 0, the GPM prediction unit 30377 performs the following:

[0128] If the prediction list flag for A is 0 (predListFlagA==0), the GPM prediction unit 30377 stores the motion vector of A in L0 as a unidirectional prediction. If the prediction list flag for A is not 0 (predListFlagA!=0), the GPM prediction unit 30377 stores the motion vector of A in L1 as a unidirectional prediction.

[0129] predFlagL0 = (predListFlagA==0) ? 1 : 0 predFlagL1 = (predListFlagA==0) ? 0 : 1 refIdxL0 = (predListFlagA==0) ? refIdxA : -1 refIdxL1 = (predListFlagA==0) ? -1 : refIdxA mvL0[0] = (predListFlagA==0) ? mvA[0] : 0 mvL0[1] = (predListFlagA==0) ? mvA[1] : 0 mvL1[0] = (predListFlagA==0) ? 0 : mvA[0] mvL1[1] = (predListFlagA==0) ? 0 : mvA[1] If, instead, sType is 1, or sType is 2 and predListFlagA + predListFlagB is not 1, the GPM prediction unit 30377 performs the following: Here, predListFlagA + predListFlagB being not 1 means that the reference picture lists A and B are the same.

[0130] If the prediction list flag for B is 0 (predListFlagB==0), the GPM prediction unit 30377 stores the motion vector of B in L0 as a unidirectional prediction. If the prediction list flag for B is not 0 (predListFlagB!=0), the GPM prediction unit 30377 stores the motion vector of B in L1 as a unidirectional prediction.

[0131] predFlagL0 = (predListFlagB==0) ? 1 : 0 predFlagL1 = (predListFlagB==0) ? 0 : 1 refIdxL0 = (predListFlagB==0) ? refIdxB : -1 refIdxL1 = (predListFlagB==0) ? -1 : refIdxB mvL0[0] = (predListFlagB==0) ? mvB[0] : 0 mvL0[1] = (predListFlagB==0) ? mvB[1] : 0 mvL1[0] = (predListFlagB==0) ? 0 : mvB[0] mvL1[1] = (predListFlagB==0) ? 0 : mvB[1] Otherwise (when sType is 2 and predListFlagA + predListFlagB is 1), the GPM prediction unit 30377 performs the following. Here, predListFlagA + predListFlagB being 1 indicates that the reference picture lists of A and B are different.

[0132] If the prediction list flag for A is 0 (predListFlagA==0), the GPM prediction unit 30377 sets the prediction to bidirectional, storing A's motion vector in L0 and B's motion vector in L1. If the prediction list flag for A is not 0 (predListFlagA!=0), the GPM prediction unit 30377 sets the prediction to bidirectional, storing B's motion vector in L0 and A's motion vector in L1.

[0133] predFlagL0 = 1 predFlagL1 = 1 refIdxL0 = (predListFlagA==0) ? refIdxA : refIdxB refIdxL1 = (predListFlagA==0) ? refIdxB : refIdxA mvL0[0] = (predListFlagA==0) ? mvA[0] : mvB[0] mvL0[1] = (predListFlagA==0) ? mvA[1] : mvB[1] mvL1[0] = (predListFlagA==0) ? mvB[0] : mvA[0] mvL1[1] = (predListFlagA==0) ? mvB[1] : mvA[1] (Processing of GPM prediction and GPM synthesis) Figure 10 is a flowchart showing the processing flow for GPM prediction and GPM synthesis. Below, we will explain the processing flow assuming that all the conditions for setting MergeGpmFlag=1 (GPM prediction on) as described above are met.

[0134] In S3501, the parameter decoding unit 302 decodes the syntax elements related to the GPM notified by merge_data() or the like.

[0135] In S3502, the GPM prediction unit 30377 derives MergeGpmFlag and determines whether MergeGpmFlag is 1 or not.

[0136] If MergeGpmFlag is not 1 in S3502, in S3506 the GPM prediction unit 30377 turns off GPM prediction and terminates processing.

[0137] In S3502, if MergeGpmFlag is 1, the GPM prediction unit 30377 performs GPM prediction processing, and the GPM synthesis unit 30952, described later, performs GPM synthesis processing.

[0138] In S3503, the GPM prediction unit 30377 derives prediction parameters such as motion information. The motion compensation unit 3091, described later, uses the motion information to generate two temporary prediction images, predSamplesLA and predSamplesLB.

[0139] In S3504, the GPM synthesis unit 30952 derives the weight coefficient wValue and generates a predicted image.

[0140] In S3505, the GPM prediction unit 30377 stores the motion vector in memory.

[0141] In the GPM prediction described above, a predicted image is generated by using weights that indicate the shape of the prediction unit for two predicted images with different motion parameters.

[0142] (Example of GPM mode number prediction) The following describes a method for predicting the GPM of a target block using the GPM parameters of an adjacent block (for example, the block above or to the left of the target block). Figure 19 shows the GPM of adjacent blocks. This figure shows the PM division line and candidate GPM division lines in the target block. Since the boundaries (edges) of an object are continuous, if the GPM division line of an adjacent block intersects with the target block, the target block is likely to have an edge passing through that intersection point. In other words, as shown in Figure 19(a), the edges intersect on the target block and become continuous. In addition, as shown in Figure 19(b), edges may also be continuous across blocks. In this embodiment, we describe a configuration that predicts the GPM division pattern (GPM mode number) of the target block from the intersection point of the division lines of the surrounding GPM predictions and the target block.

[0143] The following describes a method for predicting the GPM mode number of a target block from the GPM parameters of adjacent blocks. This allows for GPM prediction while reducing the amount of code required for GPM parameters, resulting in improved coding efficiency.

[0144] (Decoding of syntax elements in an example of GPM mode number prediction) (Basic syntax structure) Figures 11(a) to 11(c) show an example of a syntax configuration that transmits the GPM parameters of a target block using the GPM parameters of an adjacent block. In this example, GPM prediction may be used when merge mode is active and ciip_flag is 0, and the GPM parameters may be transmitted. Figure 11(a) is an example of a syntax configuration that switches between transmitting merge_gpm_angle_idx (hereinafter referred to as the small-range syntax) or merge_gpm_partition_idx (hereinafter referred to as the full-range syntax) depending on the state of the GPM parameters of the adjacent block. merge_gpm_angle_idx is a shortened syntax with a smaller value range than the full-range syntax. merge_gpm_partition_idx is the full-range syntax.

[0145] As shown in the figure, the parameter decoding unit 302 derives a variable mergeGpmAvailableNeighbor that indicates whether GPM information for the adjacent block is available or not. If mergeGpmAvailableNeighbor is valid (e.g., 1), it decodes merge_gpm_angle_idx. Otherwise (if mergeGpmAvailableNeighbor is invalid (e.g., 0)), the parameter decoding unit 302 decodes merge_gpm_partition_idx. Here, merge_gpm_angle_idx is a syntax element that indicates the angle of the partition line. merge_gpm_angle_idx can take any integer value between 0 and 9, but is not limited to this. As another example, it may take a value between 0 and 7. merge_gpm_partition_idx is an index that indicates the GPM parameters (angle and distance). The syntax elements that the parameter decoding unit 302 decodes from here on have already been explained and are therefore omitted. The maximum value cMax that merge_gpm_angle_idx can take (e.g., 9) is less than the cMax of merge_gpm_partition_idx (e.g., 63). Binaryization of merge_gpm_angle_idx may use a TB binary with cMax (see below). merge_gpm_partition_idx may also use an FB binary (see below).

[0146] An image decoding device comprising a parameter decoding unit that decodes the GPM parameters of a target block from encoded data, and a prediction unit that derives a predicted image from two predicted images and weights, wherein the parameter decoding unit decodes different parameters depending on the GPM parameters of adjacent blocks, the prediction unit includes a process of deriving the GPM parameters of the target block from the GPM parameters of adjacent blocks, and the prediction unit derives weights based on the above GPM parameters and uses those weights to derive a predicted image.

[0147] As described above, the coding complexity is reduced by switching the syntax elements of the GPM parameters to be encoded or decoded depending on the state of the surrounding GPM mode parameters. In addition to the basic configuration described above, the following modifications can also be used.

[0148] (Variation 1: Configuration using merge_gpm_mpm_flag) Figure 11(b) shows how the additional flag merge_gpm_mpm_flag is further encoded and decoded, resulting in either a small-range syntax merge_gpm_angle_idx or a full-range syntax merge_gpm_angle_idx depending on the state of the GPM parameters in the adjacent block. This is an example of a syntax configuration that switches whether or not to transmit the merge_gpm_partition_idx syntax.

[0149] As shown in the figure, the parameter decoding unit 302 decodes merge_gpm_mpm_flag when the variable mergeGpmAvailableNeighbor is 1. merge_gpm_mpm_flag is a syntax element that indicates whether or not to perform GPM mode number prediction on the target block. If merge_gpm_mpm_flag is 1, it indicates that GPM mode number prediction will be performed, and if it is 0, it indicates that GPM mode number prediction will not be performed. If mergeGpmAvailableNeighbor is 0, merge_gpm_mpm_flag is not decoded and is set to 0. The parameter decoding unit 302 decodes merge_gpm_angle_idx, which is a syntax element that indicates the angle of the partition line, when merge_gpm_mpm_flag is 1. On the other hand, if merge_gpm_mpm_flag is 0, the parameter decoding unit 302 decodes merge_gpm_partition_idx, similar to the case where mergeGpmAvailableNeighbor==0.

[0150] In this configuration, the syntax elements to be encoded and decoded are switched according to the parameter state of the surrounding GPM modes. Furthermore, the additional flag merge_gpm_mpm_flag can be used to switch between a GPM mode with limited possible patterns and a GPM mode that can take on a variety of patterns. This achieves the effects of both code reduction and diverse prediction.

[0151] (Variation 2: Configuration 2 using merge_gpm_mpm_flag) Modification 2 describes an example in which a list of predicted GPM mode numbers (candGPMList) is derived and used. Figure 11(c) is an example of a syntax configuration that switches between transmitting the small-range syntax merge_gpm_mpm_flag or the full-range syntax merge_gpm_partition_idx depending on the state of the GPM parameters of the adjacent block.

[0152] As shown in the figure, the parameter decoding unit 302 decodes merge_gpm_mpm_flag if the variable mergeGpmAvailableNeighbor is 1. The parameter decoding unit 302 decodes mpm_merge_gpm_partition_idx if merge_gpm_mpm_flag is 1. mpm_merge_gpm_partition_idx is a syntax element that indicates which candidate to use from the list (candGPMList) which holds multiple GPM mode numbers that are likely to be used. On the other hand, if merge_gpm_mpm_flag is 0, the parameter decoding unit 302 decodes remainder_merge_gpm_partition_idx. remainder_merge_gpm_partition_idx is a syntax element that indicates which mode number to use from among the mode numbers other than those in candGPMList. The method for deriving partition modes using mpm_merge_gpm_partition_idx and remainder_merge_gpm_partition_idx is described in (GPM mode number prediction using candGPMList).

[0153] The parameter decoding unit 302 directly decodes merge_gpm_partition_idx if mergeGpmAvailableNeighbor is 0.

[0154] In the following embodiment, the GPM mode number of the target block is derived as the variable mergeGpmPartitionIdx, and angleIdx and distanceIdx are derived using mergeGpmPartitionIdx. When the parameter decoding unit 302 decodes merge_gpm_partition_idx, it may set it to mergeGpmPartitionIdx.

[0155] mergeGpmPartitionIdx = merge_gpm_partition_idx Conversely, if the parameter decoding unit 302 does not decode merge_gpm_partition_idx, it derives mergeGpmPartitionIdx (described later).

[0156] The parameter decoding unit 302 (CU decoding unit 3022) may perform binary conversion (binary representation) of syntax elements such as merge_gpm_angle_idx and remainder_merge_gpm_partition_idx, for example, using truncated binary (TB) (TB binary). TB is a binaryization method in which the upper limit cMax of the possible values ​​of syntax elements is defined.

[0157] (Example of a TB binary) The TB binary can also be derived as follows:

[0158] n = cMax + 1 k = Floor(Log2(n)) u = (1 << (k + 1)) - n When the value synVal of the syntax element (here merge_gpm_partition_idx) is less than u, the parameter decoding unit 302 derives the TB binary in FixedLength binary (hereinafter FL binary) using cMax = (1 << k)-1. Otherwise (when synVal is greater than or equal to u), cMax = (1 << (k + 1))-1 is set. [[ID=S1]] [[ID=S2]]

[0159] [[ID=S3]] Note that when deriving the FL binary, the parameter decoding unit 302 may derive the BIN length fixedLength of the syntax element and derive it by expressing synVal in binary with fixedLength bits. [[ID=S5]] [[ID=S6]]

[0160] [[ID=S7]] fixedLength = Ceil(Log2(cMax + 1))[[ID=S9]] Also, the parameter decoding unit 302 may perform binaryization of mpm_merge_gpm_partition_idx using truncated Rice (TR) with cMax determined and the Rice parameter set to 0 (TR binary). For example, when mpm_merge_gpm_partition_idx takes values from 0 to 5 and one is selected from six candidates, the value of mpm_merge_gpm_partition_idx is encoded as an encoded bit string of up to 5 bits (binary values: 0, 10, 110, 1110, 11110, 11111). [[ID=S11]] [[ID=S12]]

[0161] [[ID=S13]] (Example of deriving mergeGpmAvailableNeighbor)[[ID=S15]] The above mergeGpmAvailableNeighbor is a variable derived from the GPM parameters of adjacent blocks and indicates whether it is possible to use the GPM information of adjacent blocks. [[ID=S17]] [[ID=S18]]

[0162] [[ID=S19]] The parameter decoding unit 302 may derive mergeGpmAvailableNeighbor using the GPM mode number GpmModeA of the upper adjacent block, the GPM mode number GpmModeL of the left adjacent block, and a predetermined table. mergeGpmAvailableNeighbor may also be determined by whether the GPM division line in the adjacent block intersects with the target block.

[0163] For example, the parameter decoding unit 302 derives mergeGpmAvailableNeighbor using the tables crstblNeighborForAbove in Figure 12 and crstblNeighborForLeft in Figure 13. crstblNeighborForAbove is a table that derives the x-coordinate of the intersection point between the dividing line and the target block from the block size and GPM mode number for the upper adjacent block. crstblNeighborForLeft is a table that derives the y-coordinate of the intersection point from the block size and GPM mode number for the left adjacent block.

[0164] The following process may be used to determine whether or not it is possible to use the upper adjacent block NA. The top-left coordinate of NA is denoted as (xNA, yNA), the width of NA as widthA, the height as heightA, and the GPM mode number as GpmModeA. In this case, the parameter decoding unit 302 derives the width index wIdxA and the height index hIdxA as follows.

[0165] wIdxA = log2(widthA) - 2 hIdxA = log2(heightA) - 2 Note that wIdxA and hIdxA may also be the difference between the cbWidth and cbHeight of the target block.

[0166] wIdxA = log2(widthA) - log2(cbWidth) hIdxA = log2(heightA) - log2(cbHeight) To prevent the relative size from becoming less than 0, you may do the following:

[0167] wIdxA = log2(widthA) - log2(cbWidth) + Log2GPMBlkSize hIdxA = log2(heightA) - log2(cbHeight) + Log2GPMBlkSize Furthermore, clipping may be made to a value between 0 and a predetermined maximum value.

[0168] Here, Log2GPMBlkSize is a predetermined constant (4, 5, 6, 7, 8, etc.). For example, if the maximum size of the block used in GPM is 128, then Log2BlkSize = log2(128) = 7 is also acceptable. The direction of the difference can also be reversed.

[0169] wIdxA = log2(cbWidth) - log2(widthA) + Log2GPMBlkSize hIdxA = log2(cbHeight) - log2(heightA) + Log2GPMBlkSize The parameter decoding unit 302 derives the x-coordinate (xTmp) of the intersection point using crstblNeighborForAbove[hIdxA][wIdxA][GpmModeA]. In this case, if the top-left coordinate of NA is (xNA, yNA), then the coordinate of the intersection point is (xNA+xTmp, yNA+heightA). xTmp is the distance from the left edge of NA. If the top-left coordinate of NA (xNA, yNA) is taken as the reference (0,0), then the coordinate of the intersection point can also be written as (xTmp, heightA). Alternatively, if the top-left coordinate of the target block is (xCb, yCb), then the coordinate of the intersection point can be derived as (xNA-xCb+xTmp, yCb). If the top-left coordinate (xCb, yCb) is taken as the reference (0,0), then the coordinate of the intersection point can also be written as (xNA+xTmp, 0). Based on the above explanation, if we take the upper-left coordinate (xCb, yCb) as the reference (0,0) and represent the x-coordinate of this intersection as x0, we can derive whether or not it is possible to use the GPM information of the upper adjacent block using the following (Condition 1).

[0170] (Condition 1) The upper adjacent block is available, x0 is 0 or greater, and x0 is less than or equal to the width of the target block. In other words, mergeGpmAvailableAbove = availableAbove && x0 >= 0 && x0 <= cbWidth `availableAbove` is a flag that indicates whether the upper block is available or not; it is 1 (true) if it is available and 0 (false) if it is not available.

[0171] The parameter decoding unit 302 may also directly derive mergeGpmAvailableAbove from the relative size of the target block and the upper adjacent block, or from the sizes hIdxA, wIdxA of the upper adjacent blocks, GpmModeA, and the table gpmNeighborForAbove. mergeGpmAvailableAbove = gpmNeighborForAbove[hIdxA][wIdxA][GpmModeA] The table can also be derived as follows.

[0172] gpmNeighborForAbove[hIdxA][wIdxA][GpmModeA] = crstblNeighborForAbove[hIdx][wIdx][GpmModeA] >= 0 && crstblNeighborForAbove[hIdxA][wIdxA][GpmModeA] <= TH Here, TH is a predetermined value. Alternatively, the table can be derived as follows.

[0173] gpmNeighborForAbove[hIdxA][wIdxA][GpmModeA] = crstblNeighborForAbove[hIdxA][wIdxA][GpmModeA] + 1 Similarly, the left adjacent block NL may also be determined to be usable. The top-left coordinates of NL are denoted as (xNL, yNL), the width of NL as widthL, the height as heightL, and the GPM mode number as GpmModeL. In this case, the parameter decoding unit 302 derives the width index wIdx and the height index hIdxL as follows.

[0174] wIdxL = log2(widthL) - 2 hIdxL = log2(heightL) - 2 Note that wIdx and hIdx may also be the difference between the cbWidth and cbHeight of the target block.

[0175] wIdxL = log2(widthL) - log2(cbWidth) hIdxL = log2(heightL) - log2(cbHeight) To prevent the relative size from becoming less than 0, you may do the following: Alternatively, you may perform the clipping described above.

[0176] wIdxL = log2(widthL) - log2(cbWidth) + Log2GPMBlkSize hIdxL = log2(heightL) - log2(cbHeight) + Log2GPMBlkSize The parameter decoding unit 302 derives the y-coordinate (yTmp) of the intersection point using crstblNeighborForLeft[hIdxL][wIdxL][GpmModeL]. In this case, if the top-left coordinate of NL is (xNL, yNL), then the coordinates of the intersection point are (xNL+widthL, yNL+yTmp). yTmp is the distance from the top end of NL. If the top-left coordinate of NL (xNA, yNA) is taken as the reference (0,0), then the coordinates of the intersection point can also be written as (widthL,yTmp). Alternatively, if the top-left coordinate of the target block is (xCb, yCb), then the coordinates of the intersection point can be derived as (xCb, yNL-yCb+yTmp). If the top-left coordinate (xCb, yCb) is taken as the reference (0,0), then the coordinates of the intersection point can also be written as (0, yNL+yTmp). Based on the above explanation, if we take the top-left coordinate (xCb, yCb) as the reference (0,0) and represent the y-coordinate of this intersection as y0, we can derive whether or not it is possible to use the GPM information of the adjacent block to the left using the following (Condition 2).

[0177] (Condition 2) The adjacent block on the left is available, and y0 is 0 or greater, and y0 is less than or equal to the height of the target block.

[0178] mergeGpmAvailableLeft = availableLeft && y0 >= 0 && y0 <= cbHeight `availableLeft` is a flag that indicates whether the left-hand block is available or not; it is 1 (true) if it is available and 0 (false) if it is not available.

[0179] The parameter decoding unit 302 may also directly derive mergeGpmAvailableLeft from the relative size of the target block and the left adjacent block, or from the sizes hIdxL, wIdxL of the left adjacent block, GpmModeL, and the table gpmNeighborForLeft. mergeGpmAvailableLeft = gpmNeighborForLeft[hIdxL][wIdxL][GpmModeL] The table can also be derived as follows.

[0180] gpmNeighborForLeft[hIdxL][wIdxL][GpmModeL] = crstblNeighborForLeft[hIdxL][wIdxL][GpmModeL] >= 0 && crstblNeighborForLeft[hIdxL][wIdxL][GpmModeL] <= TH Here, TH is a predetermined value. Alternatively, the table can be derived as follows.

[0181] gpmNeighborForLeft[hIdxL][wIdxL][GpmModeL] = crstblNeighborForLeft[hIdxL][wIdxL][GpmModeL] + 1 The parameter decoding unit 302 may set mergeGpmAvailableNeighbor to 1 if either (condition 1) or (condition 2) is met. This can be expressed as follows:

[0182] mergeGpmAvailableNeighbor = mergeGpmAvailableAbove || mergeGpmAvailableLeft Note that the above || can also be replaced with +.

[0183] As described above, a table that associates the size of adjacent blocks, the GPM prediction mode number of adjacent blocks, and the coordinate position of the intersection may be used to derive the intersection point. Alternatively, as noted, a table that includes the determination of the coordinate position of the intersection point may be used.

[0184] (Summary of derivation examples for mergeGpmAvailableNeighbor) To summarize what has already been explained, the parameter decoding unit 302 may derive mergeGpmAvailableNeighbor as follows.

[0185] mergeGpmAvailableNeighbor = gpmNeighborForAbove[hIdxA][wIdxA][GpmModeA] || gpmNeighborForLeft[hIdxL][wIdxL][GpmModeL] (Process flow for predicting the GPM mode number of the target block) Figures 17 and 18 are flowcharts showing the process flow for predicting the GPM mode number of the target block.

[0186] In S3501, the parameter decoding unit 302 decodes the syntax elements related to the GPM notified in the merge data or the like.

[0187] In S3502, the GPM prediction unit 30377 derives MergeGpmFlag and determines whether MergeGpmFlag is 1 or not.

[0188] If MergeGpmFlag is not 1 in S3502, in S3506 the GPM prediction unit 30377 turns off GPM prediction and terminates processing.

[0189] In S3502, if MergeGpmFlag is 1, S3507 determines whether or not to predict the GPM mode number of the target block. As a condition for determination, in the case of the syntax element shown in Figure 11(a), mergeGpmAvailableNeighbor is derived as shown in Figure 17, and it is determined whether or not mergeGpmAvailableNeighbor is 1. Also, in the case of the syntax element shown in Figure 11(b), it is determined whether or not merge_gpm_mpm_flag is 1 as shown in Figure 18.

[0190] If the GPM mode number prediction for the target block is not performed in S3507, the process proceeds to S3503.

[0191] If the GPM mode number of the target block is predicted in S3507, the GPM mode prediction process for the target block is performed in S3508.

[0192] The subsequent processing is the same as in Figure 10, so the explanation will be omitted.

[0193] In this embodiment, the GPM prediction unit 30377 may derive angleIdx and distanceIdx using the predicted GPM mode number mergeGpmPartitionIdx instead of gpm_partition_idx decoded from the encoded data, and generate a predicted image from weight processing corresponding to the predicted shape. In this case, the GPM prediction unit 30377 may derive angleIdx and distanceIdx using a table that associates mergeGpmPartitionIdx with angleIdx and distanceIdx, as shown in Figure 9(c).

[0194] The following describes how to derive the GPM mode number of the target block from merge_gpm_angle_idx, which is decoded in the syntax structures of Figure 11(a) and Figure 11(b). It also describes how to derive the GPM mode number of the target block from mpm_merge_gpm_partition_idx, which is decoded in the syntax configuration of Figure 11(c).

[0195] (GPM mode number prediction using merge_gpm_angle_idx) The GPM prediction unit 30377 in this embodiment derives the GPM mode number of the target block by the following process.

[0196] First, the GPM prediction unit 30377 derives mergeGpmAvailableAbove and mergeGpmAvailableLeft of the intersection points using the same method as described above.

[0197] If mergeGpmAvailableAbove is 1, the GPM prediction unit 30377 uses the intersection x0 to determine the target block The GPM mode number of the block is predicted. If mergeGpmAvailableAbove is 0 and mergeGpmAvailableLeft is 1, the GPM prediction unit 30377 uses the intersection y0 to predict the GPM mode number of the target block. In the above example, when both mergeGpmAvailableAbove and mergeGpmAvailableLeft are 1, the upper adjacent block is prioritized, but a configuration prioritizing the left adjacent block is also possible.

[0198] (When using the upper adjacent block (intersection x0)) The GPM prediction unit 30377 derives angleIdx using merge_gpm_angle_idx and the table shown in Figure 16. Figure 16(a) is the table for deriving angleIdx when merge_gpm_angle_idx takes a value between 0 and 9. Figure 16(b) is the table for deriving angleIdx when merge_gpm_angle_idx takes a value between 0 and 7.

[0199] The GPM prediction unit 30377 sequentially searches for possible values ​​for the GPM mode number (0 to NumGPMFull-1 (=63)). First, it extracts mode number i from the GPM modes whose angle matches angleIdx or angleIdx+16. If there are multiple i values, the i that minimizes the distance between x1 and x0, the intersection points with the upper adjacent block obtained by the dividing line of the target block, is selected as the GPM mode of the target block. Here, crstblCurrForAbove in Figure 14 is a table that derives the x-coordinate of the intersection point between the dividing line and the upper adjacent block from the block size and GPM mode number in the target block. The pseudocode for the above process is shown below. cbWidth and cbHeight are the width and height of the target block. Also, g_GeoParams is a table as shown in Figure 9, and is used to derive angleIdx and distanceIdx from the GPM mode number. MAX_INT is the maximum value of an integer (for example, for a 32-bit signed integer, 1 << 31 - 1). (start) The angleIdx is derived from merge_gpm_angle_idx and the table in Figure 16. wIdxA = log2(cbWidth) - 2 hIdxA = log2(cbHeight) - 2 minDis = MAX_INT finalCurrGpmMode = -1 for (i = 0; i < NumGPMFull; i++) tmpAngleIdx = g_GeoParams[i][0] if (tmpAngleIdx == angleIdx || tmpAngleIdx == angleIdx + 16) x1 = crstblCurrForAbove[hIdxA][wIdxA][i] if (Abs(x0-x1) < minDis) minDis = Abs(x0-x1) finalCurrGpmMode = i mergeGpmPartitionIdx = finalCurrGpmMode (end) Finally, the value stored in finalCurrGpmMode is set as the GPM mode number (mergeGpmPartitionIdx) of the target block.

[0200] (When using the adjacent block on the left (intersection y0)) The GPM mode number of the target block is predicted using the same procedure as for the upper adjacent block.

[0201] The GPM prediction unit 30377 derives angleIdx using merge_gpm_angle_idx and the table shown in Figure 16.

[0202] The GPM prediction unit 30377 sequentially searches for possible values ​​(0 to NumGPMFull-1 (=63)) as the GPM mode number. First, it extracts mode number i from the GPM modes whose angle matches angleIdx or angleIdx+16. If there are multiple i, it selects the i that minimizes the distance between the intersection points y1 and y0 of the target block and the adjacent block to the left, obtained by the dividing line of the target block, and determines the GPM mode of the target block. Let's assume it's D. Here, crstblCurrForLeft in Figure 15 is a table that derives the y-coordinate of the intersection point between the dividing line and the left adjacent block from the block size and GPM mode number in the target block. The pseudocode for the above process is shown below. (start) The angleIdx is derived from merge_gpm_angle_idx and the table in Figure 18. wIdxL = log2(cbWidth) - 2 hIdxL = log2(cbHeight) - 2 minDis = MAX_INT finalCurrGpmMode = -1 for (i = 0; i < NumGPMFull; i++) tmpAngleIdx = g_GeoParams[i][0] if (tmpAngleIdx == angleIdx || tmpAngleIdx == angleIdx + 16) y1 = crstblCurrForLeft[hIdxL][wIdxL][i] if (Abs(y0-y1) < minDis) minDis = Abs(y0-y1) finalCurrGpmMode = i mergeGpmPartitionIdx = finalCurrGpmMode (end) Finally, the value stored in finalCurrGpmMode is set as the GPM mode number (mergeGpmPartitionIdx) of the target block.

[0203] As described above, when the GPM partition line of an adjacent block intersects with the target block, the partition index (mode number) of the GPM prediction mode of the target block may be derived using the intersection, the partition angle derived from the index indicating the decoded partition angle, the size of the adjacent block, a table associating the GPM prediction mode number with the coordinate position of the intersection, and a table associating the size of the target block with the GPM prediction mode number with the coordinate position of the intersection.

[0204] (GPM mode number prediction using candGPMList) In this embodiment, the GPM prediction unit 30377 derives the GPM mode number of the target block using mpm_merge_gpm_partition_idx, remainder_merge_gpm_partition_idx, and candGPMList.

[0205] First, the GPM prediction unit 30377 derives mergeGpmAvailableAbove and mergeGpmAvailableLeft of the intersection points using the same method as described above.

[0206] If mergeGpmAvailableAbove is 1, the GPM prediction unit 30377 constructs candGPMList using the GPM information of the upper adjacent block. If mergeGpmAvailableAbove is 0 and mergeGpmAvailableLeft is 1, the GPM prediction unit 30377 constructs candGPMList using the GPM information of the left adjacent block. In the above example, when both mergeGpmAvailableAbove and mergeGpmAvailableLeft are 1, the upper adjacent block is prioritized, but a configuration prioritizing the left adjacent block is also possible.

[0207] When merge_gpm_mpm_flag is 1, the GPM prediction unit 30377 derives the GPM mode number of the target block based on candGPMList and the decoded mpm_merge_gpm_partition_idx.

[0208] mergeGpmPartitionIdx = candGPMlist[mpm_merge_gpm_partition_idx] On the other hand, when merge_gpm_mpm_flag is 0, the GPM prediction unit 30377 derives the GPM mode number of the target block based on candGPMList and the decoded remainder_merge_gpm_partition_idx. Here, MaxGPMList is the maximum value of the indices of candGPMList. That is, when the number of GPM's MPMs is NumGPMCand, MaxGPMList = NumGPMCand - 1. At this time, the parameter decoding unit 302 derives mergeGpmPartitionIdx in the following steps. 1) Sort the list. That is, when candGPMList[i] > candGPMList[j] for j = (i + 1)..MaxGPMList (i = 0..MaxGPMList - 1), swap the values at the i-th and j-th positions in the list.

[0209] (candGPMList[i], candGPMList[j]) = Swap(candGPMList[i], candGPMList[j]) 2) Derive mergeGpmPartitionIdx in the next step. i. mergeGpmPartitionIdx = remainder_merge_gpm_partition_idx ii. Increment the value of mergeGpmPartitionIdx by 1. iii. For i = 0..MaxGPMList, if mergeGpmPartitionIdx >= candGPMList[i], increment the value of mergeGpmPartitionIdx by 1.

[0210] In the above steps, the GPM mode number of the target block is derived. Hereinafter, the configuration of candGPMList will be described.

[0211] (Configuration of candGPMList) As the mode numbers constituting candGPMList, the GPM mode numbers passing through the intersection may be preferentially selected. In particular, among those passing through the intersection, the GPM mode numbers having an angle close to the angle of the dividing line of the adjacent block may be preferentially selected. For example, candGPMList may be derived in the following steps.

[0212] 1) The GPM prediction unit 30377 searches for modes in which the difference between the coordinates x0 or y0 of the intersection point and the coordinates x1 or y1 of the intersection point derived using crstblNeighborForAbove and crstblNeighborForLeft is within a specific value (for example, 1), and stores the GPM division modes satisfying the conditions in the array tmpCandList[].

[0213] 2) Among the GPM division modes stored in tmpCandList[], search for the mode having an angleIdx that matches the angle angleIdxN of the dividing line of the adjacent block, and remember the position (assume it is the j-th). 3) Derive candGPMList as follows.

[0214] candGPMList[i++] = tmpCandList[j] candGPMList[i++] = tmpCandList[j - 1] candGPMList[i++] = tmpCandList[j + 1] candGPMList[i++] = tmpCandList[j - 2] candGPMList[i++] = tmpCandList[j+2] Alternatively, the mode numbers that make up candGPMList may be preferentially selected from GPM mode numbers that have an angle close to the angle of the dividing line of an adjacent block, regardless of whether or not they pass through an intersection. In other words, they may be derived as follows.

[0215] candGPMList[i++] = GpmModeA + 1 candGPMList[i++] = GpmModeA - 1 candGPMList[i++] = GpmModeL + 1 candGPMList[i++] = GpmModeL - 1 Furthermore, you may use the modulo operator (mod, where the symbol is %) to ensure that the result falls within the specified range, as shown below.

[0216] candGPMList[i++] = (GpmModeA + 1) % NumGPMFull candGPMList[i++] = (GpmModeA - 1) % NumGPMFull candGPMList[i++] = (GpmModeL + 1) % NumGPMFull candGPMList[i++] = (GpmModeL - 1) % NumGPMFull For example, if the number of partition index options, NumGPMFull, is 64, it can be written as follows:

[0217] candGPMList[i++] = (GpmModeA + 1) % 64 candGPMList[i++] = (GpmModeA - 1) % 64 candGPMList[i++] = (GpmModeL + 1) % 64 candGPMList[i++] = (GpmModeL - 1) % 64 The process may be modified depending on whether the GPM of the adjacent block is available or not.

[0218] if (mergeGpmAvailableAbove) { candGPMList[i++] = (GpmModeA + 1) % NumGPMFull candGPMList[i++] = (GpmModeA - 1) % NumGPMFull } if (mergeGpmAvailableLeft) { candGPMList[i++] = (GpmModeL + 1) % NumGPMFull candGPMList[i++] = (GpmModeL - 1) % NumGPMFull } (Another processing flow for predicting the GPM mode number of the target block) In the above, the GPM mode number prediction process for the target block is performed by the GPM prediction unit 30377. However, the GPM mode number prediction process for the target block may also be performed by the parameter decoding unit 302.

[0219] (Example when the intersection point is not on the target block) (Example of deriving mergeGpmAvailableNeighbor) As shown in Figure 19(b), if the intersection point is not on the target block, mergeGpmAvailableNeighbor may be derived as follows.

[0220] The parameter decoding unit 302 may derive the intersection point using the method already described. That is, for the upper adjacent block, the x-coordinate x0 of the intersection point may be derived using crstblNeighborForAbove, and for the left adjacent block, the y-coordinate y0 of the intersection point may be derived using crstblNeighborForLeft.

[0221] Here, whether it is possible to use the GPM information of the upper adjacent block and the left adjacent block may be derived by the following (Condition 3) and (Condition 4). (Condition 3) The upper adjacent block is available, x0 is 0 or more, and x0 is less than or equal to the width of the upper adjacent block. (Condition 4) The left adjacent block is available, y0 is 0 or more, and y0 is less than or equal to the height of the left adjacent block. That is,[[]] mergeGpmAvailableAbove = availableAbove && x0 >= 0 && x0 <= widthA mergeGpmAvailableLeft = availableLeft && y0 >= 0 && y0 <= height Note that the parameter decoding unit 302 may directly derive mergeGpmAvailableAbove from the relative size of the target block and the upper adjacent block, or the size hIdxA, wIdxA of the upper adjacent block, GpmModeA, and the table gpmNeighborForAbove, or may directly derive mergeGpmAvailableLeft from the relative size of the target block and the left adjacent block, or the size hIdxL, wIdxL of the left adjacent block, GpmModeL, and the table gpmNeighborForLeft.

[0222] mergeGpmAvailableAbove = gpmNeighborForAbove[hIdxA][wIdxA][GpmModeA] mergeGpmAvailableLeft = gpmNeighborForLeft[hIdxL][wIdxL][GpmModeL] And when (Condition 3) or (Condition 4) is satisfied, the parameter decoding unit 302 may set mergeGpmAvailableNeighbor to 1.

[0223] mergeGpmAvailableNeighbor = mergeGpmAvailableAbove || mergeGpmAvailableLeft (GPM mode number prediction using merge_gpm_angle_idx) Furthermore, we will describe how to derive the GPM mode number of the target block when the intersection point does not lie on the target block, as shown in Figure 19(b). In this case, the GPM prediction unit 30377 uses a different table from crstblCurrForAbove or crstblCurrForLeft described above.

[0224] Specifically, when the GPM prediction unit 30377 uses GPM information from an upper adjacent block, it may use a table that associates the size and GPM prediction mode number of the target block with the y-coordinate position of the intersection on the right side of the target block. Alternatively, when the GPM prediction unit 30377 uses GPM information from a left adjacent block, it may use a table that associates the size and GPM prediction mode number of the target block with the x-coordinate position of the intersection on the lower side of the block.

[0225] (Interpretation image generation unit 309) When predMode indicates inter-prediction mode, the inter-prediction image generation unit 309 generates a block or sub-block prediction image by inter-prediction using the inter-prediction parameters input from the inter-prediction parameter derivation unit 303 and a reference picture.

[0226] Figure 4 is a schematic diagram showing the configuration of the inter-predictive image generation unit 309 included in the predictive image generation unit 308 according to this embodiment. The inter-predictive image generation unit 309 is composed of a motion compensation unit (predictive image generation device) 3091 and a synthesis unit 3095. The synthesis unit 3095 is composed of an IntraInter synthesis unit 30951, a GPM synthesis unit 30952, a BIO unit 30954, and a weight prediction unit 3094.

[0227] (Motion compensation) The motion compensation unit 3091 (interpolation image generation unit 3091) generates an interpolated image (motion-compensated image) by reading a reference block from the reference picture memory 306 based on the inter-prediction parameters (predFlagLX, refIdxLX, mvLX) input from the inter-prediction parameter derivation unit 303. The reference block is the block located at a position shifted by mvLX from the position of the target block on the reference picture RefPicLX specified by refIdxLX. If mvLX is not integer precision, a filter called a motion compensation filter is applied to generate pixels at decimal positions, and then the interpolated image is generated.

[0228] The motion compensation unit 3091 first derives the integer position (xInt, yInt) and phase (xFrac, yFrac) corresponding to the coordinates (x, y) within the prediction block using the following formula.

[0229] xInt = xPb+(mvLX[0]>>(log2(MVPREC)))+x xFrac = mvLX[0]&(MVPREC-1) yInt = yPb+(mvLX[1]>>(log2(MVPREC)))+y yFrac = mvLX[1]&(MVPREC-1) Here, (xPb, yPb) are the top-left coordinates of a block of size bW*bH, x=0...bW-1, y=0...bH-1, and MVPREC represents the precision of mvLX (1 / MVPREC pixel precision). For example, MVPREC = 16.

[0230] The motion compensation unit 3091 derives a temporary image temp[][] by performing horizontal interpolation on the reference picture refImg using an interpolation filter. The following Σ is the sum with respect to k of k=0..NTAP-1, shift1 is a normalization parameter that adjusts the range of values, and offset1=1<<(shift1-1).

[0231] temp[x][y] = (ΣmcFilter[xFrac][k]*refImg[xInt+k-NTAP / 2+1][yInt]+offset1)>>shift1 Next, the motion compensation unit 3091 performs vertical interpolation on the temporary image temp[][] to create the interpolated image Pred Derive [][]. The following Σ is the sum with respect to k from k=0 to NTAP-1, shift2 is a normalization parameter that adjusts the range of values, and offset2=1<<(shift2-1).

[0232] Pred[x][y] = (ΣmcFilter[yFrac][k]*temp[x][y+k-NTAP / 2+1]+offset2)>>shift2 In the case of biprediction, the above Pred[][] is used to derive interpolated images PredL0[][] and PredL1[][] for each L0 and L1 list, and then the interpolated image Pred[][] is generated from PredL0[][] and PredL1[][].

[0233] The synthesis unit 3095 includes an IntraInter synthesis unit 30951, a GPM synthesis unit 30952, a weight prediction unit 3094, and a BIO unit 30954.

[0234] (GPM synthesis section 30952) The GPM synthesis unit 30952 derives a predicted image using the temporary predicted images predSamplesLA and predSamplesLB, and weight parameters derived from the angle variables. The temporary predicted images predSamplesLA and predSamplesLB are predicted images generated by the motion compensation unit 3091 using the above motion information (mvX, refIdxX, predListFlagX, X=A or B). The angle variables are angleIdx and distanceIdx derived by the GPM prediction unit 30377.

[0235] The GPM synthesis unit 30952 derives the predicted pixel value pbSample using the following procedure. Here, nCbW = cbWidth and nCbH = cbHeight. First, the GPM synthesis unit 30952 derives bitDepth as follows for the weight coefficient derivation process in GPM prediction and the motion vector storage process described later.

[0236] If cIdx is 0, the GPM synthesis unit 30952 sets bitDepth to the number of luminance pixels, BitDepthY.

[0237] If cIdx is 0, the GPM synthesis unit 30952 sets nW and nH to nCbW and nCbH, respectively. If cIdx is not 0, the GPM synthesis unit 30952 sets nW and nH to nCbW*SubWidthC and nCbH*SubHeightC, respectively. Here, SubWidthC and SubHeightC are predetermined values ​​according to the color difference format.

[0238] If cIdx is 0, the GPM synthesis unit 30952 sets both subW and subH to 1. If cIdx is not 0, the GPM synthesis unit 30952 sets subW and subH to SubWidthC and SubHeightC, respectively.

[0239] If cIdx is not 0, the GPM synthesis unit 30952 sets bitDepth to the number of color difference pixels, BitDepthC.

[0240] Next, the GPM synthesis unit 30952 derives the variables nW, nH, shift1, offset1, displacementX, displacementY, partFlip, and shiftHor as follows.

[0241] nW = (cIdx==0) ? nCbW : nCbW * SubWidthC nH = (cIdx==0) ? nCbH : nCbH * SubHeightC shift1 = Max(5, 17 - BitDepth) offset1 = 1 << (shift1 - 1) TDX = angleIdx displacementY = (angleIdx + 8) % 32 partFlip = (angleIdx>=13 && angleIdx<=27) ? 0 : 1 shiftHor = (angleIdx%16==8 || (angleIdx%16!=0 && nH>=nW)) ? 0 : 1 If shiftHor is 0, the GPM synthesis unit 30952 derives offsetX and offsetY as follows:

[0242] offsetX = (-nW) >> 1 offsetY = ((-nH) >> 1) + (angleIdx<16? (distanceIdx * nH) >> 3 : -((distanceIdx * nH) >> 3)) If shiftHor is 1, the GPM synthesis unit 30952 derives offsetX and offsetY as follows:

[0243] offsetX = ((-nW) >> 1) + (angleIdx<16? (distanceIdx * nW) >> 3 : -((distanceIdx * nW) >> 3)) offsetY = (-nH) >> 1 The GPM synthesis unit 30952 derives the predicted pixel pbSamples according to the following steps.

[0244] 1) The GPM synthesis unit 30952 derives generalized coordinates (xL, yL) from coordinates (x, y) within the CU.

[0245] xL = (cIdx==0) ? x : x * SubWidthC yL = (cIdx==0) ? y : y * SubHeightC 2) The GPM synthesis unit 30952 uses the disLut shown in Figure 9(b) to calculate the weight coefficient wValue according to the coordinates within the CU, as follows:

[0246] weightIdx = (((xL + offsetX) << 1) + 1) * disLut[displacementX] + (((yL + offsetY) << 1) + 1) * disLut[displacementY] weightIdxL = partFlip ? 32 + weightIdx : 32 - weightIdx wValue = Clip3(0, 8, (weightIdxL + 4) >> 3) 3) The GPM synthesis unit 30952 derives the value of pbSample as follows.

[0247] pbSamples[x][y] = Clip3(0, (1 << BitDepth) - 1, (predSamplesLA[x][y] * wValue + predSamplesLB[x][y] * (8 - wValue) + offset1) >> shift1) (IntraInter synthesis process) When ciip_mode is 1, the IntraInter synthesis unit 30951 generates a prediction image in CIIP (Combined intra inter prediction) mode by weighting the inter-prediction image and the intra-prediction image.

[0248] (BIO prediction) In dual prediction mode, the BIO unit 30954 generates a prediction image by referring to two prediction images (a first prediction image and a second prediction image) and a gradient correction term.

[0249] (Weight prediction) The weight prediction unit 3094 generates a predicted block image by multiplying the interpolated image PredLX by a weight coefficient.

[0250] The interpretation image generation unit 309 outputs the predicted image of the generated block to the addition unit 312.

[0251] (Intra predictive image generation unit) When predMode indicates intra-prediction mode, the intra-prediction image generation unit performs intra-prediction using the intra-prediction parameters input from the intra-prediction parameter derivation unit and the reference pixels read from the reference picture memory 306.

[0252] The inverse quantization / inverse transformation unit 311 inversely quantizes the quantization transformation coefficients input from the parameter decoding unit 302 to obtain the transformation coefficients.

[0253] The summing unit 312 performs inverse quantization and inverse transformation on the predicted image of the block input from the predicted image generation unit 308. The prediction error input from the conversion unit 311 is added pixel by pixel to generate a decoded block image. The adder 312 stores the decoded block image in the reference picture memory 306 and also outputs it to the loop filter 305.

[0254] (Configuration of the video encoding device) Next, the configuration of the video encoding device 11 according to this embodiment will be described. Figure 20 is a block diagram showing the configuration of the video encoding device 11 according to this embodiment. The video encoding device 11 is composed of 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 image storage unit, frame memory) 109, an encoding parameter determination unit 110, a parameter encoding unit 111, a prediction parameter derivation unit 120, and an entropy encoding unit 104.

[0255] The prediction image generation unit 101 generates a prediction image for each CU. The prediction image generation unit 101 includes the inter-prediction image generation unit 309 and the intra-prediction image generation unit, which have already been described, so their explanation will be omitted.

[0256] The subtraction unit 102 subtracts the pixel values ​​of the predicted image of the block input from the predicted image generation unit 101 from the pixel values ​​of image T to generate a prediction error. The subtraction unit 102 outputs the prediction error to the conversion / quantization unit 103.

[0257] The conversion / quantization unit 103 calculates conversion coefficients by frequency conversion for the prediction error input from the subtraction unit 102, and derives quantized conversion coefficients by quantization. The conversion / quantization unit 103 outputs the quantized conversion coefficients to the parameter coding unit 111 and the inverse quantization / inverse conversion unit 105.

[0258] The inverse quantization / inverse transformation unit 105 is the same as the inverse quantization / inverse transformation unit 311 in the video decoding device 31, and therefore its explanation is omitted. The calculated prediction error is output to the summing unit 106.

[0259] The parameter coding unit 111 comprises a header coding unit 1110, a CT information coding unit 1111, and a CU coding unit 1112 (predictive mode coding unit). The CU coding unit 1112 further comprises a TU coding unit 1114. The general operation of each module is described below.

[0260] The header encoding unit 1110 performs encoding processing on parameters such as header information, partitioning information, prediction information, and quantization conversion coefficients.

[0261] The CT information encoding unit 1111 encodes QT, MT (BT, TT) division information, etc.

[0262] The CU encoding unit 1112 encodes CU information, prediction information, division information, etc.

[0263] The TU encoding unit 1114 encodes the QP update information and the quantization prediction error when the TU contains a prediction error.

[0264] The CT information coding unit 1111 and the CU coding unit 1112 supply syntax elements such as inter-prediction parameters (predMode, merge_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_LX_idx, mvdLX), intra-prediction parameters, and quantization conversion coefficients to the parameter coding unit 111.

[0265] The entropy coding unit 104 receives quantization conversion coefficients and coding parameters (partitioning information, prediction parameters) from the parameter coding unit 111. The entropy coding unit 104 entropy codes these to generate and output a coding stream Te.

[0266] The prediction parameter derivation unit 120 includes an inter-prediction parameter coding unit 112 and an intra-prediction parameter coding unit 112. This means includes a meter coding unit, which derives intra-prediction parameters and intra-prediction parameters from parameters input from the coding parameter determination unit 110. The derived intra-prediction parameters and intra-prediction parameters are output to the parameter coding unit 111.

[0267] (Configuration of the interpredictive parameter coding unit) As shown in Figure 21, the interprediction parameter coding unit 112 includes a parameter coding control unit 1121 and an interprediction parameter derivation unit 303. The interprediction parameter derivation unit 303 has the same configuration as the video decoding device. The parameter coding control unit 1121 includes a merge index derivation unit 11211 and a vector candidate index derivation unit 11212.

[0268] The merge index derivation unit 11211 derives merge candidates, etc., and outputs them to the inter-prediction parameter derivation unit 303. The vector candidate index derivation unit 11212 derives prediction vector candidates, etc., and outputs them to the inter-prediction parameter derivation unit 303 and the parameter coding unit 111.

[0269] (Configuration of the intra-predictive parameter coding unit) The intra-predictive parameter coding unit comprises a parameter coding control unit and an intra-predictive parameter derivation unit. The intra-predictive parameter derivation unit has the same configuration as the video decoding device.

[0270] However, unlike the video decoding device, the inputs to the inter-prediction parameter derivation unit 303 and the intra-prediction parameter derivation unit are the coding parameter determination unit 110 and the prediction parameter memory 108, and the output is sent to the parameter coding unit 111.

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

[0272] The loop filter 107 applies a deblocking filter, SAO, and ALF to the decoded image generated by the summing unit 106. Note that the loop filter 107 does not necessarily have to include the above three types of filters; for example, it may consist of only a deblocking filter.

[0273] The prediction parameter memory 108 stores the prediction parameters generated by the coding parameter determination unit 110 in predetermined locations for each target picture and CU.

[0274] The reference picture memory 109 stores the decoded images generated by the loop filter 107 at predetermined locations for each target picture and CU.

[0275] The coding parameter determination unit 110 selects one set from among several sets of coding parameters. The coding parameters are the QT, BT, or TT segmentation information, prediction parameters, or parameters that are to be coded and generated in relation to these. The prediction image generation unit 101 generates a prediction image using these coding parameters.

[0276] The coding parameter determination unit 110 calculates an RD cost value for each of the multiple sets, which indicates the magnitude of the information and the coding error. The RD cost value is, for example, the sum of the code amount and the squared error multiplied by a coefficient λ. The code amount is the information amount of the coded stream Te obtained by entropy coding the quantization error and coding parameters. The squared error is the sum of the squares of the prediction errors calculated in the subtraction unit 102. The coefficient λ is a preset real number greater than zero. The coding parameter determination unit 110 selects the set of coding parameters that minimizes the calculated cost value. The coding parameter determination unit 110 outputs the determined coding parameters to the parameter coding unit 111 and the prediction parameter derivation unit 120.

[0277] Furthermore, some parts of the video encoding device 11 and video decoding device 31 in the above-described embodiment, such as the entropy decoding unit 301, parameter decoding unit 302, loop filter 305, prediction image generation unit 308, inverse quantization / inverse transformation unit 311, addition unit 312, prediction parameter derivation unit 320, prediction image generation unit 101, subtraction unit 102, transformation / quantization unit 103, entropy encoding unit 104, inverse quantization / inverse transformation unit 105, loop filter 107, encoding parameter determination unit 110, parameter encoding unit 111, and prediction parameter derivation unit 120, may be implemented using a computer. In that case, a program for realizing this control function may be recorded on a computer-readable recording medium, and the program recorded on this recording medium may be loaded into a computer system and executed. Hereinafter, "computer system" refers to a computer system built into either the video encoding device 11 or the video decoding device 31, and includes hardware such as an OS and peripheral devices. Furthermore, "computer-readable recording media" refers to portable media such as flexible disks, magneto-optical disks, ROMs, and CD-ROMs, as well as storage devices such as hard disks built into computer systems. In addition, "computer-readable recording media" may also include those that dynamically hold programs for a short period of time, such as communication lines used when transmitting programs over networks such as the Internet or communication lines such as telephone lines, and those that hold programs for a certain period of time, such as volatile memory inside computer systems that act as servers or clients in such cases. Moreover, the above-mentioned programs may be for the purpose of realizing some of the functions described above, and may also be programs that can realize the aforementioned functions in combination with programs already recorded in the computer system.

[0278] Furthermore, some or all of the video encoding device 11 and video decoding device 31 in the above-described embodiment may be implemented as an integrated circuit such as an LSI (Large Scale Integration). Each functional block of the video encoding device 11 and video decoding device 31 may be individually implemented as a processor, or some or all of them may be integrated into a single processor. In addition, the method of implementing the integrated circuit is not limited to LSIs; it may also be implemented using dedicated circuits or general-purpose processors. Furthermore, if an integrated circuit technology that can replace LSIs emerges due to advances in semiconductor technology, an integrated circuit using that technology may be used.

[0279] Although one embodiment of this invention has been described in detail above with reference to the drawings, the specific configuration is not limited to that described above, and various design changes can be made without departing from the spirit of this invention.

[0280] The embodiments of the present invention are not limited to those described above, and various modifications are possible within the scope of the claims. That is, embodiments obtained by combining technical means that have been appropriately modified within the scope of the claims are also included in the technical scope of the present invention. [Industrial applicability]

[0281] Embodiments of the present invention can be suitably applied to a video decoding device that decodes encoded data from image data, and a video encoding device that generates encoded data from image data. Furthermore, they can be suitably applied to the data structure of encoded data generated by the video encoding device and referenced by the video decoding device. [Explanation of Symbols]

[0282] 31 Image Decoder 301 Entropy Decoder 302 Parameter Decoding Unit 303 Interpretation parameter derivation section 30377 GPM Forecasting Department 305, 107 Loop Filter 306, 109 Reference picture memory 307, 108 Prediction parameter memory 308, 101 Predictive image generation unit 309 Interpretation Image Generation Unit 30952 GPM synthesis section 311, 105 Inverse Quantization / Inverse Transformation Section 312, 106 Addition section 320 Prediction parameter derivation section 11 Image encoding device 102 Subtraction Unit 103 Conversion / Quantization Section 104 Entropy coding unit 110 Encoding parameter determination unit 111 Parameter coding section 112 Interpretation Parameter Coding Unit 120 Prediction parameter derivation section

Claims

1. GPM parameters that indicate the partition shape for deriving the predicted image of the target block from the encoded data a parameter decoding unit that decodes data, and a prediction unit that derives the predicted image from two predicted images and weights, The parameter decoding unit decodes the target block according to the GPM parameters of the neighboring blocks. determining whether to decode the GPM parameters of The prediction unit includes a process of deriving a GPM mode number of the target block from the GPM parameters of the neighboring blocks, and deriving the weights based on the GPM mode number. and deriving the predicted image using the weights.

2. The parameter decoding unit generates a first parameter according to the GPM parameter of the neighboring block. determining whether to decode the meter or the second parameter; 2. The video decoding device according to claim 1, wherein the first parameter is a parameter indicating a division pattern, and the second parameter is a parameter indicating an angle of a division line.

3. The parameter decoding unit derives the GPM mode number of the target block from the first parameter when a predicted division line of the adjacent block and the target block do not have an intersection. and if the predicted dividing line of the adjacent block and the target block have an intersection, the GPM mode number of the adjacent block, the intersection, and the second parameter are used to determine the GPM mode number of the target block.

3. The video decoding device according to claim 2, wherein the GPM mode number is derived from the GPM mode number of the first frame.

4. The intersection point is derived using a table in which the block size of the adjacent block, the GPM mode number of the adjacent block, and the coordinate position of the intersection point correspond to each other. The video decoding device according to claim 3 .

5. 5. The method according to claim 3, wherein, when the predicted division line of the adjacent block and the target block have the intersection, the prediction unit derives the GPM mode number of the target block by using the intersection and a division angle derived from the second parameter. A video decoding device.

6. The prediction unit predicts the block size of the neighboring block and the GPM of the neighboring block. a table associating mode numbers with the coordinate positions of the intersections, and a table associating block sizes of the target blocks and the GPM mode numbers of the target blocks with the coordinate positions of the intersections. The GPM mode number of the target block is derived using a table in the The video decoding device according to claim 5 .

7. A GPM parameter indicating a partition shape for deriving a predicted image of a target block from encoded data. a parameter coding unit that codes data, and a prediction unit that derives a predicted image from two predicted images and weights, The parameter encoding unit encodes the target block according to the GPM parameters of the neighboring blocks. determining whether to encode the GPM parameters of the The prediction unit includes a process of deriving the GPM mode number of the target block from the GPM parameters of the neighboring blocks, and deriving the weights based on the GPM mode number. and deriving the predicted image using the weights.

8. The parameter encoding unit determines whether to encode a first parameter or a second parameter according to a positional relationship between the prediction dividing line of the adjacent block and the target block; 8. The video encoding device according to claim 7, wherein the first parameter is a parameter indicating a division pattern, and the second parameter is a parameter indicating an angle of a division line.