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

By adopting a decoding method based on affine motion prediction in the video encoding system, affine motion vector prediction candidates are constructed for the current block only when all candidate motion vectors are available, solving the problem of low encoding efficiency of high-resolution videos in the prior art, and achieving higher encoding efficiency and simplified process.

JP7654866B2Active Publication Date: 2025-04-01LG ELECTRONICS INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024074275
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2018-08-06
Filing Date
2024-05-01
Publication Date
2025-04-01
Estimated Expiration
2039-08-06

AI Technical Summary

Technical Problem

The prior art is difficult to effectively improve the encoding efficiency of high-resolution and high-quality videos, resulting in increased transmission and storage costs.

Method used

By adopting a decoding method based on affine motion prediction in the video encoding system, affine motion vector prediction candidates are constructed for the current block only when all candidate motion vectors are available, and affine motion vector prediction candidate list is constructed for prediction.

Benefits of technology

The overall compression efficiency of video encoding is improved, the process of constructing affine motion vector prediction candidates is simplified, the calculation complexity is reduced, and the encoding efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007654866000012
    Figure 0007654866000012
  • Figure 0007654866000013
    Figure 0007654866000013
  • Figure 0007654866000014
    Figure 0007654866000014
Patent Text Reader

Abstract

To provide a method and an apparatus for improving video coding efficiency.SOLUTION: An image decoding method performed by a decoding apparatus comprises the steps of: obtaining motion prediction information for a current block from a bitstream; generating an affine MVP candidate list for the current block; deriving CPMVPs for CPs of the current block on the basis of the affine MVP candidate list; deriving CPMVDs 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; and deriving prediction samples for the current block on the basis of the CPMVs.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, the demand for high-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images is increasing in various fields. As the image data has higher resolution and quality, the amount of information or bits to be transmitted increases relatively compared to conventional image data, so that when the image data is transmitted using a medium such as a conventional wired or wireless broadband line or when the image data is stored using a conventional storage medium, the transmission cost and storage cost increase.

[0003] Therefore, in order to effectively transmit, store, and play back high-resolution, high-quality video information, a highly efficient video compression technique is required. 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 objective 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 predicted 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, a decoding device for performing image decoding is provided. 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 (CPMVP) for a control point (CP) of the current block based on the affine MVP candidate list, derives control point motion vector differences (CPMVD) for the CP of the current block based on the motion prediction information, derives control point motion vectors (CPMV) for the CP of the current block based on the CPMVP and the CPMVD, 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, wherein if a constructed affine MVP candidate is available, the affine MVP candidate list includes the constructed affine MVP candidate, and the constructed affine MVP candidate is a candidate motion vector for the CP. 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 (CPMVP) 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 (CPMVD) for the CP of the current block based on the CPMVP and the CPMV, and encoding motion prediction information including information regarding the CPMVD, 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 (CPMVP) 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 (CPMVD) for the CP of the current block based on the CPMVP and the CPMV, a subtraction unit that derives control point motion vector differences (CPMVD) 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 regarding the CPMVD, wherein if a constructed affine MVP candidate is available, the affine MVP candidate list includes the constructed affine MVP candidate, and the constructed affine MVP candidate is a candidate motion vector for the CP. The constructed affine MVP candidate is available if the candidate motion vector is available. Effect 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 description of the drawings]

[0013] [Figure 1] FIG. 1 is a diagram illustrating the configuration of a video encoding device to which this document can be applied. [Diagram 2] FIG. 1 is a diagram illustrating the configuration of a video decoding device to which this document can be applied. [Diagram 3] 10 illustrates an example of a motion represented via the affine motion model. [Figure 4] 1 exemplarily illustrates the affine motion model in which motion vectors for three control points are used. [Diagram 5] 1 exemplarily illustrates the affine motion model in which motion vectors for two control points are used. [Figure 6] A method of deriving a motion vector on a sub-block basis 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. 2 is a diagram illustrating a method for deriving a motion vector predictor at a control point according to one embodiment of the present document. [Figure 9] FIG. 2 is a diagram illustrating a method for deriving a motion vector predictor at a control point according to one embodiment of the present document. [Figure 10] 13 shows an example of affine prediction performed when a surrounding block A is selected as an affine merge candidate. [Figure 11]4 shows an example of neighboring blocks for deriving the inherited affine candidates. [Figure 12] 13 shows an example of spatial candidates for the constructed affine candidates. [Figure 13] An example of constructing an affine MVP list is given below. [Figure 14] An example of deriving the constructed candidates will be described below. [Figure 15] An example of deriving the constructed candidates will be described 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 a 6-affine motion model is applied to the current block will be described. [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 by an encoding device according to the present 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 PREFERRED EMBODIMENTS

[0014] Since this document can be modified in various ways and can 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 a specific embodiment. Terms commonly used in this specification are used only to describe a specific embodiment, and are not intended to limit the technical ideas of this document. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, the terms "include" 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, each component in the drawings described in this document is shown independently for the convenience of describing different characteristic functions, and does not mean that each component is realized by different hardware or software. For example, two or more components among the components may be combined to form one component, or one component may be divided into multiple components. An embodiment in which each component is integrated and / or separated is also included in the scope of this document as long as it does not deviate from the essence of this document.

[0016] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. In the following, 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 mean a collection of a series of images over time. A picture is generally a unit indicating one image at a specific time, and a slice is a unit constituting a part of a picture in coding. One picture may be composed of multiple slices or tile groups, and pictures, slices, and tile groups may be used interchangeably as necessary. In this document, an image may be a still image, or may indicate an image over time constituting a video. Hereinafter, image coding may be interchangeable with video coding. Image coding may also be interchangeable with picture coding or frame coding.

[0018] A pixel or a pel may mean the smallest unit that constitutes one picture (or 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 the region. A unit may be used in combination with terms such as block or area, depending on the case. Alternatively, a unit may include a luma component block and a chroma component (cb, cr) block. In a general case, an M×N 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] As an example, the processing unit may be called a coding unit (CU). In this case, the coding units are recursively divided from the largest coding unit (LCU) according to a quad-tree binary-tree (QTBT) structure. For example, one coding unit is divided into a plurality of coding units of a deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary tree structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure and the ternary tree structure may be applied later. 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 a deeper depth as necessary, and a coding unit of an optimal size may be used as the final coding unit. Here, the coding procedure includes procedures such as prediction, transformation, and restoration, which will be described later.

[0024] As another example, the processing unit includes a coding unit (Cu), a prediction unit (PU), or a transform unit (TU). The coding units are split from a largest coding unit (LCU) into coding units of deeper depths according to a quad tree structure. In this case, the largest coding unit may be used as the final coding unit immediately based on coding efficiency according to image characteristics, or the coding unit may be recursively split into coding units of lower depths as necessary, and a coding unit of 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 means a coding unit that is a base for partitioning or splitting 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 a unit that is divided from the coding unit according to a quad tree structure and derives transform coefficients and / or a unit that derives a residual signal from the transform coefficients. Hereinafter, the coding unit may be called a coding block (CB), the prediction unit may be called a prediction block (PB), and the transform unit may be called 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 a prediction sample 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 the current block based on a reference sample outside the current block in 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 an interpolation of neighboring reference samples of the current block, and (ii) derive the prediction sample based on a reference sample that exists in a specific (prediction) direction with respect to the prediction sample among the neighboring reference samples of the current block. In the case of (i), it may be called a non-directional mode or a non-angular mode, and in the case of (ii), it may be called a directional mode or an angular mode. In intra prediction, the prediction mode may have, for example, 33 directional prediction modes and at least two or more non-directional modes. The non-directional modes may include a DC prediction mode and a planar mode. The prediction unit 110 may also determine a prediction mode to be applied to the current block using a prediction mode applied to a neighboring block.

[0028] In the case of inter prediction, the prediction unit 110 may derive a prediction sample for the current block based on a sample specified by a motion vector on a reference picture. The prediction unit 110 may derive a prediction 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 case of the skip mode and the merge mode, the prediction unit 110 may use motion information of a neighboring block as motion information of the current block. In the case of the skip mode, unlike the merge mode, a difference (residual) between a prediction sample and an original sample is not transmitted. In the case of the MVP mode, a 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, the 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). The motion information includes a motion vector and a reference picture index. Information such as prediction mode information and motion information can be (entropy) encoded and output in the form of a bitstream.

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

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

