Image decoding method and device based on affine motion prediction using constructed affine MVP candidate in image coding system

The video decoding method constructs affine MVP candidates only when all candidate motion vectors are available, addressing inefficiencies in high-resolution video compression by reducing complexity and enhancing coding efficiency.

JP2025094114AActive Publication Date: 2025-06-24LG ELECTRONICS INC
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2025044610
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2018-08-06
Filing Date
2025-03-19
Publication Date
2025-06-24
Estimated Expiration
2039-08-06

AI Technical Summary

Technical Problem

The increasing demand for high-resolution and high-quality videos has led to a surge in video data volume, resulting in higher transfer and storage costs due to inefficient video compression technologies.

Method used

A video decoding method and apparatus that constructs an affine Motion Vector Predictor (MVP) candidate list based on neighboring blocks, deriving Control Point Motion Vector Predictors (CPMVPs) and Differences (CPMVDs) for improved image coding efficiency, only when all candidate motion vectors are available.

Benefits of technology

This approach enhances image coding efficiency by reducing the complexity of deriving affine MVP candidates and improving compression performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025094114000001_ABST
    Figure 2025094114000001_ABST
Patent Text Reader

Abstract

To increase image coding efficiency based on overall image / video compression efficiency and affine motion prediction.SOLUTION: An image decoding method performed by a decoding device comprises the steps of: obtaining motion prediction information relating to a current block from a bitstream; generating an affine motion vector predictor (MVP) candidate list for the current block; deriving CPMVPs for control points (CPs) of the current block on the basis of the affine MVP candidate list; deriving CP motion vector differences (MVDs) for the CPs of the current block on the basis of the motion prediction information; deriving CPMVs for the CPs of the current block on the basis of the CPMVPs and the CPMVDs; deriving prediction samples for the current block on the basis of the CP motion vectors (MVs): and generating a reconstructed picture for the current block on the basis of the derived prediction samples.SELECTED DRAWING: Figure 22
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to video coding technology, and more particularly, to a video decoding method and apparatus based on affine motion prediction in a video coding system.

Background Art

[0002] Recently, the demand for high-resolution and high-quality videos such as HD (High Definition) videos and UHD (Ultra High Definition) videos has been increasing in various fields. As the video data becomes higher in resolution and quality, the amount of information or bits transferred relatively increases compared to conventional video data. Therefore, when transferring video data using a medium such as a conventional wired or wireless broadband line or storing video data using a conventional storage medium, the transfer cost and storage cost increase.

[0003] Therefore, in order to effectively transfer, store, and reproduce high-resolution and high-quality video information, a highly efficient video compression technology is required.

Summary of the Invention

Problems to be Solved by the Invention

[0004] The technical problem of this document is to provide a method and apparatus for improving image coding efficiency.

[0005] Another technical problem of this document is to provide an image decoding method and apparatus that derive a constructed affine MVP candidate based on neighboring blocks and construct an affine MVP candidate list for the current block only when all candidate motion vectors for the CP are available, and perform prediction for the current block based on the constructed affine MVP candidate list.

Means for Solving the Problems

[0006] According to one embodiment of the present document, an image decoding method performed by a decoding device is provided. The method includes steps of: obtaining motion prediction information for a current block from a bitstream; constructing an affine Motion Vector Predictor (MVP) candidate list for the current block; deriving Control Point Motion Vector Predictors (CPMVPs) for Control Points (CPs) of the current block based on the affine MVP candidate list; deriving Control Point Motion Vector Differences (CPMVDs) for the CPs of the current block based on the motion prediction information; deriving Control Point Motion Vectors (CPMVs) for the CPs of the current block based on the CPMVPs and the CPMVDs; deriving predicted samples for the current block based on the CPMVs; and generating a reconstructed picture for the current block based on the derived predicted samples. However, when a constructed affine MVP candidate is available, the affine MVP candidate list includes the constructed affine MVP candidate, the constructed affine MVP candidate includes candidate motion vectors for the CPs, and the constructed affine MVP candidate is available when the candidate motion vectors are available.

[0007] According to another embodiment of the present document, a decoding apparatus for performing image decoding is provided. The decoding apparatus includes an entropy decoding unit that acquires motion prediction information for a current block from a bit stream, constructs an affine Motion Vector Predictor (MVP) candidate list for the current block, derives Control Point Motion Vector Predictors (CPMVPs) for a Control Point (CP) of the current block based on the affine MVP candidate list, derives Control Point Motion Vector Differences (CPMVDs) for the CP of the current block based on the motion prediction information, derives Control Point Motion Vectors (CPMVs) for the CP of the current block based on the CPMVPs and the CPMVDs, a prediction unit that derives a predicted sample for the current block based on the CPMVs, and an addition unit that generates a restored picture for the current block based on the derived predicted sample. However, when a constructed affine MVP candidate is available, the affine MVP candidate list includes the constructed affine MVP candidate, the constructed affine MVP candidate includes candidate motion vectors for the CP, and the constructed affine MVP candidate is available when the candidate motion vectors are available.

[0008] According to another embodiment of the present document, a video encoding method performed by an encoding device is provided. The method includes steps of constructing an affine Motion Vector Predictor (MVP) candidate list for a current block, deriving Control Point Motion Vector Predictors (CPMVPs) for a Control Point (CP) of the current block based on the affine MVP candidate list, deriving a CPMV for the CP of the current block, deriving Control Point Motion Vector Differences (CPMVDs) for the CP of the current block based on the CPMVPs and the CPMV, and encoding motion prediction information including information regarding the CPMVDs. However, when a constructed affine MVP candidate is available, the affine MVP candidate list includes the constructed affine MVP candidate, the constructed affine MVP candidate includes candidate motion vectors for the CP, and the constructed affine MVP candidate is available when the candidate motion vectors are available.

[0009] According to another embodiment of the present document, a video encoding apparatus is provided. The encoding apparatus constructs an affine Motion Vector Predictor (MVP) candidate list for a current block, derives Control Point Motion Vector Predictors (CPMVPs) for a Control Point (CP) of the current block based on the affine MVP candidate list, derives a CPMV for the CP of the block, and a prediction unit that derives Control Point Motion Vector Differences (CPMVDs) for the CP of the current block based on the CPMVPs and the CPMV, a subtraction unit that derives CPMVDs for the CP of the current block based on the CPMVPs and the CPMV, and an entropy encoding unit that encodes motion prediction information including information about the CPMVDs. However, when a constructed affine MVP candidate is available, the affine MVP candidate list includes the constructed affine MVP candidate, the constructed affine MVP candidate includes candidate motion vectors for the CP, and the constructed affine MVP candidate is available when the candidate motion vectors are available.

Advantages of the Invention

[0010] According to the present document, the compression efficiency of general images / videos can be improved.

[0011] According to the present document, the efficiency of image coding based on affine motion prediction can be improved.

[0012] According to this document, when deriving the affine MVP candidate list, the constructed affine MVP candidates can be added only when all candidate motion vectors for the CP of the constructed affine MVP candidates are available, thereby reducing the complexity of the process of deriving the constructed affine MVP candidates and the process of constructing the affine MVP candidate list, and improving the coding efficiency.

Brief Description of Drawings

[0013]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

Figure 16

Figure 17

Figure 18

Figure 19

Figure 20

Figure 21

Figure 22

Figure 23

Figure 24

Embodiments for Carrying Out the Invention

[0014] Since this document can be modified in various ways and can have various embodiments, specific embodiments will be illustrated in the drawings and described in detail. However, this is not intended to limit this document to specific embodiments. The terms commonly used in this specification are used only for the purpose of explaining specific embodiments and are not intended to limit the technical idea of this document. Singular expressions include plural expressions unless the context clearly indicates otherwise. Terms such as "including" or "having" in this specification are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and should not be understood as precluding the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0015] On the other hand, each configuration on the drawings described in this document is shown independently for the convenience of explaining different characteristic functions, and does not mean that each configuration is implemented by different hardware or different software. For example, among each configuration, two or more configurations can be combined to form one configuration, and one configuration can be divided into multiple configurations. Embodiments in which each configuration is integrated and / or separated are included in the scope of rights of this document as long as they do not deviate from the essence of this document.

[0016] Hereinafter, with reference to the accompanying drawings, preferred embodiments of this document will be described in more detail. Hereinafter, for the same components on the drawings, the same reference numerals will be used and overlapping descriptions of the same components will be omitted.

[0017] In this specification, "video" may mean a set of images following the flow of time. A "picture" is generally a unit indicating one image in a specific time period, and a "slice" is a unit constituting a part of a picture in coding. One picture may be composed of a plurality of slices or tile groups, and if necessary, pictures, slices, and tile groups may be used in combination with each other. In this document, an "image" may be a still image or may indicate an image at a certain time constituting a video. Hereinafter, image coding may sometimes be used in combination with video coding. Also, image coding may sometimes be used in combination with picture coding or frame coding.

[0018] A "pixel" or "pel" may mean the smallest unit constituting one picture (or image). Also, as a term corresponding to a pixel, "sample" is used. A sample can generally indicate a pixel or a pixel value, and can also indicate only the pixel / pixel value of the luma component or only the pixel / pixel value of the chroma component.

[0019] A "unit" indicates a basic unit of image processing. A unit includes at least one of a specific region of a picture and information regarding the region. A unit may, in some cases, be used in combination with terms such as "block" or "area". Or, a unit may include a luma component block and chroma component (cb, cr) blocks. In a general case, an M×N block indicates a set of samples or transform coefficients consisting of M columns and N rows.

[0020] FIG. 1 is a diagram schematically explaining the configuration of a video / image encoding apparatus to which this document is applicable. Hereinafter, a video encoding apparatus may include an image encoding apparatus.

[0021] As shown in FIG. 1, the video encoding device 100 includes a picture partitioning module 105, a prediction module 110, a residual processing module 120, an entropy encoding module 130, an adder 140, a filtering module 150, and a memory 160. The residual processing module 120 includes a substractor 121, a transform module 122, a quantization module 123, a rearrangement module 124, a dequantization module 125, and an inverse transform module 124.

[0022] The picture partitioning module 105 can divide the input picture into at least one processing unit.

[0023] As an example, the processing unit may be referred to as a coding unit (CU). In this case, the coding unit is recursively divided from the largest coding unit (LCU) according to the Quad-tree binary-tree (QTBT) structure. For example, one coding unit is divided into multiple coding units with a deeper depth based on a quad-tree structure, a binary-tree structure, and / or a ternary tree structure. In this case, for example, the quad-tree structure may be applied first, and the binary-tree structure and the ternary tree structure may be applied later. Or, the binary-tree structure / ternary tree structure may be applied first. A coding procedure according to this document can be performed based on the final coding unit that is no longer divided. In this case, based on the coding efficiency according to the image characteristics, etc., the largest coding unit may be immediately used as the final coding unit, or, if necessary, the coding unit may be recursively divided into coding units with a deeper depth, and the coding unit with the optimal size may be used as the final coding unit. Here, the coding procedure includes procedures such as prediction, conversion, and restoration, which will be described later.

[0024] As another example, the processing unit may include a coding unit (Cu), a prediction unit (PU), or a transform unit (TU). The coding unit is split from the largest coding unit (LCU) into coding units with a deeper depth according to a quad-tree structure. In this case, based on coding efficiency according to image characteristics, etc., the largest coding unit may be immediately used as the final coding unit, or, if necessary, the coding unit may be recursively split into coding units with a deeper depth so that the coding unit of the optimal size is used as the final coding unit. When the smallest coding unit (SCU) is set, the coding unit cannot be split into coding units smaller than the smallest coding unit. Here, the final coding unit means the coding unit that serves as the basis for partitioning or splitting into a prediction unit or a transform unit. The prediction unit is a unit partitioned from the coding unit and may be a unit for sample prediction. Here, the prediction unit can also be divided into sub-blocks. The transform unit is split from the coding unit according to a quad-tree structure and may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients. Hereinafter, the coding unit may be referred to as a coding block (CB), the prediction unit may be referred to as a prediction block (PB), and the transform unit may be referred to as a transform block (TB). The prediction block or the prediction unit means a specific area in block form within a picture and may include an array of prediction samples.In addition, a transform block or a transform unit means a specific area in block form within a picture, and may include an array of transform coefficients or residual samples.

[0025] The prediction unit 110 performs a prediction on a block to be processed (hereinafter referred to as the current block), and generates a predicted block including prediction samples for the current block. The unit of prediction performed by the prediction unit 110 can be a coding block, a transform block, or a prediction block.

[0026] The prediction unit 110 determines whether intra prediction or inter prediction is applied to the current block. As an example, the prediction unit 110 can determine whether intra prediction or inter prediction is applied in CU units.

[0027] In the case of intra prediction, the prediction unit 110 can derive prediction samples for the current block based on reference samples outside the current block within the picture to which the current block belongs (hereinafter referred to as the current picture). Here, the prediction unit 110 can (i) derive prediction samples based on the average or interpolation of neighboring reference samples of the current block, and (ii) also derive the prediction samples based on reference samples existing in a specific (prediction) direction with respect to the prediction samples among the neighboring reference samples of the current block. The case of (i) can be called a non-directional mode or a non-angle mode, and the case of (ii) can be called a directional mode or an angular mode. In intra prediction, the prediction mode can have, for example, 33 directional prediction modes and at least two or more non-directional modes. The non-directional modes may include a DC prediction mode and a Planar mode. The prediction unit 110 can also determine the prediction mode applied to the current block using the prediction mode applied to the neighboring blocks.

[0028] In the case of inter prediction, the prediction unit 110 can derive a prediction sample for the current block based on samples specified by motion vectors on the reference picture. The prediction unit 110 can apply any one of a skip mode, a merge mode, and an MVP (Motion Vector Prediction) mode to derive a prediction sample for the current block. In the case of the skip mode and the merge mode, the prediction unit 110 can use the motion information of the surrounding blocks as the motion information of the current block. In the case of the skip mode, unlike the merge mode, the difference (residual) between the prediction sample and the original sample is not transmitted. In the case of the MVP mode, the motion vector of the surrounding block can be used as a motion vector predictor to derive the motion vector of the current block.

[0029] In the case of inter prediction, the surrounding blocks include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. The reference picture including the temporal neighboring blocks may be called a collocated picture (colPic). The motion information includes a motion vector and a reference picture index. Information such as prediction mode information and motion information can be (entropy) encoded and output in the form of a bit stream.

[0030] When motion information of temporal neighboring blocks is used in skip mode and merge mode, the top picture on the reference picture list can also be used as a reference picture. The reference pictures included in the reference picture list can be sorted based on the difference in POC (Picture Order Count) between the current picture and the reference picture. POC corresponds to the display order of pictures and is distinguished from the coding order.

[0031] The subtraction unit 121 generates a residual sample, which is the difference between the original sample and the predicted sample. When the skip mode is applied, the residual sample may not be generated as described above.

[0032] The conversion unit 122 converts the residual samples in units of conversion blocks to generate transform coefficients. The conversion unit 122 can perform conversion according to the size of the conversion block and the prediction mode applied to the coding block or prediction block that spatially overlaps with the conversion block. For example, if intra prediction is applied to the coding block or the prediction block that overlaps with the conversion block, and the conversion block is a 4×4 residual array, the residual samples are converted using a DST (Discrete Sine Transform) conversion kernel, and in other cases, the residual samples can be converted using a DCT (Discrete Cosine Transform) conversion kernel.

[0033] The quantization unit 123 can quantize the transform coefficients to generate quantized transform coefficients.

[0034] The reordering unit 124 reorders the quantized transform coefficients. The reordering unit 124 can reorder the quantized transform coefficients in block form into a one-dimensional vector form by a coefficient scanning method. Here, although the reordering unit 124 is described as a separate configuration, the reordering unit 124 may be part of the quantization unit 123.

[0035] The entropy encoding unit 130 can perform entropy encoding on the quantized transform coefficients. Entropy encoding includes encoding methods such as exponential Golomb, CAVLC (context-adaptive variable length coding), and CABAC (context-adaptive binary arithmetic coding). The entropy encoding unit 130 can also entropy encode, either together or separately, information necessary for video restoration (such as the values of syntax elements) along with the quantized transform coefficients or encode them by a preset method. The encoded information is transmitted or stored in the form of a bitstream in units of NAL (network abstraction layer) units. The bitstream may be transmitted via a network or stored in a digital storage medium. Here, the network may include a broadcast network and / or a communication network, etc., and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc.

[0036] The inverse quantization unit 125 inverse quantizes the value (quantized transform coefficient) quantized by the quantization unit 123, and the inverse transform unit 126 inverse transforms the value inverse quantized by the inverse quantization unit 125 to generate a residual sample.

[0037] The adder 140 combines the residual samples and the predicted samples to restore the picture. The residual samples and the predicted samples can be added in block units to generate a restored block. Here, although the adder 140 has been described as a separate configuration, the adder 140 may be a part of the predictor 110. On the other hand, the adder 140 may be called a reconstruction module or a restored block generation unit.

[0038] For the reconstructed picture, the filter unit 150 can apply a deblocking filter and / or a sample adaptive offset. By the deblocking filtering and / or the sample adaptive offset, artifacts at the block boundaries in the restored picture and distortions in the quantization process can be corrected. The sample adaptive offset may be applied in sample units or may be applied after the deblocking filtering process is completed. The filter unit 150 can also apply an ALF (Adaptive Loop Filter) to the reconstructed picture. The ALF can be applied to the reconstructed picture after the deblocking filter and / or the sample adaptive offset have been applied.

