METHODS FOR IMAGE SIGNALS ENCODING / DECODING, AND THEIR EQUIPMENT

IDP000106498BActive Publication Date: 2026-07-16GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD

Patent Information

Authority / Receiving Office
ID · ID
Patent Type
Patents
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2019-11-07
Publication Date
2026-07-16

Smart Images

  • Figure 0_ABST
    Figure 0_ABST
Patent Text Reader

Abstract

A method for supervising an image, according to the present invention, includes the steps of: determining whether a coding block is divided into a first prediction unit and a second prediction unit; determining a partition type of the coding block when determining that the coding block is divided; deriving first motion information about the first prediction unit and second motion information about the second prediction unit within the coding block; and obtaining a prediction sample within the coding block based on the first motion information and the second motion information.
Need to check novelty before this filing date? Find Prior Art

Description

Description METHODS FOR ENCORDING / CONTROLLING IMAGE SIGNALS AND EQUIPMENT Field of Invention Engineering This invention relates to methods of encoding or monitoring video signals and equipment therefor. Background to the Invention With the trend of increasingly larger display panels, high definition video services are in demand. The biggest problem of high-definition video services is that the amount of data increases significantly, and to solve this problem, research has been actively carried out to increase the video compression speed. As a representative example, the Joint Collaborative Team on Video Coding (JCT-VC) was established within the Video Coding Experts Group (VCEG) under the Telecommunication Union International Telecommunication Union (ITU-T) and the Motion Picture Experts Group (MPEG) in 2009. JCT-VC proposed High Efficiency Video Coding (HEVC), which is a video compression standard in which the compression performance is about twice as high as the compression performance of H.264 / AVC, and was approved as a standard on January 25, 2013. With the rapid development of high-definition video services, the performance of HEVC has gradually revealed its limitations. Brief Description of the Invention Technical problem The present invention is directed at providing a method for partitioning an encoding block into a plurality of prediction blocks when encoding or decoding a video signal and an apparatus for doing the same. The present invention is directed at providing a method for obtaining motion information for each number of prediction blocks when encoding or decoding a video signal and an apparatus for doing the same. The present invention is directed at providing a method for obtaining joint candidates using inter-regional motion information tables when encoding or decoding video signals and equipment for implementing said method. The technical problems intended to be solved by this invention are not limited to the problems mentioned above, and other technical problems not described herein should be clearly understood by those skilled in the art from the following description. Technical Solutions Methods for encoding or decoding a video signal according to the present invention include determining whether to separate the coding block into a first prediction unit and a second prediction unit, determining the partition type of the coding block when it is determined to separate the coding block, obtaining first motion information about the first prediction unit in the coding block and the second motion information regarding the second prediction unit in the coding block, and obtaining a prediction sample in the coding block based on the first motion information and the second motion information. In this case, the first motion information regarding the first prediction unit can be derived from the first compound candidate determined by the first index information among a plurality of compound candidates included in the list of compound candidates, and the second motion information regarding the second prediction unit may be derived from the second compound candidate specified determined by the second index information among a plurality of combined candidates included in the combined candidate list. When the information value of the second index is greater than or equal to the information value of the first index, the second combined candidate can have an index equal to the information value of the second index plus one. When the information value of the second index is smaller than the information value of the first index, the second combined candidate can have the same index as the information value of the second index. When a prediction sample is included in the boundary region between the first prediction unit and the second prediction unit, the prediction sample can be derived based on a weighted sum operation of the first prediction sample derived based on the first motion information and the second prediction sample derived based on the second motion information. The first weight applied to the first prediction sample can be determined based on the x-coordinate and y-coordinate of the prediction sample. The second weight applied to the second prediction sample can be reduced by subtracting the first weight from a constant value. The size of the border region can be determined based on at least one of the size of the coding block or the shape of the coding block. The features briefly summarized above with respect to the present invention are only exemplary aspects of the complete description of the present invention described below and do not limit the scope of the present invention. BENEFICIAL EFFECTS According to the present invention, by partitioning the coding block into a number of prediction blocks and obtaining motion information for each prediction block, it is possible to increase the inter-prediction efficiency. According to the present invention, by providing a method for obtaining joint candidates using an inter-regional motion information table, it is possible to increase the inter-prediction efficiency. The beneficial effects of the present invention are not limited to the effects mentioned above, and other beneficial effects not described herein should be clearly understood by those skilled in the art from the following description. Short Description of Image FIGURE 1 is a block diagram of an encoder according to an embodiment of the present invention. FIGURE 2 is a control block diagram according to an embodiment of the present invention. FIGURE 3 is a diagram showing a basic coding tree unit according to an embodiment of the present invention. FIGURE 4 is a diagram showing the various types of coding block partitions. FIGURE 5 is a diagram illustrating aspects of coding tree unit partitioning. FIGURE 6 is a flow chart of an inter-prediction method according to an embodiment of the present invention. FIGURE 7 is a diagram that illustrates the nonlinear motion of objects. FIGURE 8 is a flow chart of an inter-prediction method based on affine motion according to an embodiment of the present invention. FIGURE 9 is a diagram illustrating the affine seed vector for each affine motion model. FIGURE 10 is a diagram illustrating the affine vectors of the sub-blocks in the 4-parameter motion model. FIGURE 11 is a diagram showing neighboring blocks that can be used to obtain merge candidates. FIGURE 12 is a diagram showing an example for obtaining the affine seed vector of the current block based on the affine seed vectors of neighboring affine blocks. FIGURE 13 is a diagram showing an example of setting sub-block motion vectors as affine seed vectors of neighboring affine blocks. FIGURES 14 to 16 are diagrams showing the location of reference samples. FIGURE 17 is a diagram showing an example where the modified affine joint vector derivation method is applied. FIGURE 18 is a diagram showing an example of deriving an affine seed vector from a candidate affine composite based on the motion vectors of sub-blocks belonging to neighboring blocks. FIGURE 19 is a diagram showing an example of deriving an affine seed vector from a candidate affine compound based on the sub-block motion vector located to the left of the current block. FIGURE 20 is a diagram that shows an example of deriving an affine seed vector from affine combination candidates based on motion information of neighboring blocks or non-neighboring blocks located to the left of the current block. FIGURE 21 is a diagram showing the block locations for deriving an affine seed vector from affine compound candidates. FIGURE 22 is a diagram to explain an example of combining motion vectors from a number of neighboring blocks to derive a combined combined candidate. FIGURE 23 is a diagram showing unavailable neighboring blocks. FIGURE 24 is a flowchart of the current block motion information derivation process in combined mode. FIGURE 25 is a diagram to explain aspects of updating the inter-regional movement information table. FIGURE 2 6 is a diagram showing aspects of updating the inter-region combined candidate table. FIGURE 27 is a diagram showing an example where a saved inter-region combined candidate index is updated. FIGURE 28 is a diagram showing the location of representative sub-blocks. FIGURE 29 shows an example where an inter-regional motion information table is generated for each inter-prediction mode. FIGURE 30 is a diagram showing an example where inter-region joint candidates included in the long-term motion information table are added to the list of joint candidates. FIGURE 31 is a diagram showing an example where a redundancy check is performed on only a few compound candidates. FIGURE 32 is a diagram showing an example where redundancy checks on certain join candidates are omitted. FIGURE 33 is a diagram showing an example of partitioning a coding block into a number of prediction blocks using diagonal lines. FIGURE 34 is a diagram showing an example of partitioning a coding block into two prediction units. FIGURE 35 shows an example where the coding block is separated into a number of prediction blocks of different sizes. FIGURE 36 is a diagram showing the neighboring blocks used to derive candidate triangle joins. FIGURE 37 is a diagram to explain an example of determining the availability of neighboring blocks for each triangle prediction unit. FIGURES 38 and 39 are diagrams that show an example of deriving a prediction sample based on the weighted addition operation of the first prediction sample and the second prediction sample. FIGURE 40 is a flow chart of an intra-prediction method according to an embodiment of the present invention. FIGURE 41 is a diagram showing intra-prediction modes. FIGURES 42 and 43 are diagrams showing examples of one-dimensional arrangements in which reference samples are arranged along a line. FIGURE 44 is a diagram illustrating the angles formed between the straight line parallel to the x-axis and the direction intra-prediction mode. FIGURE 45 is a diagram showing an aspect in which a prediction sample is obtained when the current block is non-square. FIGURE 46 is a diagram showing the wide-angle intra-prediction mode. FIGURE 47 is a flow chart showing the process of determining blocking strength. FIGURE 48 shows the filter candidates that have been determined. Complete Description of the Invention Next, embodiments of the present invention will be described in detail with reference to the accompanying drawings. An image is encoded and encoded in block units. For example, encoding and monitoring processing such as transformation, quantization, prediction, in-loop filtering, or reconstruction may be performed on an encoder block, a transform block, or a prediction block. Furthermore, a block to be encoded or encoded will be referred to as the current block.” For example, the current block may represent an encoding block, a transformation block, or a prediction block depending on the current step for encoding or encoding processing. Additionally, the term unit used herein can be understood as denoting the basic unit for carrying out a particular encoding and encoding process, and the term block can be understood as denoting an arrangement of samples of a predetermined size. Unless otherwise specified, the terms block and unit may be used interchangeably. For example, in the following embodiment, the coding block and the coding unit may be understood to have equivalent meaning. FIGURE 1 is a block diagram of an encoder according to an embodiment of the present invention. Referring to FIGURE 1, the video encoding apparatus (100) may include an image separator (110), a predictor (120) and (125), a transformer (130), a quantizer (135), a sequencer (160), an entropy encoder (165), reverse quantizer (140), reverse transformer (145), filter (150), and memory (155). The elements of FIGURE 1 are loosely represented so as to represent different characteristic functions in video encoding equipment, and each element is not intended to be configured in a separate hardware unit or as a single software unit. In other words, the elements are loosely arranged to facilitate explanation. To carry out a function, at least two elements can be combined into one element, or one element can be divided into a number of elements. In this case, an embodiment for the combination of elements and an embodiment for partitioning the elements are included within the scope of the present invention without departing from the essence of the present invention. Also, some elements may not be essential elements to perform the essential functions of the invention and may simply be optional elements to improve performance. The invention can be implemented by including only those elements necessary to implement the essence of the invention rather than elements used simply to improve performance. Even a structure that includes only essential elements rather than optional elements used simply to improve performance is covered within the scope of the present invention. The image splitter 110 may separate the input image into at least one processing unit. In this case, the processing unit can be a prediction unit (PU), transformation unit (TU), or coding unit (CU). The image splitter 110 may separate an image into a plurality of combinations of encoding units, prediction units, and transformation units and may select one combination of encoding units, prediction units, and transformation units according to predetermined criteria (e.g., a cost function) to encode the Image For example, a single image can be split into a number of coding units. A recursive tree structure, such as a rectangular tree structure, can be used to separate the image into coding units. Coding units are separated into other coding units using a single image or largest coding unit because the root can have a number of nodes that corresponds to the number of split coding units. Coding units that are no longer separate due to predefined restrictions function as leaf nodes. That is, when it is assumed that only square partitioning is possible for one coding unit, one coding unit can be split into up to four other coding units. In the following embodiments of the present invention, the encoding unit may refer to a unit configured to perform encoding, or a unit configured to perform encoding monitoring. One coding unit may be separated into at least one or more prediction units of the same size in a square or rectangular shape and may be separated into prediction units such that one of the prediction units differs from the other prediction units in shape and / or size. When the prediction unit that is subjected to intra-prediction based on the coding unit is generated and the coding unit is not the minimum coding unit, intra-prediction can be performed without partitioning the coding unit into a number of N*N prediction units. Predictors (120) and (125) may include an inter-predictor (120) configured to perform inter-prediction and an intra-predictor (125) configured to perform intra-prediction. Predictors 120 and 125 can determine whether to perform intra-prediction or to use inter-prediction on the prediction unit and can determine complete information (e.g., intra-prediction mode, motion vector, reference image, and the like) that corresponds to each prediction method. In this case, the processing unit where the prediction is performed may be different from the processing unit where the prediction method and specific details are specified. For example, prediction methods, prediction modes, and the like may be specified by a prediction unit, and predictions may be performed by a transformation unit. The residual value (corresponding block) between the predicted block and the resulting original block may be fed to transformer 130. Also, motion vector information, prediction mode information, and the like, used for prediction, in addition to residual values ​​may be encoded by the entropy encoder 165 and sent to monitoring. When certain encoding modes are used, the original block in its entirety can be encoded and transmitted to the controller without generating a predicted block through it. The inter-predictor 120 may predict a prediction unit based on information about at least one of the previous image or a subsequent image with respect to the current image, and in some cases, the prediction unit may be predicted based on information about a partial region of the current image where encoding is completed. The inter-predictor 120 may include a reference image interpolator, a motion predictor, and a motion compensator. The reference image interpolator can receive reference image information from memory 155 and can generate information about pixels that are less than or equal to integer pixels of the reference image. In the case of luminance pixels, DCT-based 8-beat interpolation filters having different filter coefficients can be used to generate information about pixels that are smaller than or equal to integer pixels in 1 / 4 pixel units. In the case of chrominance signals, DCT-based 4-beat interpolation filters having different filter coefficients can be used to generate information about pixels that are smaller than or equal to integer pixels in 1 / 8 pixel units. The motion predictor can make motion predictions based on a reference image that is interpolated by a reference image interpolator. As methods for calculating motion vectors, various methods such as full search-based block matching algorithm (FBMA), three-step search algorithm (TSS), and new three-step search algorithm (NTS) can be used. Motion vectors can have motion vector values ​​in units of 1 / 2 or 1 / 4 pixels based on the interpolated pixels. The motion prediction unit can predict the current prediction unit using different motion prediction methods. As motion prediction methods, various methods such as pass method, compound method, advanced motion vector prediction (AMVP) method, and intra-block copy method can be used. The intra-predictor 125 may generate prediction units based on information about reference pixels near the current block, which are information pixels in the current image. When the closest block to the current prediction unit is a block subject to inter-prediction and thus the reference pixel is a pixel subject to inter-prediction, the reference pixel information of the nearest block subject to intra-prediction can be used instead of the reference pixel included in the block in question. subject to inter-prediction. That is, when a reference pixel is not available, at least one available reference pixel can be used as a substitute for the information of the unavailable reference pixel. The prediction modes in intra-prediction can include a direction prediction mode that uses reference pixel information depending on the prediction direction and a directionless mode that does not use directionality information when making predictions. The mode for predicting luminance information and the mode for predicting chrominance information may be different, and the intra-prediction mode information that is used to predict luminance information, or the predicted luminance signal information can be utilized to predict chrominance information. When intra-prediction is performed and the prediction unit is the same size as the transformation unit, intra-prediction can be performed on the prediction unit based on pixels located to the left of the prediction unit, pixels located in the upper left corner of the prediction unit, and pixels located at the top of the prediction unit . However, when intra-prediction is performed and the prediction unit is different in size from the transformation unit, intra-prediction can be performed using reference pixels based on the transformation unit. Also, intra-prediction using N*N partitioning for only minimum coding units can be used. In the intra-prediction method, a prediction block can be generated after applying an adaptive intra-smoothing (AIS) filter to the reference pixels depending on the prediction mode. The type of AIS filter applied to the reference pixel can vary. To perform the intra-prediction method, the intra-prediction mode of the current prediction unit can be predicted from the intra-prediction mode of a prediction unit near the current prediction unit. When the prediction mode of the current prediction unit is predicted using the predicted mode information of the nearest prediction unit, information indicating that the current prediction unit and the nearest prediction unit have the same prediction mode can be transmitted using the predefined flag information when the intra-prediction mode of The current prediction unit is the same as the intra-prediction mode of the nearest prediction unit, and entropy encoding can be performed to encode the prediction mode of the current block information when the prediction mode of the current prediction unit is different from the prediction mode of the nearest prediction unit. Also, a residual block that includes information about the residual value, which is the difference between the prediction unit subjected to the prediction and the original block of the prediction unit, may be generated based on the prediction units generated by the predictors 120 and 125. The resulting waste blocks can be inserted into the transformer 130. The transformer 130 can transform residual blocks that include information about residual values ​​between the original block and the prediction units generated by the predictors 120 and 125 using transformation methods such as discrete cosine transform (DCT) or discrete sine transform (DST). Here, the DCT transformation core includes at least one of DCT2 or DCT8, and the DST transformation core includes DST7. Whether to apply DCT or DST to transform the residual block can be determined based on the intra-prediction mode information of the prediction unit used to generate the residual block. Residual block transformations can be skipped. A flag indicating whether to skip remaining block transformations can be encoded. Transformation skipping may be possible for residual blocks with sizes less than or equal to the threshold value, luma components, or chroma components with a 4:4:4 format. The quantizer 135 can quantize values ​​transformed into the frequency domain by the transformer 130 . The quantization coefficient may vary depending on the block or importance of the Image. The values ​​calculated by the quantizer 135 may be made available to the reverse quantizer 140 and the resequencer 160 . The reorderer 160 can reorder the coefficient values ​​on the quantized residual values. The reorderer 160 can convert the coefficients from a two-dimensional block form to a one-dimensional vector form via a coefficient scanning method. For example, the repeat sequencer 160 can scan DC coefficients and even high frequency coefficients using a meander scanning method to convert the coefficients to one-dimensional vector form. Depending on the intra-prediction mode and the size of the transformation unit, a vertical scan in which the two-dimensional block type coefficients are scanned in the column direction or a horizontal scan in which the two-dimensional block type coefficients are scanned in the row direction can be used instead of the meander scan. That is, the reorderer can determine which scanning method to use among curved scan, vertical scan, and horizontal scan depending on the size of the transformation unit and the intra-prediction mode. The entropy encoder 165 can perform entropy encoding based on the values ​​calculated by the resequencing 160 . Entropy encoding can use, for example, various encoding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoder 165 can encode various information such as residual value coefficient information and coding unit block type information, prediction mode information, partition information, prediction unit information, transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering of resequencing (160) and predictors (120) and (125). The entropy encoder 165 can perform entropy encoding on the input coefficient values ​​of the encoding unit of the resequcer 160 . The inverse quantizer (140) can inversely quantize the values ​​quantized by the quantizer (135), and the inverse transformer (145) can inversely transform the values ​​transformed by the transformer (130). The residual values ​​generated by the inverse quantizer 140 and the inverse transformer 145 can be combined with the prediction units predicted via the motion estimator, motion compensator, and intra-predictor of the predictors 120 and 125 to produce a reconstructed block. The filter 150 can apply at least one of a blocking filter, an offset corrector, and an adaptive loop filter. Block distortion filters can remove block distortion that has occurred due to boundaries between blocks of the reconstructed image. To determine whether to perform unblocking, whether to apply an unblocking filter to the current block can be determined based on the pixels included in some rows or columns within the block. When a block filter is applied to a block, a strong filter or a weak filter can be applied depending on the required strength of the block filter. Also, when a blocking filter is applied, vertical filtering and horizontal filtering can be performed such that horizontal filtering and vertical filtering are processed in parallel. The offset corrector can correct the offset of the original image in an image subject to unblocking in pixel units. A method for classifying pixels included in an image into a certain number of regions, determining the region that will be offset, and applying an offset to the specified region or a method for applying offset by considering edge information for each data pixel used to perform offset correction in a particular image. Adaptive loop filtering (ALF) can be performed based on the values ​​obtained by comparing the filtered reconstructed image and the original image. By classifying the pixels included in the image into predefined groups and determining the filters to be applied to each group, differential filtering can be performed for each group. Information about whether to apply ALF can be transmitted for each coding unit (CU), and the shape and filter coefficients of the ALF filter to be applied can vary depending on the block. Also, ALF filters of the same shape (fixed shape) can be applied regardless of the characteristics of a block to be subjected to filtering. The memory 155 may store reconstructed blocks or images calculated via the filter 150 . The stored reconstructed blocks or images may be made available to predictors 120 and 125 when inter-prediction is performed. FIGURE 2 is a control block diagram according to an embodiment of the present invention. Referring to FIGURE 2, supervision in (200) may include supervision in entropy (210), reorderer (215), inverse quantizer (220), inverse transformer (225), predictors (230) and (235), filter (240), and memory (245). When a video bit stream is input from an encoder, the input bit stream can be encoded in a procedure opposite to that of the encoder. The entropy encoder 210 may perform entropy encoding in a procedure that is contrary to the procedure in which the entropy encoder of the encoder performs entropy encoding. For example, various methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC) can be applied to suit the method performed by the encoder. Entropy monitoring 210 can encode information related to intra-prediction and inter-prediction made by the encoder. The reorderer 215 may perform reordering on the bit stream subjected to entropy encoding by the entropy controller 210 based on the reordering method used by the encoder. The reorderer 215 can reconstruct coefficients expressed in one-dimensional vector form into two-dimensional block type coefficients to reorder the two-dimensional block type coefficients. The reorderer 215 may receive information related to the coefficient scan performed by the encoder and perform reordering via a reverse scan method based on the encoder scan sequence. The reverse quantizer 220 can perform reverse quantization based on the values ​​of the reordered block coefficients and the quantization parameters provided by the encoder. The inverse transformer 225 can perform inverse DCT or inverse DST on the quantization results performed by the encoder, where the inverse DCT or inverse DST is the inverse of the transformation that has been performed by the transformation unit, namely, DCT or DST. Here, the DCT transformation core may include at least one of DCT2 or DCT8, and the DST transformation core may include DST7. Alternatively, when a transformation is passed in the encoder, the reverse transformer 225 cannot perform the reverse transformation. The reverse transformation can be performed based on the transmission units specified by the encoder. In the reverse transformer 225 of the controller, transformation techniques (e.g., DCT and DST) can be selectively performed depending on several pieces of information such as the prediction method, the current block size, and the prediction direction. The predictors 230 and 235 can generate prediction blocks based on information relating to the formation of the prediction block, provided by monitoring entropy 210, and information about previously encoded blocks or images, provided by memory 245. As explained above, when intra-prediction is performed in the same way as the encoder and the prediction unit is the same size as the transformation unit, intra-prediction can be performed on the prediction unit based on the pixel located to the left of the prediction unit, the pixel located in the left corner top of the prediction unit, and pixels located at the top of the prediction unit. On the other hand, when intra-prediction is performed and the prediction unit is different in size from the transformation unit, intra-prediction can be performed using reference pixels based on the transformation unit. Also, intra-prediction using N*N partitioning for only minimum coding units can be used. Predictors (230) and (235) may include prediction unit determinants, inter-predictors, and intra-predictors. The prediction unit specifier can receive various information such as prediction unit information, prediction mode information for the intra-prediction method, and motion prediction related information for the inter-prediction method from supervisiondi entropy (210), classify the prediction unit in the current coding unit, and determine whether The prediction unit performs inter-prediction or intra-prediction. Using the information required for inter-prediction of the current prediction unit provided by the encoder, the inter-predictor 230 can perform inter-prediction on the current prediction unit based on information included in at least one of the images preceding the current image that includes the current prediction unit or the image after the current image. Alternatively, inter-prediction can be performed based on information about multiple reconstructed regions in the current image that include the current prediction unit. The inter-predictor 230 may determine whether the motion prediction method for the prediction unit included in the corresponding coding unit is pass-through mode, combined mode, AMVP mode, or intra-block copy mode based on the coding unit to perform the inter-prediction. The intra-predictor 235 may generate prediction blocks based on information about pixels in the current image. When the prediction unit is a prediction unit subject to intra-prediction, the intra-predictor 235 can perform intra-prediction based on the intra-prediction mode information of the prediction unit provided by the encoder. The intra-predictor 235 may include an AIS filter, a reference pixel interpolator, and a DC filter. The AIS filter, which is the part that performs filtering on the current block's reference pixels, can determine whether to apply the filter depending on the prediction mode of the current prediction unit. The AIS filter can perform AIS filtering on the current block's reference pixels using the AIS filter information and prediction mode of the prediction unit provided by the encoder. When the current block prediction mode is a mode in which AIS filtering is not performed, the AIS filter cannot be applied. When the prediction mode of the prediction unit is a prediction mode in which intra-prediction is performed based on pixel values ​​obtained by interpolating reference pixels, the reference pixel interpolator can interpolate the reference pixels to produce reference pixels in pixel units that are less than or equal to an integer. When the prediction mode of the current prediction unit is a prediction mode in which the prediction block is generated without interpolating the reference pixels, the reference pixels cannot be interpolated. When the prediction mode of the current block is DC mode, the DC filter can generate a prediction block through filtering. The reconstructed blocks or images may be provided to the filter 240. Filters 240 may include blocking filters, offset correctors, and ALF filters. The filter 240 may receive information about whether a blocking filter was applied to the corresponding block or image or information about whether a strong filter or a weak filter was applied when the blocking filter was applied from the encoder. The blocking filter of the monitoringdi can receive information related to the blocking filter, which is provided by the encoder, and the monitoringdi can perform blocking filtering on the corresponding blocks. The offset corrector can perform offset corrections on reconstructed images based on the offset correction type, offset value information, and the like applied to the image after encoding. ALF can be applied to the encoding unit based on information about whether to apply ALF, ALF coefficient information, and the like provided from the encoder. ALF information can be provided by inclusion in certain parameter sets. The memory 245 can store the reconstructed image or block so that the image or block can be used as a reference image or reference block and can also provide a reconstructed image for the output unit. FIGURE 3 is a diagram showing a basic coding tree unit according to an embodiment of the present invention. The coding unit of the largest size can be defined as a coding tree block. One image is split into a number of coding tree units (CTUs). The coding tree unit, which is the coding unit of the largest size, can be called the largest coding unit (LCU). FIGURE 3 shows an example where a single image is split into a number of coding tree units. The unit size of the encoding tree can be defined at the image level or sequence level. For this purpose, information indicating the size of the encoding tree unit can be signaled via an image parameter set or a circuit parameter set. As an example, the encoding tree unit size for all images in a series can be set to 128x128. Alternatively, either 128x128 or 256x256 may be specified as the encoding tree unit size at the Image level. For example, the encoding tree unit size in the first drawing may be set to 128x128, and the encoding tree unit size in the second drawing may be set to 256x256. Encoding tree units can be separated to produce encoding blocks. The encoding block represents the basic unit for the encoding or encoding process. For example, predictions or transformations may be performed for each coding block, or a predictive coding mode may be specified for each coding block. Here, the predictive coding mode indicates the method for generating Image predictions. As an example, the predictive coding mode may include intra-prediction, inter-prediction, current image referencing (CPR) (or intra-block copy (IBC)), or combined prediction . The prediction block for the coding block can be generated using at least one predictive coding mode among intra-prediction, inter-prediction, current image referencing, or combined prediction for the coding block. Information indicating the predictive coding mode of the current block can be signaled in a bit stream. For example, the information may be a 1-bit flag indicating whether the predictive coding mode is intra-mode or inter-mode. Current image referencing or combined prediction can be available only when it is determined that the predictive coding mode of the current block is inter-mode. Current image referencing is to set the current image as a reference image and obtain the current block prediction block from a region of the current image where encoding or encoding is completed. Here, current image refers to the image that includes the current block. Information indicating that the current image reference is applied to the current block may be signaled in a bit stream. For example, the information can be a 1-bit flag. It can be determined that the predictive coding mode of the current block is referencing the current image when the flag is true, and it can be determined that the prediction mode of the current block is inter-prediction when the flag is false. Alternatively, the predictive coding mode of the current block can be determined based on the index of the reference image. For example, when the index of the reference image shows the current image, it can be determined that the predictive coding mode of the current block is referencing the current image. When the index of the reference image shows an image other than the current image, it can be determined that the predictive coding mode of the current block is inter-prediction. That is, current image referencing is a prediction method that uses information from a region of the current image where encoding or encoding supervision is complete, and inter-prediction is a prediction method that uses information from another image where encoding or encoding supervision is complete. Combined prediction represents the encoding mode obtained by combining two or more of intra-prediction, inter-prediction, and current image referencing. For example, when combined prediction is applied, a first prediction block can be generated based on either intra-prediction, inter-prediction, or reference of the current image, and a second prediction block can be generated based on another prediction block. When the first prediction block and the second prediction block are generated, the final prediction block can be generated via an averaging operation or a weighted addition operation between the first prediction block and the second prediction block. Information indicating whether the combined prediction was applied can be signaled in a bit stream. The information can be a 1-bit flag. FIGURE 4 is a diagram showing the various types of coding block partitions. The coding block can be separated into a number of coding blocks based on rectangular tree partitioning, binary tree partitioning, or ternary tree partitioning. The coding block obtained through partitioning can be further separated into a number of coding blocks based on rectangular tree partitioning, binary tree partitioning, or ternary tree partitioning. Quad tree partitioning shows a partitioning technique to split the current block into four blocks. As a result of the rectangular tree partitioning, the current block can be split into four rectangular partitions (see SPLIT_QT of FIGURE 4A). Binary tree partitioning shows a partitioning technique to split the current block into two blocks. Partitioning the current block into two blocks in the vertical direction (i.e., using a vertical line across the current block) can be referred to as vertical binary tree partitioning, and partitioning the current block into two blocks in the horizontal direction (i.e., using a horizontal line across the current block ) can be called as horizontal binary tree partitioning. As a result of binary tree partitioning, the current block can be separated into two non-square partitions. In FIGURE 4B, SPLIT_BT_VER represents the result of partitioning a vertical binary tree. In FIGURE 4C, SPLIT_BT_HOR represents the result of partitioning a horizontal binary tree. Ternary tree partitioning shows a partitioning technique to separate the current block into three blocks. Partitioning the current block into three blocks in the vertical direction (i.e., using two vertical lines across the current block) can be referred to as vertical ternary tree partitioning, and partitioning the current block into three blocks in the horizontal direction (i.e., using two horizontal lines across the block currently) can be referred to as horizontal ternary tree partitioning. As a result of the ternary tree partitioning, the current block can be separated into three non-square partitions. In this case, the width or height of the partition located in the center of the current block can be twice the width or height of the other partitions. In FIGURE 4D, 'SPLIT_TT_VER' represents the result of partitioning the vertical ternary tree. In FIGURE 4E, SPLIT_TT_HOR represents the result of partitioning the horizontal ternary tree. The number of times a coding tree unit is split can be determined as the partition depth. The maximum partition depth of an encoding tree unit can be determined at the circuit level or Image level. Thus, the maximum partition depth of an encoding tree unit can vary depending on the circuit or Image level. Alternatively, the maximum partition depth can be determined independently for each partitioning technique. For example, the maximum partition depth allowed for rectangular tree partitioning may be different from the maximum partition depth allowed for binary tree partitioning and / or ternary tree partitioning. The encoder may signal information indicating at least one of the partition types or partition depths of the current block in the bit stream. Supervision can determine the partition type and partition depth of coding tree units based on information parsed from the bit stream. FIGURE 5 is a diagram that illustrates the partitioning aspect of the coding tree unit. Partitioning coding blocks using partitioning techniques such as rectangular tree partitioning, binary tree partitioning, and / or ternary tree partitioning can be called multi-tree partitioning. The coding blocks generated by applying multi-tree partitioning to the coding blocks can be called down-coding blocks. When the partition depth of coding blocks is k, the partition depth of lower coding blocks is set to k+1. On the other hand, with respect to a coding block with partition depth k+1, a coding block with partition depth k can be called an upper coding block. The current coding block partition type can be determined based on at least one of the ats coding block partition type or the neighbor coding block partition type. Here, neighboring coding blocks are adjacent to the current coding block and can include at least one of the neighboring blocks located above the current coding block, neighboring blocks located to the left of the current coding block, or neighboring blocks adjacent to the top left corner current coding block. Here, the partition type may include at least one of quad tree partitioning, binary tree partitioning, binary tree partitioning direction, ternary tree partitioning, or ternary tree partitioning direction. To determine the coding block partition type, information indicating whether the coding block is split can be signaled in the bit stream. The information is the 1-bit split_cu_flag flag, and the flag is true indicating that the coding block was split by a multi-tree partitioning technique. When split_cu_flag is true, information indicating whether the coding block is split via rectangular tree partitioning can be signaled in the bit stream. The information is the 1-bit split_qt_flag flag, and when the flag is true, the encoder block can be split into four blocks. For example, it is shown in FIGURE 5 that four coding blocks with a partition depth of one are generated because the coding tree units are split through rectangular tree partitioning. It is also shown that quad tree partitioning is reapplied to the first coding block and the fourth coding block among the four coding blocks generated by performing quad tree partitioning. As a result, four coding blocks with a partition depth of two can be generated. Also, by reapplying quad tree partitioning to coding blocks with a partition depth of two, coding blocks with a partition depth of three can be generated. When rectangular tree partitioning is not applied to the coding block, whether to perform binary tree partitioning or ternary tree partitioning on the coding block can be determined by considering at least one of the coding block size, whether the coding block is located at the edge of the image, the maximum partition depth, or the partitioning aspect. neighboring block. When it is determined that binary tree partitioning or ternary tree partitioning is performed on an encoding block, information indicating the direction of partitioning can be signaled in the bit stream. The information can be a 1-bit flag mtt_split_cu_vertical_flag. Based on these flags, whether the partitioning direction is vertical or horizontal can be determined. Additionally, information indicating which binary tree partitioning and ternary tree partitioning is applied to the coding block can be signaled in the bit stream. The information can be a 1-bit flag mtt_split_cu_binary_flag. Based on these flags, whether binary tree partitioning or ternary tree partitioning is applied to the coding block can be determined. For example, it is shown in FIGURE 5 that vertical binary tree partitioning is applied to coding blocks with a partition depth of one, vertical ternary tree partitioning is applied to the left coding block among the coding blocks generated as a result of vertical binary tree partitioning, and vertical binary tree partitioning is applied to the right coding block. Inter-prediction is a mode of predictive coding in which the current block is predicted using information about previous images. As an example, a block included in the previous image and placed in the same location as the current block's location (hereinafter referred to as a collocated block) can be designated as a predicted block of the current block. Prediction blocks generated based on blocks placed in the same location as the current block location will be called collocated block predictions. Meanwhile, when an object present in the previous image moves to a different location in the current image, the current block can be effectively predicted using the object's motion. For example, when the motion direction and size of an object can be found by comparing the previous image to the current image, a prediction block (or predicted image) of the current block can be generated by considering the object's motion information. Furthermore, the prediction block generated using motion information can be called a motion prediction block. The remaining block can be generated by subtracting the predicted block from the current block. At this time, when there is object motion, it is possible to reduce the residual block energy, and therefore it is possible to improve the residual block compression performance by using motion prediction blocks instead of collocated prediction blocks. As explained above, generating prediction blocks using motion information can be called motion compensation prediction. In most inter-predictions, prediction blocks can be generated based on motion compensation predictions. The motion information may include at least one of a motion vector, a reference image index, a predicted direction, or a bidirectional weight index. The motion vector indicates the direction of motion and size of the object. The reference image index determines the current block reference image among the reference images included in the reference image list. The prediction direction indicates either one-way L0 prediction, one-way L1 prediction, or bidirectional prediction (L0 prediction and L1 prediction). At least one of L0 directional motion information or L1 directional motion information can be used depending on the predicted direction of the current block. The bidirectional weight index determines the weight applied to the L0 prediction block and the weight applied to the L1 prediction block. FIGURE 6 is a flow chart of an inter-prediction method according to an embodiment of the present invention. Referring to FIGURE 6, the inter-prediction method includes determining the inter-prediction mode of the current block (S601), obtaining motion information of the current block according to the specified inter-prediction mode (S602), and performing motion compensation prediction of the current block based on the information motion obtained (S603). Here, the inter-prediction modes, which represent various techniques for determining the motion information of the current block, can include inter-prediction modes using translational motion information and inter-prediction modes using affine motion information. As an example, an inter-prediction mode using translational motion information may include a combined mode and a motion vector prediction mode, and an inter-prediction mode using affine motion information may include an affine combined mode and an affine motion vector prediction mode. The motion information of the current block can be determined based on the information decomposed from the bit stream or blocks adjacent to the current block according to the inter-prediction mode. Inter-prediction methods using affine motion information will be explained in detail below. FIGURE 7 is a diagram illustrating the nonlinear movement of an object. The motion of objects in the image can occur non-linearly. For example, as in the example shown in FIGURE 7, nonlinear motion of objects, such as enlargement, contraction, rotation, and affine transformations, can occur. When non-linear motion of an object occurs, the translational motion vector cannot effectively represent the motion of the object. Therefore, it is possible to increase the coding efficiency by using affine motion in a section where nonlinear motion of the object has occurred instead of translational motion. FIGURE 8 is a flow chart of an inter-prediction method based on affine motion according to an embodiment of the present invention. Whether an affine motion-based inter-prediction technique is applied to the current block can be determined based on the information parsed from the bit stream. In detail, whether an affine motion-based inter-prediction technique is applied to the current block can be determined based on at least one of the flags indicating whether the affine joint mode is applied to the current block or the flag indicating whether the affine motion vector prediction mode is applied to the current block . When the affine motion based inter-prediction technique is applied to the current block, the affine motion model of the current block can be determined (S801). At least one of the 6-parameter affine motion model or the 4-parameter affine motion model can be specified as the affine motion model. The 6-parameter affine motion model expresses an affine model using six parameters, and the 4-parameter affine motion model expresses an affine model using four parameters. Equation 1 expresses affine motion using six parameters. Affine motion represents translational motion for a particular region determined by the affine seed vector. [Equation 1] vxax-by+e vv=cx+dy+j When affine motion is expressed using six parameters, complex motion can be expressed, but the number of bits required to encode the parameters may increase, thereby reducing coding efficiency. Therefore, affine motion can be expressed using four parameters. Equation 2 expresses affine motion using four parameters. [Equation 2] vx=ax-by l e vy=bx+ay+J Information to determine the affine motion model from the current model can be encoded and signaled in a bit stream. For example, the information could be the 1-bit flag affme_type_flag. A flag value of 0 indicates that the 4-parameter affine motion model is applied, and a flag value of 1 indicates that the 6-parameter affine motion model is applied. Flags can be encoded in single slices, tiles, or blocks (for example, coding blocks or coding tree units). When the flag is signaled at the slice level, the affine motion model defined at the slice level can be applied to all blocks included in the slice. Alternatively, an affine motion model of the current block can be determined based on the affine inter-prediction modes of the current block. For example, when the affine combined mode is applied, it can be determined that the current block affine motion model is a 4-parameter motion model. On the other hand, when the affine motion vector prediction mode is applied, the information to determine the current block's affine motion model can be encoded and signaled in a bit stream. For example, when the affine motion vector prediction mode is applied to the current block, the affine motion model of the current block can be determined based on the 1-bit flag 'affine_type_flag, Next, the affine seed vector of the current block can be derived (S802). When the 4-parameter affine motion model is selected, the motion vectors at the two control points of the current block can be derived. On the other hand, when the 6-parameter affine motion model is selected, the motion vectors at the three control points of the current block can be derived. The motion vector at the control point can be called an affine seed vector. Control points can include at least one of the top-left corner, top-right corner, or bottom-left corner of the current block. FIGURE 9 is a diagram illustrating the affine seed vector for each affine motion model. In the 4-parameter affine motion model, the affine seed vector can be derived for any two from the top left corner, top right corner, or bottom left corner. For example, as in the example shown in FIGURE 9A, when a 4-parameter affine motion model is selected, an affine vector can be derived using the affine seed vector sv0 for the top-left corner of the current block (for example, the top-left sample (x0, y0)) and the vector affine seed sv1for the top right corner of the current block (for example, the top right sample (x1, y1)). The affine seed vector for the bottom left corner can be used instead of the affine seed vector for the top left corner, or the affine seed vector for the bottom left corner can be used instead of the affine seed vector for the top right corner. In the 6-parameter affine motion model, affine seed vectors can be derived for the top left corner, top right corner, and bottom left corner. For example, as in the example shown in FIGURE 9B, when the 6-parameter affine motion model is selected, the affine vector can be derived using the affine seed vector sv0for the top left corner of the current block (for example, the top left sample (x0, y0)), the seed vector the affine sv1 for the top right corner of the current block (for example, the top right sample (x1, y1)), and the affine seed vector sv2 for the top left corner of the current block (for example, the top left sample (x2, y2)). In the following embodiment, in the 4-parameter affine motion model, the affine seed vectors for the top-left control point and the top-right control point will be referred to as the first affine seed vector and the second affine seed vector, respectively. In the following embodiment where a first affine seed vector and a second affine seed vector are used, at least one of the first affine seed vector and the second affine seed vector may be replaced with an affine seed vector (third affine seed vector) for the bottom left control point or an affine seed vector (fourth affine seed vector) for the bottom right control point. Also, in the 6-parameter affine motion model, the affine seed vectors of the top-left control point, top-right control point, and bottom-left control point will be referred to as the first affine seed vector, the second affine seed vector, and the third affine seed vector, respectively. consecutive. In the following embodiment where a first affine seed vector, a second affine seed vector, and a third affine seed vector are used, at least one of the first affine seed vector, second affine seed vector, and third affine seed vector may be replaced by an affine seed vector (seed vector fourth affine) for the bottom right control point. Affine vectors can be derived for each sub-block using an affine seed vector (S803). Here, the affine vector denotes the translational motion vector derived based on the affine seed vector. The affine vectors of the sub-blocks can be called affine motion vectors or sub-block motion vectors. FIGURE 10 is a diagram illustrating the affine vectors of the sub-blocks in the 4-parameter motion model. The affine vector of the sub-block can be derived based on the control point location, sub-block location, and affine seed vector. As an example, Equation 3 shows an example of deriving an affine sub-block vector. [Equation 3] In Equation 3, (x, y) represents the sub-block location. Here, the sub-block location indicates the location of the reference samples included in the sub-block. The reference sample can be a sample located in the top left corner of the sub-block or a sample where at least one of the x-coordinates or y-coordinates is located at the center. (x0, y0) represents the location of the first control point, and (sv0x, sv0y) represents the first affine seed vector. Also, (x1, y1) represents the location of the second control point, and (sv1x, sv1y) represents the second affine seed vector. When the first control point and the second control point correspond to the top left corner and top right corner of the current block, respectively, x1-x0 can be set to a value equal to the width of the current block. Next, motion compensation predictions can be performed for each sub-block using the corresponding sub-block affine vector (S804). As a result of performing motion compensation predictions, a prediction block for each sub-block can be generated. The prediction blocks of a sub-block can be set as the prediction blocks of the current block. The affine seed vector of the current block can be derived based on the affine seed vector of blocks adjacent to the current block. When the inter-prediction mode of the current block is the affine join mode, the affine seed vector of the join candidates included in the list of join candidates can be specified as the affine seed vector of the current block. Also, when the current block's inter-prediction mode is an affine combined mode, motion information including at least one of the reference image indexes, certain direction prediction flags, or bidirectional weights of the current block may also be set to be equal to the combined candidate. Merge candidates can be derived based on neighboring blocks of the current block. The neighbor block may include at least one of the spatial neighbor blocks that is spatially adjacent to the current block and the temporary neighbor block that is included in a different image than the current image. FIGURE 11 is a diagram showing neighboring blocks that can be used to obtain merge candidates. Neighboring blocks of the current block may include at least one of the neighboring block (A) adjacent to the left of the current block, the neighboring block (B) adjacent to the top of the current block, the neighboring block (C) adjacent to the top right corner the current block, the neighboring block (D) adjacent to the lower left corner of the current block, or the neighboring block (E) adjacent to the upper left corner of the current block. When the top left sample of the current block has coordinates (x0, y0), the left neighbor block A includes the sample located at (x0-1, y0+H-1), and the top neighbor block B includes the sample located at (x0+W -1, y0-1). Here, W and H represent the width and height of the current block, respectively. The top-right neighbor block C includes samples located at (x0+W, y0-1), and the bottom-left neighbor block D includes samples located at (x0-1, y0+H). The upper left neighbor block E includes samples located at (x0-1, y0-1). When neighboring blocks are encoded in affine inter-prediction mode, a combined candidate affine seed vector can be derived based on the affine seed vectors of the corresponding neighboring blocks. Hereinafter, the neighboring blocks encoded in the affine inter-prediction mode will be referred to as affine neighbor blocks, and the merge candidates derived from the affine neighbor blocks will be referred to as affine merge candidates. Neighboring blocks can be found in a predefined scan sequence to generate affine join candidates for the current block. The scan order can be predefined in the encoder and controller. For example, neighboring blocks can be found in the order A, B, C, D, and E. Also, candidate affine compounds can be sequentially derived from the discovered affine neighboring blocks. Alternatively, the scan sequence may be adaptively determined based on at least one of the current block's size, shape, or affine motion model. That is, the scan sequences for blocks that differ in at least one of their sizes, shapes, or affine motion models may differ from each other. Alternatively, blocks located to the top of the current block can be sequentially discovered to derive one affine merge candidate from the initially discovered affine neighboring block, and blocks located to the left of the current block can be sequentially discovered to derives one affine merge candidate from the first discovered affine neighboring block. Here, neighboring blocks located at the top of the current block can include at least one of neighboring block E, neighboring block B, or neighboring block C, and blocks located to the left of the current block can include at least one of from block A or block D. In this case, the neighboring block E can be classified as the block located to the left of the current block. Although not shown, candidate affine joins can be derived from temporary neighboring blocks of the current block. Here, temporary neighboring blocks can include blocks placed at the same location in the collocated image as the current block or blocks adjacent to the block. In detail, when the temporary neighboring blocks of the current block are encoded in affine inter-prediction mode, affine fusion candidates can be derived based on the affine seed vectors of the temporary affine fusion candidates. A merge candidate list that includes the affine merge candidates may be generated, and an affine seed vector according to one of the merge candidates included in the merge candidate list may be determined to be the affine seed vector of the current block. For this purpose, an information index to identify one of the combined candidates may be encoded and transmitted in a bit stream. As another example, while a neighboring block is being discovered in a scan sequence, the affine seed vector of the current block can be derived from the affine seed vector of the first discovered affine neighboring block. The current block's affine seed vector can be derived using neighboring blocks' affine seed vectors in affine merge mode. When the inter-prediction mode of the current block is the affine motion vector prediction mode, the affine seed vector of the motion vector prediction candidate included in the motion vector prediction candidate can be determined as the prediction value of the current block's affine seed vector. By adding the difference value of the affine seed vector to the predicted value of the affine seed vector, the current block affine seed vector can be derived. Affine seed vector prediction candidates can be derived based on the neighboring blocks of the current block. In detail, neighboring blocks located above the current block are found in a predetermined scan sequence, and the first affine seed vector prediction candidate can be derived from the first discovered affine neighboring block. Also, neighboring blocks located to the left of the current block are found in a predetermined scan sequence, and a second affine seed vector prediction candidate can be derived from the first discovered affine neighboring block. Information to determine the difference values ​​of affine seed vectors can be encoded and transmitted in a bit stream. Information can include information measures that indicate the size of the difference value of affine seed vectors and sign information that indicates the sign of the difference value of affine seed vectors. The difference value of the affine seed vector for each control point can be set to the same value. Alternatively, the difference value of the affine seed vector can be set differently depending on the control point. As explained above, the affine seed vector of the affine merge candidate or predicted candidate affine seed vector is derived from the affine seed vector of the neighboring affine block, and the current block's affine seed vector can be derived using the affine seed vector derived from the affine merge candidate or candidate affine seed vector prediction. Alternatively, once an affine neighbor block is found in a predefined scan sequence, the current block's affine seed vector can be derived from the affine seed vector of the first discovered affine neighbor block. The method of deriving a block's current affine seed vector, affine merge candidate, or affine seed vector prediction candidate from affine seed vectors in neighboring affine blocks will be explained in detail below. In the following embodiments, to obtain the affine seed vector the current block can also be understood as deriving the affine seed vector from the affine compound candidate or to obtain the affine seed vector from the predicted candidate affine seed vector. FIGURE 12 is a diagram showing an example of deriving the affine seed vector of the current block based on the affine seed vectors of neighboring affine blocks. When the first affine seed vector nv0 for the top-left control point and the second affine seed vector nv1 for the top-right control point are saved for the affine neighbor block, the third affine seed vector nv2 for the bottom-left control point of the affine neighbor block can be derived based on the first affine seed vector and the vector second affine seed. Equation 4 shows an example of deriving a third affine seed vector. [Equation 4] (ηνίχ-ηνΟχ) (wvlv-HVQy)z. I™*--1-----λ',λ)—1------— Cv^-Jwo)+vOa. \Awl ““'hit)) (Απ1_-*·η0.) _ (wvlv-«vOv) . (m'lx-'nvox) . . / iV2y z . λ (Λ'«2Λ,7 / θ) z . λ Clj / 2J;»o)+ / iVOy In Equation 4, (nv0x, nv0y) represents the first affine seed vector nv0, (nv1x, nv1y) represents the second affine seed vector nv1, and (nv2x, nv2y) represents the third affine seed vector nv2. Also, (xn0, xn0) represents the location of the first control point, (xn1, xn1) represents the location of the second control point, and (xn2, xn2) represents the location of the third control point. Next, the current block's affine seed vector can be derived using the first affine seed vector, the second affine seed vector, and the third affine seed vector. Equation 5 shows an example of deriving the first affine seed vector v0 from the current block, and Equation 6 shows an example of deriving the second affine seed vector v1 from the current block. [Equation 5] (hv^-hv^.) (wv2A-HVaT) , . i).v f _ _ 0*ί) z , s 0'0 JJio)“tWVΟγ _ («v2l.-wv0>)f,Vo.v--77-----VV'o-^o)- —<To-JW1v·^nln<)' 'J' «2--' u0' [Equation 6] _ (MV1A.-wvoj , (nv^-nvox)r. ;-------— <*ι-*κο.)—; -------7 (j:rT«o.)1(A nl “Λ „o) (j'n2'A „0) _ (nvlv-nvOy) (nv2v-nv0y) % z ’ . Or-*^)- z ‘ACVi-.V„o)+«vOv In Equation 5 and Equation 6, (v0x, v0y) represents the first affine seed vector sv0 of the current block, and (v1x, v1y) represents the second affine seed vector sv1 of the current block. Also, (x0, y0) represents the location of the first control point, and (x1, y1) represents the location of the second control point. For example, the first control point shows the top left corner of the current block, and the second control point shows the top right corner of the current block. In the example described above, it has been explained that the affine seed vector of the current block is derived using three affine seed vectors for neighboring affine blocks. As another example, the affine seed vector of the current block can be derived using only two affine seed vectors from neighboring affine blocks. Alternatively, the affine seed vector of the current block can be derived using the fourth affine seed vector for the bottom right corner instead of the first affine seed vector for the top left corner, the second affine seed vector for the top right corner, or the third affine seed vector for the bottom left corner with respect to neighboring affine blocks. Specifically, when the top edge of the current block is adjacent to the top edge of the coding tree unit and the affine seed vector for the top control point (e.g., top left corner or top right corner) of the affine neighboring block is adjacent to the top of the current block (hereinafter referred to as as the top affine neighbor block) is intended to be used, this affine seed vector must be pre-stored in memory. Therefore, problems may arise where the number of line buffers increases. Thus, when the top edge of the current block is adjacent to the top edge of the coding tree unit, the arrangement can be made such that the affine seed vector for the bottom control point (for example, the bottom left corner or the bottom right corner) instead of the affine seed vector for the top control point used for neighboring blocks over affine. As an example, the affine seed vector of the current block can be derived using the third affine seed vector for the bottom left corner and the fourth affine seed vector for the bottom right corner with respect to the affine's top neighboring block. In this case, the affine seed vectors for the bottom corners can be derived by copying the affine seed vectors for the top corners or from the affine seed vectors for the top corners. As an example, the fourth affine seed vector for the bottom right corner may be used by modifying or replacing the first affine seed vector, the second affine seed vector, or the third affine seed vector. Equation 7 and Equation 8 show an example of deriving the first affine seed vector and second affine seed vector from the current block using the third affine seed vector for the lower left control point of the neighboring affine vector and the fourth affine seed vector for the lower right control point of the neighboring affine vector. [Equation 7] [Equation 8] In Equation 7 and Equation 8, (xn2, yn2) represents the coordinates of the lower left control point of the affine neighboring block, and (xn3, yn3) represents the coordinates of the lower right control point of the affine neighboring block. (x0, y0) represents the coordinates of the top-left control point of the current block, and (x1, y1) represents the coordinates of the top-right control point of the current block. (nv2x, nv2y) represents the affine seed vector for the bottom left control point (i.e., the third affine seed vector) of the affine neighbor block, and (nv3x, nv3y) represents the affine seed vector for the bottom right control point (i.e., the fourth affine seed vector) from the neighboring block of Afin. (v0x, v0y) represents the affine seed vector for the top-left control point (i.e., the first affine seed vector) of the current block, and (v1x, v1y) represents the affine seed vector for the top-right control point (i.e., the second affine seed vector ) of the current block. The division operations included in Equation 7 and Equation 8 can be converted to bit shift operations. The bit shift operation can be performed based on the value derived by the width (i.e., xn3-xn2) between the bottom left control point and the bottom right control point. As in the example above, the affine seed vector of the current block can be derived from the affine seed vector of the neighboring affine block where encoding or encoding is completed. For this purpose, the affine seed vectors of the affine neighboring blocks where encoding or encoding supervision is completed must be stored in memory. However, because the affine seed vectors of the affine neighboring blocks are stored in memory in addition to the translational motion vectors (i.e., affine vectors) of the sub-blocks included in the affine neighboring blocks, there is a problem that memory usage increases. To solve this problem, the affine seed vector of the current block can be derived using the motion vector of the sub-block adjacent to the control point of the neighboring affine block as a substitute for the affine seed vector of the neighboring affine block. That is, the motion vector of the sub-block adjacent to the control point of the affine neighboring block can be designated as the affine seed vector of the affine neighboring block. Here, sub-blocks can be blocks of a predefined size or shape in the encoder and controller and can be blocks of a basic size or shape in which the motion vector is stored. For example, a sub-block could be a 4X4 square block. Alternatively, the motion vector for a particular sample location can be specified as the affine seed vector of the affine neighboring block. FIGURE 13 is a diagram showing an example of setting a sub-block motion vector as an affine seed vector from an affine neighboring block. The motion vectors of sub-blocks adjacent to control points can be assigned as affine seed vectors of the corresponding control points. As an example, as in the example shown in FIGURE 13, the motion vector (nv4x, nv4y) of the sub-block adjacent to the lower left corner (lower left sub-block) of the affine neighboring block can be designated as the affine seed vector (nv2x, nv2x) for the bottom left control point, and the motion vector (nv5x, nv5y) of the sub-block adjacent to the bottom right corner (bottom right sub-block) can be assigned as an affine seed vector (nv3x, nv3y) for the control point in the right corner lower. Here, the bottom left sub-block can refer to the sub-block that includes samples adjacent to the bottom left control point (xn2, yn2) in a neighboring affine block (for example, samples located at (xn2, yn2-1)), and The bottom right sub-block may refer to a block that includes samples adjacent to the bottom right control point (xn3, yn3) in a neighboring affine block (for example, samples located at (xn3-1, yn3-1)). When the affine seed vector of the current block is derived based on Equation 7 and Equation 8, the third affine seed vector of the neighboring affine block can be replaced by the lower left sub-block motion vector, and the fourth affine seed vector can be replaced by the lower right sub-block motion vector . In the following embodiment, the sub-block used as an affine seed vector of an affine neighboring block will be referred to as an affine sub-block. According to an embodiment of the present invention, affine sub-blocks can be determined based on samples located at specific locations. As an example, a sub-block that includes samples located at a particular location can be designated as an affine sub-block. Furthermore, samples located in certain locations will be referred to as reference samples. Additionally, the reference sample used to determine the affine sub-block for the bottom left control point will be referred to as the bottom left reference sample, and the reference sample used to determine the affine sub-block for the bottom right control point will be referred to as the bottom right reference sample. The bottom left reference sample and the bottom right reference sample can be selected from the samples included in the affine neighbor block. For example, at least one of the top left sample, bottom left sample, top right sample, or bottom left sample of the bottom left sub-block is designated as the bottom left reference sample, and at least one of the top left sample, bottom left sample, the top right sample, or the bottom left sample from the bottom right sub-block is set as the bottom right reference sample. Therefore, the motion vectors of the bottom left sub-block that includes the bottom left reference sample and the bottom right sub-block that includes the bottom right reference sample can be designated as affine seed vectors for the bottom left control point and affine seed vectors for the bottom right point, respectively. consecutive. As another example, at least one of the bottom left reference sample or the bottom right reference sample can be designated as a sample that lies outside the affine neighboring block. This will be explained in detail below with reference to FIGURE 14 to 16. FIGURES 14 to 16 are diagrams showing the location of reference samples. As in the example shown in FIGURE 14A, for the bottom left control point, the top left sample of the bottom left sub-block can be set as the reference sample (xn4, yn4). Thus, the bottom left sub-block that includes the reference samples (xn4, yn4) can be designated as an affine sub-block for the bottom left control point. For the bottom right control point, the sample located to the right of the top right sample in the bottom right sub-block can be set as the reference sample (xn5, yn5). Thus, the sub-block adjacent to the right of the bottom right sub-block that includes the reference samples (xn5, yn5) can be designated as the affine sub-block for the bottom right control point. Alternatively, as in the example shown in FIGURE 14B, for the bottom left control point, the sample located to the left of the top left sample of the bottom left sub-block can be set as the reference sample (xn4, yn4). Thus, the sub-block adjacent to the left of the bottom left sub-block that includes the reference sample (xn4, yn4) can be designated as an affine sub-block for the bottom left control point. For the bottom right control point, the top right sample of the bottom right sub-block can be set as the reference sample (xn5, yn5). Thus, the bottom right sub-block that includes the reference samples (xn5, yn5) can be designated as an affine sub-block for the bottom right control point. Alternatively, as in the example shown in FIGURE 15A, for the bottom left control point, the bottom left sample of the bottom left sub-block can be set as the reference sample (xn4, yn4). Thus, the bottom left sub-block that includes the reference samples (xn4, yn4) can be designated as an affine sub-block for the bottom left control point. For the bottom right control point, the sample located to the right of the bottom right sample in the bottom right sub-block can be set as the reference sample (xn5, yn5). Thus, the sub-block adjacent to the right of the bottom right sub-block that includes the reference samples (xn5, yn5) can be designated as the affine sub-block for the bottom right control point. Alternatively, as in the example shown in FIGURE 15B, for the bottom left control point, the sample located to the left of the bottom left sample of the bottom left sub-block can be set as the reference sample (xn4, yn4). Thus, the sub-block adjacent to the left of the bottom left sub-block that includes the reference sample (xn4, yn4) can be designated as an affine sub-block for the bottom left control point. For the bottom right control point, the bottom right sample of the bottom right sub-block can be set as the reference sample (xn5, yn5). Thus, the bottom right sub-block that includes the reference samples (xn5, yn5) can be designated as an affine sub-block for the bottom right control point. Alternatively, as in the example shown in FIGURE 16A, for the bottom left control point, the sample located between the top left sample and the bottom left sample of the bottom left sub-block (for example, the middle left sample) can be set as the reference sample (xn4, yn4). Thus, the bottom left sub-block that includes the reference samples (xn4, yn4) can be designated as an affine sub-block for the bottom left control point. For the bottom right control point, the sample located to the right of the sample located between the top right sample and the bottom right sample of the bottom right sub-block (for example, the middle right sample) can be set as the reference sample (xn5, yn5). Thus, the sub-block adjacent to the right of the bottom right sub-block that includes the reference samples (xn5, yn5) can be designated as the affine sub-block for the bottom right control point. Alternatively, as in the example shown in FIGURE 16B, for the bottom left control point, the sample located to the left of the sample located between the top left sample and the bottom left sample of the bottom left sub-block can be set as the reference sample (xn4, yn4) . Thus, the sub-block adjacent to the left of the bottom left sub-block that includes the reference sample (xn4, yn4) can be designated as an affine sub-block for the bottom left control point. For the bottom right control point, the sample located between the top right sample and the bottom right sample of the bottom right sub-block can be set as the reference sample (xn5, yn5). Thus, the bottom right sub-block that includes the reference samples (xn5, yn5) can be designated as an affine sub-block for the bottom right control point. When the affine seed vector of the current block is derived based on Equation 7 and Equation 8, the third affine seed vector of the neighboring affine block can be replaced by the affine sub-block motion vector for the bottom left control point, and the fourth affine seed vector can be replaced by the sub-block motion vector -affine block for bottom right control point. Also, the bottom left control point location can be replaced by the bottom left reference sample location, and the bottom right control point location can be replaced by the bottom right reference sample location. Unlike described above with reference to FIGURE 14 to 16, sub-blocks that include samples adjacent to the reference sample can be designated as affine sub-blocks. In detail, samples located outside the affine neighboring sub-blocks can be designated as reference samples, and sub-blocks included in the affine neighboring blocks can be designated as affine sub-blocks. For example, in the example shown in FIGURE 14A, the sample located to the right of the top right sample in the bottom right sub-block can be set as the reference sample (xn5, yn5), and the bottom right sub-block can be set as the affine sub-block for bottom right corner. Alternatively, in the example shown in FIGURE 14B, the sample located to the left of the top left sample in the bottom left sub-block can be designated as the reference sample (xn4, yn4), and the bottom left sub-block can be designated as the affine sub-block for the bottom left corner. The embodiments described above can also be applied to FIGURE 15 and 16. That is, in the examples shown in FIGURE 15A or 16A, samples located to the right of the bottom right sample or middle right samples of the bottom right sub-block can be designated as reference samples (xn5, yn5), and the bottom right sub-block can be assigned as an affine sub-block for the bottom right corner. Alternatively, in the example shown in FIGURE 15B or 16B, the sample located to the left of the bottom left sample or the middle left sample of the bottom left sub-block can be designated as the reference sample (xn4, yn4), and the bottom left sub-block can be designated as an affine sub-block for the bottom left corner. As in the example above, the affine seed vectors of neighboring affine blocks can be derived using the motion vectors of the affine sub-blocks. For this purpose, in the case of blocks where encoding or encoding supervision is completed, the motion vectors can be stored in sub-block units. As another example, once a minimum number of affine seed vectors are stored for neighboring affine blocks, the motion vectors of the affine sub-blocks can be derived using the stored affine seed vectors. Equation 9 and Equation 10 show examples of deriving motion vectors of affine sub-blocks using affine seed vectors from neighboring affine blocks. [Equation 9] (nv]x-nvnx) (»ι-'1ν- / η·Ον)m'4x---{-------U --T~----i— (y „4-.V„o)+«VOr(ην^.-ην^) «v4v--—----— (χ„4-χ,λ)-—------— (j' „4-.y»o.)+«vOv. (ΑηΓΑζΚ>)' [Equation 10]_(myx-nvOx)(nviy-nvOy) U'«1‘am0? 1Α'ηΓΛ· / ?37 (ην,,-mP (m^-nvP ..... nv5y(· t, ίΑί?5-Αη[)) z \ «5“> »0 )+ / 7VOy UXj7r.x,]0; Ι.Λ „γλ-^; In Equation 9 and Equation 10, (nv4x, nv4y) represents the affine sub-block motion vector for the bottom left control point, and (nv5x, nv5y) represents the affine sub-block motion vector for the bottom right control point. Since the affine sub-block motion vector and the affine seed vector of the control point are set to be equal to each other, (nv4x, nv4y) can be replaced by the affine seed vector (nv2x, nv2y) for the bottom left control point, and (nv5x, nv5y) can be replaced with an affine seed vector (nv3x, nv3y) for the bottom right control point. (xn4, yn4) represents the location of the reference sample with respect to the bottom left sub-block. Alternatively, the bottom left sub-block center location or bottom left control point location can be used instead. (xn5, yn5) represents the location of the reference sample with respect to the bottom right sub-block. Alternatively, the bottom right sub-block center location or bottom right control point location can be used instead. Equation 9 and Equation 10 can be applied to a case where the current block is not adjacent to the edge of the coding tree unit. When the current block is adjacent to the top edge of the coding tree unit, the translational motion vector of the affine sub-block determined based on the bottom left reference sample can be set as the third affine seed vector, and the translational motion vector of the affine sub-block determined based on the right reference sample bottom can be set as the fourth affine seed vector instead using Equation 9 and Equation 10. In Equation 7 and Equation 8, (xn3-xn2) represents the width between the bottom left control point and the bottom right control point. As explained above, xn3 can be replaced by location xn5 from the bottom right reference sample, and xn2 can be replaced by location xn4 from the bottom left reference sample. Next, (xn3-xn2) or the value (for example, (xn5-xn4)) obtained by replacing the location of the above Equation with the location of the reference sample will be defined as the variable Wseed, and this variable will be called the width of the seed subvector. Depending on the location of the reference sample, the width of the seed subvector may not be a power of 2 (for example, 2n). For example, when the bottom left sample of the bottom left sub-block is set as the bottom left reference sample and the bottom right sample of the bottom right sub-block is set as the bottom right reference sample, the width of the seed sub vector is not a multiple of 2. When the width of the sub vector seed is not a power of 2, the width of the seed subvector can be transformed to a power of 2. Transformations can include adding or subtracting offsets to or from the width of the seed subvector or using sample locations adjacent to the reference sample as a substitute for the reference sample location. As an example, the width of the transformed seed subvector can be reduced by adding one to the width between the bottom left reference sample and the bottom right reference sample. Alternatively, the width between the bottom left reference sample and the neighboring reference sample adjacent to the right of the bottom right reference sample can be defined as the width of the transformed seed subvector. Next, the affine seed vector of the current block can be derived by applying the width of the transformed seed subvector to Equation 7 and Equation 8. The division operations included in Equation 7 and Equation 8 can be converted into bit shift operations. The bit shift operation can be performed based on the value derived by the width of the transformed seed subvector (i.e., the value expressed as a power of 2). When the reference sample used to determine the affine sub-block is not included in the affine neighbor block, the affine seed vector of the affine neighbor block can be derived based on samples adjacent to the reference sample among the samples included in the affine neighbor block. Specifically, the sub-block translational motion vector that includes samples adjacent to the reference sample (hereinafter referred to as neighboring reference samples) in the affine neighbor block can be designated as the affine seed vector of the affine neighbor block. As explained above, the affine seed vector derivation method using neighboring reference samples can be defined as a modified affine joint vector derivation method. FIGURE 17 is a diagram showing an example where the modified affine joint vector derivation method is applied. When the bottom right reference sample (xn5, yn5) of the affine neighboring block E is not included in the nearby affine block, the affine seed vector can be derived based on the sample (xn5-1, yn5) that is adjacent to the left of the bottom right reference sample among the samples included in the affine neighboring block. Specifically, the sub-block translational motion vector that includes neighboring reference samples (xn5-1, yn5) can be assigned as the affine seed vector of the bottom right control point. In the example shown in FIGURE 17, it is shown that the sample adjacent to the right of the top right sample in the bottom right sub-block is the bottom right reference sample. The affine seed vector can be derived based on samples adjacent to the left of the neighboring reference sample even when samples adjacent to the right of the bottom right sample in the bottom right sub-block or samples adjacent to the right of the middle right sample in the bottom right sub-block are set as samples bottom right reference. Also, an affine seed vector can be derived based on the right adjacent samples of the bottom left reference sample according to the above embodiment even when the bottom left reference sample does not fall within the affine neighbor block. By setting the locations of the reference samples and sub-blocks differently to derive the affine seed vector, the width of the seed sub-vector can be set as a step of 2. Alternatively, an affine seed vector can be derived based on the width of neighboring blocks while the bottom left sub-block and bottom right sub-block motion vectors are used. FIGURE 18 is a diagram showing an example of deriving an affine seed vector from a candidate affine composite based on the motion vectors of sub-blocks belonging to neighboring blocks. When the top edge of the current block is adjacent to the edge of the coding tree unit, the affine seed vector of the affine merge candidate can be derived based on the motion vectors of the bottom left sub-block and bottom right sub-block of the top neighboring block located above the current block. When it is assumed that the top left sample location of the top neighbor block is (xNb, yNb) and the width and height of the top neighbor block are NbW and NbH, respectively, the bottom left sub-block can include samples located at (xNb, yNb+ yNbH-1), and the bottom right sub-block may include samples located at (xNb+NbW-1, yNb+NbH-1). The affine seed block of the affine merge candidate can be derived based on the width of neighboring blocks and the coordinate difference between the current block and neighboring blocks. As an example, the affine seed vector of affine compound candidates can be derived based on Equations 11 to 13 below. [Equation 11]νο.τ ^zat<<7+((Jakatibx)<<'(7~ 2(^(xCb-x?vb) ''c,,.-r-'zi,«7+(( r-Av-IA,)«(7-log2GViO*(.vC6-^VZ>) [Equation 12] V Lv= VI£x«7+(. ( v££x- yI£x)« (7- log2(Nb W)) * (xCb +xCb W-xNb) v ιΛ= +( ( ^HBy- ( 7- l°g ^)) * <*Cb+*Cb W-xNb) [Equation 13] 'A = JijS.v--7((1 J ΆΓ) (7 - log2(Λ'ί> J O) * (-vC0 1 ACh H '-.rW) !(.( / i^. · 1·'^· --(7- log2(.V0 JH) *xCbJ / 'A J^ / 7<7+((r-'w- / -^p<<(7-lngAArAJ^)*(- TCA+A<'AH'-i.vAj+(<r22lA.-i-'Jute)K<(7.1og2(.VAH0)*x(?AA / In Equations 11 to 13, (v0x, v0y) represents the first affine seed vector, (v1x, v1y) represents the second affine seed vector, and (v2x, v2y) represents the third affine seed vector. VLBx represents the motion vector of the horizontal component of the bottom left sub-block, and VLBy represents the motion vector of the vertical component of the bottom left sub-block. VRBx represents the motion vector of the horizontal component of the bottom right sub-block, and VRBy represents the motion vector of the vertical component of the bottom right sub-block. NbW represents the width of the neighboring block, and xCbW and xCbH represent the width and height of the current block, respectively. xCb represents the x-coordinate of the top-left sample of the current block, and xNb represents the x-coordinate of the top-left sample of the neighboring block. An affine join candidate can be generated to combine the motion vector of the second neighboring block with the affine seed vector derived from the first neighboring block. For example, in the example shown in FIGURE 18, the third affine seed vector of a candidate affine merge can be derived based on the motion vector of the sub-block located to the left of the current block instead of based on the motion vector of the bottom left sub-block and the bottom right sub-block. FIGURE 19 is a diagram showing an example of deriving an affine seed vector from a candidate affine compound based on the sub-block motion vector located to the left of the current block. The affine seed vector of the affine merge candidate can be derived based on the motion vectors of the bottom left sub-block and bottom right sub-block of the top neighboring block located above the current block. In detail, the first affine seed vector and the second affine seed vector of the affine compound candidate can be derived based on the motion vectors of the lower left sub-block and the lower right sub-block. As an example, the first affine seed vector and the second affine seed vector of affine composite candidates can be derived based on Equations 11 and 12. The third affine seed vector of the affine merge candidate can be derived based on the motion vector of the neighboring block adjacent to the left of the current block. As an example, the motion vector of the neighboring block adjacent to the left of the current block or the neighboring block adjacent to the bottom left corner of the current block can be designated as a third affine seed vector. Neighboring blocks adjacent to the left of the current block can include samples located at (xCb-1, yCb+CbH-1), and neighboring blocks adjacent to the bottom left corner of the current block can include samples located at (xCb-1, yCb+CbH). Equation 14 and Equation 15 show an example of setting the motion vector of a neighboring block located to the left of the current block as a third affine seed vector. [Equation 14]vZx VLeftx b'2y I Lefty [Equation 15]V2x ^lBxV2y=^IBy In Equation 14, VLeftx represents the horizontal motion vector of neighboring blocks adjacent to the left of the current block, and VLefty represents the vertical motion vector of neighboring blocks adjacent to the left of the current block. In Equation 15, VLBx represents the horizontal motion vector of the neighboring block adjacent to the lower left corner of the current block, and VLBy represents the vertical motion vector of the neighboring block adjacent to the lower left corner of the current block. The third affine seed vector can be derived using the motion vector of the neighboring block adjacent to the bottom left corner of the current block only when the motion vector of the neighboring block adjacent to the left of the current block is not available. The method of deriving the third affine seed vector from a candidate affine merge can be specified differently depending on whether the motion vector of a neighboring block located to the left of the current block is available. For example, when the motion vector of a neighboring block located to the left of the current block (for example, a sub-block adjacent to the left of the current block or a sub-block adjacent to the bottom left corner of the current block) is available, a third affine seed vector can derived using Equation 14 or Equation 15. On the other hand, when the motion vector of a neighboring block located to the left of the current block is not available, a third affine seed vector can be derived using Equation 13. A third affine seed vector can be derived based on the motion vector of non-neighboring blocks that have reference samples that are not adjacent to the current block. To derive the third affine seed vector, whether to use the motion vector of a neighboring block which has a reference sample adjacent to the current block or to use the motion vector of a non-neighbor block which has a reference sample not adjacent to the current block can be determined based on the location of the top neighboring block which is used to derive candidate affine compounds. FIGURE 20 is a diagram that shows an example of deriving an affine seed vector from affine combination candidates based on motion information of neighboring blocks or non-neighboring blocks located to the left of the current block. By comparing the top left sample location of the current block to the top left sample location of the top neighboring block used to derive the affine compound candidate, the block location for deriving the third affine seed vector can be determined. For example, as in the example shown in FIGURE 20A, when the x-coordinate (xNb) of the top left sample of the top neighboring block is smaller than the x-coordinate (xCb) of the top left sample of the current block, the third affine seed vector can be derived based on the vector move non-neighboring blocks that are not adjacent to the left of the current block. In detail, the third affine seed vector can be derived based on the motion vector of the lower left non-neighbor block which includes samples located at (xNb, yCb+CbH) or the left non-neighbor block which includes samples located at (xNb, yCb+CbH-1) , where the samples have the same x-coordinate as the top left sample of the top neighboring block. Equation 16 and Equation 17 show an example of deriving a third affine seed vector based on the motion vectors of non-neighboring blocks. [Equation 16]V2x- LefVxV2>=I' leffly [Equation 17] V2, VM, V2y T I.P,2y In Equation 16, VLeft2x represents the horizontal motion vector of the left non-neighbor block, and VLeft2y represents the vertical motion vector of the left non-neighbor block. In Equation 17, VLB2x represents the horizontal motion vector of the bottom left non-neighbor block, and VLB2y represents the vertical motion vector of the bottom left non-neighbor block. The third affine seed vector can be derived using the bottom left non-neighbor block motion vector only when the left non-neighbor block motion vector is not available. As in the example shown in FIGURE 20B, when the x-coordinate (xNb) of the top left sample of the top neighboring block is greater than or equal to the x-coordinate (xCb) of the top left sample of the current block, the third affine seed vector can be derived based on motion vector of neighboring blocks adjacent to the bottom left corner or to the left of the current block. In detail, the third affine seed vector can be derived based on the motion vector of the left neighbor block which includes samples (xCb, yCb+CbH-1) which are adjacent to the left of the current block or the bottom left neighbor block which includes samples located on (xCb, yCb+ CbH) adjacent to the bottom left corner of the current block. The location of the reference sample of the left neighbor block or the left non-neighbor block can be specified differently from that shown in FIGURE 18 to 20. For example, a block that includes samples (xCb-1, yCb+subH-1) adjacent to the current block can is designated as the left neighbor block, and blocks that include samples (xNb, yCb+subH-1) that are not adjacent to the current block can be designated as left non-neighbor blocks. Here, subH represents the minimum height of a block where motion information is stored and may be a natural number such as 2, 4 or 8. FIGURE 21 is a diagram showing the location of a block for deriving an affine seed vector from affine compound candidates. For example, as in the example shown in FIGURE 21A, when the x-coordinate (xNb) of the top left sample of the top neighboring block is smaller than the x-coordinate (xCb) of the top left sample of the current block, the third affine seed vector can be derived based on the vector move non-neighboring blocks that are not adjacent to the left of the current block. In detail, the third affine seed vector can be derived based on the motion vector of the left non-neighbor block which includes samples (xNb, yCb+subH-1) which have the same x-coordinate as the top left sample of the top neighbor block and which are located a predetermined distance (for example, subH) from the bottom left sample of the top neighbor block. Equation 18 shows an example of deriving a third affine seed vector based on the motion vectors of non-neighboring blocks. [Equation 18]V2.v f ^2 y f l.pft'il.y In Equation 18, VLeftT2x represents the horizontal motion vector of the left non-neighbor block which includes samples that are a predetermined distance from the bottom left sample of the top neighbor block. VLeftT2y represents the vertical motion vector of the left non-neighbor block which includes samples that are a predetermined distance from the bottom left sample of the top neighbor block. Alternatively, as in the example shown in FIGURE 21B, when the x-coordinate (xNb) of the top left sample of the top neighboring block is greater than or equal to the x-coordinate (xCb) of the top left sample of the current block, the third affine seed vector can be derived based on the motion vector of the left neighboring block which is adjacent to the left of the current block and which includes samples (xCb-1, yCb+subH-1) that are horizontally spaced a predetermined distance (for example, subH-1) from the top left sample current block. Equation 19 shows an example of deriving a third affine seed vector based on the motion vectors of neighboring blocks. [Equation 19] 'A iZItflTx Ί ι 't' leftTy In Equation 19, VLeftTx represents the horizontal motion vector of the left neighbor block that is adjacent to the left of the current block and that includes samples spaced vertically a predetermined distance from the top left sample of the current block. VLeftTy represents the vertical motion vector of the left neighboring block that is adjacent to the left of the current block and that includes samples spaced vertically a predetermined distance from the top left sample of the current block. Alternatively, the reference sample can be set at a different location than shown in FIGURE 18 to 21. For example, a sample (xCb-1, yCb) that is adjacent to the left of the current block and that has the same y-coordinate as the left sample top of the current block or samples (xNb, yCb) that are not adjacent to the left of the current block and that have the same y-coordinate as the top left sample of the current block can be set as reference samples. As in the example described, the first affine seed vector and the second affine seed vector of an affine merge candidate can be derived from a neighboring block located above the current block, and a third affine seed vector of an affine merge candidate can be derived from a neighboring block located to the left current block. The first affine seed vector and third affine seed vector of the affine merge candidate can be derived from a neighboring block located to the left of the current block, and the second affine seed vector of the affine merge candidate can be derived from a neighboring block located above the current block. In the examples shown in Equations 11 to 13, the affine seed vector of the candidate affine union can be derived based on the difference value between the VLB motion vector of the bottom left sub-block of the top neighbor block and the VRB motion vector of the bottom right sub-block of the top neighbor block . In this case, the affine seed vector of the candidate affine union can be derived using the motion vector of another block instead of the motion vector of the bottom left sub-block or bottom right sub-block. For example, when the motion vector VLB of the bottom left sub-block of the top neighbor block has the same value as the motion vector VRB of the bottom right sub-block of the top neighbor block, the VRB can be replaced by the motion vector of a block that includes samples located to the right or under the bottom right sub-block. As an example, the motion vector of an affine composite candidate can be derived using the motion vector of a block that includes samples located at (xNb+NbW, yNb+NbH-1) instead of using the VRB motion vector of the bottom right sub-block. Alternatively, when the VLB motion vector of the bottom left sub-block of the top neighboring block has the same value as the VRB motion vector of the bottom right sub-block of the top neighbor block, the VLB can be replaced by the motion vector of a block that includes samples located to the left or under the bottom left sub-block. As an example, the motion vector of an affine compound candidate can be derived using the motion vector of a block that includes samples located at (xNb, yNb+NbH-1+offset) instead of using the VLB motion vector of the bottom left sub-block. Here, the offset can be an integer greater than or equal to 1. Alternatively, VRB can be replaced by the motion vector of a block that includes samples located to the left or below the bottom left sub-block, or VLB can be replaced by the motion vector of a block that includes samples located to the right or below the right sub-block lower. A combined candidate can be derived by combining the motion vectors of a number of neighboring vectors adjacent to the current block. The combined candidate produced by combining the motion vectors of a number of neighboring vectors can be called a combined combined candidate. When the merged compound candidate is derived, the affine seed vector for the control point can be derived from one neighboring block adjacent to the control point's surroundings. FIGURE 22 is a diagram to explain an example of combining the motion vectors of a number of neighboring blocks to derive a merged candidate. A plurality of neighboring blocks may include a top neighboring block located above the current block and a left neighboring block located to the left of the current block. The top neighboring blocks can include at least one of block B0 which includes the sample located at (xCb+CbW, yCb-1), block B1 which includes the sample located at (xCb+CbW-1, yCb- 1), or block B3 which includes samples located at (xCb, yCb-1). Here, (xCb, yCb) represents the top left sample location of the current block, and CbW represents the width of the current block. The left neighbor block can include at least one of block A0 which includes samples located at (xCb-1, yCb+CbH), block A1 which includes samples located at (xCb-1, yCb+CbH-1), or block A2 which includes samples located at (xCb-1, yCb). Here, CbH represents the current block height. Also, a further number of neighboring blocks may include temporary neighboring blocks of the current block. The merged composite candidate can be derived by combining the motion information fragments of two or more from a plurality of neighboring blocks. The merged compound candidate can be derived by combining the motion information fragments of two or three neighboring blocks. In detail, a combined candidate can be derived by combining at least two or more motion information of neighboring blocks adjacent to the first control point, motion information of neighboring blocks adjacent to the second control point, or motion information of neighboring blocks adjacent to the third control point. For example, a merged composite candidate can be derived by combining the motion vectors of at least two or more neighboring blocks A2, B2, or B3 adjacent to the top-left control point CP0, neighboring blocks B1 or B0 adjacent to the top-right control point CP1 , or a temporary neighbor block T for the lower left control point CP2. In this case, the motion vector of the available neighboring blocks found first when the neighboring blocks adjacent to the control point are scanned in a predefined scan sequence can be assigned as the affine seed vector for the control point. As an example, the first affine seed vector of the merged compound candidate for CP0 can be defined as the motion vector of the first available neighboring block discovered when the neighboring blocks are discovered in the sequence B2, B3, and A2. The second affine seed vector of the merged candidate compound for CP1 can be set as the motion vector of the available neighbor block found first when the neighbor blocks are found in sequence B1 and B0. The third affine seed vector of the merged compound candidate for CP2 can be set as the motion vector of the available neighboring block that is found first when the neighboring blocks are discovered in the sequence A1 and A0. When a merged joint candidate is derived, neighboring blocks encoded with the affine motion model or neighboring blocks derived as affine combined candidates may be set as unavailable. FIGURE 23 is a diagram showing unavailable neighboring blocks. When an affine merge candidate is derived from a neighboring block B1 located above the current block, it can be determined that the neighboring block B1 is not available to derive the merged merge candidate. Thus, when the affine seed vector of the merged candidate compound for CP1 is derived, the motion vector B1 cannot be used. Alternatively, when neighboring blocks are encoded in the affine motion model, a merged joint candidate can be derived based on the sub-block affine vector that includes the reference sample. As an example, when a neighboring block that includes a sample located on B1 is encoded in an affine motion model, the merged composite candidate can be derived using the sub-block affine vector of the neighboring block that includes a sample located on B1. Alternatively, the scan order can be determined by considering whether neighboring blocks are encoded with an affine motion model or whether neighboring blocks are derived as affine fusion candidates. For example, neighboring blocks encoded with affine motion models or neighboring blocks encoded with affine compound candidates may be assigned to be scanned last. As an example, when the neighboring block located in B1 is encoded with an affine motion model, the second affine seed vector of the merged compound candidate for CP2 can be derived by finding the neighboring blocks in the sequence B0 and B1. When neighboring blocks have different reference image indices, the motion vector can be scaled with respect to the reference image with the largest index or the reference image with the smallest index. Scaling can be done based on the image sequence count (POC) difference value between the reference image and the current image. Alternatively, a combination of neighboring blocks can be performed using only neighboring blocks that have the same reference image index among neighboring blocks. For example, when at least one of the neighboring blocks has a different index of the reference image, the combination may be determined to be unavailable as a merged compound candidate. Also, the availability of combinations can be determined regardless of whether neighboring blocks have the same motion information or motion vectors. As an example, a merged composite candidate can be derived by merging neighboring blocks that have the same reference image index even when the neighboring blocks have the same motion vector (e.g., affine seed vector CP0 and affine seed vector CP1). Alternatively, the scan order of neighboring blocks can be determined by considering the reference image indices of neighboring blocks. Alternatively, the combination can be performed using only neighboring blocks that have the same predicted direction among neighboring blocks. Combined candidates can be generated in a predefined combination order. As an example, the combination order can be defined as follows. 1. {CP0 affine seed vector, CP1 affine seed vector, CP2 affine seed vector} 2. {CP0 affine seed vector, CP1 affine seed vector, CP3 affine seed vector} 3. {CP0 affine seed vector, CP2 affine seed vector, CP3 affine seed vector} 4. {CP1 affine seed vector, CP2 affine seed vector, CP3 affine seed vector} 5. {CP0 affine seed vector, CP1 affine seed vector} 6. {CP0 affine seed vector, CP2 affine seed vector} Although six combination examples are shown, it is also possible to use fewer or more combination examples. The merged merge candidate generated by combining three affine seed vectors can be called a merged 6-parameter merge candidate, and the merged merge candidate generated by combining two affine seed vectors can be called a merged 4-parameter merge candidate. The order of combinations can be predefined in the encoder and controller. Alternatively, the combination order may be determined based on at least one of the size, shape, partition form, or affine motion model of the current block, the current location of the block in the coding unit tree, or the POC of the reference image. For example, when a 4-parameter affine motion model is applied to the current block, settings can be made such that combination examples for the merged 4-parameter compound candidate have higher priority than combination examples for the 6-parameter merge candidate combined parameters. Even if the merged merge candidates are generated in combination order, only the merged candidates generated by merging neighboring blocks that have the same reference image can be determined to be available. Alternatively, when at least one of the neighboring blocks has a different reference image, the motion vector can be scaled with respect to the reference image with the largest index or the reference image with the smallest index to derive a composite candidate. Scaling can be done based on the POC difference between the reference image and the current image. Alternatively, when two neighboring blocks have the same reference image and another neighboring block has a different reference image, the motion vector of the neighboring blocks having different reference images can be scaled with respect to the reference image applied in common to the two neighboring blocks to obtain a combined candidate which is combined. The number of combined combined candidates added to the combined candidate list may be determined based on at least one of the maximum number of combined candidates or the number of previous combined candidates included in the combined candidate list. Alternatively, depending on the affine motion model of the current block, only merged 6-parameter compound candidates can be added to the merged candidate list, or only merged 4-parameter compound candidates can be added to the merged merged candidate list. For example, when the number of merging compound candidates to be added to the merge candidate list is one and a 6-parameter motion model is applied to the current block, one merged 6-parameter compound candidate can be added to the merge candidate list in the initial fixed combination order. In detail, when all CP0 affine seed vectors, CP1 affine seed vectors, and CP2 affine seed vectors are available, the merged candidates {CP0 affine seed vector, CP1 affine seed vector, and CP2 affine seed vector} can be added to the list of combined candidates. Alternatively, when the CP2 affine seed vector is not available and the CP3 affine seed vector is available, the merged candidate combinations {CP0 affine seed vector, CP1 affine seed vector, and CP3 affine seed vector} can be added to the list of combined candidates. Alternatively, when the number of merged joint candidates to be added to the combined candidate list is one and a 6-parameter motion model is applied to the current block, one merged 4-parameter combined candidate can be added to the combined candidate list in the initial fixed combination order. As another example, the number of merge candidates to be added to the list of merge candidates may be set differently depending on the block's current affine motion model. For example, when a 6-parameter motion model is applied to the current block, one merge candidate can be added to the list of merge candidates. On the other hand, when the 4-parameter motion model is applied to the current block, the two merged joint candidates can be added to the list of combined candidates. The affine fusion candidates to be added to the merge candidate list can be selected depending on the number of available affine fusion candidates. For example, when the number of available affine fusion candidates is two or more, any number of merged 4-parameter compound candidates can be added to the list of compound candidates. On the other hand, when the number of available affine fusion candidates is one or less, only the merged 6-parameter compound candidates can be added to the list of merge candidates. Alternatively, when the number of available affine fusion candidates is one or less, N merging 6-parameter fusion candidates and M merging 4-parameter fusion candidates can be added to the list of merge candidates. Here, N and M are natural numbers, and M can be derived based on the maximum number of affine compound candidates minus N. Alternatively, when the number of available affine compound candidates is one or less, only the 4-parameter merged candidates can be added to combined candidate list. Alternatively, the combination order can be determined based on the availability of affine seed vectors. As an example, the merged candidate pools can be added to the list of merged candidates by considering the availability of affine seed vectors in the following order. 1. Cases where CP0 affine seed vector, CP1 affine seed vector, and CP2 affine seed vector are available {CP0 affine seed vector, CP1 affine seed vector, CP2 affine seed vector} 2. Cases where CP0 affine seed vector, CP1 affine seed vector, and CP3 affine seed vector are available {CP0 affine seed vector, CP1 affine seed vector, CP3 affine seed vector} 3. Cases where CP0 affine seed vector, CP2 affine seed vector, and CP3 affine seed vector are available {CP0 affine seed vector, CP2 affine seed vector, CP3 affine seed vector} 4. Cases where CP0 affine seed vector, CP2 affine seed vector, and CP3 affine seed vector are available {CP1 affine seed vector, CP2 affine seed vector, CP3 affine seed vector} 5. Cases where both CP0 affine seed vector and CP1 affine seed vector are available {CP0 affine seed vector, CP1 affine seed vector} 6. Cases where both CP0 affine seed vector and CP2 affine seed vector are available {CP0 affine seed vector, CP2 affine seed vector} When the number of combined combined candidates to be added to the combined candidate list is one, the combined combined candidate that meets the first of the first through sixth conditions may be added to the combined candidate list. When none of the first through sixth candidates are satisfied, no combined combined candidates can be added to the combined candidate list. As another example, the maximum number of affine fusion candidates to be added to a list of affine fusion candidates can be determined depending on the number of available affine fusion candidates. When the number of joint candidates included in the joint candidate list is smaller than the maximum number, zero joint candidates, which have a motion vector of 0, can be added to the joint candidate list. Thus, the fusion candidates can be derived in affine fusion mode in the following order. 1. Decrease in Afin Joint Candidates 2. Combined Combined Candidates 3. Zero Joint Candidate Next, the inter-prediction method using translational motion information will be explained in detail below. The motion information of the current block can be derived from the motion information of a block other than the current block. Here, another block can be an encoded or watchworded block via inter-prediction earlier than the current block. Setting the motion information of the current block to be the same as the motion information of other blocks can be defined as combined mode. Also, setting the motion vector of another block as the value of the current block's predicted motion vector can be defined as the motion vector prediction mode. FIGURE 24 is a flowchart of the current block motion information derivation process in combined mode. The current block merge candidate can be derived (S2401). The current block's combined candidate can be derived from an encoded or encoded block through earlier inter-prediction of the current block. The candidate blocks used to derive the combined block may include neighboring blocks that include samples adjacent to the current block. For example, when the top left sample coordinate of the current block is (0, 0), at least one of the blocks includes the reference sample located at (-1, H-1), the block includes the reference sample located at (-1, H-1). W-1, -1), a block that includes a reference sample located at (W, -1), a block that includes a reference sample located at (-1, H), or a block that includes a reference sample located at (-1 , -1) can be used as candidate blocks. Alternatively, candidate blocks that do not belong to the same coding tree unit as the current block can be designated as unavailable as merge candidates. For example, when the reference sample deviates from the top edge of the coding tree unit included in the current block, the candidate block that includes the reference sample may be determined to be unavailable as a merge candidate. Merge candidates can be derived from temporary neighboring blocks included in an image that is different from the current block image. As an example, a composite candidate may be derived from the collocated blocks included in the collocated image. One reference image included in the reference image list can be designated as a collocated image. An information index for identifying collocated images among reference images can be signaled in a bit stream. Alternatively, a reference image that has a predefined index between the reference images can be defined as a collocated image. The motion information of the combined candidate can be set to be the same as the motion information of the candidate block. For example, at least one of the motion vector, reference image index, prediction direction, or bidirectional weight index of the candidate block may be designated as combined candidate motion information. A combined candidate list that includes combined candidates can be generated (S2402). Indexes can be assigned to merge candidates from a list of merge candidates in a predefined order. For example, the indices can be sequentially assigned to a merge candidate derived from the left neighboring block, a merge candidate derived from the top neighbor block, a merge candidate derived from the top-right neighbor block, a merge candidate derived from the bottom-left neighbor block , a merge candidate derived from the upper left neighbor block, and a merge candidate derived from the temporary neighbor block. When a plurality of joint candidates is included in a joint candidate, at least one of the plurality of joint candidates can be selected (S2403). In detail, information to determine one of a number of combined candidates can be signaled in a bit stream. For example, merge_idx information, which indicates the index of one of the merge candidates included in the merge candidate list may be signaled in a bit stream. When the number of joint candidates included in the joint candidate list is smaller than the threshold value, the joint candidates included in the inter-region motion information table can be added to the joint candidate list. Here, the threshold value can be the maximum number of joint candidates that the joint candidates can cover or the value obtained by subtracting the offset from the maximum number of joint candidates. The offset can be a natural number such as 1 or 2. The inter-region motion information table can include compound candidates derived based on blocks encoded or encoded earlier than the current block. The inter-region motion information table includes combined candidates derived from encoded or supervised blocks based on inter-predictions in the current image. For example, the combined candidate motion information included in the inter-region motion information table can be set to be the same as the encoded or encoded block motion information based on inter-prediction. Here, the motion information may include at least one of a motion vector, a reference image index, a predicted direction, or a bidirectional weight index. For ease of description, the joint candidates included in the inter-region motion information table will be referred to as inter-region joint candidates. The maximum number of compound candidates that can be included in the inter-region motion information table can be predefined in the encoder and supervisordi. For example, the maximum number of joint candidates that can be included in an inter-region motion information table may be 1, 2, 3, 4, 5, 6, 7, 8, or more (for example, 16). Alternatively, information indicating the maximum number of combined candidates from the inter-region motion information table may be signaled in a bit stream. Information can be signaled at the circuit, image, or slice level. Alternatively, the maximum number of joint candidates from the inter-region motion information table can be determined depending on the image size, slice size, or coding tree unit size. The inter-region motion information table can be initialized in image units, slices, bricks, coding tree units, or coding tree unit lines (rows and columns). For example, when a slice is initialized, the inter-region motion information table is also initialized and must not include join candidates. Alternatively, information indicating whether to initialize an inter-region motion information table may be signaled in a bit stream. Information can be signaled at the slice, tile, brick, or block level. The previously configured inter-region motion information table can be used until the information indicates the initialization of the inter-region motion information table. Alternatively, information about initial inter-region fusion candidates can be signaled via image parameter sets or slice headers. Even though the slice is initialized, the inter-region motion information table may include initial inter-region join candidates. Therefore, an inter-region join candidate can be used for a block to be encoded or encoded first in the slice. Blocks may be encoded or encoded in an encoding or encoding sequence, and blocks encoded or encoded based on sequential inter-prediction may be designated as inter-region combination candidates in an encoding or encoding sequence. FIGURE 25 is a diagram to explain aspects of updating the inter-regional movement information table. When inter-prediction is performed on the current block (S2501), a combined inter-region candidate can be derived based on the current block (S2502). The combined candidate motion information between regions can be set to be equal to the motion information of the current block. When the inter-region motion information table is empty (S2503), the inter-region join candidates derived based on the current block can be added to the inter-region motion information table (S2504). When the inter-region motion information table already includes inter-region join candidates (S2503), a redundancy check can be performed on the current block's motion information (or inter-region join candidates derived based on the motion information) (S2505). The redundancy check is to determine whether the motion information of the current block is the same as the combined inter-region candidate motion information stored previously in the inter-region motion information table. Redundancy checks can be performed on all inter-region join candidates previously stored in the inter-region motion information table. Alternatively, a redundancy check can be performed on candidate inter-region joins that have indices greater than or equal to the threshold value or indices less than or equal to the threshold value among candidate inter-region joins previously stored in in the inter-regional movement information table. When no inter-prediction joint candidates that have the same motion information as the current block are included, the inter-region joint candidates derived based on the current block can be added to the inter-region motion information table (S2508). Whether the inter-prediction joint candidates are identical can be determined based on whether the inter-prediction joint candidates have the same motion information (e.g., motion vectors and / or reference image indices). In this case, when the maximum number of inter-region join candidates is pre-stored in the inter-region motion information table (S2506), the oldest inter-region join candidate is selected (S2507), and the derived inter-region join candidate based on the current block can added to the inter-regional movement information table (S2508). Combined candidates between regions can be identified by their indices. When the inter-region join candidate derived from the current block is added to the inter-region motion information table, the lowest index (for example, 0) is assigned to the inter-region join candidate, and the indexes of the inter-region join candidates that have been saved can be increased by one. In this case, when the maximum number of inter-prediction joint candidates is pre-stored in the inter-region motion information table, the inter-region joint candidate with the largest index is eliminated. Alternatively, when the inter-region join candidate derived from the current block is added to the inter-region motion information table, the largest index can be assigned to the inter-region join candidate. For example, when the number of inter-prediction joint candidates previously stored in the inter-region motion information table is smaller than the maximum value, an index having a value equal to the number of pre-stored inter-prediction joint candidates can be assigned to the inter-regional joint candidate region. Alternatively, when the number of inter-prediction joint candidates previously stored in the inter-region motion information table equals the maximum value, the index having the maximum value minus 1 can be assigned to the inter-region joint candidate. Also, the inter-region join candidate with the smallest index is removed, and the other saved inter-region join candidate indices are reduced by 1. FIGURE 2 6 is a diagram showing aspects of updating the inter-region combined candidate table. Since the inter-region join candidate derived from the current block is added to the inter-region join candidate table, it is assumed that the largest index is assigned to the inter-region join candidate. Also, it is assumed that the maximum number of inter-region join candidates is stored in the inter-region join candidate table. When the inter-region join candidate HmvpCand[n+1], which is derived from the current block, is added to the inter-region join candidate table HmvpCandList, the inter-region join candidate HmvpCand[0], which has the smallest index among the inter-region join candidates saved regions can be deleted, and other inter-region composite candidate indices can be reduced by 1. Also, the inter-region composite candidate index HmvpCand[n+1], derived from the current block, can be set as the maximum value (n in the example shown in FIGURE 26). When an inter-region join candidate that is identical to the inter-region join candidate derived based on the current block is previously stored (S2505), the derived inter-region join candidate based on the current block cannot be added to the inter-region motion information table (S2509) . Alternatively, when the inter-region join candidates derived based on the current block are added to the inter-region motion information table, the stored inter-region join candidates that are identical to the inter-region join candidates can be removed. This causes the same effect as updating already stored cross-region composite candidate indices. FIGURE 27 is a diagram showing an example where a saved inter-region combined candidate index is updated. When a previously stored combined candidate inter-prediction index that is identical to the inter-region combined candidate mvCand, derived based on the current block, is hIdx, the previously stored combined candidate inter-prediction can be deleted, and the combined candidate inter-prediction indices larger than hIdx can be reduced by 1. As an example, it is shown in FIGURE 27 that HmvpCand[2], which is identical to mvCand, is removed from the interregional motion information table HvmpCandList, and that the indices HmvpCand[3] through HmvpCand[n ] is decreased by 1. Also, the inter-region join candidate mvCand, derived based on the current block, can be added to the end of the inter-region motion information table. Alternatively, an index assigned to a stored inter-region join candidate that is identical to the m derived inter-region join candidate based on the current block can be updated. For example, a saved cross-region combined candidate index can be changed to a minimum value or a maximum value. An arrangement can be made such that block motion information included in a defined region is not added to the inter-region motion information table. For example, an inter-region composite candidate derived based on block motion information included in the composite processing region cannot be added to the inter-region motion information table. Since the order of encoding or encoding supervision is not specified for the blocks included in the combined processing area, it is not appropriate to use the motion information of one of the blocks to perform inter-prediction on other blocks. Therefore, the inter-region joint candidates derived based on the blocks included in the joint processing region cannot be added to the inter-region motion information table. When motion compensation prediction is performed in sub-block units, inter-region composite candidates can be derived based on representative sub-block motion information among a plurality of sub-blocks included in the current block. For example, when a combined candidate sub-block is used for the current block, the inter-region combined candidate can be derived based on the representative sub-block motion information between the sub-blocks. The sub-block motion vectors can be derived in the following order. First, one joint candidate can be selected from among the joint candidates included in the current block's list of joint candidates, and an initial shift vector shVector can be derived based on the selected joint candidate's motion vector. Then, sub-block shifts that have a reference sample located at (xColSb, yColSb) can be derived by adding the initial shift vector to the location (xSb, ySb) of the reference sample (for example, the top left sample or the middle sample) in each sub-block in the coding block. Equation 2 0 below shows the equation to obtain the shift sub-block. [Equation 20] {x( 'o / Sb,y( ol$b)~(xSb+shlrector[0]»4.ySh+shlzec / or[l]»4) Then, the collocated block motion vector corresponding to the center position of the encompassing sub-block (xColSb, yColSb) can be designated as the motion vector of the encompassing sub-block (xSb, ySb). The representative sub-block can refer to the sub-block that includes the top left sample or the middle sample of the current block. FIGURE 28 is a diagram showing the location of representative sub-blocks. FIGURE 28A shows an example where the sub-block located to the left of and above the current block is designated as the representative sub-block, and FIGURE 28B shows an example where the sub-block located in the middle of the current block is designated as the representative sub-block represent. When motion compensation prediction is performed in sub-block units, a combined inter-region candidate of the current block can be derived based on the motion vector of the sub-block covering the top left sample of the current block or the sub-block covering the middle sample of the current block. Whether to use the current block as an inter-region join candidate can also be determined based on the current block's inter-prediction mode. For example, blocks encoded or encoded based on an affine motion model may be determined to be unavailable as candidates for inter-regional fusion. Therefore, even though the current block is encoded or pre-encoded through inter-prediction, the inter-prediction table motion information cannot be updated based on the current block when the inter-prediction mode of the current block is affine prediction mode. Alternatively, a candidate inter-region join can be derived based on the sub-block vector of at least one sub-block included in the encoded or encoded block based on the affine motion model. As an example, an inter-regional join candidate can be derived using a sub-block located in the top left corner of the current block, a sub-block located in the middle of the current block, or a sub-block located in the top right corner of the current block. Alternatively, the average sub-block vector of a number of sub-blocks can be defined as a joint inter-region candidate motion vector. Alternatively, candidate inter-region composites can be derived based on the average affine seed vector of encoded or encoded blocks based on the affine motion model. For example, the average of at least one of the first affine seed vectors, second affine seed vectors, or third affine seed vectors in the current block may be designated as an inter-region combined candidate motion vector. Alternatively, an inter-region motion information table can be configured for each inter-prediction mode. For example, at least one of an inter-region motion information table for an encoded or encoded block with an intra-block copy, an inter-region motion information table for an encoded or encoded block based on a translational motion model, or an inter-region motion information table for encoded or supervised blocks based on the affine motion model can be determined. One of a number of inter-region motion information tables can be selected according to the inter-prediction mode of the current block. FIGURE 29 shows an example where an inter-regional motion information table is generated for each inter-prediction mode. When a block is encoded or supercoded based on a non-affine motion model, the inter-region join candidate mvCand, derived based on the block, can be added to the inter-region non-affine motion information table HmvpCandList. On the other hand, when blocks are encoded or supercoded based on an affine motion model, the inter-region join candidate mvAfCand, which is derived based on the block, can be added to the inter-region affine motion information table HmvpAfCandList. The affine seed vector of the block can be stored in an inter-region fusion candidate derived from the encoded or encoded block based on the affine motion model. Therefore, the inter-region merge candidate can be used as a merge candidate to derive the affine seed vector of the current block. Additional inter-region motion information tables can be defined in addition to the inter-region motion information tables described above. In addition to the inter-regional motion information table described above (hereinafter referred to as the first inter-regional motion information table), a long-term motion information table (hereinafter referred to as the second inter-regional motion information table) can be defined. Here, the long-term motion information table includes long-term joint candidates. When both the first inter-region motion information table and the second inter-region motion information table are empty, preferred inter-region composite candidates can be added to the second inter-region motion information table. Until the number of inter-region join candidates allowed for the second inter-region motion information table reaches the maximum number, inter-region join candidates cannot be added to the first inter-region motion information table. Alternatively, one combined candidate inter-prediction can be added to both the first inter-region motion information table and the second inter-region motion information table. In this case, the second inter-region motion information table for which the configuration was completed is no longer capable of updating. Alternatively, when the monitored region is greater than or equal to a predetermined proportion of the slice, a second inter-region motion information table can be updated. Alternatively, a second inter-region motion information table can be updated every N lines of the coding tree unit. On the other hand, the first inter-region motion information table can be updated whenever blocks encoded or encoded through inter-prediction are generated. However, settings can be made such that the inter-region join candidates added to the second inter-region motion information table are not used to update the first inter-region motion information table. Information for selecting either a first inter-region motion information table or a second inter-region motion information table may be signaled in the bit stream. When the number of joint candidates included in the joint candidate list is smaller than a threshold value, the joint candidates included in the inter-region motion information table indicated by the information can be added to the joint candidate list. Alternatively, the inter-region motion information table can be selected based on the size, shape, or inter-prediction mode of the current block, the presence of bidirectional predictions, the presence of motion vector smoothing, or the presence of triangular partitioning. Alternatively, when the number of joint candidates included in the joint candidate list is less than the maximum joint number even though the inter-region joint candidates included in the inter-region motion information table are first added to the joint candidate list, the inter-region joint candidates included in a second inter-regional motion information table can be added to the combined candidate list. FIGURE 30 is a diagram showing an example where inter-region joint candidates included in the long-term motion information table are added to the list of joint candidates. When the number of join candidates included in the join candidate list is smaller than the maximum number, the inter-region join candidates included in the first inter-region motion information table HmvpCandList can be added to the join candidate list. When the number of joint candidates included in the joint candidate list is smaller than the maximum number even though the inter-region joint candidates included in the inter-region movement information table are first added to the joint candidate list, the inter-region joint candidates included in the term movement information table length HmvpLTCandList can be added to the combined candidate list. Table 1 shows the process of adding inter-region joint candidates included in the long-term motion information table to the list of joint candidates. [Table 1] For each candidate in HMVPCandList with index HMVPLTIdx = 1..numHMVPLTCand, the following sequential steps are repeated until combStop equals true - sameMotion is set to FALSE - If hmvpStop equals FALSE and numCurrMergecand is less than (MaxNumMergeCand-1), hmvpLT is set to TRUE - If HMVPLTCandList[NumLTHmvp-HMVPLTIdx] has the same motion vector and the same reference indices as any mergeCandList[i] where I is 0.. numOrigMergeCand-1 and HasBeenPruned[i] equals false, sameMotion is set to true - If sameMotion equals false, mergeCandList[numCurrMergeCand++] is set to HMVPLTCandList[NumLTHmvp-HMVPLTIdx] - If numCurrMergeCand is equal to (MaxNumMergeCand-1), hmvpLTStop is set to TRUE An arrangement can be made such that the candidate inter-region fusion includes additional information as well as motion information. For example, size, shape, or partition information of a block may further be stored for inter-region join candidates. When configuring the merge candidate list of the current block, only inter-prediction merge candidates that have the same or similar size, shape, or partition information as the current block among the inter-prediction merge candidates can be used, or inter-prediction merge candidates that have the same or similar size, shape, or partition information as the currently preferred block can be added to the merge candidate list. Alternatively, an inter-region motion information table can be generated for each block size, shape, or piece of partition information. A combined candidate list of the current block may be generated using an inter-region motion information table that matches the shape, size, or partition information of the current block among a plurality of inter-region motion information tables. When the number of joint candidates included in the joint candidate list of the current block is smaller than the threshold value, the inter-region joint candidates included in the inter-region motion information table can be added to the joint candidate list. The addition process may be in ascending or descending order based on the indices. For example, the inter-regional joint candidate with the largest favorable index can be added to the list of joint candidates. When the inter-region join candidates included in the inter-region motion information table are to be added to the join candidate list, a redundancy check can be performed on the inter-region join candidates with respect to the join candidates previously stored in the join candidate list. As an example, Table 2 shows the process of adding inter-regional joint candidates (joint candidate list). [Table 2] For each candidate in HMVPCandList with index HMVPIdx = 1.. numCheckedHMVPCand, successive steps are repeated until combStop equals true - sameMotion is set to false- If HMVPCandList[NumHmvp- HMVPIdx] has the same motion vector and the same reference indices equals any mergeCandList[i] where I is 0.. numOrigMergeCand-1 and HasBeenPruned[i] equals false, sameMotion is set to true - If sameMotion is equal to false, mergeCandList[numCurrMergeCand++] is set to HMVPCandList[NumHmvpHMVPIdx] - If numCurrMergeCand is equal with (MaxNumMergeCand-1), hmvpStop is set to TRUE Redundancy checks can be performed on only a few candidate inter-region joins included in the inter-region motion information table. As an example, a redundancy check can be performed on only inter-region joint candidates that have indices greater than or equal to the threshold value or indices less than or equal to the threshold value. Alternatively, a redundancy check can be performed on only the N combined candidates that have the largest indices or those that have the smallest indices. Alternatively, a redundancy check can be performed on only some of the combined candidates previously stored in the combined candidate list. As an example, a redundancy check may be performed on only compound candidates with an index greater than or equal to a threshold value or an index less than or equal to a threshold value or compound candidates derived from blocks at a particular location. Here, a particular location can include at least one of the left-neighbor block, the top-neighbor block, the top-right neighbor block, or the bottom-left neighbor block of the current block. FIGURE 31 is a diagram showing an example where a redundancy check is performed on only a few compound candidates. When the inter-region merge candidate HmvpCand[j] has to be added to the list of merge candidates, a redundancy check can be performed on the inter-region merge candidate with respect to the two merge candidates mergeCandList[NumMerge-2] and mergeCandList[NumMerge-1], which have indices- largest index. Here, NumMerge can represent the number of available spatial merge candidates and temporal merge candidates. Unlike the example shown, when the inter-region join candidate HmvpCand[j] has to be added to the list of join candidates, a redundancy check can be performed on the inter-region join candidate with respect to at least two join candidates having the smallest indices. For example, it can be checked whether mergeCandList[0] and mergeCandList[1] are identical to HmvpCand[j]. Alternatively, a redundancy check can be performed on only the merged candidates deployed at a particular location. For example, a redundancy check may be performed on at least one of a merge candidate derived from a nearby block located to the left of the current block or a merge candidate derived from a nearby block located above the current block. When no joint candidates are derived at a particular location that is in the joint candidate list, inter-region joint candidates can be added to the joint candidate list without a redundancy check. When a join candidate identical to the first inter-region join candidate is found, the redundancy check on the join candidate identical to the first inter-region join candidate can be removed when the redundancy check is performed on the second inter-region join candidate. FIGURE 32 is a diagram showing an example where redundancy checks on certain join candidates are omitted. When the inter-region merge candidate HmvpCand[i] with index i has to be added to the merge candidate list, a redundancy check between the inter-region merge candidate and the merge candidates previously stored in the merge candidate list can be performed. In this case, when a merge candidate mergeCandList[j] that is identical to the inter-region merge candidate HmvpCand[i] is found, the inter-region merge candidate HmvpCand[i] cannot be added to the list of merge candidates, and the redundancy check between the inter-region merge candidates region HmvpCand[i-1], which has index i-1, and combining candidates is possible. In this case, the redundancy check between the inter-region merge candidate HmvpCand[i-1] and the merge candidate mergeCandList[j] can be omitted. For example, in the example shown in FIGURE 32, it is determined that HmvpCand[i] and mergeCandList[2] are identical to each other. Therefore, HmvpCand[i] cannot be added to the combined candidate list, and a redundancy check can be performed on HmvpCand[i-1]. In this case, the redundancy check between HvmpCand[i-1] and mergeCandList[2] can be omitted. When the number of merge candidates included in the merge candidate list of the current block is smaller than the threshold value, at least one of the pairwise merge candidates or zero merge candidates can further include in addition to the inter-region merge candidates. A pairwise joint candidate refers to a joint candidate with a motion vector equal to the average of the motion vectors of two or more joint candidates, and a zero joint candidate refers to a joint candidate with a motion vector of 0. Merge candidates can be added to the list of merge candidates of the current block in the following order. Spatial join candidate - Temporary join candidate Inter-region join candidate - (Inter-region affine join candidate) - Pairwise join candidate - Zero join candidate. A spatial merge candidate refers to a merge candidate derived from at least one of the neighboring blocks or a non-neighbor block, and a temporal merge candidate refers to a merge candidate derived from a previous reference image. An inter-region affine join candidate refers to an inter-region join candidate derived from blocks encoded or encoded by the affine motion model. The inter-region motion information table can be used even in motion vector prediction mode. For example, when the number of motion vector prediction candidates included in the motion vector prediction candidate list of the current block is smaller than the threshold value, the combined inter-region candidates included in the inter-region motion information table can be designated as motion vector prediction candidates for the current block. In detail, the motion vector of the inter-region combined candidate can be designated as the motion vector prediction candidate. When one of the motion vector prediction candidates included in the list of motion vector prediction candidates of the current block is selected, the selected candidate can be designated as the motion vector predictor of the current block. Next, the motion vector of the current block can be obtained by supervising the residual motion vector of the current block value and then adding the values ​​of the predictor motion vector and the residual motion vector. The list of motion vector prediction candidates of the current block can be configured in the following order. Spatial motion vector prediction candidate - Temporal motion vector prediction candidate - Inter-decoding-region Inter-coding region combined candidate - (Inter-coding affine combined candidate) - Zero motion vector prediction candidate A spatial motion vector prediction candidate refers to a motion vector prediction candidate derived from at least one of the neighboring blocks or a non-neighboring block, and a temporal motion vector prediction candidate refers to a motion vector prediction candidate derived from a previous reference image. An inter-region affine composite candidate refers to a candidate inter-region motion vector prediction derived from blocks encoded or encoded by an affine motion model. A zero motion vector prediction candidate represents a candidate with a motion vector of 0. The coding block may be separated into a plurality of prediction units, and the prediction units may be subject to prediction. Here, prediction unit indicates the basic unit for performing predictions. Encoding blocks can be separated using at least one of vertical lines, horizontal lines, slashes, or diagonal lines. Information to determine at least one of the number, angle, or location of the gairs separating the coding blocks may be signaled in the bit stream. For example, information specifying one of a plurality of candidate partition types of a coding block may be signaled in a bit stream, or information specifying one of a plurality of candidate lines separating a coding block may be signaled in a bit stream. Alternatively, information to determine the number or partitioning of candidate line type encoding blocks may be signaled in the bit stream. For example, whether to use a slash that has a larger angle than the diagonal line and / or a slash that has a smaller angle than the diagonal line as a line candidate can be determined using a 1-bit flag. Alternatively, at least one of the numbers, corners, or partitioning locations of line coding blocks can be adaptively determined based on at least one of the coding block's inter-prediction modes, inter-prediction modes, available joint candidate locations, or partitioning aspects of neighboring blocks. . When the coding block is split into a number of prediction units, intra-prediction or inter-prediction can be performed on the prediction units. FIGURE 33 is a diagram that shows an example of partitioning a coding block into a number of prediction units using diagonal lines. As in the examples shown in FIGURE 33A and 33B, the coding block can be split into two triangular prediction units using a diagonal line. FIGURE 33A and 33B showing that the coding block is separated into two prediction units using a diagonal line connecting the two tops of the coding block. However, the coding block can be separated into two prediction units using a slash that has at least one end that does not pass through the top of the coding block. FIGURE 34 is a diagram showing an example of partitioning a coding block into two prediction units. As in the examples shown in FIGURE 34A and 34B, the coding block can be split into two prediction units using a slash with the two ends adjacent to the top and bottom edges of the coding block. Alternatively, as in the examples shown in FIGURE 34C and 34D, the coding block can be separated into two prediction units using a slash with both ends adjacent to the left edge and the right edge of the coding block. Alternatively, the coding block can be separated into two prediction blocks of different sizes. For example, by partitioning a slash encoding block to be contiguous with two edges forming one peak, the encoding block can be separated into two prediction units of different sizes. FIGURE 35 shows examples where the coding block is split into a number of prediction blocks of different sizes. As in the examples shown in FIGURE 35A and 35B, by setting the diagonal line connecting the top-left and bottom-right parts of the coding block to pass through the left edge, right edge, top edge, or bottom edge of the coding block instead of through the top-left corner or the bottom right corner of the coding block, the coding block can be separated into two prediction units of different sizes. Alternatively, as in the examples shown in FIGURE 35C and 35D, by setting the diagonal connecting the top-right and bottom-left portions of the coding block to pass through the left edge, right edge, top edge, or bottom edge of the coding block instead of through the corners top left or bottom right corner of the coding block, the coding block can be separated into two prediction units of different sizes. Each prediction unit produced by partitioning the coding block is called the Nth prediction unit.” As an example, in the examples shown in FIGURE 33 to 35, PU1 can be specified as the first prediction unit, and PU2 can be specified as the second prediction unit. The first prediction unit can refer to the prediction unit that includes the sample located at the bottom left of the coding block or the sample that is located at the top-left of the coding block, and the second prediction unit can refer to the prediction unit that includes the sample that is located at the top-right coding block or sample located at the bottom right of the coding block. On the other hand, the prediction unit that includes the sample located at the top-right of the coding block or the sample that is located at the bottom-right of the coding block can be specified as the first prediction unit, and the prediction unit that includes the sample that is located at the bottom-left of the coding block or the sample that located at the top-left of the coding block can be specified as the second prediction unit. The following embodiments will be described, focusing on examples of partitioning using diagonal lines. Specifically, partitioning an encoding block into two prediction units using diagonal lines is referred to as diagonal partitioning or triangular partitioning, the resulting prediction units based on diagonal partitioning are referred to as triangular prediction units. However, it will be appreciated that the following embodiments can be applied even to partitioning examples using slanted lines that have angles different from the angles of vertical lines, horizontal lines, or diagonal lines. Whether to apply diagonal partitioning to a coding block can be determined based on at least one of the intersection types, the maximum number of combined candidates that the combined candidate list can include, the size of the coding block, the shape of the coding block, the predictive coding mode of the coding block, or the partitioning aspect of the master node . For example, whether to apply diagonal partitioning to a coding block can be determined based on whether the current slice is of type B. Diagonal partitioning can be permitted only when the current slice is of type B. Alternatively, whether to apply diagonal partitioning to the coding block can be determined based on whether the maximum number of combined candidates included in the combined candidate list is two or more. Diagonal partitioning may be permitted only when the maximum number of joint candidates included in the combined candidate list is two or more. Alternatively, when at least one of the widths or heights is greater than 64 in a hardware implementation, unfavorably, data processing units having a size of 64*64 are accessed excessively. Therefore, when at least one of the width or height of the coding block is greater than the threshold value, the coding block cannot be allowed to be split into a plurality of prediction blocks. For example, when at least one of the coding block heights or widths is greater than 64, diagonal partitioning cannot be used. Alternatively, whether to apply diagonal partitioning to the coding block can be determined based on at least one of whether the number of samples included in the coding block is less than or equal to the first threshold value or whether the number of samples included in the coding block is greater of or equal to the second threshold value. For example, when the number of samples included in the coding block is less than or equal to the first threshold value or when the number of samples included in the coding block is greater than or equal to the second threshold value, the settings can be made such that so that diagonal partitioning is not applied to coding blocks. Alternatively, whether to apply diagonal partitioning to a coding block can be determined based on whether the width-to-height ratio of the coding block is smaller than the first threshold value or whether the width-to-height ratio of the coding block is greater than the second threshold value. Here, the width to height ratio whRatio of the coding block can be determined as the ratio between the width CbW and the height CbH of the coding block as shown in Equation 21 below. [Equation 21] whRatio—CbW / CbH The second threshold value can be the inverse number of the first threshold value. For example, when the first threshold value is k, the second threshold value might be 1 / k. Diagonal partitioning can be applied to coding blocks only when the width to height ratio of the coding block is between the first threshold value and the second threshold value. Alternatively, triangular partitioning can be used only when the width-to-height ratio of the coding block is smaller than the first threshold value or greater than the second threshold value. For example, when the first threshold value is 16, diagonal partitioning cannot be allowed for coding blocks of size 64*4 or 4*64. Alternatively, whether to allow diagonal partitioning can be determined based on the partitioning aspect of the parent node. For example, when coding blocks, which are parent nodes, are split based on rectangular tree partitioning, diagonal partitioning can be applied to coding blocks which are leaf nodes. On the other hand, when coding blocks, which are parent nodes, are split based on binary tree partitioning or ternary tree partitioning, the arrangement can be made such that diagonal partitioning is not permitted for coding blocks that are leaf nodes. Alternatively, whether to allow diagonal partitioning can be determined based on the predictive coding mode of the encoder block. As an example, diagonal partitioning may be permitted only when the coding block is encoded via intra-prediction, when the coding block is encoded via inter-prediction, or when the coding block is encoded in a predetermined inter-prediction mode. Here, the specified inter-prediction mode can represent at least one of a combined mode, a motion vector prediction mode, an affine combined mode, or an affine motion vector prediction mode. Alternatively, whether to allow diagonal partitioning can be determined based on the size of the parallel processing regions. For example, when the coding block size is larger than the parallel processing region size, diagonal partitioning cannot be used. Whether to apply diagonal partitioning to coding blocks can be determined by considering two or more of the conditions listed above. Additionally, information indicating whether to allow diagonal partitioning can be signaled in the bit stream. Information can be signaled at the circuit, image, slice or block level. The information indicates that diagonal partitioning is permitted, and diagonal partitioning can be applied to coding blocks only when at least one of the conditions listed above is met. When it is determined to apply diagonal partitioning to coding blocks, information indicating the number or location of line coding block partitions can be signaled in the bit stream. For example, when coding blocks are separated by diagonal lines, information indicating the direction of the coding block's diagonal partitioning lines can be signaled in the bit stream. As an example, the triangle_partition_type_flag, which indicates the direction of the diagonal line, can be signaled in the bit stream. The flag indicates whether the coding block is separated by a diagonal line connecting the top-left and bottom-right or by a diagonal line connecting the top-right and bottom-left. The partitioning of the coding block by a diagonal line connecting the top-left and the bottom-right can be called the left triangle partition type, and the partitioning of the coding block by the diagonal line connecting the top-right and the bottom-left can be called the right-triangle partition type. For example, a flag having a value of 0 may indicate that the coding block partition type is of the left triangular partition type, and a flag having a value of 1 may indicate that the coding block partition type is of the right triangular partition type. Information indicating the coding block partition type can be signaled at the coding block level. Therefore, the partition type can be determined for each coding block applied to the diagonal partitioning. As another example, information indicating the partition type for a sequence, image, slice, tile, or encoding tree unit may be signaled. In this case, the coding block partition type applied to the diagonal partitioning can be specified identically in sets, images, slices, tiles, or coding tree units. Alternatively, information to determine the partition type of the first coding unit to be applied to the diagonal partitioning in the coding tree unit can be encoded and signaled, arrangements can be made such that the second and final coding unit to be applied to the diagonal partitioning uses the same partition type as first coding unit. As another example, the partition type of a coding block can be determined based on the partition type of neighboring blocks. Here, the neighbor block may include at least one of the neighbor blocks adjacent to the top left corner of the coding block, the neighbor block adjacent to the top right corner of the coding block, the neighbor block adjacent to the bottom left corner of the coding block, the neighbor block located above coding block, or a neighboring block located to the left of the coding block. For example, the partition type of the current block can be set to be the same as the partition type of a neighboring block. Alternatively, the current block partition type can be determined based on whether the left triangle partition type is applied to the top-left neighbor block or whether the right triangle partition type is applied to the top-right neighbor block or the bottom-left neighbor block. To perform motion prediction compensation for the first triangle prediction unit and the second triangle prediction unit, motion information from each first triangle prediction unit and the second triangle prediction unit can be derived. In this case, the motion information of the first triangle prediction unit and the second triangle prediction unit can be derived from the combined candidates included in the combined candidate list. To distinguish the general combined candidate list from the combined candidate list used to derive the motion information of the triangular prediction unit, the combined candidate list for deriving the motion information of the triangular prediction unit is referred to as the triangular combined candidate list, and the combined candidates included in the triangular combined candidate list are referred to as triangular combination candidate. However, the use of the combined candidate derivation method and the combined candidate list configuration method described above for the method of configuring triangular combined candidates and the combined triangle candidate list is also included in the spirit of the present invention. Information to determine the maximum number of triangle join candidates that can be included in the list of triangle join candidates can be signaled in the stream. The information may indicate the difference between the maximum number of combined candidates that can be included in the combined candidate list and the maximum number of triangular combined candidates that can be included in the combined triangular candidate list. Triangle union candidates can be derived from spatial neighbor blocks and temporal neighbor blocks of the coding block. FIGURE 36 is a diagram showing the neighboring blocks used to obtain candidate triangle unions. Triangle merge candidates may be derived using at least one of a neighboring block located above the coding block, a neighboring block located to the left of the coding block, or a collocated block included in a different image than the coding block image. The top neighbor block may include at least one of the sample-covering block (xCb+CbW-1, yCb-1) located above the coding block, the sample-covering block (xCb+CbW, yCb-1) located above the coding block , and a block that includes samples (xCb-1, yCb-1) located above the coding block. The left neighbor block can include at least one of the sample-covering block (xCb-1, yCb+CbH-1) located to the left of the coding block or the sample-covering block (xCb-1, yCb+CbH) located to the left of the coding block . Collocated blocks can be defined by either the sample-encompassing block (xCb+CbW, yCb+CbH) adjacent to the top right corner of the coding block in the collocated image or the sample-encompassing block (xCb / 2, yCb / 2) located in the center coding blocks in collocated images. Neighboring blocks can be found in a predetermined order, and the triangle merge candidates can form a list of triangle merge candidates in a predetermined order. For example, the triangle merge candidates can be found in the order B1, A1, B0, A0, C0, B2, and C1 to form a list of triangle merge candidates. The motion information of the triangle prediction unit can be derived based on the list of candidate triangle combinations. That is, triangle prediction units can share one list of candidate triangle joins. Information to determine at least one of the triangle join candidates included in the list of triangle join candidates may be signaled in a bit stream to obtain motion information of the triangle join unit. For example, the merge_triangle_idx information index, which is to determine at least one of the triangle merge candidates, may be signaled in the bit stream. The index information can determine a combined candidate combination of the first triangle prediction unit and a combined candidate combination of the second triangle prediction unit. As an example, Table 3 represents the combination of merge candidates corresponding to the merge_triangle_idx information index. [Table 3] Composite triangle index 0 1 2 3 4 5 6 7 8 First prediction unit 1 0 0 0 2 0 0 1 3 Second prediction unit 0 1 2 1 0 3 4 0 0 Compound triangle index 9 10 11 12 13 14 15 16 17 First prediction unit 4 0 1 1 0 0 1 1 1 Prediction unit second 0 2 2 2 4 3 3 4 4 Combined triangle index 18 19 20 21 22 23 24 25 26 First triangle prediction unit 1 2 2 2 4 3 3 3 4 Second triangle prediction unit 3 1 0 1 3 0 2 4 0 Triangle index combined 27 28 29 30 31 32 33 34 35 First triangular prediction units 3 2 4 4 2 4 3 4 3 Second triangle prediction units 1 3 1 1 3 2 2 3 1 Combined triangle index 36 37 38 39 First triangular 2 2 4 3 units prediction Second triangle prediction unit 4 4 2 4 The merge_triangle_idx index information which has a value of 1 represents that the motion information of the first triangle prediction unit is derived from the combined candidate with index 1 and that the 5 motion information of the second triangle prediction unit is derived from the combined candidate with index 0. Through the merge_triangle_idx information index, the candidate triangles are combined to derive information the unit motion of the first triangle prediction and the combined candidate triangles to derive the motion information of the second triangle prediction unit 10 can be determined. The partition type of the coding block applied to the diagonal partitioning can be determined by the index information. That is, the index information can determine the combined candidate combination of the first triangle prediction unit, the combined candidate of the second 15 triangle prediction units, and the direction partitioning of the coding block. When the coding block partition type is determined by index information, the triangle_partition_type_flag information, which indicates the direction of the coding block's diagonal partition line, cannot be encoded. Table 4 represents the coding block partition types in the merge_triangle_idx information index. [Table 4] Combined triangle index 0 1 2 3 4 5 6 7 8 TriangleDir 0 1 1 0 0 1 1 1 0 Combined triangle index 9 10 11 12 13 14 15 16 17 TriangleDir 0 0 0 1 0 0 0 0 1 Combined triangle index 18 19 20 21 22 23 24 25 26 TriangleDir 1 1 1 0 0 1 1 1 1 Combined triangle index 27 28 29 30 31 32 33 34 35 TriangleDir 1 1 1 0 0 1 0 1 0 Combined triangle index 36 37 38 39 TriangleDir 0 1 0 0 A TriangleDir variable of 0 represents that the left triangle partition type is applied to the coding block, and a TriangleDir variable of 1 represents that the right triangle partition type is applied to the coding block. In the combination of Table 3 and Table 4, the merge_triangle_idx index information can be specified to determine the combination of the merge candidate of the first triangle prediction unit, the merge candidate of the second triangle prediction unit, and the direction partitioning of the coding block. As another example, only the index information for one of the first triangle prediction unit and the second triangle prediction unit may be signaled, and a combined triangle candidate index for another one of the first triangle prediction unit and the second triangle prediction unit may be determined based on the index information. For example, the triangle merge candidates of the first triangle prediction unit can be determined based on the information index merge_triangle_idx, which indicates the index of one of the triangle merge candidates. Also, the candidate triangle merge of the second triangle prediction unit can be determined based on merge_triangle_idx. As an example, the candidate triangle merge of the second triangle prediction unit can be derived by adding or subtracting offsets to or from the information index merge_triangle_idx. The offset can be an integer such as 1 or 2. For example, a triangle merge candidate with an index equal to merge_traingle_idx plus 1 can be determined as the triangle merge candidate of the second triangle prediction unit. When merge_triangle_idx indicates the triangle merge candidate with the largest index value among the triangle merge candidates, the movement information of the second triangle prediction unit can be derived from the triangle merge candidate with index 0 or the triangle merge candidate with index equal to merge_triangle_idx minus 1. Alternatively, motion information of the second triangle prediction unit can be derived from a candidate triangle composite that has the same reference image as the candidate triangle composite of the first triangle prediction unit determined by the index information. Here, a triangle merge candidate that has the same reference image as the triangle merge candidate of the first triangle prediction unit can indicate a triangle merge candidate where at least one of the L0 reference image or L1 reference image is the same as the triangle merge candidate image of the first triangle prediction unit . When there are a plurality of candidate triangle composites that have the same reference image as the candidate composite triangles of the first triangle prediction unit, one of the plurality of candidate composite triangles can be selected based on at least one of whether the candidate composite includes bidirectional motion information or the value of the difference between the index information and combined candidate index. As another example, an information index may be signaled to each of the first triangle prediction units and the second triangle prediction unit. For example, the first index information 1st_merge_idx, which is to determine the triangle merge candidate of the first triangle prediction unit, and the second index information 2nd_merge_idx, which is to determine the triangle merge candidate of the second triangle prediction unit, may be signaled in the bit stream. The motion information of the first triangle prediction unit can be derived from the triangle merge candidate determined based on the first index information 1st_merge_idx, and the motion information of the second triangle prediction unit can be derived from the triangle merge candidate determined based on the second index information 2nd_merge_idx. The first index information 1st_merge_idx may indicate the index of one of the triangle merge candidates included in the list of triangle merge candidates. The triangle merge candidate of the first triangle prediction unit can be determined as the triangle merge candidate indicated by the first index information 1st_merge_idx. An arrangement can be made such that the triangle merge candidate indicated by the first index information 1st_merge_idx cannot be used as the triangle merge candidate of the second triangle prediction unit. Therefore, the second index information 2nd_merge_idx of the second triangle prediction unit may indicate the index of any of the remaining triangle merge candidates other than the triangle merge candidate indicated by the first index information. When the information value of the second index 2nd_merge_idx is smaller than the information value of the first index 1st_merge_idx, the triangle merge candidate of the second triangle prediction unit can be determined as the triangle merge candidate having the information index indicated by the second index information 2nd_merge_idx. On the other hand, when the information value of the second index 2nd_merge_idx is greater than or equal to the information value of the first index 1st_merge_idx, the triangle merge candidate of the second triangle prediction unit can be determined as the triangle merge candidate with the index having the value obtained by adding one to the index information value second 2nd_merge_idx. Alternatively, whether to signal the second index information may be determined according to the number of triangle join candidates included in the list of triangle join candidates. For example, when the maximum number of triangle join candidates that cannot be included in the list of triangle join candidates does not exceed two, the second index information signaling can be omitted. When the signaling of the second index information is removed, the second triangle join candidate can be derived by adding or subtracting an offset to or from the first index information. For example, when the maximum number of triangle join candidates that can be included in the list of triangle join candidates is two and the first index information indicates an index of 0, the second triangle join candidate can be derived by adding one to the first index information. Alternatively, when the maximum number of triangle join candidates that can be included in the list of triangle join candidates is two and the first index information indicates one, a second triangle join candidate can be derived by subtracting one from the first index information. Alternatively, when the second index information signaling is omitted, the second index information can be set as the default value. Here, the default value may be equal to zero. The second triangle combination candidate can be derived by comparing the first index information and the second index information. For example, a join candidate with index 0 can be designated as the second triangle join candidate when the second index information is smaller than the first index information, and a join candidate with index 1 can be set as the second triangle join candidate when the second index information is greater than or equal to first index information. When the triangle fusion candidate has one direction of motion information, one direction of motion information of the triangle fusion candidate can be assigned as the motion information of the triangle prediction unit. On the other hand, when the triangle composite candidate has bidirectional motion information, only one of the L0 motion information or L1 motion information can be assigned as the motion information of the triangle prediction unit. Whether to choose L0 motion information or L1 motion information can be determined based on the triangle composite candidate index or other triangle prediction unit motion information. For example, when the index of the triangle composite candidate is an even number, the L0 motion information of the triangle prediction unit can be set to zero, and the L1 motion information of the triangle composite candidate can be set as the L1 motion information of the triangle prediction unit. On the other hand, when the index of the triangle joint candidate is an odd number, the L1 motion information of the triangle prediction unit can be set to zero, and the L0 motion information of the triangle joint candidate can be set to zero. On the other hand, the L0 motion information of the triangle compound candidate can be assigned as the L0 motion information of the triangle prediction unit when the index of the triangle compound candidate is an even number, and the L1 motion information of the triangle compound candidate can be assigned as the L1 motion information of the triangle prediction unit when the index of the compound candidate triangle is an odd number. Alternatively, the L0 motion information of the triangle fusion candidate can be assigned as the L0 motion information of the first triangle prediction unit when the triangle fusion candidates for the first triangle prediction unit are an even number, and the L1 motion information of the triangle fusion candidate can be assigned as the L1 motion information of the unit second triangle prediction when the candidate triangle combination for the second triangle prediction unit is an odd number. Alternatively, when the first triangle prediction unit has L0 motion information, the L0 motion information of the second triangle prediction unit can be set to zero, and the L1 motion information of the triangle composite candidate can be set as the L1 motion information of the second triangle prediction unit. On the other hand, when the first triangle prediction unit has L1 motion information, the L1 motion information of the second triangle prediction unit can be set to zero, and the L0 motion information of the triangle composite candidate can be set as the L0 motion information of the second triangle prediction unit. An arrangement can be made such that the list of candidate triangle combinations for deriving motion information from the first triangle prediction unit is different from the list of candidate triangle combinations for deriving motion information from the second triangle prediction unit. For example, when the candidate triangle composites for deriving the motion information of the first triangle prediction unit are determined from a list of triangle composite candidates based on the index information for the first triangle prediction unit, the motion information of the second triangle prediction unit can be derived using the triangle composite list that includes those candidates. the remaining triangle joins other than the candidate triangle joins indicated by the index information. In detail, the motion information of the second triangle prediction unit can be derived from any of the remaining triangle combination candidates. Therefore, the maximum number of triangle merge candidates that can be included in the list of triangle merge candidates of the first triangle prediction unit may be different from the maximum number of triangle merge candidates that can be included in the list of triangle merge candidates of the second triangle prediction unit. For example, when the list of candidate triangle unions of a first triangle prediction unit includes M candidate unions, the list of candidate triangle unions of the second triangle prediction unit may include M-1 candidate unions in addition to the candidate triangle unions indicated by the index information of the first triangle prediction unit. As another example, while the combined candidates of a triangle prediction unit are derived based on neighboring blocks adjacent to the coding block, the availability of neighboring blocks can be determined by considering the shape or location of the triangle prediction unit. FIGURE 37 is a diagram to explain an example of determining the availability of neighboring blocks for each triangle prediction unit. Neighboring blocks that are not adjacent to the first triangle prediction unit may be set to be unavailable for the first triangle prediction unit, and neighboring blocks that are not adjacent to the second triangle prediction unit may be set to be unavailable for the second triangle prediction unit. For example, as in the example shown in FIGURE 37A, when the left triangle partition type is applied to the coding block, it can be determined that the blocks A1, A0, and A2 adjacent to the first triangle prediction unit among the blocks adjacent to the coding block are available for the first triangle prediction unit and that blocks B0 and B1 are not available for the first triangle prediction unit. Therefore, the list of triangle merge candidates for the first triangle prediction unit can include triangle merge candidates derived from blocks A1, A0, and A2 but cannot include triangle merge candidates derived from blocks B0 and B1. As in the example shown in FIGURE 37B, when the left triangle partition type is applied to the coding block, it can be determined that blocks B0 and B1 adjacent to the second triangle prediction unit are available for the second triangle prediction unit and that blocks A1, A0, and A2 are not available for the second triangle prediction unit. Therefore, the list of triangle merge candidates for the second triangle prediction unit can include the triangle merge candidates derived from blocks B0 and B1 but cannot include the triangle merge candidates derived from blocks A1, A0, and A2. Therefore, the number or range of candidate triangle combinations that can be used by the triangle prediction unit can be determined based on at least one of the location of the triangle prediction unit or the partition type of the coding block. As another example, the combined mode may be applied to only one of the first triangle prediction unit and the second triangle prediction unit. Also, the motion information of another one of the first triangle prediction unit and the second triangle prediction unit can be set to be equal to the motion information of the triangle prediction unit applied in the combined mode or can be derived by smoothing the motion information of the triangle prediction unit applied in the combined mode. As an example, the index of a reference image and the motion vector of a first triangle prediction unit can be derived based on the combined candidate triangles, and the motion vector of the second triangle prediction unit can be derived by smoothing the motion vector of the first triangle prediction unit. As an example, the motion vector of a second triangle prediction unit can be derived by adding or subtracting the smooth motion vector {Rx, Ry} to the motion vector {mvD1LXx, mvD1LXy} of the first triangle prediction unit. The reference image index of the second triangle prediction unit can be set to be the same as the reference image index of the first triangle prediction unit. Information to determine a smooth motion vector indicating the difference between the motion vector of the first triangle prediction unit and the motion vector of the second triangle prediction unit may be signaled in the bit stream. The information may include at least one of information indicating the size of the smooth motion vector or information indicating the sign of the smooth motion vector. Alternatively, the signature of the smooth motion vector may be derived based on at least one of the partition types applied to the coding block, the location of the triangle prediction unit, or the index of the triangle prediction unit. As another example, the motion vector and reference image index of one of the first triangle prediction unit and the second triangle prediction unit may be signaled. The motion vector of another one of the first triangle prediction unit and the second triangle prediction unit can be derived by smoothing the signalized motion vectors. As an example, the index of the reference image and the motion vector of the first triangle prediction unit can be determined based on the information signaled from the bit stream. Also, the motion vector of the prediction unit of the second triangle can be derived by smoothing the motion vector of the prediction unit of the first triangle. As an example, the motion vector of a second triangle prediction unit can be derived by adding or subtracting the smooth motion vector {Rx, Ry} to the motion vector {mvD1LXx, mvD1LXy} of the first triangle prediction unit. The reference image index of the second triangle prediction unit can be set to be the same as the reference image index of the first triangle prediction unit. Motion compensation predictions can be made in the coding block based on motion information from the first triangle prediction unit and motion information from the second triangle prediction unit. In this case, image quality degradation may occur at the border between the first triangle prediction unit and the second triangle prediction unit. For example, image quality continuity may decrease near an edge that is at the boundary between the first triangle prediction unit and the second triangle prediction unit. To reduce image quality degradation at borders, prediction samples can be downsampled via weighted prediction or smoothing filters. The prediction samples in the coding block applied to the diagonal partitioning can be derived based on a weighted addition operation from the first prediction sample obtained based on the motion information of the first triangle prediction unit and the second prediction sample obtained based on the motion information of the second triangle prediction unit. Alternatively, prediction samples from the first triangle prediction unit may be derived from a first prediction block determined based on the motion information of the first triangle prediction unit, and prediction samples from the second triangle prediction unit may be derived from a second prediction block determined based on the motion information of the second triangle prediction unit. In this case, a prediction sample located in the border region between the first triangle prediction unit and the second triangle prediction unit can be derived based on a weighted sum operation of the first prediction sample included in the first prediction block and the second prediction sample included in the second prediction block. As an example, Equation 22 below represents an example of downsampling predictions from the first triangle prediction unit and the second triangle prediction unit. [Equation 22] P(x,y)~ w 1 *P1 (xy)+(1 - w 1) *P2(x,y) In Equation 22, P1 represents the first prediction sample, and P2 represents the second prediction sample. w1 represents the weight applied to the first prediction sample, and (1-w1) represents the weight applied to the second prediction sample. As in the example shown in Equation 22, the weight applied to the second prediction sample can be reduced by subtracting the weight applied to the first prediction sample from a constant value. When the left triangle partition type is applied to the coding block, the boundary region can include prediction samples that have the same x-coordinate and the same y-coordinate. On the other hand, when the right triangle partition type is applied to the coding block, the border region can include prediction samples having x-coordinates and y-coordinates respectively where the sum is greater than or equal to the first threshold value and less than or equal to the second threshold value. The size of the border region can be determined based on at least one of the size of the coding block, the shape of the coding block, the motion information of the triangle prediction unit, the difference value of the motion vector triangle prediction unit, the POC of the reference image, or the difference value between the first prediction sample and the second prediction sample within the diagonal border . FIGURES 38 and 39 are diagrams that show an example of deriving a prediction sample based on the weighted addition operation of the first prediction sample and the second prediction sample. FIGURE 38 illustrates a case where the left triangle partition type is applied to the coding block, and FIGURE 39 illustrates a case where the right triangle partition type is applied to the coding block. Also, FIGURE 38A and 39A are diagrams showing the predicted aspects for the luma component, and FIGURE 38B and 39B are diagrams showing the predicted aspects for the chroma component. In the figures shown, the number written in the prediction sample located near the border between the first prediction unit and the second prediction unit indicates the weight applied to the first prediction sample. For example, when the number written to the prediction sample is N, the prediction sample can be derived by applying a weight of N / 8 to the first prediction sample and applying a weight of 1-(N / 8) to the second prediction sample. In non-border regions, the first prediction sample or the second prediction sample can be specified as the prediction sample. Referring to the example of FIGURE 38, in a region belonging to the first triangular prediction unit among the regions where the absolute difference between the x-coordinate and the y-coordinate is greater than the threshold value, the first prediction sample derived based on the motion information of the prediction unit The first triangle can be determined as a prediction sample. On the other hand, in a region belonging to the second triangle prediction unit among the regions where the difference between the x-coordinate and the y-coordinate is greater than a threshold value, the second prediction sample derived based on the motion information of the second triangle prediction unit can determined as the prediction sample. Referring to the example of FIGURE 39, in a region where the sum of the x-coordinates and y-coordinates is smaller than the first threshold value, the first prediction sample derived based on the motion information of the first triangular prediction unit can be determined as a prediction sample. On the other hand, in a region where the sum of the x-coordinate and y-coordinate is greater than the second threshold value, the second prediction sample derived based on the motion information of the second triangle prediction unit can be determined as the prediction sample. A threshold value for determining a non-border region may be determined based on at least one of the coding block size, coding block shape, or color component. For example, while the threshold value for the luma component can be set to N, the threshold value for the chroma component can be set to N / 2. The prediction samples included in the border region can be derived based on the weighted addition operation of the first prediction sample and the second prediction sample. In this case, the weights applied to the first prediction sample and the second prediction sample may be determined based on at least one of the location of the prediction sample, the size of the coding block, the shape of the coding block, or the color component. For example, as in the example shown in FIGURE 38A, prediction samples located at the same x-coordinate and the same y-coordinate can be derived by applying the same weight as the first prediction sample and the second prediction sample. Prediction samples where the absolute difference between the x-coordinate and the y-coordinate is one can be derived by setting the ratio between the weights applied to the first prediction sample and the second prediction sample to (3:1) or (1:3). Also, prediction samples where the absolute difference between the x-coordinate and the y-coordinate is two can be derived by setting the ratio between the weights applied to the first prediction sample and the second prediction sample to (7:1) or (1:7). Alternatively, as in the example shown in FIGURE 38B, prediction samples located at the same x-coordinate and the same y-coordinate can be derived by applying the same weight as the first prediction sample and the second prediction sample, and the predictions in which the absolute difference between the x-coordinate and the y-coordinate is one can be derived by setting the ratio between the weights applied to the first prediction sample and the second prediction sample to (7:1) or (1:7). For example, as in the example shown in FIGURE 39A, prediction samples where the sum of the x-coordinate and y-coordinate is one less than the width or height of the coding block can be derived by applying the same weight as the first prediction sample and the second prediction sample . Prediction samples where the sum of the x-coordinate and y-coordinate is equal to or is two less than the width or height of the coding block can be derived by setting the ratio between the weights applied to the first prediction sample and the second prediction sample to (3:1) or (1:3). Prediction samples where the sum of the x-coordinates and y-coordinates is one greater than or three less than the width or height of the coding block can be derived by setting the ratio between the weights applied to the first prediction sample and the second prediction sample to (7 :1) or (1:7). Alternatively, as in the example shown in FIGURE 39B, prediction samples where the sum of the x-coordinates and y-coordinates is one less than the width or height of the coding block can be derived by applying the same weight as the first prediction sample and the second. Prediction samples where the sum of the x-coordinate and y-coordinate is equal to or is two less than the width or height of the coding block can be derived by setting the ratio between the weights applied to the first prediction sample and the second prediction sample to (7:1) or (1:7) . As another example, weights can be determined by considering the location of prediction samples or the shape of coding blocks. Equations 23 to 25 show an example of weight loss when the left triangle partition type is applied to the coding block. Equation 23 shows an example of weight reduction applied to the first prediction sample when the coding block is square. [Equation 23] wl =(x-y+4) / 8 In Equation 23, x and y represent the locations of the predicted samples. When the coding block is non-square, the weight applied to the first prediction sample can be derived using Equation 24 or Equation 25 below. Equation 24 represents a case where the coding block width is larger than the height, and Equation 25 represents a case where the coding block width is smaller than the height. [Equation 24] iri (Λ λ / \\hRai !o)-y +4) / 8 [Equation 25] m·' l whRatio)+4) / 8 When the right triangle partition type is applied to the coding block, the weights applied to the first prediction sample can be determined using Equations 26 to 28. Equation 26 shows an example of decreasing the weights applied to the first prediction sample when the coding block is square. [Equation 26] M’l =(Cbll·- l -λ-y)+4) / 8 In Equation 26, CbW represents the width of the coding block. When the coding block is non-square, the weight applied to the first prediction sample can be derived using Equation 27 or Equation 28 below. Equation 27 represents a case where the coding block width is greater than the height, and Equation 28 represents a case where the coding block width is less than the height. [Equation 27] h4 =(CbH-1 - (x / yvhRatio^-y^+A-y^, [Equation 28] u'l =(CbW-1 -xAy * xvhRaiio y A ) / ^ In Equation 27, CbH represents the height of the coding block. As in the example shown, among the prediction samples in the border region, the prediction samples included in the first triangular prediction unit can be derived by assigning a greater weight to the first prediction sample than to the second prediction sample, and the prediction samples included in the the prediction of the second triangle can be derived by assigning a greater weight to the second prediction sample than to the first prediction sample. When diagonal partitioning is applied to the coding block, the settings can be made such that the combined prediction mode, which is a combination of the intra-prediction mode and the combined mode, is not applied to the coding block. Intra-prediction is to predict the current block using reconstructed samples where encoding or encoding monitoring is complete and which are near the current block. In this case, the reconstructed samples before the in-loop filter is applied can be used for intra-prediction of the current block. Intra-prediction techniques include matrix-based intra-prediction and normal intra-prediction which considers directivity with respect to nearby reconstructed samples. Information indicating the intra-prediction technique of the current block can be signaled in a bit stream. The information can be a 1-bit flag. Alternatively, the intra-prediction technique of the current block may be determined based on at least one of the location, size, or shape of the current block or the intra-prediction technique of neighboring blocks. For example, when the current block crosses the image border, settings can be made such that matrix-based intra-prediction is not applied to the current block. Matrix-based intra-prediction can be a method of deriving a predicted block from the current block based on the product of intermediate matrices 100 previously stored matrices in the encoder and monitor and reconstructed samples near the current block. Information to determine one of a number of previously stored matrices can be signaled in a bit stream. Supervision can determine a matrix for intra-prediction of the current block based on the information and size of the current block. Normal intra-prediction is a method of deriving the prediction block for the current block based on non-directional intra-prediction mode or directional intra-prediction mode. A process for performing intra-prediction based on normal intra-prediction will be explained in detail below with reference to the Figures FIGURE 40 is a flow chart of an intra-prediction method according to an embodiment of the present invention. Line refers to a set of reference samples that fall within the kth line from the top and / or left of the current block. Reference samples can be derived from reconstructed samples where coding or decoding is complete and which are located near the current block. Index information to identify a reference sample line of the current block among a plurality of reference sample lines may be marked in the bit stream. For example, the index information intra_luma_ref_idx, which determines the reference sample line of the current block, can be marked in the bitstream. Index information can be characterized in coding block units. A plurality of reference sample lines may include at least one of the first row, second row, third row, or fourth row from the top and / or left of the current block. Among a plurality of reference sample lines, the reference sample line consisting of the row adjacent to the top of the current block and the adjacent column to the left of the current block may be referred to as the adjacent reference sample line, and other references. sample lines can be referred to as non-adjacent reference sample lines. Only some of a number of reference sample lines can be selected as reference sample lines of the current block. For example, among a number of reference sample lines, the remaining reference sample lines apart from the third reference sample line are not adjacent 101 can be designated as a candidate reference sample line. Table 5 represents the indices assigned to candidate reference sample pathways. [Table 5] Index (intra luma ref idx) Reference sample line 0 Adjacent reference sample line 1 First non-adjacent reference sample line 2 Second non-adjacent reference sample line It is possible to set a larger number of candidate reference sample lines or a smaller number of candidate reference sample lines than described above. Also, the number or location of non-adjacent reference sample paths designated as reference sample path candidates is not limited to the examples described above. For example, a first non-adjacent reference sample path and a third non-adjacent reference sample path may be designated as reference sample path candidates, and a second non-adjacent reference sample path and a third non-adjacent reference sample path may be designated as reference sample line candidates. Alternatively, all non-adjacent first reference sample paths, second non-adjacent reference sample paths, and third non-adjacent reference sample paths may be designated as reference sample path candidates. The number or type of reference sample line candidates may be determined based on at least one of the size, shape, or location of the current block, the existence of a partition into sub-blocks, or the intra-prediction mode of the current block. The reference sample line of the current block may be determined based on at least one of the location, size, or shape of the current block or a predictive coding mode of a neighboring block. For example, when the current block is adjacent to an edge of a drawing, tile, slice, or coding tree unit, the adjacent reference sample line can be specified as the reference sample line of the current block. Alternatively, when the current block is non-square, the adjacent reference sample line can be specified as the reference sample line from 102 blocks currently. Alternatively, when the width-to-height ratio of the current block is greater than or equal to the threshold value or less than or equal to the threshold value, the adjacent reference sample line can be determined as the reference sample line of the current. block. The reference sample line may include a top reference sample located above the current block and a left reference sample located to the left of the current block. The top reference sample and left reference sample can be derived from reconstructed samples near the current block. The reconstructed sample may be in the state it was in before the in-loop filter was applied. Next, the intra-prediction mode of the current block can be determined (S4002). At least one of a non-directional intra-prediction mode or a directional intra-prediction mode may be specified as the intra-prediction mode of the current block. Non-directional intra-prediction modes include Planar and DC, and directional intra-prediction includes 33 or 65 modes from the diagonal bottom-left direction to the diagonal top-right direction. FIGURE 41 is a diagram showing intra-prediction modes. FIGURE 41A shows 35 intra-prediction modes, and FIGURE 41B shows 67 intra-prediction modes. A larger number of intra-prediction modes or a smaller number of intra-prediction modes can be defined than shown in Figure 41. The most likely mode (MPM) can be set based on the intra-prediction mode of blocks adjacent to the current block. Here, neighboring blocks can include left neighboring blocks adjacent to the left of the current block and top neighboring blocks adjacent to the top of the current block. The number of MPMs included in the MPM list may be preset in the encoder and decoder. For example, the number of MPMs can be three, four, five, or six. Alternatively, information indicating the number of MPMs can be signaled in a bit stream. Alternatively, the number of MPMs may be determined based on at least one of the predictive coding modes of neighboring blocks or the size, shape, or line index of a reference sample of the current block. For example, N MPM can be used when the reference sample line The adjacent 103 is specified as the reference sample line of the current block, and M MPM can be used when the non-adjacent reference sample line is specified as the reference sample line of the current block. M is a natural number that is smaller than N. For example, N might be six, and M might be five, four, or three. Thus, one of the six intra-prediction mode candidates is determined as the intra-prediction mode of the current block when the reference sample line index of the current block is zero and the MPM flag is true, and one of the five intra-prediction mode candidates is determined as the mode intra-prediction of the current block when the reference sample line index of the current block is greater than zero and the MPM flag is true. Alternatively, a fixed number (e.g., five or six) of MPM candidates may be used regardless of the reference sample line index of the current block. An MPM list that includes a plurality of MPMs is created, and information indicating whether MPMs identical to the intra-prediction mode of the current block are included in the MPM list can be marked in the bit stream. The information is a 1-bit flag, and the flag can be called the MPM flag. When the MPM flag indicates that an MPM identical to the current block is included in the MPM list, index information to identify one of the MPMs can be marked in the bitstream. For example, the index information intra_luma_ref_idx, which is to determine one of a number of MPMs, can be marked in the bit stream. The MPM determined by the index information can be set as the intra-prediction mode of the current block. When the MPM flag indicates that an MPM identical to the current block is not included in the MPM list, residual mode information indicating one of the remaining intraprediction modes other than the MPM can be signaled in the bitstream. The residual mode information shows the index value corresponding to the intra-prediction mode of the current block when the index is reassigned to the remaining intra-prediction modes other than MPM. The decoder can sort the MPMs in ascending order and compare the MPMs with the residual mode information to determine the intra-prediction mode of the current block. For example, when the residual mode information is smaller than or equal to MPM, The 104 intra-prediction modes of the current block can be derived by adding one to the residual mode information. When deriving intra-prediction modes from the current block, the comparison between residual mode information and multiple MPMs can be omitted. For example, among MPMs, MPMs that are non-directional intra-prediction modes can be excluded from the comparison. When the non-directional intra-prediction mode is set as MPM, it is clear that the residual mode information indicates the directional intra-prediction mode. Thus, the intra-prediction mode of the current block can be derived through the comparison between the residual mode information and the remaining MPM in addition to the non-directional intra-prediction mode. Instead of excluding non-directional intra-prediction modes from the comparison, the number of non-directional intra-prediction modes can be added to the residual mode information, and thus the resulting value can be compared with the remaining MPM. Instead of setting MPM as the default mode, information indicating whether the intra-prediction mode of the current block is the default mode can be marked in the bitstream. The information can be a 1-bit flag, and the flag can be called the default mode flag. The default mode flag can only be marked when the MPM flag indicates that the MPM is identical to the current block included in the MPM list. As explained above, the default modes can include at least one of Planar, DC, Vertical, or Horizontal modes. For example, when Planar is set as the default mode, the default mode flag can indicate whether the current block's intra-prediction mode is Planar. When the default mode flag indicates that the intra-prediction mode of the current block is not the default mode, one of the MPMs indicated by the index information can be set as the intra-prediction mode of the current block. When the default mode flag is used, settings can be made such that an intra-prediction mode identical to the default mode is not set as MPM. For example, while the default mode flag indicates whether the intra-prediction mode of the current block is Planar, the intra-prediction mode of the current block can be derived using five MPMs excluding the Planar-compliant MPM. 105 When a number of intra-prediction modes are set as default modes, index information indicating one of the default modes can be further signaled. The intra-prediction mode of the current block can be set as the default mode indicated by the index information. When the reference sample line index of the current block is not zero, settings can be made such that the default mode is not used. For example, when a non-adjacent reference sample line is specified as the reference sample line of the current block, settings can be made such that non-directional intra-prediction modes such as DC mode or Planar mode are not used. Therefore, when the reference sample line index is not zero, the default mode flag may not be signaled, and the value of the default mode flag may be set to a predefined value (that is, false). When the intra-prediction mode of the current block is specified, prediction samples for the current block can be obtained based on the specified intra-prediction mode (S4003). When DC mode is selected, a prediction sample for the current block can be generated based on the average of the reference samples. In detail, the values ​​of all samples in the prediction block can be generated based on the average of the reference samples. The average can be derived using at least one of the top reference samples located above the current block and the left reference sample located to the left of the current block. The number or range of reference samples used to obtain the average may vary depending on the current shape of the block. For example, when the current block is a non-square block whose width is greater than its height, the average can be calculated using only the top reference sample. On the other hand, when the current block is a non-square block where the width is smaller than the height, the average can be calculated using only the left reference sample. That is, when the current width and height of the beam are different from each other, the average can be calculated using only the reference samples that are adjacent to the longer ones between the width and height. Alternatively, 106 whether calculating the average using the top reference sample or calculating the average using the left reference sample can be determined based on the current block's width-to-height ratio. When Planar mode is selected, prediction samples can be obtained using horizontal prediction samples and vertical prediction samples. Here, horizontal prediction samples are obtained based on the left reference sample and right reference samples located on the same horizontal line as the prediction sample, and vertical prediction samples are obtained based on the upper and lower reference samples. a reference sample that lies on the same vertical line as the prediction sample. Here, the right reference sample can be generated by copying the reference sample adjacent to the upper right corner of the current block, and the lower reference sample can be generated by copying the reference sample adjacent to the lower left corner of the current block. . The horizontal prediction sample can be obtained based on the weighted addition operation of the left reference sample and the right reference sample, and the vertical prediction sample can be obtained based on the weighted addition operation of the upper reference sample and the lower reference sample. In this case, the weight assigned to each reference sample can be determined depending on the location of the prediction sample. Prediction samples can be obtained based on the average operation or weighted addition operation of horizontal prediction samples and vertical prediction samples. When a weighted addition operation is performed, the weights assigned to horizontal prediction samples and vertical prediction samples can be determined based on the location of the prediction samples. When the direction prediction mode is selected, a parameter indicating the prediction direction (or prediction angle) of the selected direction prediction mode can be specified. Table 6 below shows the intra-directional parameters of intraPredAng for each intra-prediction mode. [Table 6] PredModeIntra IntraPredAng 1- 232 326 421 517 613 79 PredModeIntraIntraPre dAng 85 92 100 11-2 12-5 13-9 14-13 107 PredModeIntraIntraPre dAng 15-17 16-21 17-26 18-32 19-26 20-21 21-17 PredModeIntraIntraPre dAng 13-22 23-9 24-5 25-2 260 272 285 PredModeIntraIntraPre dAng 299 3013 3117 3221 3326 3432 Table 6 represents the intra-directional parameters for each intra-prediction mode with indices between 2 and 34 when 35 intra-prediction modes are defined. When more than 33 direction intra-prediction modes are defined, Table 6 can be further divided to define the intra-direction parameters for each direction intra-prediction mode. After setting the upper reference sample and the left reference sample of the current block in a line, a prediction sample can be obtained based on the intra-directional parameter values. In this case, when the value of the intra-directional parameter is negative, the left reference sample and the upper reference sample can be set in one line. Figures 42 and 43 are diagrams showing examples of one-dimensional arrays in which reference samples are arranged in a line. Figure 42 shows an example of a one-dimensional vertical array in which the reference samples are arranged vertically, and Figure 43 shows an example of a one-dimensional horizontal array in which the reference samples are arranged horizontally. Embodiments of Figures 42 and 43 will be described assuming that 35 intra-prediction modes are defined. A one-dimensional horizontal array in which the top reference sample is rotated counterclockwise can be applied when the intra-prediction mode index is between 11 and 18, and a one-dimensional vertical array in which the left reference sample is rotated clockwise can be applied when the intra-prediction mode index is between 19 and 25. When the reference samples are arranged in a line, the intra-prediction mode angles can be considered. Reference sample determination parameters can be determined based on intra-directional parameters. Reference sample determination parameters may include a reference sample index to determine the reference sample and a weight parameter to determine the weight to be applied to the reference sample. 108 The sample reference ildx index and ifact weight parameters can be obtained via Equations 30 and 31 below. [Equation 30] i / <Zv=( v > 1 ) *7^ / 32 [Equation 31] v^=[Cv+rrp^]&3i In Equations 30 and 31, Pang represents the intra-directional parameters. The reference sample defined by the reference sample index ildx corresponds to an integer number. To obtain a prediction sample, at least one reference sample can be specified. In detail, the location of the reference sample to be used to obtain the prediction sample can be determined by considering the slope of the prediction mode. For example, the reference sample that will be used to obtain a prediction sample can be determined using the reference sample index ildx. In this case, when the intra-prediction mode slope cannot be expressed with a single reference sample, the predication sample can be generated by interpolating a number of reference samples. For example, when the slope of the intra-prediction mode is a value between the slope between the prediction sample and the first reference sample and the slope between the prediction sample and the second reference sample, the prediction sample can be obtained by interpolating the first reference sample and the second reference sample. That is, the angle line corresponding to the infra-prediction angle does not pass through the reference sample located at the integer-pel, the prediction sample can be obtained by interpolating reference samples adjacent to the left, right, top, or bottom, of the location that the angle line passes. Equation 32 below shows an example of obtaining a prediction sample based on a reference sample. [Equation 32] P(x,y)=((32- / ΑίΎ) / 32)*Λ^_ΐη(Λ· i Udx ι 1) । (^. / 32)^ / ^1^(^ । ildx । 2) 109 In Equation 32, P represents the prediction sample, and Ref_lD represents one of the reference samples arranged in one dimension. In this case, the location of the reference sample can be determined by the index of the reference sample ildx and the location (x, y) of the prediction sample. When the intra-prediction mode slope can be expressed with one reference sample, the ifact weight parameter can be set to zero. Therefore, Equation 32 can be simplified to Equation 33 below. [Equation 33] P(xiy)=Ref^iD(x+iIdx+1) Intra-prediction can be performed on the current block based on a number of intra-prediction modes. For example, an intra-prediction mode may be derived for each prediction sample, and the prediction sample may be derived based on the intra-prediction mode assigned to the corresponding prediction sample. Alternatively, an intra-prediction mode can be derived for each region, and intra-prediction can be performed on the corresponding region based on the intra-prediction mode assigned to the corresponding region. Here, the region can include at least one sample. At least one of the sizes or shapes of the region may be determined adaptively based on the at least one size, shape, or intra-prediction mode of the current block. Alternatively, at least one of the region sizes or shapes may be predetermined in the encoder and decoder independently of the current block size or shape. Alternatively, intra-prediction may be performed multiple times, and a final prediction sample may be derived based on an average operation or weighted addition operation of a number of prediction samples obtained by performing intra-prediction multiple times. For example, the first prediction sample can be obtained by performing intraprediction based on the first intraprediction mode, and the second prediction sample can be obtained by performing intraprediction based on the second intraprediction mode. . Next, the final prediction sample can be obtained based on the average operation or operation 110 weighted summation between the first predicted sample and the second predicted sample. In this case, the weights assigned to the first prediction sample and the second prediction sample can be determined by considering at least one of whether the first intra-prediction mode is a non-directional prediction mode or a directional prediction mode, whether the second intra-prediction mode is a non-directional prediction mode. direction or directional prediction mode, whether the second intra-prediction mode. -prediction mode is non-directional prediction mode or directional prediction mode, or intra-prediction mode of neighboring blocks. A plurality of intra-prediction modes may be a combination of non-directional intra-prediction mode and directional intra-prediction mode, a combination of directional intra-prediction modes, or a combination of non-directional intra-prediction modes. Figure 44 is a diagram illustrating the angle formed between a straight line parallel to the x-axis and a directional intra-prediction mode. In the example shown in Figure 44, the direction prediction mode can range from the bottom-left direction of the diagonal to the top-right direction of the diagonal. While the following description assumes an angle is formed between the x-axis and the direction prediction mode, the direction prediction mode can range between 45 degrees (in the lower left direction of the diagonal) and -135 degrees (in the upper right direction of the diagonal). When the current block is non-square, the prediction sample can be derived using a reference sample that is far from the prediction sample among the reference samples that lie on the corner line corresponding to the intra prediction angle instead of the reference sample that is close to the prediction sample depending on the intra-prediction mode prediction of the current block. Figure 45 is a diagram showing the aspect in which prediction samples are obtained when the current block is non-square. For example, as in the example shown in Figure 45A, it is assumed that the current block has a non-square shape where the width is greater than the height and the intraprediction mode of the current block is a directional intraprediction mode having an angle between 0 degrees and 45 degrees. In this case, when downsampling A's prediction near the right column of the current block, the reference sample 111 left L far from the prediction sample among the reference samples located on the angle line corresponding to the angle can be used instead of the upper reference sample T close to the prediction sample. As another example, as in the example shown in Figure 45B, it is assumed that the current block has a non-square shape where the height is greater than the width and the current block's intra-prediction mode is a directional intra-prediction mode that has an angle between -90 degrees and -135 degrees. In this case, when deriving the prediction sample A near the bottom row of the current block, the upper reference sample T that is far from the prediction sample among the reference samples located on the corner line corresponding to the corner can be used instead of the left reference sample L close to the sample predictions. To solve such a problem, when the current block is non-square, the intra-prediction mode of the current block can be replaced by an intra-prediction mode in the opposite direction. Thus, direction prediction modes having larger or smaller angles than the direction prediction mode shown in Figure 41 can be used for non-square blocks. Such directional intra-prediction mode can be defined as wide-angle intra-prediction mode. The wide-angle intra-prediction mode represents a directional intra-prediction mode that is not in the range between 45 degrees and -135 degrees. FIGURE 46 is a diagram showing the wide-angle intra-prediction mode. In the example shown in FIGURE 46, the intra-prediction mode with an index between -1 and -14 and the intra-prediction mode with an index between 67 and 80 indicate the wide-angle intra-prediction mode. In Figure 46, 14 wide-angle intra-prediction modes having angles greater than 45 degrees (-1 to -14) and 14 wide-angle intra-prediction modes having angles smaller than - 135 degrees (67 to 80) are illustrated, but a larger or smaller number of wide-angle intraprediction modes can be determined. 112 When the wide-angle intra-prediction mode is used, the length of the upper reference sample can be set to 2W+1, and the length of the left reference sample can be set to 2H+1. When the wide-angle intra-prediction mode is used, sample A 5 shown in Figure 45A can be predicted using the reference sample T, and sample A shown in Figure 45B can be predicted using the reference sample L. A total of 67+N intra-prediction modes can be used by adding N wide-angle intra-prediction modes to the existing 10 intra-prediction modes. For example, Table 7 shows intra-direction. [Table 7] PredModeIntra -10 -9 -8 -7 -6 -5 -4 -3 -2 intraPredAngle 114 93 79 68 60 54 49 45 39 PredModeIntra -1 2 3 4 5 6 7 8 9 intraPredAngle 35 32 29 26 23 21 19 17 15 Predmodeintra 10 11 12 13 14 15 16 17 18 Intrarapredangle 13 11 9 7 5 3 2 1 0 Predmodeintra 19 20 21 22 23 24 25 26 27 Intrarapredangle -1 -2 -3 -5 -7 -7 -11 -11 -13 -15 Predmodeintra 28 29 30 31 32 33 34 35 36 intraPredAngle -17 -19 -21 -23 -26 -29 -32 -29 -26 PredModeIntra 37 38 39 40 41 42 43 44 45 intraPredAngle -23 -21 -19 -17 -15 - 13 -11 -9 -7 PredModeIntra 46 47 48 49 50 51 52 53 54 intraPredAngle -5 -3 -2 -1 0 1 2 3 5 PredModeIntra 55 56 57 58 59 60 61 62 63 intraPredAngle 7 9 11 13 15 17 19 21 23 PredModeIntra 64 65 66 67 68 69 70 71 72 intraPredAngle 26 29 32 35 39 45 49 54 60 PredModeIntra 73 74 75 76 intraPredAngle 68 79 93 114 When the current block is non-square and the intra-prediction mode of the current block obtained in S4002 is within the transformation range, the intra-prediction mode of the current block can be changed 113 into wide-angle intra-prediction mode. The transformation range can be defined based on at least one of the current block sizes, shapes, or ratios. Here, the ratio can indicate the ratio between the current width and height of the beam. When the current block has a non-square shape where the width is greater than the height, the transformation range can be set in the range from the intra-prediction mode index from the top right direction of the diagonal (for example, 66 ) to the intra-prediction mode index from the top right direction of the diagonal minus N. Here, N can be determined based on the current block ratio. When the intra-prediction mode of the current block is within the transformation range, the intra-prediction mode can be transformed into a wide-angle intra-prediction mode. The transformation may be to subtract a predefined value from the intra-prediction mode, and the predefined value may be the total number (e.g., 67) of the intra-prediction modes except the wide-angle intra-prediction mode. According to the above embodiment, intra-prediction modes #66 through #53 can be changed to wide-angle intra-prediction modes #-1 through #-14, respectively. When the current block has a non-square shape where the height is greater than the width, the transformation range can be set in the range from the intra-prediction mode index from the bottom left direction of the diagonal (for example, 2 ) to the intra-prediction mode index from the bottom left direction of the diagonal plus M. Here, M can be determined based on the current block ratio. When the intra-prediction mode of the current block is within the transformation range, the intra-prediction mode can be transformed into a wide-angle intra-prediction mode. The transformation may be to add a predefined value to the intra-prediction modes, and the predefined value may be the total number (e.g., 65) of directional intra-prediction modes excluding wide-angle intra-prediction modes. According to the above embodiment, intra-prediction modes #2 through #15 can respectively be changed to wide-angle intra-prediction modes #67 through #80. Intra-prediction modes that fall within the transformation range will be referred to as alternative wide-angle intra-prediction modes. 114 The transformation range can be determined based on the current block ratio. For example, Table 8 and Table 9 represent the transformation range when 35 intra-prediction modes except wide-angle intra-prediction mode are defined and the transformation range when 67 intra-prediction modes are defined. [Table 8] Conditions for Replaced Intra Prediction Mode W / H = 2 Mode 2, 3, 4 W / H > 2 Mode 2, 3, 4, 5, 6 W / H = 1 None H / W = 1 / 2 Mode 32, 33, 34 H / W < 1 / 2 Mode 30, 31, 32, 33, 34 [Table 9] Replaced Intra Prediction Mode Conditions W / H = 2 Mode 2, 3, 4, 5, 6, 7 W / H > 2 Mode 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 W / H = 1 None H / W = 1 / 2 Mode 61, 62, 63, 64, 65, 66 H / W < 1 / 2 Modes 57, 58, 59, 60, 61, 62, 63, 64, 65, 66 In the examples shown in Table 8 and Table 9, the number of alternative wide-angle intra-prediction modes falling within the transformation range can differ depending on the current block ratio. The transformation range as shown in Table 10 below can be set by subdividing the current block ratio. [Table 10] Conditions for Replaced Intra Prediction Mode W / H = 16 Mode 12, 13, 14, 15 W / H = 8 Mode 12, 13 W / H = 4 Mode 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 H / W = 2 Mode 2, 3, 4, 5, 6, 7 H / W = 1 None W / H = 1 / 2 Mode 61, 62, 63, 64, 65, 66 115 W / H = 1 / 4 Mode 57, 58, 59, 60, 61, 62, 63, 64, 65, 66 W / H = 1 / 8 Mode 55, 56 H / W = 1 / 16 Mode 53, 54, 55, 56 When a non-adjacent reference sample line is specified as the reference sample line of the current block or when a multi-line intra-predictive coding method for selecting one of a number of reference sample lines is used, the settings may be made such that the wide-angle intra-prediction mode does not used. That is, even when the current block is non-square and the intra-prediction mode of the current block is within the transformation range, the intra-prediction mode of the current block cannot be transformed into a wide-angle intra-prediction mode. Alternatively, when the intra-prediction mode of the current block is specified as wide-angle intra-prediction mode, an arrangement can be made such that non-adjacent reference sample lines are not available as reference sample lines of the current block, or an arrangement can be made such that such that the multi-line intra-predictive coding method for selecting one of a number of reference sample lines is not used. When the multi-line intra-prediction coding method is not used, the adjacent reference sample line can be specified as the reference sample line of the current block. When the wide-angle intra-prediction mode is not used, refW and refH can be set to the sum of nTbW and nTbH. Therefore, except for the top left reference sample, non-adjacent reference samples within distance i of the current block can include (nTbW + nTbH + offsetX[i]) the top reference sample and (nTbW + nTbH + offsetY[i] ]) leave a reference sample. That is, reference samples that are not adjacent to a distance i from the current block can include reference samples (2nTbW + 2nTbH + offsetX[i] + offsetY[i] + 1). For example, when the whRatio value is greater than 1, the settings can be made such that the offsetX value is greater than the offsetY value. For example, the offsetX value can be set to 1, and the offsetY value can be set to 0. On the other hand, when the whRatio value is smaller than 1, the settings can be made such that 116 so that the offsetY value is greater than the offsetX value. For example, the offsetX value can be set to 0, and the offsetY value can be set to 1. Since the wide-angle intra-prediction mode is used in addition to the existing intra-prediction mode, the resources required for coding the wide-angle intra-prediction mode can be increased, and thus the coding efficiency can be reduced. Therefore, by coding an alternative intra-prediction mode for the wide-angle intra-prediction mode, instead of coding the wide-angle intra-prediction mode as is, it is possible to improve the coding efficiency. For example, when the current block is encoded in wide-angle intra-prediction mode #67, wide-angle intra-prediction mode #2, which is an alternative wide-angle intra-prediction mode for #67, can be encoded into the intra-prediction mode of the current block This. Also, when the current block is encoded in wide-angle intra-prediction mode #-1, wide-angle intra-prediction mode #66, which is an alternative wide-angle intra-prediction mode for #-1, can be encoded into the intra-prediction mode of the block At the moment. The decoder can decode the intra-prediction mode of the current block and can determine whether the decoded intra-prediction mode is within the transformation range. When the decoded intra-prediction mode is an alternative wide-angle intra-prediction mode, the intra-prediction mode can be changed to a wide-angle intra-prediction mode. Alternatively, when the current block is encoded in wide-angle intra-prediction mode, the wide-angle intra-prediction mode can be encoded as is. Intra-prediction mode coding can be done based on the MPM list described above. In detail, when neighboring blocks are encoded in wide-angle intra-prediction mode, the MPM can be set based on an alternative wide-angle intra-prediction mode corresponding to the wide-angle intra-prediction mode. The residual image can be obtained by subtracting the predicted image from the original image. In this case, when the residual image is converted to the frequency domain, the subjective image quality of the image is not 117 decreases significantly even if the high frequency components are removed from the frequency components. Therefore, when the value of the high-frequency component is changed to a small value or when the value of the high-frequency component is set to 0, it is possible to increase the compression efficiency without causing significant visual distortion. Considering the above characteristics, the current block can be transformed to decompose the residual image into two-dimensional frequency components. Transformations can be performed using transformation techniques such as Discrete Cosine Transformation (DCT) or Discrete Sine Transformation (DST). DCT uses the cosine transformation to decompose (or convert) the residual image into two-dimensional frequency components, and DST uses the sine transform to decompose (or convert) the residual image into two-dimensional frequency components. As a result of the transformation of the residual image, the frequency components can be expressed by basic patterns. For example, when DCT is performed on an NXN block, the archetypal component N2 can be obtained. The size of each archetypal component included in the NX N block can be obtained through transformation. According to the transformation technique used, the size of the basic pattern component can be called the DCT coefficient or DST coefficient. The DCT transformation technique is mainly used to transform images in which many non-zero low frequency components are distributed. The DST transformation technique is mainly used for images where many high frequency components are distributed. The residual image can be transformed using transformation techniques other than DCT or DST. Converting the residual image into two-dimensional frequency components will be called a two-dimensional transformation. In addition, the size of the basic pattern components obtained through the transformation results will be referred to as the transformation coefficient. For example, transformation coefficients can refer to DCT coefficients or DST coefficients. When both the first transformation and the second transformation that will be described below are applied, the transformation coefficient can refer to the size of the archetypal components produced as a result of the second transformation. 118 Transformation techniques can be specified in blocks. The transformation technique may be determined based on at least one of the predictive coding modes of the current block or the size of the current block. For example, when the current block is encoded in intra-prediction mode and the current block size is smaller than N*N, the transformation can be performed using the DST transformation technique. On the other hand, when the above conditions are not met, the transformation can be performed using the DCT transformation technique. Two-dimensional transformation may not be performed on some blocks of the residual image. Not performing a two-dimensional transformation can be called a transformation jump. When a transformation jump is applied, quantization can be applied to the remaining values ​​where the transformation was not performed. Once a current block is changed using DCT or DST, the changed current block can be changed again. In this case, the transformation based on DCT or DST can be defined as the first transformation, and the retransformation of the block undergoing the first transformation can be defined as the second transformation. The first transformation can be performed using one of a number of candidate transformation cores. For example, the first transformation can be performed using either DCT2, DCT8, or DCT7. Different transformation cores can be used in horizontal direction and vertical direction. Information indicating the combination of vertical transformation cores and horizontal transformation cores can be signaled in a bit stream. The first transformation and the second transformation can be carried out in different units. For example, the first transformation can be performed on an 8*8 block, and the second transformation can be performed on the 4*4 sub-block of the transformed 8*8 block. In this case, the transformation coefficient of the residual region where the second transformation was not carried out can be set to 0. Alternatively, the first transformation can be performed on the 4*4 block, and the second transformation can be performed on the 8*8 block region including the transformed 4*4 block. 119 Information indicating whether to perform a second transformation can be characterized in the bit stream. The decoder can perform an inverse transformation of the second transformation (second inverse transformation) and can perform an inverse transformation of the first transformation (first inverse transformation) on the result of the second inverse transformation. As a result of performing the second inverse transformation and the first inverse transformation, the residual signal for the current block can be obtained. Quantization is to reduce the block energy, and the quantization process includes dividing the transformation coefficient by a certain constant value. The constant value can be derived with the quantization parameter, and the quantization parameter can be defined as a value between 1 and 63. When transformation and quantization are performed by the encoder, the decoder can obtain residual blocks through inverse quantization and inverse transformation. The decoder can obtain a reconstructed block for the current block by adding a prediction block and a residual block. When the reconstructed block of the current block is obtained, the information loss that occurs during quantization and coding can be reduced through in-loop filtering. An in-loop filter can include at least one blocking filter, a sample adaptive offset (SAO) filter, or an adaptive loop filter (ALF). The block reconstructed before the in-loop filter is applied will be referred to as the first reconstructed block, and the block reconstructed after the in-loop filter is applied will be referred to as the second reconstructed block. A second reconstructed block can be obtained by applying at least one blocking filter, SAO, or ALF to the first reconstructed block. In this case, SAO or ALF can be applied after the blocking filter has been applied. The deblocking filter is to reduce image quality degradation (blocking artifacts) that occur at the edge of the block when quantization is performed in blocks. To apply a blocking filter, the blocking force (BS) between the blocks is determined 120 are reconstructed first and neighboring reconstructed blocks can be determined. Figure 47 is a flow diagram showing the process of determining blocking strength. In the example shown in Figure 47, P represents the first reconstructed block, and Q represents the neighboring reconstructed block. Here, the reconstructed neighboring block can be either the block adjacent to the left or the top of the current block. In the example shown in Figure 47, it is shown that the blocking strength is determined by considering the predictive coding modes P and Q, whether non-zero transformation coefficients are included, whether the interprediction is carried out using the same reference image, or whether the difference value between the motion vectors is greater than or equal to the threshold value. Whether to apply a blocking filter can be determined based on the strength of the blocking. For example, filtering cannot be performed when the blocking strength is 0. SAO is to reduce ringing artifacts that occur when quantization is performed in the frequency domain. SAO can be performed by increasing or decreasing offsets determined by considering the pattern of the first reconstructed image. A method for determining offset includes edge offset (EO) or band offset (BO). EO indicates the method of determining the offset of the current sample according to the pattern of nearby pixels. BO shows a method of applying a general offset to a set of pixels that have similar brightness values ​​in a region. In detail, the pixel brightness is divided into 32 equal parts, and pixels with the same brightness value can be assigned as a set. For example, four adjacent bands among 32 bands can be assigned as one group, and the same offset value can be applied to samples belonging to the four bands. ALF is a method for generating a second reconstructed image by applying a filter of a predetermined size or shape to the first reconstructed image or to a reconstructed image in which the filter 121 deblocking applied. Equation 34 below is an example of the application of ALF. [Equation 34] a a _ / V S V' te—-$ Z— One of the predefined filter candidates can be selected in an image unit, coding tree unit, coding block, prediction block, or transformation block. Filter candidates may differ in size or shape. FIGURE 48 shows the filter candidates that have been determined. In the example shown in FIGURE 48, at least one of the 5*5 diamond shape, 7*7 diamond shape, or 9*9 diamond shape can be selected. Only 5*5 diamond shape can be used for chroma components. The application of the described embodiments focusing on the decoding process or encoding process to the decoding process or encoding process is included in the scope of the present invention. Changing the predetermined sequence, in which embodiments have been described, to a sequence different from that described above also falls within the scope of the present invention. Although the above embodiments have been described based on a series of steps or flows, the steps or flows do not limit the time series sequence of the present invention and can be performed simultaneously or in a different order as required. Also, individual components (e.g., units, modules, etc.) constituting a block diagram in the embodiments described above may be implemented by hardware or software, and a plurality of components may be combined and implemented by a single piece of hardware or software. The above embodiment can be implemented in the form of program instructions that can be executed via various computer elements and recorded on computer-readable recording media. Computer-readable recording media may include program instructions, data files, data structures, 122 and similar alone or in combination. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tape, optical media such as compact disc-read only memory (CD-ROM) and digital multipurpose discs (DVD), magneto-optical media such as floppy disks , and hardware such as ROM, random access memory (RAM), and flash memory, which are specifically designed to store and execute program instructions. The hardware device may be configured to operate as one or more software modules to perform the operations of the present invention 10, and vice versa. INDUSTRIAL APPLICABILITY This invention can be applied to electronic devices for video encoding or video surveillance.

Claims

1. A video surveillance method comprising: determining whether to separate a coding block into a first prediction unit and a second prediction unit; determining a partition type of a coding block when it is determined to separate a coding block; deriving first motion information regarding a first prediction unit in the coding block and second motion information regarding a second prediction unit in the coding block; and obtaining a prediction sample in the coding block based on the first motion information and the second motion information, wherein the first motion information regarding the first prediction unit is derived from a first combined candidate determined by first index information among a plurality of combined candidates included in a combined candidate list, and the second motion information regarding the second prediction unit is derived from a second combined candidate determined by second index information among a plurality of combined candidates included in the combined candidate list.

2. The video surveillance method according to claim 1, wherein when the second index information value is greater than or equal to the first index information value, the second combined candidate has an index equal to the second index information value plus one.

3. The video surveillance method according to claim 1, wherein when the second index information value is less than the first index information value, the second combined candidate has the same index as the second index information value.

4. The video surveillance method according to claim 1, wherein when a prediction sample is included in the boundary region between the first prediction unit and the second prediction unit, the prediction sample is derived based on a weighted sum operation of the first 124 prediction samples derived based on the first motion information and the second prediction sample derived based on the second motion information.

5. The video surveillance method according to claim 4, wherein the first weight applied to the first prediction sample is determined based on the x-coordinate and y-coordinate of the prediction sample.

6. The video surveillance method according to claim 5, wherein the second weight applied to the second prediction sample is derived by subtracting the first weight from a constant value.

7. The video surveillance method according to claim 4, wherein the size of the border region is determined based on at least one of the size of the coding block or the shape of the coding block.

8. A video encoding method comprising: determining whether to separate a coding block into a first prediction unit and a second prediction unit; determining a partition type of a coding block when it is determined to separate a coding block; deriving first motion information regarding a first prediction unit in a coding block and second motion information regarding a second prediction unit in a coding block;and obtaining a prediction sample in the coding block based on the first motion information and the second motion information, wherein the first motion information regarding the first prediction unit is derived from a first combined candidate among a plurality of combined candidates included in a combined candidate list, the second motion information regarding the second prediction unit is derived from a second combined candidate among a plurality of combined candidates included in the combined candidate list, and the first index information for determining the first combined candidate and the second index information for determining the second combined candidate are encoded respectively. 125; 9. The video encoding method according to claim 8, wherein when the second combined candidate index is greater than the first combined candidate index, the second index information is encoded with a value obtained by subtracting one of the second combined candidate indexes.

10. The video encoding method according to claim 8, wherein when the second combined candidate index is smaller than the first combined candidate index, the second index information is encoded with the second combined candidate index value.

11. The video encoding method according to claim 8, wherein when a prediction sample is included in the boundary region between the first prediction unit and the second prediction unit, the prediction sample is derived based on a weighted sum operation of the first prediction sample derived based on the first motion information and the second prediction sample derived based on the second motion information.

12. The video encoding method according to claim 11, wherein the first weight applied to the first prediction sample is determined based on the x-coordinate and y-coordinate of the prediction sample.

13. The video encoding method according to claim 12, wherein the second weight applied to the second prediction sample is derived by subtracting the first weight from a constant value.

14. The video encoding method according to claim 11, wherein the size of the boundary region is determined based on at least one of the size of the coding block or the shape of the coding block.

15. A video surveillance apparatus comprising: an inter-prediction unit configured to determine whether to separate a coding block into a first prediction unit and a second prediction unit, determining a partition type of the coding block when it is determined to separate the coding block, deriving first motion information regarding the first prediction unit in the coding block and 126 second motion information regarding the second prediction unit in the coding block, and obtaining prediction samples in the coding block based on the first motion information and the second motion information, wherein the first motion information regarding the first prediction unit is derived from a first combined candidate determined by the first index information among a plurality of combined candidates included in the combined candidate list,and the second motion information regarding the second prediction unit is derived from the second combined candidate 10 which is determined by the second index information among the number of combined candidates included in the combined candidate list.,