Video decoders, video encoders, and computer-readable recording media are non-volatile.

VN10062882BActive Publication Date: 2026-11-10VIDAXIO LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
VN1202404844
Authority / Receiving Office
VN · VN
Patent Type
Patents
Current Assignee / Owner
Priority Date
2018-03-26
Filing Date
2018-12-24
Publication Date
2026-11-10
Estimated Expiration
2038-12-24

AI Technical Summary

Technical Problem

Current video signal processing methods are inefficient in encoding and decoding video signals, particularly in utilizing reference samples for intra prediction, leading to suboptimal coding efficiency and signaling efficiency.

Method used

A method and device that select and utilize reference lines and intra prediction modes based on the relative position of the current block within a high-level area, using multiple reference lines and angular modes to determine the optimal intra prediction mode for decoding, thereby enhancing coding and signaling efficiency.

Benefits of technology

This approach increases coding efficiency and signaling efficiency by effectively utilizing reference samples and modes, improving the quality of video signal processing and reducing overhead in encoding and decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202404844_0
    Figure VN1202404844_0
Patent Text Reader

Abstract

The invention proposes a device for decoding and encoding video signals. More specifically, the invention relates to a method for processing video signals and a device for processing video signals to perform a method which includes the following steps: acquiring calibration curve information indicating the calibration curve for predicting the current block's internal image from among several calibration curves including neighboring samples of the current block; based on the calibration curve information, determining the internal image prediction mode for the current block from among the internal image prediction modes constituting the internal image prediction mode set; and decoding the current block based on the reference samples on the calibration curve according to the calibration curve information and the determined internal image prediction mode, wherein the several calibration curves include a first calibration curve including neighboring samples on a line adjacent to the boundary of the current block and a second calibration curve including neighboring samples on a line at a distance corresponding to a predetermined number of samples outside the boundary of the current block.Additionally, the invention proposes a non-volatile, computer-readable recording device that stores a stream of bits.
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 the steps of: obtaining reference line information indicating a reference line used for intra prediction of a current block from among a plurality of reference lines composed of peripheral samples of the current block; determining an intra prediction mode for the current block from among a plurality of intra prediction modes constituting an intra prediction mode set based on the reference line information; and decoding the current block based on a plurality of reference samples on the reference line according to the reference line information and the determined intra prediction mode, wherein the plurality of reference lines include a first reference line composed of peripheral samples on a line adjacent to a boundary of the current block and a second reference line composed of peripheral samples on a line spaced apart by a specific number of samples from the boundary 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 obtains reference line information indicating a reference line for intra prediction of a current block from among a plurality of reference lines composed of peripheral samples of the current block, determines an intra prediction mode for the current block from among a plurality of intra prediction modes constituting an intra prediction mode set based on the reference line information, and decodes the current block based on a plurality of reference samples on the reference line according to the reference line information and the determined intra prediction mode, wherein the plurality of reference lines include a first reference line composed of peripheral samples on a line adjacent to a boundary of the current block, and a second reference line composed of peripheral samples on a line spaced apart by a specific number of samples based on the boundary of the current block.

[0007] If the reference line for intra prediction of the current block is a first reference line, the intra prediction mode set may be a first intra prediction mode set, and if the reference line for intra prediction of the current block is not the first reference line, the intra prediction mode set may be a second intra prediction mode set composed of some of a plurality of intra prediction modes constituting the first intra prediction mode set.

[0008] The second intra prediction mode set may be composed of a plurality of angular modes.

[0009] The second intra prediction mode set may be composed of a preset number of angular modes determined based on an intra prediction mode corresponding to any one of the surrounding blocks of the current block.

[0010] The processor may receive intra prediction mode information indicating any one of a preset number of angular modes included in the second intra prediction mode set, and determine an intra prediction mode for the current block based on the intra prediction mode information.

[0011] The above intra prediction mode set can be determined based on the relative position of the current block within the upper level region of the current block.

[0012] The processor may configure the intra prediction mode set for the current block based on a relative position of the current block within the upper level region.

[0013] If the current block is adjacent to the upper boundary of the upper level region, the reference line information is considered to represent the first reference line, and the intra prediction mode set for the current block may be the first intra prediction mode set.

[0014] The first intra prediction mode set may include a plurality of angular modes and a planar mode and a direct current mode.

[0015] The boundary of the current block may be the left or upper boundary of the current block.

[0016] The above specific number of samples may be less than or equal to a preset number of samples. The above number of samples may represent the number of integer pixels.

[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] Figure 7 illustrates one embodiment of a method for signaling an intra prediction mode selected by an encoder to a decoder.

[0025] Figure 8 illustrates a detailed embodiment of a method for signaling an intra prediction mode.

[0026] FIG. 9 is a diagram illustrating a reference sample padding method when some reference samples for intra prediction of the current block are not available.

[0027] FIG. 10 is a diagram illustrating a reference sample padding method when not all reference samples for intra prediction of the current block are available.

[0028] Fig. 11 is a diagram showing a reference sample padding method when the prediction mode of the surrounding block is planar mode.

[0029] Figure 12 is a diagram showing a reference sample padding method when the prediction mode of the surrounding block is angular mode.

[0030] Figure 13 is a diagram showing a reference sample padding method when the prediction mode of the surrounding block is angular mode.

[0031] Figure 14 is a diagram illustrating a reference sample padding method based on the location of reference samples.

[0032] Figure 15 is a diagram showing how reference sample padding is performed based on surrounding samples.

[0033] Figure 16 is a diagram showing a reference sample padding method when a surrounding block is inter-predicted.

[0034] Figure 17 is a diagram showing a reference sample padding method when a surrounding block is inter-predicted.

[0035] Figure 18 is a diagram showing a reference sample padding method when a surrounding block is inter-predicted.

[0036] FIG. 19 is a diagram illustrating one embodiment of a plurality of reference lines composed of surrounding samples of the current block.

[0037] Figure 20 is a diagram showing how the intra prediction mode of the current block is signaled.

[0038] FIG. 21 is a diagram illustrating how intra prediction mode information is signaled based on the location of padded reference samples.

[0039] Figure 22 is a diagram showing how an intra prediction mode is determined based on the relative position of the current block.

[0040] FIG. 23 is a diagram illustrating one embodiment of a method for determining an intra prediction mode of a current block based on a reference sample.

[0041] FIG. 24 is a diagram illustrating one embodiment of a method for determining an intra prediction mode of a current block based on a reference sample.

[0042] FIG. 25 is a diagram illustrating one embodiment of a method for determining an intra prediction mode of a current block based on a reference sample.

[0043] FIG. 26 is a diagram illustrating one embodiment of a method for dividing vertical blocks and horizontal blocks.

[0044] FIG. 27 is a diagram illustrating one embodiment of a method for signaling the splitting of a quad tree, a binary tree, and a ternary tree.

[0045] FIG. 28 is a diagram illustrating one embodiment of how a split of a ternary tree is signaled.

[0046] FIG. 29 is a drawing specifically showing a structure in which vertical blocks are divided according to one embodiment of the present invention.

[0047] FIG. 30 is a drawing specifically showing a structure in which a horizontal block is divided according to one embodiment of the present invention.

[0048] FIG. 31 is a drawing showing one embodiment of a method for determining the scanning order of blocks.

[0049] 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.

[0050] 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.

[0051] 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).

[0052] 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).

[0053] 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.

[0054] 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).

[0055] 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).

[0056] 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.

[0057] 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).

[0058] 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).

[0059] 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).

[0060] 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).

[0061] 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.

[0062] 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.

[0063] 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.

[0064] 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.

[0065] 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.

[0066] 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.

[0067] 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).

[0068] 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).

[0069] 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.

[0070] 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.

[0071] 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.

[0072] 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, 8) MaxQtDepth: The maximum allowed number of QT splits.

[0073] 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.

[0074] 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.

[0075] 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.

[0076] 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.

[0077] 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. A method of padding the reference sample will be described in detail with reference to FIGS. 9 to 18. In addition, the intra prediction unit may perform a reference sample filtering process to reduce an error in intra prediction. That is, the reference samples may be obtained by filtering neighboring samples and / or samples obtained by the reference sample padding process. The intra prediction unit uses the reference samples obtained in this way to predict samples of the current block. 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. Next, FIG. 6 illustrates an embodiment of prediction modes used for intra prediction.For intra prediction, intra prediction mode information indicating the intra prediction direction may be signaled. The intra prediction mode information indicates 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.

[0078] 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.

[0079] 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.

[0080] 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.

[0081] 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.

[0082] 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.

[0083] 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.

[0084] 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. By having the intra prediction mode index for the basic angular mode signal the extended angular mode in this way, even if the configuration of the angular modes used for intra prediction of each block is different, the same set of intra prediction mode indices can be used to signal the intra prediction mode. Therefore, the signaling overhead due to changes in the intra prediction mode configuration can be minimized.

[0085] 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.

[0086] 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.

[0087] 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.

[0088] FIG. 7 illustrates an embodiment of a method for signaling an intra prediction mode selected by an encoder to a decoder. According to an embodiment of the present invention, for intra prediction of a current block, at least one prediction mode list composed of some of all intra prediction modes may be managed. A first prediction mode list for intra prediction is an MPM (Most Probable Modes) list. An intra prediction mode included in the MPM list may be referred to as an MPM mode, and an intra prediction mode not included in the MPM list may be referred to as a non-MPM mode. The encoder signals an MPM flag that distinguishes whether the intra prediction mode used in the current block is an MPM mode or a non-MPM mode. The decoder may identify whether the intra prediction mode used in the current block is an MPM mode or a non-MPM mode through the received MPM flag.

[0089] According to one embodiment, efficient signaling can be performed with fewer bits by using a separate encoding method for the MPM mode. When the number of MPM modes included in the MPM list is m, the number of non-MPM modes is Tm. If the number of MPM modes m is less than the number of non-MPM modes Tm, the MPM mode can be coded using truncated unary binarization, and the non-MPM mode can be coded using truncated binary binarization.