[0039] The memory 160 can store the restored picture (decoded picture) or information necessary for encoding / decoding. Here, the restored picture can be the restored picture for which the filtering procedure has been completed by the filter unit 150. The stored restored picture can be utilized as a reference picture for (inter) prediction of other pictures. For example, the memory 160 can store the (reference) picture used for inter prediction. Here, the picture used for inter prediction can be specified by a reference picture set or a reference picture list.

[0040] FIG. 2 is a diagram outlining the configuration of a video / image decoding apparatus to which this document is applicable. Hereinafter, the video decoding apparatus may include an image decoding apparatus.

[0041] As shown in FIG. 2, the video decoding apparatus 200 includes an entropy decoding module 210, a residual processing module 220, a prediction module 230, an adder 240, a filtering module 250, and a memory 260. Here, the residual processing module 220 includes a rearrangement module 221, a dequantization module 222, and an inverse transform module 223. Although not shown, the video decoding apparatus 200 includes a receiving unit that receives a bitstream including video information. The receiving unit may be configured as a separate module or may be included in the entropy decoding module 210.

[0042] When a bitstream including video / image information is input, the video decoding apparatus 200 can restore the video / image / picture corresponding to the process in which the video / image information was processed in the video encoding apparatus.

[0043] For example, the video decoding apparatus 200 can perform video decoding using the processing units applied in the video encoding apparatus. Therefore, the processing unit block for video decoding can be, for example, a coding unit, and in other examples, a coding unit, a prediction unit, or a transform unit. The coding unit can be divided according to a quad tree structure, a binary tree structure, and / or a ternary tree structure from the maximum coding unit.

[0044] The prediction unit and the conversion unit may be further used in some cases. In this case, the prediction block is a block derived from or partitioned from the coding unit and can be a unit of sample prediction. Here, the prediction unit may be divided into sub-blocks. The conversion unit can be divided from the coding unit according to the quad-tree structure and can be a unit that derives conversion coefficients or a unit that derives a residual signal from the conversion coefficients.

[0045] The entropy decoding unit 210 can parse the bitstream and output information necessary for video restoration or picture restoration. For example, the entropy decoding unit 210 can decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the value of the syntax element necessary for video restoration and the quantized value of the conversion coefficient regarding the residual.

[0046] More specifically, the CABAC entropy decoding method receives the bin corresponding to each syntax element in the bitstream, determines the context model using the syntax element information to be decoded, the surrounding and decoded information of the block to be decoded, or the information of the symbol / bin decoded in the previous stage, predicts the occurrence probability of the bin according to the determined context model, and performs arithmetic decoding of the bin to generate a symbol corresponding to the value of each syntax element. Here, after determining the context model, the CABAC entropy decoding method can update the context model using the information of the symbol / bin decoded for the context model of the next symbol / bin.

[0047] Among the information decoded by the entropy decoding unit 210, the information related to prediction is provided to the prediction unit 230, and the residual value obtained by performing entropy decoding in the entropy decoding unit 210, that is, the quantized transform coefficient, is input to the rearrangement unit 221.

[0048] The rearrangement unit 221 rearranges the quantized transform coefficients into a two-dimensional block form. The rearrangement unit 221 performs rearrangement corresponding to the coefficient scanning performed in the encoding device. Here, although the rearrangement unit 221 has been described as a separate configuration, the rearrangement unit 221 may be a part of the inverse quantization unit 222.

[0049] The inverse quantization unit 222 inverse-quantizes the quantized transform coefficients based on the (inverse) quantization parameters and outputs the transform coefficients. Here, the information for deriving the quantization parameters is signaled from the encoding device.

[0050] The inverse transform unit 223 inverse-transforms the transform coefficients to derive residual samples.

[0051] The prediction unit 230 performs prediction on the current block and generates a predicted block including predicted samples for the current block. The unit of prediction performed in the prediction unit 230 can be a coding block, a transform block, or a prediction block.

[0052] The prediction unit 230 determines whether to apply intra prediction or inter prediction based on the information related to the prediction. Here, the unit for determining whether to apply either intra prediction or inter prediction may be different from the unit for generating prediction samples. Additionally, in both inter prediction and intra prediction, the unit for generating prediction samples may also be different. For example, whether to apply either inter prediction or intra prediction can be determined in CU units. Also, for example, in inter prediction, the prediction mode can be determined in PU units and prediction samples can be generated, and in intra prediction, the prediction mode can be determined in PU units and prediction samples can be generated in TU units.

[0053] In the case of intra prediction, the prediction unit 230 can derive prediction samples for the current block based on the surrounding reference samples within the current picture. The prediction unit 230 can apply a directional mode or a non - directional mode based on the surrounding reference samples of the current block to derive prediction samples for the current block. Here, the prediction mode to be applied to the current block may be determined using the intra - prediction mode of the surrounding blocks.

[0054] In the case of inter prediction, the prediction unit 230 can derive prediction samples for the current block based on the samples specified on the reference picture by the motion vector on the reference picture. The prediction unit 230 can apply any one of the skip mode, merge mode, and MVP mode to derive prediction samples for the current block. Here, the motion information required for the inter - prediction of the current block provided in the video encoding device, such as information related to the motion vector, reference picture index, etc., can be obtained or derived based on the information related to the prediction.

[0055] In the case of the skip mode and the merge mode, the motion information of the surrounding blocks can be used as the motion information of the current block. At this time, the surrounding blocks include spatial surrounding blocks and temporal surrounding blocks.

[0056] The prediction unit 230 constructs a merge candidate list using the motion information of available neighboring blocks, and uses the information indicated by the merge index on the merge candidate list as the motion vector of the current block. The merge index is signaled from the encoding device. The motion information includes a motion vector and a reference picture. When the motion information of temporal neighboring blocks is used in the skip mode and the merge mode, the top picture on the reference picture list can be used as the reference picture.

[0057] In the case of the skip mode, different from the merge mode, the difference (residual) between the predicted sample and the original sample is not transmitted.

[0058] In the case of the MVP mode, the motion vector of the current block can be derived using the motion vector of a neighboring block as a motion vector predictor. Here, the neighboring blocks include spatial neighboring blocks and temporal neighboring blocks.

[0059] As an example, when the merge mode is applied, a merge candidate list can be generated using the motion vector of the restored spatial neighboring block and / or the motion vector corresponding to the Col block which is a temporal neighboring block. In the merge mode, the motion vector of the candidate block selected from the merge candidate list is used as the motion vector of the current block. The information regarding the prediction includes a merge index indicating the candidate block having the optimal motion vector selected from the candidate blocks included in the merge candidate list. Here, the prediction unit 230 can derive the motion vector of the current block using the merge index.

[0060] As another example, when the MVP (Motion Vector Prediction) mode is applied, a motion vector predictor candidate list can be generated using the motion vectors of the restored spatial neighboring blocks and / or the motion vectors corresponding to the Col blocks which are temporal neighboring blocks. That is, the motion vectors of the restored spatial neighboring blocks and / or the motion vectors corresponding to the Col blocks which are temporal neighboring blocks can be used as motion vector candidates. The information related to the prediction includes a predicted motion vector index indicating the optimal motion vector selected from among the motion vector candidates included in the list. Here, the prediction unit 230 can select the predicted motion vector of the current block from among the motion vector candidates included in the motion vector candidate list using the motion vector index. The prediction unit of the encoding device can obtain the motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor, and can encode this and output it in the form of a bit stream. That is, the MVD is obtained as the value obtained by subtracting the motion vector predictor from the motion vector of the current block. Here, the prediction unit 230 can obtain the motion vector difference included in the information related to the prediction, and can derive the motion vector of the current block by adding the motion vector difference and the motion vector predictor. The prediction unit can also obtain or derive, from the information related to the prediction, a reference picture index indicating a reference picture and the like.

[0061] The addition unit 240 can add the residual samples and the predicted samples to restore the current block or the current picture. The addition unit 240 can also add the residual samples and the predicted samples in block units to restore the current picture. When the skip mode is applied, since the residual is not transmitted, the predicted samples can become the restored samples. Here, the addition unit 240 is described as a separate configuration, but the addition unit 240 may be a part of the prediction unit 230. On the other hand, the addition unit 240 may be called a reconstruction module or a reconstructed block generation unit.

[0062] The filter unit 250 can apply a deblocking filter filtering sample adaptive offset, and / or an ALF, etc. to the restored picture. Here, the sample adaptive offset may be applied in units of samples, or may be applied after deblocking filter filtering. The ALF may be applied after deblocking filter filtering and / or the sample adaptive offset.

[0063] The memory 260 can store a restored picture (decoded picture) or information necessary for decoding. Here, the restored picture can be a restored picture for which the filtering procedure has been completed by the filter unit 250. For example, the memory 260 can store a picture used for inter prediction. Here, the picture used for inter prediction can also be specified by a reference picture set or a reference picture list. The restored picture can be used as a reference picture for other pictures. Also, the memory 260 can output the restored pictures in the output order.

[0064] On the other hand, in the case of inter prediction, an inter prediction method considering video distortion has been proposed. Specifically, an affine motion model has been proposed that efficiently derives a motion vector for a sub-block or a sample point of the current block and improves the accuracy of inter prediction despite deformations such as rotation, zoom-in, or zoom-out of the video. That is, an affine motion model for deriving a motion vector for a sub-block or a sample point of the current block has been proposed. Prediction using the affine motion model can be called affine inter prediction or affine motion prediction.

[0065] For example, the affine inter prediction using the affine motion model can efficiently represent four types of motions, that is, four types of deformations as described below.

[0066] FIG. 3 exemplarily shows the motion expressed via the affine motion model. Referring to FIG. 3, the motion that can be expressed via the affine motion model can include translational (translate) motion, scaling (scale) motion, rotational (rotate) motion, and shear motion. That is, according to the flow of time shown in FIG. 3, not only the translational motion in which (a part of) the video moves in a plane, but also the scaling motion in which (a part of) the video is scaled according to the flow of time, the rotational motion in which (a part of) the video rotates according to the flow of time, and the shear motion in which (a part of) the video is deformed into an equilibrium square according to the flow of time can be efficiently expressed via the affine inter prediction.

[0067] The encoding device / decoding device can predict the distortion form of the video based on the motion vector at the control point (CP) of the current block via the affine inter prediction, and by improving the accuracy of the prediction through this, the compression performance of the video can be improved. Also, since the motion vector for at least one control point of the current block can be derived using the motion vectors of the surrounding blocks of the current block, the data volume burden on the additional information to be added can be reduced, and the inter prediction efficiency can be significantly improved.

[0068] As an example of the affine inter prediction, it can require motion information at three control points, that is, three reference points.

[0069] FIG. 4 exemplarily shows the affine motion model in which the motion vectors for three control points are used.

[0070] When the top-left sample position within the current block 400 is set to (0,0), as shown in FIG. 4, the sample positions (0,0), (w,0), and (0,h) can be determined as the control points. Hereinafter, the control point of the (0,0) sample position can be represented as CP0, the control point of the (w,0) sample position can be represented as CP1, and the control point of the (0,h) sample position can be represented as CP2.

[0071] Using each of the above-described control points and the motion vectors corresponding to the respective control points, an equation for the affine motion model can be derived. The equation for the affine motion model can be expressed as follows.

[0072]

Equation

[0073] In the equation, w represents the width of the current block 400, h represents the height of the current block 400, v 0x , v 0y represent the x-component and y-component of the motion vector of CP0, respectively, v 1x , v 1y represent the x-component and y-component of the motion vector of CP1, respectively, v 2x , v 2y represent the x-component and y-component of the motion vector of CP2, respectively. Also, x represents the x-component of the position of the target sample within the current block 400, y represents the y-component of the position of the target sample within the current block 400, v x represents the x-component of the motion vector of the target sample within the current block 400, and v y represents the y-component of the motion vector of the target sample within the current block 400.

[0074] Since the motion vectors of the CP0, the motion vector of the CP1, and the motion vector of the CP2 are known, a motion vector corresponding to the sample position within the current block can be derived based on the formula 1. That is, according to the affine motion model, based on the distance ratio between the coordinates (x, y) of the target sample and the three control points, the motion vectors v0(v 0x , v 0y ) at the control points, v1(v 1x , v 1y ), v2(v 2x , v 2y ) are scaled, and the motion vector of the target sample corresponding to the target sample position can be derived. That is, according to the affine motion model, based on the motion vectors of the control points, the motion vectors of each sample within the current block can be derived. On the other hand, the set of motion vectors of the samples within the current block derived according to the affine motion model can be represented as an affine motion vector field (MVF).

[0075] On the other hand, the six parameters for the formula 1 can be represented by a, b, c, d, e, f as follows, and the formula for the affine motion model represented by the six parameters can be as follows.

[0076]

Equation

[0077] In the formula, w represents the width of the current block 400, h represents the height of the current block 400, v 0x , v 0y represent the x component and the y component of the motion vector of CP0 respectively, v 1x , v 1y represent the x component and the y component of the motion vector of CP1 respectively, v 2x , v 2yrepresent the x-component and y-component of the motion vector of CP2, respectively. Also, x represents the x-component of the position of the target sample within the current block 400, y represents the y-component of the position of the target sample within the current block 400, and v x represents the x-component of the motion vector of the target sample within the current block 400, and v y represents the y-component of the motion vector of the target sample within the current block 400.

[0078] The affine motion model or the affine inter prediction using the six parameters can be represented as a six-parameter affine motion model or AF6.

[0079] Also, as an example of the affine inter prediction, it can require motion information at two control points, that is, two reference points.

[0080] FIG. 5 exemplarily shows the affine motion model in which motion vectors for two control points are used. The affine motion model using two control points can represent three types of motion including translational motion, scale motion, and rotational motion. The affine motion model representing the three types of motion can be represented as a similarity affine motion model or a simplified affine motion model.

[0081] When the top-left sample position within the current block 500 is set to (0,0), as shown in FIG. 5, the sample positions (0,0), (w,0) can be determined by the control points. Hereinafter, the control point of the (0,0) sample position can be represented as CP0, and the control point of the (w,0) sample position can be represented as CP1.

[0082] Using each of the above control points and the motion vectors for the corresponding control points, an equation for the affine motion model can be derived. The equation for the affine motion model can be expressed as follows.

[0083]

Number

[0084] In the formula, w represents the width of the current block 500, and v 0x , v 0y represent the x-component and y-component of the motion vector of CP0 respectively, and v 1x , v 1y represent the x-component and y-component of the motion vector of CP1 respectively. Also, x represents the x-component of the position of the target sample within the current block 500, y represents the y-component of the position of the target sample within the current block 500, and v x represents the x-component of the motion vector of the target sample within the current block 500, and v y represents the y-component of the motion vector of the target sample within the current block 500.

[0085] On the other hand, the four parameters for Equation 3 can be represented by a, b, c, and d as in the following equation, and the equation for the affine motion model represented by the four parameters can be as follows.

[0086]

Number

[0087] In the formula, w represents the width of the current block 500, and v 0x , v 0y represent the x-component and y-component of the motion vector of CP0 respectively, and v 1x , v 1yrepresent the x - component and y - component of the motion vector of CP1, respectively. Also, x represents the x - component of the position of the target sample within the current block 500, y represents the y - component of the position of the target sample within the current block 500, and v x is the x - component of the motion vector of the target sample within the current block 500, and v y represents the y - component of the motion vector of the target sample within the current block 500. Since the affine motion model using the two control points can be represented by four parameters a, b, c, d as in Equation 4, the affine motion model or the affine inter - prediction using the four parameters can be represented as a four - parameter affine motion model or AF4. That is, according to the affine motion model, based on the motion vectors of the control points, the motion vectors of each sample within the current block can be derived. On the other hand, the set of motion vectors of the samples within the current block derived according to the affine motion model can be represented as an affine motion vector field (MVF).

[0088] On the other hand, as described above, the motion vectors of sample units can be derived through the affine motion model, and thereby the accuracy of inter - prediction can be significantly improved. However, in this case, the complexity in the motion compensation process may increase significantly.

[0089] Therefore, instead of deriving the motion vectors of sample units, it can be restricted to derive the motion vectors of sub - block units within the current block.

[0090] FIG. 6 exemplarily shows a method of deriving motion vectors in units of sub-blocks based on the affine motion model. FIG. 6 exemplarily shows a case where the size of the current block is 16×16 and motion vectors are derived in units of 4×4 sub-blocks. The sub-blocks can be set to various sizes. For example, when the sub-block is set to an n×n size (n is a positive integer, e.g., n is 4), motion vectors can be derived in units of n×n sub-blocks within the current block based on the affine motion model, and various methods for deriving motion vectors representing each sub-block can be applied.

[0091] For example, referring to FIG. 6, motion vectors of each sub-block can be derived using the center of each sub-block or the center lower right side sample position as the representative coordinate. Here, the center lower right side position can represent the sample position located on the lower right side among the four samples located at the center of the sub-block. For example, when n is odd, one sample can be located in the middle of the sub-block, and in this case, the center sample position can be used for deriving the motion vector of the sub-block. However, when n is even, four samples can be adjacent to each other at the center of the sub-block, and in this case, the lower right side sample position can be used for deriving the motion vector. For example, referring to FIG. 6, the representative coordinates for each sub-block can be derived as (2,2), (6,2), (10,2),...,(14,14), and the encoding device / decoding device can substitute each of the representative coordinates of the sub-block into Equation 1 or 3 described above to derive the motion vector of each sub-block. The motion vectors of the sub-blocks within the current block derived through the affine motion model can be represented as affine MVF.

