Image decoding methods and image encoding methods

VN127150APending Publication Date: 2026-07-15DOLBY INTERNATIONAL AB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
VN1202603680
Authority / Receiving Office
VN · VN
Patent Type
Applications
Current Assignee / Owner
Priority Date
2018-12-27
Filing Date
2019-12-27
Publication Date
2026-07-15

AI Technical Summary

Technical Problem

Current video compression technologies face challenges in efficiently encoding and decoding high-resolution and ultra-high-resolution stereoscopic video content, particularly in adapting prediction modes and reference-based prediction methods between components.

Method used

The method involves determining an intra prediction mode for a chrominance block, specifying a luminance region for reference, downsampling the region, and deriving parameters for reference between components, allowing for adaptive prediction using both intra and inter-component reference-based modes.

Benefits of technology

This approach improves encoding/decoding efficiency by segmenting directional modes and using selective pixel lines for intra prediction, and enhances inter prediction efficiency through affine mode and motion information, thereby optimizing reference-based prediction between components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202603680_0
    Figure VN1202603680_0
Patent Text Reader

Abstract

The invention relates to a device and method for encoding / decoding video that can determine the in-image prediction mode of a chromatic block, specify the luminance region for intercomponent reference of the chromatic block, desample the specified luminance region, derive parameters for intercomponent reference of the chromatic block, apply these parameters to the desampled luminance region, and thereby predict the chromatic block.
Need to check novelty before this filing date? Find Prior Art

Description