[0090] The MPM mode can be configured by considering various contexts step by step as follows. First, the MPM list can be configured with intra prediction modes and planar / DC modes used in neighboring blocks of the current block (context M0). If there is a block encoded with an intra prediction mode among the neighboring blocks that have been reconstructed, the current block is likely to have used the same intra prediction mode as the block due to the local similarity of the picture. Therefore, the MPM list can be configured including the intra prediction modes of the neighboring blocks. According to one embodiment, the neighboring blocks of the current block can include at least one of a left (L) block, an upper (A) block, a lower left (BL) block, an upper right (AR) block, or an upper left (AL) block adjacent to the current block. For example, the neighboring blocks of the current block can include a left (L) block and an upper (A) block adjacent to the current block. The left (L) block is the lowermost block adjacent to the left boundary of the current block, and the upper (A) block is the rightmost block adjacent to the upper boundary of the current block. Specific examples of the surrounding blocks for forming the MPM list will be described with reference to FIG. 8. The intra prediction mode, planar mode, and DC mode selected from the surrounding blocks of the current block can be added to the MPM list in a preset order. For example, the MPM list can be formed in the following order: {mode of block L, mode of block A, planar mode, DC mode, mode of block BL, mode of block AR, mode of block AL}.

[0091] Second, if the above method fails to fill the MPM mode m, additional context conditions (e.g., context M1, context M2, etc.) can be additionally applied to fill the MPM list. When applying additional context conditions, intra prediction modes already included in the MPM list may not be newly added.

[0092] Meanwhile, the remaining Tm non-MPM modes among the total T intra prediction modes that are not included in the MPM list can be coded using truncated binomial binarization. When truncated binarithm is used, assuming 2^(k-1) < Tm < 2^(k), the initial 2^(k)-(Tm) indices can be signaled using k-1 bits (or bins), and the remaining indices are signaled using k bits (or bins). Therefore, by applying an additional context condition (i.e., context N) to the non-MPM modes, modes that are relatively likely to be selected in the corresponding block can be signaled using an index consisting of k-1 bits, thereby minimizing signaling overhead.

[0093] According to a further embodiment of the present invention, a second prediction mode list composed of some modes among non-MPM modes can be managed. More specifically, the non-MPM modes can be additionally divided into selected (s) modes and non-selected (ns) modes, and a second prediction mode list composed of selected modes (i.e., a selected mode list) can be managed. An intra prediction mode included in the selected mode list can be referred to as a selected mode, and an intra prediction mode not included in the selected mode list can be referred to as a non-selected mode. An encoder can signal a selected mode flag that distinguishes whether an intra prediction mode used in a current block is a selected mode or a non-selected mode. A decoder can identify whether an intra prediction mode used in a current block is a selected mode or a non-selected mode through the received selected mode flag.

[0094] When non-MPM modes are additionally distinguished as described above, the selected modes can be coded with a fixed length. At this time, an additional context condition (e.g., context S) can be applied to the selected modes to give priority to modes that are more likely to be selected in the corresponding block. At this time, s selected modes (where s is a power of 2) can be coded with a fixed length, and the remaining ns non-selected modes can be coded with truncated binarization. The ns non-selected modes can be signaled using any l-1 bits (or bins) or l bits (or bins). At this time, by applying an additional context condition (i.e., context NS) to the non-selected modes, modes that are relatively more likely to be selected in the corresponding block can be signaled with an index consisting of l-1 bits, thereby minimizing signaling overhead.

[0095] Specific embodiments of the above context conditions will be described with reference to the drawings below. The context conditions additionally defined in the following embodiments may be applied individually or in duplicate to various configurations to which the above context conditions {M0, M1, M2, N, S, NS} are applied. For example, a context condition that signals the basic angular mode with priority over the extended angular mode may be additionally used. In addition, a context condition that preferentially adds angular modes obtained by adding a preset offset (e.g., -1, +1) to the angular modes of the surrounding blocks derived through the first context condition of the MPM mode (e.g., context M0) to the second prediction mode list may be used. Such a context condition may be applied as a context condition for one or more of the MPM mode, the non-MPM mode, the selection mode, or the non-selection mode. Meanwhile, the neighboring blocks of the current block reviewed to generate the above-described variable MPM list may include blocks in additional locations other than the default locations. A specific embodiment thereof will be described with reference to FIG. 8.

[0096] Figure 8 illustrates a detailed embodiment of a method for signaling an intra prediction mode. Figure 8(a) illustrates an embodiment of neighboring blocks referenced to construct a prediction mode list. Figure 8(b) illustrates an embodiment of a method for signaling the aforementioned intra prediction mode. Additionally, Figure 8(c) illustrates an embodiment of signaling non-selected modes using truncated binarization.

[0097] First, Fig. 8(a) illustrates an example of the relative positions of neighboring blocks referenced to construct an MPM list. Referring to Fig. 8(a), neighboring blocks may be referenced in the order of a left (L) block, an upper (A) block, a lower left (BL) block, an upper right (AR) block, or an upper left (AL) block adjacent to the current block. At this time, the intra prediction mode, the planar mode, and the DC mode selected from the neighboring blocks may be added to the MPM list according to a preset order. However, in an embodiment of the present invention, neighboring blocks referenced to construct an MPM list are not limited thereto. For example, neighboring blocks of a current block may include a left (L) block and an upper (A) block adjacent to the current block. The left (L) block is the lowermost block adjacent to the left boundary of the current block, and the upper (A) block is the rightmost block adjacent to the upper boundary of the current block.

[0098] According to one embodiment of the present invention, the order of forming an MPM list may vary depending on the shape of the current block. For example, if the current block is a non-square block, the reference order of the surrounding blocks may be determined differently depending on whether the current block is a vertical block or a horizontal block. For example, if the current block is a vertical block, the left block may be preferentially included in the MPM list over the upper block. If the current block is a horizontal block, the upper block may be preferentially included in the MPM list over the left block. According to another embodiment of the present invention, the order of forming an MPM list may be determined by comparing the shape of the current block with the shapes of the surrounding blocks. For example, if the current block is a vertical block, an intra prediction mode used for the vertical block among the preset surrounding blocks may be preferentially included in the MPM list.

[0099] According to another embodiment of the present invention, the order of forming the MPM list may be determined by considering the correlation between the shape of the current block and the angular modes used in the neighboring blocks. For example, if the current block is a vertical block, among the angular modes used in the preset neighboring blocks, angular modes that are in a preset range from vertical (VER) mode 50 or between diagonal (DIA) mode 34 and vertical diagonal (VDIA) mode 66 may be preferentially included in the MPM list. According to a further embodiment, intra prediction modes included in the MPM lists of the neighboring blocks may be included in the MPM list of the current block. In this case, if the MPM list of the current block is not filled with the intra prediction modes used in the neighboring blocks, intra prediction modes included in the MPM lists of the neighboring blocks may be added to the MPM list of the current block.

[0100] According to an additional embodiment of the present invention, intra prediction modes of blocks in additional locations may be utilized depending on the size of the current block and the size of each of the surrounding blocks. For example, if the surrounding blocks of the current block are smaller than the size of the current block, there may be multiple left blocks to the left of the current block with different intra prediction modes. Specifically, in Fig. 8(a), the left block represents the block located at the bottom among the blocks adjacent to the left boundary of the current block, but may include other blocks adjacent to the left boundary of the current block. In this case, an MPM mode list may be constructed based on the intra prediction modes corresponding to the other blocks.

[0101] According to a further embodiment of the present invention, the MPM mode list of the current block may be constructed based on the MPM mode lists of the surrounding blocks of the current block. For example, in addition to the intra prediction mode used for prediction of the left block in FIG. 8(a), the MPM mode list of the current block may be constructed based on additional intra prediction modes included in the MPM mode list of the left block.

[0102] FIG. 8(b) illustrates an embodiment of a method for signaling the aforementioned intra prediction mode. Among the total T intra prediction modes, m modes are classified as MPM modes and signaled using truncated unary binarization. In one embodiment, T may be 67 and m may be 6. In truncated unary binarization, as the signaling index increases, the number of bits (or bins) used increases. Therefore, signaling efficiency can be improved by matching modes with a relatively high probability of being selected from the corresponding block to indices with low values. To this end, the encoder and decoder may construct an MPM list with the same context conditions, and the derived mode values ​​may be rearranged and signaled based on the context conditions. For example, CABAC-based encoding can be performed by classifying the selected modes in the order of non-angle modes such as DC / planar modes, vertical modes, and planar angular modes. Next, the s selected modes determined by arbitrary context conditions are signaled with fixed-length bits, and the remaining ns non-selected modes are signaled with truncated binarization. In one embodiment, n can be 16 and ns can be 45.

[0103] Fig. 8(c) illustrates an embodiment of signaling non-selected modes using truncated binarization. According to the embodiment, the number of non-selected modes ns is 45. When truncated binarization is used, since 2^5 < 45 < 2^6, the initial 2^6-45=19 indices can be signaled using 5 bits (or bins), and the remaining 26 indices are signaled using 6 bits (or bins). Therefore, by applying a preset context condition to the non-selected modes, modes that are relatively more likely to be selected in the corresponding block can be matched to indices with low values ​​signaled using 5 bits (or bins).

[0104] 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.

[0105] In the present disclosure, cases where a reference sample is unavailable include cases where the reference sample has not yet been restored and cases where the reference sample does not exist. If at least some of the reference samples are unavailable, reference sample padding may be performed. Hereinafter, padding methods according to embodiments of the present invention will be described with reference to FIGS. 9 to 18.

[0106] FIG. 9 is a diagram illustrating a reference sample padding method when some of the reference samples for intra prediction of the current block are unavailable. As described above with reference to FIG. 5, when at least some of the reference samples are unavailable, the decoder may perform a reference sample padding process according to a preset rule to replace the unavailable reference sample values ​​with available reference sample values. According to one embodiment, the unavailable reference sample values ​​may be generated based on the reference sample that is closest in distance to the unavailable reference sample among the available reference samples. For example, the unavailable reference sample values ​​may be replaced with the reference sample values ​​that are closest in distance to the unavailable reference sample.

[0107] FIG. 10 is a diagram illustrating a reference sample padding method when not all reference samples for intra prediction of the current block are available. For example, when the current block is adjacent to the upper left border of the picture, there may not be any reference samples for the current block. In this case, reference sample padding may be performed based on a representative value. In this case, all padded reference samples may have the same value. In one embodiment, the representative value may be set based on the bit depth of the sequence including the current block. For example, the representative value may be a median value within a range expressible based on the bit depth.

[0108] According to another embodiment, the representative value may be set differently for each picture or sequence. For example, the representative value may be set based on the sample values ​​of the current picture including the current block, or a previously reconstructed picture or sequence reconstructed before the current sequence. For example, the representative value may be any one of the average value, the mode, or the median value of the sample values ​​of the previously reconstructed picture or sequence. In addition, the representative value may also be set based on the sample value(s) included in the current picture or the current sequence. Specifically, if there are sample value(s) reconstructed before the current block in the current sequence or the current picture, the representative value may be any one of the average value, the mode, or the median value of the previously reconstructed sample values.