[0092] On the other hand, as an example, the size of the sub-blocks within the current block can also be derived based on the following equation.

[0093]

Number

[0094] In the formula, M represents the width of the sub-block, and N represents the height of the sub-block. Also, v 0x , v 0y respectively represent the x-component and y-component of CPMV0 of the current block, v 0x , v 0y respectively represent the x-component and y-component of CPMV1 of the current block, w represents the width of the current block, h represents the height of the current block, and MvPre represents the motion vector fraction accuracy. For example, the motion vector fraction accuracy can be set to 1 / 16.

[0095] On the other hand, for the inter prediction using the above-mentioned affine motion model, that is, the affine motion prediction, there can be an affine merge mode (AF_MERGE) and an affine inter mode (AF_INTER). Here, the affine inter mode can be represented as an affine motion vector prediction mode (AF_MVP).

[0096] In the affine merge mode, in terms of not transferring the MVD for the motion vector of the control point, it is similar to the conventional merge mode. That is, the affine merge mode can represent an encoding / decoding method that induces and predicts the CPMV for each of two or three control points from the surrounding blocks of the current block without coding for the MVD (motion vector difference), similar to the conventional skip / merge mode.

[0097] For example, when the AF_MRG mode is applied to the current block, among the surrounding blocks of the current block, the MVs (i.e., CPMV0 and CPMV1) for CP0 and CP1 can be derived from the surrounding blocks to which the affine mode is applied. That is, the CPMV0 and CPMV1 of the surrounding blocks to which the affine mode is applied can be derived as merge candidates, and the merge candidates can be derived as CPMV0 and CPMV1 for the current block.

[0098] The affine inter mode can derive an MVP (motion vector predictor) for the motion vector of the control point, derive the motion vector of the control point based on the received MVD (motion vector difference) and the MVP, derive the affine MVF of the current block based on the motion vector of the control point, and perform prediction based on the affine MVF, which can represent an inter prediction. Here, the motion vector of the control point can be represented as CPMV (Control Point Motion Vector), the MVP of the control point can be represented as CPMVP (Control Point Motion Vector Predictor), and the MVD of the control point can be represented as CPMVD (Control Point Motion Vector Difference). Specifically, for example, an encoding device can derive a CPMVP (control point point motion vector predictor) and a CPMV (control point point motion vector) for each of CP0 and CP1 (or CP0, CP1, and CP2), and transfer or store the information for the CPMVP and / or the CPMVD, which is the difference value between the CPMVP and the CPMV.

[0099] Here, when the affine inter mode is applied to the current block, the encoding device / decoding device can construct an affine MVP candidate list based on the surrounding blocks of the current block. The affine MVP candidates can be indicated as CPMV pair candidates, and the affine MVP candidate list can also be indicated as a CPMV candidate list.

[0100] Also, each affine MVP candidate can mean a combination of CPMV of CP0 and CP1 in a four-parameter affine motion model, and can mean a combination of CPMV of CP0, CP1, and CP2 in a six-parameter affine motion model.

[0101] FIG. 7 exemplarily shows a flowchart of an affine motion prediction method according to an embodiment of this document.

[0102] Referring to FIG. 7, the affine motion prediction method can be generally represented as follows. When the affine motion prediction method starts, first, a CPMV pair can be obtained (S700). Here, the CPMV pair can include CPMV0 and CPMV1 when using a four-parameter affine model.

[0103] Thereafter, affine motion compensation can be performed based on the CPMV pair (S710), and the affine motion prediction can be terminated.

[0104] In addition, to determine the CPMV0 and the CPMV1, two affine prediction modes can exist. Here, the two affine prediction modes can include an affine inter mode and an affine merge mode. The affine inter mode can signal two motion vector difference (MVD) information for the CPMV0 and the CPMV1 to clearly determine the CPMV0 and the CPMV1. On the contrary, the affine merge mode can derive a CPMV pair without MVD information signaling.

[0105] In other words, the affine merge mode can derive the CPMV of the current block by using the CPMV of the surrounding blocks coded in the affine mode. When determining the motion vector in sub-block units, the affine merge mode can also be referred to as the sub-block merge mode.

[0106] In the affine merge mode, the encoding device can signal an index for the surrounding blocks coded in the affine mode to derive the CPMV of the current block to the decoding device, and can also signal a difference value between the CPMV of the surrounding blocks and the CPMV of the current block. Here, the affine merge mode can construct an affine merge candidate list based on the surrounding blocks, and the index for the surrounding blocks can represent the surrounding blocks referred to for deriving the CPMV of the current block in the affine merge candidate list. The affine merge candidate list can also be referred to as the sub-block merge candidate list.

[0107] The affine inter mode can also be referred to as the affine MVP mode. In the affine MVP mode, the CPMV of the current block can be derived based on the CPMVP (Control Point Motion Vector Predictor) and the CPMVD (Control Point Motion Vector Difference). In other words, the encoding device can determine the CPMVP for the CPMV of the current block, derive the CPMVD which is the difference value between the CPMV of the current block and the CPMVP, and signal the information for the CPMVP and the information for the CPMVD to the decoding device. Here, the affine MVP mode can construct an affine MVP candidate list based on neighboring blocks, and the information for the CPMVP can represent the neighboring blocks referred to for deriving the CPMVP for the CPMV of the current block among the affine MVP candidate list. The affine MVP candidate list can also be referred to as the control point motion vector predictor candidate list.

[0108] For example, when the affine inter mode of the 6-parameter affine motion model is applied, the current block can be encoded as described later.

[0109] FIG. 8 is a diagram for explaining a method of deriving a motion vector predictor at a control point according to an embodiment of the present document.

[0110] Referring to FIG. 8, the motion vector of CP0 of the current block can be represented as v0, the motion vector of CP1 as v1, the motion vector of the control point at the bottom-left sample position as v2, and the motion vector of CP2 as v3. That is, the v0 can represent the CPMVP of CP0, the v1 can represent the CPMVP of CP1, and the v2 can represent the CPMVP of CP2.

[0111] The affine MVP candidates can be a combination of the CPMVP candidates of CP0, the CPMVP candidates of CP1, and the candidates of CP2.

[0112] For example, the affine MVP candidate can be derived as follows.

[0113] Specifically, a combination of up to 12 CPMVP candidates can be determined as in the following equation.

[0114]

Number

[0115] Here, v A is the motion vector of the peripheral block A, v B is the motion vector of the peripheral block B, v C is the motion vector of the peripheral block C, v D is the motion vector of the peripheral block D, v E is the motion vector of the peripheral block E, v F is the motion vector of the peripheral block F, v G can represent the motion vector of the peripheral block G.

[0116] Also, the peripheral block A can represent a peripheral block located at the upper left of the upper left sample position of the current block, the peripheral block B can represent a peripheral block located at the upper end of the upper left sample position of the current block, and the peripheral block C can represent a peripheral block located on the left side of the upper left sample position of the current block. Also, the peripheral block D can represent a peripheral block located at the upper end of the upper right sample position of the current block, and the peripheral block E can represent a peripheral block located at the upper right of the upper right sample position of the current block. Also, the peripheral block F can represent a peripheral block located on the left side of the lower left sample position of the current block, and the peripheral block G can represent a peripheral block located at the lower left of the lower left sample position of the current block.

[0117] That is, referring to the above-described Equation 6, the CPMVP candidate of the CP0 is the motion vector v of the peripheral block A A , the motion vector v of the peripheral block B B and / or the motion vector v of the peripheral block C C can be included. The CPMVP candidate of the CP1 is the motion vector v of the peripheral block D D , and / or the motion vector v of the peripheral block E E can be included. The CPMVP candidate of the CP2 is the motion vector v of the peripheral block F F , and / or the motion vector v of the peripheral block G G can be included.

[0118] In other words, the CPMVP v0 of the CP0 can be derived based on the motion vectors of at least one of the peripheral blocks A, B, and C at the upper left sample position. Here, the peripheral block A can mean the block located at the upper left end of the upper left sample position of the current block, the peripheral block B can mean the block located at the upper end of the upper left sample position of the current block, and the peripheral block C can mean the block located on the left side of the upper left sample position of the current block.

[0119] Up to 12 CPMVP candidate combinations including the CPMVP candidate of the CP0, the CPMVP candidate of the CP1, and the CPMVP candidate of the CP2 can be derived based on the motion vectors of the peripheral blocks.

[0120] Thereafter, the derived CPMVP candidate combinations are sorted in ascending order of DV, and the top 2 CPMVP candidate combinations can be derived as the affine MVP candidates.

[0121] The DV of the CPMVP candidate combination can be derived as follows.

[0122]

Equation

[0123] Thereafter, the encoding device can determine the CPMV for each of the affine MVP candidates, compare the RD (Rate Distortion) cost for the CPMV, and select an affine MVP candidate having a small RD cost as the optimal affine MVP candidate for the current block. The encoding device can encode and signal an index indicating the optimal candidate and the CPMVD.

[0124] Also, for example, when the affine merge mode is applied, the current block can be encoded as described later.

[0125] FIG. 9 is a diagram for explaining a method of deriving a motion vector predictor at a control point according to an embodiment of the present document.

[0126] Based on the surrounding blocks of the current block shown in FIG. 9, the affine merge candidate list for the current block can be configured. The surrounding blocks can include surrounding block A, surrounding block B, surrounding block C, surrounding block D, and surrounding block E. The surrounding block A can represent the left surrounding block of the current block, the surrounding block B can represent the upper surrounding block of the current block, the surrounding block C can represent the upper right corner surrounding block of the current block, the surrounding block D can represent the lower left corner surrounding block of the current block, and the surrounding block E can represent the upper left corner surrounding block of the current block.

[0127] For example, when the size of the current block is WxH, and the x component of the top-left sample position of the current block is 0 and the y component is 0, the left peripheral block is a block including samples at the (-1, H-1) coordinates, the upper peripheral block is a block including samples at the (W-1, -1) coordinates, the upper-right corner peripheral block is a block including samples at the (W, -1) coordinates, the lower-left corner peripheral block is a block including samples at the (-1, H) coordinates, and the upper-left corner peripheral block may be a block including samples at the (-1, -1) coordinates.

[0128] Specifically, for example, the encoding device can scan the peripheral blocks A, B, C, D, and E of the current block in a specific scanning order, and can determine the peripheral block encoded in the affine prediction mode first in the scanning order as a candidate block for the affine merge mode, that is, as an affine merge candidate. Here, for example, the specific scanning order may be in the order of the alphabet. That is, the specific scanning order may be in the order of peripheral block A, peripheral block B, peripheral block C, peripheral block D, and peripheral block E.

[0129] Thereafter, the encoding device can determine the affine motion model of the current block by using the CPMV of the determined candidate block, can determine the CPMV of the current block based on the affine motion model, and can determine the affine MVF of the current block based on the CPMV.

[0130] As an example, when peripheral block A is determined as a candidate block for the current block, it can be coded as described later.

[0131] FIG. 10 shows an example of affine prediction performed when peripheral block A is selected as an affine merge candidate.

[0132] Referring to FIG. 10, the encoding device can determine the surrounding block A of the current block as a candidate block, and can derive the affine motion model of the current block based on the CPMV, v2, and v3 of the surrounding block. Thereafter, the encoding device can determine the CPMV, v0, and v1 of the current block based on the affine motion model. The encoding device can determine the affine MVF based on the CPMV, v0, and v1 of the current block, and can perform the encoding process for the current block based on the affine MVF.

[0133] On the other hand, in relation to affine inter prediction, inherited affine candidates and constructed affine candidates are considered for the construction of the affine MVP candidate list.

[0134] Here, the inherited affine candidate can be as follows.

[0135] For example, when the surrounding block of the current block is an affine block and the reference picture of the current block is the same as the reference picture of the surrounding block, the affine MVP pair of the current block can be determined from the affine motion model of the surrounding block. Here, the affine block can represent a block to which the affine inter prediction is applied. The inherited affine candidate can represent the CPMV (for example, the affine MVP pair) derived based on the affine motion model of the surrounding block.

[0136] Specifically, as an example, the inherited affine candidate can be derived as described later.

[0137] FIG. 11 exemplarily shows the surrounding blocks for deriving the inherited affine candidate.

[0138] Referring to FIG. 11, the surrounding blocks of the current block can include the left surrounding block A0 of the current block, the lower left corner surrounding block A1 of the current block, the upper surrounding block B0 of the current block, the upper right corner surrounding block B1 of the current block, and the upper left corner surrounding block B2 of the current block.

[0139] For example, when the size of the current block is WxH and the x component of the top-left sample position of the current block is 0 and the y component is 0, the left surrounding block is a block including samples at the (-1, H-1) coordinates, the upper surrounding block is a block including samples at the (W-1, -1) coordinates, the upper right corner surrounding block is a block including samples at the (W, -1) coordinates, the lower left corner surrounding block is a block including samples at the (-1, H) coordinates, and the upper left corner surrounding block can be a block including samples at the (-1, -1) coordinates.

[0140] The encoding device / decoding device can sequentially check the surrounding blocks A0, A1, B0, B1, and B2. When the surrounding block is coded using an affine motion model and the reference picture of the current block is the same as the reference picture of the surrounding block, two or three CPMVs of the current block can be derived based on the affine motion model of the surrounding block. The CPMV can be derived as an affine MVP candidate of the current block. The affine MVP candidate can represent the inherited affine candidate.

[0141] As an example, up to two inherited affine candidates can be derived based on the surrounding block.

[0142] For example, the encoding device / decoding device can derive a first affine MVP candidate of the current block based on a first block in the peripheral blocks. Here, the first block can be coded with an affine motion model, and the reference picture of the first block can be the same as the reference picture of the current block. That is, the first block can be a block that checks the peripheral blocks in a specific order and satisfies the condition confirmed for the first time. The condition is coded with an affine motion model, and the reference picture of the block can be the same as the reference picture of the current block.

[0143] Thereafter, the encoding device / decoding device can derive a second affine MVP candidate of the current block based on a second block in the peripheral blocks. Here, the second block can be coded with an affine motion model, and the reference picture of the second block can be the same as the reference picture of the current block. That is, the second block can be a block that checks the peripheral blocks in a specific order and satisfies the condition confirmed for the second time. The condition is coded with an affine motion model, and the reference picture of the block can be the same as the reference picture of the current block.

[0144] On the other hand, for example, when the number of available inherited affine candidates is less than 2 (that is, when the number of derived inherited affine candidates is less than 2), a constructed affine candidate is considered. The constructed affine candidate is derived as follows.

[0145] FIG. 12 exemplarily shows a spatial candidate for the constructed affine candidate.

[0146] As shown in FIG. 12, the motion vectors of the peripheral blocks of the current block are divided into three groups. Referring to FIG. 12, the peripheral blocks include peripheral block A, peripheral block B, peripheral block C, peripheral block D, peripheral block E, peripheral block F, and peripheral block G.

[0147] The peripheral block A indicates a peripheral block located at the upper left of the upper left sample position of the current block, the peripheral block B indicates a peripheral block located at the upper end of the upper left sample position of the current block, and the peripheral block C indicates a peripheral block located at the left end of the upper left sample position of the current block. Also, the peripheral block D indicates a peripheral block located at the upper end of the upper right sample position of the current block, and the peripheral block E indicates a peripheral block located at the upper right of the upper right sample position of the current block. Also, the peripheral block F indicates a peripheral block located at the left end of the lower left sample position of the current block, and the peripheral block G indicates a peripheral block located at the lower left of the lower left sample position of the current block.

[0148] For example, the three groups include S0, S1, and S2, and the S0, S1, and S2 are derived as shown in the following table.

[0149]

Table 1

[0150] Here, mv A is the motion vector of the peripheral block A, mv B is the motion vector of the peripheral block B, mv C is the motion vector of the peripheral block C, mv D is the motion vector of the peripheral block D, mv E is the motion vector of the peripheral block E, mv F is the motion vector of the peripheral block F, mv Gindicates the motion vector of the peripheral block G. It may be indicated that S0 is the first group, S1 is the second group, and S2 is the third group.

[0151] The encoding device / decoding device derives mv0 from S0, derives mv1 from S1, derives mv2 from S2, and derives an affine MVP candidate including the mv0, the mv1, and the mv2. The affine MVP candidate can indicate the constructed affine candidate. Also, the mv0 may be a CPMVP candidate of CP0, the mv1 may be a CPMVP candidate of CP1, and the mv2 may be a CPMVP candidate of CP2.

[0152] Here, the reference picture for the mv0 may be the same as the reference picture of the current block. That is, the mv0 may be a motion vector that satisfies the condition confirmed first by checking the motion vectors in S0 in a specific order. The condition may be that the reference picture for the motion vector is the same as the reference picture of the current block. The specific order may be the peripheral block A → the peripheral block B → the peripheral block C in S0. Also, it may be performed in an order other than the order described above and is not limited to the example described above.

