Method and apparatus for processing video signal based on intra prediction

By adopting the matrix-based intra prediction mode in video signal processing, the problem of low encoding efficiency of video signal is solved, more efficient intra prediction and mode list construction is achieved, and the compression efficiency of video signal is improved.

CN119277060APending Publication Date: 2025-01-07HFI INNOVATION INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411205723.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-06-21
Filing Date
2020-04-27
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing video signal processing technology is difficult to effectively improve the encoding efficiency of video signals in compressed encoding, especially in the application of intra prediction mode, especially in the derivation of prediction modes of luminance components and the construction of the most likely mode list of chrominance components. Inefficiency problem.

Method used

Matrix-based intra prediction (MIP) mode is adopted, and the MIP flag value is determined to determine whether to apply the MIP mode, and when applying MIP, the luminance intra prediction mode is set to a preset specific mode, and then the chromatic intra prediction mode is derived and generate predictive samples, recover chroma blocks, while building the most likely pattern list to improve coding efficiency when MIP is not applied.

Benefits of technology

The encoding efficiency of video signals is improved, the derivation of intra prediction modes and the construction of the most likely mode list are simplified, and the compression complexity and encoding efficiency are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277060A_ABST
    Figure CN119277060A_ABST
Patent Text Reader

Abstract

Disclosed are a method and an apparatus for processing a video signal based on intra prediction. The video signal processing method may comprise the steps of: deriving a chroma intra prediction mode applied to a current chroma block based on a luma intra prediction mode of a luma block corresponding to the current chroma block; generating a chroma prediction sample of the current chroma block based on the chroma intra prediction mode; and recovering the current chroma block based on the chroma prediction sample.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with application number 202080031899.7 (PCT / KR2020 / 005541), which was submitted to the China Patent Office on October 27, 2021, with an international application date of April 27, 2020, and the invention name is “Method and device for processing video signals based on intra-frame prediction”. Technical Field

[0002] The present disclosure relates to a video signal processing method and device, and more particularly, to a video signal processing method and device based on intra-frame prediction encoding or decoding of a video signal. Background Art

[0003] Compression coding refers to a series of signal processing techniques for sending digitized information through communication lines or storing information in a form suitable for storage media. Objects of compression coding include objects such as voice, video, and text, and in particular, the technology for performing compression coding on images is called video compression. Compression coding of video signals is performed by removing excess information in consideration of spatial correlation, temporal correlation, and random correlation. However, with the recent development of various media and data transmission media, more efficient video signal processing methods and devices are needed. Summary of the invention

[0004] Technical issues

[0005] An object of the present invention is to improve the coding efficiency of a video signal. Specifically, an object of the present invention is to provide a method for efficiently deriving intra prediction modes of chrominance components when matrix-based intra prediction (MIP) is applied to luma components.

[0006] In addition, an object of the present invention is to provide a method of efficiently constructing a Most Probable Mode (MPM) list in consideration of neighboring blocks to which Matrix-based Intra Prediction (MIP) is applied.

[0007] Technical Solution

[0008] In order to solve the above problems, the present invention provides an apparatus and method for processing a video signal, as described below.

[0009] According to an embodiment of the present invention, a method for processing a video signal is provided, comprising: deriving a chroma intra-frame prediction mode applied to a current chroma block based on a luminance intra-frame prediction mode of a luminance block corresponding to a current chroma block; generating chroma prediction samples of the current chroma block based on the chroma intra-frame prediction mode; and restoring the current chroma block based on the chroma prediction samples, wherein the luminance intra-frame prediction mode is set to a preset specific mode based on whether a matrix-based intra-frame prediction (MIP) mode is applied to the luminance block corresponding to the current chroma block.

[0010] In an embodiment, whether the MIP mode is applied to the luma block corresponding to the current chroma block may be determined according to a value of a MIP flag at a preset specific luma position, and the MIP flag indicates whether the MIP mode is applied.

[0011] In an embodiment, the preset specific luminance position may be a lower right pixel position of the center of a luminance block corresponding to the current chrominance block.

[0012] In an embodiment, the method may further include: parsing a MIP flag indicating whether the MIP mode is applied to the current luminance block; when the MIP mode is applied to the current luminance block, generating luminance prediction samples of the current luminance block by applying the MIP to the current luminance block; generating a residual block of the current luminance block by performing an inverse transform on the current luminance block; and restoring the current luminance block based on the luminance prediction samples and the residual block of the current luminance block.

[0013] In an embodiment, generating the residual block of the current luminance block may include: determining whether to use an inverse secondary transform of the current luminance block and whether to resolve a secondary transform index indicating a transform kernel used for the inverse secondary transform based on the MIP flag.

[0014] In an embodiment, parsing the MIP flag may include: obtaining a syntax element indicating whether the MIP mode is used in the current sequence, and determining whether to parse the MIP flag based on the obtained syntax element.

[0015] In an embodiment, the method may further include: when the MIP mode is not applied to the current luminance block, generating a most probable mode (MPM) list of the current luminance block based on the intra-frame prediction modes of the neighboring blocks adjacent to the lower left and upper right of the current luminance block; deriving the luminance intra-frame prediction mode of the current luminance block based on the MPM list; and generating luminance prediction samples of the current luminance block by using the luminance intra-frame prediction mode.

[0016] In an embodiment, when the MIP mode is applied to at least one block among neighboring blocks adjacent to the lower left and upper right of the current luminance block, the intra prediction mode of the block to which the MIP mode is applied is set to a preset specific intra prediction mode.

[0017] According to an embodiment of the present invention, a device for processing a video signal is provided, comprising: a processor, wherein the processor is configured to: derive a chroma intra-frame prediction mode applied to a current chroma block based on a luminance intra-frame prediction mode of a luminance block corresponding to the current chroma block; generate chroma prediction samples of the current chroma block based on the chroma intra-frame prediction mode; and restore the current chroma block based on the chroma prediction samples, wherein the luminance intra-frame prediction mode is set to a preset specific mode based on whether a matrix-based intra-frame prediction (MIP) mode is applied to the luminance block corresponding to the current chroma block.

[0018] In an embodiment, whether the MIP mode is applied to the luma block corresponding to the current chroma block may be determined according to a value of a MIP flag at a preset specific luma position, and the MIP flag indicates whether the MIP mode is applied.

[0019] In an embodiment, the preset specific luminance position may be a lower right pixel position of the center of a luminance block corresponding to the current chrominance block.

[0020] In an embodiment, the processor may be configured to: parse a MIP flag indicating whether the MIP mode is applied to a current luminance block; when the MIP mode is applied to the current luminance block, generate luminance prediction samples of the current luminance block by applying the MIP to the current luminance block; generate a residual block of the current luminance block by performing an inverse transform on the current luminance block; and restore the current luminance block based on the luminance prediction samples and the residual block of the current luminance block.

[0021] In an embodiment, the processor may be configured to determine whether to use an inverse secondary transform of the current luma block and whether to resolve a secondary transform index indicating a transform kernel for the inverse secondary transform based on the MIP flag.

[0022] In an embodiment, the processor may be configured to: obtain a syntax element indicating whether the MIP mode is used in a current sequence, and determine whether to parse the MIP flag based on the obtained syntax element.

[0023] In an embodiment, the processor can be configured to: when the MIP mode is not applied to the current brightness block, generate a most probable mode (MPM) list of the current brightness block based on the intra-frame prediction modes of the neighboring blocks adjacent to the lower left and upper right of the current brightness block; derive the brightness intra-frame prediction mode of the current brightness block based on the MPM list; and generate brightness prediction samples of the current brightness block by using the brightness intra-frame prediction mode.

[0024] In an embodiment, when the MIP mode is applied to at least one block among neighboring blocks adjacent to the lower left and upper right of the current luminance block, the intra prediction mode of the block to which the MIP mode is applied may be set to a preset specific intra prediction mode.

[0025] According to an embodiment of the present invention, a non-transitory computer-executable medium is provided, on which a computer-executable component configured to be executed on one or more processors of a computing device is stored, and the computer-executable component performs operations, the operations including: deriving a chroma intra-frame prediction mode applied to the current chroma block based on the luma intra-frame prediction mode of the luma block corresponding to the current chroma block; generating chroma prediction samples of the current chroma block based on the chroma intra-frame prediction mode; and restoring the current chroma block based on the chroma prediction samples, wherein the luma intra-frame prediction mode is set to a preset specific mode based on whether a matrix-based intra-frame prediction (MIP) mode is applied to the luma block corresponding to the current chroma block.

[0026] Effects of the Invention

[0027] According to an embodiment of the present invention, the coding efficiency of a video signal can be improved. According to an embodiment of the present invention, when matrix-based intra prediction (MIP) is applied to a luminance component, by setting the intra prediction mode of a chrominance component to a default mode, complexity can be improved and compression efficiency can be improved.

[0028] In addition, according to an embodiment of the present invention, when constructing a most probable mode (MPM) list, by setting the prediction mode of a neighboring block to which matrix-based intra prediction (MIP) is applied to a preset mode, the effectiveness of MPM list construction can be improved and coding efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a schematic block diagram of a video signal encoding apparatus according to an embodiment of the present invention.

[0030] Figure 2 is a schematic block diagram of a video signal decoding apparatus according to an embodiment of the present invention.

[0031] Figure 3An embodiment in which a coding tree unit is divided into coding units in a picture is shown.

[0032] Figure 4 Embodiments of methods for signaling partitioning of quadtrees and multi-type trees are shown.

[0033] Figure 5 and Figure 6 According to an embodiment of the present disclosure, the intra prediction method is illustrated in more detail.

[0034] Figure 7 An inter-frame prediction method according to an embodiment of the present disclosure is illustrated.

[0035] Figure 8 is a diagram specifically illustrating a method for transforming a residual signal by an encoder.

[0036] Fig. 9 is a diagram specifically illustrating a method for obtaining a residual signal by inversely transforming a transform coefficient through an encoder and a decoder.

[0037] Fig.10 is a diagram for describing a matrix-based intra prediction method according to an embodiment of the present invention.

[0038] Fig.11 is a diagram illustrating a matrix-based intra prediction process according to an embodiment of the present invention.

[0039] Fig.12 is a diagram illustrating a method for applying MIP to a block of a specific size according to an embodiment to which the present invention is applied.

[0040] Fig.13 is a diagram illustrating a method for applying MIP to a block of a specific size according to an embodiment to which the present invention is applied.

[0041] Fig.14 is a diagram illustrating a method for applying MIP to a block of a specific size according to an embodiment to which the present invention is applied.

[0042] Fig.15 is a diagram illustrating a method for applying MIP to a block of a specific size according to an embodiment to which the present invention is applied.

[0043] Fig.16 is a diagram illustrating an example of a coding unit syntax structure for describing a method of signaling and obtaining MIP-related information according to an embodiment of the present invention.

