Video signal processing method, and device therefor

The video signal processing method employs a CCP list to derive chrominance blocks from luminance blocks, addressing inefficiencies in existing methods by optimizing coding efficiency through advanced correlation utilization, resulting in improved encoding and decoding performance.

WO2024225846A1PCT designated stage expired Publication Date: 2024-10-31WILUS INSTITUTE OF STANDARDS & TECHNOLOGY INC

Patent Information

Application Number
PCT/KR2024/005806
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-10-13
Filing Date
2024-04-29
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

Current video signal processing methods for encoding and decoding are inefficient due to limitations in utilizing spatial, temporal, and probabilistic correlations, necessitating the development of more advanced techniques to enhance coding efficiency.

Method used

A method and device for video signal processing that utilize a Cross-Component Prediction (CCP) list to derive chrominance component blocks from luminance component blocks, selecting optimal CCP model candidates based on cost and rearranging the CCP merge list, incorporating parameters from neighboring blocks, and employing predefined CCP models or combinations thereof.

Benefits of technology

This approach significantly improves coding efficiency by effectively utilizing spatial and temporal correlations, leading to enhanced video signal processing and compression, thereby optimizing bitstream generation and decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2024005806_31102024_PF_FP_ABST
    Figure KR2024005806_31102024_PF_FP_ABST
Patent Text Reader

Abstract

The video signal decoding device may comprise a processor, wherein the processor configures a cross-component prediction (CCP) list for deriving a chroma component block of a current block from a luma component block of the current block, selects one CCP model candidate in the CCP list, and derives the chroma component block of the current block on the basis of the one CCP model candidate.
Need to check novelty before this filing date? Find Prior Art

Description

Video signal processing method and device therefor

[0001] The present invention relates to a method and device for processing a video signal, and more particularly, to a method and device for processing a video signal for encoding or decoding a video signal.

[0002] Compression coding refers to a series of signal processing techniques for transmitting digitized information over communication lines or storing it in a format suitable for storage media. Objects subject to compression coding include audio, video, and text, and the technology that performs compression coding on video in particular is called video compression. Compression coding of video signals is achieved by removing redundant information by considering spatial, temporal, and probabilistic correlations. However, with the recent advancements in various media and data transmission media, there is a growing demand for more efficient video signal processing methods and devices.

[0003] The purpose of this specification is to provide a video signal processing method and a device therefor to improve the coding efficiency of a video signal.

[0004] The present specification provides a video signal processing method and a device therefor.

[0005] In the present specification, a video signal decoding device includes a processor, wherein the processor can construct a CCP (Cross-Component Prediction) list for deriving a chrominance component block of a current block from a luminance component block of the current block, select one CCP model candidate within the CCP list, and derive the chrominance component block of the current block based on the one CCP model candidate. The processor can reorder the CCP merge list based on a cost.

[0006] In the present specification, a video signal encoding device includes a processor, and the processor can obtain a bitstream decoded by a decoding method. In addition, in the present specification, a computer-readable non-transitory storage medium can store the bitstream decoded by the decoding method. The decoding method may include the steps of: constructing a CCP (Cross-Component Prediction) list for deriving a chrominance component block of a current block from a luminance component block of the current block; selecting one CCP model candidate within the CCP list; and deriving a chrominance component block of the current block based on the one CCP model candidate. The decoding method may further include the step of reordering the CCP merge list based on a cost.

[0007] Additionally, in the present specification, the CCP list includes one or more CCP model candidates, and the one or more CCP model candidates may include a first CCP model candidate used by a reference block of the current block.

[0008] In addition, in the present specification, the one or more CCP model candidates can be obtained using at least one of a type of CCP model derived from the first CCP model candidate, a parameter coefficient for the first CCP model, coordinate information of the surrounding block, an average value of samples constituting the surrounding block, a luminance offset value of the surrounding block, encoding mode information of the surrounding block, and a quantization parameter of the surrounding block.

[0009] Additionally, in the present specification, the one or more CCP model candidates may be predefined CCP models.

[0010] Additionally, in the present specification, the one or more CCP model candidates are determined based on a type of a predefined CCP model, and parameters for the one or more CCP model candidates can be derived through surrounding samples adjacent to the current block.

[0011] Additionally, in the present specification, the reference block may be a block temporally separated from the current block.

[0012] Additionally, in this specification, the POC (Picture Order Count) of the picture including the current block and the POC of the picture including the reference block may be different from each other.

[0013] The one or more CCP model candidates may include a CCP model generated by combining two or more CCP models.

[0014] Additionally, in the present specification, the one or more CCP model candidates may be determined based on the product of the horizontal size of the current block and the horizontal size of the current block.

[0015] Also, in the present specification, if the product of the horizontal size of the current block and the horizontal size of the current block is equal to or less than a first threshold, the one or more CCP model candidates may not be a GL-CCCM (Gradient and location based convolutional cross-component model) or a CCCM-MDF (CCCM with multiple downsampling filters).

[0016] This specification provides a method for efficiently processing a video signal.

[0017] The effects that can be obtained from this specification are not limited to the effects mentioned above, and other effects that are not mentioned can be clearly understood by a person having ordinary skill in the art to which the present invention pertains from the description below.

[0018] FIG. 1 is a schematic block diagram of a video signal encoding device according to one embodiment of the present invention.

[0019] FIG. 2 is a schematic block diagram of a video signal decoding device according to one embodiment of the present invention.

[0020] Figure 3 illustrates an embodiment in which a coding tree unit within a picture is divided into coding units.

[0021] Figure 4 illustrates one embodiment of a method for signaling the splitting of a quad tree and a multi-type tree.

[0022] Figures 5 and 6 illustrate the intra prediction method according to an embodiment of the present invention in more detail.

[0023] Figure 7 is a diagram showing the locations of surrounding blocks used to construct a motion candidate list in inter prediction.

[0024] FIG. 8 is a diagram illustrating a method for performing CCLM according to one embodiment of the present specification.

[0025] FIG. 9 is a diagram illustrating a template used for deriving a linear model according to one embodiment of the present specification.

[0026] FIG. 10 is a diagram illustrating a method for deriving two linear models according to one embodiment of the present specification.

[0027] FIG. 11 is a diagram illustrating a method for signaling an intra prediction directional mode for a chrominance component block according to one embodiment of the present specification.

[0028] FIG. 12 and FIG. 13 are diagrams showing a context model according to one embodiment of the present specification.

[0029] FIG. 14 is a diagram illustrating a method for deriving an intra prediction mode of a current block using surrounding blocks according to one embodiment of the present specification.

[0030] FIG. 15 is a diagram illustrating a method for obtaining a color difference prediction block according to one embodiment of the present specification.

[0031] FIG. 16 is a diagram illustrating a reference region used to generate a linear model according to one embodiment of the present specification.

[0032] Figure 17 illustrates an example of a reference region and filter shape used to derive CCCM parameters according to one embodiment of the present invention.

[0033] Figure 18 shows samples used to derive CCCM parameters according to one embodiment of the present invention.

[0034] FIG. 19 illustrates luminance samples around a luminance sample of a current block according to one embodiment of the present invention.

[0035] FIG. 20 and FIG. 21 illustrate luminance samples before downsampling used to derive chrominance samples in CCCM-ND mode according to one embodiment of the present invention.

[0036] Figures 22 and 23 show a structural diagram for application of a cross-component residual model (CCRM) according to one embodiment of the present invention.

[0037] FIG. 24 illustrates a method of utilizing the correlation between a luminance prediction block and a luminance restoration block according to one embodiment of the present invention.

[0038] Fig. 25 shows a downsampling filter and sample positions applied to a luminance block according to one embodiment of the present invention.

[0039] Figure 26 shows coefficients of filtering applied to a prediction block and filtered positions according to one embodiment of the present invention.

[0040] Figure 27 illustrates filtering applied to a prediction block according to one embodiment of the present invention.

[0041] Figure 28 illustrates a method for determining a CCP mode based on a template cost according to one embodiment of the present invention.

[0042] FIG. 29 illustrates surrounding blocks used to derive CCCM for a current chrominance block according to one embodiment of the present invention.

[0043] Fig. 30 shows a reference area indicated by a block vector of a current luminance block according to one embodiment of the present invention.

[0044] FIG. 31 is a structural diagram illustrating a method for predicting a current block using CCP merge mode according to one embodiment of the invention.

[0045] Figure 32 shows surrounding blocks of a current block according to one embodiment of the present invention.

[0046] Figures 33 and 34 illustrate co-located blocks and surrounding blocks according to one embodiment of the present invention.

[0047] Figure 35 illustrates a CCLM depicted in graph form according to one embodiment of the present invention.

[0048] FIG. 36 illustrates reference template locations used to rearrange a CCP merge list according to one embodiment of the present invention.

[0049] Figure 37 illustrates a CCP method based on a block vector according to one embodiment of the present invention.

[0050] Figure 38 illustrates a luminance block corresponding to a chrominance block according to one embodiment of the present invention.

[0051] FIG. 39 illustrates a method for deriving a reference block using a block vector derived from a corresponding luminance block according to one embodiment of the present invention.

[0052] Figure 40 illustrates a method for deriving each CCP model from multiple block vectors according to one embodiment of the present invention.

[0053] Figure 41 illustrates a method for constructing a CCP list according to one embodiment of the present invention.

[0054] The terms used in this specification have been selected from widely used and current terms, taking into account the functions of the present invention. However, these terms may vary depending on the intentions of those skilled in the art, customs, or the emergence of new technologies. Furthermore, in certain cases, the applicant may arbitrarily select terms, in which case their meanings will be described in the description of the relevant invention. Therefore, it should be noted that the terms used in this specification should be interpreted based on their substantive meaning and the overall content of this specification, rather than simply their names.

[0055] In this specification, 'A and / or B' may be interpreted to mean 'comprising at least one of A or B'.

[0056] In this specification, some terms may be interpreted as follows. Coding may be interpreted as encoding or decoding, depending on the case. In this specification, a device that encodes a video signal to generate a video signal bitstream is referred to as an encoding device or encoder, and a device that decodes a video signal bitstream to restore a video signal is referred to as a decoding device or decoder. In addition, in this specification, a video signal processing device is used as a term that includes both an encoder and a decoder. Information is a term that includes values, parameters, coefficients, elements, etc., and since the meaning may be interpreted differently depending on the case, the present invention is not limited thereto. 'Unit' is used to mean a basic unit of image processing or a specific location of a picture, and refers to an image area that includes at least one of a luminance component and a chroma component. In addition, 'block' refers to an image area including specific components among luminance components and chrominance components (i.e., Cb and Cr). However, depending on the embodiment, terms such as 'unit', 'block', 'partition', 'signal', and 'region' may be used interchangeably. In addition, in this specification, 'current block' means a block that is currently scheduled to be encoded, and 'reference block' means a block that has already been encoded or decoded and is used as a reference in the current block. In addition, in this specification, terms such as 'luma', 'luminance', and 'Y' may be used interchangeably. In addition, in this specification, terms such as 'chroma', 'chroma', 'color difference', and 'Cb or Cr' may be used interchangeably, and since chrominance components are divided into two, Cb and Cr, each chrominance component may be used separately. In addition, in this specification, a unit may be used as a concept including all of a coding unit, a prediction unit, and a transformation unit.A picture refers to a field or a frame, and depending on the embodiment, the terms may be used interchangeably. Specifically, if the captured image is an interlace image, one frame is divided into an odd (or odd, top) field and an even (or even, bottom) field, and each field is configured as one picture unit and can be encoded or decoded. If the captured image is a progressive image, one frame is configured as a picture and can be encoded or decoded. In addition, in this specification, the terms 'error signal', 'residual signal', 'residual signal', 'residual signal', and 'differential signal' may be used interchangeably. In addition, in this specification, the terms 'intra prediction mode', 'intra prediction directional mode', 'intra-screen prediction mode', and 'intra-screen prediction directional mode' may be used interchangeably. In addition, in this specification, the terms 'motion', 'movement', and the like may be used interchangeably. In addition, in this specification, 'left', 'upper left', 'upper left', 'upper right', 'right', 'lower right', 'lower left', and 'lower left' can be used interchangeably with 'left', 'upper left', 'top', 'upper right', 'right', 'lower right', 'bottom', and 'lower left'. In addition, element and member can be used interchangeably with each other. POC (Picture Order Count) indicates the temporal position information of a picture (or frame), can be the playback order displayed on the screen, and can have a unique POC for each picture.

[0057] FIG. 1 is a schematic block diagram of a video signal encoding device (100) according to one embodiment of the present invention. Referring to FIG. 1, the encoding device (100) of the present invention includes a transformation unit (110), a quantization unit (115), an inverse quantization unit (120), an inverse transformation unit (125), a filtering unit (130), a prediction unit (150), and an entropy coding unit (160).

[0058] The transform unit (110) obtains a transform coefficient value by transforming the residual signal, which is the difference between the input video signal and the prediction signal generated by the prediction unit (150). For example, a discrete cosine transform (DCT), a discrete sine transform (DST), or a wavelet transform may be used. The discrete cosine transform and the discrete sine transform divide the input picture signal into blocks and perform the transformation. The coding efficiency may vary depending on the distribution and characteristics of the values ​​within the transform domain during the transformation. The transform kernel used for the transformation on the residual block may be a transform kernel having separable characteristics of vertical transformation and horizontal transformation. In this case, the transformation on the residual block may be performed separately as vertical transformation and horizontal transformation. For example, the encoder may perform vertical transformation by applying the transform kernel in the vertical direction of the residual block. Additionally, the encoder can perform horizontal transformation by applying a transformation kernel in the horizontal direction of the residual block. In the present disclosure, the transformation kernel may be used as a term referring to a set of parameters used for transformation of the residual signal, such as a transformation matrix, a transformation array, a transformation function, or a transformation. For example, the transformation kernel may be any one of a plurality of available kernels. Additionally, transformation kernels based on different transformation types may be used for each of the vertical transformation and the horizontal transformation.

[0059] The transformation coefficients are distributed in a way that increases toward the upper left corner of the block, and decreases toward 0 toward the lower right corner. As the current block size increases, there is a high probability of a significant number of 0 coefficients in the lower right corner. To reduce the transformation complexity of large blocks, only the predefined upper left corner can be left, and the remaining areas can be reset to 0.

[0060] Additionally, error signals may exist only in some regions of a coding block. In this case, the conversion process may be performed only on some predefined regions. For example, in a block of size 2Nx2N, an error signal may exist only in the first 2NxN block, and the conversion process may be performed only on the first 2NxN block, but the conversion process may not be performed on the second 2NxN block and may not be encoded or decoded. Here, N may be a predefined positive integer.

[0061] The encoder may perform an additional transform before the transform coefficients are quantized. The aforementioned transform method may be referred to as a primary transform, and the additional transform may be referred to as a secondary transform. The secondary transform may be optional for each residual block. In one embodiment, the encoder may improve coding efficiency by performing the secondary transform on areas where it is difficult to concentrate energy in the low-frequency region using only the primary transform. For example, the secondary transform may be additionally performed on blocks where residual values ​​appear large in directions other than the horizontal or vertical direction of the residual block. Unlike the primary transform, the secondary transform may not be performed separately into a vertical transform and a horizontal transform. Such a secondary transform may be referred to as a Low Frequency Non-Separable Transform (LFNST).

[0062] The quantization unit (115) quantizes the transformation coefficient value output from the transformation unit (110).

[0063] In order to increase coding efficiency, rather than coding the picture signal as it is, a method is used to predict a picture using an already coded area through a prediction unit (150), and to obtain a restored picture by adding the residual value between the original picture and the predicted picture to the predicted picture. In order to prevent mismatches from occurring in the encoder and decoder, when the encoder performs prediction, information that is also available to the decoder must be used. To this end, the encoder performs a process of restoring the encoded current block. The inverse quantization unit (120) inversely quantizes the transform coefficient value, and the inverse transform unit (125) restores the residual value using the inverse quantized transform coefficient value. Meanwhile, the filtering unit (130) performs a filtering operation to improve the quality of the restored picture and enhance the coding efficiency. For example, a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter may be included. The filtered picture is stored in the Decoded Picture Buffer (DPB, 156) to be output or used as a reference picture.

[0064] A deblocking filter is a filter that removes distortion within blocks generated at the boundaries between blocks in a reconstructed picture. The encoder can determine whether to apply a deblocking filter to a certain boundary based on the distribution of pixels in several columns or rows based on an arbitrary boundary (edge) within the block. When applying a deblocking filter to a block, the encoder can apply a long filter, a strong filter, or a weak filter depending on the deblocking filtering strength. Additionally, horizontal and vertical filtering can be processed in parallel. Sample adaptive offset (SAO) can be used to correct the offset from the original image on a pixel-by-pixel basis for the residual block to which the deblocking filter has been applied. To correct the offset for a specific picture, the encoder can divide the pixels contained in the image into a certain number of regions, determine the regions to perform offset correction, and apply the offset to those regions (Band Offset). Alternatively, the encoder can use a method (Edge Offset) that applies an offset by considering the edge information of each pixel. An adaptive loop filter (ALF) is a method that divides pixels included in an image into a predetermined group, determines a filter to be applied to each group, and performs filtering differently for each group. Information regarding whether to apply ALF can be signaled on a coding unit basis, and the shape and filter coefficients of the ALF filter to be applied can vary depending on each block. In addition, an ALF filter of the same shape (fixed shape) can be applied regardless of the characteristics of the target block to which it is applied.

[0065] The prediction unit (150) includes an intra prediction unit (152) and an inter prediction unit (154). The intra prediction unit (152) performs intra prediction within a current picture, and the inter prediction unit (154) performs inter prediction to predict the current picture using a reference picture stored in a decoded picture buffer (156). The intra prediction unit (152) performs intra prediction from reconstructed regions within the current picture and transfers intra encoding information to the entropy coding unit (160). The intra encoding information may include at least one of an intra prediction mode, an MPM (Most Probable Mode) flag, an MPM index, and information about a reference sample. The inter prediction unit (154) may be configured to include a motion estimation unit (154a) and a motion compensation unit (154b). The motion estimation unit (154a) refers to a specific area of ​​the restored reference picture to find the part most similar to the current area and obtains a motion vector value, which is the distance between the areas. The motion information (reference direction indication information (L0 prediction, L1 prediction, bidirectional prediction), reference picture index, motion vector information, etc.) for the reference area obtained by the motion estimation unit (154a) is transferred to the entropy coding unit (160) so that it can be included in the bitstream. Using the motion information transferred from the motion estimation unit (154a), the motion compensation unit (154b) performs inter-motion compensation to generate a prediction block for the current block. The inter-prediction unit (154) transfers inter-encoding information including motion information for the reference area to the entropy coding unit (160).

[0066] According to an additional embodiment, the prediction unit (150) may include an intra block copy (IBC) prediction unit (not shown). The IBC prediction unit performs IBC prediction on reconstructed samples in the current picture and transfers IBC encoding information to the entropy coding unit (160). The IBC prediction unit obtains a block vector value indicating a reference region used for prediction of the current region by referring to a specific region in the current picture. The IBC prediction unit may perform IBC prediction using the obtained block vector value. The IBC prediction unit transfers the IBC encoding information to the entropy coding unit (160). The IBC encoding information may include at least one of size information of the reference region, block vector information (index information for block vector prediction of the current block within a motion candidate list, and block vector difference information).

[0067] When the picture prediction as above is performed, the transformation unit (110) obtains a transformation coefficient value by transforming the residual value between the original picture and the predicted picture. At this time, the transformation can be performed in units of specific blocks within the picture, and the size of the specific block can be varied within a preset range. The quantization unit (115) quantizes the transformation coefficient value generated by the transformation unit (110) and transfers the quantized transformation coefficient to the entropy coding unit (160).

[0068] The quantized transform coefficients in the form of a two-dimensional array can be rearranged into a one-dimensional array for entropy coding. The method of scanning the quantized transform coefficients can be determined by which scanning method is used depending on the size of the transform block and the prediction mode within the screen. For example, diagonal, vertical, and horizontal scanning can be applied. This scanning information can be signaled on a block-by-block basis and can be derived according to predetermined rules.

[0069] The entropy coding unit (160) entropy-codes information representing quantized transform coefficients, intra-coding information, inter-coding information, etc. to generate a video signal bitstream. The entropy coding unit (160) may use a variable length coding (VLC) method and an arithmetic coding method. The variable length coding (VLC) method converts input symbols into continuous codewords, and the length of the codewords may be variable. For example, frequently occurring symbols are expressed as short codewords, and infrequently occurring symbols are expressed as long codewords. A context-based adaptive variable length coding (CAVLC) method may be used as a variable length coding method. Arithmetic coding converts continuous data symbols into a single prime number by using the probability distribution of each data symbol, and arithmetic coding can obtain the optimal prime number bits required to express each symbol. Context-based Adaptive Binary Arithmetic Code (CABAC) can be used as an arithmetic coding.

[0070] CABAC is a binary arithmetic coding method that uses multiple context models generated based on probabilities obtained through experiments. In this specification, the context models can be described as context models. First, if the symbol is not in binary form, the encoder binarizes each symbol using exp-Golomb, etc. The binarized 0 or 1 can be described as a bin. The CABAC initialization process is divided into context initialization and arithmetic coding initialization. Context initialization is the process of initializing the occurrence probability of each symbol, and is determined by the symbol type, quantization parameter (QP), and slice type (I, P, B). A context model with this initialization information can use probability-based values ​​obtained through experiments. The context model provides the occurrence probability of the Least Probable Symbol (LPS) or Most Probable Symbol (MPS) for the symbol to be currently encoded, and information (valMPS) on which bin value among 0 and 1 corresponds to the MPS. One of several context models is selected through the context index (ctxIdx), and the context index can be derived from information about the current block to be encoded or information about the surrounding blocks. Initialization for binary arithmetic coding is performed based on the probability model selected from the context model. Binary arithmetic coding is performed by dividing the data into probability intervals based on the occurrence probabilities of 0 and 1, and then encoding is performed through a process in which the probability interval corresponding to the bin to be processed becomes the entire probability interval for the bin to be processed next. The location information within the probability interval in which the last bin has been processed is output. However, since the probability interval cannot be divided infinitely, if it is reduced to a certain size, a renormalization process is performed to expand the probability interval and output the corresponding location information. In addition, after each bin is processed, a probability update process can be performed in which the probability for the next bin to be processed is newly set based on the information of the processed bin.

[0071] The above generated bitstream is encapsulated into NAL (Network Abstraction Layer) units as basic units. NAL units are divided into VCL (Video Coding Layer) NAL units containing video data and non-VCL NAL units containing parameter information for decoding video data, and there are various types of VCL or non-VCL NAL units. A NAL unit consists of NAL header information and RBSP (Raw Byte Sequence Payload) data, and the NAL header information includes summary information about the RBSP. The RBSP of a VCL NAL unit includes an integer number of encoded coding tree units. In order to decode a bitstream in a video decoder, the bitstream must first be divided into NAL unit units, and then each divided NAL unit must be decoded. Meanwhile, information required for decoding a video signal bitstream can be transmitted as included in a Video Parameter Set (VPS), a Sequence Parameter Set (SPS), a Picture Parameter Set (PPS), an Adaptation Parameter Set (APS), etc. An RBSP of a VCL NAL unit can include an integer number of coding tree units. A VPS is a parameter set configured with a common syntax by extracting duplicate parameters from an SPS parameter set signaled for each layer in a bitstream that supports image quality, resolution, and frame rate scalability or a bitstream that supports multi-view.SPS is a parameter set that includes at least one of the following: Profile, which contains information about acceptable coding tools (or algorithms) and video formats; Level, which contains information about the decoder's processing capabilities, such as the resolution and frame rate of processable video and the allowable memory size; Tier, which contains information about the maximum bit rate that can be processed; and information about the resolution, bit depth, and whether or not a function can be enabled. PPS is a parameter set that includes at least one of the following: resolution of the video, tile division information, whether or not to enable weight prediction, quantization parameters, and filtering-related information. APS is a parameter set that includes one of the following: ALF filter coefficient information, LMCS-related parameters, and quantization scale parameters, depending on the APS type. APS is divided into prefix APS, which is signaled before the VCL NAL unit, and suffix APS, which is signaled after the VCL NAL unit. In the case of ALF APS, it is efficient to apply the ALF filter coefficients derived from the previous picture to the next picture, so it can be signaled as suffix APS.

[0072] Meanwhile, the block diagram of FIG. 1 illustrates an encoding device (100) according to one embodiment of the present invention, and the blocks shown separately logically distinguish elements of the encoding device (100). Accordingly, the elements of the encoding device (100) described above may be mounted as one chip or as multiple chips depending on the design of the device. According to one embodiment, the operations of each element of the encoding device (100) described above may be performed by a processor (not shown).

[0073] Fig. 2 is a schematic block diagram of a video signal decoding device (200) according to one embodiment of the present invention. Referring to Fig. 2, the decoding device (200) of the present invention includes an entropy decoding unit (210), an inverse quantization unit (220), an inverse transformation unit (225), a filtering unit (230), and a prediction unit (250).

[0074] The entropy decoding unit (210) entropy decodes the video signal bitstream to extract transform coefficient information, intra-coding information, inter-coding information, etc. for each region. For example, the entropy decoding unit (210) can obtain a binarization code for transform coefficient information of a specific region from the video signal bitstream. In addition, the entropy decoding unit (210) inversely binarizes the binarization code to obtain a quantized transform coefficient. The inverse quantization unit (220) inversely quantizes the quantized transform coefficient, and the inverse transform unit (225) restores the residual value using the inverse quantized transform coefficient. The video signal processing device (200) restores the original pixel value by adding the residual value obtained by the inverse transform unit (225) and the prediction value obtained by the prediction unit (250).

[0075] Meanwhile, the filtering unit (230) performs filtering on the picture to improve the image quality. This may include a deblocking filter to reduce block distortion and / or an adaptive loop filter to remove distortion from the entire picture. The filtered picture is output or stored in the decoded picture buffer (DPB, 256) to be used as a reference picture for the next picture.

[0076] The prediction unit (250) includes an intra prediction unit (252) and an inter prediction unit (254). The prediction unit (250) generates a prediction picture by utilizing the encoding type decoded through the entropy decoding unit (210) described above, the transform coefficients for each region, intra / inter encoding information, etc. In order to restore the current block on which decoding is performed, the decoded region of the current picture or other pictures including the current block may be used. A picture (or tile / slice) that uses only the current picture for restoration, i.e., performs intra prediction or intra BC prediction, is called an intra picture or I picture (or tile / slice), and a picture (or tile / slice) that can perform all of intra prediction, inter prediction, and intra BC prediction is called an inter picture (or tile / slice). A picture (or tile / slice) that uses at most one motion vector and reference picture index to predict sample values ​​of each block among inter-pictures (or tiles / slices) is called a predictive picture or P-picture (or tile / slice), and a picture (or tile / slice) that uses at most two motion vectors and reference picture indices is called a bi-predictive picture or B-picture (or tile / slice). In other words, a P-picture (or tile / slice) uses at most one motion information set to predict each block, and a B-picture (or tile / slice) uses at most two motion information sets to predict each block. Here, a motion information set includes one or more motion vectors and one reference picture index.

[0077] The intra prediction unit (252) generates a prediction block using intra encoding information and reconstructed samples within the current picture. As described above, the intra encoding information may include at least one of an intra prediction mode, a Most Probable Mode (MPM) flag, and an MPM index. The intra prediction unit (252) predicts sample values ​​of the current block using reconstructed samples located on the left and / or above the current block as reference samples. In the present disclosure, the reconstructed samples, the reference samples, and the samples of the current block may represent pixels. Additionally, the sample values ​​may represent pixel values.

[0078] According to one embodiment, the reference samples may be samples included in a neighboring block of the current block. For example, the reference samples may be samples adjacent to the left boundary of the current block and / or samples adjacent to the upper boundary. In addition, the reference samples may be samples located on a line within a preset distance from the left boundary of the current block and / or samples located on a line within a preset distance from the upper boundary of the current block among the samples of the neighboring blocks of the current block. In this case, the neighboring blocks of the current block may include at least one of a left (L) block, an upper (A) block, a lower left (BL) block, an above right (AR) block, or an above left (AL) block adjacent to the current block. The neighboring blocks of the current block may be reference blocks for predicting the current block.