[0153] Also, the reference picture for the mv1 may be the same as the reference picture of the current block. That is, the mv1 may be a motion vector that satisfies the condition confirmed first by checking the motion vectors in S1 in a specific order. The condition may be that the reference picture for the motion vector is the same as the reference picture of the current block. The specific order may be the peripheral block D → the peripheral block E in S1. Also, it may be performed in an order other than the order described above and is not limited to the example described above.

[0154] Also, the reference picture for the mv2 may be the same as the reference picture of the current block. That is, the mv2 may be a motion vector that satisfies the condition first confirmed by checking the motion vectors in the S2 according to a specific order. The condition may be that the reference picture for the motion vector is the same as the reference picture of the current block. The specific order may be from the peripheral block F to the peripheral block G in the S2. Also, it may be performed in an order other than the order described above and is not limited to the example described above.

[0155] On the other hand, when only the mv0 and the mv1 are available, that is, when only the mv0 and the mv1 are derived, the mv2 is derived as follows.

[0156]

Equation

[0157] Here, mv2 x represents the x component of the mv2, mv2 y represents the y component of the mv2, mv0 x represents the x component of the mv0, mv0 y represents the y component of the mv0, mv1 x represents the x component of the mv1, mv1 y represents the y component of the mv1. Also, w represents the width of the current block, and h represents the height of the current block.

[0158] On the other hand, when only the mv0 and the mv2 are derived, the mv1 is derived as follows.

[0159]

Equation

[0160] Here, mv1 x represents the x component of the mv1, mv1 y represents the y component of the mv1, mv0 xrepresents the x component of mv0, mv0 y represents the y component of mv2, mv2 x represents the x component of mv2, mv2 y represents the y component of mv2. Also, w represents the width of the current block, and h represents the height of the current block.

[0161] Also, when the number of available inherited affine candidates and / or the constructed affine candidates is less than 2, the AMVP process of the existing HEVC standard can be applied to the affine MVP list construction. That is, when the number of available inherited affine candidates and / or constructed affine candidates is less than 2, the process of constructing MVP candidates in the existing HEVC standard can be performed.

[0162] On the other hand, the flowchart of the embodiment for constructing the aforementioned affine MVP list is as follows.

[0163] FIG. 13 exemplarily shows an example of constructing an affine MVP list.

[0164] As shown in FIG. 13, the encoding device / decoding device adds an inherited candidate to the affine MVP list of the current block (S1300). The inherited candidate represents the aforementioned inherited affine candidate.

[0165] Specifically, the encoding device / decoding device derives a maximum of two inherited affine candidates from the surrounding blocks of the current block. Here, the surrounding blocks include the left surrounding block A0, the lower left corner surrounding block A1, the upper surrounding block B0, the upper right corner surrounding block B1, and the upper left corner surrounding block B2 of the current block.

[0166] For example, an encoding device / decoding device derives a first affine MVP candidate of the current block based on a first block in a peripheral block. Here, the first block is coded with an affine motion model, and a reference picture of the first block may be the same as a reference picture of the current block. That is, the first block may be a block that satisfies a condition first confirmed by checking the peripheral blocks in a specific order. The condition may be coded with an affine motion model and that the reference picture of the block is the same as the reference picture of the current block.

[0167] Thereafter, the encoding device / decoding device derives a second affine MVP candidate of the current block based on a second block in a peripheral block. Here, the second block is coded with an affine motion model, and a reference picture of the second block may be the same as a reference picture of the current block. That is, the second block may be a block that satisfies a condition second confirmed by checking the peripheral blocks in a specific order. The condition may be coded with an affine motion model and that the reference picture of the block is the same as the reference picture of the current block.

[0168] On the other hand, the specific order may be a left peripheral block A0 → a lower left corner peripheral block A1 → an upper peripheral block B0 → an upper right corner peripheral block B1 → an upper left corner peripheral block B2. Also, it may be performed in an order other than the above-described order and is not limited to the above example.

[0169] The encoding / decoding device can add a constructed candidate to the affine MVP list of the current block (S1310). The constructed candidate indicates the constructed affine candidate described above. The constructed candidate can also be referred to as a constructed affine MVP candidate. When the number of available inherited candidates is less than 2, the encoding / decoding device can add a constructed candidate to the affine MVP list of the current block.

[0170] On the other hand, depending on whether the affine motion model applied to the current block is a 6-affine motion model or a 4-affine motion model, the method for deriving the constructed affine candidate may be different. The detailed content regarding the scheme for deriving the constructed candidate will be described later.

[0171] The encoding / decoding device adds a HEVC AMVP candidate to the affine MVP list of the current block (S1320). When the number of available inherited candidates and / or constructed candidates is less than 2, the encoding / decoding device adds a HEVC AMVP candidate to the affine MVP list of the current block. That is, when the number of available inherited candidates and / or constructed candidates is less than 2, the encoding / decoding device can perform the process of constructing the MVP candidate in the existing HEVC standard.

[0172] On the other hand, the scheme for deriving the constructed candidate is as follows.

[0173] For example, when the affine motion model applied to the current block is a 6-affine motion model, the constructed candidate is derived as in the embodiment shown in FIG. 14.

[0174] FIG. 14 shows an example of deriving the constructed candidate.

[0175] As shown in FIG. 14, the encoding device / decoding device checks mv0, mv1, and mv2 for the current block (S1400). That is, the encoding device / decoding device can determine whether there are available mv0, mv1, and mv2 in the surrounding blocks of the current block. Here, the mv0 may be a CPMVP candidate of CP0 of the current block, the mv1 may be a CPMVP candidate of CP1, and the mv2 may be a CPMVP candidate of CP2. Also, the mv0, the mv1, and the mv2 can be shown to be candidate motion vectors for the CP.

[0176] For example, the encoding device / decoding device can check whether the motion vectors of the surrounding blocks in the first group satisfy specific conditions according to a specific order. The encoding device / decoding device can derive the motion vector of the surrounding block that satisfies the condition first confirmed in the checking process as the mv0. That is, the mv0 may be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the first group according to the specific order. If the motion vectors of the surrounding blocks in the first group do not satisfy the specific condition, there may be no available mv0. Here, for example, the specific order may be the order from the surrounding block A to the surrounding block B and the surrounding block C in the first group. Also, for example, the specific condition may be that the reference picture for the motion vector of the surrounding block is the same as the reference picture of the current block.

[0177] Also, for example, the encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the second group satisfy specific conditions according to a specific order. The encoding device / decoding device can derive the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv1. That is, the mv1 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the second group according to the specific order. If the motion vectors of the peripheral blocks in the second group do not satisfy the specific condition, there may be no available mv1. Here, for example, the specific order can be the order from the peripheral block D to the peripheral block E in the second group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0178] Also, for example, the encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the third group satisfy specific conditions according to a specific order. The encoding device / decoding device derives the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv2. That is, the mv2 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the third group according to the specific order. If the motion vectors of the peripheral blocks in the third group do not satisfy the specific condition, there may be no available mv2. Here, for example, the specific order can be the order from the peripheral block F to the peripheral block G in the third group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0179] On one hand, the first group includes the motion vector of peripheral block A, the motion vector of peripheral block B, and the motion vector of peripheral block C. The second group includes the motion vector of peripheral block D and the motion vector of peripheral block E. The third group includes the motion vector of peripheral block F and the motion vector of peripheral block G. The peripheral block A refers to the peripheral block located at the upper left of the upper left sample position of the current block. The peripheral block B refers to the peripheral block located at the upper end of the upper left sample position of the current block. The peripheral block C refers to the peripheral block located at the left end of the upper left sample position of the current block. The peripheral block D refers to the peripheral block located at the upper end of the upper right sample position of the current block. The peripheral block E refers to the peripheral block located at the upper right of the upper right sample position of the current block. The peripheral block F refers to the peripheral block located at the left end of the lower left sample position of the peripheral block. The peripheral block G refers to the peripheral block located at the lower left of the lower left sample position of the current block.

[0180] When only the mv0 and the mv1 for the current block are available, that is, when only the mv0 and the mv1 for the current block are derived, the encoding device / decoding device derives the mv2 for the current block based on the aforementioned mathematical formula 8 (S1410). The encoding device / decoding device substitutes the derived mv0 and the mv1 into the aforementioned mathematical formula 8 to derive the mv2.

[0181] When only the mv0 and the mv2 for the current block are available, that is, when only the mv0 and the mv2 for the current block are derived, the encoding device / decoding device derives the mv1 for the current block based on the aforementioned mathematical formula 9 (S1420). The encoding device / decoding device substitutes the derived mv0 and the mv2 into the aforementioned mathematical formula 9 to derive the mv1.

[0182] The encoding / decoding device derives the derived mv0, mv1, and mv2 as candidate constructs for the current block (S1430). When the mv0, the mv1, and the mv2 are available, that is, when the mv0, the mv1, and the mv2 are derived based on the surrounding blocks of the current block, the encoding / decoding device derives the derived mv0, the mv1, and the mv2 as candidate constructs for the current block.

[0183] Also, when only the mv0 and the mv1 for the current block are available, that is, when only the mv0 and the mv1 for the current block are derived, the encoding / decoding device derives the derived mv0, the mv1, and mv2 derived based on the above-mentioned formula 8 as candidate constructs for the current block.

[0184] Also, when only the mv0 and the mv2 for the current block are available, that is, when only the mv0 and the mv2 for the current block are derived, the encoding / decoding device derives the derived mv0, the mv2, and mv1 derived based on the above-mentioned formula 9 as candidate constructs for the current block.

[0185] Also, for example, when the affine motion model applied to the current block is a four-affine motion model, the candidate construct can be derived as in the embodiment shown in FIG. 15.

[0186] FIG. 15 shows an example of deriving the candidate construct.

[0187] As shown in FIG. 15, the encoding device / decoding device checks mv0, mv1, and mv2 for the current block (S1500). That is, the encoding device / decoding device determines whether there are available mv0, mv1, and mv2 in the surrounding blocks of the current block. Here, the mv0 may be a CPMVP candidate for CP0 of the current block, the mv1 may be a CPMVP candidate for CP1, and the mv2 may be a CPMVP candidate for CP2.

[0188] For example, the encoding device / decoding device checks whether the motion vectors of the surrounding blocks in the first group satisfy specific conditions in a specific order. The encoding device / decoding device derives the motion vector of the surrounding block that satisfies the condition first confirmed in the checking process as the mv0. That is, the mv0 may be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the first group in a specific order. If the motion vectors of the surrounding blocks in the first group do not satisfy the specific condition, there may be no available mv0. Here, for example, the specific order may be the order from the surrounding block A to the surrounding block B and the surrounding block C in the first group. Also, for example, the specific condition may be that the reference picture for the motion vector of the surrounding block is the same as the reference picture of the current block.

[0189] Also, for example, the encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the second group satisfy specific conditions according to a specific order. The encoding device / decoding device derives the motion vector of the peripheral block that satisfies the condition first confirmed in the checking process as the mv1. That is, the mv1 can be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the second group according to the specific order. If the motion vectors of the peripheral blocks in the second group do not satisfy the specific condition, there may be no available mv1. Here, for example, the specific order can be the order from the peripheral block D to the peripheral block E in the second group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0190] Also, for example, the encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the third group satisfy specific conditions according to a specific order. The encoding device / decoding device derives the motion vector of the peripheral block that satisfies the condition first confirmed in the checking process as the mv2. That is, the mv2 can be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the third group according to the specific order. If the motion vectors of the peripheral blocks in the third group do not satisfy the specific condition, there may be no available mv2. Here, for example, the specific order can be the order from the peripheral block F to the peripheral block G in the third group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0191] On one hand, the first group includes the motion vector of peripheral block A, the motion vector of peripheral block B, and the motion vector of peripheral block C. The second group includes the motion vector of peripheral block D and the motion vector of peripheral block E. The third group includes the motion vector of peripheral block F and the motion vector of peripheral block G. The peripheral block A indicates the peripheral block located at the upper left end of the upper left end sample position of the current block. The peripheral block B indicates the peripheral block located at the upper end of the upper left end sample position of the current block. The peripheral block C indicates the peripheral block located at the left end of the upper left end sample position of the current block. The peripheral block D indicates the peripheral block located at the upper end of the upper right end sample position of the current block. The peripheral block E indicates the peripheral block located at the upper right end of the upper right end sample position of the current block. The peripheral block F indicates the peripheral block located at the left end of the lower left end sample position of the peripheral block. The peripheral block G indicates the peripheral block located at the lower left end of the lower left end sample position of the current block.

[0192] When only the mv0 and mv1 for the current block are available, or when the mv0, mv1, and mv2 for the current block are available, that is, when the mv0 and mv1 for the current block are derived, or when the mv0, mv1, and mv2 for the current block are derived, the encoding device derives the derived mv0 and mv1 as current block candidates (S1510).

[0193] On the other hand, when only the mv0 and mv2 for the current block are available, that is, when only the mv0 and mv2 for the current block are derived, the encoding device / decoding device derives mv1 for the current block based on the aforementioned formula 9 (S1520). The encoding device / decoding device substitutes the derived mv0 and mv2 into the aforementioned formula 9 to derive mv1.

[0194] Thereafter, the encoding device / decoding device derives the derived mv0 and mv1 as the constructed candidates of the current block (S1510).

[0195] On the other hand, in this document, a solution for deriving constructed candidates different from the foregoing embodiments is proposed. The proposed embodiment reduces the complexity and improves the coding performance compared to the embodiment for deriving the foregoing constructed candidates. The proposed embodiment is as follows. Also, when the number of available inherited affine candidates is less than 2 (that is, when the number of derived inherited affine candidates is less than 2), a constructed affine candidate is considered.

[0196] For example, the encoding device / decoding device checks mv0, mv1, and mv2 for the current block. That is, the encoding device / decoding device determines whether there are available mv0, mv1, and mv2 in the peripheral blocks of the current block. Here, the mv0 may be a CPMVP candidate of CP0 of the current block, the mv1 may be a CPMVP candidate of CP1, and the mv2 may be a CPMVP candidate of CP2.

[0197] Specifically, the surrounding blocks of the current block are divided into three groups, and the surrounding blocks include surrounding block A, surrounding block B, surrounding block C, surrounding block D, surrounding block E, surrounding block F, and surrounding block G. The first group includes the motion vectors of surrounding block A, surrounding block B, and surrounding block C. The second group includes the motion vectors of surrounding block D and surrounding block E. The third group includes the motion vectors of surrounding block F and surrounding block G. Surrounding block A indicates the surrounding block located at the upper left of the upper left sample position of the current block. Surrounding block B indicates the surrounding block located at the upper end of the upper left sample position of the current block. Surrounding block C indicates the surrounding block located at the left end of the upper left sample position of the current block. Surrounding block D indicates the surrounding block located at the upper end of the upper right sample position of the current block. Surrounding block E indicates the surrounding block located at the upper right of the upper right sample position of the current block. Surrounding block F indicates the surrounding block located at the left end of the lower left sample position of the current block. Surrounding block G indicates the surrounding block located at the lower left of the lower left sample position of the current block.

[0198] The encoding device / decoding device determines whether there is an available mv0 in the first group, determines whether there is an available mv1 in the second group, and determines whether there is an available mv2 in the third group.

[0199] Specifically, for example, the encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the first group satisfy specific conditions according to a specific order. The encoding device / decoding device derives the motion vector of the peripheral block that satisfies the condition first confirmed in the checking process as the mv0. That is, the mv0 can be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the first group according to the specific order. If the motion vectors of the peripheral blocks in the first group do not satisfy the specific condition, there may be no available mv0. Here, for example, the specific order can be the order from the peripheral block A to the peripheral block B and then to the peripheral block C in the first group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0200] Further, the encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the second group satisfy specific conditions according to a specific order. The encoding device / decoding device can derive the motion vector of the peripheral block that satisfies the condition first confirmed in the checking process as the mv1. That is, the mv1 can be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the second group according to the specific order. If the motion vectors of the peripheral blocks in the second group do not satisfy the specific condition, there may be no available mv1. Here, for example, the specific order can be the order from the peripheral block D to the peripheral block E in the second group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0201] In addition, the encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the third group satisfy specific conditions according to a specific order. The encoding device / decoding device derives the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv2. That is, the mv2 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the third group according to the specific order. If the motion vectors of the peripheral blocks in the third group do not satisfy the specific conditions, there may be no available mv2. Here, for example, the specific order can be the order from the peripheral block F to the peripheral block G in the third group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0202] Thereafter, when the affine motion model applied to the current block is a four-affine motion model, if mv0 and mv1 for the current block are available, the encoding device / decoding device derives the derived mv0 and mv1 as the constructed candidates for the current block. On the other hand, when mv0 and / or mv1 for the current block are not available, that is, when at least one of mv0 and mv1 is not derived from the peripheral blocks of the current block, the encoding device / decoding device does not add a constructed candidate to the affine MVP list of the current block.

[0203] Also, when the affine motion model applied to the current block is a 6 - affine motion model, if mv0, mv1, and mv2 for the current block are available, the encoding / decoding device derives the derived mv0, mv1, and mv2 as the constructed candidates for the current block. On the other hand, when mv0, mv1, and / or mv2 for the current block are not available, that is, when at least one of mv0, mv1, and mv2 cannot be derived from the surrounding blocks of the current block, the encoding / decoding device does not add constructed candidates to the affine MVP list of the current block.

