Video signal processing methods and equipment

VN130197APending Publication Date: 2026-10-15SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
VN1202607568
Authority / Receiving Office
VN · VN
Patent Type
Applications
Current Assignee / Owner
Priority Date
2018-07-31
Filing Date
2019-01-25
Publication Date
2026-10-15

AI Technical Summary

Technical Problem

Current video signal processing methods lack efficiency in coding and signaling, particularly in predicting current blocks using reference samples, leading to suboptimal compression and transmission of video data.

Method used

A video signal processing method and device that generates prediction samples based on intra prediction modes, using linear combinations of reference values and residual signals, with parameter sets adjusted according to the shape of the current block, to enhance coding efficiency and signaling efficiency.

Benefits of technology

The method increases coding efficiency and signaling efficiency by effectively predicting current samples, improving the quality and compression of video signals through optimized use of reference samples and parameter sets based on block shape.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202607568_0
    Figure VN1202607568_0
Patent Text Reader

Abstract

The invention proposes a method and apparatus for processing video signals to encode or decode video signals.More specifically, the invention proposes a video signal processing method and a video signal processing device to implement this method, which includes the following steps: obtaining reference line information indicating the reference line for predicting the internal image of the current block from among several reference lines including neighboring samples of the current block; determining, on the basis of the reference line information, the internal image prediction mode for the current block from among several internal image prediction modes constituting the set of internal image prediction modes; and decoding the current block based on several reference samples on the reference line according to the determined reference line information and internal image prediction mode, where the several reference lines include a first reference line consisting of neighboring samples on the line adjacent to the boundary of the current block and a second reference line consisting of neighboring samples on a line placed at a distance from the boundary of the current block corresponding to a predetermined number of samples.
Need to check novelty before this filing date? Find Prior Art

Description

Video signal processing method and device

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

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

[0003] The present invention aims to improve the coding efficiency of a video signal. Furthermore, the present invention aims to improve signaling efficiency related to prediction of a current block by utilizing reference samples of the current block.

[0004] To solve the above-mentioned problems, the present invention provides the following video signal processing device and video signal processing method.

[0005] First, according to an embodiment of the present invention, a video signal processing method is provided, comprising: a step of generating a first prediction sample of a current sample included in a current block based on an intra prediction mode for the current block; a step of determining, based on the intra prediction mode for the current block, at least one reference sample corresponding to the current sample from among reference samples of the current block; a step of obtaining at least one reference value corresponding to the current sample based on an unfiltered sample value of the at least one reference sample; a step of generating a second prediction sample of the current sample by linearly combining a value of the first prediction sample and the at least one reference value based on a parameter set corresponding to the specific index set; and a step of reconstructing the current sample based on a residual signal of the current sample and the second prediction sample, wherein the parameter sets corresponding to the specific index set are different depending on a shape of the current block.

[0006] In addition, according to an embodiment of the present invention, a video signal processing device is provided, including a processor, wherein the processor generates a first prediction sample of a current sample included in the current block based on an intra prediction mode for the current block, the intra prediction mode for the current block being indicated by one of at least one intra prediction mode index included in a specific index set, determines at least one reference sample corresponding to the current sample among reference samples of the current block based on the intra prediction mode for the current block, obtains at least one reference value corresponding to the current sample based on an unfiltered sample value of the at least one reference sample, generates a second prediction sample of the current sample by linearly combining a value of the first prediction sample and the at least one reference value based on a parameter set corresponding to the specific index set, and reconstructs the current sample based on a residual signal of the current sample and the second prediction sample, wherein the parameter sets corresponding to the specific index set are different depending on a shape of the current block.

[0007] The processor may generate the second prediction sample by linearly combining the first prediction sample and the at least one reference value based on a first parameter set when the shape of the current block is a vertical rectangle, and may generate the second prediction sample by linearly combining the first prediction sample and the at least one reference value based on a second parameter set when the shape of the current block is a horizontal rectangle.

[0008] The specific index set may be one of a first index set and a second index set, wherein the first index set may be a set composed of intra prediction mode indices that are greater than a smallest index among intra prediction mode indices indicating an angular mode and less than or equal to a preset first index, and the second index set may be a set composed of intra prediction mode indices that are less than a largest index among intra prediction mode indices indicating an angular mode and greater than or equal to a preset second index.

[0009] The above first index and the above second index are values ​​set based on the number of preset wide-angle modes when the longer side among the width and height of the current block is twice the shorter side, and the wide-angle mode may be an angle mode that is outside the preset reference angle range.

[0010] The first parameter set may be such that, for at least some of the samples constituting the current block, a parameter applied to an upper reference value obtained from an upper reference sample of the current block among the at least one reference value may be non-zero, and the second parameter set may be such that, for at least some of the samples constituting the current block, a parameter applied to a left reference value obtained from a left reference sample of the current block among the at least one reference value may be non-zero.

[0011] An index indicating an intra prediction mode of the current block is one of the indices constituting the first index set, and the processor can generate the second prediction sample based on the first parameter set when the shape of the current block is square.

[0012] The index indicating the intra prediction mode of the current block may be any one of the indices constituting the second index set. At this time, the processor,

[0013] If the shape of the current block is a square, the second prediction sample can be generated based on the second parameter set.

[0014] The above specific index set may be a third index set consisting of the smallest index among the intra prediction mode indices indicating the angular mode. In this case, when the shape of the current block is a square or a vertical rectangle, the parameter applied to the left reference value of the parameter set may not be 0, and when the shape of the current block is a horizontal rectangle, the parameter applied to the left reference value of the parameter set may be 0.

[0015] The above specific index set may be a fourth index set consisting of the largest index among the intra prediction mode indices indicating the angle mode. In this case, when the shape of the current block is a square or a horizontal rectangle, the parameter applied to the upper reference value of the parameter set may not be 0, and when the shape of the current block is a vertical rectangle, the parameter applied to the upper reference value of the parameter set may be 0.

[0016] The processor may obtain a reference value corresponding to the first position based on a first distance between the first position and the first reference sample and a distance between the first position and the second reference sample, when the first position intersects with one of the reference lines of the current block in an opposite direction to a prediction direction indicated by an intra prediction mode for the current block based on the position of the current sample, and the first reference sample and the second reference sample are different adjacent integer samples.

[0017] According to embodiments of the present invention, the coding efficiency of a video signal can be improved. Furthermore, according to embodiments of the present invention, the signaling efficiency related to intra prediction of the current block can be improved.

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

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

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

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

[0022] FIG. 5 illustrates an embodiment of reference samples used for prediction of a current block in intra prediction mode.

[0023] Figure 6 illustrates one embodiment of prediction modes used for intra prediction.

[0024] FIG. 7 is a diagram illustrating one embodiment of how the wide-angle mode is signaled.

[0025] Figure 8 is a drawing showing one embodiment of a horizontal rectangular block and a vertical rectangular block.

[0026] FIG. 9 is a diagram illustrating one embodiment of a positional relationship between a current sample and a reference sample of a current block when the current block has a rectangular shape.

[0027] Figure 10 is a drawing showing one embodiment of the wide-angle mode.

[0028] Fig. 11 is a drawing showing one embodiment of the number of wide-angle modes according to the shape of the current block.

[0029] FIG. 12 is a diagram illustrating one embodiment of a method for generating a final prediction sample of a current sample included in a current block using PDPC.

[0030] FIG. 13 is a diagram illustrating an embodiment of a method in which PDPC is applied when the intra prediction mode of the current block is any one of DC mode, planar mode, vertical mode, and horizontal mode.

[0031] FIG. 14 is a diagram illustrating an embodiment of a method in which PDPC is applied when the intra prediction mode of the current block is a horizontal diagonal mode or a vertical diagonal mode.

[0032] FIG. 15 is a diagram illustrating an embodiment of a method in which PDPC is applied when the intra prediction mode of the current block is one of the horizontal diagonal peripheral modes and the vertical diagonal peripheral modes.

[0033] FIG. 16 is a diagram illustrating an embodiment of a method for applying PDPC when the current block is a rectangular block.

[0034] FIG. 17 is a diagram illustrating an embodiment of a PDPC parameter set according to the shape of the current block for each intra prediction mode index.

[0035] FIG. 18 is a diagram illustrating another embodiment of a PDPC parameter set according to the shape of the current block for each intra prediction mode index.

[0036] FIG. 19 is a diagram showing an embodiment of an angle mode to which PDPC is applied when the basic angle mode is replaced by a wide-angle mode depending on the shape of the current block.

[0037] FIG. 20 is a diagram illustrating one embodiment of a method for modifying a PDPC parameter set when the current block is a rectangular block.

[0038] FIG. 21 is a flowchart illustrating a method by which a video signal processing device determines a PDPC reference value and a PDPC parameter set for generating a prediction block of a current block.

[0039] FIG. 22 is a diagram illustrating one embodiment of a method for obtaining a reference sample for intra prediction of a current block when the boundary of the current block is adjacent to the boundary of an upper level region.

[0040] FIG. 23 is a diagram illustrating an additional embodiment of a method for obtaining a reference sample for intra prediction of a current block when the boundary of the current block is adjacent to the boundary of an upper level region.

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

[0042] In this specification, some terms may be interpreted as follows. Coding may be interpreted as encoding or decoding, depending on the case. In this specification, a device that encodes (encodes) a video signal to generate a video signal bitstream is referred to as an encoding device or encoder, and a device that decodes (decodes) a video signal bitstream to restore a video signal is referred to as a decoding device or decoder. In addition, in this specification, a video signal processing device is used as a term that includes both an encoder and a decoder. Information is a term that includes values, parameters, coefficients, elements, etc., and since the meaning may be interpreted differently depending on the case, the present invention is not limited thereto. 'Unit' is used to mean a basic unit of image processing or a specific location of a picture, and refers to an image area that includes both a luma component and a chroma component. In addition, 'block' refers to an image area that includes a specific component among luma components and chroma components (i.e., Cb and Cr). However, depending on the embodiment, the terms '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 transformation unit. A picture refers to a field or a frame, and depending on the embodiment, the above terms may be used interchangeably.

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

[0044] The transform unit (110) obtains a transform coefficient value by transforming the residual signal, which is the difference between the input video signal and the prediction signal generated by the prediction unit (150). For example, a discrete cosine transform (DCT), a discrete sine transform (DST), or a wavelet transform may be used. The discrete cosine transform and the discrete sine transform divide the input picture signal into blocks and perform the transformation. In the transformation, the coding efficiency may vary depending on the distribution and characteristics of the values ​​within the transformation area. The quantization unit (115) quantizes the transform coefficient value output from the transform unit (110).

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