[0109] Meanwhile, the reference samples may be divided into left reference samples around the left boundary and upper reference samples around the upper boundary based on the boundary of the current block. According to an additional embodiment of the present invention, different reference sample padding methods may be performed on the left reference samples and the upper reference samples. For example, a first reference sample padding method may be performed on one side of the left reference samples and the upper reference samples, and a second reference sample padding method may be performed on the other side. For example, the first reference sample padding method may be the reference sample padding method described with reference to FIG. 9, and the second reference sample padding method may be the reference sample padding method described with reference to FIG. 10. For example, when there is a reference sample available only on one side of the left reference samples and the upper reference samples, the reference sample padding described with reference to FIG. 10 may be performed on the side where there is no available reference sample.

[0110] According to one embodiment of the present invention, reference sample padding may be performed in different ways depending on how the neighboring blocks are predicted. This is because the neighboring blocks of the current block may be predicted in a similar way to how other neighboring blocks of the current block are predicted. According to one embodiment, if the neighboring blocks are predicted based on any one of a plurality of intra prediction modes, reference sample padding may be performed based on the intra prediction mode of the neighboring blocks. For example, unreconstructed reference sample values ​​may be determined based on available reference samples at positions determined based on the intra prediction mode of the neighboring blocks. According to another embodiment, if the neighboring blocks are inter-predicted, reference sample padding may be performed based on information related to the inter-prediction. This will be described later with reference to FIGS. 16 to 18. The prediction performance for the current block may be improved due to the reference sample values ​​determined based on the prediction method of the neighboring blocks.

[0111] Hereinafter, a method for performing reference sample padding of a current block based on an intra prediction mode of a neighboring block will be described with reference to FIGS. 11 to 15. FIG. 11 is a diagram illustrating a reference sample padding method when the prediction mode of a neighboring block is a planar mode. Referring to FIG. 11, reference sample padding may be performed based on available reference samples. Additionally, reference sample padding may be performed using a reference sample padded before a reference sample to be padded according to the positional padding order of the reference samples. The planar mode may be an intra prediction mode that is advantageous for representing a block in which a gradual change occurs in a sample value. Accordingly, when at least one of the neighboring blocks of the current block is predicted using the planar mode, reference sample padding may be performed based on an available reference sample located at a preset distance from the reference sample to be padded. In this case, the reference sample padding method may be different from the method described in FIG. 9.

[0112] For example, the encoder and / or decoder may perform reference sample padding using reference samples located at a preset distance from a reference sample to be padded. The preset distance may be a distance in units of samples. Specifically, the unavailable reference sample value may be determined based on a first reference sample and a second reference sample. For example, the first reference sample may be a reference sample located at a closest distance from the unavailable reference sample among the available reference samples of the first line to which the unavailable reference sample belongs. Additionally, the second reference sample may be a reference sample located at a distance equal to the number of available reference samples on the first line from the unavailable reference sample.

[0113] As in FIG. 11, if the unavailable reference sample is an upper reference sample, the first reference sample may be a sample adjacent to the left of the unavailable reference sample. In this case, the second reference sample may be a sample that is M samples away from the unavailable reference sample to the left. According to another embodiment, if the unavailable reference sample is a left reference sample, the first reference sample may be a sample adjacent to the upper side of the unavailable reference sample. In this case, the second reference sample may be a sample that is a specific number of samples away from the unavailable reference sample to the upper side.

[0114] Referring to FIG. 11, among the upper reference samples of the current block, M consecutive reference samples may be available. In addition, a block including at least some of the M reference samples may be a neighboring block intra-predicted using the planar mode. When the indices indicating the positions of the M available reference samples are each from 0 to M-1, the kth reference sample may not be available. In this case, k may be an integer greater than or equal to M. In this case, the kth reference sample value (p[k]) may be determined based on a first reference sample value (p[k-1]) located at the closest distance to the left from the kth reference sample and a second reference sample value (p[kM]) located at a distance M to the left from the kth reference sample. In addition, the kth reference sample value may be determined based on a change amount (p[k-1] - p[kM]) between the first reference sample value and the second reference sample value. In this case, the kth reference sample value p[k] may be expressed as in the following mathematical equation.

[0115] [Mathematical Formula 1]

[0116] p[k] = p[k-1] + (p[k-1] - p[kM]) / (M-1)

[0117] or

[0118] p[k] = p[k-1] + (p[k-1] - p[kM]) / M

[0119] According to another embodiment, the unavailable reference sample value may be determined based on the values ​​of samples located at both ends among the available consecutive reference samples. In FIG. 14, the k-th reference sample value may be determined based on the third reference sample value (p[0]) located at the leftmost position and the fourth reference sample value (p[M-1]) located at the rightmost position among the available consecutive reference samples. In addition, the k-th reference sample value may be padded based on the amount of change between the third reference sample value and the fourth reference sample value. In this case, the k-th sample value may be expressed as in the following mathematical equation.

[0120] [Equation 2]

[0121] p[k] = p[M-1] + (k-M+1)*(p[M-1] - p[0]) / (M-1)

[0122] or

[0123] p[k] = p[M-1] + (k-M+1)*(p[M-1] - p[0]) / M

[0124] Mathematical expression 2 shows how the kth reference sample value is determined based on the fourth reference sample value and the variation. In Mathematical expression 2, (k-M+1) / M or (k-M+1) / (M-1) may be a weight for adjusting the degree of reflection of the variation depending on the location of the unavailable reference sample.

[0125] FIG. 12 is a diagram illustrating a reference sample padding method when the prediction mode of a neighboring block is an angular mode. According to one embodiment of the present disclosure, an unavailable reference sample value may be determined based on the angular mode of the neighboring block. For example, an unavailable reference sample value may be determined using a reference sample determined according to the angular mode of the neighboring block among available reference samples. In this case, the values ​​of unavailable reference samples among the reference samples included in the first group may be determined based on the available reference samples among the reference samples included in the second group. For example, the first group may be composed of upper reference samples of the current block, and the second group may be composed of left reference samples of the current block.

[0126] Specifically, when the first group includes at least one unavailable reference sample, and the prediction mode of a surrounding block overlapping the first group is the first angular mode, reference samples used for padding the reference samples of the first group can be determined based on the first angular mode. Reference samples used for padding the reference samples of the first group can be determined based on the prediction direction indicated by the first angular mode or the opposite direction. At this time, the reference samples used for padding the reference samples of the first group may be included in the second group and may be available reference samples.

[0127] Referring to FIG. 12, unavailable reference samples (1201) may be samples of the first group. The intra prediction mode of a neighboring block including the first available reference samples (1202) among the samples of the first group may be a vertical diagonal mode. In this case, the value of the unavailable reference samples (1201) may be determined based on the second available reference samples (1203) included in the second group. Reference sample padding may be performed based on reference samples located in the prediction direction indicated by the vertical diagonal mode or the opposite direction among the second available reference samples (1203). A reference sample located on the horizontal diagonal with respect to an unavailable upper reference sample may be any one of the left reference samples.

[0128] Fig. 13 is a diagram illustrating a reference sample padding method when the prediction mode of the surrounding block is angular mode. As in Fig. 12, when an unavailable reference sample value is determined based on the angular mode, the distance between the position of the reference sample to be padded and the position of the reference sample used for padding may be greater than a preset value. The greater the distance between the sample positions, the lower the correlation between the sample values.

[0129] Accordingly, according to one embodiment of the present invention, when the intra prediction mode of the neighboring block is the angular mode, the unavailable reference sample value may be determined based on the sample closest to the unavailable reference sample among the reconstructed samples on the angle indicated by the intra prediction mode of the neighboring block. In this case, the closest sample may not be limited to the neighboring sample of the current block. Referring to FIG. 13, the unavailable reference sample value may be determined based on the first angle corresponding to the intra prediction mode of the neighboring block. The unavailable reference sample value may be determined based on the closest sample among the reconstructed samples located on the first angle with respect to the position of the unavailable reference sample.

[0130] Figure 14 is a diagram illustrating a reference sample padding method based on the positions of reference samples. As described above, the reference samples can be distinguished into left reference samples and upper reference samples. According to one embodiment of the present invention, the left reference samples and the upper reference samples can be mapped to each other based on their respective positions. For example, an upper reference sample corresponding to each of the left reference samples can be determined.

[0131] According to one embodiment of the present invention, if either of the corresponding first left reference sample and the first upper reference sample is unavailable, the unavailable reference sample value can be determined based on the value of the other available one.

[0132] Specifically, in Fig. 14, the index indicating the relative position of each of the upper reference samples may be 0, ..., N-1, N, ..., 2N-1 from the left. In addition, the index indicating the relative position of each of the left reference samples may be 0, ..., N-1, N, ..., 2N-1 from the top. The upper reference sample and the left reference sample having the same index may be corresponding reference samples. For example, when the index of the first left reference sample is 2N-1, the index of the first upper reference sample corresponding to the first left reference sample may be 2N-1.

[0133] FIG. 15 is a diagram illustrating a method for performing reference sample padding based on surrounding samples. Referring to FIG. 15, a sample located at a specific angle relative to a position of an unavailable reference sample may be a sample located outside the range of reference samples determined based on the size of the current block. For example, if the size of the current block is WXH, the range of reference samples may be the upper left sample of the current block, 2W samples on a line adjacent to the upper side of the current block, and 2H samples on a line adjacent to the left side of the current block. In addition, the range of reference samples may be the upper left sample of the current block, W+H samples on a line adjacent to the upper side of the current block, and W+H samples on a line adjacent to the left side of the current block. As described above, this is because the coding tree unit may have a rectangular shape. In this case, the unavailable reference sample value may be determined using a reconstructed sample that is outside the range of the reference sample. In this case, the reconstructed samples may be samples located on a line adjacent to the upper or left side of the current block.

[0134] Hereinafter, a method for performing reference sample padding of a current block based on a case where a neighboring block is inter-predicted will be described with reference to FIGS. 16 to 18. According to one embodiment of the present invention, a decoder can generate a reference sample of a current block based on a sample of another picture.

[0135] FIG. 16 is a diagram illustrating a reference sample padding method when a neighboring block is inter-predicted. According to an embodiment of the present invention, when a neighboring block of a current block is inter-predicted, reference sample padding may be performed based on sample(s) of a reference picture used for inter-prediction of the neighboring block. Reference sample padding of the current block may be performed based on neighboring samples of a collocated block corresponding to the same position as the current block in the reference picture. In the present disclosure, a collocated block may indicate a block determined based on a reference picture index used for inter-prediction of the neighboring block. In this case, a positional relationship between a neighboring sample of the collocated block and the collocated block may be identical to a positional relationship between an unavailable reference sample and the current block.