[0204] The proposed embodiment described above is a method of considering as constructed candidates only when all the motion vectors of the CP for generating the affine motion model of the current block are possible. Here, the meaning of "available" indicates that the reference picture of the surrounding block and the reference picture of the current block are the same. That is, the constructed candidates can be derived only when there are motion vectors that satisfy the condition among the motion vectors of the surrounding blocks for each CP of the current block. Therefore, when the affine motion model applied to the current block is a 4 - affine motion model, the constructed candidates are considered only when the MVs of CP0 and CP1 of the current block (i.e., the mv0 and the mv1) are available. Also, when the affine motion model applied to the current block is a 6 - affine motion model, the constructed candidates are considered only when the MVs of CP0, CP1, and CP2 of the current block (i.e., the mv0, the mv1, and the mv2) are available. Therefore, according to the proposed embodiment, there may be no need for an additional configuration to derive the motion vector for the CP based on the above - mentioned Equation 8 or Equation 9. As a result, the computational complexity for deriving the constructed candidates can be reduced. Also, since the constructed candidates are determined only when the CPMVP candidates having the same reference picture are available, the general coding performance can be improved.

[0205] The foregoing embodiments can be shown as in FIGS. 16 and 17.

[0206] FIG. 16 shows an example of deriving the constructed candidate when a 4-affine motion model is applied to the current block.

[0207] As shown in FIG. 16, the encoding / decoding device determines whether mv0 and mv1 for the current block are available (S1600). That is, the encoding / decoding device determines whether there are available mv0 and mv1 in the peripheral blocks of the current block. Here, the mv0 may be a CPMVP candidate of CP0 of the current block, and the mv1 may be a CPMVP candidate of CP1.

[0208] The encoding / decoding device determines whether there is available mv0 in the first group and whether there is available mv1 in the second group.

[0209] Specifically, the surrounding blocks of the current block are divided into three groups, and the surrounding blocks include surrounding block A, surrounding block B, surrounding block C, surrounding block D, surrounding block E, surrounding block F, and surrounding block G. The first group includes the motion vector of surrounding block A, the motion vector of surrounding block B, and the motion vector of surrounding block C. The second group includes the motion vector of surrounding block D and the motion vector of surrounding block E. The third group includes the motion vector of surrounding block F and the motion vector of surrounding block G. The surrounding block A indicates the surrounding block located at the upper left end of the upper left end sample position of the current block. The surrounding block B indicates the surrounding block located at the upper end of the upper left end sample position of the current block. The surrounding block C indicates the surrounding block located at the left end of the upper left end sample position of the current block. The surrounding block D indicates the surrounding block located at the upper end of the upper right end sample position of the current block. The surrounding block E indicates the surrounding block located at the upper right end of the upper right end sample position of the current block. The side block F indicates the surrounding block located at the left end of the lower left end sample position of the current block. The surrounding block G indicates the surrounding block located at the lower left end of the lower left end sample position of the current block.

[0210] The encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the first group satisfy specific conditions according to a specific order. The encoding device / decoding device derives the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv0. That is, the mv0 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the first group according to the specific order. If the motion vectors of the peripheral blocks in the first group do not satisfy the specific condition, there may be no available mv0. Here, for example, the specific order can be the order from the peripheral block A to the peripheral block B and the peripheral block C in the first group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0211] Also, the encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the second group satisfy specific conditions according to a specific order. The encoding device / decoding device derives the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv1. That is, the mv1 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the second group according to the specific order. If the motion vectors of the peripheral blocks in the second group do not satisfy the specific condition, there may be no available mv1. Here, for example, the specific order can be the order from the peripheral block D to the peripheral block E in the second group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0212] When the mv0 and mv1 for the current block are available, that is, when the mv0 and mv1 for the current block are derived, the encoding / decoding device derives the derived mv0 and mv1 as the constructed candidates for the current block (S1610). On the other hand, when the mv0 and / or mv1 for the current block are not available, that is, when at least one of mv0 and mv1 cannot be derived from the surrounding blocks of the current block, the encoding / decoding device does not add a constructed candidate to the affine MVP list of the current block.

[0213] FIG. 17 shows an example of deriving the constructed candidate when a 6-affine motion model is applied to the current block.

[0214] As shown in FIG. 17, the encoding / decoding device determines whether mv0, mv1, and mv2 for the current block are available (S1700). That is, the encoding / decoding device determines whether there are available mv0, mv1, and mv2 in the surrounding blocks of the current block. Here, the mv0 may be the CPMVP candidate of CP0 of the current block, the mv1 may be the CPMVP candidate of CP1, and the mv2 may be the CPMVP candidate of CP2.

[0215] The encoding / decoding device determines whether there is an available mv0 in the first group, determines whether there is an available mv1 in the second group, and determines whether there is an available mv2 in the third group.

[0216] Specifically, the surrounding blocks of the current block are divided into three groups, and the surrounding blocks include surrounding block A, surrounding block B, surrounding block C, surrounding block D, surrounding block E, surrounding block F, and surrounding block G. The first group includes the motion vectors of surrounding block A, surrounding block B, and surrounding block C. The second group includes the motion vectors of surrounding block D and surrounding block E. The third group includes the motion vectors of surrounding block F and surrounding block G. The surrounding block A indicates the surrounding block located at the upper left end of the upper left end sample position of the current block. The surrounding block B indicates the surrounding block located at the upper end of the upper left end sample position of the current block. The surrounding block C indicates the surrounding block located at the left end of the upper left end sample position of the current block. The surrounding block D indicates the surrounding block located at the upper end of the upper right end sample position of the current block. The surrounding block E indicates the surrounding block located at the upper right end of the upper right end sample position of the current block. The surrounding block F indicates the surrounding block located at the left end of the lower left end sample position of the current block. The surrounding block G indicates the surrounding block located at the lower left end of the lower left end sample position of the current block.

[0217] The encoding / decoding device checks whether the motion vectors of the peripheral blocks in the first group satisfy specific conditions according to a specific order. The encoding / decoding device derives the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv0. That is, the mv0 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the first group according to the specific order. If the motion vectors of the peripheral blocks in the first group do not satisfy the specific condition, there may be no available mv0. Here, for example, the specific order can be the order from the peripheral block A to the peripheral block B and the peripheral block C in the first group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0218] In addition, the encoding / decoding device checks whether the motion vectors of the peripheral blocks in the second group satisfy specific conditions according to a specific order. The encoding / decoding device derives the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv1. That is, the mv1 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the second group according to the specific order. If the motion vectors of the peripheral blocks in the second group do not satisfy the specific condition, there may be no available mv1. Here, for example, the specific order can be the order from the peripheral block D to the peripheral block E in the second group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0219] Also, the encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the third group satisfy specific conditions in a specific order. The encoding device / decoding device derives the motion vector of the peripheral block that satisfies the condition first confirmed in the checking process as the mv2. That is, the mv2 can be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the third group in a specific order. If the motion vectors of the peripheral blocks in the third group do not satisfy the specific condition, there may be no available mv2. Here, for example, the specific order may be the order from the peripheral block F to the peripheral block G in the third group. Also, for example, the specific condition may be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0220] When the mv0, mv1, and mv2 for the current block are available, that is, when the mv0, mv1, and mv2 for the current block are derived, the encoding device / decoding device derives the derived mv0, mv1, and mv2 as the constructed candidates for the current block (S1710). On the other hand, when the mv0, mv1, and / or mv2 for the current block are not available, that is, when at least one of mv0, mv1, and mv2 cannot be derived from the peripheral blocks of the current block, the encoding device / decoding device does not add a constructed candidate to the affine MVP list of the current block.

[0221] Also, in this document, an embodiment for deriving constructed candidates as described below is proposed. Specifically, in the embodiment described below, the CP for generating the four-affine motion model can be adaptively determined based on the width and height of the current block. That is, when the affine motion model applied to the current block is a four-affine motion model, two of the CP0, CP1, CP2 of the current block can be selected based on the width and height of the current block.

[0222] For example, the CP of the current block is selected as shown in the following table.

[0223]

Table 2

[0224] Referring to Table 2 above, when the width of the current block is greater than or equal to the height, the CP of the affine motion model for the current block can be selected as CP0 and CP1. Also, when the width of the current block is smaller than the height, the CP of the affine motion model for the current block can be selected as CP0 and CP2.

[0225] FIG. 18 shows an example of deriving a constructed candidate including CPMVP for a CP adaptively selected based on the width and height of the current block.

[0226] As shown in FIG. 18, when a 4-affine motion model is applied to the current block, the encoding device / decoding device determines whether the width of the current block is greater than or equal to the height (S1800). When the width of the current block is greater than or equal to the height, the encoding device / decoding device can select the CP of the affine motion model for the current block as CP0 and CP1. Also, when the width of the current block is smaller than the height, the encoding device / decoding device can select the CP of the affine motion model for the current block as CP0 and CP2.

[0227] When the width of the current block is greater than or equal to the height, the encoding device / decoding device determines whether mv0 and mv1 for the current block are available (S1810). That is, the encoding device / decoding device determines whether available mv0 and mv1 exist in the surrounding blocks of the current block. Here, the mv0 can be a CPMVP candidate for CP0 of the current block, and the mv1 can be a CPMVP candidate for CP1.

[0228] The encoding device / decoding device determines whether there is an available mv0 in the first group and determines whether there is an available mv1 in the second group.

[0229] Specifically, the peripheral blocks of the current block are divided into three groups, and the peripheral blocks include peripheral block A, peripheral block B, peripheral block C, peripheral block D, peripheral block E, peripheral block F, and peripheral block G. The first group includes the motion vectors of peripheral block A, peripheral block B, and peripheral block C, the second group includes the motion vectors of peripheral block D and peripheral block E, and the third group includes the motion vectors of peripheral block F and peripheral block G. Peripheral block A indicates the peripheral block located at the upper left end of the upper left end sample position of the current block, peripheral block B indicates the peripheral block located at the upper end of the upper left end sample position of the current block, peripheral block C indicates the peripheral block located at the left end of the upper left end sample position of the current block, peripheral block D indicates the peripheral block located at the upper end of the upper right end sample position of the current block, peripheral block E indicates the peripheral block located at the upper right end of the upper right end sample position of the current block, peripheral block F indicates the peripheral block located at the left end of the lower left end sample position of the current block, and peripheral block G indicates the peripheral block located at the lower left end of the lower left end sample position of the current block.

[0230] The encoding / decoding device checks whether the motion vectors of the peripheral blocks in the first group satisfy specific conditions according to a specific order. The encoding / decoding device derives the motion vector of the peripheral block that satisfies the condition first confirmed in the checking process as the mv0. That is, the mv0 can be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the first group according to the specific order. If the motion vectors of the peripheral blocks in the first group do not satisfy the specific condition, there may be no available mv0. Here, for example, the specific order can be the order from peripheral block A to peripheral block B and then to peripheral block C in the first group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0231] In addition, the encoding / decoding device checks whether the motion vectors of the peripheral blocks in the second group satisfy specific conditions according to a specific order. The encoding / decoding device derives the motion vector of the peripheral block that satisfies the condition first confirmed in the checking process as the mv1. That is, the mv1 can be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the second group according to the specific order. If the motion vectors of the peripheral blocks in the second group do not satisfy the specific condition, there may be no available mv1. Here, for example, the specific order can be the order from peripheral block D to peripheral block E in the second group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0232] On the one hand, when the width of the current block is smaller than the height, it is determined whether mv0 and mv2 for the current block are available (S1820). That is, the encoding device / decoding device determines whether there are available mv0 and mv2 in the surrounding blocks of the current block. Here, the mv0 may be a CPMVP candidate of CP0 of the current block, and the mv2 may be a CPMVP candidate of CP2.

[0233] The encoding device / decoding device determines whether there is available mv0 in the first group and whether there is available mv2 in the third group.

[0234] Specifically, the surrounding blocks of the current block are divided into three groups. The surrounding blocks include surrounding block A, surrounding block B, surrounding block C, surrounding block D, surrounding block E, surrounding block F, and surrounding block G. The first group includes the motion vectors of surrounding block A, surrounding block B, and surrounding block C. The second group includes the motion vectors of surrounding block D and surrounding block E. The third group includes the motion vectors of surrounding block F and surrounding block G. The surrounding block A indicates the surrounding block located at the upper left of the upper left sample position of the current block. The surrounding block B indicates the surrounding block located at the upper end of the upper left sample position of the current block. The surrounding block C indicates the surrounding block located at the left end of the upper left sample position of the current block. The surrounding block D indicates the surrounding block located at the upper end of the upper right sample position of the current block. The surrounding block E indicates the surrounding block located at the upper right of the upper right sample position of the current block. The surrounding block F indicates the surrounding block located at the left end of the lower left sample position of the current block. The surrounding block G indicates the surrounding block located at the lower left of the lower left sample position of the current block.

[0235] The encoding / decoding device checks whether the motion vectors of the peripheral blocks in the first group satisfy specific conditions according to a specific order. The encoding / decoding device derives the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv0. That is, the mv0 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the first group according to the specific order. If the motion vectors of the peripheral blocks in the first group do not satisfy the specific condition, there may be no available mv0. Here, for example, the specific order can be the order from the peripheral block A to the peripheral block B and the peripheral block C in the first group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0236] In addition, the encoding / decoding device checks whether the motion vectors of the peripheral blocks in the third group satisfy specific conditions according to a specific order. The encoding / decoding device derives the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv2. That is, the mv2 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the third group according to the specific order. If the motion vectors of the peripheral blocks in the third group do not satisfy the specific condition, there may be no available mv2. Here, for example, the specific order can be the order from the peripheral block F to the peripheral block G in the third group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0237] The encoding / decoding device determines the constructed candidate of the current block based on the derived motion vectors (S1830). For example, when mv0 for CP0 and mv1 for CP1 are derived, the encoding / decoding device determines mv0 and mv1 as the constructed candidates. Also, for example, when mv0 for CP0 and mv2 for CP2 are derived, the encoding / decoding device determines mv0 and mv2 as the constructed candidates.

[0238] On the other hand, when the 6 - affine motion model is applied to the current block, as in the previous embodiment, when all of the CPMVPs (i.e., mv0, mv1, mv2) for CP0, CP1, and CP2 are available, the constructed candidate can be considered.

[0239] Also, in this document, embodiments for deriving constructed candidates as described below are proposed. Specifically, the embodiments described below can be applied in deriving the constructed candidate of the current block when a scheme for adaptively selecting CP is not considered.

[0240] FIG. 19 shows an example of deriving the constructed candidate of the current block.

[0241] The encoding / decoding device determines whether mv0 and mv1 for the current block are available (S1900). When the 4 - affine motion model is applied to the current block, the encoding / decoding device determines whether there are available mv0 and mv1 in the surrounding blocks of the current block. Here, mv0 can be a CPMVP candidate for CP0 of the current block, and mv1 can be a CPMVP candidate for CP1.

[0242] The encoding / decoding device determines whether there is available mv0 in the first group and whether there is available mv1 in the second group.

[0243] Specifically, the peripheral blocks of the current block are divided into three groups. The peripheral blocks include peripheral block A, peripheral block B, peripheral block C, peripheral block D, peripheral block E, peripheral block F, and peripheral block G. The first group includes the motion vectors of peripheral block A, peripheral block B, and peripheral block C. The second group includes the motion vectors of peripheral block D and peripheral block E. The third group includes the motion vectors of peripheral block F and peripheral block G. Peripheral block A indicates the peripheral block located at the upper left corner of the upper left corner sample position of the current block. Peripheral block B indicates the peripheral block located at the upper end of the upper left corner sample position of the current block. Peripheral block C indicates the peripheral block located at the left end of the upper left corner sample position of the current block. Peripheral block D indicates the peripheral block located at the upper end of the upper right corner sample position of the current block. Peripheral block E indicates the peripheral block located at the upper right corner of the upper right corner sample position of the current block. Peripheral block F indicates the peripheral block located at the left end of the lower left corner sample position of the current block. Peripheral block G indicates the peripheral block located at the lower left corner of the lower left corner sample position of the current block.

[0244] The encoding / decoding device checks whether the motion vectors of the peripheral blocks in the first group satisfy specific conditions according to a specific order. The encoding / decoding device derives the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv0. That is, the mv0 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the first group according to the specific order. If the motion vectors of the peripheral blocks in the first group do not satisfy the specific condition, there may be no available mv0. Here, for example, the specific order can be the order from the peripheral block A to the peripheral block B and the peripheral block C in the first group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0245] In addition, the encoding / decoding device checks whether the motion vectors of the peripheral blocks in the second group satisfy specific conditions according to a specific order. The encoding / decoding device derives the motion vector of the peripheral block that satisfies the condition confirmed first in the checking process as the mv1. That is, the mv1 can be the motion vector that satisfies the specific condition confirmed first by checking the motion vectors in the second group according to the specific order. If the motion vectors of the peripheral blocks in the second group do not satisfy the specific condition, there may be no available mv1. Here, for example, the specific order can be the order from the peripheral block D to the peripheral block E in the second group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0246] If mv0 and / or mv1 for the current block are not available, that is, if at least one of mv0 and mv1 cannot be derived from the surrounding blocks of the current block, the encoding device / decoding device determines whether mv0 and mv2 for the current block are available and whether the width of the current block is smaller than its height (S1910).