[0044] Fig.17 is a diagram illustrating an example of a coding unit syntax structure for describing a method of signaling and obtaining MIP-related information according to an embodiment of the present invention.

[0045] Fig.18 is a diagram illustrating an example of a coding unit syntax structure for describing a method of signaling and obtaining secondary transform related information according to an embodiment of the present invention.

[0046] Fig.19 and 20 is a diagram illustrating an example of a residual coding unit syntax structure for describing a method of signaling and obtaining secondary transform related information according to an embodiment of the present invention.

[0047] Fig.21 is a diagram illustrating an example of a transform unit syntax structure for describing a method of signaling and obtaining transform-related information according to an embodiment of the present invention.

[0048] Fig. 22 is a diagram illustrating a method for constructing a Most Probable Mode (MPM) list according to an embodiment of the present invention.

[0049] Fig.23 is a diagram for describing a relationship between a luminance block and a chrominance block according to a tree structure according to an embodiment of the present invention.

[0050] Fig.24 is a diagram illustrating a method for constructing a Most Probable Mode (MPM) list according to an embodiment of the present invention.

[0051] Fig.25 is a diagram illustrating neighboring blocks that are referenced when constructing an MPM list according to an embodiment of the present invention.

[0052] Fig.26 is a flow chart illustrating a method for processing a video signal according to an embodiment of the present invention. DETAILED DESCRIPTION

[0053] Considering the functions in the present disclosure, the terms used in this specification may be common terms that are currently widely used, but may be changed according to the intention of those skilled in the art, customs, or the emergence of new technologies. In addition, in some cases, there may be terms arbitrarily selected by the applicant, and in this case, their meanings are described in the corresponding description section of the present disclosure. Therefore, the terms used in this specification should be interpreted based on the substantial meaning of the terms and contents throughout the specification.

[0054] In this specification, some terms may be explained as follows. In some cases, coding may be explained as encoding or decoding. In this specification, a device that generates a video signal bit stream by performing coding (coding) of a video signal is referred to as a coding device or encoder, and a device that performs decoding (decoding) of a video signal bit stream to reconstruct 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 the concepts of both encoders and decoders. Information is a term that includes all values, parameters, coefficients, elements, etc. In some cases, the meaning is interpreted differently, so the present disclosure is not limited thereto. "Unit" is used as a meaning that refers to a basic unit of image processing or a specific position of a picture, and refers to an image area that includes both luminance components and chrominance components. In addition, "block" refers to an image area that includes a specific component among luminance components and chrominance components (ie, Cb and Cr). However, depending on the embodiment, terms such as "unit", "block", "partition" and "area" may be used interchangeably. In addition, in this specification, a unit may be used as a concept that includes all of a coding unit, a prediction unit and a transform unit. A picture indicates a field or a frame, and these terms may be used interchangeably according to an embodiment.

[0055] Figure 1 is a schematic block diagram of a video signal encoding apparatus according to an embodiment of the present invention. Figure 1 The encoding device 100 of the present invention includes a transform unit 110, a quantization unit 115, an inverse quantization unit 120, an inverse transform unit 125, a filtering unit 130, a prediction unit 150 and an entropy coding unit 160.

[0056] The transform unit 110 obtains the value of the transform coefficient 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, discrete cosine transform (DCT), discrete sine transform (DST) or wavelet transform can be used. DCT and DST perform transformation by dividing the input picture signal into a plurality of blocks. In the transformation, the coding efficiency can vary according to the distribution and characteristics of the values ​​in the transformation area. The quantization unit 115 quantizes the value of the transform coefficient value output from the transform unit 110.

[0057] In order to improve the coding efficiency, instead of the method of coding the picture signal as it is, a method is used to predict the picture using the area that has been encoded by the prediction unit 150, and to obtain the reconstructed picture by adding the residual value between the original picture and the predicted picture to the predicted picture. In order to prevent the mismatch between the encoder and the decoder, when the prediction is performed in the encoder, information that can be used in the decoder should be used. To this end, the encoder performs the process of reconstructing the encoded current block again. The inverse quantization unit 120 inversely quantizes the value of the transform coefficient, and the inverse transform unit 125 reconstructs the residual value using the inversely quantized transform coefficient value. At the same time, the filtering unit 130 performs a filtering operation to improve the quality of the reconstructed picture and improve 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 output or stored in a decoded picture buffer (DPB) 156 to be used as a reference picture.

[0058] In order to improve coding efficiency, the picture signal is not coded as it is, but a method of predicting the picture via the prediction unit 150 by using the coded area and adding the residual value between the original picture and the predicted picture to the predicted picture is used to obtain a reconstructed picture. The intra prediction unit 152 performs intra prediction in the current picture, and the inter prediction unit 154 predicts the current picture by using the reference picture stored in the decoded picture buffer 156. The intra prediction unit 152 performs intra prediction from the reconstructed area in the current picture and transmits the intra coding information to the entropy coding unit 160. The inter prediction unit 154 may include a motion estimation unit 154a and a motion compensation unit 154b. The motion estimation unit 154a obtains a motion vector value of the current area by referring to a specific reconstructed area. The motion estimation unit 154a transmits the position information (reference frame, motion vector, etc.) of the reference area to the entropy coding unit 160 so that the position information is included in the bitstream. The motion compensation unit 154b performs inter motion compensation by using the motion vector value transmitted from the motion estimation unit 154a.

[0059] 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 the current picture, and the inter prediction unit 154 performs inter prediction to predict the current picture by using the reference picture stored in the DBP 156. The intra prediction unit 152 performs intra prediction from the reconstructed sample in the current picture, and transmits intra coding information to the entropy coding unit 160. The intra coding information may include at least one of an intra prediction mode, a most probable mode (MPM) flag, and an MPM index. The intra coding information may include information about the reference sample. The inter prediction unit 154 may include a motion estimation unit 154a and a motion compensation unit 154b. The motion estimation unit 154a obtains a motion vector value of a current area by referring to a specific area of ​​the reconstructed reference picture. The motion estimation unit 154a transmits a motion information set (reference picture index, motion vector information, etc.) for the reference area to the entropy coding unit 160. The motion compensation unit 154 b performs motion compensation by using the motion vector value transferred from the motion estimation unit 154 a . The inter prediction unit 154 transfers inter encoding information including motion information about the reference region to the entropy coding unit 160 .

[0060] According to another embodiment, the prediction unit 150 may include an intra block copy (BC) prediction unit (not shown). The intra BC prediction unit performs intra BC prediction based on the reconstructed sample in the current picture, and transmits intra BC coding information to the entropy coding unit 160. The intra BC prediction unit obtains a block vector value indicating a reference area for predicting the current area with reference to a specific area in the current picture. The intra BC prediction unit may perform intra BC prediction using the obtained block vector value. The intra BC prediction unit transmits the intra BC coding information to the entropy coding unit 160. The intra BC coding information may include block vector information.

[0061] When performing the above-mentioned picture prediction, the transform unit 110 transforms the residual value between the original picture and the predicted picture to obtain a transform coefficient value. In this case, the transform can be performed in units of a specific block within the picture, and the size of the specific block can be changed within a preset range. The quantization unit 115 quantizes the transform coefficient value generated in the transform unit 110 and sends it to the entropy coding unit 160.

[0062] The entropy coding unit 160 performs entropy coding on information indicating quantized transform coefficients, intra-frame coding information, inter-frame coding information, etc. to generate a video signal bit stream. In the entropy coding unit 160, a variable length coding (VLC) scheme, an arithmetic coding scheme, etc. can be used. The variable length coding (VLC) scheme includes transforming input symbols into continuous codewords, and the length of the codeword can be variable. For example, frequently occurring symbols are represented by short codewords, while rarely occurring symbols are represented by long codewords. A context-based adaptive variable length coding (CAVLC) scheme can be used as a variable length coding scheme. Arithmetic coding can transform continuous data symbols into a single prime number, wherein arithmetic coding can obtain the best bit required to represent each symbol. Context-based adaptive binary arithmetic coding (CABAC) can be used as arithmetic coding. For example, the entropy coding unit 160 can binarize the information indicating the quantized transform coefficients. The entropy coding unit 160 can generate a bit stream by arithmetic coding binary information.

[0063] The generated bitstream is encapsulated using a network abstraction layer (NAL) unit as a basic unit. A NAL unit includes an integer number of coded coding tree units. In order to decode the bitstream in a video decoder, first, the bitstream must be separated into NAL units, and then each separated NAL unit must be decoded. At the same time, the information required to decode the video signal bitstream can be sent through a raw byte sequence payload (RBSP) of a high-level set such as a picture parameter set (PPS), a sequence parameter set (SPS), a video parameter set (VPS), etc.

[0064] at the same time, Figure 1 The block diagram of the encoding device 100 according to an embodiment of the present invention is shown, and the blocks shown separately logically distinguish and show the elements of the encoding device 100. Therefore, the elements of the encoding device 100 described above may be installed as one chip or multiple chips depending on the design of the device. According to an embodiment, the operation of each element of the encoding device 100 described above may be performed by a processor (not shown).

[0065] Figure 2 2 is a schematic block diagram of a video signal decoding apparatus 200 according to an embodiment of the present invention. Figure 2 The decoding device 200 of the present invention includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 225, a filtering unit 230 and a prediction unit 250.

[0066] The entropy decoding unit 210 performs entropy decoding on the video signal bit stream to extract transform coefficient information, intra-frame coding information, inter-frame coding information, etc. for each region. For example, the entropy decoding unit 210 can obtain a binarization code for transform coefficient information for a specific region from the video signal bit stream. The entropy decoding unit 210 obtains a quantized transform coefficient by inverse binarization of the binary code. The inverse quantization unit 220 inverse quantizes the quantized transform coefficient, and the inverse transform unit 225 restores the residual value by 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 to the predicted value obtained by the prediction unit 250.

[0067] At the same time, the filtering unit 230 performs filtering on the picture to improve the image quality. This may include a deblocking filter for reducing block distortion and / or an adaptive loop filter for removing distortion of the entire picture. The filtered picture is output or stored in the DPB 256 to be used as a reference picture for the next picture.