[0046] The prediction unit (150) includes an intra prediction unit (152) and an inter prediction unit (154). The intra prediction unit (152) performs intra prediction within a current picture, and the inter prediction unit (154) performs inter prediction to predict the current picture using a reference picture stored in a decoded picture buffer (156). The intra prediction unit (152) performs intra prediction from reconstructed samples within the current picture and transfers intra encoding information to the entropy coding unit (160). The intra encoding information may include at least one of an intra prediction mode, an MPM (Most Probable Mode) flag, and an MPM index. The inter prediction unit (154) may be configured to include a motion estimation unit (154a) and a motion compensation unit (154b). The motion estimation unit (154a) obtains a motion vector value of the current region by referring to a specific region of the reconstructed reference picture. The motion estimation unit (154a) transmits motion information (reference picture index, motion vector information, etc.) for the reference region to the entropy coding unit (160). The motion compensation unit (154b) performs motion compensation using the motion vector value transmitted from the motion estimation unit (154a). The inter prediction unit (154) transmits inter encoding information including motion information for the reference region to the entropy coding unit (160).

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

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

[0049] The above generated bitstream is encapsulated as a basic unit of a Network Abstraction Layer (NAL) unit. A NAL unit includes an integer number of encoded coding tree units. In order to decode a bitstream in a video decoder, the bitstream must first be divided into NAL units, and then each divided NAL unit must be decoded. Meanwhile, information required for decoding a video signal bitstream can be transmitted through a Raw Byte Sequence Payload (RBSP) of a higher-level set, such as a Picture Parameter Set (PPS), a Sequence Parameter Set (SPS), or a Video Parameter Set (VPS).

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

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

[0052] The entropy decoding unit (210) entropy decodes the video signal bitstream to extract transform coefficients, intra-coding information, inter-coding information, etc. for each region. The inverse quantization unit (220) inversely quantizes the entropy-decoded transform coefficients, and the inverse transform unit (225) restores the residual value using the inverse quantized transform coefficients. The video signal processing device (200) restores the original pixel value by adding the residual value obtained from the inverse transform unit (225) with the prediction value obtained from the prediction unit (250).

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

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

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

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

[0057] The inter prediction unit (254) generates a prediction block using the reference picture and inter encoding information stored in the decoded picture buffer (256). The inter encoding information may include motion information (reference picture index, motion vector information, etc.) of the current block with respect to the reference block. Inter prediction may include L0 prediction, L1 prediction, and bi-prediction. L0 prediction is prediction using one reference picture included in the L0 picture list, and L1 prediction means prediction using one reference picture included in the L1 picture list. For this, one set of motion information (e.g., motion vector and reference picture index) may be required. In the bi-prediction method, up to two reference areas can be used, and these two reference areas may exist in the same reference picture or may exist in different pictures. That is, in the bi-prediction method, up to two sets of motion information (e.g., motion vectors and reference picture indices) can be used, and the two motion vectors may correspond to the same reference picture index or different reference picture indices. In this case, the reference pictures can be displayed (or output) either temporally before or after the current picture.

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

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

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

[0061] FIG. 3 illustrates an embodiment in which a Coding Tree Unit (CTU) within a picture is divided into Coding Units (CUs). During the coding process of a video signal, a picture may be divided into a sequence of Coding Tree Units (CTUs). A Coding Tree Unit consists of NXN blocks of luma samples and two blocks of corresponding chroma samples. A Coding Tree Unit may be divided into multiple Coding Units. A Coding Tree Unit may not be divided and may become a leaf node. In this case, the Coding Tree Unit itself may become a Coding Unit. A Coding Unit refers to a basic unit for processing a picture in the video signal processing process described above, such as intra / inter prediction, transformation, quantization, and / or entropy coding. The size and shape of a Coding Unit within a picture may not be constant. A Coding Unit may have a square or rectangular shape. A rectangular coding unit (or rectangular block) includes a vertical coding unit (or vertical block) and a horizontal coding unit (or horizontal block). In this specification, a vertical block is a block whose height is greater than its width, and a horizontal block is a block whose width is greater than its height. In addition, a non-square block in this specification may refer to a rectangular block, but the present invention is not limited thereto.

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

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

[0064] Leaf nodes of a multi-type tree can be coding units. If a coding unit is not too large compared to the maximum transformation length, the coding unit is used as a unit for prediction and transformation without further splitting. Meanwhile, in the quad tree and multi-type tree described above, at least one of the following parameters may be predefined or transmitted via a RBSP of a higher-level set, such as a PPS, SPS, or VPS. 1) CTU size: The size of the root node of the quad tree, 2) MinQtSize: The minimum allowed QT leaf node size, 3) MaxBtSize: The maximum allowed BT root node size, 4) MaxTT size (MaxTtSize): The maximum allowed TT root node size, 5) MaxMttDepth: The maximum allowed depth of an MTT split from a leaf node of a QT, 6) MinBT size (MinBtSize): The minimum allowed BT leaf node size, 7) MinTT size (MinTtSize): The minimum allowed TT leaf node size.

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

[0066] According to an embodiment of the present invention, a coding tree unit is a root node of a quad tree and can be first split into a quad tree structure. In the quad tree structure, 'qt_split_flag' is signaled for each node 'QT_node'. If the value of 'qt_split_flag' is 1, the node is split into four square nodes, and if the value of 'qt_split_flag' is 0, the node becomes a leaf node 'QT_leaf_node' of the quad tree.

[0067] Each quad tree 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'. If the value of 'mtt_split_flag' is 1, the node is split into multiple rectangular nodes, and if the value of 'mtt_split_flag' is 0, the node becomes a leaf node 'MTT_leaf_node' of the multi-type tree. If the multi-type tree node 'MTT_node' is split into multiple rectangular nodes (i.e., if the value of 'mtt_split_flag' is 1), 'mtt_split_vertical_flag' and 'mtt_split_binary_flag' for the node 'MTT_node' can be additionally signaled. If the value of 'mtt_split_vertical_flag' is 1, vertical splitting of node 'MTT_node' is indicated, and if the value of 'mtt_split_vertical_flag' is 0, horizontal splitting of node 'MTT_node' is indicated. In addition, if the value of 'mtt_split_binary_flag' is 1, node 'MTT_node' is split into two rectangular nodes, and if the value of 'mtt_split_binary_flag' is 0, node 'MTT_node' is split into three rectangular nodes.

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

[0069] First, FIG. 5 illustrates an embodiment of reference samples used for prediction of a current block in an intra prediction mode. According to an embodiment, the reference samples may be samples adjacent to the left boundary and / or samples adjacent to the upper boundary of the current block. As illustrated in FIG. 5, when the size of the current block is WXH and samples of a single reference line adjacent to the current block are used for intra prediction, reference samples may be set using up to 2W+2H+1 surrounding samples located to the left and / or above the current block. According to a further embodiment of the present invention, samples on a plurality of reference lines may be used for intra prediction of the current block. The plurality of reference lines may be composed of n lines located within a preset distance from the boundary of the current block. In this case, separate reference line information indicating at least one reference line used for intra prediction of the current block may be signaled. Specifically, the reference line information may include an index indicating any one of the plurality of reference lines. In addition, if at least some of the samples to be used as reference samples have not yet been restored, the intra prediction unit may perform a reference sample padding process to obtain a reference sample. In addition, the intra prediction unit may perform a reference sample filtering process to reduce an error in intra prediction. That is, filtering may be performed on neighboring samples and / or reference samples obtained by the reference sample padding process to obtain filtered reference samples. The intra prediction unit predicts samples of a current block using unfiltered reference samples or filtered reference samples. In the present disclosure, the neighboring samples may include samples on at least one reference line. For example, the neighboring samples may include neighboring samples on a line adjacent to a boundary of the current block.

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

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

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

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

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

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

[0076] In the above embodiments, the spacing between the extended angular modes may be set based on the spacing between the corresponding basic angular modes. For example, the spacing between the extended angular modes {3, 5, 7, … , 65} may be determined based on the spacing between the corresponding basic angular modes {2, 4, 6, … , 66}. In addition, the spacing between the extended angular modes {-10, -9, … , -1} may be determined based on the spacing between the corresponding opposite basic angular modes {56, 57, … , 65}, and the spacing between the extended angular modes {67, 68, … , 76} may be determined based on the spacing between the corresponding opposite basic angular modes {3, 4, … , 12}. The angular spacing between the extended angular modes may be set to be equal to the angular spacing between the corresponding basic angular modes. In addition, the number of the extended angular modes in the intra prediction mode set may be set to be less than or equal to the number of the basic angular modes.

[0077] According to an embodiment of the present invention, an extended angular mode may be signaled based on a base angular mode. For example, a wide-angle mode (i.e., an extended angular mode) may replace at least one angular mode (i.e., a base angular mode) within a first angular range. The replaced base angular mode may be an angular mode corresponding to an opposite side of the wide-angle mode. That is, the replaced base angular mode is an angular mode corresponding to an angle in an opposite direction to an angle indicated by the wide-angle mode or an angle that is different from the angle in the opposite direction by a preset offset index. According to an embodiment of the present invention, the preset offset index is 1. An intra prediction mode index corresponding to the replaced base angular mode may be remapped to the wide-angle mode to signal the corresponding wide-angle mode. For example, the wide-angle modes {-10, -9, … , -1} may be signaled by intra prediction mode indices {57, 58, … , 66}, and the wide-angle modes {67, 68, … , 66} may be signaled by intra prediction mode indices {57, 58, … , 66}, respectively. , 76} can be signaled by intra prediction mode indices {2, 3, …, 11} respectively.

[0078] FIG. 7 is a diagram illustrating an embodiment of a method for signaling a wide-angle mode. Referring to FIG. 7, the wide-angle mode {67, 68} can replace the basic angular mode {2, 3}. In addition, the wide-angle modes {67, 68} can be signaled by the intra-prediction mode indices {2, 3}, respectively. In this way, by having the intra-prediction mode index for the basic angular mode signal the extended angular mode, the same set of intra-prediction mode indices can be used to signal the intra-prediction mode even if the configuration of the angular modes used for intra-prediction of each block is different. Therefore, the signaling overhead due to changes in the intra-prediction mode configuration can be minimized.

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

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

