Image decoding method and apparatus based on affine motion prediction using constructed affine MVP candidates in an image coding system

The image decoding method constructs affine motion vector predictors to enhance coding efficiency for high-resolution images, addressing the increased costs associated with high-quality image transmission and storage.

JP7795022B2Active Publication Date: 2026-01-06LG ELECTRONICS INC
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The increasing demand for high-resolution, high-quality images leads to higher transmission and storage costs due to increased data volume, necessitating improved image coding efficiency.

Method used

An image decoding method that constructs affine motion vector predictor candidates based on surrounding blocks and performs prediction using a constructed affine MVP candidate list, deriving Control Point Motion Vector Predictors and Differences to generate a reconstructed picture.

Benefits of technology

This approach enhances image/video compression efficiency by reducing complexity and improving coding efficiency through selective construction of affine MVP candidates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007795022000012
    Figure 0007795022000012
  • Figure 0007795022000013
    Figure 0007795022000013
  • Figure 0007795022000014
    Figure 0007795022000014
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 techniques, and more particularly to a method and apparatus for video decoding based on affine motion prediction in a video coding system. [Background technology]

[0002] Recently, demand for high-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images has been increasing in various fields. As the resolution and quality of image data increases, the amount of information or bits to be transmitted increases relatively compared to conventional image data. Therefore, when transmitting image data using a medium such as a conventional wired or wireless broadband line or storing image data using a conventional storage medium, transmission costs and storage costs increase.

[0003] Therefore, highly efficient video compression technology is required to effectively transfer, store, and play back high-resolution, high-quality video information. Summary of the Invention [Problem 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 derives constructed affine MVP candidates based on surrounding blocks only when all candidate motion vectors for a CP are available, constructs an affine MVP candidate list for the current block, and performs prediction for the current block based on the constructed affine MVP candidate list. [Means for solving the problem]

[0006] According to an embodiment of the present document, there is provided an image decoding method performed by a decoding device, the method including the 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 (CPMVP) for a Control Point (CP) of the current block based on the affine MVP candidate list; deriving Control Point Motion Vector Differences (CPMVD) for the CP of the current block based on the motion prediction information; and deriving Control Point Motion Vector Differences (CPMVD) for the CP of the current block based on the CPMVP and the CPMVD. and generating a reconstructed picture for the current block based on the derived prediction samples, wherein if 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 if the candidate motion vector is available.

[0007] According to another embodiment of the present document, there is provided a decoding device for performing image decoding. The decoding apparatus includes an entropy decoding unit that obtains motion prediction information for a current block from a bitstream; a prediction unit that constructs an affine motion vector predictor (MVP) candidate list for the current block, derives control point motion vector predictors (CPMVPs) for a control point (CPMVP) 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 (CPMVDs) for the CP of the current block based on the CPMVP and the CPMVDs, and derives prediction samples for the current block based on the CPMV; and an adder that generates a reconstructed picture for the current block based on the derived prediction samples. The constructed affine MVP candidate is available if the candidate motion vector is available.

[0008] According to yet another embodiment of the present document, there is provided a video encoding method performed by an encoding device. The method includes the 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 CPMVs; and encoding motion prediction information including information on the CPMVDs, wherein if 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 if the candidate motion vector is available.

[0009] According to yet another embodiment of the present document, a video encoding device is provided. The encoding apparatus includes a prediction unit that configures 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 derives control point motion vector differences (CPMVDs) for the CP of the current block based on the CPMVP and the CPMV, a subtraction unit that derives control point motion vector differences (CPMVDs) for the CP of the current block based on the CPMVP and the CPMV, and an entropy encoding unit that encodes motion prediction information including information on the CPMVDs. If constructed affine MVP candidates are available, the affine MVP candidate list includes the constructed affine MVP candidates, and the constructed affine MVP candidates are candidate motion vectors for the CP. The constructed affine MVP candidate is available if the candidate motion vector is available. [Effects of the Invention]

[0010] This document can improve the overall image / video compression efficiency.

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

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

[0013] [Figure 1] 1 is a diagram illustrating the configuration of a video encoding device to which the present document can be applied; [Figure 2] 1 is a diagram illustrating the configuration of a video decoding device to which the present document can be applied; [Figure 3] 10 illustrates an example of motion represented through the affine motion model. [Figure 4] 1 shows an example of the affine motion model in which motion vectors for three control points are used. [Figure 5] 1 exemplarily illustrates the affine motion model in which motion vectors for two control points are used. [Figure 6] A method for deriving a motion vector in sub-block units based on the affine motion model will now be described as an example. [Figure 7] 1 exemplarily illustrates a flowchart of an affine motion prediction method according to one embodiment of the present document; [Figure 8] FIG. 1 illustrates a method for deriving motion vector predictors at control points according to an embodiment of the present document. [Figure 9] FIG. 1 illustrates a method for deriving motion vector predictors at control points according to an embodiment of the present document. [Figure 10] 10 shows an example of affine prediction performed when a neighboring block A is selected as an affine merge candidate. [Figure 11]10 exemplarily shows neighboring blocks for deriving the inherited affine candidates. [Figure 12] 10 shows an example of spatial candidates for the constructed affine candidates. [Figure 13] An example of constructing an affine MVP list is shown below. [Figure 14] An example of deriving the constructed candidates will be shown below. [Figure 15] An example of deriving the constructed candidates will be shown below. [Figure 16] An example of deriving the constructed candidates when four affine motion models are applied to the current block will be described below. [Figure 17] An example of deriving the constructed candidates when six affine motion models are applied to the current block will be described below. [Figure 18] An example of deriving constructed candidates including a CPMVP for a CP adaptively selected based on the width and height of the current block will now be described. [Figure 19] An example of deriving constructed candidates for the current block is shown below. [Figure 20] 1 illustrates a schematic diagram of an image encoding method using an encoding device according to this document. [Figure 21] 1 shows a schematic representation of an encoding device for performing an image encoding method according to the present document; [Figure 22] 1 illustrates a schematic diagram of an image decoding method by a decoding device according to the present document. [Figure 23] 1 shows a schematic diagram of a decoding device for performing an image decoding method according to the present document; [Figure 24] 1 illustrates an exemplary structural diagram of a content streaming system to which this document applies. DETAILED DESCRIPTION OF THE INVENTION

[0014] Because this document may be modified in various ways and may have various embodiments, a specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit this document to the specific embodiment. Common terms used in this document are used to describe specific embodiments, but are not intended to limit the technical ideas of this document. The singular includes the plural unless the context clearly dictates otherwise. In this specification, the terms "comprise" or "have" are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0015] Meanwhile, the components in the drawings described in this document are shown independently for the convenience of describing their distinct characteristic functions, and do not necessarily mean that the components are implemented by separate hardware or software. For example, two or more of the components may be combined to form a single component, or a single component may be divided into multiple components. Embodiments in which the components are integrated and / or separated are also within the scope of this document, provided they do not deviate from the essence of this document.

[0016] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Hereinafter, the same components in the drawings will be designated by the same reference numerals, and duplicated descriptions of the same components will be omitted.

[0017] In this specification, video may refer to a series of images over time. A picture is generally a unit representing one image at a specific time, and a slice is a unit constituting a part of a picture in coding. A picture may be composed of multiple slices or tile groups, and the terms picture, slice, and tile group may be used interchangeably as needed. In this specification, an image may refer to a still image or to an image over time constituting a video. Hereinafter, image coding may be used interchangeably with video coding. Image coding may also be used interchangeably with picture coding or frame coding.

[0018] A pixel or a pel can refer to the smallest unit that makes up a picture (or an image). A term corresponding to a pixel is "sample." A sample can generally indicate a pixel or a pixel value, or can indicate only a pixel / pixel value of a luma component, or can indicate only a pixel / pixel value of a chroma component.

[0019] A unit refers to a basic unit of image processing. A unit includes at least one of a specific region of a picture and information about that region. The term "unit" may be used interchangeably with terms such as "block" or "area." Alternatively, a unit may include a luma component block and a chroma component (cb, cr) block. In a general case, an MxN block refers to a set of samples or transform coefficients consisting of M columns and N rows.

[0020] 1 is a diagram for explaining the schematic configuration of a video / image encoding device to which this document can be applied. Hereinafter, the video encoding device may include an image encoding device.

[0021] 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 subtractor 121, a transform module 122, a quantization module 123, a rearrangement module 124, a dequantization module 125, and an inverse transform module 126.

[0022] The picture division unit 105 can divide an input picture into at least one processing unit.

[0023] For example, the processing unit may be referred to as a coding unit (CU). In this case, the coding units are recursively divided from the largest coding unit (LCU) according to a QTBT (Quad-tree Binary-tree) structure. For example, one coding unit may be divided into multiple coding units of deeper depths 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 then the binary tree structure and the ternary tree structure may be applied later. Alternatively, the binary tree structure / ternary tree structure may be applied first. The coding procedure according to this document may be performed based on the final coding unit that is not further divided. In this case, the largest coding unit may be immediately used as the final coding unit based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as needed, and the coding unit of the optimal size may be used as the final coding unit. Here, the coding procedure includes prediction, conversion, and restoration procedures, 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 units are split from the largest coding unit (LCU) to deeper coding units according to a quadtree structure. In this case, the largest coding unit may be directly used as the final coding unit based on coding efficiency according to image characteristics, or the coding unit may be recursively split into coding units of lower depths as needed, and the coding unit with the optimal size may be used as the final coding unit. When a 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 refers to a coding unit that is a base for partitioning or dividing into prediction units or transform units. The prediction unit is a unit partitioned from the coding unit and may be a unit of sample prediction. Here, the prediction unit may be divided into sub-blocks. The transform unit may be divided from the coding unit according to a quadtree 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). A prediction block or a prediction unit refers to a specific region in a block form within a picture and may include an array of prediction samples.A transform block or transform unit refers to a specific region in a picture in block form and may include an array of transform coefficients or residual samples.

[0025] The prediction unit 110 performs prediction on a current block to be processed (hereinafter, referred to as a current block) and generates a predicted block including prediction samples for the current block. The unit of prediction performed by the prediction unit 110 may 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. For example, the prediction unit 110 may determine whether intra prediction or inter prediction is applied on a CU basis.

[0027] In the case of intra prediction, the prediction unit 110 may derive a prediction sample for a current block based on a reference sample outside the current block within a picture to which the current block belongs (hereinafter, the current picture). Here, the prediction unit 110 may (i) derive a prediction sample based on an average or interpolation of neighboring reference samples of the current block, or (ii) derive a prediction sample based on a reference sample present in a specific (prediction) direction with respect to the prediction sample among the neighboring reference samples of the current block. (i) may be referred to as a non-directional mode or a non-angular mode, and (ii) may be referred to as a directional mode or an angular mode. In intra prediction, prediction modes may include, 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 may also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.

[0028] In the case of inter prediction, the predictor 110 may derive a predicted sample for the current block based on a sample identified by a motion vector on a reference picture. The predictor 110 may derive a predicted sample for the current block by applying any one of a skip mode, a merge mode, and a motion vector prediction (MVP) mode. In the skip mode and the merge mode, the predictor 110 may use motion information of a neighboring block as motion information of the current block. In the skip mode, unlike the merge mode, a difference (residual) between a predicted sample and an original sample is not transmitted. In the MVP mode, the motion vector of the current block may be derived by using a motion vector of a neighboring block as a motion vector predictor.

[0029] In the case of inter prediction, neighboring blocks include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in a reference picture. The reference picture including the temporal neighboring blocks may be called a collocated picture (colPic). 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 bitstream.

[0030] In skip mode and merge mode, when motion information of temporally neighboring blocks is used, the top picture on the reference picture list can be used as the reference picture. Reference pictures included in the reference picture list can be sorted based on the difference in picture order count (POC) between the current picture and the corresponding reference picture. POC corresponds to the display order of pictures and is distinct from the coding order.

