Image encoding / decoding method and device for deriving weight index of bidirectional prediction and method for transmitting bit stream

Through the affine merging mode and weight indexing technology of inter prediction mode, the image encoding/decoding efficiency is improved, the problem of high-resolution image transmission cost is solved, and efficient image encoding and decoding is achieved.

CN114342375BActive Publication Date: 2024-11-19LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080062509.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-08-08
Filing Date
2020-07-06
Publication Date
2024-11-19
Estimated Expiration
2040-07-06

AI Technical Summary

Technical Problem

The prior art is difficult to effectively compress and transmit high-resolution, high-quality images, resulting in increased transmission and storage costs.

Method used

Using an image encoding/decoding method, motion information is derived through the affine merge mode of the inter prediction mode, a weight index for double prediction is generated, and used for inter prediction and encoding of images.

Benefits of technology

Improve image encoding/decoding efficiency, reduce the amount of bits transmitted, reduce storage and transmission costs, while supporting efficient transmission and storage of high-resolution and high-quality images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114342375B_ABST
    Figure CN114342375B_ABST
Patent Text Reader

Abstract

Provided is an image encoding / decoding method and device. The image decoding method for decoding an image according to the image decoding device of the present disclosure includes the following steps: restoring the inter-frame prediction mode of the current block; if the inter-frame prediction mode of the current block is the affine merge mode, deriving an affine merge candidate based on the peripheral blocks of the current block; deriving motion information about the current block based on motion information about the affine merge candidate; performing inter-frame prediction on the current block based on the motion information about the current block to generate a prediction block of the current block; and restoring the current block based on the prediction block, wherein the motion information may include a bidirectional prediction weight index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to an image encoding / decoding method and device and a method for sending a bit stream, and more specifically, to an image encoding / decoding method and device for deriving a weight index for dual prediction and a method for sending a bit stream generated by the image encoding method / device of the present disclosure. Background Art

[0002] Recently, the demand for high-resolution and high-quality images, such as high-definition (HD) images and ultra-high-definition (UHD) images, is increasing in various fields. As the resolution and quality of image data are improved, the amount of information or bit volume transmitted is relatively increased compared to existing image data. The increase in the amount of information or bit volume transmitted leads to an increase in transmission cost and storage cost.

[0003] Therefore, efficient image compression technology is needed to effectively transmit, store, and reproduce information about high-resolution and high-quality images. Summary of the invention

[0004] Technical issues

[0005] An object of the present disclosure is to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.

[0006] Another object of the present disclosure is to provide an image encoding / decoding method and device for deriving a weight index for bi-prediction.

[0007] Another object of the present disclosure is to provide a method for transmitting a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0008] Another object of the present disclosure is to provide a recording medium storing a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0009] Another object of the present disclosure is to provide a recording medium storing a bit stream received and decoded by the image decoding apparatus according to the present disclosure and used to reconstruct an image.

[0010] The technical problems solved by the present disclosure are not limited to the above-mentioned technical problems, and other technical problems not described here will be clear to those skilled in the art through the following description.

[0011] Technical Solution

[0012] According to an aspect of the present disclosure, an image decoding method may include: reconstructing an inter-frame prediction mode of a current block; deriving an affine merging candidate based on a neighboring block of the current block based on the inter-frame prediction mode of the current block being an affine merging mode; deriving motion information of the current block based on motion information of the affine merging candidate; generating a prediction block of the current block by performing inter-frame prediction on the current block based on the motion information of the current block; and reconstructing the current block based on the prediction block. The motion information may include a weight index for dual prediction.

[0013] In the image decoding method according to the present disclosure, the affine merging candidate may include constructing the affine merging candidate, and deriving the constructed affine merging candidate based on a combination of predetermined control points (CPs).

[0014] In the image decoding method according to the present disclosure, the motion information of each CP in the combination may be derived based on the motion information of the candidate blocks of the CP.

[0015] In the image decoding method according to the present disclosure, when a plurality of candidate blocks exist for a CP, the candidate blocks may be checked in a predetermined order, and the motion information of the CP may be derived based on the motion information of the first candidate block available in the predetermined order.

[0016] In the image decoding method according to the present disclosure, the motion information of the CP may include a weight index based on whether the CP is the upper left CP or the upper right CP of the current block, and the motion information of the CP may not include a weight index based on whether the CP is the lower left CP or the lower right CP of the current block.

[0017] In the image decoding method according to the present disclosure, the plurality of CPs in combination may have a predetermined order, and a weight index for constructing an affine merging candidate may be derived based on the predetermined order.

[0018] In the image decoding method according to the present disclosure, the weight index for constructing the affine merging candidate may be derived as the weight index of the first CP in the combination.

[0019] In the image decoding method according to the present disclosure, the plurality of CPs in the combination may have a predetermined order, and a weight index for constructing an affine merging candidate is derived based on the predetermined order and information on a prediction direction of the combination.

[0020] In the image decoding method according to the present disclosure, the information about the combined prediction direction may include whether the prediction direction L0 is available and whether the prediction direction L1 is available.

[0021] In the image decoding method according to the present disclosure, based on the fact that both the prediction direction L0 and the prediction direction L1 of the combination are available, the weight index for constructing the affine merge candidate may be derived as the weight index of the first CP in the combination.

[0022] In the image decoding method according to the present disclosure, based on the unavailability of the combined prediction direction L0 or the prediction direction L1, the weight index for constructing the affine merging candidate may be derived as a predetermined weight index.

[0023] In the image decoding method according to the present disclosure, the predetermined weight is an index that specifies that the weight applied to the prediction direction L0 and the weight applied to the prediction direction L1 are equal.

[0024] According to another aspect of the present disclosure, an image decoding device may include a memory and at least one processor. The at least one processor may: reconstruct an inter-frame prediction mode of a current block; based on the inter-frame prediction mode of the current block being an affine merge mode, derive an affine merge candidate based on a neighboring block of the current block; derive motion information of the current block based on motion information of the affine merge candidate; generate a prediction block of the current block by performing inter-frame prediction on the current block based on the motion information of the current block; and reconstruct the current block based on the prediction block. The motion information may include a weight index for dual prediction.

[0025] According to another aspect of the present disclosure, an image encoding method may include: generating a prediction block of a current block by performing inter-frame prediction on the current block based on the motion information of the current block; encoding the current block based on the prediction block; and encoding the motion information of the current block. The step of encoding the motion information of the current block may include: determining the inter-frame prediction mode of the current block; deriving an affine merging candidate based on the neighboring blocks of the current block based on the inter-frame prediction mode of the current block being an affine merging mode; and encoding the motion information of the current block based on the motion information of the affine merging candidate. The motion information may include a weight index for dual prediction.

[0026] In addition, a computer-readable recording medium according to another aspect of the present disclosure may store a bit stream generated by the image encoding device or the image encoding method of the present disclosure.

[0027] The features described above in brief summary of the present disclosure are merely exemplary aspects of the following detailed description of the present disclosure and do not limit the scope of the present disclosure.

[0028] Beneficial Effects

[0029] According to the present disclosure, it is possible to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.

[0030] Furthermore, according to the present disclosure, it is possible to provide an image encoding / decoding method and apparatus for deriving a weight index for bi-prediction.

[0031] Furthermore, according to the present disclosure, it is possible to provide a method of transmitting a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0032] Furthermore, according to the present disclosure, it is possible to provide a recording medium storing a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0033] Furthermore, according to the present disclosure, it is possible to provide a recording medium that stores a bit stream received and decoded by the image decoding device according to the present disclosure and used to reconstruct an image.

[0034] Those skilled in the art will understand that the effects that can be achieved through the present disclosure are not limited to what has been specifically described above, and other advantages of the present disclosure will be more clearly understood from the detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 FIG. 4 is a diagram schematically illustrating a video encoding system to which an embodiment of the present disclosure is applicable.

[0036] Figure 2 is a view schematically illustrating an image encoding device to which an embodiment of the present disclosure is applicable.

[0037] Figure 3 is a view schematically illustrating an image decoding device to which an embodiment of the present disclosure is applicable.

[0038] Figure 4 is a flowchart illustrating a video / image encoding method based on inter-frame prediction.

[0039] Figure 5 is a view illustrating a configuration of the inter prediction unit 180 according to the present disclosure.

[0040] Figure 6 is a flowchart illustrating a video / image decoding method based on inter-frame prediction.

[0041] Figure 7 is a view illustrating a configuration of the inter prediction unit 260 according to the present disclosure.

[0042] Figure 8 is a view illustrating neighboring blocks that can be used as spatial merging candidates.

[0043] Fig. 9 is a view schematically illustrating a method for constructing a merge candidate list according to an example of the present disclosure.

[0044] Fig.10 is a diagram illustrating candidate pairs for redundancy check performed on spatial candidates.

[0045] Fig.11 is a view illustrating a method of scaling a motion vector of a temporal candidate.

[0046] Fig.12is a view illustrating the position of deriving the temporal candidate.

[0047] Fig.13 is a view schematically illustrating a motion vector predictor candidate list configuration method according to an example of the present disclosure.

[0048] Fig.14 is a view illustrating a parametric model of an affine pattern.

[0049] Fig.15 is a view illustrating a method of generating an affine merge candidate list.

[0050] Fig.16 is a view illustrating neighboring blocks used to derive inheritance affine candidates.

[0051] Fig.17 is a view illustrating a control point motion vector (CPMV) derived from neighboring blocks.

[0052] Fig.18 is a view illustrating neighboring blocks used to derive and construct affine merge candidates.

[0053] Fig.19 is a view illustrating a method of generating an affine MVP candidate list.

[0054] Fig. 20 is a view illustrating a method of deriving a motion vector field according to a sub-block based TMVP mode.

[0055] Fig.21 is a view illustrating a method of deriving a weight index for constructing an affine merge candidate according to another embodiment of the present disclosure.

[0056] Fig. 22 is a view illustrating a method of inferring and constructing an affine merge candidate according to another embodiment of the present disclosure.

[0057] Fig.23 is a view exemplarily illustrating a method of deriving information on each CP of a current block.

[0058] Fig.24 is a view exemplarily illustrating a method of deriving and constructing affine merging candidates based on information derived for each CP.

[0059] Fig.25 is a view exemplarily illustrating a method of deriving a weight index for constructing an affine merge candidate.

[0060] Fig.26 is a diagram showing a content streaming system to which an embodiment of the present disclosure is applicable. DETAILED DESCRIPTION

[0061] Hereinafter, the embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to facilitate implementation by those skilled in the art. However, the present disclosure can be implemented in various forms and is not limited to the embodiments described herein.

[0062] When describing the present disclosure, if it is determined that the detailed description of related known functions or configurations makes the scope of the present disclosure unnecessarily ambiguous, the detailed description thereof will be omitted. In the drawings, parts irrelevant to the description of the present disclosure are omitted, and like reference numerals are given to like parts.

[0063] In the present disclosure, when a component is "connected", "coupled" or "linked" to another component, it may include not only a direct connection relationship but also an indirect connection relationship with intermediate components. In addition, when a component "includes" or "has" other components, unless otherwise specified, it means that other components may also be included, rather than excluding other components.

[0064] In the present disclosure, the terms first, second, etc. are used only for the purpose of distinguishing one component from other components, and do not limit the order or importance of the components unless otherwise specified. Accordingly, within the scope of the present disclosure, a first component in one embodiment may be referred to as a second component in another embodiment, and similarly, a second component in one embodiment may be referred to as a first component in another embodiment.

[0065] In the present disclosure, components that are distinguished from each other are intended to clearly describe each feature and do not mean that the components must be separated. That is, multiple components can be integrated and implemented in one hardware or software unit, or one component can be distributed and implemented in multiple hardware or software units. Therefore, even if not specifically stated, implementations in which these components are integrated or distributed are also included in the scope of the present disclosure.

[0066] In the present disclosure, the components described in each embodiment are not necessarily indispensable components, and some components may be optional components. Therefore, the embodiments consisting of a subset of the components described in the embodiments are also included in the scope of the present disclosure. In addition, the embodiments including other components in addition to the components described in the various embodiments are included in the scope of the present disclosure.

[0067] The present disclosure relates to encoding and decoding of images. Unless otherwise defined in the present disclosure, terms used in the present disclosure may have general meanings commonly used in the technical field to which the present disclosure belongs.

[0068] In the present disclosure, a "picture" generally refers to a unit representing an image within a specific time period, and a slice / tile is a coding unit constituting a part of a picture, and a picture may be composed of one or more slices / tiles. In addition, a slice / tile may include one or more coding tree units (CTUs).

[0069] In the present disclosure, "pixel" or "pel" may refer to the smallest unit constituting a picture (or image). In addition, "sample" may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a pixel value, or may represent only a pixel / pixel value of a luminance component or only a pixel / pixel value of a chrominance component.

[0070] In the present disclosure, a "unit" may refer to a basic unit of image processing. The unit may include at least one of a specific area of ​​a picture and information related to the area. In some cases, the unit may be used interchangeably with terms such as "sample array", "block" or "area". In general, an M×N block may include M columns and N rows of samples (or sample arrays) or a set (or array) of transform coefficients.

[0071] In the present disclosure, "current block" may mean one of "current coding block", "current coding unit", "coding target block", "decoding target block" or "processing target block". When prediction is performed, "current block" may mean "current prediction block" or "prediction target block". When transform (inverse transform) / quantization (dequantization) is performed, "current block" may mean "current transform block" or "transform target block". When filtering is performed, "current block" may mean "filtering target block".

[0072] In the present disclosure, the term " / " or "," may be interpreted as indicating "and / or". For example, "A / B" and "A, B" may mean "A and / or B". In addition, "A / B / C" and "A / B / C" may mean "at least one of A, B, and / or C".

[0073] In the present disclosure, the term "or" should be interpreted to indicate "and / or". For example, the expression "A or B" may include 1) only "A", 2) only "B", or 3) both "A and B". In other words, in the present disclosure, "or" should be interpreted to indicate "additionally or alternatively".

[0074] Overview of Video Coding Systems

[0075] Figure 1 is a diagram schematically illustrating a video encoding system according to the present disclosure.

[0076] The video encoding system according to the embodiment may include an encoding device 10 and a decoding device 20. The encoding device 10 may deliver the encoded video and / or image information or data to the decoding device 20 via a digital storage medium or a network in the form of a file or a stream.

[0077] The encoding device 10 according to the embodiment may include a video source generator 11, an encoding unit 12, and a transmitter 13. The decoding device 20 according to the embodiment may include a receiver 21, a decoding unit 22, and a renderer 23. The encoding unit 12 may be called a video / image encoding unit, and the decoding unit 22 may be called a video / image decoding unit. The transmitter 13 may be included in the encoding unit 12. The receiver 21 may be included in the decoding unit 22. The renderer 23 may include a display and the display may be configured as a separate device or an external component.