[0032] The transform unit 122 transforms the 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 predictive block that spatially overlaps with the transform block. For example, if intra prediction is applied to the coding block or the predictive block that overlaps with the transform block and the transform block is a 4×4 residual array, the residual samples may be transformed using a Discrete Sine Transform (DST) transform kernel, and 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 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form by a coefficient scanning method. Here, the rearrangement unit 124 has been described as a separate component, but 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 the 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., values ​​of syntax elements, etc.) together with or separately from the quantized transform coefficients using entropy encoding or a preset method. The encoded information is transmitted or stored in a network abstraction layer (NAL) unit in the form of a bitstream. The bitstream may be transmitted via a network or stored in a digital storage medium. Here, the network may include a broadcast network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc.

[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 combines the residual samples and the prediction samples to reconstruct a picture. The residual samples and the prediction samples may be added in units of blocks to generate a reconstructed block. Although the adder 140 has been described as a separate component, the adder 140 may be a part of the prediction unit 110. Meanwhile, the adder 140 may be called 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. By the deblocking filtering and / or the sample adaptive offset, artifacts at block boundaries in the reconstructed picture and distortion in the quantization process may be corrected. 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 filter and / or the sample adaptive offset are 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 been filtered 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, a 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. Here, the residual processing module 220 includes a rearrangement module 221, a dequantization module 222, and an inverse transform module 223. Although not shown, the video decoding device 200 also includes a receiver for receiving a bitstream including 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 reconstruct 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 can perform video decoding using a processing unit applied in a video encoding device. Thus, a processing unit block of the video decoding may be a coding unit as an example, and may be a coding unit, a prediction unit, or a transform unit as another example. The coding unit may be divided according to 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 which case the prediction block may be a block derived or 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 or a unit for deriving a residual signal from the transform coefficients.

[0045] The entropy decoding unit 210 may parse the bitstream and output information required for video reconstruction 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 required for video reconstruction and quantized values ​​of transform coefficients related to the residual.

[0046] More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element in the bitstream, determines a context model using information on the syntax element to be decoded and decode information on the neighboring and 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 symbol / bin 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 a prediction unit 230, and the residual values ​​entropy decoded by the entropy decoding unit 210, i.e., the quantized transform coefficients, are input to a reordering unit 221.

[0048] The reordering unit 221 reorders the quantized transform coefficients into a two-dimensional block format. The reordering unit 221 performs the reordering in response to the coefficient scanning performed in the encoding device. Here, the reordering unit 221 has been described as a separate component, but the reordering 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 in 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 on the prediction. Here, the unit for determining whether to apply intra prediction or inter prediction may differ from the unit for generating a prediction sample. In addition, the unit for generating a prediction sample may differ in inter prediction and intra prediction. For example, whether to apply inter prediction or intra prediction may be determined in units of CU. In addition, for example, in inter prediction, a prediction mode may be determined in units of PU and a prediction sample may be generated, and in intra prediction, a prediction mode may be determined in units of PU and a prediction sample may be generated in units of TU.

[0053] In the case of intra prediction, the prediction unit 230 may derive a prediction sample for the current block based on neighboring reference samples in the current picture. The prediction unit 230 may derive a prediction sample 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, a prediction mode to be applied to the current block may be determined using an intra prediction mode of a neighboring block.

[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 case of the skip mode and the merge mode, the motion information of the neighboring blocks may be used as the motion information of the current block, where the neighboring blocks include spatial neighboring blocks and temporal neighboring blocks.

[0056] The prediction unit 230 constructs a merge candidate list with 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 the temporal neighboring blocks is used in the skip mode and the merge mode, the top picture on the reference picture list can be used as the reference picture.

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

[0058] In the MVP mode, the motion vector of the current block may be derived using the motion vectors of the 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 motion vectors of reconstructed spatial neighboring blocks and / or motion vectors corresponding to a Col block, which is a temporal neighboring block. In the merge mode, a motion vector of a candidate block selected from the merge candidate list is used as a motion vector of a current block. The prediction information includes a merge index indicating a candidate block having an optimal motion vector selected from among the candidate blocks included in the merge candidate list. Here, the prediction unit 230 may derive a 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 vector of the restored spatial neighboring block and / or the motion vector corresponding to the Col block, which is a temporal neighboring block. That is, the motion vector of the restored spatial neighboring block and / or the motion vector corresponding to the Col block, which is a temporal neighboring block, may be used as a motion vector candidate. 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 of the current block from the motion vector candidates included in the motion vector candidate list using the motion vector index. A prediction unit of an encoding device may obtain a motion vector difference (MVD) between a motion vector of a current block and a motion vector predictor, encode the MVD, and output the MVD in the form of a bitstream. That is, the MVD is obtained as a value 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 difference included in the prediction information, and derive the motion vector of the current block by adding the motion vector difference and the motion vector predictor. The prediction unit may also obtain or derive from information relating to the prediction a reference picture index, etc., that indicates a reference picture.

[0061] The adder 240 may reconstruct a current block or a current picture by adding a residual sample and a predicted sample. The adder 240 may also reconstruct a current picture by adding a residual sample and a predicted sample in block units. When a skip mode is applied, the residual is not transmitted, and therefore the predicted sample may be a reconstructed sample. Although the adder 240 is described as a separate component here, the adder 240 may be a part of the prediction unit 230. Meanwhile, the adder 240 may be called 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 (a decoded picture) or information required for decoding. Here, the reconstructed picture may be a reconstructed picture for which a filtering procedure has been completed by the filter unit 250. For example, the memory 260 may store a picture used in inter prediction. Here, the picture 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. Also, the memory 260 may output the reconstructed picture according to an output order.

[0064] Meanwhile, in the case of inter prediction, an inter prediction method considering image distortion 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 and improves the accuracy of inter prediction despite deformation 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 described below.

[0066] Figure 3 exemplarily illustrates motions represented through the affine motion model. Referring to Figure 3, motions that can be represented through the affine motion model include translation motion, scale motion, rotation motion, and shear motion. That is, not only the translation motion in which an image (part of it) moves on a plane according to the time flow shown in Figure 3, but also the scale motion in which an image (part of it) is scaled according to the time flow, the rotation motion in which an image (part of it) is rotated according to the time flow, and the shear motion in which an image (part of it) is deformed to a balanced square according to the time flow can be efficiently represented through the affine inter prediction.

[0067] The encoding / decoding apparatus 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 prediction accuracy and thereby improving the image compression performance. Also, since a motion vector for at least one control point of the current block can be derived using the motion vectors of neighboring blocks of the current block, the data amount burden for added additional 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 illustrates 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 Fig. 4. Hereinafter, the control point of the (0,0) sample position can be expressed as CP0, the control point of the (w,0) sample position can be expressed as CP1, and the control point of the (0,h) sample position can be expressed as CP2.

[0071] Using the above-mentioned 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 in the current block 400, y represents the y component of the position of the target sample in 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 a sample position in the current block can be derived based on Equation 1. That is, according to the affine motion model, a motion vector v0 (v 0x , v 0y ), v1(v 1x , v 1y ), v2(v 2x , v 2y ) is scaled to derive a motion vector of the target sample according to the target sample position. 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 in the current block 400, y represents the y component of the position of the target sample in 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 may be referred to as a six parameter affine motion model or AF6.

[0079] 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 express three types of motion including translational motion, scale motion, and rotational motion. The affine motion model expressing three types of motion can be expressed 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 Fig. 5. Hereinafter, the control point of the (0,0) sample position can be expressed as CP0, and the control point of the (w,0) sample position can be expressed as CP1.

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

[0083]

number

[0084] In the formula, w represents the width of the current block 500, and v 0x , v 0y represent the x 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 in the current block 500, y represents the y component of the position of the target sample in 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] In the formula, 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 in the current block 500, y represents the y component of the position of the target sample in 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, the 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 expressed as an affine motion vector field (MVF).

[0088] Meanwhile, as described above, a motion vector for each sample can be derived through the affine motion model, which can significantly improve the accuracy of inter prediction, 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 derived.

[0090] Fig. 6 exemplarily illustrates a method of deriving a motion vector in sub-block units based on the affine motion model. Fig. 6 exemplarily illustrates a case where the size of the current block is 16x16 and the motion vector is derived in 4x4 sub-block units. The sub-blocks can be set to various sizes, for example, when the sub-blocks are set to an nxn size (n is a positive integer, ex, n is 4), a motion vector can be derived in nxn sub-block units in 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 of each sub-block may be derived using a center or center lower right side sample position of each sub-block as a representative coordinate. Here, the center lower right side position may refer to a sample position located at the lower right side of four samples located at the center of the sub-block. For example, when 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 of the sub-block. However, when n is an even number, four samples may be adjacently located 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 of 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 of each sub-block by substituting each of the representative coordinates of the sub-block into the above-mentioned Equation 1 or 3. The motion vector of a sub-block within a 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 the CPMV1 of the current block, w represents the width of the current block, h represents the height of the current block, and MvPre represents motion vector fraction accuracy. For example, the motion vector fraction accuracy may 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 MVD for the motion vector of the control point is not transmitted. That is, the affine merge mode can represent an encoding / decoding method in which CPMV for each of two or three control points from neighboring blocks of the current block is derived and prediction is performed without coding for MVD (motion vector difference) like the conventional skip / merge mode.

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

[0098] The affine inter mode may represent inter prediction that 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, the encoding device may derive a control point point motion vector predictor (CPMVP) and a control point 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 a 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 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 the 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, and a combination of CPMVPs CP0, CP1, and CP2 in a six parameter affine motion model.

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

[0102] 7, the affine motion prediction method can be roughly expressed as follows: When the affine motion prediction method starts, a CPMV pair may be obtained (S700). Here, the CPMV pair may 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, there may be two affine prediction modes for determining the CPMV0 and CPMV1. Here, the two affine prediction modes may include an affine inter mode and an affine merge mode. The affine inter mode may clearly determine CPMV0 and CPMV1 by signaling two pieces of motion vector difference (MVD) information for CPMV0 and CPMV1. On the other hand, the affine merge mode may derive a CPMV pair without signaling MVD information.

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

[0106] In the affine merge mode, the encoding apparatus may signal an index for a neighboring block coded in the affine mode for deriving the CPMV of the current block to the decoding apparatus, and may further signal a difference value between the CPMV of the neighboring block and the CPMV of the current block. Here, the affine merge mode may configure an affine merge candidate list based on the neighboring blocks, and the index for the neighboring block may represent a neighboring block to be referenced for deriving the CPMV of the current block from the affine merge candidate list. 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 on the CPMVP and information on the CPMVD to the decoding device. Here, the affine MVP mode may configure an affine MVP candidate list based on neighboring blocks, and the information on the CPMVP may represent neighboring blocks to be referenced in order to derive the CPMVP for the CPMV of the current block from the affine MVP candidate list. 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 6-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 can represent the CPMVP of CP0, v1 can represent the CPMVP of CP1, and v2 can represent the CPMVP of CP2.

[0111] The affine MVP candidate may be a combination of the CPMVP candidate of CP0, the CPMVP candidate of CP1, and the candidate of 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 neighboring 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 may represent the motion vector of the surrounding block G.

[0116] Also, the peripheral block A may represent a peripheral block located at the upper left end of the upper left sample position of the current block, the peripheral block B may represent a peripheral block located at the upper end of the upper left sample position of the current block, and the peripheral block C may represent a peripheral block located at the left side of the upper left sample position of the current block. Also, the peripheral block D may represent a peripheral block located at the upper end of the upper right sample position of the current block, and the peripheral block E may represent a peripheral block located at the upper right end of the upper right sample position of the current block. Also, the peripheral block F may represent a peripheral block located at the left side of the lower left sample position of the current block, and the peripheral block G may represent a peripheral block located at the lower left end 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 neighboring block B B and / or the motion vector v of the neighboring block C C The CPMVP candidates of CP1 may include the motion vector v D , and / or the motion vector v of the neighboring block E. E The CPMVP candidates for CP2 may include the motion vector v F , and / or the motion vector v of the neighboring block G G may include.

[0118] In other words, the CPMVP v0 of CP0 can be derived based on at least one motion vector of the neighboring blocks A, B, and C of the top left sample position, where the neighboring block A can refer to a block located at the top left corner of the top left sample position of the current block, the neighboring block B can refer to a block located at the top of the top left sample position of the current block, and the neighboring block C can refer to a 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 CP0 CPMVP candidate, the CP1 CPMVP candidate, and the CP2 CPMVP candidate 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] Then, the encoding device can determine a CPMV for each of the affine MVP candidates, compare 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 an 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 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 top right corner neighboring block of the current block, the neighboring block D may represent a bottom left corner neighboring block of the current block, and the neighboring block E may represent an top left corner neighboring block of the current block.

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