[0247] For example, the encoding device / decoding device determines whether there is available mv0 in the first group and whether there is available mv2 in the third group. Here, the mv0 may be a CPMVP candidate of CP0 of the current block, and the mv2 may be a CPMVP candidate of CP2.

[0248] Specifically, the surrounding blocks of the current block are divided into three groups, and the surrounding blocks include surrounding block A, surrounding block B, surrounding block C, surrounding block D, surrounding block E, surrounding block F, and surrounding block G. The first group includes the motion vectors of surrounding block A, surrounding block B, and surrounding block C, the second group includes the motion vectors of surrounding block D and surrounding block E, and the third group includes the motion vectors of surrounding block F and surrounding block G. The surrounding block A indicates the surrounding block located at the upper left of the upper left sample position of the current block, the surrounding block B indicates the surrounding block located at the upper end of the upper left sample position of the current block, the surrounding block C indicates the surrounding block located at the left end of the upper left sample position of the current block, the surrounding block D indicates the surrounding block located at the upper end of the upper right sample position of the current block, the surrounding block E indicates the surrounding block located at the upper right of the upper right sample position of the current block, the surrounding block F indicates the surrounding block located at the left end of the lower left sample position of the current block, and the surrounding block G indicates the surrounding block located at the lower left of the lower left sample position of the current block.

[0249] The encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the first group satisfy specific conditions according to a specific order. The encoding device / decoding device derives the motion vector of the peripheral block that satisfies the condition first confirmed in the checking process as the mv0. That is, the mv0 can be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the first group according to the specific order. If the motion vectors of the peripheral blocks in the first group do not satisfy the specific condition, there may be no available mv0. Here, for example, the specific order can be the order from peripheral block A to peripheral block B and peripheral block C in the first group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0250] Also, the encoding device / decoding device checks whether the motion vectors of the peripheral blocks in the third group satisfy specific conditions according to a specific order. The encoding device / decoding device derives the motion vector of the peripheral block that satisfies the condition first confirmed in the checking process as the mv2. That is, the mv2 can be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the third group according to the specific order. If the motion vectors of the peripheral blocks in the third group do not satisfy the specific condition, there may be no available mv2. Here, for example, the specific order can be the order from peripheral block F to peripheral block G in the third group. Also, for example, the specific condition can be that the reference picture for the motion vector of the peripheral block is the same as the reference picture of the current block.

[0251] Also, the encoding device / decoding device determines whether the width of the current block is smaller than the height.

[0252] If mv0 and mv2 for the current block are available and the width of the current block is smaller than the height, the encoding / decoding device derives mv1 for the current block based on the above-described Equation 9 (S1920). If mv0 and mv2 for the current block are available and the width of the current block is smaller than the height, the encoding / decoding device substitutes the derived mv0 and the mv2 into the above-described Equation 9 to derive the mv1. On the other hand, if at least one of mv0 and mv2 for the current block is not available or the width of the current block is not smaller than the height, the constructed candidate for the current block may not be derived.

[0253] Thereafter, the encoding / decoding device derives the derived mv0 and mv1 as the constructed candidates for the current block (S1930).

[0254] FIG. 20 schematically shows an image encoding method by an encoding device according to this document. The method disclosed in FIG. 20 can be performed by the encoding device disclosed in FIG. 1. Specifically, for example, S2000 to S2030 in FIG. 20 are performed by the prediction unit of the encoding device, and S2040 is performed by the entropy encoding unit of the encoding device. Also, although not shown, the process of deriving a prediction sample for the current block based on the CPMV is performed by the prediction unit of the encoding device, the process of deriving a residual sample for the current block based on the original sample and the prediction sample for the current block is performed by the subtraction unit of the encoding device, the process of generating information regarding the residual for the current block based on the residual sample is performed by the conversion unit of the encoding device, and the process of encoding the information regarding the residual is performed by the entropy encoding unit of the encoding device.

[0255] The encoding device constructs an affine Motion Vector Predictor (MVP) candidate list for the current block (S2000). The encoding device constructs an affine MVP candidate list including an affine MVP candidate for the current block.

[0256] As an example, when constructed affine MVP candidates are available, the affine MVP candidate list includes the constructed affine MVP candidates. Here, the constructed affine MVP candidates include candidate motion vectors for the CP. The constructed affine MVP candidates are available when all the candidate motion vectors are available.

[0257] For example, when a 4-affine motion model is applied to the current block, the CP of the current block includes CP0 and CP1. When the candidate motion vector for CP0 is available and the candidate motion vector for CP1 is available, the constructed affine MVP candidate is available, and the affine MVP candidate list includes the constructed affine MVP candidate. Here, CP0 indicates the upper left position of the current block, and CP1 indicates the upper right position of the current block.

[0258] The constructed affine MVP candidate includes the candidate motion vector for CP0 and the candidate motion vector for CP1. The candidate motion vector for CP0 may be the motion vector of the first block, and the candidate motion vector for CP1 may be the motion vector of the second block.

[0259] Further, the first block may be a block in which the reference picture first confirmed by checking the peripheral blocks in the first group according to a first specific order is the same as the reference picture of the current block. Here, when the reference picture of the first block in the first group is the same as the reference picture of the current block, the candidate motion vector for the CP0 can be used. Also, for example, the first group may include a peripheral block A, a peripheral block B, and a peripheral block C, and the first specific order may be the order from the peripheral block A to the peripheral block B and then to the peripheral block C.

[0260] Further, the second block may be a block in which the reference picture first confirmed by checking the peripheral blocks in the second group according to a second specific order is the same as the reference picture of the current block. Here, when the reference picture of the second block in the second group is the same as the reference picture of the current block, the candidate motion vector for the CP1 can be used. Also, for example, the second group may include a peripheral block D and a peripheral block E, and the second specific order may be the order from the peripheral block D to the peripheral block E.

[0261] On the one hand, when the size of the current block is W×H and the x - component of the top - left sample position of the current block is 0 and the y - component is 0, the surrounding block A can be a block including the sample at the (-1, -1) coordinate, the surrounding block B can be a block including the sample at the (0, -1) coordinate, the surrounding block C can be a block including the sample at the (-1, 0) coordinate, the surrounding block D can be a block including the sample at the (W - 1, -1) coordinate, and the surrounding block E can be a block including the sample at the (W, -1) coordinate. That is, the surrounding block A can be the upper - left - corner surrounding block of the current block, the surrounding block B can be the left - most upper - side surrounding block among the upper - side surrounding blocks of the current block, the surrounding block C can be the top - most left - side surrounding block among the left - side surrounding blocks of the current block, the surrounding block D can be the right - most upper - side surrounding block among the upper - side surrounding blocks of the current block, and the surrounding block E can be the upper - right - corner surrounding block of the current block.

[0262] On the other hand, when at least one of the candidate motion vectors of CP0 and the candidate motion vector of CP1 is not available, the constructed affine MVP candidate may not be available.

[0263] Or, for example, when a 6 - affine motion model is applied to the current block, the CPs of the current block include CP0, CP1, and CP2. When the candidate motion vector for CP0 is available, the candidate motion vector for CP1 is available, and the candidate motion vector for CP2 is available, the constructed affine MVP candidate is available, and the affine MVP candidate list includes the constructed affine MVP candidate. Here, CP0 indicates the top - left position of the current block, CP1 indicates the top - right position of the current block, and CP2 indicates the bottom - left position of the current block.

[0264] The constructed affinity MVP candidate includes a candidate motion vector for the CP0, a candidate motion vector for the CP1, and a candidate motion vector for the CP2. The candidate motion vector for the CP0 can be the motion vector of the first block, the candidate motion vector for the CP1 can be the motion vector of the second block, and the candidate motion vector for the CP2 can be the motion vector of the third block.

[0265] Also, the first block can be a block that checks the surrounding blocks within the first group according to a first specific order and the first confirmed reference picture is the same as the reference picture of the current block. Here, when the reference picture of the first block within the first group is the same as the reference picture of the current block, the candidate motion vector for the CP0 is available. Also, for example, the first group includes surrounding block A, surrounding block B, and surrounding block C, and the first specific order can be the order from the surrounding block A to the surrounding block B and the surrounding block C.

[0266] Also, the second block can be a block that checks the surrounding blocks within the second group according to a second specific order and the first confirmed reference picture is the same as the reference picture of the current block. Here, when the reference picture of the second block within the second group is the same as the reference picture of the current block, the candidate motion vector for the CP1 is available. Also, for example, the second group includes surrounding block D and surrounding block E, and the second specific order can be the order from the surrounding block D to the surrounding block E.

[0267] Further, the third block may be a block that checks the peripheral blocks within the third group according to a third specific order and the reference picture confirmed first is the same as the reference picture of the current block. Here, when the reference picture of the third block within the third group is the same as the reference picture of the current block, the candidate motion vector for CP2 can be used. Also, for example, the third group may include a peripheral block F and a peripheral block G, and the third specific order may be the order from the peripheral block F to the peripheral block G.

[0268] On the other hand, when the size of the current block is W×H and the x component of the top-left sample position of the current block is 0 and the y component is 0, the peripheral block A may be a block including samples at the (-1, -1) coordinates, the peripheral block B may be a block including samples at the (0, -1) coordinates, the peripheral block C may be a block including samples at the (-1, 0) coordinates, the peripheral block D may be a block including samples at the (W - 1, -1) coordinates, the peripheral block E may be a block including samples at the (W, -1) coordinates, the peripheral block F may be a block including samples at the (-1, H - 1) coordinates, and the peripheral block G may be a block including samples at the (-1, H) coordinates. That is, the peripheral block A may be the upper left corner peripheral block of the current block, the peripheral block B may be the leftmost upper peripheral block among the upper peripheral blocks of the current block, the peripheral block C may be the uppermost left peripheral block among the left peripheral blocks of the current block, the peripheral block D may be the rightmost upper peripheral block among the upper peripheral blocks of the current block, the peripheral block E may be the upper right corner peripheral block of the current block, the peripheral block F may be the lowermost left peripheral block among the left peripheral blocks of the current block, and the peripheral block G may be the lower left corner peripheral block of the current block.

[0269] On the other hand, if at least one of the candidate motion vectors of the CP0, the candidate motion vector of the CP1, and the candidate motion vector of the CP2 is unavailable, the constructed affine MVP candidate may be unavailable.

[0270] Or, for example, when a 4-affin motion model is applied to the current block, the CP is selected based on the width and height of the current block, and the constructed affine MVP candidate includes the candidate motion vector for the selected CP.

[0271] As an example, when the width of the current block is greater than or equal to the height, the CP of the current block includes the CP0 and CP1. If the candidate motion vector for the CP0 is available and the candidate motion vector for the CP1 is available, the constructed affine MVP candidate is available, and the affine MVP candidate list can include the constructed affine MVP candidate. Here, the CP0 indicates the upper left corner position of the current block, and the CP1 indicates the upper right corner position of the current block.

[0272] The constructed affine MVP candidate includes the candidate motion vector for the CP0 and the candidate motion vector for the CP1. The candidate motion vector for the CP0 can be the motion vector of the first block, and the candidate motion vector for the CP1 can be the motion vector of the second block.

[0273] Further, the first block may be a block in which the reference picture first confirmed by checking the peripheral blocks in the first group according to the first specific order is the same as the reference picture of the current block. Here, when the reference picture of the first block in the first group is the same as the reference picture of the current block, the candidate motion vector for CP0 can be used. Also, for example, the first group may include a peripheral block A, a peripheral block B, and a peripheral block C, and the first specific order may be the order from the peripheral block A to the peripheral block B and then to the peripheral block C.

[0274] Further, the second block may be a block in which the reference picture first confirmed by checking the peripheral blocks in the second group according to the second specific order is the same as the reference picture of the current block. Here, when the reference picture of the second block in the second group is the same as the reference picture of the current block, the candidate motion vector for CP1 can be used. Also, for example, the second group may include a peripheral block D and a peripheral block E, and the second specific order may be the order from the peripheral block D to the peripheral block E.

[0275] On one hand, when the size of the current block is W×H and the x component of the top-left sample position of the current block is 0 and the y component is 0, the surrounding block A can be a block including the sample at the (-1, -1) coordinate, the surrounding block B can be a block including the sample at the (0, -1) coordinate, the surrounding block C can be a block including the sample at the (-1, 0) coordinate, the surrounding block D can be a block including the sample at the (W - 1, -1) coordinate, and the surrounding block E can be a block including the sample at the (W, -1) coordinate. That is, the surrounding block A can be the upper-left corner surrounding block of the current block, the surrounding block B can be the leftmost upper surrounding block among the upper surrounding blocks of the current block, the surrounding block C can be the uppermost left surrounding block among the left surrounding blocks of the current block, the surrounding block D can be the rightmost upper surrounding block among the upper surrounding blocks of the current block, and the surrounding block E can be the upper-right corner surrounding block of the current block.

[0276] If at least one of the candidate motion vectors of the CP0 and the candidate motion vectors of the CP1 is not available, the constructed affine MVP candidate may not be available.

[0277] Also, when the width of the current block is smaller than the height, the current block includes the CP0 and CP2. When the candidate motion vector for the CP0 is available and the candidate motion vector for the CP2 is available, the constructed affine MVP candidate is available, and the affine MVP candidate list includes the constructed affine MVP candidate. Here, the CP0 indicates the upper-left position of the current block, and the CP2 indicates the lower-left position of the current block.

[0278] The constructed affine MVP candidate includes a candidate motion vector for the CP0 and a candidate motion vector for the CP2. The candidate motion vector for the CP0 may be a motion vector of the first block, and the candidate motion vector for the CP2 may be a motion vector of the third block.

[0279] Also, the first block may be a block in which the reference picture first confirmed by checking the peripheral blocks in the first group according to the first specific order is the same as the reference picture of the current block. Here, when the reference picture of the first block in the first group is the same as the reference picture of the current block, the candidate motion vector for the CP0 is available. Also, for example, the first group may include a peripheral block A, a peripheral block B, and a peripheral block C, and the first specific order may be the order from the peripheral block A to the peripheral block B and the peripheral block C.

[0280] Also, the third block may be a block in which the reference picture first confirmed by checking the peripheral blocks in the third group according to the third specific order is the same as the reference picture of the current block. Here, when the reference picture of the third block in the third group is the same as the reference picture of the current block, the candidate motion vector for the CP2 is available. Also, for example, the third group may include a peripheral block F and a peripheral block G, and the third specific order may be the order from the peripheral block F to the peripheral block G.

[0281] On one hand, when the size of the current block is W×H and the x - component of the top - left sample position of the current block is 0 and the y - component is 0, the peripheral block A can be a block including samples at coordinates (-1, -1), the peripheral block B can be a block including samples at coordinates (0, -1), the peripheral block C can be a block including samples at coordinates (-1, 0), the peripheral block F can be a block including samples at coordinates (-1, H - 1), and the peripheral block G can be a block including samples at coordinates (-1, H). That is, the peripheral block A can be the upper - left - corner peripheral block of the current block, the peripheral block B can be the left - most upper - side peripheral block among the upper - side peripheral blocks of the current block, the peripheral block C can be the top - most left - side peripheral block among the left - side peripheral blocks of the current block, the peripheral block F can be the bottom - most left - side peripheral block among the left - side peripheral blocks of the current block, and the peripheral block G can be the lower - right - corner peripheral block of the current block.

[0282] If at least one of the candidate motion vectors of CP0 and the candidate motion vectors of CP2 is not available, the constructed affine MVP candidate may not be available.

[0283] Also, as an example, the affine MVP candidate list includes inherited affine MVP candidates.

[0284] The inherited affine MVP candidates are derived based on specific blocks within the peripheral blocks of the current block. Here, the specific blocks are coded in the affine motion model, and the reference picture of the specific blocks can be the same as the reference picture of the current block.

[0285] Here, the specific block may be a block that checks the peripheral blocks in a specific order and satisfies the condition confirmed first. The condition may be coded in the affine motion model and may be that the reference picture of the block is the same as the reference picture of the current block. For example, the encoding device can check whether the peripheral blocks satisfy the condition in the specific order, derive the specific block that satisfies the condition first, and derive the inherited affine MVP candidate based on the specific block.

[0286] Specifically, for example, the encoding device can derive the motion vector for the CP of the current block based on the affine motion model of the specific block, and derive the inherited affine MVP candidate including the motion vector as the CPMVP candidate. The affine motion model can be derived as in the foregoing Equation 1 or Equation 3.

[0287] Here, the peripheral blocks include the left peripheral block, upper peripheral block, upper right peripheral block, lower left peripheral block, and upper left peripheral block of the current block. For example, when the size of the current block is W×H and the x component of the top-left sample position of the current block is 0 and the y component is 0, the left peripheral block is a block including samples at the (-1, H-1) coordinates, the upper peripheral block is a block including samples at the (W-1, -1) coordinates, the upper right peripheral block is a block including samples at the (W, -1) coordinates, the lower left peripheral block is a block including samples at the (-1, H) coordinates, and the upper left peripheral block may be a block including samples at the (-1, -1) coordinates.

[0288] On the other hand, when a number of affine MVP candidates smaller than two are derived through the foregoing process, the affine MVP candidates can include the MVP candidates in the existing HEVC standard.