[0078] The video source generator 11 can obtain the video / image by the process of capturing, synthesizing or generating the video / image. The video source generator 11 may include a video / image capturing device and / or a video / image generating device. The video / image capturing device may include, for example, one or more cameras, a video / image archive including previously captured videos / images, etc. The video / image generating device may include, for example, a computer, a tablet computer, and a smart phone, and may generate the video / image (electronically). For example, a virtual video / image may be generated by a computer, etc. In this case, the video / image capturing process may be replaced by a process of generating relevant data.

[0079] The encoding unit 12 may encode the input video / image. For compression and encoding efficiency, the encoding unit 12 may perform a series of processes such as prediction, transformation, and quantization. The encoding unit 12 may output encoded data (encoded video / image information) in the form of a bitstream.

[0080] The transmitter 13 transmits the encoded video / image information or data output in the form of a bit stream to the receiver 21 of the decoding device 20 in the form of a file or stream through a digital storage medium or a network. The digital storage medium may include various storage media, such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter 13 may include an element for generating a media file in a predetermined file format and may include an element for transmission through a broadcast / communication network. The receiver 21 may extract / receive a bit stream from a storage medium or a network and transmit the bit stream to the decoding unit 22.

[0081] The decoding unit 22 may decode a video / image by performing a series of processes corresponding to the operations of the encoding unit 12, such as dequantization, inverse transformation, and prediction.

[0082] The renderer 23 may render the decoded video / image. The rendered video / image may be displayed through a display.

[0083] Overview of Image Coding Equipment

[0084] Figure 2 is a view schematically showing an image encoding device to which an embodiment of the present disclosure is applicable.

[0085] like Figure 2 As shown, the image encoding device 100 may include an image segmenter 110, a subtractor 115, a transformer 120, a quantizer 130, a dequantizer 140, an inverse transformer 150, an adder 155, a filter 160, a memory 170, an inter-frame prediction unit 180, an intra-frame prediction unit 185, and an entropy encoder 190. The inter-frame prediction unit 180 and the intra-frame prediction unit 185 may be collectively referred to as a "prediction unit". The transformer 120, the quantizer 130, the dequantizer 140, and the inverse transformer 150 may be included in a residual processor. The residual processor may also include a subtractor 115.

[0086] In some embodiments, all or at least some of the components configuring the image encoding apparatus 100 may be configured by one hardware component (eg, an encoder or a processor). In addition, the memory 170 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium.

[0087] The image segmenter 110 may segment the input image (or picture or frame) input to the image encoding device 100 into one or more processing units. For example, the processing unit may be referred to as a coding unit (CU). The coding unit may be obtained by recursively segmenting a coding tree unit (CTU) or a maximum coding unit (LCU) according to a quadtree binary tree ternary tree (QT / BT / TT) structure. For example, a coding unit may be segmented into a plurality of coding units of a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary tree structure. For the segmentation of the coding unit, the quadtree structure may be applied first, and then the binary tree structure and / or the ternary tree structure may be applied. The encoding process according to the present disclosure may be performed based on the final coding unit that is no longer segmented. The maximum coding unit may be used as the final coding unit, and the coding unit of a deeper depth obtained by segmenting the maximum coding unit may also be used as the final coding unit. Here, the encoding process may include the prediction, transformation, and reconstruction processes described later. As another example, the processing unit of the encoding process may be a prediction unit (PU) or a transformation unit (TU). The prediction unit and the transform unit may be divided or partitioned from the final coding unit. The prediction unit may be a sample prediction unit, and the transform unit may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from the transform coefficient.

[0088] The prediction unit (inter prediction unit 180 or intra prediction unit 185) may perform prediction on the block to be processed (current block) and generate a prediction block including prediction samples of the current block. The prediction unit may determine whether to apply intra prediction or inter prediction based on the current block or CU. The prediction unit may generate various information related to the prediction of the current block and transmit the generated information to the entropy encoder 190. The information about the prediction may be encoded in the entropy encoder 190 and output in the form of a bitstream.

[0089] The intra prediction unit 185 can predict the current block by referring to the samples in the current picture. Depending on the intra prediction mode and / or the intra prediction technology, the reference samples can be located in the neighbors of the current block or can be placed separately. The intra prediction mode may include multiple non-directional modes and multiple directional modes. The non-directional mode may include, for example, a DC mode and a plane mode. Depending on the level of detail of the prediction direction, the directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes. However, this is only an example, and more or fewer directional prediction modes may be used according to the settings. The intra prediction unit 185 may determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0090] The inter prediction unit 180 may derive a prediction block of the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter prediction direction (L0 prediction, L1 prediction, dual prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be referred to as a collocated reference block, a collocated CU (colCU), etc. The reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter prediction unit 180 may configure a motion information candidate list based on the neighboring blocks and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the inter prediction unit 180 may use the motion information of the neighboring block as the motion information of the current block. In the case of skip mode, unlike the merge mode, the residual signal may not be transmitted. In the case of motion vector prediction (MVP) mode, the motion vector of the neighboring block may be used as a motion vector predictor, and the motion vector of the current block may be signaled by encoding the motion vector difference and an indicator of the motion vector predictor. The motion vector difference may mean the difference between the motion vector of the current block and the motion vector predictor.

[0091] The prediction unit can generate a prediction signal based on the various prediction methods and prediction techniques described below. For example, the prediction unit can apply not only intra-frame prediction or inter-frame prediction, but also intra-frame prediction and inter-frame prediction at the same time to predict the current block. The prediction method that simultaneously applies both intra-frame prediction and inter-frame prediction to predict the current block can be called combined inter-frame and intra-frame prediction (CIIP). In addition, the prediction unit can perform intra-frame block copying (IBC) to predict the current block. Intra-frame block copying can be used for content image / video encoding of games, etc., for example, screen content coding (SCC). IBC is a method of predicting the current picture using a previously reconstructed reference block in the current picture at a position separated by a predetermined distance from the current block. When IBC is applied, the position of the reference block in the current picture can be encoded as a vector (block vector) corresponding to a predetermined distance.

[0092] The prediction signal generated by the prediction unit can be used to generate a reconstruction signal or to generate a residual signal. The subtractor 115 can generate a residual signal (residual block or residual sample array) by subtracting the prediction signal (prediction block or prediction sample array) output from the prediction unit from the input image signal (original block or original sample array). The generated residual signal can be transmitted to the transformer 120.

[0093] The transformer 120 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a karhunen-loève transform (KLT), a graph-based transform (GBT), or a conditional nonlinear transform (CNT). Here, GBT refers to a transform obtained from a graph when relationship information between pixels is represented by a graph. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to square pixel blocks of the same size or may be applied to blocks of variable size instead of square.

[0094] The quantizer 130 may quantize the transform coefficients and transmit them to the entropy encoder 190. The entropy encoder 190 may encode the quantized signal (information about the quantized transform coefficients) and output a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantizer 130 may rearrange the quantized transform coefficients in the block form into a one-dimensional vector form based on the coefficient scanning order, and generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form.

[0095] The entropy encoder 190 may perform various encoding methods, such as exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. The entropy encoder 190 may encode information required for video / image reconstruction other than quantized transform coefficients together or separately (e.g., values ​​of syntax elements, etc.). The encoded information (e.g., encoded video / image information) may be transmitted or stored in units of a network abstraction layer (NAL) in the form of a bitstream. The video / image information may also include information about various parameter sets, such as an adaptive parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may also include general constraint information. The signaled information, transmitted information, and / or syntax elements described in the present disclosure may be encoded and included in a bitstream through the above-described encoding process.

[0096] The bitstream may be transmitted over a network or may be stored in a digital storage medium. The network may include a broadcast network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting a signal output from the entropy encoder 190 and / or a storage unit (not shown) for storing the signal may be included as an internal / external element of the image encoding device 100. Alternatively, a transmitter may be provided as a component of the entropy encoder 190.

[0097] The quantized transform coefficients output from the quantizer 130 may be used to generate a residual signal. For example, the residual signal (residual block or residual sample) may be reconstructed by applying dequantization and inverse transformation to the quantized transform coefficients through the dequantizer 140 and the inverse transformer 150.

[0098] The adder 155 adds the reconstructed residual signal to the prediction signal output from the inter-frame prediction unit 180 or the intra-frame prediction unit 185 to generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array). If the block to be processed has no residual, such as when the skip mode is applied, the prediction block can be used as a reconstructed block. The adder 155 can be called a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra-frame prediction of the next block to be processed in the current picture, and can be used for inter-frame prediction of the next picture by filtering as described below.

[0099] In addition, as described below, luma mapping and chroma scaling (LMCS) is applicable to the picture coding process.

[0100] The filter 160 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 160 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and store the modified reconstructed picture in the memory 170, specifically, in the DPB of the memory 170. Various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filtering, bilateral filtering, etc. The filter 160 can generate various information related to filtering and transmit the generated information to the entropy encoder 190, as described later in the description of each filtering method. The information related to filtering can be encoded by the entropy encoder 190 and output in the form of a bit stream.

[0101] The modified reconstructed picture transferred to the memory 170 may be used as a reference picture in the inter prediction unit 180. When inter prediction is applied by the image encoding apparatus 100, prediction mismatch between the image encoding apparatus 100 and the image decoding apparatus may be avoided and encoding efficiency may be improved.

[0102] The DPB of the memory 170 may store the modified reconstructed picture for use as a reference picture in the inter-frame prediction unit 180. The memory 170 may store the motion information of the block from which the motion information in the current picture is derived (or encoded) and / or the motion information of the reconstructed block in the picture. The stored motion information may be transmitted to the inter-frame prediction unit 180 and used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 170 may store the reconstructed samples of the reconstructed blocks in the current picture and may transmit the reconstructed samples to the intra-frame prediction unit 185.

[0103] Overview of Image Decoding Equipment

[0104] Figure 3 is a view schematically showing an image decoding device to which an embodiment of the present disclosure is applicable.

[0105] like Figure 3 As shown, the image decoding device 200 may include an entropy decoder 210, a dequantizer 220, an inverse transformer 230, an adder 235, a filter 240, a memory 250, an inter-frame prediction unit 260, and an intra-frame prediction unit 265. The inter-frame prediction unit 260 and the intra-frame prediction unit 265 may be collectively referred to as a "prediction unit". The dequantizer 220 and the inverse transformer 230 may be included in a residual processor.

[0106] According to an embodiment, all or at least some of the plurality of components configuring the image decoding apparatus 200 may be configured by hardware components (eg, a decoder or a processor). In addition, the memory 250 may include a decoded picture buffer (DPB) or may be configured by a digital storage medium.

[0107] The image decoding device 200 having received a bit stream including video / image information may perform the same Figure 2 The image encoding device 100 may reconstruct the image by processing corresponding to the processing performed by the image encoding device 100. For example, the image decoding device 200 may perform decoding using a processing unit applied in the image encoding device. Therefore, the processing unit of decoding may be, for example, a coding unit. The coding unit may be obtained by partitioning the coding tree unit or the maximum coding unit. The reconstructed image signal decoded and output by the image decoding device 200 may be reproduced by a reproduction device (not shown).

[0108] The image decoding device 200 may receive the image in the form of a bit stream from Figure 2The received signal may be decoded by the entropy decoder 210. For example, the entropy decoder 210 may parse the bitstream to derive information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information may also include information about various parameter sets, such as an adaptive parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may also include general constraint information. The image decoding device may also decode the picture based on the information about the parameter set and / or the general constraint information. The information and / or syntax elements signaled / received described in the present disclosure may be decoded and obtained from the bitstream through a decoding process. For example, the entropy decoder 210 may decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values ​​of the syntax elements required for image reconstruction and the quantized values ​​of the transform coefficients of the residual. More specifically, the CABAC entropy decoding method can receive a bin corresponding to each syntax element in the bitstream, use the decoding target syntax element information, the decoding information of the neighboring block and the decoding target block, or the information of the symbol / bin decoded in the previous stage to determine the context model, perform arithmetic decoding on the bin by predicting the probability of occurrence of the bin according to the determined context model, and generate a symbol corresponding to the value of each syntax element. In this case, the CABAC entropy decoding method can update the context model by using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. The information related to the prediction in the information decoded by the entropy decoder 210 can be provided to the prediction unit (inter-frame prediction unit 260 and intra-frame prediction unit 265), and the residual value of the entropy decoding performed on it in the entropy decoder 210, that is, the quantized transform coefficient and the related parameter information can be input to the dequantizer 220. In addition, the information about filtering in the information decoded by the entropy decoder 210 can be provided to the filter 240. In addition, a receiver (not shown) for receiving a signal output from the image encoding apparatus may be further configured as an internal / external element of the image decoding apparatus 200 , or the receiver may be a component of the entropy decoder 210 .

[0109] In addition, the image decoding device according to the present disclosure may be referred to as a video / image / picture decoding device. The image decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include an entropy decoder 210. The sample decoder may include a dequantizer 220, an inverse transformer 230, an adder 235, a filter 240, a memory 250, an inter-frame prediction unit 260, or at least one of an intra-frame prediction unit 265.

[0110] The dequantizer 220 may dequantize the quantized transform coefficients and output the transform coefficients. The dequantizer 220 may rearrange the quantized transform coefficients in the form of two-dimensional blocks. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the image encoding device. The dequantizer 220 may dequantize the quantized transform coefficients by using a quantization parameter (e.g., quantization step size information) and obtain the transform coefficients.

[0111] The inverse transformer 230 may inversely transform the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0112] The prediction unit may perform prediction on the current block and generate a prediction block including prediction samples of the current block. The prediction unit may determine whether to apply intra prediction or inter prediction to the current block based on the information about prediction output from the entropy decoder 210, and may determine a specific intra / inter prediction mode (prediction technique).

[0113] The same as described in the prediction unit of the image encoding device 100 , the prediction unit can generate a prediction signal based on various prediction methods (techniques) described later.

[0114] The intra prediction unit 265 may predict the current block by referring to samples in the current picture. The description of the intra prediction unit 185 is also applicable to the intra prediction unit 265.

[0115] The inter-frame prediction unit 260 can derive the prediction block of the current block based on the reference block (reference sample array) specified by the motion vector on the reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter-frame prediction mode, the motion information can be predicted in units of blocks, sub-blocks or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction direction (L0 prediction, L1 prediction, dual prediction, etc.) information. In the case of inter-frame prediction, the neighboring blocks may include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. For example, the inter-frame prediction unit 260 may configure a motion information candidate list based on the neighboring blocks, and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. Inter-frame prediction may be performed based on various prediction modes, and information about the prediction may include information indicating the inter-frame prediction mode of the current block.

[0116] The adder 235 can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the prediction unit (including the inter-frame prediction unit 260 and / or the intra-prediction unit 265). The description of the adder 155 is also applicable to the adder 235.

[0117] In addition, as described below, luma mapping and chroma scaling (LMCS) is applied to the picture decoding process.

[0118] The filter 240 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 240 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and store the modified reconstructed picture in the memory 250, specifically, in the DPB of the memory 250. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filtering, bilateral filtering, etc.