[0136] Referring to FIG. 16, if at least some of the reference samples adjacent to the upper boundary of the current block are unavailable, reference sample padding may be performed based on neighboring samples adjacent to the upper boundary of the collocated block. In an additional embodiment, reference sample padding may be performed based on a method by which neighboring blocks of the collocated block included in the reference picture are predicted (e.g., intra-prediction mode or inter-prediction). In this case, the above-described method in which unavailable reference sample values ​​are determined based on the intra-prediction mode of the neighboring blocks may be applied in the same or a corresponding manner.

[0137] FIG. 17 is a diagram illustrating a reference sample padding method when a neighboring block is inter-predicted. According to one embodiment of the present invention, when a neighboring block of a current block is inter-predicted, reference sample padding may be performed based on a reference picture index and a motion vector used for inter-prediction of the neighboring block. For example, an indirect reference block of the current block may be determined based on a reference picture and a motion vector used for inter-prediction of the neighboring block. Next, reference sample padding may be performed based on a neighboring sample of the indirect reference block existing in the reference picture.

[0138] Specifically, the unavailable first reference sample value may be determined based on a specific sample among the surrounding samples of the indirect reference block. The positional relationship between the specific sample and the indirect reference block may be the same as the positional relationship between the current block and the first reference sample. Referring to FIG. 17, if at least some of the reference samples adjacent to the upper boundary of the current block are unavailable, reference sample padding may be performed based on the surrounding samples adjacent to the upper boundary of the indirect reference block.

[0139] Fig. 18 is a diagram illustrating a reference sample padding method when a neighboring block is inter-predicted. According to one embodiment of the present invention, reference sample padding may be performed based on a method by which a neighboring block of an indirect reference block is predicted. For example, when a neighboring block of an indirect reference block is predicted based on any one of a plurality of intra prediction modes, reference sample padding may be performed based on the intra prediction mode of the neighboring block of the indirect reference block. Referring to Fig. 18, when the prediction mode of a neighboring block of an indirect reference block is a first intra prediction mode, the values ​​of unavailable reference samples of the current block may be determined based on the first intra prediction mode. In this case, the method described through Figs. 11 to 15 may be applied as an identical or corresponding method.

[0140] In the embodiments described above, the reference sample padding is described with reference to reference samples included in a reference line 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. For example, the encoder can signal reference line information indicating at least one reference line among the n reference lines used for prediction of the current block. The decoder can obtain the reference line information from a bitstream.

[0141] Hereinafter, when multiple reference lines are available for intra prediction of a current block according to one embodiment of the present invention, the surrounding samples constituting each reference line will be described with reference to FIG. 19. FIG. 19 is a diagram illustrating one embodiment of multiple reference lines composed of surrounding samples of a current block. Here, the surrounding samples of the current block may be samples located within a preset distance from a boundary line of the current block.

[0142] As described above with reference to FIG. 5, samples from one or more of a plurality of reference lines may be used for intra prediction of the current block. For example, the plurality of reference lines may include lines located at a distance of n samples from the boundary of a specific block to be predicted. In this case, n may be an integer greater than or equal to 0.

[0143] Referring to FIG. 19, a first reference line (Line 1), a second reference line (Line 2), and a third reference line (Line 3) may be configured based on the boundary of the current block. Specifically, the first reference line may be configured with adjacent samples located on a line adjacent to the boundary of the current block. The second reference line may be configured with samples located on a line spaced apart by one sample based on the boundary of the current block. The third reference line may be configured with samples located on a line spaced apart by two samples based on the boundary of the current block. Although FIG. 19 illustrates reference lines around the upper boundary of the current block as an example, the present disclosure is not limited thereto. For example, there may be a plurality of reference lines configured based on the left boundary of the current block.

[0144] In intra prediction mode, the reference samples used to predict the current block may be neighboring samples of the current block. For example, neighboring samples may include samples on a line adjacent to the boundary of the current block. The neighboring samples may include samples adjacent to the upper boundary and samples adjacent to the left boundary of the current block. Additionally, the neighboring samples may include samples located above the left of the current block.

[0145] Additionally, the surrounding samples may include samples that are not adjacent to the boundary of the current block. Specifically, the surrounding samples may include samples on a line spaced a specific number of samples to the left from the leftmost sample within the current block. Additionally, the surrounding samples may include samples on a line spaced a specific number of samples upward from the topmost sample within the current block. Here, the specific number of samples may be a value less than or equal to a preset number of samples. For example, if the preset number of samples is 2, the specific number of samples may be any one of 0 to 2. Additionally, the number of samples may mean the number of integer pixels.

[0146] Meanwhile, the intra prediction mode of the current block may be determined based on other information related to the intra prediction of the current block. According to one embodiment of the present invention, the intra prediction mode of the current block may be determined based on reference samples used for intra prediction of the current block. This is because the intra prediction method is a prediction method based on the local similarity between the current block and neighboring blocks.

[0147] For example, the encoder and decoder can determine the intra prediction mode of the current block based on reference samples of the current block. According to one embodiment of the present invention, the encoder can implicitly signal intra prediction mode information using the reference samples, or generate an intra prediction mode set composed of some of the entire modes to signal intra prediction mode information with a smaller number of bits. This allows signaling of intra prediction mode information to be performed efficiently.

[0148] According to one embodiment of the present invention, an intra prediction mode set of a current block can be configured according to the characteristics of reference samples of the current block. An encoder and a decoder can configure an intra prediction mode set according to a predefined rule according to the characteristics of the reference samples of the current block. At this time, the intra prediction mode sets configured by the encoder and the decoder respectively can be the same. In addition, the decoder can determine an intra prediction mode of the current block based on the configured intra prediction mode set and signaled intra prediction mode information. The intra prediction mode information can be a sub-index indicating any one of a plurality of modes constituting the intra prediction mode set. At this time, the sub-index can be a value distinct from the intra prediction mode index described above. For example, the sub-index can be a value mapped to any one of the modes included in the intra prediction mode set according to a preset mapping rule.

[0149] An intra-prediction mode set may be composed of a subset of all modes. For example, an intra-prediction mode set may be composed in a predefined manner based on information related to reference sample padding. An intra-prediction mode set may also be composed in a predefined manner based on the locations of reference samples. Specifically, the locations of the reference samples may be reference lines.

[0150] Hereinafter, a method for determining an intra prediction mode of a current block based on information related to a reference sample of the current block according to one embodiment of the present invention will be described with reference to FIG. 20. FIG. 20 is a diagram illustrating a method for signaling an intra prediction mode of a current block.

[0151] Referring to FIG. 20, in step S2002, a plurality of reference samples for intra prediction of a current block may be determined. The decoder may prepare the reference samples of the current block based on surrounding samples of the current block. For example, if at least some of the reference samples are unavailable, the decoder may perform reference sample padding. In addition, the decoder may determine a reference line. For example, the encoder may signal reference line information indicating a reference line used for prediction of the current block. The decoder may receive the reference line information from a bitstream. The decoder may determine at least one reference line used for prediction of the current block based on the reference line information.

[0152] Next, an intra prediction mode set may be determined based on reference samples. According to one embodiment of the present invention, the intra prediction mode of the current block may be determined based on whether a padded reference sample exists among the reference samples. Referring to step S2004, the intra prediction mode may be determined based on whether a padded reference sample exists. For example, different intra prediction mode sets may be used depending on whether the reference sample is padded. Here, the configuration of the intra prediction modes included in each of the different intra prediction mode sets may be different. For example, the first intra prediction mode set may be composed of at least some of the intra prediction modes constituting the second intra prediction mode set. The first intra prediction mode set includes the intra prediction modes constituting the second intra prediction mode set, and may further include other intra prediction modes.

[0153] If reference sample padding is not performed (step S2004), the intra prediction mode of the current block may be determined based on the first intra prediction mode set (step S2006). At this time, the first intra prediction mode set may be a set composed of all intra prediction modes. The decoder may determine the intra prediction mode of the current block based on the first intra prediction mode set. The encoder may signal intra prediction mode information indicating any one of the modes constituting the first intra prediction mode set. The decoder may determine any one intra prediction mode of the first intra prediction mode set based on intra prediction mode information received from the bitstream. In addition, the decoder may perform intra prediction on the current block based on the determined intra prediction mode.

[0154] If there is at least one padded reference sample (step S2004), the intra prediction mode of the current block may be determined based on a second intra prediction mode set (step S2008). At this time, the second intra prediction mode set may be a set composed of some modes among all intra prediction modes. If there is a padded sample, an intra prediction mode set that excludes an angular mode that predicts the current block by referring to the padded reference sample may be used. This is because the probability of predicting the current block based on the padded reference sample may be lower than the probability of predicting the current block based on the reconstructed reference sample. The decoder may determine the intra prediction mode of the current block based on the second intra prediction mode set. The encoder may signal intra prediction mode information indicating any one of the modes constituting the second intra prediction mode set. The decoder may determine any one intra prediction mode of the second intra prediction mode set based on intra prediction mode information received from the bitstream. Additionally, the decoder can perform intra prediction for the current block based on the determined intra prediction mode.

[0155] According to a further embodiment of the present invention, the intra prediction mode of the current block may be determined based on the position of the padded reference sample. For example, different sets of intra prediction modes may be used depending on the position of the padded reference sample. In the above-described embodiment, the selection of one of the first intra prediction mode and the second intra prediction mode is exemplified, but the present disclosure is not limited thereto. For example, multiple sets of intra prediction modes may be configured based on the characteristics of the reference samples. Furthermore, the intra prediction mode of the current block may be determined based on one of the multiple sets of intra prediction modes.

[0156] According to one embodiment of the present invention, a set of intra prediction modes for predicting a current block may be configured based on the locations of reference samples. The locations of the reference samples may be reference lines. As described above, the encoder and decoder may predict the current block using any one of a plurality of reference lines composed of surrounding samples of the current block. According to one embodiment, the intra prediction mode of the current block may be determined based on the reference line including reference samples of the current block.

[0157] For example, an intra prediction mode set for a current block may be configured based on reference line information. The reference line information may be information indicating a reference line used for prediction of the current block among a plurality of reference lines of the current block. The plurality of reference lines of the current block may include a first reference line composed of neighboring samples on a line adjacent to a boundary of the current block. The plurality of reference lines of the current block may include one or more second reference lines that are not adjacent to the boundary of the block. In addition, each of the one or more second reference lines may be composed of neighboring samples on a line spaced apart by a specific number of samples from the boundary of the current block. In this case, the specific number of samples spaced apart from the boundary of the current block may vary for each reference line.