[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 in alphabetical order. That is, the specific scanning order may be in the order of neighboring blocks A, B, C, D, and E.

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

[0130] For example, when 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 a neighboring 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 may derive an affine motion model for the current block based on the CPMV, v2, and v3 of the neighboring blocks. Thereafter, the encoding apparatus may determine the CPMV, v0, and v1 of the current block based on the affine motion model. The encoding apparatus may determine an affine MVF based on the CPMV, v0, and v1 of the current block, and may 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 an 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 neighboring blocks for deriving the inherited affine candidates.

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

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

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

[0141] As an example, up to two inherited 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 a reference picture for the first block may be the same as a reference picture for 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 a reference picture for the block may be the same as a reference picture for 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 a reference picture of the second block may be the same as a reference picture of the current block. That is, the second block may be a block that satisfies a second confirmed condition 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 a reference picture of the block is the same as a reference picture of the current block.

[0144] On the other hand, for example, if the available number of the inherited affine candidates is less than two (i.e., the number of derived inherited affine candidates is less than two), 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] As shown in Fig. 12, the motion vectors of the neighboring blocks of the current block are divided into three groups. Referring to Fig. 12, the neighboring blocks include a neighboring block A, a neighboring block B, a neighboring block C, a neighboring block D, a neighboring block E, a neighboring block F, and a neighboring block G.