Video encoding / decoding method and device The present invention relates to a video signal processing method and apparatus. Market demand for high-resolution video is increasing, and consequently, there is a need for technology that can efficiently compress high-resolution video. In response to these market demands, the Moving Picture Expert Group (MPEG) of ISO / IEC and the Video Coding Expert Group (VCEG) of ITU-T jointly formed the Joint Collaborative Team on Video Coding (JCT-VC), completed the development of the High Efficiency Video Coding (HEVC) video compression standard in January 2013, and have been actively conducting research and development on next-generation compression standards. Video compression is broadly composed of intra-frame prediction (or intra prediction), inter-frame prediction (or inter prediction), transformation, quantization, entropy coding, and in-loop filters. Meanwhile, along with the increasing demand for high-resolution video, the demand for stereoscopic video content as a new video service is also increasing. Discussions are underway regarding video compression technologies to effectively provide high-resolution and ultra-high-resolution stereoscopic video content. The present invention aims to provide a method and apparatus for adaptively dividing a picture. The present invention aims to provide an intra-prediction method and apparatus. The present invention aims to provide an inter prediction method and apparatus. The present invention aims to provide a prediction method and value based on references between components. The video encoding / decoding method and apparatus according to the present invention determine an intra-prediction mode of a color difference block, specify a luminance region for inter-component referencing of the color difference block, downsample the specified luminance region, derive a parameter for inter-component referencing of the color difference block, and predict the color difference block using a luminance block corresponding to the color difference block and the parameter. In the video encoding / decoding method and apparatus according to the present invention, the luminance region may include at least one of a luminance block corresponding to the chrominance block or a neighboring region adjacent to the luminance block. In the video encoding / decoding method and apparatus according to the present invention, the intra-prediction mode of the chrominance block can be derived based on a predetermined group and index composed of a prediction mode based on inter-component reference. In the video encoding / decoding method and apparatus according to the present invention, the prediction mode based on inter-component reference may include at least one of a first mode that references both the left and upper regions adjacent to the color difference block, a second mode that references the left region adjacent to the color difference block, or a third mode that references the upper region adjacent to the color difference block. In the video encoding / decoding method and apparatus according to the present invention, the neighbor area adjacent to the luminance block includes at least one of an upper neighbor area and a left neighbor area, the upper neighbor area includes n pixel lines, and the left neighbor area may include m pixel lines. In the video encoding / decoding method and apparatus according to the present invention, downsampling of a neighboring region adjacent to the luminance block can be performed using only the luminance pixel at a specific location and the surrounding pixels of the luminance pixel. In the video encoding / decoding method and apparatus according to the present invention, the specific location may be determined based on the location of a selected pixel among a plurality of pixels belonging to the neighboring region of the color difference block. In the video encoding / decoding method and apparatus according to the present invention, the selected pixel may be one or more pixels located at predetermined intervals in the neighboring region of the color difference block. In the video encoding / decoding method and apparatus according to the present invention, the surrounding pixel may be a pixel located in at least one direction among the left, right, top, bottom, top-left, bottom-left, top-right, or bottom-right of the luminance pixel. In the video encoding / decoding method and apparatus according to the present invention, the step of deriving a parameter for inter-component referencing includes the step of calculating a maximum value and a minimum value from a plurality of pixels obtained through downsampling of neighboring regions of the luminance block, and the parameter for inter-component referencing can be derived using the calculated maximum value and minimum value. A digital storage medium according to the present invention may record / store a video decoding program that determines an intra-prediction mode of a color difference block, specifies a luminance region for reference between components of the color difference block, downsamples the specified luminance region, derives a parameter for reference between components of the color difference block, and performs a process of predicting the color difference block by applying the parameter to the downsampled luminance region. The present invention can improve the encoding / decoding efficiency of a video signal by dividing a picture into predetermined units and performing encoding / decoding. The present invention can improve the coding efficiency of intra prediction by using a subdivided directional mode and / or optional pixel lines. The present invention can improve the encoding efficiency of inter prediction by utilizing affine mode or inter-region motion information. The present invention can improve the efficiency of component-to-component reference-based prediction through downsampling / subsampling of the luminance region. FIG. 1 is a block diagram showing an image encoding device according to the present invention. FIG. 2 is a block diagram showing an image decoding device according to the present invention. FIGS. 3 to 5 illustrate a method of dividing a picture into a plurality of blocks as an embodiment to which the present invention is applied. FIG. 6 schematically illustrates the process of restoring the current block as an embodiment to which the present invention is applied. FIG. 7 illustrates an inter prediction method as an embodiment to which the present invention is applied. FIGS. 8 to 10 illustrate an affine inter prediction method as an embodiment to which the present invention is applied. FIG. 11 illustrates the range of spatial surrounding blocks for a merge mode as an embodiment to which the present invention is applied. FIGS. 12 to 18 illustrate a merge mode using movement information of an inter-region as an example to which the present invention is applied. FIGS. 19 and 20 illustrate an MPMM-based merge mode as an embodiment to which the present invention is applied. FIGS. 21 to 30 illustrate an intra-prediction method as an embodiment to which the present invention is applied. FIG. 31 illustrates a prediction method based on references between components as an embodiment to which the present invention is applied. FIGS. 32 to 38 illustrate a method for deriving parameters for downsampling and inter-component referencing for a peripheral area of ​​a luminance block as an embodiment to which the present invention is applied. FIGS. 39 and 40 illustrate a method of applying an in-loop filter to a restoration block as an embodiment to which the present invention is applied. The video encoding / decoding method and apparatus according to the present invention determine an intra-prediction mode of a color difference block, specify a luminance region for inter-component referencing of the color difference block, downsample the specified luminance region, derive a parameter for inter-component referencing of the color difference block, and predict the color difference block using a luminance block corresponding to the color difference block and the parameter. In the video encoding / decoding method and apparatus according to the present invention, the luminance region may include at least one of a luminance block corresponding to the chrominance block or a neighboring region adjacent to the luminance block. In the video encoding / decoding method and apparatus according to the present invention, the intra-prediction mode of the chrominance block can be derived based on a predetermined group and index composed of a prediction mode based on inter-component reference. In the video encoding / decoding method and apparatus according to the present invention, the prediction mode based on inter-component reference may include at least one of a first mode that references both the left and upper regions adjacent to the color difference block, a second mode that references the left region adjacent to the color difference block, or a third mode that references the upper region adjacent to the color difference block. In the video encoding / decoding method and apparatus according to the present invention, the neighbor area adjacent to the luminance block includes at least one of an upper neighbor area and a left neighbor area, the upper neighbor area includes n pixel lines, and the left neighbor area may include m pixel lines. In the video encoding / decoding method and apparatus according to the present invention, downsampling of a neighboring region adjacent to the luminance block can be performed using only the luminance pixel at a specific location and the surrounding pixels of the luminance pixel. In the video encoding / decoding method and apparatus according to the present invention, the specific location may be determined based on the location of a selected pixel among a plurality of pixels belonging to the neighboring region of the color difference block. In the video encoding / decoding method and apparatus according to the present invention, the selected pixel may be one or more pixels located at predetermined intervals in the neighboring region of the color difference block. In the video encoding / decoding method and apparatus according to the present invention, the surrounding pixel may be a pixel located in at least one direction among the left, right, top, bottom, top-left, bottom-left, top-right, or bottom-right of the luminance pixel. In the video encoding / decoding method and apparatus according to the present invention, the step of deriving a parameter for inter-component referencing includes the step of calculating a maximum value and a minimum value from a plurality of pixels obtained through downsampling of neighboring regions of the luminance block, and the parameter for inter-component referencing can be derived using the calculated maximum value and minimum value. A digital storage medium according to the present invention may record / store a video decoding program that determines an intra-prediction mode of a color difference block, specifies a luminance region for reference between components of the color difference block, downsamples the specified luminance region, derives a parameter for reference between components of the color difference block, and performs a process of predicting the color difference block by applying the parameter to the downsampled luminance region. Embodiments of the present invention are described in detail with reference to the drawings attached to this specification so that those skilled in the art can easily implement the invention. However, the present invention may be embodied in various different forms and is not limited to the embodiments described herein. Furthermore, in order to clearly explain the invention in the drawings, parts unrelated to the explanation have been omitted, and similar parts throughout the specification are denoted by similar reference numerals. Throughout this specification, when a part is described as being 'connected' to another part, this includes not only cases where they are directly connected, but also cases where they are electrically connected with other elements in between. Furthermore, throughout this specification, when a part is described as 'comprising' a certain component, this means that, unless specifically stated otherwise, it does not exclude other components but may include additional components. Additionally, terms such as "first," "second," etc., may be used to describe various components, but said components should not be limited by said terms. These terms are used solely for the purpose of distinguishing one component from another. Additionally, in the embodiments relating to the device and method described herein, some components of the device or some steps of the method may be omitted. Also, the order of some components of the device or some steps of the method may be changed. Additionally, other components or other steps may be inserted into some components of the device or some steps of the method. In addition, some components or steps of the first embodiment of the present invention may be added to or replace some components or steps of the second embodiment of the present invention. Furthermore, the components shown in the embodiments of the present invention are depicted independently to represent different characteristic functions and do not imply that each component consists of separate hardware or a single software unit. That is, for convenience of explanation, each component is described by listing it as a separate component, and at least two of the components may be combined to form a single component, or a single component may be divided into multiple components to perform a function. Such integrated and separated embodiments of each component are also included within the scope of the present invention as long as they do not deviate from the essence of the invention. In this specification, a block may be expressed in various ways such as a unit, region, unit, partition, etc., and a sample may be expressed in various ways such as a pixel, pel, pixel, etc. Hereinafter, embodiments of the present invention will be described in more detail with reference to the attached drawings. In describing the present invention, redundant descriptions of identical components are omitted. FIG. 1 is a block diagram showing an image encoding device according to the present invention. Referring to FIG. 1, a conventional image encoding device (100) may include a picture splitting unit (110), a prediction unit (120, 125), a conversion unit (130), a quantization unit (135), a reordering unit (160), an entropy encoding unit (165), an inverse quantization unit (140), an inverse conversion unit (145), a filter unit (150), and a memory (155). The picture splitting unit (110) can split the input picture into at least one processing unit. At this time, the processing unit may be a Prediction Unit (PU), a Transform Unit (TU), or a Coding Unit (CU). In the following embodiments of the present invention, the term "coding unit" may be used to mean a unit that performs coding, or a unit that performs decoding. A prediction unit may be divided into at least one square or rectangle of the same size within a single coding unit, or it may be divided such that one of the prediction units within a single coding unit has a different shape and / or size from another prediction unit. When generating a prediction unit that performs intra prediction based on a coding unit, if it is not the minimum coding unit, intra prediction can be performed without dividing into multiple prediction units NxN. The prediction unit (120, 125) may include an inter prediction unit (120) that performs inter prediction or inter-frame prediction, and an intra prediction unit (125) that performs intra prediction or intra-frame prediction. It may determine whether to use inter prediction or perform intra prediction for a prediction unit, and determine specific information according to each prediction method (e.g., intra prediction mode, motion vector, reference picture, etc.). The residual value (residual block) between the generated prediction block and the original block may be input to the conversion unit (130). In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded together with the residual value in the entropy encoding unit (165) and transmitted to the decoder. The inter prediction unit (120) may predict a prediction unit based on information of at least one picture among the previous picture or the subsequent picture of the current picture, and in some cases, may predict a prediction unit based on information of a partially encoded area within the current picture. The inter prediction unit (120) may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit. In the reference picture interpolation unit, reference picture information is received from memory (155), and pixel information of integer pixels or less can be generated from the reference picture. In the case of luminance pixels, a DCT-based 8-tap interpolation filter with different filter coefficients can be used to generate pixel information of integer pixels or less in 1 / 4 pixel units. In the case of chrominance signals, a DCT-based 4-tap interpolation filter with different filter coefficients can be used to generate pixel information of integer pixels or less in 1 / 8 pixel units. The motion prediction unit can perform motion prediction based on a reference picture interpolated by the reference picture interpolation unit. Various methods, such as FBMA (Full search-based Block Matching Algorithm), TSS (Three Step Search), and NTS (New Three-Step Search Algorithm), can be used to calculate motion vectors. Based on the interpolated pixels, the motion vector can have motion vector values ​​in units of 1 / 2 or 1 / 4 pixels. The motion prediction unit can predict the current prediction unit by using different motion prediction methods. Various methods, such as Skip Mode, Merge Mode, AMVP Mode, Intra Block Copy Mode, and Affine Mode, can be used as motion prediction methods. The intra prediction unit (125) can generate a prediction unit based on reference pixel information around the current block, which is pixel information within the current picture. If the surrounding block of the current prediction unit is a block that has performed inter prediction, and the reference pixel is a pixel that has performed inter prediction, the reference pixel included in the block that has performed inter prediction can be replaced with the reference pixel information of the surrounding intra prediction block. That is, if the reference pixel is not available, the unavailable reference pixel information can be replaced with at least one of the available reference pixels. Additionally, a residual block can be generated that includes residual value information, which is the difference between the prediction unit that performed the prediction based on the prediction unit generated in the prediction unit (120, 125) and the original block of the prediction unit. The generated residual block can be input to the conversion unit (130). In the transformation unit (130), the residual block containing residual value information of the prediction unit generated through the original block and the prediction unit (120, 125) can be transformed using a transformation method such as DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), or KLT. Whether to apply DCT, DST, or KLT 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. The quantization unit (135) can quantize the values ​​converted into the frequency domain in the conversion unit (130). The quantization coefficient may vary depending on the block or the importance of the image. The values ​​produced by the quantization unit (135) may be provided to the inverse quantization unit (140) and the reordering unit (160). The reordering unit (160) can perform reordering of coefficient values ​​for quantized residual values. The reordering unit (160) can convert two-dimensional block-shaped coefficients into one-dimensional vector forms through a coefficient scanning method. For example, the reordering unit (160) can convert the coefficients from DC to high-frequency range coefficients into one-dimensional vector forms by scanning using a Zig-Zag Scan method. Depending on the size of the conversion unit and the intra-prediction mode, a vertical scan that scans two-dimensional block-shaped coefficients in the column direction or a horizontal scan that scans two-dimensional block-shaped coefficients in the row direction may be used instead of the Zig-Zag Scan. That is, depending on the size of the conversion unit and the intra-prediction mode, it can be determined whether to use a Zig-Zag Scan, a vertical scan, or a horizontal scan. The entropy encoding unit (165) can perform entropy encoding based on the values ​​calculated by the reordering unit (160). Entropy encoding can use various encoding methods, such as, for example, Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding). In this regard, the entropy encoding unit (165) can encode residual value coefficient information of the encoding unit from the reordering unit (160) and the prediction unit (120, 125). Additionally, according to the present invention, it is possible to signal and transmit information indicating that motion information is derived and used in the decoder side, and information regarding the technique used for deriving motion information. In the inverse quantization unit (140) and inverse transformation unit (145), the values ​​quantized in the quantization unit (135) are inverse quantized, and the values ​​transformed in the transformation unit (130) are inverse transformed. The residual value generated in the inverse quantization unit (140) and inverse transformation unit (145) can be combined with the prediction unit predicted through the motion estimation unit, motion compensation unit, and intra prediction unit included in the prediction unit (120, 125) to generate a reconstructed block. The filter unit (150) may include at least one of a deblocking filter, an offset correction unit, and an Adaptive Loop Filter (ALF). The deblocking filter can remove block distortion caused by boundaries between blocks in the restored picture. The offset correction unit can correct the offset from the original image on a pixel-by-pixel basis for the image that has undergone deblocking. To perform offset correction for a specific picture, a method may be used in which pixels included in the image are divided into a certain number of regions, the region to be offset is determined, and the offset is applied to that region, or a method may be used in which the offset is applied by considering the edge information of each pixel. Adaptive Loop Filtering (ALF) may be performed based on a value obtained by comparing the filtered restored image with the original image. After dividing the pixels included in the image into a predetermined group, a filter to be applied to that group is determined, and filtering may be performed differentially for each group. The memory (155) can store a restored block or picture produced through the filter unit (150), and the stored restored block or picture can be provided to the prediction unit (120, 125) when performing inter-prediction. FIG. 2 is a block diagram showing an image decoding device according to the present invention. Referring to FIG. 2, the image decoder (200) may include an entropy decoder (210), a reordering unit (215), an inverse quantization unit (220), an inverse transformation unit (225), a prediction unit (230, 235), a filter unit (240), and a memory (245). When a video bitstream is input to a video encoder, the input bitstream can be decoded using the reverse procedure of the video encoder. The entropy decoding unit (210) can perform entropy decoding in the opposite procedure to that which the entropy encoding unit of the image encoder performed. For example, various methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) can be applied in correspondence with the method performed in the image encoder. The entropy decoding unit (210) can decode information related to intra-prediction and inter-prediction performed in the encoder. The reordering unit (215) can perform reordering based on the method of reordering the entropy-decoded bitstream in the encoding unit in the entropy decoding unit (210). The coefficients expressed in the form of a one-dimensional vector can be reordered by restoring them to the form of two-dimensional block coefficients. The inverse quantization unit (220) can perform inverse quantization based on the coefficient values ​​of the rearranged block and the quantization parameters provided by the encoder. The inverse transform unit (225) can perform inverse transforms, i.e., inverse DCT, inverse DST, and inverse KLT, on the transforms, i.e., DCT, DST, and KLT, performed by the transform unit on the quantization result performed by the image encoder. The inverse transform can be performed based on the transmission unit determined by the image encoder. In the inverse transform unit (225) of the image decoder, a transformation technique (e.g., DCT, DST, KLT) can be selectively performed according to multiple pieces of information such as a prediction method, the size of the current block, and the prediction direction. The prediction unit (230, 235) can generate a prediction block based on the prediction block generation information provided by the entropy decoding unit (210) and the previously decoded block or picture information provided by the memory (245). As described above, when performing intra prediction or intra-frame prediction identical to the operation in the video encoder, if the size of the prediction unit and the size of the transform unit are the same, intra prediction for the prediction unit is performed based on the pixels to the left of the prediction unit, the pixels to the top left, and the pixels to the top; however, if the size of the prediction unit and the size of the transform unit are different when performing intra prediction, intra prediction can be performed using reference pixels based on the transform unit. Additionally, intra prediction using NxN partitioning only for the minimum encoding unit may also be used. The prediction unit (230, 235) may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit determination unit receives various information, such as prediction unit information input from the entropy decoding unit (210), prediction mode information of the intra prediction method, and motion prediction related information of the inter prediction method, distinguishes the prediction unit in the current encoding unit, and determines whether the prediction unit performs inter prediction or intra prediction. On the other hand, if the encoder (100) does not transmit motion prediction related information for the inter prediction, but instead transmits information indicating that motion information is derived and used from the decoder side and information regarding the technique used for deriving motion information, the prediction unit determination unit determines whether the inter prediction unit (230) performs prediction based on the information transmitted from the encoder (100). The inter prediction unit (230) can perform inter prediction for the current prediction unit based on information included in at least one picture, either a previous picture or a subsequent picture, of the current picture containing the current prediction unit, using information required for inter prediction of the current prediction unit provided by the video encoder. To perform inter prediction, based on the encoding unit, it can determine whether the motion prediction method of the prediction unit included in the corresponding encoding unit is a Skip Mode, Merge Mode, AMVP Mode, Intra Block Copy Mode, or Affine Mode. The intra prediction unit (235) can generate a prediction block based on pixel information within the current picture. If the prediction unit is a prediction unit that has performed intra prediction, it can perform intra prediction based on the intra prediction mode information of the prediction unit provided by the image encoder. The intra prediction unit (235) may include an Adaptive Intra Smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a part that performs filtering on the reference pixels of the current block, and can determine whether to apply the filter based on the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block using the prediction mode of the prediction unit and AIS filter information provided by the image encoder. If the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied. The reference pixel interpolation unit can generate a reference pixel of an integer value or less by interpolating the reference pixel when the prediction mode of the prediction unit is a prediction unit that performs intra-prediction based on the pixel value interpolated from the reference pixel. If the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. The DC filter can generate a prediction block through filtering when the prediction mode of the current block is DC mode. The restored block or picture may be provided to a filter unit (240). The filter unit (240) may include a deblocking filter, an offset correction unit, and an ALF. Information regarding whether a deblocking filter has been applied to the corresponding block or picture can be received from the video encoder, and if a deblocking filter has been applied, information regarding whether a strong filter or a weak filter has been applied. The deblocking filter of the video decoder receives information related to the deblocking filter provided by the video encoder and can perform deblocking filtering on the corresponding block. The offset correction unit can perform offset correction on the restored image based on the type of offset correction and offset value information applied to the image during encoding. ALF can be applied to the encoding unit based on information on whether ALF is applied and ALF coefficient information provided by the encoder. This ALF information can be provided included in a specific parameter set. The memory (245) can store the restored picture or block so that it can be used as a reference picture or reference block, and can also provide the restored picture to the output unit. FIGS. 3 to 5 illustrate a method of dividing a picture into a plurality of blocks as an embodiment to which the present invention is applied. Referring to FIG. 3, the picture (300) is divided into a plurality of basic coding units (Coding Tree Unit, hereinafter CTU). The size of a CTU can be defined on a picture or video sequence basis, and each CTU is configured so as not to overlap with other CTUs. For example, the CTU size can be set to 128x128 for the entire sequence, and on a picture basis, any one of 128x128 to 256x256 can be selected and used. Coding blocks / Coding units (hereinafter CU) can be generated by hierarchically dividing the CTU. Prediction and transformation can be performed at the coding unit level, and it serves as the basic unit for determining the prediction coding mode. The prediction coding mode indicates a method for generating a prediction image, and examples include intra prediction (hereinafter intra prediction), inter prediction (hereinafter inter prediction), or combined prediction. Specifically, for example, a prediction block can be generated at the coding unit level using at least one of the prediction coding modes among intra prediction, inter prediction, or combined prediction. In the inter prediction mode, if the reference picture points to the current picture, the prediction block can be generated based on the region within the current picture that has already been decoded. This can be included in inter prediction because the prediction block is generated using the reference picture index and the motion vector. Intra prediction is a method of generating a prediction block using information from the current picture, inter prediction is a method of generating a prediction block using information from another picture that has already been decoded, and composite prediction is a method of using a combination of inter prediction and intra prediction. In composite prediction, some of the multiple sub-regions constituting a single coding block may be encoded / decoded using inter prediction, and the remaining regions may be encoded / decoded using intra prediction. Alternatively, composite prediction may perform inter prediction first on multiple sub-regions and perform intra prediction secondarily. In this case, the prediction value of the coding block may be derived by taking a weighted average of the prediction value based on inter prediction and the prediction value based on intra prediction. The number of sub-regions constituting a single coding block may be two, three, four, or more, and the shape of the sub-regions may be a rectangle, a triangle, or other polygon. Referring to Fig. 4, the CTU can be partitioned into a quad tree, binary tree, or triple tree. The partitioned blocks can be further partitioned into a quad tree, binary tree, or triple tree. The method of dividing the current block into four square partitions is called quad tree partitioning, the method of dividing the current block into two square or non-square partitions is called binary tree partitioning, and the method of dividing the current block into three partitions is called binary tree partitioning. Binary partitioning in the vertical direction (SPLIT_BT_VER in Fig. 4) is called vertical binary tree partitioning, and binary tree partitioning in the horizontal direction (SPLIT_BT_HOR in Fig. 4) is called horizontal binary tree partitioning. Triple partitioning in the vertical direction (SPLIT_TT_VER in Fig. 4) is called vertical triple tree partitioning, and triple tree partitioning in the horizontal direction (SPLIT_TT_HOR in Fig. 4) is called horizontal triple tree partitioning. The number of partitions is called the partitioning depth, and the maximum partitioning depth can be set differently for each sequence, picture, subpicture, slice, or tile, and can be set to have different partitioning depths depending on the partitioning tree type (quad tree / binary tree / triple tree), and can signal a syntax indicating this. By methods such as quad tree partitioning, binary tree partitioning, or other multi-tree partitioning (e.g., binary tree partitioning), the partitioned coding unit may be further partitioned to form the coding unit of the leaf node, or the coding unit of the leaf node may be formed without further partitioning. Referring to Fig. 5, coding units can be configured by hierarchically dividing a single CTU, and coding units can be divided using at least one of binary tree partitioning, quad tree partitioning, or triple tree partitioning. This method is called multi tree partitioning. A coding unit created by partitioning an arbitrary coding unit with a partitioning depth of k is called a sub-coding unit, and the partitioning depth becomes (k+1). A coding unit with a partitioning depth of k that contains a sub-coding unit with a partitioning depth of (k+1) is called a super-coding unit. The partitioning type of the current coding unit may be restricted depending on the partitioning type of the parent coding unit and / or the partitioning type of the coding units surrounding the current coding unit. Here, the partitioning type indicates an indicator that shows which partitioning method was used: binary tree partitioning, quad tree partitioning, or triple tree partitioning. FIG. 6 schematically illustrates the process of restoring the current block as an embodiment to which the present invention is applied. Referring to FIG. 6, a prediction block of the current block can be generated based on a pre-defined prediction mode in the encoding / decoding device (S600). In video encoding / decoding, predicted images can be generated in multiple ways, and the method of generating predicted images is called the predictive encoding mode. Predictive coding modes can be composed of intra-predictive coding modes, inter-predictive coding modes, current picture reference coding modes, or combined prediction modes. Inter-predictive coding mode is a predictive coding mode that generates a predictive block (predicted image) of the current block using information from the previous picture, while intra-predictive coding mode is a predictive coding mode that generates a predictive block using samples adjacent to the current block. A predictive block can also be generated using an already restored image of the current picture, which is called the current picture reference mode or intra-block copy mode. Predicted blocks may be generated using at least two of the following prediction modes: inter-predicted coding mode, intra-predicted coding mode, or current picture reference coding mode, and this is called combined prediction. Inter-predictive coding modes will be examined in detail with reference to FIGS. 7 to 20, and intra-predictive coding modes will be examined in detail with reference to FIGS. 21 to 38. Referring to FIG. 6, a transformation block of the current block can be generated through a predetermined transformation (S610). The image obtained by differentiating the predicted image from the original image is called the residual image or transform block. The residual image can be decomposed into binary frequency components through a 2D transformation such as the Discrete Cosine Transform (DCT). It has the characteristic that removing high-frequency components from the image does not cause significant visual distortion. By setting the values ​​corresponding to high frequencies to small or zero, compression efficiency can be greatly increased without significant visual distortion. Depending on the size of the prediction block or the prediction mode, the Discrete sine transform (DST) may be used. Specifically, for example, if the prediction mode is intra and the size of the prediction block / coding block is smaller than NxN, the DST transformation may be configured to be used, and for other prediction blocks / coding blocks, the DCT may be configured to be used. DCT is a process that decomposes (transforms) an image into two-dimensional frequency components using a cosine transform, and these frequency components are represented as the basis image. For example, if a DCT transformation is performed on an NxN block, N 2 One can obtain basic pattern components. Performing a DCT transformation means determining the magnitude of each basic pattern component contained in the original pixel block. The magnitude of each basic pattern component is called a DCT coefficient. Generally, the Discrete Cosine Transform (DCT) is mainly used for images where there are many non-zero components at low frequencies, and the Discrete Sine Transform (DST) can be used for images where there are many high-frequency components. DST represents a process that decomposes (transforms) an image into two-dimensional frequency components using a sine transformation. A two-dimensional image can be decomposed (transformed) into two-dimensional frequency components using transformation methods other than DCT or DST transformation, and this is called two-dimensional image transformation. In certain blocks of the residual image, 2D image transformation may not be performed, and this is called a transform skip. Quantization can be applied after the transform skip. Any block within a 2D image can be subjected to DCT, DST, or 2D image transformation, and the transformation used is called the first transformation. After performing the first transformation, a transformation can be performed again in a part of the transformed block, and this is called the second transformation. The first transformation may use one of a plurality of transformation cores. Specifically, for example, any one of DCT2, DCT8, or DST7 may be selected and used in the transformation block. Alternatively, different transformation cores may be used for the horizontal transformation and the vertical transformation of the transformation block. The block units for performing the first transformation and the second transformation may be set differently. Specifically, for example, the first transformation may be performed on an 8x8 block of the residual image, and then the second transformation may be performed on each 4x4 sub-block. As another example, the first transformation may be performed on each 4x4 block, and then the second transformation may be performed on each 8x8 block. The residual image to which the first transformation is applied is called the first transformed residual image. A DCT, DST, or 2D image transformation can be applied to the first transformed residual image, and the transformation used in this case is called the second transformation. The 2D image to which the second transformation is applied is called the second transformed residual image. The sample values ​​within a block after performing the first and / or second transformation are called transformation factors. Quantization refers to the process of dividing transformation factors by predefined values ​​to reduce the energy of a block. The values ​​defined to apply quantization to transformation factors are called quantization parameters. Predefined quantization parameters can be applied in sequence units or block units. Typically, quantization parameters can be defined with values ​​between 1 and 51. After performing transformation and quantization, a residual reconstruction image can be generated by performing inverse quantization and inverse transformation. A first reconstruction image can be generated by adding a prediction image to the residual reconstruction image. A transformation block may be generated based on at least one of n transformation types predefined in the encoding / decoding device. n may be an integer of 1, 2, 3, 4, or more. As the transformation types, DCT2, DCT8, DST7, transformation skip mode, etc., may be used. Only one identical transformation type may be applied to the vertical and horizontal directions of a block, or different transformation types may be applied to each of the vertical and horizontal directions. To this end, a flag indicating whether one identical transformation type is applied may be used. The flag may be signaled by the encoding device. Additionally, the above-mentioned transformation type may be determined based on information signaled by the encoding device or based on a predetermined encoding parameter. Here, the encoding parameter may mean at least one of the block size, shape, intra-prediction mode, or component type (e.g., luminance, chrominance). The block size may be expressed as width, height, ratio of width to height, product of width to height, sum / difference of width and height, etc. For example, if the current block size is greater than a predetermined threshold value, the horizontal transformation type may be determined as a first transformation type (e.g., DCT2), and the vertical transformation type may be determined as a second transformation type (e.g., DST7). The threshold value may be an integer of 0, 4, 8, 16, 32, or greater. Meanwhile, the residual coefficient according to the present invention may be obtained by performing a second transformation after the first transformation. The second transformation may be performed on the residual coefficient of a portion of the current block. In this case, the decoding device may obtain a transformed block of the current block by performing a second inverse transformation on the portion of the current block and performing a first inverse transformation on the current block including the inversely transformed portion of the current block. Referring to FIG. 6, the current block can be restored based on the prediction block and the transformation block (S620). A predetermined in-loop filter may be applied to the restored current block. The in-loop filter may include at least one of a deblocking filter, a sample adaptive offset (SAO) filter, or an adaptive loop filter (ALF), which will be examined with reference to FIGS. 39 and FIGS. 40. FIG. 7 illustrates an inter prediction method as an embodiment to which the present invention is applied. The method of generating a predicted block (predicted image) of a block in the current picture using information from the previous picture is called the inter-predictive coding mode or inter-mode. For example, a predicted image can be generated based on the corresponding block (colocated block / co-located block) of the previous picture, or a predicted block (predicted image) can be generated based on a specific block of the previous picture. Here, a specific block can be derived from a motion vector. A block at the same location represents a block of the corresponding picture that has the same position and size as the current block and the top-left sample, as shown in FIG. 7. The corresponding picture can be identified from syntax such as a reference picture reference. In inter-predictive coding mode, prediction blocks can be generated by considering the movement of objects. For example, if it is known which direction and how far an object in the previous picture has moved in the current picture, a prediction block (predicted image) can be generated by subtracting the block that considers movement from the current block; this is called a motion prediction block. Residual blocks can be generated from the current block by using motion prediction blocks or by differencing them. If motion occurs in an object, using motion prediction blocks instead of the corresponding prediction blocks can reduce the energy of the residual blocks, thereby improving compression performance. This method of using motion prediction blocks is called motion-compensated prediction, and most inter-prediction coding systems utilize motion-compensated prediction. A value indicating the direction and degree of movement of an object in the previous picture within the current picture is called a motion vector. Motion vectors with different pixel precisions can be used in units of sequences, pictures, sub-pictures, slices, tiles, CTUs, or CUs. For example, the pixel precision of a motion vector in a specific block may be at least one of 1 / 16, 1 / 8, 1 / 4, 1 / 2, 1, 2, 4, or 8. Depending on the inter-prediction coding mode described below, the types and / or number of available pixel precision candidates may differ. For example, k pixel precisions are available for the affine inter-prediction method, and i pixel precisions are available for the inter-prediction method using translation motion. For the current picture reference mode, j pixel precisions are available. Here, k, i, and j may be natural numbers 1, 2, 3, 4, 5, or greater. However, k may be smaller than i, and i may be smaller than j. An affine inter prediction method may use at least one pixel precision of 1 / 16, 1 / 4, or 1, and an inter prediction method using translation motion (e.g., merge mode, AMVP mode) may use at least one pixel precision of 1 / 4, 1 / 2, 1, or 4. A current picture reference mode may use at least one pixel precision of 1, 4, or 8. For the inter prediction mode, an inter prediction method using translation motion and an affine inter prediction method using affine motion may be optionally used. As for the inter prediction method using translation motion, merge mode or AMVP mode may be used. FIGS. 8 to 10 illustrate an affine inter prediction method as an embodiment to which the present invention is applied. There are many cases where the movement of a specific object in a video does not appear linearly. For example, in a video where affine motion is used, such as camera zoom-in, zoom-out, rotation, and affine transformations that enable transformation into arbitrary forms as shown in Fig. 8, if only translation motion vectors are used to represent the movement of the object, the movement of the object cannot be effectively represented, and encoding performance may be reduced. Affine movement can be expressed as shown in the following mathematical equation 1. [Mathematical Formula 1] v x =ax-by+e v y =cx+dy+f Representing affine motion using a total of six parameters is effective for videos with complex motion, but encoding efficiency may decrease because a large number of bits are used to encode the affine motion parameters. Accordingly, affine motion can be simplified and expressed using four parameters, and this is called the 4-parameter affine motion model. Equation 2 represents affine motion using four parameters. [Mathematical Formula 2] v x =ax-by+e v y =bx+ay+f A 4-parameter affine motion model may include motion vectors at two control points of the current block. The control points may include at least one of the top-left corner, top-right corner, or bottom-left corner of the current block. For example, as shown in the left figure of FIG. 9, a 4-parameter affine motion model can be determined by a motion vector sv0 at the top-left sample (x0,y0) of the coding unit and a motion vector sv1 at the top-right sample (x1,y1) of the coding unit, and sv0 and sv1 are called affine seed vectors. Hereinafter, the affine seed vector sv0 located at the top-left is assumed to be the first affine seed vector, and the affine seed vector sv1 located at the top-right is assumed to be the second affine seed vector. In a 4-parameter affine motion model, it is also possible to replace one of the first and second affine seed vectors with the affine seed vector located at the bottom left. The 6-parameter affine motion model is an affine motion model in which the motion vector sv2 of a residual control point (e.g., sample (x2,y2) at the bottom left) is added to the 4-parameter affine motion model as shown in the right figure of Fig. 9. Hereinafter, the affine seed vector sv0 located at the top left is assumed to be the first affine seed vector, the affine seed vector sv1 located at the top right is assumed to be the second affine seed vector, and the affine seed vector sv2 located at the bottom left is assumed to be the third affine seed vector. Information regarding the number of parameters for expressing affine motion may be encoded in the bitstream. For example, a flag indicating whether to use 6-parameters and a flag indicating whether to use 4-parameters may be encoded in at least one of a picture, sub-picture, slice, tile group, tile, coding unit, or CTU. Accordingly, either a 4-parameter affine motion model or a 6-parameter affine motion model may be selectively used in a given unit. Motion vectors can be derived for each sub-block of a coding unit using an affine seed vector as shown in Fig. 10, and this is called an affine sub-block vector. An affine sub-block vector may be derived as shown in the following mathematical equation 3. Here, the reference sample position (x,y) of the sub-block may be a sample located at the corner of the block (e.g., top-left sample) or a sample where at least one of the x-axis or y-axis is the center (e.g., center sample). [Mathematical Formula 3] Motion compensation can be performed at the coding unit level or at the sub-block level within the coding unit using affine sub-block vectors, and this is called the affine inter-prediction mode. In Equation 3, (x1-x0) can have a value equal to the width of the coding unit. FIG. 11 illustrates the range of spatial surrounding blocks for a merge mode as an embodiment to which the present invention is applied. The motion information (motion vector, reference picture index, etc.) of the current coding unit can be derived from the motion information of surrounding blocks without being encoded. The motion information of any of the surrounding blocks can be set as the motion information of the current coding unit, and this is called merge mode. Referring to FIG. 11, the surrounding blocks used in merge mode may be blocks adjacent to the current coding unit (blocks touching the boundary of the current coding unit), such as indices 0 to 4, or blocks not adjacent to the current coding unit, such as indices 5 to 26 of FIG. 11. In the case of merge mode, a merge candidate list including at least one of the surrounding blocks can be configured. Based on the merge index, any one of the multiple merge candidates belonging to the merge candidate list is specified, and the movement information of the specified merge candidate can be set as the movement information of the current coding unit. FIGS. 12 to 18 illustrate a merge mode using movement information of an inter-region as an example to which the present invention is applied. In the current picture, motion information (motion vector and reference picture index) of coding units already encoded by inter-prediction can be stored in a pre-defined list (buffer), which is called the inter-region motion information list. Motion information (at least one of a motion vector or a reference picture index) in the inter-area motion information list is called an inter-area motion candidate. Candidates for inter-region movements can be used as merge candidates for the current coding unit, and to this end, at least one of the inter-region movement candidates can be added to the merge candidate list of the current coding unit. This method is called the inter-region merge method. The above inter-region motion information list may be initialized in units of any one of a picture, slice, tile, CTU row, or CTU. Initialization may mean that the list is empty. Motion information from a portion of a picture that has been encoded and / or decoded may be added to the inter-region motion information list. Initial inter-region motion candidates of the inter-region motion information list may also be signaled at at least one level among a sequence, picture, sub-picture, slice, or tile. When a coding unit is encoded / decoded by inter prediction, the motion information of the coding unit can be updated in the inter-region motion information list as shown in FIG. 12. When the number of inter-region motion candidates in the inter-region motion information list is at its maximum value, the smallest value (the motion information added to the inter-region motion information list first) in the index of the inter-region motion information list can be removed, and the most recently encoded / decoded inter-region motion information can be added to the inter-region motion information list. If the most recent movement information is identical to movement information already added to the list, the most recent movement information may not be added to the list. Alternatively, the movement information identical to the most recent movement information may be removed from the list, and the most recent movement information may be added. In this case, the most recent movement information may be added to the last position of the list. The motion vector mvCand of the decoded coding unit can be updated in the inter-region motion information list HmvpCandList. In this case, if the motion information of the decoded coding unit is the same as any of the motion information in the inter-region motion information list (where both the motion vector and the reference index are the same), the inter-region motion information list may not be updated, or the motion vector mvCand of the decoded coding unit may be stored at the very end of the inter-region motion information list as shown in FIG. 14. In this case, if the index of HmvpCandList that has motion information equal to mvCand is hIdx, HMVPCandList[i] may be set to HVMPCandList[i-1] for all i greater than hIdx as shown in FIG. 14. If a sub-block merge candidate is used in the currently decoded coding unit, the motion information of the representative sub-block within the coding unit may be stored in the inter-region motion information list. For example, the representative subblock within the coding unit may be set as the upper-left subblock within the coding unit as shown in FIG. 13, or as the middle subblock within the coding unit. Sub-block unit merge candidates can be induced as follows: 1. An initial shift vector (shVector) can be derived from the motion vector of the surrounding merge candidate blocks of the current block. Here, the surrounding merge candidate blocks may be any one of the left, top, bottom-left, top-right, or top-left blocks of the current block. Alternatively, only the left or top block of the current block may be set to be used in a fixed manner. 2. A shift sub-block with the position of the top-left sample (xColSb, yColSb) can be derived by adding the initial shift vector to the top-left sample (xSb, ySb) of the sub-block within the coding unit as shown in Equation 4. [Mathematical Formula 4] (xColSb, yColSb) = (xSb + shVector[0]>> 4,ySb+shVector[1]>> 4) 3. The motion vector of the collocated block corresponding to the center position of the sub-block containing (xColSb, yColSb) can be derived into the motion vector of the sub-block containing the top-left sample (xSb, ySb). A total of NumHmvp pieces of movement information can be stored in the inter-area movement information list, and NumHmvp is referred to as the size of the inter-area movement information list. The size of the inter-area motion information list can use a predefined value. The size of the inter-area motion information list can also be signaled to the sequence, picture, sub-picture, slice header, and / or tile header. For example, the size of the inter-area motion information list can be defined as 16, or as 4, 5, 6, etc. If a coding unit that has completed encoding / decoding is an inter-predicted and has an affine motion vector, it may not be included in the inter-region motion information list. Alternatively, if the coding unit that has completed encoding / decoding is an inter-prediction and possesses an affine motion vector, the affine sub-block vector may be added to the inter-region motion information list. In this case, the position of the sub-block may be set to the top-left, top-right, or center sub-block, etc. Alternatively, the average value of the motion vectors of each control point may be added to the inter-region motion candidate list. If the motion vector MV0 derived by encoding / decoding a specific coding unit is identical to any of the inter-region motion candidates, MV0 may not be added to the inter-region motion information list. Alternatively, existing inter-region motion candidates having the same motion vector as MV0 may be deleted, and MV0 may be newly included in the inter-region motion information list, thereby updating the index assigned to MV0. In addition to the Inter-area Motion Information List, you can also configure the Inter-area Motion Information Long-term List HmvpLTList. The size of the Inter-area Motion Information Long-term List can be set to be equal to the size of the Inter-area Motion Information List or set to a different value. The Inter-Area Movement Information Long-Term List can be composed of Inter-Area Merge candidates initially added at the tile group start position. The Inter-Area Movement Information Long-Term List can be configured after it is composed entirely of available values, or the movement information within the Inter-Area Movement Information List can be set as the movement information in the Inter-Area Movement Information Long-Term List. At this time, the inter-region movement information long-term list configured once may be configured not to perform updates, to be updated again when the decrypted area among the tile groups is more than half of the total tile group, or to be updated every m CTU lines. The inter-region movement information list may be configured to be updated whenever it is decrypted into an inter-region, or to be updated on a CTU line basis. Movement information and the partition information or shape of the coding unit may also be stored in the inter-region movement information list. An inter-region merge method may also be performed using only inter-region movement candidates that are similar to the current coding unit in terms of partition information and shape. Alternatively, an inter-region movement information list can be configured individually depending on the block type. In this case, one of multiple inter-region movement information lists can be selected and used depending on the current block type. As shown in FIG. 15, it may be composed of an inter-region affine motion information list and an inter-region motion information list. When the decoded coding unit is in affine inter or affine merge mode, the first affine seed vector and the second affine seed vector may be stored in the inter-region affine motion information list HmvpAfCandList. Motion information in the inter-region affine motion information list is called an inter-region affine merge candidate. The merge candidates available in the current coding unit can be configured as follows and may have a search order similar to the configuration order. 1. Spatial merge candidates (A1, B1, B0, A0) 2. Temporal merge candidates (merge candidates derived from the previous reference picture) 3. Spatial merge candidate (B2) 4. Inter-region merge candidates 5. Inter-region affine merge candidates 6. Zero motion merge candidate First, the merge candidate list, mergeCandList, can be composed of spatial merge candidates and temporal merge candidates. The number of available spatial and temporal merge candidates is called the number of available merge candidates (NumMergeCand). If the number of available merge candidates is less than the maximum allowed number of merges, movement candidates from the inter-region movement information list can be added to the merge candidate list, mergeCandList, as inter-region merge candidates. When adding the inter-region movement information list HmvpCandList to the merge candidate list mergeCandList, you can check whether the movement information of the inter-region movement candidate within the inter-region movement information list is identical to the movement information in the existing merge candidate list mergeCandList. If the movement information is identical, it is not added to the merge list mergeCandList; if the movement information is not identical, the inter-region merge candidate can be added to the merge list mergeCandList. For example, when adding the most recently updated movement information (HmvpCandList[n]) of HmvpCandList to the merge candidate list (mergeCandList), a duplicate check can be performed on any L of the elements in mergeCandList. In this case, L is a positive integer greater than 0, and for example, if L is 2, the duplicate check can be performed on the first and second movement information of mergeCandList. For example, a redundancy check between HmvpCandList and mergeCandList may be performed on some of the merge candidates of mergeCandList and some of the movement candidates of HmvpCandList. Here, some of the mergeCandList may include the left block and the top block among the spatial merge candidates. However, it is not limited thereto and may be limited to any one of the blocks among the spatial merge candidates, or may additionally include at least one of the bottom-left block, top-right block, top-left block, or temporal merge candidates. Meanwhile, some of the HmvpCandList may refer to the K inter-region movement candidates most recently added to HmvpCandList. Here, K is 1, 2, 3, or more, and may be a fixed value pre-agreed upon by the encoding / decoding device. Assume that 5 inter-region movement candidates are stored in HmvpCandList and that an index from 1 to 5 is assigned to each inter-region movement candidate. A larger index indicates a recently stored inter-region movement candidate. At this time, duplicates can be checked between the inter-region movement candidates with indices 5, 4, and 3 and the merge candidates of the mergeCandList. Alternatively, duplicates can be checked between the inter-region movement candidates with indices 5 and 4 and the merge candidates of the mergeCandList. Or, the most recently added inter-region movement candidate with index 5 can be excluded, and duplicates can be checked between the inter-region movement candidates with indices 4 and 3 and the merge candidates of the mergeCandList. As a result of the duplicate check, if even one identical inter-region movement candidate exists, the movement candidate of HmvpCandList may not be added to the mergeCandList. On the other hand, if no identical inter-region movement candidate exists, the movement candidate of HmvpCandList may be added to the last position of the inter-region movement information list.At this time, move candidates recently stored in HmvpCandList can be added to mergeCandList in the order of their indices (i.e., from largest to smallest). However, the most recently stored move candidate in HmvpCandList (the move candidate with the largest index) may be restricted from being added to mergeCandList. Candidates for inter-region movements can be added to the merge candidate list mergeCandList starting from the largest index, and the following process can be used. For each candidate in HMVPCandList with index HMVPIdx = 1.. numCheckedHMVPCand, the following ordered steps are repeated until combStop is equal to true - sameMotion is set to false - If HMVPCandList[NumHmvp - HMVPIdx] have the same motion vectors and the same reference indices with any mergeCandList[i] with i being 0… numOrigMergeCand - 1 and HasBeenPruned[i] equal to false, sameMotion is set to true - If sameMotion is equal to false, mergeCandList[numCurrMergeCand++] is set to HMVPCandList[NumHmvp - HMVPIdx] - If numCurrMergeCand is equal to (MaxNumMergeCand-1), hmvpStop is set to TRUE If the movement information of the inter-region movement candidate HmvpCandList[i] with index i is the same as that of the merge candidate list mergeCandList[j] with index j, then mergeCandList[j] can be configured not to be compared when comparing whether the movement information of HmvpCandList[i-1] is the same as in Fig. 16. Alternatively, the movement information of the inter-region movement candidate in HmvpCandList can be compared with the movement information of the merge candidate in the merge candidate list. For example, as shown in FIG. 17, the movement information of the inter-region movement candidate can be compared with the N merge candidates with the largest indices in the merge candidate list. Even if the list of inter-area movement information is added to the merge candidate list, if it is smaller than the maximum number of merges allowed in the tile group (hereinafter, maximum number of merges allowed), the inter-area movement information long-term list can be used as shown in FIG. 18, and the following process can be used. For each candidate in HMVPCandList with index HMVPLTIdx = 1.. numHMVPLTCand, the following ordered steps are repeated until combStop is equal to true - sameMotion is set to FALSE - if hmvpStop is equal to FALSE and numCurrMergecand is less than (MaxNumMergeCand-1), hvmpLT is set to TRUE - If HMVPLTCandList[NumLTHmvp - HMVPLTIdx] have the same motion vectors and the same reference indices with any mergeCandList[i] with i being 0… numOrigMergeCand - 1 and HasBeenPruned[i] equal to false, sameMotion is set to true - If sameMotion is equal to false, mergeCandList[numCurrMergeCand++] is set to HMVPLTCandList[NumLTHmvp - HMVPLTIdx] - If numCurrMergeCand is equal to (MaxNumMergeCand-1), hmvpLTStop is set to TRUE Inter-domain motion candidates can be used as Motion Vector Predator (MVP) candidates for the current coding unit, and this method is called the inter-domain motion prediction method. Inter-domain affine motion candidates can be used as Motion Vector Predator (MVP) candidates for the current coding unit, and this method is called the inter-domain motion affine prediction method. The motion information predictor candidates available in the current coding unit can be configured as follows and may have a search order similar to the configuration order. 1. Spatial motion predictor candidates (identical to coding block adjacent merge candidates and coding block non-adjacent merge candidates) 2. Temporal motion predictor candidates (motion predictor candidates derived from the previous reference picture) 3. Inter-region motion predictor candidates 4. Inter-region affine motion predictor candidates 5. Zero motion motion predictor candidates FIGS. 19 and 20 illustrate an MPMM-based merge mode as an embodiment to which the present invention is applied. It is highly likely that the movement information of the current coding unit is similar to the movement information of surrounding coding units. Additionally, it is highly likely that the merge mode information of the current coding unit is similar to the merge mode information of surrounding coding units, or that the movement information of surrounding coding units close to the current coding unit is likely to be used as a merge candidate for the current coding unit. A Most Probable Merge Mode (MPMM) list consisting of movement information of surrounding coding units or merge candidates can be derived, and the size of the MPMM list M can be set differently per tile set, per sequence, or a predefined value. The merge candidates within the Merge Candidate List (MergeCandList) that do not belong to the MPMM list are called the Remaining Merge Mode (RMM) list. You can signal the mpmm_flag flag, which indicates whether the merge candidate of the current coding unit belongs to the merge candidates in the MPM list. If the merge candidate of the current coding unit is at least one of the MPMM lists (i.e., the mpmm_flag value is 1), the MPMM index (pre-defined index in the MPMM list, mpmm_index) can be signaled. If the merge candidate of the current coding unit does not belong to the MPMM, the index in the RMM list (rmm_index) can be signaled, and a syntax table such as Table 1 can be used. coding_unit( x0, y0, cbWidth, cbHeight, treeType ) {Descriptor....} else { / * MODE_INTER * / if( cu_skip_flag[ x0 ][ y0 ] ) {if( MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8 )merge_subblock_flag[ x0 ][ y0 ]ae(v)if( merge_subblock_flag[ x0 ][ y0 ] = = 0 && MaxNumMergeCand > 1 )mpmm_flag[ x0 ][ y0 ]ae(v)if (mpmm_flag[x0][y0] ==1){mpmm_index[x0][y0]ae(v)} else {rmm_index[x0][y0]ae(v)}if( merge_subblock_flag[ x0 ][ y0 ] = = 1 && MaxNumSubblockMergeCand > 1 )merge_subblock_idx[ x0 ][ y0 ]ae(v)} else {merge_flag[ x0 ][ y0 ]ae(v)if( merge_flag[ x0 ][ y0 ] ) {if( MaxNumSubblockMergeCand > 0 && cbWidth >= 8 && cbHeight >= 8 )merge_subblock_flag[ x0 ][ y0 ]ae(v)if( merge_subblock_flag[ x0 ][ y0 ] = = 0 && MaxNumMergeCand > 1 )mpmm_flag[ x0 ][ y0 ]ae(v)if (mpmm_flag[x0][y0] ==1){mpmm_index[x0][y0]ae(v)} else {rmm_index[x0][y0]ae(v)}if( merge_subblock_flag[ x0 ][ y0 ] = = 1 && MaxNumSubblockMergeCand > 1 )merge_subblock_idx[ x0 ][ y0 ]ae(v)...} For example, as shown in FIG. 19, the MPMM list may be composed of HmvpCandList[LastIdx] to HmvPCandList[LastIdx-M+1], which are inter-coding units decoded from the previous coding unit and have a encoding / decoding order close to that of the current coding unit. The RMM is derived from the existing mergeCandList, but if there is identical movement information in the MPMM list, it can be removed from the RMM list. Merge candidates in the mergeCandList derived from HmvpCandList[LastIdx] to HmvPCandList[LastIdx-M+1] may not be added to the RMM list. As another example, a mergeCandList derived from a previous coding unit, such as the shape of the current coding unit, can be set as an MPMM. For instance, as shown in FIG. 20, if the current coding unit is square, merge candidates derived from the square coding unit can be added to the MPMM list. As another example, merge candidates derived from neighboring coding units using merge mode / skip mode can be added to the MPMMM list, and merge candidates derived from coding units using AMVP mode can be added to the RMM list. FIGS. 21 to 30 illustrate an intra-prediction method as an embodiment to which the present invention is applied. Intra prediction uses already encoded boundary samples around the current block, as shown in Fig. 21, to generate intra prediction, and these are called intra reference samples. Intra-prediction can be performed by setting the average value of the intra-reference sample to the value of the entire sample in the prediction block (DC mode), generating a vertical prediction sample by weighting the horizontal prediction sample generated by performing horizontal reference weighted prediction and the vertical prediction sample generated by weighting the horizontal prediction sample and the vertical prediction sample, and then generating a prediction sample by weighting the horizontal prediction sample and the vertical prediction sample (Planar mode), or by using a directional intra-prediction mode, etc. As shown in the left figure of Fig. 22, intra prediction can be performed using 33 directions (a total of 35 intra prediction modes), and as shown in the right figure, 65 directions (a total of 67 intra prediction modes) can be used. When using directional intra prediction, an intra reference sample (reference sample) is generated by considering the directionality of the intra prediction mode, and intra prediction can be performed from this. The intra-reference sample on the left side of the coding unit is called the left intra-reference sample, and the intra-reference sample on the upper side of the coding unit is called the upper intra-reference sample. When performing directional intra-prediction, an intra-direction parameter (intraPredAng), which is a parameter representing the prediction direction (or prediction angle) according to the intra-prediction mode, can be set as shown in Table 2. Table 2 below is merely an example based on directional intra-prediction modes having values ​​from 2 to 34 when using 35 intra-prediction modes. Of course, the prediction direction (or prediction angle) of the directional intra-prediction mode can be further subdivided, and more than 33 directional intra-prediction modes can be used. PredModeIntra1234567IntraPredAng-32262117139PredModeIntra891011121314IntraPredAng520-2-5-9-13PredModeIntra15161718192021IntraP redAng-17-21-26-32-26-21-17PredModeIntra22232425262728IntraPredAng-13-9-5-2025PredModeIntra293031323334IntraPredAng91317212632 When intraPredAng is negative (for example, when the intra-prediction mode index is between 11 and 25), the left intra-reference sample and the upper intra-reference sample in the current block can be reconstructed into a one-dimensional reference sample (Ref_1D) composed of 1D according to the angle of the intra-prediction mode, as shown in Fig. 23. When the intra prediction mode index is between 11 and 18, one-dimensional reference samples can be generated in a counter-clockwise direction from the intra reference sample located to the right of the upper side of the current block to the intra reference sample located to the bottom of the left side, as shown in FIG. 24. In other modes, one-dimensional reference samples can be generated using only the upper-side intra-reference samples or the lower-side intra-reference samples. When the intra prediction mode index is between 19 and 25, one-dimensional reference samples can be generated clockwise from the intra reference sample located at the bottom left side of the current block to the intra reference sample located at the right side of the top side, as shown in Fig. 25. Reference sample determination index i Idx wa i Idx Weight-related parameter i applied to at least one reference sample determined based on fact can be derived as shown in the following mathematical equation 5. i Idx wa i factis determined variably depending on the gradient of the directional intra prediction mode, and i Idx The reference sample specified by may correspond to an integer pel. [Mathematical Formula 5] i Idx = (y+1) * P ang / 32 i fact = [(y+1) * P ang ] & 31 For each prediction sample, at least one one-dimensional reference sample may be specified to derive the prediction image. For example, the location of a one-dimensional reference sample that can be used to generate the prediction sample may be specified by considering the gradient value of the directional intra prediction mode. Different directional intra prediction modes may be used for each prediction sample. Multiple intra prediction modes may be used for a single prediction block. Multiple intra prediction modes may be expressed as a combination of multiple non-directional intra prediction modes, a combination of one non-directional intra prediction mode and at least one directional intra prediction mode, or a combination of multiple directional intra prediction modes. Different intra prediction modes may be applied for each predetermined sample group within a single prediction block. A predetermined sample group may consist of at least one sample. The number of sample groups may be determined variably based on the size / number of samples of the current prediction block, or it may be a fixed number pre-set in the encoder / decoder independently of the size / number of samples of the prediction block. Specifically, for example, the location of a one-dimensional reference sample can be determined using the reference sample determination index iIdx. When the gradient of the intra prediction mode cannot be represented by a single one-dimensional reference sample alone, a first prediction image can be generated by interpolating adjacent one-dimensional reference samples as shown in Equation 6. If the angular line according to the gradient / angle of the intra prediction mode does not pass through a reference sample located at an integer pel, a first prediction image can be generated by interpolating adjacent reference samples to the left / right or above / below of the angular line. The filter coefficients of the interpolation filter used in this case are i fact It can be determined based on. For example, the filter coefficients of an interpolation filter can be derived based on the distance between a prime number located on an angular line and a reference sample located on an integer number. [Mathematical Formula 6] P(x,y)=((32-i fact ) / 32)*Ref_1D(x+i Idx +1)+(i fact / 32)*Ref_1D(x+i Idx +2) When the gradient of the intra prediction mode can be expressed with only a single one-dimensional reference sample (i fact When the value is 0) a first prediction image can be generated as shown in the following mathematical formula 7. [Mathematical Formula 7] P(x,y) = Ref_1D(x+i Idx +1) The prediction angle of the directional intra prediction mode can be set between 45 and -135 degrees as shown in Fig. 26. When performing intra-prediction mode in a non-square coding unit, a disadvantage may occur where the current sample is predicted from an intra-reference sample far from the current sample instead of an intra-reference sample close to the current sample due to a predefined prediction angle. For example, as shown in the left figure of FIG. 27, in a coding unit where the width of the coding unit is greater than the height of the coding unit (hereinafter, horizontal coding unit), intra prediction can be performed from a distant sample L instead of a close sample T. As another example, as shown in the right figure, in a coding unit where the height of the coding unit is greater than the width of the coding unit (hereinafter, vertical coding unit), intra prediction can be performed from a distant sample T instead of a close sample L. In non-rectangular coding units, intra prediction can be performed at a wider prediction angle than the pre-defined prediction angle, and this is called wide-angle intra prediction mode. The wide-angle intra prediction mode can have a prediction angle of 45-α to -135-β, and a prediction angle that deviates from the angle used in the existing intra prediction mode is called a wide-angle angle. In the left figure of FIG. 27, sample A in the horizontal coding unit can be predicted from intra-reference sample T using a wide-angle intra-prediction mode. In the right figure of FIG. 27, sample A in the vertical coding unit can be predicted from intra-reference sample L using a wide-angle intra-prediction mode. N+M intra prediction modes can be defined by adding M wide angles to the existing N intra prediction modes. Specifically, for example, a total of 95 intra prediction modes can be defined by adding 67 intra modes and 28 wide angles as shown in Table 3. The intra prediction modes available to the current block can be determined based on the shape of the current block. For example, based on at least one of the size of the current block, the aspect ratio (e.g., the ratio of width to height), and the reference line index, 65 directional intra prediction modes out of 95 directional intra prediction modes can be selected. predModeIntra-14-13-12-11-10-9-8-7-6-5-4-3-2-1234intraPredAngle5123412561711281028673645751453935322926predModeIntra567891011121314151617 18192021intraPredAngle232018161412108643210-1-2-3predModeIntra2223242526272829303132333435363738intraPredAngle-4-6-8-10-12-14-16-18-20-23 -26-29-32-29-26-23-20predModeIntra3940414243444546474849505152535455intraPredAngle-18-16-14-12-10-8-6-4-3-2-1012346predModeIntra565758596 0616263646566676869707172intraPredAngle810121416182023262932353945515764predModeIntra7374757677787980intraPredAngle7386102128171256341512 The intra-pred mode angle shown in Table 3 can be adaptively determined based on at least one of the shape of the current block and the reference line index. For example, the intraPredAngle of Mode 15 can be set to have a larger value when the current block is square than when the current block is non-square. Alternatively, the intraPredAngle of Mode 75 can be set to have a larger value when a non-adjacent reference line is selected than when an adjacent reference line is selected. When using the wide angle intra prediction mode, as shown in Fig. 28, the length of the upper intra reference sample can be set to 2W+1 and the length of the left intra reference sample can be set to 2H+1. When using wide-angle intra prediction, encoding the intra prediction modes of the wide-angle intra prediction mode can result in a large number of intra prediction modes, which may lower the encoding efficiency. The wide-angle intra prediction mode can be encoded by replacing it with an existing intra prediction mode that is not used in wide-angle intra, and the replacement prediction mode is called the wide-angle replacement mode. The wide-angle replacement mode may be an intra prediction mode that is opposite to the wide-angle intra prediction mode. Specifically, for example, when using 35 intra predictions as shown in Fig. 29, wide-angle intra prediction mode 35 can be encoded as wide-angle alternative mode intra prediction mode 2, and wide-angle intra prediction mode 36 can be encoded as wide-angle alternative mode intra prediction mode 3. The replacement mode and number can be set differently depending on the shape of the coding block or the ratio of the coding block height to width. Specifically, for example, as shown in Table 4, the replacement mode and number can be set differently depending on the shape of the coding block. Table 4 shows the intra-predictive replacement modes used depending on the ratio of the width and height of the coding block. Aspect ratioReplaced intra prediction modesW / H == 16Modes 12, 13,14,15W / H == 8Modes 12, 13W / H == 4Modes 2,3,4,5,6,7,8,9,10,11W / H == 2Modes 2,3,4,5,6,7,W / H == 1NoneW / H == 1 / 2Modes 61,62,63,64,65,66W / H == 1 / 4Mode 57,58,59,60,61,62,63,64,65,66W / H == 1 / 8Modes 55, 56W / H == 1 / 16Modes 53, 54, 55, 56 Referring to FIG. 30, intra prediction may be performed using at least one of a plurality of intra reference lines. For example, intra prediction can be performed by selecting any one of a plurality of intra reference lines composed of adjacent intra reference lines and non-adjacent intra reference lines, and this is called a multi-line intra prediction method. The non-adjacent intra reference line may include at least one of a first non-adjacent intra reference line (non-adjacent reference line index 1), a second non-adjacent intra reference line (non-adjacent reference line index 2), or a third non-adjacent intra reference line (non-adjacent reference line index 3). Some of the non-adjacent intra reference lines may be used. For example, only the first non-adjacent intra reference line and the second non-adjacent intra reference line may be used, or only the first non-adjacent intra reference line and the third non-adjacent intra reference line may be used. The intra-reference line index (intra_luma_ref_idx), which is the syntax specifying the reference line used for intra-prediction, can be signaled at the coding unit level. Specifically, when using adjacent intra-reference lines, the first non-adjacent intra-reference line, and the third non-adjacent intra-reference line, intra_luma_ref_idx may be defined as shown in Table 5 below. intra_luma_ref_idx[ x0 ][ y0 ] Reference lines used for intra prediction 0 Adjacent intra reference line 1 First non-adjacent reference line 2 Third non-adjacent reference line Alternatively, depending on the size, shape, or intra prediction mode of the current block, the location of the non-adjacent reference line may be specified. For example, a line index of 0 may represent an adjacent intra reference line, and a line index of 1 may represent a first non-adjacent intra reference line. Meanwhile, depending on the size, shape, or intra prediction mode of the current block, a line index of 2 may represent a second non-adjacent intra reference line or a third non-adjacent intra reference line. Depending on the intra mode, the available non-adjacent reference lines may also be determined. For example, when using diagonal mode intra prediction, only the adjacent reference line, the first non-adjacent reference line, and the third non-adjacent reference line may be used, and in vertical or horizontal intra prediction mode, the adjacent reference line, the first non-adjacent reference line, and the second non-adjacent reference line may be set to be used. When using non-adjacent intra-reference lines, non-directional intra-prediction mode may be configured not to be used. That is, when using non-adjacent intra-reference lines, DC mode or Planar mode may be restricted not to be used. As another example, when using non-adjacent intra-reference lines, at least one of the non-directional intra-prediction mode or the specific directional intra-prediction mode may be restricted from use. The non-directional intra-prediction mode includes at least one of DC mode and Planar mode, and the specific directional intra-prediction mode may include at least one of Horizontal direction mode (INTRA_MODE18), Vertical direction mode (INTRA_MODE50), Diagonal direction mode (INTRA_MODE2, 66), and Wide angle mode. The number of samples belonging to a non-adjacent intra-reference line can be set to be greater than the number of samples in an adjacent intra-reference line. Additionally, the number of samples in the (i+1) non-adjacent intra-reference line can be set to be greater than the number of samples in the i-th non-adjacent intra-reference line. The difference between the number of upper samples of the i-th non-adjacent intra-reference line and the number of upper samples of the (i-1) non-adjacent intra-reference line can be represented by the reference sample count offsetX[i]. offsetX[1] represents the difference between the number of upper samples of the first non-adjacent intra-reference line and the number of upper samples of the adjacent intra-reference line. The difference between the number of left-side samples of the i-th non-adjacent intra-reference line and the number of left-side samples of the (i-1) non-adjacent intra-reference line can be represented by the reference sample count offsetY[i]. offsetY[1] represents the difference between the number of samples to the left of the first non-adjacent intra-reference line and the number of samples to the left of the adjacent intra-reference line. A non-adjacent intra-reference line with intra-reference line index i can be composed of an upper non-adjacent reference line refW + offsetX[i], a left non-adjacent reference line refH + offsetY[i], and an upper-left sample, and the number of samples belonging to the non-adjacent intra-reference line can be composed of refW + refH + offsetX[i] + offsetY[i] + 1. [Mathematical Formula 8] refW = ( nTbW * 2 ) refH = ( nTbH * 2 ) In mathematical formula 8, nTbW represents the width of the coding unit, nTbH represents the height of the coding unit, and whRatio can be defined as in the following mathematical formula 9. [Mathematical Formula 9] whRatio = log2(nTbW / nTbH) In the multi-line intra-predictive coding method, if non-adjacent intra-reference lines are used, the wide-angle intra mode may be configured not to be used. Alternatively, if the MPM mode of the current coding unit is wide-angle intra mode, the multi-line intra-predictive coding method may be configured not to be used. In this case, the non-adjacent intra-reference line with intra-reference line index i may be composed of the upper non-adjacent reference line W + H + offsetX[i], the left non-adjacent reference line H + W + offsetY[i], and the upper-left sample, and the number of samples belonging to the non-adjacent intra-reference line may be composed of 2W + 2H + offsetX[i] + offsetY[i] + 1, and the values ​​of offsetX[i] and offsetY[i] may vary depending on the whRatio value. For example, if the whRatio value is greater than 1, the offsetX[i] value can be set to 1 and the offsetY[i] value to 0, and if the whRatio value is less than 1, the offsetX[i] value can be set to 0 and the offsetY[i] value to 1. FIG. 31 illustrates a prediction method based on references between components as an embodiment to which the present invention is applied. The current block can be classified into a luminance block and a chrominance block according to the component type. The chrominance block can be predicted using pixels of the previously restored luminance block, and this is referred to as inter-component reference. In this embodiment, it is assumed that the chrominance block has a size of (nTbW x nTbH) and the luminance block corresponding to the chrominance block has a size of (2*nTbW x 2*nTbH). Referring to FIG. 31, the intra-prediction mode of the color difference block can be determined (S3100). Predefined intra-prediction modes for color difference blocks can be divided into a first group and a second group. Here, the first group consists of a prediction mode based on inter-component reference, and the second group may consist of all or part of the intra-prediction mode shown in FIG. 22. The encoding / decoding device may define at least one of INTRA_LT_CCLM, INTRA_L_CCLM, or INTRA_T_CCLM as a prediction mode based on inter-component reference. INTRA_LT_CCLM is a mode that references both the left and top regions adjacent to the luminance / chrominance block, INTRA_L_CCLM is a mode that references the left region adjacent to the luminance / chrominance block, and INTRA_T_CCLM is a mode that references the top region adjacent to the luminance / chrominance block. The intra-prediction mode of the color difference block can be induced by selectively using either the first group or the second group. The selection can be performed based on a predetermined first flag. The first flag may indicate whether the intra-prediction mode of the color difference block is induced based on the first group or based on the second group. For example, if the first flag is the first value, the intra prediction mode of the chrominance block may be determined as any one of the component-to-component reference-based prediction modes belonging to the first group. A predetermined index may be used to select any one of the component-to-component reference-based prediction modes. The index may be information specifying any one of INTRA_LT_CCLM, INTRA_L_CCLM, or INTRA_T_CCLM. The component-to-component reference-based prediction modes and the indices assigned to each prediction mode are as shown in Table 6 below. Inter-component reference-based prediction mode 0INTRA_LT_CCLM 1INTRA_L_CCLM 2INTRA_T_CCLM Table 6 is merely an example of the indices assigned to each prediction mode, but is not limited thereto. That is, as shown in Table 6, indices may be assigned in the order of priority INTRA_LT_CCLM, INTRA_L_CCLM, INTRA_T_CCLM, or in the order of priority INTRA_LT_CCLM, INTRA_T_CCLM, INTRA_L_CCLM. Alternatively, INTRA_LT_CCLM may have a lower priority than INTRA_T_CCLM or INTRA_L_CCLM. On the other hand, when the first flag is the second value, the intra-prediction mode of the chroma block may be determined as any one of a plurality of intra-prediction modes belonging to the second group. For example, the second group may be defined as shown in Table 7, and the intra-prediction mode of the chroma block may be derived based on information (intra_chroma_pred_mode) signaled by the encoding device and the intra-prediction mode (IntraPredModeY) of the luminance block. intra_chroma_pred_mode[ xCb ][ yCb ]IntraPredModeY[ xCb + cbWidth / 2 ][ yCb + cbHeight / 2 ]050181X ( 0 <= The first flag may be optionally signaled based on information indicating whether a reference between components is allowed. For example, if the value of the information is 1, the first flag may be signaled, and if not, the first flag may not be signaled. Here, the information may be determined to be 0 or 1 based on a predetermined condition described below. (Condition 1) If a second flag indicating whether a prediction based on cross-component references is allowed is 0, the information may be set to 0. The second flag may be signaled in at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), or a slice header. (Condition 2) If at least one of the following sub-conditions is satisfied, the information may be set to 1. - When the value of qtbtt_dual_tree_intra_flag is 0 - If the slice type is not an I-slice - When the size of the coding tree block is smaller than 64x64 In Condition 2 above, qtbtt_dual_tree_intra_flag may indicate whether the coding tree block is implicitly divided into coding blocks of size 64x64 and whether the coding blocks of size 64x64 are divided into a dual tree. The dual tree may refer to a method in which the luminance component and the chrominance component are divided into a division structure independent of each other. The size of the coding tree block (CtbLog2Size) may be a pre-defined size (e.g., 64x64, 128x128, 256x256) in the encoding / decoding device, or it may be encoded and signaled in the encoding device. (Condition 3) If at least one of the following sub-conditions is satisfied, the information may be set to 1. - When the width and height of the first parent block are 64 - When the depth of the first parent block is equal to (CtbLog2Size-6), the first parent block is partitioned by Horizontal BT, and the second parent block is 64x32 - When the depth of the 1st parent block is greater than (CtbLog2Size-6) - When the depth of the first parent block is equal to (CtbLog2Size-6), the first parent block is partitioned into Horizontal BTs, and the second parent block is partitioned into Vertical BTs In the above condition 3, the first upper block may be a block that includes the current color difference block as a sub-block. For example, if the depth of the current color difference block is k, the depth of the first upper block is (kn), and n may be 1, 2, 3, 4 or greater. The depth of the first upper block may refer only to the depth based on a quadtree-based partition, or it may refer to the depth based on at least one of a quadtree, binary tree, or binary tree partition. The second upper block is a sub-block belonging to the first upper block and may have a depth smaller than the current color difference block or a depth larger than the first upper block. For example, if the depth of the current color difference block is k, the depth of the second upper block is (km), and m may be a natural number smaller than n. If none of the aforementioned conditions 1 to 3 are satisfied, the information may be set to 0. However, even if at least one of conditions 1 to 3 is satisfied, if at least one of the following sub-conditions is satisfied, the information may be reset to 0. - When the first upper block is 64x64 and the aforementioned sub-block unit prediction is performed - If at least one of the width or height of the first parent block is less than 64, and the depth of the first parent block is equal to (CtbLog2Size-6) Referring to FIG. 31, a luminance region for reference between components of a color difference block can be specified (S3110). The above luminance region may include at least one of a luminance block or a neighboring region adjacent to the luminance block. Here, the luminance block may be defined as a region containing pixels pY[x][y] (x=0..nTbW*2-1, y=0..nTbH*2-1). The pixels may refer to the restored value before the in-loop filter is applied. The above neighbor area may include at least one of a left neighbor area, an upper neighbor area, or an upper-left neighbor area. The left neighbor area may be set as an area containing pixels pY[x][y] (x=-1..-3, y=0..2*numSampL-1). This setting may be performed only when the value of numSampL is greater than 0. The upper neighbor area may be set as an area containing pixels pY[x][y] (x=0..2*numSampT-1, y=-1..-3). This setting may be performed only when the value of numSampT is greater than 0. The upper-left neighbor area may be set as an area containing pixels pY[x][y] (x=-1, y=-1,-2). This setting may be performed only when the upper-left area of ​​the luminance block is available. The aforementioned numSampL and numSampT can be determined based on the intra prediction mode of the current block. Here, the current block may refer to a chrominance block. For example, if the intra prediction mode of the current block is INTRA_LT_CCLM, it can be derived as shown in the following mathematical formula 10. Here, INTRA_LT_CCLM may mean a mode in which inter-component references are performed based on the regions adjacent to the left and top of the current block. [Mathematical Formula 10] numSampT = availT ? nTbW : 0 numSampL = availL ? nTbH : 0 According to Equation 10, numSampT can be derived as nTbW if the upper neighbor region of the current block is available, and as 0 otherwise. Likewise, numSampL can be derived as nTbH if the left neighbor region of the current block is available, and as 0 otherwise. On the other hand, if the intra prediction mode of the current block is not INTRA_LT_CCLM, it can be derived as shown in the following mathematical formula 11. [Mathematical Formula 11] numSampT = ( availT && predModeIntra = = INTRA_T_CCLM ) ? (nTbW + numTopRight) : 0 numSampL = ( availL && predModeIntra = = INTRA_L_CCLM ) ? (nTbH + numLeftBelow) : 0 In Equation 11, INTRA_T_CCLM may indicate a mode where inter-component referencing is performed based on the region adjacent to the top of the current block, and INTRA_L_CCLM may indicate a mode where inter-component referencing is performed based on the region adjacent to the left of the current block. numTopRight may indicate the number of all or some pixels belonging to the region adjacent to the top-right of the chrominance block. Some pixels may refer to available pixels among those belonging to the bottom pixel row of that region. The determination of availability is performed sequentially from left to right to check the availability of pixels, and this may be performed until an unavailable pixel is found. numLeftBelow may indicate the number of all or some pixels belonging to the region adjacent to the bottom-left of the chrominance block. Some pixels may refer to available pixels among those belonging to the rightmost pixel column of that region. The determination of availability is made by sequentially checking the availability of pixels from top to bottom, and this can be performed until an unavailable pixel is found. Referring to FIG. 31, downsampling can be performed on a specific luminance region in S3110 (S3120). The above downsampling may include at least one of 1. downsampling for a luminance block, 2. downsampling for a left neighbor area of ​​a luminance block, or 3. downsampling for an upper neighbor area of ​​a luminance block, and will be examined in detail below. 1. Downsampling of the luminance block (Example 1) The pixel pDsY[x][y] (x=0..nTbW-1, y=0..nTbH-1) of the downsampled luminance block can be derived based on the corresponding pixel pY[2*x][2*y] of the luminance block and surrounding pixels. The surrounding pixels may refer to pixels adjacent to the corresponding pixel in at least one of the directions to the left, right, top, or bottom. For example, the pixel pDsY[x][y] can be derived as shown in the following Equation 12. [Mathematical Formula 12] pDsY[ x ][ y ] = ( pY[ 2 * x ][ 2 * y - 1 ] + pY[ 2 * x - 1 ][ 2 * y ] + 4 * pY[ 2 * x ][ 2 * y ] + pY[ 2 * x + 1 ][ 2 * y ] + pY[ 2 * x ][ 2 * y + 1 ] + 4 ) >> 3 However, there may be cases where the left / top neighbor region of the current block is unavailable. If the left neighbor region of the current block is unavailable, the pixel pDsY[0][y] (y=1..nTbH-1) of the downsampled luminance block can be derived based on the corresponding pixel pY[0][2*y] of the luminance block and surrounding pixels. The surrounding pixels may refer to pixels adjacent in at least one direction, either above or below, the corresponding pixel. For example, the pixel pDsY[0][y] (y=1..nTbH-1) can be derived as shown in the following Equation 13. [Mathematical Formula 13] pDsY

[0000] [ y ] = ( pY

[0000] [ 2 * y - 1 ] + 2 * pY

[0000] [ 2 * y ] + pY

[0000] [ 2 * y + 1 ] + 2 ) >> 2 If the upper neighbor region of the current block is unavailable, the pixel pDsY[x][0] (x=1..nTbW-1) of the downsampled luminance block can be derived based on the corresponding pixel pY[2*x][0] of the luminance block and the surrounding pixels. The surrounding pixels may refer to pixels adjacent in at least one direction to the left or right of the corresponding pixel. For example, the pixel pDsY[x][0] (x=1..nTbW-1) can be derived as shown in the following Equation 14. [Mathematical Formula 14] pDsY[ x ]

[0000] = ( pY[ 2 * x - 1 ]

[0000] + 2 * pY[ 2 * x ]

[0000] + pY[ 2 * x + 1 ]

[0000] + 2 ) >> 2 Meanwhile, the pixel pDsY[0][0] of the downsampled luminance block can be derived based on the corresponding pixel pY[0][0] of the luminance block and / or surrounding pixels. The location of the surrounding pixels may be determined differently depending on the availability of the left / top neighbor area of ​​the current block. For example, if the left neighbor area is available and the top neighbor area is not available, pDsY[0][0] can be derived as shown in the following mathematical equation 15. [Mathematical Formula 15] pDsY

[0000]

[0000] = ( pY[ -1 ]

[0000] + 2 * pY

[0000]

[0000] + pY

[0001]

[0000] + 2 ) >> 2 On the other hand, if the left neighbor area is not available and the top neighbor area is available, pDsY[0][0] can be derived as shown in the following mathematical equation 16. [Mathematical Formula 16] pDsY

[0000]

[0000] = ( pY

[0000] [ -1 ] + 2 * pY

[0000]

[0000] + pY

[0000]

[0001] + 2 ) >> 2 Meanwhile, if both the left and top neighbor areas are unavailable, pDsY

[0000]

[0000] can be set to the corresponding pixel pY[0][0] of the luminance block. (Example 2) The pixel pDsY[x][y] (x=0..nTbW-1, y=0..nTbH-1) of the downsampled luminance block can be derived based on the corresponding pixel pY[2*x][2*y] of the luminance block and surrounding pixels. The surrounding pixels may refer to pixels adjacent to the corresponding pixel in at least one of the directions of bottom, left, right, bottom-left, or bottom-right. For example, the pixel pDsY[x][y] can be derived as shown in the following Equation 17. [Mathematical Formula 17] pDsY[ x ][ y ] = (pY[ 2 * 1 ][ 2 * y + 1 ] + 4 ) >> 3 However, if the left neighbor region of the current block is unavailable, the pixel pDsY[0][y] (y=0..nTbH-1) of the downsampled luminance block can be derived based on the corresponding pixel pY[0][2*y] of the luminance block and the bottom neighbor pixels. For example, the pixel pDsY[0][y] (y=0..nTbH-1) can be derived as shown in the following Equation 18. [Mathematical Formula 18] pDsY

[0000] [ y ] = ( pY

[0000] [ 2 * y ] + pY

[0000] [ 2 * y + 1 ] + 1 ) >> 1 Downsampling of the luminance block may be performed based on either of the aforementioned embodiments 1 and 2. In this case, either embodiment 1 or 2 may be selected based on a predetermined flag. Here, the flag may indicate whether the downsampled luminance pixel has the same position as the original luminance pixel. For example, if the flag is a first value, the downsampled luminance pixel has the same position as the original luminance pixel. On the other hand, if the flag is a second value, the downsampled luminance pixel has the same position as the original luminance pixel in the horizontal direction, but has a position shifted by half pel in the vertical direction. 2. Downsampling of the left neighbor region of the luminance block (Example 1) The downsampled left neighbor pixel pLeftDsY[y] (y=0..numSampL-1) can be derived based on the corresponding left neighbor pixel pY[-2][2*y] and surrounding pixels. The surrounding pixels may refer to pixels adjacent to the left, right, top, or bottom of the corresponding pixel. For example, the pixel pLeftDsY[y] can be derived as shown in the following Equation 19. [Mathematical Formula 19] pLeftDsY[ y ] = ( pY[ -2 ][ 2 * y - 1 ] + pY[ -3 ][ 2 * y ] + 4 * pY[ -2 ][ 2 * y ] + pY[ -1 ][ 2 * y ] + pY[ -2][ 2 * y + 1 ] + 4 ) >> 3 However, if the top-left neighbor region of the current block is unavailable, the pixel pLeftDsY

[0000] of the downsampled left neighbor region can be derived based on the corresponding pixel pY[-2][0] of the left neighbor region and surrounding pixels. The surrounding pixels may refer to pixels adjacent in at least one direction, either to the left or to the right of the corresponding pixel. For example, the pixel pLeftDsY

[0000] can be derived as shown in the following Equation 20. [Mathematical Formula 20] pLeftDsY

[0000] = ( pY[ -3 ]

[0000] + 2 * pY[ -2 ]

[0000] + pY[ -1 ]

[0000] + 2 ) >> 2 (Example 2) The downsampled left neighbor pixel pLeftDsY[y] (y=0..numSampL-1) can be derived based on the corresponding left neighbor pixel pY[-2][2*y] and surrounding pixels. The surrounding pixels may refer to pixels adjacent in at least one of the directions of the bottom, left, right, bottom-left, or bottom-right of the corresponding pixel. For example, the pixel pLeftDsY[y] can be derived as shown in the following Equation 21. [Mathematical Formula 21] pLeftDsY[ y ] = ( pY[ -1 ][ 2 * y ] + pY[ -1 ][ 2 * y + 1 ] + 2* pY[ -2 ][ 2 * y ] + 2*pY[ -2 ][ 2 * y + 1 ] + pY[ -3 ][ 2 * y ] + pY[ -3 ][ 2 * y + 1 ] + 4 ) >> 3 Likewise, downsampling of the left neighbor region may be performed based on either of the aforementioned embodiments 1 and 2. In this case, either embodiment 1 or 2 may be selected based on a predetermined flag. The flag indicates whether the downsampled luminance pixel has the same location as the original luminance pixel, as described above. Meanwhile, downsampling of the left neighbor region may be performed only when the numSampL value is greater than 0. A numSampL value greater than 0 means that the left neighbor region of the current block is available and the intra prediction mode of the current block is INTRA_LT_CCLM or INTRA_L_CCLM. 3. Downsampling of the top neighbor region of the luminance block (Example 1) The pixel pTopDsY[x] (x=0..numSampT-1) of the downsampled top neighbor region can be derived by considering whether the top neighbor region belongs to a CTU different from the luminance block. If the top neighbor region belongs to the same CTU as the luminance block, the pixel pTopDsY[x] of the downsampled top neighbor region can be derived based on the corresponding pixel pY[2*x][-2] of the top neighbor region and the surrounding pixels. The surrounding pixels may refer to pixels adjacent to the left, right, top, or bottom of the corresponding pixel. For example, the pixel pTopDsY[x] can be derived as shown in the following Equation 22. [Mathematical Formula 22] pTopDsY[ x ] = ( pY[ 2 * x ][ -3 ] + pY[ 2 * x - 1 ][ -2 ] + 4 * pY[ 2 * x ][ -2 ] + pY[ 2 * x + 1 ][ -2 ] + pY[ 2 * x ][ -1 ] + 4 ) >> 3 On the other hand, if the top neighbor region belongs to a CTU different from the luminance block, the pixel pTopDsY[x] of the downsampled top neighbor region can be derived based on the corresponding pixel pY[2*x][-1] of the top neighbor region and surrounding pixels. The surrounding pixels may refer to pixels adjacent in at least one direction, either to the left or to the right of the corresponding pixel. For example, the pixel pTopDsY[x] can be derived as shown in the following Equation 23. [Mathematical Formula 23] pTopDsY[ x ] = ( pY[ 2 * x - 1 ][ -1 ] + 2* pY[ 2 * x ][ -1 ] + pY[ 2 * x + 1 ][ -1 ] + 2 ) >> 2 Alternatively, if the top-left neighbor area of ​​the current block is unavailable, the surrounding pixels may refer to pixels adjacent in at least one of the top or bottom directions of the corresponding pixels. For example, the pixel pTopDsY

[0000] can be derived as shown in the following Equation 24. [Mathematical Formula 24] pTopDsY

[0000] = ( pY

[0000] [ -3 ] + 2 * pY

[0000] [ -2 ] + pY

[0000] [ -1 ] + 2 ) >> 2 Alternatively, if the top-left neighbor area of ​​the current block is unavailable and the top neighbor area belongs to a CTU different from the luminance block, pixel pTopDsY

[0000] can be set to pixel pY

[0000] [ -1 ] of the top neighbor area. (Example 2) The pixel pTopDsY[x] (x=0..numSampT-1) of the downsampled top neighbor region can be derived by considering whether the top neighbor region belongs to a CTU different from the luminance block. If the top neighbor region belongs to the same CTU as the luminance block, the pixel pTopDsY[x] of the downsampled top neighbor region can be derived based on the corresponding pixel pY[2*x][-2] of the top neighbor region and the surrounding pixels. The surrounding pixels may refer to pixels adjacent in at least one of the directions of the bottom, left, right, bottom-left, or bottom-right of the corresponding pixel. For example, the pixel pTopDsY[x] can be derived as shown in the following Equation 25. [Mathematical Formula 25] pTopDsY[ x ] = ( pY[ 2 * x - 1 ][ -2 ] + pY[ 2 * x - 1 ][ -1 ] + 2* pY[ 2 * x ][ -2 ] + 2*pY[ 2* On the other hand, if the top neighbor region belongs to a CTU different from the luminance block, the pixel pTopDsY[x] of the downsampled top neighbor region can be derived based on the corresponding pixel pY[2*x][-1] of the top neighbor region and surrounding pixels. The surrounding pixels may refer to pixels adjacent in at least one direction, either to the left or to the right of the corresponding pixel. For example, the pixel pTopDsY[x] can be derived as shown in the following Equation 26. [Mathematical Formula 26] pTopDsY[ x ] = ( pY[ 2 * x - 1 ][ -1 ] + 2* pY[ 2 * x ][ -1 ] + pY[ 2 * x + 1 ][ -1 ] + 2 ) >> 2 Alternatively, if the top-left neighbor area of ​​the current block is unavailable, the surrounding pixels may refer to pixels adjacent in at least one of the top or bottom directions of the corresponding pixels. For example, the pixel pTopDsY

[0000] can be derived as shown in the following Equation 27. [Mathematical Formula 27] pTopDsY

[0000] = ( pY

[0000] [ -2 ] + pY

[0000] [ -1 ] + 1 ) >> 1 Alternatively, if the top-left neighbor area of ​​the current block is unavailable and the top neighbor area belongs to a CTU different from the luminance block, pixel pTopDsY

[0000] can be set to pixel pY

[0000] [ -1 ] of the top neighbor area. Likewise, downsampling of the upper neighbor region may be performed based on either of the aforementioned embodiments 1 and 2. In this case, either embodiment 1 or 2 may be selected based on a predetermined flag. The flag indicates whether the downsampled luminance pixel has the same location as the original luminance pixel, as described above. Meanwhile, downsampling of the upper neighbor region may be performed only when the numSampT value is greater than 0. A case where the numSampT value is greater than 0 means that the upper neighbor region of the current block is available and the intra prediction mode of the current block is INTRA_LT_CCLM or INTRA_T_CCLM. Downsampling for at least one of the left or upper neighbor regions of the aforementioned luminance block (hereinafter, luminance reference region) can be performed using only the corresponding pixel pY[-2][2*y] at a specific location and surrounding pixels. Here, the specific location can be determined based on the location of a selected pixel among a plurality of pixels belonging to at least one of the left or upper neighbor regions of the chrominance block (hereinafter, chrominance reference region). The selected pixel may be a pixel located at an odd-numbered position or an even-numbered position in the color difference reference area. Alternatively, the selected pixel may be a starting pixel and one or more pixels located at predetermined intervals from the starting pixel. Here, the starting pixel may be a pixel located at the first, second, or third position in the color difference reference area. The interval may be one, two, three, four, or more sample intervals. For example, if the interval is one sample interval, the selected pixel may include the n-th pixel, the (n+2)-th pixel, etc. The number of selected pixels may be two, four, six, eight, or more. The number of selected pixels, the starting pixel, and the spacing may be variably determined based on at least one of the length of the color difference reference area (i.e., numSampL and / or numSampT) or the intra prediction mode of the color difference block. Alternatively, the number of selected pixels may be a fixed number (e.g., 4) pre-agreed to the encoding / decoding device regardless of the length of the color difference reference area and the intra prediction mode of the color difference block. Referring to FIG. 31, parameters for referencing between components of a color difference block can be derived (S3130). The above parameter may include at least one of a weight or an offset. The above parameter may be determined by considering the intra-prediction mode of the current block. The above parameter may be derived using a selected pixel in the chrominance reference region and a pixel obtained through downsampling in the luminance reference region. Specifically, n pixels can be classified into two groups by performing a size comparison between n pixels obtained through downsampling of the luminance reference region. For example, the first group may be a group of pixels with relatively large values ​​among the n pixels, and the second group may be a group of pixels excluding the pixels of the first group among the n samples. That is, the second group may be a group of pixels with relatively small values. Here, n may be 4, 8, 16, or greater. The average value of the pixels belonging to the first group may be set as the maximum value (MaxL), and the average value of the pixels belonging to the second group may be set as the minimum value (MinL). Selected pixels in a color difference reference area can be grouped according to the grouping of n pixels obtained through downsampling of the luminance reference area. A first group for the color difference reference area can be formed using pixels in the color difference reference area corresponding to pixels in the first group for the luminance reference area, and a second group for the color difference reference area can be formed using pixels in the color difference reference area corresponding to pixels in the second group for the luminance reference area. Similarly, the average value of the pixels belonging to the first group can be set as the maximum value (MaxC), and the average value of the pixels belonging to the second group can be set as the minimum value (MinC). Based on the calculated maximum values ​​(MaxL, MaxC) and minimum values ​​(MinL, MaxC), the weights and / or offsets of the parameters can be derived. The color difference block can be predicted based on the downsampled luminance block and parameters (S3140). The color difference block can be predicted by applying at least one of a pre-induced weight or offset to the pixels of the downsampled luminance block. However, FIG. 31 is merely an example of a downsampling method for the surrounding area of ​​a luminance block, and other downsampling / subsampling methods may be applied, which will be examined in detail below with reference to FIGS. 32 to 38. FIGS. 32 to 38 illustrate a method for deriving parameters for downsampling and inter-component referencing for a peripheral area of ​​a luminance block as an embodiment to which the present invention is applied. A predicted image can be generated as shown in Equation 28 by linearly predicting based on an image in which at least one of downsampling or subsampling is performed on the surrounding samples of the current coding unit. [Mathematical Formula 28] Pred c (i,j) = (α * rec l '(i,j) >> S) + β In mathematical equation 28, rec l ' refers to the reconstructed sample of the downsampled luminance block, and Pred c can mean a predicted sample of a color difference block generated by linear chroma prediction. The surrounding samples of the current coding unit can be composed of samples existing at the left boundary and the upper boundary of the current coding unit as shown in the right figure of Fig. 32, and can be downsampled (downsampled to the gray samples in the right figure of Fig. 32), and this will be called the luminance surrounding template image. At this time, the linear chroma prediction parameters α and β that minimize the prediction error of Equation 28 can be derived as shown in Equation 29 below. [Mathematical Formula 29] α = (y B - y A ) / (x B - x A ) β = y A - α* x A Here, as shown in Fig. 33, x A represents the smallest value among the surrounding samples of the subsampled luminance (i.e., luminance surrounding template images), and x B represents the largest value among the surrounding samples of the subsampled luminance. y A is x A Represents the surrounding sample of the chroma corresponding to and, y B is x B It represents the surrounding sample of the chroma corresponding to it. Alternatively, as shown in FIG. 34, Max and min values ​​may be derived by subsampling a luminance-period template image. The n samples obtained through subsampling can be classified into two groups. For example, the first group may be a group of samples with relatively large values ​​among the n samples, and the second group may be a group of samples excluding the samples in the first group among the n samples. That is, the second group may be a group of samples with relatively small values. Here, n may be 4, 8, 16, or greater. The average value of the samples in the first group may be set as the maximum value (Max), and the average value of the samples in the second group may be set as the minimum value (Min). When the Min or Max value is an isolated sample that is far from other samples, there is a high probability that the prediction performance will be low when using Equation 29 for chroma prediction. By subsampling the luminance surrounding template image, the number of cases where isolated samples become maximum or minimum values ​​is reduced, which has the advantage of improving prediction performance. Additionally, comparison operations must be performed to find the maximum and minimum values, but the number of operations can be reduced from 4N (maximum value 2N and minimum value 2N) to 2N (maximum value N and minimum value N). A luminance surrounding template image can be derived from i lines adjacent to the upper boundary of the luminance block and j lines adjacent to the left boundary. i and j can be 2, 3, 4, or more. i can be equal to j, and i can be set to a value greater than j. As shown in FIG. 35, subsampling / downsampling can be performed from four lines adjacent to the upper boundary to two lines, and from four lines adjacent to the left boundary to two lines, and this is referred to as a first-order luminance template. By deriving the max and min values ​​of the first-order luminance template, linear prediction chroma parameters α and β can be derived. Using the derived linear prediction chroma parameters and the reconstructed samples of the luminance block, linear prediction chroma prediction for the chrominance block can be performed. Here, the reconstructed samples of the luminance block may be samples downsampled to correspond to the resolution of the chrominance block. As shown in Fig. 36, a luminance peripheral template image can be generated by performing subsampling on a primary luminance template generated through downsampling. For example, the upper line of the first-order luminance template can be configured so that samples with the same x-axis coordinate are not subsampled simultaneously. Similarly, the upper line of the first-order luminance template can be configured so that samples with the same y-axis coordinate are not subsampled simultaneously. Alternatively, when a multi-line intra prediction method is used in a luminance block, luminance surrounding template images may be configured differently depending on the intra reference line index (intra_luma_ref_idx). Specifically, for example, when the intra_luma_ref_idx value is 0, a luminance surrounding template image adjacent to the luminance boundary can be configured as shown in the left figure of Fig. 37, and when the intra_luma_ref_idx value is not 0, a luminance surrounding template image not adjacent to the luminance boundary can be configured as shown in the right figure. Alternatively, when a multi-line intra-prediction method is used for luminance, samples within the luminance surrounding template image can be weighted and predicted according to the intra-reference line index (intra_luma_ref_idx) to derive the maximum and minimum values ​​of the luminance surrounding template image. Specifically, for example, a second surrounding template sample can be generated by performing weighted prediction on samples with the same x-axis coordinates in the upper two lines and weighted prediction on samples with the same y-axis coordinates in the left two lines. The max and min values ​​of the second surrounding template sample can be calculated, and linear prediction chroma parameters α and β can be derived using them, and linear prediction chroma prediction can be performed. The weighted prediction parameter values ​​used when generating the second surrounding template sample can be set differently depending on the intra_luma_ref_idx value as shown in FIG. 38. Specifically, for example, when the intra_luma_ref_idx value is 0, a large weight can be set for samples belonging to lines adjacent to the block boundary, and when the intra_luma_ref_idx value is not 0, a large weight can be set for samples belonging to lines not adjacent to the block boundary. FIGS. 39 and 40 illustrate a method of applying an in-loop filter to a restoration block as an embodiment to which the present invention is applied. In-loop filtering is a technique that adaptively filters a decoded image to reduce information loss occurring during the quantization and encoding processes. Deblocking filters, sample adaptive offset filters (SAO), and adaptive loop filters (ALF) are examples of in-loop filtering. A second reconstructed image can be generated by applying at least one of a deblocking filter, a Sample Adaptive Offset (SAO), or an Adaptive Loop Filter (ALF) to the first reconstructed image. After applying a deblocking filter to the restored image, SAO and ALF can be applied. During the video encoding process, conversion and quantization are performed in block units. Losses occur during the quantization process, and discontinuities appear at the boundaries of the restored image. The discontinuous images appearing at block boundaries are called blocking artifacts. A deblocking filter is a method that mitigates blocking artifacts occurring at the block boundaries of the first image and improves encoding performance. Block image quality degradation can be mitigated by performing filtering at block boundaries, and a block filter strength (hereinafter BS) value can be determined based on at least one of the following: whether a block is encoded in an intra-prediction mode as shown in FIG. 39, whether the difference in absolute values ​​of motion vectors of neighboring blocks is greater than a predetermined threshold value, or whether the reference pictures of neighboring blocks are identical to each other. If the BS value is 0, filtering is not performed, and if the BS value is 1 or 2, filtering can be performed at block boundaries. Since quantization is performed in the frequency domain, ringing artifacts may occur at the edges of objects, or pixel values ​​may become larger or smaller than the original by a certain amount. SAO can effectively reduce ringing artifacts by adding or subtracting specific offsets on a block basis, taking into account the pattern of the first reconstructed image. Depending on the characteristics of the reconstructed image, SAO consists of edge offset (EO) and band offset (BO). Edge offset is a method that adds a different offset to the current sample based on the surrounding pixel sample pattern. Band offset reduces encoding errors by adding a fixed value to a set of pixels with similar brightness values ​​within a region. Pixel brightness can be divided into 32 uniform bands to group pixels with similar brightness values ​​into a single set. For example, four adjacent bands can be grouped into one category. It can be configured to use the same offset value within a single category. ALF (Adaptive Loop Filter) is a method for generating a second reconstructed image using one of the filters defined on the first reconstructed image or the reconstructed image on which deblocking filtering is performed, as shown in Equation 30. [Mathematical Formula 30] In this case, the filter can be selected on a picture-by-picture or CTU-by-CTU basis. For the luminance component, any one of the 5x5, 7x7, or 9x9 diamond shapes can be selected as shown in Fig. 40. For the color difference component, it may be restricted to using only the 5x5 diamond shape. The various embodiments of the present disclosure are not intended to list all possible combinations but to describe representative aspects of the present disclosure, and the matters described in the various embodiments may be applied independently or in combination of two or more. In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. In the case of implementation by hardware, it may be implemented by one or more ASICs (Application Specific Integrated Circuits), DSPs (Digital Signal Processors), DSPDs (Digital Signal Processing Devices), PLDs (Programmable Logic Devices), FPGAs (Field Programmable Gate Arrays), general processors, controllers, microcontrollers, microprocessors, etc. The scope of the present disclosure includes software or machine-executable instructions (e.g., operating system, application, firmware, program, etc.) that enable an operation according to a method of various embodiments to be executed on a device or computer, and a non-transitory computer-readable medium on which such software or instructions, etc. are stored and executable on a device or computer. The present invention can be used for video encoding / decoding.

Claims

1. A step of determining the intra prediction mode of a color difference block; A step of specifying a luminance area for reference between components of the above chrominance block; A step of downsampling the specified luminance region; wherein the luminance region includes at least one of a luminance block corresponding to the chrominance block or a neighboring region adjacent to the luminance block. A step of deriving parameters for reference between components of the above chrominance block; and A video decoding method comprising a step of predicting the chrominance block by applying the parameter to the downsampled luminance block.

2. In paragraph 1, The intra prediction mode of the above chrominance block is derived based on a predetermined group and index consisting of a prediction mode based on inter-component reference, A video decoding method, wherein the above inter-component reference-based prediction mode includes at least one of a first mode referencing both the left and upper areas adjacent to the chrominance block, a second mode referencing the left area adjacent to the chrominance block, or a third mode referencing the upper area adjacent to the chrominance block.

3. In paragraph 1, The neighboring region adjacent to the luminance block includes at least one of the upper neighboring region and the left neighboring region, A video decoding method, wherein the upper neighboring region includes n pixel lines and the left neighboring region includes m pixel lines.

4. In paragraph 1, A video decoding method, wherein downsampling for a neighboring area adjacent to the luminance block is performed using only luminance pixels at a specific location and pixels surrounding the luminance pixels.

5. In paragraph 4, A video decoding method, wherein the specific location is determined based on the location of a pixel selected from among a plurality of pixels belonging to a neighboring area of ​​the chrominance block.

6. In paragraph 5, A video decoding method, wherein the selected pixels are one or more pixels located at predetermined intervals in a neighboring area of ​​the chrominance block.

7. In paragraph 4, A video decoding method, wherein the above-mentioned surrounding pixels are pixels located in at least one direction among the left, right, top, bottom, top left, bottom left, top right, or bottom right of the above-mentioned luminance pixel.

8. In the first paragraph, the step of deriving parameters for reference between the components is as follows: A step of calculating a maximum value and a minimum value from a plurality of pixels obtained through downsampling for a neighboring area of ​​the luminance block, A video decoding method, wherein the parameters for reference between the above components are derived using the calculated maximum and minimum values.

9. A step of determining the intra prediction mode of the color difference block; A step of specifying a luminance area for reference between components of the above chrominance block; A step of downsampling the specified luminance region; wherein the luminance region includes at least one of a luminance block corresponding to the chrominance block or a neighboring region adjacent to the luminance block. A step of deriving parameters for reference between components of the above chrominance block; and A video encoding method, comprising a step of predicting the chrominance block by applying the parameter to the downsampled luminance block.

10. In a digital storage medium for storing a video bitstream, A digital storage medium having recorded thereon a video decoding program that executes a process of determining an intra prediction mode of a chrominance block, specifying a luminance region for inter-component reference of the chrominance block, downsampling the specified luminance region, deriving a parameter for inter-component reference of the chrominance block, and applying the parameter to the downsampled luminance region to predict the chrominance block.