[0079] The inter prediction unit (254) generates a prediction block using the reference picture and inter encoding information stored in the decoded picture buffer (256). The inter encoding information may include a set of motion information (reference picture index, motion vector information, etc.) of the current block with respect to the reference block. Inter prediction may include L0 prediction, L1 prediction, and bi-prediction. L0 prediction is prediction using one reference picture included in the L0 picture list, and L1 prediction means prediction using one reference picture included in the L1 picture list. For this, one set of motion information (e.g., motion vector and reference picture index) may be required. In the bi-prediction method, up to two reference areas can be used, and these two reference areas may exist in the same reference picture or may exist in different pictures, respectively. That is, in the bi-prediction method, up to two sets of motion information (e.g., motion vectors and reference picture indices) can be used, and the two motion vectors may correspond to the same reference picture index or may correspond to different reference picture indices. At this time, the reference pictures are pictures that are located temporally before or after the current picture, and may be completed pictures that have already been restored. According to one embodiment, the two reference areas used in the bi-prediction method may be areas selected from each of the L0 picture list and the L1 picture list. In addition, a prediction method that uses only reference pictures having a POC smaller than the POC of the current picture or uses only reference pictures having a POC larger than the POC of the current picture based on the POC (picture order count) indicating the display order of the current picture can be called uni-directional prediction.Also, a prediction method that uses both a reference picture with a POC (picture order count) smaller than that of the current picture and a reference picture with a POC larger than that of the current picture based on the POC indicating the display order of the current picture can be called bi-directional prediction. A prediction method that uses only one reference picture in uni-directional prediction can be called uni-prediction, and a prediction method that uses two reference pictures in uni-directional prediction can be called bi-prediction or bi-prediction.

[0080] The inter prediction unit (254) can obtain a reference block of the current block using a motion vector and a reference picture index. The reference block exists in a reference picture corresponding to the reference picture index. In addition, a sample value of a block specified by the motion vector or an interpolated value thereof can be used as a predictor of the current block. For motion prediction with sub-pel unit pixel accuracy, for example, an 8-tap interpolation filter can be used for a luminance signal and a 4-tap interpolation filter can be used for a chrominance signal. However, the interpolation filter for sub-pel unit motion prediction is not limited thereto. In this way, the inter prediction unit (254) performs motion compensation to predict the texture of the current unit from a previously restored picture. At this time, the inter prediction unit can use a motion information set.

[0081] According to an additional embodiment, the prediction unit (250) may include an IBC prediction unit (not shown). The IBC prediction unit may reconstruct the current region by referring to a specific region including reconstructed samples within the current picture. The IBC prediction unit may perform IBC prediction using IBC encoding information obtained from the entropy decoding unit (210). The IBC encoding information may include block vector information.

[0082] A restored video picture is generated by adding the predicted value output from the intra prediction unit (252) or inter prediction unit (254) and the residual value output from the inverse transformation unit (225). That is, the video signal decoding device (200) restores the current block using the predicted block generated from the prediction unit (250) and the residual obtained from the inverse transformation unit (225).

[0083] Meanwhile, the block diagram of FIG. 2 illustrates a decoding device (200) according to one embodiment of the present invention, and the blocks shown separately logically distinguish the elements of the decoding device (200). Accordingly, the elements of the aforementioned decoding device (200) may be mounted as one chip or as multiple chips depending on the design of the device. According to one embodiment, the operations of each element of the aforementioned decoding device (200) may be performed by a processor (not shown).

[0084] Meanwhile, the technology proposed in this specification is applicable to both the methods and devices of the encoder and decoder, and the parts described as signaling and parsing may be described for convenience of explanation. In general, signaling can be described as encoding each syntax from the encoder's perspective, and parsing can be described as interpreting each syntax from the decoder's perspective. That is, each syntax can be included in the bitstream from the encoder and signaled, and the decoder can parse the syntax and use it in the restoration process. At this time, the sequence of bits for each syntax listed in the prescribed hierarchical structure can be referred to as a bitstream.

[0085] A picture can be encoded by dividing it into sub-pictures, slices, tiles, etc. A sub-picture can include one or more slices or tiles. When a picture is encoded by dividing it into multiple slices or tiles, all slices or tiles within the picture must be decoded before it can be displayed on the screen. On the other hand, when a picture is encoded into multiple sub-pictures, only predefined sub-pictures can be decoded and displayed on the screen. A slice can include multiple tiles or sub-pictures, or a tile can include multiple sub-pictures or slices. Sub-pictures, slices, and tiles can be encoded or decoded independently, which is effective for parallel processing and improving processing speed. However, there is a disadvantage in that the amount of bits increases because the encoded information of adjacent sub-pictures, slices, and tiles cannot be used. Sub-pictures, slices, and tiles can be encoded by dividing them into multiple coding tree units (CTUs).

[0086] FIG. 3 illustrates an embodiment in which a Coding Tree Unit (CTU) within a picture is divided into Coding Units (CUs). In the process of coding a video signal, a picture may be divided into a sequence of Coding Tree Units (CTUs). A Coding Tree Unit may be composed of a luminance (luma) Coding Tree Block (CTB), two chroma (chroma) Coding Tree Blocks, and their encoded syntax information. One Coding Tree Unit may be composed of one Coding Unit, or one Coding Tree Unit may be split into multiple Coding Units. One Coding Unit may be composed of a luminance Coding Block (CB), two chroma Coding Blocks, and their encoded syntax information. One Coding Block may be split into multiple Sub-Coding Blocks. One Coding Unit may be composed of one Transform Unit (TU), or one Coding Unit may be split into multiple Transform Units. A single transform unit may consist of a luminance transform block (TB), two chrominance transform blocks, and their encoded syntax information. A coding tree unit may be divided into multiple coding units. A coding tree unit may not be divided and may also be a leaf node. In this case, the coding tree unit itself may be a coding unit.

[0087] A coding unit refers to a basic unit for processing a picture in the video signal processing described above, such as intra / inter prediction, transformation, quantization, and / or entropy coding. The size and shape of a coding unit within a picture may not be constant. A coding unit may have a square or rectangular shape. A rectangular coding unit (or rectangular block) includes a vertical coding unit (or vertical block) and a horizontal coding unit (or horizontal block). In the present specification, a vertical block is a block whose height is greater than its width, and a horizontal block is a block whose width is greater than its height. In addition, a non-square block in the present specification may refer to a rectangular block, but the present invention is not limited thereto.

[0088] Referring to Fig. 3, the coding tree unit is first partitioned into a Quad Tree (QT) structure. That is, in the Quad Tree structure, one node with a size of 2NX2N can be partitioned into four nodes with a size of NXN. In this specification, the Quad Tree may also be referred to as a quaternary tree. The Quad Tree partitioning can be performed recursively, and not all nodes need to be partitioned to the same depth.

[0089] Meanwhile, the leaf node of the aforementioned quad tree can be further split into a multi-type tree (MTT) structure. According to an embodiment of the present invention, in the multi-type tree structure, one node can be split into a binary or ternary tree structure of horizontal or vertical split. That is, the multi-type tree structure has four split structures: vertical binary split, horizontal binary split, vertical ternary split, and horizontal ternary split. According to an embodiment of the present invention, in each of the above tree structures, the width and height of the node can both have a power of 2 value. For example, in the binary tree (BT) structure, a node of size 2NX2N can be split into two NX2N nodes by vertical binary split, and can be split into two 2NXN nodes by horizontal binary split. Also, in a Ternary Tree (TT) structure, a node of size 2NX2N can be split into nodes of size (N / 2)X2N, NX2N, and (N / 2)X2N by vertical ternary splitting, and into nodes of size 2NX(N / 2), 2NXN, and 2NX(N / 2) by horizontal ternary splitting. This multi-type tree splitting can be performed recursively.

[0090] A leaf node of a multi-type tree can be a coding unit. If the coding unit is not larger than the maximum transformation length, the coding unit can be used as a unit of prediction and / or transformation without further splitting. In one embodiment, if the width or height of the current coding unit is larger than the maximum transformation length, the current coding unit can be split into multiple transformation units without explicit signaling regarding the splitting. Meanwhile, in the quad tree and multi-type tree described above, at least one of the following parameters can be predefined or transmitted through an RBSP of a higher-level set, such as a PPS, an SPS, or a VPS. 1) CTU size: The size of the root node of the quad tree, 2) MinQtSize: The minimum allowed QT leaf node size, 3) MaxBtSize: The maximum allowed BT root node size, 4) MaxTT size (MaxTtSize): The maximum allowed TT root node size, 5) MaxMttDepth: The maximum allowed depth of an MTT split from a leaf node of a QT, 6) MinBT size (MinBtSize): The minimum allowed BT leaf node size, 7) MinTT size (MinTtSize): The minimum allowed TT leaf node size.

[0091] Fig. 4 illustrates one embodiment of a method for signaling splitting of a quad tree and a multi-type tree. Pre-configured flags may be used to signal splitting of the quad tree and the multi-type tree described above. Referring to Fig. 4, at least one of a flag 'split_cu_flag' indicating whether a node is split, a flag 'split_qt_flag' indicating whether a quad tree node is split, a flag 'mtt_split_cu_vertical_flag' indicating a splitting direction of a multi-type tree node, or a flag 'mtt_split_cu_binary_flag' indicating a splitting shape of a multi-type tree node may be used.

[0092] According to an embodiment of the present invention, a flag 'split_cu_flag' indicating whether a current node is split may be signaled first. If the value of 'split_cu_flag' is 0, it indicates that the current node is not split, and the current node becomes a coding unit. If the current node is a coding tree unit, the coding tree unit includes one coding unit that is not split. If the current node is a quad tree node 'QT node', the current node is a leaf node 'QT leaf node' of the quad tree and becomes a coding unit. If the current node is a multi-type tree node 'MTT node', the current node is a leaf node 'MTT leaf node' of the multi-type tree and becomes a coding unit.

[0093] When the value of 'split_cu_flag' is 1, the current node can be split into nodes of a quad tree or a multi-type tree depending on the value of 'split_qt_flag'. The coding tree unit is the root node of the quad tree and can be first split into a quad tree structure. In the quad tree structure, 'split_qt_flag' is signaled for each node 'QT node'. When the value of 'split_qt_flag' is 1, the node is split into four square nodes, and when the value of 'split_qt_flag' is 0, the node becomes a leaf node 'QT leaf node' of the quad tree, and the node is split into multi-type nodes. According to an embodiment of the present invention, quad tree splitting can be limited depending on the type of the current node. Quad tree splitting may be allowed if the current node is a coding tree unit (root node of a quad tree) or a quad tree node, and quad tree splitting may not be allowed if the current node is a multi-type tree node. Each quad tree leaf node 'QT leaf node' may be further split into a multi-type tree structure. As described above, if 'split_qt_flag' is 0, the current node may be split into multi-type nodes. To indicate the splitting direction and splitting shape, 'mtt_split_cu_vertical_flag' and 'mtt_split_cu_binary_flag' may be signaled. If the value of 'mtt_split_cu_vertical_flag' is 1, a vertical split of the node 'MTT node' is indicated, and if the value of 'mtt_split_cu_vertical_flag' is 0, a horizontal split of the node 'MTT node' is indicated.Additionally, if the value of 'mtt_split_cu_binary_flag' is 1, the node 'MTT node' is split into two rectangular nodes, and if the value of 'mtt_split_cu_binary_flag' is 0, the node 'MTT node' is split into three rectangular nodes.

[0094] The tree partitioning structure allows luminance blocks and chrominance blocks to be partitioned into identical shapes. That is, chrominance blocks can be partitioned by referencing the partitioning shape of the luminance blocks. If the current chrominance block is smaller than a predefined size, the chrominance block may not be partitioned even if the luminance block is partitioned.

[0095] The tree partitioning structure may have different forms for luminance blocks and chrominance blocks. In this case, partitioning information for the luminance block and partitioning information for the chrominance block may be signaled separately. Furthermore, not only the partitioning information but also the encoding information for the luminance block and chrominance block may differ. For example, at least one of the intra-coding modes of the luminance block and the chrominance block, and the encoding information for motion information, may differ.

[0096] The luminance block and the chrominance block may have the same tree partitioning structure, which may be referred to as a single tree. If the current block is encoded with a single tree, the partitioning structure, encoding mode information, motion information, etc. of the luminance block and the chrominance block may be the same, and information related to other error signals may be different between the luminance block and the chrominance block. In addition, the luminance block and the chrominance block may have different tree partitioning structures, which may be referred to as a dual tree. If the current block is encoded with a dual tree, the partitioning structure, encoding mode information, motion information, etc. of the luminance block and the chrominance block may be different in at least one or more.

[0097] There is a close correlation between the luminance block and its corresponding chrominance block. Therefore, when the current block is encoded and decoded using a dual tree in the encoder and decoder, the chrominance block can be encoded using the luminance block's partition information, encoding mode information, and motion information.

[0098] A node to be divided into the smallest unit can be processed as a single coding block. If the current block is a coding block, the coding block can be divided into multiple sub-blocks (sub-coding blocks), and the prediction information of each sub-block can be the same or different. For example, if the coding unit is an intra mode, the intra prediction modes of each sub-block can be the same or different. Furthermore, if the coding unit is an inter mode, the motion information of each sub-block can be the same or different. Furthermore, each sub-block can be encoded or decoded independently. Each sub-block can be distinguished by a sub-block index (sbIdx). Furthermore, when a coding unit is divided into sub-blocks, it can be divided horizontally, vertically, or diagonally. In intra mode, the mode that divides the current coding unit into two or four sub-blocks horizontally or vertically is called ISP (Intra Sub-Partitions). In inter mode, the mode that divides the current coding block diagonally is called GPM (Geometric partitioning mode). In GPM mode, the position and direction of the diagonal line are derived using a predefined angle table, and the index information of the angle table is signaled.

[0099] The motion information may include one or more of reference direction indication information, reference picture information, motion vector, motion resolution, affine model, CPMV (control point motion vector), block vector, block vector resolution, MHP information, LIC information, filtering information, BCW information, and RRIBC information.

[0100] The reference direction indication information is composed of L0 prediction, L1 prediction, L0 and L1 prediction, and L0 prediction and L1 prediction are uni-prediction and unidirectional prediction, and L0 and L1 prediction are bi-prediction. And L0 and L1 prediction can be uni-prediction or bi-directional prediction. Here, L0 prediction is predicted using reference pictures in the L0 reference picture list, and L1 prediction can be predicted using reference pictures in the L1 reference picture list. In the L0 reference picture list, a reference picture with a POC smaller than the POC of the current picture can be added to the reference picture list based on the POC of the current picture. In addition, the L0 reference picture list can be composed in order from a reference picture with a POC closer to the POC of the current picture to a reference picture with a POC farther from the POC. In the L1 reference picture list, a reference picture with a POC larger than the POC of the current picture can be added to the reference picture list based on the POC of the current picture. Additionally, the L1 reference picture list can be organized in the order of reference pictures with a POC closer to the POC of the current picture to reference pictures with a POC farther away. The L0 and L1 reference picture lists can vary for each slice, subpicture, and picture. Additionally, the L0 reference picture list can include reference pictures of the L1 reference picture list. And the L1 reference picture list can include reference pictures of the L0 reference picture list.

[0101] Reference picture information may vary for each block and may be index information indicating which reference picture in the L0 reference picture list and / or the L1 reference picture list is used to predict the current block. The reference picture information may include one or more of L0 reference picture information and L1 reference picture information.

[0102] A motion vector is information that indicates the block that best matches the current block in a reference picture. It is a value that represents the distance to the reference block in horizontal and vertical coordinates based on the upper left position of the current block in the picture.

[0103] Motion resolution represents the resolution of the motion vector, and motion resolution can be expressed in units of 4 pixels, 1 pixel (integer pixel), 1 / 2 pixel, 1 / 4 pixel, 1 / 8 pixel, 1 / 16 pixel, etc.

[0104] A block vector is information indicating the block that best matches the current block in the already restored area within the current picture. It is a value that represents the distance to the reference block in horizontal and vertical coordinates based on the upper left position of the current block within the picture.

[0105] Block vector resolution can be expressed in units of 4 pixels, 1 pixel (integer pixel), 1 / 2 pixel, 1 / 4 pixel, 1 / 8 pixel, 1 / 16 pixel, etc.

[0106] MHP information may include whether additional motion information is applied and additional motion information.

[0107] LIC information may include whether LIC applies to the current block.

[0108] Filtering information may include filtering type and coefficient information applied according to the motion resolution of the current block.

[0109] CW information may include whether BCW is applied to the current block.

[0110] RRIBC information may include information about whether RRIBC is applied and the RRIBC type if the current block is encoded in IBC mode.

[0111] Picture prediction (motion compensation) for coding is performed on coding units that are no longer divisible (i.e., leaf nodes of a coding tree unit). The basic unit performing this prediction is referred to below as a prediction unit or prediction block.

[0112] Hereinafter, the term "unit" used in this specification may be used as a replacement for the prediction unit, which is the basic unit for performing prediction. However, the present invention is not limited thereto, and can be understood more broadly as a concept that includes the coding unit.

[0113] Figures 5 and 6 illustrate an intra prediction method according to an embodiment of the present invention in more detail. As described above, the intra prediction unit predicts sample values ​​of the current block using restored samples located to the left and / or above the current block as reference samples.

[0114] First, FIG. 5 illustrates an embodiment of reference samples used for prediction of a current block in an intra prediction mode. According to an embodiment, the reference samples may be samples adjacent to a left boundary of the current block and / or samples adjacent to an upper boundary. As illustrated in FIG. 5, when the size of the current block is WXH and samples of a single reference line adjacent to the current block are used for intra prediction, reference samples may be set using at most 2W+2H+1 surrounding samples located on the left and / or upper sides of the current block.

[0115] Meanwhile, pixels of multiple reference lines may be used for intra prediction of the current block. The multiple reference lines may be composed of n lines located within a preset range from the current block. According to one embodiment, when pixels of multiple reference lines are used for intra prediction, separate index information indicating the lines to be set as reference pixels may be signaled, and this may be referred to as a reference line index.

[0116] In addition, if at least some of the samples to be used as reference samples have not yet been restored, the intra prediction unit may perform a reference sample padding process to obtain a reference sample. In addition, the intra prediction unit may perform a reference sample filtering process to reduce an error in intra prediction. That is, filtering may be performed on the surrounding samples and / or the reference samples obtained by the reference sample padding process to obtain filtered reference samples. The intra prediction unit predicts samples of the current block using the reference samples obtained in this manner. The intra prediction unit predicts samples of the current block using unfiltered reference samples or filtered reference samples. In the present disclosure, the surrounding samples may include samples on at least one reference line. For example, the surrounding samples may include adjacent samples on a line adjacent to a boundary of the current block.

[0117] Next, FIG. 6 illustrates an embodiment of prediction modes used for intra prediction. For intra prediction, intra prediction mode information indicating an intra prediction direction may be signaled. The intra prediction mode information indicates any one of a plurality of intra prediction modes constituting an intra prediction mode set. If the current block is an intra prediction block, the decoder receives intra prediction mode information of the current block from the bitstream. The intra prediction unit of the decoder performs intra prediction on the current block based on the extracted intra prediction mode information.

[0118] According to an embodiment of the present invention, an intra prediction mode set may include all intra prediction modes used for intra prediction (e.g., a total of 67 intra prediction modes). More specifically, the intra prediction mode set may include a planar mode, a DC mode, and a plurality of (e.g., 65) angular modes (i.e., directional modes). Each intra prediction mode may be indicated by a preset index (i.e., an intra prediction mode index). For example, as illustrated in FIG. 6, an intra prediction mode index 0 indicates a planar mode, and an intra prediction mode index 1 indicates a DC mode. In addition, intra prediction mode indices 2 to 66 may each indicate different angular modes. The angular modes each indicate different angles within a preset angular range. For example, an angular mode may indicate an angle within an angular range from 45 degrees to -135 degrees clockwise (i.e., a first angular range). The angular mode may be defined based on the 12 o'clock direction. At this time, intra prediction mode index 2 indicates horizontal diagonal (HDIA) mode, intra prediction mode index 18 indicates horizontal (HOR) mode, intra prediction mode index 34 indicates diagonal (DIA) mode, intra prediction mode index 50 indicates vertical (VER) mode, and intra prediction mode index 66 indicates vertical diagonal (VDIA) mode.

[0119] Meanwhile, the preset angle range may be set differently depending on the shape of the current block. For example, if the current block is a rectangular block, a wide-angle mode indicating an angle exceeding 45 degrees or less than -135 degrees in a clockwise direction may be additionally used. If the current block is a horizontal block, the angle mode may indicate an angle within an angle range (i.e., a second angle range) between (45+offset1) degrees and (-135+offset1) degrees in a clockwise direction. At this time, angle modes 67 to 76 that are outside the first angle range may be additionally used. In addition, if the current block is a vertical block, the angle mode may indicate an angle within an angle range (i.e., a third angle range) between (45-offset2) degrees and (-135-offset2) degrees in a clockwise direction. At this time, angle modes -10 to -1 that are outside the first angle range may be additionally used. According to an embodiment of the present invention, the values ​​of offset1 and offset2 may be determined differently depending on the ratio between the width and height of the rectangular block. Also, offset1 and offset2 can be positive.

[0120] According to an additional embodiment of the present invention, the plurality of angular modes constituting the intra prediction mode set may include a basic angular mode and an extended angular mode. In this case, the extended angular mode may be determined based on the basic angular mode.

[0121] According to one embodiment, the basic angle mode may be a mode corresponding to an angle used in intra prediction of the existing HEVC (High Efficiency Video Coding) standard, and the extended angle mode may be a mode corresponding to an angle newly added in intra prediction of the next-generation video codec standard. More specifically, the basic angle mode may be an angle mode corresponding to any one of the intra prediction modes {2, 4, 6, … , 66}, and the extended angle mode may be an angle mode corresponding to any one of the intra prediction modes {3, 5, 7, … , 65}. That is, the extended angle mode may be an angle mode between the basic angle modes within the first angle range. Therefore, the angle indicated by the extended angle mode may be determined based on the angle indicated by the basic angle mode.

[0122] According to another embodiment, the basic angle mode may be a mode corresponding to an angle within a preset first angle range, and the extended angle mode may be a wide-angle mode outside the first angle range. That is, the basic angle mode may be an angle mode corresponding to any one of the intra prediction modes {2, 3, 4, … , 66}, and the extended angle mode may be an angle mode corresponding to any one of the intra prediction modes {-14, –13, –12, … , –1} and {67, 68, … , 80}. The angle indicated by the extended angle mode may be determined as an opposite angle to the angle indicated by the corresponding basic angle mode. Accordingly, the angle indicated by the extended angle mode may be determined based on the angle indicated by the basic angle mode. Meanwhile, the number of extended angle modes is not limited thereto, and additional extended angles may be defined according to the size and / or shape of the current block. Meanwhile, the total number of intra prediction modes included in the intra prediction mode set may vary depending on the configuration of the basic angle mode and the extended angle mode described above.

[0123] In the above embodiment, the spacing between the extended angular modes may be set based on the spacing between the corresponding basic angular modes. For example, the spacing between the extended angular modes {3, 5, 7, … , 65} may be determined based on the spacing between the corresponding basic angular modes {2, 4, 6, … , 66}. In addition, the spacing between the extended angular modes {-14, -13, … , -1} may be determined based on the spacing between the corresponding opposite basic angular modes {53, 53, … , 66}, and the spacing between the extended angular modes {67, 68, … , 80} may be determined based on the spacing between the corresponding opposite basic angular modes {2, 3, 4, … , 15}. The angular spacing between the extended angular modes may be set to be equal to the angular spacing between the corresponding basic angular modes. In addition, the number of the extended angular modes in the intra prediction mode set may be set to be less than or equal to the number of the basic angular modes.

[0124] According to an embodiment of the present invention, an extended angular mode may be signaled based on a base angular mode. For example, a wide-angle mode (i.e., an extended angular mode) may replace at least one angular mode (i.e., a base angular mode) within a first angular range. The replaced base angular mode may be an angular mode corresponding to an opposite side of the wide-angle mode. That is, the replaced base angular mode is an angular mode corresponding to an angle in an opposite direction to an angle indicated by the wide-angle mode or an angle that is different from the angle in the opposite direction by a preset offset index. According to an embodiment of the present invention, the preset offset index is 1. An intra prediction mode index corresponding to the replaced base angular mode may be remapped to the wide-angle mode to signal the corresponding wide-angle mode. For example, the wide-angle modes {-14, -13, … , -1} may be signaled by intra prediction mode indices {52, 53, … , 66}, and the wide-angle modes {67, 68, … , 69} may be signaled by intra prediction mode indices {52, 53, … , 66}, respectively. , 80} can be signaled by intra prediction mode indices {2, 3, … , 15}, respectively. By having the intra prediction mode index for the basic angular mode signal the extended angular mode in this way, even if the configuration of the angular modes used for intra prediction of each block is different, the same set of intra prediction mode indices can be used to signal the intra prediction mode. Therefore, the signaling overhead due to changes in the intra prediction mode configuration can be minimized.

[0125] Meanwhile, whether to use the extended angle mode may be determined based on at least one of the shape and size of the current block. In one embodiment, if the size of the current block is larger than a preset size, the extended angle mode may be used for intra prediction of the current block, and otherwise, only the default angle mode may be used for intra prediction of the current block. In another embodiment, if the current block is a non-square block, the extended angle mode may be used for intra prediction of the current block, and if the current block is a square block, only the default angle mode may be used for intra prediction of the current block.

[0126] The intra prediction unit determines reference samples and / or interpolated reference samples to be used for intra prediction of the current block based on intra prediction mode information of the current block. If the intra prediction mode index indicates a specific angular mode, the reference sample or interpolated reference sample corresponding to the specific angle from the current sample of the current block is used for prediction of the current pixel. Therefore, different sets of reference samples and / or interpolated reference samples can be used for intra prediction depending on the intra prediction mode. After intra prediction of the current block is performed using the reference samples and intra prediction mode information, the decoder restores the sample values ​​of the current block by adding the residual signal of the current block obtained from the inverse transform unit to the intra prediction value of the current block.

[0127] Motion information used for inter prediction may include reference direction indication information (inter_pred_idc), reference picture indexes (ref_idx_l0, ref_idx_l1), and motion vectors (mvL0, mvL1). Reference picture list utilization information (predFlagL0, predFlagL1) may be set according to the reference direction indication information. As an example, in case of unidirectional prediction using an L0 reference picture, predFlagL0=1, predFlagL1=0 may be set. In case of unidirectional prediction using an L1 reference picture, predFlagL0=0, predFlagL1=1 may be set. In case of bidirectional prediction using both L0 and L1 reference pictures, predFlagL0=1, predFlagL1=1 may be set.

[0128] If the current block is a coding unit, the coding unit can be divided into multiple sub-blocks, and the prediction information of each sub-block can be the same or different. For example, if the coding unit is an intra mode, the intra prediction modes of each sub-block can be the same or different. In addition, if the coding unit is an inter mode, the motion information of each sub-block can be the same or different. In addition, each sub-block can be encoded or decoded independently. Each sub-block can be distinguished through a sub-block index (sbIdx).

[0129] The motion vector of the current block is likely to be similar to that of the surrounding blocks. Therefore, the motion vectors of the surrounding blocks can be used as motion vector predictors (mvp), and the motion vector of the current block can be derived using the motion vectors of the surrounding blocks. Furthermore, to improve the accuracy of the motion vector, the difference in motion vectors (mvd) between the optimal motion vector of the current block, found from the original image by the encoder, and the motion predictor can be signaled.

[0130] Motion vectors can have various resolutions, and the resolution of motion vectors can vary on a block-by-block basis. Motion vector resolution can be expressed in integer units, half-pixel units, quarter-pixel units, sixteenth-pixel units, and integer-4 pixel units. Since images such as screen content are in simple graphical forms such as characters, interpolation filters do not need to be applied, integer units and integer-4 pixel units can be selectively applied on a block-by-block basis. Blocks encoded in affine mode, which can express rotation and scale, have significant shape changes, so integer units, quarter-pixel units, and sixteenth-pixel units can be selectively applied on a block-by-block basis. Information on whether to selectively apply motion vector resolution on a block-by-block basis is signaled with amvr_flag. If applicable, which motion vector resolution to apply to the current block is signaled with amvr_precision_idx.