[0147] 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, and 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, and 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.

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

[0149] [Table 1]

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

[0151] The encoding device / decoding device derives mv0 from S0, mv1 from S1, and mv2 from S2, and derives an affine MVP candidate including the mv0, the mv1, and the mv2. The affine MVP candidate may indicate the constructed affine candidate. Also, the mv0 may be a CPMVP candidate for CP0, the mv1 may be a CPMVP candidate for CP1, and the 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 a motion vector that satisfies a condition that is confirmed first by checking the 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 -> the neighboring block C in S0. Also, the order may be other than the above-mentioned order and is not limited to the above-mentioned example.

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

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

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

[0156]

number

[0157] Here, 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 the 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] Here, 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, 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 procedure 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, a procedure 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 described below.

[0163] FIG. 13 illustrates 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 above-mentioned 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 upper right corner neighboring block B1, and an upper left corner neighboring block B2 of the current block.

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

[0171] The encoding device / decoding device adds an HEVC AMVP candidate to the affine MVP list of the current block (S1320). If the number of available inherited candidates and / or constructed candidates is less than two, the encoding device / decoding device adds an HEVC AMVP candidate to the affine MVP list of the current block. That is, if the number of available inherited candidates and / or constructed candidates is less than two, the encoding device / 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 Fig. 14, the encoding / decoding apparatus checks mv0, mv1, and mv2 for the current block (S1400). That is, the encoding / decoding apparatus can determine whether mv0, mv1, and mv2 are available in neighboring blocks of the current block. Here, the mv0 may be a CPMVP candidate for CP0 of the current block, the mv1 may be a CPMVP candidate for CP1, and the mv2 may be a CPMVP candidate for CP2. Also, the mv0, mv1, and mv2 may be indicated as candidate motion vectors for the CP.

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

[0177] Also, for example, the encoding device / decoding device checks whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition according to a specific order. The encoding device / decoding device may derive the motion vector of the neighboring block that satisfies the first confirmed condition in the checking process as the mv1. That is, the mv1 may be the motion vector that satisfies the first confirmed condition by checking the motion vectors in the second group according to 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 an order from the neighboring block D to the neighboring block E in the second group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

[0178] Also, for example, the encoding / decoding apparatus checks whether the motion vectors of the neighboring blocks in the third group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the first confirmed condition in the checking process as the mv2. That is, the mv2 may be the motion vector that satisfies the first confirmed condition by checking the motion vectors in the third group according to 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 an order from the neighboring block F to the neighboring block G in the third group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a 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 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 peripheral 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.

[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-mentioned Equation 8 (S1410). The encoding / decoding device substitutes the derived mv0 and mv1 into the above-mentioned Equation 8 to derive mv2.

[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 substitutes the derived mv0 and mv2 into Equation 9 to derive mv1.

[0182] The encoding device / decoding device derives the derived mv0, mv1, and mv2 as constructed candidates of 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 device / decoding device derives the derived mv0, mv1, and mv2 as constructed candidates of the current block.

[0183] In addition, when only mv0 and mv1 for the current block are available, i.e., when 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] In addition, when only mv0 and mv2 for the current block are available, i.e., when only mv0 and mv2 for the current block are derived, the encoding device / decoding device derives the derived mv0, mv2 and mv1 derived based on the above-mentioned Equation 9 as the constructed candidate for the current block.

[0185] Also, for example, when 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] As shown in Fig. 15, the encoding / decoding device checks mv0, mv1, and mv2 for the current block (S1500). That is, the encoding / decoding device determines whether available mv0, mv1, and mv2 exist in neighboring blocks of the current block. Here, the mv0 may be a CPMVP candidate for CP0 of the current block, the mv1 may be a CPMVP candidate for CP1, and the mv2 may be a CPMVP candidate for CP2.

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

[0189] Also, for example, the encoding / decoding apparatus checks whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition that is first confirmed in the checking process as the mv1. That is, the mv1 may be the motion vector that satisfies the specific condition that is first confirmed by checking the motion vectors in the second group according to 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 an order from the neighboring block D to the neighboring block E in the second group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