[0068] The prediction unit 250 includes an intra prediction unit 252 and an inter prediction unit 254. The prediction unit 250 generates a predicted picture by using the encoding type, the transform coefficient of each region, and the intra / inter encoding information decoded by the above-mentioned entropy decoding unit 210. In order to reconstruct the current block in which decoding is performed, the decoded region of the current picture or other pictures including the current block may be used. In reconstruction, only the current picture, that is, the picture (or tile / slice) in which only intra prediction or intra BC prediction is performed is referred to as an intra picture or an I picture (or tile / slice), and the picture (or tile / slice) in which all intra prediction, inter prediction, and intra BC prediction can be performed is referred to as an inter picture (or tile / slice). In order to predict the sample values ​​of each block in an inter-frame picture (or tile / slice), a picture (or tile / slice) using up to one motion vector and a reference picture index is called a predicted picture or a P picture (or tile / slice), and a picture (or tile / slice) using up to two motion vectors and a reference picture index is called a bidirectional predicted picture or a B picture (or tile / slice). In other words, a P picture (or tile / slice) uses up to one motion information set to predict each block, and a B picture (or tile / slice) uses up to two motion information sets to predict each block. Here, a motion information set includes one or more motion vectors and a reference picture index.

[0069] The intra prediction unit 252 generates a prediction block using the intra coding information and the reconstructed samples in the current picture. As described above, the intra coding 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 the sample value of the current block by using the reconstructed samples located to 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. Moreover, the sample value may represent a pixel value.

[0070] According to an embodiment, the reference sample may be a sample included in a neighboring block of the current block. For example, the reference sample may be a sample adjacent to the left boundary of the current block and / or the sample may be a sample adjacent to the upper boundary. Moreover, the reference sample may be a sample located on a line within a predetermined distance from the left boundary of the current block and / or a sample located on a line within a predetermined 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 a left (L) block, an upper (A) block, a lower left (BL) block, an upper right (AR) block, or an upper left (AL) block.

[0071] The inter prediction unit 254 generates a prediction block using the reference picture and inter coding information stored in the DPB 256. The inter coding information may include a motion information set (reference picture index, motion vector information, etc.) for the current block of the reference block. Inter prediction may include L0 prediction, L1 prediction, and bidirectional prediction. L0 prediction means 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. To this end, a motion information set (e.g., motion vector and reference picture index) may be required. In the bidirectional prediction method, up to two reference areas may be used, and the two reference areas may exist in the same reference picture or may exist in different pictures. That is, in the bidirectional prediction method, up to two motion information sets (e.g., motion vector and reference picture index) may be used, and the two motion vectors may correspond to the same reference picture index or different reference picture indexes. In this case, in terms of time, the reference picture may be displayed (or output) before and after the current picture. According to an embodiment, the two reference areas used in the bidirectional prediction scheme may be areas selected from the picture list L0 and the picture list L1, respectively.

[0072] The inter-frame prediction unit 254 can use the motion vector and the reference picture index to obtain the reference block of the current block. The reference block is in the reference picture corresponding to the reference picture index. Moreover, the sample value of the block specified by the motion vector or its interpolated value can be used as the predictor of the current block. For motion prediction with sub-pel unit pixel accuracy, for example, an 8-tap interpolation filter for luminance signal and a 4-tap interpolation filter for chrominance signal can be used. However, the interpolation filter for motion prediction in sub-pixel units is not limited to this. In this way, the inter-frame prediction unit 254 performs motion compensation to predict the texture of the current unit based on the motion picture previously reconstructed using motion information. In such a case, the inter-frame prediction unit can use a motion information set.

[0073] According to another embodiment, the prediction unit 250 may include an intra BC prediction unit (not shown). The intra BC prediction unit may reconstruct the current region by referring to a specific region including the reconstructed sample in the current picture. The intra BC prediction unit obtains intra BC encoding information of the current region from the entropy decoding unit 210. The intra BC prediction unit obtains a block vector value of the current region indicating the specific region in the current picture. The intra BC prediction unit may perform intra BC prediction by using the obtained block vector value. The intra BC encoding information may include block vector information.

[0074] The reconstructed video picture is generated by adding the prediction value output from the intra prediction unit 252 or the inter prediction unit 254 to the residual value output from the inverse transform unit 225. That is, the video signal decoding apparatus 200 reconstructs the current block using the prediction block generated by the prediction unit 250 and the residual obtained from the inverse transform unit 225.

[0075] at the same time, Figure 2 The block diagram of the decoding device 200 according to an embodiment of the present invention is shown, and the blocks shown separately logically distinguish and show the elements of the decoding device 200. Therefore, the elements of the above-mentioned decoding device 200 may be installed as one chip or multiple chips depending on the design of the device. According to the embodiment, the operation of each element of the above-mentioned decoding device 200 may be performed by a processor (not shown).

[0076] Figure 3An embodiment in which a coding tree unit (CTU) is partitioned into coding units (CU) in a picture is illustrated. In the encoding process of a video signal, a picture may be partitioned into a series of coding tree units (CTUs). A coding tree unit consists of an NxN block of luminance samples and two blocks of chrominance samples corresponding thereto. A coding tree unit may be partitioned into a plurality of coding units. A coding tree unit may not be partitioned and may be a leaf node. In this case, the coding tree unit itself may be a coding unit. A coding unit refers to a basic unit for processing a picture in the processing of the above-mentioned video signal, i.e., intra / inter prediction, transform, quantization and / or entropy coding. The size and shape of a coding unit in 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 this specification, a vertical block is a block whose height is greater than the width, and a horizontal block is a block whose width is greater than the height. In addition, in this specification, a non-square block may refer to a rectangular block, but the present disclosure is not limited thereto.

[0077] refer to Figure 3 , firstly, the compilation tree unit is split into a quadtree (QT) structure. That is, a node having a size of 2NX2N in the quadtree structure can be split into four nodes having a size of NXN. In this specification, a quadtree may also be referred to as a quadtree. Quadtree splitting may be performed recursively, and not all nodes need to be split at the same depth.

[0078] At the same time, the leaf nodes of the above-mentioned quadtree can be further divided into a multi-type tree (MTT) structure. According to an embodiment of the present invention, in a multi-type tree structure, a node can be divided into a binary or ternary tree structure divided horizontally or vertically. That is, in a multi-type tree structure, there are four segmentation structures, such as vertical binary segmentation, horizontal binary segmentation, vertical ternary segmentation and horizontal ternary segmentation. According to an embodiment of the present invention, in each tree structure, the width and height of the node can have a power of 2. For example, in a binary tree (BT) structure, a node of 2NX2N size can be divided into two NX2N nodes by vertical binary segmentation, and divided into two 2NXN nodes by horizontal binary segmentation. In addition, in a ternary tree (TT) structure, a node of 2NX2N size is divided into (N / 2)X2N, NX2N and (N / 2)X2N nodes by vertical ternary segmentation, and is divided into 2NX(N / 2), 2NXN and 2NX(N / 2) nodes by horizontal ternary segmentation. This multi-type tree splitting can be performed recursively.

[0079] The leaf nodes of the multi-type tree can be coding units. If the partitioning for the coding unit is not indicated or the coding unit is not large for the maximum transform length, the coding unit is used as a unit of prediction and transformation without further division. On the other hand, at least one of the following parameters in the above-mentioned quadtree and multi-type tree can be predefined or sent through the RBSP of the high-level set such as PPS, SPS, VPS, etc. 1) CTU size: the root node size of the quadtree, 2) Minimum QT size MinQtSize: the minimum allowed QT leaf node size, 3) Maximum BT size MaxBtSize: the maximum allowed BT root node size, 4) Maximum TT size MaxTtSize: the maximum allowed TT root node size, 5) Maximum MTT depth MaxMttDepth: the maximum allowed depth of the MTT partitioned from the leaf node of the QT, 6) Minimum BT size MinBtSize: the minimum allowed BT leaf node size, 7) Minimum TT size MinTtSize: the minimum allowed TT leaf node size.

[0080] Figure 4 An embodiment of a method for signaling the partitioning of a quadtree and a multi-type tree is shown. A preset flag may be used to signal the partitioning of the quadtree and the multi-type tree. Figure 4 , at least one of the flag “qt_split_flag” indicating whether to split a quadtree node, the flag “mtt_split_flag” indicating whether to split a multi-type tree node, the flag “mtt_split_vertical_flag” indicating the split direction of the multi-type tree node, or the flag “mtt_split_binary_flag” indicating the split type of the multi-type tree node may be used.

[0081] According to an embodiment of the present invention, the coding tree unit is the root node of the quadtree and can be first split into a quadtree structure. In the quadtree structure, a signal "qt_split_flag" is sent for each node "QT_node". If the value of "qt_split_flag" is 1, the node is split into 4 square nodes, and if the value of "qt_split_flag" is 0, the corresponding node becomes a leaf node "QT_leaf_node" of the quadtree.

[0082] Each quad leaf node "QT_leaf_node" can be further split into a multi-type tree structure. In the multi-type tree structure, "mtt_split_flag" is signaled for each node "MTT_node". When the value of "mtt_split_flag" is 1, the corresponding node is split into multiple rectangular nodes, and when the value of "mtt_split_flag" is 0, the corresponding node is a leaf node "MTT_leaf_node" of the multi-type tree. When the multi-type tree node "MTT_node" is split into multiple rectangular nodes (that is, when the value of "mtt_split_flag" is 1), the "mtt_split_vertical_flag" and "mtt_split_binary_flag" of the node "MTT_node" can be additionally signaled. When the value of "mtt_split_vertical_flag" is 1, it indicates the vertical division of the node "MTT_node", and when the value of "mtt_split_vertical_flag" is 0, it indicates the horizontal division of the node "MTT_node". In addition, when the value of "mtt_split_binary_flag" is 1, the node "MTT_node" is divided into 2 rectangular nodes, and when the value of "mtt_split_binary_flag" is 0, the node "MTT_node" is divided into 3 rectangular nodes.

[0083] Picture prediction (motion compensation) for encoding is performed on a coding unit that is no longer divided (ie, a leaf node of a coding unit tree). Hereinafter, a basic unit for performing prediction will be referred to as a "prediction unit" or a "prediction block".

[0084] Hereinafter, the term "unit" used herein may replace a prediction unit, which is a basic unit for performing prediction. However, the present disclosure is not limited thereto, and the "unit" may be understood as broadly covering the concept of a coding unit.

[0085] Figure 5 and Figure 6 The intra prediction method according to an embodiment of the present invention is illustrated in more detail. As described above, the intra prediction unit predicts sample values ​​of the current block by using reconstructed samples located on the left and / or above the current block as reference samples.

[0086] first, Figure 5 An embodiment of a reference sample used for prediction of a current block in an intra prediction mode is shown. According to an embodiment, the reference sample may be a sample adjacent to the left boundary of the current block and / or a sample adjacent to the upper boundary. Figure 5As shown in , 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, a maximum of 2W+2H+1 neighboring samples located on the left and top of the current block can be used to configure reference samples.

