Method for decoding and encoding image and non-transitory computer readable storage medium

By constructing an inter-frame prediction candidate list and utilizing the weighted sum of intra-frame prediction modes, the problem of low coding efficiency of high-resolution video images is solved and more efficient video signal compression is achieved.

CN118694928APending Publication Date: 2024-09-24DOLBY INTERNATIONAL AB
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410746706.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-12-28
Filing Date
2019-12-30
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Existing technology is difficult to effectively compress high-resolution video images, especially when providing high-resolution and ultra-high-resolution stereoscopic image content, and the coding efficiency is low.

Method used

By constructing an inter prediction candidate list, the prediction block of the current block is generated, and a weighted sum is performed based on the intra prediction mode to generate the final prediction block, and then inverse quantization and inverse transformation are performed to reconstruct the image, using the inter prediction mode and intra prediction Combination of modes to improve coding efficiency.

Benefits of technology

The coding efficiency of video signals is improved, and high-resolution video images can be compressed and transmitted more effectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694928A
    Figure CN118694928A
Patent Text Reader

Abstract

The disclosure relates to a method of decoding an image, a method of encoding an image, and a non-transitory computer-readable storage medium. The method of decoding an image includes: constructing an inter prediction candidate list of a current block in the image, the inter prediction candidate list including a plurality of merge candidates; generating a first prediction block of the current block by performing inter prediction based on one of a plurality of merge candidates included in an inter prediction candidate list; generating a second prediction block of the current block based on a predefined intra prediction mode in the decoding device, the predefined intra prediction mode representing the planar mode; generating a final prediction block of the current block based on a weighted sum of the first prediction block and the second prediction block; generating a residual block of the current block by performing inverse quantization and inverse transformation on the quantization coefficient of the current block; and reconstructing the current block on the basis of the prediction block and the residual block, in which a weight for the weighted sum is determined on the basis of whether a prediction mode of a neighboring block adjacent to the current block is an intra mode.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of invention patent application No. 201980091943.0, whose application date is December 30, 2019, international application number is PCT / KR2019 / 018741, and which entered the Chinese national stage on August 12, 2021, and whose invention name is “Inter-frame prediction coding and decoding method and device”. Technical Field

[0002] The present disclosure relates to image encoding / decoding methods and devices. Background Art

[0003] The video image is compressed and encoded by removing spatial and temporal redundancy and inter-view redundancy, which can be transmitted through a communication line or stored in a form suitable for a storage medium.

[0004] The market demand for high-resolution video is increasing, and therefore, a technology that can efficiently compress high-resolution images is needed. In response to these market demands, the Moving Picture Experts Group (MPEG) of ISO / IEC and the VCEG (Video Coding Experts Group) of ITU-T jointly formed JVET to actively research and develop the VVC (Versatile Video Coding) video compression standard.

[0005] Video compression mainly consists of the following: intra-frame prediction, inter-frame prediction, transform, quantization, entropy coding, and loop filtering. At the same time, as the demand for high-resolution images increases, the demand for 3D image content as a new image service is also increasing. Video compression technology for efficiently providing high-resolution and ultra-high-resolution stereoscopic image content is being discussed. Summary of the invention

[0006] Technical issues

[0007] The present disclosure is to improve the coding efficiency of video signals.

[0008] Technical Solutions

[0009] According to one aspect of the present invention, a method for decoding an image is provided, comprising: constructing an inter-frame prediction candidate list of a current block in the image, the inter-frame prediction candidate list including multiple merge candidates; generating a first prediction block of the current block by performing inter-frame prediction based on one of the multiple merge candidates included in the inter-frame prediction candidate list; generating a second prediction block of the current block based on a predefined intra-frame prediction mode in a decoding device, the predefined intra-frame prediction mode representing a planar mode; generating a final prediction block of the current block based on a weighted sum of the first prediction block and the second prediction block; generating a residual block of the current block by performing inverse quantization and inverse transformation on quantization coefficients of the current block; and reconstructing the current block based on the prediction block and the residual block, wherein the weight used for the weighted sum is determined based on the following: whether the prediction mode of a neighboring block adjacent to the current block is an intra-frame mode.

[0010] According to another aspect of the present invention, a method for encoding an image is provided, comprising: constructing an inter-frame prediction candidate list of a current block in the image, the inter-frame prediction candidate list including multiple merge candidates; generating a first prediction block of the current block by performing inter-frame prediction based on one of the multiple merge candidates included in the inter-frame prediction candidate list; generating a second prediction block of the current block based on a predefined intra-frame prediction mode in an encoding device, the predefined intra-frame prediction mode representing a planar mode; generating a final prediction block of the current block based on a weighted sum of the first prediction block and the second prediction block; generating a residual block of the current block based on the final prediction block of the current block; generating quantization coefficients by performing transformation and quantization on the residual block; and encoding the quantized coefficients to generate a bitstream, wherein the weight used for the weighted sum is determined based on whether the prediction mode of a neighboring block adjacent to the current block is an intra-frame mode.

[0011] According to another aspect of the present invention, a non-transitory computer-readable storage medium for storing data associated with a video signal is provided, comprising: a bit stream generated by a coding method, the coding method comprising: constructing an inter-frame prediction candidate list of a current block, the inter-frame prediction candidate list comprising multiple merge candidates; generating a first prediction block of the current block by performing inter-frame prediction based on one of the multiple merge candidates included in the inter-frame prediction candidate list; generating a second prediction block of the current block based on a predefined intra-frame prediction mode, the predefined intra-frame prediction mode being a representation of a planar mode; generating a final prediction block of the current block based on a weighted sum of the first prediction block and the second prediction block; generating a residual block of the current block based on the final prediction block of the current block; generating quantization coefficients by performing transformation and quantization on the residual block; and encoding the quantized coefficients, wherein the weights used for the weighted sum are determined based on the following: whether the prediction mode of a neighboring block adjacent to the current block is an intra-frame mode.

[0012] The decoding method and device according to the contents of the present disclosure can: determine at least one of multiple inter-frame prediction modes as the inter-frame prediction mode of the current block, construct an inter-frame prediction candidate list based on the determined inter-frame prediction mode, generate a first prediction block of the current block by performing motion compensation based on any one prediction candidate in the inter-frame prediction candidate list, and modify the first prediction block using a predetermined intra-frame prediction mode.

[0013] In the decoding method and apparatus according to the present disclosure, the modification may include: generating a second prediction block of the current block based on an intra prediction mode; and combining the first prediction block and the second prediction block.

[0014] In the decoding method and apparatus according to the present disclosure, the intra prediction mode may be a fixed mode pre-agreed in the decoding apparatus.

[0015] In the decoding method and apparatus according to the present disclosure, the pre-agreed fixed mode may be any one of the planar mode and the DC mode.

[0016] In the decoding method and apparatus according to the present disclosure, the inter prediction candidate list may include at least one of a spatial merging candidate and a temporal merging candidate.

[0017] In the decoding method and apparatus according to the present disclosure, the inter prediction candidate list may further include a combined merge candidate, and the combined merge candidate may be obtained by averaging at least two merge candidates belonging to the inter prediction candidate list.

[0018] In the decoding method and apparatus according to the present disclosure, modification of the first prediction block may be selectively performed according to a flag indicating whether to perform modification based on intra prediction.

[0019] In the decoding method and apparatus according to the present disclosure, a flag may be signaled or derived in consideration of at least one of a type of a slice to which a current block belongs, an inter prediction mode of the current block, or a size of the current block.

[0020] The encoding method and device according to the contents of the present disclosure can: determine at least one of multiple inter-frame prediction modes as the inter-frame prediction mode of the current block, construct an inter-frame prediction candidate list based on the determined inter-frame prediction mode, generate a first prediction block of the current block by performing motion compensation based on any one prediction candidate in the inter-frame prediction candidate list, and modify the first prediction block using a predetermined intra-frame prediction mode.

[0021] According to the contents of the present disclosure, a non-transitory computer-readable storage medium can: determine at least one of a plurality of inter-frame prediction modes as an inter-frame prediction mode of a current block, construct an inter-frame prediction candidate list based on the determined inter-frame prediction mode, generate a first prediction block of the current block by performing motion compensation based on any one prediction candidate in the inter-frame prediction candidate list, and modify the first prediction block using a predetermined intra-frame prediction mode.

[0022] Beneficial Effects

[0023] The video signal processing method and apparatus according to the present disclosure can improve video signal encoding efficiency through inter-frame prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a block diagram showing the configuration of a video encoding method and apparatus according to an embodiment of the present disclosure.

[0025] Figure 2 is a block diagram showing the configuration of a video decoding method and apparatus according to an embodiment of the present disclosure.

[0026] Figure 3 2 is a diagram showing a tree-structure based partitioning method as an embodiment to which the present disclosure is applied.

[0027] Figure 4 is a diagram illustrating a method of performing motion compensation based on an inter prediction mode predefined in an encoding / decoding device according to an embodiment to which the present disclosure is applied.

[0028] Figures 5 to 17 An embodiment to which the present disclosure is applied is shown.

[0029] Best Mode for Carrying Out the Present Disclosure

[0030] The decoding method and device according to the contents of the present disclosure can: determine at least one of multiple inter-frame prediction modes as the inter-frame prediction mode of the current block, construct an inter-frame prediction candidate list based on the determined inter-frame prediction mode, generate a first prediction block of the current block by performing motion compensation based on any one prediction candidate in the inter-frame prediction candidate list, and modify the first prediction block using a predetermined intra-frame prediction mode.

[0031] In the decoding method and apparatus according to the present disclosure, the modification may include: generating a second prediction block of the current block based on an intra prediction mode; and combining the first prediction block and the second prediction block.

[0032] In the decoding method and apparatus according to the present disclosure, the intra prediction mode may be a fixed mode pre-agreed in the decoding apparatus.

[0033] In the decoding method and apparatus according to the present disclosure, the pre-agreed fixed mode may be any one of the planar mode and the DC mode.

[0034] In the decoding method and apparatus according to the present disclosure, the inter prediction candidate list may include at least one of a spatial merging candidate and a temporal merging candidate.

[0035] In the decoding method and apparatus according to the present disclosure, the inter prediction candidate list may further include a combined merge candidate, and the combined merge candidate may be obtained by averaging at least two merge candidates belonging to the inter prediction candidate list.

[0036] In the decoding method and apparatus according to the present disclosure, modification of the first prediction block may be selectively performed according to a flag indicating whether to perform modification based on intra prediction.

[0037] In the decoding method and apparatus according to the present disclosure, a flag may be signaled or derived in consideration of at least one of a type of a slice to which a current block belongs, an inter prediction mode of the current block, or a size of the current block.

[0038] The encoding method and device according to the contents of the present disclosure can: determine at least one of multiple inter-frame prediction modes as the inter-frame prediction mode of the current block, construct an inter-frame prediction candidate list based on the determined inter-frame prediction mode, generate a first prediction block of the current block by performing motion compensation based on any one prediction candidate in the inter-frame prediction candidate list, and modify the first prediction block using a predetermined intra-frame prediction mode.

[0039] According to the contents of the present disclosure, a non-transitory computer-readable storage medium can: determine at least one of a plurality of inter-frame prediction modes as an inter-frame prediction mode of a current block, construct an inter-frame prediction candidate list based on the determined inter-frame prediction mode, generate a first prediction block of the current block by performing motion compensation based on any one prediction candidate in the inter-frame prediction candidate list, and modify the first prediction block using a predetermined intra-frame prediction mode. DETAILED DESCRIPTION

[0040] The embodiments of the present disclosure will be described in detail with reference to the drawings in this specification so that those of ordinary skill in the art can easily implement the present disclosure. However, the present disclosure can be implemented in various different forms and is not limited to the embodiments described herein. In addition, in the drawings, in order to clearly describe the present disclosure, parts that are not related to the description are omitted, and in the specification, similar reference numerals are attached to similar parts.

[0041] In the specification, when a certain part is referred to as being "connected to" another part, this includes not only the case where it is directly connected but also the case where it is electrically connected to another element interposed therebetween.

[0042] In addition, when a part of the present specification is referred to as “comprising” a certain component, it means that other components may be included rather than being excluded unless otherwise specified.

[0043] In addition, various components may be described using terms such as first and second, but these components should not be limited by these terms. The above terms are used only for the purpose of distinguishing one component from another.

[0044] In addition, in the embodiments of the apparatus and method described in this specification, some parts of the apparatus or some steps of the method may be omitted. In addition, the order of some parts of the apparatus or some steps of the method may be changed. In addition, other parts or other steps may be inserted into some parts of the apparatus or some steps of the method.

[0045] In addition, some components or some steps of the first embodiment of the present disclosure may be added to the second embodiment of the present disclosure, or may be replaced with some components or some steps of the second embodiment.