[0190] Also, for example, the encoding / decoding apparatus checks whether the motion vectors of the neighboring blocks in the third group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the first confirmed condition in the checking process as the mv2. That is, the mv2 may be the motion vector that satisfies the first confirmed condition by checking the motion vectors in the third group according to 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 an order from the neighboring block F to the neighboring block G in the third group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

[0191] Meanwhile, the first group includes the motion vectors of peripheral blocks A, B, and C, the second group includes the motion vectors of peripheral blocks D and E, and the third group includes the motion vectors of peripheral blocks F and 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 peripheral 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.

[0192] If only the mv0 and the mv1 for the current block are available, or if the mv0, the mv1 and the mv2 for the current block are available, i.e., if the mv0 and the mv1 for the current block have been derived, or if the mv0, the mv1 and the mv2 for the current block have been derived, the encoding device derives the derived mv0 and the mv1 as current block candidates (S1510).

[0193] On the other hand, if only the mv0 and the mv2 for the current block are available, i.e., if only the mv0 and the 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 substitutes the derived mv0 and mv2 into Equation 9 to derive mv1.

[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 constructed candidate different from the above-mentioned embodiment. The proposed embodiment improves coding performance by reducing complexity compared to the above-mentioned embodiment for deriving a constructed candidate. The proposed embodiment is described below. Also, when the number of available inherited affine candidates is less than two (i.e., when 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, and the neighboring blocks include 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 an available mv0 exists in the first group, determines whether an available mv1 exists in the second group, and determines whether an available mv2 exists in the third group.

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

[0200] Also, the encoding / decoding apparatus checks whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition according to a specific order. The encoding / decoding apparatus may derive the motion vector of the neighboring block that satisfies the first confirmed condition in the checking process as the mv1. That is, the mv1 may be the motion vector that satisfies the first confirmed condition by checking the motion vectors in the second group according to 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 an order from the neighboring block D to the neighboring block E in the second group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

[0201] Also, the encoding / decoding apparatus checks whether the motion vectors of the neighboring blocks in the third group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the first confirmed condition in the checking process as the mv2. That is, the mv2 may be the motion vector that satisfies the first confirmed condition by checking the motion vectors in the third group according to 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 an order from the neighboring block F to the neighboring block G in the third group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a 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-mentioned proposed embodiment is a method of considering a constructed candidate only when all motion vectors of CPs for generating an affine motion model of the current block are available. Here, the meaning of available indicates 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 when there is a motion vector that satisfies the above condition among the motion vectors of the neighboring blocks for each CP of the current block. Therefore, when the affine motion model applied to the current block is a 4-affine motion model, the constructed candidate is considered only when the MVs of CP0 and CP1 of the current block (i.e., the mv0 and the mv1) are available. Also, when the affine motion model applied to the current block is a 6-affine motion model, the constructed candidate is considered only when the MVs of CP0, CP1, and CP2 of the current block (i.e., the mv0, the mv1, and the mv2) are available. Therefore, according to the proposed embodiment, there may be no need for an additional configuration for deriving a motion vector for a CP based on the above Equation 8 or Equation 9. This reduces the computational complexity for deriving the constructed candidate. Also, the constructed candidate is determined only when a CPMVP candidate having the same reference picture is available, thereby improving overall coding performance.

[0205] The above embodiment can be illustrated 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 are available for the current block (S1600). That is, the encoding / decoding device determines whether available mv0 and mv1 exist in neighboring blocks of the current block. Here, the mv0 may be a CPMVP candidate for CP0 of the current block, and the mv1 may be a CPMVP candidate for CP1.

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

[0209] Specifically, the neighboring blocks of the current block are divided into three groups, and the neighboring blocks include 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 apparatus checks whether the motion vectors of the neighboring blocks in the first group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition that is first confirmed in the checking process as the mv0. That is, the mv0 may be the motion vector that satisfies the specific condition that is first confirmed by checking the motion vectors in the first group according to 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 an order from the neighboring block A in the first group to the neighboring block B and the neighboring block C. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

[0211] Also, the encoding / decoding apparatus checks whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition that is first confirmed in the checking process as the mv1. That is, the mv1 may be the motion vector that satisfies the specific condition that is first confirmed by checking the motion vectors in the second group according to 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 an order from the neighboring block D to the neighboring block E in the second group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

[0212] If the mv0 and the mv1 for the current block are available, i.e., if the mv0 and the mv1 for the current block are derived, the encoding device / 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 device / 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 a 6-affine motion model is applied to the current block.

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

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

[0216] Specifically, the neighboring blocks of the current block are divided into three groups, and the neighboring blocks include 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 according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the first confirmed condition in the checking process as the mv0. That is, the mv0 may be the motion vector that satisfies the first confirmed condition by checking the motion vectors in the first group according to 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 the neighboring block A in the first group to the neighboring block B and the neighboring block C. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

[0218] Also, the encoding / decoding apparatus checks whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition that is first confirmed in the checking process as the mv1. That is, the mv1 may be the motion vector that satisfies the specific condition that is first confirmed by checking the motion vectors in the second group according to 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 an order from the neighboring block D to the neighboring block E in the second group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

[0219] Also, the encoding / decoding apparatus checks whether the motion vectors of the neighboring blocks in the third group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition that is first confirmed in the checking process as the mv2. That is, the mv2 may be the motion vector that satisfies the specific condition that is first confirmed by checking the motion vectors in the third group according to 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 an order from the neighboring block F to the neighboring block G in the third group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a 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, a CP for generating a 4-affine motion model can be adaptively determined based on the width and height of a current block. That is, when an 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 illustrates an example of deriving a constructed candidate including a CPMVP for a CP that is adaptively selected based on the width and height of the current block.

[0226] As shown in Figure 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 CPs of the affine motion model for the current block as CP0 and CP1. If the width of the current block is less than the height, the encoding / decoding device may select CPs of the affine motion model for the current block as CP0 and CP2.

[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, the mv0 may be a CPMVP candidate for CP0 of the current block, and the mv1 may be a CPMVP candidate for CP1.

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

[0229] Specifically, the neighboring blocks of the current block are divided into three groups, and the neighboring blocks include 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 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 apparatus checks whether the motion vectors of the neighboring blocks in the first group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition that is first confirmed in the checking process as the mv0. That is, the mv0 may be the motion vector that satisfies the specific condition that is first confirmed by checking the motion vectors in the first group according to 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 an order from the neighboring block A in the first group to the neighboring block B and the neighboring block C. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

[0231] Also, the encoding / decoding apparatus checks whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition that is first confirmed in the checking process as the mv1. That is, the mv1 may be the motion vector that satisfies the specific condition that is first confirmed by checking the motion vectors in the second group according to 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 an order from the neighboring block D to the neighboring block E in the second group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a 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, the mv0 may be a CPMVP candidate for CP0 of the current block, and the mv2 may be a CPMVP candidate for CP2.

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

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

[0237] The encoding / decoding device determines constructed candidates for the current block based on the derived motion vector (S1830). For example, if mv0 for the CP0 and mv1 for the CP1 are derived, the encoding / decoding device determines the mv0 and mv1 as the constructed candidates. Also, for example, if mv0 for the CP0 and mv2 for the CP2 are derived, the encoding / decoding device determines the 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 previous 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] In addition, this document proposes an embodiment for deriving constructed candidates as described below. Specifically, the embodiment described below can be applied to deriving constructed candidates for a current block when the adaptive CP selection scheme 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, the mv0 may be a CPMVP candidate for CP0 of the current block, and the mv1 may be a CPMVP candidate for CP1.

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

[0243] Specifically, the neighboring blocks of the current block are divided into three groups, and the neighboring blocks include 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 apparatus checks whether the motion vectors of the neighboring blocks in the first group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition that is first confirmed in the checking process as the mv0. That is, the mv0 may be the motion vector that satisfies the specific condition that is first confirmed by checking the motion vectors in the first group according to 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 an order from the neighboring block A in the first group to the neighboring block B and the neighboring block C. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

[0245] Also, the encoding / decoding apparatus checks whether the motion vectors of the neighboring blocks in the second group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition that is first confirmed in the checking process as the mv1. That is, the mv1 may be the motion vector that satisfies the specific condition that is first confirmed by checking the motion vectors in the second group according to 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 an order from the neighboring block D to the neighboring block E in the second group. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a 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 neighboring blocks of the current block, the encoding / decoding device determines whether mv0, mv2 for the current block are available and whether the width of the current block is less than its 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 the mv0 may be a CPMVP candidate for CP0 of the current block, and the mv2 may be a CPMVP candidate for CP2.

[0248] Specifically, the neighboring blocks of the current block are divided into three groups, and the neighboring blocks include 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 apparatus checks whether the motion vectors of the neighboring blocks in the first group satisfy a specific condition according to a specific order. The encoding / decoding apparatus derives the motion vector of the neighboring block that satisfies the condition that is first confirmed in the checking process as the mv0. That is, the mv0 may be the motion vector that satisfies the specific condition that is first confirmed by checking the motion vectors in the first group according to 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 an order from the neighboring block A in the first group to the neighboring block B and the neighboring block C. Also, for example, the specific condition may be that a reference picture for the motion vector of the neighboring block is the same as a reference picture of the current block.

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

[0251] The encoding / decoding device also determines whether the width of the current block is less 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 is a schematic diagram of an image encoding method by an encoding device according to the present document. The method disclosed in FIG. 20 may be performed by the encoding device disclosed in FIG. 1. Specifically, for example, S2000 to S2030 in FIG. 20 are performed by a prediction unit of the encoding device, and S2040 is performed by an entropy encoding unit of the encoding device. Although not shown, a process of deriving a prediction sample for the current block based on the CPMV is performed by a prediction unit of the encoding device, a process of deriving a residual sample for the current block based on an original sample and a prediction sample for the current block is performed by a subtraction unit of the encoding device, a process of generating information about the residual for the current block based on the residual sample is performed by a transformation unit of the encoding device, and a process 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] As an example, if a constructed affine MVP candidate is available, the affine MVP candidate list includes the constructed affine MVP candidate, where the constructed affine MVP candidate includes candidate motion vectors for the CP, and the constructed affine MVP candidate is available if all of the candidate motion vectors are available.

[0257] For example, when a 4 affine motion model is applied to the current block, the CPs of the current block include the CP0 and CP1. If a candidate motion vector for the CP0 is available and a candidate motion vector for the CP1 is available, the constructed affine MVP candidate is available and the affine MVP candidate list includes the constructed affine MVP candidate. Here, the CP0 indicates the upper left corner position of the current block, and the CP1 indicates the upper right corner position 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] Also, the first block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the first group according to a first specific order. 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. Also, for example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from the neighboring block A to the neighboring block B and C.