[0087] When at least some samples to be used as reference samples have not been recovered, the intra prediction unit may obtain reference samples by performing a reference sample filling process. The intra prediction unit may perform a reference sample filtering process to reduce errors in intra prediction. That is, filtering may be performed on adjacent samples and / or reference samples obtained by the reference sample filling process to obtain filtered reference samples. The intra prediction unit predicts samples of the current block by using the reference samples obtained as above. The intra prediction unit predicts samples of the current block by using unfiltered reference samples or filtered reference samples. In the present disclosure, adjacent samples may include samples on at least one reference line. For example, adjacent samples may include adjacent samples on a line adjacent to a boundary of the current block.

[0088] Next, Figure 6 An embodiment of a prediction mode for intra prediction is shown. For intra prediction, intra prediction mode information indicating an intra prediction direction may be signaled. The intra prediction mode information indicates one of a plurality of intra prediction modes included in an intra prediction mode set. When a current block is an intra prediction block, a decoder receives the intra prediction mode information of the current block from a bitstream. An intra prediction unit of the decoder performs intra prediction on the current block based on the extracted intra prediction mode information.

[0089] According to an embodiment of the present invention, the intra prediction mode set may include all intra prediction modes used in intra prediction (e.g., a total of 67 intra prediction modes). More specifically, the intra prediction mode set may include a plane mode, a DC mode, and a plurality of (e.g., 65) angle 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, Figure 6As shown, intra-frame prediction mode index 0 indicates plane mode, and intra-frame prediction mode index 1 indicates DC mode. In addition, intra-frame prediction mode indexes 2 to 66 may indicate different angle modes, respectively. The angle modes respectively indicate angles that are different from each other within a preset angle range. For example, the angle mode may indicate an angle within an angle range (i.e., a first angle range) between 45 degrees and -135 degrees in a clockwise direction. The angle mode may be defined based on the 12 o'clock direction. In this case, intra-frame prediction mode index 2 indicates a horizontal diagonal (HDIA) mode, intra-frame prediction mode index 18 indicates a horizontal (horizontal, HOR) mode, intra-frame prediction mode index 34 indicates a diagonal (DIA) mode, intra-frame prediction mode index 50 indicates a vertical (VER) mode, and intra-frame prediction mode index 66 indicates a vertical diagonal (VDIA) mode.

[0090] In the following, reference is made to Figure 7 An inter-frame prediction method according to an embodiment of the present disclosure is described. In the present disclosure, the inter-frame prediction method may include a general inter-frame prediction method optimized for translational motion and an inter-frame prediction method based on an affine model. In addition, the motion vector may include at least one of a general motion vector for motion compensation according to the general inter-frame prediction method and a control point motion vector for affine compensation.

[0091] Figure 7 The inter-frame prediction method according to an embodiment of the present disclosure is illustrated. As described above, the decoder can refer to the reconstructed samples of another decoded picture to predict the current block. Figure 7 , the decoder obtains a reference block 702 within a reference picture 720 based on a motion information set of a current block 701. In this case, the motion information set may include a reference picture index and a motion vector (MV). The reference picture index indicates a reference picture 720 including a reference block for inter prediction of the current block in a reference picture list. According to an embodiment, the reference picture list may include at least one of an L0 picture list or an L1 picture list. The motion vector indicates an offset between a coordinate value of the current block 701 within the current picture 710 and a coordinate value of the reference block 702 within the reference picture 720. The decoder obtains a predictor of the current block 701 based on a sample value of the reference block 702 and reconstructs the current block 701 using the predictor.

[0092] Specifically, the encoder can obtain a reference block by searching for a block similar to the current block in a picture with a higher recovery sequence. For example, the encoder can search for a reference block with the smallest sum of differences in sample values ​​from the current block within a preset search area. In this case, in order to measure the similarity between the samples of the current block and the reference block, at least one of the sum of absolute differences (SAD) and the sum of Hadamard transform differences (SATD) can be used. Here, SAD may be a value obtained by adding all absolute values ​​of the differences in sample values ​​included in the two blocks. In addition, SATD may be a value obtained by adding all absolute values ​​of Hadamard transform coefficients obtained by Hadamard transform of the differences in sample values ​​included in the two blocks.

[0093] At the same time, one or more reference areas may be used to predict the current block. As described above, two or more reference areas may be used to inter-predict the current block through a pair of prediction methods. According to an embodiment, the decoder may obtain two reference blocks based on two motion information sets of the current block. Further, the decoder may obtain a first predictor and a second predictor of the current block based on sample values ​​of the two obtained reference blocks. In addition, the decoder may reconstruct the current block using the first predictor and the second predictor. For example, the decoder may reconstruct the current block based on the average value of each sample of the first predictor and the second predictor.

[0094] As described above, for motion compensation of the current block, one or more motion information sets may be signaled. In this case, similarities between motion information sets used for motion compensation of each of the multiple blocks may be used. For example, the motion information set used to predict the current block may be derived from the motion information set used to predict one of the other reconstructed samples. To this end, the encoder and decoder may reduce signaling overhead.

[0095] For example, there may be multiple candidate blocks that are likely to be predicted based on a motion information set that is the same as or similar to the motion information set of the current block. The decoder may generate a merge candidate list based on the multiple candidate blocks. Here, the merge candidate list may include candidates corresponding to samples that are likely to have been predicted based on a motion information set related to the motion information set of the current block among samples reconstructed earlier than the current block. The encoder and the decoder may configure the merge candidate list of the current block according to predefined rules. Here, the merge candidate lists configured by the encoder and the decoder, respectively, may be the same. For example, the encoder and the decoder may configure the merge candidate list of the current block based on the position of the current block in the current picture. Referring to Fig. 9 A method of configuring a merge candidate list of a current block by an encoder and a decoder is described. In the present disclosure, a position of a specific block indicates a relative position of an upper left sample of the specific block in a picture including the specific block.

[0096] At the same time, in order to improve the coding efficiency, the transform coefficient value obtained by transforming the residual signal using quantization and coding the quantized transform coefficient instead of coding the above-mentioned residual method as it is. As described above, the transform unit can obtain the transform coefficient value by transforming the residual signal. In this case, the residual signal of a specific block can be distributed over the entire area of ​​the current block. Therefore, the energy can be concentrated in the low-frequency area by frequency domain conversion of the residual signal, thereby improving the coding efficiency. In the following, the method of transforming or inverse transforming the residual signal will be described in detail.

[0097] Figure 8 is a diagram specifically illustrating a method for transforming a residual signal by an encoder. As described above, the residual signal in the spatial domain can be transformed into the frequency domain. The encoder can obtain a transform coefficient by transforming the obtained residual signal. First, the encoder can obtain at least one residual block including a residual signal for a current block. The residual block can be a current block or one of the blocks divided from the current block. In the present disclosure, the residual block can be referred to as a residual array or a residual matrix, which includes residual samples of the current block. In the present disclosure, the residual block can represent a transform unit or a block having the same size as a transform block.

[0098] Next, the encoder can transform the residual block by using a transform kernel. The transform kernel used to transform the residual block can be a transform kernel having separable characteristics of vertical transform and horizontal transform. In this case, the transform for the residual block can be performed as a vertical transform and a horizontal transform respectively. For example, the encoder can perform a vertical transform by applying a transform kernel in the vertical direction of the residual block. The encoder can perform a horizontal transform by applying a transform kernel in the horizontal direction of the residual block. In the present disclosure, a transform kernel can be used as a term referring to a parameter set for a transform of a residual signal, such as a transform matrix, a transform array, a transform function, and a transform. According to an embodiment, the transform kernel can be any one of a plurality of available kernels. Transform kernels based on different transform types can be used for each of a vertical transform and a horizontal transform.

[0099] The encoder may pass the transform block transformed from the residual block to the quantization unit and quantize the transform block. The transform block may include a plurality of transform coefficients. Specifically, the transform block may include a plurality of transform coefficients arranged in two dimensions. As in the case of the residual block, the size of the transform block may be the same as the size of the current block or the block divided from the current block. The transform coefficients passed to the quantization unit may be represented as quantized values.

[0100] The encoder may perform additional transforms before quantizing the transform coefficients. Figure 8As shown, the above-mentioned transformation method may be referred to as a primary transformation, and the additional transformation may be referred to as a secondary transformation. For each residual block, a secondary transformation is optional. According to an embodiment, the encoder may improve coding efficiency by performing a secondary transformation on an area where it is difficult to concentrate energy in a low-frequency area only by the primary transformation. For example, a secondary transformation may be added to a block in which residual values ​​in directions other than the horizontal or vertical direction of the residual block show a large value. Compared with the residual values ​​of the inter-frame prediction block, the residual values ​​of the intra-frame prediction block have a higher transformation probability in directions other than the horizontal or vertical direction. Therefore, the encoder may additionally perform a secondary transformation on the residual signal of the intra-frame prediction block. The encoder may omit the secondary transformation of the residual signal for the inter-frame prediction block.

[0101] As another example, it can be determined whether to perform a secondary transform according to the size of the current block or the residual block. In addition, transform kernels with different sizes can be used according to the size of the current block or the residual block. For example, an 8X8 secondary transform can be applied to a block whose shorter side length in width or height is equal to or greater than the first preconfigured length. In addition, a 4X4 secondary transform can be applied to a block whose shorter side length in width or height is equal to or greater than the second preconfigured length and less than the first preconfigured length. The first preconfigured length may be greater than the second preconfigured length, but the present disclosure is not limited thereto. In addition, unlike the primary transform, the secondary transform may not be divided into a vertical transform and a horizontal transform. This secondary transform may be referred to as a low-frequency inseparable transform (LFNST).

[0102] In the case of a video signal in a specific area, even if a frequency transform is performed due to a sudden change in brightness, the energy in the high frequency band is not reduced. Therefore, the compression performance attributed to quantization may be degraded. When a transform is performed on an area where residual values ​​rarely exist, the encoding time and the decoding time may be unnecessarily increased. Therefore, the transform of the residual signal of a specific area can be omitted. Whether to perform a transform on the residual signal of a specific area can be determined by a syntax element related to the transform of the specific area. For example, the syntax element may include transform skip information. The transform skip information may be a transform skip flag. If the transform skip information about the residual block indicates a transform skip, the transform of the residual block is not performed. In this case, the encoder may immediately quantize the residual signal on which the transform of the corresponding area is not performed. It can be performed via Figure 1 The transformation unit performs the reference Figure 8 Describes the operation of the encoder.

[0103] The above-mentioned transform-related syntax elements may be information parsed from a video signal bitstream. The decoder may perform entropy decoding on the video signal bitstream to obtain the transform-related syntax elements. The encoder may perform entropy coding on the transform-related syntax elements to generate a video signal bitstream.