[0031] The subtractor 121 generates residual samples, which are the differences between the original samples and the predicted samples. When the skip mode is applied, the residual samples may not be generated as described above.

[0032] The transform unit 122 transforms residual samples in units of transform blocks to generate transform coefficients. The transform unit 122 may perform the transform according to the size of the transform block and a prediction mode applied to a coding block or a prediction block spatially overlapping with the transform block. For example, if intra prediction is applied to the coding block or the prediction block overlapping with the transform block and the transform block is a 4x4 residual array, the residual samples may be transformed using a Discrete Sine Transform (DST) transform kernel; otherwise, the residual samples may be transformed using a Discrete Cosine Transform (DCT) transform kernel.

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

[0034] The rearrangement unit 124 rearranges the quantized transform coefficients. The rearrangement unit 124 can rearrange the quantized transform coefficients in a block format into a one-dimensional vector format using a coefficient scanning method. Although the rearrangement unit 124 has been described as a separate component, the rearrangement unit 124 may be a part of the quantization unit 123.

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

[0036] The inverse quantization unit 125 inversely quantizes the values ​​(quantized transformation coefficients) quantized by the quantization unit 123, and the inverse transform unit 126 inversely transforms the values ​​inversely quantized by the inverse quantization unit 125 to generate residual samples.

[0037] The adder 140 reconstructs a picture by combining residual samples and prediction samples. The residual samples and prediction samples may be added in block units to generate reconstructed blocks. Although the adder 140 has been described as a separate component, it may also be part of the prediction unit 110. Meanwhile, the adder 140 may also be referred to as a reconstruction module or a reconstructed block generator.

[0038] The filter unit 150 may apply a deblocking filter and / or a sample adaptive offset to the reconstructed picture. The deblocking filtering and / or the sample adaptive offset may correct artifacts at block boundaries in the reconstructed picture and distortions in the quantization process. The sample adaptive offset may be applied on a sample-by-sample basis or may be applied after the deblocking filtering process is completed. The filter unit 150 may also apply an adaptive loop filter (ALF) to the reconstructed picture. The ALF may be applied to the reconstructed picture after the deblocking filtering and / or the sample adaptive offset have been applied.

[0039] The memory 160 may store a reconstructed picture (decoded picture) or information required for encoding / decoding. Here, the reconstructed picture may be a reconstructed picture that has undergone a filtering procedure by the filter unit 150. The stored reconstructed picture may be used as a reference picture for (inter) prediction of another picture. For example, the memory 160 may store (reference) pictures used for inter prediction. Here, the pictures used for inter prediction may be specified by a reference picture set or a reference picture list.

[0040] 2 is a diagram outlining the configuration of a video / image decoding device to which this document can be applied. Hereinafter, the term "video decoding device" may include an image decoding device.

[0041] 2, the video decoding device 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. 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 device 200 also includes a receiver for receiving a bitstream containing video information. The receiver may be configured as a separate module or may be included in the entropy decoding module 210.

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

[0043] For example, the video decoding device 200 may perform video decoding using a processing unit applied in a video encoding device. Accordingly, a processing unit block for video decoding may be a coding unit, for example, or a coding unit, a prediction unit, or a transform unit, for example. The coding unit may be divided into a quad tree structure, a binary tree structure, and / or a ternary tree structure from a maximum coding unit.

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

[0045] The entropy decoding unit 210 may parse the bitstream and output information necessary for video or picture reconstruction. For example, the entropy decoding unit 210 may decode information in the bitstream based on a coding method such as Exponential-Golomb coding, CAVLC, or CABAC, and output values ​​of syntax elements necessary for video reconstruction and quantized values ​​of transform coefficients related to residuals.

[0046] More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element in a bitstream, determines a context model using information on the syntax element to be decoded and decode information on neighboring and target blocks to be decoded or information on symbols / bins decoded in a previous step, 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, the CABAC entropy decoding method can update the context model using information on the decoded symbols / bins for the context model of the next symbol / bin after determining the context model.

[0047] Among the information decoded by the entropy decoding unit 210, information related to prediction is provided to the prediction unit 230, and the residual values ​​entropy decoded by the entropy decoding unit 210, i.e., the quantized transform coefficients, are input to the reordering unit 221.

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

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

[0050] The inverse transform unit 223 inversely 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 prediction samples for the current block. The unit of prediction performed by the prediction unit 230 may 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 intra prediction or inter prediction may differ from the unit for generating prediction samples. Furthermore, the unit for generating prediction samples may also differ between inter prediction and intra prediction. For example, whether to apply inter prediction or intra prediction may be determined on a CU basis. Furthermore, for example, in inter prediction, a prediction mode may be determined on a PU basis and prediction samples may be generated, and in intra prediction, a prediction mode may be determined on a PU basis and prediction samples may be generated on a TU basis.

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

[0054] In the case of inter prediction, the prediction unit 230 may derive a prediction sample for the current block based on a sample identified on the reference picture by a motion vector on the reference picture. The prediction unit 230 may derive a prediction sample for the current block by applying any one of a skip mode, a merge mode, and an MVP mode. Here, motion information required for inter prediction of the current block provided in the video encoding device, such as information on a motion vector, a reference picture index, etc., may be obtained or induced based on information on the prediction.

[0055] In the skip mode and merge mode, motion information of neighboring blocks can be used as motion information of the current block, where neighboring blocks include spatial and temporal neighboring 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 skip mode and merge mode, the top picture on the reference picture list can be used as the reference picture.

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

[0058] In the MVP mode, the motion vector of the current block can be derived using the motion vectors of neighboring blocks as motion vector predictors, where the neighboring blocks include spatial and temporal neighboring blocks.

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

[0060] As another example, when a Motion Vector Prediction (MVP) mode is applied, a motion vector predictor candidate list may be generated using the motion vectors of the reconstructed spatially surrounding blocks and / or the motion vector corresponding to the Col block, which is a temporally surrounding block. That is, the motion vectors of the reconstructed spatially surrounding blocks and / or the motion vector corresponding to the Col block, which is a temporally surrounding block, may be used as motion vector candidates. The prediction information includes a predicted motion vector index indicating an optimal motion vector selected from the motion vector candidates included in the list. Here, the prediction unit 230 may select a predicted motion vector for the current block from the motion vector candidates included in the motion vector candidate list using the motion vector index. A prediction unit of the encoding device may obtain a motion vector differential (MVD) between the motion vector of the current block and a motion vector predictor, encode the MVD, and output it in the form of a bitstream. That is, the MVD is obtained by subtracting the motion vector predictor from the motion vector of the current block. Here, the prediction unit 230 may obtain the motion vector differential included in the prediction information and derive the motion vector of the current block by adding the motion vector differential and the motion vector predictor. The prediction unit may also obtain or derive from information relating to the prediction, for example, a reference picture index indicating a reference picture.

[0061] The adder 240 may reconstruct a current block or a current picture by adding residual samples and predicted samples. The adder 240 may also reconstruct a current picture by adding residual samples and predicted samples in block units. When a skip mode is applied, residuals are not transmitted, and predicted samples may be reconstructed samples. Although the adder 240 is described as a separate component here, the adder 240 may be part of the prediction unit 230. Meanwhile, the adder 240 may also be referred to as a reconstruction module or a reconstructed block generation module.

[0062] The filter unit 250 may apply deblocking filtering, sample adaptive offset, and / or ALF to the reconstructed picture. Here, the sample adaptive offset may be applied on a sample-by-sample basis or may be applied after deblocking filtering. The ALF may be applied after deblocking filtering and / or sample adaptive offset.

[0063] The memory 260 may store a reconstructed picture (decoded picture) or information required for decoding. Here, a reconstructed picture may be a reconstructed picture that has undergone a filtering procedure by the filter unit 250. For example, the memory 260 may store pictures used in inter prediction. Here, the pictures used in inter prediction may be specified by a reference picture set or a reference picture list. The reconstructed picture may be used as a reference picture for other pictures. In addition, the memory 260 may output the reconstructed pictures in an output order.

[0064] Meanwhile, in the case of inter prediction, an inter prediction method that takes image distortion into consideration has been proposed. Specifically, an affine motion model has been proposed that efficiently derives motion vectors for sub-blocks or sample points of a current block, thereby improving the accuracy of inter prediction despite deformations such as image rotation, zoom-in, or zoom-out. That is, an affine motion model has been proposed that derives motion vectors for sub-blocks or sample points of a current block. Prediction using the affine motion model may 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 motion, that is, four types of deformation, as will be described below.

[0066] 3 exemplarily illustrates motions represented using the affine motion model. Referring to FIG. 3, motions that can be represented using the affine motion model include translational motion, scaled motion, rotated motion, and sheared motion. That is, not only the translational motion in which an image (or a part thereof) moves planarly over time as shown in FIG. 3, but also the scaled motion in which an image (or a part thereof) is scaled over time, the rotational motion in which an image (or a part thereof) is rotated over time, and the sheared motion in which an image (or a part thereof) is equilibrium square-deformed over time can be efficiently represented through the affine inter-prediction.

[0067] The encoding / decoding device can predict the distortion type of the image based on the motion vector at the control point (CP) of the current block through the affine inter prediction, thereby improving the accuracy of prediction and thereby improving the image compression performance. Also, since the motion vector for at least one control point of the current block can be derived using the motion vectors of the neighboring blocks of the current block, the data amount burden for added side information can be reduced and the inter prediction efficiency can be significantly improved.

[0068] As an example of the affine inter-prediction, three control points, i.e., motion information at three reference points, may be required.

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

[0070] If the top-left sample position in the current block 400 is (0,0), the (0,0), (w,0), and (0,h) sample positions can be determined as the control points, as shown in Figure 4. Hereinafter, the control point at the (0,0) sample position can be expressed as CP0, the control point at the (w,0) sample position as CP1, and the control point at the (0,h) sample position as CP2.

[0071] Using the above-described 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.

[0072]

number

[0073] In the formula, w represents the width of the current block 400, h represents the height of the current block 400, and v 0x , v 0y represent the x and y components of the motion vector of CP0, respectively, and v 1x , v 1y represent the x and y components of the motion vector of CP1, respectively, and v 2x , v 2y represent the x and y components 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 is the x-component of the motion vector of the target sample in the current block 400, v y represents the y component of the motion vector of the target sample in the current block 400.

[0074] Since the motion vectors of CP0, CP1, and CP2 are known, a motion vector corresponding to the sample position in the current block can be derived based on Equation 1. That is, according to the affine motion model, the motion vector v0 (v 0x , v 0y ), v1(v 1x , v 1y ), v2(v 2x , v 2y ) is scaled, and a motion vector of the target sample according to the target sample position can be derived. That is, according to the affine motion model, a motion vector of each sample in the current block can be derived based on the motion vector of the control point. Meanwhile, a set of motion vectors of samples in the current block derived according to the affine motion model can be represented as an affine motion vector field (MVF).

[0075] Meanwhile, the six parameters for Equation 1 can be expressed as a, b, c, d, e, and f as follows, and the equation for the affine motion model expressed by the six parameters can be as follows:

[0076]

number

[0077] In the formula, w represents the width of the current block 400, h represents the height of the current block 400, and v 0x , v 0y represent the x and y components of the motion vector of CP0, respectively, and v 1x , v 1y represent the x and y components of the motion vector of CP1, respectively, and v 2x , v 2yrepresent the x and y components 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 is the x-component of the motion vector of the target sample in the current block 400, v y represents the y component of the motion vector of the target sample in the current block 400.

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

[0079] Also, as an example of the affine inter-prediction, two control points, i.e., motion information at two reference points, may be required.

[0080] 5 exemplarily illustrates 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, scaling motion, and rotational motion. The affine motion model representing three types of motion can be referred to as a similarity affine motion model or a simplified affine motion model.

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

[0082] Using the above-described 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] where w represents the width of the current block 500, and v 0x , v 0y represent the x and y components of the motion vector of CP0, respectively, and v 1x , v 1y represent the x and y components 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 in the current block 500, v y represents the y component of the motion vector of the target sample in the current block 500.