[0119] The (modified) reconstructed picture stored in the DPB of the memory 250 may be used as a reference picture in the inter-frame prediction unit 260. The memory 250 may store the motion information of the block from which the motion information in the current picture is derived (or decoded) and / or the motion information of the reconstructed block in the picture. The stored motion information may be transmitted to the inter-frame prediction unit 260 to be used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 250 may store the reconstructed samples of the reconstructed block in the current picture and transmit the reconstructed samples to the intra-frame prediction unit 265.

[0120] In the present disclosure, the implementations described in the filter 160, the inter-frame prediction unit 180 and the intra-frame prediction unit 185 of the image encoding device 100 can be equally or correspondingly applied to the filter 240, the inter-frame prediction unit 260 and the intra-frame prediction unit 265 of the image decoding device 200.

[0121] Overview of Inter Prediction

[0122] The image encoding device / image decoding device may perform inter-frame prediction in units of blocks to derive prediction samples. Inter-frame prediction may mean prediction derived in a manner that depends on data elements of pictures other than the current picture. When inter-frame prediction is applied to the current block, a prediction block of the current block may be derived based on a reference block specified by a motion vector on a reference picture.

[0123] In this case, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information of the current block can be derived based on the correlation of the motion information between the neighboring blocks and the current block, and the motion information can be derived in units of blocks, sub-blocks or samples. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction type information. Here, the inter-frame prediction type information may mean the direction information of the inter-frame prediction. The inter-frame prediction type information may indicate that the current block is predicted using one of L0 prediction, L1 prediction or dual prediction.

[0124] When inter prediction is applied to the current block, the neighboring blocks of the current block may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block of the current block and the reference picture including the temporal neighboring blocks may be the same or different. The temporal neighboring block may be referred to as a collocated reference block or collocated CU (colCU), and the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic).

[0125] Furthermore, a motion information candidate list may be constructed based on neighboring blocks of the current block, and in this case, a flag or index information indicating which candidate to use in order to derive a motion vector and / or a reference picture index of the current block may be signaled.

[0126] According to the inter prediction type, the motion information may include L0 motion information and / or L1 motion information. A motion vector in the L0 direction may be defined as an L0 motion vector or MVL0, and a motion vector in the L1 direction may be defined as an L1 motion vector or MVL1. Prediction based on the L0 motion vector may be defined as L0 prediction, prediction based on the L1 motion vector may be defined as L1 prediction, and prediction based on both the L0 motion vector and the L1 motion vector may be defined as dual prediction. Here, the L0 motion vector may mean a motion vector associated with the reference picture list L0, and the L1 motion vector may mean a motion vector associated with the reference picture list L1.

[0127] The reference picture list L0 may include pictures before the current picture in the output order as reference pictures, and the reference picture list L1 may include pictures after the current picture in the output order. The previous picture may be defined as a forward (reference) picture, and the subsequent picture may be defined as a backward (reference) picture. In addition, the reference picture list L0 may also include pictures after the current picture in the output order as reference pictures. In this case, in the reference picture list L0, the previous picture may be indexed first, and then the subsequent picture may be indexed. The reference picture list L1 may also include pictures before the current picture in the output order as reference pictures. In this case, in the reference picture list L1, the subsequent picture may be indexed first, and then the previous picture may be indexed. Here, the output order may correspond to a picture order count (POC) order.

[0128] Figure 4 is a flowchart illustrating a video / image encoding method based on inter-frame prediction.

[0129] Figure 5 is a view illustrating a configuration of the inter predictor 180 according to the present disclosure.

[0130] Figure 6 The encoding method can be Figure 2 The image encoding device of the present invention may be performed. Specifically, step S410 may be performed by the inter-frame predictor 180, and step S420 may be performed by the residual processor. Specifically, step S420 may be performed by the subtractor 115. Step S430 may be performed by the entropy encoder 190. The prediction information of step S630 may be derived by the inter-frame predictor 180, and the residual information of step S630 may be derived by the residual processor. The residual information is information about the residual sample. The residual information may include information about the quantized transform coefficient for the residual sample. As described above, the residual sample may be derived as a transform coefficient by the transformer 120 of the image encoding device, and the transform coefficient may be derived as a quantized transform coefficient by the quantizer 130. The information about the quantized transform coefficient may be encoded by the entropy encoder 190 through the residual encoding process.

[0131] The image encoding device may perform inter-frame prediction for the current block (S410). The image encoding device may derive the inter-frame prediction mode and motion information of the current block and generate a prediction sample of the current block. Here, the inter-frame prediction mode determination, motion information derivation, and prediction sample generation processes may be performed simultaneously or any one of them may be performed before the other processes. For example, Figure 5 As shown, the inter-frame prediction unit 180 of the image encoding device may include a prediction mode determination unit 181, a motion information derivation unit 182, and a prediction sample derivation unit 183. The prediction mode determination unit 181 may determine the prediction mode of the current block, the motion information derivation unit 182 may derive the motion information of the current block, and the prediction sample derivation unit 183 may derive the prediction sample of the current block. For example, the inter-frame prediction unit 180 of the image encoding device may search for a block similar to the current block in a predetermined area (search area) of the reference picture through motion estimation, and derive a reference block whose difference with the current block is equal to or less than a predetermined criterion or a minimum value. Based on this, a reference picture index indicating a reference picture in which the reference block is located may be derived, and a motion vector may be derived based on the position difference between the reference block and the current block. The image encoding device may determine a mode applied to the current block among various inter-frame prediction modes. The image encoding device may compare rate-distortion (RD) costs for various prediction modes, and determine the best inter-frame prediction mode for the current block. However, a method of determining the inter prediction mode of the current block by the image encoding apparatus is not limited to the above example, and various methods may be used.

[0132] For example, the inter prediction mode of the current block may be determined as at least one of a merge mode, a merge skip mode, a motion vector prediction (MVP) mode, a symmetric motion vector difference (SMVD) mode, an affine mode, a sub-block based merge mode, an adaptive motion vector resolution (AMVR) mode, a history-based motion vector predictor (HMVP) mode, a pairwise average merge mode, a merge mode with motion vector difference (MMVD) mode, a decoder-side motion vector refinement (DMVR) mode, a combined inter- and intra-prediction (CIIP) mode, or a geometric partitioning mode (GPM).

[0133] For example, when the skip mode or merge mode is applied to the current block, the image encoding device may derive a merge candidate from a neighboring block of the current block, and use the derived merge candidate to construct a merge candidate list. In addition, the image encoding device may derive a reference block whose difference with the current block is equal to or less than a predetermined criterion or minimum value from the reference blocks indicated by the merge candidates included in the merge candidate list. In this case, a merge candidate associated with the derived reference block may be selected, and merge index information indicating the selected merge candidate may be generated and signaled to the image decoding device. The motion information of the selected merge candidate may be used to derive the motion information of the current block.

[0134] As another example, when the MVP mode is applied to the current block, the image encoding device may derive a motion vector predictor (MVP) candidate from a neighboring block of the current block, and use the derived MVP candidate to construct an MVP candidate list. In addition, the image encoding device may use the motion vector of the MVP candidate selected from among the MVP candidates included in the MVP candidate list as the MVP of the current block. In this case, for example, the motion vector indicating the reference block derived by the above-mentioned motion estimation may be used as the motion vector of the current block, and the MVP candidate having the smallest motion vector difference with the motion vector of the current block among the MVP candidates may be the selected MVP candidate. A motion vector difference (MVD) as a difference obtained by subtracting the MVP from the motion vector of the current block may be derived. In this case, index information indicating the selected MVP candidate and information about the MVD may be signaled to the image decoding device. In addition, when the MVP mode is applied, the value of the reference picture index may be constructed as reference picture index information and separately signaled to the image decoding device.

[0135] The image encoding apparatus may derive residual samples based on the predicted samples (S420). The image encoding apparatus may derive residual samples by comparing the original samples of the current block with the predicted samples. For example, the residual samples may be derived by subtracting the corresponding predicted samples from the original samples.

[0136] The image encoding device may encode the image information including the prediction information and the residual information (S430). The image encoding device may output the encoded image information in the form of a bitstream. The prediction information may include prediction mode information (e.g., a skip flag, a merge flag, or a mode index, etc.) and information about motion information as information related to the prediction process. Among the prediction mode information, the skip flag indicates whether the skip mode is applied to the current block, and the merge flag indicates whether the merge mode is applied to the current block. Alternatively, the prediction mode information may indicate one of a plurality of prediction modes, such as a mode index. When the skip flag and the merge flag are 0, it can be determined that the MVP mode is applied to the current block. The information about the motion information may include candidate selection information (e.g., a merge index, an mvp flag, or an mvp index) as information for deriving a motion vector. Among the candidate selection information, the merge index may be signaled when the merge mode is applied to the current block, and may be information for selecting one of the merge candidates included in the merge candidate list. Among the candidate selection information, the MVP flag or the MVP index may be signaled when the MVP mode is applied to the current block, and may be information for selecting one of the MVP candidates in the MVP candidate list. Specifically, the MVP flag may be signaled using a syntax element mvp_10_flag or mvp_11_flag. In addition, the information about the motion information may include information about the above-mentioned MVD and / or reference picture index information. In addition, the information about the motion information may include information indicating whether L0 prediction, L1 prediction, or bi-prediction is applied. The residual information is information about the residual sample. The residual information may include information about the quantized transform coefficients for the residual sample.

[0137] The output bit stream may be stored in a (digital) storage medium and transmitted to the image decoding device or may be transmitted to the image decoding device via a network.

[0138] As described above, the image encoding device can generate a reconstructed picture (a picture including reconstructed samples and reconstructed blocks) based on the reference sample and the residual sample. This is for the image encoding device to derive the same prediction result as the prediction result performed by the image decoding device, thereby improving the coding efficiency. Therefore, the image encoding device can store the reconstructed picture (or reconstructed sample and reconstructed block) in a memory and use it as a reference picture for inter-frame prediction. As described above, the in-loop filtering process is also applicable to the reconstructed picture.

[0139] Figure 6 is a flowchart illustrating a video / image decoding method based on inter-frame prediction.

[0140] Figure 7 is a view illustrating a configuration of the inter prediction unit 260 according to the present disclosure.

[0141] The image decoding apparatus may perform an operation corresponding to the operation performed by the image encoding apparatus. The image decoding apparatus may perform prediction on the current block based on the received prediction information and derive a prediction sample.

[0142] Figure 6 The decoding method can be obtained by Figure 3 The image decoding device of the present invention is performed. Steps S610 to S630 may be performed by the inter-frame prediction unit 260, and the prediction information of step S610 and the residual information of step S640 may be obtained from the bitstream by the entropy decoder 210. The residual processor of the image decoding device may derive the residual samples of the current block based on the residual information (S640). Specifically, the dequantizer 220 of the residual processor may perform dequantization based on the quantized transform coefficient derived according to the residual information to derive the transform coefficient, and the inverse transformer 230 of the residual processor may perform inverse transform on the transform coefficient to derive the residual sample of the current block. Step S650 may be performed by the adder 235 or the reconstructor.

[0143] Specifically, the image decoding apparatus may determine a prediction mode of the current block based on the received prediction information (S610). The image decoding apparatus may determine which inter prediction mode is applied to the current block based on prediction mode information in the prediction information.

[0144] For example, it may be determined whether the skip mode is applied to the current block based on a skip flag. In addition, it may be determined whether the merge mode or the MVP mode is applied to the current block based on a merge flag. Alternatively, one of various inter-frame prediction mode candidates may be selected based on a mode index. The inter-frame prediction mode candidate may include a skip mode, a merge mode, and / or an MVP mode or may include various inter-frame prediction modes to be described below.

[0145] The image decoding device may derive motion information of the current block based on the determined inter prediction mode (S620). For example, when the skip mode or merge mode is applied to the current block, the image decoding device may construct a merge candidate list to be described below, and select one of the merge candidates included in the merge candidate list. The selection may be performed based on the above-mentioned candidate selection information (merge index). The motion information of the selected merge candidate may be used to derive the motion information of the current block. For example, the motion information of the selected merge candidate may be used as the motion information of the current block.

[0146] As another example, when the MVP mode is applied to the current block, the image decoding device may construct an MVP candidate list, and use the motion vector of the MVP candidate selected from the MVP candidates included in the MVP candidate list as the MVP of the current block. The selection may be performed based on the above-mentioned candidate selection information (mvp flag or mvp index). In this case, the MVD of the current block may be derived based on the information about the MVD, and the motion vector of the current block may be derived based on the MVP and MVD of the current block. In addition, the reference picture index of the current block may be derived based on the reference picture index information. The picture indicated by the reference picture index in the reference picture list of the current block may be derived as a reference picture referenced for inter-frame prediction of the current block.

[0147] The image decoding device may generate a prediction sample of the current block based on the motion information of the current block (S630). In this case, a reference picture may be derived based on a reference picture index of the current block, and a sample of the reference block indicated by a motion vector of the current block on the reference picture may be used to derive the prediction sample of the current block. In some cases, a prediction sample filtering process may also be performed for all or some of the prediction samples of the current block.

[0148] For example, Figure 7 As shown, the inter-frame prediction unit 260 of the image decoding device may include a prediction mode determination unit 261, a motion information derivation unit 262, and a prediction sample derivation unit 263. In the inter-frame prediction unit 260 of the image decoding device, the prediction mode determination unit 261 may determine the prediction mode of the current block based on the received prediction mode information, the motion information derivation unit 262 may derive the motion information (motion vector and / or reference picture index, etc.) of the current block based on the received motion information, and the prediction sample derivation unit 263 may derive the prediction sample of the current block.

[0149] The image decoding device may generate residual samples of the current block based on the received residual information (S640). The image decoding device may generate reconstructed samples of the current block based on the predicted samples and the residual samples and generate a reconstructed picture based thereon (S650). Thereafter, the in-loop filtering process is applied to the reconstructed picture as described above.

[0150] As described above, the inter-frame prediction process may include a step of determining an inter-frame prediction mode, a step of deriving motion information according to the determined prediction mode, and a step of performing prediction (generating prediction samples) based on the derived motion information. As described above, the inter-frame prediction process may be performed by an image encoding device and an image decoding device.

[0151] Hereinafter, the steps of deriving motion information according to the prediction mode will be described in more detail.

[0152] As described above, inter-frame prediction can be performed using the motion information of the current block. The image encoding device can derive the best motion information of the current block through a motion estimation process. For example, the image encoding device can use the original block in the original picture of the current block in fractional pixel units to search for a similar reference block with high correlation within a predetermined search range in the reference picture, and use it to derive motion information. The similarity of the blocks can be calculated based on the sum of absolute differences (SAD) between the current block and the reference block. In this case, the motion information can be derived based on the reference block with the minimum SAD in the search area. The derived motion information can be signaled to the image decoding device according to various methods based on the inter-frame prediction mode.

[0153] When the merge mode is applied to the current block, the motion information of the current block is not sent directly, and the motion information of the neighboring blocks is used to derive the motion information of the current block. Therefore, the motion information of the current prediction block can be indicated by sending flag information indicating that the merge mode is used and candidate selection information (e.g., merge index) indicating which neighboring block is used as a merge candidate. In the present disclosure, since the current block is a prediction execution unit, the current block can be used as the same meaning as the current prediction block, and the neighboring block can be used as the same meaning as the neighboring prediction block.