[0046] In addition, the components shown in the embodiments of the present disclosure are independently shown to represent different characteristic functions, which does not mean that each component unit is formed by separate hardware or a single software component. That is, for ease of explanation, each component unit is described by each component unit listed as, and at least two component units in each component unit are combined to form a single component unit, or a component unit can be divided into multiple component units to perform functions. Without departing from the essence of the present disclosure, the integrated implementation and separate implementation of each component in these components are also included in the scope of the present disclosure.

[0047] First, the terms used in this application are briefly described as follows.

[0048] The decoding apparatus (Video Decoding Apparatus) to be described below may be: a civilian security camera apparatus, a civilian security system, a military security camera apparatus, a military security system, a personal computer (PC), a notebook computer, a portable multimedia player (PMP), a wireless communication terminal, a smart phone, an apparatus included in a server terminal such as a TV application server and a service server, and may represent user terminals such as various devices, communication devices such as a communication modem for performing communication with a wired / wireless communication network, a memory for storing various programs and data for decoding an image or performing intra-frame prediction or inter-frame prediction for decoding, or various devices equipped with a microprocessor, etc. to run programs for operation and control.

[0049] In addition, the image encoded as a bit stream by the encoder can be sent to the video decoding device in real time or non-real time through a wired and wireless communication network (e.g., the Internet, a local wireless communication network, a wireless LAN network, a WiBro network, and a mobile communication network) or through various communication interfaces (e.g., a cable and a universal serial bus (USB)), decoded, reconstructed into an image and reproduced. Alternatively, the bit stream generated by the encoder can be stored in a memory. The memory may include both a volatile memory and a non-volatile memory. In this specification, the memory may be expressed as a recording medium storing a bit stream.

[0050] Generally, a motion picture may be composed of a series of pictures, and each picture may be divided into coding units such as blocks. In addition, a person skilled in the art of the present embodiment will understand that the term "picture" described below may be replaced with other terms having equivalent meanings, such as "image" and "frame". In addition, a person skilled in the art will understand that the term "coding unit" may be replaced with other terms having equivalent meanings, such as "unit block" and "block".

[0051] Hereinafter, embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. In describing the present disclosure, repeated description of the same components will be omitted.

[0052] Figure 1 is a block diagram showing the configuration of a video encoding method and apparatus according to an embodiment of the present disclosure.

[0053] According to an embodiment, the video encoding method and device may include: an inter-frame prediction unit 120, an intra-frame prediction unit 125, a subtraction unit 130, a transform unit 140, a quantization unit 150, an entropy encoding unit 160, an inverse transform unit 145, an inverse quantization unit 155, an addition unit 135, a bidirectional filter unit 180, a loop filter unit 180 and a reconstructed picture buffer 190.

[0054] The inter prediction unit 120 generates a prediction signal by performing motion prediction using the input image 110 and a reconstructed image stored in the reconstructed picture buffer 190 .

[0055] The intra prediction unit 125 generates a prediction signal by performing spatial prediction using pixel values ​​of a pre-reconstructed neighboring block spatially adjacent to a current block to be encoded.

[0056] The subtraction unit 130 generates a residual signal by using the input image and a prediction signal generated by the inter prediction unit 120 or the intra prediction unit 125 .

[0057] The transform unit 140 and the quantization unit 150 perform transform and quantization on the residual signal generated by the subtraction unit 130 to generate a quantization coefficient.

[0058] The entropy encoding unit 160 performs entropy encoding on encoding information such as syntax elements and quantization coefficients defined in the video compression standard, and outputs a bit stream.

[0059] The inverse transform unit 145 and the inverse quantization unit 155 receive the quantization coefficients, perform inverse quantization and inverse transform in sequence, and generate a reconstructed residual signal.

[0060] The adding unit 135 generates a reconstructed signal using the prediction signal generated by the inter prediction unit 120 or the intra prediction unit 125 and the reconstructed residual signal.

[0061] The reconstructed signal is transmitted to the loop filter unit 180 , and a final reconstructed picture is generated by applying one or more loop filters such as a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to be stored in the reconstructed picture buffer 190 .

[0062] The reconstructed picture stored in the reconstructed picture buffer 190 may be used as a reference picture in the inter prediction unit 120 .

[0063] Figure 2 is a block diagram showing the configuration of a video decoding method and apparatus according to an embodiment of the present disclosure.

[0064] According to an embodiment, the video decoding device and method may include: an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, an inter-frame prediction unit 250, and an addition unit 260, a bidirectional filter unit 270, a loop filter unit 280 and a reconstructed picture buffer 290.

[0065] The entropy decoding unit 210 decodes the input bitstream 200 and outputs decoded information such as syntax elements and quantized coefficients.

[0066] The inverse quantization unit 220 and the inverse transform unit 230 receive the quantization coefficients, perform inverse quantization and inverse transform in sequence, and output a residual signal.

[0067] The intra prediction unit 240 generates a prediction signal by performing spatial prediction using pixel values ​​of pre-decoded neighboring blocks adjacent to a current block to be decoded.

[0068] The inter prediction unit 250 generates a prediction signal by performing motion compensation using a motion vector extracted from a bitstream and a reconstructed image stored in the reconstructed picture buffer 280 .

[0069] The adding unit 260 generates a reconstructed signal using the prediction signal generated by the intra prediction unit 240 or the inter prediction unit 250 and the reconstructed residual signal.

[0070] The bidirectional filter unit 270 performs bidirectional filtering on the reconstructed signal generated by the adding unit 260 to generate a signal to which filtering is applied.

[0071] The reconstructed signal is sent to the loop filter unit 270 , and a final reconstructed picture is generated by applying one or more loop filters such as a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to be stored in the reconstructed picture buffer 280 .

[0072] The reconstructed picture stored in the reconstructed picture buffer 280 may be used as a reference picture in the inter prediction unit 250 .

[0073] Figure 3 2 is a diagram showing a tree-structure based partitioning method as an embodiment to which the present disclosure is applied.

[0074] The tree structure-based division may be performed based on at least one of a quadtree, a binary tree, and a ternary tree. A quadtree may be a type in which a higher coding block is divided into four lower coding blocks. Here, each of the width and height of the lower coding block may be half the width and height of the higher coding block. A binary tree may be a type in which a higher coding block is divided into two lower coding blocks. For example, Figure 3 As shown, the higher coding block can be divided into two in the horizontal direction or the vertical direction. In this case, the width or height of the lower coding block can be half of the width or height of the higher coding block. The ternary tree can be a type in which the higher coding block is divided into three lower coding blocks. For example, Figure 3 As shown, a ternary tree (similar to a binary tree) can be divided into three in the horizontal direction or the vertical direction. In this case, the ratio of the width or height of the three lower coding blocks can be 1:2:1, 1:1:2 or 2:1:1.

[0075] The above partition types may be applied based on a priority pre-agreed in the encoding / decoding device. For example, only when the block partition based on the quadtree is no longer performed, at least one of the binary tree and the ternary tree is allowed. However, the present disclosure is not limited thereto, and after performing the block partition based on at least one of the binary tree and the ternary tree, the block partition based on the quadtree may be additionally performed.

[0076] Block partitioning can be performed based on predetermined partitioning information. The partitioning information may include at least one of the following: first information indicating whether to partition, second information indicating the partitioning direction, or third information indicating the partitioning type or the number of partitions. The first information may include at least: a first flag indicating whether the current coding block is partitioned based on the above-mentioned tree structure, a second flag indicating whether the current coding block is partitioned based on a quadtree, or a third flag indicating whether the current coding block is additionally partitioned based on a tree structure different from a quadtree. At least one of the above-mentioned partitioning information may be encoded and signaled by the encoding device, or may be derived by the decoding device based on predetermined encoding parameters. Here, the encoding parameters may include: block size / shape, partition depth, block position (e.g., whether the block is located at the boundary of a predetermined fragment area), transform type (e.g., DCT, DST, transform skip, etc.), component type (e.g., luminance, chrominance), partition type of adjacent blocks, etc.

[0077] For example, when the first flag is true, a second flag indicating whether to divide based on a quadtree is notified by a signal, and when the second flag is false, the current coding block is no longer divided. When the second flag is true, the current coding block is divided into four coding blocks, and when the second flag is false, the current coding block can be divided based on a binary tree or a ternary tree. To this end, the second information indicating the direction of division and the third information indicating the type of division can be notified by a signal. When the second information is a first value, the division can be performed in the vertical direction, otherwise, the division can be performed in the horizontal direction. When the third information is a first value, a binary tree can be applied, otherwise, a ternary tree can be applied. Alternatively, when the second flag is false, a third flag indicating whether to divide based on a tree structure other than a quadtree can be notified by a signal. In this case, when the third flag is true, block division based on a binary tree or a ternary tree can be performed based on the second information indicating the direction of division and the third information indicating the type of division.

[0078] On the other hand, when the current coding block is larger than a predetermined threshold size, only quadtree is allowed, otherwise, quadtree, binary tree and ternary tree based divisions may be allowed. The threshold size may be a fixed value (e.g., 128, 64, 32) preset in the encoding / decoding device, or may be encoded and signaled by the encoding device. When the current coding block is larger than the predetermined threshold size, since only quadtree division is allowed, the above division information may not be signaled.

[0079] In the following, the terms block, coding block, current coding block and current block may be understood to mean a coding block of a leaf node in which the above-mentioned tree-structure-based partitioning is no longer performed. A coding block may be interpreted in the same meaning as a coding block. A subblock may be understood to mean a subblock of a coding block constituting a leaf node. Inter-frame prediction information may represent candidate motion information for motion compensation of a current block or candidate block information with corresponding motion information. Alternatively, in some cases, the inter-frame prediction information may represent motion information for motion compensation of a current block in the candidate motion information. The motion information may include at least one of the following: a motion vector, a reference picture index, a prediction direction (e.g., L0 prediction, L1 prediction) and reference picture list information.

[0080] Inter prediction is performed by motion estimation and motion compensation by generating a prediction block using a reconstructed image and a motion vector stored in a decoded picture buffer (DPB).

[0081] Motion estimation may refer to the process of finding the optimal prediction block from a picture for inter-frame prediction stored in a decoded picture buffer, and motion compensation may refer to the process of generating a prediction block based on motion information (motion vector, reference picture index) of the optimal prediction block found in the motion estimation process.

[0082] In addition, inter prediction can be divided into unidirectional prediction and bidirectional prediction. Unidirectional prediction uses only one picture in the past or future on the time axis as a reference picture for a block, while bidirectional prediction refers to both past and future pictures. This can be determined by the slice type.

[0083] In inter prediction, one slice may be divided into a P slice and a B slice, and inter prediction of the P slice may perform only unidirectional prediction, and inter prediction of the B slice may selectively use any one of unidirectional prediction and bidirectional prediction.

[0084] In addition, unidirectional prediction can be classified into forward prediction using a reference picture displayed (or output) temporally before the current picture and backward prediction using a reference picture displayed (or output) temporally after the current picture.