[0104] Fig. 9 It is a diagram specifically illustrating a method for obtaining a residual signal by inversely transforming a transform coefficient through an encoder and a decoder. For ease of description, the inverse transform operation performed by the inverse transform unit of each of the encoder and the decoder will be described. The inverse transform unit can obtain a residual signal by inversely transforming the inverse quantized transform coefficient. First, the inverse transform unit can detect whether to perform an inverse transform on a specific region from the transform-related syntax element of the region. According to an embodiment, when the transform-related syntax element for a specific transform block indicates a transform skip, the transform of the transform block can be omitted. In this case, the above-mentioned primary inverse transform and secondary inverse transform of the transform block can be omitted. The inverse quantized transform coefficient can be used as a residual signal. For example, the decoder can reconstruct the current block by using the inverse quantized transform coefficient as a residual signal.

[0105] According to another embodiment, the transform-related syntax element for a specific transform block may not indicate transform skipping. In this case, the inverse transform unit may determine whether to perform a secondary inverse transform on the secondary transform. For example, when the transform block is a transform block of an intra-frame prediction block, a secondary inverse transform may be performed on the transform block. The secondary transform kernel for the transform block may be determined based on the intra-frame prediction mode corresponding to the transform block. As another example, it may be determined whether to perform a secondary inverse transform based on the size of the transform block. The secondary inverse transform may be performed after inverse quantization and before the primary inverse transform.

[0106] The inverse transform unit may perform a primary inverse transform on the inverse quantized transform coefficient or the transform coefficient of the secondary inverse transform. In the case of the primary inverse transform, as in the case of the primary transform, the vertical transform and the horizontal transform may be performed separately. For example, the inverse transform unit may obtain a residual block by performing a vertical inverse transform and a horizontal inverse transform on the transform block. The inverse transform unit may inverse transform the transform block based on a transform core for transforming the transform block. For example, the encoder may explicitly or implicitly signal information indicating a transform core applied to the current transform block among a plurality of available transform cores. The decoder may select a transform core to be used for the inverse transform of the transform block from among a plurality of available transform cores using information indicating the signaled transform core. The inverse transform unit may reconstruct the current block by using a residual signal obtained by inverse transforming the transform coefficients.

[0107] Fig.10 is a diagram for describing a matrix-based intra prediction method according to an embodiment of the present invention.

[0108] According to an embodiment of the present invention, Fig.10 As shown, the encoder / decoder can generate a prediction block for the current block by applying matrix values ​​and offsets based on reference samples adjacent to the left and upper sides of the current block. Fig.10, bdry top 1001 indicates the reference sample above the current block and can be represented by Fig.10 In addition, bdry left 1002 indicates the left reference sample of the current block and can be represented by Fig.10 H in represents. As an embodiment, the reference sample line used for matrix-based intra prediction may be the reference sample line closest to the current block. In this specification, this matrix-based intra prediction method may be referred to as matrix-based intra prediction (MIP) or affine linear weighted intra prediction (ALWIP).

[0109] Fig.11 is a diagram illustrating a matrix-based intra prediction process according to an embodiment of the present invention.

[0110] refer to Fig.11 In step S1101, the encoder / decoder may perform an averaging process on adjacent reference samples. The averaging process may be referred to as a downsampling process. For example, in step S1101, the reference sample bdry above the current block may be averaged. top Expressed (or set, replaced) as the average value of a specific bundle (or quantity) of units. For example, in Fig.11 In step S1101, the reference sample bdry can be averaged by two reference samples. top The eight reference samples in are used to generate four new (or downsampled) reference samples. The new reference samples are Fig.11 can be called bdry top red In the same way, in step S1101, the eight left reference samples bdry of the current block can be left Downsampled to four new reference samples bdry left red In an embodiment, the number of reference samples after the averaging process (ie, the number of downsampled reference samples) may be determined according to the size of the current prediction block.

[0111] In step S1102, the encoder / decoder may perform a matrix-vector multiplication process. In other words, the encoder / decoder may apply the matrix operation to the downsampled reference sample in step S1101. As a result of the matrix-vector multiplication process, a temporary prediction sample may be generated. The encoder / decoder may apply the matrix vector and / or the offset value to the result value of step S1101 based on a specific mode. As an example, the specific mode may be represented as follows Fig.11 The encoder / decoder may apply the matrix vector and the offset value to the result value of step S1101 using the following equation 1.

[0112] [Equation 1]

[0113] pred red =A.bdry red +b

[0114] In Equation 1, A is a variable representing a matrix. In an embodiment, the matrix may be predefined in the encoder and the decoder. In addition, A may include W red x H red Columns, and if W=H=4, 4 columns may be included, and in other cases, 8 columns may be included. In addition, b is a variable (or vector) indicating an offset, and the size may be defined as W red x H red . According to an embodiment of the present invention, matrix A and vector b may be any one of three sets consisting of S0, S1 and S2. In an embodiment, S0 may be composed of 18 matrices, each of which includes 16 rows, 4 columns and 18 offset vectors. In addition, S1 may be composed of 10 matrices, each of which has 16 rows, 8 columns and 10 offset vectors. In addition, S2 may be composed of 6 matrices, each of which has 64 rows, 8 columns and 6 offset vectors. In an embodiment, the index idx indicating a specific set in the above-mentioned sets may be determined as in Equation 2 below.

[0115] [Equation 2]

[0116]

[0117] Furthermore, in an embodiment, the above-mentioned mode k may be determined based on the following Equation 3.

[0118] [Equation 3]

[0119] For W=H=4 and mode<18, mode

[0120] For W=H=4 and mode>=18, mode-17

[0121] For max(W,H)=8 and mode<10, mode

[0122] For max(W,H)=8 and mode>=10, mode-9

[0123] For max(W,H)>8 and mode<6, mode

[0124] For max(W,H)>8 and mode>=6, mode-5

[0125] In step S1103, the encoder / decoder may perform an interpolation process on the result value of step S1102. In the present invention, the interpolation process may be referred to as an upsampling process. The result value of step S1102 (i.e., the temporary prediction sample) may be mapped to a specified position of the current prediction block. When the current prediction block is larger than the downsampled reference sample (or reference block), a single-step linear interpolation is applied in the vertical direction, the horizontal direction, or both directions to generate a final prediction block (or final prediction sample). In an embodiment, the above interpolation process may be applied to a block having a size of W×H where max(W,H)>=8. In the following, a method for applying MIP according to the size of the current processing block will be described in detail.

[0126] Fig.12 is a diagram illustrating a method for applying MIP to a block of a specific size according to an embodiment to which the present invention is applied.

[0127] refer to Fig.12 , assuming that the current block (or current prediction block) is a 4×4 block. The encoder / decoder first performs an averaging process on the reference samples of the current block (S1201). After the averaging process of step S1201, four new reference samples (i.e., downsampled reference samples) can be generated. The encoder / decoder performs a matrix-vector multiplication process (S1202) based on the downsampled reference samples, and completes the prediction (S1203) without additional linear interpolation. In the case of a 4×4 block, the total number of samples of the prediction block is 16, which is the same as the result sample of step S1202. Therefore, when the current block (or current prediction block) is a 4×4 block, the interpolation process can be omitted.

[0128] Fig.13 is a diagram illustrating a method for applying MIP to a block of a specific size according to an embodiment to which the present invention is applied.

[0129] refer to Fig.13 , assuming that the current block (or current prediction block) is an 8×8 block. The encoder / decoder first performs an averaging process on the reference samples of the current block (S1301). The encoder / decoder can generate a total of eight new reference samples (i.e., downsampled reference samples) by averaging the reference samples of the current block by 2.

[0130] The encoder / decoder can generate a total of 16 new samples by performing a matrix-vector multiplication process (S1302). As described above, in the present invention, the samples generated as a result of the matrix-vector multiplication process can be referred to as temporary prediction samples. Fig.13 As shown, the encoder / decoder can map (or assign) the temporary prediction samples generated as a result of the matrix-vector multiplication process to specific positions of the current prediction block.

[0131] In an embodiment of the present invention, when performing a linear interpolation process (S1303), the reference samples (i.e., downsampled reference samples) generated by the averaging process of step S1301 may be mapped to specific positions in the reference samples corresponding to the width (i.e., horizontal reference samples or upper reference samples). For example, the downsampled reference samples above the current block may be mapped to odd-numbered positions. For reference samples corresponding to the height (i.e., vertical reference samples or left reference samples), the reference samples used in the averaging process may be used as is. In this case, the encoder / decoder may perform reference sample filtering on the reference samples. In an embodiment, the encoder / decoder may perform filtering by applying higher and lower weights (or weight filters) [1, 2, 1] based on the current sample. Alternatively, known methods may be applied. The encoder / decoder may perform a linear interpolation process based on the mapped (or derived) reference samples.

[0132] Fig.14 is a diagram illustrating a method for applying MIP to a block of a specific size according to an embodiment to which the present invention is applied.

[0133] refer to Fig.14 , assuming that the current block (or current prediction block) is an 8×4 block. When the current block is an 8×4 block, the encoder / decoder averages the eight upper reference samples by 2 to generate four downsampled reference samples, and the left reference sample can use these values ​​as is without taking the average value (S1401). The encoder / decoder can generate 16 temporary prediction samples by performing a matrix-vector multiplication process based on eight new reference samples, and the generated temporary prediction samples can be mapped to a preset specific position (S1402). The encoder / decoder performs a linear interpolation process based on the generated temporary prediction samples (S1403). In an embodiment, the linear interpolation process may only require vertical samples. That is, the linear interpolation process can be performed only in the horizontal direction, and by this, the final prediction block can be generated.

[0134] Fig.15 is a diagram illustrating a method for applying MIP to a block of a specific size according to an embodiment to which the present invention is applied.

[0135] refer to Fig.15, assuming that the current block (or current prediction block) is a 16×16 block. When the current block is a 16×16 block, in S1501, the encoder / decoder generates eight new reference samples (i.e., downsampled reference samples) by averaging the upper reference samples by 2. The eight downsampled reference samples generated can be used for subsequent linear interpolation. In addition, the encoder / decoder can generate four new reference samples (i.e., downsampled reference samples) by averaging the eight downsampled reference samples by 2 again. The encoder / decoder can generate four new reference samples (i.e., downsampled reference samples) by averaging the left reference samples by 4.

[0136] In step S1502 , the encoder / decoder may perform matrix-vector multiplication using downsampled reference samples (four in the vertical direction and four in the horizontal direction) and generate temporary prediction samples. The temporary prediction samples may be 64.

[0137] In step S1503, the encoder / decoder may use the eight downsampled reference samples generated in step S1501 as horizontal reference samples for linear interpolation. In addition, as a vertical direction, the original reference samples may be used as is for linear interpolation. In an embodiment, linear interpolation may be applied to both horizontal and vertical directions.

[0138] Fig.16 is a diagram illustrating an example of a coding unit syntax structure for describing a method of signaling and obtaining MIP-related information according to an embodiment of the present invention.