[0085] Meanwhile, the four parameters for Equation 3 can be expressed as a, b, c, and d as follows, and the equation for the affine motion model expressed by the four parameters can be as follows:

[0086]

number

[0087] where w represents the width of the current block 500, and v 0x , v 0y represent the x and y components of the motion vector of CP0, respectively, and v 1x , v 1yrepresent the x and y components 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 in the current block 500, v y represents the y-component of the motion vector of the target sample in the current block 500. Since the affine motion model using the two control points can be expressed by four parameters a, b, c, and d as in Equation 4, the affine motion model or the affine inter-prediction using the four parameters can be expressed as a four-parameter affine motion model or AF4. That is, according to the affine motion model, a motion vector for each sample in the current block can be derived based on the motion vector of the control point. Meanwhile, a set of motion vectors of samples in the current block derived according to the affine motion model can be expressed as an affine motion vector field (MVF).

[0088] Meanwhile, as described above, the accuracy of inter-prediction can be significantly improved by deriving a motion vector per sample through the affine motion model, but in this case, the complexity of the motion compensation process can be significantly increased.

[0089] Therefore, instead of deriving a motion vector in units of samples, a motion vector in units of sub-blocks within the current block can be restricted to be derived.

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

[0091] For example, referring to FIG. 6, a motion vector for each sub-block may be derived using the center or lower right sample position of each sub-block as a representative coordinate. Here, the center lower right position may refer to the sample position located at the lower right of four samples located at the center of the sub-block. For example, if n is an odd number, one sample may be located at the center of the sub-block, and in this case, the center sample position may be used to derive the motion vector for the sub-block. However, if n is an even number, four samples may be located adjacent to each other at the center of the sub-block, and in this case, the lower right sample position may be used to derive the motion vector. For example, referring to FIG. 6, the representative coordinates for each sub-block may be derived as (2,2), (6,2), (10,2),..., (14,14), and the encoding / decoding device may derive the motion vector for each sub-block by substituting each of the representative coordinates of the sub-block into Equation 1 or 3 above. The motion vector of a sub-block within the current block derived through the affine motion model can be expressed as an affine MVF.

[0092] Meanwhile, as an example, the size of the sub-block within the current block may be derived based on the following formula:

[0093]

number

[0094] In the formula, M represents the width of the sub-block, and N represents the height of the sub-block. 0x , v 0y represent the x and y components of the CPMV0 of the current block, respectively, and v 0x , v 0y where x and y represent the x and y components 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] Meanwhile, inter prediction using the above-mentioned affine motion model, i.e., affine motion prediction, can include an affine merge mode (AF_MERGE) and an affine inter mode (AF_INTER). Here, the affine inter mode can be expressed as an affine motion vector prediction mode (AF_MVP).

[0096] The affine merge mode is similar to the conventional merge mode in that it does not transmit MVDs for the motion vectors of the control points. That is, the affine merge mode can represent an encoding / decoding method in which CPMVs for each of two or three control points from neighboring blocks of the current block are derived and prediction is performed without coding for motion vector differences (MVDs), similar to the conventional skip / merge mode.

[0097] For example, when the AF_MRG mode is applied to the current block, MVs (i.e., CPMV0 and CPMV1) for CP0 and CP1 can be derived from neighboring blocks of the current block to which the affine mode is applied. That is, CPMV0 and CPMV1 of the neighboring 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 may represent inter prediction, which derives a motion vector predictor (MVP) for the motion vector of the control point, derives the motion vector of the control point based on a received motion vector difference (MVD) and the MVP, derives an affine MVF of the current block based on the motion vector of the control point, and performs prediction based on the affine MVF. Here, the motion vector of the control point may be expressed as a control point motion vector (CPMV), the MVP of the control point may be expressed as a control point motion vector predictor (CPMVP), and the MVD of the control point may be expressed as a control point motion vector difference (CPMVD). Specifically, for example, an encoding device may derive a control point motion vector predictor (CPMVP) and a control point motion vector (CPMVD) for each of CP0 and CP1 (or CP0, CP1, and CP2), and may transmit or store information on the CPMVP and / or CPMVD, which is the difference between the CPMVP and 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 neighboring blocks of the current block, and the affine MVP candidates can be indicated as CPMVP pair candidates, and the affine MVP candidate list can also be indicated as a CPMVP candidate list.

[0100] In addition, each affine MVP candidate can represent a combination of CPMVPs CP0 and CP1 in a four parameter affine motion model, or a combination of CPMVPs CP0, CP1, and CP2 in a six parameter affine motion model.

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

[0102] 7, the affine motion estimation method can be roughly expressed as follows: When the affine motion estimation method starts, a CPMV pair can be obtained (S700). Here, the CPMV pair can include CPMV0 and CPMV1 when a four-parameter affine model is used.

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

[0104] Also, two affine prediction modes can be used to determine the CPMV0 and CPMV1. Here, the two affine prediction modes can include an affine inter mode and an affine merge mode. The affine inter mode can clearly determine the CPMV0 and CPMV1 by signaling two pieces of motion vector difference (MVD) information for the CPMV0 and CPMV1. On the other hand, the affine merge mode can derive a CPMV pair without signaling MVD information.

[0105] In other words, affine merge mode can derive the CPMV of the current block using the CPMV of surrounding blocks coded in affine mode, and if the motion vector is determined on a sub-block basis, affine merge mode can also be referred to as sub-block merge mode.

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

[0107] The affine inter mode may also be referred to as the affine MVP mode. In the affine MVP mode, the CPMV of the current block may be derived based on a control point motion vector predictor (CPMVP) and a control point motion vector difference (CPMVD). In other words, the encoding device may determine the CPMVP for the CPMV of the current block, derive the CPMVD, which is the difference between the CPMV of the current block and the CPMVP, and signal information about the CPMVP and information about the CPMVD to the decoding device. Here, the affine MVP mode may construct an affine MVP candidate list based on neighboring blocks, and the information about the CPMVP may indicate neighboring blocks in the affine MVP candidate list that are referenced to derive the CPMVP for the CPMV of the current block. The affine MVP candidate list may also be referred to as a control point motion vector predictor candidate list.

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

[0109] FIG. 8 is a diagram illustrating a method for deriving a motion vector predictor at a control point according to one embodiment of this document.

[0110] 8, the motion vector of CP0 of the current block can be expressed 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, v0 represents the CPMVP of CP0, v1 represents the CPMVP of CP1, and v2 represents the CPMVP of CP2.

[0111] The affine MVP candidate may be a combination of the CPMVP candidate for CP0, the CPMVP candidate for CP1, and the candidate for CP2.

[0112] For example, the affine MVP candidates can be derived as follows:

[0113] Specifically, a combination of up to 12 CPMVP candidates can be determined as follows:

[0114]

number

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

[0116] The neighboring block A may represent a neighboring block located at the upper left corner of the upper left sample position of the current block, the neighboring block B may represent a neighboring block located at the top of the upper left sample position of the current block, and the neighboring block C may represent a neighboring block located at the left of the upper left sample position of the current block. The neighboring block D may represent a neighboring block located at the top of the upper right sample position of the current block, and the neighboring block E may represent a neighboring block located at the upper right corner of the upper right sample position of the current block. The neighboring block F may represent a neighboring block located at the left of the lower left sample position of the current block, and the neighboring block G may represent a neighboring block located at the lower left corner of the lower left sample position of the current block.

[0117] That is, referring to the above-mentioned equation 6, the CPMVP candidate of the CP0 is the motion vector v of the neighboring block A. A , the motion vector v of the surrounding block B B and / or the motion vector v of the neighboring block C C and the CPMVP candidates for CP1 may include the motion vector v of the neighboring block D. D , and / or the motion vector v of the surrounding block E E and the CPMVP candidates for CP2 may include the motion vector v of the neighboring block F. F , and / or the motion vector v of the surrounding block G G may include:

[0118] In other words, the CPMVP v0 of CP0 can be derived based on the motion vector of at least one of neighboring blocks A, B, and C at the top left sample position, where neighboring block A may refer to the block located at the top left of the top left sample position of the current block, neighboring block B may refer to the block located at the top of the top left sample position of the current block, and neighboring block C may refer to the block located to the left of the top left sample position of the current block.

[0119] Based on the motion vectors of the neighboring blocks, a maximum of 12 CPMVP candidate combinations including the CPMVP candidate for CP0, the CPMVP candidate for CP1, and the CPMVP candidate for CP2 can be derived.

[0120] Thereafter, the derived CPMVP candidate combinations are sorted in ascending order of DV, and the top two 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]

number

[0123] The encoding device can then determine a CPMV for each of the affine MVP candidates, compare the RD (Rate Distortion) costs for the CPMV, and select the affine MVP candidate with the smallest RD cost as the optimal affine MVP candidate for the current block. The encoding device can encode and signal an index pointing to the optimal candidate and the CPMVD.

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

[0125] FIG. 9 is a diagram illustrating a method for deriving a motion vector predictor at a control point according to one embodiment of this document.

[0126] An affine merge candidate list for a current block may be constructed based on the neighboring blocks of the current block shown in Fig. 9. The neighboring blocks may include neighboring block A, neighboring block B, neighboring block C, neighboring block D, and neighboring block E. The neighboring block A may represent a left neighboring block of the current block, the neighboring block B may represent an upper neighboring block of the current block, the neighboring block C may represent a right upper corner neighboring block of the current block, the neighboring block D may represent a lower left corner neighboring block of the current block, and the neighboring block E may represent an upper left corner neighboring block of the current block.

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

[0128] Specifically, for example, the encoding apparatus may scan neighboring blocks A, B, C, D, and E of the current block in a specific scanning order, and determine the neighboring block encoded in the affine prediction mode first in the scanning order as a candidate block for the affine merge mode, i.e., an affine merge candidate. Here, for example, the specific scanning order may be alphabetical order, i.e., the order may be neighboring block A, neighboring block B, neighboring block C, neighboring block D, and neighboring block E.

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

[0130] For example, if neighboring block A is determined as a candidate block for the current block, it can be coded as described below.

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

[0132] 10, the encoding apparatus may determine a neighboring block A of the current block as a candidate block and derive an affine motion model for the current block based on the CPMVs v2 and v3 of the neighboring blocks. Thereafter, the encoding apparatus may determine the CPMVs v0 and v1 of the current block based on the affine motion model. The encoding apparatus may determine an affine MVF based on the CPMVs v0 and v1 of the current block and perform an encoding process for the current block based on the affine MVF.

[0133] Meanwhile, in relation to affine inter-prediction, inherited affine candidates and constructed affine candidates are considered for affine MVP candidate list construction.

[0134] Here, the inherited affine candidates may be as follows:

[0135] For example, if a neighboring 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 neighboring block, an affine MVP pair of the current block may be determined from the affine motion model of the neighboring block. Here, the affine block may represent a block to which the affine inter-prediction is applied. The inherited affine candidate may represent a CPMVP (e.g., the affine MVP pair) derived based on the affine motion model of the neighboring block.

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

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

[0138] Referring to FIG. 11, the peripheral blocks of the current block may include a left peripheral block A0 of the current block, a lower left corner peripheral block A1 of the current block, an upper peripheral block B0 of the current block, a top right corner peripheral block B1 of the current block, and an upper left corner peripheral block B2 of the current block.

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

[0140] The encoding / decoding device may sequentially check neighboring blocks A0, A1, B0, B1, and B2. If the neighboring blocks are coded using an affine motion model and the reference picture of the current block is the same as the reference picture of the neighboring blocks, the encoding / decoding device may derive two or three CPMVs for the current block based on the affine motion model of the neighboring blocks. The CPMVs may be derived as affine MVP candidates for the current block. The affine MVP candidates may represent the inherited affine candidates.

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