[0131] For blocks to which bidirectional prediction is applied, the weights between the two prediction blocks can be applied equally or differently when applying weighted average, and information about the weights is signaled through bcw_idx.

[0132] To improve the accuracy of the motion prediction value, Merge or advanced motion vector prediction (AMVP) methods can be selectively used on a block-by-block basis. The Merge method configures the motion information of the current block to be identical to the motion information of the adjacent blocks to the current block, and has the advantage of increasing the encoding efficiency of the motion information by spatially propagating the motion information without change in the homogeneous motion region. On the other hand, the AMVP method predicts motion information in the L0 and L1 prediction directions respectively to express accurate motion information and signals the most optimal motion information. After the decoder derives the motion information for the current block through the AMVP or Merge method, it uses the reference block located in the motion information derived from the reference picture as the prediction block for the current block.

[0133] A method for deriving motion information in Merge or AMVP may be to construct a motion candidate list using predicted values ​​of motion information derived from neighboring blocks of the current block, and then signal index information for the optimal motion candidate. In the case of AMVP, since motion candidate lists are derived for each of L0 and L1, optimal motion candidate indices (mvp_l0_flag, mvp_l1_flag) for each of L0 and L1 are signaled. In the case of Merge, since one motion candidate list is derived, one merge index (merge_idx) is signaled. The motion candidate lists derived from one coding unit may vary, and a motion candidate index or merge index may be signaled for each motion candidate list. In this case, a mode in which there is no information about the remaining blocks in a block encoded in Merge mode can be referred to as MergeSkip mode.

[0134] Bidirectional motion information for the current block can be derived using a combination of AMVP and Merge modes. For example, motion information in the L0 direction can be derived using AMVP, while motion information in the L1 direction can be derived using Merge. Conversely, Merge can be applied to L0, and AMVP can be applied to L1. This encoding mode is called AMVP-Merge mode.

[0135] The motion candidates and motion information candidates in this specification may have the same meaning. Furthermore, the motion candidate list and motion information candidate list in this specification may have the same meaning.

[0136] SMVD (Symmetric MVD) is a method for reducing the bit volume of transmitted motion information by ensuring that the MVD (Motion Vector Difference) values ​​in the L0 and L1 directions are symmetrical in the case of bidirectional prediction. The MVD information in the L1 direction, which is symmetrical to the L0 direction, is not transmitted, and reference picture information in the L0 and L1 directions is also not transmitted, but is derived during the decoding process.

[0137] OBMC (Overlapped Block Motion Compensation) is a method that generates prediction blocks for the current block using motion information from surrounding blocks when the motion information between blocks differs. It then weights and averages these prediction blocks to generate a final prediction block for the current block. This method effectively reduces blocking artifacts that occur at block boundaries in motion-compensated images.

[0138] Typically, merge motion candidates have low motion accuracy. To improve the accuracy of these merge motion candidates, the MMVD (Merge mode with MVD) method can be used. The MMVD method is a method of compensating motion information using one candidate selected from several motion difference value candidates. Information about the compensation value of the motion information obtained through the MMVD method (e.g., an index indicating one candidate selected from among the motion difference value candidates) can be included in the bitstream and transmitted to the decoder. Compared to the existing method of including the motion information difference value in the bitstream, including information about the compensation value of the motion information in the bitstream can save bits.

[0139] The TM (Template Matching) method constructs a template using the surrounding pixels of the current block, finds the matching area with the highest similarity to the template, and then compensates for motion information. TM (Template Matching) is a method that performs motion prediction in the decoder without including motion information in the bitstream to reduce the size of the encoded bitstream. Since the decoder does not have the original image, it can roughly derive motion information for the current block using already reconstructed surrounding blocks.

[0140] The DMVR (Decoder-side Motion Vector Refinement) method is a method of compensating motion information through the correlation of already restored reference images to find slightly more accurate motion information. It is a method of using the bidirectional motion information of the current block to use the best matching point between the reference blocks in the reference pictures within a predetermined area of ​​two reference pictures as a new bidirectional motion. When this DMVR is performed, the encoder performs DMVR on a block basis to compensate for the motion information, and then divides the block into sub-blocks and performs DMVR on each sub-block basis to re-compensate the motion information of the sub-block. This can be called MP-DMVR (Multi-pass DMVR).

[0141] The LIC (Local Illumination Compensation) method is a method of compensating for luminance changes between blocks. It is a method of deriving a linear model using neighboring pixels adjacent to the current block, and then compensating for the luminance information of the current block through the linear model.

[0142] Existing video encoding methods perform motion compensation that only considers parallel translation in all directions, which reduces encoding efficiency when encoding videos containing motions commonly encountered in the real world, such as zooming in, zooming out, and rotation. To express such motions, an affine model-based motion prediction technique utilizing a four-parameter (rotation) or six-parameter (zoom in, zoom out, rotation) model can be applied.

[0143] Bi-Directional Optical Flow (BDOF) is used to compensate for predicted blocks by estimating pixel changes based on optical flow from a reference block of a block composed of bidirectional motion. The motion information derived from BDOF in VVC can be used to compensate for the motion of the current block.

[0144] PROF (Prediction Refinement with Optical Flow) is a technique for improving the accuracy of sub-block-level affine motion prediction to be similar to that of pixel-level motion prediction. Similar to BDOF, PROF calculates a correction value on a pixel-by-pixel basis for affine motion-compensated pixel values ​​on a sub-block-by-subblock basis based on optical flow to obtain a final prediction signal.

[0145] The CIIP (Combined Inter- / Intra-picture Prediction) method is a method of generating a final prediction block by weighting and averaging prediction blocks generated by the intra-picture prediction method and prediction blocks generated by the inter-picture prediction method when generating a prediction block for the current block.

[0146] The Intra Block Copy (IBC) method finds the most similar part to the current block in a previously restored area within the current picture and uses that reference block as a prediction block for the current block. At this time, information related to the block vector, which represents the distance between the current block and the reference block, can be included in the bitstream. The decoder can parse the block vector information contained in the BeastStream to calculate or set the block vector for the current block.

[0147] The BCW (Bi-prediction with CU-level Weights) method is a method that performs a weighted average on two motion-compensated prediction blocks by adaptively applying weights on a block-by-block basis, rather than generating a prediction block by averaging two motion-compensated prediction blocks from different reference pictures.

[0148] The Intra TMP (Template Matching Prediction) method is a method in which a video signal processing device constructs a reference template using pixel values ​​of neighboring blocks adjacent to the current block, finds the part most similar to the constructed reference template in an already restored area within the current picture, and then uses the reference block (the part found in the already restored area) as a prediction block for the current block.

[0149] The MHP (Multi-hypothesis prediction) method is a method of performing weight prediction using various prediction signals by transmitting additional motion information to unidirectional and bidirectional motion information during inter-screen prediction.

[0150] CCLM (Cross-component linear model) is a method of constructing a linear model by utilizing the high correlation between a luminance signal and a chrominance signal located at the same location as the luminance signal, and then predicting the chrominance signal through the linear model. A template is constructed using blocks adjacent to the current block that have been restored, and the parameters for the linear model are derived through the template. Next, the current luminance block, which has been restored to the size of the chrominance block, is selectively downsampled depending on the image format. Finally, the chrominance component block of the current block is predicted using the downsampled luminance component block (sample) and the corresponding linear model. At this time, the method of using two or more linear models is called MMLM (Multi-model Linear mode).

[0151] CCCM (Convolutional cross-component model) is a method of constructing a nonlinear model by utilizing the high correlation between a luminance signal and a chrominance signal located at the same location as the luminance signal, and then predicting the chrominance signal through the nonlinear model.

[0152] GLM (Gradient Linear Model) is a method of constructing a model by additionally reflecting the slope of luminance samples in a linear model such as CCLM, and then predicting the color difference signal through the model.

[0153] In independent scalar quantization, the input coefficient t k Restored coefficients t' for k is the associated quantization index q k depends only on t'. That is, the quantization index for any restored coefficient has a different value from the quantization indices for other restored coefficients. In this case, t' k is t k may be a value that includes quantization error, and may be different or the same depending on the quantization parameter. Here, t' k can be named restored transform coefficients or inverse quantized transform coefficients, and the quantization indices can also be named quantized transform coefficients.

[0154] In Uniform Reconstruction Quantizers (URQ), the reconstructed coefficients are spaced at equal intervals. The distance between two adjacent reconstructed values ​​is referred to as the quantization step size. Reconstructed values ​​can include zeros, and the entire set of available reconstructed values ​​can be uniquely defined by the quantization step size. The quantization step size can vary depending on the quantization parameter.

[0155] In conventional methods, quantization reduces the set of acceptable reconstructed transform coefficients, and the number of elements in this set can be finite. This limits the ability to minimize the average error between the original and reconstructed images. Vector quantization can be used as a method to minimize this average error.

[0156] A simple form of vector quantization used in video encoding is sign data hiding. This is a method in which the encoder does not encode the sign of a non-zero coefficient, and the decoder determines the sign of the coefficient based on whether the sum of the absolute values ​​of all coefficients is even or odd. To achieve this, the encoder may increase or decrease the value of at least one coefficient, and at least one coefficient may be selected and adjusted to be optimal in terms of rate-distortion cost. In one implementation, a coefficient having a value close to the boundary of the quantization interval may be selected.

[0157] Another vector quantization method is trellis-coded quantization, which is used in video coding as an optimal path search technique to obtain optimized quantization values ​​in dependent quantization. Block-wise, quantization candidates for all coefficients in the block are arranged in a trellis graph, and the optimal trellis path between the optimized quantization candidates is searched for by considering the cost for rate-distortion. Specifically, dependent quantization applied to video coding can be designed so that the set of allowable reconstructed transform coefficients for a transform coefficient depends on the value of the transform coefficient preceding the current transform coefficient in the restoration order. At this time, by selectively using multiple quantizers according to the transform coefficients, the average error between the original image and the reconstructed image can be minimized, thereby increasing the encoding efficiency.

[0158] Among intra prediction encoding techniques, the MIP (Matrix Intra Prediction) method is a matrix-based intra prediction method. Unlike the prediction method that has directionality from the pixels of the surrounding blocks adjacent to the current block, it is a method of obtaining a prediction signal using a predefined matrix and offset values ​​for the pixels on the left and top of the surrounding blocks.

[0159] To derive the intra-prediction mode of the current block, a template, which is a predefined region adjacent to the current block and reconstructed, is used. The intra-prediction mode derived from the template's surrounding pixels can be used to reconstruct the current block. First, the decoder generates a prediction template for the template using the surrounding pixels (reference) adjacent to the template. The intra-prediction mode that generates the prediction template most similar to the already reconstructed template can then be used to reconstruct the current block. This method is called TIMD (Template intra-mode derivation).

[0160] Typically, an encoder can determine a prediction mode for generating a prediction block and generate a bitstream containing information about the determined prediction mode. A decoder can parse the received bitstream to set an intra-prediction mode. At this time, the bit amount of information about the prediction mode may be about 10% of the total bitstream size. To reduce the bit amount of information about the prediction mode, the encoder may not include information about the intra-prediction mode in the bitstream. Accordingly, the decoder can derive (determine) an intra-prediction mode for restoring the current block using the characteristics of the surrounding blocks, and can restore the current block using the derived intra-prediction mode. At this time, the decoder can use a method of applying a Sobel filter in the horizontal and vertical directions to each neighboring pixel (pixel) of the current block to infer directional information, and then mapping the directional information to the intra-prediction mode to derive the intra-prediction mode. The method by which the decoder derives the intra prediction mode using surrounding blocks can be described as Decoder side intra mode derivation (DIMD).

[0161] If the current block is a luminance block, the video signal processing device can derive an intra prediction mode through the DIMD and TIMD methods. If the current block is a chroma block, since there is an already reconstructed luminance block corresponding to the chroma block, the video signal processing device can derive an intra prediction mode by applying the DIMD and TIMD methods using the reconstructed luminance block, and then use the derived intra prediction mode as the intra prediction mode of the chroma block. That is, the video signal processing device can derive directional information if the current block is a luminance block, and may not derive directional information if the current block is a chroma block, and can apply the directional information found in the luminance block to the chroma block. This mode can be referred to as the "DIMD Chroma" mode or the "TIMD Chroma" mode.

[0162] Prediction methods that utilize the correlation between different signals, such as CCLM, MMLM, CCCM, and GLM, can be called Cross-Component Prediction (CCP). In other words, a method of predicting another signal (a chrominance signal, such as Cb or Cr) from one signal (e.g., a luminance signal) can be called Cross-Component Prediction (CCP).

[0163] The CCP merge method is a method of predicting the chrominance block of the current block using the CCP model (models such as CCLM, MMLM, and CCCM) used in the surrounding blocks.

[0164] The Reconstruction-Reordered IBC (RRIBC) coding mode (which may be used interchangeably with RRIBC) can be used in IBC blocks. RRIBC can consist of vertical flips and horizontal flips. A block to which RRIBC is applied can be flipped according to the RRIBC type of the current block. The original block to be encoded can be flipped before the encoder finds the most similar part to the current block from the reference picture. That is, the encoder can find the most similar part to the current block from the reference picture using the flipped original block. Therefore, the prediction block can be an unflipped block, and the error block (residual block, residual block) can also be processed as an unflipped block. The decoder can flip the final reconstructed block according to the RRIBC type of the current block.

[0165] The encoding modes (prediction modes) described herein may be described without the term "mode" or with the term "method" instead of "mode." For example, the CCLM mode may be described as the CCLM method or CCLM.

[0166] Figure 7 is a diagram showing the locations of surrounding blocks used to construct a motion candidate list in inter prediction.

[0167] The neighboring blocks can be blocks of spatial position or blocks of temporal position. The neighboring block spatially adjacent to the current block can be at least one of a left (A1) block, a left below (A0) block, an above (B1) block, an above right (B0) block, and an above left (B2) block. The neighboring block temporally adjacent to the current block can be a block that includes an upper left pixel position of a bottom right (BR) block of the current block in a corresponding picture (Collocated picture). If the neighboring block temporally adjacent to the current block is encoded in intra mode or the neighboring block temporally adjacent to the current block exists in an unusable position, a block that includes a horizontal and vertical center (Center, Ctr) pixel position of the current block in the picture corresponding to the current picture (Collocated picture) can be used as the temporal neighboring block. Motion candidate information derived from corresponding pictures can be referred to as a Temporal Motion Vector Predictor (TMVP). Only one TMVP can be derived from a single block, or a block can be divided into multiple sub-blocks, and then a separate TMVP candidate can be derived for each sub-block. The method for deriving TMVPs at the sub-block level can be referred to as a sub-block Temporal Motion Vector Predictor (sbTMVP).

[0168] Whether the methods described in this specification are applied can be determined based on at least one of information about the slice type (e.g., whether it is an I slice, a P slice, or a B slice), whether it is a tile, whether it is a subpicture, the size of the current block, the depth of the coding unit, whether the current block is a luminance block or a chrominance block, whether it is a reference frame or a non-reference frame, the temporal hierarchy according to the reference order and layer, etc. The information used to determine whether the methods described in this specification are applied can be information agreed upon in advance between the decoder and the encoder. In addition, such information can be determined according to a profile and a level. Such information can be expressed as a variable value, and the bitstream can include information about the variable value. That is, the decoder can parse the information about the variable value included in the bitstream to determine whether the above-described methods are applied. For example, whether the methods described in this specification are applied can be determined based on the horizontal length or the vertical length of the coding unit. The above-described methods can be applied when the horizontal length or vertical length is 32 or more (e.g., 32, 64, 128, etc.). In addition, the methods described in this specification can be applied when the horizontal length or vertical length is less than 32 (e.g., 2, 4, 8, 16). In addition, the methods described in this specification can be applied when the horizontal length or vertical length is 4 or 8.

[0169] A residual signal can be a signal representing the difference between the original signal and a predicted signal generated through inter- or intra-frame prediction. The energy of the residual signal can be distributed across the entire pixel domain. Therefore, if the decoder encodes the pixel values ​​of the residual signal itself, compression efficiency may be reduced. Therefore, a process is required to concentrate the energy of the residual signal in the pixel domain into the low-frequency region of the frequency domain using transform coding.

[0170] The HEVC (high efficiency video coding) standard mostly uses the efficient DCT-II (discrete cosine transform type-II) when the signal is evenly distributed in the pixel domain (when neighboring pixel values ​​are similar), and uses the DST-VII (discrete sine transform type-VII) only for the 4x4 blocks predicted within the picture to transform the residual signal in the pixel domain into the frequency domain. The DCT-II transform may be suitable for the residual signal generated through inter-picture prediction (when the energy is evenly distributed in the pixel domain). However, for the residual signal generated through intra-picture prediction, the energy of the residual signal may tend to increase as it gets farther from the reference sample due to the nature of intra-picture prediction, which predicts using the reconstructed reference samples around the current coding unit. Therefore, high encoding efficiency cannot be achieved when only the DCT-II transform is used.

[0171] FIG. 8 is a diagram illustrating a method for performing CCLM according to one embodiment of the present specification.

[0172] Referring to Fig. 8, a template can be constructed using a block whose restoration has been completed among the neighboring blocks adjacent to the current block. A video signal processing device (e.g., a decoder or an encoder) can derive parameters for a linear model using the template. Depending on the image format, the restored luminance component block (sample) can be optionally down-sampled to match the size of the chrominance component block. The video signal processing device can predict the chrominance component block (sample) of the current block using the down-sampled luminance component block (sample) and the linear model. At this time, two or more linear models can be used, and a method in which two or more linear models are used can be described as MMLM (Multi-model Linear mode).

[0173] FIG. 9 is a diagram illustrating a template used for deriving a linear model according to one embodiment of the present specification.

[0174] A video signal processing device can derive parameters for a linear model using only some of the surrounding samples adjacent to the current block. The dark gray portion in Fig. 9 may be the location of a sample used to derive parameters for the linear model. In the 4:2:0 format, a chrominance component block is 1 / 4 the size of a luminance component block. Therefore, down-sampled luminance component samples can be used to derive parameters for the linear model to ensure a 1:1 matching between luminance component samples and chrominance component samples. Two types of filters can be used to derive the down-sampled luminance component samples. An encoder can obtain a bitstream including filter type information regarding which type of filter is used. In addition, the type of the filter (Type 1 or Type 2) can be determined depending on which unit the filter is used in (e.g., SPS level, PPS level, Picture Header (PH) level, slice level, tile level, CU level, sub-block level, etc.). The decoder can determine / set the type of filter for adaptively deriving a luminance component sample by parsing the filter type information included in the bitstream. Type 1 of Fig. 9 is a method for deriving a center luminance component sample among upper samples using 6 samples. The video signal processing device can generate a down-sampled luminance component sample by applying Type 1 to position A of Fig. 9. Type 2 of Fig. 9 is a method for deriving a center luminance component sample among 5 samples using 5 samples. The video signal processing device can generate a down-sampled luminance component sample by applying Type 2 to position C. A template used to derive parameters for a linear model can be composed of down-sampled luminance component samples. A method for constructing a template is described below.

[0175] In addition, the video signal processing device can configure a template with down-sampled luminance component samples by referring to samples within the current luminance component block. Referring to position B of FIG. 9, when Type 1 is used to generate down-sampled luminance component samples, the upper three samples may be samples of neighboring blocks adjacent to the current block, and the lower three samples (901) may be samples of restored luminance component blocks within the current block. At this time, the position of the finally generated luminance component sample may be the hatched position (902) of B of FIG. 9. The same applies when Type 2 is used at position D of FIG. 9 to generate down-sampled luminance component samples. That is, the X position sample (903) of D of FIG. 9 may be a sample of a restored luminance component block within the current block, and the remaining four samples may be samples of neighboring blocks adjacent to the current block. At this time, the position of the finally generated luminance component sample may be the hatched position (904) of D of FIG. 9.

[0176] In addition, the video signal processing device can construct a template with down-sampled luminance component samples by referring only to samples of surrounding blocks excluding samples within the current luminance component block. Referring to position B of FIG. 9, when Type 1 is used to generate down-sampled luminance component samples, the video signal processing device can obtain down-sampled luminance component samples using only the upper three samples (i.e., excluding the restored luminance component samples (901) within the current block) and construct a template. At this time, the position of the finally generated luminance component sample may be the hatched position (902) of B of FIG. 9. The same applies when Type 2 is used at position D of FIG. 9 to generate down-sampled luminance component samples. That is, the video signal processing device can obtain down-sampled luminance component samples using the remaining four samples (surrounding samples adjacent to the current block) excluding samples within the current luminance component block (X position samples (903) of D of FIG. 9) and construct a template. At this time, the position of the final generated luminance component sample may be the hatched position (904) of D in Fig. 9.

[0177] Also, referring to FIG. 9, the video signal processing device can generate down-sampled luminance samples using three consecutive lines, including one line adjacent to the current block. At this time, if the upper boundary of the current block is a CTU boundary, the video signal processing device can configure a template using only one line closest to the current block to save memory on the line buffer. In order to allow the application of filters of type 1 and type 2, the samples of one adjacent line (the first line) can be padded to the second and third lines. Alternatively, the samples of the first line can be padded to the second and third lines with values ​​having a predefined weight applied thereto.

[0178] Samples that are located in efficient positions among adjacent samples of the current block can be included in the template. Specifically, the template can include efficient samples among the left and upper surrounding samples of the current block. At this time, the encoder can obtain a bitstream containing information regarding which samples are included. The decoder can then parse the information regarding which samples are included to construct the template. The method of signaling the inclusion of information regarding which samples are included in the bitstream has the problem of increasing the bit rate. Below, a method for implicitly determining which samples are included in the template is described.

[0179] The positions of samples included in the template may be determined based on the intra prediction directional mode of the current block. That is, if the intra prediction directional mode is in a direction close to upper samples of the current block or is a predetermined first mode, only upper samples may be included in the template. If the intra prediction directional mode is in a direction close to left samples of the current block or is a predetermined second mode, only left samples may be included in the template. In this case, the first mode may be an intra prediction directional mode corresponding to an index greater than 50. The second mode may be an intra prediction directional mode corresponding to an index less than 18. In addition, if the intra prediction directional mode is an intra prediction directional mode corresponding to an index greater than or equal to 18 and less than or equal to 50, the template may include both upper samples of the current block and left samples of the current block.

[0180] To construct an accurate template, samples restored with higher image quality may be required. Therefore, a template can be constructed by comparing the quantization parameter value used when reconstructing a neighboring block adjacent to the left of the current block with the quantization parameter value used when reconstructing a neighboring block adjacent to the upper side of the current block. For example, a template can be constructed that includes samples of neighboring blocks that use a smaller quantization parameter value between the quantization parameter value used when reconstructing a neighboring block adjacent to the left of the current block and the quantization parameter value used when reconstructing a neighboring block adjacent to the upper side of the current block. Conversely, a template can be constructed that includes samples of neighboring blocks that use a larger quantization parameter value between the quantization parameter value used when reconstructing a neighboring block adjacent to the left of the current block and the quantization parameter value used when reconstructing a neighboring block adjacent to the upper side of the current block. When the quantization parameter value used to restore the neighboring block adjacent to the left of the current block is the same as the quantization parameter value used to restore the neighboring block adjacent to the upper side of the current block, a template including samples of the neighboring block adjacent to the left of the current block and samples of the neighboring block adjacent to the upper side of the current block can be configured. In addition, when the difference between the quantization parameter value used to restore the neighboring block adjacent to the left of the current block and the quantization parameter value used to restore the neighboring block adjacent to the upper side of the current block is within a preset value, a template including samples of the neighboring block adjacent to the left of the current block and samples of the neighboring block adjacent to the upper side of the current block can be configured.

[0181] Additionally, the samples included in the template may be determined by comparing the size of the current block (e.g., the product of the width and height of the current block (i.e., the number of samples)) with a specific value. If the size of the current block is smaller than the specific value, the left peripheral samples of the current block and the upper peripheral samples of the current block may be included in the template. Conversely, if the size of the current block is equal to or greater than the specific value, the left peripheral samples of the current block and the upper peripheral samples of the current block may be included in the template. The specific value may be an integer greater than or equal to 1, and is determined based on the sum of the width and height sizes of the current block.

[0182] Additionally, the samples included in the template may be determined based on the ratio of the width and height of the current block. For example, if the width of the current block is longer than the height, the samples surrounding the left (or upper) side of the current block may be included in the template. Conversely, if the width of the current block is shorter than the height, the samples surrounding the upper (or left) side of the current block may be included in the template. If the width and height of the current block are equal, the samples surrounding the left and upper sides of the current block may be included in the template.

[0183] Additionally, the template can be determined based on whether CCLM and MMLM have been applied to the left and upper neighboring blocks of the current block. Samples of blocks to which CCLM and MMLM have been applied can be included in the template. For example, if the left neighboring block of the current block is not subject to CCLM and MMLM, but the upper neighboring block of the current block is subject to CCLM and MMLM, the upper neighboring samples of the current block can be included in the template.

[0184] In addition, the samples included in the template may be determined based on the number of samples for which reference sample padding has been performed. For example, if the number of samples for which reference sample padding has been performed among the samples of the left peripheral block of the current block is greater than or equal to a certain number, the left peripheral samples of the current block may not be included in the template. That is, the upper peripheral samples of the current block may be included in the template. Similarly, if the number of samples for which reference sample padding has been performed among the samples of the upper peripheral block of the current block is greater than or equal to a certain number, the upper peripheral samples of the current block may not be included in the template. That is, the left peripheral samples of the current block may be included in the template. At this time, the specific number may be an integer greater than or equal to 1. Meanwhile, if neither the upper peripheral samples nor the left peripheral samples of the current block are included in the template, and if both the left and upper templates are set to not be referenced, CCLM and MMLM may not be applied to the current block. Additionally, the decoder may not parse information related to CCLM and MMLM in the current block if both the left and top templates are set to non-referenceable, and may set CCLM and MMLM to not be used in the current block.

[0185] Meanwhile, if the number of samples included in the template configured by applying the above-described method, etc., is smaller than a predefined number or if the size of the current block is smaller than a specific size, the linear model for predicting the chrominance component block of the current block may be a linear model to which predefined basic parameters are applied. This is because it is difficult to derive a linear model when the number of samples is small. At this time, the predefined number and the specific size may be integers greater than or equal to 1. Alternatively, if the number of the samples is smaller than a predefined number or if the size of the current block is smaller than a specific size, CCLM and MMLM may not be applied to the current block. In addition, the decoder may not parse information related to CCLM and MMLM in the current block if the number of the samples is smaller than a predefined number or if the size of the current block is smaller than a specific size, and may set CCLM and MMLM not to be used in the current block.

[0186] The surrounding samples of the current block included in the template may be samples before deblocking filtering is applied. Alternatively, if Luma Mapping with Chroma Scaling (LMCS) is applied to the current block, the surrounding samples of the current block may be samples before deblocking or samples after deblocking.

[0187] A video signal processing device can derive parameters for a linear model using a template. One or more linear models can be used per block, and information regarding the number of linear models to be used per block can be included in the bitstream. A decoder can parse this information regarding the number of linear models to be used per block and use it to derive linear models for the current block. Methods for deriving linear models include the Least-Mean-Square (LMS) method and the min / max method. Methods for deriving linear models are described below.