[0158] According to one embodiment, when a reference line for intra prediction of a current block is a first reference line, an intra prediction mode of the current block may be determined based on a first intra prediction mode set. The first intra prediction mode set may include all intra prediction modes. Furthermore, when a reference line for intra prediction of the current block is not the first reference line, an intra prediction mode of the current block may be determined based on a second intra prediction mode set. According to one embodiment, a plurality of reference lines may be used for intra prediction of the current block. When the plurality of reference lines for intra prediction of the current block include a second reference line, an intra prediction mode of the current block may be determined based on the second intra prediction mode set. The second intra prediction mode set may be composed of some of the modes constituting the first intra prediction mode.

[0159] Specifically, the second intra prediction mode set may be composed of n angular modes. In addition, the first intra prediction mode set may include m angular modes, a planar mode, and a DC mode. Here, m may be greater than n. According to an embodiment, m may be the total number of angular modes used for intra prediction. In addition, the second intra prediction mode set may be composed of some of the modes constituting the first intra prediction mode set. The angular modes may include the basic angular mode and the extended angular mode described above with reference to FIG. 6. In an embodiment, the second intra prediction mode set may be composed based on the intra prediction mode of a neighboring block of the current block.

[0160] The second intra prediction mode set may include the intra prediction mode of an intra-predicted block among the neighboring blocks. According to one embodiment, if the intra prediction mode of the neighboring block is an angular mode, the angular mode may be included in the second intra prediction mode set. In addition, the second intra prediction mode set may be composed of a preset number of angular modes. For example, the second intra prediction mode set may include angular modes obtained by adding a preset offset (e.g., -1, +1) to the angular mode of the neighboring block. If there are multiple blocks predicted based on the intra prediction mode among the neighboring blocks of the current block, the second intra prediction mode set may be composed by considering the context of the neighboring blocks. For example, the second intra prediction mode set may be composed in a method identical to or corresponding to the MPM list composition method described above with reference to FIG. 7. The second intra prediction mode set may be an MPM list.

[0161] If there is no intra-predicted block based on an angular mode among the surrounding blocks of the current block, the second intra-prediction mode set may be configured based on a preset angular mode. For example, the preset angular mode may include at least one of a horizontal diagonal mode, a horizontal mode, a diagonal mode, a vertical mode, and a vertical diagonal mode. In addition, the second intra-prediction mode set may include angular modes in which a preset offset (e.g., -1, +1) is added to the preset angular mode.

[0162] According to one embodiment, the encoder can signal reference line information indicating a reference line used for prediction of the current block among a plurality of reference lines of the current block. The decoder can obtain the reference line information from the bitstream. In addition, the encoder and the decoder can configure an intra prediction mode set according to a predefined rule based on the reference line information. In this case, the intra prediction mode sets configured by the encoder and the decoder can be identical. The decoder can determine an intra prediction mode for the current block based on the configured intra prediction mode set.

[0163] For example, an encoder can signal intra prediction mode information indicating one of a configured intra prediction mode set. A decoder can obtain the intra prediction mode information by parsing a bitstream. The decoder can determine an intra prediction mode index of a current block based on the intra prediction mode set and the intra prediction mode information. The decoder can perform intra prediction of the current block based on the determined intra prediction mode index. Furthermore, the decoder can perform intra prediction of the current block based on a plurality of reference samples on a reference line according to reference line information and the intra prediction mode index. The decoder can determine a reference line used for prediction of the current block based on the reference line information. If at least some of the plurality of samples on the reference line used for intra prediction of the current block are not available, the decoder can prepare reference samples of the current block by performing reference sample padding as described above with reference to FIGS. 9 to 18.

[0164] Through this, a method for constructing an intra prediction mode set composed of some modes among all modes can be implicitly signaled through reference line information. Depending on the reference line, an intra prediction mode set including intra prediction modes that are highly likely to have been used in the prediction of the current block can be constructed. This is because intra prediction modes that improve prediction performance may differ depending on the reference line. In addition, intra prediction mode information indicating one of the intra prediction mode sets composed of a smaller number of modes than the total number of modes can be signaled. Accordingly, efficient signaling for intra prediction mode information can be performed.

[0165] In step S2010, prediction for the current block may be performed based on the determined intra prediction mode. The decoder may perform intra prediction for the current block based on the determined intra prediction mode to generate a predicted block.

[0166] FIG. 21 is a diagram illustrating a method for signaling intra prediction mode information based on the position of a padded reference sample. According to a further embodiment of the present invention, an intra prediction mode corresponding to an additional angle may be signaled according to the position of a padded reference sample. For example, in FIG. 21, an intra prediction mode set for a current block may be composed of modes between indices 34 and 66. In this case, an additional angle between the angles corresponding to indices 34 and 66 may be signaled using the bit(s) that were allocated to signal an intra prediction mode corresponding to an index lower than indices 34. Alternatively, intra prediction mode information may be signaled with a smaller number of bits through an intra prediction mode set composed of some of the entire modes.

[0167] Referring to FIG. 21, the surrounding samples adjacent to the upper boundary of the current block may include reconstructed samples. Additionally, the surrounding samples adjacent to the left boundary of the current block may all be composed of padded surrounding samples. In this case, the intra prediction mode of the current block may be determined so that the upper surrounding samples are used for intra prediction. For example, the intra prediction mode set may be composed of intra prediction modes corresponding to indices 34 to 66. This is because the probability of prediction using previously reconstructed reference samples may be higher than the probability of prediction using padded reference samples.

[0168] FIG. 22 is a diagram illustrating a method for determining an intra prediction mode based on the relative position of a current block. According to one embodiment of the present invention, the intra prediction mode of a current block may be determined based on the relative position of the current block within a higher-level region of the current block. Here, the higher-level region of the current block may be a slice or tile containing the current block. Furthermore, the higher-level region of the current block may be a picture containing the current block. Furthermore, the higher-level region of the current block may be a CTU or CTB (coding tree block) containing the current block.

[0169] In one embodiment, a set of intra prediction modes for a current block may be configured differently depending on the relative position of the current block within a higher-level region. This is because, depending on the position of the current block, surrounding samples of the current block may not be available for prediction of the current block. For example, a set of intra prediction modes may be configured differently depending on the relative position of the current block within a picture, slice, tile, CTU, or CTB. The decoder may determine the intra prediction mode of the current block using the set of intra prediction modes configured based on the relative position of the current block.

[0170] The encoder and decoder can configure a set of intra prediction modes based on predefined rules based on the relative position of the current block within the upper-level region. The intra prediction mode sets configured by the encoder and decoder may be identical. Furthermore, the decoder can use the configured set of intra prediction modes to determine the intra prediction mode of the current block. Furthermore, the decoder can perform prediction of the current block based on the determined intra prediction mode.

[0171] According to one embodiment of the present invention, when the position of the current block is a preset position, the intra prediction mode of the current block may be determined using a preset intra prediction mode set. In this case, the position of the current block may indicate the position of an upper-level region of an upper-left corner sample of the current block among the samples included in the current block. Specifically, the preset position may be a position where the boundary of the current block is adjacent to the boundary of the upper-level region. The preset position may be a position set based on at least one of a scanning order or an encoding / decoding order. For example, the preset position may be a position of a block that is processed first in a parallel processing area. The preset position may be a position adjacent to the upper boundary of a picture (or a tile / slice / CTU / CTB). Additionally, the preset position may be a position adjacent to the left boundary of the picture (or a tile / slice / CTU / CTB). This is because, when the current block is adjacent to the boundary of a picture (or a tile / slice / CTU / CTB), there may not be any previously reconstructed blocks around the current block. The set of pre-configured intra prediction modes may consist of all intra prediction modes.

[0172] Additionally, if the upper boundary of the current block overlaps the upper boundary of the upper level region, the available upper neighboring blocks may be limited. In this case, among the aforementioned multiple reference lines, the use of a reference line that is not adjacent to the boundary of the current block may not be permitted. The encoder and decoder can predefine that the reference line adjacent to the current block is used if the current block is adjacent to the upper boundary of the upper level region. Accordingly, if the current block is adjacent to the upper boundary of the upper level region, the decoder can predict the current block based on the reference line adjacent to the current block. Furthermore, the decoder can construct an intra prediction mode set for the current block based on the reference line adjacent to the current block, and determine the intra prediction mode. Furthermore, the decoder can perform prediction on the current block based on the determined intra prediction mode.

[0173] According to one embodiment of the present invention, if the position of the current block is not the aforementioned preset position, an intra prediction mode set may be configured using the method described above with reference to FIGS. 19 to 21. If the position of the current block is not the aforementioned preset position, the encoder and decoder may configure an intra prediction mode set composed of some of the entire modes. Furthermore, the decoder may perform intra prediction on the current block based on the configured intra prediction mode.

[0174] According to another embodiment of the present invention, when the location of the current block is a preset location, prediction for the current block can be performed using a preset intra prediction mode. In this case, the preset intra prediction mode can include at least one of a planar mode or a DC mode. In addition, when the location of the current block is a preset location, the encoder and the decoder can perform intra prediction for the current block using an intra prediction mode set composed of intra prediction modes excluding some angular modes. At this time, some angular modes can be determined according to the locations of unavailable reference samples among the reference samples of the current block. For example, they can be angular modes corresponding to a prediction direction predicted from the unavailable reference samples. Specifically, when a reference sample located on the left side of the current block is unavailable, the encoder and the decoder can configure an intra prediction mode set composed of the remaining intra prediction modes excluding at least intra prediction mode indices 2 to 18. This is because if reference sample padding is performed based on the position of the current block, the probability that some angular modes will be used for intra prediction of the current block may be low.

[0175] According to another embodiment of the present invention, the intra prediction mode of the current block can be determined based on the similarity between reference samples of the current block. In this case, the intra prediction mode of the current block can be implicitly signaled. The encoder and decoder can select the intra prediction mode of the current block using a predetermined rule without separate signaling. This intra prediction mode information signaling method may be referred to as implicit signaling. Hereinafter, a method for determining the intra prediction mode of the current block based on the similarity between neighboring samples of the current block will be described in detail with reference to FIGS. 23 to 25.

[0176] FIG. 23 is a diagram illustrating an embodiment of a method for determining an intra prediction mode of a current block based on similarity between neighboring samples. According to an embodiment of the present disclosure, the intra prediction mode of the current block may be determined using a plurality of reference sample subsets each composed of a plurality of neighboring samples. For example, the intra prediction mode of the current block may be determined based on the similarity between a first reference sample subset and a second reference sample subset. Here, the neighboring sample configurations included in each of the first reference sample subset and the second reference sample subset may be different from each other.