[0154] The image encoding device may search for a merge candidate block for deriving motion information of the current block to perform a merge mode. For example, up to five merge candidate blocks may be used, but not limited thereto. The maximum number of merge candidate blocks may be sent in a slice header or a tile group header, but not limited thereto. After finding the merge candidate block, the image encoding device may generate a merge candidate list and select the merge candidate block with the minimum RD cost as the final merge candidate block.

[0155] The present disclosure provides various implementations for configuring a merge candidate block of a merge candidate list. The merge candidate list may use, for example, five merge candidate blocks. For example, four spatial merge candidates and one temporal merge candidate may be used.

[0156] Figure 8 is a view illustrating neighboring blocks that can be used as spatial merging candidates.

[0157] Fig. 9 is a view schematically illustrating a method for constructing a merge candidate list according to an example of the present disclosure.

[0158] The image encoding / decoding apparatus may insert a spatial merge candidate derived by searching for spatial neighboring blocks of the current block into a merge candidate list (S910). Figure 8As shown, the spatial neighboring blocks may include a lower left neighboring block A0, a left neighboring block A1, an upper right neighboring block B0, an upper neighboring block B1, and an upper left neighboring block B2 of the current block. However, this is an example, and in addition to the above-mentioned spatial neighboring blocks, additional neighboring blocks such as a right neighboring block, a lower neighboring block, and a lower right neighboring block may be further used as spatial neighboring blocks. The image encoding / decoding device may detect available blocks by searching the spatial neighboring blocks based on priority, and derive motion information of the detected blocks as spatial merging candidates. For example, the image encoding / decoding device may detect available blocks by searching in the order of A1, B1, B0, A0, and B2. Figure 8 The five blocks shown are indexed in turn to build a merge candidate list.

[0159] The image encoding / decoding device may insert a temporal merge candidate derived by searching for temporal neighboring blocks of the current block into a merge candidate list (S920). The temporal neighboring block may be located on a reference picture different from the current picture in which the current block is located. The reference picture in which the temporal neighboring block is located may be referred to as a collocated picture or a col picture. The temporal neighboring blocks may be searched in the order of the lower right corner neighboring block and the lower right center block of the collocated block of the current block on the col picture. In addition, when motion data compression is applied in order to reduce memory load, specific motion information may be stored as representative motion information of each predetermined storage unit of the col picture. In this case, it is not necessary to store motion information of all blocks in the predetermined storage unit, thereby obtaining a motion data compression effect. In this case, the predetermined storage unit may be predetermined to be, for example, a 16×16 sample unit or an 8×8 sample unit, or the size information of the predetermined storage unit may be signaled from the image encoding device to the image decoding device. When motion data compression is applied, the motion information of the temporal neighboring block may be replaced with the representative motion information of the predetermined storage unit in which the temporal neighboring block is located. That is, in this case, from the perspective of implementation, the temporal merging candidate can be derived based on the motion information of the prediction block covering the arithmetically left shifted position after the coordinates (upper left sample position) of the temporal neighboring block are arithmetically right shifted by a predetermined value (rather than the prediction block located on the coordinates of the temporal neighboring block). For example, when the predetermined storage unit is 2 n ×2 nWhen the coordinates of the sample unit and the temporally neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the modified position ((xTnb >> n) << n), (yTnb >> n) << n)) can be used for temporal merge candidates. Specifically, for example, when the predetermined storage unit is a 16×16 sample unit and the coordinates of the temporally neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the modified position ((xTnb >> 4) << 4), (yTnb >> 4) << 4)) can be used for temporal merge candidates. Alternatively, for example, when the predetermined storage unit is an 8×8 sample unit and the coordinates of the temporally neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the modified position ((xTnb >> 3) << 3), (yTnb >> 3) << 3)) can be used for temporal merge candidates.

[0160] Referring again to Fig. 9 , the image encoding / decoding device may check whether the current number of merge candidates is less than the maximum number of merge candidates (S930). The maximum number of merge candidates may be predefined or signaled from the image encoding device to the image decoding device. For example, the image encoding device may generate and encode information about the maximum number of merge candidates and send the encoded information to the image decoding device in the form of a bitstream. When the maximum number of merge candidates is satisfied, the subsequent candidate addition process S940 may not be performed.

[0161] When, as a result of the check in step S930, the current number of merge candidates is less than the maximum number of merge candidates, the image encoding / decoding device may derive additional merge candidates according to a predetermined method and then insert the additional merge candidates into the merge candidate list (S940). For example, the additional merge candidates may include at least one of a history-based merge candidate, a pairwise average merge candidate, an ATMVP, a combined bi-prediction merge candidate (when the slice / tile group type of the current slice / tile group is of type B), and / or a zero vector merge candidate.

[0162] When, as a result of the check in step S930, the current number of merge candidates is not less than the maximum number of merge candidates, the image encoding / decoding device may end the construction of the merge candidate list. In this case, the image encoding device may select the best merge candidate from among the merge candidates configuring the merge candidate list and signal candidate selection information (e.g., a merge candidate index or a merge index) indicating the selected merge candidate to the image decoding device. The image decoding device may select the best merge candidate based on the merge candidate list and the candidate selection information.

[0163] As described above, the motion information of the selected merge candidate may be used as the motion information of the current block, and the prediction sample of the current block may be derived based on the motion information of the current block. The image encoding device may derive the residual sample of the current block based on the prediction sample, and signal the residual information of the residual sample to the image decoding device. As described above, the image decoding device may generate a reconstructed sample based on the residual sample derived from the residual information and the prediction sample, and generate a reconstructed picture based thereon.

[0164] When the skip mode is applied to the current block, the motion information of the current block can be derived using the same method as the case where the merge mode is applied. However, when the skip mode is applied, the residual signal of the corresponding block is omitted, and thus the prediction sample can be directly used as the reconstructed sample. For example, when the value of cu_skip_flag is 1, the above skip mode can be applied.

[0165] Hereinafter, a method of deriving a spatial candidate in a merge mode and / or a skip mode will be described. The spatial candidate may refer to the above-mentioned spatial merge candidate.

[0166] The derivation of spatial candidates can be performed based on spatial neighboring blocks. For example, Figure 8 The candidate blocks at the positions shown derive up to four spatial candidates. The order of deriving spatial candidates may be A1->B1->B0->A0->B2. However, the order of deriving spatial candidates is not limited to the above order, and may be, for example, B1->A1->B0->A0->B2. When at least one of the current four positions (A1, B1, B0, and A0 in the above example) is unavailable, the last position in the order (position B2 in the above example) may be considered. In this case, the block at the unavailable predetermined position may include a corresponding block belonging to a slice or patch different from the current block or a corresponding block as an intra-frame prediction block. When a spatial candidate is derived from the first position in the order (A1 or B1 in the above example), a redundancy check may be performed on the spatial candidates at subsequent positions. For example, when the motion information of the subsequent spatial candidate is the same as the motion information of the spatial candidate already included in the merge candidate list, the subsequent spatial candidate may not be included in the merge candidate list, thereby improving coding efficiency. The redundancy check performed on the subsequent spatial candidate may be performed on some candidate pairs rather than all possible candidate pairs, thereby reducing computational complexity.

[0167] Fig.10 is a diagram illustrating candidate pairs for redundancy check performed on spatial candidates.

[0168] exist Fig.10In the example shown, a redundant check on the spatial candidate at position B0 may be performed only on the spatial candidate at position A0. In addition, a redundant check on the spatial candidate at position B1 may be performed only on the spatial candidate at position B0. In addition, a redundant check on the spatial candidate at position A1 may be performed only on the spatial candidate at position A0. Finally, a redundant check on the spatial candidate at position B2 may be performed only on the spatial candidates at positions A0 and B0.

[0169] exist Fig.10 In the example shown, the order of deriving spatial candidates is A0->B0->B1->A1->B2. However, the present disclosure is not limited thereto, even if the order of deriving spatial candidates is changed, such as Fig.10 In the example shown, redundancy checking may be performed only on some of the candidate pairs.

[0170] Hereinafter, a method of deriving a temporal candidate in the case of a merge mode and / or a skip mode will be described. The temporal candidate may represent the temporal merge candidate described above. In addition, the motion vector of the temporal candidate may correspond to the temporal candidate of the MVP mode.

[0171] In the case of a temporal candidate, only one candidate may be included in the merge candidate list. In the process of deriving a temporal candidate, the motion vector of the temporal candidate may be scaled. For example, scaling may be performed based on a collocated block (CU) (hereinafter referred to as a "col block") belonging to a collocated reference picture (colPic) (hereinafter referred to as a "col picture"). The reference picture list used to derive the col block may be explicitly signaled in the slice header.

[0172] Fig.11 is a view illustrating a method of scaling a motion vector of a temporal candidate.

[0173] exist Fig.11 In the above, curr_CU and curr_pic represent the current block and the current picture, respectively, and col_CU and col_pic represent the col block and the col picture, respectively. In addition, curr_ref represents the reference picture of the current block, and col_ref represents the reference picture of the col block. In addition, tb represents the distance between the reference picture of the current block and the current picture, and td represents the distance between the reference picture of the col block and the col picture. tb and td can represent values ​​corresponding to the difference in POC (picture order count) between pictures. Scaling of the motion vector of the temporal candidate can be performed based on tb and td. In addition, the reference picture index of the temporal candidate can be set to 0.

[0174] Fig.12 is a view illustrating the position of deriving the temporal candidate.

[0175] exist Fig.12The block with a thick solid line indicates the current block. Fig.12 The temporal candidate is derived from the block corresponding to position C0 (lower right position) or C1 (center position). First, it can be determined whether position C0 is available, and when position C0 is available, the temporal candidate can be derived based on position C0. When position C0 is not available, the temporal candidate can be derived based on position C1. For example, when the block at position C0 in the col picture is an intra-frame prediction block or is located outside the current CTU row, it can be determined that position C0 is not available.

[0176] As described above, when motion data compression is applied, the motion vector of the col block may be stored for each predetermined unit block. In this case, in order to derive the motion vector of the block covering position C0 or position C1, position C0 or position C1 may be modified. For example, when the predetermined unit block is an 8×8 block and position C0 or position C1 is (xColCi, yColCi), the position for deriving the temporal candidate may be modified to ((xColCi>>3)<<3, (yColCi>>3)<<3).

[0177] Hereinafter, a method of deriving a history-based candidate in case of a merge mode and / or a skip mode will be described.The history-based candidate may be represented by a history-based merge candidate.

[0178] After the spatial candidates and temporal candidates are added to the merge candidate list, history-based candidates may be added to the merge candidate list. For example, the motion information of a previously encoded / decoded block may be stored in a table and used as a history-based candidate for the current block. The table may store multiple history-based candidates during the encoding / decoding process. The table may be initialized at the beginning of a new CTU row. Initializing the table may mean clearing the corresponding table by deleting all history-based candidates stored in the table. Whenever there is an inter-prediction block, the relevant motion information may be added to the table as the last entry. In this case, the inter-prediction block may not be a block based on sub-block prediction. The motion information added to the table may be used as a new history-based candidate.

[0179] The table of history-based candidates may have a predetermined size. For example, the size may be 5. In this case, the table may store up to five history-based candidates. When a new candidate is added to the table, a limited first-in, first-out (FIFO) rule of redundant checking of whether there is an identical candidate in the table may be applied. If an identical candidate already exists in the table, the identical candidate may be deleted from the table and the positions of all subsequent history-based candidates may be moved forward.

[0180] History-based candidates can be used in the process of configuring a merge candidate list. In this case, the history-based candidates most recently included in the table can be checked in sequence and located after the temporal candidates in the merge candidate list. When a history-based candidate is included in the merge candidate list, a redundant check with a spatial candidate or a temporal candidate already included in the merge candidate list can be performed. If a spatial candidate or a temporal candidate already included in the merge candidate list overlaps with a history-based candidate, the history-based candidate may not be included in the merge candidate list. The amount of computation can be reduced by simplifying the redundant check as follows.

[0181] The number of history-based candidates used to generate the merge candidate list can be set to (N<=4)?M:(8-N). In this case, N can represent the number of candidates already included in the merge candidate list, and M can represent the number of available history-based candidates included in the table. That is, when 4 or fewer candidates are included in the merge candidate list, the number of history-based candidates used to generate the merge candidate list may be M, and when the merge candidate list includes N candidates greater than 4, the number of history-based candidates used to generate the merge candidate list may be set to (8-N).

[0182] When the total number of available merge candidates reaches (maximum allowed number of merge candidates - 1), configuration of the merge candidate list using history-based candidates may end.

[0183] Hereinafter, a method of deriving a pairwise average candidate in case of a merge mode and / or a skip mode will be described. The pairwise average candidate may be represented by a pairwise average merge candidate or a pairwise candidate.

[0184] Paired average candidates may be generated by obtaining predefined candidate pairs from the candidates included in the merge candidate list and averaging them. The predefined candidate pairs may be {(0,1), (0,2), (1,2), (0,3), (1,3), (2,3)} and the number of configurations of each candidate pair may be the index of the merge candidate list. That is, the predefined candidate pair (0,1) may mean a pair of index 0 candidates and index 1 candidates of the merge candidate list, and the paired average candidate may be generated by the average of the index 0 candidate and the index 1 candidate. The derivation of the paired average candidates may be performed in the order of the predefined candidate pairs. That is, after deriving the paired average candidates of the candidate pair (0,1), the process of deriving the paired average candidates may be performed in the order of the candidate pair (0,2) and the candidate pair (1,2). The paired average candidate derivation process may be performed until the configuration of the merge candidate list is completed. For example, the paired average candidate derivation process may be performed until the number of merge candidates included in the merge candidate list reaches the maximum number of merge candidates.

[0185] Pairwise average candidates may be calculated separately for each reference picture list. When two motion vectors are available for one reference picture list (L0 list or L1 list), the average of the two motion vectors may be calculated. In this case, even if the two motion vectors indicate different reference pictures, the average of the two motion vectors may be performed. If only one motion vector is available for one reference picture list, the available motion vector may be used as the motion vector of the pairwise average candidate. If both motion vectors are not available for one reference picture list, it may be determined that the reference picture list is invalid.

[0186] When configuration of the merge candidate list is not completed even after the pairwise average candidate is included in the merge candidate list, a zero vector may be added to the merge candidate list until the maximum number of merge candidates is reached.