[0188] First, the min / max method is explained. The video signal processing device calculates the values ​​(X) for the smaller two samples among the four chrominance samples at pre-arranged locations in the template. 0 A , X 1 A ) and values ​​for the two large samples (X 0 B , X 1 B ) is first determined. Then, the video signal processing device determines the value of the luminance sample (Y) corresponding to each of the four samples at the pre-arranged positions in the template. 0 A , Y 1 A , Y 0 B , Y 1 B ), using the average of small values ​​(X a , Y a ) and the average of large values ​​(X b , Y b ) can be derived. At this time, the average of small values ​​(X a , Y a ) and the average of large values ​​(X b , Y b ) can be used to derive Equation 1. Referring to Equation 1, X a is the value for the smaller two samples out of four samples at pre-determined locations in the template (X 0 A , X 1 A ) may be the average of Y a is the value for the smaller two samples out of four samples at pre-determined locations in the template (X 0 A , X 1 A ) is the value of the luminance sample corresponding to each 0 A , Y 1 A It can be the average of X bis the value for the two larger samples among the four samples at the pre-arranged locations in the template (X 0 B , X 1 B ) may be the average of Y b is the value for the two larger samples among the four samples at the pre-arranged locations in the template (X 0 B , X 1 B ) is the value of the luminance sample corresponding to each 0 B , Y 1 B It can be the average of. The video signal processing device can calculate the linear model parameters α, β using mathematical expression 2. The video signal processing device can calculate the linear model parameters (α, β) and the (downsampled) luminance sample value (rec L ') is used to calculate each sample value (pred) of the chrominance block. c ) can be calculated to predict the chrominance block. Each sample value of the chrominance block can be calculated as in mathematical expression 3. (i, j) in mathematical expression 3 can mean the coordinate when the coordinate of the upper left sample of the current block is (0, 0). That is, pred c (i, j) can mean the sample value of the color difference block at position (i, j).

[0189]

[0190]

[0191]

[0192] Next, the LMS method is explained. The video signal processing device can calculate the linear model parameters α and β according to the LMS method as shown in Equations 4 and 5. Rec in Equations 4 and 5 C (i) and Rec' L(i) denote the values ​​of the chrominance samples and downsampled luminance samples in the template, respectively, and I denotes the number of samples in the template. For example, the samples in the template may be samples at the locations indicated in gray in Fig. 9. The video signal processing device applies α and β obtained through Equations 4 and 5 to Equation 3 to obtain each sample value (pred) of the chrominance block. c ) can be used to predict the color difference block. α can be expressed as a fraction.

[0193]

[0194]

[0195] In order to improve the encoding efficiency of linear model (CCLM, MMLM) mode, a video signal processing device can use two or more linear models rather than just one linear model. That is, the video signal processing device can use a combination of the CCLM mode that uses only one existing linear model and the MMLM mode that uses two or more linear models. In this case, information related to whether the CCLM mode or the MMLM mode is used can be included in the bitstream, and whether the CCLM mode or the MMLM mode is used can be determined on a CU basis.

[0196] FIG. 10 is a diagram illustrating a method for deriving two linear models according to one embodiment of the present specification.

[0197] Since the computational complexity of a video signal processing device may increase when multiple linear models are used, the following describes a case where two linear models are used.

[0198] Referring to FIG. 10, a video signal processing device can select samples for inducing two linear models using one template. At this time, the samples can be selected based on a threshold. The threshold can be an average value of restored luminance component samples in the template or a value obtained using the same. The two linear models using the threshold can be as shown in Equation 6. [x, y] in Equation 6 can mean coordinates when the coordinates of the upper left sample of the current block are (0, 0). That is, Pred c [x, y] can mean the sample value of the chrominance block at the (x, y) location. Rec' L (i) may mean a downsampled luminance sample in the template.

[0199]

[0200] Below, we describe a method for deriving parameters (α1, α2, β1, β2) for two linear models.

[0201] A video signal processing device can obtain (calculate) an average value for luminance component samples within a template and an average value for chrominance component samples within the template. At this time, the average value for luminance component samples and the average value for chrominance component samples may be an average value of scaled samples in a determined range based on the number of samples of each template. This is to more accurately distinguish between two linear models. The average value for luminance component samples within the template may be calculated using down-sampled luminance component samples or luminance component samples before down-sampling. In addition, which sample is used among the down-sampled luminance component samples and the luminance component samples before down-sampling may vary depending on an SPS level, a PPS level, a Picture Header (PH) level, a slice level, a tile level, a CU level, and a sub-block level. The decoder can parse information indicating which sample is used among the downsampled luminance component samples and the luminance component samples before downsampling included in the bitstream, and can determine / set which sample is used among the adaptively downsampled luminance component samples and the luminance component samples before downsampling. Parameters for the linear model can be set to default values. For example, α1 and α2 can be set to 0, and β1 and β2 can be set to half of the maximum value of the range of the current video format. If the maximum value of the range of the video format is 8 bits, β1 and β2 can be set to 128. Additionally, a shift value for restoring the scaled value to the original can be set to '0'. When the number of samples in the template is less than a predefined fixed number, two linear models set to the default parameters can be selected. The predefined fixed number can be an integer greater than or equal to 1, for example, 4.Meanwhile, based on the scaled average value of the luminance component samples in the template, the chrominance samples at the same position as each of the luminance samples can be divided into two groups. At this time, the number of samples in each group may be a multiple of 2. If it is not a multiple of 2, the video signal processing device may perform padding using surrounding samples so that the number of samples in each group becomes a multiple of 2. If the number of samples in each group is less than a predefined number, padding may not be performed. The video signal processing device may calculate the parameters for the linear model for each group using Equations 4 and 5. If the number of samples in each group is less than the predefined number, the difference value obtained by subtracting the average value of the luminance component samples in the template from the average value of the chrominance component samples in the template may be the parameter β for the linear model. In addition, if the number of samples in each group is less than the predefined number, only one linear model may be derived and used. The predefined number may be an integer greater than or equal to 1, for example, 4.

[0202] When MMLM is applied, the video signal processing device can use the method described below to derive parameters for a more accurate linear model.

[0203] The threshold for inducing a linear model may be obtained (calculated) based on the average value of the reconstructed luminance component samples within the current block instead of the average value of the luminance component samples within the templates of neighboring blocks adjacent to the current block. Alternatively, the threshold for inducing a linear model may be obtained (calculated) based on the average value of the reconstructed luminance component samples within the current block and the average value of the luminance component samples within the template. Depending on the color format, the average value of the reconstructed luminance component samples within the current block may be the average value of the samples of the downsampled luminance component block. Alternatively, the video signal processing device may use the average value calculated using at least one of the pixel values ​​of the luminance templates of neighboring blocks adjacent to the current block and the pixel values ​​of the reconstructed luminance block within the current block to determine the threshold for inducing a linear model. Either the average value of the current luminance block or the average value of the luminance template may be used as the threshold for distinguishing between two linear models. Depending on the color format, the average value of the luminance block of the neighboring blocks may be the average value of the downsampled luminance components. In addition, depending on the color format, the average value of the luminance block of the current block may be the average value for the downsampled luminance blocks. In addition, depending on the color format, the average value of the luminance template and the luminance block may be the average value for the luminance template and the luminance block before downsampling. Alternatively, depending on the size of the current block, the weights for calculating the average value between the luminance template and the restored luminance block within the current block may vary. That is, when the size of the current block is equal to or smaller than a predefined size, the video signal processing device may calculate the average value by multiplying the pixel value of the luminance template by a first weight and multiplying the pixel value of the restored luminance block within the current block by a second weight. In addition, the video signal processing device may use the calculated average value as a threshold for distinguishing between two models in the MMLM method.At this time, the predefined size can be determined based on the horizontal and vertical sizes of the current block. For example, the predefined size can be the sum of the horizontal and vertical sizes of the current block, and a specific value can be 12. In addition, the first weight and the second weight can be integers, and the first weight and the second weight can be different values. For example, the first weight can be greater than or less than the second weight, and specifically, the first weight can be 1 and the second weight can be 4. In addition, the calculation of the average value can also vary depending on the weight. For example, when the second weight is 4, the average value can be calculated by considering the size of the current block as 4 times. This is a method to increase the proportion of the current block when the size of the current block is small when calculating the average value. Alternatively, the threshold for inducing the linear model can be obtained (calculated) based on the average value of the chrominance component samples in the template instead of the average value of the luminance component samples in the template. At this time, two linear models can be derived for each of the two chrominance components (Cb component, Cr component). The average value of each chrominance component sample in the template can be used to derive a linear model for each chrominance component. The threshold for applying the two linear models to the reconstructed luminance component sample in the current block can be classified into two using the average value of the chrominance component samples in the template. The encoder can obtain a bitstream including information about the threshold. The decoder can obtain the threshold for deriving the two linear models by parsing the information about the threshold. At this time, the information about the threshold may directly indicate the threshold. However, since there is a problem that the amount of bits increases when the threshold is directly indicated, the information about the threshold may indicate an index of a preset table.That is, a table of thresholds each mapped to one or more indices is preset, and the threshold information can indicate any one of the one or more indices. The decoder can use the threshold corresponding to the index indicated by the threshold information. The thresholds included in the table can be predefined values ​​or include thresholds used in neighboring blocks. The thresholds included in the table can be a predefined number of thresholds (e.g., one or more) and can be configured in a FIFO (First in, First out) format. That is, the table can be configured in such a way that the thresholds used in neighboring blocks of the current block are included in the table. The threshold information can be signaled for each block, and the threshold can be applied for each block. At this time, the information for each block can be signaled by being included in the bitstream. The decoder can parse the information for each block and set the threshold for each block.

[0204] Below we describe in detail how to decide how many linear models (one or two) are used to predict a chrominance component block.

[0205] i) If the reference line index used to construct samples of the current luminance component block is greater than or equal to 1, the decoder can predict the chrominance component block using one linear model. This is because the current block is likely to be a linearly varying block. ii) If the reference line index used to construct samples of the current luminance component block is 0 (if samples are constructed on a line adjacent to the current block), the decoder can predict the chrominance component block using one or two linear models. That is, the decoder can decide whether to parse syntax elements related to CCLM and MMLM (e.g., information about thresholds, information related to whether CCLM mode or MMLM mode is used, information about how many linear models are used per block, etc.) based on the reference line index. The decoder may not parse syntax elements related to CCLM and MMLM if the reference line index is greater than or equal to 1. The decoder can infer that CCLM, which uses a single linear model, is used to predict the chrominance component block if the reference line index is greater than or equal to 1. Syntax related to CCLM and MMLM (e.g., information about threshold, information about whether CCLM mode or MMLM mode is used, information about how many linear models are used per block, etc.) may not be included in the bitstream. The encoder can obtain a bitstream including syntax elements related to CCLM and MMLM (e.g., information about threshold, information about whether CCLM mode or MMLM mode is used, information about how many linear models are used per block, etc.) if the reference line index is 0. The decoder can parse syntax elements related to CCLM and MMLM if the reference line index is 0. iii) The number of linear models for predicting the chrominance component block may be determined based on the size of the current block.For example, if the width or height of the current block is less than a predefined value (e.g., an integer greater than or equal to 1), the decoder can predict a chrominance component block using a single linear model. iv) If the size of the current block is greater than or equal to the predefined value, the decoder can divide the current block into multiple sub-blocks and apply a linear model to each of the multiple sub-blocks to predict a chrominance component block. At this time, the template for inducing the linear model of each sub-block may include reconstructed samples of the neighboring blocks located closest to the corresponding sub-block. For example, as shown in FIG. 9, the current block may be divided into four sub-blocks. At this time, the decoder may induce a linear model for the first sub-block using both the left and upper templates. The decoder may induce a linear model for the second sub-block using the upper template. The decoder may induce a linear model for the third sub-block using the left template. The decoder can derive a linear model for the fourth sub-block using the upper template used to derive a linear model for the second sub-block and the left template used to derive a linear model for the third sub-block. v) The number of linear models for predicting the chrominance component block can be determined based on at least one of the intra prediction mode of the current luminance component block, the coefficient distribution of the residual block of the current luminance component block, the quantization parameter of the current block, and whether CCLM or MMLM is used in the neighboring blocks. For example, if there is at least one block to which MMLM is applied among the neighboring blocks of the current block, MMLM can be applied to the current block as well. Additionally, if CCLM is applied to all neighboring blocks of the current block, CCLM can be applied to the current block. vi) The decoder can obtain a new linear model based on two linear models for the current block signaled to have MMLM applied.That is, the decoder can reset the current block to apply the CCLM mode and predict the chrominance component block using a new linear model. The decoder can obtain two linear models for the current block and obtain a new linear model based on the similarity of the parameter values ​​for the two linear models. At this time, the similarity of the parameter values ​​for the two linear models can be determined based on at least one of the similarity between α1 and α2 and the similarity between β1 and β2 in Equation 6. If the difference between the absolute value of the similarity between α1 and α2 and the absolute value of the similarity between β1 and β2 is less than a predefined value (e.g., an integer greater than or equal to 1), the parameter values ​​for the two linear models can be determined to be similar. Since there are two chrominance components (i.e., Cb component, Cr component), the number of linear models can be different for each of the two chrominance components.

[0206] In general, the same intra prediction directional mode can be applied to two chrominance components. The same number of linear models can be applied to the two chrominance components. Meanwhile, in order to improve encoding efficiency, an intra-picture prediction mode can be signaled for each chrominance component, and the number of linear models applied to each chrominance component can also be different. For example, a horizontal intra-picture mode can be applied to the Cb chrominance component, and a prediction mode using two linear models can be applied to the Cr chrominance component. In addition, information on whether an LM mode (CCLM or MMLM) is applied to the two chrominance components can be signaled, and information on which mode, CCLM or MMLM, is applied to each chrominance component can be additionally signaled. In addition, information on whether MMLM is applied to both chrominance components can be signaled, and the video signal processing device can implicitly determine whether CCLM or MMLM is applied to each chrominance component by judging the similarity of the two linear models derived for each chrominance component. In this case, since no additional information for each color difference component is signaled, the bit rate is reduced.

[0207] A video signal processing device can use two intra prediction directional modes to generate a luminance prediction block in TIMD mode. The TIMD encoding mode can be useful for blocks where directionality characteristics do not clearly exist. That is, if the TIMD mode is applied to the current block, the intra prediction mode for the chrominance component block of the current block can be implicitly set to the CCLM or MMLM mode. At this time, information on whether CCLM or MMLM is applied to the chrominance component block of the current block can be signaled. At this time, information on whether CCLM or MMLM is applied to each chrominance component block can be signaled by being included in the bitstream. When the TIMD mode is applied to the current block, the decoder can parse the information on whether CCLM or MMLM is applied to determine the mode applied to each chrominance component block. Alternatively, information on whether CCLM or MMLM is applied to each chrominance component block may not be signaled separately. At this time, the decoder implicitly sets MMLM to be applied to each chrominance component block, and can reset CCLM to be applied to each chrominance component block using the method described above (a method of obtaining a new linear model based on the similarity of parameter values ​​for two linear models). These methods can be applied not only to blocks encoded in TIMD mode, but also to blocks encoded in MIP and DIMD modes.

[0208] When TIMD and DIMD encoding modes are applied to the current block, the decoder can generate prediction blocks using two intra prediction directional modes, respectively, and then generate a final predicted luminance block by performing a weighted average on each prediction block. The decoder can generate a reconstructed luminance block by merging the final predicted luminance block with a residual block. The decoder must perform CCLM or MMLM using the reconstructed luminance block to generate a chrominance component block. This method has a problem in that the processing speed is slow due to the number of processing steps. Therefore, to improve the processing speed, the decoder can generate a chrominance block by applying CCLM or MMLM to the final predicted luminance block instead of the reconstructed luminance block. The method of generating a chrominance block by applying CCLM or MMLM to the final predicted luminance block may have lower accuracy than the method of generating a chrominance block by applying CCLM or MMLM to the reconstructed luminance block. Therefore, information on whether to apply CCLM or MMLM to the final predicted luminance block or to the reconstructed luminance block can be signaled and included in the bitstream. That is, the decoder can parse the information on whether to apply CCLM or MMLM to the final predicted luminance block or to the reconstructed luminance block included in the bitstream to determine the block to which CCLM or MMLM is to be applied.

[0209] The intra prediction directional mode applied to the chrominance component block can be DM (Derived Mode or Direct Mode), EM (Explicit Mode), or LM (Linear Model) mode. The DM mode can be a mode in which the intra prediction directional mode of the luminance component block is used as the intra prediction directional mode of the chrominance component block. The EM mode can be a mode in which the intra prediction directional mode of the chrominance component block is specified as any one of the planar mode, DC mode, horizontal mode, and vertical mode. The EM mode can be set so that the intra prediction directional mode of the chrominance component block is not the same as the intra prediction directional mode of the luminance component block. The EM mode can be described as a non-direct mode. The LM mode is a mode that predicts the chrominance component block using the reconstructed luminance component block and a linear model, and has different characteristics from the existing angular mode and non-angular mode (Planar mode, DC mode).

[0210] FIG. 11 is a diagram illustrating a method for signaling an intra prediction directional mode for a chrominance component block according to one embodiment of the present specification.

[0211] Hereinafter, a method for signaling an intra prediction directional mode for a chrominance component block of a current block is described. First, whether the LM mode is applied to the prediction of the chrominance component block may be signaled first. In this case, if the LM mode is not applied to the prediction of the chrominance component block, information regarding whether the DM mode and / or the EM mode is applied may be signaled. In this case, if the LM mode is applied to the prediction of the chrominance component block, information regarding whether the CCLM mode or the MMLM mode is applied to the prediction of the chrominance component block and information regarding a template for deriving a linear model may be signaled. In this case, information regarding the template may be information regarding whether the template includes left samples of the current block, upper samples, or both left samples and upper samples. Hereinafter, a method for signaling an intra prediction directional mode for a chrominance component block of a current block will be described in more detail.

[0212] Referring to FIG. 11(a), the decoder can determine whether the LM mode is applied for prediction of the chrominance component block by parsing a syntax element (lm_flag) indicating whether the LM mode is applied for prediction of the chrominance component block. A value of lm_flag of 1 may indicate that the LM mode is applied, and a value of lm_flag of 0 may indicate that the LM mode is not applied. If lm_flag indicates that the LM mode is not applied for prediction of the chrominance component block (e.g., the value of lm_flag is 0), the decoder can parse information on whether the EM mode and / or the DM mode are applied for prediction of the chrominance component block. If lm_flag indicates that the LM mode is applied for prediction of the chrominance component block (e.g., if the value of lm_flag is 1), the decoder can parse a syntax element (mmlm_flag) that indicates whether the MMLM mode is used for prediction of the chrominance component block. If the value of mmlm_flag is 1, it indicates that the MMLM mode is used, and if the value of mmlm_flag is 0, it indicates that the CCLM mode is used. If mmlm_flag indicates that the MMLM mode is used for prediction of the chrominance component block (e.g., if the value of mmlm_flag is 1), the decoder can additionally parse a syntax element (template_idx) that indicates which template is used. For example, if the value of template_idx is 1, left samples and above samples of the current block may be included in the template, and the video signal processing device may induce a linear model using the left samples and above samples of the current block. If the value of template_idx is 00, the left samples of the current block can be included in the template, and the video signal processing device can derive a linear model using only the left samples of the current block.If the value of template_idx is 01, the upper samples of the current block can be included in the template, and the video signal processing device can derive a linear model using only the upper samples of the current block. If the value of mmlm_flag is 0, it can indicate that the CCLM mode is used for predicting the chrominance component block. At this time, the video signal processing device can parse the template_idx and predict the chrominance component block based on the samples indicated by the template_idx.

[0213] In addition, since the MMLM mode requires two or more linear models, a large number of samples may be required. Therefore, it may be effective to use both the left samples and the upper samples of the current block. Therefore, the signaling method of Fig. 11(a) can be modified as follows. First, the decoder can parse lm_flag. If lm_flag indicates that the LM mode is not used for predicting the chrominance component block (e.g., if the value of lm_flag is 0), the decoder can parse information on whether the EM mode and / or the DM mode are applied for predicting the chrominance component block. If lm_flag indicates that the LM mode is applied for predicting the chrominance component block (e.g., if the value of lm_flag is 1), the decoder can parse mmlm_flag. If mmlm_flag indicates that MMLM mode is used for prediction of chrominance component blocks (e.g., if the value of mmlm_flag is 1), template_idx is not parsed, and the value of template_idx can be inferred as a value (e.g., 1) indicating that left samples and upper samples of the current block are used for linear model induction. This is because in MMLM mode, it is more efficient to use left samples and upper samples. If mmlm_flag indicates that CCLM mode rather than MMLM mode is applied (if the value of mmlm_flag is 0), the decoder can additionally parse template_idx. For example, if the value of template_idx is 1, left samples and upper samples of the current block can be included in the template, and the video signal processing device can induce a linear model using the left samples and upper samples of the current block. If the value of template_idx is 00, the left samples of the current block can be included in the template, and the video signal processing device can derive a linear model using only the left samples of the current block.If the value of template_idx is 01, the upper samples of the current block can be included in the template, and the video signal processing device can induce a linear model using only the upper samples of the current block. On the other hand, if the value of mmlm_flag is 1, whether to parse template_idx may be determined using at least one or more of the intra prediction mode of the current luminance component block, the size of the coding block, the characteristics of the residual block, the quantization parameter, whether the CCLM mode and / or the MMLM mode are used for the neighboring blocks, and the reference line index, or the value of template_idx may be inferred as a predefined value. For example, if the size of the current block is less than a predefined value (e.g., an integer greater than or equal to 1), template_idx is not parsed, and the value of template_idx may be inferred as a value (e.g., 1) indicating that the left samples and the upper samples of the current block are used to induce a linear model.

[0214] Also, referring to FIG. 11(b), the decoder can parse lm_flag. At this time, if lm_flag indicates that the LM mode is not applied (e.g., if the value of lm_flag is 0), the decoder can parse information on whether the EM mode and / or DM mode are applied. If lm_flag indicates that the LM mode is applied (e.g., if the value of lm_flag is 1), the decoder can parse template_idx. For example, if the value of template_idx is 1, the left samples and the upper samples of the current block can be included in the template, and the video signal processing device can derive a linear model using the left samples and the upper samples of the current block. If the value of template_idx is 00, the left samples of the current block can be included in the template, and the video signal processing device can derive a linear model using only the left samples of the current block. If the value of template_idx is 01, the upper samples of the current block can be included in the template, and the video signal processing device can derive a linear model using only the upper samples of the current block. Unlike the method of Fig. 11(a), since the syntax element indicating which mode, CCLM mode or MMLM mode, is used is not parsed, the decoder can derive two linear models for the CCLM mode and the MMLM mode, and determine the mode (CCLM mode or MMLM mode) to be applied for predicting the chrominance block based on the similarity for the two linear models.

[0215] FIG. 12 and FIG. 13 are diagrams showing a context model according to one embodiment of the present specification.

[0216] mmlm_flag and template_idx can be entropy-coded using CABAC (Context Adaptive Binary Arithmetic Coding). Context models for mmlm_flag and template_idx can be defined using experimentally obtained values ​​(see Figures 12 and 13).

[0217] The initValues ​​in Fig. 12(a) and Fig. 13(a) represent context models for mmlm_flag and context models for template_idx, respectively. shiftIdx can be used when updating probabilities for mmlm_flag and template_idx. initValue can be determined according to the type of the current slice. That is, initValue can be determined according to whether the current slice is an I slice, a P slice, or a B slice. Fig. 12(b) and Fig. 13(b) represent context models that can be used according to each slice type. Referring to Fig. 12(b), the initialization type (initType) of mmlm_flag is determined according to the current slice type, and initValue can be determined according to the initialization type. Referring to Fig. 13(b), the initialization type (initType) of template_idx is determined according to the current slice type, and initValue can be determined according to the initialization type. For example, if the type of the current slice is an I slice, the value of initType can be 0 to 2. If the type of the current slice is a P slice, the value of initType can be 3 to 5. If the type of the current slice is a B slice, the value of initType can be 6 to 8. The value of initType determined according to the slice type can be the same as the value of ctxIdx of mmlm_flag in Fig. 12(a) and the same as the value of ctxIdx of template_idx in Fig. 13(a). initValue can be determined as a value corresponding to Fig. 12(a) and Fig. 13(a) according to the value of initType determined according to each type of the current slice.

[0218] Meanwhile, initType can be determined as a single value for each slice type. For example, if the type of the current slice is an I slice, the value of initType can be 0. If the type of the current slice is a P slice, the value of initType can be 3. If the type of the current slice is a B slice, the value of initType can be 6. initValue can be determined as a value corresponding to Fig. 12(a) according to the value of initType, which is determined as a single value for each type of the current slice. For example, if the value of initType is 0, the value of ctxIdx of mmlm_flag can be 0, and according to Fig. 12(a), the value of initValue can be 20, and the value of shiftIdx can be 4. If the value of initType is 0, the value of ctxIdx of template_idx can be 0, and according to Fig. 13(a), the value of initValue can be 17, and the value of shiftIdx can be 1. If the value of initType is 3, the value of ctxIdx of mmlm_flag can be 3, and according to Fig. 12(a), the value of initValue can be 35, and the value of shiftIdx can be 4. If the value of initType is 3, the value of ctxIdx of template_idx can be 3, and according to Fig. 13(a), the value of initValue can be 0, and the value of shiftIdx can be 1. If the value of initType is 6, the value of ctxIdx of mmlm_flag can be 6, and according to Fig. 12(a), the value of initValue can be 38, and the value of shiftIdx can be 4. If the value of initType is 6, the value of ctxIdx of template_idx can be 6, and according to Fig. 13(a), the value of initValue can be 0, and the value of shiftIdx can be 1.

[0219] In addition, the use of initType according to the slice type can be selectively applied for each slice. For example, the order of use of the values ​​of initType can vary depending on the value of sh_cabac_init_flag defined in the slice header. If the value of sh_cabac_init_flag is 1 and the type of the current slice is a P slice, the value of initType can be 6. If the value of sh_cabac_init_flag is 1 and the type of the current slice is a B slice, the value of initType can be 3. If the value of sh_cabac_init_flag is 0 and the type of the current slice is a P slice, the value of initType can be 3. If the value of sh_cabac_init_flag is 0 and the type of the current slice is a B slice, the value of initType can be 6.

[0220] A video signal processing device can select a symbol of mmlm_flag to be currently coded or parsed from among multiple context models, using at least one of an intra prediction mode of a current luminance component block, a horizontal or vertical size of an encoding block (or a ratio of the horizontal and vertical or a difference between the horizontal and vertical, etc.), a quantization parameter, whether CCLM and / or MMLM are used in a neighboring block, characteristics of a residual block (information on whether the luminance component block is a residual signal, position information of the last transform coefficient), a motion information difference value, and a reference line index. Hereinafter, a method for a video signal processing device to select a symbol of mmlm_flag from among multiple context models will be described.

[0221] A video signal processing device can select a context index of a symbol of mmlm_flag based on mmlm_flag information of a neighboring block of a current block. The mmlm_flag information can indicate a value of mmlm_flag. For example, the value of mmlm_flag can be 0 or 1, and if the value of mmlm_flag is 0, it indicates that MMLM is not used for the corresponding block, and if the value of mmlm_flag is 1, it indicates that MMLM is used for the corresponding block. For example, the context index of the mmlm_flag symbol can be determined by adding the mmlm_flag information of the left neighboring block adjacent to the current block and the mmlm_flag information of the upper neighboring block adjacent to the current block. That is, the context index can be a value of 0 to 2. At this time, if the neighboring block is in an unusable position, 0 can be added to the context index.

[0222] The video signal processing device can select a context index of a symbol of mmlm_flag based on the size of the current block. For example, if the size of the current block is greater than the first value, the context index can be 2, if the size of the current block is less than the second value, the context index can be 0, and if the size of the current block is greater than or equal to the second value and less than or equal to the first value, the context index can be 1. At this time, the first value and the second value are preset values, and the first value can be 32 x 32, and the second value can be 16 x 16. In addition, the first value and the second value can be set based on the sum of the horizontal and vertical sizes of the current block.

[0223] The video signal processing device can select the context index of the symbol of mmlm_flag based on the difference between the horizontal and vertical sizes of the current block. If the horizontal and vertical sizes of the current block are equal, the context index can be 0. If the horizontal size of the current block is greater than the vertical size, the context index can be 1. If the horizontal size of the current block is smaller than the vertical size, the context index can be 2.

[0224] A video signal processing device can perform binary arithmetic encoding in a bypass form using a fixed probability interval without performing binary arithmetic encoding using mmlm_flag through a context model.

[0225] A video signal processing device can perform binary arithmetic encoding of mmlm_flag using only one context model. In this case, since each slice type has only one context model, a context model index is not derived, and a fixed context model can be used for all blocks in the slice.

[0226] The video signal processing device can select a symbol of template_idx to be currently coded or parsed by using at least one of the intra prediction mode of the current luminance component block, the horizontal or vertical size of the coding block (or the ratio of the horizontal and vertical or the difference between the horizontal and vertical, etc.), the quantization parameter, whether CCLM and / or MMLM are used in the neighboring blocks, the characteristics of the residual block (information on whether the luminance component block is a residual signal, information on the position of the last transform coefficient), the motion information difference value, and the reference line index. The template_idx can be composed of two bins, and a context model technique can be applied to the first bin, and binary arithmetic coding in the form of a bypass can be performed or a fixed context model can be used for the second bin. Hereinafter, a method for the video signal processing device to select a symbol of template_idx from among multiple context models will be described.