[0289] That is, for example, when a smaller number of affine MVP candidates than two are derived through the above-described process, the encoding device can derive MVP candidates in the existing HEVC standard.

[0290] On the other hand, the encoding device can determine an affine motion model applied to the current block and generate and encode affine type information indicating the affine motion model applied to the current block. For example, the affine type information indicates whether the affine motion model applied to the current block is a 4-affine motion model or a 6-affine motion model. The affine type information may be signaled via the bitstream. The image information includes the affine type information.

[0291] The encoding device derives CPMVPs (Control Point Motion Vector Predictors) for the CP (Control Point) of the current block based on the affine MVP candidate list (S2010). The encoding device derives a CPMV for the CP of the current block that has the optimal RD cost, and selects the affine MVP candidate among the affine MVP candidates that is most similar to the CPMV as the affine MVP candidate for the current block. The encoding device derives CPMVPs for the CP (Control Point) of the current block based on the selected affine MVP candidate among the affine MVP candidates included in the affine MVP candidate list. Specifically, when the affine MVP candidate includes a candidate motion vector for CP0 and a candidate motion vector for CP1, the candidate motion vector for CP0 of the affine MVP candidate can be derived as the CPMVP of CP0, and the candidate motion vector for CP1 of the affine MVP candidate can be derived as the CPMVP of CP1. Also, when the affine MVP candidate includes a candidate motion vector for CP0, a candidate motion vector for CP1, and a candidate motion vector for CP2, the candidate motion vector for CP0 of the affine MVP candidate is derived as the CPMVP of CP0, and the candidate motion vector for CP2 of the affine MVP candidate is derived as the CPMVP of CP1. Also, when the affine MVP candidate includes a candidate motion vector for CP0 and a candidate motion vector for CP2, the candidate motion vector for CP0 of the affine MVP candidate is derived as the CPMVP of CP0, and the candidate motion vector for CP2 of the affine MVP candidate is derived as the CPMVP of CP2.

[0292] The encoding device can encode an affine MVP candidate index indicating the selected affine MVP candidate among the affine MVP candidates. The affine MVP candidate index can indicate the one affine MVP candidate among the affine MVP candidates included in the motion vector predictor (MVP) candidate list for the current block.

[0293] The encoding device derives a CPMV for the CP of the current block (S2020). The encoding device derives a CPMV for each of the CPs of the current block.

[0294] The encoding device derives CPMVD (Control Point Motion Vector Differences) for the CP of the current block based on the CPMV and the CPMV (S2030). The encoding device derives CPMVD for the CP of the current block based on the CPMV and the CPMV for each of the CPs.

[0295] The encoding device encodes motion prediction information including information about the CPMVD (S2040). The encoding device outputs the motion prediction information including the information about the CPMVD in the form of a bitstream. That is, the encoding device outputs the image information including the motion prediction information in the form of a bitstream. The encoding device encodes information about the CPMVD for each of the CPs, and the motion prediction information includes the information about the CPMVD.

[0296] In addition, the motion prediction information includes the affine MVP candidate index. The affine MVP candidate index can indicate the selected affine MVP candidate among the affine MVP candidates included in the motion vector predictor (MVP) candidate list for the current block.

[0297] On the other hand, as an example, the encoding device derives a prediction sample for the current block based on the CPMV, derives a residual sample for the current block based on the original sample and the prediction sample for the current block, generates information regarding the residual for the current block based on the residual sample, and encodes the information regarding the residual. The image information can include the information regarding the residual.

[0298] On the other hand, the bitstream is transmitted to the decoding device via a network or a (digital) storage medium. Here, the network includes a broadcast network and / or a communication network, etc., and the digital storage medium includes various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc.

[0299] FIG. 21 schematically shows an encoding apparatus that performs an image encoding method according to this document. The method disclosed in FIG. 20 is performed by the encoding apparatus disclosed in FIG. 21. Specifically, for example, the prediction unit of the encoding apparatus in FIG. 21 performs S2000 to S2030 in FIG. 20, and the entropy encoding unit of the encoding apparatus in FIG. 21 performs S2040 in FIG. 20. Also, although not shown, the process of deriving a prediction sample for the current block based on the CPMV is performed by the prediction unit of the encoding apparatus in FIG. 21, the process of deriving a residual sample for the current block based on the original sample and the prediction sample for the current block is performed by the subtraction unit of the encoding apparatus in FIG. 21, the process of generating information regarding the residual for the current block based on the residual sample is performed by the conversion unit of the encoding apparatus in FIG. 21, and the process of encoding the information regarding the residual is performed by the entropy encoding unit of the encoding apparatus in FIG. 21.

[0300] FIG. 22 schematically shows an image decoding method by a decoding apparatus according to this document. The method disclosed in FIG. 22 is performed by the decoding apparatus disclosed in FIG. 2. Specifically, for example, S2200 in FIG. 22 is performed by the entropy decoding unit of the decoding apparatus, S2210 to S2250 are performed by the prediction unit of the decoding apparatus, and S2260 is performed by the addition unit of the decoding apparatus. Also, although not shown, the process of acquiring information regarding the residual of the current block via a bit stream is performed by the entropy decoding unit of the decoding apparatus, and the process of deriving the residual sample for the current block based on the residual information is performed by the inverse conversion unit of the decoding apparatus.

[0301] The decoding apparatus acquires motion prediction information for the current block from a bit stream (S2200). The decoding apparatus acquires image information including the motion prediction information from the bit stream.

[0302] Also, for example, the motion prediction information includes information regarding CPMVD (Control Point Motion Vector Differences) with respect to the CP (control point) of the current block. That is, the motion prediction information includes information regarding CPMVD for each of the CPs of the current block.

[0303] Also, for example, the motion prediction information includes an affine MVP candidate index for the current block. The affine MVP candidate index can indicate one of the affine MVP candidates included in an affine motion vector predictor (MVP) candidate list for the current block.

[0304] The decoding device constructs (S2210) an affine motion vector predictor (MVP) candidate list for the current block. The decoding device constructs an affine MVP candidate list including an affine MVP candidate for the current block.

[0305] As an example, when a constructed affine MVP candidate is available, the affine MVP candidate list includes the constructed affine MVP candidate. Here, the constructed affine MVP candidate includes candidate motion vectors for the CP. The constructed affine MVP candidate is available when all of the candidate motion vectors are available.

[0306] For example, when a 4 affine motion model is applied to the current block, the CP of the current block includes the CP0 and CP1. If a candidate motion vector for CP0 is available and a candidate motion vector for CP1 is available, the constructed affine MVP candidate is available, and the affine MVP candidate list can include the constructed affine MVP candidate. Here, CP0 indicates the upper left position of the current block, and CP1 indicates the upper right position of the current block.

[0307] The constructed affine MVP candidate includes a candidate motion vector for CP0 and a candidate motion vector for CP1. The candidate motion vector for CP0 can be the motion vector of the first block, and the candidate motion vector for CP1 can be the motion vector of the second block.

[0308] Also, the first block can be a block that checks the surrounding blocks within the first group according to a first specific order and the first identified reference picture is the same as the reference picture of the current block. Here, when the reference picture of the first block within the first group is the same as the reference picture of the current block, a candidate motion vector for CP0 can be available. Also, for example, the first group includes surrounding block A, surrounding block B, and surrounding block C, and the first specific order can be the order from surrounding block A to surrounding block B and surrounding block C.

[0309] Further, the second block may be a block in which the peripheral blocks within the second group are checked according to a second specific order, and the reference picture confirmed first is the same as the reference picture of the current block. Here, when the reference picture of the second block within the second group is the same as the reference picture of the current block, the candidate motion vector for CP1 is available. Also, for example, the second group may include a peripheral block D and a peripheral block E, and the second specific order may be the order from the peripheral block D to the peripheral block E.

[0310] On the other hand, when the size of the current block is W×H and the x component of the top-left sample position of the current block is 0 and the y component is 0, the peripheral block A may be a block including samples at (-1, -1) coordinates, the peripheral block B may be a block including samples at (0, -1) coordinates, the peripheral block C may be a block including samples at (-1, 0) coordinates, the peripheral block D may be a block including samples at (W - 1, -1) coordinates, and the peripheral block E may be a block including samples at (W, -1) coordinates. That is, the peripheral block A may be the upper left corner peripheral block of the current block, the peripheral block B may be the leftmost upper peripheral block among the upper peripheral blocks of the current block, the peripheral block C may be the uppermost left peripheral block among the left peripheral blocks of the current block, the peripheral block D may be the rightmost upper peripheral block among the upper peripheral blocks of the current block, and the peripheral block E may be the upper right corner peripheral block of the current block.

[0311] On the other hand, when at least one of the candidate motion vectors of CP0 and the candidate motion vectors of CP1 is not available, the constructed affine MVP candidate may not be available.

[0312] Alternatively, for example, when a 6 affine motion model is applied to the current block, the CPs of the current block include CP0, CP1, and CP2. When candidate motion vectors for CP0 are available, candidate motion vectors for CP1 are available, and candidate motion vectors for CP2 are available, the constructed affine MVP candidate is available, and the affine MVP candidate list can include the constructed affine MVP candidate. Here, CP0 indicates the upper left position of the current block, CP1 indicates the upper right position of the current block, and CP2 indicates the lower left position of the current block.

[0313] The constructed affine MVP candidate includes candidate motion vectors for CP0, candidate motion vectors for CP1, and candidate motion vectors for CP2. The candidate motion vector for CP0 can be the motion vector of the first block, the candidate motion vector for CP1 can be the motion vector of the second block, and the candidate motion vector for CP2 can be the motion vector of the third block.

[0314] Also, the first block can be a block in which the reference picture that is first confirmed by checking the peripheral blocks in the first group according to the first specific order is the same as the reference picture of the current block. Here, when the reference picture of the first block in the first group is the same as the reference picture of the current block, candidate motion vectors for CP0 can be available. Also, for example, the first group includes peripheral block A, peripheral block B, and peripheral block C, and the first specific order can be the order from peripheral block A to peripheral block B and peripheral block C.

[0315] Further, the second block may be a block in which the reference picture first confirmed by checking the peripheral blocks in the second group according to the second specific order is the same as the reference picture of the current block. Here, when the reference picture of the second block in the second group is the same as the reference picture of the current block, the candidate motion vector for the CP1 can be used. Also, for example, the second group may include a peripheral block D and a peripheral block E, and the second specific order may be the order from the peripheral block D to the peripheral block E.

[0316] Further, the third block may be a block in which the reference picture first confirmed by checking the peripheral blocks in the third group according to the third specific order is the same as the reference picture of the current block. Here, when the reference picture of the third block in the third group is the same as the reference picture of the current block, the candidate motion vector for the CP2 can be used. Also, for example, the third group may include a peripheral block F and a peripheral block G, and the third specific order may be the order from the peripheral block F to the peripheral block G.

[0317] On the one hand, when the size of the current block is W×H and the x component of the top-left sample position of the current block is 0 and the y component is 0, the surrounding block A can be a block including a sample at the (-1, -1) coordinate, the surrounding block B can be a block including a sample at the (0, -1) coordinate, the surrounding block C can be a block including a sample at the (-1, 0) coordinate, the surrounding block D can be a block including a sample at the (W - 1, -1) coordinate, the surrounding block E can be a block including a sample at the (W, -1) coordinate, the surrounding block F can be a block including a sample at the (-1, H - 1) coordinate, and the surrounding block G can be a block including a sample at the (-1, H) coordinate. That is, the surrounding block A can be the upper-left corner surrounding block of the current block, the surrounding block B can be the leftmost upper surrounding block among the upper surrounding blocks of the current block, the surrounding block C can be the uppermost left surrounding block among the left surrounding blocks of the current block, the surrounding block D can be the rightmost upper surrounding block among the upper surrounding blocks of the current block, the surrounding block E can be the upper-right corner surrounding block of the current block, the surrounding block F can be the lowermost left surrounding block among the left surrounding blocks of the current block, and the surrounding block G can be the lower-left corner surrounding block of the current block.

[0318] On the other hand, when at least one of the candidate motion vectors of CP0, the candidate motion vector of CP1, and the candidate motion vector of CP2 is not available, the constructed affine MVP candidate may not be available.

[0319] Or, for example, when a 4-affin motion model is applied to the current block, CP is selected based on the width and height of the current block, and the constructed affine MVP candidate includes the candidate motion vector for the selected CP.

[0320] As an example, when the width of the current block is greater than or equal to the height, the CPs of the current block include CP0 and CP1. If the candidate motion vector for CP0 is available and the candidate motion vector for CP1 is available, the constructed affine MVP candidate is available, and the affine MVP candidate list can include the constructed affine MVP candidate. Here, CP0 indicates the upper left position of the current block, and CP1 indicates the upper right position of the current block.

[0321] The constructed affine MVP candidate includes the candidate motion vector for CP0 and the candidate motion vector for CP1. The candidate motion vector for CP0 can be the motion vector of the first block, and the candidate motion vector for CP1 can be the motion vector of the second block.

[0322] Also, the first block can be a block that checks the surrounding blocks in the first group according to a first specific order and the first identified reference picture is the same as the reference picture of the current block. Here, when the reference picture of the first block in the first group is the same as the reference picture of the current block, the candidate motion vector for CP0 can be available. Also, for example, the first group includes surrounding block A, surrounding block B, and surrounding block C, and the first specific order can be the order from surrounding block A to surrounding block B and then to surrounding block C.

[0323] Also, the second block can be a block that checks the surrounding blocks in the second group according to a second specific order and the first identified reference picture is the same as the reference picture of the current block. Here, when the reference picture of the second block in the second group is the same as the reference picture of the current block, the candidate motion vector for CP1 can be available. Also, for example, the second group includes surrounding block D and surrounding block E, and the second specific order can be the order from surrounding block D to surrounding block E.

[0324] On one hand, when the size of the current block is W×H and the x-component of the top-left sample position of the current block is 0 and the y-component is 0, the peripheral block A may be a block including a sample at the (-1, -1) coordinate, the peripheral block B may be a block including a sample at the (0, -1) coordinate, the peripheral block C may be a block including a sample at the (-1, 0) coordinate, the peripheral block D may be a block including a sample at the (W - 1, -1) coordinate, and the peripheral block E may be a block including a sample at the (W, -1) coordinate. That is, the peripheral block A may be a peripheral block around the upper left corner of the current block, the peripheral block B may be the leftmost upper peripheral block among the upper peripheral blocks of the current block, the peripheral block C may be the uppermost left peripheral block among the left peripheral blocks of the current block, the peripheral block D may be the rightmost upper peripheral block among the upper peripheral blocks of the current block, and the peripheral block E may be a peripheral block around the upper right corner of the current block.

[0325] When at least one of the candidate motion vectors of the CP0 and the candidate motion vectors of the CP1 is unavailable, the constructed affine MVP candidate may be unavailable.

[0326] Also, when the width of the current block is smaller than the height, the current block may include the CP0 and CP2. When the candidate motion vector for the CP0 is available and the candidate motion vector for the CP2 is available, the constructed affine MVP candidate is available, and the affine MVP candidate list includes the constructed affine MVP candidate. Here, the CP0 indicates the upper left position of the current block, and the CP2 indicates the lower left position of the current block.

[0327] The constructed affinity MVP candidate includes a candidate motion vector for the CP0 and a candidate motion vector for the CP2. The candidate motion vector for the CP0 can be a motion vector of the first block, and the candidate motion vector for the CP2 can be a motion vector of the third block.

[0328] Also, the first block can be a block that checks the surrounding blocks within the first group according to a first specific order and the first identified reference picture is the same as the reference picture of the current block. Here, when the reference picture of the first block within the first group is the same as the reference picture of the current block, the candidate motion vector for the CP0 is available. Also, for example, the first group includes surrounding block A, surrounding block B, and surrounding block C, and the first specific order can be the order from the surrounding block A to the surrounding block B and the surrounding block C.

[0329] Also, the third block can be a block that checks the surrounding blocks within the third group according to a third specific order and the first identified reference picture is the same as the reference picture of the current block. Here, when the reference picture of the third block within the third group is the same as the reference picture of the current block, the candidate motion vector for the CP2 is available. Also, for example, the third group includes surrounding block F and surrounding block G, and the third specific order can be the order from the surrounding block F to the surrounding block G.

[0330] On one hand, when the size of the current block is W×H and the x component of the top-left sample position of the current block is 0 and the y component is 0, the surrounding block A may be a block including samples at coordinates (-1, -1), the surrounding block B may be a block including samples at coordinates (0, -1), the surrounding block C may be a block including samples at coordinates (-1, 0), the surrounding block F may be a block including samples at coordinates (-1, H - 1), and the surrounding block G may be a block including samples at coordinates (-1, H). That is, the surrounding block A may be the upper-left corner surrounding block of the current block, the surrounding block B may be the leftmost upper surrounding block among the upper surrounding blocks of the current block, the surrounding block C may be the uppermost left surrounding block among the left surrounding blocks of the current block, the surrounding block F may be the lowermost left surrounding block among the left surrounding blocks of the current block, and the surrounding block G may be the lower-right corner surrounding block of the current block.

[0331] If at least one of the candidate motion vectors of CP0 and the candidate motion vectors of CP2 is unavailable, the constructed affine MVP candidate may be unavailable.

[0332] Also, as an example, the affine MVP candidate list includes inherited affine MVP candidates.