[0142] For example, the encoding / decoding apparatus may derive a first affine MVP candidate for the current block based on a first block among neighboring blocks. Here, the first block may be coded using an affine motion model, and the reference picture of the first block may be the same as the reference picture of the current block. That is, the first block may be a block that satisfies a condition that is first confirmed by checking the neighboring blocks according to a specific order. The condition may be that the block is coded using an affine motion model, and the reference picture of the block is the same as the reference picture of the current block.

[0143] Thereafter, the encoding / decoding apparatus may derive a second affine MVP candidate for the current block based on a second block among the neighboring blocks. Here, the second block may be coded using an affine motion model, and the reference picture of the second block may be the same as the reference picture of the current block. That is, the second block may be a block that satisfies a second confirmed condition when checking the neighboring blocks according to a specific order. The condition may be that the block is coded using an affine motion model, and the reference picture of the block is the same as the reference picture of the current block.

[0144] On the other hand, for example, if the number of available inherited affine candidates is less than 2 (i.e., 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 spatial candidates for the constructed affine candidates.

[0146] 12, the motion vectors of the neighboring blocks of the current block are divided into three groups, which include neighboring block A, neighboring block B, neighboring block C, neighboring block D, neighboring block E, neighboring block F, and neighboring block G.

[0147] The peripheral block A indicates a peripheral block located at the upper left corner 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, the peripheral block C indicates a peripheral block located at the left end of the upper left sample position of the current block, the peripheral block D indicates a peripheral block located at the upper end of the upper right sample position of the current block, the peripheral block E indicates a peripheral block located at the upper right corner of the upper right sample position of the current block, 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 corner of the lower left sample position of the current block.

[0148] For example, the three groups include S0, S1, and S2, and 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 surrounding block A, mv B is the motion vector of the surrounding block B, mv C is the motion vector of the surrounding block C, mv D is the motion vector of the surrounding block D, mv E is the motion vector of the surrounding block E, mv F is the motion vector of the surrounding block F, mv Gindicates the motion vector of the surrounding block G. S0 may be indicated as the first group, S1 as the second group, and S2 as the third group.

[0151] The encoding / decoding device derives mv0 from S0, mv1 from S1, and mv2 from S2, and derives affine MVP candidates including mv0, mv1, and mv2. The affine MVP candidates may represent the constructed affine candidates. Furthermore, mv0 may be a CPMVP candidate for CP0, mv1 may be a CPMVP candidate for CP1, and mv2 may be a CPMVP candidate for CP2.

[0152] Here, the reference picture for mv0 may be the same as the reference picture of the current block. That is, mv0 may be the motion vector that satisfies a condition that is first confirmed by checking motion vectors in S0 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 the neighboring block A, the neighboring block B, and the neighboring block C in S0. Orders other than the above-mentioned order may also be used, and are not limited to the above-mentioned example.

[0153] Furthermore, the reference picture for mv1 may be the same as the reference picture of the current block. That is, mv1 may be the motion vector that satisfies a condition that is first confirmed when motion vectors in S1 are checked 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 neighboring block D → neighboring block E in S1. Orders other than the above-mentioned order may also be used, and are not limited to the above-mentioned example.

[0154] Furthermore, the reference picture for mv2 may be the same as the reference picture of the current block. That is, mv2 may be the motion vector that satisfies a condition that is first confirmed when motion vectors in S2 are checked 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 the neighboring block F→the neighboring block G in S2. An order other than the above-mentioned order may also be used, and is not limited to the above-mentioned example.

[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]

number

[0157] where mv2 x indicates the x-component of mv2, and mv2 y indicates the y component of mv2, and mv0 x indicates the x component of mv0, and mv0 y indicates the y component of mv0, and mv1 x indicates the x-component of mv1, and mv1 y indicates the y component of mv1, w indicates the width of the current block, and h indicates 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]

number

[0160] where mv1 x indicates the x-component of mv1, and mv1 y indicates the y component of mv1, and mv0 xindicates the x component of mv0, and mv0 y indicates the y component of mv2, and mv2 x indicates the x-component of mv2, and mv2 y represents the y component of mv2, and w represents the width of the current block, and h represents the height of the current block.

[0161] Also, if the number of available inherited affine candidates and / or constructed affine candidates is less than 2, the AMVP process of the existing HEVC standard can be applied to construct the affine MVP list. That is, if 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, a flowchart of an embodiment for constructing the above-mentioned affine MVP list is as follows.

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

[0164] 13, the encoding / decoding device adds an inherited candidate to the affine MVP list of the current block (S1300). The inherited candidate indicates the inherited affine candidate.

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

[0166] For example, the encoding / decoding apparatus may derive a first affine MVP candidate for the current block based on a first block among neighboring blocks. Here, the first block may be coded using an affine motion model, and the reference picture of the first block may be the same as the reference picture of the current block. That is, the first block may be the block that satisfies a condition that is first confirmed when checking the neighboring blocks in a specific order. The condition may be that the block is coded using an affine motion model, and 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 for the previous current block based on a second block among the neighboring blocks. Here, the second block may be coded using an affine motion model, and the reference picture of the second block may be the same as the reference picture of the current block. That is, the second block may be a block that satisfies a second confirmed condition when checking the neighboring blocks in a specific order. The condition may be that the block is coded using an affine motion model, and the reference picture of the block is the same as the reference picture of the current block.

[0168] Meanwhile, the specific order may be the left peripheral block A0 → the lower left corner peripheral block A1 → the upper peripheral block B0 → the upper right corner peripheral block B1 → the upper left corner peripheral block B2, etc. Also, the order may be other than the above-mentioned order and is not limited to the above-mentioned example.

[0169] The encoding device / decoding device may add a constructed candidate to the affine MVP list of the current block (S1310). The constructed candidate refers to the above-mentioned constructed affine candidate. The constructed candidate may also be referred to as a constructed affine MVP candidate. If the number of available inherited candidates is less than two, the encoding device / decoding device may add a constructed candidate to the affine MVP list of the current block.

[0170] Meanwhile, the method of deriving the constructed affine candidates may differ 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 of deriving the constructed affine candidates will be described in detail below.

[0171] The encoding / decoding device adds an HEVC AMVP candidate to the affine MVP list of the current block (S1320). If the number of available inherited and / or constructed candidates is less than two, the encoding / decoding device adds the HEVC AMVP candidate to the affine MVP list of the current block. That is, if the number of available inherited and / or constructed candidates is less than two, the encoding / decoding device may perform a process of configuring MVP candidates in the existing HEVC standard.

[0172] Meanwhile, the method for deriving the constructed candidates is as follows.

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

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

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

[0176] For example, the encoding / decoding apparatus may check whether motion vectors of neighboring blocks in a first group satisfy a specific condition in a specific order. The encoding / decoding apparatus may derive the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv0. That is, 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 neighboring blocks in the first group do not satisfy the specific condition, there may be no usable mv0. Here, for example, the specific order may be from neighboring block A to neighboring block B to neighboring block C in the first group. Also, for example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0177] For example, the encoding / decoding apparatus may check whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition in a specific order. The encoding / decoding apparatus may derive the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv1. That is, mv1 may be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the second group in a specific order. If the motion vectors of the neighboring blocks in the second group do not satisfy the specific condition, there may be no usable mv1. Here, for example, the specific order may be from neighboring block D to neighboring block E in the second group. For example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0178] For example, the encoding / decoding apparatus may check whether the motion vectors of the neighboring blocks in the third group satisfy a specific condition in a specific order. The encoding / decoding apparatus may derive the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv2. That is, mv2 may 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 neighboring blocks in the third group do not satisfy the specific condition, there may be no usable mv2. Here, for example, the specific order may be from neighboring block F to neighboring block G in the third group. For example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0179] Meanwhile, the first group includes motion vectors of peripheral blocks A, B, and C, the second group includes motion vectors of peripheral blocks D and E, and the third group includes motion vectors of peripheral blocks F and G. The peripheral block A indicates the peripheral block located at the upper left corner of the upper left sample position of the current block, the peripheral block B indicates the peripheral block located at the upper end of the upper left sample position of the current block, the peripheral block C indicates the peripheral block located at the left end of the upper left sample position of the current block, the peripheral block D indicates the peripheral block located at the upper end of the upper right sample position of the current block, the peripheral block E indicates the peripheral block located at the upper right corner of the upper right sample position of the current block, the peripheral block F indicates the peripheral block located at the left end of the lower left sample position of the peripheral block, and the peripheral block G indicates the peripheral block located at the lower left corner of the lower left sample position of the current block.

[0180] If only the mv0 and mv1 for the current block are available, i.e., if only the mv0 and mv1 for the current block are derived, the encoding / decoding device derives mv2 for the current block based on the above-described Equation 8 (S1410). The encoding / decoding device derives mv2 by substituting the derived mv0 and mv1 into the above-described Equation 8.

[0181] If only the mv0 and mv2 for the current block are available, i.e., if only the mv0 and mv2 for the current block are derived, the encoding / decoding device derives mv1 for the current block based on Equation 9 (S1420). The encoding / decoding device derives mv1 by substituting the derived mv0 and mv2 into Equation 9.

[0182] The encoding / decoding device derives the derived mv0, mv1, and mv2 as constructed candidates for the current block (S1430). If the mv0, mv1, and mv2 are available, i.e., if the mv0, mv1, and mv2 are derived based on neighboring blocks of the current block, the encoding / decoding device derives the derived mv0, mv1, and mv2 as constructed candidates for the current block.

[0183] Also, if only mv0 and mv1 for the current block are available, i.e., if only mv0 and mv1 for the current block are derived, the encoding device / decoding device derives mv2 derived based on the derived mv0, mv1 and the above-mentioned Equation 8 as the constructed candidate for the current block.

[0184] Also, if only mv0 and mv2 for the current block are available, i.e., if only mv0 and mv2 for the current block are derived, the encoding device / decoding device derives mv1 derived based on the derived mv0, mv2 and the above-mentioned Equation 9 as the constructed candidate for the current block.

[0185] Also, for example, if the affine motion model applied to the current block is a 4-affine motion model, the constructed candidates can be derived as in the embodiment shown in FIG.

[0186] FIG. 15 shows an example of deriving the constructed candidates.

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

[0188] For example, the encoding / decoding device checks whether motion vectors of neighboring blocks in a first group satisfy a specific condition in a specific order. The encoding / decoding device derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv0. That is, 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 neighboring blocks in the first group do not satisfy the specific condition, there may be no usable mv0. Here, for example, the specific order may be from neighboring block A to neighboring block B to neighboring block C in the first group. Also, for example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

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

[0190] For example, the encoding / decoding apparatus may check whether the motion vectors of the neighboring blocks in the third group satisfy a specific condition in a specific order. The encoding / decoding apparatus may derive the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv2. That is, mv2 may 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 neighboring blocks in the third group do not satisfy the specific condition, there may be no usable mv2. Here, for example, the specific order may be from neighboring block F to neighboring block G in the third group. For example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

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

[0192] If only mv0 and mv1 for the current block are available, or if mv0, mv1, and mv2 for the current block are available, i.e., if mv0 and mv1 for the current block are derived, or if 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, if only the mv0 and mv2 for the current block are available, i.e., if only the mv0 and mv2 for the current block are derived, the encoding / decoding device derives mv1 for the current block based on Equation 9 (S1520). The encoding / decoding device derives mv1 by substituting the derived mv0 and mv2 into Equation 9.

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

[0195] Meanwhile, this document proposes a method for deriving a constrained candidate that is different from the above-described embodiment. The proposed embodiment reduces complexity and improves coding performance compared to the above-described embodiment for deriving a constructed candidate. The proposed embodiment is described below. Also, if the number of available inherited affine candidates is less than two (i.e., if the number of derived inherited affine candidates is less than two), a constructed affine candidate is considered.

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