[0187] When the MVP mode is applied to the current block, the reconstructed spatial neighboring blocks (e.g., Figure 8 The motion vector predictor (MVP) candidate list is generated based on the motion vector of the reconstructed spatial neighboring block (neighboring block shown) and / or the motion vector corresponding to the temporal neighboring block (or Col block). That is, the motion vector of the reconstructed spatial neighboring block and the motion vector corresponding to the temporal neighboring block can be used as the motion vector predictor candidate of the current block. When bidirectional prediction is applied, the MVP candidate list for L0 motion information derivation and the MVP candidate list for L1 motion information derivation are generated and used separately. The prediction information (or information about the prediction) of the current block may include candidate selection information (e.g., MVP flag or MVP index) indicating the best motion vector predictor candidate selected from the motion vector predictor candidates included in the MVP candidate list. In this case, the prediction unit can use the candidate selection information to select the motion vector predictor of the current block from the motion vector predictor candidates included in the MVP candidate list. The prediction unit of the image encoding device can obtain and encode the motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor and output the encoded MVD in the form of a bitstream. That is, the MVD can be obtained by subtracting the motion vector predictor from the motion vector of the current block. The prediction unit of the image decoding device may obtain the motion vector difference included in the information about the prediction and derive the motion vector of the current block by adding the motion vector difference to the motion vector predictor. The prediction unit of the image decoding device may obtain or derive the reference picture index indicating the reference picture from the information about the prediction.

[0188] Fig.13 is a view schematically illustrating a method for constructing a motion vector predictor candidate list according to an example of the present disclosure.

[0189] First, the spatial candidate blocks of the current block can be searched and the available candidate blocks can be inserted into the MVP candidate list (S1010). Thereafter, it is determined whether the number of MVP candidates included in the MVP candidate list is less than 2 (S1020), and when the number of MVP candidates is 2, the construction of the MVP candidate list can be completed.

[0190] In step S1020, when the number of available spatial candidate blocks is less than 2, the temporal candidate blocks of the current block may be searched and the available candidate blocks may be inserted into the MVP candidate list (S1030). When the temporal candidate blocks are not available, a zero motion vector may be inserted into the MVP candidate list (S1040), thereby completing the construction of the MVP candidate list.

[0191] In addition, when the MVP mode is applied, the reference picture index may be explicitly signaled. In this case, the reference picture index refidxL0 for L0 prediction and the reference picture index refidxL1 for L1 prediction may be signaled differently. For example, when the MVP mode is applied and dual prediction is applied, information about refidxL0 and information about refidxL1 may be signaled.

[0192] As described above, when the MVP mode is applied, information about the MVP derived by the image encoding device may be signaled to the image decoding device. For example, the information about the MVD may include the MVD absolute value and information indicating the x and y components for the sign. In this case, when the MVD absolute value is greater than 0, whether the MVD absolute value is greater than 1 and information indicating the MVD remainder may be signaled step by step. For example, only when the value of the flag information indicating whether the MVD absolute value is greater than 0 is 1, the information indicating whether the MVD absolute value is greater than 1 may be signaled.

[0193] Overview of Affine Mode

[0194] Hereinafter, an affine mode as an example of an inter-frame prediction mode will be described in detail. In a conventional video encoding / decoding system, only one motion vector is used to express the motion information of a current block. However, in this method, there is a problem that the best motion information is expressed only in units of blocks, but the best motion information cannot be expressed in units of pixels. In order to solve this problem, an affine mode that defines the motion information of a block in units of pixels has been proposed. According to the affine mode, two to four motion vectors associated with the current block can be used to determine the motion vectors of each pixel and / or sub-block unit of the block.

[0195] Compared with the existing motion information expressed using translational motion (or displacement) of pixel values, in the affine mode, the motion information of each pixel can be expressed using at least one of translational motion, scaling, rotation, or shearing. Among them, the affine mode that uses displacement, scaling, or rotation to express the motion information of each pixel can be a similar or simplified affine mode. The affine mode in the following description can mean a similar or simplified affine mode.

[0196] The motion information in the affine mode can be expressed using two or more control point motion vectors (CPMVs). The CPMVs can be used to derive the motion vector for a specific pixel position of the current block. In this case, the set of motion vectors for each pixel and / or sub-block of the current block can be defined as an affine motion vector field (affine MVF).

[0197] Fig.14 is a view illustrating a parametric model of an affine pattern.

[0198] When the affine mode is applied to the current block, the affine MVF can be derived using one of a 4-parameter model and a 6-parameter model. In this case, the 4-parameter model may refer to a model type using two CPMVs, and the 6-parameter model may refer to a model type using three CPMVs. Fig.14 (a) and Fig.14 (b) shows the CPMV used in the 4-parameter model and the 6-parameter model respectively.

[0199] When the position of the current block is (x, y), the motion vector according to the pixel position may be derived according to the following formula 1 or formula 2. For example, the motion vector according to the 4-parameter model may be derived according to formula 1, and the motion vector according to the 6-parameter model may be derived according to formula 2.

[0200] [Formula 1]

[0201]

[0202] [Formula 2]

[0203]

[0204] In Equations 1 and 2, mv0={mv_0x, mv_0y} may be the CPMV at the upper left corner position of the current block, v1={mv_1x, mv_1y} may be the CPMV at the upper right position of the current block, and mv2={mv_2x, mv_2y} may be the CPMV at the lower left position of the current block. In this case, W and H correspond to the width and height of the current block, respectively, and mv={mv_x, mv_y} may mean the motion vector of the pixel position {x, y}.

[0205] In the encoding / decoding process, the affine MVF can be determined in units of pixels and / or predefined sub-blocks. When the affine MVF is determined in units of pixels, the motion vector can be derived based on the individual pixel values. In addition, when the affine MVF is determined in units of sub-blocks, the motion vector of the corresponding block can be derived based on the center pixel value of the sub-block. The center pixel value may mean a virtual pixel present in the center of the sub-block or a lower right pixel among the four pixels present in the center. In addition, the center pixel value may be a specific pixel in the sub-block and may be a pixel representing the sub-block. In the present disclosure, the case of determining the affine MVF in units of 4×4 sub-blocks will be described. However, this is only for the convenience of description, and the size of the sub-block may be changed differently.

[0206] That is, when affine prediction is available, the motion model applicable to the current block may include three models, namely, a translation motion model, a 4-parameter affine motion model, and a 6-parameter affine motion model. Here, the translation motion model may represent a model used by an existing block unit motion vector, the 4-parameter affine motion model may represent a model used by two CPMVs, and the 6-parameter affine motion model may represent a model used by three CPMVs. The affine mode may be divided into detailed modes according to the motion information encoding / decoding method. For example, the affine mode may be further divided into an affine MVP mode and an affine merge mode.

[0207] When the affine merge mode is applied to the current block, the CPMV can be derived from the neighboring blocks of the current block encoded / decoded in the affine mode. The affine merge mode can be applied to the current block when at least one neighboring block of the current block is encoded / decoded in the affine mode. That is, when the affine merge mode is applied to the current block, the CPMV of the current block can be derived using the CPMV of the neighboring blocks. For example, the CPMV of the neighboring blocks can be determined as the CPMV of the current block, or the CPMV of the current block can be derived based on the CPMV of the neighboring blocks. When the CPMV of the current block is derived based on the CPMV of the neighboring blocks, at least one encoding parameter of the current block or the neighboring blocks can be used. For example, the CPMV of the neighboring blocks can be modified based on the size of the neighboring blocks and the size of the current block and used as the CPMV of the current block.

[0208] In addition, the affine merge that derives MV in units of sub-blocks may be referred to as a sub-block merge mode, which may be specified by a merge_subblock_flag having a first value (e.g., 1). In this case, the affine merge candidate list described below may be referred to as a sub-block merge candidate list. In this case, the candidate derived as the SbTMVP described below may be further included in the sub-block merge candidate list. In this case, the candidate derived as the sbTMVP may be used as a candidate for index #0 of the sub-block merge candidate list. In other words, the candidate derived as the sbTMVP may be located in front of the inherited affine candidate and the constructed affine candidate described below in the sub-block merge candidate list.

[0209] For example, an affine mode flag specifying whether affine mode is applicable to the current block may be defined, which may be signaled at at least one higher level (e.g., sequence, picture, slice, patch, patch group, tile, etc.) of the current block. For example, the affine mode flag may be named sps_affine_enabled_flag.

[0210] When the affine merge mode is applied, the affine merge candidate list may be configured to derive the CPMV of the current block. In this case, the affine merge candidate list may include at least one of an inherited affine merge candidate, a constructed affine merge candidate, or a zero merge candidate. When the neighboring blocks of the current block are encoded / decoded in affine mode, the inherited affine merge candidate may mean a candidate derived using the CPMV of the neighboring block. Constructing an affine merge candidate may mean a candidate that derives each CPMV based on the motion vector of the neighboring block of each control point (CP). In addition, a zero merge candidate may mean a candidate consisting of a CPMV of size 0. In the following description, CP may mean a specific position of a block used to derive a CPMV. For example, CP may be each vertex position of a block.

[0211] Fig.15 is a view illustrating a method of generating an affine merge candidate list.

[0212] Reference Fig.15 , the affine merge candidates can be added to the affine merge candidate list in the order of inheriting the affine merge candidate (S1210), constructing the affine merge candidate (S1220), and the zero merge candidate (S1230). When the number of candidates included in the candidate list does not meet the maximum number of candidates even if all the inherited affine merge candidates and the constructed affine merge candidates are added to the affine merge candidate list, the zero merge candidate can be added. In this case, the zero merge candidate can be added until the number of candidates in the affine merge candidate list meets the maximum number of candidates.

[0213] Fig.16is a view illustrating a control point motion vector (CPMV) derived from neighboring blocks.

[0214] For example, up to two inherited affine merge candidates may be derived, each of which may be derived based on at least one of the left neighboring block and the upper neighboring block. Figure 8 Describe the neighboring blocks used to derive the inherited affine merge mode. The inherited affine merge candidate derived based on the left neighboring block is derived based on at least one of A0 or A1, and the inherited affine merge candidate derived based on the upper neighboring block can be derived based on at least one of B0, B1 or B2. In this case, the scanning order of the neighboring blocks may be A0 to A1 and B0, B1 and B2, but is not limited to this. For each of the left and the upper, the inherited affine merge candidate can be derived based on the first neighboring block available in the scanning order. In this case, no redundancy check may be performed between the candidates derived from the left neighboring block and the upper neighboring block.

[0215] For example, Fig.16 As shown, when the left neighboring block A is encoded / decoded in affine mode, at least one of the motion vectors v2, v3, and v4 corresponding to the CP of the neighboring block A can be derived. When the neighboring block A is encoded / decoded by a 4-parameter affine model, the inherited affine merge candidate can be derived using v2 and v3. In contrast, when the neighboring block A is encoded / decoded by a 6-parameter affine model, the inherited affine merge candidate can be derived using v2, v3, and v4.

[0216] Fig.17 is a view illustrating neighboring blocks used to derive and construct affine merge candidates.

[0217] Constructing an affine candidate may mean a candidate with a CPMV derived using a combination of general motion information of neighboring blocks. The motion information of each CP may be derived using a spatial neighboring block or a temporal neighboring block of the current block. In the following description, CPMVk may mean a motion vector representing the kth CP. For example, referring to Fig.17 , CPMV1 may be determined as the first motion vector available among the motion vectors of B2, B3, and A2, and in this case, the scanning order may be B2, B3, and A2. CPMV2 may be determined as the first motion vector available among the motion vectors of B1 and B0, and in this case, the scanning order may be B1 and B0. CPMV3 may be determined as one of the motion vectors of A1 and A0, and in this case, the scanning order may be A1 and A0. When TMVP is applicable to the current block, CPMV4 may be determined as the motion vector of the temporally neighboring block T.

[0218] After deriving the four motion vectors of each CP, an affine merge candidate can be derived based on this. The affine merge candidate can be configured by including at least two motion vectors selected from the four motion vectors of each CP derived. For example, the affine merge candidate can be composed of at least one of {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2} or {CPMV1, CPMV3} in this order. The affine candidate constructed by three motion vectors can be a candidate for a 6-parameter affine model. In contrast, the affine candidate constructed by two motion vectors can be a candidate for a 4-parameter affine model. In order to avoid the scaling process of the motion vector, when the reference picture indexes of the CPs are different from each other, the combination of the relevant CPMVs can be ignored and not used to derive the affine candidate.

[0219] When the affine MVP mode is applied to the current block, the encoding / decoding device may derive two or more CPMV predictors and CPMV of the current block and derive the CPMV difference based on them. In this case, the CPMV difference may be signaled from the encoding device to the decoding device. The image decoding device may derive the CPMV predictor of the current block, reconstruct the signaled CPMV difference, and then derive the CPMV of the current block based on the CPMV predictor and the CPMV difference.

[0220] In addition, the affine MVP mode may be applied to the current block only when the affine merge mode or the sub-block based TMVP is not applied to the current block. In addition, the affine MVP mode may be expressed as an affine CP MVP mode.

[0221] When affine MVP is applied to the current block, the affine MVP candidate list may be configured to derive the CPMV of the current block. In this case, the affine MVP candidate list may include at least one of an inherited affine MVP candidate, a constructed affine MVP candidate, a translation motion affine MVP candidate, or a zero MVP candidate.

[0222] In this case, the inherited affine MVP candidate may mean a candidate derived based on the CPMV of a neighboring block when the neighboring block of the current block is encoded / decoded in affine mode. The constructed affine MVP candidate may mean a candidate derived by generating a CPMV combination based on the motion vector of the CP neighboring block. The zero MVP candidate may mean a candidate consisting of a CPMV with a value of 0. The derivation method and the characteristics of the inherited affine MVP candidate and the constructed affine MVP candidate are the same as those of the inherited affine candidate and the constructed affine candidate described above, so their description will be omitted.

[0223] When the maximum number of candidates in the affine MVP candidate list is 2, affine MVP candidates, translational motion affine MVP candidates and zero MVP candidates may be added when the current number of candidates is less than 2. Specifically, the translational motion affine MVP candidates may be derived in the following order.

[0224] For example, when the number of candidates included in the affine MVP candidate list is less than 2 and CPMV0 for constructing the affine MVP candidate is valid, CPMV0 can be used as the affine MVP candidate. That is, the affine MVP candidate whose all motion vectors of CP0, CP1, and CP2 are CPMV0 can be added to the affine MVP candidate list.

[0225] Next, when the number of candidates in the affine MVP candidate list is less than 2 and CPMV1 for constructing the affine MVP candidate is valid, CPMV1 can be used as the affine MVP candidate. That is, the affine MVP candidate whose motion vectors of CP0, CP1, and CP2 are all CPMV1 can be added to the affine MVP candidate list.

[0226] Next, when the number of candidates in the affine MVP candidate list is less than 2 and CPMV2 for constructing the affine MVP candidate is valid, CPMV2 can be used as the affine MVP candidate. That is, the affine MVP candidate whose motion vectors of CP0, CP1, and CP2 are all CPMV2 can be added to the affine MVP candidate list.

[0227] Regardless of the above conditions, when the number of candidates of the affine MVP candidate list is less than 2, a temporal motion vector predictor (TMVP) of the current block may be added to the affine MVP candidate list.

[0228] Regardless of the addition of the translational motion affine MVP candidate, when the number of candidates of the affine MVP candidate list is less than 2, a zero MVP candidate may be added to the affine MVP candidate list.

[0229] Fig.18 is a view illustrating a method of generating an affine MVP candidate list.

[0230] Reference Fig.18 , the candidates may be added to the affine MVP candidate list in the order of inheriting the affine MVP candidate (S1610), constructing the affine MVP candidate (S1620), translating the motion affine MVP candidate (S1630), and zeroing the MVP candidate (S1640). As described above, steps S1620 to S1640 may be performed depending on whether the number of candidates included in the affine MVP candidate list in each step is less than 2.

[0231] The scanning order of the inherited affine MVP candidate may be equal to the scanning order of the inherited affine merge candidate. However, in the case of the inherited affine MVP candidate, only the neighboring blocks that refer to the same reference picture as the reference picture of the current block may be considered. When the inherited affine MVP candidate is added to the affine MVP candidate list, redundancy check may not be performed.

[0232] In order to derive and construct affine MVP candidates, we can only consider Fig.17 The spatial neighboring blocks shown. In addition, the scanning order for constructing the affine MVP candidate can be equal to the scanning order for constructing the affine merge candidate. In addition, in order to derive the construction of the affine MVP candidate, the reference picture index of the neighboring block can be checked, and in the scanning order, the first neighboring block that is inter-coded and refers to the same reference picture as the reference picture of the current block can be used.

[0233] Overview of the Sub-Block-Based TMVP (SbTMVP) Mode

[0234] Hereinafter, a subblock-based TMVP mode as an example of an inter prediction mode will be described in detail. According to the subblock-based TMVP mode, a motion vector field (MVF) of a current block may be derived and a motion vector may be derived in units of subblocks.

[0235] Unlike the conventional TMVP mode performed in units of coding units, for coding units to which the sub-block based TMVP mode is applied, motion vectors can be encoded / decoded in units of sub-coding units. In addition, according to the conventional TMVP mode, temporal motion vectors can be derived from collocated blocks, but in the sub-block based TMVP mode, motion vector fields can be derived from reference blocks specified by motion vectors derived from neighboring blocks of the current block. Hereinafter, the motion vector derived from the neighboring blocks may be referred to as motion shift or representative motion vector of the current block.

[0236] Fig.19 is a view of neighboring blocks illustrating a sub-block based TMVP mode.

[0237] When the sub-block based TMVP mode is applied to the current block, the neighboring blocks used to determine the motion shift may be determined. Fig.19 The neighboring blocks for determining motion shift are scanned in the order of blocks A1, B1, B0 and A0 of the current block. As another example, the neighboring blocks for determining motion shift may be limited to specific neighboring blocks of the current block. For example, the neighboring block for determining motion shift may always be determined as block A1. When a neighboring block has a motion vector of a reference col picture, the corresponding motion vector may be determined as motion shift. The motion vector determined as motion shift may be referred to as a temporal motion vector. In addition, when the above-mentioned motion vector cannot be derived from the neighboring blocks, the motion shift may be set to (0,0).

[0238] Fig. 20 is a view illustrating a method of deriving a motion vector field according to a sub-block based TMVP mode.

[0239] Next, the reference block on the collocated picture specified by the motion shift can be determined. For example, the sub-block-based motion information (motion vector or reference picture index) can be obtained from the col picture by adding the motion shift to the coordinates of the current block. Fig. 20 In the example shown, it is assumed that the motion shift is the motion vector of the A1 block. By applying the motion shift to the current block, the sub-blocks (col sub-blocks) corresponding to the respective sub-blocks configuring the current block in the col picture can be specified. Thereafter, using the motion information of the corresponding sub-blocks (col sub-blocks) in the col picture, the motion information of the respective sub-blocks of the current block can be derived. For example, the motion information of the corresponding sub-block can be obtained from the center position of the corresponding sub-block. In this case, the center position can be the position of the lower right sample among the four samples located at the center of the corresponding sub-block. When the motion information of a particular sub-block of the col block corresponding to the current block is not available, the motion information of the center sub-block of the col block can be determined as the motion information of the corresponding sub-block. When the motion vector of the corresponding sub-block is derived, similar to the above-mentioned TMVP process, it is possible to switch to the reference picture index and the motion vector of the current sub-block. That is, when deriving a sub-block-based motion vector, the POC of the reference picture of the reference block can be considered to perform scaling of the motion vector.

[0240] As described above, a sub-block-based TMVP candidate of the current block may be derived using a motion vector field or motion information of the current block derived on a sub-block basis.

[0241] Hereinafter, a merge candidate list configured in subblock units is defined as a subblock-unit merge candidate list. The above-mentioned affine merge candidates and subblock-based TMVP candidates may be merged to configure a subblock-unit merge candidate list.

[0242] In addition, a sub-block-based TMVP mode flag that specifies whether the sub-block-based TMVP mode is applicable to the current block may be defined, which may be signaled at at least one level among the higher levels of the current block (e.g., sequence, picture, slice, patch, patch group, tile, etc.). For example, the sub-block-based TMVP mode flag may be named sps_sbtmvp_enabled_flag. When the sub-block-based TMVP mode is applicable to the current block, the sub-block-based TMVP candidate may be first added to the sub-block unit merge candidate list, and then the affine merge candidate may be added to the sub-block unit merge candidate list. In addition, the maximum number of candidates that may be included in the sub-block unit merge candidate list may be signaled. For example, the maximum number of candidates that may be included in the sub-block unit merge candidate list may be 5.

[0243] The size of the sub-block used to derive the sub-block unit merge candidate list may be signaled or preset to M×N. For example, M×N may be 8×8. Therefore, the affine mode or the sub-block-based TMVP mode is applicable to the current block only when the size of the current block is 8×8 or larger.

[0244] The following will describe the implementation of the prediction execution method disclosed in the present invention. Figure 4 Step S410 or Figure 6 The following prediction execution method is performed in step S630.

[0245] A prediction block of a current block may be generated based on motion information derived according to a prediction mode. A prediction block (predicted block) may include prediction samples (prediction sample array) of a current block. When a motion vector of a current block specifies a partial sample unit, an interpolation process may be performed, and thereby, a prediction sample of a current block may be derived based on a reference sample in a partial sample unit within a reference picture. When affine inter prediction is applied to a current block, a prediction sample may be generated based on a sample / sub-block unit MV. When bi-prediction is applied, a prediction sample derived by a weighted sum or weighted average (according to a phase) of a prediction sample derived based on L0 prediction (i.e., prediction using MVL0 and a reference picture within a reference picture list L0) and a prediction sample derived based on L1 prediction (i.e., prediction using MLV1 and a reference picture within a reference picture list L1) may be used as a prediction sample of a current block. When bi-prediction is applied and a reference picture for L0 prediction and a reference picture for L1 prediction are located in different temporal directions relative to a current picture (i.e., if it corresponds to bi-prediction and bi-directional prediction), this may be referred to as true bi-prediction.

[0246] In the image decoding device, reconstructed samples and reconstructed pictures can be generated based on the derived prediction samples, and then an in-loop filtering process can be performed. In addition, in the image encoding device, residual samples can be derived based on the derived prediction samples, and encoding of image information including prediction information and residual information can be performed.

[0247] Bi-prediction with CU-level weights, BCW

[0248] When bi-prediction is applied to the current block as described above, the prediction sample can be derived based on weighted averaging. Conventionally, the bi-prediction signal (i.e., bi-prediction sample) can be derived by a simple average of the L0 prediction signal (L0 prediction sample) and the L1 prediction signal (L1 prediction sample). That is, the bi-prediction sample is derived by averaging the L0 prediction sample based on the L0 reference picture and MVL0 and the L1 prediction sample based on the L1 reference picture and MVL1. However, according to the present disclosure, when bi-prediction is applied, the bi-prediction signal (bi-prediction sample) can be derived by a weighted average of the L0 prediction signal and the L1 prediction signal as follows.

[0249] [Formula 3]

[0250] P bi-pred =(8-w)*P0+w*P1+4)>>3