[0177] For convenience of explanation, the following describes a method for determining an intra prediction mode based on a first reference sample subset and a second reference sample subset. However, the present disclosure is not limited thereto. For example, two or more reference sample subsets may be configured, and the intra prediction mode of the current block may be determined based on these.

[0178] Referring to FIG. 23, in step S2302, the decoder may determine a first reference sample subset and a second reference sample subset similar to the first reference sample subset. The first reference sample subset and the second reference sample subset may be composed of surrounding samples at different locations. For example, the first reference sample subset may be a subset composed of surrounding samples located above the current block. Additionally, the second reference sample subset may be a subset composed of surrounding samples located to the left of the current block. The first reference sample subset and the second reference sample subset may be subsets composed of samples on different reference lines.

[0179] The second reference sample subset may be determined based on similarity with the first reference sample subset. For example, the second reference sample subset may be a subset having a similarity greater than or equal to a preset value with the first reference sample subset. For example, the similarity may be a correlation between the first reference sample subset and the second reference sample subset. The similarity may be calculated based on the values ​​of surrounding samples included in the reference sample subset.

[0180] Specifically, the similarity may be calculated by comparing a value of a first peripheral sample, which is one of a plurality of peripheral samples constituting a first reference sample subset, with a value of a second peripheral sample, which is one of a plurality of peripheral samples constituting a second reference sample subset. Furthermore, the similarity may be calculated by comparing values ​​of a plurality of samples by position. The encoder and the decoder may compare values ​​of a plurality of reference samples constituting a first reference sample subset with values ​​of a plurality of reference samples constituting a second reference sample subset.

[0181] According to one embodiment, the similarity may be calculated based on at least one of a gradient, a directional change, or a sample value difference between a plurality of surrounding samples constituting each of the first reference sample subset and the second reference sample subset. For example, the encoder and the decoder may calculate the similarity by comparing the gradient values ​​of the samples constituting the first reference sample subset with the gradient values ​​of the samples constituting the second reference sample subset. The encoder and the decoder may calculate the similarity by comparing the sample value differences between the samples constituting the first reference sample subset with the sample value differences between the samples constituting the second reference sample subset.

[0182] Additionally, a plurality of subsets including edges can be obtained based on at least one of gradients, directional variations, or sample value differences of a plurality of surrounding samples constituting the reference sample subset. When the first reference sample subset and the second reference sample subset include edges, the intra prediction mode of the current block can be determined based on the positional relationship between the first reference sample subset and the second reference sample subset.

[0183] According to an additional embodiment of the present invention, the first reference sample subset and the second reference sample subset may be configured to exclude unavailable reference samples. The reference sample subset may not include reference samples at positions where padding has been performed. This is because the sample values ​​of the padded reference samples are generated based on the values ​​of adjacent samples. Furthermore, errors may occur when calculating similarity using unrestored reference samples.

[0184] According to a further embodiment of the present invention, a second reference sample subset may be determined additionally using subpixels. For example, the similarity between a plurality of reference sample subsets may be calculated using subpixels of each of the plurality of reference sample subsets. In this case, a subpixel may be a pixel of a subpel unit located between adjacent integer samples. The subpixel may be a value obtained by interpolating integer samples. The subpixel may be obtained using at least one of a linear filter or a DCT filter used for intra prediction. When using subpixels, a larger number of angular modes may be implicitly signaled.

[0185] In step S2304, the intra prediction mode of the current block may be determined. For example, the intra prediction mode of the current block may be determined based on the positional relationship between the first reference sample subset and the second reference sample subset. This will be described with reference to FIGS. 24 and 25 . In step S2305, intra prediction for the current block may be performed based on the determined intra prediction mode. Meanwhile, in the present embodiment, the samples used to calculate the similarity and the reference samples referenced in the intra prediction process may be different samples. For example, in the embodiments of FIGS. 23 to 25 , the reference sample subset may be composed of neighboring samples of the current block, regardless of whether they are referenced during intra prediction.

[0186] According to a further embodiment of the present invention, the intra prediction mode of the current block can be determined based on multiple reference sample subsets composed of surrounding samples. For example, multiple candidate subsets can be formed based on the locations of the surrounding samples. Furthermore, by calculating similarity between the multiple candidate subsets, a pair of subsets with the greatest similarity can be determined.

[0187] In addition, according to an additional embodiment of the present invention, the amount of variation between neighboring samples of the current block may be determined first. The amount of variation may be calculated based on the gradient, slope, or sample value difference between neighboring samples of the current block. Depending on the amount of variation between neighboring samples of the current block, it may be determined whether the intra prediction mode is signaled using the method described above. For example, if the amount of variation is less than a preset amount, the intra prediction mode of the current block may not be signaled using the method described above. In addition, if the amount of variation is greater than or equal to the preset amount, the intra prediction mode may be signaled using the method described above. Alternatively, even if the amount of variation is less than the preset amount, the intra prediction mode may be signaled using the method described above. This is because, in the case of the planar mode or the DC mode, the amount of variation between neighboring samples may not be large.

[0188] FIG. 24 is a diagram illustrating one embodiment of a method for determining an intra prediction mode of a current block based on surrounding samples. Referring to FIG. 24, the shaded portion may indicate an area where the first reference sample subset and the second reference sample subset are similar. For example, the sample values ​​of each sample included in the shaded portion in the original picture or the reconstructed picture may be within a preset range. The closer the prediction direction is to the shape of the shaded portion, the better the prediction performance may be.

[0189] In Fig. 24, the first reference sample subset may be composed of a plurality of surrounding samples located above the current block. In addition, the second reference sample subset may be composed of a plurality of surrounding samples located to the left of the current block. The values ​​of the surrounding samples included in the shaded portion among the surrounding samples constituting the first reference sample subset may change similarly to the values ​​of the surrounding samples included in the shaded portion among the surrounding samples constituting the second reference sample subset. In this case, the intra prediction mode of the current block may be determined based on the direction in which samples with high similarity are connected.

[0190] According to a further embodiment of the present invention, a plurality of intra prediction modes may be determined based on the first reference sample subset and the second reference sample subset determined in step S2302. For example, two angular modes corresponding to one angle determined based on the positions of the first reference sample subset and the second reference sample subset may be possible. The two angular modes may be a first angular mode and a second angular mode in an opposite direction to the direction corresponding to the first angular mode, respectively. Intra prediction mode information indicating any one of the plurality of angular modes needs to be signaled. In addition, if any one of the first angular mode and the second angular mode determined based on the positions of the first reference sample subset and the second reference sample subset corresponds to the aforementioned wide-angle mode, the current block may be predicted based on the angular mode rather than the wide-angle mode.

[0191] In one embodiment, the intra prediction mode of the current block may be determined based on the indices of multiple angular modes. For example, the angular mode with the lowest index among the multiple angular modes may be used as the intra prediction mode of the current block. Alternatively, the angular mode with the highest index among the multiple angular modes may be used as the intra prediction mode of the current block.

[0192] According to another embodiment, the intra prediction mode of the current block may be determined based on the residual signal of the current block. For example, the intra prediction mode of the current block may be determined using the residual signal for each region within the current block. Specifically, a first residual signal sum of samples located at the uppermost line within the current block may be obtained. A second residual signal sum of samples located at the leftmost line within the current block may be obtained. If the second residual signal sum is greater than the first residual signal sum, an intra prediction mode corresponding to a prediction angle predicted from the upper side to the left may be used for prediction of the current block. Conversely, if the first residual signal sum is greater than the second residual signal sum, an intra prediction mode corresponding to a prediction angle predicted from the left side to the upper side may be used for prediction of the current block. This is because, in the case of intra prediction, the closer a predicted sample is to a reference sample used for intra prediction, the smaller the residual signal may be.

[0193] According to another embodiment, the intra prediction mode of the current block may be determined based on the number of padded reference samples included in the reference sample subset. For example, an intra prediction mode in a direction referenced from a reference sample subset with a smaller number of padded reference samples may be used for prediction of the current block. This is because padded reference samples may represent less characteristics of the original signal than reconstructed reference samples. Furthermore, the probability of a prediction based on reconstructed reference samples may be higher than the probability of a prediction based on padded reference samples.

[0194] FIG. 25 is a diagram illustrating one embodiment of a method for determining an intra prediction mode of a current block based on surrounding samples. Referring to FIG. 25, the intra prediction mode of the current block may be determined based on the positions of a first reference sample subset and a second reference sample subset. The first reference sample subset and the second reference sample subset may be a pair of subsets whose similarity is greater than or equal to a preset value, as described above.

[0195] In FIG. 25, the first reference sample subset may include a first sample located n-th to the right from a surrounding sample located at the upper left of the current block. In addition, the first reference sample subset may include a predetermined number of samples that are consecutive to the right from the first sample. The second reference sample subset may include a second sample located m-th to the bottom from a surrounding sample located at the upper left of the current block. In addition, the second reference sample subset may include a predetermined number of samples that are consecutive to the bottom from the second sample.

[0196] At this time, the intra prediction mode of the current block can be determined based on n and m. Specifically, in FIG. 25, the angle (θ) between the line connecting the first sample and the second sample and the line adjacent to the left boundary of the current block can be arctan(n / m). The intra prediction mode of the current block can be a prediction mode corresponding to the first angle (θ) or the second angle (θ - a*π). At this time, a can be an integer, and π can be pi.

[0197] Meanwhile, among the multiple angle modes included in the intra prediction mode set, there may not be an angle mode that matches the line connecting the first sample and the second sample. For example, the first angle (θ) may not be mapped to an angle corresponding to the preset angle modes, as shown in FIG. 6. In this case, among the angles corresponding to the angle modes, the angle mode that corresponds to the angle closest to the first angle (θ) may be used as the intra prediction mode of the current block.

[0198] As described above, the intra prediction mode of the current block can be determined based on the similarity between neighboring samples of the current block. Accordingly, the encoder and decoder can reduce the signaling overhead for the intra prediction mode of the current block. According to an additional embodiment of the present invention, when a method of determining the intra prediction mode of the current block based on reference samples and a conventional method of signaling intra prediction mode information are used in combination, signaling for this may be required.

[0199] In one embodiment, the method for determining the intra prediction mode may be explicitly signaled. For example, the method for determining the intra prediction mode may be signaled for each block. Alternatively, the availability of multiple methods may be signaled for each first region, and the method for determining the intra prediction mode used may be signaled for each second region. For example, the first region may be a higher-level region including multiple second regions. The first region may be a picture (or tile / slice), and the second region may be a coding unit or block divided for coding.