[0197] Specifically, the neighboring blocks of the current block are divided into three groups, including neighboring block A, neighboring block B, neighboring block C, neighboring block D, neighboring block E, neighboring block F, and neighboring block G. The first group includes the motion vectors of neighboring block A, neighboring block B, and neighboring block C, the second group includes the motion vectors of neighboring block D and neighboring block E, and the third group includes the motion vectors of neighboring block F and neighboring block G. The peripheral block A indicates a peripheral block located at the upper left end 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, the peripheral block C indicates a peripheral block located at the left end of the upper left sample position of the current block, the peripheral block D indicates a peripheral block located at the upper end of the upper right sample position of the current block, the peripheral block E indicates a peripheral block located at the upper right end of the upper right sample position of the current block, 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 end 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 / decoding apparatus checks whether motion vectors of neighboring blocks in a first group satisfy a specific condition in a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv0. That is, 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 neighboring blocks in the first group do not satisfy the specific condition, there may be no usable mv0. Here, for example, the specific order may be from neighboring block A to neighboring block B to neighboring block C in the first group. Also, for example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

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

[0201] The encoding / decoding apparatus also checks whether the motion vectors of the neighboring blocks in the third group satisfy a specific condition in a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv2. That is, mv2 may 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 neighboring blocks in the third group do not satisfy the specific condition, there may be no usable mv2. Here, for example, the specific order may be from neighboring block F to neighboring block G in the third group. For example, the specific condition may be that the reference picture for the motion vector of the neighboring 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 4-affine motion model, if mv0 and mv1 for the current block are available, the encoding / decoding device derives the derived mv0 and mv1 as constructed candidates for the current block. On the other hand, if mv0 and / or mv1 for the current block are not available, i.e., if at least one of mv0 and mv1 is not derived from a neighboring block of the current block, the encoding / 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 constructed candidates for the current block. On the other hand, if mv0, mv1, and / or mv2 for the current block are not available, i.e., if at least one of mv0, mv1, and mv2 is not derived from a neighboring block of the current block, the encoding / decoding device does not add a constructed candidate to the affine MVP list of the current block.

[0204] The above-described proposed embodiment is a method in which only if all motion vectors of CPs for generating an affine motion model for the current block are available, they are considered as a constructed candidate. Here, "available" means that the reference picture of the neighboring block is the same as the reference picture of the current block. That is, the constructed candidate can be derived only if there is a motion vector that satisfies the above condition among the motion vectors of neighboring blocks for each CP of the current block. Therefore, if the affine motion model applied to the current block is a 4-affine motion model, the constructed candidate is considered only if the motion vectors of CP0 and CP1 of the current block (i.e., mv0 and mv1) are available. Also, if the affine motion model applied to the current block is a 6-affine motion model, the constructed candidate is considered only if the motion vectors of CP0, CP1, and CP2 of the current block (i.e., mv0, mv1, and mv2) are available. Therefore, according to the proposed embodiment, an additional configuration for deriving a motion vector for a CP based on the above-described Equation 8 or Equation 9 may not be required. This reduces the computational complexity for deriving the constructed candidate. Also, since the constructed candidate is determined only when a CPMVP candidate having the same reference picture is available, overall coding performance can be improved.

[0205] The above embodiment can be illustrated as in FIGS.

[0206] FIG. 16 shows an example of deriving the constructed candidates when four affine motion models are applied to the current block.

[0207] 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 available mv0 and mv1 exist in neighboring blocks of the current block. Here, mv0 may be a CPMVP candidate for CP0 of the current block, and mv1 may be a CPMVP candidate for CP1.

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

[0209] Specifically, the neighboring blocks of the current block are divided into three groups, including neighboring block A, neighboring block B, neighboring block C, neighboring block D, neighboring block E, neighboring block F, and neighboring block G. The first group includes the motion vectors of neighboring block A, neighboring block B, and neighboring block C, the second group includes the motion vectors of neighboring block D and neighboring block E, and the third group includes the motion vectors of neighboring block F and neighboring block G. The peripheral block A indicates a peripheral block located at the upper left end 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, the peripheral block C indicates a peripheral block located at the left end of the upper left sample position of the current block, the peripheral block D indicates a peripheral block located at the upper end of the upper right sample position of the current block, the peripheral block E indicates a peripheral block located at the upper right end of the upper right sample position of the current block, the side 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 end of the lower left sample position of the current block.

[0210] The encoding / decoding device checks whether motion vectors of neighboring blocks in the first group satisfy a specific condition in a specific order. The encoding / decoding device derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv0. That is, 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 neighboring blocks in the first group do not satisfy the specific condition, there may be no usable mv0. Here, for example, the specific order may be from neighboring block A to neighboring block B to neighboring block C in the first group. Also, for example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

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

[0212] If the mv0 and mv1 for the current block are available, i.e., if the mv0 and mv1 for the current block are derived, the encoding / decoding device derives the derived mv0 and mv1 as constructed candidates for the current block (S1610). On the other hand, if the mv0 and / or mv1 for the current block are not available, i.e., if at least one of mv0 and mv1 is not derived from a neighboring block 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 candidates when 6 affine motion models are applied to the current block.

[0214] 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 available mv0, mv1, and mv2 exist in neighboring blocks of the current block. Here, mv0 may be a CPMVP candidate for CP0 of the current block, mv1 may be a CPMVP candidate for CP1, and mv2 may be a CPMVP candidate for CP2.

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

[0216] Specifically, the neighboring blocks of the current block are divided into three groups, including neighboring block A, neighboring block B, neighboring block C, neighboring block D, neighboring block E, neighboring block F, and neighboring block G. The first group includes the motion vectors of neighboring block A, neighboring block B, and neighboring block C, the second group includes the motion vectors of neighboring block D and neighboring block E, and the third group includes the motion vectors of neighboring block F and neighboring block G. The peripheral block A indicates a peripheral block located at the upper left end 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, the peripheral block C indicates a peripheral block located at the left end of the upper left sample position of the current block, the peripheral block D indicates a peripheral block located at the upper end of the upper right sample position of the current block, the peripheral block E indicates a peripheral block located at the upper right end of the upper right sample position of the current block, 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 end of the lower left sample position of the current block.

[0217] The encoding / decoding apparatus checks whether motion vectors of neighboring blocks in the first group satisfy a specific condition in a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv0. That is, 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 neighboring blocks in the first group do not satisfy the specific condition, there may be no usable mv0. Here, for example, the specific order may be from neighboring block A in the first group to neighboring block B and neighboring block C. Also, for example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0218] The encoding / decoding apparatus also checks whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition in a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv1. That is, mv1 may be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the second group in a specific order. If the motion vectors of the neighboring blocks in the second group do not satisfy the specific condition, there may be no usable mv1. Here, for example, the specific order may be from neighboring block D to neighboring block E in the second group. For example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0219] The encoding / decoding apparatus also checks whether the motion vectors of the neighboring blocks in the third group satisfy a specific condition in a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv2. That is, mv2 may 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 neighboring blocks in the third group do not satisfy the specific condition, there may be no usable mv2. Here, for example, the specific order may be from neighboring block F to neighboring block G in the third group. For example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0220] If the mv0, mv1, and mv2 for the current block are available, i.e., if the mv0, mv1, and mv2 for the current block are derived, the encoding / decoding device derives the derived mv0, mv1, and mv2 as constructed candidates for the current block (S1710). On the other hand, if the mv0, mv1, and / or mv2 for the current block are not available, i.e., if at least one of mv0, mv1, and mv2 is not derived from a neighboring block of the current block, the encoding / decoding device does not add a constructed candidate to the affine MVP list of the current block.

[0221] This document also proposes an embodiment for deriving constellation candidates, as described below. Specifically, in the embodiment described below, CPs for generating 4-affine motion models can be adaptively determined based on the width and height of the current block. That is, if the affine motion model applied to the current block is a 4-affine motion model, two CPs can be selected from CP0, CP1, and CP2 of the current block 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, if the width of the current block is greater than or equal to the height, the CPs of the affine motion model for the current block may be selected as CP0 and CP1, and if the width of the current block is less than the height, the CPs of the affine motion model for the current block may be selected as CP0 and CP2.

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

[0226] 18, when a four-affine motion model is applied to the current block, the encoding / decoding device determines whether the width of the current block is greater than or equal to the height (S1800). If the width of the current block is greater than or equal to the height, the encoding / decoding device may select CP0 and CP1 as the CPs of the affine motion model for the current block. If the width of the current block is less than the height, the encoding / decoding device may select CP0 and CP2 as the CPs of the affine motion model for the current block.

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

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

[0229] Specifically, the neighboring blocks of the current block are divided into three groups, including neighboring block A, neighboring block B, neighboring block C, neighboring block D, neighboring block E, neighboring block F, and neighboring block G. The first group includes the motion vectors of neighboring block A, neighboring block B, and neighboring block C, the second group includes the motion vectors of neighboring block D and neighboring block E, and the third group includes the motion vectors of neighboring block F and neighboring block G. The peripheral block A indicates a peripheral block located at the upper left end 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, the peripheral block C indicates a peripheral block located at the left end of the upper left sample position of the current block, the peripheral block D indicates a peripheral block located at the upper end of the upper right sample position of the current block, the peripheral block E indicates a peripheral block located at the upper right end of the upper right sample position of the current block, 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 end of the lower left sample position of the current block.

[0230] The encoding / decoding device checks whether motion vectors of neighboring blocks in the first group satisfy a specific condition in a specific order. The encoding / decoding device derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv0. That is, 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 neighboring blocks in the first group do not satisfy the specific condition, there may be no usable mv0. Here, for example, the specific order may be from neighboring block A to neighboring block B to neighboring block C in the first group. Also, for example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0231] The encoding / decoding apparatus also checks whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition in a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv1. That is, mv1 may be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the second group in a specific order. If the motion vectors of the neighboring blocks in the second group do not satisfy the specific condition, there may be no usable mv1. Here, for example, the specific order may be from neighboring block D to neighboring block E in the second group. For example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0232] On the other hand, if 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 / decoding device determines whether available mv0 and mv2 exist in neighboring blocks of the current block. Here, mv0 may be a CPMVP candidate for CP0 of the current block, and mv2 may be a CPMVP candidate for CP2.

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

[0234] Specifically, the neighboring blocks of the current block are divided into three groups, including neighboring block A, neighboring block B, neighboring block C, neighboring block D, neighboring block E, neighboring block F, and neighboring block G. The first group includes the motion vectors of neighboring block A, neighboring block B, and neighboring block C, the second group includes the motion vectors of neighboring block D and neighboring block E, and the third group includes the motion vectors of neighboring block F and neighboring block G. The peripheral block A indicates a peripheral block located at the upper left end 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, the peripheral block C indicates a peripheral block located at the left end of the upper left sample position of the current block, the peripheral block D indicates a peripheral block located at the upper end of the upper right sample position of the current block, the peripheral block E indicates a peripheral block located at the upper right end of the upper right sample position of the current block, 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 end of the lower left sample position of the current block.

[0235] The encoding / decoding device checks whether motion vectors of neighboring blocks in the first group satisfy a specific condition in a specific order. The encoding / decoding device derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv0. That is, 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 neighboring blocks in the first group do not satisfy the specific condition, there may be no usable mv0. Here, for example, the specific order may be from neighboring block A to neighboring block B to neighboring block C in the first group. Also, for example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0236] The encoding / decoding apparatus also checks whether the motion vectors of the neighboring blocks in the third group satisfy a specific condition in a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv2. That is, mv2 may 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 neighboring blocks in the third group do not satisfy the specific condition, there may be no usable mv2. Here, for example, the specific order may be from neighboring block F to neighboring block G in the third group. For example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0237] The encoding / decoding device determines constructed candidates for the current block based on the derived motion vectors (S1830). For example, if mv0 for CP0 and mv1 for CP1 are derived, the encoding / decoding device determines mv0 and mv1 as the constructed candidates. Also, for example, if 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 a 6-affine motion model is applied to the current block, as in the above embodiment, the constructed candidate can be considered if all of the CPMVPs (i.e., mv0, mv1, mv2) for CP0, CP1, and CP2 are available.