[0251] In the above formula 3, P bi-pred represents a dual prediction signal (dual prediction block) derived by weighted averaging, P0 and P1 represent L0 prediction samples (L0 prediction block) and L1 prediction samples (L1 prediction block), respectively. In addition, (8-w) and w represent weights applied to P0 and P1, respectively.

[0252] When generating a dual prediction signal by weighted averaging, five weights may be allowed. For example, the weight w may be selected from {-2, 3, 4, 5, 10}. For each dual prediction CU, the weight w may be determined by one of two methods. As the first of the two methods, when the current CU is not in merge mode (non-merged CU), the weight index may be signaled together with the motion vector difference. For example, the bitstream may include information about the weight index after the information about the motion vector difference. As the second of the two methods, when the current CU is in merge mode (merged CU), the weight index may be derived from the neighboring block based on the merge candidate index (merged index).

[0253] The generation of a dual prediction signal by weighted averaging can be limited to be applied only to CUs having a size including 256 or more samples (luminance component samples). That is, dual prediction by weighted averaging can be performed only for CUs whose product of the width and height of the current block is 256 or more. In addition, the weight w can be used as one of the five weights as described above, and one of a different number of weights can be used. For example, depending on the characteristics of the current image, five weights can be used for low-delay pictures and three weights can be used for non-low-delay pictures. In this case, the three weights can be {3, 4, 5}.

[0254] By applying a fast search algorithm, the image encoding device can determine the weight index without significantly increasing complexity. In this case, the fast search algorithm can be summarized as follows. Hereinafter, unequal weights may mean that the weights applied to P0 and P1 are not equal. In addition, equal weights may mean that the weights applied to P0 and P1 may be equal.

[0255] - In the case where the AMVR mode in which the resolution of the motion vector is adaptively changed is applied together, when the current picture is a low-delay picture, unequal weights may be conditionally checked only for each of the 1-pel motion vector resolution and the 4-pel motion vector resolution.

[0256] - In a case where the affine mode is applied together and the affine mode is selected as the optimal mode of the current block, the image encoding apparatus may perform affine motion estimation (ME) for respective unequal weights.

[0257] - Unequal weights may only be checked conditionally when the two reference pictures used for bi-prediction are equal.

[0258] - When the predetermined condition is met, the unequal weight may not be checked. The predetermined picture may be based on the POC distance between the current picture and the reference picture, the quantization parameter (QP), the temporal level, etc.

[0259] The weight index of the BCW can be encoded using one context coding bin and one or more subsequent bypass coding bins. The first context coding bin specifies whether equal weights are used. When unequal weights are used, additional bins can be bypass coded and signaled. Additional bins can be signaled to specify which weights to use.

[0260] Weighted prediction (WP) is a tool for efficiently encoding images including faded images. According to weighted prediction, weighting parameters (weights and offsets) can be signaled for each reference picture included in each of the reference picture lists L0 and L1. Then, when motion compensation is performed, the weights and offsets can be applied to the corresponding reference pictures. Weighted prediction and BCW can be used for different types of images. In order to avoid interaction between weighted prediction and BCW, the BCW weight index may not be signaled for a CU using weighted prediction. In this case, the weight may be inferred to be 4. That is, equal weights may be applied.

[0261] In the case of a CU to which merge mode is applied, a weight index can be inferred from neighboring blocks based on a merge candidate index. This can be applied to both general merge mode and inherited affine merge mode.

[0262] In the case of constructing the affine merge mode, the affine motion information can be configured based on the motion information of up to three blocks. In this case, for a CU using the constructing affine merge mode, the following process can be performed to derive the BCW weight index.

[0263] (1) First, the range of BCW weight index {0, 1, 2, 3, 4} can be divided into three groups {0}, {1, 2, 3} and {4}. When the BCW weight indexes of all CPs are from the same group, the BCW weight index can be derived by the following step (2). Otherwise, the BCW weight index can be set to 2.

[0264] (2) When at least two CPs have the same BCW weight index, the same BCW weight index may be assigned as the weight index for constructing an affine merge candidate. Otherwise, the weight index for constructing an affine merge candidate may be set to 2.

[0265] The invention according to the present disclosure described below relates to dual prediction based on weighted averaging and includes a method for deriving a BCW weight index, specifically, when configuring a temporal candidate for a merge mode or a temporal candidate for a sub-block merge mode. In addition, according to the present disclosure, a method for deriving a BCW weight index when deriving a paired (merged) candidate is provided. Hereinafter, the BCW weight index may be referred to as a weight index for short. The various embodiments included in the present disclosure may be used alone or two or more embodiments may be used in combination.

[0266] According to an embodiment of the present disclosure, when a temporal merge candidate uses bi-prediction to derive a merge candidate for a merge mode, the weight index of the temporal merge candidate may always be set to a default index (e.g., 0). Hereinafter, the default index may mean that the weights of the prediction directions (i.e., the L0 prediction direction and the L1 prediction direction in the bi-prediction) are equal (equal weight). According to this embodiment, the weight index of the temporal merge candidate may be efficiently derived without increasing the computational complexity of the image encoding / decoding device.

[0267] According to another embodiment of the present disclosure, when a temporal merge candidate uses dual prediction to derive a merge candidate for a merge mode, the weight index of the temporal merge candidate can be set to the weight index of the collocated block. According to this embodiment, using the weight index of the collocated block that has been derived can be expected to improve the coding efficiency without significantly increasing the computational complexity of the image encoding / decoding device.

[0268] According to another embodiment of the present disclosure, when a temporal candidate is derived as a merge candidate for a merge mode in units of subblocks using dual prediction, the weight index of the temporal candidate may always be set to a default index (e.g., 0). Alternatively, when a temporal candidate is selected from a subblock merge candidate list based on a merge index, the weight index of the current block may be set to 0. According to this embodiment, the weight index of the temporal merge candidate may be efficiently derived in units of subblocks even for a merge mode without increasing the computational complexity of an image encoding / decoding device.

[0269] According to another embodiment of the present disclosure, when the temporal candidate uses dual prediction to derive a merge candidate for a merge mode in sub-block units, the weight index of the temporal candidate can be set to the weight index of the center block. The center block can be a block in the col picture that includes coordinates corresponding to the center position of the current block. The coordinates corresponding to the center position can be derived based on the upper left coordinates (x, y) of the current block and the width and height of the current block. For example, the coordinates corresponding to the center position can be (x+width / 2, y+height / 2). According to this embodiment, by using the already derived weight index of the center block, improvements in coding efficiency can be expected without significantly increasing the computational complexity of the image encoding / decoding device.

[0270] According to another embodiment of the present disclosure, when the temporal candidate uses dual prediction to derive a merge candidate for merge mode in units of subblocks, the weight index of the temporal candidate of the current subblock may be set to the weight index of the corresponding col subblock. If the col subblock is not available or the weight index of the col subblock is not available, the weight index of the temporal candidate of the current subblock may be set to the BCW weight index of the center block. According to this embodiment, the weight index of the corresponding col subblock may be used to improve coding efficiency.

[0271] According to another embodiment of the present disclosure, when deriving a merge candidate for a merge mode, a weight index of a paired candidate may be set. As described above, a paired candidate may be derived based on a predefined candidate pair selected from among the candidates included in the merge candidate list. The candidate pair for deriving a paired candidate may be represented by cand0 and cand1.

[0272] According to the example of the present embodiment, when the paired candidate uses dual prediction, the weight index of the paired candidate can be set to the weight index of cand0. Alternatively, the weight index of the paired candidate can be set to the weight index of cand0, or can be set to a weight index other than the default (1:1 weight index) among the weight index of cand0 and the weight index of cand1.