[0139] refer to Fig.16 , the embodiment of the present invention will be described focusing on the decoder, but the present invention is not limited thereto, and the syntax signaling / parsing method according to the present embodiment can be basically applied to the encoder in the same manner. Fig.16 In the description, CuPredMode[x0][y0] is a variable indicating the prediction mode of the current coding unit. The prediction mode may include any one of MODE INTRA and MODEINTER, and when the prediction mode is MODE INTRA, the prediction mode of the current coding unit may be an intra prediction mode. Pcm_flag[x0][y0] represents a syntax element indicating whether the current prediction block is coded by a pulse coding modulation method.

[0140] Therefore, reference Fig.16, when CuPredMode[x0][y0] indicates MODE_INTRA, and pcm_flag[x0][y0] indicates 0, parsing MIP related signaling information is possible. In an embodiment, MIP may be applied to a luma component. treeType is a variable indicating the segmentation type of luma and chroma components, SINGLE_TREE may indicate that luma and chroma are segmented in the same manner (or segmentation structure), and DUAL_TREE_LUMA may indicate that luma and chroma are segmented in different manners. When the tree type is any one of SINGLE_TREE and DUAL_TREE_LUMA, MIP related signaling information may be parsed.

[0141] exist Fig.16 In step S1601, intra_lwip_flag[x0][y0] indicates a syntax element (or flag) indicating whether MIP is applied to the current coding block. In the present invention, intra_lwip_flag may be referred to as intra_mip_flag[x0][y0] (MIP flag). In step S1601, when a preset condition is met, the decoder may parse the MIP flag. According to an embodiment of the present invention, the condition for parsing the MIP flag may be defined as in Equation 4 below.

[0142] [Equation 4]

[0143] (Abs(Log2(cbWidth)–Log2(cbHeight))<=2&&(cbWidth<=INTRA_MIP_MAX_WIDTH&&cbHeight<=INTRA_MIP_MAX_HEIGHT))

[0144] In Equation 4, Abs() represents an operator that takes an absolute value as a result value without a sign. In addition, Log2() represents a binary logarithm with base 2, and && in A&&B represents an operator that makes the result true when both A and B are true. cbWidth is a variable representing the width of a coding block, and cbHeight is a variable representing the height of a coding block. INTRA_MIP_MAX_WIDTH is a variable representing a maximum MIP applicable width, and INTRA_MIP_MAX_HEIGTH is a variable representing a maximum MIP applicable height.

[0145] When the current coding block satisfies the condition of Equation 4, the decoder can parse the MIP flag. When Abs(Log2(cbWidth)-Log2(cbHeight))<=2 in Equation 4 (referred to as the first condition), the difference between the width and the height obtained by taking log2 can be less than or equal to 2. When (cbWidth<=INTRA_MIP_MAX_WIDTH&&cbHeight<=INTRA_MIP_MAX_HEIGHT) (referred to as the second condition) and (cbWidth<=INTRA_MIP_MAX_WIDTH||cbHeight<=INTRA_MIP_MAX_HEIGHT) (referred to as the third condition) are satisfied in Equation 4, the width and height of the current coding block may be the block size to which the preset MIP is to be applied. For example, the block size to which the preset MIP is to be applied may be 256, 128, 64, 32, 16, 8, or 4. When the MIP flag is true, the decoder can obtain the prediction mode information used in the MIP mode by parsing intra_lwip_mpm_flag[x0][y0] and, based on this, parsing intra_lwip_mpm_idx[x0][y0] or intra_lwip_mpm_remains[x0][y0].

[0146] Fig.17 is a diagram illustrating an example of a coding unit syntax structure for describing a method of signaling and obtaining MIP-related information according to an embodiment of the present invention.

[0147] refer to Fig.17 , the embodiments of the present invention will be described focusing on the decoder, but the present invention is not limited thereto, and the syntax signaling / parsing method according to the present embodiment can be substantially similarly applied to the encoder. According to an embodiment of the present invention, the decoder can determine whether to parse the MIP flag based on the syntax element (or flag) signaled at a higher level. In an embodiment, the higher level can be a sequence, a picture, a slice, or a tile. For example, the above reference Fig.16 The condition of equation 4 described may include whether sps_mip_enabled_flag is true. This may be referred to as the fourth condition. In an embodiment, whether MIP is used may be indicated by sps_mip_enabled_flag in the sequence parameter set RBSP (SPS) syntax.

[0148] Fig.18 is a diagram illustrating an example of a coding unit syntax structure for describing a method of signaling and obtaining secondary transform related information according to an embodiment of the present invention.

[0149] refer to Fig.18, the embodiment of the present invention will be described with emphasis on the decoder, but the present invention is not limited thereto, and the syntax signaling / parsing method according to the present embodiment can be substantially similarly applied to the encoder. The encoder may apply the primary transform to the current coding block and then apply the secondary transform, and the decoder may first apply the secondary transform (i.e., inverse secondary transform) and then apply the primary transform (i.e., inverse primary transform).

[0150] According to an embodiment of the present invention, the decoder may consider the value of the MIP flag when determining whether to parse the secondary transform index. Fig.18 In the embodiment, st_idx[x0][y0] may represent a syntax element indicating a secondary transform kernel for secondary transform, and may be referred to as a secondary transform index in the present invention. In an embodiment, in step S1801, in the parsing condition of st_idx[x0][y0], a case where the intra_lwip_flag[x0][y0] value is not true may be included. That is, the secondary transform is not applied to the block to which the MIP is applied, and only the primary transform may be applied.

[0151] Fig.19 and 20 is a diagram illustrating an example of a residual coding unit syntax structure for describing a method of signaling and obtaining secondary transform related information according to an embodiment of the present invention.

[0152] refer to Fig.19 and 20 , the embodiments of the present invention will be described focusing on the decoder, but the present invention is not limited thereto, and the syntax signaling / parsing method according to the present embodiment can be basically applied to the encoder in the same manner. Fig.19 According to an embodiment of the present invention, the decoder may define the case where the MIP flag is not true as a condition for counting numZeroOutSigCoeff. numZeroOutSigCoeff is a variable indicating the number of zeroed significant coefficients. When the condition defined in step S1901 is met, the decoder may count numSigCoeff.

[0153] refer to Fig. 20, the decoder can define the case where the MIP flag is not true as an upper condition that the variable numSigCoeff cannot even be counted. numSigCoeff is a variable indicating the number of significant coefficients. In this case, the values ​​of the numSigCoeff and numZeroOutSigCoeff variables do not exist, so their values ​​can be semantically defined. For example, when there are no values ​​because the two variables are not resolved, the decoder can set (or infer) numSigCoeff to 0, and can set (or infer) numZeroOutSigCoeff to a specific value greater than 0. For example, the decoder can set a specific value greater than 0 to a value corresponding to the condition that the secondary transform index (i.e., st_idx[x0][y0]) may not be resolved. Alternatively, when the MIP flag is semantically true, the value of numZeroOutSigCoeff may be set to a value greater than 0. In this case, the secondary transform can be applied only when the value of numZeroOutSigCoeff is 0. When st_idx[x0][y0] indicates 0, it may indicate that the secondary transform is not applied.

[0154] Fig.21 is a diagram illustrating an example of a transform unit syntax structure for describing a method of signaling and obtaining transform-related information according to an embodiment of the present invention.

[0155] refer to Fig.21 , the embodiment of the present invention will be described with emphasis on the decoder, but the present invention is not limited thereto, and the syntax signaling / parsing method according to the present embodiment can be basically applied to the encoder in the same manner. Fig.21 In the embodiment, tu_mts_idx[x0][y0] represents a syntax element indicating a transform kernel (or a transform kernel set), and may be referred to as an MTS index in the present invention. In an embodiment, when the MTS index indicates 0, a preset default transform kernel may be used. When the MTS index is greater than 0, several preset combinations of kernels may be used. In an embodiment, the decoder may use a preset basic transform kernel without parsing the MTS index at which the MIP is applied to the current block. This may reduce the complexity of the encoder and the decoder.

[0156] Therefore, in step S2101, the condition for parsing tu_mts_idx[x0][y0] may include the case where intra_lwip_flag[x0][y0] is not true. Alternatively, when intra_lwip_flag[x0][y0] is true, a transform kernel optimized for MIP may be used instead of applying the default transform set. When constructing a transform kernel set, the transform kernel may be determined without separate signaling / parsing.

[0157] In addition, according to an embodiment of the present invention, when deriving a prediction mode of a chroma block, the encoder / decoder may determine the prediction mode of the chroma block based on a luma mode at a specific position in a luma block corresponding to the chroma block.

[0158] In an embodiment, when the MIP mode is not applied to the luminance block corresponding to the chrominance block, the encoder / decoder may derive the chrominance prediction mode based on the prediction mode of the corresponding luminance. In addition, according to an embodiment, when the MIP mode in the luminance block corresponding to the chrominance block is confirmed, the luminance position may be predefined. The luminance position may be the lower right pixel position of the center of the corresponding luminance block. That is, when the intra_lwip_flag[xCb+cbWidth / 2][yCb+cbHeight / 2] value in the corresponding luminance position [xCb+cbWidth / 2][yCb+cbHeight / 2] indicates 0, the encoder / decoder may derive the chrominance prediction mode based on the prediction mode of the corresponding luminance block.

[0159] When the MIP mode is applied to the luma block corresponding to the chroma block, that is, when the MIP flag of the specific luma position indicates 1, the luma intra prediction mode used to determine (or derive) the prediction mode of the chroma block can be mapped to the general prediction mode, and the chroma prediction mode can be derived based on the luma intra prediction mode transformed into the general prediction mode. In an embodiment, the size sizeID of the luma block including [xCb+cbWidth / 2][yCb+cbHeight / 2] can also be considered.

[0160] In an embodiment, when intra_lwip_flag[xCb+cbWidth / 2][yCb+cbHeight / 2] is true, the encoder / decoder may use a preset basic mode instead of using the prediction mode of the corresponding luma position. In other words, when MIP is applied, the prediction mode of the corresponding luma position may be set to the preset basic mode. This is because the prediction mode of the block to which MIP is applied may have different characteristics from the general prediction mode and may therefore not be suitable for use as a prediction mode for the chroma block. For example, the preset basic mode may be a prediction mode that is statistically most selected (e.g., a planar mode).

[0161] Fig. 22 is a diagram illustrating a method for constructing a Most Probable Mode (MPM) list according to an embodiment of the present invention.

[0162] refer to Fig. 22 , the encoder / decoder may refer to the prediction mode of the neighboring blocks adjacent to the current coding block 2201 in order to construct (or generate) the MPM list (or MPM candidate list) for the current coding block 2201. In an embodiment, the encoder / decoder may refer to the prediction mode of the neighboring blocks adjacent to the current coding block 2201. Fig. 22 The MPM list is constructed by the prediction modes of the L position (left, lower left position) and the A position (above, upper right position) shown. In this specification, for the convenience of description, the intra-frame prediction mode of the L position can be referred to as L, and the intra-frame prediction mode of the A position can be referred to as A.