[0200] In another embodiment, the method for determining the intra prediction mode can be implicitly signaled. For example, the encoder and decoder can select the intra prediction mode determination method based on a preset method. Specifically, if the variation between neighboring samples of the current block is greater than a preset value, the method based on the aforementioned reference sample can be used. If the variation is less than the preset value, the existing method can be used.

[0201] Hereinafter, a method for dividing a coding tree unit into coding units according to another embodiment of the present invention will be described. FIG. 26 is a diagram illustrating an embodiment of a method for dividing vertical blocks and horizontal blocks. A binary block divided by binary division from a leaf node of a quad tree can be divided into a vertical block and a horizontal block. A block whose vertical side length is longer than the horizontal side length, such as an Nx2N block size, can be referred to as a vertical block. A vertical block can be generated by vertical binary division from a leaf node of the quad tree.

[0202] If a vertical block is a leaf node, the vertical block may not be further split. Alternatively, the vertical block may be further split according to a specific condition. The specific condition may include the parameters described above with respect to the multi-type tree. The vertical block may be split into two (N / 2)x2N nodes by a vertical binary split. Alternatively, the vertical block may be split into two NxN nodes by a horizontal binary split. Alternatively, the vertical block may be split into four (N / 2)xN nodes by a binary quadtree (BQ) split. Alternatively, the vertical block may be split into two Nx(N / 2) nodes and one NxN node by a horizontal ternary split. Alternatively, the vertical block may be split into two (N / 4)x2N) nodes and one (N / 2)x2N node by a vertical ternary split.

[0203] Additionally, a block whose horizontal side length is longer than its vertical side length, such as a 2NxN block size, may be referred to as a horizontal block. A horizontal block may be generated by a horizontal binary partition from a leaf node of a quad tree. If a horizontal block is a leaf node, the horizontal block may not be further partitioned. Alternatively, the horizontal block may be further partitioned according to a specific condition. The specific condition may include the parameters described above with respect to a multi-type tree. A horizontal block may be partitioned into two NxN nodes by a vertical binary partition. Alternatively, a vertical block may be partitioned into two 2Nx(N / 2) nodes by a horizontal binary partition. Alternatively, a vertical block may be partitioned into four Nx(N / 2) nodes by a binary quadtree (BQ) partition. Alternatively, a horizontal block may be partitioned into two (N / 2)xN nodes and one NxN node by a vertical ternary partition. Alternatively, a horizontal block can be split into two 2Nx(N / 4) nodes and one 2Nx(N / 2) node by vertical ternary partitioning.

[0204] According to one embodiment of the present invention, binary quadtree partitioning may be performed according to preset conditions. For example, whether a binary block can be BQ partitioned may be determined on a per-picture, per-slice, per-tile, per-CTU, or per-CU basis. The encoder may signal whether BQ partitioning of a binary block is allowed on a per-picture, per-slice, per-tile, per-CTU, or per-CU basis. If binary quadtree partitioning is allowed, a BQ partitioning signaling field for the current block may be signaled. According to another embodiment, when a binary block is BQ partitioned, the partitioning may be the final partitioning without any further partitioning. In addition, the partitioned blocks may represent encoding units. In addition, the partitioned blocks may represent transforming units. In other words, prediction, etc. may be performed integrally in blocks prior to BQ block partitioning, and in blocks partitioned into BQ, transformation may be performed on individual blocks. The BQ partitioning of a binary block can be restricted to cases where the size of one side of the binary block is MinBtSize. Only when the size of the shorter side of the binary block is MinBtSize, a signaling field for the BQ block partitioning can be additionally signaled. In addition, the ternary partitioning of a binary block can be determined based on a separate parameter related to the ternary partitioning. For example, the separate parameter can be the aforementioned MaxTtSize.

[0205] Figure 27 is a diagram illustrating an embodiment of a method for signaling the splitting of a quad tree, a binary tree, and a ternary tree. Figure 27(a) illustrates an embodiment of a method for signaling the splitting of a quad tree. If QT Split indicates a split, the corresponding node is split into quad tree nodes, and if it does not indicate a split, the corresponding node may become a leaf node. In this case, if the quad tree is signaled as a leaf node, binary tree splitting information may be additionally signaled.

[0206] Figure 27(b) illustrates one embodiment of how a split in a binary tree is signaled. If BT Split does not indicate a split, the node becomes a leaf node; if it does indicate a split, signaling indicating a vertical or horizontal split may be added.

[0207] Fig. 27(c) illustrates a method for signaling the splitting of a binary tree according to another embodiment of the present invention. If BT Adaptive Split is 1, the node can be split by either vertical binary splitting or horizontal binary splitting. If BT Adaptive Split is 0, the node can be a leaf node or split by either vertical binary splitting or horizontal binary splitting. Signaling indicating whether it is a leaf node or a binary split can be added. The encoder can preferentially signal one direction of binary splitting among the binary splittings. This can reduce signaling overhead when the splitting is frequently selected from the entire picture, slice, tile, or CTU units.

[0208] The adaptive signaling method of Fig. 27(c) can be adaptively used or signaled through the following methods. For example, the adaptive signaling method can be used when the maximum BT depth (MaxBTDepth), which represents the maximum number of allowed BT splits, is greater than a preset value. This is because when MaxBTDepth is large, signaling for binary tree splits occurs frequently, which may result in the effect of adaptive signaling. On the other hand, when MaxBTDepth is small, the number of signaling for binary tree splits is small, making it difficult to obtain the effect of adaptive signaling. Accordingly, when MaxBTDepth is less than a preset value, the signaling method of Fig. 27(b) can be used.

[0209] Additionally, the encoder can signal information related to the adaptive signaling method on a picture (or tile / slice) basis. Specifically, the encoder can signal a split direction that is preferentially signaled by BT Adaptive Split among vertical binary splitting and horizontal binary splitting. Additionally, the split direction that is preferentially signaled by BT Adaptive Split can be changed based on the context at the picture (or tile / slice) level. For example, the split direction that is preferentially signaled can be determined based on the frequency of vertical binary splitting and horizontal binary splitting up to the previous block of the current block.

[0210] Additionally, for I-slices in which all blocks are encoded in intra prediction mode, adaptive signaling for chroma block segmentation can be performed based on the segmentation structure of the luma block corresponding to the chroma block. The luma block corresponding to the chroma block can be selected based on the block corresponding to the position of the pixel in the central region of the chroma block. Alternatively, luma blocks corresponding to pixels in multiple regions, such as the upper left, upper right, center, lower left, or lower right, within the chroma block can be selected. The method by which the segmentation of the chroma block is signaled can be changed using the segmentation structure of one or more luma blocks corresponding to the chroma block. For example, if the luma block is a vertical block, a signaling method in which vertical binary segmentation is preferentially signaled can be selected with respect to the segmentation of the chroma block.

[0211] Fig. 27(d) illustrates an embodiment of a method for signaling a QTBT combined block split structure. If QTBT Split is 1, the corresponding node is split into a quad tree, and if it is 0, the corresponding node can be a leaf node or a binary tree split. In addition, signaling indicating whether it is a leaf node or split into a binary tree can be added. In addition, if it indicates splitting into a binary tree, signaling indicating whether it is a vertical binary split or a horizontal binary split can be added.

[0212] Figure 27(e) illustrates one embodiment of how a binary tree split is signaled when a BQ split is allowed. As in Figure 27(c), either the horizontal binary split or the vertical binary split may be signaled first. Additionally, the other of the horizontal binary split or the vertical binary split may be signaled, and whether it is a leaf node or a BQ split may be signaled.

[0213] Fig. 27(f) illustrates another embodiment of a method for signaling a binary tree split when BQ splitting is allowed. The splitting of the binary tree can be signaled using a fixed-length coding method. Signaling can be performed to indicate leaf nodes, horizontal binary splits, vertical binary splits, and BQ splits, respectively. Efficient signaling can be performed when the occurrence probabilities of leaf nodes, horizontal binary splits, vertical binary splits, and BQ splits are similar.

[0214] Figure 27(g) illustrates an embodiment of how QTBT combined block splitting is signaled when BQ splitting is allowed. In Figure 27(g), signaling can be performed regardless of whether the current tree structure is a quad tree or a binary tree.

[0215] Fig. 28 is a diagram illustrating an embodiment of a method for signaling a split of a ternary tree. Referring to Fig. 28(a), if BTTT Split is 0, the corresponding node can be a leaf node. Additionally, if BTTT Split is 1, the corresponding node can be split into a binary tree or a ternary tree. A bit indicating whether it is a binary tree split or a ternary tree split, and a bit indicating whether it is a horizontal split or a vertical split in each case, can be additionally signaled.

[0216] Referring to Fig. 28(b), the split direction can be signaled with priority over the split shape. Whether it is a horizontal or vertical split can be signaled with priority over whether it is a binary tree or a ternary tree. If BTTT Split is 0, the node becomes a leaf node, and if it is 1, the node can be split into either a horizontal or vertical split. In this case, a bit signaling a horizontal or vertical split and a bit signaling a binary tree or a ternary tree can be additionally signaled.

[0217] Meanwhile, whether ternary tree splitting is allowed can be determined on a picture, slice, tile, or CTU basis. For example, if a pre-defined condition is met on a picture, slice, tile, or CTU basis, ternary tree splitting can be allowed. Alternatively, the encoder can signal whether ternary tree splitting is allowed on a picture, slice, tile, or CTU basis. If ternary tree splitting is not allowed, the signaling method of Fig. 28(b) can reduce signaling overhead by 1 bit compared to the signaling method of Fig. 28(a). If ternary tree splitting is not allowed, the signaling method of Fig. 28(b) can signal binary tree splitting with up to 2 bits.

[0218] Referring to Fig. 28(c), depending on the binary tree structure, the corresponding node may become a leaf node or be split into multiple nodes through vertical binary partitioning, horizontal binary partitioning, vertical ternary partitioning, or horizontal ternary partitioning. In one embodiment, the encoder may preferentially signal either the vertical binary partitioning or the horizontal binary partitioning, and then signal the remaining partition structures. In this case, the adaptive signaling method described through Fig. 27(c) may also be applied in the same or corresponding manner.

[0219] FIG. 29 is a diagram specifically showing a structure in which a vertical block is divided according to an embodiment of the present invention. Referring to FIG. 29(a), a block of size 2Nx2N can be divided into a first left vertical block (LVB) and a first right vertical block (RVB) of size Nx2N through vertical binary division. In this case, the division structure of the first right vertical block may be limited depending on the division structure of the first left vertical block. For example, when the first left vertical block is horizontally binary divided, the first right vertical block may not be allowed to be horizontally binary divided. This is because when the first left vertical block and the first right vertical block are horizontally binary divided, it is the same as a block of size 2Nx2N being divided into a quad-tree structure. In addition, this is because it is possible to signal quad-tree division in a 2Nx2N block. Accordingly, when a horizontal binary split for the first left vertical block is signaled, the split for the first right vertical block may be signaled except when a horizontal binary split is performed.