[0273] According to another example of the present embodiment, at least one of the following four methods may be applied in order to set weight indexes for pairs of candidates.

[0274] (1) The weight index of the pair of candidates can be set to the weight index of cand0.

[0275] (2) The weight index of the paired candidate may be set to the weight index of the bi-prediction candidate among cand0 and cand1.

[0276] (3) When cand0 and cand1 have the same weight index, the weight index of the paired candidate may be set to the corresponding weight index. Otherwise, the weight index of the paired candidate may be set to a default index. The default index may be an index indicating equal weight.

[0277] (4) When cand0 and cand1 have the same weight index, the weight index of the paired candidate may be set to the corresponding weight index. Otherwise, the weight index of the paired candidate may be set to a weight index other than the default index among the weight index of cand0 and the weight index of cand1. The default index may be an index indicating equal weight.

[0278] Paired candidates have similar characteristics to constructing affine candidates because they are generated by combining multiple candidates. Therefore, according to another example of the present embodiment, a method for deriving weight indices of paired candidates in consideration of design consistency may be provided. When the candidate pair used to derive paired candidates may be referred to as cand0 and cand1, the weight index of cand0 is referred to as bcwIdx0, and the weight index of cand1 is referred to as bcwIdx1, and at least one of the following two methods may be applied to set the weight index of the paired candidates.

[0279] (1) The weight index may be set based on whether bcwIdx0 and bcwIdx1 are the same. It may be determined whether bcwIdx0 and bcwIdx1 are the same, and if they are the same, the weight index of the paired candidate may be set to bcwIdx0. When they are not the same, the weight index of the paired candidate may be set to a default index. The default index may be an index indicating equal weight.

[0280] (2) Simply, the weight index of the pair of candidates can be set to the weight index of the first candidate (e.g., bcwIdx0).

[0281] According to the present embodiment, various methods of deriving weight indices for pairs of candidates may be provided.

[0282] According to another embodiment of the present disclosure, various methods of setting a weight index for constructing an affine merge candidate when deriving a merge candidate for a merge mode in units of subblocks may be provided.

[0283] As reference Fig.17As described, the representative motion vector CPMVk of the kth CP may be derived (k is an integer from 1 to 4). That is, CPMV1 may be a motion vector representing the first CP (upper left CP, CP0), CPMV2 may be a motion vector representing the second CP (upper right CP, CP1), CPMV3 may be a motion vector representing the third CP (lower left CP, CP2), and CPMV4 may be a motion vector representing the fourth CP (lower right CP, RB or CP3). For example, the affine merge candidate may be constructed by deducing in the order of {CP0, CP1, CP2}, {CP0, CP1, CP3}, {CP0, CP2, CP3}, {CP1, CP2, CP3}, {CP0, CP1}, and {CP0, CP2}.

[0284] According to an example of this embodiment, the weight index for constructing an affine merge candidate may be set to the weight index of the block used to derive CPMV1 among the candidate blocks of CP0. Fig.17 In the example, when the motion vector of B3 among B2, B3 and A2 is determined to be CPMV1, the weight index for constructing the affine merge candidate can be set to the weight index of B3. However, this is only an example, and the weight index of the candidate block of one CP among CP0, CP1, CP2 and RB can be used.

[0285] According to another example of the present embodiment, a weight index other than the default index among the weight indexes of each CP can be used as a weight index for constructing an affine merge candidate. Alternatively, the weight index for constructing an affine merge candidate can be determined based on the frequency of occurrence of the weight index. For example, the weight index for constructing an affine merge candidate can be derived using a weight index with a high frequency of occurrence among the weight indexes of the candidate blocks of a specific CP (e.g., CP0). Alternatively, a weight index with a high frequency of occurrence among the weight indexes of the CPs that configure the construction of the affine merge candidate can be used. For example, in the case of a combination of {CP0, CP2, CP3 (RB)}, the weight index with the highest frequency of occurrence among the weight indexes of CP0, CP2, and RB can be used as the weight index for constructing an affine merge candidate. In this case, the weight index of the RB can be derived based on the method for deriving the weight index of the temporal candidate described above.

[0286] According to the present embodiment, the weight index for constructing the affine merging candidate can be efficiently derived without increasing the computational complexity of the image encoding / decoding device.

[0287] According to another example of the present embodiment, CP0, CP1 and CP2 are spatial candidates, and the weight index of the corresponding CP can be derived from the spatial neighboring blocks. In addition, CP3 (RB) can be a temporal candidate, and the weight index of CP3 can be set to a default index. In this case, when the weight index of the first CP in each combination is CP_0, the weight index of the second CP is CP_1, and the weight index of the third CP is CP_2, the weight index IDX of the corresponding constructed affine merge candidate can be derived as shown in Table 1 below.

[0288] [Table 1]

[0289]

[0290] According to Table 1 above, when CP_0 and CP_1 are the same, IDX can be set to CP_0, otherwise, IDX can be set to a default index. In this case, CP_2 for most combinations is derived from CP3 (RB). That is, CP_2 can have a default value. Therefore, for simplicity, the comparison with CP_2 can be omitted. Alternatively, the weight index for constructing an affine merge candidate can always be derived using the weight index (CP_0) of the first CP in the combination without performing the comparison process shown in Table 1 above. For example, as a weight index for constructing an affine merge candidate, the weight index of CP0 can be used in the case of a combination of {CP0, CP2, CP3}, and the weight index of CP1 can be used in the case of a combination of {CP1, CP2, CP3}.

[0291] Fig.21 is a view illustrating a method of deriving a weight index for constructing an affine merge candidate according to another embodiment of the present disclosure. Fig.21 Corresponds to Fig.17 , and exemplarily shows the motion vectors of CP0 to CP3.

[0292] The weight index for constructing an affine merge candidate can be derived based on the weight index and / or weight group index of each CP. The weight indexes of the CPs configuring each combination may be referred to as bcwIdxCorner0, bcwIdxCorner1, and bcwIdxCorner2, respectively. That is, bcwIdxCorner0 may mean the weight index of the first CP in the combination, bcwIdxCorner1 may mean the weight index of the second CP in the combination, and bcwIdxCorner2 may mean the weight index of the third CP in the combination. For example, in the case of a combination of {CP0, CP2, CP3}, bcwIdxCorner0, bcwIdxCorner1, and bcwIdxCorner2 may correspond to the weight indexes of CP0, CP2, and CP3, respectively. In addition, when the weight w is selected from a set of five predefined weights (e.g., {-2, 3, 4, 5, 10}), the weight index may have a value of 0 to 4, and the weight index may be classified into three groups. In this case, the three groups can be {0}, {1,2,3} and {4}. In this case, the index of the weight group of the weight index of the XCP in the combination can be represented by bcwIdxGroupX (X is an integer from 0 to 2). When the weight index is classified into three groups, the weight pairs indicated by the index can also be classified into three groups. For example, the weight pairs can be classified into three groups {(-1 / 4,5 / 4)}, {(1 / 4,3 / 4), (2 / 4,2 / 4), (3 / 4,1 / 4)} and {(5 / 4,-1 / 4)}.

[0293] According to an implementation of this embodiment, the weight index (bcwIdxConst) for constructing an affine merge candidate can be derived through the following Table 2.

[0294] [Table 2]

[0295]

[0296] As shown in Table 2, first, it may be checked whether bcwIdxCorner0 and bcwIdxCorner1 are the same and whether bcwIdxGroup0 and bcwIdxGroup2 are the same. If they are the same, bcwIdxConst may be set to bcwIdxCorner0. Otherwise, it may be checked whether bcwIdxCorner0 and bcwIdxCorner2 are the same and whether bcwIdxGroup0 and bcwIdxGroup1 are the same. If they are the same, bcwIdxConst may be set to bcwIdxCorner0.

[0297] Otherwise, it may be checked whether bcwIdxCorner1 and bcwIdxCorner2 are the same and whether bcwIdxGroup1 and bcwIdxGroup0 are the same. If they are the same, bcwIdxConst may be set to bcwIdxCorner2.

[0298] Otherwise, bcwIdxConst can be set to the default index.

[0299] According to this example, when three CPs are used, weight indices for constructing affine merge candidates can be derived through a maximum of six comparison operations.

[0300] According to another example of the present embodiment, the weight index (bcwIdxConst) for constructing the affine merge candidate can be derived by the following Table 3. As described above, the weight index of the temporal candidate can be set to a default index, and since the temporal candidate is included as the last CP of each combination, the comparison of bcwIdxCorner2 is not required. In the method of Table 3, the comparison of bcwIdxCorner2 is omitted from the method of Table 2 considering these characteristics.

[0301] [Table 3]

[0302]

[0303] As shown in Table 3 above, first, it may be checked whether bcwIdxCorner0 and bcwIdxCorner1 are the same and whether bcwIdxGroup0 and bcwIdxGroup2 are the same. If they are the same, bcwIdxConst may be set to bcwIdxCorner0. Otherwise, it may be checked whether bcwIdxGroup0 and bcwIdxGroup1 are the same. If they are the same, bcwIdxConst may be set to bcwIdxCorner0.

[0304] Otherwise, it may be checked whether bcwIdxGroup1 and bcwIdxGroup0 are the same. If they are the same, bcwIdxConst may be set to bcwIdxCorner2.

[0305] Otherwise, bcwIdxConst can be set to the default index.

[0306] According to another example of the present embodiment, the weight index (bcwIdxConst) for constructing the affine merge candidate can be derived by the following Table 4. As described above, three weights can be used for non-low-delay pictures, and these three weights can belong to one group. Therefore, in the derivation method of Table 4, compared with the derivation method of Table 2, the comparison of the index of the weight group can be omitted.

[0307] [Table 4]

[0308]

[0309] As shown in Table 4 above, first, it may be checked whether bcwIdxCorner0 and bcwIdxCorner1 are the same. If they are the same, bcwIdxConst may be set to bcwIdxCorner0. Otherwise, it may be checked whether bcwIdxCorner0 and bcwIdxCorner2 are the same. If they are the same, bcwIdxConst may be set to bcwIdxCorner0.

[0310] Otherwise, it may be checked whether bcwIdxCorner1 and bcwIdxCorner2 are the same. If they are the same, bcwIdxConst may be set to bcwIdxCorner2.

[0311] Otherwise, bcwIdxConst can be set to the default index.

[0312] As described with reference to Tables 3 and 4, by omitting unnecessary comparisons, the method of deriving weight indices for constructing affine merge candidates can be simplified.

[0313] According to another example of this embodiment, the weight index (bcwIdxConst) for constructing the affine merge candidate can be derived through the following Table 5.

[0314] [Table 5]

[0315]

[0316] That is, when bcwIdxCorner0 and bcwIdxCorner1 are the same, bcwIdxConst may be set to bcwIdxCorner0, otherwise, it may be set to a default index. According to the derivation method of Table 5 above, bcwIdxConst may be derived through one comparison. According to another example of this embodiment, bcwIdxConst may be set to bcwIdxCorner0 without performing a comparison.

[0317] Below, we will refer to Figure 22 to Figure 25 A method for deriving and constructing affine merge candidates is described in detail.

[0318] Fig. 22 is a view illustrating a method of inferring and constructing an affine merge candidate according to another embodiment of the present disclosure. Fig. 22 The derivation method includes a method for deriving weight indices for constructing affine merge candidates.

[0319] like Fig. 22 As shown, first, information about each CP of the current block can be derived (S2210). The various CPs of the current block may include the above-mentioned CP0, CP1, CP2, and CP3 (RB). Information about CPn (n is an integer from 0 to 3) may include at least one of a reference picture index (refIdxLXCorner[n]), prediction direction information (predFlagLXCorner[n]), a motion vector (cpMvLXCorner[n]), whether CPn is available (availableFlagCorner[n]), or a weight index of CPn (bcwIdxCorner[n]).

[0320] According to the present embodiment, the weight index for constructing an affine merge candidate can be derived as the weight index of the first CP in each combination. As described above, the combination used to derive the construction of an affine merge candidate can be one of {CP0, CP1, CP2}, {CP0, CP1, CP3}, {CP0, CP2, CP3}, {CP1, CP2, CP3}, {CP0, CP1} and {CP0, CP2}. As described above, the first CP in each combination is CP0 or CP1. Therefore, the weight index of CPn among the information about CPn can be derived only for CP0 and CP1. That is, the process of deriving the weight index of CPn can be skipped for CP2 and CP3. This is because, even if the weight indexes of CP2 or CP3 are derived, these weight indexes are not used as weight indexes for constructing affine merge candidates.

[0321] When information about each CP is derived in step S2210, an affine merge candidate can be derived based on the information (S2220). Step S2220 can be performed for each combination used to derive the affine merge candidate. Step S2220 can be performed based on information specifying whether a 6-parameter model can be used. For example, when a 6-parameter model can be used, step S2220 can be performed for both a combination including three CPs and a combination including two CPs. When the 6-parameter model is not available, step S2220 can be performed only for a combination including two CPs. Since the 6-parameter model refers to three CPs, when the 6-parameter model is not available, there is no need to configure an affine merge candidate for a combination including three CPs. Information specifying whether a 6-parameter model can be used can be signaled through a bitstream. For example, it can be signaled in a higher-level sequence parameter set as a block.

[0322] Fig.23 is a view exemplarily illustrating a method of deriving information on each CP of a current block.

[0323] Fig.23 The method can be performed on each CP of the current block. For example, the execution order can be CP0, CP1, CP2 and CP3. However, the present disclosure is not limited thereto, and the method can be performed in a different order or can be performed on some or all CPs simultaneously.

[0324] First, candidate blocks corresponding to the CP may be identified (S2310). Fig.17 The candidate blocks of each CP are described. For example, the candidate blocks of CP0 can be B2, B3 and A2, the candidate blocks of CP1 can be B1 and B0, the candidate blocks of CP2 can be A1 and A0, and the candidate blocks of CP3 can be T. When performing Fig.23 When the method is used, the candidate blocks can be checked in the above order (scanning order). Therefore, when there are multiple candidate blocks, the first block can be identified first. For example, B2 as the first candidate block of CP0 can be identified first.

[0325] When the candidate block of the corresponding CP is identified, it may be checked whether the identified candidate block is available (S2320). Whether the candidate block is available may be determined based on whether the candidate block exists in the current picture, whether the candidate block and the current block exist in the same slice or the same patch, or whether the prediction mode of the candidate block and the prediction mode of the current block are the same. For example, when the candidate block exists outside the current picture, when the candidate block and the current block exist in different slices or different patches, or when the prediction mode of the candidate block and the prediction mode of the current block are different, it may be determined that the corresponding candidate block is unavailable.

[0326] When the identified candidate block is not available (S2320: No), it may be determined whether there is a next candidate block (S2330). When there is a next candidate block (S2330: Yes), steps S2310 to S2320 may be performed on the next candidate block. When there is no next candidate block (S2330: No), whether the corresponding CP is available (availableFlagCorner) may be set to "unavailable" (S2350).