[0260] Also, the second block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the second group 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. Also, for example, the second group may include neighboring blocks D and E, and the second specific order may be an order from the neighboring block D to the 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 at the leftmost position among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located at the topmost position among the left peripheral blocks of the current block, the peripheral block D may be the upper peripheral block located at the rightmost position 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 CP0 candidate motion vector and the CP1 candidate motion vector is not available, the constructed affine MVP candidate may not be available.

[0263] Or, 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 the CP0 is available, a candidate motion vector for the CP1 is available, and a candidate motion vector for the CP2 is available, the constructed affine MVP candidates are available, and the affine MVP candidate list includes the constructed affine MVP candidates. Here, the CP0 indicates the top left corner position of the current block, the CP1 indicates the top right corner position of the current block, and the CP2 indicates the bottom left corner position of the current block.

[0264] The constructed affine MVP candidates include a candidate motion vector for the CP0, a candidate motion vector for the CP1, and a candidate motion vector for the 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] Also, the first block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the first group according to a first specific order. 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. Also, for example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from the neighboring block A to the neighboring block B and C.

[0266] Also, the second block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the second group 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. Also, for example, the second group may include neighboring blocks D and E, and the second specific order may be an order from the neighboring block D to the neighboring block E.

[0267] Also, the third block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the third group 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. Also, for example, the third group may include a neighboring block F and a neighboring block G, and the third specific order may be an order from the neighboring block F to the 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 an upper left corner peripheral block of the current block, the peripheral block B may be an upper peripheral block located at the leftmost position among the upper peripheral blocks of the current block, the peripheral block C may be a left peripheral block located at the topmost position among the left peripheral blocks of the current block, the peripheral block D may be an upper peripheral block located at the rightmost position among the upper peripheral blocks of the current block, the peripheral block E may be a upper right corner peripheral block of the current block, the peripheral block F may be a left peripheral block located at the bottommost position among the left peripheral blocks of the current block, and the peripheral block G may be a lower left corner peripheral block of the current block.

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

[0270] Or, for example, if a 4 affin 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 top left corner position of the current block, and CP1 indicates the top right corner position 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] Also, the first block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the first group according to a first specific order. 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. Also, for example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from the neighboring block A to the neighboring block B and C.

[0274] Also, the second block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the second group 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. Also, for example, the second group may include neighboring blocks D and E, and the second specific order may be an order from the neighboring block D to the 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 at the leftmost position among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located at the topmost position among the left peripheral blocks of the current block, the peripheral block D may be the upper peripheral block located at the rightmost position 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 CP0 candidate motion vector and the CP1 candidate motion vector is not available, the constructed affine MVP candidate may not be available.