[0081] Meanwhile, the encoder can signal the selected intra prediction mode information to the decoder. The decoder can extract the intra prediction mode information of the current block from the bitstream. For example, when the total number of intra prediction modes constituting the intra prediction mode set is T (e.g., 67), simply representing the T modes in binary and signaling them is inefficient because it does not consider the probability of each mode being selected and the context of the corresponding block and surrounding blocks. Therefore, an intra prediction mode set consisting of some modes associated with the current block among all modes can be managed separately. Efficient signaling can be performed by reducing the range of intra prediction modes to be signaled. For example, efficient signaling can be performed by separately managing a list of some modes among all modes that are highly likely to have been used in the current block.

[0082] As mentioned above, the angular range of the angular mode used for intra prediction can be set differently depending on the shape of the current block. For example, if the current block is a rectangular block, a wide-angle mode indicating angles exceeding 45 degrees clockwise or less than -135 degrees can be additionally used.

[0083] Fig. 8 is a diagram illustrating an embodiment of a horizontal rectangular block and a vertical rectangular block. Fig. 7(a) shows the positional relationship between a reference sample and a current sample according to an intra prediction mode when the current block is a horizontal rectangular block whose width is greater than its height. Fig. 7(b) shows the positional relationship between a reference sample and a current sample according to an intra prediction mode when the current block is a vertical rectangular block whose height is greater than its width. In Fig. 7, when the wide-angle mode is not used, Width(W)+Height(H)+1 reference samples can be used for each of the upper reference line and the left reference line of the current block.

[0084] FIG. 9 is a diagram illustrating an embodiment of the positional relationship between a current sample and a reference sample of a current block when the current block is rectangular. In one embodiment, when the current block is rectangular, a method of using a wide-angle mode instead of the basic angle mode may be advantageous. This is because prediction performance may be improved when the current sample is predicted using a reference sample that is relatively close to the current sample. In a rectangular block, a reference sample corresponding to the prediction direction indicated by the wide-angle mode may be closer to the current sample than a reference sample corresponding to the opposite direction.

[0085] Specifically, referring to Fig. 9(a), when the current block is a horizontal rectangular block, the current sample (A) is closer to the upper reference sample (T) than to the left reference sample (L). The direction in which the current sample (A) is predicted from the upper reference sample (T) may be a wide-angle mode exceeding 45 degrees in a clockwise direction. In addition, referring to Fig. 9(b), when the current block is a vertical rectangular block, the current sample (A) is closer to the left reference sample (L) than to the upper reference sample (T). The direction in which the current sample (A) is predicted from the left sample (L) may be a wide-angle mode less than -135 degrees in a clockwise direction. In addition, when predicting the current block based on the wide-angle mode, unlike Fig. 8, 2W+1 upper reference samples and 2H+1 left reference samples may be used.

[0086] Fig. 10 is a diagram illustrating an embodiment of a wide-angle mode. The dotted arrows in Fig. 10 indicate the angles indicated by the wide-angle modes of a rectangular block. Referring to Fig. 10(a), the width-to-height ratio of the current block is 2:1, and the shape of the current block is a horizontal rectangle. In this case, the current block can be predicted using wide-angle modes with an angular range exceeding 45 degrees in a clockwise direction. Referring to Fig. 10(b), the width-to-height ratio of the current block is 1:2, and the shape of the current block is a vertical rectangle. In this case, the current block can be predicted using wide-angle modes with an angular range less than -135 degrees in a clockwise direction.

[0087] According to one embodiment of the present invention, the number of wide-angle modes can be determined based on the shape of the current block. Furthermore, basic angular modes to be replaced with the wide-angle modes can be determined based on the number of wide-angle modes. In this case, each of the intra-prediction mode indices indicating the basic angular modes to be replaced can indicate each of the mapped wide-angle modes. For example, the decoder can interpret the intra-prediction mode index of the current block differently depending on the ratio of the current block. Furthermore, the decoder can perform intra-prediction on the current block based on the interpreted intra-prediction mode. Hereinafter, the number of wide-angle modes according to the shape of the current block and the intra-prediction mode indices indicating the wide-angle modes will be described with reference to FIG. 11.

[0088] FIG. 11 is a diagram illustrating an embodiment of the number of wide-angle modes according to the shape of a current block. According to an embodiment, the shape of the current block may be defined based on the width and height of the current block. For example, the shape of the current block may be determined based on the ratio (W / H) of the width and height of the current block. In the present disclosure, the width and height of the current block may be, but are not limited to, the width and height of a transform unit. For example, the width and height of the current block may be the width and height of a coding unit or a prediction unit. According to an embodiment, when the ratio (W / H) is 1, the shape of the current block is square, and the wide-angle mode may not be used. In this case, intra prediction mode indices between 2 and 66 may indicate angular modes within a basic angular range.

[0089] In one embodiment, when the ratio (W / H) is greater than or equal to 2, the shape of the current block may be a horizontal rectangle, and the number of wide-angle modes may be at least 6. When the ratio (W / H) is 2, each of the indices {2, 3, 4, 5, 6, 7} from 2, which is the smallest index among the intra prediction mode indices indicating the angular mode, may indicate wide-angle modes having an angular range exceeding 45 degrees in a clockwise direction. In addition, when the ratio (W / H) exceeds 2, each of the indices from 2, which is the smallest index, to (M+1) may indicate wide-angle modes having an angular range exceeding 45 degrees in a clockwise direction. In this case, M may be the number of wide-angle modes determined according to the ratio (W / H). In addition, the number of wide-angle modes may be at most 14.

[0090] In one embodiment, when the ratio (W / H) is less than or equal to 1 / 2, the shape of the current block may be a vertical rectangle, and the number of wide-angle modes may be at least 6. When the ratio (W / H) is 1 / 2, each of the indices {61, 62, 63, 64, 65, 66} from 61 to 66, which is a largest index among the intra prediction mode indices indicating angular modes, may indicate wide-angle modes having an angular range less than -135 degrees in a clockwise direction. In addition, when the ratio (W / H) is less than 1 / 2, each of the indices from 66, which is a smallest index, to (67-M) may indicate wide-angle modes having an angular range less than -135 degrees in a clockwise direction. In this case, M may be the number of wide-angle modes determined according to the ratio (W / H).

[0091] Meanwhile, when the intra prediction unit generates a prediction block of the current block using reference samples of the current block, discontinuities may occur at the boundaries between the prediction block and the reference samples. This can degrade subjective image quality and reduce encoding efficiency. Therefore, boundary filtering may be performed on the boundaries of the prediction block generated using the reference samples. Boundary filtering can reduce discontinuities between the prediction block and the reference samples.

[0092] Alternatively, to alleviate discontinuities, position-dependent intra prediction combination (PDPC) may be applied to the prediction block of the current block. For example, a final prediction sample may be generated by combining an intermediate prediction sample before the aforementioned boundary filtering is performed and at least one reference value corresponding to the current sample of the current block. At this time, the reference value may be a value obtained from an unfiltered sample value of at least one reference sample corresponding to the current sample among the reference samples. In addition, at least one reference sample corresponding to the current sample may be determined based on the position of the current sample. Here, the position of the current sample represents a relative position with respect to the upper-leftmost sample within the current block. PDPC may also be referred to as position-dependent intra prediction sample filtering. Through this, the encoder and decoder can generate a final prediction block with reduced discontinuities between the prediction block and the reference samples without performing separate boundary filtering on the boundaries of the prediction block. Hereinafter, reference sample means an unfiltered reference sample unless otherwise specified, and reference sample value may mean an unfiltered sample value.

[0093] Hereinafter, with reference to FIGS. 12 to 15, a method for generating a final prediction block using PDPC will be described. FIG. 12 is a diagram illustrating an embodiment of a method for generating a final prediction sample of a current sample included in a current block using PDPC. Referring to FIG. 12, a first prediction sample (q), which is an intermediate prediction sample of the current sample, can be generated based on an intra-prediction mode for the current block. The encoder and decoder can generate the first prediction sample of the current block based on the intra-prediction mode of the current block as described above with reference to FIGS. 5 to 7.

[0094] Next, a second prediction sample (p), which is a final prediction sample of the current sample, can be generated based on the sample value (q[x, y]) of the first prediction sample and at least one reference value. The encoder and the decoder can determine the value (p[x, y]) of the second prediction sample based on the sample value (q[x, y]) of the first prediction sample and at least one reference value. At this time, the reference value may be a value obtained based on an unfiltered sample value of at least one reference sample corresponding to the current sample. For example, the at least one reference value may include at least one of a left reference value, an upper reference value, or an upper-left reference value. Here, the left reference value may be a value obtained based on at least one left reference sample corresponding to the current sample among the left reference samples of the current block. In addition, the upper reference value may be a value obtained based on at least one upper reference sample corresponding to the current sample among the upper reference samples of the current block. In addition, the upper-left reference value may be a sample value of the upper-left reference sample of the current block.

[0095] According to one embodiment, at least one reference sample corresponding to a current sample may be determined based on at least one of a shape of the current block, an intra-prediction mode index of the current block, or an intra-prediction mode of the current block. For example, the encoder and the decoder may determine at least one reference sample corresponding to the current sample based on the intra-prediction mode of the current block. In addition, the position of the at least one reference sample corresponding to each of the samples included in one block may vary depending on the position (x, y) of each sample. In addition, a method for obtaining a reference value from a reference sample may vary depending on at least one of a shape of the current block, an intra-prediction mode index of the current block, or an intra-prediction mode of the current block. A method for determining a reference sample corresponding to a current sample and a method for obtaining a reference value will be described in detail with reference to FIGS. 13 to 15.

[0096] According to one embodiment, the encoder and decoder may generate the second prediction sample (p) by linearly combining the sample values ​​(q[x, y]) of the first prediction sample and at least one reference value corresponding to the current sample. For example, the values ​​(q[x, y]) of the first prediction sample and the at least one reference value may be linearly combined based on a PDPC parameter set including one or more PDPC parameters. For convenience of explanation, the linear combination between the values ​​(q[x, y]) of the first prediction sample and the at least one reference value may be referred to as PDPC linear combination hereinafter. The PDPC parameter set may include parameters applied to each of the at least one reference value. Specifically, the PDPC parameter set may be composed of parameters applied to each of the left reference value, the upper reference value, and the upper-left reference value. In addition, in linearly combining the sample values ​​of the first prediction sample and the at least one reference value, a weight applied to the sample values ​​of the first prediction sample may be determined based on parameters included in the PDPC parameter set.