[0085] The motion information (or parameters) for specifying which reference area (or reference block) is used to predict the current block in the inter prediction process (i.e., unidirectional prediction or bidirectional prediction) may include: an inter prediction mode (here, the inter prediction mode may indicate a reference direction (i.e., unidirectional or bidirectional) and a reference list (i.e., L0, L1, or bidirectional), a reference index (or a reference picture index or a reference list index), and motion vector information. The motion vector information may include: a motion vector, a motion vector prediction (MVP), or a motion vector difference (MVD). The motion vector difference means the difference between a motion vector and a motion vector prediction value.

[0086] In inter-frame prediction encoding / decoding, the inter-frame prediction motion information of the adjacent blocks is used to reduce the motion information transmitted when the prediction information of the current block is derived. The inter-frame prediction mode can be classified into an AMVP method, which derives a motion vector prediction value from the motion information of the adjacent blocks to reduce the searched inter-frame prediction information, and a merge / skip method, which uses the predicted motion information of the adjacent blocks as is. In addition, each method can be classified into a mode in units of coding blocks or a mode in units of sub-blocks according to the block unit to be executed. The sub-block unit merge / skip method may include at least one of the following: ATMVP, STMVP, and affine mode, and the sub-block unit AMVP mode may include at least one of the following: ATMVP, STMVP, and affine mode. In the sub-block unit AMVP mode, restrictions may be made so that at least one of ATMVP or STMVP is not used.

[0087] In the following, the adjacent block may include at least one of a spatial adjacent block or a temporal adjacent block. The spatial adjacent block may be a block adjacent to at least one of the left, top, upper left, upper right or lower left of the current block, or may be a block separated by a predetermined distance. Here, the predetermined distance may be determined based on a block parameter, or may be a fixed value pre-agreed by the encoder / decoder. The block parameter may include the width / height, shape, depth, partitioning technique (e.g., quadtree, binary tree, ternary tree, triangular partitioning, etc.) of the block. In this case, the block parameter may be related to the current block and / or the adjacent block. The temporal adjacent block is a block belonging to a different picture from the current block, and may represent a block in the same position as the current block (hereinafter referred to as a collocated block). The collocated block may include at least one of the following: a block including the center position of the current block or a block adjacent to each corner (e.g., upper left, lower right, etc.) of the current block.

[0088] ATMVP and affine merging / inter-frame methods determine whether motion information is available in spatially adjacent blocks according to a predetermined order and derive necessary motion information. Even if the block positions used to determine whether information of adjacent blocks is available are the same, the given order used for searching between techniques may be different.

[0089] The predetermined order may be a fixed order predefined in the encoder / decoder, or may be variably determined based on the above-mentioned encoding parameters.

[0090] The coding parameters may include information about block attributes. Here, block attributes may represent: position, size, shape, aspect ratio, length values ​​of width and height, partitioning technology (e.g., quadtree, binary tree, ternary tree), partition depth, inter-frame prediction mode (e.g., whether it is merge mode, whether it is affine mode), affine mode type (4 parameters, 6 parameters), etc. Block attributes may represent the attributes of the current block and / or the neighboring blocks of the current block. The position may indicate whether a block (CU) or a sub-block is located on the boundary of a predetermined segment area, or may indicate the position of a sub-block within a block. The predetermined segment area may refer to a tile, a slice, a CTU row, or a CTU. The predetermined order may be determined based on a comparison between a first threshold predetermined by the encoder / decoder and the block attribute.

[0091] In the present disclosure, by searching in the same order as searching for neighboring blocks for constructing candidates in a subblock inter prediction process in consideration of the correlation with the current block, redundant searching of neighboring blocks can be prevented without degrading encoding performance.

[0092] The inter prediction mode can be classified into an AMVP method and a merge / skip method. The AMVP method derives a motion vector prediction value from an adjacent block, and the merge / skip method uses the inter prediction motion information of the adjacent block as is. In addition, each method can be classified into a mode in units of coding blocks or a mode in units of sub-blocks according to the block unit to be executed. Among them, in the case of an inter prediction mode in units of sub-blocks, a candidate list is constructed with the help of: inherited affine inter prediction using an affine model of an adjacent block predicted and encoded using an affine model, combined affine inter prediction using an affine model derived from motion information of an adjacent block, ATMVP, etc. In each inter prediction mode, a list containing a specific number of candidates can be constructed to use the motion information of the adjacent block, and the adjacent blocks are searched in a specific order to fill the list.

[0093] In order to construct a candidate list in an inter prediction mode in sub-block units, ATMVP, inherited affine inter prediction, and combined affine inter prediction can be used. In this case, in order to construct the corresponding prediction mode, the temporal / spatial neighboring blocks can be searched in a specific order according to the correlation with the current block, and the candidate list can be constructed without redundantly searching the neighboring blocks without degrading the encoding performance.

[0094] When constructing a candidate list in inter-frame prediction in sub-block units, motion information of temporal / spatial neighboring blocks of the current block is used. Motion information with higher priority in the candidate list can be sent by allocating lower bits. By jointly searching for neighboring blocks with high correlation for several modes used to construct the list, the inefficient complexity of searching the same position multiple times individually can be reduced.

[0095] Figure 4 is a diagram illustrating a method of performing motion compensation based on an inter prediction mode predefined in an encoding / decoding device according to an embodiment to which the present disclosure is applied.

[0096] In the present disclosure, when performing inter-frame prediction encoding / decoding on a current block, an encoding / decoding method and device for inter-frame prediction are proposed, which includes: an inter-frame prediction mode determination step (S400), an inter-frame prediction candidate deriving step (S410), and a motion compensation / modification step (S420).

[0097] In the inter prediction mode determining step (S400), at least one of the skip mode, the merge mode, and the AMVP mode may be determined as the inter prediction mode of the current block.

[0098] In addition, at least one of the following modes may be determined as the inter prediction mode of the current block. In this case, the determination may be performed based on at least one of the skip mode, the merge mode, and the AMVP mode.

[0099] Sub-block unit merging mode

[0100] Sub-block unit skip mode

[0101] Sub-block unit AMVP mode

[0102] MMVD mode

[0103] MH Intra Mode

[0104] Triangle Mode

[0105] The inter-frame prediction candidate deriving step (S410) can use at least one of the following to construct an inter-frame prediction candidate list: inter-frame prediction information of spatially adjacent blocks, inter-frame prediction information of temporally adjacent blocks, HMVP, synthesized inter-frame prediction information, combined affine inter-frame prediction information, inherited affine inter-frame prediction information, ATMVP or STMVP.

[0106] In addition, when constructing the list, at least one of the following inter-frame prediction information may be used.

[0107] MV (Motion Vector)

[0108] Reference image directions

[0109] Reference Image Index

[0110] Affine flag: Specifies whether to use affine mode

[0111] MMVD flag: specifies whether to use MMVD mode

[0112] MH intra-frame flag: specifies whether to use MH intra-frame mode

[0113] Triangle flag: Specifies whether to use triangle mode

[0114] CPMV (Control Point Motion Vector)

[0115] In the motion compensation / modification step (S420), inter-frame prediction and motion compensation / modification may be performed using at least one of motion compensation, luminance compensation (IC), OBMC, BIO, affine motion compensation, or decoding-side motion compensation. In addition, the motion compensation / modification step S420 may include a process of modifying a prediction block according to motion compensation. Here, modification may mean a process of combining a prediction block according to motion compensation and a prediction block obtained by performing intra prediction on a current block.

[0116] Specifically, in the inter prediction mode determination step (S400), at least one prediction mode among skip, merge, and AMVP in inter prediction for the current block may be determined as the inter prediction mode of the current block.

[0117] The inter prediction mode of the current block may be determined as the merge mode.

[0118] When determining the merge mode, the prediction block of the current block can be obtained by applying the same motion information of the adjacent block to the current block. Here, the adjacent block can be any one of the following: left block (F), top block (D), bottom left block (G), top right block (E) or top left block (A).

[0119] For example, you can use the Figure 5 At least one of the motion information of the left block at positions F and G. For example, the motion information of the left block at positions F and G can be used. Figure 5 At least one of the motion information of the top block at positions D and E. For example, the motion information of the top block at positions D and E can be used. Figure 5 The motion information of the upper left block at position A.

[0120] Prediction of the current block may be performed through neighboring blocks, and a residual block may be generated accordingly.

[0121] Among the neighboring blocks, inter prediction information of the neighboring block consuming the minimum cost for encoding the prediction information and the residual block may be used to encode the current block.

[0122] The inter prediction mode of the current block may be determined as the skip mode.

[0123] When determining the skip mode, the motion information of the neighboring block is used as the motion information of the current block.

[0124] For example, you can use the Figure 5 At least one of the motion information of the left block at positions F and G. For example, the motion information of the left block at positions F and G can be used. Figure 5 At least one of the motion information of the top block at positions D and E. For example, the motion information of the top block at positions D and E can be used. Figure 5 Motion information of the top block at position A.

[0125] Prediction of the current block is performed through neighboring blocks, and no residual block is generated accordingly.

[0126] The inter prediction mode of the current block may be determined as the AMVP mode.

[0127] When determining the AMVP mode, the motion information of the neighboring blocks may be used as the predicted motion information of the current block.

[0128] For example, you can use the Figure 5 At least one of the motion information of the left block at positions F and G. For example, the motion information of the left block at positions F and G can be used. Figure 5 At least one of the motion information of the top block at positions D and E. For example, the motion information of the top block at positions D and E can be used. Figure 5Motion information of the top block at position A.

[0129] The predicted motion information of the current block may be obtained through the neighboring blocks, and the predicted block of the current block may be obtained through an additional search based on the corresponding motion information.

[0130] Among the neighboring blocks, inter prediction information of the neighboring block consuming the minimum cost for encoding the prediction information and the residual block may be used to encode the current block.

[0131] In addition, after determining the inter-frame prediction mode, at least one of the following prediction modes may be determined as the inter-frame prediction mode of the current block: sub-block unit merge mode, sub-block unit skip mode, sub-block unit AMVP mode, MMVD mode, MH intra-frame mode, or triangle mode. In this case, the determination may be made by information such as a flag, an index, etc. Information such as a flag, an index, etc. may be signaled by the encoder or derived from the decoder based on predetermined encoding parameters.

[0132] The prediction mode in sub-block units can divide the current block into M sub-blocks and can have n inter-frame prediction information. Here, M can be greater than or equal to n. When M>n, multiple sub-blocks belonging to the current block can share one inter-frame prediction information. In this case, the multiple sub-blocks can be blocks adjacent to each other in the current block, or blocks that are not adjacent to each other. The size of the sub-block can be at least one of 4x4, 4x8, 8x4, 4x16, 16x4...2NxN, Nx2N, and can be fixed to a predetermined size.

[0133] When the motion information is derived in units of sub-blocks, the size of the sub-block can be determined as the size of the sub-block with the minimum cost. In this case, the cost can be obtained by at least one of the methods such as SATD, SAD, RD cost and the average block size in the previous picture. When there is no motion information of the sub-block unit of the reference block, it can be replaced by the motion information of the sub-block at a predetermined position. The predetermined position may refer to the position at the lower right or center of the reference block or the position at the lower right corner of the reference block, etc. Here, the position at the lower right corner may represent the position of the block adjacent to the right, bottom or lower right based on the lower right sample of the reference block.

[0134] When determining the inter prediction mode of the current block, the sub-block unit merge mode may be determined.

[0135] The sub-block unit merge mode of the current block can be performed in one or more methods of ATMVP and affine mode. That is, when the inter prediction mode of the current block is ATMVP mode or affine mode, merging in units of sub-blocks can be applied.

[0136] The affine merge mode can derive N positive integer positions and the CPMV of these positions from neighboring blocks.

[0137] For example, you can use the Figure 5 The upper left, upper right or lower left CPMV (control point MV) of the current block is derived from at least one of the upper left, upper right or lower left CPMVs of the left block at positions F and G. This can be any one of a plurality of candidate CPMVs for the current block.

[0138] For example, you can use the Figure 5 At least one of the upper left, upper right or lower left CPMVs of the top blocks at positions E, D and A is used to derive the upper left, upper right or lower left CPMV of the current block. This can be any one of multiple candidate CPMVs for the current block. Alternatively, at least one of the upper left, upper right or lower left CPMVs of at least one of the k-th groups (k=1, 2 and 3) above can be used to derive the upper left, upper right or lower left CPMV of the current block. This can be any one of multiple candidate CPMVs for the current block.

[0139] exist Figure 5 In the embodiment, the CPMV of the current block can be obtained by selecting any one of the first group (A, B, C), the second group (D, E) or the third group (F, G). Alternatively, the CPMV of the current block can be obtained by selecting at least one of the first group, at least one of the second group and at least one of the third group.

[0140] The selection may be performed based on a predetermined priority. For example, the first group may have a higher priority than the second or third group. The third group may have a higher priority than the first or second group. The priority between blocks within each group may be bottom->top and left->right, or right->left and top->bottom. Alternatively, it may be left->right and top->bottom, or the opposite direction. Regardless of the position of the group, the priority may be the same, or the priority may be set differently for each group.

[0141] The derivation may be performed in units of sub-blocks of the current block. In the derivation process, the use of a specific group may be limited according to the position of the sub-block in the current block. For example, only the first group / second group may be used, only the first group / third group may be used, or only the second group / third group may be used. Alternatively, the CPMV of the current block may be derived using a block pair predefined in an encoder / decoder. Any one of the block pairs may belong to any one of the first to third groups, and the other may belong to another group. The block pair may be defined differently for each current sub-block.

[0142] When the sub-block-unit merge mode of the current block is performed, prediction information may be constructed and signaled using at least one of a merge index or a residual signal.

[0143] The sub-block-unit inter-frame prediction information of the neighboring block consuming the minimum cost may be used to encode the current block.

[0144] When determining the inter prediction mode of the current block, a sub-block unit skip mode may be determined.

[0145] When a sub-block-unit skip mode of a current block is performed, prediction information may be constructed and signaled using a merge index.

[0146] Among the neighboring blocks, sub-block-unit inter prediction information of the neighboring block consuming the minimum prediction information cost may be used to encode the current block.

[0147] Sub-block-unit prediction information of a neighboring block may be used as sub-block-unit motion information of a current block, and a residual block may not be generated accordingly.

[0148] When determining the inter prediction mode of the current block, a sub-block unit AMVP mode may be determined.

[0149] When the inter prediction mode of the current block is the affine mode, the sub-block unit AMVP mode of the current block may be applied.

[0150] When a sub-block-unit AMVP mode of a current block is performed, prediction information may be constructed and signaled using an AMVP index, a motion information difference (MVD), a reference picture index, a reference direction, and a residual signal.

[0151] The sub-block unit inter prediction information of the neighboring block consuming the minimum cost may be used to encode the current block. When determining the inter prediction mode of the current block, the MMVD mode may be determined.

[0152] When deriving inter-frame prediction information for the current block, motion information of neighboring blocks may be used.

[0153] For example, motion information present in the merge candidate list may be used.

[0154] The specific direction and magnitude of the MVD (motion vector difference) may be signaled and used for the motion information of neighboring blocks.

[0155] Prediction of the current block may be performed through motion information of neighboring blocks and additional signaling, and a residual block may be generated accordingly.

[0156] At least one or more inter prediction information, additional direction information, and MVD size information among neighboring blocks may be used to encode the current block. Here, the direction information may indicate any one of up, down, left, or right directions.

[0157] When determining the inter prediction mode of the current block, the MH intra mode may be determined.

[0158] The MH intra mode may be a mode for obtaining a first prediction block of a current block by inter prediction, obtaining a second prediction block of the current block by intra prediction, and obtaining a final prediction block by combining the first prediction block and the second prediction block. The first prediction block may be obtained using any one of the above inter prediction modes (i.e., block unit skip mode, sub-block unit skip mode, merge mode, AMVP mode). The second prediction block may be obtained using an intra prediction mode derived based on the MPM or an intra prediction mode predefined in the encoding / decoding apparatus.

[0159] For example, when performing MH intra mode of the current block, the merge index and the intra prediction mode may be signaled. In order to derive the intra prediction mode, most probable mode (MPM) candidate information may be constructed.

[0160] For encoding of the current block, a merge index and most probable mode (MPM) candidate information for intra prediction may be used. The MPM may be constructed using the intra prediction modes of neighboring blocks adjacent to the current block in the intra prediction mode as candidates for the current intra prediction mode.

[0161] When determining the inter prediction mode of the current block, a triangular mode may be determined.

[0162] The inter prediction information of the current block may be derived using the motion information of one or more neighboring blocks. In this case, the derivation may be performed by combining the motion information of multiple neighboring blocks. The triangular partitions belonging to the current block may share a candidate list, and an index for specifying the motion information of each partition may be signaled.

[0163] Inter prediction information of a current block may be used by combining motion information of two or more neighboring blocks with intra prediction.

[0164] For example, by dividing the current block in a diagonal direction, motion information of other adjacent blocks can be obtained.

[0165] When the triangular mode of the current block is performed, the prediction information may be constructed and signaled using the triangular index and the residual signal.

[0166] A combination of inter-frame information of two or more neighboring blocks consuming the minimum cost may be used to encode the current block.

[0167] Inter prediction candidate deriving step (S410); when deriving inter prediction candidates, at least one of inter prediction information of spatially adjacent blocks, inter prediction information of temporally adjacent blocks, history-based motion vector predictor (HMVP), synthesized inter prediction information, combined affine inter prediction information, inherited affine inter prediction information, ATMVP, and STMVP can be derived as candidates. One or more prediction candidates can be used to construct an inter prediction candidate list, and the prediction candidate can include at least one of motion vector, reference direction, reference picture index, affine flag, MH intra-frame flag, MMVD flag, triangle flag, and CPMV. The inter prediction candidate list can be one or more.

[0168] The affine flag is a flag indicating whether to use the inter prediction mode in subblock units. The affine flag is a flag indicating whether to use the affine mode in block units or in subblock units.

[0169] The MH intra flag is a flag indicating whether the MH intra mode is used.

[0170] The MMVD flag is a flag indicating whether the MMVD prediction mode is used.

[0171] The triangular flag is a flag indicating whether the triangular prediction mode is used.

[0172] CPMV (Control Point Motion Vector) may be a motion vector for encoding using affine. CPMV may be motion information in units of sub-blocks including at least one of the upper left, upper right, lower left, or lower right positions of a block encoded using affine. The CPMV of the current block may be derived from the CPMV of the previous block encoded / decoded using affine by Formula 1. One (2 parameters), two (4 parameters), or more than two (6 parameters, ...) CPMVs may be used to apply affine to the current block.

[0173] [Formula 1]

[0174] v 0x =v 3x +(v 5x -v 3x )(y 0 -y 3 ) / nH+(v 4x -v 3x )(x 0 -x 3 ) / nW

[0175] v 0y =v 3 y+(v 5y -v 3y )(y 0 -y3 ) / nH+(v 4y -v 3y )(x 0 -x 3 ) / nW

[0176] v 1x =v 0x +(v 4x -v 3x )×cW / nW

[0177] v 1y =v 0y +(v 4y -v 3y )×cH / nH

[0178] v 2x =v 0x +(v 5x -v 3x )×cW / nW

[0179] v 2y =v 0y +(v 5y -v 3y )×cH / nH

[0180] For example, as shown in Formula 1, the CPMV of the upper left (x0, y0), upper right (x1, y1) or lower left (x2, y2) of the current block can be obtained using the CPMV of the upper left (x3, y3), upper right (x4, y4) or lower left (x5, y5) of the left block, as shown in Figure 7 As shown. Motion information in units of sub-blocks can be derived by applying the CPMV of the current block to an affine model. However, it is not limited to the left block, and at least one of the following can be used: a top block, an upper left block, a lower left block, and an upper right block. The lower right position of the adjacent block (not shown) can be used to derive the CPMV. Considering the position of the current block, the availability of adjacent blocks, and the availability of the upper left, upper right, or lower left positions of adjacent blocks, the lower right position can be selectively used. Here, the position of the current block may indicate whether it is located on the boundary of a predetermined segment area, and the segment area may represent a tile, a slice, a coding tree block (CTB row, CBT, etc.). The number of adjacent blocks available when deriving the CPMV may be 1, 2, 3, or more. The number may be a predefined number in the encoder / decoder, may be the same number regardless of the angular position of the current block, or may be defined differently for each angular position.

[0181] ATMVP may receive one or more motion information from spatially neighboring blocks in a predetermined order, and derive inter prediction information of the current block in units of sub-blocks.

[0182] The motion information originally existing in the spatial neighboring blocks may be used as the motion information in units of subblocks of the current block. The motion information may be motion information existing in units of subblocks in a block corresponding to the current block in a picture on which encoding / decoding has been previously performed.

[0183] When the sub-block unit of the reference block has no motion information, such as Figure 6 As shown, the sub-block of the current block may be replaced with the motion information of the sub-block existing at the middle position of the previous picture.

[0184] Affine can use the motion vector (CPMV) of the subblock existing in the neighboring block to derive the subblock unit motion vector (CPMV) of the current block. The motion information of the current block in units of subblocks can be derived by using the derived CPMV.

[0185] For example, the top left and top right CPMVs of the current block can be obtained by using Figure 7 It is generated by the upper left and upper right CPMV of the adjacent blocks.

[0186] For example, the top-left, top-right, and bottom-left CPMVs of the current block can be obtained by using Figure 7 It is generated by the upper left, lower left and upper right CPMV of the adjacent blocks.

[0187] The motion information of the neighboring block adjacent to the upper left, upper right or lower left of the current block may be used as the CPMV. By using the CPMV, the motion information of the current block in units of sub-blocks may be derived.

[0188] For example, the motion information of the current block in units of sub-blocks may be derived by using the motion information existing in each position {A, B, C}, the position {D, E}, and the position {F, G} as the CPMV.

[0189] The STMVP may be derived by combining inter-frame prediction information in units of sub-blocks of spatial neighboring blocks and temporal neighboring blocks for the current block. The combination may be performed based on operations such as median, average, and minimum / maximum.

[0190] The motion information of a sub-block previously derived in the current block may be used to derive the motion information of the current sub-block.

[0191] HMVP may be used to derive motion information of a current block by constructing motion information of a previously coded block as a candidate.

[0192] like Figure 8As shown, the first candidate list can be constructed by storing motion information of previously encoded blocks. When constructing the inter-frame prediction candidate list of the current block, one or more motion information of the first candidate list can be used. The first candidate list can be constructed using the motion information of A previously encoded blocks. Here, A can be a natural number of 1, 2, 3, 4, 5, 6 or more. A can be less than or equal to a threshold agreed to in advance with the encoder / decoder. The previously encoded block may include blocks that are not adjacent to the current block. A can be determined based on information notified by the encoder with a signal (e.g., digital information of a specified value), or can be a fixed value agreed to in advance with the encoder / decoder.

[0193] For example, the motion information of the first candidate list may be used for the merged candidate list. For example, the motion information of the first candidate list may be used for the AMVP candidate list.

[0194] After the inter prediction mode of the current block is finally determined, the prediction mode may be added to the first candidate list.

[0195] When the inter prediction mode of the current block is determined to be a merge mode, a merge candidate list may be constructed. The merge candidate list may be constructed using N inter prediction information.

[0196] The merge candidate list may be constructed using at least one of: inter prediction information of spatially neighboring blocks, inter prediction information of temporally neighboring blocks, HMVP, synthesized inter prediction information, STMVP, ATMVP, and zero motion information.

[0197] The list may be constructed using N candidates, N being, for example, 5 or more.

[0198] The inter-frame prediction information of spatially adjacent blocks refers to Fig. 9 The inter-frame prediction information of the blocks present at positions A, B, ..., J, K in the image may be obtained. In this case, the size of the adjacent blocks may have a size of MxN, and M or N may be at least one of 4, 8, 16, 32, 64, and 128, respectively. The size may be a pre-agreed fixed value or may be variably determined by the above-mentioned encoding parameters.

[0199] For example, when obtaining the motion information of adjacent blocks, Fig. 9 It is derived from the order of the B, J, K, A and F blocks in the game.

[0200] The inter-frame prediction information of the temporally adjacent block refers to the inter-frame prediction information existing in the block of the picture that has been encoded / decoded before at least one of the positions of a, b, c, d, e, f, g, h.

[0201] The HMVP is the same as described above, and its detailed description will be omitted.

[0202] ATMVP may use inter prediction information in units of subblocks of a block corresponding to the current block in a previously encoded / decoded picture. In order to find the corresponding block, the first existing motion information in a spatially adjacent block according to a predetermined order may be used.

[0203] For example, when obtaining the motion information of adjacent blocks, Fig. 9 The search is performed in the order of B, J, K, and A blocks in the image, and the motion information of the neighboring block having the first existing motion information may be used.

[0204] For example, the motion information of the first candidate in the candidate list may be merged using a block unit derived from spatially adjacent blocks.

[0205] STMVP denotes subblock-unit inter prediction information generated by combining inter prediction information of spatially neighboring blocks or temporally neighboring blocks in units of subblocks with respect to a current block.

[0206] The synthesized inter prediction information may be derived by combining one or more candidates present in the merge candidate list. The motion vector of the synthesized inter prediction information may be obtained by combining N positive integer motion vectors.

[0207] The combined inter prediction information may be derived by using at least one of the merge candidates present in the merge candidate list, and is hereinafter referred to as a combined merge candidate.

[0208] The merge candidate list may also include a combined merge candidate. The combined merge candidate may be derived by combining n merge candidates belonging to the pre-generated merge candidate list.

[0209] Here, n may be an integer of 2, 3, 4 or more. The number (n) of merge candidates to be combined may be a fixed value agreed to in advance with the encoding / decoding device, or may be encoded and signaled by the encoding device. Signaling may be performed in at least one of the following units: sequence, picture, slice, tile, sub-tile (brick), or predetermined block. The number (n) of merge candidates to be combined may be variably determined based on the number of remaining merge candidates. Here, the number of remaining merge candidates may refer to the difference between the maximum number of merge candidates that can be included in the merge candidate list and the current number of merge candidates in the merge candidate list. The maximum number may be a number agreed to in advance with the encoding / decoding device, or may be encoded and signaled by the encoding device. The current number may mean the number of merge candidates constructed before adding the combined merge candidate. For example, when the number of remaining merge candidates is 1, two merge candidates may be used, and when the number of remaining merge candidates is greater than 1, three or more merge candidates may be used.

[0210] The positions of the n merge candidates may be predetermined positions in the merge candidate list. For example, each merge candidate belonging to the merge candidate list may be assigned an index (0 to (k-1)). Here, k may represent the total number of merge candidates belonging to the merge candidate list. In this case, the positions of the n merge candidates may correspond to index 0 to index (n-1) in the merge candidate list. Alternatively, the n merge candidates may be determined by considering the prediction direction of each merge candidate belonging to the merge candidate list. For example, among the merge candidates belonging to the merge candidate list, only merge candidates as bidirectional predictions may be selectively used, or only merge candidates as unidirectional predictions may be selectively used.

[0211] The combined merge candidate may be derived using both the spatial merge candidate and the temporal merge candidate, or may be derived using only one of the spatial merge candidate or the temporal merge candidate. For example, the combined merge candidate may be limited to be derived using only the spatial merge candidate. In this case, the number of merge candidates to be combined may be limited to the number of spatial merge candidates belonging to the pre-generated merge candidate list.

[0212] The combined merge candidate may be added after the spatial / temporal merge candidate in the merge candidate list. That is, the index of the combined merge candidate may be greater than the index of the spatial / temporal merge candidate. Alternatively, the combined merge candidate may be added between the spatial merge candidate and the temporal merge candidate in the merge candidate list. That is, the index of the combined merge candidate may be greater than the index of the spatial merge candidate and less than the index of the temporal merge candidate. Alternatively, the position of the combined merge candidate may be variably determined considering the prediction direction of the combined merge candidate. Depending on whether the prediction direction of the combined merge candidate is bidirectional prediction, the position of the combined merge candidate in the merge candidate list may be rearranged. For example, when the combined merge candidate is bidirectional prediction, an index smaller than the spatial merge candidate or the temporal merge candidate may be assigned, otherwise, an index larger than the spatial merge candidate or the temporal merge candidate may be assigned.

[0213] Hereinafter, for convenience of description, a method of deriving a combined merge candidate based on two merge candidates will be described.

[0214] The motion information of the combined merge candidate can be derived by taking a weighted average of the motion information of the first merge candidate and the second merge candidate. Here, the weights of the weighted average are [1:1], [1:2], [1:3], [2:3], etc., but are not limited thereto. The weights can be predefined in the encoding / decoding device or derived from the decoding device. In this case, the weights can be derived by considering at least one of the distance between the reference picture of the merge candidate and the current picture or the prediction direction of the merge candidate. Alternatively, the motion information of the combined merge candidate can be derived by obtaining the motion information in the L0 direction from the first merge candidate and the motion information in the L1 direction from the second merge candidate and combining them. The motion information of the combined merge candidate can be derived based on at least one of the above-mentioned derivation methods, and this can be performed by considering the prediction direction of the merge candidates to be combined as described later.

[0215] In the present specification, the motion information may include at least one of the following: a prediction direction flag, a reference picture index, or a motion vector. The motion information may be defined for L0 prediction and L1 prediction, respectively. Here, L0 prediction may mean prediction with reference to reference picture list L0, and L1 prediction may mean prediction with reference to reference picture list L1.

[0216] When the first merge candidate and the second merge candidate are both unidirectional predictions

[0217] (Case 1) When the first merge candidate is L0 prediction and the second merge candidate is L1 prediction, the reference picture index of the first merge candidate may be used to derive the reference picture index of the combined merge candidate in the L0 direction. The prediction direction flag in the L0 direction of the combined merge candidate may be derived as 1. The motion vector in the L0 direction of the combined merge candidate may be derived as the motion vector of the first merge candidate. The reference picture index in the L1 direction of the combined merge candidate may be derived as the reference picture index of the second merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate may be derived as 1. The motion vector in the L1 direction of the combined merge candidate may be derived as the motion vector of the second merge candidate.

[0218] (Case 2) When the first merge candidate is L1 predicted and the second merge candidate is L0 predicted, the reference picture index in the L0 direction of the combined merge candidate may be derived as the reference picture index of the second merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate may be derived as 1. The motion vector in the L0 direction of the combined merge candidate may be derived as the motion vector of the second merge candidate. The reference picture index in the L1 direction of the combined merge candidate may be derived as the reference picture index of the first merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate may be derived as 1. The motion vector in the L1 direction of the combined merge candidate may be derived as the motion vector of the first merge candidate.

[0219] (Case 3) When the first merge candidate and the second merge candidate are L0 predictions, the reference picture index in the L0 direction of the combined merge candidate can be derived as the reference picture index of any one of the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index among the first merge candidate and the second merge candidate can be set as the reference picture index in the L0 direction of the combined merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate can be derived as 1. The motion vector in the L0 direction of the combined merge candidate can be derived from the weighted average of the motion vectors of the first merge candidate and the second merge candidate. The reference picture index in the L1 direction of the combined merge candidate can be derived as -1, the prediction direction flag in the L1 direction can be derived as 0, and the motion information in the L1 direction can be derived as 0.

[0220] (Case 4) When the first merge candidate and the second merge candidate are L1 predictions, the reference picture index in the L0 direction of the combined merge candidate can be derived as -1, the prediction direction flag in the L0 direction can be derived as 0, and the motion information in the L0 direction can be derived as 0. The reference picture index in the L1 direction of the combined merge candidate can be derived as the reference picture index of any one of the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index in the first merge candidate and the second merge candidate can be set as the reference picture index in the L1 direction of the combined merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate can be derived as 1. The motion vector in the L1 direction of the combined merge candidate can be derived from the weighted average of the motion vectors of the first merge candidate and the second merge candidate.

[0221] 2. When both the first merge candidate and the second merge candidate are bidirectionally predicted

[0222] (Case 5) The reference picture index in the L0 direction of the combined merge candidate can be derived as the reference picture index of any one of the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index in the first merge candidate and the second merge candidate can be set as the reference picture index in the L0 direction of the combined merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate can be derived as 1. The motion vector in the L0 direction of the combined merge candidate can be derived from the weighted average of the motion vectors of the first merge candidate and the second merge candidate. The reference picture index in the L1 direction of the combined merge candidate can be derived as the reference picture index of any one of the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index in the first merge candidate and the second merge candidate can be set as the reference picture index in the L1 direction of the combined merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate can be derived as 1. The motion vector in the L1 direction of the combined merge candidate can be derived from the weighted average of the motion vectors of the first merge candidate and the second merge candidate.

[0223] 3. When the first merge candidate is bidirectionally predicted and the second merge candidate is unidirectionally predicted

[0224] (Case 6) When the second merge candidate is an L0 prediction, the reference picture index in the L0 direction of the combined merge candidate can be derived as the reference picture index of any one of the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index among the first merge candidate and the second merge candidate can be set as the reference picture index in the L0 direction of the combined merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate can be derived as 1. The motion vector in the L0 direction of the combined merge candidate can be derived from the weighted average of the motion vectors of the first merge candidate and the second merge candidate. The reference picture index in the L1 direction of the combined merge candidate can be derived as the reference picture index of the first merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate can be derived as 1. The motion vector in the L1 direction of the combined merge candidate can be derived as the motion vector of the first merge candidate.

[0225] (Case 7) When the second merge candidate is an L1 prediction, the reference picture index in the L0 direction of the combined merge candidate can be derived as the reference picture index of the first merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate can be derived as 1. The motion vector in the L0 direction of the combined merge candidate can be derived as the motion vector of the first merge candidate. The reference picture index in the L1 direction of the combined merge candidate can be derived as the reference picture index of any one of the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index in the first merge candidate and the second merge candidate can be set as the reference picture index in the L1 direction of the combined merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate can be derived as 1. The motion vector in the L1 direction of the combined merge candidate can be derived from the weighted average of the motion vectors of the first merge candidate and the second merge candidate.

[0226] When the (maximum) candidate list for merge mode is not filled, the (maximum) candidate list may be filled with zero motion information.

[0227] When the inter prediction mode of the current block is determined to be a skip mode, a skip candidate list may be constructed. The skip candidate list may include N inter prediction information.

[0228] In the case of skip mode, the candidate list construction method can be the same as the merge candidate list construction method.

[0229] When the inter prediction mode of the current block is determined to be the AMVP mode, an AMVP candidate list may be constructed. The AMVP candidate list may include N inter prediction information.

[0230] An AMVP candidate list having at least one of a motion vector, a reference picture list, a reference direction or a motion vector difference is constructed. The AMVP candidate list includes at least one of the following: inter-frame prediction information of spatial neighboring blocks, inter-frame prediction information of temporal neighboring blocks and zero motion information.

[0231] For example, the AMVP candidate list may be structured into more than two lists.

[0232] The inter-frame prediction information of spatially adjacent blocks refers to Fig. 9 One or more candidates may be derived from spatially neighboring blocks in a predetermined order.

[0233] The left neighboring block may be a block at one or more positions of A, B, C, D, E, and the inter prediction information may be derived in a predetermined order.

[0234] For example, when obtaining the motion information of the left adjacent block, Fig. 9Alternatively, it can be derived in the order of B and A blocks.

[0235] The top neighboring block may be a block at one or more positions of F, G, H, I, J, and K, and inter prediction information may be derived in a predetermined order.

[0236] For example, when deriving the motion information of the top adjacent block, Fig. 9 Alternatively, it can also be obtained in the order of J, K, F or F, J, K blocks.

[0237] When the derivation is performed according to a predetermined order, when the motion information of the neighboring blocks corresponding to the current order is not available, the motion information of the blocks corresponding to the next order may be used.

[0238] The inter-frame prediction information of temporally adjacent blocks refers to Fig.10 The inter-frame prediction information existing in the block at the same position as the current block in the picture that has been encoded / decoded before the current picture in the current picture. The position of the temporal neighboring block may correspond to a position at least one of the lower right, center, and predetermined position of the current block.

[0239] For example, the position of the temporal neighboring block may correspond to the position a or b of a block present in the previous picture.

[0240] For example, the position of the temporal neighboring block may correspond to one of the positions c, d, e of the block present in the previous picture, or to one of the positions f, g, h of the block present in another previous picture. Alternatively, the temporal neighboring block may include the upper left position (not shown) of the block corresponding to the current block, or may be a block adjacent to the upper left position.

[0241] When the (maximum) candidate list of the AMVP mode is not filled, the candidate list may be filled with zero motion information.

[0242] When the inter prediction mode of the current block is determined to be the sub-block unit merge mode, a merge candidate list may be constructed in units of sub-blocks. The sub-block unit merge candidate list may include N inter prediction information.

[0243] The sub-block-unit merge candidate list may be constructed using at least one of: ATMVP, inherited affine inter prediction information, combined affine inter prediction information, and zero affine motion prediction information.

[0244] ATMVP may use inter prediction information in a subblock unit of a block corresponding to a current block in a previously encoded / decoded picture. In order to find a corresponding block, motion information first existing in a spatially adjacent block may be used in a predetermined order.

[0245] For example, you can Fig.11 The A, B, C, and D blocks are searched sequentially to find the block corresponding to the current block.

[0246] For example, when no motion information exists in all neighboring blocks, zero motion information may be used to find the corresponding block.

[0247] The inherited affine inter prediction information may be a CPMV derived from the CPMV of a spatially neighboring block using affine encoding / decoding of the current block. The CPMV of the spatially neighboring block may be a sub-block unit motion vector of at least one of the upper left, upper right, lower left, or lower right positions of the block using affine encoding / decoding, and the sub-block unit motion vector (CPMV of the current block) at the upper left, upper right, or lower left position of the current block may be derived by scaling the CPMV of the neighboring block according to the width and height of the current block and the adjacent block, as shown in Formula 1. Fig.12 In the method, spatially neighboring blocks at positions A, B, ..., H, O can be searched, and one or more candidates including one or at least two or more CPMV combinations (4 parameters, 6 parameters, ...) obtained in a predetermined order can be obtained.

[0248] The 4 parameters may be a sub-block unit motion vector combination derived at two of the four corners of the current block. In this case, any two of the upper left, upper right, lower left, and lower right of the current block may be selectively used. However, if any of the selected corner positions is unavailable, it may be replaced with another available corner position. For example, a combination of two CPMVs (4 parameters) may be a sub-block unit motion vector combination derived at the upper left and upper right of the current block.

[0249] The 6 parameters may be a sub-block unit motion vector combination derived at three of the four corners of the current block. In this case, any three of the upper left, upper right, lower left, and lower right of the current block may be selectively used. However, if any of the selected corner positions is unavailable, it may be replaced with another available corner position. For example, three CPMV combinations (6 parameters) may be sub-block unit motion vector combinations derived at the upper left, upper right, and lower left of the current block.

[0250] The left neighboring blocks may be blocks at A, B, C, . . . , F, G, and at least one or more inter-frame prediction information may be derived in a predetermined order.

[0251] For example, you can Fig.12 The order of the A and B blocks in the frame derives at least one or more inter-frame prediction information.

[0252] The top neighboring blocks may be blocks at H, I, J, . . . , N, O, and at least one or more inter-frame prediction information may be derived in a predetermined order.

[0253] For example, you can Fig.12 At least one or more inter-frame prediction information is derived from the order of O, N and H blocks in . The above order is just an example and can be derived in the reverse order.

[0254] The combined affine inter prediction information can be Fig.12 The motion vector combination of the neighboring blocks adjacent to each other in the upper left (CP1), upper right (CP2), lower left (CP3) and lower right (CP4) positions in the middle. The motion vector of the neighboring block can be used as the CPMV. A candidate including at least two or more CPMV combinations (4 parameters, 6 parameters, ...) can be constructed. When all motion vectors of the neighboring blocks used as the CPMV combination have the same reference index, they can be added to the candidate list. When the neighboring blocks have the same reference picture, they can be added to the candidate list.

[0255] For example, first there is Fig.12 A motion vector among the positions of H, I, G in the image may be used as CP1, which is the upper left CPMV. In this case, the search order may be (H, I, G), (H, G, I), (G, I, H), (I, G, H), (G, H, I), or (I, H, G).

[0256] For example, first there is Fig.12 The motion vector in the position of N, O in can be used as CP2, which is the upper right CPMV. In this case, the search order can be (N, O) or (O, N).

[0257] For example, first there is Fig.12 The motion vector among positions B and A can be used as CP3, which is the lower left CPMV. In this case, the search order can be (B, A) or (A, B).

[0258] For example, in Fig.12 The motion vector at position P of the reference block of the previous picture in can be used as CP4, which is the lower right CPMV.

[0259] For example, four CPMVs (CP1, CP2, CP3, CP4) can be combined in the following order: {CP1, CP2, CP3}, {CP1, CP2, CP4}, {CP1, CP3, CP4}, {CP2, CP3, CP4}, {CP1, CP2}, {CP1, CP3}, and when all corresponding CPs have the same reference index (or have the same reference picture), they can be added to the candidate list.

[0260] When the maximum candidate list in the sub-block unit merge mode is not filled, the candidate list may be filled with zero motion information.

[0261] When the inter prediction mode of the current block is determined as the sub-block unit skip mode, a skip candidate list may be constructed in units of sub-blocks. The skip candidate list in units of sub-blocks may include N inter prediction information.

[0262] The details about constructing the candidate list may be the same as the contents of the sub-block unit merging mode.

[0263] When the inter prediction mode is determined to be the sub-block unit merge mode or the sub-block unit skip mode, the inter prediction mode can be derived by using the CPMV of the affine model present in the candidate list of the sub-block unit inter prediction mode. In order to use the CPMV of the affine model present in the candidate list, the ATMVP can be filled in the candidate list after the affine model prediction.

[0264] For example, the ATMVP may be populated in the candidate list after combining the affine inter prediction information.

[0265] For example, the ATMVP may be populated in the candidate list after inheriting the affine inter prediction information.

[0266] For ATMVP, at least one or more of the CPMVs of the inherited affine inter prediction candidates may be used to derive sub-block-unit motion information of the current block.

[0267] The left neighboring block may be a block at one or more positions of A, B, C, . . . , F, G, and the inter prediction information may be derived in a predetermined order.

[0268] For example, it can be concluded that Fig.12 At least one or more of the blocks at A and B in inherit the affine inter prediction information. At least one or more of the CPMVs at the upper left, upper right, or lower left of the corresponding block may be used to derive motion information in units of sub-blocks.

[0269] The top neighboring block may be a block at one or more positions of H, I, J, ..., N, O, and sub-block prediction information may be derived in a predetermined order.

[0270] For example, it can be concluded that Fig.12 At least one or more of the blocks at O, N, and H in inherit the affine inter prediction information. At least one of the CPMVs at the upper left, upper right, or lower left positions of the corresponding block can be used to derive motion information in a sub-block unit of the current block.

[0271] For ATMVP, at least one or more of the CPMVs of the combined affine inter prediction information can be used to derive sub-block unit motion information. The sub-block unit motion information can be motion information existing in a sub-block unit of a block corresponding to the current block that has been moved by the CPMV in a previously encoded / decoded picture.

[0272] For example, the upper left CP1 may be used to derive motion information in sub-block units of the current block.

[0273] For example, the upper right CP2 may be used to derive motion information in sub-block units of the current block.

[0274] For example, the lower left CP3 may be used to derive motion information in sub-block units of the current block.

[0275] When the inter prediction mode is determined to be a sub-block unit merge mode or a sub-block unit skip mode, the same search order of adjacent blocks may be constructed to construct a candidate list of the sub-block unit inter prediction mode. The candidate list of the sub-block unit inter prediction mode may be used to derive ATMVP, inherited affine inter prediction information, and combined affine inter prediction information by determining whether motion information of adjacent blocks is available according to the same constructed search order.

[0276] The search order of the left neighboring block or the top neighboring block may be constructed identically.By determining whether motion information is available, at least one or more blocks from the left block and at least one or more blocks from the top block may be used to derive sub-block-unit inter candidates.

[0277] For example, the left neighboring block could be Fig.12 The blocks at A, B, C, ..., F, G in the figure can be obtained by Fig.12 The search order is constructed in the order of A, B, G or A, B blocks in the sub-block frame, and at least one or more blocks are used to obtain sub-block inter-frame prediction information.

[0278] For example, in Fig.12 In the embodiment, the top neighboring block may be a block at one or more positions of H, I, J, ..., N, O, and the sub-block inter-frame prediction information may be obtained using at least one or more blocks by constructing a search order in the order of O, N, I, H or O, N, H blocks.

[0279] The lower left, upper right, and upper left neighboring blocks may be searched in the same order. By determining whether motion information is available, at least one or more blocks from the upper left block, at least one or more blocks from the upper right block, and at least one or more blocks from the lower left block may be used to derive a sub-block unit inter-frame candidate.

[0280] For example, in Fig.12, the lower left neighboring block may be a block at A, ..., D, and the sub-block inter prediction information may be derived using at least one or more blocks by constructing a search order such as in the order of A, B, C, D or A, B, C or A, B blocks.

[0281] For example, in Fig.12 , the upper right neighboring block may be a block at L, ..., O, and the sub-block inter-frame prediction information may be derived using at least one or more blocks by constructing a search order such as in the order of O, N, M, L or O, N, M blocks.

[0282] For example, in Fig.12 , the upper left neighboring block may be a block at F, G, ..., I, J, and the sub-block inter-frame prediction information may be derived using at least one or more blocks by constructing a search order such as in the order of H, I, G, J, F or H, I, G blocks.

[0283] When the inter prediction mode of the current block is determined as the sub-block unit AMVP mode, the AMVP candidate list can be constructed in units of sub-blocks. The AMVP candidate list in units of sub-blocks can include N inter prediction information.

[0284] The sub-block-unit AMVP candidate list includes at least one or more of the following: inherited affine inter prediction information, combined affine inter prediction information, padded affine inter prediction information, and zero affine inter prediction information.

[0285] The inherited affine inter-frame prediction information may be a motion vector of a spatially neighboring block using affine encoding / decoding, and may be a CPMVP obtained from the CPMV relative to the current block by scaling the CPMV of the neighboring block according to the width and height of the current block and the neighboring block, as shown in Formula 1. The CPMV of the spatially neighboring block may be a sub-block unit motion vector of at least one of the upper left, upper right, lower left, or lower right of the block using affine encoding / decoding, and the sub-block unit motion vector at the upper left, upper right, or lower left of the current block (CPMVP of the current block) may be obtained by scaling the CPMV of the neighboring block according to the width and height of the current block and the neighboring block, as shown in Formula 1. Fig.12 In the embodiment, spatial neighboring blocks at A, B, ..., H, O can be searched, and one or more candidates including at least two or more CPMVP combinations (4 parameters, 6 parameters, ...) derived according to a predetermined order can be derived. The CPMV can be obtained by an additional search for the CPMVP, and the difference between the CPMV and the CPMVP can be additionally signaled.

[0286] For example, the combination of two CPMVPs (4 parameters) may be a combination of sub-block unit motion vectors obtained at the upper left and upper right of the current block.

[0287] For example, a combination of three CPMVPs (6 parameters) may be a combination of sub-block unit motion vectors obtained at the upper left, upper right, and lower left of the current block.

[0288] The left neighboring blocks may be blocks at A, B, C, . . . , F, G, and at least one or more inter-frame prediction information may be derived in a predetermined order.

[0289] For example, you can Fig.12 At least one or more inter-frame prediction information is obtained based on the order of the A and B blocks in the frame.

[0290] The top neighboring blocks may be blocks at H, I, J, . . . , N, O, and at least one or more inter-frame prediction information may be derived in a predetermined order.

[0291] For example, you can Fig.12 The order of O, N, H blocks in the block derives at least one or more inter-frame prediction information.

[0292] The combined affine inter prediction information can be Fig.12 The motion vector combination of the neighboring blocks adjacent to the upper left (CP1), upper right (CP2) and lower left (CP3) in the image. The motion vector of the neighboring block can be used as the CPMVP. Candidates including at least two or more CPMV combinations (4 parameters, 6 parameters, ...) can be constructed, and when all CPMVPs exist and have the same reference index, they can be added to the candidate list and can be added as candidates.

[0293] For example, in Fig.12 The motion vectors at H, I, and G in can be used as CP1, which is the upper left CPMVP.

[0294] For example, in Fig.12 The motion vectors at N and O in can be used as CP2, which is the upper right CPMVP.

[0295] For example, in Fig.12 The motion vectors at B and A in the figure can be used as CP3, which is the lower left CPMVP.

[0296] For example, in the case of 4-parameter combination affine, the motion vectors of the upper left (CP1) and the upper right (CP2) can be used as the CPMVP combination.

[0297] For example, in the case of 6-parameter combination affine, the motion vectors of the upper left (CP1), upper right (CP2), and lower left (CP3) may be used as the CPMVP combination.

[0298] When the maximum candidate list of the sub-block unit AMVP mode is not filled, the candidate list may be filled with CPMVP for combining affine inter prediction information as filling affine motion information.

[0299] For example, the motion vector CPI at the upper left position may be stored as CPMVP at the upper left, upper right, and lower left and configured as candidates.

[0300] For example, the motion vector CP2 at the upper right position may be stored as CPMVP at the upper left, upper right, and lower left, and configured as a candidate.

[0301] For example, the motion vector CP3 at the lower left position may be stored as CPMVP at the upper left, upper right, and lower left, and configured as a candidate.

[0302] When the maximum candidate list of the sub-block unit AMVP mode is not filled, the candidate list may be filled with zero motion information.

[0303] When the inter prediction mode is determined as the sub-block unit AMVP mode, the same search order of adjacent blocks can be constructed to construct a candidate list of the sub-block unit inter prediction mode. The candidate list of the sub-block unit inter prediction mode can be used to derive ATMVP, inherited affine inter prediction information, and combined affine inter prediction information by determining whether motion information of adjacent blocks is available according to the same constructed search order.

[0304] The search order of the left neighboring block and the top neighboring block may be constructed in the same manner.By determining whether motion information is available, at least one block from the left block and at least one block from the top block may be used to derive sub-block-unit inter candidates.

[0305] For example, the left neighboring block could be Fig.12 The blocks at A, B, C, ..., F, G in the figure can be obtained by Fig.12 The search order is constructed in the order of A, B, G or A, B blocks in the sub-block unit, and at least one block is used to obtain the inter-frame prediction information of the sub-block unit.

[0306] For example, in Fig.12 In the example, the top adjacent block may be a block at one or more positions of H, I, J, ..., N, O, and may be obtained by Fig.12 The search order is constructed in the order of O, N, I, H or O, N, H blocks in the sub-block unit, and at least one block is used to obtain the inter-frame prediction information of the sub-block unit.

[0307] The search order of the lower left neighboring block, the upper right neighboring block, and the upper left neighboring block can be constructed in the same manner. By determining whether motion information is available, at least one block in the upper left block, at least one block in the upper right block, and at least one block in the lower left block can be used to derive a sub-block unit inter-frame candidate.

[0308] For example, in Fig.12 , the lower left neighboring block may be a block at A, ..., D, and the sub-block unit inter-frame prediction information may be obtained using at least one block by constructing a search order such as in the order of A, B, C, D or A, B, C or A, B blocks.

[0309] For example, in Fig.12 , the upper right neighboring block may be a block at L, ..., O, and the sub-block unit inter-frame prediction information may be obtained using at least one block by constructing a search order such as in the order of O, N, M, L or O, N, M blocks.

[0310] For example, in Fig.12 , the upper left neighboring block may be a block at F, G, ..., I, J, and the search order may be constructed in the order of H, I, G, J, F or H, I, G blocks, using at least one block to derive the sub-block unit inter-frame prediction information.

[0311] When the inter prediction mode of the current block is determined to be the MMVD mode, an MMVD candidate list may be constructed. The MMVD candidate list may include N inter prediction information.

[0312] The MMVD candidate list includes at least one of: inter prediction information of spatial neighboring blocks, inter prediction information of temporal neighboring blocks, and HMVP.

[0313] The MMVD candidates may include, for example, more than two lists.

[0314] For example, when obtaining the spatial motion information of adjacent blocks, Fig. 9 The spatial motion information of adjacent blocks is obtained by following the order of B, J, K, A, and F blocks.

[0315] For example, the positions of temporally neighboring blocks can be Fig.10 corresponds to the position a or b of the block existing in the previous picture.

[0316] The current block may be predicted by combining the MMVD candidates, the additional motion direction information, and the additional motion magnitude information.

[0317] For example, Fig.13 As shown, additional motion direction information of top, bottom, left and right may be signaled for a candidate motion vector.

[0318] For example, in addition to the candidate motion vectors, the size [1 / 4, 1 / 2, 1, 2, 4, 8, 16, 32] may also be signaled.

[0319] When the inter prediction mode of the current block is determined to be the MH intra mode, an MH intra candidate list may be constructed. The MH intra candidate list may include N inter prediction information.

[0320] The MH intra mode may be the same mode as the combined inter intra prediction (CIIP) mode.

[0321] The MH intra candidate list includes at least one of the following: inter prediction information of spatial neighboring blocks, inter prediction information of temporal neighboring blocks, and HMVP.

[0322] For example, the merge mode candidate list may be used as the MH intra candidate list.

[0323] When the inter prediction mode of the current block is determined to be a triangle mode, a triangle candidate list may be constructed. The triangle candidate list may include N inter prediction information.

[0324] The triangle candidate list includes at least one of: inter prediction information of spatially neighboring blocks and inter prediction information of temporally neighboring blocks.

[0325] By searching neighboring blocks in a predetermined order, a candidate list using unidirectional motion information can be constructed.

[0326] For example, Fig.14 As shown, motion information of spatially neighboring blocks at positions {A, B, C, D, E} may be used as candidates.

[0327] For example, Fig.14 As shown, motion information of temporal neighboring blocks at positions {F, G} may be used as candidates.

[0328] The motion information of the current block may be predicted by combining the motion combinations of the constructed candidate lists in a diagonal direction.

[0329] For example, Fig.15 As shown, two or more motion information may be combined in a diagonal direction of 45 degrees.

[0330] For example, Fig.15 As shown, two or more motion information may be combined in a diagonal direction of 135 degrees.

[0331] Inter-frame prediction and motion compensation / modification step (S420); inter-frame prediction and motion compensation / modification can be performed by using at least one of the following on the decoder in the inter-frame prediction of the current block: motion compensation, brightness compensation (IC), OBMC (overlapped block motion compensation), BIO (bidirectional optical flow), affine space motion prediction and compensation, and motion vector refinement.

[0332] Motion compensation may be performed in inter prediction and motion compensation / modification of the current block.

[0333] The candidate list may include one or more inter prediction candidates, and any one of the multiple inter prediction candidates may be selected. The selection may be performed based on a signaled flag or index. The inter prediction information of the selected inter prediction candidate may be set as the inter prediction information of the current block. The prediction block of the current block is generated using the set inter prediction information (at least one of a motion vector, a reference picture list, and a reference picture index).

[0334] In motion compensation, unidirectional motion information compensation may be performed.

[0335] For example, motion compensation may be performed using a block in one picture in one reference picture list L0.

[0336] For example, motion compensation may be performed by combining two or more blocks in one picture of one reference picture list L0.

[0337] For example, motion compensation may be performed by combining two or more blocks in two or more pictures of one reference picture list L0.

[0338] For example, motion compensation may be performed using a block in one picture in one reference picture list L1.

[0339] For example, motion compensation may be performed by combining two or more blocks in one picture of one reference picture list L1.

[0340] For example, motion compensation may be performed by combining two or more blocks in two or more pictures of one reference picture list L1.

[0341] In motion compensation, bidirectional motion information compensation can be performed.

[0342] For example, motion compensation may be performed by mixing one block of each of two reference picture lists L0 and L1.

[0343] For example, motion compensation may be performed by combining two or more blocks of two reference picture lists L0 and L1, respectively.

[0344] For example, motion compensation may be performed by combining two or more blocks in two or more pictures of two reference picture lists L0 and L1, respectively.

[0345] In inter prediction and motion compensation / modification of the current block, brightness compensation may be performed.

[0346] In motion compensation, changes in brightness / illuminance of a reference picture in which a block for motion compensation exists and a reference picture in which a current block exists may be compensated.

[0347] For example, brightness compensation can be performed by approximating changes in neighboring samples of the current block and neighboring samples of the reference block using a linear model of N or more arbitrary integers, and applying the linear model to the motion compensated block. The linear model can be defined as at least one of a weight or an offset.

[0348] In inter prediction and motion compensation / modification of the current block, overlapped block motion compensation (OBMC) may be performed.

[0349] The prediction block may be generated by combining a block compensated using inter prediction information of the current block with one or more blocks compensated using inter prediction information of at least one or more blocks among neighboring blocks of the current block.

[0350] For example, the prediction block may be generated by combining the left block and the right block based on the current block.

[0351] For example, a prediction block may be generated by combining a top block, a bottom block, a left block, and a right block based on the current block.

[0352] For example, the prediction block may be generated by combining one of the neighboring blocks based on the current block.

[0353] like Fig.16 As shown, a prediction block can be generated by combining a block compensated using sub-block unit inter-frame prediction information of a current block and one or more blocks compensated using inter-frame prediction information of at least one or more blocks in sub-blocks at the left, right, above, and below the corresponding sub-block in the current block.

[0354] For example, it may be performed only on the sub-blocks located at the boundary position in the current block.

[0355] For example, it can be performed on all sub-blocks in the current block.

[0356] For example, the process may be performed only on the sub-block located at the left boundary of the current block.

[0357] For example, the process may be performed only on the sub-block located at the right boundary position in the current block. For example, the process may be performed only on the sub-block located at the boundary position of at least one of the top or the bottom of the current block.

[0358] Bidirectional optical flow (BIO) may be performed for inter prediction and motion compensation / modification of the current block.

[0359] The motion vector of the current block can be obtained through the optical flow of the block in a unidirectional position.

[0360] The motion vector of the current block may be obtained by using blocks existing in previous and subsequent pictures of the current picture in a display order with a bidirectional optical flow.

[0361] Blocks existing in previous pictures and subsequent pictures may be blocks similar to the current picture with opposite motion.

[0362] In the case of the MH intra mode, the intra prediction mode may be used to modify a prediction block (hereinafter referred to as a first prediction block) for motion compensation using inter prediction information of a candidate in the MH intra candidate list. Specifically, a modified prediction block (hereinafter referred to as a third prediction block) may be generated by modifying the first prediction block using a prediction block (hereinafter referred to as a second prediction block) generated in the intra prediction mode.

[0363] The MH intra mode may be the same mode as the combined inter intra prediction (CIIP) mode.

[0364] The intra-frame prediction mode can be derived based on the MPM candidate as described above, or can be an intra-frame prediction mode predefined in the encoding / decoding device. Here, the predefined intra-frame prediction mode can be a directional mode or a non-directional mode. For example, in the encoding / decoding device, the intra-frame prediction mode can be fixed to one of the following: planar mode, DC mode, vertical mode or horizontal mode.

[0365] For example, in the case of the MH intra mode, the intra prediction mode of the current block may be set to the planar mode, and the first prediction block may be modified using the second prediction block generated using the planar mode. However, the present disclosure is not limited thereto, and an intra prediction mode having an average value of adjacent reference pixels may be used, or an intra prediction mode having a horizontal mode or a vertical mode may be used.

[0366] Generating the third prediction block by modifying the first prediction block using the second prediction block can be performed by multiplying each sample of the first prediction block and the second prediction block by a weight. For example, this can be performed by the following Equation 2.

[0367] [Formula 2]

[0368] CU_PredSamp[x][y]=(w*1st-Predsamp[x][y]+(4-w)*2rd-Predsamp[x][y]+offeet)>>2

[0369] Here, CU_PredSamp represents a sample of a modified prediction block (third prediction block) of the current block, 1st_Predsamp represents a sample of a first prediction block, 2rd_Predsamp represents a sample of a second prediction block, olfset represents an offset, w represents a weight, and x, y represent x and y coordinates of a Cartesian coordinate system, where x can represent from 0 to cbWidth (the width of the current block) -1, and y can represent from 0 to bHeight (the height of the current block) -1.

[0370] The weight may be a pre-agreed fixed value or a value variably determined by the above-mentioned coding parameters. Specifically, the weight may be performed in consideration of the availability and prediction mode of the adjacent blocks. The adjacent block may mean at least one of the top block or the left block. When there are multiple blocks at the top of the current block, the rightmost block or the leftmost block may be used as the top block. When there are multiple blocks at the left side of the current block, the bottommost block or the topmost block may be used as the left block.

[0371] For example, when the prediction mode of the neighboring block is the intra prediction mode and the availability of the neighboring blocks is all recognized, the weight w may be set to 1. When all prediction modes of the neighboring blocks are not the intra prediction mode, the weight may be set to 3. When the availability of the neighboring block is not recognized, the weight may be set to 2.

[0372] The offset may be a natural number of 0, 1, 2, 3 or more. The offset may be a pre-agreed fixed value, or may be variably determined by the above encoding parameters. For example, the offset may be fixed to 2.

[0373] The modification according to the MH intra mode may be selectively performed based on the above-mentioned MH intra flag. The MH intra flag may be a value of 0, 1 or greater.

[0374] Specifically, when the MH intra-frame flag is a first value (eg, 1), it specifies that the MH intra-frame mode is used, and when the MH intra-frame flag is a second value (eg, 0), it specifies that the MH intra-frame mode is not used.

[0375] The MH intra-frame flag may be encoded and signaled by the encoding apparatus based on at least one of: a slice type, whether a skip mode is used, and a width and height of a current block.

[0376] For example, the MH intra-frame flag may be signaled only when the slice type is a B slice. For example, the MH intra-frame flag may be signaled only when the skip mode is not applied. For example, the MH intra-frame flag may be signaled only when the width and height of the current block are respectively less than a predetermined first threshold. Here, the first threshold may be an integer of 64, 128 or more. For example, the MH intra-frame flag may be signaled only when the product of the width and height of the current block is equal to or greater than a second predetermined threshold. Here, the second threshold may be an integer of 32, 64, 128 or more. However, the second threshold may be set to be less than the first threshold.

[0377] In addition, the MH intra-frame flag may be signaled only when the conditions obtained by combining at least two of the above examples are met. For example, the MH intra-frame flag may be signaled only when the slice type is a B slice, the skip mode is not applied, the product of the width and height of the current block is 64 or more, and the width and height of the current block are each greater than 128.

[0378] When the MH intra flag is not signaled, the MH intra flag value may have a predetermined fixed value (e.g., 0 or 1) or may have a variable value based on the inter prediction mode, the size of the current block, etc. For example, when the inter prediction mode is a sub-block unit prediction mode, the MH intra flag may be set to a second value (e.g., 0).

[0379] Specifically, the MH intra-frame flag can be set to a first value (e.g., 1) when at least one of the following conditions is met: merge mode is applied, sub-block unit prediction mode is not applied, skip mode is not applied, the width and height of the current block are less than 128, or the product of the width and height of the current block is 64 or greater.

[0380] Hereinafter, in case of the MH intra mode, a method of generating a second prediction block of a current block based on intra prediction will be described.

[0381] The intra prediction may be generated by constructing reference samples to be used for prediction of the current block and generating intra prediction samples using the constructed reference samples.

[0382] Constructing the reference sample may include using the neighboring blocks of the current block to be encoded / decoded to construct the reference sample. Here, using the neighboring blocks may include: using all or part of the samples in the neighboring blocks, or using the average value, weighted average value, representative value, most frequent value, minimum value, maximum value, etc. of the samples in the neighboring blocks. For example, all samples in the neighboring blocks that are adjacent to at least one space in the left part or the top part of the target block may be used to construct the reference sample.

[0383] Constructing the reference sample may include at least one of: determining whether the reference sample is available, replacing the reference sample, or filtering the reference sample.

[0384] Determining whether the reference sample is available may include determining whether the constructed reference sample is available. For example, when the block including the reference sample is not encoded or decoded or when the reference sample exists outside the boundary of a picture, a slice, a tile, an entropy slice, a wavefront (WPP, wavefront parallel processing), etc., it can be determined that the reference sample is not available. Alternatively, when the block including the reference sample is an inter-frame mode coded block in an environment using constrained intra prediction (CIP), it can be determined that the reference sample is not available.

[0385] Replacing the reference sample may include replacing the reference sample according to the result of determining whether the reference sample is available. Specifically, it may include replacing a sample value whose availability is not identified in the constructed reference sample with another sample value.

[0386] Another sample value may be any one of the samples in which availability is identified in the constructed reference sample. In addition, this may include: a pre-agreed fixed value, a value variably determined by the above-mentioned encoding parameter (for example, a value variably determined by the bit depth). Here, any one of the samples in which availability is identified may be adjacent to the top, bottom, left, or right of the sample in which availability is not identified.

[0387] The filtering of the reference sample may be a step of filtering the constructed reference pixel to improve the prediction efficiency. The filtering target sample may be filtered using at least one of the filtering target sample or the adjacent samples of the filtering target sample. The filtering may be performed by the average value, weighted average value, most frequent value, maximum value, minimum value or representative value of the sample, or may be performed by an n-tap filter. Here, n may include a natural number of 1, 2, 3, 4 or more, and may be a pre-agreed fixed value or a value variably determined by the above-mentioned coding parameters. For example, the filtering may be a 3-tap filter with [1 / 4, 2 / 4, 1 / 4].

[0388] In addition, whether to perform the filtering step can be determined by a flag. The flag can be determined according to the intra-frame prediction mode. For example, when the intra-frame prediction mode is a plane mode, filtering can be applied. Alternatively, it can be pre-listed and determined whether to apply filtering to the reference sample according to the intra-frame prediction mode of the prediction target block.

[0389] Alternatively, when applying filtering to the reference sample, it can be determined whether to apply filtering to the reference sample according to the color component of the prediction target block. For example, if the color component is a luminance signal, filtering can be applied to the reference sample, and if the color component is a chrominance signal, filtering cannot be applied to the reference sample.

[0390] Generating intra prediction samples may be a step of generating intra prediction samples using the constructed reference samples. The method of generating prediction samples may vary according to the intra prediction mode. Here, as described above, the intra prediction mode may be classified into a non-directional prediction mode and a directional prediction mode.

[0391] The non-directional prediction mode may include a DC mode and a plane mode. In the DC mode, a fixed value may be used as a prediction value of a sample in a prediction target block. For example, in the DC mode, a fixed value may be obtained by averaging the sample values ​​around the prediction target block. In the plane mode, vertical interpolation and horizontal interpolation may be performed using samples vertically adjacent to the prediction target block and samples horizontally adjacent to the prediction target block, and their average values ​​may be used as prediction values ​​of samples in the prediction target block.

[0392] The directional prediction mode is a mode indicating the direction in which the reference sample is located, and the corresponding direction may be indicated as the angle between the prediction target sample and the reference sample in the prediction target block. The directional prediction mode may be referred to as an angle mode, and may include a vertical mode, a horizontal mode, and the like. The vertical mode may use the sample values ​​adjacent to the prediction target block in the vertical direction as the prediction value of the sample in the prediction target block, while the horizontal mode may use the sample values ​​adjacent to the prediction target block in the horizontal direction as the prediction value of the sample in the prediction target block. In addition, an angle mode other than the vertical mode and the horizontal mode may derive a prediction value of a sample in the prediction target block by using a reference sample located at a predetermined angle and / or direction for each mode.

[0393] When the intra prediction mode of the current block is a planar mode, the prediction value of the prediction target sample of the current block can be obtained by using at least one of a first reference sample variably determined according to the position of the prediction target sample and a second reference sample fixed independently of the position of the prediction target sample. Here, the first reference sample is a reference sample located on the same horizontal line as the prediction target sample (i.e., a reference sample having the same x-coordinate value as the prediction target sample) or a reference sample located on the same vertical line as the prediction target sample (i.e., a reference sample having the same y-coordinate value as the prediction target sample). The second reference sample may include at least one of the following: a sample adjacent to the upper right corner of the current block among a plurality of adjacent samples adjacent to the top boundary of the current block, a sample adjacent to the lower left corner of the current block among a plurality of adjacent samples adjacent to the left boundary of the current block, or an adjacent sample adjacent to the upper left corner of the current block.

[0394] In addition, in the case of planar mode, the prediction sample can be generated by Equation 3.

[0395] [Formula 3]

[0396] predV[x][y]=((nTbH-1-y)*p{x][-1]+(y+1)*p[-1][nTbH])<<Log2(nTbW)

[0397] predH[x][y]=((nTbW-1-x)*p[-1][y]+(x+1)*p[nTbW][-1])<<Log2(nTbH)

[0398] predSamples[x][y]=(predV[x][y]+predH[x][y]+nTbV*nTbH)>>Log2(nTbW)+Log2(nTbH)+1)