[0277] Also, if the width of the current block is less than its height, the CP0 and CP2 of the current block are included. If a candidate motion vector for the CP0 is available and a candidate motion vector for the CP2 is available, the constructed affine MVP candidate is available and the affine MVP candidate list includes the constructed affine MVP candidate, where CP0 indicates the top left corner position of the current block and CP2 indicates the bottom left corner position 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] Also, the first block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the first group according to a first specific order. 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. Also, for example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from the neighboring block A to the neighboring block B and C.

[0280] Also, the third block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the third group 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. Also, for example, the third group may include a neighboring block F and a neighboring block G, and the third specific order may be an order from the neighboring block F to the 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 at the leftmost position among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located at the top among the left peripheral blocks of the current block, the peripheral block F may be the left peripheral block located at the bottom 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 CP0 candidate motion vector and the CP2 candidate motion vector is not available, the constructed affine MVP candidate may not be available.

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

[0284] The inherited affine MVP candidate is derived based on a particular block among neighboring blocks of the current block, where the particular block is coded to an affine motion model and the reference picture of the particular 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 that is confirmed first by checking the neighboring blocks according to a specific order. The condition may be that the block is coded to 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 a CP of the current block based on an 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 less 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 indicates 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 (CPMVP) for a control point (CP) 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 an optimal RD cost, and selects an affine MVP candidate most similar to the CPMV among the affine MVP candidates as an affine MVP candidate for the current block. The encoding apparatus derives a CPMVP for a control point (CP) of the current block based on the selected affine MVP candidate among the affine MVP candidates included in the affine MVP candidate list. Specifically, when the affine MVP 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 the CP0, and the candidate motion vector for CP1 of the affine MVP candidate may be derived as the CPMVP of the CP1. Furthermore, when an affine MVP candidate includes a candidate motion vector for CP0, a candidate motion vector for CP1, and a candidate motion vector for CP2, the candidate motion vector 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, when an affine MVP candidate includes 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, wherein 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 a control point motion vector difference (CPMVD) for the CP of the current block based on the CPMVP and the CPMV (S2030). The encoding apparatus derives a CPMVD for the CP 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 on the CPMVD (S2040). The encoding apparatus outputs the motion prediction information including the information on 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 on the CPMVD for each of the CPs, and the motion prediction information includes information on 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 apparatus may derive a predicted sample for the current block based on the CPMV, derive a residual sample for the current block based on an original sample and the predicted sample for the current block, generate information about the residual for the current block based on the residual sample, 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 is a schematic diagram of an encoding device for performing 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 S2000 to S2030 of FIG. 20, and an entropy encoding unit of the encoding device of FIG. 21 performs S2040 of FIG. 20. Although not shown, a process of deriving a predicted sample for the current block based on the CPMV is performed by a prediction unit of the encoding device of FIG. 21, a process of deriving a residual sample for the current block based on an original sample and a predicted sample 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 sample is performed by a conversion 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] FIG. 22 is a schematic diagram of an image decoding method by a decoding device according to the present document. The method disclosed in FIG. 22 is performed by the decoding device disclosed in FIG. 2. Specifically, for example, S2200 in FIG. 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 unit of the decoding device. Although not shown, a process of obtaining information on the residual of the current block through a bitstream is performed by an 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 apparatus obtains motion prediction information for a current block from a bitstream (S2200). The decoding apparatus 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] As an example, if a constructed affine MVP candidate is available, the affine MVP candidate list includes the constructed affine MVP candidate, where the constructed affine MVP candidate includes candidate motion vectors for the CP, and the constructed affine MVP candidate is available if all of the candidate motion vectors are available.

[0306] For example, when a 4 affine motion model is applied to the current block, the CPs of the current block include the CP0 and CP1. If a candidate motion vector for the CP0 is available and a candidate motion vector for the CP1 is available, the constructed affine MVP candidate is available and the affine MVP candidate list can include the constructed affine MVP candidate. Here, the CP0 indicates the top left corner position of the current block, and the CP1 indicates the top right corner position 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] Also, the first block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the first group according to a first specific order. 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. Also, for example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from the neighboring block A to the neighboring block B and C.

[0309] Also, the second block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the second group 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. Also, for example, the second group may include neighboring blocks D and E, and the second specific order may be an order from the neighboring block D to the 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 at the leftmost position among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located at the topmost position among the left peripheral blocks of the current block, the peripheral block D may be the upper peripheral block located at the rightmost position 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 CP0 candidate motion vector and the CP1 candidate motion vector is not available, the constructed affine MVP candidate may not be available.

[0312] Or, 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 the CP0 is available, a candidate motion vector for the CP1 is available, and a candidate motion vector for the CP2 is available, the constructed affine MVP candidates are available, and the affine MVP candidate list can include the constructed affine MVP candidates. Here, the CP0 indicates the top left position of the current block, the CP1 indicates the top right position of the current block, and the CP2 indicates the bottom left position of the current block.

[0313] The constructed affine MVP candidates include a candidate motion vector for the CP0, a candidate motion vector for the CP1, and a candidate motion vector for the 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] Also, the first block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the first group according to a first specific order. 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. Also, for example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from the neighboring block A to the neighboring block B and C.

[0315] Also, the second block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the second group 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. Also, for example, the second group may include neighboring blocks D and E, and the second specific order may be an order from the neighboring block D to the neighboring block E.

[0316] Also, the third block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the third group 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. Also, for example, the third group may include a neighboring block F and a neighboring block G, and the third specific order may be an order from the neighboring block F to the 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 (-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 peripheral block located at the leftmost position among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located at the top among the left peripheral blocks of the current block, the peripheral block D may be the upper peripheral block located at the rightmost position 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 left peripheral block located at the bottom 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 CP0 candidate motion vector, the CP1 candidate motion vector, and the CP2 candidate motion vector is not available, the constructed affine MVP candidate may not be available.

[0319] Or, for example, if a 4 affin 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 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 top left corner position of the current block, and CP1 indicates the top right corner position 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] Also, the first block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the first group according to a first specific order. 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. Also, for example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from the neighboring block A to the neighboring block B and C.

[0323] Also, the second block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the second group 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. Also, for example, the second group may include neighboring blocks D and E, and the second specific order may be an order from the neighboring block D to the 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 at the leftmost position among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located at the topmost position among the left peripheral blocks of the current block, the peripheral block D may be the upper peripheral block located at the rightmost position 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 CP0 candidate motion vector and the CP1 candidate motion vector is not available, the constructed affine MVP candidate may not be available.