[0327] When the identified candidate block is available (S2320: Yes), information about the corresponding CP can be derived based on the information about the available candidate block. For example, the reference picture index, prediction direction information, motion vector, and weight index of the available candidate block can be used as information about the corresponding CP. In this case, as described above, the weight index of the available candidate block can be used as the weight index of the corresponding CP only when the corresponding CP is CP0 or CP1. In addition, when the identified candidate block is available, whether the corresponding CP is available (availableFlagCorner) can be set to "available" (S2350).

[0328] Fig.24is a view exemplarily illustrating a method of deriving and constructing affine merging candidates based on information derived for each CP.

[0329] The above method can be performed on each combination of {CP0, CP1, CP2}, {CP0, CP1, CP3}, {CP0, CP2, CP3}, {CP1, CP2, CP3}, {CP0, CP1} and {CP0, CP2} used to derive and construct affine merge candidates. Fig.24 The execution order may be the order listed above. In addition, as described above, it is possible to execute only some combinations depending on whether the 6-parameter model is available. Fig.24 method.

[0330] First, a combination for deriving and constructing an affine merge candidate is input (identified) (S2410), and it can be checked whether the CP in the combination is available (S2420). Step S2420 can be performed based on information (availableFlagCorner) specifying whether the corresponding CP is available. For example, when the input combination is {CP0, CP1, CP2}, step S2420 can be performed based on availableFlagCorner[0], availableFlagCorner[1], and availableFlagCorner[2]. Even when one CP in the combination is unavailable (S2420: No), since it is impossible to derive and construct an affine merge candidate for the corresponding combination, Fig.24 When all CPs in the combination are available (S2420: Yes), steps S2430 to S2450 may be performed for each prediction direction (L0 direction and L1 direction).

[0331] In step S2430, the availability of each prediction direction (availableFlagL0 and availableFlagL1) may be derived. For example, when the input combination is {CP0, CP1, CP2}, for the prediction direction LX (X is 0 or 1), if all prediction direction information (predFlagLXCorner[n]) of CP0, CP1, and CP2 are 1 and the reference picture indexes (refIdxLXCorner[n]) of CP0, CP1, and CP2 are the same, then whether the prediction direction LX is available may be derived as "available", otherwise, it may be derived as "unavailable".

[0332] In step S2440, it may be determined whether the prediction direction LX is available, and in the case of "available" (S2440: Yes), the method may proceed to step S2450. In step S2450, an affine merge candidate may be constructed based on information about the CP of the prediction direction LX. For example, when the input combination is {CP0, CP1, CP2}, for the available prediction direction LX (X is 0 or 1), the reference picture index (refIdxLXCorner[0]) of CP0, the motion vector (cpMvLXCorner[0]) of CP0, the motion vector (cpMvLXCorner[1]) of CP1, and the motion vector (cpMvLXCorner[2]) of CP2 may be respectively assigned to the reference picture index (refIdxLXConst1), CPMV1, CPMV2, and CPMV3 of the corresponding constructed affine merge candidate. When the prediction direction LX is "unavailable" (S2440: No), step S2450 may be skipped.

[0333] Thereafter, in step S2460, a weight index for constructing an affine merge candidate may be derived. Step S2460 may be performed based on whether the prediction direction LX is available. For example, when both L0 and L1 are available, the weight index for constructing an affine merge candidate may be derived as the weight index of the first CP in the combination. For example, when the input combination is {CP0, CP1, CP2}, the weight index of CP0 may be used as the weight index for constructing an affine merge candidate. If L0 or L1 is not available, the weight index for constructing an affine merge candidate may be derived as a predetermined index. The predetermined index may be a default index, and may be, for example, an index of a specified equal weight.

[0334] Thereafter, in step S2470, whether the corresponding combination is available and / or the motion model may be derived. Step S2470 may be performed based on whether the prediction direction LX is available and / or the number of CPs in the combination. For example, when L0 or L1 is available, whether the corresponding combination is available may be derived as "available". In this case, when the number of CPs in the corresponding CP is 3, the motion model of the corresponding combination may be derived as a 6-parameter affine model. When the number of CPs in the combination is 2, the motion model of the corresponding combination may be derived as a 4-parameter affine model.

[0335] Otherwise (when both L0 and L1 are unavailable), whether the corresponding combination is available may be derived as “unavailable.” In addition, the motion model of the corresponding combination may be derived as a traditional translation motion model.

[0336] Fig.25 is a view exemplarily illustrating a method of deriving a weight index for constructing an affine merge candidate.

[0337] As described above, a weight index for constructing an affine merging candidate may be derived based on whether the prediction direction LX is available. To this end, information specifying the availability of the prediction direction derived in step S2430 may be input (S2510).

[0338] Thereafter, in step S2520, it may be determined whether both L0 and L1 are available. When both L0 and L1 are available (S2520: Yes), the weight index for constructing the affine merge candidate may be derived as the weight index of the first CP in the combination (S2530). For example, when the input combination is {CP0, CP1, CP2}, the weight index of CP0 may be used as the weight index for constructing the affine merge candidate. For example, when the input combination is {CP1, CP2, CP3}, the weight index of CP1 may be used as the weight index for constructing the affine merge candidate.

[0339] When L0 or L1 is not available (S2520: No), the weight index for constructing the affine merge candidate may be derived as a predetermined index as described above (S2540). The predetermined index may be a default index and may be, for example, an index that specifies equal weights.

[0340] According to reference Figure 22 to Figure 25 The described implementation mode can derive and construct affine merge candidates, and more specifically, can efficiently derive the weight index for constructing the affine merge mode based on whether the CP is available and whether each prediction direction of each CP is available, thereby increasing the coding efficiency without significantly increasing the computational complexity.

[0341] According to reference Figure 22 to Figure 25 In the described embodiment, based on whether both L0 and L1 are available, the weight index or default index of the first CP in the combination is set as the weight index for constructing the affine merge candidate. According to another example of the present embodiment, regardless of whether L0 and L1 are available, the weight index of the first CP in the combination can be set as the weight index for constructing the affine merge candidate. Therefore, since the process of determining whether L0 and L1 are available can be skipped, the effect of reducing computational complexity and allowing fast processing can be expected.

[0342] According to another embodiment of the present disclosure, when the motion vector candidates of the merge mode are configured in units of sub-blocks, a method for deriving a weight index when the representative prediction vector candidate uses dual prediction may be provided. Fig. 20 As described, the sub-block based TMVP can derive the col block corresponding to the current block based on motion shift. Fig. 20As shown, the motion shift can be derived from the left block A1 that is spatially adjacent to the current block. That is, the probability that the weight index of the left block is reliable is high. Therefore, taking this into account, the weight index of the left block can be used as the weight index of the current block. That is, when the candidate derived by ATMVP uses dual prediction, the weight index of the left block can be used as the weight index of the merge mode of the sub-block. According to this embodiment, when the motion vector candidates for the merge mode are configured in units of sub-blocks, the coding efficiency can be improved without increasing the complexity by efficiently configuring the weights of the representative prediction vector candidates.

[0343] Although for the sake of clarity of description, the exemplary method of the present disclosure described above is represented as a series of operations, it is not intended to limit the order of executing the steps, and these steps can be performed simultaneously or in different orders when necessary. In order to implement the method according to the present invention, the steps described may further include other steps, may include the remaining steps except some steps, or may include other additional steps except some steps.

[0344] In the present disclosure, an image encoding device or an image decoding device that performs a predetermined operation (step) may perform an operation (step) of confirming an execution condition or situation of the corresponding operation (step). For example, if it is described that a predetermined operation is performed when a predetermined condition is met, the image encoding device or the image decoding device may perform the predetermined operation after determining whether the predetermined condition is met.

[0345] The various embodiments of the present disclosure are not a list of all possible combinations and are intended to describe representative aspects of the present disclosure, and matters described in the various embodiments may be applied independently or in combination of two or more.

[0346] Various embodiments of the present disclosure may be implemented in hardware, firmware, software or a combination thereof. In the case of implementing the present disclosure in hardware, the present disclosure may be implemented in an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a general purpose processor, a controller, a microcontroller, a microprocessor, etc.

[0347] In addition, the image decoding device and the image encoding device to which the embodiments of the present disclosure are applied may be included in a multimedia broadcast transmission and reception device, a mobile communication terminal, a home theater video device, a digital theater video device, a surveillance camera, a video chat device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camera, a video on demand (VoD) service provider, an OTT video (over the top video) device, an Internet streaming service provider, a three-dimensional (3D) video device, a video phone video device, a medical video device, etc., and may be used to process a video signal or a data signal. For example, an OTT video device may include a game console, a Blu-ray player, an Internet access TV, a home theater system, a smart phone, a tablet PC, a digital video recorder (DVR), etc.

[0348] Fig.26 is a diagram showing a content streaming system to which an embodiment of the present disclosure can be applied.

[0349] like Fig.26 As shown in , a content streaming system to which the embodiments of the present disclosure are applied may mainly include an encoding server, a streaming server, a network server, a media storage device, a user device, and a multimedia input device.

[0350] The encoding server compresses the content input from a multimedia input device such as a smart phone, camera, or camcorder into digital data to generate a bitstream and sends the bitstream to the streaming server. As another example, when a multimedia input device such as a smart phone, camera, or camcorder directly generates a bitstream, the encoding server can be omitted.

[0351] The bitstream may be generated by the image encoding method or the image encoding device to which the embodiments of the present disclosure are applied, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0352] The streaming server sends multimedia data to the user device based on the user's request through the network server, and the network server is used as a medium to inform the user of the service. When the user requests the required service from the network server, the network server can deliver it to the streaming server, and the streaming server can send the multimedia data to the user. In this case, the content streaming system may include a separate control server. In this case, the control server is used to control the command / response between the devices in the content streaming system.

[0353] The streaming server may receive content from a media storage device and / or an encoding server. For example, when receiving content from an encoding server, the content may be received in real time. In this case, in order to provide a smooth streaming service, the streaming server may store the bitstream within a predetermined time.

[0354] Examples of user devices may include mobile phones, smart phones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation devices, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smart watches, smart glasses, head-mounted displays), digital televisions, desktop computers, digital signage, etc.

[0355] Each server in the content streaming system may operate as a distributed server, in which case data received from each server may be distributed.

[0356] The scope of the present disclosure includes software or machine-executable commands (e.g., operating systems, applications, firmware, programs, etc.) for enabling operations of methods according to various embodiments to be performed on a device or computer, and non-transitory computer-readable media having such software or commands stored thereon and executable on a device or computer.

[0357] Industrial Applicability

[0358] The embodiments of the present disclosure may be used to encode or decode an image.

Claims

1. An image decoding method performed by an image decoding device, the image decoding method comprising the following steps: Reconstructing the inter prediction mode of the current block; Based on the inter prediction mode of the current block being a sub-block merging mode, deriving a sub-block merging candidate based on a neighboring block of the current block, wherein the sub-block merging candidate includes a constructed sub-block merging candidate derived based on a combination of predetermined candidate control points CP; Derivation of motion information of the current block based on motion information of the sub-block merge candidate; generating a prediction block of the current block by performing inter prediction on the current block based on the motion information of the current block; and reconstructing the current block based on the prediction block, Wherein, based on whether the candidate CP is the upper left candidate CP or the upper right candidate CP of the current block, the motion information of the candidate CP includes a weight index of dual prediction, and Wherein, based on the fact that the candidate CP is a lower left candidate CP or a lower right candidate CP of the current block, the motion information of the candidate CP does not include the weight index.

2. The image decoding method according to claim 1, wherein: The motion information of each candidate CP in the combination is derived based on the motion information of the candidate block for the candidate CP.

3. The image decoding method according to claim 2, wherein: Based on the existence of multiple candidate blocks for the candidate CP, The candidate blocks are examined in a predetermined order, and The motion information of the candidate CP is derived based on the motion information of the first candidate block available in the predetermined order.

4. The image decoding method according to claim 1, in, The plurality of candidate CPs in the combination have a predetermined order, and Wherein, the weight index of the building block merging candidate is derived based on the predetermined order.

5. The image decoding method according to claim 4, wherein: The weight index of the building block merging candidate is derived as the weight index of the first candidate CP in the combination.

6. The image decoding method according to claim 1, in, The plurality of candidate CPs in the combination have a predetermined order, and The weight index of the building block merging candidate is derived based on the predetermined order and information about the combined prediction direction.

7. The image decoding method according to claim 6, wherein: The information about the prediction direction of the combination includes whether prediction direction L0 is available and whether prediction direction L1 is available.

8. The image decoding method according to claim 7, wherein: Based on the fact that both the prediction direction L0 and the prediction direction L1 of the combination are available, the weight index of the building subblock merging candidate is derived as the weight index of the first candidate CP in the combination.

9. The image decoding method according to claim 8, wherein: Based on the fact that the prediction direction L0 or the prediction direction L1 of the combination is unavailable, the weight index of the building subblock merging candidate is derived as a predetermined weight index.

10. The image decoding method according to claim 9, wherein: The predetermined weight is an index that specifies that a weight applied to the prediction direction L0 and a weight applied to the prediction direction L1 are equal.

11. An image encoding method performed by an image encoding device, the image encoding method comprising the following steps: generating a prediction block of the current block by performing inter-frame prediction on the current block based on motion information of the current block; encoding the current block based on the prediction block; as well as encoding the motion information of the current block, The step of encoding the motion information of the current block includes: Determining an inter-frame prediction mode of the current block; Based on the inter prediction mode of the current block being a subblock merging mode, deriving subblock merging candidates based on neighboring blocks of the current block, wherein the subblock merging candidates include constructed subblock merging candidates derived based on a combination of predetermined candidate control points CP; and encoding the motion information of the current block based on the motion information of the sub-block merging candidate, Wherein, based on whether the candidate CP is the upper left candidate CP or the upper right candidate CP of the current block, the motion information of the candidate CP includes a weight index of dual prediction, and Wherein, based on the fact that the candidate CP is a lower left candidate CP or a lower right candidate CP of the current block, the motion information of the candidate CP does not include the weight index.

12. A method for transmitting a bit stream generated by an image encoding method, the image encoding method comprising the following steps: generating a prediction block of the current block by performing inter-frame prediction on the current block based on motion information of the current block; encoding the current block based on the prediction block; as well as encoding the motion information of the current block, The step of encoding the motion information of the current block includes: Determining an inter-frame prediction mode of the current block; Based on the inter prediction mode of the current block being a subblock merging mode, deriving subblock merging candidates based on neighboring blocks of the current block, wherein the subblock merging candidates include constructed subblock merging candidates derived based on a combination of predetermined candidate control points CP; and encoding the motion information of the current block based on the motion information of the sub-block merging candidate, Wherein, based on whether the candidate CP is the upper left candidate CP or the upper right candidate CP of the current block, the motion information of the candidate CP includes a weight index of dual prediction, and Wherein, based on the fact that the candidate CP is a lower left candidate CP or a lower right candidate CP of the current block, the motion information of the candidate CP does not include the weight index.