[0333] The inherited affine MVP candidates are derived based on specific blocks within the surrounding blocks of the current block. Here, the specific blocks are coded in the affine motion model, and the reference picture of the specific blocks may be the same as the reference picture of the current block.

[0334] Here, the specific block may be a block that checks the peripheral blocks in a specific order and satisfies the condition confirmed first. The condition may be coded in an affine motion model and may be that the reference picture of the block is the same as the reference picture of the current block. For example, the decoding device checks whether the peripheral blocks satisfy the condition in the specific order, derives the specific block that satisfies the condition first, and derives the inherited affine MVP candidate based on the specific block.

[0335] Specifically, for example, the decoding device can derive a motion vector for the CP of the current block based on the affine motion model of the specific block, and derive the inherited affine MVP candidate including the motion vector as a CPMVP candidate. The affine motion model is derived as in the above-mentioned Equation 1 or Equation 3.

[0336] Here, the peripheral blocks include the left peripheral block, upper peripheral block, upper right peripheral block, lower left peripheral block, and upper left peripheral block of the current block. For example, if the size of the current block is W×H and the x component of the top-left sample position of the current block is 0 and the y component is 0, the left peripheral block may be a block including samples at coordinates (-1, H-1), the upper peripheral block may be a block including samples at coordinates (W-1, -1), the upper right peripheral block may be a block including samples at coordinates (W, -1), the lower left peripheral block may be a block including samples at coordinates (-1, H), and the upper left peripheral block may be a block including samples at coordinates (-1, -1).

[0337] On the other hand, when a number of affine MVP candidates smaller than two are derived through the above-mentioned process, the affine MVP candidates include the MVP candidates in the existing HEVC standard.

[0338] That is, for example, when a smaller number of affine MVP candidates than two are derived through the above-described process, the decoding device can derive MVP candidates in the existing HEVC standard.

[0339] On the other hand, the affine motion model applied to the current block is derived based on the affine type information. For example, the affine type information indicates the affine motion model applied to the current block. That is, the affine type information can indicate whether the affine motion model applied to the current block is a 4-affine motion model or a 6-affine motion model. The affine type information can be obtained through the bitstream. The image information includes the affine type information.

[0340] The decoding device derives CPMVP (Control Point Motion Vector Predictors) for the CP (Control Point) of the current block based on the affine MVP candidate list (S2220).

[0341] The decoding device selects a specific affine MVP candidate from among the affine MVP candidates included in the affine MVP candidate list, and derives the selected affine MVP candidate as the CPMVP for the CP of the current block. For example, the decoding device obtains the affine MVP candidate index for the current block from the bitstream, and derives, as the CPMVP candidate for the CP of the current block, the affine MVP candidate indicated by the affine MVP candidate index among the affine MVP candidates included in the affine MVP candidate list. Specifically, when the affine MVP candidate includes a candidate motion vector for CP0 and a candidate motion vector for CP1, the candidate motion vector for CP0 of the affine MVP candidate is derived as the CPMVP for CP0, and the candidate motion vector for CP1 of the affine MVP candidate is derived as the CPMVP for CP1. Also, when the affine MVP candidate includes a candidate motion vector for CP0, a candidate motion vector for CP1, and a candidate motion vector for CP2, the candidate motion vector for CP0 of the affine MVP candidate is derived as the CPMVP for CP0, and the candidate motion vector for CP2 of the affine MVP candidate can be derived as the CPMVP for CP1. Also, when the affine MVP candidate includes a candidate motion vector for CP0 and a candidate motion vector for CP2, the candidate motion vector for CP0 of the affine MVP candidate is derived as the CPMVP for CP0, and the candidate motion vector for CP2 of the affine MVP candidate is derived as the CPMVP for CP2.

[0342] The decoding device derives CPMVD (Control Point Motion Vector Differences) for the CP of the current block based on the motion prediction information (S2230). The motion prediction information includes information regarding CPMVD for each of the CPs, and the decoding device derives the CPMVD for each of the CPs of the current block based on the information regarding CPMVD for each of the CPs.

[0343] The decoding device derives CPMV (Control Point Motion Vectors) for the CP of the current block based on the CPMVP and the CPMVD (S2240). The decoding device derives CPMV for each CP based on the CPMVP and the CPMVD for each CP. For example, the decoding device adds the CPMVP and the CPMVD for each CP to derive the CPMV for the CP.

[0344] The decoding device derives a prediction sample for the current block based on the CPMV (S2250). The decoding device derives a motion vector in units of sub-blocks or samples of the current block based on the CPMV. That is, the decoding device derives a motion vector for each sub-block or each sample of the current block based on the CPMV. The motion vector in units of sub-blocks or samples is derived based on the aforementioned Equation 1 or Equation 3. The motion vector can be represented as an affine motion vector field (MVF) or a motion vector array.

[0345] The decoding device derives a prediction sample for the current block based on the motion vector in units of sub-blocks or samples. The decoding device can derive a reference region in a reference picture based on the motion vector in units of sub-blocks or samples, and generate a prediction sample of the current block based on the restored samples in the reference region.

[0346] The decoding device generates a reconstructed picture for the current block based on the derived prediction sample (S2260). The decoding device generates a reconstructed picture for the current block based on the derived prediction sample. The decoding device can immediately use the prediction sample as a reconstructed sample according to the prediction mode, or can also generate a reconstructed sample by adding a residual sample to the prediction sample. When there is a residual sample for the current block, the decoding device acquires information about the residual for the current block from the bitstream. The information about the residual includes transform coefficients related to the residual sample. The decoding device derives the residual sample (or residual sample array) for the current block based on the residual information. The decoding device generates a reconstructed sample based on the prediction sample and the residual sample, and derives a reconstructed block or a reconstructed picture based on the reconstructed sample. Thereafter, as described above, the decoding device can apply in-loop filtering procedures such as deblocking filtering and / or SAO procedures to the reconstructed picture to improve subjective / objective picture quality as necessary.

[0347] FIG. 23 schematically shows a decoding device that performs the image decoding method accompanying this document. The method disclosed in FIG. 22 can be performed by the decoding device disclosed in FIG. 23. Specifically, for example, the entropy decoding unit of the decoding device in FIG. 23 performs S2200 in FIG. 22, the prediction unit of the decoding device in FIG. 23 performs S2210 to S2250 in FIG. 22, and the addition unit of the decoding device in FIG. 23 performs S2260 in FIG. 22. Also, although not shown, the process of acquiring image information including information about the residual of the current block via the bitstream is performed by the entropy decoding unit of the decoding device in FIG. 23, and the process of deriving the residual sample for the current block based on the residual information is performed by the inverse transform unit of the decoding device in FIG. 23.

[0348] According to the foregoing document, the efficiency of image coding based on affine motion prediction can be improved.

[0349] Also, according to the present document, when deriving an affine MVP candidate list, the constructed affine MVP candidates can be added only when all the candidate motion vectors for the CP of the constructed affine MVP candidates are available. Thereby, the complexity of the process of deriving the constructed affine MVP candidates and the process of constructing the affine MVP candidate list can be reduced, and the coding efficiency can be improved.

[0350] In the foregoing embodiments, the method is described based on a flowchart as a series of steps or blocks. However, the present document is not limited to the order of the steps, and a certain step may occur in a different order from the steps described above or simultaneously. Also, those skilled in the art will understand that the steps shown in the flowchart are not exclusive, and other steps may be included, or one or more steps of the flowchart can be deleted without affecting the scope of the present document.

[0351] The embodiments described in the present document are implemented and performed on a processor, a microprocessor, a controller, or a chip. For example, the functional units shown in each figure are implemented and performed on a computer, a processor, a microprocessor, a controller, or a chip. In this case, the information for implementation (for example, information on instructions) or algorithms can be stored in a digital storage medium.

[0352] In addition, the decoding device and the encoding device to which this document is applicable can be included in multimedia broadcast transmission / reception devices, mobile communication terminals, home cinema video devices, digital cinema video devices, surveillance cameras, video conferencing devices, real-time communication devices such as video communication, mobile streaming devices, storage media, camcorders, pay-per-view (VoD) service providing devices, over-the-top (OTT) devices, Internet streaming service providing devices, three-dimensional (3D) video devices, virtual reality (VR) devices, augmented reality (AR) devices, picture phone video devices, transportation means terminals (e.g., vehicle (including autonomous driving vehicle) terminals, airplane terminals, ship terminals, etc.) and medical video devices, etc., and can be used to process video signals and data signals. For example, OTT video devices include game consoles, Blu-ray players, Internet-connected TVs, home theater systems, smartphones, tablet PCs, digital video recorders (DVRs), etc.

[0353] In addition, the processing method to which this document is applicable can be produced in the form of a program executed by a computer and can be stored in a computer-readable recording medium. Multimedia data having the data structure according to the present invention can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium can include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy (registered trademark) disk, and an optical data storage device. Further, the computer-readable recording medium includes a medium realized in the form of a carrier wave (for example, transmission via the Internet). Also, a bitstream generated by an encoding method can be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.

[0354] In addition, the embodiments of this document are realized as a computer program product by program code, and the program code is executed in a computer according to the embodiments of the present invention. The program code can be stored on a computer-readable carrier.

[0355] FIG. 24 exemplarily shows a content streaming system structure diagram to which this document is applicable.

[0356] The content streaming system to which this document is applicable includes an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0357] The encoding server compresses the content input from multimedia input devices such as smartphones, cameras, and video cameras into digital data to generate a bitstream, and plays the role of transmitting this to the streaming server. As another example, when multimedia input devices such as smartphones, cameras, and camcorders directly generate a bitstream, the encoding server may be omitted.

[0358] The bitstream is generated by an encoding method or a bitstream generation method to which the present disclosure is applied, and the stream server can temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0359] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server plays the role of a medium for informing the user of what services are available. When the user requests a desired service from the web server, the web server transmits this to the streaming server, and the streaming server transmits multimedia data to the user. Here, the content streaming system may include a separate control server. In this case, the control server plays the role of controlling commands / responses between each device in the content streaming system.

[0360] The streaming server receives content from a media storage and / or an encoding server. For example, when receiving content from the encoding server, the content can be received in real time. In this case, in order to provide a smooth streaming service, the streaming server can store the bitstream for a certain period of time.

[0361] Examples of the user device may include a mobile phone, a smart phone, a laptop computer, a digital broadcast terminal, a PDA (personal digital assistants), a PMP (portable multimedia player), a navigation device, a slate PC, a tablet PC, an ultrabook, a wearable device (e.g., a smartwatch, smart glass, HMD (head mounted display)), a digital TV, a desktop computer, a digital signage, and the like. Each server in the content streaming system can be operated as a distributed server, and in this case, the data received by each server can be distributedly processed.

Claims

1. 1. An image decoding method performed by a decoding device, comprising: obtaining motion prediction information for a current block from a bitstream; determining whether there is an available motion vector for control point 0 (CP0) based on the first group of surrounding blocks; determining whether there is an available motion vector for control point 1 (CP1) based on the second group of surrounding blocks; determining whether there is an available motion vector for control point 2 (CP2) based on a third group of surrounding blocks; deriving constructed affine motion vector predictor (MVP) candidates that include available motion vectors for control points (CPs); constructing an affine MVP candidate list for the current block; deriving control point motion vector predictors (CPMVPs) for the CPs of the current block based on the affine MVP candidate list; deriving control point motion vector differentials (CPMVDs) for the CPs of the current block based on the motion prediction information; deriving control point motion vectors (CPMVs) for the CPs of the current block based on the CPMVPs and the CPMVDs; deriving predicted samples for the current block based on the CPMVs; generating a reconstructed picture for the current block based on the derived prediction samples; The CP0 is located at the top left corner of the current block, the CP1 is located at the top right corner of the current block, and the CP2 is located at the bottom left corner of the current block; Based on the reference picture of a neighboring block in a particular neighboring block group being the same as the reference picture of the current block, the motion vector of the neighboring block is determined as an available motion vector for a CP associated with the particular neighboring block group; the constructed affine MVP candidate is an affine MVP candidate that configures the available motion vector derived from the first surrounding block group as a CPMVP for the CP0, the available motion vector derived from the second surrounding block group as a CPMVP for the CP1, and the available motion vector derived from the third surrounding block group as a CPMVP for the CP2; based on the availability of the constructed affine MVP candidate, the affine MVP candidate list includes the constructed affine MVP candidate; the constructed affine MVP candidate is available only based on the existence of all of the available motion vectors for the CP0, the available motion vectors for the CP1, and the available motion vectors for the CP2; the constructed affine MVP candidate is unavailable based on the absence of at least one of the available motion vector for the CP0, the available motion vector for the CP1, and the available motion vector for the CP2; The image decoding method, wherein the constructed affine MVP candidate is not included in the affine MVP candidate list based on the absence of at least one of the available motion vector for the CP0, the available motion vector for the CP1, and the available motion vector for the CP2.

2. 1. A method of image encoding performed by an encoding device, comprising: determining whether there is an available motion vector for control point 0 (CP0) based on the first group of surrounding blocks; determining whether there is an available motion vector for control point 1 (CP1) based on the second group of surrounding blocks; determining whether there is an available motion vector for control point 2 (CP2) based on a third group of surrounding blocks; deriving constructed affine motion vector predictor (MVP) candidates that include available motion vectors for control points (CPs); constructing an affine MVP candidate list for the current block; deriving control point motion vector predictors (CPMVPs) for the CPs of the current block based on the affine MVP candidate list; deriving control point motion vectors (CPMVs) for the CPs of the current block; deriving control point motion vector differentials (CPMVDs) for the CPs of the current block based on the CPMVPs and the CPMVs; encoding motion prediction information including information regarding the CPMVDs; The CP0 is located at the top left corner of the current block, the CP1 is located at the top right corner of the current block, and the CP2 is located at the bottom left corner of the current block; Based on the reference picture of a neighboring block in a particular neighboring block group being the same as the reference picture of the current block, the motion vector of the neighboring block is determined as an available motion vector for a CP associated with the particular neighboring block group; the constructed affine MVP candidate is an affine MVP candidate that configures the available motion vector derived from the first surrounding block group as a CPMVP for the CP0, the available motion vector derived from the second surrounding block group as a CPMVP for the CP1, and the available motion vector derived from the third surrounding block group as a CPMVP for the CP2; based on the availability of the constructed affine MVP candidate, the affine MVP candidate list includes the constructed affine MVP candidate; the constructed affine MVP candidate is available only based on the existence of all of the available motion vectors for the CP0, the available motion vectors for the CP1, and the available motion vectors for the CP2; the constructed affine MVP candidate is unavailable based on the absence of at least one of the available motion vector for the CP0, the available motion vector for the CP1, and the available motion vector for the CP2; The image encoding method, wherein the constructed affine MVP candidate is not included in the affine MVP candidate list based on the absence of at least one of the available motion vector for the CP0, the available motion vector for the CP1, and the available motion vector for the CP2.

3. A method for transmitting data for an image, comprising: obtaining a bitstream for the image, the bitstream comprising: determining, based on a first surrounding block group, whether there is an available motion vector for control point 0 (CP0); determining, based on a second surrounding block group, whether there is an available motion vector for control point 1 (CP1); determining, based on a third surrounding block group, whether there is an available motion vector for control point 2 (CP2); and generating a constructed affine motion vector including the available motion vectors for the control points (CPs). deriving control point motion vector predictors (CPMVPs) for the CPs of the current block based on the affine MVP candidate list; deriving control point motion vectors (CPMVS) for the CPs of the current block based on the affine MVP candidate list; deriving control point motion vector differentials (CPMVDs) for the CPs of the current block based on the CPMVPs and the CPMVS; and encoding motion prediction information including information on the CPMVDs. transmitting the data including the bitstream; The CP0 is located at the top left corner of the current block, the CP1 is located at the top right corner of the current block, and the CP2 is located at the bottom left corner of the current block; Based on the reference picture of a neighboring block in a particular neighboring block group being the same as the reference picture of the current block, the motion vector of the neighboring block is determined as an available motion vector for a CP associated with the particular neighboring block group; the constructed affine MVP candidate is an affine MVP candidate that configures the available motion vector derived from the first surrounding block group as a CPMVP for the CP0, the available motion vector derived from the second surrounding block group as a CPMVP for the CP1, and the available motion vector derived from the third surrounding block group as a CPMVP for the CP2; based on the availability of the constructed affine MVP candidate, the affine MVP candidate list includes the constructed affine MVP candidate; the constructed affine MVP candidate is available only based on the existence of all of the available motion vectors for the CP0, the available motion vectors for the CP1, and the available motion vectors for the CP2; the constructed affine MVP candidate is unavailable based on the absence of at least one of the available motion vector for the CP0, the available motion vector for the CP1, and the available motion vector for the CP2; A transmission method, wherein the constructed affine MVP candidate is not included in the affine MVP candidate list based on the absence of at least one of the available motion vector for CP0, the available motion vector for CP1, and the available motion vector for CP2.

Citation Information

Patent Citations

  • Motion vector prediction for affine motion models in video coding

    US20180098063A1

  • Motion vector generation for affine motion model for video coding

    US20180192069A1

  • Method and apparatus for affine merge mode prediction for video coding system

    WO2017118409A1

  • Method and apparatus of video coding with affine motion compensation

    WO2017148345A1