METHODS AND EQUIPMENT FOR DECODING VIDEO SIGNALS, METHODS AND EQUIPMENT FOR ENCODING VIDEO SIGNALS, AND COMPUTER-BASED READING METHODS (NOT TEMPORARY)
Patent Information
- Application Number
- VN1202607757
- Authority / Receiving Office
- VN · VN
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2018-07-24
- Filing Date
- 2019-07-01
- Publication Date
- 2026-10-15
AI Technical Summary
Current inter prediction methods in video encoding/decoding struggle to efficiently handle high-resolution and high-quality images, particularly in constructing merge candidate lists and performing motion compensation on a sub-block basis, which affects the accuracy and efficiency of video compression.
The method involves configuring a merge candidate list that includes spatial, temporal, and combination merge candidates, deriving motion information through weighted averages, and using affine candidates to improve inter prediction accuracy and efficiency, especially for sub-blocks and in projection formats like 360 video.
This approach enhances the accuracy of motion information and improves video encoding/decoding performance by utilizing spatial and temporal merge candidates, combination candidates, and affine models, leading to better coding efficiency and prediction accuracy.
Smart Images

Figure VN1202607757_0
Abstract
Description
Merge mode-based inter prediction method and device The present invention relates to an inter prediction method and apparatus. Recently, the demand for high-resolution, high-quality video, such as HD (High Definition) and UHD (Ultra High Definition) video, has been increasing across various application fields, and accordingly, high-efficiency video compression technologies are being discussed. Various image compression technologies exist, such as inter-prediction technology that predicts pixel values in the current picture from previous or subsequent pictures, intra-prediction technology that predicts pixel values in the current picture using pixel information within the current picture, and entropy coding technology that assigns short codes to values with high frequency and long codes to values with low frequency; by utilizing these image compression technologies, image data can be effectively compressed for transmission or storage. The present invention aims to provide an inter prediction method and apparatus. The present invention aims to provide a method and apparatus for constructing a merge candidate list. The present invention aims to provide a motion compensation method and apparatus in sub-block units. The present invention aims to provide a method and apparatus for determining affine candidates. The present invention aims to provide an inter-prediction method and apparatus according to the projection format of 360 video. The video encoding / decoding method and apparatus according to the present invention can construct a merge candidate list of a current block, derive motion information of the current block from the merge candidate list, and perform inter prediction of the current block using the motion information. In the video encoding / decoding method and apparatus according to the present invention, the merge candidate list may include at least one of a spatial merge candidate, a temporal merge candidate, or a combination merge candidate. In the video encoding / decoding method and apparatus according to the present invention, the combined merge candidate can be derived by combining n merge candidates belonging to a merge candidate list. In the video encoding / decoding method and apparatus according to the present invention, the n merge candidates may be merge candidates corresponding to indices 0 to (n-1) in the merge candidate list. In the video encoding / decoding method and apparatus according to the present invention, the index of the combined merge candidate may be larger than the index of the temporal merge candidate. In the video encoding / decoding method and apparatus according to the present invention, the n merge candidates include a first merge candidate and a second merge candidate, and the motion information of the combined merge candidate can be derived by considering the prediction direction of the first merge candidate and the prediction direction of the second merge candidate. In the video encoding / decoding method and apparatus according to the present invention, the motion information of the combined merge candidate can be derived by weighted averaging the motion information of the first merge candidate and the motion information of the second merge candidate. In the video encoding / decoding method and apparatus according to the present invention, the weights of the weighted average may be any one of [1:1], [1:2], [1:3], or [2:3]. The video encoding / decoding method and device according to the present invention can generate a candidate list for predicting motion information of a current block, derive a control point vector of the current block based on the candidate list and candidate index, derive a motion vector of the current block based on the control point vector of the current block, and perform inter-prediction for the current block using the motion vector. In a video encoding / decoding device according to the present invention, the candidate list may include a plurality of affine candidates. In a video encoding / decoding device according to the present invention, the affine candidate may include at least one of a spatial candidate, a temporal candidate, or a configured candidate. In a video encoding / decoding device according to the present invention, the motion vector of the current block can be derived in units of sub-blocks of the current block. In a video encoding / decoding device according to the present invention, the spatial candidate may be determined by considering whether the boundary of the current block touches the boundary of the coding tree block (CTU boundary). In a video encoding / decoding device according to the present invention, the configured candidate may be determined based on a combination of at least two control point vectors corresponding to each corner of the current block. The video encoding / decoding method and apparatus according to the present invention can acquire pixels of all or part of a reference region using data of a correlated region when the reference region for inter-prediction includes the boundary of a reference picture or the boundary between discontinuous surfaces. According to the present invention, the accuracy of motion information can be improved by using not only spatial / temporal merge candidates but also combination merge candidates. According to the present invention, the encoding / decoding performance of an image can be improved through affine model-based inter-prediction. According to the present invention, the accuracy of the prediction can be improved through inter-prediction at the sub-block level. According to the present invention, the encoding / decoding efficiency of inter-prediction can be improved through efficient affine candidate determination. According to the present invention, the encoding efficiency of inter-prediction can be improved by setting a reference region that considers correlation. FIG. 1 is a block diagram of an image encoding device according to one embodiment of the present invention. FIG. 2 is a block diagram of an image decoding device according to one embodiment of the present invention. Figure 3 is an example diagram showing a tree-based block shape. FIG. 4 is an example diagram showing various block shapes that can be obtained from the block division part of the present invention. FIG. 5 illustrates a block division process according to one embodiment of the present invention. FIG. 6 illustrates a method for performing inter-prediction based on a block-unit merge mode as an embodiment to which the present invention is applied. FIG. 7 illustrates an affine model-based inter prediction method as an embodiment to which the present invention is applied. FIG. 8 is an embodiment to which the present invention is applied, and relates to a method for deriving affine candidates from control point vectors of spatial / temporal neighbor blocks. FIG. 9 illustrates a method for deriving a candidate based on a combination of motion vectors of spatial / temporal neighbor blocks as an embodiment to which the present invention is applied. FIG. 10 illustrates a method for deriving motion information of a temporal candidate based on a sub-block as an embodiment to which the present invention is applied. FIG. 11 illustrates an inter-prediction method in an ERP projection format as an embodiment to which the present invention is applied. FIGS. 12 and FIGS. 15 illustrate an inter-prediction method in a CMP projection format as an embodiment to which the present invention is applied. The video encoding / decoding method and apparatus according to the present invention can construct a merge candidate list of a current block, derive motion information of the current block from the merge candidate list, and perform inter prediction of the current block using the motion information. In the video encoding / decoding method and apparatus according to the present invention, the merge candidate list may include at least one of a spatial merge candidate, a temporal merge candidate, or a combination merge candidate. In the video encoding / decoding method and apparatus according to the present invention, the combined merge candidate can be derived by combining n merge candidates belonging to a merge candidate list. In the video encoding / decoding method and apparatus according to the present invention, the n merge candidates may be merge candidates corresponding to indices 0 to (n-1) in the merge candidate list. In the video encoding / decoding method and apparatus according to the present invention, the index of the combined merge candidate may be larger than the index of the temporal merge candidate. In the video encoding / decoding method and apparatus according to the present invention, the n merge candidates include a first merge candidate and a second merge candidate, and the motion information of the combined merge candidate can be derived by considering the prediction direction of the first merge candidate and the prediction direction of the second merge candidate. In the video encoding / decoding method and apparatus according to the present invention, the motion information of the combined merge candidate can be derived by weighted averaging the motion information of the first merge candidate and the motion information of the second merge candidate. In the video encoding / decoding method and apparatus according to the present invention, the weights of the weighted average may be any one of [1:1], [1:2], [1:3], or [2:3]. The video encoding / decoding method and device according to the present invention can generate a candidate list for predicting motion information of a current block, derive a control point vector of the current block based on the candidate list and candidate index, derive a motion vector of the current block based on the control point vector of the current block, and perform inter-prediction for the current block using the motion vector. In a video encoding / decoding device according to the present invention, the candidate list may include a plurality of affine candidates. In a video encoding / decoding device according to the present invention, the affine candidate may include at least one of a spatial candidate, a temporal candidate, or a configured candidate. In a video encoding / decoding device according to the present invention, the motion vector of the current block can be derived in units of sub-blocks of the current block. In a video encoding / decoding device according to the present invention, the spatial candidate may be determined by considering whether the boundary of the current block touches the boundary of the coding tree block (CTU boundary). In a video encoding / decoding device according to the present invention, the configured candidate may be determined based on a combination of at least two control point vectors corresponding to each corner of the current block. The video encoding / decoding method and apparatus according to the present invention can acquire pixels of all or part of a reference region using data of a correlated region when the reference region for inter-prediction includes the boundary of a reference picture or the boundary between discontinuous surfaces. The present invention is capable of various modifications and may have various embodiments, and specific embodiments are illustrated in the drawings and described in detail. However, this is not intended to limit the invention to specific embodiments, and it should be understood that the invention includes all modifications, equivalents, and substitutions that fall within the spirit and scope of the invention. Terms such as first, second, A, B, etc., may be used to describe various components, but said components should not be limited by said terms. These terms are used solely for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be named the second component, and similarly, the second component may be named the first component. The term "and / or" includes a combination of a plurality of related described items or any of a plurality of related described items. When it is stated that one component is "connected" or "connected" to another component, it should be understood that while it may be directly connected or connected to that other component, there may also be other components in between. On the other hand, when it is stated that one component is "directly connected" or "directly connected" to another component, it should be understood that there are no other components in between. The terms used in this application are used merely to describe specific embodiments and are not intended to limit the invention. The singular expression includes the plural expression unless the context clearly indicates otherwise. In this application, terms such as "comprising" or "having" are intended to specify the presence of the features, numbers, steps, actions, components, parts, or combinations thereof described in the specification, and should be understood as not precluding the existence or addition of one or more other features, numbers, steps, actions, components, parts, or combinations thereof. Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as generally understood by those skilled in the art to which the present invention pertains. Terms such as those defined in commonly used dictionaries should be interpreted as having meanings consistent with the context of the relevant technology and should not be interpreted in an ideal or overly formal sense unless explicitly defined in this application. The video encoding and decoding devices may be user terminals such as a personal computer (PC), notebook computer, personal digital assistant (PDA), portable multimedia player (PMP), PlayStation portable (PSP), wireless communication terminal, smartphone, TV, virtual reality (VR), augmented reality (AR), mixed reality (MR), head-mounted display (HMD), smart glasses, etc., or server terminals such as application servers and service servers, and may include various devices equipped with communication devices such as communication modems for performing communication with various devices or wired / wireless communication networks, memory for storing various programs and data for encoding or decoding images or for intra or inter prediction for encoding or decoding, and processors for executing programs to perform calculations and control. In addition, the video encoded into a bitstream by the video encoding device can be transmitted to a video decoding device in real-time or non-real-time through wired or wireless communication networks such as the Internet, a local area wireless network, a wireless LAN network, a WiBro network, or a mobile communication network, or through various communication interfaces such as a cable or a Universal Serial Bus (USB), and then decoded by the video decoding device to be restored and played back as a video. In addition, the image encoded into a bitstream by the image encoding device may be transmitted from the encoding device to the decoder through a computer-readable recording medium. The aforementioned video encoding device and video decoding device may each be separate devices, but depending on the implementation, they may be made into a single video encoding / decoding device. In that case, some components of the video encoding device may be implemented to include at least the same structure or perform at least the same function as some components of the video decoding device, as they are substantially identical technical elements. Therefore, in the detailed description of the technical elements and their operating principles below, redundant explanations of corresponding technical elements will be omitted. Furthermore, since the image decoding device corresponds to a computing device that applies the image encoding method performed by the image encoding device to decoding, the following description will focus on the image encoding device. A computing device may include a memory that stores a program or software module implementing an image encoding method and / or an image decoding method, and a processor connected to the memory that executes the program. Additionally, the image encoding device may be referred to as an encoder, and the image decoding device may be referred to as a decoder. Typically, an image can be composed of a series of still images, which can be classified into Group of Pictures (GOP) units, and each still image can be referred to as a Picture. In this case, a Picture can represent one of a Frame or Field in a progressive signal or an interlaced signal; if encoding / decoding is performed on a frame basis, the image can be represented as a 'Frame,' and if performed on a field basis, as a 'Field.' Although this invention assumes a progressive signal for explanation, it may also be applicable to interlaced signals. Higher-level concepts such as GOPs and Sequences may exist, and each Picture can be divided into specific regions such as slices, tiles, or blocks. Additionally, a single GOP may include units such as I-Picture, P-Picture, and B-Picture. I-Picture may refer to a picture that is encoded / decoded independently without using a reference picture, while P-Picture and B-Picture may refer to pictures that are encoded / decoded by performing processes such as motion estimation and motion compensation using a reference picture. Generally, for P-Picture, I-Picture and P-Picture can be used as reference pictures, and for B-Picture, I-Picture and P-Picture can be used as reference pictures; however, these definitions may change depending on the encoding / decoding settings. Here, the picture referenced for encoding / decoding is called the Reference Picture, and the referenced block or pixel is called the Reference Block or Reference Pixel. Furthermore, the referenced data may include not only pixel values in the spatial domain but also coefficient values in the frequency domain, as well as various encoding / decoding information generated or determined during the encoding / decoding process. For example, this may include intra-prediction related information or motion-related information in the prediction unit, transformation-related information in the transformation / inverse transformation unit, quantization-related information in the quantization / inverse quantization unit, encoding / decoding-related information (context information) in the encoding / decoding unit, and filter-related information in the in-loop filter unit. The smallest unit constituting an image may be a pixel, and the number of bits used to represent a single pixel is called bit depth. Generally, bit depth can be 8 bits, but higher bit depths may be supported depending on the encoding settings. Bit depth may support at least one bit depth depending on the color space. Additionally, it may be composed of at least one color space depending on the image's color format. Depending on the color format, it may be composed of one or more pictures of a certain size or one or more pictures of different sizes. For example, in the case of YCbCr 4:2:0, it may be composed of one luminance component (Y in this example) and two chrominance components (Cb / Cr in this example), where the ratio of the chrominance component to the luminance component may be 1:2 horizontally and vertically. As another example, in the case of 4:4:4, the horizontal and vertical ratios may be the same. As in the example above, if the picture is composed of one or more color spaces, the picture can be divided into each color space. In the present invention, the description will be based on a specific color space (Y in this example) of a specific color format (YCbCr in this example), and the same or similar application (setting dependent on a specific color space) may be applied to other color spaces (Cb, Cr in this example) according to the color format. However, it may also be possible to have partial differences in each color space (setting independent of a specific color space). That is, a setting dependent on each color space may mean having a setting proportional to or dependent on the composition ratio of each component (e.g., determined according to 4:2:0, 4:2:2, 4:4:4, etc.), and a setting independent of each color space may mean having a setting only for that color space, regardless of or independently of the composition ratio of each component. In the present invention, depending on the encoder / decoder, some components may have independent settings or dependent settings. The configuration information or syntax elements required during the video encoding process can be determined at the unit level, such as video, sequence, picture, slice, tile, or block. These can be stored in a bitstream in units such as VPS (Video Parameter Set), SPS (Sequence Parameter Set), PPS (Picture Parameter Set), Slice Header, Tile Header, and Block Header, and transmitted to a decoder. The decoder can then parse these elements at the same level to recover the configuration information transmitted from the encoder and use it in the video decoding process. Additionally, related information can be transmitted via a bitstream in the form of SEI (Supplement Enhancement Information) or metadata, and parsed for use. Each parameter set has a unique ID value, and a lower parameter set may contain the ID value of a higher parameter set to be referenced. For example, a lower parameter set may reference information from a higher parameter set that has a matching ID value among one or more higher parameter sets. Among the various examples of units mentioned above, if one unit includes one or more other units, the corresponding unit may be called the superordinate unit, and the included unit may be called the subordinate unit. In the case of setting information generated in the above unit, it may include content regarding independent settings for each unit, or content regarding settings dependent on previous, subsequent, or higher units. Here, dependent settings can be understood as representing the setting information of the unit by flag information indicating that it follows the settings of previous, subsequent, or higher units (for example, a 1-bit flag where 1 means follow and 0 means do not follow). Although the setting information in the present invention will be explained primarily based on examples of independent settings, examples of addition or replacement with content regarding a dependent relationship to the setting information of previous, subsequent, or higher units of the current unit may also be included. FIG. 1 is a block diagram of an image encoding device according to one embodiment of the present invention. FIG. 2 is a block diagram of an image decoding device according to one embodiment of the present invention. Referring to FIG. 1, the image encoding device may be configured to include a prediction unit, a subtraction unit, a conversion unit, a quantization unit, an inverse quantization unit, an inverse conversion unit, an addition unit, an in-loop filter unit, a memory and / or an encoding unit, some of the above components may not necessarily be included, some or all of which may be optionally included depending on the implementation, and additional components not shown may be included. Referring to FIG. 2, the image decoder may be configured to include a decoder, a prediction unit, an inverse quantization unit, an inverse transform unit, an adder, an in-loop filter unit and / or a memory, some of the above components may not necessarily be included, some or all of which may be optionally included depending on the implementation, and additional components not shown may be included. The video encoding device and the video decoding device may each be separate devices, but depending on the implementation, they may be combined into a single video encoding / decoding device. In that case, some components of the video encoding device may be implemented to include at least the same structure or perform at least the same function as some components of the video decoding device, as they are substantially identical technical elements. Therefore, in the detailed description of the technical elements and their operating principles below, redundant descriptions of corresponding technical elements will be omitted. Since the video decoding device corresponds to a computing device that applies the video encoding method performed by the video encoding device to decoding, the following description will focus on the video encoding device. The video encoding device may be referred to as an encoder, and the video decoding device as a decoder. The prediction unit may include an intra prediction unit that performs intra prediction and an inter prediction unit that performs inter prediction. Intra prediction may determine an intra prediction mode by configuring pixels of adjacent blocks of the current block as reference pixels and may generate a prediction block using said intra prediction mode, and inter prediction may determine motion information of the current block using one or more reference images and generate a prediction block by performing motion compensation using said motion information. It may be determined which method, intra prediction or inter prediction, to use for the current block (encoding unit or prediction unit), and specific information according to each prediction method (e.g., intra prediction mode, motion vector, reference image, etc.) may be determined. At this time, the processing unit in which the prediction is performed and the processing unit in which the prediction method and specific details are determined may be determined according to the encoding / decoding settings. For example, the prediction method, prediction mode, etc. are determined as a prediction unit (or encoding unit), and the prediction is performed as a prediction block unit (or encoding unit, conversion unit). The subtraction unit generates a residual block by subtracting the prediction block from the current block. In other words, the subtraction unit calculates the difference between the pixel value of each pixel in the current block to be encoded and the predicted pixel value of each pixel in the prediction block generated by the prediction unit, thereby creating a residual block, which is a residual signal in the form of a block. The converter can convert a signal belonging to the spatial domain into a signal belonging to the frequency domain, and the signal obtained through this conversion process is called the transformed coefficient. For example, a residual block containing a residual signal received from the subtraction unit can be converted to obtain a transformed block containing the transformed coefficient; the input signal is determined according to the encoding settings and is not limited to the residual signal. The transformation unit can transform the residual block using transformation techniques such as the Hadamard Transform, Discrete Sine Transform (DST Based-Transform), and Discrete Cosine Transform (DCT Based-Transform), but is not limited to these and various transformation techniques that are improved or modified thereof may be used. The transformation can be performed in the horizontal / vertical direction. For example, pixel values in the spatial domain can be transformed into the frequency domain by performing a one-dimensional transformation in the horizontal direction and a one-dimensional transformation in the vertical direction using basis vectors in the transformation, thereby performing a total of two-dimensional transformations. In addition, the conversion unit can transmit information necessary to generate a conversion block to the encoding unit to encode it, and the corresponding information can be stored in a bitstream and transmitted to the decoder, and the decoder of the decoder can parse the information and use it in the inverse conversion process. The quantization unit can quantize the input signal, and the signal obtained through this quantization process is called the quantized coefficient. For example, a residual block containing residual transform coefficients received from the conversion unit can be quantized to obtain a quantized block containing quantized coefficients; the input signal is determined by the encoding settings and is not limited to the residual transform coefficients. The quantization unit can quantize the transformed residual block using quantization techniques such as Dead Zone Uniform Threshold Quantization and Quantization Weighted Matrix, but is not limited to these and various quantization techniques that improve and modify them may be used. The quantization unit can transmit information necessary to generate a quantization block to the encoding unit to encode it, and the corresponding information can be stored in a bitstream and transmitted to the decoder, and the decoder of the decoder can parse the information and use it in the inverse quantization process. Although the above example was described under the assumption that the residual block is transformed and quantized through the transformation and quantization units, it is possible to generate a residual block with transformation coefficients by transforming the residual signal of the residual block and not perform the quantization process; furthermore, it is possible to perform only the quantization process without transforming the residual signal of the residual block into transformation coefficients, or to perform neither the transformation nor the quantization process. This can be determined by the encoder settings. The encoding unit can scan the quantization coefficients, transform coefficients, or residual signals of the generated residual block according to at least one scan order (e.g., zig-zag scan, vertical scan, horizontal scan, etc.) to generate a sequence of quantization coefficients, a sequence of transform coefficients, or a sequence of signals, and can encode them using at least one entropy coding technique. At this time, information regarding the scan order may be determined according to the encoding settings (e.g., encoding mode, prediction mode, etc.), and may be implicitly determined or explicitly generated. For example, one of a plurality of scan orders may be selected according to the intra-prediction mode. At this time, the scan pattern may be set to one of various patterns such as zig-zag, diagonal, or raster. In addition, encoded data containing encoding information transmitted from each component can be generated and output as a bitstream, which can be implemented as a multiplexer (MUX). At this time, encoding can be performed using methods such as Exponential Golomb, Context Adaptive Variable Length Coding (CAVLC), and Context Adaptive Binary Arithmetic Coding (CABAC) as encoding techniques, but is not limited to these and various encoding techniques that are improved and modified thereof may be used. When performing entropy encoding (assumed to be CABAC in this example) on the above residual block data and syntax elements such as information generated during the encoding / decoding process, the entropy encoding device may include a binarizer, a context modeler, and a binary arithmetic coder. In this case, the binary arithmetic coder may include a regular coding engine and a bypass coding engine. In this case, the regular coding engine may be a process performed in relation to the context modeler, and the bypass coding engine may be a process performed independently of the context modeler. Since the syntax elements input to the above entropy encoding device may not be binary values, if the syntax elements are not binary values, the binarization unit can binarize the syntax elements and output a bin string composed of 0s or 1s. At this time, a bin represents a bit composed of 0s or 1s and can be encoded through a binary arithmetic encoding unit. At this time, either a regular coding unit or a bypass coding unit may be selected based on the probability of occurrence of 0s and 1s, and this may be determined according to the encoding / decoding settings. If the syntax elements are data where the frequency of 0s and 1s is the same, the bypass coding unit may be used; otherwise, the regular coding unit may be used and can be referenced when performing the next regular coding unit through context modeling (or context information update). In this case, context is information regarding the probability of occurrence of a bin, and context modeling is a process of estimating the probability of a bin required for binary arithmetic coding by taking the bin resulting from binarization as input. For probability estimation, information on the syntactic elements of the bin, an index which is the position of the bin in the bin string, and the probability of the bin included in the surrounding blocks may be used, and at least one context table may be used for this purpose. For example, for information regarding some flags, multiple context tables may be used depending on the combination of whether the surrounding blocks use flags. Various methods may be used when performing binarization on the above-mentioned syntactic elements. For example, it can be classified into fixed-length binarization and variable-length binarization; in the case of variable-length binarization, unary binarization (Trunacted Unary Binarization), truncated rice binarization, K-th Exp-Golomb binarization, truncated binary binarization, etc., may be used. Additionally, signed or unsigned binarization may be performed depending on the range of values of the syntactic elements. The binarization process for syntactic elements occurring in the present invention may be performed by including not only the binarization mentioned in the above examples but also other additional binarization methods. The inverse quantization unit and the inverse transform unit can be implemented by performing the processes in the transform unit and the quantization unit in reverse. For example, the inverse quantization unit can inversely quantize the quantized transform coefficients generated in the quantization unit, and the inverse transform unit can inversely transform the inversely quantized transform coefficients to generate a restored residual block. The adder adds the prediction block and the restored residual block to restore the current block. The restored block is stored in memory and can be used as reference data (prediction unit and filter unit, etc.). The in-loop filter section may include at least one post-processing filter process, such as a deblocking filter, a Sample Adaptive Offset (SAO), and an Adaptive Loop Filter (ALF). The deblocking filter can remove block distortion occurring at the boundaries between blocks in the reconstructed image. The ALF can perform filtering based on a value obtained by comparing the reconstructed image with the input image. Specifically, filtering can be performed based on a value obtained by comparing the reconstructed image with the input image after the blocks have been filtered through the deblocking filter. Alternatively, filtering can be performed based on a value obtained by comparing the reconstructed image with the input image after the blocks have been filtered through the SAO. Memory can store restored blocks or pictures. The restored blocks or pictures stored in memory can be provided to a prediction unit that performs intra prediction or inter prediction. Specifically, a storage space in the form of a queue for the bitstream compressed in the encoder can be processed as a Coded Picture Buffer (CPB), and a space for storing the decoded image in picture units can be processed as a Decoded Picture Buffer (DPB). In the case of the CPB, decoding units are stored according to the decoding order and emulate the decoding operation within the encoder, and the compressed bitstream can be stored during the emulation process. The bitstream output from the CPB is restored through a decoding process, and the restored image is stored in the DPB, and the pictures stored in the DPB can be referenced during subsequent image encoding and decoding processes. The decoding unit can be implemented by performing the process in reverse in the encoding unit. For example, it can receive a sequence of quantization coefficients, a sequence of transformation coefficients, or a signal sequence from a bitstream and decode them, and parse decoded data containing decoding information and transmit it to each component. A block division unit may be included in an image encoding device and an image decoding device according to an embodiment of the present invention. A basic encoding unit may refer to a basic (or starting) unit for prediction, transformation, quantization, etc., during the image encoding / decoding process. In this case, the encoding unit may be composed of one luminance encoding block and two chrominance encoding blocks according to the color format (YCbCr in this example), and the size of each block may be determined according to the color format. In the example described below, the explanation will be based on a block (luminance component in this example). At this time, the explanation assumes that the block is a unit that can be obtained after each unit is determined, and assumes that similar settings can be applied to other types of blocks. The block division unit can be configured in relation to each component of the image encoding device and the decoder, and through this process, the size and shape of the block can be determined. At this time, the configured block may be defined differently depending on the component; for example, a prediction block for the prediction unit, a conversion block for the conversion unit, and a quantization block for the quantization unit may be included. This is not limited to these, and additional block units may be defined according to other components. The size and shape of the block may be defined by the width and height of the block. In the block division section, blocks can be represented as M × N, and the maximum and minimum values of each block can be obtained within a range. For example, if the shape of the block supports a square and the maximum value of the block is set to 256×256 and the minimum value to 8×8, a block of size 2m×2m (in this example, m is an integer from 3 to 8. For example, 8×8, 16×16, 32×32, 64×64, 128×128, 256×256) or a block of size 2m×2m (in this example, m is an integer from 4 to 128) or a block of size m×m (in this example, m is an integer from 8 to 256) can be obtained. Alternatively, if the block shape supports squares and rectangles and has the same range as the above example, a block of size 2m × 2n (in this example, m and n are integers from 3 to 8. Assuming the case where the width-to-height ratio is at most 2:1, for example, 8×8, 8×16, 16×8, 16×16, 16×32, 32×16, 32×32, 32×64, 64×32, 64×64, 64×128, 128×64, 128×128, 128×256, 256×128, 256×256. Depending on the decoding / encoding settings, there may be no limit on the width-to-height ratio or a maximum value of the ratio may exist) can be obtained. Alternatively, a block of size 2m × 2n (where m and n are integers from 4 to 128 in this example) can be obtained. Alternatively, a block of size m × n (where m and n are integers from 8 to 256 in this example) can be obtained. In the block splitting section, one or more blocks can be obtained from the input block. For example, the input block may be output as is or may be obtained by splitting it into two or more sub-blocks. At this time, the number of sub-blocks may be 2, 3, 4, etc., and this can be determined according to the splitting method (splitting type). The shape of the sub-blocks may be obtained based on the block before splitting (input block in this example) and may have various shapes depending on the block splitting settings. The present invention will focus on a tree-based partitioning method, but is not limited thereto. The obtainable blocks may be determined according to the encoding / decoding settings (e.g., block type, partitioning method, partitioning settings, etc.). For example, the encoding block may be a block of size 2m × 2n, the prediction block may be a block of size 2m × 2n or m × n, and the transformation block may be a block of size 2m × 2n. Based on the above settings, information such as block size and range (e.g., information related to exponents, multiples, etc.) may be generated. The above range (defined as the maximum and minimum values in this example) may be determined according to the type of block. Additionally, for some blocks, range information may be explicitly generated, while for some blocks, range information may be implicitly determined. For example, for encoding and conversion blocks, relevant information may be explicitly generated, while for prediction blocks, relevant information may be implicitly processed. In explicit cases, at least one range information may be generated. For example, in the case of an encoding block, range information may be generated for a maximum value and a minimum value. Alternatively, it may be generated based on the difference between a maximum value and a preset minimum value (e.g., 8) (e.g., generated based on the above setting, such as information on the difference value of the exponent between the maximum value and the minimum value). Additionally, information on multiple ranges for the width and height of a rectangular block may be generated. In the case of implicit, range information can be obtained based on the encoding / decoding settings (e.g., block type, partitioning method, partitioning settings, etc.). For example, in the case of a prediction block, maximum and minimum value information can be obtained from a group of candidates (M × N and m / 2 × n / 2 in this example) obtainable from the upper unit encoding block (e.g., maximum size M × N of the encoding block, minimum size m × n) with the partitioning settings of the prediction block (e.g., quad tree partitioning + partitioning depth 0). The size and shape of the initial (or starting) block of the block division section can be determined from the higher-level unit. In the case of an encoding block, the basic encoding block may be the initial block; in the case of a prediction block, the encoding block may be the initial block; and in the case of a conversion block, either the encoding block or the prediction block may be the initial block, which can be determined according to the encoding / decoding settings. For example, if the encoding mode is Intra, the prediction block may be the higher-level unit of the conversion block; if it is Inter, the prediction block may be a unit independent of the conversion block. The initial block can be divided into smaller blocks as the starting unit of the division. Once the optimal size and shape for the division of each block are determined, that block may be designated as the initial block of the lower-level unit. For example, in the former case, it may be the encoding block, and in the latter case (the lower-level unit), it may be the prediction block or the conversion block. Once the initial block of the lower-level unit is determined as in the above example, a division process can be performed to find the block of the optimal size and shape, similar to the higher-level unit. In summary, the block splitting unit can divide a basic coding unit (or maximum coding unit) into at least one coding unit (or sub-coding unit). Additionally, the coding unit can be divided into at least one prediction unit and can be divided into at least one transformation unit. The coding unit can be divided into at least one coding block, and the coding block can be divided into at least one prediction block and can be divided into at least one transformation block. The prediction unit can be divided into at least one prediction block, and the transformation unit can be divided into at least one transformation block. As shown in the example above, when a block of optimal size and shape is found through a mode determination process, mode information (e.g., segmentation information, etc.) can be generated. The mode information can be stored in a bitstream along with information generated in the component to which the block belongs (e.g., prediction-related information, transformation-related information, etc.) and transmitted to a decoder, and can be parsed at the same level unit in the decoder and used in the image decoding process. The following example will explain the division method, assuming that the initial block is square-shaped; however, the same or similar application may be possible in the case of a rectangular shape. Figure 3 is an example diagram showing a tree-based block shape. a represents an example where one 2N × 2N block is obtained without any splitting, b represents two 2N × N blocks obtained through some splitting flags (horizontal splitting of a binary tree in this example), c represents two N × 2N blocks obtained through some splitting flags (vertical splitting of a binary tree in this example), and d represents four N × N blocks obtained through some splitting flags (four-part splitting of a quad tree in this example). The form of the blocks obtained may be determined by the type of tree used for splitting. For example, when performing a Quad Tree split, the obtainable candidate blocks may be a and d. When performing a Binary Tree split, the obtainable candidate blocks may be a, b, and c. In the case of a Quad Tree, one splitting flag is supported, and if the flag is '0', a can be obtained, and if it is '1', d can be obtained. In the case of binary trees, multiple partition flags are supported; one may indicate whether to partition, and the other may indicate whether to partition horizontally or vertically. In the case of quad trees, a basic tree-based partitioning method may be used, and additionally, a tree partitioning method (binary tree in this example) may be included within the tree-based partitioning method. Multiple tree partitions can be performed if a flag allowing additional tree partitioning is implicitly or explicitly enabled. Tree-based partitioning may be a method that enables recursive partitioning. That is, a partitioned block can be set back as the initial block to perform tree-based partitioning, which can be determined by partitioning settings such as the partition range and the allowed partition depth. This may be an example of a hierarchical partitioning method. FIG. 4 is an example diagram showing various block shapes that can be obtained from the block division part of the present invention. Referring to FIG. 4, blocks a to s can be obtained depending on the division setting and division method, and additional block shapes not shown may also be possible. For example (1), asymmetric partitioning may be allowed in a tree-based partition. For example, in the case of a binary tree, blocks such as b and c may be possible, or blocks such as b to g may be possible. If the flag allowing asymmetric partitioning is explicitly or implicitly disabled according to the decoding / encoding settings, the obtainable candidate blocks may be b or c, and if the flag allowing asymmetric partitioning is enabled, the obtainable candidate blocks may be b, d, e (horizontal partitioning in this example) or c, f, g (vertical partitioning in this example). In the above example, the left-right or top-bottom length ratio of the asymmetric division is described as being 1:3 or 3:1, but it is not limited to this and may also have a group of candidates with other ratios (e.g., 1:2, 1:4, 2:3, 2:5, 3:5, etc.) depending on the encoding settings. The following shows various examples of splitting information that occur in binary tree splitting (candidates 1:1, 1:3, and 3:1 in this example). For example, in addition to flags indicating whether to partition and flags indicating the direction of partitioning, a flag indicating the partition type may occur. In this case, the partition type may refer to symmetric or asymmetric partitioning. If asymmetric partitioning is determined as the partition type, a flag indicating the partition ratio may occur, and an index may be assigned according to a pre-configured set of candidates. If a partition ratio of 1:3 or 3:1 is supported as a candidate set, the partition ratio can be selected via a 1-bit flag. Alternatively, in addition to the flag indicating whether to divide and the flag indicating the direction of division, a flag indicating the division ratio may occur. In this example, the candidate group for the division ratio may be configured to include candidates having a symmetrical ratio of 1:1. In this invention, it is assumed that the binary tree partitioning has a configuration similar to the former example (when a flag allowing asymmetric partitioning is activated), and unless otherwise specified, the binary tree refers to a symmetric binary tree. For example (2), additional tree divisions may be allowed in the tree-based division. For example, divisions such as a ternary tree, a quad-type tree, or an octa tree may be possible, thereby obtaining n division blocks (3, 4, 8 in this example, where n is an integer). In the case of a ternary tree, the supported blocks (in the case of division into multiple blocks in this example) may be h to m, in the case of a quad-type tree, the supported blocks may be n to p, and in the case of an octa tree, the supported blocks may be q. Whether the tree-based division is supported may be implicitly determined by the decoding / encoding settings or may be explicitly generated with relevant information. Additionally, depending on the decoding / encoding settings, it may be used alone or in combination with binary tree, quad tree division, etc. For example, in the case of a binary tree, blocks such as b and c may be possible, and when binary trees and terminal trees are mixed (assuming in this example that the usage scope of the binary tree and the terminal tree partially overlap), blocks such as b, c, i, and l may be possible. If a flag allowing additional splitting other than the existing tree is explicitly or implicitly disabled depending on the decryption / encryption settings, the obtainable candidate blocks may be b or c; if enabled, the obtainable candidate blocks may be b, i or b, h, i, j (horizontal splitting in this example) or c, l or c, k, l, m (vertical splitting in this example). In the above example, the length ratio of left:middle:right or top:middle:bottom of the territorial tree division is described assuming a case where it is 2:1:1 or 1:2:1 or 1:1:2, but it is not limited to this and other ratios may also be possible depending on the encoding settings. The following shows an example of splitting information that occurs in a ternary tree split (a candidate that is 1:2:1 in this example). For example, in addition to flags indicating whether to split and flags indicating the direction of splitting, a flag indicating the type of split may occur. In this case, the split type may refer to binary tree or binary tree splitting. In the present invention, adaptive encoding / decoding settings can be applied according to the partitioning method. For example, the partitioning method can be determined based on the type of block. For instance, the encoding block and the transform block may use quadtree partitioning, while the prediction block may use quadtree and binary tree (or binary tree, etc.) partitioning methods. For example, the partitioning method may be determined based on the block size. For instance, quad tree partitioning may be possible for a portion of the range between the maximum and minimum values of the block (e.g., a×b to c×d, where the latter is larger), and binary tree (or binary tree, etc.) partitioning may be possible for a portion of the range (e.g., e×f to g×h). In this case, range information based on the partitioning method may be explicitly generated or implicitly determined, and the aforementioned ranges may also overlap. For example, the partitioning method may be determined based on the shape of the block (or the block before partitioning). For instance, if the block is square, partitioning using a quad tree and a binary tree (or terminal tree, etc.) may be possible. Alternatively, if the block is rectangular, partitioning based on a binary tree (or terminal tree, etc.) may be possible. For example, splitting settings can be determined based on the type of block. For instance, in tree-based splitting, quadtree splitting can be used for the encoding block and prediction block, and binary tree splitting can be used for the transformation block. Alternatively, the allowable splitting depth for the encoding block can be set to m, for the prediction block to n, and for the transformation block to o, where m, n, and o may or may not be the same. For example, partitioning settings may be determined based on the size of the block. For instance, quad tree partitioning may be possible for a portion of the block range (e.g., a×b to c×d), binary tree partitioning for a portion of the block range (e.g., e×f to g×h; assuming c×d is greater than g×h in this example), and binary tree partitioning for a portion of the block range (e.g., i×j to k×l; assuming g×h is greater than or equal to k×l in this example). In this case, the said range may include all ranges between the maximum and minimum values of the block, and said ranges may have non-overlapping settings or overlapping settings. For instance, the minimum value of a portion of the range may be equal to the maximum value of a portion of the range, or the minimum value of a portion of the range may be smaller than the maximum value of a portion of the range. If there are overlapping ranges, the partitioning method with the higher maximum value may have priority, or information regarding which partitioning method to use may be explicitly provided. That is, in a partitioning method with priority, whether to perform a partitioning method with lower priority can be determined based on the partitioning result, or which partitioning method to use can be determined based on the partitioning method selection information. For example, the partitioning settings can be determined based on the shape of the block. For instance, if the block is square, quad tree partitioning may be possible. Alternatively, if the block is rectangular, binary tree or binary tree partitioning may be possible. For example, splitting settings may be determined based on encoding / decoding information (e.g., slice type, color component, encoding mode, etc.). For instance, if the slice type is I, quad tree (or binary tree, terminal tree) splitting may be possible within a specific range (e.g., a×b ~ c×d); if it is P, within a specific range (e.g., e×f ~ g×h); and if it is B, within a specific range (e.g., i×j ~ k×l). Additionally, the allowable splitting depth for quad tree (or binary tree, terminal tree) splitting can be set to m if the slice type is I, n if it is P, and o if it is B, where m, n, and o may or may not be the same. Some slice types may have the same settings as other slices (e.g., slices P and B). As another example, the allowable depth of the quad tree (or binary tree, terary tree) partition can be set to m when the color component is a luminance component and to n when it is a chrominance component, and m and n may or may not be the same. Additionally, the range of the quad tree (or binary tree, terary tree) partition when the color component is a luminance component (e.g., a×b ~ c×d) and the range of the quad tree (or binary tree, terary tree) partition when the color component is a chrominance component (e.g., e×f ~ g×h) may or may not be the same. As another example, when the encoding mode is Intra, the allowable depth for quad tree (or binary tree, terary tree) partitioning may be m, and when it is Inter, it may be n (assuming n is greater than m in this example), and m and n may or may not be the same. Additionally, the range of quad tree (or binary tree, terary tree) partitioning when the encoding mode is Intra and the range of quad tree (or binary tree, terary tree) partitioning when the encoding mode is Inter may or may not be the same. In the above example, information regarding whether to support adaptive partitioning candidate group configuration based on encoding / decoding information may be explicitly generated or implicitly determined. The above example explains cases where the partitioning method and partitioning settings are determined according to the encoding / decoding settings. The above example represents some cases based on each element, and variations to other cases may also be possible. Furthermore, the partitioning method and partitioning settings may be determined by a combination of multiple elements. For example, the partitioning method and partitioning settings may be determined by the block type, size, shape, encoding / decoding information, etc. In addition, the elements involved in the partitioning method, settings, etc. in the above example may be implicitly determined or explicitly generate information to determine whether adaptive cases such as the above example are permitted. Among the above partition settings, the partition depth refers to the number of times the initial block is spatially partitioned (in this example, the partition depth of the initial block is 0), and as the partition depth increases, it can be partitioned into smaller blocks. The depth-related settings can be varied depending on the partitioning method. For example, among the methods of performing tree-based partitioning, the partition depth of a binary tree and the partition depth of a binary tree can use a single common depth, while the partition depth of a quad tree and the partition depth of a binary tree can use different depths, and individual depths can be used depending on the type of tree. In the above example, if individual split depths are used depending on the type of tree, the split depth can be set to 0 at the starting position of the tree's split (the block before the split in this example). The split depth can be calculated based on the starting position of the split, rather than based on the split range of each tree (the maximum value in this example). FIG. 5 illustrates a block division process according to an embodiment of the present invention. Specifically, it shows examples of the size and shape of blocks obtainable according to one or more division methods, starting with a basic encoding block. In the figure, the thick solid line represents the basic encoding block, the thick dotted line represents the quad tree partition boundary, the double solid line represents the symmetric binary tree partition boundary, the solid line represents the binary tree partition boundary, and the thin dotted line represents the asymmetric binary tree partition boundary. Except for the thick solid line, the boundaries are defined according to each partitioning method. The partitioning settings described below (e.g., partitioning type, partitioning information, order of partitioning information configuration, etc.) are not limited to the specific example and various variations may be possible. For the sake of convenience of explanation, the explanation assumes a case where individual block partitioning settings are applied to the upper-left, upper-right, lower-left, and lower-right blocks (N x N, 64 x 64) based on the basic encoding block (2N x 2N, 128 x 128). First, it is assumed that four sub-blocks are acquired due to a single partitioning operation (partition depth 0 -> 1, i.e., partition depth increased by 1) in the initial block, and that the partitioning settings regarding the quad tree are such that the maximum encoding block is 128 x 128, the minimum encoding block is 8 x 8, and the maximum partition depth is 4, and that these are settings commonly applied to each block. (No. 1. Top-left Block. A1 ~ A6) This example is a case where a single tree method of partitioning (a quad tree in this example) is supported, and the size and shape of the obtainable block can be determined through a single block partitioning setting such as a maximum code block, a minimum code block, and a partition depth. In this example, when there is only one obtainable block depending on the partitioning (divided horizontally and vertically into 2 each), the partitioning information required for a single partitioning operation (based on a block of 4M x 4N before partitioning, with the partition depth increased by 1) is a flag indicating whether to partition (in this example, 0 means no partitioning, 1 means partitioning), and the obtainable candidates may be 4M x 4N and 2M x 2N. (No. 2. Upper Right Block. A7 ~ A11) This example is a case where multi-tree partitioning (quad tree, binary tree in this example) is supported, and the size and shape of the obtainable blocks can be determined through multiple block partitioning settings. In this example, for the binary tree, it is assumed that the maximum encoding block is 64 x 64, the minimum encoding block has a side length of 4, and the maximum partition depth is 4. In this example, when there are two or more blocks obtainable by partitioning (two or four in this example), the partitioning information required for one partitioning operation (increasing the quad tree partitioning depth by 1) is a flag indicating whether to partition, a flag indicating the type of partition, a flag indicating the partition shape, and a flag indicating the direction of partitioning, and the obtainable candidates may be 4M x 4N, 4M x 2N, 2M x 4N, 4M x N / 4M x 3N, 4M x 3N / 4M x N, M x 4N / 3M x 4N, and 3M x 4N / M x 4N. If the quad tree and binary tree splitting ranges overlap (i.e., a range where both quad tree splitting and binary tree splitting are possible at the current stage) and the current block (a state before splitting) is a block obtained by quad tree splitting (a block obtained by quad tree splitting from a parent block <where the splitting depth is 1 less than the current one>), the splitting information can be configured by classifying it into the following cases. That is, if a block supported according to each splitting setting can be obtained by multiple splitting methods, splitting information can be generated by classifying it through the following process. (1) Case where quad tree splitting and binary tree splitting overlap [Table 1] In the table above, 'a' represents a flag indicating whether to split a quad tree, and if it is 1, a quad tree split (QT) is performed. If the above flag is 0, check 'b', a flag indicating whether to split a binary tree. If 'b' is 0, no further splitting is performed in the block (No Split), and if it is 1, a binary tree split is performed. c is a flag indicating the partitioning direction; 0 means horizontal partitioning (hor) and 1 means vertical partitioning (ver). d is a flag indicating the partitioning type; 0 means symmetric partitioning (SBT, Symmetric Binary Tree) and 1 means asymmetric partitioning (ABT, Asymmetric Binary Tree). Information regarding the detailed partitioning ratio (1 / 4 or 3 / 4) in asymmetric partitioning is checked only when d is 1. When d is 0, the left and top blocks have a 1 / 4 ratio and the right and bottom blocks have a 3 / 4 ratio in the left / right or top / bottom blocks, and when d is 1, the opposite ratios are used. (2) Cases where only binary tree splitting is possible In the table above, partition information can be expressed using flags b through e, excluding a. In the case of block A7 in Fig. 5, since quad tree splitting was possible in the blocks before splitting (A7 to A11) (i.e., quad tree splitting was possible but binary tree splitting was performed instead of quad tree splitting), it corresponds to the case where splitting information in (1) is generated. On the other hand, in the case of A8 to A11, if binary tree splitting has already been performed in the blocks prior to splitting (A8 ~ A11) without quad tree splitting being performed (i.e., no longer the corresponding blocks<A8 ~ A11> In this case, it corresponds to the case where quad tree splitting is impossible) and the splitting information in (2) is generated. (No. 3. Bottom-left block. A12 ~ A15) This example is a case where multi-tree partitioning (quad tree, binary tree, and terminal tree in this example) is supported, and the size and shape of the obtainable block can be determined through multiple block partitioning settings. In this example, for binary tree / terminal, it is assumed that the maximum encoding block is 64 x 64, the minimum encoding block has a side length of 4, and the maximum partition depth is 4. In this example, when there are two or more blocks obtainable by division (2, 3, or 4 in this example), the division information required for a single division operation is a flag indicating whether to divide, a flag indicating the type of division, and a flag indicating the direction of division, and the obtainable candidates may be 4M x 4N, 4M x 2N, 2M x 4N, 4M x N / 4M x 2N / 4M x N, M x 4N / 2M x 4N / M x 4N. If the quad tree and binary tree / binary tree partitioning ranges overlap and the current block is a block obtained by quad tree partitioning, the partitioning information can be configured by classifying it into the following cases. (1) Case where quad tree splitting and binary tree / binary tree splitting overlap [Table 2] In the table above, a is a flag indicating whether to split a quad tree, and if it is 1, a quad tree split is performed. If the above flag is 0, check b, a flag indicating whether to split a binary tree or a tertiary tree. If b is 0, no further splitting is performed in the block, and if it is 1, a binary tree or tertiary tree split is performed. c is a flag indicating the direction of splitting, where 0 means horizontal splitting and 1 means vertical splitting, and d is a flag indicating the type of splitting, where 0 means binary tree splitting (BT) and 1 means binary tree splitting (TT). (2) Cases where only binary tree / binary tree splitting is possible In the table above, the split information can be expressed using flags b through d, excluding a. In Fig. 5, for blocks A12 and A15, since quad tree partitioning was possible in the blocks before partitioning (A12 ~ A15), it corresponds to the case where partitioning information in (1) is generated. On the other hand, A13 and A14 correspond to cases where the splitting information in (2) is generated because the splitting was not performed into a quad tree in the blocks (A13, A14) before splitting but into a ternary tree. (No. 4. Bottom-left block. A16 ~ A20) This example is a case where multi-tree partitioning (quad tree, binary tree, and terminal tree in this example) is supported, and the size and shape of the obtainable block can be determined through multiple block partitioning settings. In this example, for binary tree / terminal tree, it is assumed that the maximum encoding block is 64 x 64, the minimum encoding block has a side length of 4, and the maximum partition depth is 4. In this example, when there are two or more blocks obtainable by division (2, 3, or 4 in this example), the division information required for a single division operation is a flag indicating whether to divide, a flag indicating the type of division, a flag indicating the shape of the division, and a flag indicating the direction of the division, and the obtainable candidates may be 4M x 4N, 4M x 2N, 2M x 4N, 4M x N / 4M x 3N, 4M x 3N / 4M x N, M x 4N / 3M x 4N, 3M x 4N / M x 4N, 4M x N / 4M x 2N / 4M x N, M x 4N / 2M x 4N / M x 4N. If the quad tree and binary tree / binary tree partitioning ranges overlap and the current block is a block obtained by quad tree partitioning, the partitioning information can be configured by classifying it into the following cases. (1) Case where quad tree splitting and binary tree / binary splitting overlap [Table 3] In the table above, 'a' represents a flag indicating whether to split a quad tree, and if it is 1, a quad tree split is performed. If the above flag is 0, check 'b', which is a flag indicating whether to split a binary tree. If 'b' is 0, no further splitting is performed in the block, and if it is 1, a binary tree or binary tree split is performed. c is a flag indicating the direction of partitioning, meaning horizontal partitioning if 0 and vertical partitioning if 1. d is a flag indicating the type of partitioning, meaning binary partitioning if 0 and binary tree partitioning if 1. When d is 1, the flag e for the partition type is checked; if e is 0, symmetric partitioning is performed, and if e is 1, asymmetric partitioning is performed. When e is 1, information regarding the detailed partition ratios in asymmetric partitioning is checked, which is the same as in the previous example. (2) Cases where only binary tree / binary tree splitting is possible In the table above, partition information can be expressed using flags b through f, excluding a. In Fig. 5, block A20 corresponds to the case where quad tree partitioning is possible in blocks (A16 to A19) before partitioning, so it corresponds to the case where partitioning information in (1) is generated. On the other hand, in the case of A16 to A19, the quad tree splitting was not performed in the blocks before splitting (A16 to A19) and the binary tree splitting was performed, so it corresponds to the case where the splitting information in (2) is generated. Below, we will examine an inter prediction method based on merge mode. In merge mode, motion information can be derived in units of a single block. Here, a block may refer to a coding block determined through the aforementioned block division. Additionally, a block may refer to a coding block of a leaf node that cannot be further divided into smaller coding blocks. In the merge mode, motion information can be derived in units of sub-blocks belonging to a single block. To this end, a single block may be further divided into multiple sub-blocks. For example, affine motion modeling may be performed based on the merge mode at the sub-block level. The current block may selectively utilize either a block-unit merge mode or a sub-block-unit merge mode, and a specific flag may be used for this purpose. Here, the flag may be information indicating whether the sub-block-unit merge mode is applied. The above flag may be encoded and signaled in an encoding device based on predetermined encoding parameters, or derived in a decoder. The above encoding parameters may refer to block size / shape, component type, partition type, partition depth, etc. For example, if the size of the current block is greater than or equal to NxM, the above flag may be signaled, and otherwise, the above flag may be derived to a pre-defined value. Here, N and M may be integers of 8, 16, or greater. N and M may be the same or different. Block-unit merge mode will be examined with reference to FIG. 6, and sub-block-unit merge mode will be examined with reference to FIG. 7 through 10, respectively. FIG. 6 illustrates a method for performing inter-prediction based on a block-unit merge mode as an embodiment to which the present invention is applied. Referring to FIG. 6, a list of merge candidates for the current block can be constructed (S600). The merge candidate list may include at least one of the spatial merge candidate or temporal merge candidate of the current block. Motion information of a spatial merge candidate can be derived from motion information of a spatial neighbor block of the current block. Here, a spatial neighbor block refers to a block adjacent to the current block that belongs to the same picture as the current block. A spatial neighbor block may include a block adjacent to at least one of the left, top, top-right, bottom-left, or top-left of the current block. A top-left neighbor block may be used only when at least one of the blocks adjacent to the left, top, top-right, and bottom-left is not available. Motion information of a temporal merge candidate can be derived from motion information of a temporal neighbor block of the current block. A temporal neighbor block is a block belonging to a different picture from the current block and can be defined as a block at the same location as the current block. Here, a block at the same location may mean at least one of a block adjacent to the bottom-right corner of the current block (BR), a block containing the location of the center sample of the current block (CTR), or a block containing the location of the top-left sample of the current block (TL). Alternatively, a block at the same location may mean a block containing a location shifted by a predetermined disparity vector from the location of the top-left sample of the current block. Here, the disparity vector may be determined based on any one of the motion vectors of the aforementioned spatial neighbor blocks. Alternatively, the disparity vector may be determined based on a combination of at least two of the motion vectors of the aforementioned spatial neighbor blocks. The combination may refer to operations such as maximum value, minimum value, median value, or weighted average value. For example, the above variation vector may be set to the motion vector of the left neighbor block or the top neighbor block. Alternatively, the variation vector may be set to the median or average value between the motion vector of the left neighbor block and the motion vector of the bottom-left neighbor block. The motion vector and reference picture index of the temporal merge candidate can be derived from the motion vector and reference picture index of the aforementioned temporal neighbor block, respectively. Alternatively, the motion vector of the temporal merge candidate can be derived from the motion vector of the temporal neighbor block, and the reference picture index of the temporal merge candidate can be set to a default value (e.g., 0) pre-agreed to the decoder regardless of the temporal neighbor block. The merge candidate list may further include composite merge candidates. A composite merge candidate can be derived by combining n merge candidates belonging to the pre-generated merge candidate list. Here, n may be an integer of 2, 3, 4, or more. The number of merge candidates (n) to be combined may be a fixed value pre-agreed upon in the encoding / decoding device, or it may be encoded and signaled by the encoding device. The signaling may be performed in at least one unit among a sequence, picture, slice, tile, sub-tile (brick), or a predetermined block. The number of merge candidates (n) to be combined may be variably determined based on the number of remaining merge candidates. Here, the number of remaining merge candidates may refer to the difference between the maximum number of merge candidates that can be included in the merge candidate list and the current number of merge candidates belonging to the merge candidate list. The maximum number may be a pre-agreed number in the encoding / decoding device, or it may be encoded and signaled by the encoding device. The current number may refer to the number of merge candidates configured before adding the combined merge candidates. For example, if the number of remaining merge candidates is 1, 2 merge candidates are used, and if the number of remaining merge candidates is greater than 1, 3 or more merge candidates may be used. The positions of the above n merge candidates may be pre-determined positions in the merge candidate list. For example, an index (0 to (k-1)) may be assigned to each merge candidate belonging to the merge candidate list. Here, k may represent the total number of merge candidates belonging to the merge candidate list. In this case, the positions of the n merge candidates may correspond to indices 0 to (n-1) in the merge candidate list. Alternatively, the above n merge candidates may be determined by considering the prediction direction of each merge candidate belonging to the merge candidate list. For example, among the merge candidates belonging to the merge candidate list, only merge candidates with bidirectional prediction may be selectively used, or only merge candidates with unidirectional prediction may be selectively used. Combination merge candidates may be derived using both spatial and temporal merge candidates, or by using only one of them. For example, combination merge candidates may be restricted to being derived using only spatial merge candidates. In this case, the number of merge candidates to be combined may be limited to the number of spatial merge candidates in the pre-generated merge candidate list. The aforementioned composite merge candidate may be added to the merge candidate list after the spatial / temporal merge candidate. That is, the index of the composite merge candidate may be greater than the index of the spatial / temporal merge candidate. Alternatively, the composite merge candidate may be added between the spatial merge candidate and the temporal merge candidate in the merge candidate list. That is, the index of the composite merge candidate may be greater than the index of the spatial merge candidate and smaller than the index of the temporal merge candidate. Alternatively, the position of the composite merge candidate may be determined variably by considering the prediction direction of the composite merge candidate. Depending on whether the prediction direction of the composite merge candidate is bidirectional prediction, the position of the composite merge candidate within the merge candidate list may be rearranged. For example, if the composite merge candidate is bidirectional prediction, an index smaller than that of the spatial or temporal merge candidate may be assigned, and otherwise, an index larger than that of the spatial or temporal merge candidate may be assigned. Below, for the sake of convenience of explanation, we will look at a method for deriving a combined merge candidate based on two merge candidates. Motion information of a combined merge candidate can be derived by weighted averaging the motion information of a first merge candidate and a second merge candidate. Here, the weights of the weighted average may be [1:1], [1:2], [1:3], [2:3], etc., but are not limited thereto. The above weights may be pre-defined in the encoding / decoding device or may be derived by the decoding device. In this case, the weights may be derived by considering at least one of the distance between the current picture and the reference picture of the merge candidate or the predicted direction of the merge candidate. Alternatively, the motion information of the combined merge candidate may be derived by obtaining motion information in the L0 direction from the first merge candidate and motion information in the L1 direction from the second merge candidate, respectively, and combining them. Motion information of a combined merge candidate may be derived based on at least one of the aforementioned derivation methods, and this may be performed by considering the predicted direction of the merge candidate to be combined, as described below. In this specification, motion information may include at least one of a prediction direction flag, a reference picture index, or a motion vector. The motion information may be defined for L0 prediction and L1 prediction, respectively. Here, L0 prediction refers to a prediction that references reference picture list L0, and L1 prediction refers to a prediction that references reference picture list L1. 1. When both the first and second merge candidates are unidirectional predictions (CASE 1) If the first merge candidate is L0 prediction and the second merge candidate is L1 prediction, the reference picture index in the L0 direction of the combined merge candidate can be derived to the reference picture index of the first merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate can be derived to 1. The motion vector in the L0 direction of the combined merge candidate can be derived to the motion vector of the first merge candidate. The reference picture index in the L1 direction of the combined merge candidate can be derived to the reference picture index of the second merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate can be derived to 1. The motion vector in the L1 direction of the combined merge candidate can be derived to the motion vector of the second merge candidate. (CASE 2) If the first merge candidate is L1 prediction and the second merge candidate is L0 prediction, the reference picture index in the L0 direction of the combined merge candidate can be derived to the reference picture index of the second merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate can be derived to 1. The motion vector in the L0 direction of the combined merge candidate can be derived to the motion vector of the second merge candidate. The reference picture index in the L1 direction of the combined merge candidate can be derived to the reference picture index of the first merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate can be derived to 1. The motion vector in the L1 direction of the combined merge candidate can be derived to the motion vector of the first merge candidate. (CASE 3) When the first merge candidate and the second merge candidate are L0 predictions, the reference picture index in the L0 direction of the combined merge candidate may be derived from the reference picture index of either the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index among the first merge candidate and the second merge candidate may be set as the reference picture index in the L0 direction of the combined merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate may be derived to 1. The motion vector in the L0 direction of the combined merge candidate may be derived from the weighted average of the motion vector of the first merge candidate and the second merge candidate. The reference picture index in the L1 direction of the combined merge candidate may be derived to -1, the prediction direction flag in the L1 direction may be derived to 0, and the motion information in the L1 direction may be derived to 0. (CASE 4) When the first merge candidate and the second merge candidate are L1 predictions, the reference picture index in the L0 direction of the combined merge candidate may be derived to -1, the prediction direction flag in the L0 direction may be derived to 0, and the motion information in the L0 direction may be derived to 0. The reference picture index in the L1 direction of the combined merge candidate may be derived to the reference picture index of either the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index among the first merge candidate and the second merge candidate may be set as the reference picture index in the L1 direction of the combined merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate may be derived to 1. The motion vector in the L1 direction of the combined merge candidate may be derived as the weighted average of the motion vector of the first merge candidate and the second merge candidate. 2. When both the first and second merge candidates are bidirectional predictions (CASE 5) The reference picture index in the L0 direction of the combined merge candidate may be derived from the reference picture index of either the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index among the first merge candidate and the second merge candidate may be set as the reference picture index in the L0 direction of the combined merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate may be derived to 1. The motion vector in the L0 direction of the combined merge candidate may be derived from the motion vector of the first merge candidate and the weighted average of the second merge candidate. The reference picture index in the L1 direction of the combined merge candidate may be derived from the reference picture index of either the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index among the first merge candidate and the second merge candidate may be set as the reference picture index in the L1 direction of the combined merge candidate. The prediction direction flag for the L1 direction of the combined merge candidate can be derived as 1. The motion vector for the L1 direction of the combined merge candidate can be derived as the weighted average of the motion vector of the first merge candidate and the second merge candidate. 3. When the first merge candidate is a bidirectional prediction and the second merge candidate is a unidirectional prediction (CASE 6) If the second merge candidate is an L0 prediction, the reference picture index in the L0 direction of the combined merge candidate may be derived from the reference picture index of either the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index among the first merge candidate and the second merge candidate may be set as the reference picture index in the L0 direction of the combined merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate may be derived to 1. The motion vector in the L0 direction of the combined merge candidate may be derived from the weighted average of the motion vector of the first merge candidate and the second merge candidate. The reference picture index in the L1 direction of the combined merge candidate may be derived from the reference picture index of the first merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate may be derived to 1. The motion vector in the L1 direction of the combined merge candidate may be derived from the motion vector of the first merge candidate. (CASE 7) If the second merge candidate is an L1 prediction, the reference picture index in the L0 direction of the combined merge candidate can be derived from the reference picture index of the first merge candidate. The prediction direction flag in the L0 direction of the combined merge candidate can be derived to 1. The motion vector in the L0 direction of the combined merge candidate can be derived from the motion vector of the first merge candidate. The reference picture index in the L1 direction of the combined merge candidate can be derived from the reference picture index of either the first merge candidate or the second merge candidate. For example, the reference picture index of the merge candidate with the smallest index among the first merge candidate and the second merge candidate can be set as the reference picture index in the L1 direction of the combined merge candidate. The prediction direction flag in the L1 direction of the combined merge candidate can be derived to 1. The motion vector in the L1 direction of the combined merge candidate can be derived from the weighted average of the motion vector of the first merge candidate and the second merge candidate. Referring to FIG. 6, motion information of the current block can be derived from the merge candidate list (S610). Specifically, the merge index of the current block can be signaled. The merge index can identify one of multiple merge candidates belonging to the merge candidate list. That is, a merge candidate with the same index as the merge index is extracted, and the motion information of the current block can be derived using the motion information of the extracted merge candidate. Referring to FIG. 6, the inter prediction of the current block can be performed using the induced motion information (S620). Specifically, a reference picture can be selected from a list of reference pictures based on the reference picture index of the current block. A reference block within the reference picture can be identified based on the motion vector of the current block. A predicted pixel of the current block can be generated using the reconstructed pixel of the identified reference block. The current block can be reconstructed by adding the predicted pixel of the current block and the residual pixel. Here, the residual pixel can be derived by performing at least one of inverse quantization or inverse transform on the residual coefficient signaled through the bitstream. FIG. 7 illustrates an affine model-based inter prediction method as an embodiment to which the present invention is applied. Referring to FIG. 7, a candidate list for predicting motion information of the current block can be generated (S700). The above candidate list may include one or more affine model-based candidates (hereinafter referred to as affine candidates). An affine candidate may refer to a candidate having a control point vector. A control point vector refers to a motion vector of a control point for an affine model and may be defined for a corner position of a block (e.g., at least one position among the top-left, top-right, bottom-left, or bottom-right corners). An affine candidate may include at least one of a spatial candidate, a temporal candidate, or a constructed candidate. Here, the spatial candidate may be derived from a vector of a neighbor block spatially adjacent to the current block, and the temporal candidate may be derived from a vector of a neighbor block temporally adjacent to the current block. Here, the neighbor block may refer to a block encoded by an affine model. The vector may refer to a motion vector or a control point vector. A method for deriving spatial / temporal candidates based on the vectors of spatial / temporal neighbor blocks will be examined in detail with reference to Fig. 8. Meanwhile, the above-described candidate can be derived based on a combination of motion vectors between spatial and temporal neighbor blocks of the current block, which will be examined in detail with reference to FIG. 9. The aforementioned multiple affine candidates may be arranged in the candidate list based on a predetermined priority. For example, the multiple affine candidates may be arranged in the candidate list in the order of spatial candidates, temporal candidates, and constructed candidates. Alternatively, the multiple affine candidates may be arranged in the candidate list in the order of temporal candidates, spatial candidates, and constructed candidates. However, this is not limited thereto, and temporal candidates may be arranged after constructed candidates. Alternatively, some of the constructed candidates may be arranged before spatial candidates, and the remainder may be arranged after spatial candidates. The above candidate list may further include temporal candidates based on sub-blocks. The motion information of the above temporal candidates may be derived into a collocated block corresponding to the current block, and this will be examined in detail with reference to FIG. 10. Based on the above candidate list and candidate index, a control point vector of the current block can be derived (S710). A candidate index may refer to an encoded index used to derive the control point vector of the current block. The candidate index may specify any one of a plurality of affine candidates belonging to a candidate list. The control point vector of the current block can be derived using the control point vector of the affine candidate specified by the candidate index. For example, assume that the type of the affine model of the current block is 4-parameter (i.e., it is determined that the current block uses 2 control point vectors). In this case, if the affine candidate specified by the candidate index has 3 control point vectors, only 2 of the 3 control point vectors (e.g., control point vectors where Idx=0 and 1) can be selected and set as the control point vectors of the current block. Alternatively, the 3 control point vectors of the specified affine candidate can be set as the control point vectors of the current block. In this case, the type of the affine model of the current block can be updated to 6-parameter. Conversely, assume that the type of the affine model of the current block is 6-parameter (i.e., that the current block is determined to use 3 control point vectors). In this case, if the affine candidate specified by the candidate index has 2 control point vectors, one additional control point vector may be generated, and the 2 control point vectors of the affine candidate and the additional control point vector may be set as the control point vectors of the current block. The additional control point vector may be derived based on at least one of the 2 control point vectors of the affine candidate and the size or location information of the current / neighbor block. Alternatively, two control point vectors of the specified affine candidates can be set as the control point vectors of the current block. In this case, the type of the affine model of the current block can be updated to 4-parameters. Based on the control point vector of the current block, the motion vector of the current block can be derived (S720). The above motion vector can be derived in units of sub-blocks of the current block. To this end, the current block can be divided into a plurality of NxM sub-blocks. Here, the NxM sub-blocks are rectangular (N > M or N <M) 또는 정사각형(N=M)의 형태일 수 있다. 상기 N과 M 값은, 4, 8, 16, 32 또는 그 이상일 수 있다. For example, the size / shape of the sub-block may be a fixed size / shape pre-defined in the decoding device. For example, the size / shape of the sub-block may be a square such as 4x4, 8x8, 16x16, etc., or a rectangle such as 2x4, 2x8, 4x8, 4x16, etc. Alternatively, the sub-block may be defined as a block in which the sum of the width and height is an integer of 8, 12, 16, or greater. Alternatively, the sub-block may be defined as a block in which the product of the width and height is an integer of 16, 32, 64, or greater. Alternatively, the size / shape of the sub-block may be variably derived based on the attributes of the aforementioned block. For example, if the size of the current block is greater than or equal to a predetermined threshold size, the current block may be divided into units of a first sub-block (e.g., 8x8, 16x16), and if not, the current block may be divided into units of a second sub-block (e.g., 4x4). Alternatively, information regarding the size / shape of a sub-block may be encoded and signaled by an encoding device. The information indicates at least one of the size or shape of the sub-block, and this may be signaled at at least one level among a sequence, picture, tile group, tile, and CTU. The control point representing the current block may include the top-left position and the top-right position. However, it is not limited thereto, and the control point may include three points—the top-left position, the top-right position, and the bottom-left position—or may include a plurality of additional points. When two control points are used, a motion vector for each sub-block of the current block can be derived by using at least one of a first control point vector corresponding to the first control point, a second control point vector corresponding to the second control point, the position (x,y) of the sub-block, or the size (width or height) of the current block. When three control points are used, a motion vector for each sub-block of the current block can be derived by using at least one of a first control point vector corresponding to the first control point, a second control point vector corresponding to the second control point, a third control point vector corresponding to the third control point, the position (x,y) of the sub-block, or the size (width or height) of the current block. At this time, a difference vector between the second control point vector and the first control point vector can be used, and a difference vector between the third control point vector and the first control point vector can be used. The difference vector can be calculated for the horizontal direction (x-axis direction) and the vertical direction (y-axis direction), respectively. The motion vector derivation process described above may further include a process of applying a predetermined offset to the motion vector derived based on the control point vector. The offset may refer to a vector for improving the previously derived motion vector. The offset may be determined based on information regarding at least one of the magnitude or direction of the offset. The magnitude (Absolute) may be an integer of 1, 2, 3, or more. The direction may include at least one of left, right, up, or down. Information regarding the magnitude and / or direction of the offset may be encoded and signaled by an encoding device. Alternatively, the magnitude of the offset may be a fixed value pre-set in a decoder. Inter prediction for the current block can be performed using the above-derived motion vector (S730). Specifically, a reference block can be identified using the motion vector of the current block. The reference block can be identified for each sub-block of the current block. The reference block of each sub-block may belong to a single reference picture. That is, sub-blocks belonging to the current block may share a single reference picture. Alternatively, a reference picture index may be set independently for each sub-block of the current block. Meanwhile, the above-described motion vector may include at least one of an L0 motion vector or an L1 motion vector. If the motion vector includes L0 and L1 motion vectors, the decoder may perform unidirectional prediction by setting either of the L0 and L1 motion vectors to 0. The above settings may be optionally performed by considering at least one of the block size or the prediction mode. Here, the block may refer to the current block or a sub-block of the current block. The prediction mode may refer to a skip mode, a merge mode, an AMVP mode, an affine model-based prediction mode, a current picture reference mode, etc. For example, if the size of the current block (or a sub-block of the current block) is smaller than or equal to a predetermined threshold size, unidirectional prediction can be performed by setting the L1 motion vector to 0, and otherwise, bidirectional prediction can be performed using the L0 and L1 motion vectors. Here, the threshold size can be defined as a block size in which at least one of the width and height is 4, 8, or 16. Alternatively, if the current block is encoded in the first prediction mode, unidirectional prediction can be performed by setting the L1 motion vector to 0, and if not, bidirectional prediction can be performed using L0 and L1 motion vectors. The aforementioned specified reference block can be set as the prediction block of the current block. The current block can be restored by adding the residual block to the prediction block. FIG. 8 is an embodiment to which the present invention is applied, and relates to a method for deriving affine candidates from control point vectors of spatial / temporal neighbor blocks. The width and height of the current block (800) are cbW and cbH, respectively, and the location of the current block is (xCb, yCb). The width and height of the spatial neighbor blocks (810-850) are nbW and nbH, respectively, and the location of the spatial neighbor blocks is (xNb, yNb). The spatial neighbor blocks may include at least one of the left block (810), the lower-left block (840), the upper-right block (830), the upper block (820), or the upper-left block (850) of the current block. Alternatively, the spatial neighbor blocks may further include at least one of the blocks adjacent to the right or the blocks adjacent to the bottom of the upper-left block (850). Spatial candidates may have n control point vectors (cpMV). Here, the value of n may be an integer of 1, 2, 3, or more. The value of n may be determined based on at least one of information regarding whether it is decoded in sub-block units, information regarding whether it is a block encoded by an affine model, or information regarding the type of the affine model (4-parameter or 6-parameter). For example, according to the information above, if the block is decoded in sub-block units or is a block encoded by an affine model, the block may have two control point vectors. On the other hand, if it is not, the block may not perform affine model-based prediction. Alternatively, according to the information above, if the block is encoded as an affine model and the type of the affine model is 6-parameter, the block may have three control point vectors. On the other hand, if it is not, the block may not perform affine model-based prediction. The aforementioned information may be encoded and signaled by an encoding device. Alternatively, all or part of the aforementioned information may be derived by a decoder based on the attributes of the block. Here, the block may refer to the current block or to a spatial / temporal neighbor block of the current block. The attributes may refer to parameters regarding size, shape, location, partition type, inter-mode, and residual coefficients. The inter-mode is a pre-defined mode in the decoder and may refer to a merge mode, skip mode, AMVP mode, affine model, intra / inter combination mode, current picture reference mode, etc. Alternatively, the value of n may be derived by a decoder based on the attributes of the aforementioned block. In this embodiment, n control point vectors can be represented as the first control point vector (cpMV[0]), the second control point vector (cpMV[1]), the third control point vector (cpMV[2]), and the nth control point vector (cpMV[n-1]). For example, the first control point vector (cpMV[0]), the second control point vector (cpMV[1]), the third control point vector (cpMV[2]), and the fourth control point vector (cpMV[3]) may be vectors corresponding to the positions of the top-left sample, top-right sample, bottom-left sample, and bottom-right sample of the block, respectively. Here, it is assumed that the spatial candidate has three control point vectors, and the three control point vectors may be any control point vectors selected from the first to the nth control point vectors. However, it is not limited thereto, and the spatial candidate may have two control point vectors, and the two control point vectors may be any control point vectors selected from the first to the nth control point vectors. Below, we will examine the method for deriving the control point vectors of spatial candidates. 1. If the boundary of the current block does not touch the CTU boundary The first control point vector above can be derived based on at least one of the first control point vector of a spatial neighbor block, a predetermined difference value, location information of the current block (xCb, yCb) or location information of a spatial neighbor block (xNb, yNb). The number of the difference values may be one, two, three, or more. The number of difference values may be determined variably by considering the attributes of the aforementioned block, or it may be a fixed value pre-agreed upon in the decoding device. The difference values may be defined as difference values between any one of a plurality of control point vectors and another. For example, the difference values may include at least one of a first difference value between a second control point vector and a first control point vector, a second difference value between a third control point vector and a first control point vector, a third difference value between a fourth control point vector and a third control point vector, or a fourth difference value between a fourth control point vector and a second control point vector. For example, the first control point vector can be derived as shown in the following mathematical equation 1. [Mathematical Formula 1] cpMvLX
[0000]
[0000] = ( mvScaleHor + dHorX * ( xCb - xNb ) + dHorY * ( yCb - yNb ) ) cpMvLX
[0000]
[0001] = ( mvScaleVer + dVerX * ( xCb - xNb ) + dVerY * ( yCb - yNb ) ) In Equation 1, the variables mvScaleHor and mvScaleVer may represent the first control point vector of a spatially neighboring block, or they may represent a value derived by applying a shift operation of k to the first control point vector. Here, k may be an integer of 1, 2, 3, 4, 5, 6, 7, 8, 9, or greater. The variables dHorX and dVerX correspond to the x and y components, respectively, of the first difference value between the second control point vector and the first control point vector. The variables dHorY and dVerY correspond to the x and y components, respectively, of the second difference value between the third control point vector and the first control point vector. The aforementioned variables can be derived as shown in Equation 2 below. [Mathematical Formula 2] mvScaleHor = CpMvLX[xNb][yNb]
[0000]
[0000] << 7 mvScaleVer = CpMvLX[xNb][yNb]
[0000]
[0001] << 7 dHorX = ( CpMvLX [ dVerX = ( CpMvLX [ dHorY = (CpMvLX[xNb][yNb + nNbH - 1]
[0002]
[0000] - CpMvLX[xNb][yNb]
[0002]
[0000] ) << (7 - log2NbH) dVerY = ( CpMvLX[xNb][yNb + nNbH - 1]
[0002]
[0001] - CpMvLX[xNb][yNb]
[0002]
[0001] ) << (7 - log2NbH) The second control point vector can be derived based on at least one of the first control point vector of a spatial neighbor block, a predetermined difference value, location information of the current block (xCb, yCb), block size (width or height), or location information of a spatial neighbor block (xNb, yNb). Here, the block size may refer to the size of the current block and / or the spatial neighbor block. The difference value is as described in the first control point vector, so a detailed explanation is omitted here. However, the range and / or number of difference values used in the derivation process of the second control point vector may differ from that of the first control point vector. For example, the second control point vector can be derived as shown in the following mathematical equation 3. [Mathematical Formula 3] cpMvLX
[0001]
[0000] = ( mvScaleHor + dHorX * ( xCb + cbWidth - xNb ) + dHorY * ( yCb - yNb ) ) cpMvLX
[0001]
[0001] = ( mvScaleVer + dVerX * ( xCb + cbWidth - xNb ) + dVerY * ( yCb - yNb ) ) In Equation 3, the variables mvScaleHor, mvScaleVer, dHorX, dVerX, dHorY, and dVerY are as seen in Equation 1, and a detailed explanation is omitted here. The third control point vector can be derived based on at least one of the first control point vector of a spatial neighbor block, a predetermined difference value, location information of the current block (xCb, yCb), block size (width or height), or location information of a spatial neighbor block (xNb, yNb). Here, the block size may refer to the size of the current block and / or the spatial neighbor block. The difference value is as described in the first control point vector, so a detailed explanation is omitted here. However, the range and / or number of difference values used in the derivation process of the third control point vector may differ from that of the first control point vector or the second control point vector. For example, the third control point vector can be derived as shown in the following mathematical equation 4. [Mathematical Formula 4] cpMvLX
[0002]
[0000] = ( mvScaleHor + dHorX * ( xCb - xNb ) + dHorY * ( yCb + cbHeight - yNb ) ) cpMvLX
[0002]
[0001] = ( mvScaleVer + dVerX * ( xCb - xNb ) + dVerY * ( yCb + cbHeight - yNb ) ) In Equation 4, the variables mvScaleHor, mvScaleVer, dHorX, dVerX, dHorY, and dVerY are as described in Equation 1, and a detailed explanation is omitted here. Meanwhile, through the process described above, the nth control point vector of the spatial candidate can be derived. 2. When the boundary of the current block touches the CTU boundary The first control point vector above can be derived based on at least one of the motion vector (MV) of a spatial neighbor block, a predetermined difference value, the position information (xCb, yCb) of the current block, or the position information (xNb, yNb) of a spatial neighbor block. The above motion vector may be the motion vector of a sub-block located at the bottom of a spatial neighbor block. The above sub-block may be the one located at the far left, center, or far right among a plurality of sub-blocks located at the bottom of a spatial neighbor block. Alternatively, the above motion vector may refer to the average, maximum, or minimum value of the motion vector of a sub-block. The number of the difference values may be one, two, three, or more. The number of difference values may be determined variably by considering the attributes of the aforementioned block, or it may be a fixed value pre-agreed upon in the decoding device. The difference value may be defined as the difference between one of a plurality of motion vectors stored as sub-block units in a spatial neighbor block and another. For example, the difference value may refer to the difference between the motion vector of the lower-right sub-block and the motion vector of the lower-left sub-block of the spatial neighbor block. For example, the first control point vector can be derived as shown in the following mathematical equation 5. [Mathematical Formula 5] cpMvLX
[0000]
[0000] = ( mvScaleHor + dHorX * ( xCb - xNb ) + dHorY * ( yCb - yNb ) ) cpMvLX
[0000]
[0001] = ( mvScaleVer + dVerX * ( xCb - xNb ) + dVerY * ( yCb - yNb ) ) In mathematical formula 5, the variables mvScaleHor and mvScaleVer may represent the motion vector (MV) of the aforementioned spatial neighbor block or a value derived by applying a shift operation of k to the motion vector. Here, k may be an integer of 1, 2, 3, 4, 5, 6, 7, 8, 9 or greater. The above variables dHorX and dVerX correspond to the x and y components of a predetermined difference value, respectively. Here, the difference value refers to the difference between the motion vector of the lower-right sub-block and the motion vector of the lower-left sub-block within the spatial neighbor block. The variables dHorY and dVerY can be derived based on the above variables dHorX and dVerX. The aforementioned variables can be derived as shown in the following mathematical equation 6. [Mathematical Formula 6] mvScaleHor = MvLX[ xNb ][ yNb + nNbH - 1 ]
[0000] << 7 mvScaleVer = MvLX[xNb][yNb + nNbH - 1]
[0001] << 7 dHorX = ( MvLX [ dVerX = ( MvLX [ dHorY = - dVerX dVerY = dHorX The second control point vector can be derived based on at least one of the motion vector (MV) of a spatial neighbor block, a predetermined difference value, position information of the current block (xCb, yCb), block size (width or height), or position information of a spatial neighbor block (xNb, yNb). Here, the block size may refer to the size of the current block and / or the spatial neighbor block. As the motion vector and difference value are as described in the first control point vector, a detailed explanation is omitted here. However, the position of the motion vector and the range and / or number of difference values used in the derivation process of the second control point vector may differ from those of the first control point vector. For example, the second control point vector can be derived as shown in the following mathematical equation 7. [Mathematical Formula 7] cpMvLX
[0001]
[0000] = ( mvScaleHor + dHorX * ( xCb + cbWidth - xNb ) + dHorY * ( yCb - yNb ) ) cpMvLX
[0001]
[0001] = ( mvScaleVer + dVerX * ( xCb + cbWidth - xNb ) + dVerY * ( yCb - yNb ) ) In Equation 7, the variables mvScaleHor, mvScaleVer, dHorX, dVerX, dHorY, and dVerY are as seen in Equation 5, and a detailed explanation is omitted here. The third control point vector can be derived based on at least one of the motion vector (MV) of a spatial neighbor block, a predetermined difference value, position information of the current block (xCb, yCb), block size (width or height), or position information of a spatial neighbor block (xNb, yNb). Here, the block size may refer to the size of the current block and / or the spatial neighbor block. The motion vector and difference value are as described in the first control point vector, so a detailed explanation is omitted here. However, the position of the motion vector and the range and / or number of difference values used in the derivation process of the third control point vector may differ from the first control point vector or the second control point vector. For example, the third control point vector can be derived as shown in the following mathematical equation 8. [Mathematical Formula 8] cpMvLX
[0002]
[0000] = ( mvScaleHor + dHorX * ( xCb - xNb ) + dHorY * ( yCb + cbHeight - yNb ) ) cpMvLX
[0002]
[0001] = ( mvScaleVer + dVerX * ( xCb - xNb ) + dVerY * ( yCb + cbHeight - yNb ) ) In Equation 8, the variables mvScaleHor, mvScaleVer, dHorX, dVerX, dHorY, and dVerY are as seen in Equation 5, and a detailed explanation is omitted here. Meanwhile, through the process described above, the nth control point vector of the spatial candidate can be derived. The derivation process of the aforementioned affine candidates can be performed for each of the predefined spatial neighbor blocks. The predefined spatial neighbor blocks may include at least one of the left block, bottom-left block, top-right block, top block, or top-left block of the current block. Alternatively, the derivation process of the above affine candidates may be performed separately for each group of the above spatial neighbor blocks. Here, the spatial neighbor blocks may be classified into a first group including the left block and the bottom-left block, and a second group including the top-right block, the top block, and the top-left block. For example, one affine candidate may be derived from a spatial neighbor block belonging to the first group. This derivation may be performed based on a predetermined priority until an available affine candidate is found. The priority may be in the order of left block -> bottom-left block, or in the reverse order. Based on the priority, it is determined whether the corresponding spatial neighbor block within the first group is a block decoded through affine model-based prediction, and the first block decoded by affine model-based prediction may be selected as an affine candidate. Similarly, one affine candidate may be derived from spatial neighbor blocks belonging to the second group. This derivation may be performed based on a predetermined priority until an available affine candidate is found. The priority may be in the order of upper-right block -> upper block -> upper-left block, or in the reverse order. Based on the priority, it is determined whether the corresponding spatial neighbor block within the second group is a block decoded through affine model-based prediction, and the first block decoded through affine model-based prediction may be selected as an affine candidate. The above-described embodiment may be applied in the same or similar manner to temporal neighbor blocks. Here, a temporal neighbor block may be a block that belongs to a different picture from the current block but is located at the same position as the current block. A block at the same position may be a block that includes the position of the top-left sample of the current block, the center position, or the position of a sample adjacent to the bottom-right sample of the current block. Alternatively, a temporal neighbor block may refer to a block at a position shifted by a predetermined variation vector from the block at the same position. Here, the variation vector may be determined based on the motion vector of any one of the spatial neighbor blocks of the aforementioned current block. FIG. 9 illustrates a method for deriving a candidate based on a combination of motion vectors of spatial / temporal neighbor blocks as an embodiment to which the present invention is applied. The configured candidate of the present invention can be derived based on a combination of at least two control point vectors (hereinafter referred to as control point vectors (cpMVCorner[n])) corresponding to each corner of the current block. Here, n can be 0, 1, 2, or 3. The above control point vector (cpMVCorner[n]) may be derived based on the motion vectors of spatial neighbor blocks and / or temporal neighbor blocks. Here, the spatial neighbor blocks may include at least one of a first neighbor block (A, B, or C) adjacent to the top-left sample of the current block, a second neighbor block (D or E) adjacent to the top-right sample of the current block, or a third neighbor block (F or G) adjacent to the bottom-left sample of the current block. The temporal neighbor blocks may refer to blocks belonging to a different picture from the current block, and may mean blocks at the same location as the current block (hereinafter referred to as the fourth neighbor block (Col)). Here, the fourth neighbor block may refer to a block (H, I, or J) containing the location of the top-left sample, top-right sample, or bottom-left sample of the current block, or a block adjacent to the location of the bottom-right sample of the current block. The first neighbor block may refer to the neighbor block located at the top-left (A), top (B), or left (C) of the current block. Depending on a predetermined priority, it may be determined whether the motion vectors of neighbor blocks A, B, and C are available, and a control point vector may be determined using the motion vectors of the available neighbor blocks. The availability determination may be performed until a neighbor block with an available motion vector is found. Here, the priority may be in the order A -> B -> C. However, it is not limited thereto, and the order may be A -> C -> B, C -> A -> B, or B -> A -> C. The second neighbor block may refer to the upper (D) or upper-right (E) neighbor block of the current block. Similarly, it may be determined whether the motion vectors of neighbor blocks D and E are available according to a predetermined priority, and the control point vector may be determined using the motion vectors of the available neighbor blocks. The availability determination may be performed until a neighbor block with an available motion vector is found. Here, the priority may be in the order of D -> E or E -> D. The third neighbor block may refer to a neighbor block to the left (F) or bottom-left (G) of the current block. Similarly, it may be determined whether a motion vector of a neighbor block is available according to a predetermined priority, and a control point vector may be determined using the motion vector of an available neighbor block. The availability determination may be performed until a neighbor block with an available motion vector is found. Here, the priority may be in the order of G -> F or F -> G. For example, the first control point vector (cpMVCorner[0]) can be set as the motion vector of the first neighbor block, the second control point vector (cpMVCorner[1]) can be set as the motion vector of the second neighbor block, and the third control point vector (cpMVCorner[2]) can be set as the motion vector of the third neighbor block. The fourth control point vector (cpMVCorner[3]) can be set as the motion vector of the fourth neighbor block. Alternatively, the first control point vector may be derived using at least one motion vector among the first neighbor block or the fourth neighbor block, wherein the fourth neighbor block may be a block (H) containing the position of the top-left sample. The second control point vector may be derived using at least one motion vector among the second neighbor block or the fourth neighbor block. Here, the fourth neighbor block may be a block (I) containing the position of the top-right sample. The third control point vector may be derived using at least one motion vector among the third neighbor block or the fourth neighbor block. Here, the fourth neighbor block may be a block (J) containing the position of the bottom-left sample. Alternatively, any one of the first to fourth control point vectors may be derived based on the other. For example, the second control point vector may be derived by applying a predetermined offset vector to the first control point vector. The offset vector may be a difference vector between the third control point vector and the first control point vector, or may be derived by applying a predetermined scaling factor to the difference vector. The scaling factor may be determined based on at least one of the width or height of the current block and / or neighboring blocks. K configured candidates (ConstK) according to the present invention can be determined through a combination of at least two of the aforementioned first to fourth control point vectors. The value of K may be an integer of 1, 2, 3, 4, 5, 6, 7, or more. The value of K may be derived based on information signaled by an encoding device, or may be a value pre-agreed upon by a decoding device. The information may include information indicating the maximum number of configured candidates included in the candidate list. Specifically, the first configured candidate (Const1) can be derived by combining the first to third control point vectors. For example, the first configured candidate (Const1) may have control point vectors as shown in Table 4 below. Meanwhile, the control point vectors may be configured as shown in Table 4 only when the reference picture information of the first neighbor block is identical to the reference picture information of the second and third neighbor blocks. Here, the reference picture information may refer to a reference picture index indicating the location of the corresponding reference picture within the reference picture list, or may refer to a POC (picture order count) value indicating the output order. Idx control point vector 0cpMvCorner
[0000] 1cpMvCorner
[0001] 2cpMvCorner
[0002] The second configured candidate (Const2) can be derived by combining the first, second, and fourth control point vectors. For example, the second configured candidate (Const2) may have control point vectors as shown in Table 5 below. Meanwhile, the control point vectors may be configured as shown in Table 5 only when the reference picture information of the first neighbor block is identical to the reference picture information of the second and fourth neighbor blocks. Here, the reference picture information is as described above. Idx control point vector 0cpMvCorner
[0000] 1cpMvCorner
[0001] 2cpMvCorner
[0003] + cpMvCorner
[0001] - cpMvCorner
[0000] cpMvCorner
[0003] + cpMvCorner
[0000] - cpMvCorner
[0001] The third constructed candidate (Const3) can be derived by combining the first, third, and fourth control point vectors. For example, the third constructed candidate (Const3) may have control point vectors as shown in Table 6 below. Meanwhile, the control point vectors may be restricted to be constructed as shown in Table 6 only when the reference picture information of the first neighbor block is identical to the reference picture information of the third and fourth neighbor blocks. Here, the reference picture information is as described above. Idx Control Point Vector Control Point Vector 0cpMvCorner[0]cpMvCorner[0]1cpMvCorner[3] + cpMvCorner[0] - cpMvCorner[2]cpMvCorner[2]2cpMvCorner[2]cpMvCorner[0] + cpMvCorner[3] - cpMvCorner[2] The fourth configured candidate (Const4) can be derived by combining the second, third, and fourth control point vectors. For example, the fourth configured candidate (Const4) may have control point vectors as shown in Table 7 below. Meanwhile, it may be restricted to be configured as shown in Table 7 only when the reference picture information of the second neighbor block is identical to the reference picture information of the third and fourth neighbor blocks. Here, the reference picture information is as described above. Idx control point vector control point vector 0cpMvCorner[1] + cpMvCorner[2] - cpMvCorner[3]cpMvCorner[2]1cpMvCorner[1]cpMvCorner[3]2cpMvCorner[2]cpMvCorner[3] + cpMvCorner[2] - cpMvCorner[1] The fifth configured candidate (Const5) can be derived by combining the first and second control point vectors. For example, the fifth configured candidate (Const5) may have control point vectors as shown in Table 8 below. Meanwhile, the control point vector may be configured as shown in Table 8 only when the reference picture information of the first neighbor block is identical to the reference picture information of the second neighbor block. Here, the reference picture information is as described above. Idx control point vector 1cpMvCorner
[0000] 2cpMvCorner
[0001] The sixth constructed candidate (Const6) can be derived by combining the first and third control point vectors. For example, the sixth constructed candidate (Const6) may have control point vectors as shown in Table 9 below. Meanwhile, the control point vector may be configured as shown in Table 9 only when the reference picture information of the first neighbor block is identical to the reference picture information of the third neighbor block. Here, the reference picture information is as described above. Idx control point vector control point vector 1cpMvCorner
[0000] cpMvCorner
[0000] 2cpMvCorner
[0002] cpMvCorner
[0001] In Table 9, cpMvCorner
[0001] may be a second control point vector derived based on the first and third control point vectors. The second control point vector may be derived based on at least one of the first control point vector, a predetermined difference value, or the size of the current / neighbor block. For example, the second control point vector may be derived as shown in the following Equation 9. [Mathematical Formula 9] cpMvCorner
[0001]
[0000] = ( cpMvCorner
[0000]
[0000] << 7 ) + ( ( cpMvCorner
[0002]
[0001] - cpMvCorner
[0000]
[0001] ) << ( 7 + Log2( cbHeight / cbWidth ) ) ) cpMvCorner
[0001]
[0001] = ( cpMvCorner
[0000]
[0001] << 7 ) + ( ( cpMvCorner
[0002]
[0000] - cpMvCorner
[0000]
[0000] ) << ( 7 + Log2( cbHeight / cbWidth ) ) ) In the aforementioned K constructed candidates (ConstK), the value of K does not limit the position or priority of the constructed candidates arranged in the candidate list. In addition, all of the first to sixth configured candidates may be included in the candidate list, or only some of them may be included in the candidate list. For example, if it is determined that the current block uses three control point vectors, only a configured candidate generated through a combination of three of the first to fourth control point vectors may be used. If it is determined that the current block uses two control point vectors, a configured candidate generated through a combination of at least two of the first to fourth control point vectors may be used, or a configured candidate generated through a combination of only two of the first to fourth control point vectors may be used. Alternatively, only some configured candidates may be included in the candidate list, taking into account the maximum number of affine candidates included in the candidate list. Here, the maximum number may be determined based on the maximum number information signaled by the encoding device, or it may be determined variably by considering the attributes of the current block mentioned above. In this case, the K value of the configured candidate (ConstK) may represent the priority for insertion into the candidate list. Meanwhile, if the difference between two control point vectors belonging to the above-mentioned candidate is smaller than a predetermined threshold value, the above-mentioned candidate may not be inserted into the candidate list. The difference between the two control point vectors may be divided into a difference value in the horizontal direction and a difference value in the vertical direction. Here, the difference value in the horizontal direction refers to the difference value between the first control point vector (910) and the second control point vector (920), and the difference value in the vertical direction may refer to the difference value between the first control point vector (910) and the third control point vector (930). The threshold value may refer to 0 or a vector of a size already agreed upon in the encoding / decoding device. FIG. 10 illustrates a method for deriving motion information of a temporal candidate based on a sub-block as an embodiment to which the present invention is applied. Motion information of a temporal candidate according to the present invention can be derived from motion information of a collocated block. The motion information can be derived in units of sub-blocks. Here, the call block is a block belonging to a different picture (i.e., the call picture) from the current block (1010), and may be a block (1040) at the same position as the current block or a block (1030) at a position shifted by a temporal vector from the position of the current block. The temporal vector may be determined based on the motion vector of the spatial neighbor blocks of the current block. Spatial neighbor blocks may refer to blocks adjacent to at least one of the left, bottom-left, top, top-right, or top-left of the current block. The temporal vector may be determined using only neighbor blocks at positions pre-assigned to the encoding / decoding device. For example, the pre-assigned positions may be the left (1011) or the top (1012), or the left (1011) and the top (1012). If there are multiple neighbor blocks on the left, a block located at the bottom, top, or center among the multiple neighbor blocks may be used. If there are multiple neighboring blocks at the top, the block located at the far left, far right, or center among the multiple neighboring blocks may be used. In deriving a temporal candidate based on a sub-block, the current block and / or call block may be divided into a plurality of sub-blocks. Here, the sub-block may have a fixed size / shape pre-agreed to the encoding / decoding device. For example, the sub-block is represented as an NxM block, and the values of N and M may be integers of 4, 8, or greater. The sub-block may be a square (N=M) or a rectangle (N>M, N <M)일 수도 있다. 크기을 의미할 수 있다. 또는, 부호화 장치는, 상기 서브 블록의 크기 / 형태에 관한 정보를 부호화하여 시그날링하고, 복호화 장치는 시그날링되는 정보에 기초하여 서브 블록의 크기 / 형태를 결정할 수도 있다. Alternatively, the current block and / or call block may be divided into multiple sub-blocks based on a predetermined number. Here, the number may be a fixed number pre-agreed upon by the encoding / decoding device, or it may be determined variably considering the block size / shape. Alternatively, the number may be determined based on count information signaled by the encoding device. Below, we will examine a method for deriving motion information of a temporal candidate in sub-block units. The motion vector of the temporal candidate can be set to a motion vector stored for each sub-block of the call block. The reference picture index of the temporal candidate can be set to a pre-defined value (e.g., 0) in the encoding / decoding device. Alternatively, the reference picture index of the temporal candidate may be set to the reference picture index of the call block or the reference picture index of the top-left sub-block among the sub-blocks. Alternatively, similar to the motion vector, the reference picture index of the temporal candidate may also be set to a reference picture index stored for each sub-block. However, if there is an unavailable sub-block among the sub-blocks belonging to the call block, the motion vector of the unavailable sub-block may be replaced with the motion vector of an available sub-block within the call block. Here, an available sub-block may refer to a block adjacent to any one of the left, right, top, or bottom of the unavailable sub-block. Alternatively, an available sub-block may be a block at a pre-assigned position in the encoding / decoding device. For example, the pre-assigned position may be the position of the bottom-right sub-block within the call block, or the position of a sub-block including the center position of the call block. The aforementioned sub-block-based temporal candidate may be added to the candidate list only if the available sub-block exists. Alternatively, the aforementioned sub-block-based temporal candidate may be added to the candidate list only if the sub-block at the pre-assigned position is available. FIG. 11 illustrates an inter-prediction method in an ERP projection format as an embodiment to which the present invention is applied. Referring to Fig. 11, in the case of the ERP projection format, a reference area specified by a motion vector may overlap the boundary of the reference picture. In this case, the boundary of the reference picture can be extended, and data adjacent to the boundary can be filled horizontally into the extended area (see A). Alternatively, the boundary of the reference picture can be extended, and data adjacent to the opposite boundary (data having continuity or correlation with the boundary) can be filled into the extended area (see B). Alternatively, data in a non-existent area can be filled using data adjacent to the opposite boundary (see C). A and B require a process of expanding the data of the reference picture, but the computation process can be simplified, while C does not require additional memory due to the expansion, but additional computation processes may be required. In the case of A and B, there may be instances where the size of the current picture and the size of the (expanded) reference picture are not the same. A predetermined adjustment process that takes into account this size difference may be included in the process of acquiring predicted pixels. When comparing only the horizontal length, the current picture has a range of 0 to (pic_width - 1), and the reference picture (extended as shown on the right) can have a range of -L_offset to (pic_width - 1 + R_offset) or a range of 0 to (pic_width - 1 + L_offset + R_offset). In the former case, the predicted pixel can be obtained from the extended reference picture at the exact position obtained by adding the current block's coordinates and motion vector. In the latter case, the predicted pixel can be obtained at the readjusted position after the adjustment process of the obtained position is performed. Here, L_offset and R_offset may refer to the length extended in the left and right directions. In the present invention, it will be explained by assuming the case where the coordinates are calculated based on the range of the current picture or the existing reference picture, as before. In the case of C, the position within the reference picture can be calculated by adding the current block's coordinates and the motion vector. The calculated pixel position is within the range of the reference picture (<0,0> ~<pic_width - 1, pic_height - 1> It is possible to check whether it is outside the range of the reference picture. If the calculated pixel location is not outside the range of the reference picture, a predicted pixel can be obtained at the calculated pixel location. On the other hand, if the calculated pixel location is outside the range of the reference picture, a location corresponding to the calculated location is calculated at the opposite location inside the boundary <inside the picture> (right when left, left when right), and a predicted pixel can be obtained at the calculated corresponding location. Based on at least one of the aforementioned embodiments, inter-prediction at reference picture boundaries can be performed. The method for inter-prediction at reference picture boundaries may be pre-defined in the encoding / decoding device, or it may be determined based on selection information specifying any one of the aforementioned embodiments and information related to the selected method (data processing method, extension size information, etc.). This may be applied equally to the embodiments described below. FIGS. 12 and FIGS. 15 illustrate an inter-prediction method in a CMP projection format as an embodiment to which the present invention is applied. Referring to Fig. 12, in the case of the CMP projection format, continuity in three-dimensional space may exist between the upper and lower 3x1 faces due to region-wise packing. However, continuity in three-dimensional space may not exist between the upper 3 x 1 face and the lower 3 x 1 face. Similarly, there may be cases where a reference region specified by a motion vector spans the boundary of the reference picture or some surface boundary. In case A, it points inside the reference picture but is located on some surface boundary (low correlation due to a lack of mutual continuity in 3D space), and in case B, the reference region is located on the boundary of the reference picture. In particular, in the case of A, although it points inside the reference picture, the accuracy of the inter prediction may be reduced because the reference region includes discontinuous surface boundaries. In the case of A and B, the position of the reference area within the reference picture can be calculated by adding the coordinates of the current block and the motion vector. It can be determined whether at least a portion of the reference area extends beyond the boundaries of the reference picture or includes discontinuous boundaries within the reference picture. If the reference area is outside the range of the reference picture, a location with continuity or correlation in three-dimensional space can be determined, and a predicted pixel can be obtained from the determined location. On the other hand, if the reference area does not extend beyond the range of the reference picture, it is possible to determine whether at least one pixel within the reference area pointed to by the motion vector of the current block belongs to two or more surfaces. Here, the verification process can be performed through pixel locations such as the top-left, top-right, bottom-left, and bottom-right of the current block. If at least one pixel within the reference region does not belong to two or more surfaces, a predicted pixel can be obtained from the reference region. However, if this is not the case, it can be determined whether the surface has continuity with the surface to which the current block belongs. In the case of reference region A', the upper region has continuity with the surface to which the current block belongs, and the lower region does not have continuity with the surface to which the current block belongs. If the aforementioned continuity exists, the predicted pixel can be obtained from the reference region. However, if it does not exist, the predicted pixel can be obtained from a region that has continuity or correlation in three-dimensional space. The aforementioned inter prediction order is an example, and various variations are possible, such as changing the order or modifying some components. In the case of C and D, the reference picture can be expanded, and the expanded area can be filled by padding data adjacent to the boundary in the horizontal / vertical direction or by using data from the correlated area. In the case of D, as seen in the ERP, a detailed explanation will be omitted here. In the case of C, as in A, the reference area is located inside the reference picture, but it includes surface boundaries with low correlation. Therefore, if a separate expanded area is not created inside the reference picture, the accuracy of the inter prediction may decrease, and this will be examined in detail with reference to Fig. 13. In the case of C and D, the size of the current picture and the size of the reference picture may not be the same due to the expansion of the reference picture. In this case, the reference picture may have a range of (- L_offset, - U_offset) to (pic_width - 1 + R_offset, pic_height - 1 + D_offset). Here, L_, R_, U_, and D_ offsets may represent the lengths expanded in the left, right, up, and down directions from the reference picture. The above offsets may have the same value or different values. The length of expansion based on the reference picture may be explicitly signaled or implicitly determined. For example, one of the lengths supported in the block division section, such as 2, 4, 8, etc., may be supported. Alternatively, the extension length may be determined based on the minimum coding block, maximum coding block, minimum prediction block, maximum prediction block, etc. Or it may be determined based on units such as tiles, bricks, etc. For example, it can be extended by the length of the maximum prediction block, in which case the acquisition of prediction blocks for all blocks can be processed within the extended range. If, even after extending the reference picture, the area pointed to by the motion vector of the current block falls outside the range of the extended reference picture, the prediction pixels corresponding to the out-of-bounds area can be acquired through horizontal, vertical, or diagonal padding. Referring to FIG. 13, cases A through D may correspond to cases where the reference picture is expanded in units of one or more surfaces. Cases A and B are examples where the reference picture (or sub-reference picture) is expanded by grouping surfaces that have continuity. Cases C and D are examples where the reference picture is expanded individually in units of surfaces. Data processing of the expanded area is the same or similar to the previously described embodiment. In the previously described embodiment, there was a single range regarding the reference picture, but in this example, the reference picture is divided into two or more parts to expand each area (referred to as a sub-reference picture), so overlapping ranges may occur. In examples A and B, the extended sub-reference picture located at the top has a range of (- L_offset, - U_offset) to (pic_width - 1 + R_offset, pic_height / 2 - 1 + D_offset), and the extended sub-reference picture located at the bottom has a range of (- L_offset, pic_height / 2 - U_offset) to (pic_width - 1 + R_offset, pic_height - 1 + D_offset). It is assumed that the extended left, right, up, and down lengths are the same for each sub-reference picture. However, the lengths extended in the left, right, up, and down directions may be set equally for all extension units, or they may be set differently. Additionally, the extension lengths may be set individually depending on the extension unit. In this case, the coordinates of the range extended downward from the upper sub-reference picture are identical to the coordinates within the lower sub-reference picture; however, the upper sub-reference picture contains the corresponding area extended with correlated data, whereas the lower sub-reference picture contains the original data before the extension. In summary, the reference picture can have a range from (-L_offset, -U_offset) to (pic_width - 1 + R_offset, pic_height - 1 + D_offset). Generally, it is correct to assign a single pixel value to each location; however, considering the characteristics of the omnidirectional image, the reference image is expanded by dividing it into two or more regions, so two or more pixel values may be assigned in some ranges. In this case, it may be necessary to determine which pixel value to acquire as the predicted pixel value at locations where two or more pixel values are assigned. Referring to Fig. 14, in the case of E, it is determined which sub-reference picture contains a larger area, and a predicted value can be obtained using the data of the sub-reference picture containing the larger area. In the case of F, if the sub-reference picture containing the current block contains a preset number of pixels or more, or contains a predetermined area, the data of that sub-reference picture may be used. However, if this is not the case, processing using the data of the sub-reference picture containing a larger area, as in E, may be possible. In the case of G, it is a case where it is equally contained in both sub-reference pictures. In this case, priority is given to the sub-reference picture containing the current block so that the data of that sub-reference picture can be used. This example may be included as a detailed condition for F and E. In summary, when the area pointed to by the motion vector of the current block is the boundary between sub-reference pictures, the choice of which sub-reference picture's data to use can be determined based on factors such as the included area and whether it is the same sub-reference picture as the current block. Depending on the encoding / decoding settings, it can be determined which sub-reference picture's data can be used to perform inter-prediction by including all or some of the above conditions. In the example above, the reference picture is divided into two to expand each area, whereas this example describes a case where more sub-reference pictures are generated on a surface basis. In FIG. 15, it is assumed that each surface unit is a sub-reference picture. Likewise, at a location where two or more pixel values are assigned, it is necessary to determine which pixel value to acquire as the predicted pixel value. Referring to Fig. 15, in the case of H, data from a sub-reference picture of a region that contains more can be used, or data from a sub-reference picture containing the current block can be used. For example, if a subreference picture containing the current block is included with a preset number of pixels or a preset width, the data from that subreference picture may be used. Alternatively, if the data from a subreference picture with a larger included area is to be used, the data from that subreference picture may be used. However, if the included areas are identical, the use of the data from the subreference picture containing the current block may be restricted. In case I, data from the sub-reference picture of the area that is included more can be used. In this example, sub-reference pictures are supported on a surface basis, but since the surface settings have discontinuous characteristics between the top 3 x 1 area and the bottom 3 x 1 area, priority can be given to the sub-reference picture with continuous characteristics rather than the sub-reference picture with discontinuous characteristics. In the case of J, data from the sub-reference picture of the area that is more included can be used. However, this applies when the included areas are evenly distributed; as in this example I, the sub-reference picture containing the current block (top right of the 3x2) is not an overlapping target. Furthermore, the sub-reference pictures (top left and center of the 3x2) belong to the same 3 x 1 area as the sub-reference picture containing the current block. In this case, priority can be given to the one that is closer to the sub-reference picture containing the current block. In summary, when the area pointed to by the motion vector of the current block is the boundary between sub-reference pictures, it is possible to determine which sub-reference picture's data to use based on the inclusion area, the priority of using the sub-reference picture, etc. Meanwhile, with reference to FIGS. 7 to 10, we have examined a method for performing inter prediction based on affine motion modeling, which can be used in the same or similar way for encoding / decoding 360 video, and a detailed explanation is omitted. The methods according to the present invention may be implemented in the form of program instructions that can be executed through various computer means and recorded on a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, etc., either alone or in combination. The program instructions recorded on the computer-readable medium may be those specifically designed and configured for the present invention, or they may be those known and available to those skilled in the art of computer software. Examples of computer-readable media may include hardware devices specifically configured to store and execute program instructions, such as ROM, RAM, and flash memory. Examples of program instructions may include machine code, such as that generated by a compiler, as well as high-level language code that can be executed by a computer using an interpreter, etc. The aforementioned hardware devices may be configured to operate as at least one software module to perform the operation of the present invention, and vice versa. In addition, the above-described method or device may be implemented by combining all or part of its configuration or function, or by implementing it separately. Although the present invention has been described above with reference to preferred embodiments, those skilled in the art will understand that various modifications and changes can be made to the invention without departing from the spirit and scope of the invention as described in the following claims. The present invention can be used to encode / decode video signals.
Claims
1. Step of constructing a merge candidate list for the current block; A step of deriving motion information of the current block from the merge candidate list; and A step of performing inter prediction of the current block using the above motion information, The above merge candidate list includes at least one of a spatial merge candidate, a temporal merge candidate, or a combination merge candidate, A method for decoding a video signal, wherein the above combination merge candidate is derived by combining n merge candidates belonging to a merge candidate list.
2. In paragraph 1, A video signal decoding method, wherein the above n merge candidates are merge candidates corresponding to indices 0 to (n-1) in the merge candidate list.
3. In paragraph 1, A video signal decoding method, wherein the index of the above combination merge candidate is greater than the index of the above temporal merge candidate.
4. In paragraph 1, The above n merge candidates include a first merge candidate and a second merge candidate, A video signal decoding method, wherein the motion information of the above combination merge candidate is derived by considering the prediction direction of the first merge candidate and the prediction direction of the second merge candidate.
5. In paragraph 4, A video signal decoding method, wherein the motion information of the above combination merge candidate is derived by weighting the motion information of the first merge candidate and the motion information of the second merge candidate.
6. In paragraph 5, A method for decoding a video signal, wherein the weight of the above weighted average is any one of [1:1], [1:2], [1:3] or [2:3].