[0399] Here, p[x][y] represents a reference sample, predSamples[x][y] represents a predicted sample, nTbW and nTbH represent the width and height of the transform block, respectively, and x can represent an x ​​coordinate from 0 to nTbW-1, and y can represent a y coordinate from 0 to nTbH-1.

[0400] Specifically, PredV can be obtained by multiplying a first reference sample variably determined according to the position of x and a second reference sample adjacent to the lower left corner of the current block determined independently of the position of x by a weight, and PredH can be obtained by multiplying a first reference sample variably determined according to the position of y and a second reference sample adjacent to the upper right corner of the current block determined independently of the position of y by a weight. The predicted samples (predSamples[x][y]) can be obtained by weighted averaging of PredV and PredH. In this case, the weight of the weighted average can be expressed as [1:k] or [k:1]. The absolute value of k can be 0, 1, 2, 3, 4 or more, and k can be a positive value or a negative value.

[0401] Affine spatial motion prediction and compensation may be performed on inter prediction and motion compensation / modification of the current block.

[0402] A motion vector of each pixel of the current block may be generated by using an affine transformation equation and motion vectors at the upper left and upper right of the current block, and motion compensation may be performed by using the motion vector.

[0403] A motion vector in units of a sub-block of the current block may be generated by using an affine transformation equation and motion vectors at the upper left and upper right of the current block, and motion compensation may be performed by using the motion vector.