[0239] This document also proposes an embodiment for deriving constructed candidates, as described below. Specifically, the embodiment described below can be applied to deriving constructed candidates for the current block when adaptive CP selection is not considered.

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

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

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

[0243] Specifically, the neighboring blocks of the current block are divided into three groups, including neighboring block A, neighboring block B, neighboring block C, neighboring block D, neighboring block E, neighboring block F, and neighboring block G. The first group includes the motion vectors of neighboring block A, neighboring block B, and neighboring block C, the second group includes the motion vectors of neighboring block D and neighboring block E, and the third group includes the motion vectors of neighboring block F and neighboring block G. The peripheral block A indicates a peripheral block located at the upper left end 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, the peripheral block C indicates a peripheral block located at the left end of the upper left sample position of the current block, the peripheral block D indicates a peripheral block located at the upper end of the upper right sample position of the current block, the peripheral block E indicates a peripheral block located at the upper right end of the upper right sample position of the current block, 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 end of the lower left sample position of the current block.

[0244] The encoding / decoding device checks whether motion vectors of neighboring blocks in the first group satisfy a specific condition in a specific order. The encoding / decoding device derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv0. That is, 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 neighboring blocks in the first group do not satisfy the specific condition, there may be no usable mv0. Here, for example, the specific order may be from neighboring block A to neighboring block B to neighboring block C in the first group. Also, for example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0245] The encoding / decoding apparatus also checks whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition in a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv1. That is, mv1 may be the motion vector that satisfies the specific condition first confirmed by checking the motion vectors in the second group in a specific order. If the motion vectors of the neighboring blocks in the second group do not satisfy the specific condition, there may be no usable mv1. Here, for example, the specific order may be from neighboring block D to neighboring block E in the second group. For example, the specific condition may be that the reference picture for the motion vector of the neighboring 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, i.e., if at least one of mv0 and mv1 cannot be derived from the neighboring blocks of the current block, the encoding / decoding device determines whether mv0 and mv2 for the current block are available and whether the width of the current block is smaller than the height (S1910).

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

[0248] Specifically, the neighboring blocks of the current block are divided into three groups, including neighboring block A, neighboring block B, neighboring block C, neighboring block D, neighboring block E, neighboring block F, and neighboring block G. The first group includes the motion vectors of neighboring block A, neighboring block B, and neighboring block C, the second group includes the motion vectors of neighboring block D and neighboring block E, and the third group includes the motion vectors of neighboring block F and neighboring block G. The peripheral block A indicates a peripheral block located at the upper left end 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, the peripheral block C indicates a peripheral block located at the left end of the upper left sample position of the current block, the peripheral block D indicates a peripheral block located at the upper end of the upper right sample position of the current block, the peripheral block E indicates a peripheral block located at the upper right end of the upper right sample position of the current block, 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 end of the lower left sample position of the current block.

[0249] The encoding / decoding device checks whether motion vectors of neighboring blocks in the first group satisfy a specific condition in a specific order. The encoding / decoding device derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv0. That is, 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 neighboring blocks in the first group do not satisfy the specific condition, there may be no usable mv0. Here, for example, the specific order may be from neighboring block A to neighboring block B to neighboring block C in the first group. Also, for example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0250] The encoding / decoding apparatus also checks whether the motion vectors of the neighboring blocks in the third group satisfy a specific condition in a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition first confirmed during the checking process as mv2. That is, mv2 may 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 neighboring blocks in the third group do not satisfy the specific condition, there may be no usable mv2. Here, for example, the specific order may be from neighboring block F to neighboring block G in the third group. For example, the specific condition may be that the reference picture for the motion vector of the neighboring block is the same as the reference picture of the current block.

[0251] The encoding / decoding device also determines whether the width of the current block is smaller than its 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 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 derives mv1 by substituting the derived mv0 and mv2 into Equation 9. 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, a constructed candidate for the current block may not be derived.

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

[0254] FIG. 20 schematically illustrates an image encoding method by an encoding device according to the present document. The method disclosed in FIG. 20 can be performed by the encoding device disclosed in FIG. 1. Specifically, for example, steps S2000 to S2030 in FIG. 20 are performed by a prediction unit of the encoding device, and step S2040 is performed by an entropy encoding unit of the encoding device. Also, although not shown, a step of deriving predicted samples for the current block based on the CPMV is performed by a prediction unit of the encoding device, a step of deriving residual samples for the current block based on original samples and predicted samples for the current block is performed by a subtraction unit of the encoding device, a step of generating information about the residual for the current block based on the residual samples is performed by a transformation unit of the encoding device, and a step of encoding information about the residual is performed by an entropy encoding unit of the encoding device.

[0255] The encoding apparatus constructs an affine motion vector predictor (MVP) candidate list for a current block (S2000). The encoding apparatus constructs the affine MVP candidate list including affine MVP candidates for the current block.

[0256] For example, if constructed affine MVP candidates are available, the affine MVP candidate list includes the constructed affine MVP candidates, which include candidate motion vectors for the CP. The constructed affine MVP candidates are available if all of the candidate motion vectors are available.

[0257] For example, if a 4-affine motion model is applied to the current block, the CPs of the current block include 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 includes the constructed affine MVP candidate. Here, CP0 indicates the upper left corner of the current block, and CP1 indicates the upper right corner of the current block.

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

[0259] Furthermore, the first block may be a block whose first reference picture identified by checking neighboring blocks in the first group according to a first specific order is the same as the reference picture of the current block. Here, if 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 may be available. For example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from neighboring block A to neighboring block B to neighboring block C.

[0260] Furthermore, the second block may be a block whose first identified reference picture is the same as the reference picture of the current block when neighboring blocks in the second group are checked according to a second specific order. Here, if the reference picture of the second block in the second group is the same as the reference picture of the current block, a candidate motion vector for CP1 may be available. For example, the second group may include neighboring blocks D and E, and the second specific order may be from neighboring block D to neighboring block E.

[0261] On the other hand, 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 surrounding block A may be a block including a sample at (-1,-1) coordinates, the surrounding block B may be a block including a sample at (0,-1) coordinates, the surrounding block C may be a block including a sample at (-1,-0) coordinates, the surrounding block D may be a block including a sample at (W-1,-1) coordinates, and the surrounding block E may be a block including a sample 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 upper peripheral block located on the leftmost side among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located on the topmost side among the left peripheral blocks of the current block, the peripheral block D may be the upper peripheral block located on the rightmost side 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.

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

[0263] Alternatively, for example, if a 6-affine motion model is applied to the current block, the CPs of the current block include CP0, CP1, and CP2. If a candidate motion vector for CP0 is available, a candidate motion vector for CP1 is available, and a candidate motion vector for CP2 is available, the constructed affine MVP candidates are available, and the affine MVP candidate list includes the constructed affine MVP candidates. Here, CP0 indicates the upper left corner of the current block, CP1 indicates the upper right corner of the current block, and CP2 indicates the lower left corner of the current block.

[0264] The constructed affine MVP candidates include a candidate motion vector for CP0, a candidate motion vector for CP1, and a candidate motion vector for CP2, where the candidate motion vector for CP0 may be a motion vector of a first block, the candidate motion vector for CP1 may be a motion vector of a second block, and the candidate motion vector for CP2 may be a motion vector of a third block.

[0265] Furthermore, the first block may be a block whose first reference picture identified by checking neighboring blocks in the first group according to a first specific order is the same as the reference picture of the current block. Here, if 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 may be available. For example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from neighboring block A to neighboring block B to neighboring block C.

[0266] Furthermore, the second block may be a block whose first identified reference picture is the same as the reference picture of the current block when neighboring blocks in the second group are checked according to a second specific order. Here, if the reference picture of the second block in the second group is the same as the reference picture of the current block, a candidate motion vector for CP1 may be available. For example, the second group may include neighboring blocks D and E, and the second specific order may be from neighboring block D to neighboring block E.

[0267] Furthermore, the third block may be a block whose first identified reference picture is the same as the reference picture of the current block when neighboring blocks in the third group are checked according to a third specific order. Here, if the reference picture of the third block in the third group is the same as the reference picture of the current block, a candidate motion vector for CP2 may be available. For example, the third group may include neighboring blocks F and G, and the third specific order may be from neighboring block F to neighboring block G.