[0097] According to one embodiment, each of the PDPC parameters may be a value that varies depending on the position of the current sample. For example, a first parameter applied to a left reference value may be set to have a smaller value as the position of the current sample is farther from the left boundary of the current block. In addition, a second parameter applied to an upper reference value may be set to have a smaller value as the position of the current sample is farther from the upper boundary of the current block. In addition, a third parameter applied to an upper left reference value may be set to have a smaller value as the position of the current sample is farther from the upper left sample of the current block. In this case, a weight applied to a sample value of the first prediction sample may be set to have a larger value as the position of the current sample is farther from the left or upper boundary. For example, a weight applied to a sample value of the first prediction sample may be determined based on a value obtained by subtracting the first parameter and the second parameter from a preset offset. Parameters included in a PDPC parameter set may be obtained through addition and shift operations.

[0098] According to one embodiment of the present invention, a PDPC parameter set may be set differently depending on the intra prediction mode. For example, a final prediction sample may be generated based on some of the left reference value, the upper reference value, and the upper left reference value depending on the intra prediction mode of the current block. In this case, a parameter applied to an unused reference value may be set to a preset value. The preset value may be '0'. Furthermore, according to one embodiment of the present invention, a PDPC parameter set corresponding to specific intra mode indices may be set differently depending on the shape of the current block. This will be described in detail with reference to FIGS. 17 to 21.

[0099] The PDPC linear combination method according to one embodiment is expressed by a mathematical formula as shown in [Mathematical Formula 1] below. In [Mathematical Formula 1], pred'(x, y) represents a sample value of a second prediction sample, and pred(x, y) represents a sample value of a first prediction sample. In addition, RL[x][y] represents a left reference value corresponding to the position (x, y) of the current sample of the current block. In addition, RT[x][y] represents an upper reference value corresponding to the position (x, y) of the current sample of the current block. R[-1][-1] represents a sample value of the upper-left reference sample of the current block. In addition, wL, wT, and wTL represent parameters applied to the left reference value, the upper reference value, and the upper-left reference value, respectively.

[0100] [Mathematical Formula 1]

[0101] pred'(x,y) = (wL x RL[x][y] + wT x RT[x][y] - wTL x R[-1][-1] + (64 - wL - wT + wTL)

[0102] When the final prediction block is generated through PDPC linear combination, additional filtering, such as boundary filtering performed on prediction blocks predicted based on the DC mode in the HEVC standard or edge filtering performed on prediction blocks predicted based on the horizontal / vertical mode, may not be performed.

[0103] According to one embodiment of the present invention, PDPC can be applied to some prediction modes among all intra prediction modes constituting the intra prediction mode set. For example, PDPC can be used to generate a final prediction block when the prediction mode of the current block is any one of the DC mode, the planar mode, or some angular modes to which PDPC is applied. For example, some angular modes to which PDPC is applied can include the horizontal mode, the vertical mode, the vertical diagonal mode, and the horizontal diagonal mode as illustrated in FIG. 6. In addition, some angular modes to which PDPC is applied can include horizontal diagonal peripheral modes around the horizontal diagonal mode and vertical diagonal peripheral modes around the vertical diagonal mode.

[0104] According to one embodiment, the horizontal diagonal peripheral mode set may be composed of horizontal diagonal peripheral modes within a first PDPC angular range based on a prediction direction indicated by the horizontal diagonal mode. The horizontal diagonal peripheral modes may be some angular modes among angular modes between the horizontal diagonal mode and the horizontal mode. In addition, the first PDPC angular range may be between the horizontal diagonal mode and the first angular mode. In this case, the first angular mode may be any one of the angular modes between the horizontal diagonal mode and the horizontal mode. When the intra prediction mode of the current block is the horizontal diagonal peripheral mode, an intermediate prediction sample may be generated using only the left reference sample around the left boundary based on the boundary of the current block.

[0105] In addition, the vertical diagonal peripheral mode set may be composed of vertical diagonal peripheral modes within a second PDPC angular range based on the prediction direction indicated by the vertical diagonal mode. The vertical diagonal peripheral modes may be some angular modes among angular modes between the vertical mode and the vertical diagonal mode. In addition, the second PDPC angular range may be between the vertical diagonal mode and the second angular mode. In this case, the second angular mode may be any one of the angular modes between the vertical mode and the vertical diagonal mode. When the intra prediction mode of the current block is the vertical diagonal peripheral mode, an intermediate prediction sample may be generated using only upper reference samples around the upper boundary based on the boundary of the current block.

[0106] Meanwhile, the reference values ​​and PDPC parameter sets used to perform PDPC linear combination may be determined differently depending on the intra prediction mode of the current block. Below, a method for applying PDPC depending on the intra prediction mode of the current block is described in detail with reference to FIGS. 13 to 15 .

[0107] FIG. 13 is a diagram illustrating an embodiment of a method for applying PDPC when the intra prediction mode of the current block is any one of the DC mode, the planar mode, the vertical mode, and the horizontal mode. According to an embodiment, when the intra prediction mode of the current block is any one of the DC mode, the planar mode, the vertical mode, and the horizontal mode, at least one reference sample corresponding to the current sample (x, y) may include a first reference sample located on the same line as the current sample among the left reference samples of the current block. At this time, the left reference value may be a sample value (R[-1][y]) of the first reference sample. In addition, at least one reference sample corresponding to the current sample may include a second reference sample located on the same line as the current sample among the upper reference samples of the current block. At this time, the upper reference value may be a sample value (R[x][-1]) of the second reference sample. In addition, at least one reference sample corresponding to the current sample may include an upper-left reference sample of the current sample. At this time, the upper left reference value may be the sample value (R[-1][-1]) of the upper left reference sample.

[0108] According to one embodiment, when the intra prediction mode of the current block is the DC mode, the first parameter (wL) applied to the left reference value, the second parameter (wT) applied to the upper reference value, and the third parameter (wTL) applied to the upper left reference value may be determined as in [Mathematical Formula 2]. In addition, when the intra prediction mode of the current block is any one of the planar mode, the vertical mode, and the horizontal mode, the first parameter (wL) and the second parameter (wT) may be as in [Mathematical Formula 2], and the third parameter (wTL) may be set to '0'.

[0109] [Equation 2]

[0110] wT[y] = 32 >> ( ( y<<1 ) >> shift ),

[0111] wL[x] = 32 >> ( ( x<<1 ) >> shift ),

[0112] wTL[x][y] = ( wL[x]>>4 ) + ( wT[y]>>4 ),

[0113] Here, shift = (log2(width) - 2 + log2(height) - 2 + 2) >> 2, where width is the width of the current block and height is the height of the current block.

[0114] FIG. 14 is a diagram illustrating an embodiment of a method for applying PDPC when the intra prediction mode of a current block is a horizontal diagonal mode or a vertical diagonal mode. According to an embodiment, when the intra prediction mode of the current block is either a horizontal diagonal mode or a vertical diagonal mode, at least one reference sample corresponding to a current sample may include a first reference sample at a position where a diagonal direction intersects a left reference line based on a position (x', y') of the current sample. The position of the first reference sample may be (-1, x'+y'+1). In this case, the left reference value may be a sample value (R[-1][x'+y'+1]) of the first reference sample. In addition, at least one reference sample corresponding to a current sample may include a second reference sample at a position where a diagonal direction intersects an upper reference line based on a position (x', y') of the current sample. The position of the second reference sample may be (x'+y'+1, -1). At this time, the upper reference value may be the sample value (R[x'+y'+1][-1]) of the second reference sample. In addition, if the intra prediction mode of the current block is either the horizontal diagonal mode or the vertical diagonal mode, the upper left reference sample of the current block may not be used to generate the final prediction block.

[0115] According to one embodiment, when the intra prediction mode of the current block is either a horizontal diagonal mode or a vertical diagonal mode, the first parameter (wL) applied to the left reference value, the second parameter (wT) applied to the upper reference value, and the third parameter (wTL) applied to the upper left reference value may be determined as in [Mathematical Formula 3].

[0116] [Equation 3]

[0117] wT[y] = 16 >> ( ( y<<1 ) >> shift ),

[0118] wL[x] = 16 >> ( ( x<<1 ) >> shift ),

[0119] wTL[x][y] = 0

[0120] Here, shift = (log2(width) - 2 + log2(height) - 2 + 2) >> 2, where width is the width of the current block and height is the height of the current block.

[0121] FIG. 15 is a diagram illustrating one embodiment of a method for applying PDPC when the intra prediction mode of the current block is one of horizontal diagonal peripheral modes and vertical diagonal peripheral modes. According to one embodiment, when the intra prediction mode of the current block is one of horizontal diagonal peripheral modes and vertical diagonal peripheral modes, at least one reference value may be obtained based on at least one reference sample corresponding to an angle in the opposite direction to the prediction direction indicated by the intra prediction mode of the current block.

[0122] Referring to FIG. 15(a), when the intra prediction mode of the current block is any one of the horizontal diagonal peripheral modes, the decoder may determine at least one reference sample corresponding to the current sample among the upper reference samples. The decoder may determine a first position (x, -1) at which the intra prediction direction of the current block and the upper reference line intersect each other based on the position (x', y') of the current sample. At this time, the upper reference line may be a reference line determined based on reference line information among a plurality of reference lines. In addition, the decoder may determine at least one reference sample corresponding to the first position among the upper reference samples included in the upper reference line. According to one embodiment, when the first position is a position in integer sample units, the decoder may obtain a reference value corresponding to the current sample based on a sample value of the reference sample at the first position. For example, the reference value corresponding to the current sample may be a sample value of the reference sample at the first position.