[0404] The motion vectors at the upper left and upper right of the current block may be transmitted.

[0405] The motion vectors at the upper left and upper right of the current block may be transmitted using only the differences between adjacent motion vectors of the corresponding vectors.

[0406] The motion vectors at the upper left and upper right of the current block can be derived by using the affine motion vectors of the current neighboring blocks without transmission.

[0407] Affine space motion compensation can be performed by adaptively using not only the upper left motion vector and the upper right motion vector but also the lower left motion vector.

[0408] Affine spatial motion compensation may be performed by adaptively using the upper left, upper right, and lower left motion vectors of the current block.

[0409] In inter prediction and motion compensation / modification of the current block, motion vector modification may be performed at the decoder.

[0410] The motion vector in the current block may be modified in the current block by using the motion vector transmitted to the decoder.

[0411] For example, Fig.17 As shown, the motion vector of the current block can be optimized using the best matching block by searching the neighboring blocks indicated by the obtained MV0 and MV1.

[0412] When performing inter-prediction information modification under bilateral matching, SAD can be used to derive block matches.

[0413] For example, the two blocks with the lowest SAD or MR-SAD may be indicated as the best match.

[0414] Industrial availability

[0415] The embodiments of the present disclosure as described above may be used in an apparatus or method for decoding / encoding a video or an image.