[0268] On the other hand, 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 surrounding block A may be a block including a sample at (-1,-1) coordinates, the surrounding block B may be a block including a sample at (0,-1) coordinates, the surrounding block C may be a block including a sample at (-1,0) coordinates, the surrounding block D may be a block including a sample at (W-1,-1) coordinates, the surrounding block E may be a block including a sample at (W,-1) coordinates, the surrounding block F may be a block including a sample at (-1,H-1) coordinates, and the surrounding block G may be a block including a sample at (-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 upper leftmost peripheral block among the upper peripheral blocks of the current block, the peripheral block C may be the leftmost peripheral block among the left peripheral blocks of the current block, the peripheral block D may be the upper rightmost 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 leftmost 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 CP0, CP1, and CP2 is unavailable, the constructed affine MVP candidate may not be available.

[0270] Alternatively, for example, if a 4-affine motion model is applied to the current block, a CP is selected based on the width and height of the current block, and the constructed affine MVP candidates include candidate motion vectors for the selected CP.

[0271] For example, if 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 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 corner of the current block, and CP1 indicates the upper right corner of the current block.

[0272] The constructed affine MVP candidates include a candidate motion vector for the CP0 and a candidate motion vector for the CP1, where the candidate motion vector for the CP0 may be a motion vector of a first block, and the candidate motion vector for the CP1 may be a motion vector of a second block.

[0273] Furthermore, the first block may be a block whose first reference picture identified by checking neighboring blocks in the first group according to a first specific order is the same as the reference picture of the current block. Here, if 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 may be available. For example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from neighboring block A to neighboring block B to neighboring block C.

[0274] Furthermore, the second block may be a block whose first identified reference picture is the same as the reference picture of the current block when neighboring blocks in the second group are checked according to a second specific order. Here, if the reference picture of the second block in the second group is the same as the reference picture of the current block, a candidate motion vector for CP1 may be available. For example, the second group may include neighboring blocks D and E, and the second specific order may be from neighboring block D to neighboring block E.

[0275] On the other hand, 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 surrounding block A may be a block including a sample at (-1,-1) coordinates, the surrounding block B may be a block including a sample at (0,-1) coordinates, the surrounding block C may be a block including a sample at (-1,-0) coordinates, the surrounding block D may be a block including a sample at (W-1,-1) coordinates, and the surrounding block E may be a block including a sample 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 upper peripheral block located on the leftmost side among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located on the topmost side among the left peripheral blocks of the current block, the peripheral block D may be the upper peripheral block located on the rightmost side 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.

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

[0277] Also, if the width of the current block is smaller than the height, the CP0 and CP2 of the current block are included. If a candidate motion vector for CP0 is available and a 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 upper left corner of the current block, and CP2 indicates the lower left corner of the current block.

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

[0279] Furthermore, the first block may be a block whose first reference picture identified by checking neighboring blocks in the first group according to a first specific order is the same as the reference picture of the current block. Here, if 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 may be available. For example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from neighboring block A to neighboring block B to neighboring block C.

[0280] Furthermore, the third block may be a block whose first identified reference picture is the same as the reference picture of the current block when neighboring blocks in the third group are checked according to a third specific order. Here, if the reference picture of the third block in the third group is the same as the reference picture of the current block, a candidate motion vector for CP2 may be available. For example, the third group may include neighboring blocks F and G, and the third specific order may be from neighboring block F to neighboring block G.

[0281] On the other hand, 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 surrounding block A may be a block including a sample at (-1,-1) coordinates, the surrounding block B may be a block including a sample at (0,-1) coordinates, the surrounding block C may be a block including a sample at (-1,-0) coordinates, the surrounding block F may be a block including a sample at (-1,H-1) coordinates, and the surrounding block G may be a block including a sample at (-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 upper peripheral block located on the leftmost side among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located on the topmost side among the left peripheral blocks of the current block, the peripheral block F may be the left peripheral block located on the bottommost side among the left peripheral blocks of the current block, and the peripheral block G may 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 unavailable, 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 candidate is derived based on a specific block among neighboring blocks of the current block, where the specific block is coded using an affine motion model and the reference picture of the specific block may be the same as the reference picture of the current block.

[0285] Here, the specific block may be a block that satisfies a condition first when checking the neighboring blocks in a specific order. The condition may be that the block is coded using an affine motion model and that the reference picture of the block is the same as the reference picture of the current block. For example, the encoding apparatus may check whether the neighboring 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 apparatus may 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 may be derived as shown in Equation 1 or 3 above.

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

[0288] Meanwhile, if fewer than two affine MVP candidates are derived through the above process, the affine MVP candidates may include MVP candidates in the existing HEVC standard.

[0289] That is, for example, if fewer than two affine MVP candidates are derived through the above process, the encoding device can derive MVP candidates in the existing HEVC standard.

[0290] Meanwhile, the encoding apparatus may determine an affine motion model to be applied to the current block, and generate and encode affine type information indicating the affine motion model to be applied to the current block. For example, the affine type information may indicate whether the affine motion model to be 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. Image information includes the affine type information.

[0291] The encoding apparatus derives control point motion vector predictors (CPMVPs) for the control points (CPs) of the current block based on the affine MVP candidate list (S2010). The encoding apparatus derives a CPMV for the CP of the current block having the optimal RD cost, and selects an affine MVP candidate most similar to the CPMV from the affine MVP candidates as an affine MVP candidate for the current block. The encoding apparatus derives a CPMVP for the control points (CPs) of the current block based on the selected affine MVP candidate from the affine MVP candidates included in the affine MVP candidate list. Specifically, if the affine MVP candidates include a candidate motion vector for CP0 and a candidate motion vector for CP1, the candidate motion vector for CP0 of the affine MVP candidate may be derived as the CPMVP of CP0, and the candidate motion vector for CP1 of the affine MVP candidate may be derived as the CPMVP of CP1. Furthermore, if the affine MVP candidates include a candidate motion vector for CP0, a candidate motion vector for CP1, and a candidate motion vector for CP2, the candidate motion vector of the affine MVP candidate for CP0 is derived as the CPMVP of CP0, and the candidate motion vector of the affine MVP candidate for CP2 is derived as the CPMVP of CP1. Furthermore, if the affine MVP candidates include a candidate motion vector for CP0 and a candidate motion vector for CP2, the candidate motion vector of the affine MVP candidate for CP0 is derived as the CPMVP of CP0, and the candidate motion vector of the affine MVP candidate for CP2 is derived as the CPMVP of CP2.

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

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

[0294] The encoding apparatus derives control point motion vector differences (CPMVDs) for the CPs of the current block based on the CPMVP and the CPMV (S2030). The encoding apparatus derives CPMVDs for the CPs of the current block based on the CPMVP and the CPMV for each of the CPs.

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

[0296] The motion prediction information also includes the affine MVP candidate index, which may indicate the selected affine MVP candidate from among affine MVP candidates included in an affine motion vector predictor (MVP) candidate list for the current block.

[0297] Meanwhile, as an example, the encoding device may derive predicted samples for the current block based on the CPMV, derive residual samples for the current block based on original samples and predicted samples for the current block, generate information about the residual for the current block based on the residual samples, and encode the information about the residual. The image information may include information about the residual.

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

[0299] FIG. 21 schematically illustrates an encoding device that performs an image encoding method according to the present document. The method disclosed in FIG. 20 is performed by the encoding device disclosed in FIG. 21. Specifically, for example, a prediction unit of the encoding device of FIG. 21 performs steps S2000 to S2030 of FIG. 20, and an entropy encoding unit of the encoding device of FIG. 21 performs step S2040 of FIG. 20. Although not shown, a process of deriving predicted samples for the current block based on the CPMV is performed by the prediction unit of the encoding device of FIG. 21, a process of deriving residual samples for the current block based on original samples and predicted samples for the current block is performed by a subtraction unit of the encoding device of FIG. 21, a process of generating information about the residual for the current block based on the residual samples is performed by a transformation unit of the encoding device of FIG. 21, and a process of encoding information about the residual is performed by an entropy encoding unit of the encoding device of FIG. 21.

[0300] Figure 22 schematically illustrates an image decoding method by a decoding device according to the present document. The method disclosed in Figure 22 is performed by the decoding device disclosed in Figure 2. Specifically, for example, S2200 in Figure 22 is performed by an entropy decoding unit of the decoding device, S2210 to S2250 are performed by a prediction unit of the decoding device, and S2260 is performed by an adder of the decoding device. Also, although not shown, a process of obtaining information about the residual of the current block via a bitstream is performed by the entropy decoding unit of the decoding device, and a process of deriving the residual sample for the current block based on the residual information is performed by an inverse transform unit of the decoding device.

[0301] The decoding device obtains motion prediction information for a current block from a bitstream (S2200). The decoding device obtains image information including the motion prediction information from the bitstream.

[0302] Also, for example, the motion prediction information includes information on Control Point Motion Vector Differences (CPMVD) for the control points (CPs) of the current block, i.e., the motion prediction information includes information on CPMVD for each of the CPs of the current block.

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

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

[0305] For example, if 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 can be available if all of the candidate motion vectors are available.

[0306] For example, if a 4-affine motion model is applied to the current block, the CPs of the current block include 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 corner of the current block, and CP1 indicates the upper right corner of the current block.

[0307] The constructed affine MVP candidates include a candidate motion vector for the CP0 and a candidate motion vector for the CP1, where the candidate motion vector for the CP0 may be a motion vector of a first block, and the candidate motion vector for the CP1 may be a motion vector of a second block.

[0308] Furthermore, the first block may be a block whose first reference picture identified by checking neighboring blocks in the first group according to a first specific order is the same as the reference picture of the current block. Here, if 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 may be available. For example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from neighboring block A to neighboring block B to neighboring block C.

[0309] Furthermore, the second block may be a block whose first identified reference picture is the same as the reference picture of the current block when neighboring blocks in the second group are checked according to a second specific order. Here, if the reference picture of the second block in the second group is the same as the reference picture of the current block, a candidate motion vector for CP1 may be available. For example, the second group may include neighboring blocks D and E, and the second specific order may be from neighboring block D to neighboring block E.

[0310] On the other hand, 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 surrounding block A may be a block including a sample at (-1,-1) coordinates, the surrounding block B may be a block including a sample at (0,-1) coordinates, the surrounding block C may be a block including a sample at (-1,-0) coordinates, the surrounding block D may be a block including a sample at (W-1,-1) coordinates, and the surrounding block E may be a block including a sample 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 upper peripheral block located on the leftmost side among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located on the topmost side among the left peripheral blocks of the current block, the peripheral block D may be the upper peripheral block located on the rightmost side 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, if at least one of the candidate motion vectors of CP0 and the candidate motion vectors of CP1 is unavailable, the constructed affine MVP candidate may not be available.

[0312] Alternatively, for example, if a 6-affine motion model is applied to the current block, the CPs of the current block include CP0, CP1, and CP2. If a candidate motion vector for CP0 is available, a candidate motion vector for CP1 is available, and a candidate motion vector for CP2 is available, the constructed affine MVP candidates are available, and the affine MVP candidate list can include the constructed affine MVP candidates. Here, CP0 indicates the upper left corner of the current block, CP1 indicates the upper right corner of the current block, and CP2 indicates the lower left corner of the current block.

[0313] The constructed affine MVP candidates include a candidate motion vector for CP0, a candidate motion vector for CP1, and a candidate motion vector for CP2, where the candidate motion vector for CP0 may be a motion vector of a first block, the candidate motion vector for CP1 may be a motion vector of a second block, and the candidate motion vector for CP2 may be a motion vector of a third block.

[0314] Furthermore, the first block may be a block whose first reference picture identified by checking neighboring blocks in the first group according to a first specific order is the same as the reference picture of the current block. Here, if 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 may be available. For example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from neighboring block A to neighboring block B to neighboring block C.

[0315] Furthermore, the second block may be a block whose first identified reference picture is the same as the reference picture of the current block when neighboring blocks in the second group are checked according to a second specific order. Here, if the reference picture of the second block in the second group is the same as the reference picture of the current block, a candidate motion vector for CP1 may be available. For example, the second group may include neighboring blocks D and E, and the second specific order may be from neighboring block D to neighboring block E.

[0316] Furthermore, the third block may be a block whose first identified reference picture is the same as the reference picture of the current block when neighboring blocks in the third group are checked according to a third specific order. Here, if the reference picture of the third block in the third group is the same as the reference picture of the current block, a candidate motion vector for CP2 may be available. For example, the third group may include neighboring blocks F and G, and the third specific order may be from neighboring block F to neighboring block G.

[0317] On the other hand, 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 surrounding block A may be a block including a sample at a (-1,-1) coordinate, the surrounding block B may be a block including a sample at a (0,-1) coordinate, the surrounding block C may be a block including a sample at a (-1,0) coordinate, the surrounding block D may be a block including a sample at a (W-1,-1) coordinate, the surrounding block E may be a block including a sample at a (W,-1) coordinate, the surrounding block F may be a block including a sample at a (-1,H-1) coordinate, and the surrounding block G may be a block including a sample at a (-1,H) coordinate. 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 upper leftmost peripheral block among the upper peripheral blocks of the current block, the peripheral block C may be the leftmost peripheral block among the left peripheral blocks of the current block, the peripheral block D may be the upper rightmost 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 leftmost 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.

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

[0319] Alternatively, for example, if a 4-affine motion model is applied to the current block, a CP is selected based on the width and height of the current block, and the constructed affine MVP candidates include candidate motion vectors for the selected CP.

[0320] For example, if the width of the current block is greater than or equal to its height, the CPs of the current block include 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 corner of the current block, and CP1 indicates the upper right corner of the current block.

[0321] The constructed affine MVP candidates include a candidate motion vector for the CP0 and a candidate motion vector for the CP1, where the candidate motion vector for the CP0 may be a motion vector of a first block, and the candidate motion vector for the CP1 may be a motion vector of a second block.

[0322] Furthermore, the first block may be a block whose first reference picture identified by checking neighboring blocks in the first group according to a first specific order is the same as the reference picture of the current block. Here, if 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 may be available. For example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from neighboring block A to neighboring block B to neighboring block C.

[0323] Furthermore, the second block may be a block whose first identified reference picture is the same as the reference picture of the current block when neighboring blocks in the second group are checked according to a second specific order. Here, if the reference picture of the second block in the second group is the same as the reference picture of the current block, a candidate motion vector for CP1 may be available. For example, the second group may include neighboring blocks D and E, and the second specific order may be from neighboring block D to neighboring block E.

[0324] On the other hand, 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 surrounding block A may be a block including a sample at (-1,-1) coordinates, the surrounding block B may be a block including a sample at (0,-1) coordinates, the surrounding block C may be a block including a sample at (-1,-0) coordinates, the surrounding block D may be a block including a sample at (W-1,-1) coordinates, and the surrounding block E may be a block including a sample 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 upper peripheral block located on the leftmost side among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located on the topmost side among the left peripheral blocks of the current block, the peripheral block D may be the upper peripheral block located on the rightmost side 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.

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

[0326] Also, if the width of the current block is smaller than its height, the CP0 and CP2 of the current block can be included. If a candidate motion vector for CP0 is available and a 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 upper left corner of the current block, and CP2 indicates the lower left corner of the current block.

[0327] The constructed affine MVP candidates include a candidate motion vector for the CP0 and a candidate motion vector for the CP2, where the candidate motion vector for the CP0 may be a motion vector of a first block, and the candidate motion vector for the CP2 may be a motion vector of a third block.

[0328] Furthermore, the first block may be a block whose first reference picture identified by checking neighboring blocks in the first group according to a first specific order is the same as the reference picture of the current block. Here, if 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 may be available. For example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from neighboring block A to neighboring block B to neighboring block C.

[0329] Furthermore, the third block may be a block whose first identified reference picture is the same as the reference picture of the current block when neighboring blocks in the third group are checked according to a third specific order. Here, if the reference picture of the third block in the third group is the same as the reference picture of the current block, a candidate motion vector for CP2 may be available. For example, the third group may include neighboring blocks F and G, and the third specific order may be from neighboring block F to neighboring block G.

[0330] On the other hand, 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 surrounding block A may be a block including a sample at (-1,-1) coordinates, the surrounding block B may be a block including a sample at (0,-1) coordinates, the surrounding block C may be a block including a sample at (-1,-0) coordinates, the surrounding block F may be a block including a sample at (-1,H-1) coordinates, and the surrounding block G may be a block including a sample at (-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 upper peripheral block located on the leftmost side among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located on the topmost side among the left peripheral blocks of the current block, the peripheral block F may be the left peripheral block located on the bottommost side among the left peripheral blocks of the current block, and the peripheral block G may be the lower right corner peripheral 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 not be available.

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

[0333] The inherited affine MVP candidate is derived based on a specific block among neighboring blocks of the current block, where the specific block is coded using an affine motion model and the reference picture of the specific block may be the same as the reference picture of the current block.

[0334] Here, the specific block may be a block that satisfies a condition first when checking the neighboring blocks in a specific order. The condition may be that the block is coded using an affine motion model and 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 neighboring 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 may 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 shown in Equation 1 or 3 above.

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

[0337] Meanwhile, if fewer than two affine MVP candidates are derived through the above process, the affine MVP candidates include MVP candidates in the existing HEVC standard.

[0338] That is, for example, if fewer than two affine MVP candidates are derived through the above process, the decoding device can derive MVP candidates in the existing HEVC standard.

[0339] Meanwhile, the affine motion model applied to the current block is derived based on 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 may 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 may be obtained via the bitstream. Image information includes the affine type information.

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

[0341] The decoding device selects a specific affine MVP candidate from the affine MVP candidates included in the affine MVP candidate list and derives the selected affine MVP candidate as a CPMVP for the CP of the current block. For example, the decoding device obtains the affine MVP candidate index for the current block from a bitstream and derives the affine MVP candidate indicated by the affine MVP candidate index from the affine MVP candidate list as a CPMVP candidate for the CP of the current block. Specifically, if the affine MVP candidates include 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 of CP0, and the candidate motion vector for CP1 of the affine MVP candidate is derived as the CPMVP of CP1. Furthermore, if the affine MVP candidates include a candidate motion vector for CP0, a candidate motion vector for CP1, and a candidate motion vector for CP2, the candidate motion vector of the affine MVP candidate for CP0 can be derived as the CPMVP of CP0, and the candidate motion vector of the affine MVP candidate for CP2 can be derived as the CPMVP of CP1. Furthermore, if the affine MVP candidates include a candidate motion vector for CP0 and a candidate motion vector for CP2, the candidate motion vector of the affine MVP candidate for CP0 can be derived as the CPMVP of CP0, and the candidate motion vector of the affine MVP candidate for CP2 can be derived as the CPMVP of CP2.

[0342] The decoding apparatus derives control point motion vector differences (CPMVDs) for the CPs of the current block based on the motion prediction information (S2230). The motion prediction information includes information about the CPMVDs for each of the CPs, and the decoding apparatus derives the CPMVDs for each of the CPs of the current block based on the information about the CPMVDs for each of the CPs.

[0343] The decoding device derives control point motion vectors (CPMV) for the CPs 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 CPMVD for each CP. For example, the decoding device derives CPMV for the CP by adding the CPMVP and CPMVD for each CP.

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

[0345] The decoding device may derive predicted samples for the current block based on the motion vector in sub-block units or sample units, derive a reference area in a reference picture based on the motion vector in sub-block units or sample units, and generate predicted samples for the current block based on reconstructed samples in the reference area.

[0346] The decoding device generates a reconstructed picture for the current block based on the derived predicted samples (S2260). The decoding device generates a reconstructed picture for the current block based on the derived predicted samples. Depending on the prediction mode, the decoding device can directly use the predicted samples as reconstructed samples, or can generate reconstructed samples by adding residual samples to the predicted samples. If residual samples for the current block exist, the decoding device obtains information about the residuals for the current block from the bitstream. The information about the residuals includes transform coefficients related to the residual samples. The decoding device derives the residual samples (or residual sample array) for the current block based on the residual information. The decoding device generates reconstructed samples based on the predicted samples and the residual samples, and derives a reconstructed block or picture based on the reconstructed samples. 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 image quality as needed.

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

[0348] According to the aforementioned document, it is possible to improve the efficiency of image coding based on affine motion prediction.

[0349] In addition, according to this document, when deriving an affine MVP candidate list, a constructed affine MVP candidate can be added only if all candidate motion vectors for the CP of the constructed affine MVP candidate are available, thereby reducing the complexity of the process of deriving a constructed affine MVP candidate and the process of constructing an affine MVP candidate list and improving coding efficiency.

[0350] In the above embodiments, the method is described based on a flowchart as a series of steps or blocks, but this document is not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps described above. 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 may be deleted without affecting the scope of this document.

[0351] The embodiments described herein may be implemented on a processor, microprocessor, controller, or chip. For example, the functional units shown in the figures may be implemented on a computer, processor, microprocessor, controller, or chip. In this case, information (e.g., information on instructions) or algorithms for implementation may be stored on a digital storage medium.

[0352] In addition, the decoding and encoding devices to which this document applies may be included in multimedia broadcast transmitting / receiving devices, mobile communication terminals, home cinema video devices, digital cinema video devices, surveillance cameras, video conversation devices, real-time communication devices such as video communications, mobile streaming devices, storage media, camcorders, custom video (VoD) service providing devices, over-the-top video (OTT) devices, internet streaming service providing devices, three-dimensional (3D) video devices, virtual reality (VR) devices, augmented reality (AR) devices, image telephone video devices, transportation terminals (e.g., vehicle terminals (including autonomous vehicles), airplane terminals, ship terminals, etc.), medical video devices, etc., and may be used to process video signals and data signals. For example, over-the-top video (OTT) devices include game consoles, Blu-ray players, internet-connected TVs, home theater systems, smartphones, tablet PCs, and digital video recorders (DVRs).

[0353] Furthermore, the processing method to which this document is applied can be produced in the form of a computer-executable program and stored in a computer-readable recording medium. Multimedia data having a 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, Blu-ray Discs (BDs), Universal Serial Buses (USBs), ROMs, PROMs, EPROMs, EEPROMs, RAMs, CD-ROMs, magnetic tapes, floppy disks, and optical data storage devices. The computer-readable recording medium also includes media realized in the form of carrier waves (e.g., transmission via the Internet). The bitstream generated by the encoding method can be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.

[0354] Furthermore, the embodiments of the present document may be realized as a computer program product by program code, which may be stored on a computer-readable carrier when executed on a computer according to the embodiments of the present invention.

[0355] FIG. 24 exemplarily shows a structural diagram of a content streaming system to which this document applies.

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

[0357] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, or video camera into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, or camcorder directly generates 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 during 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 serves as a medium for informing the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, which then transmits the multimedia data to the user. Here, the content streaming system may include a separate control server, which controls commands and responses between devices in the content streaming system.

[0360] The streaming server receives content from a media repository 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, the streaming server can store the bitstream for a certain period of time to provide a smooth streaming service.

[0361] Examples of the user devices include mobile phones, smartphones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, head mounted displays (HMDs)), digital TVs, desktop computers, digital signage, etc. Each server in the content streaming system can be operated as a distributed server, and in this case, data received by each server can be processed in a distributed manner.

Claims

1. An image decoding method performed by a decoding device, obtaining prediction-related information for a current block from a bitstream; constructing an affine motion vector predictor (mvp) candidate list for the current block; deriving a control point motion vector (CPMV) for a control point (CP) of the current block based on the prediction-related information and the affine motion vector candidate list; deriving a predicted sample for the current block based on the CPMV; generating a reconstructed picture for the current block based on the derived prediction samples; Based on the availability of constructed affine MVP candidates, the affine MVP candidate list includes the constructed affine MVP candidates; The constructed affine mvp candidates include candidate motion vectors for a first CP, a second CP, and a third CP of the current block; The available candidate motion vector for the first CP is derived based on the fact that a reference picture of a first block in a first surrounding block group for the first CP is equal to a reference picture of the current block; The available candidate motion vector for the second CP is derived based on the fact that a reference picture of a second block in a second surrounding block group for the second CP is equal to the reference picture of the current block; The available candidate motion vector for the third CP is derived based on the fact that a reference picture of a third block in a third neighboring block group for the third CP is equal to the reference picture of the current block; the constructed affine mvp candidate is available based on the availability of the candidate motion vectors for the first CP, the second CP, and the third CP; A method in which the constructed affine MVP candidate is not available and is not included in the affine MVP candidate list based on the fact that at least one of the candidate motion vector for the first CP, the candidate motion vector for the second CP, or the candidate motion vector for the third CP is not available.

2. An image encoding method performed by an encoding device, constructing an affine motion vector predictor (mvp) candidate list for the current block; deriving a control point motion vector (CPMV) for a control point (CP) of the current block based on the affine motion vector candidate list; deriving a predicted sample for the current block based on the CPMV; encoding prediction-related information for the current block; Based on the availability of constructed affine MVP candidates, the affine MVP candidate list includes the constructed affine MVP candidates; The constructed affine mvp candidates include candidate motion vectors for a first CP, a second CP, and a third CP of the current block; The available candidate motion vector for the first CP is derived based on the fact that a reference picture of a first block in a first surrounding block group for the first CP is equal to a reference picture of the current block; The available candidate motion vector for the second CP is derived based on the fact that a reference picture of a second block in a second surrounding block group for the second CP is equal to the reference picture of the current block; The available candidate motion vector for the third CP is derived based on the fact that a reference picture of a third block in a third neighboring block group for the third CP is equal to the reference picture of the current block; the constructed affine mvp candidate is available based on the availability of the candidate motion vectors for the first CP, the second CP, and the third CP; A method in which the constructed affine MVP candidate is not available and is not included in the affine MVP candidate list based on the fact that at least one of the candidate motion vector for the first CP, the candidate motion vector for the second CP, or the candidate motion vector for the third CP is not available.

3. In a method for transmitting data for an image, obtaining a bitstream of image information including prediction-related information for a current block; transmitting the data including the bitstream of the image information including the prediction-related information; the prediction-related information is information about a prediction sample for the current block; The prediction sample is derived based on a control point motion vector (CPMV) for a control point (CP) of the current block, The CPMV is derived based on an affine motion vector predictor (mvp) candidate list for the current block; Based on the availability of constructed affine MVP candidates, the affine MVP candidate list includes the constructed affine MVP candidates; The constructed affine mvp candidates include candidate motion vectors for a first CP, a second CP, and a third CP of the current block; The available candidate motion vector for the first CP is derived based on the fact that a reference picture of a first block in a first surrounding block group for the first CP is equal to a reference picture of the current block; The available candidate motion vector for the second CP is derived based on the fact that a reference picture of a second block in a second surrounding block group for the second CP is equal to the reference picture of the current block; The available candidate motion vector for the third CP is derived based on the fact that a reference picture of a third block in a third neighboring block group for the third CP is equal to the reference picture of the current block; the constructed affine mvp candidate is available based on the availability of the candidate motion vectors for the first CP, the second CP, and the third CP; A method in which the constructed affine MVP candidate is not available and is not included in the affine MVP candidate list based on the fact that at least one of the candidate motion vector for the first CP, the candidate motion vector for the second CP, or the candidate motion vector for the third CP is not available.

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