[0123] The first position may not correspond to a position in integer sample units depending on the position of the current sample. The first position may be a position between two adjacent integer samples. That is, the first position may be represented by a combination of iIdx indicating a position in integer sample units and iFact indicating a position in subpel units between two adjacent integer samples. At this time, the position iIdx in integer sample units may represent a smaller index among two adjacent integer samples. In addition, iFact may represent a position (0 to N-1) in units of 1 / N that divides the space between two adjacent integer samples into N equal parts. At this time, N may be an even number. According to one embodiment of the present invention, N may be 32 or 64. Specifically, when the position of the current sample is (x, y), 'iIdx=(((x or y)+1)*intraPredAngle)>>5' and 'iFact=((x or y)+1)*intraPredAngle)&31' may be true. Here, '>>' may mean a right shift operation, and '&' may mean a remainder operation. In addition, intraPredAngle may be a value obtained by taking a tangent function on the prediction direction angle of the intra prediction mode and multiplying it by 32 or 64. According to one embodiment, when the first position is between different adjacent first reference samples and second reference samples, the decoder may obtain a reference value corresponding to the first position based on the positional relationship between the first position, the first reference sample, and the second reference sample.

[0124] For example, the decoder can interpolate the sample values ​​of each of the first reference sample and the second reference sample to generate a reference value corresponding to the current sample. For example, the decoder can interpolate the sample values ​​of each of the first reference sample and the second reference sample based on a first distance between the first position and the first reference sample and a second distance between the first position and the second reference sample. At this time, the first distance and the second distance may be values ​​in units of 1 / N determined based on iFact. For example, if the index of the first reference sample is smaller than the index of the second reference sample and the iFact of the first position is iFact_1, the first distance may be (iFact_1) and the second distance may be (N-iFact_1). As described above, when N is an even number, it is difficult for the first distance and the second distance to be the same. The first weight applied to the sample value of the first reference sample may be determined based on the first distance. The second weight applied to the sample value of the second reference sample may be determined based on the second distance. At this time, the first weight and the second weight may be set to have a larger value as the value gets closer to the first position. In addition, the sum of the first weight and the second weight may be a preset value. In this case, the preset value may be 64. In addition, the decoder may generate a reference value corresponding to the current sample based on the first weight, the second weight, and the sample values ​​of each of the first reference sample and the second reference sample.

[0125] According to another embodiment, even if the first position is between different adjacent first reference samples and second reference samples, the decoder can obtain the reference value using only the iIdx of the first position. In this case, the decoder can determine which of the sample values ​​of the first reference sample and the second reference sample to use as the reference value based on the first position. For example, the decoder can determine the reference sample closest to the first position among the first reference sample and the second reference sample based on the first distance and the second distance described above. In this case, the decoder can obtain the reference value corresponding to the current sample based on the sample value of the reference sample closest to the first position. For example, the reference value of the current sample can be the sample value of the reference sample corresponding to a shorter distance among the first distance and the second distance described above.

[0126] In one embodiment, if the intra prediction mode of the current block is one of the horizontal diagonal peripheral modes, at least one reference value corresponding to the current sample may not include a left reference value and an upper left reference value. In this case, the first parameter (wL) applied to the left reference value and the third parameter (wTL) applied to the upper left reference value may be set to '0'. In addition, the second parameter (wT) applied to the upper reference value may be set as in [Mathematical Formula 4].

[0127] [Equation 4]

[0128] wT[y] = 32 >> ( ( y<<1 ) >> shift ),

[0129] wL[x] = 0,

[0130] wTL[x][y] = 0,

[0131] Here, shift = (log2(width) - 2 + log2(height) - 2 + 2) >> 2, where width is the width of the current block and height is the height of the current block.

[0132] Referring to FIG. 15(b), when the intra prediction mode of the current block is any one of the vertical diagonal peripheral modes, the decoder can determine at least one reference sample corresponding to the current sample among the left samples. The decoder can determine a second position (-1, y) where the intra prediction direction of the current block and the left reference line intersect each other based on the position (x', y') of the current sample. At this time, the left reference line may be a reference line determined based on reference line information among a plurality of reference lines. In addition, the decoder can determine at least one reference sample corresponding to the second position among the left reference samples included in the left reference line. In addition, the decoder can obtain a reference value corresponding to the current sample by a method identical to or corresponding to the method described with reference to FIG. 10(a).

[0133] In one embodiment, if the intra prediction mode of the current block is one of the vertical diagonal peripheral modes, at least one reference value corresponding to the current sample may not include an upper reference value and an upper left reference value. In this case, the second parameter (wT) applied to the upper reference value and the third parameter (wTL) applied to the upper left reference value may be set to '0'. In addition, the first parameter (wL) applied to the left reference value may be set as in [Mathematical Formula 5].

[0134] [Equation 5]

[0135] wL[x] = 32 >> ( ( x<<1 ) >> shift ),

[0136] wT[y] =0,

[0137] wTL[x][y] = 0,

[0138] Here, shift = (log2(width) - 2 + log2(height) - 2 + 2) >> 2, where width is the width of the current block and height is the height of the current block.

[0139] According to an additional embodiment of the present invention, when the intra prediction mode of the current block is the aforementioned wide-angle mode, the decoder may determine whether to use PDPC based on an indicator received from the encoder. This is because applying PDPC even in the wide-angle mode to generate the final prediction block of the current block can improve prediction performance.

[0140] In one embodiment, the encoder may signal an indicator indicating whether PDPC is applied to wide-angle modes. If the intra prediction mode of the current block is the wide-angle mode, the decoder may determine whether PDPC is applied based on the indicator indicating whether PDPC is applied to the wide-angle modes. For example, the indicator indicating whether PDPC is applied to the wide-angle modes may be signaled through an RBSP of a higher-level set. Here, the RBSP of the higher-level set may be any one of a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS) as described above. In addition, the indicator indicating whether PDPC is applied to the wide-angle modes may be signaled for each unit of at least one of a slice / tile, a CTU, or a CU.

[0141] In another embodiment, the encoder may signal a second indicator (pdpc_wide_angle flag) indicating whether PDPC is applied to wide-angle modes separately from the first indicator (pdpc_sps_flag) indicating whether PDPC is applied during intra prediction. In this case, the decoder may interpret the first and second indicators independently. For example, if the first indicator is disabled and the second indicator is enabled, the decoder may apply PDPC only to wide-angle modes. Conversely, if the first indicator is enabled and the second indicator is disabled, the decoder may apply PDPC to preset modes excluding wide-angle modes.

[0142] Fig. 16 is a diagram illustrating an embodiment of a method for applying PDPC when the current block is a rectangular block. According to an embodiment of the present invention, when the intra prediction mode of the current block is a wide-angle mode, at least one reference value corresponding to the current sample can be obtained based on the prediction direction indicated by the wide-angle mode. For example, the wide-angle modes can be divided into upper wide-angle modes (Fig. 16 (a)) that refer to the upper reference sample and left wide-angle modes (Fig. 16 (b)) that refer to the left reference sample according to the prediction direction.

[0143] According to one embodiment, when the intra prediction mode of the current block is the upper wide-angle mode, the reference value may be obtained by a method identical to or corresponding to the method used when the intra prediction mode of the current block is the vertical diagonal peripheral mode (Fig. 15(b)). For example, the decoder may determine a position (L) where the intra prediction direction of the current block and the left reference line intersect each other based on the position of the current sample (A). At this time, the left reference line may be a reference line determined based on reference line information among a plurality of reference lines. The decoder may obtain the left reference value based on at least one reference sample corresponding to the position (L). In addition, the decoder may linearly combine the intermediate prediction sample and the left reference value to generate a final prediction sample.

[0144] According to another embodiment, when the intra prediction mode of the current block is the left wide-angle mode, the reference value may be obtained by a method identical to or corresponding to the method used when the intra prediction mode of the current block is the horizontal diagonal peripheral mode (Fig. 15(a)). For example, the decoder may determine a position (L) where the intra prediction direction of the current block and the upper reference line intersect each other based on the position of the current sample (A). At this time, the upper reference line may be a reference line determined based on reference line information among a plurality of reference lines. The decoder may obtain the upper reference value based on at least one reference sample corresponding to the position (L). In addition, the decoder may linearly combine the intermediate prediction sample and the upper reference value to generate a final prediction sample. In Fig. 16, the position (L) is illustrated as a position in integer sample units, but may also be a position in subpel units.

[0145] As described above, even if the intra prediction mode of the current block is a wide-angle mode, the final prediction block can be generated by applying PDPC. In one embodiment, the intra prediction mode set can include a wide-angle mode. In this case, some of the intra prediction mode indices can indicate different intra prediction modes depending on the shape of the current block. For example, a specific index can indicate a vertical diagonal mode if the current block is a square block or a vertical rectangular block, and can indicate any one of the wide-angle modes with an angle exceeding 45 degrees clockwise if the current block is a horizontal rectangular block. Hereinafter, a method for generating the final prediction block by applying PDPC when the intra prediction mode set includes a wide-angle mode will be described.

[0146] According to one embodiment of the present invention, an intra prediction mode for a current block may be indicated by one of the intra prediction mode indices included in a specific index set. Here, each of at least one intra prediction mode index included in the specific index set may be mapped to a plurality of angular modes indicating different directions. In this case, the intra prediction mode for the current block may be a specific angular mode according to the shape of the current block among the plurality of angular modes mapped to the intra prediction mode index. Based on the specific angular mode, the decoder may obtain at least one reference value corresponding to the current sample by the method described above with reference to FIGS. 12 to 16. In addition, the decoder may generate a final prediction sample using the obtained at least one reference value.

[0147] According to one embodiment, the specific index set may be a first index set composed of intra prediction mode indices that are greater than a smallest index among the intra prediction mode indices indicating the angular mode and equal to or smaller than a preset first index. The smallest index among the intra prediction mode indices indicating the angular mode may be {2}. In addition, the first index may be a value set based on the number of preset wide-angle modes when the longer side of the width and height of the current block is twice the shorter side. For example, when the number of preset wide-angle modes is N, the first index may be the Nth index (2+N-1) in ascending order from index 2. According to one embodiment of the present invention, the number of preset wide-angle modes may be 6, and the first index may be {7}.

[0148] According to one embodiment, the specific index set may be a second index set composed of intra prediction mode indices that are smaller than a largest index among the intra prediction mode indices indicating the angular mode and greater than or equal to a preset second index. The largest index among the intra prediction mode indices indicating the angular mode may be {66}. In addition, the second index may be a value set based on the number of preset wide-angle modes when the longer side of the width and height of the current block is twice the shorter side. For example, when the number of preset wide-angle modes is N, the second index may be the Nth index (66-N+1) in descending order from the index 66. According to one embodiment of the present invention, the number of preset wide-angle modes is 6, and the second index may be {61}.