[0326] Also, if the width of the current block is less than its height, it may include the CP0 and CP2 of the current block. If a candidate motion vector for the CP0 is available and a candidate motion vector for the CP2 is available, the constructed affine MVP candidate is available and the affine MVP candidate list includes the constructed affine MVP candidate, where CP0 indicates the top left corner position of the current block and CP2 indicates the bottom left corner position 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] Also, the first block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the first group according to a first specific order. 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. Also, for example, the first group may include neighboring blocks A, B, and C, and the first specific order may be from the neighboring block A to the neighboring block B and C.

[0329] Also, the third block may be a block in which a first confirmed reference picture is the same as the reference picture of the current block by checking neighboring blocks in the third group 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. Also, for example, the third group may include a neighboring block F and a neighboring block G, and the third specific order may be an order from the neighboring block F to the 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 at the leftmost position among the upper peripheral blocks of the current block, the peripheral block C may be the left peripheral block located at the top among the left peripheral blocks of the current block, the peripheral block F may be the left peripheral block located at the bottom 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 CP0 candidate motion vector and the CP2 candidate motion vector is not available, 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 according to an affine motion model, and a reference picture of the specific block may be the same as a reference picture of the current block.

[0334] Here, the specific block may be a block that satisfies a condition that is confirmed first by checking the neighboring blocks according to a specific order. The condition may be that the block is coded to 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 apparatus 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 a CP of the current block based on an 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 Equation 3 above.

[0336] 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, when the size of the current block is W×H and the x component of the top-left sample position of the current block is 0 and the y component of the top-left sample position of the current block is 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.

[0337] On the other hand, 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 less 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 an 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 apparatus 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 apparatus obtains the affine MVP candidate index for the current block from a bitstream, and derives an affine MVP candidate indicated by the affine MVP candidate index from the affine MVP candidates included in the affine MVP candidate list as a CPMVP candidate for the CP of the current block. Specifically, when an affine MVP candidate includes a candidate motion vector for CP0 and a candidate motion vector for CP1, the candidate motion vector of the affine MVP candidate for CP0 is derived as the CPMVP of the CP0, and the candidate motion vector of the affine MVP candidate for CP1 is derived as the CPMVP of the CP1. Also, when an affine MVP candidate includes a candidate motion vector for CP0, a candidate motion vector for CP1, and a candidate motion vector for CP2, the candidate motion vector 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. Also, when an affine MVP candidate includes 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 on 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 on the CPMVDs for each of the CPs.

[0343] The decoding apparatus derives control point motion vectors (CPMV) for the CP of the current block based on the CPMVP and the CPMVD (S2240). The decoding apparatus derives a CPMV for each CP based on the CPMVP and CPMVD for each of the CPs. For example, the decoding apparatus derives a 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 sub-block-based or sample-based motion vectors of the current block based on the CPMV. That is, the decoding apparatus derives motion vectors of each sub-block or each sample of the current block based on the CPMV. The sub-block-based 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 apparatus may derive a prediction sample for the current block based on the motion vector in the sub-block unit or the sample unit, derive a reference area in a reference picture based on the motion vector in the sub-block unit or the sample unit, and generate a prediction sample for the current block based on a reconstructed sample in the reference area.

[0346] The decoding apparatus generates a reconstructed picture for the current block based on the derived prediction sample (S2260). The decoding apparatus generates a reconstructed picture for the current block based on the derived prediction sample. The decoding apparatus may directly use the prediction sample as a reconstructed sample according to a prediction mode, or may generate a reconstructed sample by adding a residual sample to the prediction sample. If a residual sample for the current block exists, the decoding apparatus obtains information about the residual for the current block from the bitstream. The information about the residual includes a transform coefficient for the residual sample. The decoding apparatus derives the residual sample (or a residual sample array) for the current block based on the residual information. The decoding apparatus generates a reconstructed sample based on the prediction sample and the residual sample, and derives a reconstructed block or a reconstructed picture based on the reconstructed sample. As described above, the decoding apparatus may then apply deblocking filtering and / or an in-loop filtering procedure such as an SAO procedure to the reconstructed picture to improve subjective / objective image quality as necessary.

[0347] FIG. 23 is a schematic diagram of a decoding device for performing an image decoding method according to the present document. The method disclosed in FIG. 22 can be performed by the decoding device disclosed in FIG. 23. Specifically, for example, the entropy decoding unit of the decoding device of FIG. 23 performs S2200 of FIG. 22, the prediction unit of the decoding device of FIG. 23 performs S2210 to S2250 of FIG. 22, and the adder of the decoding device of FIG. 23 performs S2260 of FIG. 22. Although not shown, a process of obtaining image information including information on the residual of the current block through a bitstream is performed by the entropy decoding unit of the decoding device of FIG. 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 FIG. 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 steps, and a step may occur in a different order or simultaneously with other steps described above. Also, a person 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 in this document 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 on instructions or algorithms for implementation may be stored on a digital storage medium.

[0352] In addition, the decoding device and encoding device to which this document is applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video conversation device, a real-time communication device such as a video communication, a mobile streaming device, a storage medium, a camcorder, a custom video (VoD) service providing device, an over-the-top video (OTT) device, an internet streaming service providing device, a three-dimensional (3D) video device, a virtual reality (VR) device, an argumente reality (AR) device, an image telephone video device, a means of transportation terminal (e.g., a vehicle (including an autonomous vehicle) terminal, an airplane terminal, a ship terminal, etc.), a medical video device, etc., and may be used to process a video signal and a data signal. For example, over-the-top video (OTT) devices include a game console, a Blu-ray player, an internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), etc.

[0353] In addition, the processing method to which this document is applied can be produced in the form of a program executed by a computer and can be stored in a computer-readable recording medium. Multimedia data having 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 kinds 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 Disc (BD), Universal Serial Bus (USB), ROM, PROM, EPROM, EEPROM, RAM, CD-ROM, magnetic tape, floppy disk, and optical data storage device. The computer-readable recording medium also includes media realized in the form of a carrier wave (e.g., transmission via the Internet). Also, the bit stream 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 is executed in a computer according to the embodiments of the present invention. The program code may be stored on a carrier readable by a computer.

[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, a camera, a video camera, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, when a multimedia input device such as a smartphone, a camera, a camcorder, etc. directly generates a bitstream, the encoding server may be omitted.

[0358] The bitstream is generated by an encoding method or a bitstream generating 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, and the streaming server transmits multimedia data to the user. Here, the content streaming system may include a separate control server, and in this case, the control server serves to control commands / 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, smart phones, 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, in which case data received by each server can be processed in a distributed manner.

Claims

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

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

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

Citation Information

Patent Citations

  • Motion vector generation for affine motion model for video coding

    US20180192069A1