[0227] The video signal processing device can select a context index of a symbol of template_idx based on the size of the current block. For example, if the size of the current block is greater than the first value, the context index can be 2, if the size of the current block is less than the second value, the context index can be 0, and if the size of the current block is greater than or equal to the second value and less than or equal to the first value, the context index can be 1. At this time, the first value and the second value are preset values, and the first value can be 32 x 32, and the second value can be 16 x 16. In addition, the first value and the second value can be set based on the sum of the horizontal and vertical sizes of the current block.

[0228] The video signal processing device can select the context index of the symbol of template_idx based on the difference between the width and height of the current block. If the width and height of the current block are equal, the context index can be 0. If the width of the current block is greater than the height, the context index can be 1. If the width of the current block is smaller than the height, the context index can be 2.

[0229] A video signal processing device can perform binary arithmetic encoding in a bypass form using a fixed probability interval without performing binary arithmetic encoding of template_idx through a context model.

[0230] A video signal processing device can perform binary arithmetic encoding of template_idx using only one context model. In this case, since each slice type has only one context model, a context model index is not derived, and a fixed context model can be used for all blocks in the slice.

[0231] Since the LM mode uses a restored luminance block and a linear model, the LM mode can be applied to the chrominance blocks of blocks encoded with the intra mode or the inter mode. The inter mode has the advantage of high processing speed because it has low dependence on the surrounding blocks, whereas the LM mode has the disadvantage of low processing speed because it has high dependence on the surrounding blocks. Therefore, when the LM mode is applied to the inter mode, it may not be applied to encoding modes with low processing speed (e.g., GPM, Affine, sbTMVP, BCW, PROF, BDOF, TM, MP-DMVR, OBMC, MHP, LIC). The LM mode can be applied to chrominance component blocks encoded with encoding modes with relatively high decoding processing speed for luminance component blocks (e.g., Merge, MergeSkip, MMVD, AMVP, SMVD, CIIP). At this time, information on whether the LM mode is applied to the chrominance component blocks can be signaled. That is, the decoder can determine whether the LM mode is applied to the chrominance component block of a block encoded in inter mode by parsing information on whether the LM mode is applied to the chrominance component block in the bitstream.

[0232] Block prediction methods can be broadly divided into intra-prediction methods that utilize spatial correlation and inter-prediction methods that utilize temporal correlation. If an intra-prediction method is applied to the current block, the bitstream may contain information related to intra-prediction but not inter-prediction. Conversely, if an inter-prediction method is applied to the current block, the bitstream may contain information related to inter-prediction but not intra-prediction. The encoding information for the current block (whether an inter-prediction method or an intra-prediction method is applied) can be predicted based on the encoding information of the surrounding blocks. For example, if intra-prediction is applied to the current block, prediction for the current block can be performed based on the intra-prediction information of the surrounding blocks. However, if all surrounding blocks are blocks to which inter-prediction is applied, applying intra-prediction to the current block reduces efficiency. To address this issue, a video signal processing device can improve the intra-prediction efficiency of the next block to be processed by including intra-prediction information for the surrounding blocks on which inter-prediction was performed in the bitstream. A method for deriving intra-prediction information for a block on which inter-prediction has been performed can utilize the fact that the current block is likely to have similar image characteristics to the reference block. In other words, the intra-prediction information of the reference block can be used as intra-prediction information for the current block.

[0233] FIG. 14 is a diagram illustrating a method for deriving an intra prediction mode of a current block using surrounding blocks according to one embodiment of the present specification.

[0234] Referring to FIG. 14, neighboring blocks of the current block may have different sizes. When the current block is encoded in an intra prediction mode, the video signal processing device may construct an MPM list using the intra prediction modes of the neighboring blocks of the current block, and then encode the intra prediction mode for the current block using the MPM list. When deriving the intra prediction mode of the neighboring block, if the neighboring block is a block encoded with inter prediction, the video signal processing device may derive the intra prediction mode of the current block from the reference picture using the motion information of the neighboring block. Specifically, the intra prediction mode stored at a position shifted by the motion information of the neighboring block based on the position corresponding to the upper left pixel position of the neighboring block of the reference picture may be included in the MPM list. For example, the intra prediction mode of the neighboring block Ne-A2 / A3 of FIG. 14 may be the intra prediction mode of M4 or O5 of the reference picture, and the stored intra prediction mode of M4 or O5 may be included in the MPM list.

[0235] The intra prediction mode of the current block may be similar to the intra prediction mode of the surrounding blocks, and the closer the position used to derive the intra prediction mode of the surrounding blocks is to the current block, the higher the accuracy of the intra prediction mode may be. Therefore, the position used to derive the intra prediction mode of the surrounding blocks may be reset to a position closer to the current block. For example, the intra prediction mode of the Ne-L3 surrounding block of FIG. 14 may be the intra prediction mode of J16 or J17, which is closer to the current block, rather than H16 or I17. In addition, the video signal processing device may derive the intra prediction mode from the reference picture by projecting the motion information of the surrounding blocks based on the position of the current block. For example, in order to derive an intra prediction mode for the neighboring block Ne-A2 / A3 of FIG. 14, the video signal processing device may derive and use the intra prediction mode of the position of the current block, instead of using the intra prediction mode of M4, which is a position shifted by the motion information of the neighboring block Ne-A2 / A3 based on the position corresponding to the upper left pixel position of the neighboring block Ne-A2 / A3 in the reference picture. That is, in order to derive an intra prediction mode for the neighboring block Ne-A2 / A3, the video signal processing device may derive and use the intra prediction mode of M10, which is a position shifted by the motion information of the neighboring block Ne-A2 / A3 based on the position corresponding to the center pixel position of the current block in the reference picture. The derived intra prediction mode may be included in constructing the MPM list of the current block. At this time, the video signal processing device may derive an intra prediction mode of a position shifted by the motion information of the neighboring block based on a predefined position within the current block, rather than the position of the center pixel of the current block.For example, the predefined position may be one of the upper left, upper center, upper right, left center, lower left, lower center, lower right, and right center of the current block. At this time, the video signal processing device may generate the intra prediction block of the corresponding sub-block by using at least one of several intra prediction modes derived from motion information of several surrounding blocks. The video signal processing device may use one of the median, the average, the minimum, and the maximum values ​​among several intra prediction modes as the optimal intra prediction mode. The above-described method may also be applied when the chrominance component block of the current block is encoded in the LM mode. For example, the video signal processing device may derive the intra prediction mode for the chrominance component block of the current block from the reference picture by projecting the motion information of the surrounding blocks based on the position of the current block. At this time, if the derived intra prediction mode is the LM mode, the video signal processing device can obtain at least one of information on which mode among CCLM, MMLM, CCCM, and GLM was applied to the surrounding block, information on which samples (left samples, upper samples) were used, and filter coefficient information from the reference picture and use it to predict the current chrominance block. To do this, all LM encoding information for the corresponding chrominance block must be stored in the reference picture.

[0236] The CIIP mode is a method of performing both intra prediction and inter prediction on the current block and then weighting and averaging each prediction block. When the CIIP mode is applied to the current block, since the bitstream already includes motion information for the current block, the video signal processing device can use the motion information of the current block when deriving the intra prediction mode from the reference picture. At this time, if the intra prediction mode of the chrominance component block derived from the reference picture is any one of the LM, CCLM, MMLM, CCCM, and GLM modes, the chrominance component block of the current block can be predicted using the coding mode of the chrominance component block of the reference block. At this time, in order to increase the processing speed for the block encoded in the CIIP mode, the video signal processing device can perform intra prediction and inter prediction only on the luminance component block and then perform a weighted averaging to generate a prediction block, and for the chrominance component block, the prediction block can be generated only using the chrominance coding mode of the corresponding reference block (LM). In other words, the video signal processing device does not need to perform inter prediction on the chrominance component block, thereby increasing the processing speed.

[0237] The parameter derivation method for the linear model described above can only use samples at predetermined locations. Therefore, the accuracy of the linear model may vary depending on the accuracy of the samples at these locations. Typically, in images captured by cameras, noise may be present in samples at predefined locations. Using these noisy samples to derive linear model parameters can lower the accuracy of the linear model. Below, we describe a method to address this issue.

[0238] FIG. 15 is a diagram illustrating a method for obtaining a color difference prediction block according to one embodiment of the present specification.

[0239] Referring to FIG. 15, a video signal processing device may configure a first template including surrounding samples of a current block. The video signal processing device may selectively perform low-pass filtering on the surrounding samples within the template to make the surrounding samples similar to each other. That is, the video signal processing device may configure a second template including surrounding samples that are similar to each other. Alternatively, the video signal processing device may perform high-pass filtering on the surrounding samples within the template to clearly distinguish noise, and then determine a sample that is greater than a predefined threshold as noise and remove it from the template. At this time, the sample determined to be noise and removed may be padded using one of the surrounding pixels or set to a weighted average value of the surrounding pixels. That is, the video signal processing device may configure a third template by padding a sample determined to be noise and removed using one of the surrounding pixels or set to a weighted average value of the surrounding pixels. Filtering and noise removal may be selectively performed at each of the SPS, PPS, PH, Slice, Tile, CU, and sub-block levels. At this time, information on whether filtering and noise removal are performed can be signaled and included in the bitstream, and the decoder can parse the information on whether filtering and noise removal are performed to determine whether filtering and noise removal are performed. The video signal processing device can derive parameters for a linear model based on samples in the second template or the third template, and obtain a first linear model. The video signal processing device can perform verification on the first linear model using samples in the first template. The video signal processing device can perform verification based on whether the samples in the first template are within a predefined error value (e.g., an integer greater than or equal to 1) when applied to the first linear model, or whether the ratio between the samples within the error value and all samples in the first template is greater than or equal to a predefined ratio (e.g., a value between 0 and 1).At this time, if the ratio between the samples within the error value and the total samples in the first template is less than a predefined ratio, the second linear model can be derived using samples other than the samples used to derive the first linear model. The video signal processing device can derive the n-th linear model by repeatedly performing the linear model derivation process. At this time, the linear model derivation process can be repeated until all the samples in the first template are used in the derivation process or the number of remaining samples that can be used for linear model derivation is within a predefined number (for example, an integer greater than or equal to 1). In addition, the video signal processing device can obtain a downsampled luminance component block (sample) and predict a chrominance component block (sample) by performing the method described herein.

[0240] FIG. 16 is a diagram illustrating a reference region used to generate a linear model according to one embodiment of the present specification.

[0241] As described with reference to FIG. 9, a video signal processing device may use a type 1 or type 2 filter to generate a downsampled luminance component sample. The dark gray samples in FIG. 16 represent locations where downsampled luminance component samples are generated, and the light gray samples represent surrounding samples used to generate luminance component samples at the dark gray locations. At this time, the gray samples may be described as a reference region. The decoder may use one or more reference lines to predict the current block. At this time, the encoder may generate a bitstream including information on which line among the one or more reference lines is used. At this time, the information on which line is used may be an index of the reference line. The decoder may predict the current block using the reference line corresponding to the index obtained by parsing the information on which line is used. If the reference line used for predicting the current block is an adjacent line to the current block, the decoder may use the reference region of FIG. 16(a) to derive a linear model for predicting a chrominance component sample. At this time, the line adjacent to the current block can be a line that is spaced apart from the current block by n samples. At this time, n is an integer greater than or equal to 1 and can be 3. That is, referring to Fig. 16(a), the decoder can use the samples on the reference lines (reference lines 0, 1, 2) corresponding to indices 0, 1, and 2 as reference areas (when n is 3). If the reference line used for predicting the current block is a line that is not adjacent to the current block, the decoder can use the reference area of ​​Fig. 16(b) to derive a linear model for predicting chrominance component samples. At this time, the line that is not adjacent to the current block can be a line after a line that is spaced apart from the current block by k samples. At this time, k is an integer greater than or equal to 1 and can be 3.That is, referring to Fig. 16(b), the decoder can make the samples on the reference line after the reference line corresponding to index 2 (reference line 2) the reference area (when k is 3).

[0242] A video signal processing device can derive (use) two linear models when predicting chrominance component samples using the MMLM method. At this time, the video signal processing device can derive a first linear model using the reference region of Fig. 16(a) and a second linear model using the reference region of Fig. 16(b). If the information regarding which line is used described above does not indicate the index of a line adjacent to the current block (e.g., if it indicates an index greater than 1), linear models can be derived from different reference regions.

[0243] The closer the sample used to derive the linear model used to predict the chrominance component sample is to the current block, the better the derived linear model can represent the characteristics of the current block. Therefore, the more samples adjacent to the current block are used, the more effective the linear model can be derived. If the sample used to predict the luminance component sample for the current block is a sample from a line that is not adjacent to the current block, it may contain noise. This noise may prevent the decoder from deriving an effective linear model. That is, the decoder can determine whether to use or activate CCLM, MMLM, GLM, CCCM, etc. depending on the line of the reference sample used to predict the luminance component sample for the current block. For example, the decoder may not use CCLM, MMLM, GLM, CCCM, etc. for the prediction of the current block if the line index of the sample used to predict the luminance component sample for the current block is greater than a predefined value (for example, 3 as an integer greater than or equal to 1). That is, syntax related to CCLM, MMLM, GLM, and CCCM is not parsed, and syntax related to CCLM, MMLM, GLM, and CCCM can be inferred to indicate that CCLM, MMLM, GLM, and CCCM are not used or enabled. It can be inferred (implied) that they are not parsed and not used.

[0244] Figure 17 illustrates an example of a reference region and filter shape used to derive CCCM parameters according to one embodiment of the present invention.

[0245] CCCM (Convolutional cross-component intra prediction model) is a method of predicting a chrominance signal using a nonlinear model that utilizes the high correlation between a luminance signal and a chrominance signal located at the same location as the luminance signal. Fig. 17(a) shows the positional relationship between reference samples (vertical hatching, 1720) for applying CCCM to the current prediction block (diagonal hatching, 1710) and side samples (horizontal hatching) required when applying a cross-shaped filter. The current prediction block (MxN) can be composed of reference samples in the upper 6 rows (2Mx6), reference samples in the left 6 rows (6x2N), and 6x6 reference samples in the upper left, in a 1:1 chroma-to-luma sample number ratio. When a video signal processing device applies a cross-shaped sample (Fig. 17(b)) filter to a chroma sample prediction relationship (Fig. 17(c)) for CCCM, cases where the reference sample area is exceeded may occur. At this time, additionally required samples may be side samples. The chroma sample prediction relationship of Fig. 17(c) may be applied to each chroma component (i.e., Cb, Cr). The sample at the C (Center) position in Fig. 17(b) may be a luma sample corresponding to the Cb and Cr chroma samples, and N (North), E (East), S (South), and W (West) may be luma samples adjacent to the luma sample at the C position. Side samples may additionally require one sample for an area other than the reference sample depending on the position of the C sample. If the sample value existing at the position of the side sample is not available, the sample value at the unavailable position may be padded with the C sample value. The P value of Fig. 17(c) may be a nonlinear term. The P value may be calculated as P = ( C*C + midVal ) >> bitDepth , and in the case of 10-bit content, P = ( C*C + 512 ) >> 10 .In Fig. 17(c), the B value can be an integer offset value as a bias value. The B value can be an intermediate value of bitDepth (bit depth). In the case of 10-bit content, the B value can be 512.

[0246] In Fig. 17(c), the seven coefficients (c1, c2, ..., c6) can be obtained using the luma and chroma samples of the reference sample area. At this time, the seven coefficients can be obtained by using the process of minimizing the MSE (Mean Square Error) value of the autocorrelation matrix for the luma input value and the cross-correlation vector for the luma input value and the chroma output value. The autocorrelation matrix can be obtained by LDL decomposition or Cholesky decomposition. In addition, the seven coefficients can be obtained using the back-substitution method. The B value in Fig. 17(c) can be defined as the average value of each chroma component, or can be defined as the difference (or the absolute value of the difference) between the average value of the luma samples of the entire reference sample and the average value of each chroma component.

[0247] The P value of Fig. 17(c) may be used as a value described later instead of the above-described value. i) The P value may be P = ( Cg*Cg + midVal ) >> bitDepth. In this case, Cg may be a gradient value at the C position of Fig. 17(b). midVal may be a middle value of the bit depth. In the case of 10-bit content, midVal may be 512. ii) The P value may be an average value of the gradient values ​​of the reference samples. iii) The P value may be an average value of the gradient values ​​at each position of C, N, W, E, and S of Fig. 17(b). iv) The P value may be P=(meanG*meanG+bitDepth>>1)>>bitdepth. meanG may be an average value of the gradient values ​​of the reference samples.

[0248] Additionally, C, N, S, E, W, and P in Fig. 17(c) may be used as values ​​described below instead of the values ​​described above. Instead of the C, N, S, E, W, and P values ​​described above, the values ​​C', N', S', E', W', and P' may be used, respectively.

[0249] C'=C-meanY, N'=N-meanY, S'=S-meanY, E'=E-meanY, W'=W-meanY, P'=P-meanNonlinY

[0250] At this time, meanY can be the average value of lumas in the reference sample area. meanNonlinY can be meanNonlinY = (meanY * meanY) >> bitdepth or meanNonlinY = (meanY * meanY + bitdepth>>1) >> bitdepth.

[0251] Figure 18 shows samples used to derive CCCM parameters according to one embodiment of the present invention.

[0252] A video signal processing device can use only samples at specific locations to obtain meanY and meanChroma. The video signal processing device can calculate meanY and meanChroma values ​​using at least one sample at locations A, B, C, D, E, F, G, a, b, c, d, e, f, and g of FIG. 18. In addition, the samples used may vary depending on the form of the template used in CCCM. For example, the template used in CCCM may include not only the template of FIG. 17(a), but also an upper template that uses only the upper pixels of the current block and a left template that uses only the left pixels of the current block. If an upper template that uses only the upper pixels of the current block exists, when applying CCCM to the current block, the video signal processing device can calculate meanY and meanChroma values ​​using at least one sample at locations B, E, F, b, e, and f within the upper template.

[0253] Fig. 17(c) can be expressed as in mathematical formulas 7 and 8 using C', N', S', W', and P'.

[0254]

[0255]

[0256] B' in mathematical expression 7 may be the difference (or absolute value difference) between the average value of luma samples in the reference sample and the average value of each chroma component. meanChroma in mathematical expressions 7 and 8 may be the average value for each of the chroma samples (Cb, Cr) in the reference sample area.

[0257] The coefficients of the luma samples used in Equation 8 can be used as a combination of five luma position samples, and the number of required coefficients may vary depending on the number of lumas used. In this case, the number of luma positions and coefficients can be preset.

[0258] In Fig. 17(c), the luma sample values ​​or transformed luma sample values ​​(i.e., C, N, S, E, W, C', N', S', E', W') of Equation 7 can be replaced with slope values.

[0259] In CCCM, the autocorrelation matrix can be computed using the reconstructed values ​​of luma and chroma samples. Since luma and chroma samples span the full range (0 to 1023 for 10-bit content), the autocorrelation matrix can be relatively large. Therefore, obtaining the coefficients requires a high bit-depth computation. Differentiating the meanY and meanNonlinY values ​​can address this issue. However, the mean-value difference method requires calculating the mean, which necessitates an additional pipeline step and thus increases implementation complexity. To mitigate this drawback, this specification proposes a method for differentiating predefined fixed values ​​for luma and chroma samples for each model. This reduces the size of the values ​​used for model generation and reduces the precision required for fixed-point operations. Consequently, this approach allows for the use of 16-bit fractional precision instead of the 22-bit precision of the original CCCM implementation.

[0260] The sample values ​​(i.e., luma and chroma of the reference area, luma of the current PU) used for model generation and final prediction in the relational expression of Fig. 17(c) can be reduced by a fixed value as follows.

[0261] C' = C - offsetLuma

[0262] N' = N - offsetLuma

[0263] S' = S - offsetLuma

[0264] E' = E - offsetLuma

[0265] W' = W - offsetLuma

[0266] P' = nonLinear(C')

[0267] B = midValue = 1 << (bitDepth - 1)

[0268] Chroma values ​​are predicted using the following mathematical expression 9, where offsetChroma can be offsetCr for the Cr component and offsetCb for the Cb component. The pixel value at position A in Fig. 18 can be used as the offset (offsetLuma, offsetCb, and offsetCr) for simplicity.

[0269]

[0270] There is a problem that if the pixel value at position A in Fig. 18, which can be used as the offsetLuma value, is 0, the difference process is eliminated, and therefore calculations at the existing high bit depth are required again. This specification describes a method for solving this problem.

[0271] If the pixel value at position A of FIG. 18, which can be used as the offsetLuma value, is smaller than a predefined first value or larger than a predefined second value, the video signal processing device can use the predefined value (offset value) as the offsetLuma, offsetCr, and offsetCb values. At this time, the predefined first and second values ​​may be integers greater than or equal to 1. In addition, the predefined first and second values ​​may be determined based on the bit depth. For example, when the bit depth is 10 bits, the predefined first and second values ​​may be 0, 128, 256, 512, 768, 1023, etc. Or, the predefined values ​​may be integers and may be determined based on the bit depth. For example, when the bit depth is 10 bits, the predefined values ​​may be -256, -128, 0, 128, 256, etc.

[0272] If the pixel value at position A in FIG. 18 is less than a predefined first value or greater than a predefined second value, the video signal processing device sequentially searches for samples at positions B, C, D, E, F, G, a, b, c, d, e, f, and g in FIG. 18, checks whether the sample at the corresponding position is a sample within a valid range, and if it is valid, uses the sample value at the corresponding position as the offsetLuma, offsetCr, and offsetCb values. At this time, the valid range may be a predefined range. For example, the video signal processing device may determine that the sample is a valid sample if the value of the sample is greater than a predefined integer. The predefined integer may be determined based on the bit depth, and for example, if the bit depth is 10 bits, it may be 128, 256, etc.

[0273] The encoder sequentially searches for samples at positions A, B, C, D, E, F, G, a, b, c, d, e, f, g in Fig. 18, checks whether the sample at the corresponding position is within a valid range, and then applies CCCM to the current block using all sample values ​​within the valid range, and signals information about the most optimal sample position by including it in the bitstream. The decoder can then parse the information about the most optimal sample position, and set the offsetLuma, offsetCr, and offsetCb values ​​to be used for performing CCCM of the current block based on the sample at the determined optimal sample position.

[0274] If the pixel value at position A in FIG. 18 is less than a predefined first value or greater than a predefined second value, the encoder may not use CCCM to encode the current chrominance block and may not include information related to CCCM in the bitstream. If the pixel value at position A in FIG. 18 is less than a predefined first value or greater than a predefined second value, the decoder may not parse information related to CCCM. That is, the decoder may infer (implie) the values ​​of syntaxes related to CCCM as 0 or set syntaxes related to CCCM to not be used.

[0275] If all pixel values ​​at positions A, B, C, D, E, F, G, a, b, c, d, e, f, g in FIG. 18 are less than a predefined first value or greater than a predefined second value, the encoder may not use CCCM to encode the current chrominance block and may not include information related to CCCM in the bitstream. If all pixel values ​​at positions A, B, C, D, E, F, G, a, b, c, d, e, f, g in FIG. 18 are less than a predefined first value or greater than a predefined second value, the decoder may not parse information related to CCCM. That is, the decoder may infer (hint) the values ​​of syntaxes related to CCCM as 0 or set syntaxes related to CCCM to not be used.

[0276] The method for checking whether the samples at positions A, B, C, D, E, F, G, a, b, c, d, e, f, and g of the above-described FIG. 18 are samples within a valid range may vary depending on the form of the template used in the CCCM. For example, when the template used in the CCCM includes not only the template of FIG. 17(a), but also an upper template that uses only the upper pixels of the current block and a left template that uses only the left pixels of the current block, and when the upper template is used for applying CCCM to the current block, the video signal processing device may sequentially search for samples at positions B, E, F, b, e, and f within the upper template, check whether the samples at the corresponding positions are samples within a valid range, and if valid, use the sample values ​​at the corresponding positions as the offsetLuma, offsetCr, and offsetCb values.

[0277] When a video signal processing device checks whether the samples at positions A, B, C, D, E, F, G, a, b, c, d, e, f, and g of FIG. 18 are samples within a valid range, the video signal processing device can set a valid range by using at least one of the minimum value, median value, maximum value, and average value of surrounding samples adjacent to the current block.

[0278] If the pixel value at position A in FIG. 18 is less than a defined predefined first value or greater than a defined predefined second value, the encoder may not use at least one of CCLM, MMLM, GLM, and CCCM used to encode the current chrominance block. And, the encoder may not include information related to at least one of CCLM, MMLM, GLM, and CCCM in the bitstream. If the pixel value at position A in FIG. 18 is less than a defined predefined first value or greater than a defined predefined second value, the decoder may not parse information related to at least one of CCLM, MMLM, GLM, and CCCM, and the value of information (e.g., syntax elements) related to CCLM, MMLM, GLM, and CCCM may be inferred (implied) as 0. The decoder may be set not to use information related to CCLM, MMLM, GLM, and CCCM.

[0279] When applying MMLM, the video signal processing device may set the average value of luminance samples of surrounding blocks of the current block as a first threshold, derive two linear models through the surrounding blocks based on the first threshold, and then derive corresponding chrominance samples using one linear model based on the first threshold for each luminance sample of the current block. When applying MMLM, the chrominance samples of the current block may be derived using one linear model for the corresponding luminance samples. When the difference between the luminance samples of the current block and the first threshold is small, it may be more effective to use both linear models rather than one linear model.

[0280] A video signal processing device can compare a luminance sample of a current block and a predefined number of luminance samples surrounding the luminance sample of the current block with a first threshold, and can predict a chrominance sample corresponding to the luminance sample of the current block using at least one of the number of luminance samples of the current block belonging to a first linear model and a second linear model, a difference between the luminance samples of the current block and the first threshold, a weight for the first linear model, and a weight for the second linear model. The first linear model and the second linear model can be linear models derived using the first threshold. The first threshold can be an integer greater than or equal to 1, and can be an average value of reconstructed luminance samples adjacent to the current block. When the luminance sample of the current block is less than the first threshold, the video signal processing device can determine that the luminance sample of the current block belongs to the first linear model, and when the luminance sample of the current block is greater than or equal to the first threshold, the video signal processing device can determine that the luminance sample of the current block belongs to the second linear model.

[0281] Additionally, the meaning of the number belonging to the linear model described in this specification may mean the number of luminance samples included in the linear model, as described above.

[0282] FIG. 19 illustrates luminance samples around a luminance sample of a current block according to one embodiment of the present invention.

[0283] Figure 19(a) shows four luminance samples around the current block, and Figure 19(b) shows eight luminance samples around the current block.

[0284] A video signal processing device compares a luminance sample of a current block and a predefined number of luminance samples around the luminance sample of the current block (Fig. 19(a), (b)) with a first threshold to calculate the number of samples belonging to a first linear model and a second linear model. If the number of the first linear model is equal to or greater than the first predefined value, the chrominance sample corresponding to the luminance sample of the current block can be predicted using only the first linear model. If the number of the second linear model is equal to or greater than the first predefined value, the chrominance sample corresponding to the luminance sample of the current block can be predicted using only the second linear model. The first predefined value may be 6. If the number of the first linear model is greater than the number of the second linear model, the video signal processing device may set a first weight for the first linear model and set a second weight for the second linear model. And, the video signal processing device can derive a chrominance sample corresponding to the luminance sample of the current block through a weighted average using the first weight and the second weight for the first chrominance sample derived using the first linear model and the second chrominance samples derived using the second linear model, respectively. If the number of the first linear models is equal to or less than the number of the second linear models, the video signal processing device can set the first weight to the second linear model and the second weight to the first linear model. And, the video signal processing device can derive a chrominance sample corresponding to the luminance sample of the current block through a weighted average using the second weight and the first weight for the first chrominance sample derived using the first linear model and the second chrominance samples derived using the second linear model, respectively. The first weight may be 13, and the second weight may be 3. At this time, the weighted average between the sample values ​​A and B may be calculated as (A * first weight + B * second weight) >> Shift. The value of Shift can be determined based on the first weight and the second weight.The value of Shift can be the value obtained by converting the sum of the first and second weights into binary and then subtracting 1 from N, which is the number of binary bits converted. For example, if the first weight is 13 and the second weight is 3, the sum of the weights is 16. The sum of the weights, 16, is 10000 when converted into binary, and since the number of binary bits is 5, the value of Shift becomes 4. Accordingly, when calculating the weighted average of the sample values ​​A and B, the weighted average value is restored back to the bit depth of the sample value.