[0149] In one embodiment, the specific index set may be a third index set consisting of the smallest index among the intra prediction mode indices indicating the angular mode. Additionally, the specific index set may be a fourth index set consisting of the smallest index among the intra prediction mode indices indicating the angular mode.

[0150] Additionally, the decoder can perform the aforementioned PDPC linear combination based on the PDPC parameter set corresponding to a specific index set. The decoder can generate the final prediction sample of the current block through the PDPC linear combination. According to one embodiment of the present invention, the PDPC parameter set corresponding to a specific index set may vary depending on the shape of the current block. Hereinafter, the PDPC parameter set corresponding to each index set will be described with reference to FIGS. 17 to 20.

[0151] According to one embodiment, when the shape of the current block is a vertical rectangle, the PDPC parameter set corresponding to the specific index set may be a first parameter set. In this case, the first parameter set may be a PDPC parameter set in which a parameter applied to an upper reference value obtained from an upper reference sample of the current block is set to a non-zero value for at least some of the samples constituting the current block. For example, the first parameter set may be a PDPC parameter set applied when the intra prediction mode of the current block is a horizontal diagonal peripheral mode. That is, the first parameter set may be the same parameter set as [Mathematical Formula 4] described above with reference to FIG. 15.

[0152] According to one embodiment, when the shape of the current block is a horizontal rectangle, the PDPC parameter set corresponding to a specific index set may be a second parameter set. In this case, the first parameter set and the second parameter set may be different PDPC parameter sets. In addition, the second parameter set may be a PDPC parameter set in which a parameter applied to a left reference value obtained from a left reference sample of the current block is set to a non-zero value for at least some of the samples constituting the current block. For example, the second parameter set may be a PDPC parameter set applied when the intra prediction mode of the current block is a vertical diagonal peripheral mode. That is, the second parameter set may be the same parameter set as [Mathematical Formula 5] described above with reference to FIG. 15.

[0153] According to a specific embodiment, the PDPC parameter set corresponding to the first index set may be the first parameter set if the current block is a square block or a vertical rectangular block. Additionally, the PDPC parameter set corresponding to the first index set may be the second parameter set if the current block is a horizontal rectangular block.

[0154] According to a specific embodiment, the PDPC parameter set corresponding to the second index set may be the second parameter set if the current block is a square block or a horizontal rectangular block. Additionally, the PDPC parameter set corresponding to the second index set may be the first parameter set if the current block is a vertical rectangular block.

[0155] According to a specific embodiment, the PDPC parameter set corresponding to the third index set may be the third parameter set when the current block is a square block or a vertical rectangular block. The third parameter set may be a PDPC parameter set applied when the intra prediction mode of the current block is a horizontal diagonal mode or a vertical diagonal mode. That is, the third parameter set may be the same parameter set as [Mathematical Formula 3] described above with reference to FIG. 14. In addition, the PDPC parameter set corresponding to the third index set may be the second parameter set when the current block is a horizontal rectangular block.

[0156] According to a specific embodiment, the PDPC parameter set corresponding to the fourth index set may be the third parameter set if the current block is a square block or a vertical rectangular block. Additionally, the PDPC parameter set corresponding to the fourth index set may be the first parameter set if the current block is a horizontal rectangular block.

[0157] Fig. 17 is a diagram showing an embodiment of a PDPC parameter set according to the shape of the current block for each intra prediction mode index. Fig. 17(a) shows a PDPC parameter set used for each intra prediction mode index when the width and height ratio (W / H) of the current block is 1. Referring to Fig. 17(a), when the intra prediction mode index of the current block is any one of the first index sets {3, ..., 7}, PDPC linear combination may be performed based on the first parameter set. In addition, when the intra prediction mode index of the current block is any one of the second index sets {61, ..., 65}, PDPC linear combination may be performed based on the second parameter set. In addition, the PDPC parameter sets corresponding to the third index set {2} and the fourth index set {66} may be the third parameter set.

[0158] Fig. 17(b) shows a PDPC parameter set used for each intra prediction mode index when the width and height ratio (W / H) of the current block is 2. Referring to Fig. 17(b), when the intra prediction mode index of the current block is any one of the third index set {2}, the first index set {3, ..., 7}, and the second index set {61, ..., 65}, PDPC linear combination may be performed based on the second parameter set. In addition, the PDPC parameter set corresponding to the fourth index set {66} may be the third parameter set.

[0159] Also, if the width to height ratio (W / H) of the current block is 1 / 2: i) If the intra prediction mode index of the current block is any one of the third index set {2}, the first index set {3, ..., 7}, and the second index set {61, ..., 65}, PDPC linear combination may be performed based on the first parameter set. ii) If the intra prediction mode index of the current block is the fourth index set, PDPC linear combination may be performed based on the third parameter set.

[0160] According to a further embodiment of the present invention, when the longer side of the width and height of the current block exceeds twice the shorter side, intra prediction mode indexes indicating different intra prediction modes may be added depending on the shape of the current block. For example, at least one intra prediction mode index may indicate any one of the basic angle modes when the ratio between the width and height (W / H) of the current block is less than or equal to 2, and may indicate any one of the wide-angle modes when the ratio (W / H) exceeds 2. In this case, the number of added indexes may be determined based on the number of wide-angle modes preset for each width and height ratio of the current block.

[0161] For example, if the width-to-height ratio of the current block is 3 or 1 / 3, the number of preset wide-angle modes may be 9, which is 3 more than when the width-to-height ratio of the current block is 2 or 1 / 2. That is, the fifth index set {8, 9, 10} and the sixth index set {58, 59, 60} may indicate any one of the basic angle modes when the width-to-height ratio (W / H) of the current block is less than 3, and may indicate any one of the wide-angle modes when the ratio (W / H) is 3 or greater. Accordingly, if the width-to-height ratio of the current block is 3 or greater and the intra-prediction mode index of the current block is any one of the fifth indices {8, 9, 10}, PDPC linear combination may be performed based on the second parameter set. In contrast, if the width-to-height ratio (W / H) of the current block is less than 3 and the intra prediction mode index of the current block is one of the fifth indices {8, 9, 10}, PDPC linear combination may be performed based on the first parameter set.

[0162] Additionally, if the width-to-height ratio of the current block is less than or equal to 1 / 3 and the intra prediction mode index of the current block is any one of the sixth indices {58, 59, 60}, PDPC linear combination may be performed based on the first parameter set. Conversely, if the width-to-height ratio (W / H) of the current block is greater than 1 / 3 and the intra prediction mode index of the current block is any one of the fifth indices {8, 9, 10}, PDPC linear combination may be performed based on the second parameter set.

[0163] In addition, when the width-to-height ratio of the current block is 4 or 1 / 4, the number of preset wide-angle modes may be 10, which is one more than when the width-to-height ratio of the current block is 3 or 1 / 3. That is, the indices {11} and {57} may be indices indicating the basic angle mode or the wide-angle mode depending on the shape of the current block. When the width-to-height ratio of the current block is 4 or more and the intra-prediction mode index of the current block is {11}, PDPC linear combination may be performed based on the second parameter set. When the width-to-height ratio of the current block is less than 4 and the intra-prediction mode index of the current block is {11}, PDPC may not be applied. When the width-to-height ratio of the current block is 1 / 4 or less and the intra-prediction mode index of the current block is {57}, PDPC linear combination may be performed based on the first parameter set. If the ratio of the width and height of the current block exceeds 1 / 4 and the intra prediction mode index of the current block is {57}, PDPC may not be applied.

[0164] Alternatively, if the longer side of the current block exceeds twice the shorter side, the number of wide-angle modes can be fixed to a specific number. For example, the preset number can be up to 14. For convenience of explanation, the following example assumes a preset number of 10.

[0165] In one embodiment, when the width to height ratio (W / H) of the current block exceeds 2: when the intra prediction mode index of the current block is any one of the first index set {3, ..., 7} and the indices {8, ..., 11}, PDPC linear combination may be performed based on the second parameter set. Furthermore, when the intra prediction mode index of the current block is any one of the second index set {61, ..., 65} and the indices {58, ..., 60}, PDPC linear combination may be performed based on the second parameter set. Furthermore, when the intra prediction mode index of the current block is the index {57}, PDPC may not be applied.

[0166] According to another embodiment, when the width to height ratio (W / H) of the current block is less than 1 / 2: when the intra prediction mode index of the current block is one of the first index set {3, ..., 7} and the indices {8, ..., 10}, PDPC linear combination may be performed based on the first parameter set. In addition, when the intra prediction mode index of the current block is the index {11}, PDPC may not be applied. In addition, when the intra prediction mode index of the current block is one of the second index set {61, ..., 65} and the indices {57, ..., 60}, PDPC linear combination may be performed based on the first parameter set.

[0167] FIG. 18 is a diagram illustrating another embodiment of a PDPC parameter set according to the shape of the current block for each intra prediction mode index. According to one embodiment, when the intra prediction mode of the current block is a wide-angle mode, a third parameter set may be used. In this case, the third parameter set may be a set used when the intra prediction mode of the current block is a vertical diagonal mode or a horizontal diagonal mode. Accordingly, a PDPC parameter set corresponding to a specific index set may be set in a different manner from FIG. 17 depending on the shape of the current block.

[0168] Fig. 18(a) shows a PDPC parameter set used for each intra prediction mode index when the width and height ratio (W / H) of the current block is 1. Referring to Fig. 18(a), when the intra prediction mode index of the current block is any one of the first index set {3, ..., 7}, PDPC linear combination can be performed based on the first parameter set. In addition, when the intra prediction mode index of the current block is any one of the second index set {61, ..., 65}, PDPC linear combination can be performed based on the second parameter set.

[0169] Fig. 18(b) shows the PDPC parameter sets used for each intra prediction mode index when the width and height ratio (W / H) of the current block is 2. Referring to Fig. 18(b), when the intra prediction mode index of the current block is any one of the first index sets {3, ..., 7}, PDPC linear combination can be performed based on the third parameter set. In addition, when the intra prediction mode index of the current block is any one of the second index sets {61, ..., 65}, PDPC linear combination can be performed based on the second parameter set.

[0170] In addition, when the width-to-height ratio (W / H) of the current block is 1 / 2 and the intra prediction mode index of the current block is one of the first index set {3, ..., 7}, PDPC linear combination can be performed based on the first parameter set. In addition, when the width-to-height ratio (W / H) of the current block is 1 / 2 and the intra prediction mode index of the current block is one of the second index set {61, ..., 65}, PDPC linear combination can be performed based on the third parameter set.