[0163] The coordinates of the upper left corner of the current coding block may be xCb, yCb. In this case, the position of L may be (xCb-1, Height-1), and the position of A may be (Width-1, yCb-1). Here, Height represents the height of the current coding block 2201, and Width represents the width of the current coding block 2201. Fig. 22 In the MPM list, it is assumed that the neighboring block at position A is a block predicted in MIP mode, and the coded A block coded by MIP may have a prediction mode different from that of a block predicted by other general methods. When constructing the MPM list, the encoder / decoder may map (or interpret, set) the intra prediction mode of the neighboring block at position A (which is a block coded by MIP) to another preset prediction mode. Table 1 below illustrates a table defined by mapping the prediction mode used in the block predicted by MIP to a general prediction mode.

[0164] [Table 1]

[0165]

[0166] Referring to Table 1, MipSizeId may be MipSizeId[xNbX][yNbX]. For example, when intra_mip_flag[xNbX][yNbX] of a neighboring block indicates 1 to indicate that it is a block predicted using MIP, the encoder / decoder may obtain the MipSizeId value of the neighboring block and obtain the corresponding value in Table 1. At this time, X may be L and A. Table 1 shows the relationship between the prediction mode using MIP and the general prediction mode corresponding to each MipSizeId. MipSizeId may also be expressed as MipSizeId[x][y] and may have a range / width of x=xCb+cbWidth..xCb+cbWidth-1 and y=yCb..yCb+cbHeight-1. The encoder / decoder may determine the MipSizeId value in the following manner.

[0167] 1) When cbWidth and cbHeight are both equal to 4, MipSizeId[x][y] is equal to 0.

[0168] 2) When cbWidth and cbHeight are both less than or equal to 8, MipSizeId[x][y] is equal to 1.

[0169] 3) In other cases, MipSizeId[x][y] is equal to 2.

[0170] exist Fig. 22 In the example, since the block corresponding to position L is a block encoded using a general prediction mode instead of a MIP mode, the encoder / decoder can use the prediction mode of the block at position L when constructing the MPM list without a separate transform process.

[0171] Therefore, the encoder / decoder may check the value of intra_mip_flag[xNbX][yNbX] in the neighboring blocks of A and L. When intra_mip_flag[xNbX][yNbX] is 1, candIntraPredModeX may be reinterpreted (or set) to the general prediction mode from Table 1 described above according to IntraPredModeY[xNbX][yNbX] and MipSizeId[xNbX][yNbX]. In addition, when the value of intra_mip_flag[xNbX][yNbX] is 0, candIntraPredModeX may be equal to IntraPredModeY[xNbX][yNbX].

[0172] The encoder / decoder can construct the MPM list based on the prediction modes of the neighboring blocks at two locations. In the present invention, the case of referring to two neighboring blocks has been described as an example, but the present invention is not limited thereto, and the MPM list can be constructed using two or more neighboring blocks.

[0173] In addition, according to an embodiment of the present invention, when constructing an MPM list of a current coding block to which MIP is not applied, when MIP is applied to a neighboring block at a preset position, the intra prediction mode of the neighboring block at the preset position may be set to a preset mode. The preset mode may be any one of several prediction modes defined as intra prediction modes. For example, the preset mode may be a basic prediction mode. For example, the preset mode may be a prediction mode that is statistically most selected (e.g., a plane mode). That is, when intra_mip_flag[xNbX][yNbX] of a neighboring block at a preset position is 1, the encoder / decoder may use the preset mode as the prediction mode of the neighboring block to construct the MPM list.

[0174] Fig.23 is a diagram for describing a relationship between a luminance block and a chrominance block according to a tree structure according to an embodiment of the present invention.

[0175] Fig.23(a) shows the relationship between the chroma block and the corresponding luminance block in a single tree partition structure. The ratio of luminance to chroma is, for example, in the chroma format 4:2:0. For the DM mode in which the chroma prediction mode is used as the luminance prediction mode, the value of intraPredModeY[xCb][yCb] in the LT (upper left) position (xCb, yCb) coordinates of the upper left corner of the luminance coding block can be used. In addition, the encoder / decoder can check the value of intra_mip_flag[xCb][yCb] at this position. When the value is 1, the encoder / decoder can obtain the value of MipSizeId[xCb][yCb] at the corresponding position when indicating the use of the MIP prediction mode, and then reinterpret it as a general prediction mode using Table 2 below, and use it as the chroma prediction mode.

[0176] [Table 2]

[0177]

[0178] Fig.23 (b) shows the relationship between the chroma block and the corresponding luma block in the dual-tree partition structure. In the corresponding partition structure, the partitioning methods for chroma and luma may be different. The chroma format has a structure of, for example, 4:2:0. In the case where the chroma prediction mode is used as the direct mode (DM) mode of the luma prediction mode, the chroma prediction mode may be used. Fig.23 (b) shows the intraPredModeY value of position C. That is, considering position C, the DM mode may be IntraPredModeY[xCb+cbWidth / 2][yCb+cbHeight / 2].

[0179] Therefore, in the chroma intra prediction mode, the value of intra_mip_flag[xCb+cbWidth / 2][yCb+cbHeight / 2] corresponding to the position C in the corresponding luminance block is checked, and when the check result indicates 1, the values ​​of IntraPredModeY[xCb+cbWidth / 2][yCb+cbHeight / 2] and MipSizeId[xCb+cbWidth / 2][yCb+cbHeight / 2] can be obtained, and the mapping method shown in Table 16-1 can be used, reinterpreted in the general prediction mode, and used as the chroma intra prediction mode. In another case, if the value of intra_mip_flag[xCb+cbWidth / 2][yCb+cbHeight / 2] is 0, the value of IntraPredModeY[xCb+cbWidth / 2][yCb+cbHeight / 2] can be used as it is. In the present invention, the position of C is described only by way of example, but the present invention is not limited thereto, and the position may be a designated coordinate and may be a plurality of positions.

[0180] exist Fig.23 In the single tree structure of , as an example, intra_mip_flag, intraPredModeY, and MipSizeId are checked based on the LT position, but in the single tree structure, the luminance block corresponding to the chrominance is one block, and the three values ​​can be the same. Therefore, in the dual tree structure, the reference position of the two segmentation methods can be set to the same, such as the reference position C. Even in the single tree structure, the coordinates of [xCb+cbWidth / 2][yCb+cbHeight / 2] can be used instead of LT to refer to the same position as the dual tree structure. This can simplify the implementation of software / hardware.

[0181] The chroma formats, the number and positions of referenced neighboring blocks, the position of C in the dual tree structure, and Tables 1 and 2 that have been illustrated in the above embodiments are examples, and the present invention is not limited thereto.

[0182] According to an embodiment of the present invention, when the luma coding block is in a mode using MIP, the encoder / decoder may use the luma intra prediction mode as a preset mode when determining the chroma prediction mode. For example, when the value of intra_mip_flag[x][y] stored in a specified position of the luma block corresponding to the chroma is equal to 1, intraPredModeY[x][y] may be set (or used) as a preset mode. The preset mode may be one of the intra prediction modes. For example, the preset mode may be a basic prediction mode. For example, the preset mode may be a prediction mode that is statistically most selected (e.g., a planar mode).

[0183] Fig.24 FIG. is a diagram illustrating a method for constructing a Most Probable Mode (MPM) list according to an embodiment of the present invention.

[0184] Referring Fig.24 , when using MIP in the current prediction block, the method for constructing the MPM can be as follows. The encoder / decoder can construct an MPM list for MIP by using the prediction mode values of adjacent blocks A and L. In an embodiment, the position of L can be (xCb-1, yCb), and the position of L can be (xCb, yCb-1). The upper left position of the current prediction block can be (xCb, yCb). candMipModeX can be obtained as follows. In this case, X can be L and A.

[0185] When one or more of the following conditions are met, the encoder / decoder sets candMipModeX to -1.

[0186] 1. When the availableX variable is false.

[0187] 2. When CuPredMode[xNbX][yNbX] is not MODE_INTRA and ciip_flag[xNbX][yNbX] is not 1.

[0188] 3. When pcm_flag[xNbX][yNbX] is not 1.

[0189] 4. When X is equal to B and YCb-1 is less than ((yCb >> CtbLog2SizeY) << CtbLog2SizeY).

[0190] In an embodiment, in a case different from the above, the encoder / decoder applies the following method.

[0191] 1) When intra_mip_flag[xNbX][yNbX] is equal to 1.

[0192] Check whether MipSizeId[xCb][yCb] and MipSizeId[xNbX][yNbX] are the same, and then, when the check result indicates that the two are equal to each other, set candMipModeX to the value of IntraPredModeY[xNbX][yNbX], and when MipSizeId[xCb][xCb] and MipSizeId[xCb]yNbX] are not equal to each other, set candMipModeX to -1.

[0193] 2) When intra_mip_flag[xNbX][yNbX] is not equal to 1.

[0194] candMipModeX may be reinterpreted / mapped to a prediction mode by the MIP in Table 3 based on the values ​​of IntraPredModeY[xNbX][yNbX] and MipSizeId[xCb][yCb]. In Table 3, MipSizeId may be MipSizeId[xCb][yCb].

[0195] [Table 3]

[0196]

[0197] In the method of constructing the MPM list of a compilation block using MIP as described above, as the position of the adjacent block, Fig. 22 The positions of the neighboring blocks A and L of the MIP coding block are replaced Fig.24 The positions of A and L of the blocks. This makes it possible to refer to a unified adjacent block position when implementing HW / SW, thereby simplifying the implementation. Alternatively, in the opposite case, a unified adjacent block position can be referred to.

[0198] When the current coding block is a block using MIP and there are blocks that are not coded using MIP in the adjacent blocks, the MPM of the current MIP block may be considered as follows. A prediction mode preset for each block MIP size of the current block may be used. When there are three cases for the MIP size, a prediction mode preset for each size may be used. When MipSizeId is 0, the prediction mode may be set to mode 17, when it is 1, to mode 0, and when it is 2, to mode 1. The prediction mode may be determined by a statistically frequently used mode for each MipSizeId. In another case, a preset prediction mode may be used without considering the MIP size. The preset prediction mode may be a mode used as an intra-frame prediction mode. The value may be a plane mode. However, the present invention is not limited thereto.

[0199] Fig.25 is a diagram illustrating neighboring blocks that are referenced when constructing an MPM list according to an embodiment of the present invention.

[0200] exist Fig.25 In (a), the current block is a general coding block that does not use MIP, and the position of the adjacent reference block refers to the previous Fig. 22 In addition, Fig.25 (b) is a diagram showing the relationship between the current coding block and the adjacent reference blocks using MIP, and the positions of the adjacent reference blocks refer to the previously described Fig.24 content.