[0416] Additionally, the present technology may also be configured as follows.

[0417] (1) An image decoding method, comprising:

[0418] Determining at least one of a plurality of inter prediction modes as an inter prediction mode of a current block;

[0419] constructing an inter prediction candidate list based on the determined inter prediction mode;

[0420] generating a first prediction block of the current block by performing motion compensation based on any one prediction candidate in the inter prediction candidate list; and

[0421] The first prediction block is modified using a predetermined intra prediction mode.

[0422] (2) The image decoding method according to (1), wherein the modification comprises:

[0423] generating a second prediction block of the current block based on the intra prediction mode; and

[0424] The first prediction block and the second prediction block are combined.

[0425] (3) The image decoding method according to (1), wherein the intra prediction mode is a fixed mode agreed in advance in the decoding device.

[0426] (4) The image decoding method according to (3), wherein the predetermined fixed mode is either a planar mode or a DC mode.

[0427] (5) The image decoding method according to (1), wherein the inter prediction candidate list includes at least one of a spatial merging candidate and a temporal merging candidate.

[0428] (6) The image decoding method according to (5), wherein the inter prediction candidate list also includes a combined merge candidate, and

[0429] The combined merge candidate is obtained by averaging at least two merge candidates belonging to the inter-frame prediction candidate list.