[0171] According to a further embodiment of the present invention, the number of angular modes constituting each of the aforementioned horizontal diagonal peripheral mode set and vertical diagonal peripheral mode set may be set differently depending on the shape of the current block. For example, if the longer side among the width and height of the current block is twice the shorter side, the number of angular modes constituting each of the horizontal diagonal peripheral mode set and the vertical diagonal peripheral mode set may be set to N. According to one embodiment of the present invention, N may be 8. In addition, if the longer side among the width and height of the current block is more than twice the shorter side, the number of angular modes constituting each of the horizontal diagonal peripheral mode set and the vertical diagonal peripheral mode set may be set to M. In this case, M may be an integer at least greater than N. For example, M may be 10. In addition, the number of angular modes constituting the horizontal diagonal peripheral mode set and the number of angular modes constituting the vertical diagonal peripheral mode set may be set differently from each other. For example, if the width of the current block is greater than the height, the number of angular modes constituting the horizontal diagonal peripheral mode set may be set to be greater than the number of angular modes constituting the vertical diagonal peripheral mode set. Conversely, if the height of the current block is greater than the width, the number of angular modes constituting the horizontal diagonal peripheral mode set may be set to be greater than the number of angular modes constituting the vertical diagonal peripheral mode set.

[0172] Figure 19 is a diagram illustrating an example of an angular mode to which PDPC is applied when the basic angular mode is replaced by a wide-angle mode depending on the shape of the current block. Each of the horizontal diagonal peripheral mode set and the vertical diagonal peripheral mode set may include a preset number of basic angular modes. For convenience of explanation, the following description will be given as an example where the preset number is eight.

[0173] Fig. 19 (a) illustrates how the composition of the horizontal diagonal peripheral mode set changes when some of the fundamental angular modes included in the horizontal diagonal peripheral mode set are replaced by wide-angle modes. When the shape of the current block is a horizontal rectangular block, some of the fundamental angular modes included in the horizontal diagonal peripheral mode set can be replaced by wide-angle modes with angles exceeding 45 degrees in the clockwise direction. In this case, the horizontal diagonal peripheral mode set can be reconstructed based on the number of fundamental angular modes replaced by wide-angle modes. In other words, the horizontal diagonal peripheral mode set can be configured differently depending on the shape of the current block.

[0174] In one embodiment, if the shape of the current block is a square or a vertical rectangle, there is no fundamental angular mode that is replaced by a wide-angle mode among the modes constituting the horizontal diagonal peripheral mode set. In this case, the horizontal diagonal peripheral mode set may be composed of the fundamental angular modes {3, ..., 10}.

[0175] According to another embodiment, when the width to height ratio (W / H) of the current block is 2, the number of angular modes replaced by the wide-angle mode may be 6. In this case, the set of horizontal diagonal peripheral modes may include the basic angular modes {8, ..., 15}. According to another embodiment, when the width to height ratio (W / H) of the current block exceeds 2, the number of angular modes replaced by the wide-angle mode may be 10. In this case, the set of horizontal diagonal peripheral modes may include the basic angular modes {12, 13, 14, 15, 16, 17, 19, 20}. In this case, the basic angular mode {18} may be excluded because it is a horizontal mode.

[0176] Fig. 19 (b) illustrates how the composition of the vertical diagonal peripheral mode set changes when some of the fundamental angular modes included in the vertical diagonal peripheral mode set are replaced by wide-angle modes. When the shape of the current block is a vertical rectangular block, some of the fundamental angular modes constituting the vertical diagonal peripheral mode set can be replaced by wide-angle modes with angles less than -135 degrees in the clockwise direction. In this case, the vertical diagonal peripheral mode set can be reconstructed based on the number of fundamental angular modes replaced by the wide-angle modes. In other words, the vertical diagonal peripheral mode set can be configured differently depending on the shape of the current block.

[0177] In one embodiment, if the shape of the current block is a square or horizontal rectangle, there is no fundamental angular mode that is replaced by a wide-angle mode among the modes constituting the vertical diagonal peripheral mode set. In this case, the vertical diagonal peripheral mode set may be composed of the fundamental angular modes {58, ..., 66}.

[0178] According to another embodiment, when the width to height ratio (W / H) of the current block is 1 / 2, the number of angular modes replaced by the wide-angle mode may be 6. In this case, the set of vertical diagonal peripheral modes may include the basic angular modes {53, ..., 60}. According to another embodiment, when the width to height ratio (W / H) of the current block is less than 1 / 2, the number of angular modes replaced by the wide-angle mode may be 10. In this case, the set of vertical diagonal peripheral modes may include the basic angular modes {48, 49, 51, 52, 53, 54, 55, 56}. In this case, the basic angular mode {50} may be excluded because it is a vertical mode.

[0179] FIG. 20 is a diagram illustrating an embodiment of a method for modifying a PDPC parameter set when the current block is a rectangular block. If the current block is a square, the PDPC parameter set described through FIGS. 12 to 15 may be used. According to an embodiment of the present invention, if the current block is not a square, the shift values ​​of FIGS. 12 to 15 may be modified to any one of the following [Mathematical Formula 6]. In [Mathematical Formula 6], width is the width of the current block, and height is the height of the current block.

[0180] [Equation 6]

[0181] shift=min(log2(Width), log2(Height)), or

[0182] shift= max(log2(Width), log2(Height)), or

[0183] shift = log2(Width) for wL[x] and, log2(Height) for wT[y] , or

[0184] shift = log2(Height) for wL[x] and, log2(Width) for wT[y]

[0185] Fig. 21 is a flowchart illustrating a method for a video signal processing device to determine a PDPC reference value and a PDPC parameter set for generating a prediction block of a current block. An encoder may signal intra-prediction mode information. A decoder may obtain an intra-prediction mode index of a current block based on the intra-prediction mode information from a received bitstream (S2101). In addition, the decoder may determine a method for applying PDPC based on shape information of the current block. The shape information of the current block may include at least one of width, height, or width-to-height ratio information of the current block. In Fig. 21, the width-to-height ratio information (R) may be a value obtained by dividing a longer side by a shorter side among the width and height of the current block.

[0186] According to one embodiment, when the width-to-height ratio information (R) of the current block is 2 (S2102), N specific indices may indicate wide-angle modes. At this time, when the intra prediction mode for the current block is any one of the N specific indices, the decoder may generate the final prediction block of the current block by applying PDPC in the method described above with reference to FIGS. 16 and 17. Alternatively, when the intra prediction mode for the current block is any one of the remaining indices except the N specific indices, the decoder may generate the final prediction block of the current block by applying PDPC in the method described above with reference to FIGS. 14 to 17.

[0187] In another embodiment, when the width-to-height ratio information (R) of the current block is 1 (S2103), the intra prediction mode indices may indicate angular modes within the basic angular range. The decoder may apply PDPC in the manner described in FIGS. 14 to 17 above to generate the final prediction block of the current block.

[0188] According to another embodiment, when the width-to-height ratio information (R) of the current block exceeds 2 (S2104), M specific indices may indicate wide-angle modes. In this case, M may be an integer greater than N. In this case, when the intra prediction mode for the current block is any one of the N specific indices, the decoder may generate the final prediction block of the current block by applying PDPC in the method described above with reference to FIGS. 16 and 17. Alternatively, when the intra prediction mode for the current block is any one of the remaining indices except the M specific indices, the decoder may generate the final prediction block of the current block by applying PDPC in the method described above with reference to FIGS. 14 to 17.

[0189] In the embodiments described above, reference samples are depicted as samples included in reference lines adjacent to the current block, but the present disclosure is not limited thereto. As described above, an encoder and a decoder according to an embodiment of the present invention can use samples on n reference lines within a preset distance from the boundary of the current block as reference samples for intra prediction of the current block.

[0190] Meanwhile, when generating the final prediction sample of the current block by applying PDPC, the first prediction sample, which is an intermediate prediction sample, may be generated using reference samples filtered by a preset filter. Specifically, the first prediction sample may be generated based on the intra prediction mode and the sample values ​​of the filtered reference sample. Specifically, the reference sample filtering may be performed based on any one of the preset low-pass filters. The preset low-pass filters may be classified according to the filter order, as shown in the table below.

[0191]

[0192] The encoder and decoder can generate a first prediction sample for PDPCP linear combination based on the filtered reference sample values ​​(s[-1,y], s[x,-1]).

[0193] Meanwhile, depending on the scan order, block partition, and position of the current block, at least some of the reference samples for intra prediction may not be available. This is because, depending on the restoration order of blocks within a picture, there may be one or more unrestored reference samples that have not yet been restored at the time of predicting the current block. Alternatively, if the position of the current block requires reference to a part outside the picture boundary, at least some of the reference samples may not be available.

[0194] In the present disclosure, cases where reference samples are unavailable include cases where reference samples have not yet been reconstructed and cases where reference samples do not exist. If some reference samples are unavailable, reference sample padding may be performed. However, if all reference samples are unavailable, the median value of the representable range of the current picture may be used based on the bit depth. In this case, prediction performance may be degraded compared to cases where prediction is made based on available reference samples. Hereinafter, a method for configuring reference samples of a current block is described when the boundary of the current block is adjacent to the boundary of at least one of a picture, a slice / tile, or a CTU (hereinafter, referred to as a high-level region).

[0195] FIG. 22 is a diagram illustrating one embodiment of a method for obtaining reference samples for intra prediction of a current block when the boundary of the current block is adjacent to the boundary of an upper level region. According to one embodiment of the present invention, when the upper and left reference samples of the current block are not available, reference samples may be obtained based on original sample values ​​corresponding to the current block. For example, the encoder may signal original sample values ​​on the first line inside the boundary of the current CTU including the current block. The encoder may transmit the original sample values ​​of the uppermost line and the original sample values ​​of the leftmost line within the current CTU. Furthermore, the encoder may transmit the original sample values ​​of the uppermost line and the original sample values ​​of the leftmost line of the original picture corresponding to the current block. In this case, original sample values ​​of a plurality of lines from the upper to the lower direction of the original picture and original sample values ​​of a plurality of lines from the left to the right direction of the original picture may additionally be transmitted. The decoder may obtain the reference sample of the current block based on the received original sample values.