[0201] In an embodiment, there are two cases in the method of using the preset mode without using Tables 1, 2 and 3. The method can be divided into Fig.25 In (a), in the current block not using MIP, at least one of the neighboring blocks is coded by MIP, and as in Fig.25 In (b), the current block is a block using MIP, and there is a coding block that does not use MIP in the adjacent block. The former is referred to as the first case, and the latter is referred to as the second case. Only in the first case, the preset mode can be used. Or only in the second case, the preset mode can be used. Alternatively, in the first case and the second case, the preset mode can be used to derive the MPM. It can be applied Fig. 22 How to use preset modes as described in Fig.23 The method of using the preset mode described in Fig.24 How to use the preset mode as described in . Fig.25 (a) and Fig.25 In (b), the position of the referenced neighboring block is an embodiment, and regardless of the position, the preset mode may be applied considering whether the current block uses MIP and whether the neighboring block uses MIP.

[0202] Although the above has been described in terms of a decoder, it can also be applied to an encoder. In the above, the term "parsing" has been described with emphasis on the process of obtaining information from a bitstream, but in terms of an encoder, it can be interpreted as constructing the corresponding information in the bitstream. Therefore, the term "parsing" is not limited to decoder operations, and can be interpreted as the action of constructing a bitstream in an encoder.

[0203] Fig.26 is a flowchart illustrating a method for processing a video signal according to an embodiment of the present invention. Fig.26 For convenience, the decoder will be described in detail, but the present invention is not limited thereto, and the method for processing a video signal according to the present embodiment can be basically applied to an encoder in the same manner.

[0204] The decoder derives a chroma intra prediction mode applied to the current chroma block based on a luma intra prediction mode of a luma block corresponding to the current chroma block (S2601).

[0205] The decoder generates chroma prediction samples of a current chroma block based on a chroma intra prediction mode (S2602).

[0206] The decoder restores the current chroma block based on the chroma prediction samples (S2603).

[0207] In an embodiment, the luma intra prediction mode may be set to a preset specific mode based on whether a matrix-based intra prediction (MIP) mode is applied to a luma block corresponding to a current chroma block.

[0208] In addition, as described above, whether the MIP mode is applied to the luma block corresponding to the current chroma block may be determined according to the MIP flag value of a preset specific luma position, and the MIP flag may indicate whether the MIP mode is applied.

[0209] In addition, as described above, the preset specific luminance position may be a lower right pixel position of the center of a luminance block corresponding to the current chrominance block.

[0210] In addition, as described above, the decoder can parse the MIP flag indicating whether the MIP mode is applied to the current luminance block. The decoder can generate a luminance prediction sample of the current luminance block by applying the MIP to the current luminance block when the MIP mode is applied to the current luminance block. The decoder can generate a residual block of the current luminance block by performing an inverse transform on the current luminance block. The decoder can restore the current luminance block based on the luminance prediction sample and the residual block of the current luminance block.

[0211] In addition, as described above, the decoder may determine whether to use the inverse secondary transform of the current luma block based on the MIP flag and whether to parse the secondary transform index indicating the transform kernel used for the inverse secondary transform.

[0212] In addition, as described above, the decoder may obtain a syntax element indicating whether the MIP mode is used in the current sequence, and determine whether to parse the MIP flag based on the obtained syntax element.

[0213] In addition, as described above, when the MIP mode is not applied to the current luma block, the decoder can generate a most probable mode (MPM) list of the current luma block based on the intra prediction modes of the neighboring blocks adjacent to the lower left and upper right of the current luma block. The decoder can derive the luma intra prediction mode of the current luma block based on the MPM list. The decoder can generate luma prediction samples of the current luma block by using the luma intra prediction mode.

[0214] In addition, as described above, when the MIP mode is applied to at least one block among the neighboring blocks adjacent to the lower left and upper right of the current luminance block, the intra prediction mode of the block to which the MIP mode is applied can be set to a preset specific intra prediction mode.

[0215] The above-mentioned embodiments of the present invention may be implemented by various means. For example, the embodiments of the present invention may be implemented by hardware, firmware, software or a combination thereof.

[0216] For the case of implementation through hardware, the method according to the embodiment of the present invention can be implemented by one or more of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a processor, a controller, a microcontroller, a microprocessor, etc.

[0217] In the case of implementation by firmware or software, the method according to the embodiment of the present invention can be implemented in the form of a module, process or function that performs the above functions or operations. The software code can be stored in a memory and driven by a processor. The memory can be located inside or outside the processor and can exchange data with the processor in various known ways.

[0218] Certain embodiments may also be implemented in the form of a recording medium including computer executable instructions, such as a program module executed by a computer. Computer readable media may be any available media that can be accessed by a computer, and may include all volatile, non-volatile, removable and non-removable media. In addition, computer readable media may include computer storage media and communication media. Computer storage media include all volatile, non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Typically, communication media include computer readable instructions, other data (such as data structures or program modules) or other transmission mechanisms of modulated data signals, and include any information transmission media.

[0219] The above description of the present invention is for illustrative purposes only, and it will be understood that those skilled in the art to which the present invention belongs can change the present invention without changing the technical ideas or basic features of the present invention, and the present invention can be easily modified in other specific forms. Therefore, the above embodiments are illustrative and are not limited in all aspects. For example, each component described as a single entity can be distributed and implemented, and similarly, the components described as distributed can also be implemented in an associated manner.

[0220] The scope of the present invention is defined by the appended claims rather than the detailed description above, and all changes or modifications derived from the meaning and scope of the appended claims and their equivalents should be construed as being included in the scope of the present invention.

Claims

1. A method for decoding a video signal, comprising: Derived a chroma intra prediction mode applied to the current chroma block based on a luma intra prediction mode of a lower right pixel position of a center of a luma block corresponding to the current chroma block; Generate a chroma prediction sample of the current chroma block based on the chroma intra prediction mode; as well as Restoring the current chroma block based on the chroma prediction samples, In which, when a matrix-based intra-frame prediction (MIP) mode is applied to the lower right pixel position of the center of the luminance block corresponding to the current chrominance block, the chrominance intra-frame prediction mode applied to the current chrominance block is derived based on a preset specific luminance intra-frame prediction mode.

2. The method according to claim 1, further comprising: Parsing a MIP flag indicating whether the MIP mode is applied to the current luma block; When the MIP mode is applied to the current luma block, generating a luma prediction sample of the current luma block by applying the MIP mode to the current luma block; When the MIP mode is not applied to the current luma block, generating luma prediction samples of the current luma block by not applying the MIP mode to the current luma block; Generating a residual block of the current luminance block by performing an inverse transform on the current luminance block; as well as The current luma block is restored based on the luma prediction sample and a residual block of the current luma block.

3. The method according to claim 2, wherein: Generating the residual block of the current luma block includes determining whether to use an inverse LFNST (Low Frequency Non-separable Transform) of the current luma block based on the MIP flag and whether to resolve an LFNST index indicating a transform kernel for the inverse LFNST.

4. The method according to claim 2, wherein: The analysis of the MIP flag includes: obtaining a syntax element indicating whether the MIP mode is to be used in the current sequence, and Based on the obtained syntax element, it is determined whether to parse the MIP flag.

5. The method according to claim 2, further comprising: When the MIP mode is not applied to the current luminance block, generating a most probable mode MPM list of the current luminance block based on the intra prediction modes of the neighboring blocks adjacent to the lower left and upper right of the current luminance block; Derives a luma intra prediction mode of the current luma block based on the MPM list; as well as A luma prediction sample of the current luma block is generated by using the luma intra prediction mode.

6. The method according to claim 5, wherein: When the MIP mode is applied to at least one block among the neighboring blocks adjacent to the lower left and upper right of the current luma block, the luma intra prediction mode of the block to which the MIP mode is applied is set to a preset specific luma intra prediction mode.

7. A device for decoding a video signal, comprising: processor, Wherein, the processor is configured to: Derived a chroma intra prediction mode applied to the current chroma block based on a luma intra prediction mode of a lower right pixel position of a center of a luma block corresponding to the current chroma block; Generate chroma prediction samples of the current chroma block based on the chroma intra prediction mode; and restoring the current chroma block based on the chroma prediction samples, and When a matrix-based intra prediction (MIP) mode is applied to a lower right pixel position of the center of the luminance block corresponding to the current chrominance block, the chrominance intra prediction mode applied to the current chrominance block is derived based on a preset specific luminance intra prediction mode.

8. The device according to claim 7, wherein: The processor is configured to: Parsing a MIP flag indicating whether the MIP mode is applied to the current luma block; When the MIP mode is applied to the current luma block, generating a luma prediction sample of the current luma block by applying the MIP mode to the current luma block; When the MIP mode is not applied to the current luma block, generating luma prediction samples of the current luma block by not applying the MIP mode to the current luma block; generating a residual block of the current luminance block by performing an inverse transform on the current luminance block; and The current luma block is restored based on the luma prediction sample and a residual block of the current luma block.

9. The device according to claim 8, wherein: The processor is configured to: It is determined whether to use an inverse LFNST (Low Frequency Non-separable Transform) of the current luma block and whether to parse an LFNST index indicating a transform kernel for the inverse LFNST based on the MIP flag.

10. The device according to claim 8, wherein: The processor is configured to: obtaining a syntax element indicating whether the MIP mode is to be used in the current sequence, and Based on the obtained syntax element, it is determined whether to parse the MIP flag.

11. The device according to claim 8, wherein: The processor is configured to: When the MIP mode is not applied to the current luminance block, generating a most probable mode (MPM) list of the current luminance block based on intra prediction modes of neighboring blocks adjacent to the lower left and upper right of the current luminance block; Derives a luma intra prediction mode of the current luma block based on the MPM list; and A luma prediction sample of the current luma block is generated by using the luma intra prediction mode.

12. The device according to claim 11, wherein When the MIP mode is applied to at least one block among the neighboring blocks adjacent to the lower left and upper right of the current luma block, the luma intra prediction mode of the block to which the MIP mode is applied is set to a preset specific luma intra prediction mode.

13. A method for encoding a video signal, comprising: Derived a chroma intra prediction mode applied to the current chroma block based on a luma intra prediction mode of a lower right pixel position of a center of a luma block corresponding to the current chroma block; Generate a chroma prediction sample of the current chroma block based on the chroma intra prediction mode; as well as Restoring the current chroma block based on the chroma prediction samples, In which, when a matrix-based intra-frame prediction (MIP) mode is applied to the lower right pixel position of the center of the luminance block corresponding to the current chrominance block, the chrominance intra-frame prediction mode applied to the current chrominance block is derived based on a preset specific luminance intra-frame prediction mode.