[0430] (7) The image decoding method according to (1), wherein the modification of the first prediction block is selectively performed according to a flag indicating whether to perform modification based on intra prediction.

[0431] (8) The image decoding method according to (7), wherein the flag is signaled or derived by considering at least one of a type of a slice to which the current block belongs, an inter-frame prediction mode of the current block, or a size of the current block.

[0432] (9) An image encoding method, comprising:

[0433] Determining at least one of a plurality of inter prediction modes as an inter prediction mode of a current block;

[0434] constructing an inter prediction candidate list based on the determined inter prediction mode;

[0435] generating a first prediction block of the current block by performing motion compensation based on any one prediction candidate in the inter prediction candidate list; and

[0436] The first prediction block is modified using a predetermined intra prediction mode.

[0437] (10) A non-transitory computer-readable storage medium storing a bit stream decoded by an image decoding method, the image decoding method comprising:

[0438] Determining at least one of a plurality of inter prediction modes as an inter prediction mode of a current block;

[0439] constructing an inter prediction candidate list based on the determined inter prediction mode;

[0440] generating a first prediction block of the current block by performing motion compensation based on any one prediction candidate in the inter prediction candidate list; and

[0441] The first prediction block is modified using a predetermined intra prediction mode.

Claims

1. A method for decoding an image, comprising: constructing an inter-frame prediction candidate list for a current block in the image, the inter-frame prediction candidate list comprising a plurality of merge candidates; generating a first prediction block of the current block by performing inter prediction based on one of the plurality of merge candidates included in the inter prediction candidate list; generating a second prediction block of the current block based on a predefined intra prediction mode in a decoding device, the predefined intra prediction mode representing a planar mode; generating a final prediction block of the current block based on a weighted sum of the first prediction block and the second prediction block; Generate a residual block of the current block by performing inverse quantization and inverse transformation on the quantized coefficients of the current block; as well as reconstructing the current block based on the prediction block and the residual block, The weight used for the weighted sum is determined based on whether the prediction mode of a neighboring block adjacent to the current block is an intra mode.