[0196] FIG. 23 is a diagram illustrating an additional embodiment of a method for obtaining reference samples for intra prediction of a current block when the boundary of the current block is adjacent to the boundary of an upper level region. As in FIG. 22, when signaling all original sample values ​​on the first line inside the boundary of an original picture or a CTU, the compression efficiency of a video signal may be reduced. According to an additional embodiment of the present invention, an encoder can signal the values ​​of some original samples corresponding to a specific position among the original samples on the first line inside the boundary of an original picture or a CTU. A decoder can construct a reference sample of the current block based on the received original sample values.

[0197] In one embodiment, the specific location may include the location of the upper left sample within the original picture or CTU boundary. In addition, the specific location may include the locations of samples spaced at a preset interval among the original samples of the first line within the original picture or CTU boundary. For example, as shown in FIG. 23, original sample values ​​corresponding to two positions in the upper line and the left line, and one position in the upper left, may be signaled. The decoder may construct a reference sample array including W+H+1 or 2W+2H+1 reference samples based on the original sample values ​​of the acquired specific locations. Specifically, the reference sample array may be constructed based on the interpolation of the original sample values ​​of the acquired specific locations. At this time, various methods can be used for interpolation of sample values, such as a linear interpolation method using two sample values, a bi-linear interpolation method, a padding method, a method using multi-tap filter coefficients according to the number of samples, or a method of generating and applying DCT-based interpolation filter coefficients used in HEVC (H.265).

[0198] The embodiments of the present invention described above may be implemented through various means. For example, the embodiments of the present invention may be implemented through hardware, firmware, software, or a combination thereof.

[0199] In the case of hardware implementation, the method according to embodiments of the present invention may be implemented by one or more ASICs (Application Specific Integrated Circuits), DSPs (Digital Signal Processors), DSPDs (Digital Signal Processing Devices), PLDs (Programmable Logic Devices), FPGAs (Field Programmable Gate Arrays), processors, controllers, microcontrollers, microprocessors, etc.

[0200] When implemented via firmware or software, the methods according to embodiments of the present invention may be implemented in the form of modules, procedures, or functions that perform the functions or operations described above. The software code may be stored in memory and executed by the processor. The memory may be located internally or externally to the processor and may exchange data with the processor via various known means.

[0201] The foregoing description of the present invention is for illustrative purposes only, and those skilled in the art will readily appreciate that the present invention can be readily modified into other specific forms without altering the technical spirit or essential characteristics of the present invention. Therefore, the embodiments described above should be construed as illustrative and not restrictive in all respects. For example, components described as being single may be implemented in a distributed manner, and similarly, components described as being distributed may be implemented in a combined manner.

[0202] The scope of the present invention is indicated by the claims described below rather than the detailed description above, and all changes or modifications derived from the meaning and scope of the claims and their equivalent concepts should be interpreted as being included in the scope of the present invention.

Claims

1. In a video signal processing method, A step of generating a first prediction sample of a current sample included in the current block based on an intra prediction mode for the current block, wherein the intra prediction mode for the current block is indicated by one of at least one intra prediction mode index included in a specific index set; A step of determining at least one reference sample corresponding to the current sample among reference samples of the current block based on an intra prediction mode for the current block; A step of obtaining at least one reference value corresponding to the current sample based on an unfiltered sample value of at least one reference sample; generating a second prediction sample of the current sample by linearly combining the values ​​of the first prediction sample and the at least one reference value based on a parameter set corresponding to the specific index set; and A step of restoring the current sample based on the residual signal of the current sample and the second prediction sample, A video signal processing method wherein the parameter sets corresponding to the specific index sets are different depending on the shape of the current block.

2. In paragraph 1, The step of generating the second prediction sample is: If the shape of the current block is a vertical rectangle, the second prediction sample is generated by linearly combining the first prediction sample and the at least one reference value based on the first parameter set, A video signal processing method, comprising the step of generating the second prediction sample by linearly combining the first prediction sample and the at least one reference value based on a second parameter set, when the shape of the current block is a horizontal rectangle.

3. In paragraph 2, The above specific index set is one of the first index set and the second index set, The above first index set is a set consisting of intra prediction mode indices that are greater than the smallest index among the intra prediction mode indices indicating the angular mode and less than or equal to a preset first index, A video signal processing method, wherein the second index set is a set of intra prediction mode indices that are smaller than the largest index among intra prediction mode indices indicating the angle mode and greater than or equal to a preset second index.

4. In paragraph 3, The above first index and the above second index are values ​​set based on the number of preset wide-angle modes when the longer side among the width and height of the current block is twice the shorter side, A video signal processing method, wherein the above wide-angle mode is an angle mode that exceeds a preset reference angle range.

5. In paragraph 4, The first parameter set is such that, for at least some of the samples constituting the current block, a parameter applied to an upper reference value obtained from an upper reference sample of the current block among the at least one reference value is not 0, A video signal processing method, wherein the second parameter set is a parameter other than 0 applied to a left reference value obtained from a left reference sample of the current block among the at least one reference value for at least some of the samples constituting the current block.

6. In paragraph 5, The index indicating the intra prediction mode of the current block is one of the indices constituting the first index set, The step of generating the second prediction sample is: A video signal processing method, comprising the step of generating the second prediction sample based on the first parameter set when the shape of the current block is a square.

7. In paragraph 5, The index indicating the intra prediction mode of the current block is one of the indices constituting the second index set, The step of generating the second prediction sample is: A video signal processing method, comprising the step of generating the second prediction sample based on the second parameter set when the shape of the current block is a square.

8. In paragraph 1, The above specific index set is a third index set consisting of the smallest index among the intra prediction mode indices indicating the angular mode, If the shape of the current block above is a square or a vertical rectangle, the parameter applied to the left reference value of the parameter set is not 0, A video signal processing method wherein, if the shape of the current block above is a horizontal rectangle, the parameter applied to the left reference value of the parameter set is 0.

9. In paragraph 1, The above specific index set is a fourth index set consisting of the largest index among the intra prediction mode indices indicating the angular mode, If the shape of the current block above is a square or a horizontal rectangle, the parameter applied to the upper reference value of the parameter set is not 0, A video signal processing method wherein, when the shape of the current block above is a vertical rectangle, the parameter applied to the upper reference value of the parameter set is 0.

10. In paragraph 1, The step of obtaining at least one reference value corresponding to the current sample comprises: If the first position where the prediction direction indicated by the intra prediction mode for the current block intersects with any one of the reference lines of the current block based on the position of the current sample is between the first reference sample and the second reference sample, which are different adjacent integer samples, A video signal processing method, comprising the step of obtaining a reference value corresponding to the first position based on a first distance between the first position and the first reference sample and a distance between the first position and the second reference sample.

11. In a video signal processing device, Contains a processor, The above processor, Generating a first prediction sample of a current sample included in the current block based on an intra prediction mode for the current block, wherein the intra prediction mode for the current block is indicated by one of at least one intra prediction mode index included in a specific index set; Based on the intra prediction mode for the current block, at least one reference sample corresponding to the current sample is determined among the reference samples of the current block, Obtaining at least one reference value corresponding to the current sample based on an unfiltered sample value of at least one reference sample; Generating a second prediction sample of the current sample by linearly combining the values ​​of the first prediction sample and the at least one reference value based on a parameter set corresponding to the specific index set, Reconstructing the current sample based on the residual signal of the current sample and the second prediction sample, A video signal processing device wherein the parameter sets corresponding to the specific index sets are different depending on the shape of the current block.

12. In paragraph 11, The above processor, If the shape of the current block is a vertical rectangle, the second prediction sample is generated by linearly combining the first prediction sample and the at least one reference value based on the first parameter set, A video signal processing device that generates the second prediction sample by linearly combining the first prediction sample and the at least one reference value based on a second parameter set when the shape of the current block is a horizontal rectangle.

13. In paragraph 12, The above specific index set is one of the first index set and the second index set, The above first index set is a set consisting of intra prediction mode indices that are greater than the smallest index among the intra prediction mode indices indicating the angular mode and less than or equal to a preset first index, A video signal processing device, wherein the second index set is a set of intra prediction mode indices that are smaller than the largest index among intra prediction mode indices indicating the angle mode and greater than or equal to a preset second index.

14. In paragraph 13, The above first index and the above second index are values ​​set based on the number of preset wide-angle modes when the longer side among the width and height of the current block is twice the shorter side, A video signal processing device, wherein the above wide-angle mode is an angle mode that exceeds a preset reference angle range.

15. In paragraph 14, The first parameter set is such that, for at least some of the samples constituting the current block, a parameter applied to an upper reference value obtained from an upper reference sample of the current block among the at least one reference value is not 0, A video signal processing device, wherein the second parameter set is a parameter other than 0 applied to a left reference value obtained from a left reference sample of the current block among the at least one reference value for at least some of the samples constituting the current block.

16. In paragraph 15, The index indicating the intra prediction mode of the current block is one of the indices constituting the first index set, The above processor, A video signal processing device that generates the second prediction sample based on the first parameter set when the shape of the current block is a square.

17. In paragraph 15, The index indicating the intra prediction mode of the current block is one of the indices constituting the second index set, The above processor, A video signal processing device that generates the second prediction sample based on the second parameter set when the shape of the current block is a square.

18. In paragraph 11, The above specific index set is a third index set consisting of the smallest index among the intra prediction mode indices indicating the angular mode, If the shape of the current block above is a square or a vertical rectangle, the parameter applied to the left reference value of the parameter set is not 0, A video signal processing device, wherein if the shape of the current block above is a horizontal rectangle, the parameter applied to the left reference value of the parameter set is 0.

19. In paragraph 11, The above specific index set is a fourth index set consisting of the largest index among the intra prediction mode indices indicating the angular mode, If the shape of the current block above is a square or a horizontal rectangle, the parameter applied to the upper reference value of the parameter set is not 0, A video signal processing device, wherein when the shape of the current block is a vertical rectangle, the parameter applied to the upper reference value of the parameter set is 0.

20. In paragraph 11, The above processor, If the first position where the prediction direction indicated by the intra prediction mode for the current block intersects with any one of the reference lines of the current block based on the position of the current sample is between the first reference sample and the second reference sample, which are different adjacent integer samples, A video signal processing device that obtains a reference value corresponding to the first position based on a first distance between the first position and the first reference sample and a distance between the first position and the second reference sample.