[0285] The video signal processing device may derive a chrominance sample using only the first linear model, derive a chrominance sample using only the second linear model, or derive a chrominance sample through a weighted average using both the first linear model and the second linear model based on a difference between a luminance sample of a current block and a first threshold, a second threshold, or a third threshold. The second threshold and the third threshold may be integers greater than or equal to 1 and may be preset values.

[0286] For example, if the difference between the luminance sample of the current block and the first threshold is greater than the second threshold, the video signal processing device may compare the luminance sample of the current block with the first threshold. At this time, if the luminance sample of the current block is greater than the first threshold, the chrominance sample corresponding to the luminance sample of the current block may be predicted using the second linear model. If the luminance sample of the current block is equal to or less than the first threshold, the chrominance sample corresponding to the luminance sample of the current block may be predicted using the first linear model.

[0287] If the difference between the luminance sample of the current block and the first threshold is equal to or less than the second threshold and the difference between the luminance sample of the current block and the first threshold is less than the third threshold, the video signal processing device may set a third weight for the first linear model and a fourth weight for the second linear model. Then, the video signal processing device may use the third weight and the fourth weight for each of the first chrominance sample derived using the first linear model and the second chrominance samples derived using the second linear model to ultimately derive a chrominance sample corresponding to the luminance sample of the current block through a weighted average. The third weight may be 1, and the fourth weight may be 1.

[0288] If the difference between the luminance sample of the current block and the first threshold is equal to or greater than the third threshold, the video signal processing device can compare the luminance sample of the current block with the first threshold. If the luminance sample of the current block is less than or equal to the first threshold, the video signal processing device can set a first weight to the first linear model and a second weight to the second linear model. Then, the video signal processing device can use the first weight and the second weight for the first chrominance sample derived using the first linear model and the second chrominance samples derived using the second linear model, respectively, to derive a chrominance sample that ultimately corresponds to the luminance sample of the current block through a weighted average. If the luminance sample of the current block is greater than the first threshold, the video signal processing device can set the first weight to the second linear model and the second weight to the first linear model. And, the video signal processing device can derive a chrominance sample corresponding to the luminance sample of the current block through a weighted average using the second weight and the first weight for each of the first chrominance sample derived using the first linear model and the second chrominance sample derived using the second linear model. The first weight can be 13, and the second weight can be 3.

[0289] A video signal processing device can derive a chrominance sample corresponding to a luminance sample of a current block by using at least one linear model derived from a neighboring block of a current block and two linear models derived based on an average value of neighboring blocks of the current block.

[0290] The video signal processing device compares the luminance samples of the current block and the luminance samples around the luminance samples of the current block (e.g., the samples in FIG. 19(b)) with a first threshold to calculate the number of samples belonging to the first linear model and the second linear model. If the number of the first linear model is equal to or greater than the first predefined value, the chrominance samples corresponding to the luminance samples of the current block can be predicted using only the first linear model. Otherwise, if the number of the second linear model is equal to or greater than the first predefined value, the chrominance samples corresponding to the luminance samples of the current block can be predicted using only the second linear model. The first predefined value may be 6. If the number of the first linear model is greater than the number of the second linear model, the video signal processing device may set a first weight for the first linear model and a second weight for the third linear model. And, the video signal processing device can derive a chrominance sample corresponding to the luminance sample of the current block through weighted averaging by using a first weight for each of the first chrominance sample derived using the first linear model and the second chrominance sample derived using the third linear model and a second weight for each of the second chrominance sample. If the number of the first linear models is equal to or less than the number of the second linear models, the video signal processing device can set a first weight for the second linear model and a second weight for the third linear model. And, the video signal processing device can derive a chrominance sample corresponding to the luminance sample of the current block through weighted averaging by using the first weight and the second weight for each of the first chrominance sample derived using the second linear model and the second chrominance sample derived using the third linear model. The first weight can be 13 and the second weight can be 3.

[0291] The video signal processing device can determine whether to derive a chrominance sample using only the first linear model, or whether to derive a chrominance sample using only the second linear model, or whether to derive a chrominance sample using a weighted average using at least one of the first linear model, the second linear model, and the third linear model, based on the difference between the luminance sample of the current block and the first threshold, the second threshold, or the third threshold.

[0292] If the difference between the luminance sample of the current block and the first threshold is greater than the second threshold, the video signal processing device may compare the luminance sample of the current block with the first threshold. If the luminance sample of the current block is greater than the first threshold, the chrominance sample corresponding to the luminance sample of the current block may be predicted using the second linear model. If the luminance sample of the current block is equal to or less than the first threshold, the chrominance sample corresponding to the luminance sample of the current block may be predicted using the first linear model. If the difference between the luminance sample of the current block and the first threshold is equal to or less than the second threshold and the difference between the luminance sample of the current block and the first threshold is less than the third threshold, the video signal processing device may set a third weight for the first linear model, a fourth weight for the second linear model, and a fifth weight for the third linear model. And the video signal processing device can derive a chrominance sample corresponding to the luminance sample of the current block through a weighted average using a third weight, a fourth weight, and a fourth weight for each of the first chrominance sample derived using the first linear model, the second chrominance sample derived using the second linear model, and the third chrominance sample derived using the third linear model. The third weight can be 1, the fourth weight can be 1, and the fifth weight can be '1'.

[0293] If the difference between the luminance sample of the current block and the first threshold is equal to or greater than the third threshold, the video signal processing device can compare the luminance sample of the current block with the first threshold. If the luminance sample of the current block is less than or equal to the first threshold, a first weight may be set for the first linear model and a second weight may be set for the third linear model, and then first chrominance samples derived using the first linear model and second chrominance samples derived using the third linear model may be derived, and then the first chrominance sample may be weighted and averaged using the first weight and the second weight for the second chrominance sample, to finally derive a chrominance sample corresponding to the luminance sample of the current block. If the luminance sample of the current block is greater than the first threshold, the video signal processing device can set the first weight for the second linear model and the second weight for the third linear model. In addition, the video signal processing device can derive a chrominance sample corresponding to the luminance sample of the current block through a weighted average using a first weight and a second weight for each of the first chrominance sample derived using the second linear model and the second chrominance sample derived using the third linear model. The first weight can be 13, and the second weight can be 3.

[0294] Chroma Fusion (CF) can be a method of deriving a weighted average between a chroma block (pred'C) predicted through a general intra prediction mode without using a linear model (LM) mode and a current luminance block (rec'L), as shown in Equation 10. At this time, the weight parameters (a0, a1, a2) can be derived using the CCCM method. The midvalue (midValue) can be calculated as '1 << (bitDepth - 1)'. In addition, the encoder can obtain and signal a bitstream including information on whether to use one CCCM model or two CCCM models. The decoder can parse the information on how many CCCM models are used when the current chroma block is encoded in the CF mode and use it to predict the current chroma block.

[0295]

[0296] GL-CCCM (Gradient and location based convolutional cross-component model) is an additional CCCM mode that uses gradient and location information. The existing CCCM mode may be a mode that derives a chrominance sample for the current block using a luminance sample at a corresponding location from a chrominance sample location to be predicted, four samples around the luminance sample (e.g., the sample in Fig. 19(a)), and coefficient information. At this time, the GL-CCCM mode may be a mode that reflects the vertical and horizontal differences (Gx, Gy in Equation 11) for a luminance sample at a corresponding location from a chrominance sample location to be predicted, and eight samples around the luminance sample, as illustrated in Fig. 19(b), and also derives a chrominance sample for the current block using the location value (X, Y in Equation 11) of the current luminance sample and its coefficient information. At this time, the position value of the current luminance sample can be used as the value recalculated through the upper left position of the reference template used to derive the CCCM model, the upper left position of the current block, the relative position of the current pixel when the upper left position of the current block is (0,0), the predefined offset value, and the predefined shift value. At this time, the position value of the current luminance sample can be used as the value recalculated through the upper left position of the current block when the upper left position of the current block is (0,0).

[0297] (Current pixel relative position value + difference between the current block top-left position and the top-left position of the reference template used to derive the CCCM model + predefined offset value) << predefined shift value)

[0298] can be calculated through. At this time, the predefined offset value can be an integer and can be 8. Also, the predefined shift value can be an integer and can be 3. In addition, Gx and Gy can be calculated through mathematical expression 12 using the samples of Fig. 19(b).

[0299]

[0300]

[0301] Coefficient information (or weight parameter information) can be derived using arbitrary regions of previously reconstructed neighboring blocks surrounding the current block. Additionally, the encoder can signal whether GL-CCCM is used in the current block by including it in the bitstream. The decoder can parse this information to determine whether GL-CCCM is used in the current block and use it to predict the chrominance block.

[0302] In GL-CCCM, the luminance samples used to calculate the vertical and horizontal differences of luminance samples can be not only those surrounding the current luminance sample, but also surrounding luminance samples located a specific distance (sample) away from the current sample. The specific distance can be 1, 2, 3, 4, etc.

[0303] In LM mode, which predicts the current chrominance block using the restored current luminance block, the video signal processing device can apply a downsampling filter to the luminance block to make the resolution of the luminance block the same as the resolution of the chrominance block. This is because there is a resolution difference between the luminance and chrominance blocks. This downsampling may reduce edge component information of the luminance block. Therefore, the chrominance block can be predicted using samples of the luminance block before downsampling.

[0304] FIG. 20 and FIG. 21 illustrate luminance samples before downsampling used to derive chrominance samples in CCCM-ND mode according to one embodiment of the present invention.

[0305] CCCM-ND (CCCM using non-downsampled luma samples) mode may be a method for predicting a chrominance block using samples of a luminance block before downsampling. Fig. 20 shows a chrominance sample position C to be predicted by a video signal in CCCM-ND mode and six luminance sample positions corresponding to the chrominance sample positions. At this time, the luminance samples may be samples before downsampling. The chrominance sample may be calculated using Equation 13. The chrominance sample may be calculated using a linear model using six luminance samples (L0, L1, L2, L3, L4, L5 samples of Fig. 20) and a non-linear model using four luminance samples (L0, L3, L2, L1 samples of Fig. 20). In Equation 13, offsetLuma and offsetchroma have the same meaning as the difference value described above. B can be calculated as '1 << (bitDepth - 1)'. The LDL decomposition method used in CCCM can be used to derive the coefficients (a0 ~ a10).

[0306]

[0307] The encoder can signal whether CCCM-ND is applied to the current block by including information in the bitstream. The decoder can parse this information to determine whether CCCM-ND is applied to the current block.

[0308] If CCCM-ND is applied to the current block, the encoder may not include information about GL-CCCM in the bitstream. If CCCM-ND is applied to the current block, the decoder may not parse information related to GL-CCCM and may set GL-CCCM not to be applied to the current block.

[0309] When GL-CCCM is applied to the current block, the video signal processing device derives a model for GL-CCCM using the downsampled luminance samples, and predicts chrominance samples for the current block using the downsampled luminance samples of the current block. At this time, in GL-CCCM, as in CCCM-ND, luminance samples before downsampling can be used to derive a model or predict chrominance samples.

[0310]

[0311] The chrominance sample can be predicted (calculated) through mathematical expression 14. The video signal processing device can derive the chrominance sample for the current block by reflecting the vertical and horizontal differences (Gx, Gy in mathematical expression 14) for the luminance sample at the corresponding position at the chrominance sample position to be predicted and the samples around the luminance sample (L1 to L8 luminance samples in FIG. 20) using a linear model with six luminance samples (luminance samples L0, L1, L2, L3, L4, L5 in FIG. 20) and a non-linear model with four luminance samples (luminance samples L0, L3, L2, L1 in FIG. 20). In addition, the position value (X, Y in mathematical expression 14) of the current luminance sample and the coefficient information can be used. At this time, the video signal processing device can calculate Gx and Gy through 15 using the samples in FIG. 20. In Equation 15, offsetLuma and offsetchroma have the same meaning as the difference values ​​described above. B can be calculated as '1 << (bitDepth - 1)'. The LDL decomposition method used in CCCM can be used to derive the coefficients (a0 ~ a14).

[0312]

[0313] To predict a chrominance sample, the video signal processing device can use the luminance samples of FIG. 21 (e.g., L6, L7, L8 located below the current chrominance sample) instead of the luminance samples of FIG. 20.

[0314] The video signal processing device can use luminance samples located at a specific distance (sample) away from the luminance sample corresponding to the current chrominance sample in addition to the surrounding luminance samples for CCCM-ND. For example, when the specific distance is 1, the video signal processing device can use samples located at L0 to L8 of FIG. 21, and when the specific distance is 2, the video signal processing device can use at least one of the luminance samples located at L0 to L8 and I0 to I15 of FIG. 21.

[0315] The video signal processing device can selectively apply GL-CCCM and CCCM-ND when predicting a chrominance block through a luminance block of the current block. That is, the video signal processing device can select whether to use the GL-CCCM mode, the CCCM-ND mode, or both the GL-CCCM mode and the CCCM-ND mode when predicting a chrominance block.

[0316] When the encoder predicts a chrominance block through a luminance block of the current block, if the GL-CCCM mode is used, the value of information related to the CCCM-ND mode can be included and signaled in the bitstream by setting the value of information related to the GL-CCCM mode to 0 (i.e., the CCCM-ND mode is not used) and the value of information related to the GL-CCCM mode to 1 (i.e., the GL-CCCM mode is used). The decoder can parse the information related to the CCCM-ND mode and the information related to the GL-CCCM mode to determine the mode to use when predicting the chrominance block of the current block as the GL-CCCM mode.

[0317] When the encoder predicts a chrominance block through a luminance block of the current block, if the CCCM-ND mode is used, the value of information related to the CCCM-ND mode can be included and signaled in the bitstream by setting the value of information related to the CCCM-ND mode to 1 (i.e., the CCCM-ND mode is used) and the value of information related to the GL-CCCM mode to 0 (i.e., the GL-CCCM mode is not used). The decoder can parse the information related to the CCCM-ND mode and the information related to the GL-CCCM mode to determine the mode to use when predicting the chrominance block of the current block as the CCCM-ND mode.

[0318] When the encoder predicts a chrominance block through a luminance block of the current block, if both the GL-CCCM mode and the CCCM-ND mode are used, the encoder can set the values ​​of the information related to CCCM-ND and the information related to GL-CCCM to 1 (i.e., the CCCM-ND mode is used and the GL-CCCM mode is used) and include and signal them in the bitstream. The decoder can parse the information about the CCCM-ND mode and the information about the GL-CCCM mode to set the mode to be used when predicting the chrominance block of the current block to the GL-CCCM mode and the CCCM-ND mode.

[0319] CCCM mode is a method in which a video signal processing device derives linear and nonlinear models using the correlation between luminance samples and chrominance samples of neighboring blocks adjacent to the current block, and then predicts the chrominance samples of the current block using the restored luminance samples of the current block.

[0320] Figures 22 and 23 show a structural diagram for application of a cross-component residual model (CCRM) according to one embodiment of the present invention.