2. The method according to claim 1, wherein: The inter prediction candidate list includes at least one of a spatial merging candidate and a temporal merging candidate.

3. The method according to claim 2, wherein: The inter prediction candidate list also includes a combined merge candidate, and The motion vector of the combined merge candidate is obtained as: an average value between the motion vectors of at least two merge candidates belonging to the inter-frame prediction candidate list.

4. The method according to claim 3, wherein: The weighted sum of the first prediction block and the second prediction block is selectively performed based on a flag indicating whether the final prediction block of the current block is generated based on the weighted sum of the first prediction block and the second prediction block.

5. The method according to claim 4, wherein: The flag is adaptively signaled or derived based on at least one of a type of a slice to which the current block belongs and the inter prediction mode of the current block.

6. A method for encoding an image, comprising: constructing an inter-frame prediction candidate list for a current block in the image, the inter-frame prediction candidate list comprising a plurality of merge candidates; generating a first prediction block of the current block by performing inter prediction based on one of the plurality of merge candidates included in the inter prediction candidate list; generating a second prediction block of the current block based on a predefined intra prediction mode in the encoding device, the predefined intra prediction mode representing a planar mode; generating a final prediction block of the current block based on a weighted sum of the first prediction block and the second prediction block; generating a residual block of the current block based on the final prediction block of the current block; Generate quantization coefficients by performing transformation and quantization on the residual block; as well as The quantized coefficients are encoded to generate a bitstream, The weight used for the weighted sum is determined based on whether the prediction mode of a neighboring block adjacent to the current block is an intra mode.

7. A non-transitory computer-readable storage medium for storing data associated with a video signal, comprising: A bitstream generated by an encoding method, the encoding method comprising: Constructing an inter-frame prediction candidate list for a current block, wherein the inter-frame prediction candidate list includes a plurality of merge candidates; generating a first prediction block of the current block by performing inter prediction based on one of the plurality of merge candidates included in the inter prediction candidate list; generating a second prediction block of the current block based on a predefined intra prediction mode, the predefined intra prediction mode representing a planar mode; generating a final prediction block of the current block based on a weighted sum of the first prediction block and the second prediction block; generating a residual block of the current block based on the final prediction block of the current block; Generate a quantization coefficient by performing transformation and quantization on the residual block; and Encode the quantized coefficients, The weight used for the weighted sum is determined based on whether the prediction mode of a neighboring block adjacent to the current block is an intra mode.

Citation Information

Patent Citations

  • KR2019/018741