Inter-frame prediction method and apparatus in a video encoding system
Through the inter-frame prediction method based on the affine motion model, the control point motion vector of the current block is derived, which solves the problem of high-resolution image transmission and storage costs, and achieves more efficient image compilation.
Patent Information
- Application Number
- CN202210527374.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2015-08-07
- Filing Date
- 2016-07-15
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2036-07-15
AI Technical Summary
The prior art When transmitting and storing high-resolution and high-quality images, the increase in the amount of information leads to high transmission and storage costs, and requires efficient image compression technology.
Using an inter prediction method based on an affine motion model, the control point motion vector of the current block is derived, the sample unit motion vector is derived, the inter prediction efficiency is improved, and the data volume is reduced.
Improve image compilation efficiency, reduce the amount of data in inter-frame prediction, and reduce transmission and storage costs.
Smart Images

Figure CN114866769B_ABST
Abstract
Description
[0001] This application is a divisional application of the patent application with the application number 201680055123.2 (PCT / KR2016 / 007734), the international filing date of July 15, 2016, and the invention title of "Inter-frame Prediction Method and Apparatus in a Video Coding System", which was filed on March 22, 2018. Technical Field
[0002] The present invention relates to a video coding technology, and more particularly, to an inter-frame prediction method and apparatus in a video coding system. Background Art
[0003] 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. Since image data has high resolution and high quality, the amount of information or bits to be transmitted increases compared to conventional image data. Therefore, when transmitting image data using a medium such as a conventional wired / wireless broadband line or storing image data using an existing storage medium, the transmission cost and storage cost increase.
[0004] Therefore, there is a need for an efficient image compression technology for effectively transmitting, storing, and reproducing information of high-resolution and high-quality images. Summary of the Invention
[0005] Technical Objectives
[0006] The present invention provides a method and apparatus for enhancing image coding efficiency.
[0007] Another technical objective of the present invention is to provide an inter-frame prediction method and apparatus based on an affine motion model.
[0008] Another technical objective of the present invention is to provide a method and apparatus for performing inter-frame prediction based on a sample unit motion vector.
[0009] Another technical objective of the present invention is to provide a method and apparatus for deriving a sample unit motion vector based on a motion vector of a control point of a current block.
[0010] Another technical objective of the present invention is to provide a method and apparatus for deriving a motion vector of a control point of a current block, which is a non-square block, based on samples of neighboring blocks.
[0011] Another technical objective of the present invention is to provide a method and apparatus for deriving a motion vector of a control point of a current block based on a motion vector of a control point of a previously decoded neighboring block.
[0012] Technical Solutions
[0013] In one aspect, a video decoding method performed by a decoding device is provided. The decoding method includes: deriving a control point (CP) for a current block; obtaining a motion vector for the CP; deriving a sample unit motion vector in the current block based on the obtained motion vector; and deriving predicted samples for the current block based on the sample unit motion vector.
[0014] In another aspect, a decoding device for performing video decoding is provided. The decoding device includes: a decoding unit that obtains prediction mode information about a current block from a bitstream; a prediction unit that derives a control point (CP) about the current block, obtains a motion vector for the CP, derives a sample unit motion vector in the current block based on the obtained motion vector, and derives predicted samples about the current block based on the sample unit motion vector; and an adder that generates reconstructed samples based on the predicted samples.
[0015] In another aspect, a video encoding method performed by an encoding device is provided. The video encoding method includes: deriving a driving control point (CP) about a current block; obtaining a motion vector for the CP; deriving a sample unit motion vector in the current block based on the obtained motion vector; generating predicted samples about the current block based on the sample unit motion vector; and encoding prediction mode information about the current block and outputting the encoded prediction mode information.
[0016] In another aspect, an encoding device for performing video encoding is provided. The encoding device includes: a prediction unit that determines a prediction mode about a current block, derives a control point (CP) about the current block, obtains a motion vector for the CP, derives a sample unit motion vector in the current block based on the obtained motion vector, and generates predicted samples about the current block based on the sample unit motion vector; and an encoding unit that encodes prediction mode information about the current block and outputs the encoded prediction mode information.
[0017] Advantageous Effects
[0018] According to the present invention, a more accurate sample-based motion vector for a current block can be derived, and thus the inter-frame prediction efficiency can be significantly improved.
[0019] According to the present invention, the motion vector of samples in a current block can be efficiently derived based on the motion vector of a control point of the current block.
[0020] According to the present invention, without additionally transmitting information about the motion vector of a control point of a current block, the motion vector of a control point of the current block can be derived based on the motion vector of a control point of a previously decoded neighboring block. Therefore, the data amount of the motion vector of the control point can be eliminated or reduced, and the overall encoding efficiency can be improved.
[0021] According to the present invention, even when the image in the current block is rotated, enlarged, reduced, or deformed into a parallelogram, and when the image of the current block is plane-shifted, inter-frame prediction is effectively performed through the sample unit motion vector. Therefore, the data amount of the residual signal of the current block can be eliminated or reduced, and the overall coding efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a block diagram schematically illustrating a video encoding device according to an embodiment of the present invention.
[0023] Figure 2 is a block diagram schematically illustrating a video decoding device according to an embodiment of the present invention.
[0024] Figure 3 is a view illustrating a configuration in which a prediction block is generated in inter-frame prediction applying a translational motion model.
[0025] Figure 4 is a view illustrating a configuration in which a prediction block is generated in inter-frame prediction applying an affine motion model.
[0026] Figure 5 is a view illustrating a state in which a prediction block is generated and a motion vector of inter-frame prediction to which an affine motion model is applied.
[0027] Figure 6 is a view illustrating a CP of a PU divided from a CU based on a split type 2Nx2N.
[0028] Figure 7 is a view illustrating a CP of a PU divided from a CU based on a split type Nx2N.
[0029] Figure 8 is a view illustrating a CP of a PU divided from a CU based on a split type 2NxN.
[0030] Figure 9 is a view illustrating a CP of an asymmetric PU.
[0031] Figure 10 is a view illustrating prediction candidates of motion information of a CP of a PU to which a split type 2Nx2N is applied.
[0032] Figure 11 Illustrates an example of prediction candidates of motion information of a CP of a PU to which a split type 2NxN is applied.
[0033] Figure 12 is a view illustrating a configuration in which prediction candidates of a CP of a PU to which a split type 2NxN is applied are limited to two prediction candidates.
[0034] Figure 13It is a view of the prediction candidates of the motion information of the CP of the PU to which the illustrated segmentation type Nx2N is applied.
[0035] Figure 14 It is a view of the configuration in which the prediction candidates of the CP of the PU to which the segmentation type Nx2N is applied are limited to two prediction candidates.
[0036] Figure 15 It is a view of the prediction candidates of the motion information of the CP of the asymmetric PU.
[0037] Figure 16 It is a view of the configuration in which the prediction candidates of the CP of the asymmetric PU are limited to two prediction candidates.
[0038] Figure 17 It is a view of the PU including the CP that requires motion information compilation and the CP that does not require motion information compilation.
[0039] Figure 18 It is a view of the PU including the CP that does not require motion information compilation.
[0040] Figure 19 It is a view schematically illustrating the video encoding method of the encoding device according to the present invention.
[0041] Figure 20 It is a view schematically illustrating the video decoding method of the decoding device according to the present invention. Detailed Description
[0042] The present invention can be modified in various forms, and its specific embodiments will be described and illustrated in the drawings. However, the embodiments are not intended to limit the present invention. The terms used in the following description are only used to describe specific embodiments, but are not intended to limit the present invention. The singular representation includes the plural representation as long as it is clearly and differently understood. Terms such as "including" and "having" are intended to indicate the presence of the features, numbers, steps, operations, elements, components or combinations thereof used in the following description, and therefore, it should be understood that the possibility of the presence or addition of one or more different features, numbers, steps, operations, elements, components or combinations thereof is not excluded.
[0043] On the other hand, for the convenience of explaining different specific functions in the image encoding / decoding device, the elements in the drawings described in the present invention are drawn independently, but this does not mean that the elements are implemented by independent hardware or independent software. For example, two or more of the elements can be combined to form a single element, or one element can be divided into multiple elements. The embodiments in which the elements are combined and / or divided without departing from the concept of the present invention belong to the scope of the present invention.
[0044] Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.
[0045] Figure 1 FIG. is a block diagram illustrating a video encoding device according to an embodiment of the present invention.
[0046] Referring to Figure 1 , the video encoding device 100 includes a picture segmentation module 105, a prediction module 110, a transformation module 120, a quantization module 125, a rearrangement module 130, an entropy encoding module 135, a dequantization module 140, an inverse transformation module 145, a filtering module 155, and a memory 160.
[0047] The picture segmentation module 105 may be configured to segment an input picture into at least one processing unit block. In this regard, a block as a processing unit may be a prediction unit PU, a transformation unit TU, or a coding unit CU. A picture may be composed of a plurality of coding tree units CTU. Each CTU may be segmented into a CU as a quadtree structure. The CU may be segmented into a CU with a deeper depth as a quadtree structure. The PU and TU may be obtained from the CU. For example, the PU may be segmented from the CU into a symmetric or asymmetric square structure. In addition, the TU may be segmented from the CU into a quadtree structure. The CTU may correspond to a coding tree block CTB, the CU may correspond to a coding block CB, the PU may correspond to a prediction block PB, and the TU may correspond to a transformation block TB.
[0048] The prediction module 110 includes an inter prediction unit that performs an inter prediction process, which will be described later, and an intra prediction unit that performs an intra prediction process. The prediction module 110 performs a prediction process on the processing units of the picture segmented by the picture segmentation module 105 to create a prediction block including prediction samples or an array of prediction samples. In the prediction module 110, the processing unit of the picture may be a CU, a TU, or a PU. The prediction module 110 may determine whether the prediction performed on the corresponding processing unit is an inter prediction or an intra prediction, and may determine specific details, for example, the prediction mode of the prediction method. The processing unit that undergoes the prediction process may be different from the processing unit that determines the prediction method and specific details. For example, the prediction method and prediction mode may be determined in units of PU, and the prediction process may be performed in units of TU.
[0049] In inter prediction, the prediction process is performed based on information related to at least one of a previous picture and / or a subsequent picture of the current picture to create a prediction block. In intra prediction, the prediction process may be performed based on pixel information of the current picture to create a prediction block.
[0050] As an inter - frame prediction method, a skip mode, a merge mode, and an advanced motion vector prediction (AMVP) can be used. In inter - frame prediction, a reference picture can be selected for a PU, and a reference block corresponding to the PU can be selected. The reference block can be selected based on integer pixels (or samples) or fractional pixels (or samples). Then, a prediction block is generated, in which the residual signal related to the PU is minimized and the motion vector magnitude is also minimized. Pixels, pels, and samples can be used interchangeably herein.
[0051] The prediction block can be generated as an integer - pixel unit, or can be generated as a fractional - pixel unit such as a 1 / 2 - pixel unit or a 1 / 4 - pixel unit. In this regard, the motion vector can also be expressed as a fractional - pixel unit.
[0052] Information such as the index of a reference picture selected via inter - frame prediction, a motion vector difference MDV, a motion vector predictor MVP, a residual signal, etc. can be entropy - encoded and then sent to a decoding device. When the skip mode is applied, the prediction block can be used as a reconstructed block, such that the residual does not need to be generated, transformed, quantized, or sent.
[0053] When performing intra - frame prediction, the prediction mode can be determined in units of PUs and the prediction process can be performed in units of PUs. Alternatively, the prediction mode can be determined in units of PUs and the inter - frame prediction can be performed in units of TUs.
[0054] As an example, the prediction modes in intra - frame prediction can include 33 directional prediction modes and at least two non - directional modes. The non - directional modes can include a DC prediction mode and a planar mode.
[0055] In intra - frame prediction, the prediction block can be configured after applying a filter to the reference samples. At this time, according to the intra - frame prediction mode and / or the size of the current block, it can be determined whether the filter should be applied to the reference samples.
[0056] The residual value (residual block or residual signal) between the constructed prediction block and the original block is input to the transformation module 120. The prediction mode information, motion vector information, etc. used for prediction are encoded together with the residual value by the entropy - encoding module 135 and sent to the decoding device.
[0057] The transformation module 120 performs a transformation process on the residual block in units of TUs and generates transformation coefficients.
[0058] A transformation block is a rectangular block of samples and is a block to which the same transformation is applied. The transformation block can be a TU and can have a quadtree structure.
[0059] The transformation module 120 may perform a transformation process according to the prediction mode applied to the residual block and the size of the block.
[0060] For example, when intra-frame prediction is applied to the residual block and the residual block has a 4×4 array, the discrete sine transform DST is used to transform the residual block. Otherwise, the discrete cosine transform DCT can be used to transform the residual block.
[0061] The transformation module 120 may construct a transformed block of transform coefficients through transformation.
[0062] The quantization module 125 may quantize the residual values transformed by the transformation module 120, i.e., the transform coefficients, and may create quantized coefficients. The values calculated by the quantization module 125 may be supplied to the dequantization module 140 and the rearrangement module 130.
[0063] The rearrangement module 130 may rearrange the transform coefficients supplied from the quantization module 125. By rearranging the quantized coefficients, the coding efficiency in the entropy coding module 135 can be enhanced.
[0064] The rearrangement module 130 may rearrange the quantized transform coefficients in the form of a two-dimensional block into the form of a one-dimensional vector by using a coefficient scanning method.
[0065] The entropy coding module 135 may be configured to perform entropy coding on symbols according to a probability distribution based on the quantized transform values rearranged by the rearrangement module 130 or the coding parameter values calculated during the coding process, etc., and then output a bitstream. The entropy coding method is a method of receiving symbols with various values and expressing the symbol as a binary string that can be decoded while removing its statistical redundancy.
[0066] In this regard, symbols mean syntax elements, coding parameters, residual signal values, etc. to be encoded / decoded. Coding parameters are necessary for encoding and decoding. Coding parameters may include information that can be inferred during encoding or decoding, as well as information that is encoded in the encoding device like syntax elements and transmitted to the decoding device. Coding parameters are information required for encoding or decoding an image. Coding parameters may include statistical data or values such as intra-frame / inter-frame prediction modes, motion / movement vectors, reference picture indices, coding block patterns, presence or absence of residual signals, transform coefficients, quantized transform coefficients, quantization parameters, block sizes, block segmentation information, etc. In addition, the residual signal may mean the difference between the original signal and the prediction signal. In addition, the difference between the original signal and the prediction signal may be transformed to define the residual signal, or the difference between the original signal and the prediction signal may be transformed and quantized to define the residual signal. The residual signal may be referred to as a residual block in block units and may be referred to as a residual sample in sample units.
[0067] When entropy coding is applied, symbols can be expressed such that a small number of bits are allocated to symbols with a high occurrence probability, and a large number of bits are allocated to symbols with a low occurrence probability. This can reduce the size of the bit string of the symbols to be encoded. Thus, the compression performance of image coding can be increased via entropy coding.
[0068] Coding schemes such as exponential Golomb code, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC) can be used for entropy coding. For example, the entropy coding module 135 can store therein a table for performing entropy coding, such as a variable length coding / code (VLC) table. The entropy coding module 135 can use the stored VLC table to perform entropy coding. In addition, the entropy coding module 135 derives a binarization method for the corresponding symbol and a probability model for the corresponding symbol / bin, and then uses the derived binarization method or probability model to perform entropy coding.
[0069] If necessary, the entropy coding module 135 can give a predetermined change to the parameter set or syntax to be sent.
[0070] The dequantization module 140 dequantizes the quantized value transform coefficients of the quantization module 125. The inverse transform module 145 inversely transforms the values dequantized by the dequantization module 140.
[0071] The residual values or residual samples or arrays of residual samples generated by the dequantization module 140 and the inverse transform module 145, and the prediction blocks predicted by the prediction module 110 can be combined to form a reconstructed block including reconstructed samples or an array of reconstructed samples.
[0072] In Figure 1 the residual block and the prediction block are added by an adder to create a reconstructed block. At this time, the adder can be considered as a specific unit, the reconstructed block creation unit, for generating the reconstructed block.
[0073] The filtering module 155 applies a deblocking filter, an ALF adaptive loop filter, and SAO sample adaptive offset to the reconstructed picture.
[0074] The deblocking filter removes the block distortion generated at the boundaries between blocks in the reconstructed picture. The ALF performs a filtering process based on the comparison result value between the original image and the reconstructed image whose blocks are filtered by the deblocking filter. The ALF can be used only when high efficiency is required. The SAO reconstructs the offset difference between the residual block with the applied deblocking filter and the original picture, and applies the SAO in the form of offset with band, edge offset, etc.
[0075] The memory 160 may store the reconstructed blocks or pictures calculated by the filtering module 155. The reconstructed blocks or pictures stored in the memory 160 may be supplied to the prediction module 110 that performs inter prediction.
[0076] Figure 2 is a block diagram schematically illustrating a video decoding device according to an embodiment of the present invention. Referring Figure 2 to, the video decoding device 200 may include an entropy decoding module 210, a rearrangement module 215, a dequantization module 220, an inverse transform module 225, a prediction module 230, a filtering module 235, and a memory 240.
[0077] When a video bitstream is input from a video encoding device, the input bitstream may be decoded based on the order in which the video encoding device processes video information.
[0078] The entropy decoding module 210 may perform entropy decoding on the input bitstream according to a probability distribution to generate symbols in the form of quantization coefficients. The entropy decoding method is a method of receiving a series of binary numbers and using the sequence to generate each symbol. The entropy decoding method is similar to the above-described entropy encoding method.
[0079] For example, when a variable length coding VLC such as CAVLC (hereinafter referred to as "VLC") is used to perform entropy encoding in a video encoding device, the entropy decoding module 210 may perform decoding using the same VLC table as the VLC table used in the encoding device. In addition, when CABAC is used to perform entropy encoding in a video encoding device, the entropy decoding module 210 may use CABAC to perform entropy decoding.
[0080] More specifically, the CABAC entropy decoding method may include: receiving bins corresponding to each syntax element in the bitstream, determining a context model using the information of the syntax element to be decoded, decoding the information of neighboring blocks and the block to be decoded, or the information of the symbols / bins decoded in the previous step, and predicting the probability of bin occurrence according to the determined context model and thereby performing arithmetic decoding of the bins to generate symbols corresponding to the values of each syntax element. In this regard, after determining the context model, the CABAC entropy decoding method may further include the step of updating the context model using the information of the decoded symbols / bins to determine the context model of the next symbol / bin.
[0081] The information for constructing a prediction block from the information decoded by the entropy decoding module 210 may be supplied to the prediction module 230, and the residual values decoded by the entropy decoding module 210, that is, the quantized transform coefficients, may be input to the rearrangement module 215.
[0082] The rearrangement module 215 may rearrange the bitstream information entropy-decoded by the entropy decoding module 210, i.e., the quantized transform coefficients, based on the rearrangement method in the video coding device.
[0083] The rearrangement module 215 may reconstruct the coefficients expressed in the form of a one-dimensional vector and rearrange them into coefficients in the form of a two-dimensional block. The rearrangement module 215 may scan the coefficients based on the prediction mode applied to the current block transform block and the size of the transform block, and may create an array of coefficient quantized transform coefficients in the form of a two-dimensional block.
[0084] The dequantization module 220 may perform dequantization based on the quantization parameter supplied from the video coding device and the coefficient values of the rearranged block.
[0085] The inverse transform module 225 may perform the inverse DCT and / or inverse DST of the DCT and / or DST that has been performed by the transform module of the video coding device on the quantization result from the video coding device.
[0086] The inverse transform may be performed based on the transfer unit or segmentation unit of the picture determined by the video coding device. The transform module of the video coding device may selectively perform DCT and / or DST according to a plurality of pieces of information such as the prediction method, the size of the current block, and the prediction direction, and the inverse transform module 225 of the video decoding device may perform the inverse transform based on the transform information about the transform performed by the transform module of the video coding device.
[0087] The prediction module 230 generates prediction blocks based on the prediction blocks provided by the entropy decoding module 210 to generate correlation information and the previously decoded blocks and / or picture information provided from the memory to generate prediction blocks including prediction samples or an array of prediction samples.
[0088] If the prediction mode for the current PU is the intra prediction mode, the prediction module 230 may perform intra prediction to generate a prediction block based on the pixel information in the current picture.
[0089] If the prediction mode for the current PU is the inter prediction mode, the prediction module 230 may be configured to perform inter prediction on the current PU based on the information included in at least one picture among the previous picture or the subsequent picture to the current picture. In this regard, information such as the motion vector and the reference picture index, which are necessary for the inter prediction of the current PU provided in the video coding device, may be inferred by checking the skip flag and the merge flag received from the coding device.
[0090] When performing inter prediction on the current picture, the prediction module 230 may generate a prediction block such that the residual signal with respect to the current block is minimized and the magnitude of the motion vector is minimized.
[0091] On the other hand, the motion information derivation method can be changed according to the prediction mode of the current block. Prediction modes applied to inter prediction can include Advanced Motion Vector Prediction (AMVP) mode, merge mode, etc.
[0092] For example, when the merge mode is applied, the encoding device and the decoding device can use the motion vectors of the reconstructed spatially neighboring blocks and / or the motion vectors corresponding to the Col blocks as temporally neighboring blocks to generate a merge candidate list. In the merge mode, the motion vector of the candidate block selected in the merge candidate list is used as the motion vector of the current block. The encoding device can send a merge index indicating the candidate block having the optimal motion vector selected from among the candidate blocks included in the merge candidate list to the decoding device. In such a case, the decoding device can use the merge index to derive the motion vector of the current block.
[0093] In another example, when the AMVP (Advanced Motion Vector Prediction) mode is applied, the encoding device and the decoding device use the motion vectors of the reconstructed spatially neighboring blocks and / or the motion vectors corresponding to the Col blocks as temporally neighboring blocks to generate a motion vector predictor candidate list. That is, the motion vectors of the reconstructed spatially neighboring blocks and / or the motion vectors corresponding to the Col blocks as temporally neighboring blocks can be used as motion vector candidates. The encoding device can send a predicted motion vector index indicating the optimal motion vector selected from among the motion vector candidates included in the motion vector predictor candidate list to the decoding device. In this regard, the decoding device can use the motion vector index to select a predicted motion vector for the current block from among the motion vector candidates included in the motion vector candidate list.
[0094] The encoding device can obtain a motion vector difference MVD between the motion vector for the current block and the motion vector predictor (MVP), encode the MVD, and send the encoded MVD to the decoding device. That is, the MVD can be a value obtained by subtracting the motion vector predictor (MVP) from the motion vector (MV) of the current block. In this regard, the decoding device can decode the received motion vector difference and derive the motion vector of the current block via the addition between the decoded motion vector difference and the motion vector predictor.
[0095] In addition, the encoding device can send a reference picture index indicating the reference picture to the decoding device.
[0096] The prediction module 230 of the decoding device can use the motion information of neighboring blocks to predict the motion vector of the current block and use the residual received from the encoding device to derive the motion vector of the current block. The decoding device can generate a predicted sample (or an array of predicted samples) of the current block based on the derived motion vector and the reference picture index information received from the encoding device.
[0097] The decoding device can generate a reconstructed sample (or an array of reconstructed samples) by adding a predicted sample (or an array of predicted samples) obtained from transform coefficients sent from the encoding device and a residual sample. Based on these reconstructed samples, a reconstructed block and a reconstructed picture can be generated.
[0098] In the above AMVP and merge modes, the motion information of reconstructed neighboring blocks and / or the motion information of Col blocks can be used to derive the motion information of the current block.
[0099] In the skip mode, which is one of the other modes for inter-picture prediction, the neighboring block information can be used for the current block as it is. Thus, in the case of the skip mode, the encoding device does not send syntax information such as residuals to the decoding device, except for the information indicating which block's motion information is used as the motion information of the current block.
[0100] A reconstructed block can be generated using the predicted block generated by the prediction module 230 and the residual block provided by the inverse transform module 225. Figure 2 As shown in the figure using the adder 260, the predicted block and the residual block are combined to generate a reconstructed block. In this regard, the adder can be regarded as a separate module (reconstructed block generation module) configured to generate a reconstructed block. In this regard, the reconstructed block includes the reconstructed samples or an array of reconstructed samples as described above; the predicted block includes predicted samples or an array of predicted samples; the residual block can include residual samples or an array of residual samples. Therefore, it can be considered that the corresponding reconstructed samples or an array of reconstructed samples are generated by combining the corresponding predicted samples or an array of predicted samples with the corresponding residual samples or an array of residual samples.
[0101] When the skip mode is used for a block, the residual signal may not be sent, and the predicted block can be used as the reconstructed block.
[0102] The reconstructed block and / or picture can be supplied to the filtering module 235. The filtering module 235 can perform a deblocking filtering operation, a SAO operation, and / or an ALF operation on the reconstructed block and / or picture.
[0103] The memory 240 can store the reconstructed picture or block to be used as a reference picture or reference block, and can supply the reconstructed picture to the output unit.
[0104] Among the entropy decoding module 210, rearrangement module 215, dequantization module 220, inverse transform module 225, prediction module 230, filtering module 235, and memory 240 included in the decoding device 200, the elements directly related to decoding an image, such as the entropy decoding module 210, rearrangement module 215, dequantization module 220, inverse transform module 225, prediction module 230, filtering module 235, etc., can be expressed as a decoder or a decoding module distinguished from other elements.
[0105] In addition, the decoding device 200 may further include a parsing module not illustrated in the drawings, and the parsing module parses information related to the encoded image included in the bitstream. The parsing module may include an entropy decoding module 210 and may be included in the entropy decoding module 210. Such a parsing module may also be implemented as an element of the decoding module.
[0106] Considering the motion of the image between the target object or pictures, inter-frame prediction may be performed on the current block. However, the existing inter-frame prediction method is performed based on a method for compensation of translational motion (translational motion model). Since the inter-frame prediction is performed by deriving a reference block matching the current block based on one motion vector, the translational motion model may be referred to as a block matching method. That is, in the method applied to the existing inter-frame prediction and translational motion model, all samples of the prediction unit (PU) have the same motion information.
[0107] Figure 3 is a view illustrating a manner in which a prediction block is generated from inter-frame prediction applying a translational motion model.
[0108] Reference Figure 3 , since all samples of the PU have the same motion information, prediction and compensation are performed in a limited form. Specifically, according to the translational motion model, the motion vector MV in the x-axis direction x and the motion vector MV in the y-axis direction y are used to specify a region having the same shape and size as the shape and size of the prediction block in the reference picture as a prediction reference block, the motion parameters for one motion vector are in units of the PU, and the samples in the reference block are used as prediction samples for the prediction block. However, the application of the translational motion model has a limitation that the prediction efficiency is reduced due to deformations such as enlargement, reduction, and rotation of the image. According to the present invention, the process of transmitting and deriving the same motion information in units of the existing PU can be modified so that the samples in the PU can have different motion information. The prediction model according to the present invention may be referred to as a two-dimensional affine transformation method or an affine motion model. The inter-frame prediction using the affine motion model may be the same as that Figure 4 illustrated in.
[0109] Figure 4 illustrates an example in which a prediction block is generated in inter-frame prediction using an affine motion model. Hereinafter, the current block may correspond to the PU.
[0110] Reference Figure 4, x and y respectively represent the x - coordinate and y - coordinate of each sample in the current block. x' and y' respectively represent the x - coordinate and y - coordinate of the corresponding sample in the reference picture corresponding to x and y. In this case, the region including the sample at the pointed sample position (x', y') can be called a reference block or a reference region. In this case, the reference block can correspond to a region including an image transformed according to rotational deformation, shape deformation, and dimensional deformation such as magnification or reduction of the image within the current block. Therefore, the size and shape of the reference block may be different from those of the current block. In Figure 5 illustrates the derivation of Figure 4 a specific method for different or unique motion vectors for each sample in the current block illustrated in
[0111] Figure 5 is a view illustrating the state of generating a prediction block and the motion vectors in inter - frame prediction using an affine motion model. Refer to Figure 5 , which shows the formula for deriving motion vectors when applying the affine motion model. The motion vectors can be derived based on the following equation.
[0112] [Equation 1]
[0113]
[0114] Here, v x represents the x - component of the sample - unit motion vector of the sample at the (x, y) coordinates in the current block, and v y represents the y - component of the sample - unit motion vector of the sample at the (x, y) coordinates in the current block. That is, (v x , v y ) is the sample - unit motion vector for the sample at the (x, y) coordinates. Here, a, b, c, d, e, and f represent the parameters of the equation for deriving the sample - unit motion vector (motion information) of the (x, y) coordinates from the control points (CPs) of the current block. The CP can be expressed as a steered pixel. The parameters can be derived from the motion information of the CPs of each PU sent in units of PUs. The equation for deriving the sample - unit motion vector from the motion information of the CPs can be applied to each sample of each PU, or can be derived to the position of the predicted sample in the reference image according to the relative positions of the x - and y - axes of each PU sample. Depending on the segmentation, asymmetric or symmetric type, segmentation ID, etc. applied to the coding unit (CU), and depending on the size of the PU, the sample - unit motion vector can be derived differently. Refer to Figures 6 to 16 for a specific embodiment thereof.
[0115] Figure 6 is a view illustrating the CPs of the PUs divided from the CU based on the segmentation type 2N×2N.
[0116] As illustrated in Equation (1) above, the parameters of the equation for deriving the motion vector of a sample unit can be derived as different values based on the motion vector of the CP of the current block. The CP can be three CPs. The CPs can use the motion information of the CPs at different positions according to the shape of the PU.
[0117] Reference Figure 6 , a method in the PU divided from the CU based on the partition type 2N×2N for the equation for deriving the motion vector of a sample unit is shown. For example, the motion vector of the upper left sample in the PU can be referred to as V0. Additionally, using the samples of the neighboring blocks adjacent to the PU, the motion vectors of each CP can be V1 and V2. That is, when the width and height of the PU are S and the coordinates of the upper left sample position of the PU are (xp, yp), the coordinates of CP0 among the CPs can be set to (xp, yp), the coordinates of CP1 can be set to (xp + S, yp), and the coordinates of CP2 can be set to (xp, yp + S). The motion vector of CP0 can be set to V0, the motion vector of CP1 can be set to V1, and the motion vector of CP2 can be V2. The motion vectors of the CPs can be used to derive the motion vector of the sample unit. The motion vector of the sample unit can be derived based on the following equation.
[0118] [Equation 2]
[0119]
[0120] Here, V x and V y represent the x - component and y - component of the motion vector of the sample for the (x, y) coordinates in the current block respectively, Vx0 and Vy0 represent the x - component and y - component of the motion vector V0 for CP0, Vx1 and Vy1 represent the x - component and y - component of the motion vector V1 for CP1 respectively, and Vx2 and Vy2 represent the x - component and y - component of the motion vector V2 for CP2 respectively. According to the equation for deriving the motion vector of the sample unit as in Equation 2, the motion vector can be derived based on the relative position of each sample in the PU divided from the CU based on the partition type 2N×2N.
[0121] Figure 7 The CPs of the PU divided from the CU based on the partition type N×2N are illustrated. Reference Figure 7, showing the process of deriving the motion vectors of PUs divided from a CU based on the split type Nx2N. The equations for deriving the motion vectors of sample units in a PU can be derived by the same method as in the case of the aforementioned split type 2N×2N. In the process of deriving the formulas, the width values corresponding to the shape of the PU can be used. To derive the motion vectors of sample units, three CPs can be derived, and the positions of the CPs can be adjusted as Figure 7 shown in the figure. That is, when the width and height of the PU are S / 2 and S respectively, and the coordinates of the upper-left sample position of the PU are (xp, yp), the coordinates of CP0 among the CPs are (xp, yp), the coordinates of CP1 can be (xp + S / 2, yp), and the coordinates of CP2 can be (xp, yp + S). The motion vectors of sample units can be derived based on the following equations.
[0122] [Equation 3]
[0123]
[0124] Here, V x and V y represent the x-component and y-component of the motion vector for the sample at the (x, y) coordinates in the current block respectively, Vx0 and Vy0 represent the x-component and y-component of the motion vector V0 for CP0, Vx1 and Vy1 represent the x-component and y-component of the motion vector V1 for CP1 respectively, and Vx2 and Vy2 represent the x-component and y-component of the motion vector V2 for CP2 respectively. Equation 3 represents the equation for deriving the motion vectors of sample units considering that the width of the PU is S / 2. According to the equation for deriving the motion vectors of sample units as in Equation 3, the motion vectors can be derived based on the relative positions of each sample in the PU for the PU divided from the CU based on the split type N×2N.
[0125] Figure 8 Illustrating the CPs of the PU divided from the CU based on the split type 2N×N. As Figure 8 shown in the figure, to derive the motion vectors of sample units, three CPs can be derived, and the positions of the CPs can be adjusted as Figure 8 shown to adjust the height to S / 2 according to the shape of the PU illustrated in Figure 8 . That is, when the width and height of the PU are S and S / 2 respectively, and the coordinates of the upper-left sample position of the PU are (xp, yp), the coordinates of CP0 among the CPs can be (xp, yp), the coordinates of CP1 are (xp + S, yp), and the coordinates of CP2 can be (xp, yp + S / 2). The motion vectors of sample units can be derived based on the following equations.
[0126] [Equation 4]
[0127]
[0128] Here, V x and V y respectively represent the x - component and y - component of the motion vector for the sample of the (x, y) coordinates in the current block. Vx0 and Vy0 represent the x - component and y - component of the motion vector V0 for CP0, Vx1 and Vy1 represent the x - component and y - component of the motion vector V1 for CP1, and Vx2 and Vy2 respectively represent the x - component and y - component of the motion vector V2 for CP2. Equation 4 represents the equation for deriving the motion vector of the sample unit considering the height of the PU as S / 2. According to the equation for deriving the motion vector of the sample unit as in Equation 4, the motion vector can be derived based on the relative position of each sample in the PU divided from the CU based on the segmentation type 2N×N.
[0129] Figure 9 The figure shows the CPs of an asymmetric PU. The asymmetric PU can be a PU divided from the CU based on the segmentation types nL×2N, nR×2N, 2N×nU, or 2N×nD.
[0130] As Figure 9 shown in the figure, the width and height of the asymmetric PU can be W and H respectively. In this case, the equation for deriving the motion vector of the sample unit in the PU can be derived as follows. To derive the motion vector of the sample unit, three CPs for each PU can be derived, and the coordinates of the CPs can be adjusted based on the width and height according to the shape of the PU as Figure 9 shown in the figure. That is, when the width and height of the PU are W and H and the coordinates of the upper - left sample position of each PU are (xp, yp), the coordinates of CP0 among the CPs can be set to (xp, yp), the coordinates of CP1 can be set to (xp + W, yp), and the coordinates of CP2 can be set to (xp, yp + H). In this case, the motion vector of the sample unit in the PU can be derived based on the following equation.
[0131] [Equation 5]
[0132]
[0133] Here, V x and V yrespectively represent the x - component and y - component of the motion vector of the sample for the (x, y) coordinates in the current block, Vx0 and Vy0 represent the x - component and y - component of the motion vector V0 for CP0, Vx1 and Vy1 represent the x - component and y - component of the motion vector V1 for CP1, and Vx2 and Vy2 respectively represent the x - component and y - component of the motion vector V2 for CP2. Equation 5 represents an equation for deriving the motion vector of the sample unit considering the width and height of the asymmetric Pus. According to the equation for deriving the motion vector of the sample unit as in Equation 5, the motion vector can be derived based on the relative position of each sample in the PU divided from the CU according to the segmentation types nL×2N, nR×2N, 2N×nU, or 2N×nD.
[0134] Meanwhile, according to the present invention, in order to reduce the motion information of the CPs sent in units of PUs, for example, three CPs, the motion information prediction candidates for at least one CP can be selected based on the motion information of neighboring blocks or neighboring samples of the PU. The motion information prediction candidates can be referred to as motion information candidates or motion vector candidates.
[0135] Figure 10 Illustrate the motion information prediction candidates of the CPs of the PU applying the segmentation type 2N×2N. Refer to Figure 10 , a method of configuring the motion information prediction candidates of the CPs is shown. The motion information of neighboring blocks (or neighboring samples) adjacent to each CP can be used as the prediction candidates for the motion information of the three CPs. Additionally, the motion information of neighboring samples adjacent to each CP can be used as the motion information prediction candidate for each CP. For example, in the case of the motion vector v0 of CP0, three pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2. In the case where the width and height of the PU are S and the coordinates of the upper - left sample position of the PU are (xp, yp), A0 is the motion vector of the sample at the (xp - 1, yp - 1) coordinates, and A1 can represent the motion vector of the sample at the (xp, yp - 1) coordinates, and A2 can represent the motion vector of the sample at the (xp - 1, yp) coordinates. In this case, at least one of the motion vectors A0, A1, and A2 can be used as the prediction candidate for v0.
[0136] In addition, in the case of the motion vector v1 of CP1, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by B0 and B1, respectively. In the case where the width and height of the PU are S and the coordinates of the upper-left sample position of the PU are (xp, yp), B0 can represent the coordinates (xp + S - 1, yp - 1), and B1 can represent the motion vector of the sample at the coordinates (xp + S - 1, yp - 1). In this case, at least one of the motion vectors B0 and B1 can be used as a prediction candidate for v1.
[0137] Moreover, in the case of the motion vector v2 of CP2, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1, respectively. In the case where the width and height of the PU are S and the coordinates of the upper-left sample position of the PU are (xp, yp), C0 can represent the motion vector of the sample at the coordinates (xp - 1, yp + S) and C1 can represent the motion vector of the sample at the coordinates (xp - 1, yp + S - 1). In this case, at least one of the motion vectors C0 and C1 can be used as a prediction candidate for v2.
[0138] In this case, if the affine motion model is applied to the neighboring block including the sample at the corresponding position, the motion information of the prediction candidate position can be derived based on the motion vector of the sample at the corresponding position, and if the affine motion model is not applied to the neighboring block including the sample at the corresponding position, the motion information of the prediction candidate position can be derived based on the motion vector of the neighboring block including the sample at the corresponding position. This is the same in the case of the other remaining embodiments described below. Figures 10 to 16 Specifically, for example, in the case where the affine motion model is applied to the neighboring block including the sample at the coordinates (xp - 1, yp - 1), A0 can be derived based on the motion vector of the sample at the coordinates (xp - 1, yp - ), and in the case where the affine motion model is not applied to the neighboring block including the sample at the coordinates (xp - 1, yp - 1), A0 can be derived based on the motion vector block of the neighboring block including the sample at the coordinates (xp - 1, yp - 1).
[0139] In this case, the number of prediction candidates for each CP in the figure can be used to distinguish between prediction candidates or can indicate the priority order of the prediction candidates. For example, in the case of the prediction candidates for CP0, A0 can have a higher priority than A1, and A1 can have a higher priority than A2. This is the same for the other remaining embodiments described below. Figures 11 to 16 This is the same for the other remaining embodiments.
[0140] Figure 11 The figure shows the prediction candidates of the motion information of the CP for the PU of the application segmentation type 2NxN. Refer to Figure 11 , which shows a method for configuring the prediction candidates of the motion information of the CP. As Figure 11 shown in, considering the fact that the PU is not square, the prediction candidates for the motion vector of the CP can be configured, and the prediction candidates for the motion vector of the CP can be configured considering the decoding processing order of the PU.
[0141] The motion information of the neighboring blocks (or neighboring samples) adjacent to each CP can be used as the prediction candidates for the motion information of the three CPs. When the affine motion model is applied to the neighboring blocks, the motion information of the neighboring samples adjacent to each CP can be used as the prediction candidates for the motion information of each CP. For example, in the case of the motion vector v0 of CP0, three pieces of motion information among the multiple pieces of motion information of the previously decoded neighboring blocks (or neighboring samples) can be used as the prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2. In the case where the width and height of the PU are S and S / 2 respectively and the coordinates of the upper left sample position of the PU are (xp, yp), A0 is the motion vector of the sample at the coordinates (xp - 1, yp - 1), and A1 can represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 can represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, at least one of the motion vectors A0, A1, and A2 can be used as the prediction candidate for v0.
[0142] In addition, in the case of the motion vector v1 of CP1, two pieces of motion information among the multiple pieces of motion information of the previously decoded neighboring blocks (or neighboring samples) can be used as the prediction candidates, and the two pieces of motion information can be represented by B0 and B1 respectively. In the case where the width and height of the PU are S and S / 2 respectively and the coordinates of the upper left sample position of the PU are (xp, yp), B0 can represent the motion vector of the sample at the coordinates (xp + S - 1, yp - 1), and B1 can represent the motion vector of the sample at the coordinates (xp + S - 1, yp - 1). In this case, at least one of the motion vectors B0 and B1 can be used as the prediction candidate for v1.
[0143] Moreover, in the case of the motion vector v2 of CP2, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1, respectively. In the case where the width and height of the PU are S and S / 2, respectively, and the coordinates of the top-left sample position of the PU are (xp, yp), C0 can represent the motion vector of the sample at the coordinates (xp - 1, yp + S / 2), and C1 can represent the motion vector of the sample at the coordinates (xp - 1, yp + S / 2 - 1). In this case, at least one of the motion vectors C0 and C1 can be used as a prediction candidate for v2.
[0144] In another embodiment, when the partition ID of the PU is 1, samples of neighboring blocks of the current CU can be further included as prediction candidates for the motion vector v0 of CP0 and the motion vector v1 of CP1. For example, in the case of the motion vector v0 of CP0, motion information of previously decoded neighboring blocks (i.e., neighboring blocks or neighboring samples of the current CU) can be further included as a prediction candidate. Specifically, at least one of three pieces of motion information of neighboring samples can be further used as a prediction candidate, and the three pieces of motion information can be represented by A3, A4, and A5, respectively. In the case where the width and height of the CU including the PU are S and the coordinates of the top-left sample position of the CU are (xc, yc), A3 can represent the motion vector of the sample at the coordinates (xc - 1, yc), A4 can represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), and A5 can represent the motion vector of the sample at the coordinates (xc, yc - 1). In this case, at least one of the motion vectors A3, A4, and A5 can be further used as a prediction candidate for v0.
[0145] Moreover, in the case of the motion vector v1 of CP1, motion information of previously decoded neighboring blocks (or neighboring samples) can be used as a prediction candidate. Specifically, at least one of three pieces of motion information of neighboring samples can be further used as a prediction candidate, and the three pieces of motion information can be represented by B2, B3, and B4, respectively. In the case where the width and height of the CU including the PU are S and the coordinates of the top-left sample position of the CU are (xc, yc), B2 can represent the motion vector of the sample at the coordinates (xc + S, yc), B3 can represent the motion vector of the sample at the coordinates (xc + S - 1, yc - 1), and B4 can represent the motion vector of the sample at the coordinates (xc + S - 1, yc - 1). In this case, at least one of the motion vectors B2, B3, and B4 can be further used as a prediction candidate for v1.
[0146] In another embodiment, each PU included in a CU may use the same prediction candidates of the PUs in the CU as the prediction candidates for the motion vectors of the CPs, regardless of the partition ID. For example, in the case of the motion vector v0 of CP0 of each PU, three pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (i.e., neighboring blocks or neighboring samples of the current CU) may be used as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2, respectively. In the case where the width and height of the CU are S and the coordinates of the upper left sample position of the CU are (xc, yc), A0 may represent the motion vector of the sample at the (xc - 1, yc - 1) coordinates, A1 may represent the motion vector of the sample at the (xc, yc - 1) coordinates, and A2 may represent the motion vector of the sample at the (xc - 1, yc) coordinates. In this case, at least one of the motion vectors A0, A1, and A2 may be used as a prediction candidate for v0.
[0147] In addition, in the case of the motion vector v1 of CP1 of each PU, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) may be used as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the CU are S and the coordinates of the upper left sample position of the CU are (xc, yc), B0 may represent the motion vector of the sample at the (xc + S, yc - 1) coordinates, and B1 may represent the motion vector of the sample at the (xc + S - 1, yc - 1) coordinates. In this case, at least one of the motion vectors B0 and B1 may be used as a prediction candidate for v1.
[0148] Moreover, in the case of the motion vector v2 of CP2 of each PU, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) may be used as prediction candidates, and the two pieces of motion information may be represented by C0 and C1, respectively. In the case where the width and height of the CU are S and the coordinates of the upper left sample position of the CU are (xc, yc), C0 may represent the motion vector of the sample at the (xc - 1, yc + S) coordinates and C1 may represent the motion vector of the sample at the (xc - 1, yc + S - 1) coordinates. In this case, at least one of the motion vectors C0 and C1 may be used as a prediction candidate for v2.
[0149] As a method of configuring prediction candidates for the motion vectors of the CPs of PUs configured to apply the 2N×N partition type, the prediction candidates may be restricted to a predetermined number for configuration.
[0150] Figure 12 Illustrates a configuration in which the prediction candidates for the CPs of PUs applying the 2N×N partition type are limited to two prediction candidates. Refer to Figure 12, a list of two samples that are prediction candidates for each CP that is a PU is configured. For example, in the case of the motion vector v0 of CP0, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by A0 and A1. In the case where the width and height of the PU are S and S / 2 respectively and the coordinates of the upper-left sample position of the PU are (xp, yp), A0 can represent the motion vector of the sample at the (xp - 1, yp - 1) coordinates, and A1 can represent the motion vector of the sample at the (xp, yp - 1) coordinates. In this case, A0 and A1 can be used as prediction candidates for v0.
[0151] Moreover, in the case of the motion vector v1 of CP1, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by B0 and B1 respectively. In the case where the width and height of the PU are S and S / 2 respectively and the coordinates of the upper-left sample position of the PU are (xp, yp), B0 can represent the motion vector of the sample at the (xp + S - 1, yp - 1) coordinates, and B1 can represent the motion vector of the sample at the (xp + S - 1, yp - 1) coordinates. In this case, the motion vectors B0 and B1 can be used as prediction candidates for v1.
[0152] Moreover, in the case of the motion vector v2 of CP2, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1 respectively. In the case where the width and height of the PU are S and S / 2 respectively and the coordinates of the upper-left sample position of the PU are (xp, yp), C0 can represent the motion vector of the sample at the (xp - 1, yp + S / 2) coordinates, and C1 can represent the motion vector of the sample at the (xp - 1, yp + S / 2 - 1) coordinates. In this case, the motion vectors C0 and C1 can be used as prediction candidates for v2.
[0153] Figure 13 The figure shows the prediction candidates of the motion information of the CPs of a PU with a segmentation type of N×2N. Refer to Figure 13 , which shows a method for configuring the prediction candidates of the motion information of the CPs. As Figure 13 illustrated in, considering the fact that the PU does not have a square shape, the prediction candidates for the motion vectors of the CPs can be configured, and the prediction candidates for the motion vectors of the CPs can be configured considering the decoding processing order of the PU.
[0154] As Figure 13As shown in the figure, the compiled motion information of the neighboring blocks (or neighboring samples) adjacent to each CP can be used as a prediction candidate for the motion information of the three CPs. In the case of applying an affine motion model to the neighboring blocks, the motion information of the neighboring samples adjacent to each CP can be used as a prediction candidate for the motion information of each CP. For example, in the case of the motion vector v0 of CP0, three pieces of motion information among the multiple pieces of motion information of the previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2. In the case where the width and height of the PU are S / 2 and S respectively, and the coordinates of the upper left sample position of the PU are (xp, yp), A0 is the motion vector of the sample at the (xp - 1, yp - 1) coordinates, and A1 can represent the motion vector of the sample at the (xp, yp - 1) coordinates, and A2 can represent the motion vector of the sample at the (xp - 1, yp) coordinates. In this case, at least one of the motion vectors A0, A1, and A2 can be used as a prediction candidate for v0.
[0155] Moreover, in the case of the motion vector v1 of CP1, two pieces of motion information among the multiple pieces of motion information of the previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by B0 and B1 respectively. In the case where the width and height of the PU are S / 2 and S respectively, and the coordinates of the upper left sample position of the PU are (xp, yp), B0 can represent the motion vector of the sample at the (xp + S / 2, yp - 1) coordinates, and B1 can represent the motion vector of the sample at the (xp + S / 2 - 1, yp - 1) coordinates. In this case, at least one of the motion vectors B0 and B1 can be used as a prediction candidate for v1. Moreover, in the case where the segmentation ID of the PU is 0, the motion vector B2 of the sample at the (xp + S / 2 + 1, yp - 1) coordinates and the motion vector B3 of the sample at the (xp + S / 2 + 2, yp - 1) coordinates are further included as prediction candidates for v1.
[0156] In addition, in the case of the motion vector v2 of CP2, two pieces of motion information among the multiple pieces of motion information of the previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1 respectively. In the case where the width and height of the PU are S / 2 and S respectively, and the coordinates of the upper left sample position of the PU are (xp, yp), C0 can represent the motion vector of the sample at the (xp - 1, yp + S) coordinates, and C1 can represent the motion vector of the sample at the (xp - 1, yp + S - 1) coordinates. In this case, at least one of the motion vectors C0 and C1 can be used as a prediction candidate for v2.
[0157] In another embodiment, when the split ID of the PU is 1, samples of neighboring blocks of the current CU may be further included as prediction candidates for the motion vector v0 of CP0 and the motion vector v2 of CP2. For example, in the case of the motion vector v0 of CP0, motion information of previously decoded neighboring blocks (i.e., neighboring blocks or neighboring samples of the current CU) may be further included as prediction candidates. Specifically, at least one of three pieces of motion information of neighboring samples may be further used as a prediction candidate, and the three pieces of motion information may be represented by A3, A4, and A5, respectively. In a case where the width and height of the CU including the PU are S and the coordinates of the top-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the (xc - 1, yc - 1) coordinates, A4 may represent the motion vector of the sample at the (xc, yc - 1) coordinates, and A5 may represent the motion vector of the sample at the (xc - 1, yc) coordinates. In this case, at least one of the motion vectors A3, A4, and A5 may be further used as a prediction candidate for v0.
[0158] Moreover, in the case of the motion vector v2 of CP2, motion information of previously decoded neighboring blocks (or neighboring samples) may be used as a prediction candidate. Specifically, at least one of three pieces of motion information of neighboring samples may be further used as a prediction candidate, and the three pieces of motion information may be represented by C2, C3, and C4, respectively. In a case where the width and height of the CU including the PU are S and the coordinates of the top-left sample position of the CU are (xc, yc), C2 may represent the motion vector of the sample at the (xc - 1, yc + S) coordinates, C3 may represent the motion vector of the sample at the (xc, yc + S) coordinates, and C4 may represent the motion vector of the sample at the (xc - 1, yc + S - 1) coordinates. In this case, at least one of the motion vectors C2, C3, and C4 may be further used as a prediction candidate for v2.
[0159] In another embodiment, each PU included in the CU may use the same prediction candidates of the PUs in the CU as prediction candidates for the motion vectors of the CP, regardless of the split ID. For example, in the case of the motion vector v0 of CP0 of each PU, three pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (i.e., neighboring blocks or neighboring samples of the current CU) may be used as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2, respectively. In a case where the width and height of the CU are S and the coordinates of the top-left sample position of the CU are (xc, yc), A0 may represent the motion vector of the sample at the (xc - 1, yc - 1) coordinates, A1 may represent the motion vector of the sample at the (xc, yc - 1) coordinates, and A2 may represent the motion vector of the sample at the (xc - 1, yc) coordinates. In this case, at least one of the motion vectors A0, A1, and A2 may be used as a prediction candidate for v0.
[0160] Moreover, in the case of the motion vector v1 of CP1 of each PU, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by B0 and B1. In the case where the width and height of the CU are S and the coordinates of the upper left sample position of the CU are (xc, yc), B0 can represent the motion vector of the sample at the coordinates (xc + S, yc - 1), and B1 can represent the motion vector of the sample at the coordinates (xc + S - 1, yc - 1). In this case, at least one of the motion vectors B0 and B1 can be used as a prediction candidate for v1.
[0161] Moreover, in the case of the motion vector v2 of CP2 of each PU, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1 respectively. In the case where the width and height of the CU are S and the coordinates of the upper left sample position of the CU are (xc, yc), C0 can represent the motion vector of the sample at the coordinates (xc - 1, yc + S), and C1 can represent the motion vector of the sample at the coordinates (xc - 1, yc + S - 1). In this case, at least one of the motion vectors C0 and C1 can be used as a prediction candidate for v2.
[0162] As a method of configuring prediction candidates for the motion vectors of the CPs of PUs applying the N×2N partition type, the prediction candidates can be restricted to a predetermined number for configuration.
[0163] Figure 14 FIG. illustrates a configuration in which the prediction candidates of the CPs of PUs applying the N×2N partition type are limited to two prediction candidates. Refer to Figure 14 , FIG. illustrates a configuration including a list of two samples as prediction candidates for each CP of the PU. For example, in the case of the motion vector v0 of CP0, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by A0 and A1. In the case where the width and height of the PU are S / 2 and S respectively and the coordinates of the upper left sample position of the PU are (xp, yp), A0 can represent the motion vector of the sample at the coordinates (xp - 1, yp - 1), and A1 can represent the motion vector of the sample at the coordinates (xp, yp - 1). In this case, A0 and A1 can be used as prediction candidates for v0.
[0164] Moreover, in the case of the motion vector v1 of CP1, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by B0 and B1 respectively. In the case where the width and height of the PU are S / 2 and S respectively and the coordinates of the top-left sample position of the PU are (xp, yp), B0 can represent the motion vector of the sample at the coordinates (xp + S / 2, yp - 1), and B1 can represent the motion vector of the sample at the coordinates (xp + S / 2 - 1, yp - 1). In this case, the motion vectors B0 and B1 can be used as prediction candidates for v1.
[0165] Moreover, in the case of the motion vector v2 of CP2, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1 respectively. In the case where the width and height of the PU are S / 2 and S respectively and the coordinates of the top-left sample position of the PU are (xp, yp), C0 can represent the motion vector of the sample at the coordinates (xp - 1, yp + S), and C1 can represent the motion vector of the sample at the coordinates (xp - 1, yp + S - 1). In this case, the motion vectors C0 and C1 can be used as prediction candidates for v2.
[0166] Figure 15 The figure shows the prediction candidates of the motion information of the CP of the asymmetric PU. The asymmetric PU can be a PU divided from the CU based on the segmentation types nL×2N, nR×2N, 2N×nU, or 2N×nD.
[0167] Reference Figure 15 (a) shows a method of configuring the prediction candidates of the motion information of the CP of the PU configured with the segmentation type nL×2N. As shown in Figure 15 (a), considering the fact that the PU does not have a square shape, the prediction candidates for the motion vector of the CP can be configured, and the prediction candidates for the motion vector of the CP can be configured in consideration of the decoding processing order of the PU.
[0168] As Figure 15As illustrated in (a) of, the compiled motion information of neighboring blocks (or neighboring samples) adjacent to each CP can be used as a prediction candidate for the motion information of the three CPs. When applying an affine motion model to the neighboring blocks, the motion information of the neighboring samples adjacent to each CP can be used as a prediction candidate for the motion information of each CP. For example, in the case of the motion vector v0 of CP0, three pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2. In the case where the width and height of the PU are W and H respectively, and the coordinates of the top-left sample position of the PU are (xp, yp), A0 is the motion vector of the sample at the (xp-1, yp-1) coordinates, and A1 can represent the motion vector of the sample at the (xp, yp-1) coordinates, and A2 can represent the motion vector of the sample at the (xp-1, yp) coordinates. In this case, at least one of the motion vectors A0, A1, and A2 can be used as a prediction candidate for v0.
[0169] Moreover, in the case of the motion vector v1 of CP1, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by B0 and B1 respectively. In the case where the width and height of the PU are W and H respectively, and the coordinates of the top-left sample position of the PU are (xp, yp), B0 can represent the motion vector of the sample at the (xp+W, yp-1) coordinates, and B1 can represent the motion vector of the sample at the (xp+W-1, yp-1) coordinates. In this case, at least one of the motion vectors B0 and B1 can be used as a prediction candidate for v1.
[0170] Moreover, in the case of the motion vector v2 of CP2, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1 respectively. In the case where the width and height of the PU are W and H respectively, and the coordinates of the top-left sample position of the PU are (xp, yp), C0 can represent the motion vector of the sample at the (xp-1, yp+H) coordinates, and C1 can represent the motion vector of the sample at the (xp-1, yp+H-1) coordinates. In this case, at least one of the motion vectors C0 and C1 can be used as a prediction candidate for v2.
[0171] In another embodiment, when the split ID of the PU is 1, it may further include samples of adjacent blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v2 of CP2. For example, in the case of the motion vector v0 of CP0, it may further include the motion information of previously decoded adjacent blocks (i.e., adjacent blocks or adjacent samples of the current CU) as prediction candidates. Specifically, at least one of the two motion information of the adjacent samples may be further used as a prediction candidate, and these two motion information may be represented by A3 and A4 respectively. In the case where the width and height of the CU including the PU are H and the coordinates of the upper left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the (xc - 1, yc - 1) coordinates, and A4 may represent the motion vector of the sample at the (xc - 1, yc) coordinates. In this case, at least one of the motion vectors A3 and A4 may be further used as a prediction candidate for v0.
[0172] Moreover, in the case of the motion vector v2 of CP2, it may further include the motion information of previously decoded adjacent blocks (or adjacent samples) as prediction candidates. Specifically, at least one of the two motion information of the adjacent samples may be further used as a prediction candidate, and these two motion information may be represented by C2 and C3 respectively. In the case where the width and height of the CU including the PU are H and the coordinates of the upper left sample position of the CU are (xc, yc), C2 may represent the motion vector of the sample at the (xc - 1, yc + H) coordinates, and C3 may represent the motion vector of the sample at the (xc - 1, yc + H - 1) coordinates. In this case, at least one of the motion vectors C2 and C3 may be further used as a prediction candidate for v2.
[0173] Refer to Figure 15 The (b) of shows a method for configuring prediction candidates for the motion information of the CP of a PU configured with the split type nR×2N. Considering the fact that the PU is not square, the prediction candidates for the motion vector of the CP can be configured, and the prediction candidates for the motion vector of the CP can be configured for the PU considering the PU decoding processing order.
[0174] As Figure 15As illustrated in (b) of, the compiled motion information of neighboring blocks adjacent to each CP can be used as prediction candidates for the motion information of the three CPs. In the case of applying an affine motion model to the neighboring blocks, the motion information of neighboring samples adjacent to each CP can be used as prediction candidates for the motion information of each CP. For example, in the case of the motion vector v0 of CP0, three pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2. In the case where the width and height of the PU are W and H respectively, and the coordinates of the upper-left sample position of the PU are (xp, yp), A0 is the motion vector of the sample at the (xp - 1, yp - 1) coordinates, and A1 can represent the motion vector of the sample at the (xp, yp - 1) coordinates, and A2 can represent the motion vector of the sample at the (xp - 1, yp) coordinates. In this case, at least one of the motion vectors A0, A1, and A2 can be used as a prediction candidate for v0.
[0175] Moreover, in the case of the motion vector v1 of CP1, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by B0 and B1 respectively. In the case where the width and height of the PU are W and H respectively, and the coordinates of the upper-left sample position of the PU are (xp, yp), B0 can represent the motion vector of the sample at the (xp + W, yp - 1) coordinates, and B1 can represent the motion vector of the sample at the (xp + W - 1, yp - 1) coordinates. In this case, at least one of the motion vectors B0 and B1 can be used as a prediction candidate for v1.
[0176] Moreover, in the case of the motion vector v2 of CP2, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1 respectively. In the case where the width and height of the PU are W and H respectively, and the coordinates of the upper-left sample position of the PU are (xp, yp), C0 can represent the motion vector of the sample at the (xp - 1, yp + H) coordinates, and C1 can represent the motion vector of the sample at the (xp - 1, yp + H - 1) coordinates. In this case, at least one of the motion vectors C0 and C1 can be used as a prediction candidate for v2.
[0177] In another embodiment, when the split ID of the PU is 1, samples of neighboring blocks of the current CU may be further included as prediction candidates for the motion vector v0 of CP0 and the motion vector v2 of CP2. For example, in the case of the motion vector v0 of CP0, motion information of previously decoded neighboring blocks (i.e., neighboring blocks or neighboring samples of the current CU) may be further included as prediction candidates. Specifically, at least one of three pieces of motion information of neighboring samples may be further used as a prediction candidate, and the three pieces of motion information may be represented by A3, A4, and A5, respectively. In the case where the width and height of the CU including the PU are H and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the (xc - 1, yc - 1) coordinates, A4 may represent the motion vector of the sample at the (xc, yc - 1) coordinates, and A5 may represent the motion vector of the sample at the (xc - 1, yc) coordinates. In this case, at least one of the motion vectors A3, A4, and A5 may be further used as a prediction candidate for v0.
[0178] In addition, in the case of the motion vector v2 of CP2, motion information of previously decoded neighboring blocks (or neighboring samples) may be used as a prediction candidate. Specifically, at least one of three pieces of motion information of neighboring samples may be further used as a prediction candidate, and the three pieces of motion information may be represented by C2, C3, and C4, respectively. In the case where the width and height of the CU including the PU are H and the coordinates of the upper-left sample position of the CU are (xc, yc), C2 may represent the motion vector of the sample at the (xc - 1, yc + H) coordinates, C3 may represent the motion vector of the sample at the (xc, yc + H) coordinates, and C4 may represent the motion vector of the sample at the (xc - 1, yc + H - 1) coordinates. In this case, at least one of the motion vectors C2, C3, and C4 may be further used as a prediction candidate for v2.
[0179] Reference Figure 15 of (c) shows a method of configuring prediction candidates for motion information of CPs of a PU configured to apply split type 2N×nU. As Figure 15 illustrated in (c) of, considering the fact that the PU does not have a square shape, prediction candidates for the motion vector of the CP may be configured, and prediction candidates for the motion vector of the CP may be configured in consideration of the decoding processing order of the PU.
[0180] As Figure 15As illustrated in (c) thereof, the compiled motion information of neighboring blocks adjacent to each CP can be used as candidates for predicting the motion information of the three CPs. In the case of applying an affine motion model to the neighboring blocks, the motion information of neighboring samples adjacent to each CP can be used as candidates for predicting the motion information for each CP. For example, in the case of the motion vector v0 of CP0, three pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2. In the case where the width and height of the PU are W and H respectively, and the coordinates of the upper left sample position of the PU are (xp, yp), A0 is the motion vector of the sample at (xp - 1, yp - 1), and A1 can represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 can represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, at least one of the motion vectors A0, A1, and A2 can be used as a prediction candidate for v0.
[0181] In addition, in the case of the motion vector v1 of CP1, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by B0 and B1 respectively. In the case where the width and height of the PU are W and H respectively, and the coordinates of the upper left sample position of the PU are (xp, yp), B0 can represent the motion vector of the sample at the coordinates (xp + W, yp - 1), and B1 can represent the motion vector of the sample at the coordinates (xp + W - 1, yp - 1). In this case, at least one of the motion vectors B0 and B1 can be used as a prediction candidate for v1.
[0182] In addition, in the case of the motion vector v2 of CP2, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1 respectively. In the case where the width and height of the PU are W and H respectively, and the coordinates of the upper left sample position of the PU are (xp, yp), C0 can represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 can represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, at least one of the motion vectors C0 and C1 can be used as a prediction candidate for v2.
[0183] In another embodiment, when the split ID of the PU is 1, samples of neighboring blocks of the current CU may be further included as prediction candidates for the motion vector v0 of CP0 and the motion vector v1 of CP1. For example, in the case of the motion vector v0 of CP0, motion information of previously decoded neighboring blocks (i.e., neighboring blocks or neighboring samples of the current CU) may be further included as prediction candidates. Specifically, at least one of two pieces of motion information of neighboring samples may be further used as a prediction candidate, and these two pieces of motion information may be represented by A3 and A4, respectively. In the case where the width and height of the CU including the PU are W and the coordinates of the upper left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the (xc - 1, yc - 1) coordinates, and A4 may represent the motion vector of the sample at the (xc, yc - 1) coordinates. In this case, at least one of the motion vectors A3 and A4 may be further used as a prediction candidate for v0.
[0184] In addition, in the case of the motion vector v1 of CP1, motion information of previously decoded neighboring blocks (or neighboring samples) may be further included as prediction candidates. Specifically, at least one of two pieces of motion information of neighboring samples may be further used as a prediction candidate, and these two pieces of motion information may be represented by B2 and B3, respectively. In the case where the width and height of the CU including the PU are W and the coordinates of the upper left sample position of the CU are (xc, yc), B2 may represent the motion vector of the sample at the (xc + S, yc - 1) coordinates, and B3 may represent the motion vector of the sample at the (xc + S - 1, yc - 1) coordinates. In this case, at least one of the motion vectors B2 and B3 may be further used as a prediction candidate for v1.
[0185] Reference Figure 15 to (d) of Figure 15 illustrates a method of configuring prediction candidates for motion information of CPs of a PU configured with split type 2N×nD. As illustrated in (d) of
[0186] As Figure 15As illustrated in (d) thereof, the compiled motion information of neighboring blocks (or neighboring samples) adjacent to each CP can be used as a prediction candidate for the motion information of the three CPs. In the case of applying an affine motion model to the neighboring blocks, the motion information of the neighboring samples adjacent to each CP can be used as a prediction candidate for the motion information of each CP. For example, in the case of the motion vector v0 of CP0, three pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2. In the case where the width and height of the PU are W and H respectively, and the coordinates of the upper left sample position of the PU are (xp, yp), A0 can be the motion vector of the sample at the (xp - 1, yp - 1) coordinates, A1 can represent the motion vector of the sample at the (xp, yp - 1) coordinates, and A2 can represent the motion vector of the sample at the (xp - 1, yp) coordinates. In this case, at least one of the motion vectors A0, A1, and A2 can be used as a prediction candidate for v0.
[0187] In addition, in the case of the motion vector v1 of CP1, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by B0 and B1 respectively. In the case where the width and height of the PU are W and H respectively, and the coordinates of the upper left sample position of the PU are (xp, yp), B0 can represent the motion vector of the sample at the (xp + W, yp - 1) coordinates, and B1 can represent the motion vector of the sample at the (xp + W - 1, yp - 1) coordinates. In this case, at least one of the motion vectors B0 and B1 can be used as a prediction candidate for v1.
[0188] In addition, in the case of the motion vector v2 of CP2, two pieces of motion information among the motion information of previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1 respectively. In the case where the width and height of the PU are W and H respectively, and the coordinates of the upper left sample position of the PU are (xp, yp), C0 can represent the motion vector of the sample at the (xp - 1, yp + H) coordinates, and C1 can represent the motion vector of the sample at the (xp - 1, yp + H - 1) coordinates. In this case, at least one of the motion vectors C0 and C1 can be used as a prediction candidate for v2.
[0189] In another embodiment, when the split ID of the PU is 1, it may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v1 of CP1. For example, in the case of the motion vector v0 of CP0, it may further include the motion information of previously decoded neighboring blocks (i.e., neighboring blocks or neighboring samples of the current CU) as prediction candidates. Specifically, at least one of the three motion information of the neighboring samples may be further used as a prediction candidate, and the three motion information may be represented by A3, A4, and A5 respectively. In the case where the width and height of the CU including the PU are W and the coordinates of the upper left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinate (xc - 1, yc), A4 may represent the motion vector of the sample at the coordinate (xc - 1, yc - 1), and A5 may represent the motion vector of the sample at the coordinate (xc, yc - 1). In this case, at least one of the motion vectors A3, A4, and A5 may be further used as a prediction candidate for v0.
[0190] Moreover, in the case of the motion vector v1 of CP1, it may further include the motion information of previously decoded neighboring blocks (or neighboring samples) as prediction candidates. Specifically, at least one of the three motion information of the neighboring samples may be further used as a prediction candidate, and the three motion information may be represented by B2, B3, and B4 respectively. In the case where the width and height of the CU including the PU are W and the coordinates of the upper left sample position of the CU are (xc, yc), B2 may represent the motion vector of the sample at the coordinate (xc + W, yc), B3 may represent the motion vector of the sample at the coordinate (xc + W, yc - 1), and B4 may represent the motion vector of the sample at the coordinate (xc + W - 1, yc - 1). In this case, at least one of the motion vectors B2, B3, and B4 may be further used as a prediction candidate for v1.
[0191] Included in Figure 15Each PU in the CU shown in the figure can use the same prediction candidates of the PUs in the CU as the prediction candidates for the motion vectors of the CP, regardless of the shape and the segmentation ID. For example, in the case of the motion vector v0 of CP0 of each PU, among the motion information of the previously decoded neighboring blocks (i.e., the neighboring blocks or neighboring samples of the current CU), three pieces of motion information can be used as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2 respectively. In the case where the width and height of the CU are W and H respectively and the coordinates of the upper left sample position of the CU are (xc, yc), A0 can represent the motion vector of the sample at the (xc - 1, yc - 1) coordinates, A1 can represent the motion vector of the sample at the (xc, yc - 1) coordinates, and A2 can represent the motion vector of the sample at the (xc - 1, yc) coordinates. In this case, at least one of the motion vectors A0, A1, and A2 can be used as a prediction candidate for v0.
[0192] Moreover, in the case of the motion vector v1 of CP1 of each PU, two pieces of motion information among the multiple pieces of motion information of the previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by B0 and B1. In the case where the width and height of the CU are W and the coordinates of the upper left sample position of the CU are (xc, yc), B0 can represent the motion vector of the sample at the (xc + W, yc - 1) coordinates, and B1 can represent the motion vector of the sample at the (xc + W - 1, yc - 1) coordinates. In this case, at least one of the motion vectors B0 and B1 can be used as a prediction candidate for v1.
[0193] Moreover, in the case of the motion vector v2 of CP2 of each PU, two pieces of motion information among the motion information of the previously decoded neighboring blocks (or neighboring samples) can be used as prediction candidates, and the two pieces of motion information can be represented by C0 and C1 respectively. In the case where the width and height of the CU are W and the coordinates of the upper left sample position of the CU are (xc, yc), C0 can represent the motion vector of the sample at the (xc - 1, yc + H) coordinates and C1 can represent the motion vector of the sample at the (xc - 1, yc + H - 1) coordinates. In this case, at least one of the motion vectors C0 and C1 can be used as a prediction candidate for v2.
[0194] As a method for configuring the prediction candidates of the motion vectors of the CP of the PU configured with the nL×2N, nR×2N, 2N×nU, or 2N×nD segmentation type, the prediction candidates can be restricted to a predetermined number for configuration.
[0195] Figure 16The figure shows a configuration in which the prediction candidates of the CP of the asymmetric PU are limited to two prediction candidates. The asymmetric PU may be a PU split from the CU based on the split type nL×2N, nR×2N, 2N×nU, or 2N×nD.
[0196] Reference Figure 16 , the figure shows a configuration in which the prediction candidates of each CP of each PU are limited to two prediction candidates. For example, in the case of the motion vector v0 of CP0, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) may be used as prediction candidates, and the two pieces of motion information may be represented by A0 and A1. In the case where the width and height of the PU are W and H respectively and the coordinates of the upper left sample position of the PU are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp-1, yp-1), and A1 may represent the motion vector of the sample at the coordinates (xp, yp-1). In this case, A0 and A1 may be used as prediction candidates for v0.
[0197] Moreover, in the case of the motion vector v1 of CP1, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) may be used as prediction candidates, and the two pieces of motion information may be represented by B0 and B1 respectively. In the case where the width and height of the PU are W and H respectively and the coordinates of the upper left sample position of the PU are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp+W, yp-1), and B1 may represent the motion vector of the sample at the coordinates (xp+W-1, yp-1). In this case, the motion vectors B0 and B1 may be used as prediction candidates for v1.
[0198] Moreover, in the case of the motion vector v2 of CP2, two pieces of motion information among multiple pieces of motion information of previously decoded neighboring blocks (or neighboring samples) may be used as prediction candidates, and the two pieces of motion information may be represented by C0 and C1 respectively. In the case where the width and height of the PU are W and H respectively and the coordinates of the upper left sample position of the PU are (xp, yp), C0 may represent the motion vector of the sample at (xp-1, yp+H), and C1 may represent the motion vector of the sample at the coordinates (xp-1, yp+H-1). In this case, the motion vectors C0 and C1 may be used as prediction candidates for v2.
[0199] Meanwhile, when deriving the motion vector of each CP as described in the above embodiments, the amount of data for the motion information may increase slightly. A method of reducing the amount of data by applying the feature that each CP is located at the boundary of the current PU may be used.
[0200] If the CP of the PU to be decoded (next PU) immediately adjacent to the current PU has the same position as the CP of the current PU, the encoding device may not encode the motion information regarding the CP of the next PU separately and may use the encoding method of the above prediction candidates only for the CP in the case where there is no motion information in the previous decoding process.
[0201] Figure 17 The figure shows PUs including CPs that require motion information compilation and CPs that do not require motion information compilation. It can be determined whether a PU is a PU that requires motion information through the decoding process of the motion information of adjacent blocks of the current PU in the encoding / decoding device. Therefore, when determining whether a PU is a PU that requires motion information, it may not be necessary to transmit additional syntax information. Refer to Figure 17 , the figure shows the CP of the current PU. The upper left sample of the current PU can be referred to as CP0, the upper right adjacent sample of the current PU can be referred to as CP1, and the lower left adjacent sample of the current PU can be referred to as CP2. In the case of compiling blocks in raster scan order, it can be determined that the right block of the current PU has not been decoded. Therefore, it can be determined that the motion information for the CP located in the right block needs to be compiled. For example, since the motion vectors of CPs other than CP1 have been derived in the process of decoding the previous PU, the encoding device can encode only the motion information for CP1 and send the compiled motion information through the bitstream.
[0202] Figure 18 The figure shows a PU including a CP that does not require motion information encoding. Refer to Figure 18 , the motion information of the sample in which the CP of the current PU is located has been derived from the upper block of the current PU. Therefore, the encoding device can encode the corresponding motion information without decoding additional motion information. That is, without receiving additional motion information, the decoding device can derive the motion vector of the CP of the current PU based on the motion vector derived in the previous decoding process.
[0203] For example, in the case of CP0, when decoding the uppermost block among the left neighboring blocks adjacent to the left boundary of the current block based on the affine motion model, the motion vector of CP1 of the corresponding block can be used as the motion vector of CP0 of the current block. Moreover, when decoding the leftmost block among the upper neighboring blocks adjacent to the upper boundary of the current block based on the affine motion model, the motion vector of CP2 of the corresponding block can be used as the motion vector of CP0 of the current block. Moreover, when decoding the upper-left neighboring block of the current block based on the affine motion model, the motion vector of the lower-right neighboring sample of the corresponding block derived based on the CP of the corresponding block can be used as the motion vector of CP0 of the current block. In this case, the motion vector of the lower-right neighboring sample of the corresponding block can be derived based on the CP of the corresponding block according to the above equations 2 to 5.
[0204] For example, in the case of CP1, when decoding the upper-right neighboring block of the current block based on the affine motion model, the motion vector of CP2 of the corresponding block can be used as the motion vector of CP1 of the current block. When decoding the rightmost block among the upper neighboring blocks adjacent to the upper boundary of the current block based on the affine motion model, the motion vector of the lower-right neighboring sample of the corresponding block derived based on the CP of the block can be used as the motion vector of CP1 of the current block. In this case, the motion vector of the lower-right neighboring sample of the corresponding block can be derived based on the CP of the corresponding block according to the above equations 2 to 5.
[0205] For example, in the case of CP2, when decoding the lower-left neighboring block of the current block based on the affine motion model, the motion vector of CP1 of the corresponding block can be used as the motion vector of CP2 of the current block. Moreover, when decoding the lowermost block among the left neighboring blocks adjacent to the left boundary of the current block based on the affine motion model, the motion vector of the lower-right neighboring block of the corresponding block derived based on the CP of the current block can be used as the motion vector of CP2 of the current block. In this case, the motion vector of the lower-right neighboring sample of the corresponding block can be derived based on the CP of the corresponding block according to the above equations 2 to 5.
[0206] Figure 19 Schematically illustrates a video encoding method of an encoding device according to the present invention. In Figure 19 The method disclosed in can be performed by Figure 1 The encoding device disclosed in. Specifically, for example, Figure 19 Steps S1900 to S1930 of can be performed by the prediction unit of the encoding device, and step S1940 can be performed by the entropy encoding unit of the encoding device.
[0207] The encoding device derives control points (CPs) for the current block (S1900). The encoding device may determine whether to apply the affine motion model to the current block based on the RD cost. In the case of applying the affine motion model to the current block, the encoding device may derive CPs to apply the affine motion model. The CPs may be three CPs.
[0208] For example, in the case where the current block is a PU divided from a CU based on the split type 2N×2N and the width and height of the current block are S, the encoding device may derive three CPs where CP0 is the sample at the (0,0) coordinate, CP1 is the sample at the (S,0) coordinate, and CP2 is the sample at the (0,S) coordinate based on the coordinate (0,0) of the top-left sample position of the current block.
[0209] Moreover, in the case where the current block is a PU divided from a CU based on the split type N×2N and the width and height of the current block are S / 2 and S respectively, the encoding device may derive three CPs where CP0 is the sample at the (0,0) coordinate, CP1 is the sample at the (S / 2,0) coordinate, and CP2 is the top-left sample position of the current block based on the coordinate (0,0) of (0,0).
[0210] Moreover, in the case where the current block is a PU divided from a CU based on the split type 2N×N and the width and height of the current block are S and S / 2 respectively, the encoding device may derive three CPs, where CP0 is the sample at the (0,0) coordinate, CP1 is the sample at the (S / 2,0) coordinate, and CP2 is the sample at the (0,S / 2) coordinate based on the coordinate (0,0) of the top-left sample position of the current block.
[0211] Moreover, in the case where the current block is based on the split types nL×2N, nR×2N, 2N×nU, or 2N×nD and the width and height of the current block are W and H respectively, the encoding device may derive three CPs, where CP0 is the sample at the (0,0) coordinate, CP1 is the sample at the (W,0) coordinate, and CP2 is the sample at the (0,H) coordinate based on the coordinate (0,0) of the top-left sample position of the current block.
[0212] The encoding device obtains motion vectors for the CPs (S1910). The encoding device may derive the motion vectors for the CPs based on neighboring samples adjacent to the CPs. The samples adjacent to the CPs may be configured as prediction candidates. The encoding device may configure the prediction candidates for the motion vectors of the CPs based on the compiled motion information of the neighboring blocks (or samples) adjacent to each CP, and derive the motion vectors of each CP based on the best candidate among the configured prediction candidates. The prediction candidates may be determined based on the split type, split ID, and the shape of the current block.
[0213] For example, when the current block is a PU with an application segmentation type of 2N×2N, in the case of the motion vector v0 of CP0, the encoding device can use three pieces of motion information among the motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2 respectively. When the width and height of the current block are S and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 can represent the motion vector of the sample at the (xp - 1, yp - 1) coordinates, A1 can represent the motion vector of the sample at the (xp, yp - 1) coordinates, and A2 can represent the motion vector of the sample at the (xp - 1, yp) coordinates. In this case, the encoding device can use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the encoding device can derive the motion vector v0 of CP0 based on the neighboring sample group 0 including the sample at the (xp - 1, yp - 1) coordinates, the sample at the (xp, yp - 1) coordinates, and the sample at the (xp - 1, yp) coordinates.
[0214] Moreover, in the case of the motion vector v1 of CP1, the encoding device can use two pieces of motion information among the multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by B0 and B1. When the width and height of the current block are S and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 can represent the motion vector of the sample at the (xp + S, yp - 1) coordinates, and B1 can represent the motion vector of the sample at the (xp + S - 1, yp - 1) coordinates. In this case, the encoding device can use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the encoding device can derive the motion vector v1 of CP1 based on the neighboring sample group 1 including the sample at the (xp + S, yp - 1) coordinates and the sample at the (xp + S - 1, yp - 1) coordinates.
[0215] Moreover, in the case of the motion vector v2 of CP2, the encoding device can use two pieces of motion information among the multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by C0 and C1. When the width and height of the current block are S and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 can represent the motion vector of the sample at the (xp - 1, yp + S) coordinates, and C1 can represent the motion vector of the sample at the (xp - 1, yp + S - 1) coordinates. In this case, the encoding device can use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the encoding device can derive the motion vector v2 of CP2 based on the neighboring sample group 2 including at least one of the sample at the (xp - 1, yp + S) coordinates and the sample at the (xp - 1, yp + S - 1) coordinates.
[0216] In another example, when the current block is a PU with an application partition type of 2N×N and in the case of the motion vector v0 of CP0, the encoding device may use three pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2 respectively. When the width and height of the current block are S and S / 2 respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample with the coordinates of the motion vector (xp - 1, yp - 1) of the sample, A1 may represent the motion vector of the sample with the coordinates (xp, yp - 1), and A2 may represent the motion vector of the sample with the coordinates (xp - 1, yp). In this case, the encoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the encoding device may derive the motion vector v0 of CP0 based on the neighboring sample group 0 including at least one of the sample with the coordinates (xp - 1, yp - 1), the sample with the coordinates (xp, yp - 1), and the sample with the coordinates (xp - 1, yp).
[0217] Moreover, in the case of the motion vector v1 of CP1, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. When the width and height of the current block are S and S / 2 respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample with the coordinates (xp + S, yp - 1), and B1 may represent the motion vector of the sample with the coordinates (xp + S - 1, yp - 1). In this case, the encoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the encoding device may derive the motion vector v1 of CP1 based on the neighboring sample group 1 including at least one of the sample with the coordinates (xp + S, yp - 1) and the sample with the coordinates (xp + S - 1, yp - 1).
[0218] Moreover, in the case of the motion vector v2 of CP2, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are S and S / 2 respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S / 2), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S / 2 - 1). In this case, the encoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the encoding device may derive the motion vector v2 for CP2 based on neighboring sample group 2 including at least one of the sample at the coordinates (xp - 1, yp + S / 2) and the sample at the coordinates (xp - 1, yp + S / 2 - 1).
[0219] In the case where the segmentation ID of the current block is 1, the encoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v1 of CP1. For example, in the case of the motion vector v0 of CP0, the encoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of three pieces of motion information of neighboring samples as prediction candidates, and the three pieces of motion information may be represented by A3, A4, and A5 respectively. In the case where the width and height of the CU including the current block are S and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc), A4 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), and A5 may represent the motion vector of the sample at the coordinates (xc, yc - 1). In this case, the encoding device may further use at least one of the motion vectors A3, A4, and A5 as a prediction candidate for v0. That is, the encoding device may further include at least one of the sample at the coordinates (xc - 1, yc - 1), the sample at the coordinates (xc - 1, yc), and the sample at (xc, yc - 1) in neighboring sample group 0.
[0220] Moreover, in the case of the motion vector v1 of CP1, the encoding device may further include the motion information of neighboring blocks of the current CU as prediction candidates. Specifically, the encoding device may further use at least one of the three motion information of neighboring samples as a prediction candidate, and the three motion information may be represented by B2, B3, and B4, respectively. In the case where the width and height of the CU including the current block are S and the coordinates of the upper-left sample position of the CU are (xc, yc), B2 may represent the motion vector of the sample at the coordinates (xc + S, yc), B3 may represent the motion vector of the sample at the coordinates (xc + S, yc - 1), and B4 may represent the motion vector of the sample at the coordinates (xc + S - 1, yc - 1). In this case, the encoding device may further use at least one of the motion vectors B2, B3, and B4 as a prediction candidate for v1. That is, the encoding device may further include at least one of the samples at the coordinates (xc + S, yc), the sample at the coordinates (xc + S, yc - 1), and the coordinates (xc + S - 1, yc - 1) in the neighboring sample group 1.
[0221] In addition, the encoding device may configure the prediction candidates for the motion vector of CP for the current block by limiting the number of prediction candidates to a certain number. In the case of the motion vector v0 of CP0, the encoding device may use two pieces of motion information among multiple motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by A0 and A1. In the case where the width and height of the current block are S and S / 2, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp - 1, yp - 1) and A1 may represent the motion vector of the sample at the coordinates (xp, yp - 1). In this case, the encoding device may use A0 and A1 as prediction candidates for v0. That is, the encoding device may include the sample at the coordinates (xp - 1, yp - 1) and the sample at the coordinates (xp, yp - 1) in the neighboring sample group 0, and the availability of the sample at the coordinates (xp - 1, yp - 1) and the sample at the coordinates (xp, yp - 1) may be sequentially determined according to the first predefined priority order.
[0222] In the case of the motion vector v1 of CP1, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the current block are S and S / 2 respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + S, yp - 1) and B1 may represent the motion vector of the sample at the coordinates (xp + S - 1, yp - 1). In this case, the encoding device may use B0 and B1 as prediction candidates for v1. That is, the encoding device may include the sample at the coordinates (xp + S, yp - 1) and the sample at the coordinates (xp + S - 1, yp - 1) in neighboring sample group 1, and the availability of the sample at the coordinates (xp + S, yp - 1) and the sample at the coordinates (xp + S - 1, yp - 1) may be sequentially determined according to the second predetermined priority order.
[0223] In the case of the motion vector v2 of CP2, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are S and S / 2 respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S / 2) and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S / 2 - 1). In this case, the encoding device may use C0 and C1 as prediction candidates for v2. That is, the encoding device may include the sample at the coordinates (xp - 1, yp + S / 2) and the sample at the coordinates (xp - 1, yp + S / 2 - 1) in neighboring sample group 2, and the availability of the sample at the coordinates (xp - 1, yp + S / 2) and the sample at the coordinates (xp - 1, yp + S / 2 - 1) may be sequentially determined according to the third predefined priority order.
[0224] In another example, when the current block is a PU with an application split type of N×2N, in the case of the motion vector v0 of CP0, the encoding device can use three pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2 respectively. When the width and height of the current block are S / 2 and S respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 can represent the motion vector of the sample at the coordinates (xp - 1, yp - 1), A1 can represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 can represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, the encoding device can use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the encoding device can derive the motion vector v0 of CP0 based on neighboring sample group 0 including the sample at the coordinates (xp - 1, yp - 1), the sample at the coordinates (xp, yp - 1), and the sample at the coordinates (xp - 1, yp).
[0225] In addition, in the case of the motion vector v1 of CP1, the encoding device can use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by B0 and B1. When the width and height of the current block are S / 2 and S respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 can represent the motion vector of the sample at the coordinates (xp + S / 2, yp - 1), and B1 can represent the motion vector of the sample at the coordinates (xp + S / 2 - 1, yp - 1). In this case, the encoding device can use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. In addition, when the split ID of the current block is 0, the encoding device can also include the motion vector B2 of the sample at the coordinates (xp + S / 2 + 1, yp - 1) and the motion vector B3 of the sample at the coordinates (xp + S / 2 + 2, yp - 1) as prediction candidates for v1. That is, the encoding device can derive the motion vector v1 of CP1 based on neighboring sample group 1 including the sample at the coordinates (xp + S / 2, yp - 1) and the sample at the coordinates (xp + S / 2 - 1, yp - 1).
[0226] In addition, in the case of the motion vector v2 of CP2, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are S / 2 and S respectively and the coordinates of the upper left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S) and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S - 1). In this case, the encoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the encoding device may derive the motion vector v2 of CP2 based on the neighboring sample group 2 including the sample at the coordinates (xp - 1, yp + S) and the sample at the coordinates (xp - 1, yp + S - 1).
[0227] In the case where the split ID of the current block is 1, the encoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v2 of CP2. For example, in the case of the motion vector v0 of CP0, the encoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of three pieces of motion information of neighboring samples as a prediction candidate, and the three pieces of motion information may be represented by A3, A4, and A5 respectively. In the case where the width and height of the CU including the current block are S and the coordinates of the upper left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), A4 may represent the motion vector of the sample at the coordinates (xc, yc - 1), and A5 may represent the motion vector of the sample at the coordinates (xc - 1, yc). In this case, the encoding device may further use at least one of the motion vectors A3, A4, and A5 as a prediction candidate for v0. That is, the encoding device may further include at least one of the sample at the coordinates (xc - 1, yc - 1), the sample at the coordinates (xc - 1, yc), and the sample at the coordinates (xc, yc - 1) in the neighboring sample group 0.
[0228] Moreover, in the case of the motion vector v2 of CP2, the encoding device may further include the motion information of neighboring blocks (or neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of the three motion information of neighboring samples as a prediction candidate, and the three motion information may be represented by C2, C3, and C4 respectively. In the case where the width and height of the CU including the current block are S and the coordinates of the upper left sample position of the CU are (xc, yc), C2 may represent the motion vector of the sample at the coordinates (xc - 1, yc + S), C3 may represent the motion vector of the sample at the coordinates (xc, yc + S), and C4 may represent the motion vector of the sample at the coordinates (xc - 1, yc + S - 1). In this case, the encoding device may further use at least one of the motion vectors C2, C3, and C4 as a prediction candidate for v2. That is, the encoding device may further include at least one of the samples at the coordinates (xc - 1, yc + S), (xc, yc + S), and (xc - 1, yc + S - 1) in the neighboring sample group 2.
[0229] Moreover, the encoding device may configure the prediction candidates for the motion vector of CP for the current block by limiting the number of prediction candidates to a certain number. In the case of the motion vector v0 of CP0, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by A0 and A1. In the case where the width and height of the current block are S / 2 and S respectively and the coordinates of the upper left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp - 1, yp - 1) and A1 may represent the motion vector of the sample at the coordinates (xp, yp - 1). In this case, the encoding device may use A0 and A1 as prediction candidates for v0. That is, the encoding device may include the samples at the coordinates (xp - 1, yp - 1) and (xp, yp - 1) in the neighboring sample group 0, and the availability of the samples at the coordinates (xp - 1, yp - 1) and (xp, yp - 1) may be sequentially determined according to the first predefined priority order.
[0230] In the case of the motion vector v1 of CP1, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the current block are S / 2 and S, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + S / 2, yp - 1) and B1 may represent the motion vector of the sample at the coordinates (xp + S / 2 - 1, yp - 1). In this case, the encoding device may use B0 and B1 as prediction candidates for v1. That is, the encoding device may include the sample at the coordinates (xp + S / 2, yp - 1) and the sample at the coordinates (xp + S / 2 - 1, yp - 1) in neighboring sample group 1, and the availability of the sample at the coordinates (xp + S / 2, yp - 1) and the sample at the coordinates (xp + S / 2 - 1, yp - 1) may be sequentially determined according to a second predefined priority order.
[0231] In addition, in the case of the motion vector v2 of CP2, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are S / 2 and S, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S) and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S - 1). In this case, the encoding device may use C0 and C1 as prediction candidates for v2. That is to say, the encoding device may include the sample at the coordinates (xp - 1, yp + S) and the sample at the coordinates (xp - 1, yp + S - 1) in neighboring sample group 2, and the availability of the sample at the coordinates (xp - 1, yp + S / 2) and the sample at the coordinates (xp - 1, yp + S / 2 - 1) may be sequentially determined according to a third predefined priority order.
[0232] In another example, when the current block is a PU of application split type nL×2N, for example, in the case of the motion vector v0 of CP0, the encoding device may use three pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2, respectively. When the width and height of the current block are W and H, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp - 1, yp - 1), A1 may represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 may represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, the encoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the encoding device may derive the motion vector v0 of CP0 based on neighboring sample group 0 including at least one of the sample at the coordinates (xp - 1, yp - 1), the sample at the coordinates (xp, yp - 1), and the sample at the coordinates (xp - 1, yp).
[0233] Moreover, in the case of the motion vector v1 of CP1, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. When the width and height of the current block are W and H, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + W, yp - 1), and B1 may represent the motion vector of the sample at the coordinates (xp + W - 1, yp - 1). In this case, the encoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the encoding device may derive the motion vector v1 of CP1 based on neighboring sample group 1 including the sample at the coordinates (xp + W, yp - 1) and the sample at the coordinates (xp + W - 1, yp - 1).
[0234] Moreover, in the case of the motion vector v2 of CP2, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are W and H respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, the encoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the encoding device may derive the motion vector v2 regarding CP2 based on the neighboring sample group 2 including the sample at the coordinates (xp - 1, yp + H) and the sample at the coordinates (xp - 1, yp + H - 1).
[0235] Moreover, in the case where the segmentation ID of the current block is 1, the encoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v2 of CP2. For example, in the case of the motion vector v0 of CP0, the encoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of the two pieces of motion information of neighboring samples as a prediction candidate, and the two pieces of motion information may be represented by A3 and A4 respectively. In the case where the width and height of the CU including the current block are H and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), and A4 may represent the motion vector of the sample at the coordinates (xc - 1, yc). In this case, the encoding device may further use at least one of the motion vectors A3 and A4 as a prediction candidate for v0. That is, the encoding device may further include at least one of the sample at the coordinates (xc - 1, yc - 1), the sample at the coordinates (xc - 1, yc), and the sample at the coordinates (xc, yc - 1) in the neighboring sample group 0.
[0236] Moreover, in the case of the motion vector v2 of CP2, the encoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of the two motion information of neighboring samples as a prediction candidate, and the two motion information may be represented by C2 and C3, respectively. In the case where the width and height of the CU including the current block are H and the coordinates of the upper-left sample position of the CU are (xc, yc), C2 may represent the motion vector of the sample at the coordinates (xc-1, yc+H), and C3 may represent the motion vector of the sample at the coordinates (xc-1, yc+H-1). In this case, the encoding device may further use at least one of the motion vectors C2 and C3 as a prediction candidate for v2. That is, the encoding device may further include at least one of the sample at the coordinates (xc-1, yc+H) and the sample at the coordinates (xc-1, yc+H-1) in the neighboring sample group 2.
[0237] In another example, in the case where the current block is a PU of the applied segmentation type nR×2N, for example, in the case of the motion vector v0 of CP0, the encoding device may use three pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2, respectively. In the case where the width and height of the current block are W and H, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp-1, yp-1), A1 may represent the motion vector of the sample at the coordinates (xp, yp-1), and A2 may represent the motion vector of the sample at the coordinates (xp-1, yp). In this case, the encoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the encoding device may derive the motion vector v0 regarding CP0 based on the neighboring sample group 0 including at least one of the sample at the coordinates (xp-1, yp-1), the sample at the coordinates (xp, yp-1), and the sample at the coordinates (xp-1, yp).
[0238] Moreover, in the case of the motion vector v1 of CP1, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the current block are W and H respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + W, yp - 1), and B1 may represent the motion vector of the sample at the coordinates (xp + W - 1, yp - 1). In this case, the encoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the encoding device may derive the motion vector v1 of CP1 based on the neighboring sample group 1 including the sample at the coordinates (xp + W, yp - 1) and the sample at the coordinates (xp + W - 1, yp - 1).
[0239] Moreover, in the case of the motion vector v2 of CP2, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are W and H respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, the encoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the encoding device may derive the motion vector v2 of CP2 based on the neighboring sample group 2 including the sample at the coordinates (xp - 1, yp + H) and the sample at the coordinates (xp - 1, yp + H - 1).
[0240] Moreover, when the segmentation ID of the current block is 1, the encoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v2 of CP2. For example, in the case of the motion vector v0 of CP0, the encoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of three pieces of motion information of the neighboring samples as a prediction candidate, and the three pieces of motion information may be represented by A3, A4, and A5, respectively. When the width and height of the CU including the current block are H and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), A4 may represent the motion vector of the sample at the coordinates (xc, yc - 1), and A5 may represent the motion vector of the sample at the coordinates (xc - 1, yc). In this case, the encoding device may further use at least one of the motion vectors A3, A4, and A5 as a prediction candidate for v0. That is, the encoding device may further include at least one of the samples at the coordinates (xc - 1, yc - 1), the sample at the coordinates (xc - 1, yc), and the sample at (xc, yc - 1) in the adjacent sample group 0.
[0241] Moreover, in the case of the motion vector v2 of CP2, the encoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of three pieces of motion information of the neighboring samples as a prediction candidate, and the three pieces of motion information may be represented by C2, C3, and C4, respectively. When the width and height of the CU including the current block are H and the coordinates of the upper-left sample position of the CU are (xc, yc), C2 may represent the motion vector of the sample at the coordinates (xc - 1, yc + H), C3 may represent the motion vector of the sample at the coordinates (xc, yc + H), and C4 may represent the motion vector of the sample at the coordinates (xc - 1, yc + H - 1). In this case, the encoding device may further use at least one of the motion vectors C2, C3, and C4 as a prediction candidate for v2. That is, the encoding device may further include at least one of the samples at the coordinates (xc - 1, yc + H), the sample at the coordinates (xc, yc + H), and the sample at the coordinates (xc - 1, yc + H - 1) in the neighboring sample group 2.
[0242] In another example, when the current block is a PU with an application split type of 2N×nU, for example, in the case of the motion vector v0 of CP0, the encoding device can use three pieces of motion information among the multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2 respectively. When the width and height of the current block are W and H respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 can represent the motion vector of the sample at the coordinates (xp - 1, yp - 1), A1 can represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 can represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, the encoding device can use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is to say, the encoding device can derive the motion vector v0 of CP0 based on the neighboring sample group 0 including at least one of the sample at the coordinates (xp - 1, yp - 1), the sample at the coordinates (xp, yp - 1), and the sample at the coordinates (xp - 1, yp).
[0243] Moreover, in the case of the motion vector v1 of CP1, the encoding device can use two pieces of motion information among the multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by B0 and B1. When the width and height of the current block are W and H respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 can represent the motion vector of the sample at the coordinates (xp + W, yp - 1), and B1 can represent the motion vector of the sample at the coordinates (xp + W - 1, yp - 1). In this case, the encoding device can use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is to say, the encoding device can derive the motion vector v1 of CP1 based on the neighboring sample group 1 including at least one of the sample at the coordinates (xp + W, yp - 1) and the sample at the coordinates (xp + W - 1, yp - 1).
[0244] Moreover, in the case of the motion vector v2 of CP2, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are W and H, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, the encoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the encoding device may derive the motion vector v2 for CP2 based on neighboring sample group 2 including at least one of the sample at the coordinates (xp - 1, yp + H) and the sample at (xp - 1, yp + H - 1).
[0245] Moreover, in the case where the segmentation ID of the current block is 1, the encoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v1 of CP1. For example, in the case of the motion vector v0 of CP0, the encoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of two pieces of motion information of neighboring samples as a prediction candidate, and the two pieces of motion information may be represented by A3 and A4, respectively. In the case where the width and height of the CU including the current block are W and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), and A4 may represent the motion vector of the sample at the coordinates (xc, yc - 1). In this case, the encoding device may further use at least one of the motion vectors A3 and A4 as a prediction candidate for v0. That is to say, the encoding device may further include at least one of the sample at the coordinates (xc - 1, yc - 1) and the sample at the coordinates (xc, yc - 1) in neighboring sample group 0.
[0246] Moreover, in the case of the motion vector v1 of CP1, the encoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of the two motion information of neighboring samples as a prediction candidate, and the two motion information may be represented by B2 and B3, respectively. In the case where the width and height of the CU including the current block are W and the coordinates of the upper-left sample position of the CU are (xc, yc), B2 may represent the motion vector of the sample at the coordinates (xc + W, yc - 1), and B3 may represent the motion vector of the sample at the coordinates (xc + W - 1, yc - 1). In this case, the encoding device may further use at least one of the motion vectors B2 and B3 as a prediction candidate for v1. That is, the encoding device may further include at least one of the sample at the coordinates (xc + W, yc - 1) and the sample at the coordinates (xc + W - 1, yc - 1) in the neighboring sample group 1.
[0247] In another example, in the case where the current block is a PU of the application segmentation type 2N×nD, for example, in the case of the motion vector v0 of CP0, the encoding device may use three pieces of motion information among multiple motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2, respectively. In the case where the width and height of the current block are W and H, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp - 1, yp - 1), A1 may represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 may represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, the encoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the encoding device may derive the motion vector v0 of CP0 based on at least one of the sample at the coordinates (xp - 1, yp - 1), the sample at the coordinates (xp, yp - 1), and the sample at the coordinates (xp - 1, yp) in the neighboring sample group 0.
[0248] Moreover, in the case of the motion vector v1 of CP1, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the current block are W and H, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + W, yp - 1), and B1 may represent the motion vector of the sample at the coordinates (xp + W - 1, yp - 1). In this case, the encoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the encoding device may derive the motion vector v1 regarding CP1 based on the neighboring sample group 1 including at least one of the sample at the coordinates (xp + W, yp - 1) and the sample at (xp + W - 1, yp - 1).
[0249] Moreover, in the case of the motion vector v2 of CP2, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are W and H, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, the encoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the encoding device may derive the motion vector v2 regarding CP2 based on the neighboring sample group 2 including at least one of the sample at the coordinates (xp - 1, yp + H) and the sample at (xp - 1, yp + H - 1).
[0250] In addition, when the segmentation ID of the current block is 1, the encoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v1 of CP1. For example, in the case of the motion vector v0 of CP0, the encoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of the three pieces of motion information of the neighboring samples as a prediction candidate, and the three pieces of motion information may be represented by A3, A4, and A5, respectively. When the width and height of the CU including the current block are W and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc), A4 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), and A5 may represent the motion vector of the sample at the coordinates (xc, yc - 1). In this case, the encoding device may further use at least one of the motion vectors A3, A4, and A5 as a prediction candidate for v0. That is, the encoding device may further include at least one of the samples at the coordinates (xc - 1, yc - 1), (xc - 1, yc), and (xc, yc - 1) in neighboring sample group 0.
[0251] Moreover, in the case of the motion vector v1 of CP1, the encoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the encoding device may further use at least one of the three pieces of motion information of the neighboring samples as a prediction candidate, and the three pieces of motion information may be represented by B2, B3, and B4, respectively. When the width and height of the CU including the current block are W and the coordinates of the upper-left sample position of the CU are (xc, yc), B2 may represent the motion vector of the sample at the coordinates (xc + W, yc), B3 may represent the motion vector of the sample at the coordinates (xc + W, yc - 1), and B4 may represent the motion vector of the sample at the coordinates (xc + W - 1, yc - 1). In this case, the encoding device may further use at least one of the motion vectors B2, B3, and B4 as a prediction candidate for v1. That is, the encoding device may further include at least one of the samples at the coordinates (xc + W, yc), (xc + W, yc - 1), and (xc + W - 1, yc - 1) in neighboring sample group 1.
[0252] In another example, the encoding device may use the same prediction candidates of the PUs included in the CU as the prediction candidates for the motion vectors of the CPs, regardless of the split ID. For example, in the case of the motion vector v0 of CP0 of the current block, the encoding device may use three pieces of motion information among multiple pieces of motion information of neighboring blocks (i.e., neighboring blocks or neighboring samples of the current CU) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2, respectively. In the case where the width and height of the CU are W and H, respectively, and the coordinates of the upper-left sample position of the CU are (xc, yc), A0 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), A1 may represent the motion vector of the sample at the coordinates (xc, yc - 1), and A2 may represent the motion vector of the sample at the coordinates (xc - 1, yc). In this case, the encoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0.
[0253] In addition, in the case of the motion vector v1 of CP1 of the current block, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the CU are W and the coordinates of the upper-left sample position of the CU are (xc, yc), B0 may represent the motion vector of the sample at the coordinates (xc + W, yc - 1), and B1 may represent the motion vector of the sample at the coordinates (xc + W - 1, yc - 1). In this case, the encoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1.
[0254] In addition, in the case of the motion vector v2 of CP2 of the current block, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1, respectively. In the case where the width and height of the CU are W and the coordinates of the upper-left sample position of the CU are (xc, yc), C0 may represent the motion vector of the sample at the coordinates (xc - 1, yc + H), and C1 may represent the motion vector of the sample at the coordinates (xc - 1, yc + H - 1). In this case, the encoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2.
[0255] In another example, as a method for configuring prediction candidates for the motion vectors of the CPs of the PUs configured with the nL×2N, nR×2N, 2N×nU, or 2N×nD split types, the prediction candidates may be restricted to a predetermined number for configuration.
[0256] In another example, when the current block is a PU of application split type nL×2N, nR×2N, 2N×nU, or 2N×nD, the encoding device can configure the prediction candidates for each CP by limiting their number to two. For example, in the case of the motion vector v0 of CP0, the encoding device can use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by A0 and A1. When the width and height of the current block are W and H respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 can represent the motion vector of the sample at the coordinates (xp-1, yp-1), and A1 can represent the motion vector of the sample at the coordinates (xp, yp-1). In this case, the encoding device can use A0 and A1 as the prediction candidates for v0. That is, the encoding device can include the sample at the coordinates (xp-1, yp-1) and the sample at the coordinates (xp, yp-1) in neighboring sample group 0, and the availability of the sample at the coordinates (xp-1, yp-1) and the sample at the coordinates (xp, yp-1) can be sequentially determined according to the first predefined priority order.
[0257] In addition, in the case of the motion vector v1 of CP1, the encoding device can use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by B0 and B1. When the width and height of the current block are W and H respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 can represent the motion vector of the sample at the coordinates (xp+W, yp-1), and B1 can represent the motion vector of the sample at the coordinates (xp+W-1, yp-1). In this case, the encoding device can use B0 and B1 as the prediction candidates for v1. That is, the encoding device can include the sample at the coordinates (xp+W, yp-1) and the sample at the coordinates (xp+W-1, yp-1) in neighboring sample group 1, and the availability of the sample at the coordinates (xp+w, yp-1) and the sample at the coordinates (xp+W-1, yp-1) can be sequentially determined according to the second predefined priority order.
[0258] Moreover, in the case of the motion vector v2 of CP2, the encoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are W and H respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, the encoding device may use C0 and C1 as prediction candidates for v2. That is, the encoding device may include the sample at the coordinates (xp - 1, yp + H) and the sample at the coordinates (xp - 1, yp + H - 1) in the neighboring sample group 2, and the availability of the sample at the coordinates (xp - 1, yp + H) and the sample at the coordinates (xp - 1, yp + H - 1) may be sequentially determined according to a third predefined priority order.
[0259] The encoding device derives a sample unit motion vector in the current block based on the motion vector for CP (S1920). According to the affine motion model, the motion vector may vary according to each sample coordinate in the current block. If the motion vectors of CP0, CP1, and CP2 are known, the motion vector according to the sample position in the current block can be derived. That is, according to the affine motion model, the motion vectors in CP - the motion vector of CP0 (v x0 ,v y0 ), the motion vector of CP1 (v x1 ,v y1 ), and the motion vector of CP2 (v x2 ,v y2 ) - can be used to derive the sample unit motion vector of the sample position. In this case, the encoding device may derive the sample unit motion vector of the sample position in the current block based on the above equations 2 to 5.
[0260] The encoding device generates prediction samples for the current block based on the sample unit motion vector (S1930). The encoding device may derive a reference region in the reference picture based on the sample unit motion vector, and generate prediction samples for the current block based on the reconstructed samples in the reference region. If the prediction mode for the current block is not the skip mode, the encoding device may generate a residual sample (or residual signal) based on the original samples and the prediction samples of the original picture.
[0261] The encoding device encodes the prediction mode information of the current block and outputs the encoded information (S1940). The encoding device may encode the prediction mode and the derived motion vector for the current block, and output the encoded information in the form of a bitstream. In addition, when the CP of the previous block to be decoded has the same position as the CP of the current block, the encoding device may not separately encode the motion information regarding the CP of the current block.
[0262] For example, in the case of the motion information of CP0 for the current block, when decoding the uppermost block among the left neighboring blocks adjacent to the left boundary of the current block based on the affine motion model, the motion vector of CP1 of the corresponding block may be used as the motion vector of CP0 of the current block, and thus, the motion information for CP0 may not be separately compiled. Moreover, when decoding the leftmost block among the upper neighboring blocks adjacent to the upper boundary of the current block based on the affine motion model, the motion vector of CP2 of the corresponding block may be used as the motion vector of CP0, and thus, the motion information for CP0 may not be separately compiled. Moreover, when decoding the upper left neighboring block of the current block based on the affine motion model, the motion vector of the lower right neighboring sample of the corresponding block derived based on the CP of the corresponding block may be used as the motion vector of CP0 of the current block, and thus, the motion information for CP0 may not be separately compiled. In this case, the motion vector of the lower right neighboring sample of the corresponding block may be derived based on the CP of the corresponding block according to the above equations 2 to 5.
[0263] For example, in the case of CP1 of the current block, when decoding the upper right neighboring block of the current block based on the affine motion model, the motion vector of CP2 of the corresponding block may be used as the motion vector of CP1 of the current block, and thus, the motion information for CP0 may not be separately compiled. In addition, when decoding the rightmost block of the upper neighboring block adjacent to the upper boundary of the current block based on the affine motion model, the motion vector of the lower right neighboring sample of the corresponding block derived based on the CP of the block may be used as the motion vector of CP1 of the current block, and thus the motion information for CP0 may not be separately compiled. In this case, the motion vector of the lower right neighboring sample of the corresponding block may be derived based on the CP of the corresponding block according to the above equations 2 to 5.
[0264] For example, in the case of CP2 of the current block, when decoding the bottom - left neighboring block of the current block based on the affine motion model, the motion vector of CP1 of the corresponding block can be used as the motion vector of CP2 of the current block, and thus, the motion information for CP0 may not be compiled separately. Moreover, when decoding the bottom - most block of the left neighboring block adjacent to the left boundary of the current block based on the affine motion model, the motion vector of the bottom - right neighboring sample of the corresponding block derived based on the CP of the current block can be used as the motion vector of CP2 of the current block, and thus, the motion information for CP0 may not be compiled separately.
[0265] The bitstream can be sent to the decoding device via a network or a storage medium.
[0266] Although not shown, the encoding device may encode information about the residual samples of the current block and output the information. The information about the residual samples may include transform coefficients related to the residual samples.
[0267] Figure 20 Schematically illustrates a video decoding method of a decoding device according to the present invention. Figure 20 The method disclosed in Figure 2 can be executed by the decoding device disclosed in Figure 20 Specifically, for example,
[0268] The decoding device derives control points (CPs) for the current block (S2000). The decoding device may receive information about inter - frame prediction of the current block through the bitstream. When applying the affine motion model to the current block, the decoding device may derive CPs to apply the affine motion model. The CPs may be three CPs. For example, when the current block is a PU split from a CU based on the split type 2N×2N and the width and height of the current block are S, the decoding device may derive three CPs based on the coordinates (0, 0) of the top - left sample position of the current block, where CP0 is the sample at the (0, 0) coordinate, CP1 is the sample at the (S, 0) coordinate, and CP2 is the sample at the (0, S) coordinate.
[0269] Moreover, when the current block is a PU split from a CU based on the split type N×2N and the width and height of the current block are S / 2 and S respectively, the decoding device may derive three CPs based on the coordinates (0, 0) of the top - left sample position of the previous block, where CP0 is the sample at the (0, 0) coordinate, CP1 is the sample at the (S / 2, 0) coordinate, and CP2 is the sample at the (0, S) coordinate.
[0270] In addition, in a case where the current block is a PU divided from a CU based on a split type 2N×N and the width and height of the current block are S and S / 2, respectively, the decoding device may derive three CPs based on the coordinates (0, 0) of the top-left sample position of the current block, where CP0 is the sample at the (0, 0) coordinates, CP1 is the sample at the (S / 2, 0) coordinates, and CP2 is the sample at the (0, S / 2) coordinates.
[0271] Moreover, in a case where the current block is a PU divided from a CU based on a split type nL×2N, nR×2N, 2N×nU, or 2N×nD and the width and height of the current block are W and H, respectively, the decoding device may derive three CPs based on the coordinates (0, 0) of the top-left sample position of the current block, where CP0 is the sample at the (0, 0) coordinates, CP1 is the sample at the (W, 0) coordinates, and CP2 is the sample at the (0, H) coordinates.
[0272] The decoding device obtains a motion vector for the CP (S2010).
[0273] The decoding device may derive the motion vector of the CP based on the motion vector of the current block and the motion vectors of neighboring blocks of the current block. The decoding device may receive the motion information of the CP through a bitstream. In a case where the motion vector of the CP having the same position as the CP of the current block is derived before decoding the current block, the decoding device may not receive the information about the CP of the current block. The decoding device may configure the neighboring samples of each CP into a neighboring sample group and derive the motion vector of the CP based on the neighboring sample group. The neighboring sample group may be determined based on the split type, split ID, and the shape of the current block.
[0274] For example, in a case where the current block is a PU to which a split type 2N×2N is applied, in the case of the motion vector v0 of CP0, the decoding device may use three pieces of motion information among multiple pieces of information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2, respectively. In a case where the width and height of the current block are S and the coordinates of the top-left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the (xp - 1, yp - 1) coordinates, A1 may represent the motion vector of the sample at the (xp, yp - 1) coordinates, and A2 may represent the motion vector of the sample at the (xp - 1, yp) coordinates. In this case, the decoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the decoding device may derive the motion vector v0 of CP0 based on the neighboring sample group 0 including the sample at the (xp - 1, yp - 1) coordinates, the sample at the (xp, yp - 1) coordinates, and the sample at the (xp - 1, yp) coordinates.
[0275] In addition, in the case of the motion vector v1 of CP1, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the current block are S and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + S, yp - 1), and B1 may represent the motion vector of the sample at the coordinates (xp + S - 1, yp - 1). In this case, the decoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the decoding device may derive the motion vector v1 regarding CP1 based on the neighboring sample group 1 including the sample at the coordinates (xp + S, yp - 1) and the sample at the coordinates (xp + S - 1, yp - 1).
[0276] Moreover, in the case of the motion vector v2 of CP2, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are S and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S - 1). In this case, the decoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the decoding device may derive the motion vector v2 regarding CP2 based on the neighboring sample group 2 including at least one of the sample at the coordinates (xp - 1, yp + S) and the sample at the coordinates (xp - 1, yp + S - 1).
[0277] In another example, when the current block is a PU of the application split type 2N×N and in the case of the motion vector v0 of CP0, the decoding device may use three pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2, respectively. When the width and height of the current block are S and S / 2, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp - 1, yp - 1), A1 may represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 may represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, the decoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the decoding device may derive the motion vector v0 of CP0 based on neighboring sample group 0 including at least one of the sample at the coordinates (xp - 1, yp - 1), the sample at the coordinates (xp, yp - 1), and the sample at the coordinates (xp - 1, yp). Coordinates.
[0278] Moreover, in the case of the motion vector v1 of CP1, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. When the width and height of the current block are S and S / 2, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + S, yp - 1), and B1 may represent the motion vector of the sample at the coordinates (xp + S - 1, yp - 1). In this case, the decoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the decoding device may derive the motion vector v1 of CP1 based on neighboring sample group 1 including at least one of the sample at the coordinates (xp + S, yp - 1) and the sample at the coordinates (xp + S - 1, yp - 1).
[0279] Moreover, in the case of the motion vector v2 of CP2, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are S and S / 2, respectively, and the coordinates of the upper left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S / 2), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S / 2 - 1). In this case, the decoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the decoding device may derive the motion vector v2 regarding CP2 based on neighboring sample group 2 including at least one of the sample at the coordinates (xp - 1, yp + S / 2) and the sample at the coordinates (xp - 1, yp + S / 2 - 1).
[0280] In the case where the split ID of the current block is 1, the decoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v1 of CP1. For example, in the case of the motion vector v0 of CP0, the decoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of three pieces of motion information of neighboring samples as prediction candidates, and the three pieces of motion information may be represented by A3, A4, and A5, respectively. In the case where the width and height of the CU including the current block are S and the coordinates of the upper left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc), A4 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), and A5 may represent the motion vector of the sample at the coordinates (xc, yc - 1). In this case, the decoding device may further use at least one of the motion vectors A3, A4, and A5 as a prediction candidate for v0. That is, the decoding device may further include at least one of the sample at the coordinates (xc - 1, yc - 1), the sample at the coordinates (xc - 1, yc), and the sample at (xc, yc - 1) in neighboring sample group 0.
[0281] Moreover, in the case of the motion vector v1 of CP1, the decoding device may further include the motion information of neighboring blocks (or neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of the three motion information of neighboring samples as a prediction candidate, and the three motion information may be represented by B2, B3, and B4 respectively. In the case where the width and height of the CU including the current block are S and the coordinates of the upper left sample position of the CU are (xc, yc), B2 may represent the motion vector of the sample at the coordinates (xc + S, yc), B3 may represent the motion vector of the sample at the coordinates (xc + S, yc - 1), and B4 may represent the motion vector of the sample at the coordinates (xc + S - 1, yc - 1). In this case, the decoding device may further use at least one of the motion vectors B2, B3, and B4 as a prediction candidate for v1. That is, the decoding device may further include at least one of the samples at the coordinates (xc + S, yc), the sample at the coordinates (xc + S, yc - 1), and the sample at the coordinates (xc + S - 1, yc - 1) in neighboring sample group 1.
[0282] Moreover, the decoding device may configure the prediction candidates for the motion vector of CP for the current block by limiting the number of prediction candidates to a certain number. In the case of the motion vector v0 of CP0, the decoding device may use two pieces of motion information among the multiple motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by A0 and A1. In the case where the width and height of the current block are S and S / 2 respectively and the coordinates of the upper left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp - 1, yp - 1) and A1 may represent the motion vector of the sample at the coordinates (xp, yp - 1). In this case, the decoding device may use A0 and A1 as prediction candidates for v0. That is, the decoding device may include the sample at the coordinates (xp - 1, yp - 1) and the sample at the coordinates (xp, yp - 1) in neighboring sample group 0, and the availability of the samples at the coordinates (xp - 1, yp - 1) and (xp, yp - 1) may be sequentially determined according to the first predefined priority order.
[0283] In the case of the motion vector v1 of CP1, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the current block are S and S / 2 respectively and the coordinates of the upper left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + S, yp - 1) and B1 may represent the motion vector of the sample at the coordinates (xp + S - 1, yp - 1). In this case, the decoding device may use B0 and B1 as prediction candidates for v1. That is to say, the decoding device may include the sample at the coordinates (xp + S, yp - 1) and the sample at the coordinates (xp + S - 1, yp - 1) in neighboring sample group 1, and the availability of the sample at the coordinates (xp + S, yp - 1) and the sample at the coordinates (xp + S - 1, yp - 1) may be sequentially determined according to the second predetermined priority order.
[0284] In the case of the motion vector v2 of CP2, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are S and S / 2 respectively and the coordinates of the upper left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S / 2) of the current block and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S / 2 - 1). In this case, the decoding device may use C0 and C1 as prediction candidates for v2. That is to say, the decoding device may include the sample at the coordinates (xp - 1, yp + S / 2) and the sample at the coordinates (xp - 1, yp + S / 2 - 1) in neighboring sample group 2, and the availability of the sample at the coordinates (xp - 1, yp + S / 2) and the sample at the coordinates (xp - 1, yp + S / 2 - 1) may be sequentially determined according to the third predefined priority order.
[0285] In another example, when the current block is a PU with an application segmentation type of N×2N, in the case of the motion vector v0 of CP0, the decoding device can use three pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2, respectively. When the width and height of the current block are S / 2 and S, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 can represent the motion vector of the sample at the coordinates (xp - 1, yp - 1), A1 can represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 can represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, the decoding device can use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the decoding device can derive the motion vector v0 of CP0 based on the neighboring sample group 0 including the sample at the coordinates (xp - 1, yp - 1), the sample at the coordinates (xp, yp - 1), and the sample at the coordinates (xp - 1, yp).
[0286] Moreover, in the case of the motion vector v1 of CP1, the decoding device can use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by B0 and B1. When the width and height of the current block are S / 2 and S, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 can represent the motion vector of the sample at the coordinates (xp + S / 2, yp - 1), and B1 can represent the motion vector of the sample at the coordinates (xp + S / 2 - 1, yp - 1). In this case, the decoding device can use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. Additionally, when the segmentation ID of the current block is 0, the decoding device can further include the motion vector B2 of the sample at the coordinates (xp + S / 2 + 1, yp - 1) and the motion vector B3 of the sample at the coordinates (xp + S / 2 + 2, yp - 1) as prediction candidates for v1. That is, the decoding device can derive the motion vector v1 of CP1 based on the neighboring sample group 1 including the sample at the coordinates (xp + S / 2, yp - 1) and the sample at the coordinates (xp + S / 2 - 1, yp - 1).
[0287] In addition, in the case of the motion vector v2 of CP2, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are S / 2 and S, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S - 1). In this case, the decoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the decoding device may derive the motion vector v2 of CP2 based on neighboring sample group 2 including samples at the coordinates (xp - 1, yp + S) and (xp - 1, yp + S - 1).
[0288] In the case where the segmentation ID of the current block is 1, the decoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v2 of CP2. For example, in the case of the motion vector v0 of CP0, the decoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of three pieces of motion information of neighboring samples as prediction candidates, and the three pieces of motion information may be represented by A3, A4, and A5, respectively. In the case where the width and height of the CU including the current block are S and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), A4 may represent the motion vector of the sample at the coordinates (xc, yc - 1), and A5 may represent the motion vector of the sample at the coordinates (xc - 1, yc). In this case, the decoding device may further use at least one of the motion vectors A3, A4, and A5 as a prediction candidate for v0. That is, the decoding device may further include at least one of the samples at the coordinates (xc - 1, yc - 1), (xc - 1, yc), and (xc, yc - 1) in neighboring sample group 0.
[0289] Moreover, in the case of the motion vector v2 of CP2, the decoding device may further include the motion information of neighboring blocks (or neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of the three motion information of neighboring samples as a prediction candidate, and the three motion information may be represented by C2, C3, and C4 respectively. In the case where the width and height of the CU including the current block are S and the coordinates of the upper-left sample position of the CU are (xc, yc), C2 may represent the motion vector of the sample at the coordinates (xc - 1, yc + S), C3 may represent the motion vector of the sample at the coordinates (xc, yc + S), and C4 may represent the motion vector of the sample at the coordinates (xc - 1, yc + S - 1). In this case, the decoding device may further use at least one of the motion vectors C2, C3, and C4 as a prediction candidate for v2. That is, the decoding device may further include at least one of the samples at the coordinates (xc - 1, yc + S), (xc, yc + S), and (xc - 1, yc + S - 1) in the neighboring sample group 2.
[0290] Moreover, the decoding device may configure the prediction candidates for the motion vector of CP for the current block by limiting the number of prediction candidates to a certain number. In the case of the motion vector v0 of CP0, the decoding device may use two pieces of motion information among the multiple motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by A0 and A1. In the case where the width and height of the current block are S / 2 and S respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp - 1, yp - 1) and A1 may represent the motion vector of the sample at the coordinates (xp, yp - 1). In this case, the decoding device may use A0 and A1 as prediction candidates for v0. That is, the decoding device may include the samples at the coordinates (xp - 1, yp - 1) and (xp, yp - 1) in the neighboring sample group 0, and the availability of the samples at the coordinates (xp - 1, yp - 1) and (xp, yp - 1) may be determined sequentially according to the first predefined priority order.
[0291] In the case of the motion vector v1 of CP1, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the current block are S / 2 and S, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + S / 2, yp - 1) and B1 may represent the motion vector of the sample at the coordinates (xp + S / 2 - 1, yp - 1). In this case, the decoding device may use B0 and B1 as prediction candidates for v1. That is, the decoding device may include the sample at the coordinates (xp + S / 2, yp - 1) and the sample at the coordinates (xp + S / 2 - 1, yp - 1) in neighboring sample group 1, and the availability of the sample at the coordinates (xp + S / 2, yp - 1) and the sample at the coordinates (xp + S / 2 - 1, yp - 1) may be sequentially determined according to a second predefined priority order.
[0292] In addition, in the case of the motion vector v2 of CP2, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are S / 2 and S, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S) and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + S - 1). In this case, the decoding device may use C0 and C1 as prediction candidates for v2. That is, the decoding device may include the sample at the coordinates (xp - 1, yp + S) and the sample at the coordinates (xp - 1, yp + S - 1) in neighboring sample group 2, and the availability of the sample at the coordinates (xp - 1, yp + S) and the sample at the coordinates (xp - 1, yp + S - 1) may be sequentially determined according to a third predefined priority order.
[0293] In another example, when the current block is a PU of the application split type nL×2N, for example, in the case of the motion vector v0 of CP0, the decoding device may use three pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2 respectively. When the width and height of the current block are W and H respectively and the coordinates of the upper left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp-1, yp-1), A1 may represent the motion vector of the sample at the coordinates (xp, yp-1), and A2 may represent the motion vector of the sample at the coordinates (xp-1, yp). In this case, the decoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the decoding device may derive the motion vector v0 regarding CP0 based on the neighboring sample group 0 including at least one of the sample at the coordinates (xp-1, yp-1), the sample at the coordinates (xp, yp-1), and the sample at the coordinates (xp-1, yp).
[0294] In addition, in the case of the motion vector v1 of CP1, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. When the width and height of the current block are W and H respectively and the coordinates of the upper left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp+W, yp-1), and B1 may represent the motion vector of the sample at the coordinates (xp+W-1, yp-1). In this case, the decoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the decoding device may derive the motion vector v1 regarding CP1 based on the neighboring sample group 1 including the sample at the coordinates (xp+W, yp-1) and the sample at the coordinates (xp+W-1, yp-1).
[0295] In addition, in the case of the motion vector v2 of CP2, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. When the width and height of the current block are W and H respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, the decoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the decoding device may derive the motion vector v2 for CP2 based on neighboring sample group 2 including the sample at the coordinates (xp - 1, yp + H) and the sample at (xp - 1, yp + H - 1).
[0296] Moreover, when the segmentation ID of the current block is 1, the decoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v2 of CP2. For example, in the case of the motion vector v0 of CP0, the decoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of two pieces of motion information of neighboring samples as a prediction candidate, and the two pieces of motion information may be represented by A3 and A4 respectively. When the width and height of the CU including the current block are H and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), and A4 may represent the motion vector of the sample at the coordinates (xc - 1, yc). In this case, the decoding device may further use at least one of the motion vectors A3 and A4 as a prediction candidate for v0. That is to say, the decoding device may further include at least one of the sample at the coordinates (xc - 1, yc - 1), the sample at the coordinates (xc - 1, yc), and the sample at the coordinates (xc, yc - 1) in neighboring sample group 0.
[0297] Moreover, in the case of the motion vector v2 of CP2, the decoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of the two pieces of motion information of neighboring samples as a prediction candidate, and the two pieces of motion information may be represented by C2 and C3, respectively. In the case where the width and height of the CU including the current block are H and the coordinates of the upper-left sample position of the CU are (xc, yc), C2 may represent the motion vector of the sample at the coordinates (xc - 1, yc + H), and C3 may represent the motion vector of the sample at the coordinates (xc - 1, yc + H - 1). In this case, the decoding device may further use at least one of the motion vectors C2 and C3 as a prediction candidate for v2. That is, the decoding device may further include at least one of the sample at the coordinates (xc - 1, yc + H) and the sample at the coordinates (xc - 1, yc + H - 1) in the neighboring sample group 2.
[0298] In another example, in the case where the current block is a PU of the application segmentation type nR×2N, for example, in the case of the motion vector v0 of CP0, the decoding device may use three pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2, respectively. In the case where the width and height of the current block are W and H, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp - 1, yp - 1), A1 may represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 may represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, the decoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the decoding device may derive the motion vector v0 of CP0 based on the neighboring sample group 0 including at least one of the sample at the coordinates (xp - 1, yp - 1), the sample at the coordinates (xp, yp - 1), and the sample at the coordinates (xp - 1, yp).
[0299] Moreover, in the case of the motion vector v1 of CP1, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the current block are W and H respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + W, yp - 1), and B1 may represent the motion vector of the sample at the coordinates (xp + W - 1, yp - 1). In this case, the decoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the decoding device may derive the motion vector v1 of CP1 based on the neighboring sample group 1 including the sample at the coordinates (xp + W, yp - 1) and the sample at the coordinates (xp + W - 1, yp - 1).
[0300] In addition, in the case of the motion vector v2 of CP2, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are W and H respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, the decoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the decoding device may derive the motion vector v2 of CP2 based on the neighboring sample group 2 including the sample at the coordinates (xp - 1, yp + H) and the sample at the coordinates (xp - 1, yp + H - 1).
[0301] In addition, when the segmentation ID of the current block is 1, the decoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v2 of CP2. For example, in the case of the motion vector v0 of CP0, the decoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of the three pieces of motion information of neighboring samples as a prediction candidate, and the three pieces of motion information may be represented by A3, A4, and A5 respectively. When the width and height of the CU including the current block are H and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), A4 may represent the motion vector of the sample at the coordinates (xc, yc - 1), and A5 may represent the motion vector of the sample at the coordinates (xc - 1, yc). In this case, the decoding device may further use at least one of the motion vectors A3, A4, and A5 as a prediction candidate for v0. That is, the decoding device may further include at least one of the samples at the coordinates (xc - 1, yc - 1), the sample at the coordinates (xc - 1, yc), and the sample at (xc, yc - 1) in neighboring sample group 0.
[0302] Moreover, in the case of the motion vector v2 of CP2, the decoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of the three pieces of motion information of neighboring samples as a prediction candidate, and the three pieces of motion information may be represented by C2, C3, and C4 respectively. When the width and height of the CU including the current block are H and the coordinates of the upper-left sample position of the CU are (xc, yc), C2 may represent the motion vector of the sample at the coordinates (xc - 1, yc + H), C3 may represent the motion vector of the sample at the coordinates (xc, yc + H), and C4 may represent the motion vector of the sample at the coordinates (xc - ½, yc + H - 1). In this case, the decoding device may further use at least one of the motion vectors C2, C3, and C4 as a prediction candidate for v2. That is, the decoding device may further include at least one of the samples at the coordinates (xc - 1, yc + H), the sample at the coordinates (xc, yc + H), and the sample at the coordinates (xc - 1, yc + H - 1) in neighboring sample group 2.
[0303] In another example, when the current block is a PU with an application split type of 2N×nU, for example, in the case of the motion vector v0 of CP0, the decoding device may use three pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2 respectively. When the width and height of the current block are W and H respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp - 1, yp - 1), A1 may represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 may represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, the decoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the decoding device may derive the motion vector v0 of CP0 based on neighboring sample group 0 including at least one of the sample at the coordinates (xp - 1, yp - 1), the sample at the coordinates (xp, yp - 1), and the sample at the coordinates (xp - 1, yp).
[0304] Moreover, in the case of the motion vector v1 of CP1, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. When the width and height of the current block are W and H respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + W, yp - 1), and B1 may represent the motion vector of the sample at the coordinates (xp + W - 1, yp - 1). In this case, the decoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the decoding device may derive the motion vector v1 of CP1 based on neighboring sample group 1 including at least one of the sample at the coordinates (xp + W, yp - 1) and the sample at the coordinates (xp + W - 1, yp - 1).
[0305] In addition, in the case of the motion vector v2 of CP2, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are W and H respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, the decoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the decoding device may derive the motion vector v2 regarding CP2 based on neighboring sample group 2 including at least one of the sample at the coordinates (xp - 1, yp + H) and the sample at the coordinates (xp - 1, yp + H - 1).
[0306] Moreover, in the case where the split ID of the current block is 1, the decoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v1 of CP1. For example, in the case of the motion vector v0 of CP0, the decoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of two pieces of motion information of neighboring samples as a prediction candidate, and the two pieces of motion information may be represented by A3 and A4 respectively. In the case where the width and height of the CU including the current block are W and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), and A4 may represent the motion vector of the sample at the coordinates (xc, yc - 1). In this case, the decoding device may further use at least one of the motion vectors A3 and A4 as a prediction candidate for v0. That is, the decoding device may further include at least one of the sample at the coordinates (xc - 1, yc - 1) and the sample at the coordinates (xc, yc - 1) in neighboring sample group 0.
[0307] Moreover, in the case of the motion vector v1 of CP1, the decoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of the two motion information of neighboring samples as a prediction candidate, and the two motion information may be represented by B2 and B3 respectively. In the case where the width and height of the CU including the current block are W and the coordinates of the upper left sample position of the CU are (xc, yc), B2 may represent the motion vector of the sample at the coordinates (xc + W, yc - 1), and B3 may represent the motion vector of the sample at the coordinates (xc + W - 1, yc - 1). In this case, the decoding device may further use at least one of the motion vectors B2 and B3 as a prediction candidate for v1. That is, the decoding device may further include at least one of the sample at the coordinates (xc + W, yc - 1) and the sample at the coordinates (xc + W - 1, yc - 1) in the neighboring sample group 1.
[0308] In another example, in the case where the current block is a PU of the application segmentation type 2N×nD, for example, in the case of the motion vector v0 of CP0, the decoding device may use three pieces of motion information among the multiple motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the three pieces of motion information may be represented by A0, A1, and A2 respectively. In the case where the width and height of the current block are W and H respectively and the coordinates of the upper left sample position of the current block are (xp, yp), A0 may represent the motion vector of the sample at the coordinates (xp - 1, yp - 1), A1 may represent the motion vector of the sample at the coordinates (xp, yp - 1), and A2 may represent the motion vector of the sample at the coordinates (xp - 1, yp). In this case, the decoding device may use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0. That is, the decoding device may derive the motion vector v0 of CP0 based on the neighboring sample group 0 including at least one of the sample at the coordinates (xp - 1, yp - 1), the sample at the coordinates (xp, yp - 1), and the sample at the coordinates (xp - 1, yp).
[0309] In addition, in the case of the motion vector v1 of CP1, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by B0 and B1. In the case where the width and height of the current block are W and H, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 may represent the motion vector of the sample at the coordinates (xp + W, yp - 1), and B1 may represent the motion vector of the sample at the coordinates (xp + W - 1, yp - 1). In this case, the decoding device may use at least one of the motion vectors B0 and B1 as a prediction candidate for v1. That is, the decoding device may derive the motion vector v1 regarding CP1 based on the neighboring sample group 1 including at least one of the sample at the coordinates (xp + W, yp - 1) and the sample at (xp + W - 1, yp - 1).
[0310] In addition, in the case of the motion vector v2 of CP2, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are W and H, respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, the decoding device may use at least one of the motion vectors C0 and C1 as a prediction candidate for v2. That is, the decoding device may derive the motion vector v2 regarding CP2 based on the neighboring sample group 2 including at least one of the sample at the coordinates (xp - 1, yp + H) and the sample at (xp - 1, yp + H - 1).
[0311] In addition, when the segmentation ID of the current block is 1, the decoding device may further include samples of neighboring blocks of the current CU as prediction candidates for the motion vector v0 of CP0 and the motion vector v1 of CP1. For example, in the case of the motion vector v0 of CP0, the decoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of the three motion information of neighboring samples as a prediction candidate, and the three motion information may be represented by A3, A4, and A5, respectively. When the width and height of the CU including the current block are W and the coordinates of the upper-left sample position of the CU are (xc, yc), A3 may represent the motion vector of the sample at the coordinates (xc - 1, yc), A4 may represent the motion vector of the sample at the coordinates (xc - 1, yc - 1), and A5 may represent the motion vector of the sample at the coordinates (xc, yc - 1). In this case, the decoding device may further use at least one of the motion vectors A3, A4, and A5 as a prediction candidate for v0. That is, the decoding device may further include at least one of the samples at the coordinates (xc - 1, yc - 1), (xc - 1, yc), and (xc, yc - 1) in the neighboring sample group 0.
[0312] Moreover, in the case of the motion vector v1 of CP1, the decoding device may further include the motion information of neighboring blocks (i.e., neighboring samples) as prediction candidates. Specifically, the decoding device may further use at least one of the three motion information of neighboring samples as a prediction candidate, and the three motion information may be represented by B2, B3, and B4, respectively. When the width and height of the CU including the current block are W and the coordinates of the upper-left sample position of the CU are (xc, yc), B2 may represent the motion vector of the sample at the coordinates (xc + W, yc), B3 may represent the motion vector of the sample at the coordinates (xc + W, yc - 1), and B4 may represent the motion vector of the sample at the coordinates (xc + W - 1, yc - 1). In this case, the decoding device may further use at least one of the motion vectors B2, B3, and B4 as a prediction candidate for v1. That is, the decoding device may further include at least one of the samples at the coordinates (xc + W, yc), (xc + W, yc - 1), and (xc + W - 1, yc - 1) in the neighboring sample group 1.
[0313] In another example, the decoding device can use the same prediction candidates of the PUs included in the CU as the prediction candidates for the motion vectors of the CPs, regardless of the partition ID. For example, in the case of the motion vector v0 of CP0 of the current block, the decoding device can use three pieces of motion information among multiple pieces of motion information of neighboring blocks (i.e., neighboring blocks or neighboring samples of the current CU) as prediction candidates, and the three pieces of motion information can be represented by A0, A1, and A2, respectively. In the case where the width and height of the CU are W and H, respectively, and the coordinates of the upper-left sample position of the CU are (xc, yc), A0 can represent the motion vector of the sample at (xc - 1, yc - 1), A1 can represent the motion vector of the sample at the coordinates (xc, yc - 1), and A2 can represent the motion vector of the sample at the coordinates (xc - 1, yc). In this case, the decoding device can use at least one of the motion vectors A0, A1, and A2 as a prediction candidate for v0.
[0314] In addition, in the case of the motion vector v1 of CP1 of the current block, the decoding device can use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by B0 and B1. In the case where the width and height of the CU are W and the coordinates of the upper-left sample position of the CU are (xc, yc), B0 can represent the motion vector of the sample at the coordinates (xc + W, yc - 1), and B1 can represent the motion vector of the sample at the coordinates (xc + W - 1, yc - 1). In this case, the decoding device can use at least one of the motion vectors B0 and B1 as a prediction candidate for v1.
[0315] Furthermore, in the case of the motion vector v2 of CP2 of the current block, the decoding device can use two pieces of motion information among the motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by C0 and C1, respectively. In the case where the width and height of the CU are W and the coordinates of the upper-left sample position of the CU are (xc, yc), C0 can represent the motion vector of the sample at the coordinates (xc - 1, yc + H) and C1 can represent the motion vector of the sample at the coordinates (xc - 1, yc + H - 1). In this case, the decoding device can use at least one of the motion vectors C0 and C1 as a prediction candidate for v2.
[0316] In another example, as a method for configuring prediction candidates for the motion vectors of the CPs of PUs configured for the nL×2N, nR×2N, 2N×nU, or 2N×nD partition types, the prediction candidates can be limited to a predetermined number for configuration.
[0317] In another example, when the current block is a PU of application split type nL×2N, nR×2N, 2N×nU, or 2N×nD, the decoding device can configure the prediction candidates for each CP by limiting their number to two. For example, in the case of the motion vector v0 of CP0, the decoding device can use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by A0 and A1. When the width and height of the current block are W and H respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), A0 can represent the motion vector of the sample at the coordinates (xp−1, yp−1), and A1 can represent the motion vector of the sample at the coordinates (xp, yp−1). In this case, the decoding device can use A0 and A1 as the prediction candidates for v0. That is, the decoding device can include the sample at the coordinates (xp−1, yp−1) and the sample at the coordinates (xp, yp−1) in neighboring sample group 0, and the availability of the sample at the coordinates (xp−1, yp−1) and the sample at the coordinates (xp, yp−1) can be sequentially determined according to the first predefined priority order.
[0318] In addition, in the case of the motion vector v1 of CP1, the decoding device can use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information can be represented by B0 and B1. When the width and height of the current block are W and H respectively, and the coordinates of the upper-left sample position of the current block are (xp, yp), B0 can represent the motion vector of the sample at the coordinates (xp + W, yp−1), and B1 can represent the motion vector of the sample at the coordinates (xp + W−1, yp−1). In this case, the decoding device can use B0 and B1 as the prediction candidates for v1. That is, the decoding device can include the sample at the coordinates (xp + W, yp−1) and the sample at the coordinates (xp + W−1, yp−1) in neighboring sample group 1, and the availability of the sample at the coordinates (xp + W, yp−1) and the sample at the coordinates (xp + W−1, yp−1) can be sequentially determined according to the second predefined priority order.
[0319] Moreover, in the case of the motion vector v2 of CP2, the decoding device may use two pieces of motion information among multiple pieces of motion information of neighboring blocks (or neighboring samples) as prediction candidates, and the two pieces of motion information may be represented by C0 and C1. In the case where the width and height of the current block are W and H respectively and the coordinates of the upper-left sample position of the current block are (xp, yp), C0 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H), and C1 may represent the motion vector of the sample at the coordinates (xp - 1, yp + H - 1). In this case, the decoding device may use C0 and C1 as prediction candidates for v2. That is to say, the decoding device may include the sample at the coordinates (xp - 1, yp + H) and the sample at the coordinates (xp - 1, yp + H - 1) in the neighboring sample group 2, and the availability of the sample at the coordinates (xp - 1, yp + H) and the sample at the coordinates (xp - 1, yp + H - 1) may be sequentially determined according to a third predefined priority order.
[0320] In addition, the decoding device may derive the motion vector of the CP of the current PU based on the motion vectors derived in the previous decoding process without receiving additional motion information.
[0321] For example, in the case of CP0, in the case of decoding the uppermost block among the left neighboring blocks adjacent to the left boundary of the current block based on the affine motion model, the motion vector of CP0 of the current block may be derived based on the motion vector of CP1 of the corresponding block. Moreover, in the case of decoding the leftmost block among the upper neighboring blocks adjacent to the upper boundary of the current block based on the affine motion model, the motion vector of CP0 of the current block may be derived based on the motion vector of CP2 of the corresponding block. Moreover, in the case of decoding the upper-left neighboring block of the current block based on the affine motion model, the motion vector of CP0 of the current block may be derived based on the motion vector of the lower-right neighboring sample of the corresponding block derived based on the CP of the corresponding block. In this case, the motion vector of the lower-right neighboring sample of the corresponding block may be derived based on the CP of the corresponding block according to the above equations 2 to 5.
[0322] For example, in the case of CP1, in the case of decoding the upper-right neighboring block of the current block based on the affine motion model, the motion vector of CP1 of the current block may be derived based on the motion vector of CP2 of the corresponding block. In the case of decoding the rightmost block of the upper neighboring blocks adjacent to the upper boundary of the current block based on the affine motion model, the motion vector of CP1 of the current block may be derived based on the motion vector of the lower-right neighboring sample of the corresponding block derived based on the CP of the block. In this case, the motion vector of the lower-right neighboring sample of the corresponding block may be derived based on the CP of the corresponding block according to the above equations 2 to 5.
[0323] For example, in the case of CP2, when decoding the bottom-left neighboring block of the current block based on the affine motion model, the motion vector of CP2 of the current block can be derived based on the motion vector of CP1 of the corresponding block. Moreover, when decoding the bottommost block of the left neighboring block adjacent to the left boundary of the current block based on the affine motion model, the motion vector of CP2 of the current block can be derived based on the motion vector of the bottom-right neighboring sample of the corresponding block derived based on the CP of the current block. In this case, the motion vector of the bottom-right neighboring sample of the corresponding block can be derived based on the above-described Equations 2 to 5 based on the CP of the corresponding block.
[0324] The decoding device derives the sample unit motion vector in the current block based on the obtained motion vector (S2020). Based on the motion vector of CP0, the motion vector of CP1, and the motion vector of CP2, the decoding device can derive the sample unit motion vector according to the sample position in the current block. In this case, the decoding device can derive the sample unit motion vector at the sample position in the current block based on Equations 2 to 5.
[0325] The decoding device derives the predicted sample for the current block based on the sample unit motion vector (S2030). The decoding device can derive the reference region in the reference picture based on the sample unit motion vector and generate the predicted sample for the current block based on the reconstructed samples in the reference region.
[0326] The decoding device can generate the reconstructed sample based on the predicted sample. If the prediction mode for the current block is not the skip mode, the decoding device can obtain the residual signal from the bitstream received from the encoding device and generate the residual sample for the current block. In this case, the decoding device can generate the reconstructed sample based on the predicted sample and the residual sample. The decoding device can generate the reconstructed picture based on the reconstructed sample.
[0327] According to the present invention described above, a more accurate sample unit motion vector for the current block can be derived, and the inter-frame prediction efficiency can be significantly increased.
[0328] Moreover, according to the present invention, the motion vector of the sample for the current block can be effectively derived based on the motion vector of the control point for the current block.
[0329] Moreover, according to the present invention, without additionally transmitting information about the motion vector of the control point for the current block, the motion vector of the control point for the current block can be derived based on the motion vector of the control point of the previously decoded neighboring block. Therefore, the data amount for the motion vector of the control point can be eliminated or reduced, and the overall encoding efficiency can be improved.
[0330] In addition, according to the present invention, even when the image of the current block is rotated, enlarged, reduced, or deformed into a parallelogram, and when the image of the current block is shifted in a plane, inter-frame prediction can be effectively performed by using the sample unit motion vector. Therefore, the amount of data for the residual signal of the current block can be eliminated or reduced, and the overall coding efficiency can be improved.
[0331] In the above embodiments, the method is described based on a flowchart using a series of steps or blocks, but the present invention is not limited to the order of the steps. Some steps may occur simultaneously or in an order different from the above steps. In addition, those skilled in the art should understand that the steps shown in the sequence diagram are not exclusive, may include other steps, or one or more steps in the flowchart may be deleted without affecting the scope of the present invention.
[0332] The above method according to the present invention can be implemented in software. The encoding device and / or decoding device according to the present invention may be included in a device that performs image processing, for example, for a TV, a computer, a smart phone, a set-top box, or a display device.
[0333] When an embodiment of the present invention is implemented in software, the above method can be implemented by modules (procedures, functions, etc.) that execute the above functions. Such modules may be stored in a memory and executed by a processor. The memory may be inside or outside the processor, and the memory may be coupled to the processor using various well-known means. The processor may include an application-specific integrated circuit (ASIC), other chip sets, logic circuits, and / or data processing devices. The memory may include a ROM (read-only memory), a RAM (random access memory), a flash memory, a memory card, a storage medium, and / or other storage devices.
Claims
1. A video decoding device, the video decoding device comprising: a memory; and at least one processor configured to execute a computer program stored in the memory having instructions for decoding to perform steps: Derive a motion vector for a control point (CP) of a current block; Derive a motion vector related to a sample position in the current block based on the obtained motion vector for the CP; Derive a predicted sample for the current block based on the motion vector related to the sample position; and Generate a reconstructed block for the current block based on the derived predicted sample for the current block, wherein the CP includes a first CP, a second CP, and a third CP, wherein the first CP is for the upper left corner of the current block, the second CP is for the upper right corner of the current block, and the third CP is for the lower left corner of the current block, wherein the motion vector for the CP includes a first motion vector for the first CP, a second motion vector for the second CP, and a third motion vector for the third CP, wherein the first motion vector is derived from a first block group, wherein the second motion vector is derived from a second block group, wherein the third motion vector is derived from a third block group, wherein the first motion vector is determined based on a first predefined priority order based on the first available block checked first in the first block group, wherein the first block group includes the upper left neighboring block of the current block, a first upper neighboring block that is the leftmost block among the blocks adjacent to the upper side of the current block, and a first left neighboring block that is the uppermost block among the blocks adjacent to the left side of the current block, wherein the second motion vector is determined based on a second predefined priority order based on the first available block checked first in the second block group, wherein the second block group includes the upper right neighboring block of the current block and a second upper neighboring block that is the rightmost block among the blocks adjacent to the upper side of the current block, wherein the third motion vector is determined based on a third predefined priority order based on the first available block checked first in the third block group; and wherein the third block group includes the lower left neighboring block of the current block and a second left neighboring block that is the lowermost block among the blocks adjacent to the left side of the current block.
2. The video decoding device according to claim 1, wherein, the motion vector related to the sample position is derived based on the following equation, Vx = (Vx1 - Vx0) * x / W + (Vx2 - Vx0) * y / H + Vx0, Vy = (Vy1 - Vy0) * x / W + (Vy2 - Vy0) * y / H + Vy0, and Wherein, Vx represents the x-component of the motion vector related to the sample position at the coordinates (x, y), Vy represents the y-component of the motion vector related to the sample position at the coordinates (x, y), Vx0 represents the x-component of the first motion vector for the first CP, Vy0 represents the y-component of the first motion vector for the first CP, Vx1 represents the x-component of the second motion vector for the second CP, Vy1 represents the y-component of the second motion vector for the second CP, Vx2 represents the x-component of the third motion vector for the third CP, and Vy2 represents the y-component of the third motion vector for the third CP.
3. The video decoding device according to claim 1, wherein, The upper left neighboring block is located at the coordinates (xp - 1, yp - 1), the first upper neighboring block is located at the coordinates (xp, yp - 1), and the first left neighboring block is located at the coordinates (xp - 1, yp). The upper right neighboring block is located at the coordinates (xp + W, yp - 1), and the second upper neighboring block is located at the coordinates (xp + W - 1, yp - 1), and The lower left neighboring block is located at the coordinates (xp - 1, yp + H), and the second left neighboring block is located at the coordinates (xp - 1, yp + H - 1), and Where (xp, yp) is the upper left sample position of the current block, and W and H are the width and height of the current block respectively.
4. The video decoding device according to claim 1, wherein, The first predefined priority order is from the upper left neighboring block to the first upper neighboring block to the first left neighboring block, Wherein, the second predefined priority order is from the upper right neighboring block to the second upper neighboring block, and Wherein, the third predefined priority order is from the lower left neighboring block to the second left neighboring block.
5. The video decoding device according to claim 1, Among them, H is equal to W / 2, and Wherein, the second CP is located at the coordinates (xp + W, yp), and the third CP is located at the coordinates (xp, yp + W / 2), and Where (xp, yp) is the upper left sample position of the current block, and W and H are the width and height of the current block respectively.
6. The video decoding device according to claim 5, wherein, Derive the motion vector related to the sample position based on the following equation, Vx = (Vx1 - Vx0) * x / W + (Vx2 - Vx0) * y / (W / 2) + Vx0, Vy = (Vy1 - Vy0) * x / W + (Vy2 - Vy0) * y / (W / 2) + Vy0, and Wherein, Vx represents the x-component of the motion vector related to the sample position at the coordinates (x, y), Vy represents the y-component of the motion vector related to the sample position at the coordinates (x, y), Vx0 represents the x-component of the first motion vector for the first CP, Vy0 represents the y-component of the first motion vector for the first CP, Vx1 represents the x-component of the second motion vector for the second CP, Vy1 represents the y-component of the second motion vector for the second CP, Vx2 represents the x-component of the third motion vector for the third CP, and Vy2 represents the y-component of the third motion vector for the third CP.
7. The video decoding device according to claim 5, wherein, The top-left neighboring block is located at the coordinates (xp - 1, yp - 1), the first top neighboring block is located at the coordinates (xp, yp - 1), and the first left neighboring block is located at the coordinates (xp - 1, yp); The top-right neighboring block is located at the coordinates (xp + W, yp - 1), and the second top neighboring block is located at the coordinates (xp + W - 1, yp - 1), and The bottom-left neighboring block is located at the coordinates (xp - 1, yp + W / 2), and the second left neighboring block is located at the coordinates (xp - 1, yp + W / 2 - 1).
8. A video encoding device, the video encoding device comprising: A memory; And At least one processor configured to execute a computer program stored in the memory having instructions for encoding to perform steps: Derive motion vectors for control points (CPs) of a current block; Derive motion vectors related to sample positions in the current block based on the obtained motion vectors for the CPs; Perform prediction for the current block based on the motion vectors related to the sample positions; And Encode video information regarding the prediction for the current block, Wherein, the CPs include a first CP, a second CP, and a third CP, wherein the first CP is for the top left of the current block, the second CP is for the top right of the current block, and the third CP is for the bottom left of the current block, Wherein, the motion vectors for the CPs include a first motion vector for the first CP, a second motion vector for the second CP, and a third motion vector for the third CP, Wherein, the first motion vector is derived from a first block group, Wherein, the second motion vector is derived from a second block group, Wherein, the third motion vector is derived from a third block group, Wherein, the first motion vector is determined based on the first predefined priority order based on the available blocks first checked in the first block group, Among them, the first block group includes the upper-left neighboring block of the current block, a first upper neighboring block that is the leftmost block among the blocks adjacent to the upper side of the current block, and a first left neighboring block that is the uppermost block among the blocks adjacent to the left side of the current block. Among them, the second motion vector is determined based on the first available block checked in the second block group according to a second predefined priority order. Among them, the second block group includes the upper-right neighboring block of the current block and a second upper neighboring block that is the rightmost block among the blocks adjacent to the upper side of the current block. Among them, the third motion vector is determined based on the first available block checked in the third block group according to a third predefined priority order; and Among them, the third block group includes the lower-left neighboring block of the current block and a second left neighboring block that is the lowermost block among the blocks adjacent to the left side of the current block.
9. The video encoding device according to claim 8, wherein, Derive the motion vector related to the sample position based on the following equation. Vx = (Vx1 - Vx0) * x / W + (Vx2 - Vx0) * y / H + Vx0, Vy = (Vy1 - Vy0) * x / W + (Vy2 - Vy0) * y / H + Vy0, and Among them, the Vx represents the x component of the motion vector related to the sample position at the coordinates (x, y), the Vy represents the y component of the motion vector related to the sample position at the coordinates (x, y), the Vx0 represents the x component of the first motion vector for the first CP, the Vy0 represents the y component of the first motion vector for the first CP, the Vx1 represents the x component of the second motion vector for the second CP, the Vy1 represents the y component of the second motion vector for the second CP, the Vx2 represents the x component of the third motion vector for the third CP, and the Vy2 represents the y component of the third motion vector for the third CP.
10. The video encoding device according to claim 8, wherein the upper-left neighboring block is located at the coordinates (xp - 1, yp - 1), the first upper neighboring block is located at the coordinates (xp, yp - 1), and the first left neighboring block is located at the coordinates (xp - 1, yp); the upper-right neighboring block is located at the coordinates (xp + W, yp - 1), and the second upper neighboring block is located at the coordinates (xp + W - 1, yp - 1), and the lower-left neighboring block is located at the coordinates (xp - 1, yp + H), and the second left neighboring block is located at the coordinates (xp - 1, yp + H - 1).
11. The video encoding device according to claim 8, Among them, the first predefined priority order is from the upper-left neighboring block to the first upper neighboring block to the first left neighboring block, wherein the second predefined priority order is from the upper-right neighboring block to the second upper neighboring block, and wherein the third predefined priority order is from the lower-left neighboring block to the second left neighboring block.
12. The video encoding device according to claim 8, Among them, H is equal to W / 2, wherein, the second CP is located at the coordinates of (xp + W, yp), and the third CP is located at the coordinates of (xp, yp + W / 2), wherein, (xp, yp) is the upper left sample position of the current block, and W and H are the width and height of the current block respectively.
13. The video encoding device according to claim 12, wherein, derive the motion vector related to the sample position based on the following equation, Vx = (Vx1 - Vx0) * x / W + (Vx2 - Vx0) * y / (W / 2) + Vx0, Vy = (Vy1 - Vy0) * x / W + (Vy2 - Vy0) * y / (W / 2) + Vy0, and wherein, Vx represents the x component of the motion vector related to the sample position at the coordinates of (x, y), Vy represents the y component of the motion vector related to the sample position at the coordinates of (x, y), Vx0 represents the x component of the first motion vector for the first CP, Vy0 represents the y component of the first motion vector for the first CP, Vx1 represents the x component of the second motion vector for the second CP, Vy1 represents the y component of the second motion vector for the second CP, Vx2 represents the x component of the third motion vector for the third CP, and Vy2 represents the y component of the third motion vector for the third CP.
14. The video encoding device according to claim 12, wherein, the upper left neighboring block is located at the coordinates of (xp - 1, yp - 1), the first upper neighboring block is located at the coordinates of (xp, yp - 1), and the first left neighboring block is located at the coordinates of (xp - 1, yp), the upper right neighboring block is located at the coordinates of (xp + W, yp - 1), and the second upper neighboring block is located at the coordinates of (xp + W - 1, yp - 1), and the lower left neighboring block is located at the coordinates of (xp - 1, yp + W / 2), and the second left neighboring block is located at the coordinates of (xp - 1, yp + W / 2 - 1).
15. A transmission device for video data, the transmission device comprising: a memory; and at least one processor configured to execute a computer program stored in the memory and having instructions for transmitting video data to perform the steps of: obtain a bitstream for the video, wherein the bitstream is generated based on the following: derive the motion vector of the control point (CP) for the current block, derive the motion vector related to the sample position in the current block based on the obtained motion vector of the CP, perform prediction for the current block based on the motion vector related to the sample position, and encode video information regarding the prediction for the current block; and transmit the data including the bitstream, Among them, the CP includes a first CP, a second CP, and a third CP. Among them, the first CP is used for the upper left corner of the current block, the second CP is used for the upper right corner of the current block, and the third CP is used for the lower left corner of the current block. Among them, the motion vectors for the CP include a first motion vector for the first CP, a second motion vector for the second CP, and a third motion vector for the third CP. Among them, the first motion vector is derived from a first block group. Among them, the second motion vector is derived from a second block group. Among them, the third motion vector is derived from a third block group. Among them, the first motion vector is determined based on the first predefined priority order from the available blocks first checked in the first block group. Among them, the first block group includes the upper left neighboring block of the current block, a first upper neighboring block that is the leftmost block among the blocks adjacent to the upper side of the current block, and a first left neighboring block that is the uppermost block among the blocks adjacent to the left side of the current block. Among them, the second motion vector is determined based on the second predefined priority order from the available blocks first checked in the second block group. Among them, the second block group includes the upper right neighboring block of the current block and a second upper neighboring block that is the rightmost block among the blocks adjacent to the upper side of the current block. Among them, the third motion vector is determined based on the third predefined priority order from the available blocks first checked in the third block group; and Among them, the third block group includes the lower left neighboring block of the current block and a second left neighboring block that is the lowermost block among the blocks adjacent to the left side of the current block.
Citation Information
Patent Citations
A method for decoding video signals having a current block which is to be decoded
CN104378638A
Methods and apparatuses for encoding and decoding motion vector
CN104796722A