[0220] Referring to Fig. 29(b), a vertical block of Nx2N can be vertically binary partitioned into a second left vertical block and a second right vertical block of (N / 2)x2N size. In this case, the partitioning structure of the second right vertical block can be restricted depending on the partitioning structure of the second left vertical block. For example, if the second left vertical block is horizontally binary partitioned, the second right vertical block may not be allowed to be horizontally binary partitioned. This is because when the second left vertical block and the second right vertical block are horizontally binary partitioned, it is equivalent to binary quad partitioning from a block of size Nx2N. In addition, this is because it is possible to signal BQ partitioning in an Nx2N node. Accordingly, when horizontal binary partitioning for the second left vertical block is signaled, the partitioning of the second right vertical block can be signaled except when horizontal binary partitioning is performed.

[0221] FIG. 30 is a diagram specifically showing a structure in which a horizontal block is divided according to an embodiment of the present invention. Referring to FIG. 30(a), a block of size 2Nx2N can be divided into a first upper horizontal block (UHB) and a first lower horizontal block (LHB) of size 2NxN through horizontal binary division. In this case, the division structure of the first lower horizontal block can be limited depending on the division structure of the first upper horizontal block. For example, when the first upper horizontal block is vertically binary divided, the first lower horizontal block may not be allowed to be horizontally binary divided. This is because when the first upper horizontal block and the first lower horizontal block are vertically binary divided, it is the same as a block of size 2Nx2N being divided into a quad-tree structure. In addition, this is because it is possible to signal quad-tree division in a 2Nx2N block. Accordingly, when a vertical binary split for the first upper horizontal block is signaled, the split for the first lower horizontal block may be signaled, except in the case where a vertical binary split is performed.

[0222] Referring to Fig. 30(b), a 2NxN horizontal block can be horizontally binary-partitioned into a second upper horizontal block and a second lower horizontal block of size 2Nx(N / 2). In this case, the partitioning structure of the second lower horizontal block can be restricted depending on the partitioning structure of the second upper horizontal block. For example, if the second upper horizontal block is vertically binary-partitioned, the second lower horizontal block may not be allowed to be vertically binary-partitioned. This is because when the second upper horizontal block and the second lower horizontal block are horizontally binary-partitioned, it is the same as binary quad-partitioning from a block of size 2NxN. In addition, this is because it is possible to signal BQ partitioning in a 2NxN node. Accordingly, when vertical binary partitioning for the second upper horizontal block is signaled, the partitioning of the second lower horizontal block can be signaled except when it is vertically binary-partitioned.

[0223] As described above with reference to FIGS. 29 and 30, according to one embodiment of the present invention, the type of segmentation signaling for a current block can be limited based on segmentation information of surrounding blocks. This allows segmentation information for coding tree units or coding units to be efficiently signaled.

[0224] Fig. 31 is a diagram illustrating an embodiment of a method for determining a block scanning order. Fig. 31(a) illustrates embodiments of a scanning order for multiple nodes divided from a node of size 2Nx2N. Here, a node of size 2Nx2N may include a CTU. An encoder and a decoder may use the same scanning order according to a predefined rule. For example, if the node is divided into four nodes by quad-tree partitioning ((a)(1)), encoding and decoding of four blocks may be performed according to the jet scanning order as in Fig. 31(a).

[0225] The node can be divided into multiple blocks by binary partitioning or ternary partitioning. As illustrated in Fig. 31(a), if the node is vertically partitioned ((a)(2), (4)), the multiple blocks can be sequentially encoded and decoded from left to right (horizontal direction). Furthermore, if the node is horizontally partitioned ((a)(3), (5)), the multiple nodes can be sequentially encoded and decoded from top to bottom (vertically).

[0226] Fig. 31(b) illustrates embodiments of a scanning order for a plurality of blocks divided from a vertical block. As in (3) of Fig. 31(b), when a vertical block is divided by BQ division, encoding and decoding of four blocks can be performed according to a jet scan order. When a vertical block is divided in a vertical direction ((b)(1)), the plurality of blocks can be sequentially encoded and decoded from left to right (horizontal direction). In addition, when a vertical block is divided in a horizontal direction ((b)(2), (4)), the plurality of nodes can be sequentially encoded and decoded from top to bottom (vertically direction).

[0227] Fig. 31(c) illustrates embodiments of a sequence for scanning a plurality of blocks divided from a horizontal block. As in (3) of Fig. 31(c), when a vertical block is divided by BQ division, encoding and decoding of four blocks can be performed according to the jet scan sequence. When a horizontal block is divided in the vertical direction ((c)(1), (4)), the plurality of blocks can be sequentially encoded and decoded from left to right (horizontal direction). In addition, when a horizontal block is divided in the horizontal direction ((c)(2)), the plurality of nodes can be sequentially encoded and decoded from top to bottom (vertically).

[0228] FIG. 31(d) is a diagram illustrating embodiments of a scan order for scanning blocks divided in various ways. Referring to (1) of FIG. 31(d), a block of size 2Nx2N is divided into two vertical blocks, and each vertical block can be divided by horizontal binary division and horizontal ternary division. According to one embodiment, the encoder and the decoder can use a scan order that scans the vertical blocks from left to right, and from top to bottom within the vertical blocks. Accordingly, the encoder and the decoder can scan in the order of the upper node of the left vertical block, the lower node of the left vertical block, the upper node of the right vertical block, the middle node of the right vertical block, and the lower node of the right vertical block.

[0229] In another embodiment, a method for maintaining the jet scan order may be used. For example, the encoder and decoder may perform jet scan starting from the upper left block of the picture, but scan a specific block only when the block adjacent to the left of that specific block has been restored. Specifically, (2) to (4) of FIG. 31(d) illustrate a scan order based on jet scan.

[0230] 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.

[0231] 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.

[0232] 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.

[0233] 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.

[0234] 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 obtaining reference line information indicating a reference line used for intra prediction of the current block among a plurality of reference lines composed of surrounding samples of the current block; A step of determining an intra prediction mode for the current block among a plurality of intra prediction modes constituting an intra prediction mode set based on the above reference line information; and A step of decoding the current block based on a plurality of reference samples on a reference line according to the above reference line information and a determined intra prediction mode, A video signal processing method, wherein the plurality of reference lines include a first reference line composed of surrounding samples on a line adjacent to the boundary of the current block and a second reference line composed of surrounding samples on a line spaced apart by a specific number of samples from the boundary of the current block.

2. In paragraph 1, If the reference line for intra prediction of the current block is the first reference line, the intra prediction mode set is the first intra prediction mode set, A video signal processing method, wherein if the reference line for intra prediction of the current block is not the first reference line, the intra prediction mode set is a second intra prediction mode set composed of some of the plurality of intra prediction modes constituting the first intra prediction mode set.

3. In paragraph 2, A video signal processing method, wherein the second intra prediction mode set is composed of a plurality of angular modes.

4. In paragraph 3, A video signal processing method, wherein the second intra prediction mode set is composed of a preset number of angular modes determined based on an intra prediction mode corresponding to any one of the surrounding blocks of the current block.

5. In paragraph 4, The step of determining the intra prediction mode for the current block is: A step of receiving intra prediction mode information indicating any one of a preset number of angular modes included in the second intra prediction mode set; A video signal processing method, comprising a step of determining an intra prediction mode for the current block based on the intra prediction mode information.

6. In paragraph 2, A video signal processing method, wherein the intra prediction mode set is determined based on the relative position of the current block within the upper level region of the current block.

7. In paragraph 6, The above method, A video signal processing method, comprising the step of configuring the intra prediction mode set for the current block according to the relative position of the current block within the upper level region.

8. In paragraph 7, If the current block is adjacent to the upper boundary of the upper level area, the reference line information is considered to represent the first reference line, A video signal processing method, wherein the intra prediction mode set for the current block is the first intra prediction mode set.

9. In paragraph 3, A video signal processing method, wherein the first intra prediction mode set includes a plurality of angular modes and a planar mode and a direct current mode.

10. In paragraph 1, A video signal processing method, wherein the boundary of the current block is the left or upper boundary of the current block.

11. In paragraph 1, A video signal processing method, wherein the above specific number of samples is less than or equal to a preset number of samples.

12. In paragraph 11, A video signal processing method, wherein the number of samples above represents the number of integer pixels.

13. In a video signal processing device, Contains a processor, The above processor, Obtain reference line information representing a reference line for intra prediction of the current block among a plurality of reference lines composed of surrounding samples of the current block, Based on the above reference line information, an intra prediction mode for the current block is determined among a plurality of intra prediction modes constituting an intra prediction mode set, Decode the current block based on a plurality of reference samples on the reference line according to the above reference line information and the determined intra prediction mode, A video signal processing device, wherein the plurality of reference lines include a first reference line composed of peripheral samples on a line adjacent to the boundary of the current block and a second reference line composed of peripheral samples on a line spaced apart by a specific number of samples from the boundary of the current block.

14. In paragraph 13, If the reference line for intra prediction of the current block is the first reference line, the intra prediction mode set is the first intra prediction mode set, A video signal processing device, wherein, if the reference line for intra prediction of the current block is not the first reference line, the intra prediction mode set is a second intra prediction mode set composed of some of the plurality of intra prediction modes constituting the first intra prediction mode set.

15. In paragraph 14, A video signal processing device, wherein the second intra prediction mode set comprises a plurality of angular modes.

16. In paragraph 15, A video signal processing device, wherein the second intra prediction mode set is composed of a preset number of angular modes determined based on an intra prediction mode corresponding to any one of the surrounding blocks of the current block.

17. In paragraph 16, The above processor, Receive intra prediction mode information indicating any one of a preset number of angular modes included in the second intra prediction mode set, A video signal processing device that determines an intra prediction mode for the current block based on the intra prediction mode information.

18. In paragraph 14, A video signal processing device, wherein the intra prediction mode set is determined based on the relative position of the current block within the upper level region of the current block.

19. In paragraph 18, The above processor, A video signal processing device that configures the intra prediction mode set for the current block according to the relative position of the current block within the upper level region.

20. In paragraph 19, If the current block is adjacent to the upper boundary of the upper level area, the reference line information is considered to represent the first reference line, A video signal processing device, wherein the intra prediction mode set for the current block is the first intra prediction mode set.