[0321] Referring to FIG. 22, when the inter-coding mode is applied to the current block, the video signal processing device can derive a CCP model (linear and non-linear models) between a luminance prediction block (Y') derived using motion information of the current block and a first chrominance prediction block (Cb', Cr') derived using motion information of the current block (Derive filter), and then generate a reconstructed luminance block of the current block using the luminance error block of the current block. The video signal processing device can apply the derived CCP model to the reconstructed luminance block of the current block (Apply filter) to generate a second chrominance prediction block of the current block. The video signal processing device can add a chrominance error block to the second chrominance prediction block predicted using the CCP model to finally generate (obtain) a chrominance block (Cb, Cr) of the current block.

[0322] Here, the CCP models include CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF, where CCLM and MMLM are linear models, and GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF can be nonlinear models. That is, the CCP model can be one of CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF. In addition, referring to FIG. 22, when the inter-coding mode is applied to the current block, the video signal processing device can derive a CCP model between the luminance prediction block (Y') of the current block and the first chrominance prediction block (Cb', Cr') of the current block (Derive filter), and then generate a reconstructed luminance block of the current block using the luminance error block of the current block. A video signal processing device can apply (Apply filter) the derived CCP model to the reconstructed luminance block of the current block to generate a second chrominance prediction block of the current block. The video signal processing device can generate a third chrominance prediction block through a weighted average between the second chrominance prediction block of the current block predicted using the CCP model and the first chrominance prediction block. At this time, the video signal processing device can apply a first weight to the first chrominance prediction block and a second weight to the second chrominance prediction block. The first weight and the second weight may be predefined integer values, for example, the first weight may be 3 and the second weight may be 13. The video signal processing device can add a chrominance error block to the third chrominance prediction block to ultimately generate a chrominance block (Cb, Cr) of the current block. An encoder can generate and signal a bitstream including information about the first weight and the second weight (or information indicating optimal weight values ​​of the first weight and the second weight).When the CCRM mode is applied to the current block, the decoder can parse the information about the weights (or information indicating the optimal weight values ​​of the first and second weights) and use it to predict the chrominance block of the current block.

[0323] Also, referring to FIG. 23, when the current block is applied with the inter coding mode, the video signal processing device can derive one or more CCP models using the motion information used to generate the prediction block for the current block, and use the CCP models to adaptively / selectively predict the chrominance block of the current block. The encoder can obtain and signal a bitstream including information on which model was used. The decoder can parse the information on which model was used and use the information to predict the chrominance block of the current block. When the current block is in the inter coding mode and bidirectional motion prediction is applied to the current block, the video signal processing device can derive the CCP model using the predicted luma block and chrominance block of the current block weighted-averaged through the bidirectional motion. Alternatively, when the current block is in the inter coding mode and bidirectional motion prediction is applied to the current block, the video signal processing device can derive the CCP model using the predicted luma block and chrominance block of the current block generated through the L0 or L1 motion. When bidirectional motion prediction is applied to the current block, the encoder can signal, in the bitstream, motion information indicating which motion information among L0 and L1 was used to derive the CCP model. The decoder can select one of the CCP models derived using L0 or L1, which is determined by parsing the motion information, and use it to generate a chrominance prediction block of the current block. Then, the decoder can add a chrominance error block to the generated chrominance prediction block to ultimately generate the chrominance block (Cb, Cr) of the current block. In order to reduce the amount of signaled bits, the encoder can use the quantization parameter information used in the L0 and L1 reference blocks and derive the CCP model using a reference block configured with better image quality, without signaling information indicating which motion information among L0 and L1 was used to derive the CCP model.The decoder can derive a CCP model using the quantization parameter information used in the L0 and L1 reference blocks and a reference block with a better image quality. Furthermore, the video signal processing device can derive a CCP model using a weighted average reference block (a luminance reference block and a chrominance reference block) using the L0 and L1 motion information.

[0324] When the current block is in inter encoding mode and bidirectional motion prediction is applied to the current block, the video signal processing device can derive a first CCP model using a first luminance prediction block and a first chrominance prediction block generated through L0 motion information, derive a second CCP model using a second luminance prediction block and a second chrominance prediction block generated through L1 motion information, and then generate a reconstructed luminance block of the current block using a luminance error block of the current block. The video signal processing device can apply (Apply filter) the first CCP model to the reconstructed luminance block of the current block to generate a third chrominance prediction block of the current block, and apply (Apply filter) the second CCP model to the reconstructed luminance block of the current block to generate a fourth chrominance prediction block of the current block. The first, second, third, and fourth weights can be set to the first, second, third, and fourth chrominance prediction blocks, respectively, and the weights can be averaged to generate a fifth chrominance prediction block. At this time, each of the first, second, third, and fourth weights may be integers with predefined values. The video signal processing device may add a chrominance error block to the fifth chrominance prediction block to ultimately generate a chrominance block (Cb, Cr) of the current block.

[0325] CCRM can be a method of predicting (reconstructing) the current block by deriving a CCP model using any one of CCCM, GL-CCCM, CCCM-ND, and GLM. If CCRM is applied to a reference block corresponding to the current block, the video signal processing device can apply the CCP model of the CCRM used in the reference block to the current block without deriving a CCP model for CCRM for the current block. In other words, the video signal processing device can apply the CCP model of the CCRM used in the reference block to the reconstructed luminance block of the current block to generate a chrominance prediction block of the current block.

[0326] When AMVP, merge, amvp-merge, Intra TMP, IBC, or merge-TM coding modes are applied to the current block, if an error signal exists in the luminance block of the current block, the encoder can generate and signal a bitstream including information on whether to apply CCRM to the current block, and the decoder can parse the information to determine whether to apply CCRM to the current block.

[0327] If at least one coding mode among OBMC, MHP, LIC, DMVR, BDOF, PROF, BCW, Affine, GPM, CIIP, IBC-GPM, IBC-CIIP, IBC-LIC is applied to the current block, the CCRM method may not be applied to the current block. If at least one coding mode among OBMC, MHP, LIC, DMVR, BDOF, PROF, BCW, Affine, GPM, CIIP, IBC-GPM, IBC-CIIP, IBC-LIC is applied to the current block, the encoder may not include in the bitstream and signal information related to the CCRM for the current block, and the decoder may not parse information related to the CCRM and set the CCRM to not be applied to the current block.

[0328] A video signal processing device can construct a reconstructed luminance block by adding an error signal for a luminance prediction block of a current block and a luminance block, and then construct a CCP model using a correlation between the reconstructed luminance block and the luminance prediction block. At this time, the CCP model can be one of CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF. The video signal processing device can apply the CCP model derived from the luminance block to a chrominance prediction block to generate a first chrominance prediction block to which the CCP model is applied. A final chrominance block can be generated by adding an error signal for the first chrominance prediction block and the chrominance block.

[0329] The video signal processing device can configure a reconstructed Cb chrominance block by adding an error signal for the Cb chrominance prediction block of the current block and the Cb chrominance block, and then configure a CCP model for the Cb chrominance block by using a correlation between the reconstructed Cb chrominance block and the Cb chrominance prediction block. At this time, the CCP model can be one of CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF. The video signal processing device can apply the CCP model derived from the Cb chrominance block to the Cr chrominance prediction block to generate a first Cr chrominance prediction block to which the CCP model is applied. The video signal processing device can generate a final Cr chrominance block by adding the error signal for the first Cr chrominance prediction block and the Cr chrominance block.

[0330] The CCRM method is a method used in inter-coding mode and can be effective for object boundary parts with a large amount of error signals. Since the object boundary parts have image characteristics separated based on the boundary, when a video signal processing device derives a CCP model using the CCRM method, CCP models such as MMLM and MM-CCCM that use two or more CCP models can be applied. When the CCRM is applied to the current block, the encoder can generate and signal a bitstream that includes information on whether two CCP models are used. When the CCRM is applied to the current block, the decoder can parse the information on whether two CCP models are used to determine whether two CCP models are used for the current chrominance block. At this time, when two CCP models are used, the decoder can generate the current chrominance prediction block using a CCP model such as MMLM, MM-CCCM, or MM-GLM.

[0331] Additionally, when the CCRM method is applied to the current block, the encoder can generate and signal a bitstream that includes information about which CCP model is used. The CCP model can be any one of CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF. When the CCRM method is applied to the current block, the decoder can parse the information about which CCP model is used and generate the current chrominance prediction block using the determined CCP model.

[0332] When the CCRM method is applied to the current block, the encoder can derive a CCP merge list, and generate and signal a bitstream containing index information for the optimal CCP model within the CCP merge list. When the CCRM method is applied to the current block, the decoder can parse the index information for the CCP model, and then generate the current chrominance prediction block using the CCP model indicated by the index information within the CCP merge list.

[0333] Additionally, when the CCRM method is applied to the current block, the encoder can signal information on whether to apply filtering to the chrominance block predicted by CCRM and include it in the bitstream. Here, the filtering method for the predicted chrominance block can be the filtering method described in Fig. 26. When the CCRM method is applied to the current block, the decoder can parse the information on whether to apply filtering to the predicted chrominance block and then determine whether to apply filtering to the current chrominance prediction block.

[0334] The CCRM method can be used to exploit not only the correlation between the luminance prediction block and the chrominance prediction block of the current block, but also the correlation between the luminance prediction block and the luminance restoration block.

[0335] FIG. 24 illustrates a method of utilizing the correlation between a luminance prediction block and a luminance restoration block according to one embodiment of the present invention.

[0336] When the inter-coding mode is applied to the current block, the video signal processing device may set the first luminance reference block (e.g., RefA in FIG. 24(a)) indicated by the motion information of the current block as the first luminance restoration block, and derive a CCP model using the first luminance restoration block and the second luminance reference block (e.g., RefB in FIG. 24(a)) indicated by the motion information of the first luminance restoration block. The video signal processing device may apply the derived CCP model to the first luminance reference block to generate a luminance prediction block of the current block. The video signal processing device may generate the luminance prediction block of the current block through a weighted average between the luminance prediction block of the current block and the first luminance reference block.

[0337] If the current block has an inter-coding mode applied and has bidirectional motion, the video signal processing device can derive a CCP model using a first luminance reference block indicated by the L0 motion information of the current block and a second luminance reference block indicated by the L1 motion information of the current block. The video signal processing device can generate a first luminance prediction block and a second luminance prediction block of the current block by applying the CCP model to the first luminance reference block and the second luminance reference block, respectively. The video signal processing device can generate the luminance prediction block of the current block through a weighted average between the first luminance prediction block and the second luminance prediction block and the first luminance reference block and the second luminance reference block. The method for generating a prediction block of the luminance block mentioned above can also be applied to chrominance components. That is, the video signal processing device can derive and apply a CCP model for each chrominance component.

[0338] If the current block is applied with inter coding mode and has bidirectional motion, the video signal processing device can derive a CCP model using a neighboring block adjacent to the current block (e.g., A in FIG. 24(b)) and a luminance prediction block for block A (e.g., RefA0, RefA1 in FIG. 24(b)). The video signal processing device can apply the CCP model to the luminance prediction block of the current block (e.g., Ref0, Ref1 in FIG. 24(b)) to generate a first luminance prediction block and a second luminance prediction block of the current block. The video signal processing device can generate a weighted luminance prediction block of the current block through a weighted average between the first luminance prediction block and the second luminance prediction block of the current block and the luminance prediction block of the current block. If the inter coding mode is applied and has bidirectional motion, the video signal processing device can apply the above-mentioned method for generating a prediction block of a luminance block to chrominance components. The CCP model can be derived and applied for each chrominance component.

[0339] Fig. 25 shows a downsampling filter and sample positions applied to a luminance block according to one embodiment of the present invention.

[0340] In the CCCM method of predicting a chrominance block based on a luminance block, a video signal processing device can apply various downsampling filters to reduce the resolution of the luminance block to that of the chrominance block to match the resolution difference between the luminance block and the chrominance block. The CCCM mode that applies the downsampling filters can be described as CCCM-MDF (CCCM with multiple downsampling filters).

[0341] Fig. 25(a) shows multiple downsampling filters that can be applied to a luminance block. Filtering using the H filter in Fig. 25(a) is filtering that considers the value of the current luminance sample position more important than the surrounding samples. Filtering using the G1, G2, and G3 filters in Fig. 25(a) may be filtering methods designed according to the gradient between adjacent samples. Filtering using the G1 filter may be filtering based on changes in the horizontal direction. Filtering using the G2 filter may be filtering based on changes in the vertical direction. Filtering using the G3 filter may be filtering based on changes in the diagonal direction. C in Fig. 25(b) represents the position of the current chrominance sample, and W, E, N, S, NW, NE, SW, and SE represent the positions of samples surrounding C.

[0342]

[0343] Mathematical expression 16 represents a calculation formula for deriving a chrominance sample using at least one of the down-sampled luminance samples obtained based on filtering using the H, G1, G2, and G3 filters of FIG. 25.

[0344] In Equation 16, P represents a nonlinear model and can be the square of the sample value at the corresponding location. In Equation 16, B can be half the maximum value of the current sample or an intermediate bit depth value. For 10-bit content, the value of B can be 512.

[0345] Model 1 of Equation 16 may be a mathematical formula for deriving a chrominance sample using a down-sampled luminance block obtained using four filters (using the H, G1, G2, and G3 filters of FIG. 25). Model 2 of Equation 16 may be a mathematical formula for deriving a chrominance sample using a down-sampled luminance block obtained using the H, G1 filters of FIG. 25. Model 3 of Equation 16 may be a mathematical formula for deriving a chrominance sample using a down-sampled luminance block obtained using the H, G3 filters of FIG. 25.

[0346] The encoder can select the optimal model among the three chrominance prediction blocks derived using Equation 16, and then signal information about which model is used to predict the current chrominance block by including it in the bitstream. At this time, the information about which model is used can be applied to the chrominance signal Cb and the chrominance signal Cr, respectively, on a block-by-block basis. The decoder can predict each chrominance block using the model determined by parsing the information about which model is used for each chrominance signal (Cb, Cr).

[0347] Alternatively, the encoder may select an optimal model from among the three chrominance prediction blocks derived through the above mathematical expression 16, and then signal information on which model to use when predicting the current chrominance blocks in an integrated manner for the chrominance signals (Cb, Cr) and include it in the bitstream on a block-by-block basis. The decoder may parse information on which model to use to generate the current chrominance prediction block and apply it equally to the current Cb chrominance block and the current Cr chrominance block to generate the chrominance prediction block.

[0348] When two CCCM models are used in the current block, the video signal processing device can derive the two models based on the average value of the down-sampled luminance block generated through filtering using the H filter of Fig. 25(a).

[0349] Figure 26 shows coefficients of filtering applied to a prediction block and filtered positions according to one embodiment of the present invention.

[0350] The decoder can perform filtering using the chrominance prediction block generated by applying the CCP model and the surrounding chrominance samples of the restored current block to generate a filtered chrominance prediction block. At this time, the video signal processing device can filter the current chrominance prediction block using the filtering coefficients of FIG. 26(a).

[0351] In addition, the video signal processing device may configure the surrounding samples of the current chrominance prediction block using restored samples adjacent to the current chrominance block, and configure the unrestored portion by padding the boundary samples of the current chrominance prediction block, as shown in Fig. 26(b), in order to apply filtering to all sample positions of the current chrominance prediction block.

[0352] An encoder can obtain and signal a bitstream containing information on whether filtering is performed. A decoder can parse the information on whether filtering is performed to determine whether to apply filtering to the current chrominance block. Filtering can be applied block-by-block. That is, filtering can be applied to the current luma block, the Cb chrominance block, and the Cr chrominance block. In this case, the same filtering may be applied to the current Cb chrominance block and the Cr chrominance block.

[0353] If the current block is in the GLM coding mode or in the CCLM mode in which an offset is additionally transmitted, filtering may not be applied to the current block. That is, if the current block is in the GLM coding mode or in the CCLM mode in which an offset is additionally transmitted, the encoder may not include in the bitstream information on whether filtering is performed on the current chrominance block. If the current block is in the GLM coding mode or in the CCLM mode in which an offset is additionally transmitted, the decoder may not parse information on whether filtering is performed on the current chrominance block and may determine that filtering is not applied to the current chrominance block.

[0354] Figure 27 illustrates filtering applied to a prediction block according to one embodiment of the present invention.

[0355] The video signal processing device can generate a filtered chrominance prediction block using the filtering of FIG. 27(a) or FIG. 27(b) on the current chrominance prediction block. In addition, the video signal processing device can perform multiple filters on the current chrominance prediction block and then generate a final filtered chrominance prediction block by weighting and averaging the filtered chrominance prediction blocks.

[0356] An encoder can obtain and signal a bitstream containing information about what filtering has been applied to the current chrominance block, and a decoder can parse the information to determine the filtering and generate a filtered chrominance prediction block using the determined filtering for the current chrominance block.

[0357] Figure 28 illustrates a method for determining a CCP mode based on a template cost according to one embodiment of the present invention.

[0358] The CCP encoding efficiency may vary depending on the reference region used to derive the CCCM model. For example, the chrominance prediction blocks using the CCCM models derived using reference regions A and B in Fig. 28(a) may be different from each other. The encoder may generate and signal a bitstream including position information for the optimal reference region for deriving the CCCM model used to predict the current chrominance block. The decoder may parse the position information to determine the reference region and derive the CCCM model used to predict the current chrominance block using the determined reference region. At this time, the method for deriving the CCCM model may also be used to derive models of CCCM-LT, CCCM-L, and CCCM-T modes. CCCM-LT mode is a mode that derives a CCCM model using both the left reference region and the upper reference region of the current block, CCCM-L is a mode that derives a CCCM model using the left reference region of the current block, and CCCM-T is a mode that derives a CCCM model using the upper reference region of the current block.

[0359] In order to reduce the amount of signaling bits, an optimal reference region can be derived based on a template. The video signal processing device can construct a reference template as shown in Fig. 28(c) using reconstructed surrounding samples adjacent to the current chrominance block. The size of the reference template above the current block can be configured by the horizontal length and height M of the current block, and the size of the reference template on the left side of the current block can be configured by the vertical length and width N of the current block. At this time, M and N can be integers greater than or equal to 1, and can be the same or different, for example, can be 1. At this time, the size of the reference template can be determined based on any one of the horizontal and vertical sizes of the current block or the number of samples of the current block. The video signal processing device can generate a prediction sample for the reference template position using a CCCM model derived using various reference regions. The video signal processing device can calculate a cost between the reconstructed sample of the reference template and the prediction sample generated using the CCCM model derived from each reference region, and then determine the reference region with the minimum cost as the final reference region. Alternatively, the encoder can construct a reference region list using each reference region information, then reorder the reference region list based on each calculated cost, and then generate and signal a bitstream including index information on which reference region to use. The decoder can then parse the index information and derive a CCCM model used to predict the current chrominance block using the reference region indicated by the index information in the reordered reference region list. The template-based reference region determination method can be used to derive an optimal template form among three template forms (CCCM-LT, CCCM-L, and CCCM-T templates).

[0360] MM-CCCM (Multi-Model CCCM) is a method for predicting a chrominance block by deriving two CCCM models based on the average value of luminance samples calculated from a reference region. At this time, the average value may vary depending on the region in which it is calculated, and the MM-CCCM model may vary depending on the average value. The encoder can calculate the average value to derive the optimal MM-CCCM model using at least one of the reference region A of Fig. 28(a), the reference region B, the currently reconstructed luminance block region, the reference region indicated by the block vector (BV) of the current block, and the reference region indicated by the motion vector (MV) of the current block. In addition, the encoder can generate and signal a bitstream including information on which region was used to calculate the average value (average value calculation region information). The decoder can parse the mean value calculation region information when the current chrominance block is predicted using the MM-CCCM model, and use it to derive the MM-CCCM used to predict the current chrominance block based on the determined region.

[0361] In order to reduce the amount of signaled bits, an area for calculating an optimal average value can be derived based on a template. A video signal processing device can construct a reference template as shown in Fig. 28(c) using reconstructed surrounding samples adjacent to a current chrominance block. The video signal processing device can obtain average values ​​calculated using reference area A or reference area B of Fig. 28(a), the current reconstructed luminance block area of ​​Fig. 28(b), the reference area indicated by the BV of the current block, and the reference areas indicated by the MV of the current block. The video signal processing device can generate a prediction sample for the reference template position using the MM-CCCM model derived based on the obtained average value. The video signal processing device can calculate a cost between the reconstructed sample of the reference template and the prediction sample generated using each MM-CCCM model, and then determine the average value calculation area used to derive the MM-CCCM model with the minimum cost as a final average value calculation area. The encoder can construct a list of average computation regions using the region information used for average computation, and then reorder the list of average computation regions based on each calculated cost. The encoder can then generate and signal a bitstream containing indices for the used average computation regions. The decoder can then parse the index information and derive the MM-CCCM model used to predict the current chrominance block using the average computation region indicated by the index information in the reordered average computation region list. This can also be applied to CCCM-LT, CCCM-L, and CCCM-T modes.

[0362] A video signal processing device can generate a final chroma prediction block by calculating a weighted average between a block predicted using an intra prediction directional mode and a block predicted using a CCP model, which can be referred to as a chroma fusion mode. At this time, a more effective model among CCLM or CCCM can be applied to a block predicted using the LM mode. An encoder can generate and signal a bitstream including information about the CCP model used to predict the current chroma block. A decoder can generate a chroma prediction block based on a model determined by parsing the model information if the current chroma block is encoded using the chroma fusion mode.

[0363] To reduce the amount of signaling bits, an optimal CCP model can be derived based on a template. A video signal processing device can construct a reference template using reconstructed neighboring samples adjacent to a current chrominance block, as shown in FIG. 28(c). Then, the video signal processing device can generate prediction samples for the reference template position using the CCP model. Then, the video signal processing device can calculate the cost between the reconstructed samples of the reference template and the prediction samples generated using the CCP model, and then determine a CCP model with the minimum cost. Then, the video signal processing device can predict the current chrominance block based on the determined CCP model. This can also be applied to CCCM-LT, CCCM-L, and CCCM-T modes.

[0364] The method of determining the CCP mode based on the template described through Figure 28 can be called the Local-Boosting CCP (LB-CCP) model.

[0365] FIG. 29 illustrates surrounding blocks used to derive CCCM for a current chrominance block according to one embodiment of the present invention.

[0366] Fig. 30 shows a reference area indicated by a block vector of a current luminance block according to one embodiment of the present invention.

[0367] The CCCM used to predict the current chrominance block can be derived from the neighboring blocks of the current block, which can be called the CCP merge mode. Fig. 29 shows neighboring blocks A0, A1, B0, B1, and B2 adjacent to the current block and neighboring blocks A0', A1', B0', B1', and B2' not adjacent to the current block. The video signal processing device can use the CCCM model used in the neighboring blocks of Fig. 29 to predict the current chrominance block. Alternatively, if the current block is encoded in Intra TMP or IBC mode, the video signal processing device can generate a prediction block for the current chrominance block by using the CCCM model used in the reference region indicated by the BV of the current luminance block and the currently reconstructed luminance block, as shown in Fig. 30.

[0368] The types (kinds) of CCP models can include CCLM, MMLM, GLM, MM-GLM, CCCM, MM-CCCM, GL-CCCM, MM-GL-CCCM, CCCM-ND, MM-CCCM-ND, CCCM-MDF, MM-CCCM-MDF, chroma fusion, BVG-CCCM, CCP merge, etc. An MMLM can be composed of two CCLMs. If the types of CCP models between CCP models are different, they can be said to be different CCP models. If the types of CCP models between CCP models are the same but the parameters between CCP models are different, they can be said to be different CCP models. If the number of CCP models between CCP models is different (for example, the first CCP model is composed of one CCLM, and the second CCP model is composed of two CCLMs), they can be said to be different CCP models.

[0369] FIG. 31 is a structural diagram illustrating a method for predicting a current block using CCP merge mode according to one embodiment of the invention.

[0370] Figure 32 shows surrounding blocks of a current block according to one embodiment of the present invention.

[0371] Figures 33 and 34 illustrate co-located blocks and surrounding blocks according to one embodiment of the present invention.

[0372] First, the video signal processing device can configure a CCP merge list for the current block. At this time, the CCP merge list can include a maximum preset number of candidates. For example, the maximum preset number can be 12. A CCP model used in at least one of the neighboring blocks spatially adjacent to the current block (neighboring blocks A0, A1, B0, B1, B2 of FIG. 32), neighboring blocks that are not spatially adjacent but are far away (neighboring blocks 1A0, 1A1, 1B0, 1B1, 1B2, …, NA0, NA1, NB0, NB1, NB2 of FIG. 32), and temporal neighboring blocks corresponding to the current block from other reference pictures that are not identical to the POC of the current picture can be included as CCP model candidates in the CCP merge list. The positions of spatially non-adjacent and distant neighboring blocks can be determined based on at least one of the horizontal length of the current block, the vertical length of the current block, the ratio of the horizontal length to the vertical length of the current block, the quantization parameters of the current block and the neighboring blocks, the encoding mode of the current block, information on whether the current block is encoded in Intra TMP or IBC mode, the block vector of the current block, and pre-specified positions. For example, the vertical positions of the neighboring blocks 1B0, 1B1, and 1B2 in FIG. 32 can be positions that are offset from the top boundary of the current block by the height of the current block. The horizontal positions of the neighboring blocks 1A0, 1A1, and 1B2 in FIG. 32 can be positions that are offset from the left boundary of the current block by the width of the current block. The neighboring block 1A1 can be located at a pre-defined position between 1A0 and 1B2, and the neighboring block 1B1 can be located at a pre-defined position between 1B2 and 1B0. Additionally, the vertical positions of the surrounding blocks NB0, NB1, and NB2 of FIG. 32 may be positions that are offset by a predefined distance from the upper boundary of the current block.The horizontal positions of the neighboring blocks NA0, NA1, and NB2 in Fig. 32 may be positions that are offset by a predefined distance from the left boundary of the current block. The neighboring block NA1 may be located at a predefined location between NA0 and NB2, and the neighboring block NB1 may be located at a predefined location between NB2 and NB0. The predefined distance may be an integer greater than or equal to 1. In addition, CCP models derived from neighboring blocks that are not spatially adjacent but far apart may be added as CCP model candidates to the CCP merge list. At this time, the order of addition may be determined based on at least one of the quantization parameter of the current block and the distance between the current block and the neighboring blocks. For example, neighboring blocks may be added in order from neighboring blocks that are farther away from the current block to neighboring blocks that are near the current block to neighboring blocks that are farther away from the current block. The neighboring blocks may be referred to as reference blocks for deriving a CCP model for the current block.

[0373] If the CCP merge list is not filled, the video signal processing device can add the CCP model used in the temporal neighboring block (the neighboring block corresponding to the current block from another reference picture that is not identical to the POC of the current picture, the neighboring block of the block co-located with the current block) as a CCP model candidate to the CCP merge list. When deriving the CCP model candidate of the temporal neighboring block, the video signal processing device can deriv the CCP model candidate from various predefined positions according to the horizontal and vertical sizes of the current block. In addition, the video signal processing device can deriv the CCP model candidate of the temporal neighboring block by a predefined number. The predefined number can be 4. For example, referring to FIG. 33, the video signal processing device can deriv the CCP model candidate from the positions BR0, Ctr0, BR1, and Ctr1 based on the horizontal and vertical sizes of the current block. If a predefined number of CCP model candidates are not filled, the video signal processing device can derive CCP model candidates from positions BR0, Ctr0, BR1, and Ctr1 based on twice the width and height of the current block. This process can be repeated up to N times the width and height of the current block until a predefined number of CCP model candidates are filled. In this case, N can be 5.

[0374] Also, referring to FIG. 34, the positions for inducing temporal surrounding blocks can be set in the anti-diagonal direction. The video signal processing device can induce CCP model candidates from positions BR0, Ctr0, BR1, and Ctr1 based on the horizontal and vertical sizes of the current block. If the predefined number of CCP model candidates is not filled, the video signal processing device can induce CCP model candidates from positions BR0, BR1, Ctr0, and Ctr1 based on twice the horizontal and vertical sizes of the current block. The predefined number can be 4. This process can be repeated up to N times the horizontal and vertical sizes of the current block until the predefined number of CCP model candidates are filled. In this case, N can be 5.

[0375] The video signal processing device may use at least one of encoding mode information, motion vector information, and block vector information of the temporal neighboring block to determine the usability of a CCP model candidate for the temporal neighboring block or to determine whether to add the CCP model candidate for the temporal neighboring block to a CCP merge list. For example, if the temporal neighboring block is of the RRIBC type, the video signal processing device may not use it as a CCP model candidate and may not add it to the CCP merge list.

[0376] If the CCP merge list is not filled, the video signal processing device can add a CCP model derived from a CCP model table stored in a separate memory as a CCP model candidate to the CCP merge list. At this time, the video signal processing device can extract CCP model candidates in order from the CCP model added to the CCP model table first to the CCP model added last and add them to the CCP merge list. Alternatively, the video signal processing device can extract CCP model candidates in order from the CCP model added to the CCP model table last to the CCP model added first and add them to the CCP merge list. A CCP model candidate derived from a CCP model table stored in a separate memory can be referred to as a HCCP (History-based CCP) candidate. The CCP model table can be constructed from previously used CCP models. In addition, the video signal processing device can determine whether to add a previously used CCP model to the CCP model table by using at least one of whether the block is encoded in dual tree mode, whether the block is encoded in ISP mode, whether the block is encoded in intra mode, whether the block is encoded with DIMD chroma, whether the block is encoded in DM mode, whether a CCP model already exists in a CCP model table, and whether the block is encoded in chroma fusion mode. The CCP model table can be reset when encoding or decoding of each slice starts, when encoding or decoding of the first CTU of each CTU row starts, and when reset, the CCP model table can be emptied. A FIFO (First In First Out) method can be applied in which CCP models exit the CCP model table in the order in which they are added to the CCP model table.When adding a new CCP model to the CCP model table, the video signal processing device can check whether the new CCP model exists in the CCP model table, and if the new CCP model does not exist in the CCP model table, the new CCP model can be added to the CCP model table. In addition, when adding a new CCP model to the CCP model table, if the CCP model table is completely filled, the first added CCP model can be deleted and the new CCP model can be added to the CCP model table.

[0377] If the CCP merge list is not filled, the video signal processing device can generate a combined CCP model candidate or a separated CCP model candidate using the CCP models (e.g., CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, CCCM-MDF) in the CCP merge list and add the generated combined CCP model candidate to the CCP merge list. At this time, the combined CCP model candidate may be one CCP model candidate obtained using two CCP model candidates in the CCP merge list. The combined CCP model based on the CCLM may be CCLM + GLM, CCLM + CCCM, CCLM + GL-CCCM, CCLM + CCCM-ND, CCLM + CCCM-MDF, etc. In addition, the combined CCP model based on the GLM may be GLM + CCCM, GLM + GL-CCCM, GLM + CCCM-ND, GLM + CCCM-MDF, etc. In addition, the combined CCP model based on CCCM can be CCCM + GL-CCCM, CCCM + CCCM-ND, CCCM + CCCM-MDF, etc. In addition, the combined CCP model based on GL-CCCM can be GL-CCCM + CCCM-ND, GL-CCCM + CCCM-MDF, etc. In addition, the combined CCP model based on CCCM-ND can be CCCM-ND + CCCM-MDF, etc. For example, in order to predict the current chrominance block using the CCCM-ND + CCCM-MDF candidate, the video signal processing device can divide the current luminance block into two regions based on a predefined threshold, and then predict the current chrominance sample using the CCCM-ND mode in one region, and predict the current chrominance sample using the CCCM-MDF mode in the other region, and then generate the final chrominance block. The predefined threshold can be an average value of surrounding luminance samples adjacent to the current luminance block or an average value of the current luminance block.The split CCP model candidates may be two CCP model candidates split from one CCP model candidate in the CCP merge list. Alternatively, the split CCP model candidates may be two CCP model candidates newly generated based on two CCP model candidates split from one CCP model candidate in the CCP merge list. For example, if one CCP model candidate in the CCP merge list is a CCP model that is a combination of two CCP models, such as MMLM or MM-CCCM, the combined CCP model may be split into two CCLMs or two CCCMs, and the new CCP model candidates generated based on the two split CCP models may be split CCP model candidates and added to the CCP merge list.

[0378] If the CCP merge list is not filled, the video signal processing device can check whether a CCLM (or an MMLM) exists in the CCP merge list, and then add a new CCP model candidate to the CCP merge list based on the presence of the CCLM (or the presence of the MMLM). For example, if a CCLM (or MMLM) exists in the CCP merge list, the video signal processing device can regenerate a new CCLM (or MMLM) based on the CCLM (or MMLM) in the CCP merge list and add the new CCLM (or MMLM) to the CCP merge list. At this time, the video signal processing device can regenerate the new CCLM (or MMLM) using only one CCLM (or MMLM) in the CCP merge list and add the new CCLM (or MMLM) to the CCP merge list. Alternatively, the video signal processing device can regenerate the new CCLM or the new MMLM using all CCLMs and MMLMs in the CCP merge list and add the new CCLM or the new MMLM to the CCP merge list. Specifically, the video signal processing device can separate the MMLM in the CCP merge list into two CCLMs and add the two CCP model candidates obtained by separating them into the CCP merge list. Furthermore, the video signal processing device can configure the two CCLMs in the CCP merge list into one MMLM and add the same to the CCP merge list. Furthermore, the video signal processing device can configure one CCLM through a weighted average of parameter values ​​of the two CCLMs in the CCP merge list and add the same to the CCP merge list. Alternatively, the video signal processing device can separate the MMLM in the CCP merge list into two CCLMs and then add two new CCLMs obtained by using each CCLM as CCP model candidates.In addition, the video signal processing device can obtain one MMLM through two new CCLMs obtained using each of the two CCLMs in the CCP merge list and add them to the CCP merge list. For example, if one CCP model in the CCP merge list is a CCP model that is a combination of two CCP models, such as MMLM and MM-CCCM, the video signal processing device can separate the combined CCP model into two CCLMs or two CCCMs, and then create a new CCP model based on the separated two CCLMs or two CCCMs and add the new CCP model to the CCP merge list.

[0379] A video signal processing device can generate a new CCP model based on the CCP model candidates in the CCP merge list. The CCP model used to generate the new CCP model may be a specific CCP model. Accordingly, the video signal processing device can verify whether the CCP model candidate in the CCP merge list is a specific CCP model. The specific CCP model may be a CCLM, MMLM, or the like.

[0380] Figure 35 illustrates a CCLM depicted in graph form according to one embodiment of the present invention.

[0381] CCLM may be a CCP model that derives a chrominance sample by multiplying a luminance sample by a slope value (a in Fig. 35(a)) and then adding an offset value (b in Fig. 35(a)).

[0382] The video signal processing device can obtain a new CCP model by adding a predefined value (u in Fig. 35(b)) to the slope value of CCLM or MMLM in the CCP merge list.

[0383] The slope value (a') and offset value (b') for the new CCP model can be calculated using Equation 17.

[0384]

[0385] In this specification, u in mathematical expression 17 can be expressed as a predefined first value. In addition, u can be an integer value, for example, -6, -5, ..., 5, 6. yr in mathematical expression 17 is an average value, which can be the average value of the current luminance block, the average value of the surrounding luminance blocks, or half the bit depth used to express the current luminance sample (for example, 512 if the content is 10 bits).

[0386] A CCP model may include a Cb CCP model and a Cr CCP model. The video signal processing device may generate a new Cb CCP model by adding a predefined first value to a slope value of the Cb CCP model. In addition, the video signal processing device may generate a new Cr CCP model by adding a predefined first value to a slope value of the Cr CCP model. In addition, when the u value is 0, the new CCP model is identical to the existing CCP model, and therefore, the video signal processing device may exclude the case where the u value is 0 when generating a new CCP model based on a CCLM or MMLM in the CCP merge list. That is, the case where the u value is 0 may not be added to the CCP merge list. Alternatively, the video signal processing device may not add the new CCP model to the CCP merge list when a' of the new CCP model is 0.

[0387] A video signal processing device can apply a new CCP model generated based on a CCLM or MMLM in a CCP merge list to only one of the Cb and Cr chrominance components. For example, the new CCP model can include a Cb CCP model and a Cr CCP model. The video signal processing device can generate a new Cb CCP model by adding a predefined first value to a slope value of the Cb CCP model without changing the Cr CCP model. Alternatively, the video signal processing device can generate a new Cr CCP model by adding a predefined second value to a slope value of the Cr CCP model without changing the Cb CCP model. Here, the predefined first value and the second value may be the same or different, and for example, the first value and the second value may be -6, -5, ..., 5, 6, respectively.

[0388] If there is no CCLM or MMLM in the CCP merge list, the video signal processing device can add a CCP model candidate using a predefined CCLM or MMLM to the CCP merge list. The slope value of the predefined CCLM can be an integer, for example, -6, -5, ..., 5, 6. The offset value of the predefined CCLM can be half the bit depth used to represent the current luminance sample (for example, 512 in case of 10-bit content).

[0389] When a new CCP model candidate is added to the CCP merge list, the video signal processing device can check whether the new CCP model candidate already exists in the CCP merge list. If the new CCP model candidate already exists in the CCP merge list, the new CCP model candidate may not be added to the CCP merge list. If the new CCP model candidate does not exist in the CCP merge list, the new CCP model candidate may be added to the CCP merge list. At this time, the video signal processing device can check whether the new CCP model candidate already exists in the CCP merge list by using at least one or more of the type (or type) of the CCP model, information on the upper left position of the block from which the CCP model is derived, parameter information of the CCP model, information on the luminance offset value of the CCP model, information on the average value of the luminance block of the CCP model, information on whether the CCP model type of the new CCP model candidate already exists in the CCP merge list, and information on whether MMLM exists in the CCP merge list. A video signal processing device can check the identity of the CCP models by comparing the parameters of the new CCP model candidate with the parameters of the CCP models already existing in the CCP merge list. For example, if the parameters are identical, the video signal processing device can determine that the CCP models are identical. For example, a method for the video signal processing device to check whether the new CCP model candidate already exists in the CCP merge list can check the identity of the CCP model candidates by comparing all parameters of the new CCP model with all parameters of all CCP candidates in the CCP merge list.Alternatively, the method for a video signal processing device to check whether a new CCP model candidate already exists in a CCP merge list may be performed by comparing a predefined number of parameters among all parameters of the new CCP model with a predefined number of parameters among all parameters of all CCP candidates in the CCP merge list to check the identity of the CCP model candidates. At this time, the predefined number may be an integer greater than or equal to 1. Alternatively, the method for a video signal processing device to check whether a new CCP model candidate already exists in a CCP merge list may be performed by comparing the first three parameters among all parameters of the new CCP model with the first three parameters among all parameters of all CCP candidates in the CCP merge list to check the identity of the CCP model candidates. Alternatively, the method for a video signal processing device to check whether a new CCP model candidate already exists in a CCP merge list may be performed by checking the identity of the CCP model candidates by checking whether the upper left position information of a block from which a new CCP model is derived and the upper left position information of a block from which each CCP candidate is derived in the CCP merge list are the same or similar. The video signal processing device may determine that the new CCP model is similar if the absolute value of the difference between the upper left position information of the block from which the new CCP model is derived and the upper left position information of the block from which each CCP candidate is derived in the CCP merge list is less than a predefined value. The predefined value may be an integer greater than or equal to 1.

[0390] Among the CCP model candidates, the upper left position information of the block from which the HCCP (History-based CCP) and the predefined CCP model are derived may not exist. That is, when a new CCP model candidate composed of the HCCP and the predefined CCP model is checked for identity with the CCP model candidates in the CCP merge list, the upper left position information of the block cannot be used. Therefore, the video signal processing device may not perform a check for whether the upper left position information of the block is identical for the HCCP and the predefined CCP model candidates. Specifically, when the video signal processing device generates a prediction block of a chroma block using the HCCP and the predefined CCP model, when storing the CCP model for the current chroma block, the upper left position information of the block may be stored as (0, 0) or (-1, -1). When checking whether a new CCP model candidate exists in the CCP merge list, the video signal processing device may not perform a checking process using the upper left position information if the upper left candidate position value of the block for the new CCP model candidate is (0, 0) or (-1, -1).

[0391] Alternatively, when the encoder and decoder generate a prediction block using the HCCP and a predefined CCP model for the chrominance block, when storing the CCP model for the current chrominance block, the upper left position information of the current block can be stored in the upper left position information of the block.

[0392] When a video signal processing device adds a new CCP model to a CCP merge list, it may add only one CCP model type per CCP model type to the CCP merge list. In other words, the types of each CCP model in the CCP merge list may not be identical, except for the HCCP model or a predefined CCP model.

[0393] FIG. 36 illustrates reference template locations used to rearrange a CCP merge list according to one embodiment of the present invention.

[0394] A video signal processing device can construct a CCP merge list and reorder the CCP merge list based on a template cost. Whether the reordering process is performed can be determined based on the horizontal and / or vertical dimensions of the current block.

[0395] Additionally, the template for reordering the CCP merge list can be determined based on the width and / or new size of the current block. For example, if the width of the current block is greater than the height, the top template adjacent to the top of the current block can be used for reordering the CCP merge list. If the width and height of the current block are equal, the templates of FIG. 36 (the top template adjacent to the top of the current block and the left template adjacent to the left of the current block) can be used for reordering the CCP merge list.

[0396] A video signal processing device can construct a reference template using reconstructed surrounding samples adjacent to a current block, such as in FIG. 36. The video signal processing device can predict a chrominance sample of the reference template using each CCP model in the CCP merge list and a luminance sample of the reference template to generate a chrominance prediction sample. The video signal processing device can generate a cost by calculating a SAD (or MR-SAD) between the chrominance prediction sample and the chrominance sample of the reference template. The video signal processing device can calculate a cost for each CCP model and rearrange the CCP merge list in ascending order of the cost.

[0397] The encoder can select an optimal CCP model for the current chrominance block based on the reordered CCP merge list, and generate and signal a bitstream including index information indicating the optimal CCP model. The decoder can parse the index information and generate a prediction block for the current chrominance block using the CCP model indicated by the index information in the reordered CCP merge list.

[0398] When the optimal CCP model selected from the rearranged CCP merge list is used for the prediction of the current chrominance block, the video signal processing device can derive compensation values ​​for some of the CCP models and then apply the compensation values ​​to the chrominance blocks predicted using the CCP models. Some of the CCP models can be any one of CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF. For example, when the optimal CCP model selected from the rearranged CCP merge list is CCCM, the video signal processing device can construct a reference template using reconstructed neighboring samples adjacent to the current block. The video signal processing device can predict the chrominance samples of the reference template by applying CCCM to the luminance samples of the reference template and generate the chrominance prediction samples. The video signal processing device can calculate an average value between the chrominance prediction samples and the chrominance samples of the reference template and use the average value as the compensation value. The compensation value can be at least one of a compensation value for a Cb chrominance block and a compensation value for a Cr chrominance block. In addition, when the optimal CCP model is a two-model model such as MMLM, MM-CCCM, etc., two compensation values ​​for the Cb chrominance block and two compensation values ​​for the Cr chrominance block can be used as compensation values. When the optimal CCP model is CCCM, the video signal processing device can apply CCCM to the currently reconstructed luminance block to predict the current chrominance block, and then add the derived compensation values ​​to the chrominance prediction block to generate a final chrominance prediction block. The video signal processing device can determine whether a compensation value is derived by using at least one of the horizontal and vertical sizes of the current block, the encoding mode of the current luminance block, and the type of the CCP model. For example, if the horizontal and vertical sizes of the current block are smaller than a predefined number, the compensation value may not be derived.Alternatively, if the width and height of the current block are greater than a predefined number, the reward value may not be derived. The predefined number may be an integer greater than or equal to 1, and may be the product of the width and height of the current block. For example, the predefined number may be 16.

[0399] The CCP model for the current block used to predict the chrominance block in the current block can be stored for encoding and decoding the next block, and can be stored in the CCP model table for use as an HCCP candidate. If the video signal processing device has derived a CCP model for predicting the chrominance block of the current block through the CCP merge method, the CCP model used to predict the current chrominance block can be stored. The video signal processing device can use the stored CCP model information to construct a CCP merge list of the next block.

[0400] When a CCP merge list for a current chrominance block is configured, the video signal processing device may use at least one of encoding mode information of the current luminance block, motion vector information of the current luminance block, block vector information of the current luminance block, transform coefficient information of the current luminance block, and quantization parameter information of the current luminance block to determine whether to add a predefined CCP model to the CCP merge list. For example, when the encoding mode of the current luminance block is the GPM mode, the video signal processing device may not add a CCP candidate (e.g., CCLM, CCCM, etc.) that uses only one CCP model to the CCP merge list when configuring the CCP merge list, but may add a CCP candidate (e.g., MMLM, MM-CCCM, etc.) that uses two CCP models to the CCP merge list.

[0401] When a video signal processing device stores CCP model parameters for a current block in memory, the CCP model parameters may be stored with their values ​​scaled down to reduce memory usage. The video signal processing device may use the stored CCP model parameters to predict a chrominance block after increasing the scale of the values ​​of the CCP model parameters when using the stored CCP model parameters. The scale reduction and increase processes may be processed by quantization and dequantization methods. Alternatively, the scale reduction and increase processes may be processed through a shift operation using a predefined integer value, and the predefined integer may be an integer greater than or equal to 1. For example, if the predefined integer value is 4, the scale reduction operation may be 'P>> 4', and the scale increase operation may be 'P<< 4'. P may be any one of the CCP model parameters. The shift operation A>>B means dividing A by 2 B times, and "A< <B"는 A를 B번 2로 곱하는 것을 의미한다.

[0402] A CCP merge list can be configured integrally for two chrominance signals. That is, one CCP model candidate in the CCP merge list can include a CCP model for a Cb chrominance block and a CCP model for a Cr chrominance block. An encoder can generate and signal a bitstream including information on whether to apply a CCP merge method to a current chrominance block and index information indicating an optimal CCP model for the current chrominance block among the CCP models in the CCP merge list, and a decoder can parse the information on whether to apply a CCP merge method to the current chrominance block, and if the CCP method is applied to the current chrominance block, can parse the index information, and generate a Cb prediction block and a Cr prediction block for the current chrominance block using the CCP model indicated by the index information in the CCP merge list.

[0403] In addition, the CCP merge list can be independently applied to each chrominance signal. That is, the CCP merge list for the Cb chrominance block (Cb CCP merge list) and the CCP merge list for the Cr chrominance block (Cr CCP merge list) can be independently generated, and the Cb CCP merge list and the Cr CCP merge list can be different from each other. The encoder can generate and signal a bitstream including information on whether the CCP merge method is applied to the current Cb chrominance block, index information indicating an optimal CCP model index for the Cb chrominance block, information on whether the CCP merge method is applied to the current Cr chrominance block, and index information indicating an optimal CCP model index for the Cr chrominance block, by configuring a merge list for each chrominance signal. The decoder can parse information on whether a CCP merge method is applied to a current Cb chrominance block, and if the CCP merge method is applied to the current Cb chrominance block, can parse index information indicating an optimal CCP model index for the Cb chrominance block, and can generate a Cb chrominance prediction block based on the CCP model indicated by the index information. In addition, the decoder can parse information on whether a CCP merge method is applied to a Cr chrominance block, and if the CCP merge method is applied to the current Cr chrominance block, can parse index information indicating an optimal CCP model index for the Cr chrominance block, and can generate a Cr chrominance prediction block based on the CCP model indicated by the index information.

[0404] Information about each CCP model in the above CCP merge list may include at least one of the type (or type) of the CCP model, parameter coefficients for the CCP model, coordinate information of the block from which the CCP model is derived, average value, luminance offset value, encoding mode information, and quantization parameters.

[0405] A video signal processing device can construct a CCP merge list based on information about the CCP models used in neighboring blocks of the current block. This may be due to the correlation of the CCP models between the neighboring blocks and the current block. If the correlation between the current block and neighboring blocks is low, the encoding efficiency of the method of deriving a CCP model through a CCP merge list may be low. Therefore, information about which CCP model was used can be signaled on a block-by-block basis. However, if there are many types of CCP models, the amount of bits that must be signaled may increase. To solve this problem, the encoder can construct an explicit CCP list and then generate and signal a bitstream that includes index information about the types of CCP models used in the current block within the explicit CCP list.

[0406] Since the CCP model in the CCP merge list is a CCP model used in a neighboring block, it may not be suitable for predicting the current chrominance block. Therefore, the video signal processing device can predict the current chrominance block by re-deriving the CCP model parameters through neighboring blocks adjacent to the current chrominance block. That is, the video signal processing device can newly derive the parameters for the CCP model through neighboring blocks (or samples) adjacent to the current block using only the type (or kind) of the CCP model in the optimal CCP model derived from the CCP merge list (or explicit CCP list). The video signal processing device can predict the current chrominance block using the parameters for the newly derived CCP model. The encoder can generate and signal a bitstream including selection information on whether to use the newly derived CCP model or the CCP model derived from the CCP merge list. The decoder can predict the current chrominance block using the CCP model determined by parsing the selection information.

[0407] The video signal processing device can rearrange the CCP merge list using at least one of the CCP model information of the neighboring blocks adjacent to the current block, the encoding mode of the reconstructed luminance block, the encoding mode of the reconstructed luminance block, and the horizontal and vertical sizes of the current block. For example, if the type (or kind) of the CCP model of the neighboring blocks adjacent to the current block is CCCM, the video signal processing device can change the order of the CCP model of the CCCM type in the CCP merge list to be positioned first in the list. Alternatively, if the encoding mode of the reconstructed current luminance block is a divided encoding mode such as GPM or SGPM, the video signal processing device can change the order of the CCP model of the GLM or GL-CCCM type in the CCP merge list to be positioned first in the list. Alternatively, the video signal processing device may change the order of CCP models of the MMLM, MM-CCCM, MM-GLM, MM-GL-CCCM, and MM-CCCM-ND types, which use two CCP models in the CCP merge list, to be positioned at the beginning of the list when the encoding mode of the restored current luminance block is a split encoding mode such as GPM or SGPM. Alternatively, the video signal processing device may change the order of the types (or kinds) of CCP models so that the type of CCP model with generally superior encoding efficiency is positioned at the top of the list.

[0408] Since there are various types of CCP models, the amount of bits required to signal information about the CCP model used in the current chrominance block may be large. To reduce this amount of bits, a video signal processing device can construct an explicit CCP list and then select a CCP model for the current chrominance block from the explicit CCP list. Specifically, an encoder can construct an explicit CCP list and then generate and signal a bitstream including index information for an optimal CCP model. A decoder can parse the index information and generate a prediction block of the current chrominance block using the CCP model indicated by the index information in the explicit CCP list. The video signal processing device can rearrange the explicit CCP merge list using at least one of CCP model information of neighboring blocks adjacent to the current block, an encoding mode of a reconstructed luminance block, an encoding mode of the reconstructed luminance block, and the width and height sizes of the current block. For example, if the type (or kind) of the CCP model of the surrounding block adjacent to the current block is CCCM, the video signal processing device can change the order of the CCP model of the CCCM type in the explicit CCP merge list to be located first in the list. Alternatively, if the encoding mode of the restored current luminance block is a segmented encoding mode such as GPM or SGPM, the video signal processing device can change the order of the CCP model of the GLM or GL-CCCM type in the explicit CCP merge list to be located first in the list.

[0409] The explicit CCP list may include CCLM, MMLM, GLM, MM-GLM, CCCM, MM-CCCM, GL-CCCM, GL-MM-CCCM, CCCM-ND, MM-CCCM-ND, CCCM-MDF, MM-CCCM-MDF, Chroma Fusion, LB-CCP, BVG-CCCM, and CCP Merge.

[0410] In the encoder and decoder, the optimal CCP model for the current chrominance block can be determined using the above method using a pre-specified explicit CCP list.

[0411] Specifically, an explicit CCP list can be constructed in the following order: CCLM, MMLM, GLM, MM-GLM, CCCM, MM-CCCM, GL-CCCM, GL-MM-CCCM, CCCM-ND, MM-CCCM-ND, CCCM-MDF, MM-CCCM-MDF, Chroma Fusion, LB-CCP, BVG-CCCM, MM-BVG-CCCM, CCP Merge. Or, an explicit CCP list can be constructed in the following order: CCP Merge, CCLM, MMLM, GLM, MM-GLM, CCCM, MM-CCCM, GL-CCCM, GL-MM-CCCM, CCCM-ND, MM-CCCM-ND, CCCM-MDF, MM-CCCM-MDF, Chroma Fusion, LB-CCP, BVG-CCCM, MM-BVG-CCCM. An explicit CCP list can be constructed using some or all of the explicit CCP models described above, and the order of each model can be constructed in various forms.

[0412] The characteristics of the image may differ for each block, and the gradient between samples may be gentle, a complex pattern may exist within the block, or sharp edges may exist between samples. Therefore, the video signal processing device may select a different, pre-specified explicit CCP list according to the characteristics of the block. Specifically, when sharp edges exist between samples within the block, the video signal processing device may use an explicit CCP list composed of a CCP model having a gradient characteristic. The explicit CCP list composed of a CCP model having a gradient characteristic may be composed of GLM, MM-GLM, GL-CCCM, GL-MM-CCCM, CCCM-MDF, and MM-CCCM-MDF. The characteristics of the block may be CCP model information of a neighboring block, an encoding mode of a reconstructed neighboring luminance block, an encoding mode of a reconstructed current luminance block, and the horizontal and vertical sizes of the current block. The explicit CCP list may be reordered based on a template cost. The encoder can generate and signal a bitstream including type information of an explicit CCP list indicating which explicit CCP list of characteristics is applied to the current block. Furthermore, the encoder can generate and signal a bitstream including index information for an optimal CCP model within the explicit CCP list. The decoder can parse the type information of the explicit CCP list and determine an explicit CCP list used to predict the current chrominance block among multiple explicit CCP lists based on the type information of the explicit CCP list. Furthermore, the decoder can parse the index information for the optimal CCP model to determine an optimal CCP model for predicting the current chrominance block within the determined explicit CCP list.

[0413] A video signal processing device can derive type information of an explicit CCP list by using at least one of information including CCP model information of adjacent neighboring blocks to the current block, an encoding mode of a reconstructed luma block, an encoding mode of a neighboring block, horizontal and vertical sizes of the current block, quantization parameters of the current block and neighboring blocks, an encoding mode of the current block or neighboring blocks, and information indicating whether the current block is encoded in intra-TMP or IBC mode. At this time, the encoder can use the derived type information without signaling the type information of the explicit CCP list indicating which characteristics of the explicit CCP list are applied to the current block. In addition, the encoder can generate and signal a bitstream including index information for an optimal CCP model in the explicit CCP list constructed according to the derived type information. The decoder can parse the index information for the optimal CCP model, construct an explicit CCP list using the derived type information, and then determine an optimal CCP model for predicting the current chrominance block in the explicit CCP list using the index information.

[0414] When configuring an explicit CCP list, the video signal processing device can select a different pre-specified explicit CCP list depending on whether one CCP model or two or more CCP models are used. Specifically, when one CCP model is used, the video signal processing device can use an explicit CCP list composed of one CCP model. An explicit CCP list composed of one CCP model can be composed of CCLM, GLM, CCCM, GL-CCCM, CCCM-ND, CCCM-MDF, BVG-CCCM, and CCP Merge. An explicit CCP list composed of two or more CCP models can be composed of MMLM, MM-GLM, MM-CCCM, GL-MM-CCCM, MM-CCCM-ND, MM-CCCM-MDF, Chroma Fusion, LB-CCP, MM-BVG-CCCM, and CCP Merge. The composed explicit CCP list can be reordered based on a template cost. The encoder can generate and signal a bitstream that includes type information of an explicit CCP list indicating which explicit CCP list is applied to the current block. Furthermore, the encoder can generate and signal a bitstream that includes index information for an optimal CCP model in the explicit CCP list. The decoder can parse the type information of the explicit CCP list and determine an explicit CCP list to be used for predicting the current chrominance block among multiple explicit CCP lists based on the type information of the explicit CCP list. Furthermore, the decoder can parse the index information for the optimal CCP model to determine an optimal CCP model for predicting the current chrominance block from the determined explicit CCP list.

[0415] When constructing an explicit CCP list, a video signal processing device can construct an explicit combined CCP list such that two or more CCP models become one candidate. The explicit combined CCP list can include a candidate composed of only one CCP model. Specifically, the explicit combined CCP list can be constructed as {(CCLM, CCCM), (GLM, CCCM), (GL-CCCM, MM-CCCM-ND), (CCCM-ND, MM-CCCM-MDF), (BVG-CCCM, 0), (CCP merge, 0). The constructed explicit combined CCP list can be reordered based on a template cost. An encoder can generate and signal a bitstream including index information for an optimal CCP model candidate in the explicit combined CCP list. A decoder can parse the index information for the optimal CCP model candidate to determine an optimal CCP model candidate for predicting a current chrominance block in the explicit combined CCP list. If the optimal CCP model candidate is (CCCM-ND, MM-CCCM-MDF), the video signal processing device can generate a final chrominance block by weighting the chrominance block predicted using CCCM-ND and the chrominance block predicted using MM-CCCM-MDF. If the optimal CCP model candidate is (BVG-CCCM, 0), the video signal processing device can generate a chrominance prediction block using only BVG-CCCM.

[0416] The video signal processing device can determine whether to predict a chrominance block by constructing an explicit CCP list using at least one or more of information from among CCP model information of a neighboring block adjacent to a current block, an encoding mode of a reconstructed luminance block, an encoding mode of a neighboring block, a horizontal and vertical size of the current block, a quantization parameter of the current block and a neighboring block, an encoding mode of the current block or a neighboring block, and information on whether the current block is encoded in an intra TMP or IBC mode.

[0417] Depending on the width and height of the current block, the types of acceptable CCP models may vary. For example, if the width and height of the current block are smaller than a predefined number, predefined CCP models such as CCLM, MMLM, GLM, CCCM, MM-CCCM, GL-CCCM, CCCM-ND, and CCCM-MDF may not be allowed. The predefined number may be an integer greater than or equal to 1, and may be the product of the width and height. For example, the predefined number may be 8, 16, or 32. For example, if the product of the width and height of the current block is 16 or less, GL-CCCM and CCCM-MDF, which require many samples from neighboring blocks when predicting the current chrominance block, may not be allowed. The encoder may not include or signal information related to GL-CCCM and CCCM-MDF in the bitstream if the product of the width and height of the current block is 16 or less. The decoder may not parse information related to GL-CCCM, CCCM-MDF if the product of the width and height of the current block is less than 16, and may set GL-CCCM, CCCM-MDF not to be applied.

[0418] The video signal processing device can set only the CCP models of the MMLM, MM-GLM, MM-CCCM, GL-MM-CCCM, MM-CCCM-ND, MM-CCCM-MDF, and MM chroma fusion types, which use two CCP models, to be available for prediction of the current chroma block when the encoding mode of the restored current luminance block is a split encoding mode such as GPM or SGPM. The encoder can generate and signal a bitstream including information about the number of CCP models (whether there are 1 or 2), information about the template type (L, T, LT) of the CCP models, and information about the type (CCLM, GLM, CCCM, GL-CCCM, CCCM-ND, CCCM-MDF, and chroma fusion) of the CCP models. The decoder can first parse information about the number of CCP models and information about the template type of the CCP models, and then parse information about the type of the CCP models. Alternatively, the decoder can first parse the type information of the CP model, and then parse information about the number of CCP models and information about the template form of the CCP model. If the encoding mode of the reconstructed current luma block is a segmented encoding mode such as GPM or SGPM, the encoder can disable one CCP model and not include or signal information related to one CCP model in the bitstream. Specifically, if the encoding mode of the reconstructed current luma block is a segmented encoding mode such as GPM or SGPM, the encoder can not include information about the number of CCP models in the bitstream, and only include and signal information about the template form of the CCP model and the type of the CCP model in the bitstream.If the encoding mode of the restored current luminance block is a segmented encoding mode such as GPM or SGPM, the decoder can set the number of CCP models to 2 without parsing information about the number of CCP models, and can determine CCP model information for the current chrominance block by parsing information about the template form of the CCP model and information about the type of the CCP model.

[0419] The CCCM method derives a model using the correlation between the reconstructed luminance block and chrominance block adjacent to the current block, and then predicts the current chrominance block using the currently reconstructed luminance block and the derived model. At this time, since the image quality of the reconstructed area varies depending on the quantization parameter, the derived CCCM model may vary. In order to predict the current chrominance block using the optimal CCCM model, the encoder derives an O-CCCM (Original CCCM) model for the original image using the original luminance block and chrominance block of the current block, and then predicts the current chrominance block using the reconstructed luminance block of the current block and the O-CCCM model. At this time, the encoder can generate and signal a bitstream that includes information on whether the current block is encoded using the O-CCCM model and parameter information for the O-CCCM model. If the encoding mode of the current block is the O-CCCM mode, the decoder can parse the parameter information for the O-CCCM model, construct an O-CCCM model, and use it to predict the current chrominance block. At this time, the O-CCCM model may be an O-CCCM model that reduces the value range by applying quantization to at least one parameter among the parameters of the O-CCCM model. This is to reduce parameter information about the signaled O-CCCM model.

[0420] Alternatively, the encoder may signal only the difference between the CCCM model derived from the neighboring blocks of the current block (e.g., FIG. 29) and the O-CCCM model in the bitstream. If the encoding mode of the current block is the O-CCCM mode, the decoder may parse the parameter information difference value for the O-CCCM model, construct an O-CCCM model using the parameter information difference value and the CCCM model derived from the neighboring blocks, and use the O-CCCM model to predict the current chrominance block. This is to reduce the parameter information for the O-CCCM model that is signaled.

[0421] Figure 37 illustrates a CCP method based on a block vector according to one embodiment of the present invention.

[0422] If the current luminance block is encoded in the intra TMP or IBC mode, the video signal processing device can derive a CCP model through the correlation between the luminance block (reference luma block of FIG. 37) and the chrominance block (reference chroma block of FIG. 37) of the reference block indicated by the block vector of the luminance block. The video signal processing device can generate Cb and Cr prediction blocks, which are chrominance prediction blocks for the current block, using the derived CCP model and the currently reconstructed luminance block. This may be referred to as BVG CCP (Block Vector Guided Cross Component Prediction). Here, the CCP model may be at least one of CCLM, MMLM, GLM, MM-GLM, CCCM, MM-CCCM, GL-CCCM, GL-MM-CCCM, CCCM-ND, MM-CCCM-ND, CCCM-MDF, MM-CCCM-MDF, and chroma fusion. For example, if the CCP model is a GL-CCCM model, it can be referred to as BVG GL-CCCM. In addition, various CCP models can be applied to BVG CCP. The video signal processing device can determine whether the BVG CCP method is available by using at least one of the horizontal and vertical sizes of the current block, the encoding mode of the corresponding luminance block, the error signal information of the corresponding luminance block, and the block vector of the corresponding luminance block. For example, if the sum (or product) of the horizontal size and the vertical size of the current block is less than a predefined size, the BVG CCP method may not be used. In this case, the encoder may not include information related to the BVG CCP in the bitstream. The decoder may not parse information related to the BVG CCP, and the BVG CCP mode may be set to not be applied. The predefined size may be an integer greater than or equal to 1, and may be 16.

[0423] Figure 38 illustrates a luminance block corresponding to a chrominance block according to one embodiment of the present invention.

[0424] A video signal processing device can generate a chrominance prediction block for a current block by performing BVG CCP in the following order. First, the video signal processing device checks whether BVG CCP can be applied to the current chrominance block by using at least one of information on whether the corresponding luminance block is encoded in dual tree mode, information on whether the corresponding luminance block is encoded in single tree mode, information on whether the corresponding luminance block is encoded in intra TMP mode, and information on whether the corresponding luminance block is encoded in IBC mode. At this time, the position of the corresponding luminance block may be a predefined position. For example, the predefined position may be C, TL, TR, BL, BR of FIG. 38. Alternatively, the predefined position may be a predefined position of the corresponding luminance block (such as 1, 2, 3, 4 of FIG. 38) and a predefined position outside the corresponding luminance block (such as 5, 6, 7, 8, 9 of FIG. 38). Referring to FIG. 38, the upper left position coordinate of the luminance block corresponding to the upper left position coordinate (xCbC, yCbC) of the chrominance block may be (xCbL, yCbL).

[0425] Next, if the BVG CCP mode is ava...

Claims

1. In a video signal decoding device, Includes a processor, The above processor, Construct a CCP (Cross-Component Prediction) list for deriving a chrominance component block of the current block from a luminance component block of the current block, Select one CCP model candidate from the above CCP list, A video signal decoding device that derives a chrominance component block of the current block based on the above one CCP model candidate.

2. In paragraph 1, The above CCP list includes one or more CCP model candidates, A video signal decoding device, wherein the one or more CCP model candidates include a first CCP model candidate used by a reference block of the current block.

3. In paragraph 2, A video signal decoding device, wherein the one or more CCP model candidates are obtained using at least one of a type of CCP model derived from the first CCP model candidate, parameter coefficients for the first CCP model, coordinate information of the surrounding block, an average value of samples constituting the surrounding block, a luminance offset value of the surrounding block, encoding mode information of the surrounding block, and a quantization parameter of the surrounding block.

4. In paragraph 2, A video signal decoding device, wherein the one or more CCP model candidates are predefined CCP models.

5. In paragraph 4, The one or more CCP model candidates are determined based on the type of predefined CCP model, A video signal decoding device, wherein parameters for the one or more CCP model candidates are derived through neighboring samples adjacent to the current block.

6. In paragraph 2, A video signal decoding device, wherein the above reference block is a block temporally separated from the current block.

7. In paragraph 2, A video signal decoding device, wherein the POC (Picture Order Count) of the picture including the current block and the POC of the picture including the reference block are different from each other.

8. In paragraph 2, A video signal decoding device, wherein the one or more CCP model candidates include a CCP model generated by combining two or more CCP models.

9. In paragraph 1, The above CCP list includes one or more CCP model candidates, A video signal decoding device, wherein the one or more CCP model candidates are determined based on the product of the horizontal size of the current block and the horizontal size of the current block.

10. In paragraph 9, If the product of the horizontal size of the current block and the horizontal size of the current block is less than or equal to the first threshold, A video signal decoding device wherein the one or more CCP model candidates are not GL-CCCM (Gradient and location based convolutional cross-component model) or CCCM-MDF (CCCM with multiple downsampling filters).

11. In paragraph 1, The above processor, A video signal decoding device that reorders the above CCP merge list based on cost.

12. In a video signal encoding device, Includes a processor, The above processor obtains a bitstream decoded by a decoding method, The above decoding method is, A step of constructing a CCP (Cross-Component Prediction) list for deriving a chrominance component block of the current block from a luminance component block of the current block; a step of selecting one CCP model candidate from the above CCP list; and A video signal encoding device, comprising a step of deriving a chrominance component block of the current block based on the one CCP model candidate.

13. In paragraph 12, The above CCP list includes one or more CCP model candidates, A video signal encoding device, wherein the one or more CCP model candidates include a first CCP model candidate used by a reference block of the current block.

14. In paragraph 13, A video signal encoding device, wherein the one or more CCP model candidates are obtained using at least one of a type of CCP model derived from the first CCP model candidate, parameter coefficients for the first CCP model, coordinate information of the surrounding block, an average value of samples constituting the surrounding block, a luminance offset value of the surrounding block, encoding mode information of the surrounding block, and a quantization parameter of the surrounding block.

15. In paragraph 13, A video signal encoding device, wherein the one or more CCP model candidates are predefined CCP models.

16. In paragraph 15, The one or more CCP model candidates are determined based on the type of predefined CCP model, A video signal encoding device, wherein parameters for the one or more CCP model candidates are derived through neighboring samples adjacent to the current block.

17. In paragraph 13, A video signal encoding device, wherein the above reference block is a block temporally separated from the current block.

18. In paragraph 13, A video signal encoding device, wherein the POC (Picture Order Count) of the picture including the current block and the POC of the picture including the reference block are different from each other.

19. In paragraph 13, A video signal encoding device, wherein the one or more CCP model candidates include a CCP model generated by combining two or more CCP models.

20. In a computer-readable non-transitory storage medium storing a bitstream, the bitstream is decoded by a decoding method, The above decoding method is, A step of constructing a CCP (Cross-Component Prediction) list for deriving a chrominance component block of the current block from a luminance component block of the current block; a step of selecting one CCP model candidate from the above CCP list; and A non-transitory storage medium, comprising a step of deriving a chrominance component block of the current block based on the one CCP model candidate.

Citation Information

Patent Citations

  • Eco-friendly green building window system

    KR1020200141137A

  • Shift control system and method for hybrid vehicle

    KR102719573B1

  • Cross-component prediction with multiple-parameter model

    US20220329816A1

Cited By

  • Video picture component prediction method and apparatus, and computer storage medium

    US20250211729A1

  • Method and apparatus for fallback extension of adaptive loop filter and convolutional cross-component model in video coding

    WO2026171203A1

  • Encoding method, decoding method, encoder, decoder, and storage medium

    WO2026218164A1