Video signal processing method and device

JP2025003757AActive Publication Date: 2025-01-09SAMSUNG ELECTRONICS CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2024191268
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2018-03-09
Filing Date
2024-10-31
Publication Date
2025-01-09
Estimated Expiration
2038-10-24

AI Technical Summary

Benefits of technology

【0016】 本発明の実施例によると、ビデオ信号のコーディング効率が高くなる。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025003757000001_ABST
    Figure 2025003757000001_ABST
Patent Text Reader

Abstract

To provide a video signal processing method and device that encode or decode video signals.SOLUTION: A video signal processing method includes the steps of: receiving intra-prediction mode information for a current block, which intra-prediction mode information indicates any one of a plurality of intra prediction modes constituting an intra prediction mode set; and decoding the current block on the basis of the received intra prediction mode information. The intra prediction mode set includes a plurality of angle modes. The plurality of angle modes include a basic angle mode and an extended angle mode. The extended angle mode is signaled on the basis of the basic angle mode. There is also provided a video signal processing device using the video signal processing method.SELECTED DRAWING: Figure 6
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

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

[0002] Compression coding refers to a series of signal processing techniques for transmitting digitalized information through a communication line or storing it in a form suitable for a storage medium. The objects of compression coding include voice, video, text, etc., and the technology for compressing and coding video in particular is called video compression. Compression coding of video signals is performed by removing redundant information by considering spatial correlation, temporal correlation, probabilistic correlation, etc. However, with the recent development of various media and data transmission media, there is a demand for more efficient video signal processing methods and devices. Summary of the Invention [Problem to be solved by the invention]

[0003] The invention has the object to increase the coding efficiency of video signals.

[0004] Another object of the present invention is to improve signaling efficiency when predicting a current block using prediction information of neighboring blocks. [Means for solving the problem]

[0005] In order to solve the above problems, the present invention provides a video signal processing device and a video signal processing method as follows.

[0006] First, according to an embodiment of the present invention, a video signal processing method is provided, comprising the steps of: receiving intra prediction mode information for a current block, the intra prediction mode information indicating one of a plurality of intra prediction modes constituting an intra prediction mode set; and decoding the current block based on the received intra prediction mode information, wherein the intra prediction mode set includes a plurality of angle modes, the plurality of angle modes including a base angle mode and an extension angle mode, and the extension angle mode is signaled based on the base angle mode.

[0007] Also, according to an embodiment of the present invention, a video signal processing device is provided, which includes a processor in a video signal processing device, the processor receives intra prediction mode information for a current block, the intra prediction mode information indicating any one of a plurality of intra prediction modes constituting an intra prediction mode set, and decodes the current block based on the received intra prediction mode information, the intra prediction mode set including a plurality of angle modes, the plurality of angle modes including a base angle mode and an extension angle mode, and the extension angle mode is signaled based on the base angle mode.

[0008] The basic angle mode is a mode corresponding to an angle within a preset first angle range, and the expansion angle mode is determined based on the basic angle mode.

[0009] The extended angle mode is a wide angle mode that deviates from the first angle range.

[0010] The wide angle mode replaces at least one basic angle mode within the first angle range, and an intra-prediction mode index corresponding to the replaced basic angle mode signals the wide angle mode.

[0011] The extended angle modes are angle modes between the basic angle modes within the first angle range.

[0012] The spacing between the expansion angular modes of the intra prediction mode set is set based on the spacing between the corresponding base angular modes.

[0013] The angular intervals between the expansion angular modes are set to be the same as the angular intervals between the corresponding basic angular modes.

[0014] Whether the extended angle mode is available is determined based on at least one of the shape and size of the current block.

[0015] In the intra prediction mode set, the number of extension angle modes is set to be equal to or less than the number of base angle modes. Effect of the Invention

[0016] According to an embodiment of the present invention, the coding efficiency of the video signal is increased.

[0017] Furthermore, according to the embodiment of the present invention, the prediction method for the current block can be variously extended, and the signaling overhead due to such extension can be minimized. [Brief description of the drawings]

[0018] [Figure 1] 1 is a schematic block diagram of a video signal encoding apparatus according to an embodiment of the present invention; [Diagram 2] 1 is a schematic block diagram of a video signal decoding device according to an embodiment of the present invention; [Diagram 3] FIG. 2 shows an example of how coding tree units are divided into coding units within a picture. [Figure 4] FIG. 1 illustrates an embodiment of a method for signaling splits of quad trees and multi-type trees. [Diagram 5] FIG. 2 is a diagram showing an example of reference samples used to predict a current block in intra-prediction mode. [Figure 6] FIG. 2 is a diagram showing an example of a prediction mode used in intra prediction. [Figure 7] 1 illustrates an embodiment of a method for signaling an intra-prediction mode selected by an encoder to a decoder. [Figure 8] FIG. 13 shows a detailed example of a method for signaling intra-prediction modes. [Figure 9] FIG. 13 illustrates an example of a context condition applied to an intra-prediction mode. [Figure 10] FIG. 13 is a diagram illustrating another example of a context condition applied to an intra-prediction mode. [Figure 11] FIG. 11 is a diagram illustrating yet another embodiment of a context condition applied to an intra-prediction mode. [Figure 12] FIG. 13 is a diagram illustrating an example of referring to neighboring blocks for intra-prediction of a current block. [Figure 13] 13 is a diagram illustrating another embodiment in which neighboring blocks are referenced for intra prediction of a current block. [Figure 14] A diagram showing an example of referring to the MPM list of surrounding blocks for intra prediction of a current block. [Figure 15] 13 is a diagram illustrating an embodiment in which the patterns and / or sizes of a current block and neighboring blocks are considered for intra prediction of a current block. [Figure 16] 13 illustrates an extended embodiment in which prediction information of a current block is obtained by referring to prediction information of neighboring blocks. [Figure 17] 13 illustrates an extended embodiment in which prediction information of a current block is obtained by referring to prediction information of neighboring blocks. [Figure 18] 13 illustrates an extended embodiment in which prediction information of a current block is obtained by referring to prediction information of neighboring blocks. [Figure 19] FIG. 13 is a diagram showing an example of setting the priority order of intra prediction modes based on the frequency of occurrence of intra prediction modes of surrounding blocks. [Figure 20]FIG. 13 illustrates an example of classifying intra-prediction modes into subsets. [Figure 21] FIG. 13 illustrates an example of classifying intra-prediction modes into subsets. [Figure 22] 13 illustrates an embodiment of signaling the intra-prediction mode of a current block using a subset of classified intra-prediction modes. [Diagram 23] 13 illustrates a detailed embodiment of signaling the intra-prediction mode of a current block using a subset of classified intra-prediction modes. [Figure 24] 13 illustrates an embodiment of dynamically signaling the intra-prediction mode of a current block based on prediction information of neighboring blocks. [Diagram 25] 13 is a diagram illustrating an embodiment in which the number of MPM modes is variably adjusted and the intra-prediction mode of a current block is signaled based on the adjusted number of MPM modes. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0019] The terms used in this specification are selected as general terms currently in wide use as much as possible while taking into consideration the functions in the present invention, but this may vary depending on the intentions of the engineers in this field, customs, or the emergence of new technologies. In addition, in certain cases, the applicant may arbitrarily select terms, and in such cases, the meanings of these terms will be described in the corresponding embodiment of the invention. Therefore, it is made clear that the terms used in this specification should be interpreted based on the substantial meanings of the terms and the contents of this specification as a whole, rather than simply the names of the terms.

[0020] In this specification, some terms are interpreted as follows. Coding may be interpreted as encoding or decoding in some cases. In this specification, an apparatus for encoding a video signal to generate a video signal bitstream is referred to as an encoding apparatus or encoder, and an apparatus for decoding a video signal bitstream to restore a video signal is referred to as a decoding apparatus or decoder. In this specification, a video signal processing apparatus is used as a term including both an encoder and a decoder. Information is a term including values, parameters, coefficients, elements, etc., and may be interpreted differently in some cases, so the present invention is not limited thereto. A "unit" is used to mean a basic unit of image processing or a specific position of a picture, and refers to an image area including both luma components and chroma components. In addition, a "block" refers to an image area including a specific component of a luma component and a chroma component (i.e., Cb and Cr). However, depending on the embodiment, the terms "unit", "block", "partition", and "area" may be used interchangeably. In this specification, a unit is used as a concept including a coding unit, a prediction unit, and a transform unit, and a picture refers to a field or a frame, and the terms are used interchangeably depending on the embodiment.

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

[0022] The transform unit 110 transforms a residual signal, which is a difference between an input video signal and a prediction signal generated by the prediction unit 150, to obtain transform coefficient values. For example, a discrete cosine transform (DCT), a discrete sine transform (DST), or a wavelet transform is used. The discrete cosine transform and the discrete sine transform divide the input picture signal into blocks and perform the transform. In the transform, the coding efficiency may vary depending on the distribution and characteristics within the transform domain. The quantizer 115 quantizes the transform coefficient values ​​output from the transform unit 110.

[0023] In order to improve coding efficiency, a method is used in which a picture signal is not coded as it is, but a picture is predicted using a previously coded area through a prediction unit 150, and a residual value between an original picture and a predicted picture is added to the predicted picture to obtain a reconstructed picture. In order to prevent mismatch between the encoder and the decoder, when the encoder performs prediction, information that can also be used by the decoder should be used. For this purpose, the encoder performs a process of further reconstructing the current block that has been coded. The inverse quantization unit 120 inversely quantizes the transform coefficient values, and the inverse transform unit 125 reconstructs the residual values ​​using the inversely quantized transform coefficient values. Meanwhile, the filtering unit 130 performs a filtering operation to improve the quality of the reconstructed picture and the coding efficiency. For example, the filtering unit 130 includes a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter. The filtered picture is stored in a decoded picture buffer (DPB) 156 to be output or used as a reference picture.

[0024] 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 buffer stored in a composite picture buffer 156. The intra prediction unit 152 performs intra prediction from reconstructed samples within the current picture, and transmits intra coding information to the entropy coding unit 160. The intra coding information includes at least one of an intra prediction mode, a Most Probable Mode (MPM) flag, and an MPM index. The inter prediction unit 154 includes 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 signal picture. The motion estimation unit 154a transmits motion information (reference picture index, motion vector information) for the reference region to the entropy coding unit 160. The motion compensation unit 154b performs motion compensation using the motion vector values ​​transmitted from the motion compensation unit 154a. The inter prediction unit 154 transmits to the entropy coding unit 160 inter coding information including motion information for the reference region.

[0025] When the above-mentioned picture prediction is performed, the transform unit 110 converts residual values ​​between the original picture and the predicted picture to obtain transform coefficient values. At this time, the transformation is performed in units of specific blocks within the picture, and the size of the specific block varies within a preset range. The quantization unit 115 quantizes the transform coefficient values ​​generated by the transform unit 110 and transfers the quantized values ​​to the entropy coding unit 160.

[0026] The entropy coding unit 160 generates a video signal bit stream by entropy coding the quantized transform coefficients, the intra-coded information, and the inter-coded information. The entropy coding unit 160 uses a variable length coding (VLC) method and an arithmetic coding method. The variable length coding (VLC) method converts input symbols into continuous code words, and the length of the code words is variable. For example, frequently occurring symbols are represented by short code words, and infrequently occurring symbols are represented by long code words. As the variable length coding method, a context-based adaptive variable length coding (CAVLC) method is used. The arithmetic coding converts continuous data symbols into one prime number, and the arithmetic coding obtains the optimal prime number bits required to represent each symbol. As the arithmetic coding, a context-based adaptive binary arithmetic coding (CABAC) method is used.

[0027] The generated bitstream is encapsulated in a basic unit of Network Abstraction Layer (NAL) units. An NAL unit includes an integer number of coded coding tree units. In order for a video decoder to decode the bitstream, the bitstream must first be separated into NAL units and then each separated NAL unit must be decoded. Meanwhile, information required for decoding the video signal bitstream is transmitted via Raw Byte Sequence Payload (RBSP) of higher level sets such as a Picture Parameter Set (PPS), a Sequence Parameter Set (SPS), a Video Parameter Set (VPS), etc.

[0028] 1 illustrates an encoding apparatus 100 according to one embodiment of the present invention, with separate blocks illustrating logically distinct elements of encoding apparatus 100. Thus, the elements of encoding apparatus 100 described above may be implemented on a single chip or multiple chips depending on the device design. According to one embodiment, the operation of each element of encoding apparatus 100 described above is performed by a processor (not shown).

[0029] 2 is a schematic block diagram of a video signal decoding device 200 according to an 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 transform unit 225, a filtering unit 230, and a prediction unit 250.

[0030] The entropy decoding unit 210 entropy codes the video signal bitstream and extracts transform coefficients, intra-coding information, inter-coding information, etc. for each region. The inverse quantization unit 220 inverse quantizes the entropy decoded transform coefficients, and the inverse transform unit 225 restores residual values ​​using the inverse quantized transform coefficients. The video signal processing device 200 restores original pixel values ​​by combining the residual values ​​obtained from the inverse transform unit 225 with the predicted values ​​obtained from the prediction unit 250.

[0031] Meanwhile, the filtering unit 230 performs filtering on the picture to improve image quality. This includes a deblocking filter for reducing block distortion and / or an adaptive loop filter for removing distortion of the entire picture. The filtered picture is output or stored in a composite picture buffer (DPB) 256 to be used as a reference picture for the next picture.

[0032] The prediction unit 250 includes an intra prediction unit 252 and an inter prediction unit 254. The prediction unit 250 generates a predicted picture using the coding type, the transform coefficient for each region, the intra / inter coding information, etc., decoded through the above-mentioned entropy decoding unit 210. To reconstruct the current block to be decoded, the current picture including the current block or a decoded region of another picture is used. A picture (or tile / slice) that uses only the current picture for reconstruction, i.e., performs only intra prediction, is called an intra picture or I picture (or tile / slice), and a picture (or tile / slice) that performs both intra prediction and inter prediction is called an inter picture (or tile / slice). Among interpictures (or tiles / slices), a picture (or tile / slice) that uses at most one motion vector and reference picture index to predict sample values ​​of each block 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 indexes is called a bi-predictive picture or B picture (or tile / slice). That is, 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.

[0033] The intra prediction unit 252 generates a prediction block using intra coding information and reconstructed samples in the current picture. As described above, the intra coding information includes at least one of an intra prediction mode, an MPM flag, and an MPM index. The intra prediction unit 252 predicts pixel values ​​of the current block by using reconstructed pixels located on the left and / or upper sides of the current block as reference pixels. According to one embodiment, the reference pixels are pixels adjacent to the left boundary and / or the upper boundary of the current block. According to another embodiment, the reference pixels are pixels adjacent to the left boundary of the current block within a preset distance and / or pixels adjacent to the upper boundary of the current block within a preset distance from the left boundary of the current block among pixels of neighboring blocks of the current block. In this case, the neighboring blocks of the current block include at least one of a left (L) block, an upper (A) block, a below left (BL) block, an above right (AR) block, or an above left (AL) block adjacent to the current block.

[0034] The inter prediction unit 254 generates a prediction block using the reference picture and inter coding information stored in the composite picture buffer 256. The inter coding information includes motion information (reference picture index, motion vector, etc.) of a current block with respect to a reference block. Inter prediction includes L0 prediction, L1 prediction, and bi-prediction. L0 prediction means prediction using one reference picture included in the L0 picture list, and L1 prediction means prediction using one reference picture included in the L1 picture list. For this purpose, one set of motion information (e.g., motion vector and reference picture index) is required. In the bi-prediction method, a maximum of two reference regions are used, and the two reference regions may exist in the same reference picture or may exist in different pictures. That is, in the bi-prediction method, a maximum of two sets of motion information (e.g., motion vector and reference picture index) are used, and the two motion vectors may correspond to the same reference picture index or may correspond to different reference picture indexes. In this case, the reference picture is displayed (or output) either before or after the current picture in terms of time.

[0035] The inter prediction unit 254 obtains a current reference 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 identified by the motion vector or an interpolated value thereof is used as a predictor of the current block. For motion prediction with pixel accuracy in sub-pel units, for example, an 8-tab interpolation filter is used for a luma signal and a 4-tab interpolation filter is 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.

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

[0037] 2 shows a block diagram of a decoding apparatus 200 according to an embodiment of the present invention, with separate blocks logically separating elements of the decoding apparatus 200. Thus, the elements of the decoding apparatus 200 described above may be implemented on a single chip or multiple chips depending on the device design. According to an embodiment, the operation of each element of the decoding apparatus 200 described above is performed by a processor (not shown).

[0038] FIG. 3 illustrates an embodiment in which a coding tree unit (CTU) is divided into coding units (CUs) in a picture. In a video signal coding process, a picture is divided into a sequence of coding tree units (CTUs). A coding tree unit consists of an NXN block of luma samples and two blocks of corresponding chroma samples. The coding tree unit is divided into a plurality of coding units. A coding unit refers to a basic unit for processing a picture in the above-mentioned video signal processing process, i.e., in the process of intra / inter prediction, transformation, quantization, and / or entropy coding. In one picture, the size and pattern of the coding units are not constant. The coding units have a square or rectangular pattern. 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 this specification, a non-square block refers to a rectangular block, but the present invention is not limited thereto.

[0039] Referring to Figure 3, the coding tree unit is first divided into a quad tree (QT) structure. That is, in the quad tree structure, one node having a size of 2NX2N is divided into four nodes having a size of NXN. In this specification, the quad tree is also referred to as a quaternary tree. The quad tree division is performed recursively, and it is not necessary that all nodes are divided to the same depth.

[0040] Meanwhile, the leaf node of the above-mentioned quad tree is 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 is divided into a horizontally or vertically divided binary or ternary tree structure. That is, the Multi-Type Tree structure has four division structures, namely, vertical binary division, horizontal binary division, vertical ternary division, and horizontal ternary. According to an embodiment of the present invention, in each of the tree structures, the width and height of the node are both powers of 2. For example, in a Binary Tree (BT) structure, a node of size 2NX2N is divided into two NX2N nodes by vertical binary division and divided into two 2NXN nodes by horizontal binary division. In addition, in a Ternary Tree (TT) structure, a node of size 2NX2N is divided into (N / 2)X2N, NX2N, and (N / 2)X2N nodes by vertical ternary division, and divided into 2NX(N / 2), 2NXN, and 2NX(N / 2) nodes by horizontal binary division. Such multi-type tree division is performed recursively.

[0041] A leaf node of a multi-type tree can be a coding unit. If the coding unit is not too large compared to the maximum transform length, the coding unit is not divided any more and is used as a unit of prediction and transform. Meanwhile, in the above-mentioned quad tree and multi-type tree, at least one of the following parameters is predefined or transmitted via the RBSP of a higher level set such as PPS, SPS, VPS, etc. 1) CTU size: size of the root node of the quad tree, 2) Min QT size (MinQtSize): size of the minimum QT leaf node allowed, 3) Max BT size (MaxBtSize): size of the maximum BT root node allowed, 4) Max TT size (MaxTtSize): size of the maximum TT root node allowed, 5) Max MTT depth (MaxMttDepth): maximum allowed depth of MTT division from the QT leaf node, 6) Max BT size (MinBtSize): size of the maximum BT leaf node allowed, 7) Min TT size (MinTtSize): size of the minimum TT leaf node allowed.

[0042] 4 is a diagram showing an embodiment of a method for signaling the split of a quad tree and a multi-type tree. In order to signal the split of the quad tree and the multi-type tree, a preset flag is used. Referring to FIG. 4, at least one of a flag 'qt_split_flag' indicating whether a quad tree node is split, a flag 'mtt_split_flag' indicating whether a multi-type tree node is split, a flag 'mtt_split_vertical_flag' indicating the split direction of a multi-type tree node, and a flag 'mtt_split_binary_flag' indicating the split pattern of a multi-type tree node is used.

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

[0044] Each quad tree leaf node, 'QT_leaf_node', is 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' are further signaled. If the value of "mtt_split_vertical_flag" is 1, the node "MTT_node" is split vertically, and if the value of "mtt_split_vertical_flag" is 0, the node "MTT_node" is split horizontally. If the value of "mtt_split_binary_flag" is 1, the node "MTT_node" is split into two rectangular nodes, and if the value of "mtt_split_binary_flag" is 0, the node "MTT_node" is split into three rectangular nodes.

[0045] 5 and 6 are diagrams illustrating in more detail an intra prediction method according to an embodiment of the present invention. As described above, the intra prediction unit predicts pixel values ​​of a current block using reconstructed pixels located to the left and / or above the current block as reference pixels.

[0046] First, FIG. 5 illustrates an embodiment of a reference sample used to predict a current block in an intra prediction mode. According to an embodiment, the reference pixel is a pixel adjacent to the left boundary and / or the upper boundary of the current block. As shown in FIG. 5, if the size of the current block is WXH and a pixel of a single reference line adjacent to the current block is used for intra prediction, the reference pixel is set using up to 2W+2H+1 adjacent pixels located to the left and / or upper side of the current block. Meanwhile, according to a further embodiment of the present invention, pixels of multiple reference lines are used for intra prediction of the current block. The multiple reference lines are n lines located within a preset range from the current block. According to an embodiment, if pixels of multiple reference lines are used for intra prediction, separate index information indicating the lines to be set as reference pixels is signaled. If at least some of the adjacent pixels used as reference pixels have not yet been restored, the intra prediction unit performs a reference sample padding process according to a preset rule to obtain reference pixels. In addition, the intra prediction unit performs a reference sample filtering process to reduce an error in intra prediction. That is, the reference pixels are obtained by filtering the neighboring pixels and / or the pixels obtained by the reference sample padding process, and the intra prediction unit predicts the pixels of the current block using the reference pixels obtained in this manner.

[0047] Next, Fig. 6 is a diagram showing an embodiment of a prediction mode used for intra prediction. For intra prediction, intra prediction mode information indicating an intra prediction direction is signaled. The intra prediction mode 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 the 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.

[0048] According to an embodiment of the present invention, the intra prediction mode set includes all intra prediction modes (e.g., a total of 67 intra prediction modes) used in intra prediction. More specifically, the intra prediction mode set includes a planar mode, a DC mode, and a plurality of (e.g., 65) angle modes (i.e., directional modes). Each intra prediction mode is indicated by a preset index (i.e., intra prediction mode index). For example, as shown in FIG. 6, an intra prediction mode index 0 indicates a planar mode, and an intra prediction mode index 1 indicates a DC mode. In addition, intra prediction mode indexes 2 to 66 indicate different angle modes. The angle modes indicate different angles within a preset angle range. For example, the angle modes indicate angles within an angle range between 45 degrees and -135 degrees clockwise (i.e., a first angle range). In this case, the angle modes are defined based on the 12 o'clock direction. In this case, 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.

[0049] Meanwhile, the preset angle ranges are set differently according to the pattern of the current block. For example, if the current block is a rectangular block, a wide angle mode that indicates an angle that exceeds 45 degrees or is less than -135 degrees clockwise is further used. If the current block is a horizontal block, the angle mode indicates an angle within an angle range between (45+offset1) degrees and (-135+offset1) degrees clockwise (i.e., a second angle range). At this time, angle modes 67 to 76 that deviate from the first angle range are further used. Also, if the current block is a vertical block, the angle mode indicates an angle within an angle range between (45-offset2) degrees and (-135-offset2) degrees clockwise (i.e., a third angle range). At this time, angle modes -10 to -1 that deviate from the first angle range are further used. According to an embodiment of the present invention, the values ​​of offset1 and offset2 are determined differently according to the ratio between the width and height of the rectangular block. Also, offset1 and offset2 are positive numbers.

[0050] According to a further embodiment of the present invention, the plurality of angle modes constituting the intra prediction mode set includes a base angle mode and an extension angle mode, where the extension angle mode is determined based on the base angle mode.

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

[0052] According to another embodiment, the basic angle mode is a mode corresponding to an angle within a first angle range that is preset, and the extension angle mode is a wide angle mode that deviates from the first angle range. That is, the basic angle mode is an angle mode corresponding to any one of intra prediction modes {2, 3, 4, ..., 66}, and the extension angle mode is an angle mode corresponding to any one of intra prediction modes {-10, -9, ..., -1} and {67, 68, ..., 76}. The angle indicated by the extension angle mode is determined to be an angle opposite to the angle indicated by the corresponding basic angle mode. Thus, the angle indicated by the extension angle mode is determined based on the angle indicated by the basic angle mode. Meanwhile, the number of extension angle modes is not limited thereto, and further extension angles are defined according to the size and / or pattern of the current block. For example, the extension angle mode may be defined as an angle mode corresponding to any one of intra prediction modes {-14, -13, ..., -1} and {67, 68, ..., 80}. Meanwhile, the total number of intra prediction modes included in the intra prediction mode set varies depending on the configuration of the base angle mode and the extended angle mode.

[0053] In the above embodiment, the interval between the extension angle modes is set based on the interval between the corresponding basic angle modes. For example, the interval between the extension angle modes {3, 5, 7, ..., 65} is determined based on the interval between the corresponding basic angle modes {2, 4, 6, ..., 66}. The interval between the extension angle modes {-10, -9, ..., -1} is determined based on the interval between the corresponding opposite basic angle modes {56, 57, ..., 65}, and the interval between the extension angle modes {67, 68, ..., 76} is determined based on the interval between the corresponding opposite basic angle modes {3, 4, ..., 12}. The angle interval between the extension angle modes is set to be the same as the angle interval between the corresponding basic angle modes. In addition, the number of the extension angle modes in the intra prediction mode set is set to be equal to or less than the number of the basic angle modes.

[0054] According to an embodiment of the present invention, the extension angle mode is signaled based on the base angle mode. For example, the wide angle mode (i.e., the extension angle mode) replaces at least one angle mode (i.e., the base angle mode) within the first angle range. The replaced base angle mode is an angle mode corresponding to the opposite side of the wide angle mode. That is, the replaced base angle mode is an angle mode corresponding to an angle in the opposite direction of the angle indicated by the wide angle mode, or an angle that is different from the opposite angle by a preset offset index. According to an embodiment of the present invention, the preset offset index is 1. The intra prediction mode index corresponding to the replaced base angle mode is further mapped to the wide angle mode to signal the corresponding wide angle mode. For example, the wide angle modes {-10, -9, ..., -1} are signaled by intra prediction mode indexes {57, 58, ..., 66}, respectively, and the wide angle modes {67, 68, ..., 76} are signaled by intra prediction mode indexes {2, 3, ..., 11}, respectively. In this way, by making the intra prediction mode index for the base angle mode signal the extension angle mode, even if the configurations of the angle modes used for intra prediction of each block are different, the same set of intra prediction mode indexes are used to signal the intra prediction mode, thereby minimizing signaling overhead due to changes in the configuration of the intra prediction mode.

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

[0056] The intra prediction unit determines reference pixels and / or interpolated reference pixels 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, reference pixels or interpolated reference pixels corresponding to the specific angle from the current pixel of the current block are used for predicting the current pixel. Thus, different sets of reference pixels and / or interpolated reference pixels are used for intra prediction according to the intra prediction mode. After intra prediction of the current block is performed using the reference pixels and intra prediction mode information, the decoder restores pixel values ​​of the current block by adding a residual signal of the current block obtained from the inverse transform unit to the intra prediction value of the current block.

[0057] 7 is a diagram illustrating an embodiment of a method for signaling an intra-prediction mode selected by an encoder to a decoder. If the total number of intra-prediction modes included in an intra-prediction mode set is T (for example, 67), a method of simply expressing T modes in binary notation 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, efficient signaling can be performed by separately managing a list of some modes that are highly likely to be used for the current block among all modes.

[0058] According to an embodiment of the present invention, at least one prediction mode list consisting of some modes among all intra prediction modes is managed for intra prediction of a current block. A first prediction mode list for intra prediction is an MPM list. An intra prediction mode included in the MPM list is an MPM mode, and an intra prediction mode not included in the MPM list is called a non-MPM mode. An encoder signals an MPM flag that distinguishes whether an intra prediction mode used in a current block is an MPM mode or a non-MPM mode. A decoder identifies whether an intra prediction mode used in a current block is an MPM mode or a non-MPM mode through the received MPM flag.

[0059] According to one embodiment, a separate coding method is used for the MPM modes, thereby enabling efficient signaling with fewer bits. If 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 smaller than the number of non-MPM modes Tm, the MPM modes are coded using truncated unary binarization, and the non-MPM modes are coded using truncated binary binarization.

[0060] The MPM list is constructed by considering various contexts in stages as follows. First, the MPM list includes the intra prediction modes and planar / DC modes used in the neighboring blocks of the current block (context M0). If there is a block coded in the intra prediction mode among the neighboring blocks for which reconstruction has been completed, the current block may use the same intra prediction mode as the corresponding block due to the regional similarity of the picture. Thus, the MPM list is constructed including the intra prediction modes of the neighboring blocks. According to an embodiment, the neighboring blocks of the current block 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 include a left (L) block and an upper (A) block adjacent to the current block. The left (L) block is the bottommost 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. A specific embodiment of the neighboring blocks for constructing the MPM list will be further described with reference to FIG. 8. The intra prediction mode, planar mode, and DC mode selected for the neighboring blocks of the current block are added to the MPM list in a preset order. For example, the MPM list is configured in the order of {block L mode, block A mode, planar mode, DC mode, block BL mode, block AR mode, block AL mode}.

[0061] Second, if the number m of MPM modes cannot be filled by the above method, further context conditions (e.g., context M1, context M2, ...) are applied to fill the MPM list. When applying the further context conditions, intra-prediction modes already included in the MPM modes are not newly added.

[0062] On one hand, among all T intra prediction modes, the remaining T - m non-MPM modes not included in the MPM list are coded using truncated binary coding. If truncated binary coding is used, assuming 2^(k - 1) < T - m < 2^k, the initial 2^k - (T - m) indices are signaled using K - 1 bits (or bins), and the remaining indices are signaled using k bits (or bins). Therefore, further context conditions (i.e., context N) can be applied to non-MPM modes, and the modes that are relatively likely to be selected in the corresponding block can be signaled with an index composed of k - 1 bits to minimize the signaling overhead.

[0063] According to a further embodiment of the present invention, a second prediction mode list consisting of some of the non-MPM modes is managed. More specifically, the non-MPM modes are further classified into selected (s) modes and non-selected (ns) modes, and a second prediction mode list consisting of the selected modes (i.e., the selected mode list) is managed. The intra prediction modes included in the selection list are called selected modes, and the intra prediction modes not included in the selection mode list are called non-selected modes. The encoder signals a selection mode flag that distinguishes whether the intra prediction mode used for the current block is a selected mode or a non-selected mode. The decoder identifies whether the intra prediction mode used for the current block is a selected mode or a non-selected mode via the received selection mode flag.

[0064] As described above, when non-MPM modes are further classified, the selected modes are coded with a fixed length. In this case, an additional context condition (e.g., context S) is applied to the selected modes to prioritize modes that are likely to be selected in the corresponding block. In this case, s selected modes (where s is a power of 2) are coded with a fixed length, and the remaining ns non-selected modes are coded with truncated binary binarization. The ns non-selected modes are signaled using any l-1 bits (or bins) or l bits (or bins). In this case, an additional context condition (i.e., context NS) is applied to the non-selected modes, and modes that are relatively likely to be selected in the corresponding block are signaled with an index consisting of l-1 bits, thereby minimizing signaling overhead.

[0065] Specific examples of the context conditions will be described later with reference to the drawings. The context conditions defined in the following examples are applied individually or overlappingly to various configurations to which the context conditions {M0, M1, M2, N, S, NS} are applied. For example, a context condition that signals a basic angle mode in preference to an extended angle mode may be further used. Also, a context condition that preferentially adds an angle mode obtained by adding an arbitrary offset (e.g., -1, +1) to the angle mode of a block derived via a first context condition (e.g., context M0) of an MPM mode to a prediction mode list may be used. Such a context condition is applied as a context condition for one or more of an MPM mode, a non-MPM mode, a selected mode, or a non-selected mode.

[0066] According to a further embodiment of the present invention, the above-mentioned intra prediction method is determined based on the number of intra prediction modes of the neighboring blocks and / or intra prediction mode information. For example, whether the MPM mode, non-MPM mode, selected mode, and non-selected mode are distinguished, the number of intra prediction modes signaled for each mode (i.e., m, Tm, s, and ns), and the method of encoding each mode (i.e., truncated unary binarization, truncated binary binarization, fixed length encoding), etc. are variably configured according to the number of intra prediction modes of the neighboring blocks or their values. In this case, the neighboring blocks are preset blocks referenced to configure the MPM list.

[0067] First, to construct the MPM list, the intra prediction modes of the neighboring blocks of the current block are considered, and then the variable configuration is applied based on the total number of prediction modes. If the current block is a block of a B frame or a P frame, the method of constructing the MPM list is changed according to the number of blocks in which intra prediction is performed among the neighboring blocks and / or the number of prediction modes. Extending this further, different methods are used to construct the MPM list between I frames and B / P frames. In an I frame, since all neighboring blocks are configured with intra prediction, the above-mentioned first method is not applied, and the following second method or a similar method is applied.

[0068] Second, the variable configuration is applied based on the number of different intra prediction modes used in the surrounding blocks. For example, the method of constructing the MPM list is changed based on whether the intra prediction modes used in the surrounding blocks are the same or different. Or, the method of constructing the MPM list is changed based on the degree of difference in the intra prediction modes used in the surrounding blocks. The degree of difference in the intra prediction modes used in the surrounding blocks is determined based on whether the number of intra prediction modes used in the surrounding blocks is equal to or greater than a preset value. Also, the degree of difference in the intra prediction modes used in the surrounding blocks is determined based on the difference in mode values ​​of the intra prediction modes used in the surrounding blocks. If the degree of difference in the intra prediction modes used in the surrounding blocks satisfies a preset criterion, the MPM list is constructed based on the first method. However, if the degree of difference in the intra prediction modes used in the surrounding blocks does not satisfy the preset criterion, the MPM list is constructed based on a second method different from the first method. Meanwhile, the surrounding blocks of the current block considered to generate the above-mentioned variable MPM list basically include blocks at additional positions other than the preset position. A specific embodiment thereof will be described with reference to FIG. 8.

[0069] Fig. 8 is a diagram showing a detailed embodiment of a method for signaling intra-prediction modes. Fig. 8(a) and Fig. 8(b) are diagrams showing an embodiment of neighboring blocks to be referenced for constructing a prediction mode list. Fig. 8(c) is a diagram showing an embodiment of a method for signaling the above-mentioned intra-prediction modes. Fig. 8(d) is a diagram showing an embodiment of signaling non-selected modes with truncated binary binarization.

[0070] First, FIG. 8(a) is a diagram illustrating an embodiment of relative positions of neighboring blocks referenced to construct an MPM list. Referring to FIG. 8(a), the neighboring blocks are 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 a current block. In this case, the intra prediction mode, planar mode, and DC mode selected from the neighboring blocks are added to the MPM list in a preset order. However, in the embodiment of the present invention, the neighboring blocks referenced to construct an MPM list are not limited thereto. For example, the neighboring blocks of the current block include a left (L) block and an upper (A) block of the current block. The left (L) block is the bottommost 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.

[0071] Next, FIG. 8(b) is a diagram showing another embodiment of the relative positions of neighboring blocks referenced to construct an MPM list. The neighboring blocks of the current block are divided into smaller sizes than the current block, and there are multiple blocks adjacent to the left or upper boundary of the current block. In this case, the intra prediction modes of the multiple blocks adjacent to the left or upper boundary of the current block are referenced to construct an MPM list. In the embodiment of FIG. 8(b), the multiple blocks adjacent to the left boundary of the current block are L0 and L1 from bottom to top, and the multiple blocks adjacent to the upper boundary of the current block are A0 and A1 from right to left.

[0072] According to the first embodiment, the MPM list is configured in the order of {block L0 L mode, block A0 mode, plane mode, DC mode, block BL mode, block AR mode, and block AL mode}. According to the second embodiment, the MPM list is configured in the order of {block L0 L mode, block L1 mode, block A0 mode, block A1 mode, plane mode, DC mode, block BL mode, block AR mode, and block AL mode}. In this case, the position and number of neighboring blocks to be further referenced are variable. In addition, additional blocks are also referenced in the lower left block (BL), upper right block (AR), and upper left block (AL) adjacent to the current block. According to the third embodiment, the MPM list is configured in the order of {block L0 L mode, block A0 mode, plane mode, DC mode, block L1 mode, block A1 mode, block BL mode, block AR mode, and block AL mode}. In other words, the signaling overhead can be reduced by prioritizing the order in which the planar mode and DC mode, which have a high probability of being selected, are selected in the MPM list over the mode of block L1 and the mode of block A1. According to the fourth embodiment, the MPM list is configured in the order of {L mode of block L0, mode of block A0, planar mode, DC mode, mode of block BL, mode of block AR, mode of block AL, mode of block L1, and mode of block A1}. In other words, after the order of the MPM list configuration according to the first embodiment described above, block L1 and block A1 are referenced.

[0073] According to a further embodiment of the present invention, the order of constructing the MPM list is determined based on the pattern of the current block. More specifically, if the current block is not a square block, the order of reference of the neighboring blocks is determined to be different 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 is referenced preferentially to the upper block, and if the current block is a horizontal block, the upper block is referenced preferentially to the left block. According to another embodiment, the order of constructing the MPM list is determined by comparing the pattern of the current block with the pattern of the neighboring blocks. For example, if the current block is a vertical block, the intra prediction mode used for the vertical block among the preset neighboring blocks is preferentially included in the MPM list.

[0074] According to another embodiment of the present invention, the order of constructing the MPM list is determined taking into consideration the correlation between the pattern of the current block and the angle modes used in the surrounding blocks. For example, if the current block is a vertical block, among the angle modes used in the preset surrounding blocks, the angle modes that are within a preset range from the vertical (VER) mode 50 or between the diagonal (DIA) mode 34 and the vertical diagonal (VDIA) mode 66 are preferentially included in the MPM list. According to a further embodiment, the intra prediction modes included in the MPM lists of the surrounding blocks are 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 surrounding blocks, the intra prediction modes included in the MPM lists of the surrounding blocks are added to the MPM list of the current block.

[0075] FIG. 8(c) is a diagram illustrating an embodiment of a method for signaling the above-mentioned intra prediction modes. m modes among a total of T intra prediction modes are classified as MPM modes and are signaled by truncated unary binarization. In one embodiment, T is 67 and m is 6. In truncated unary binarization, the number of bits (or bins) used increases as the signaling index increases, so that a mode that is relatively likely to be selected in the corresponding block is matched to a low-value index to increase signaling efficiency. For this, the encoder and decoder construct MPM lists under the same context conditions, and the derived mode values ​​are rearranged and signaled based on the context conditions. For example, the selected modes are classified in the order of non-angle modes such as DC / planar modes, vertical modes, and planar angle modes, and CABAC-based encoding is performed. Next, s selected modes determined by an arbitrary context condition are signaled by fixed-length bits, and the remaining ns non-selected modes are signaled by truncated binarization. In one embodiment, n is 16 and ns is 45.

[0076] FIG. 8(d) is a diagram showing an embodiment in which non-selected modes are signaled by truncated binary binarization. According to the embodiment, the number ns of non-selected modes is 45. If truncated binary binarization is used, 2^5<45<2^6, so the initial 2^6-45=19 indexes are signaled using 5 bits (or bins), and the remaining 26 indexes are signaled using 6 bits (or bins). Thus, a preset context condition is also applied to the non-selected modes, and modes that are relatively likely to be selected in the corresponding block are matched to low-value indexes signaled by 5 bits (or bins). A specific embodiment of the preset context condition will be described with reference to the following drawings.

[0077] FIG. 9 is a diagram illustrating a method of applying a preset offset to an angle mode as an embodiment of a context condition applied to an intra prediction mode. According to an embodiment of the present invention, a new priority is given to an angle mode obtained by adding or subtracting a preset offset to an angle mode having a specific priority. For example, a first or second priority is given to an angle mode obtained by adding or subtracting a preset offset to an angle mode having a first priority. According to an embodiment, a mode having a first priority among all intra prediction modes is selected preferentially over the remaining modes. In addition, the remaining modes are divided into a mode having a second priority and a mode having a third priority, and the mode having the second priority is selected preferentially over the mode having the third priority. Here, the mode selected preferentially is matched to a lower value index signaled by a smaller number of bits.

[0078] More specifically, if intra prediction mode indexes a, b, and c have the first priority, the first or second priority is given to the modes of intra prediction mode indexes a-offset, a+offset, b-offset, b+offset, c-offset, and c+offset (where offset is an integer other than 0). For example, the first priority is given to the mode selected from the surrounding blocks in the process of constructing the MPM list, and the first or second priority is given to the angle mode obtained by adding -1 or +1 to the angle mode among the modes selected from the surrounding blocks. By giving the same or second priority to the mode obtained by adding or subtracting a preset offset from the highest priority mode, a high priority is given to the mode having similarity to the highest priority mode.

[0079] However, referring to FIG. 9, when the angle mode is limited within a preset angle range, an angle mode obtained by adding or subtracting an offset from a particular angle mode may deviate from the preset range. For example, if the angle modes of the intra prediction mode set are limited to intra prediction modes 2 to 66 and the preset offset is 1, intra prediction mode 1 obtained by subtracting the offset from intra prediction mode 2, or intra prediction mode 67 obtained by adding the offset to intra prediction mode 66, deviates from the preset angle range. In other words, intra prediction mode k-offset or k+offset derived from intra prediction mode k deviates from the preset angle range. Therefore, a method for solving this problem is required.

[0080] According to an embodiment of the present invention, if an angle mode obtained by adding or subtracting an offset from a specific angle mode deviates from a set angle range, an angle mode determined cyclically from the angle mode set of the corresponding range is selected. That is, if an angle mode obtained by adding or subtracting an offset from a specific angle mode deviates from a preset angle range, an angle mode located on the opposite side of the specific angle mode from the angle mode set of the corresponding range is selected. For example, if the angle mode set of the preset angle range is modes {a, b, c, d, e, f} in ascending order of intra prediction mode index, adding an offset 1 to mode f selects mode a, and adding an offset 2 to mode f selects mode b. Similarly, subtracting an offset 1 from mode a selects mode f, and subtracting an offset 2 from mode a selects mode e. Referring to FIG. 9, adding an offset to a vertical diagonal mode VDIA selects a horizontal diagonal mode HDIA or an angle mode nearby it. That is, VDIA+1 is matched to HDIA, and VDIA+2 is matched to HDIA+1. In addition, HDIA-1 is matched to VDIA, and HDIA-2 is matched to VDIA-1.

[0081] According to another embodiment of the present invention, if an angle mode obtained by adding or subtracting an offset from a specific angle mode deviates from a preset angle range, the angle mode obtained by adding or subtracting the offset is ignored. If a preset offset is added or subtracted from a specific angle mode, an angle mode similar to the specific angle mode is selected. However, if an angle mode determined cyclically is selected as in the previous embodiment, an angle mode located opposite the specific angle mode may be selected, and the similarity between the selected angle modes may decrease. Therefore, if an angle mode obtained by adding or subtracting an offset deviates from a preset angle range, the corresponding angle is not selected. For example, if mode c+offset deviates from a preset angle range among modes a-offset, a+offset, b-offset, b+offset, c-offset, and c+offset obtained by adding or subtracting an offset from a preselected mode {a, b, c}, the remaining modes a-offset, a+offset, b-offset, b+offset, and c-offset except for mode c+offset are selected.

[0082] According to another embodiment of the present invention, if an angle mode obtained by adding or subtracting a first offset to a specific angle mode deviates from a set angle range, an angle mode obtained by subtracting or subtracting a second offset from the specific angle mode is selected. Alternatively, if an angle mode obtained by adding or subtracting a first offset from a specific angle mode deviates from a set angle range, an angle mode obtained by further adding or subtracting the second offset is selected. In this case, the second offset has a value different from the first offset. For example, if a mode a+offset1 deviates from a preset angle range, a mode a-offset2 or a mode a+offset1-offset2 is selected. Referring to FIG. 9, an angle mode VDIA+1 obtained by adding a first offset 1 to a preselected vertical diagonal mode VDIA deviates from a preset angle range. In this case, an angle mode VDIA-2 obtained by subtracting a second offset 2 from the angle mode VDIA is selected. If the angle mode selected by applying the second offset overlaps with a preselected angle mode, a third offset different from the second offset is used in a manner similar to that described above.

[0083] According to another embodiment of the present invention, if an angle mode obtained by adding or subtracting a first offset to a specific angle mode deviates from a preset angle range, an angle mode obtained by adding or subtracting a second offset to the specific angle mode is selected. In this case, the absolute value of the second offset is smaller than the absolute value of the first offset. For example, if mode a+offset1 deviates from a preset angle range, mode a+offset2 is selected. More specifically, if the preselected angle modes are VDIA and HDIA, VDIA+offset1 may deviate from a preset angle range. Therefore, if the preselected angle modes are VDIA and HDIA, VDIA+offset2 is selected. Also, referring to FIG. 9, an angle mode VDIA-1+2 obtained by adding a first offset 2 to a preselected vertical diagonal mode VDIA-1 deviates from a preset angle range. In this case, an angle mode VDIA-1+1 obtained by adding a second offset 1 to the angle mode VDIA-1 is selected. If the angular mode selected by applying the second offset overlaps with the preselected angular mode, a third offset different from the second offset is used in a manner similar to that described above.

[0084] 10 is a diagram illustrating another embodiment of a context condition applied to an intra prediction mode, which is a diagram illustrating a method of constructing a prediction mode list taking into consideration the minimum and maximum values ​​of angles or indexes of angle modes preselected in a prediction mode list. In the embodiment of the present invention, the prediction mode list includes an MPM list and a selected mode list, but the present invention is not limited thereto.

[0085] In intra prediction, the intra prediction mode of the current block is similar to the intra prediction mode of the surrounding blocks. For example, the angle mode of the current block is the same as or similar to one of the angle modes of the surrounding blocks. Thus, if there is a first prediction mode list pre-configured for the current block, the second prediction mode list is configured taking into consideration the elements of the first prediction mode list. According to one embodiment, the second prediction mode list is configured based on the minimum and / or maximum values ​​of angles or indexes (i.e., intra prediction mode indexes) of the angle modes included in the first prediction mode list. The intra prediction modes of the second prediction mode list are given a higher priority than intra prediction modes other than the first and second prediction mode lists.

[0086] More specifically, assuming that the minimum and maximum values ​​of angles or indexes of angle modes included in the first prediction mode list are 'min' and 'max', respectively, angle modes included in the second prediction mode list are selected within a range of 'min' to 'max' or a range exceeding 'min' and less than 'max'. According to one embodiment, angle modes that are uniformly distributed (i.e., have a certain index difference or a certain angle difference) between the minimum and maximum values ​​determined based on the first prediction mode list are included in the second prediction mode list. In this way, angle modes included in the second prediction mode list have a higher priority than angle modes not included in the first or second prediction mode list.

[0087] According to another embodiment, the angle modes included in the second prediction mode list are selected within a range of 'min-offset1' to 'min+offset2' or within a range of 'min-offset1' to 'min+offset2'. Here, offset1 and offset2 are preset offsets and are non-negative integers. Also, offset1 and offset2 may have the same value or different values. According to one embodiment, offset1 and offset2 are set to the same value, but as in the embodiment of FIG. 9, if the range set based on the offset deviates from the preset angle range, offset1 and offset2 are set to different values. According to another embodiment, offset1 and offset2 are set to the same value or different values ​​based on the distribution of the angle modes included in the first prediction mode list. For example, if the angle modes included in the first prediction mode list are not uniformly distributed, offset1 and offset2 are set to different values. The angle modes evenly distributed (i.e., having a certain index difference or a certain angle difference) between "min-offset1" and "min+offset2" determined based on the first prediction mode list are included in the second prediction mode list. For example, if the number of modes selected in the second prediction mode list is n, then m is set as m=floor(((max-offset2)-(min-offset1)) / (n+1)), and the second prediction mode list includes angle modes corresponding to indices or angles "min-offset1+m", "min-offset1+2m", ..., "min-offset1+nm". In this way, the angle modes included in the second prediction mode list have a higher priority than angle modes not included in the first or second prediction mode list.

[0088] Referring to FIG. 10, the first prediction mode list is an MPM list. Also, the minimum and maximum indexes of the angle modes included in the MPM list configured according to a preset rule are referred to as 'MPM_min' and 'MPM_max', respectively. In this case, as in the above-mentioned embodiment, the second prediction mode list is configured based on the MPM list in consideration of the similarity between the current block and the surrounding blocks. For example, the second prediction mode list is configured based on 'MPM_min' and 'MPM_max'. More specifically, the angle modes uniformly distributed (i.e., having a certain index difference or a certain angle difference) between 'MPM_min-offset' and 'MPM_min+offset' are included in the second prediction mode list. Here, offset is a non-negative integer.

[0089] As in the above embodiment, if the second prediction mode list is configured based on the first prediction mode list, intra prediction is performed using the first and second prediction mode lists. According to one embodiment, the second prediction mode list is used as a selected mode list. According to another embodiment, the second prediction mode list indicates an intra prediction mode signaled by an index consisting of k-1 bits among non-MPM modes signaled using k-1 or k bits. Also, the first prediction mode list and the second prediction mode list refer to the same first and second sets of prediction mode lists. That is, in the embodiment of FIG. 10 described above, the first prediction mode list and the second prediction mode list are replaced by the first set of prediction mode lists and the second set of prediction mode lists, respectively. Here, the prediction mode list is an MPM list or a selected mode list.

[0090] 11 is a diagram illustrating a method of constructing a prediction mode list taking into consideration a basic angle mode, which is another embodiment of a context condition applied to an intra prediction mode. As described above, the multiple angle modes constituting the intra prediction mode set include a basic angle mode and an extended angle mode.

[0091] According to an embodiment of the present invention, the prediction mode list is configured by giving priority to a base angle mode. An angle mode included in the prediction mode list has a higher priority than an angle mode not included in the list. According to an embodiment, the method of configuring the prediction mode list by giving priority to the base angle mode is applied under a condition that a neighboring block uses the base angle mode. In addition, the method of configuring the prediction mode list by giving priority to the base angle mode is applied under a condition that the number of neighboring blocks using the base angle mode is equal to or greater than a threshold value.

[0092] In the prediction mode determination step of the encoder, calculating the rate-distortion cost (RD-cost) for all selectable (defined) angle modes may be a burden on complexity. Therefore, in order to reduce the complexity in the intra prediction mode determination step, the encoder first calculates the rate-distortion cost for a preset angle mode, for example, only for a base angle mode, and selects an intra prediction mode. Then, the encoder further calculates the rate-distortion cost for peripheral angle modes of the selected base angle mode to select an intra prediction mode.

[0093] Considering the similarity between the current block and the neighboring blocks and the embodiment of the encoder described above, it is highly likely that the current block uses the base angle mode. Therefore, a prediction mode list having a priority is constructed based on the base angle mode. First, if the number of elements of the prediction mode list to be constructed is less than the total number of base angle modes, a part of the base angle modes is selected to construct the prediction mode list. For example, if the number of base angle modes is 33 and the number of elements of the prediction mode list to be constructed is 16, the base angle modes are selected every other one of the total basic angle modes starting from any one of the basic angle modes. That is, in the embodiment of FIG. 13, the angle modes 4, 8, 12, 16, ..., 60, and 64 are selected. According to one embodiment, the prediction mode list consisting of the intra prediction modes selected in this way is used for the selected mode list. In another embodiment of the present invention, the number of elements of the prediction mode list to be constructed is defined based on the number of base angle modes. For example, if the number of base angle modes is 33, the number of elements of the prediction mode list to be constructed is defined as 33 or 32 (=33-1), etc.

[0094] As described above, the extension angle mode is signaled based on the basic angle mode. The extension angle mode is signaled using an intra prediction mode index for the basic angle mode. For example, when a prediction mode list based on the basic angle mode is constructed, the extension angle is signaled through an offset or an on / off flag with reference to the list. More specifically, when a prediction mode list is constructed based on the basic angle mode {a, b, c, d}, an offset {offset1, offset2, offset3, offset4} corresponding to each angle mode is signaled. An angle mode {a+offset1, b+offset2, c+offset3, d+offset4} is indicated based on the signaled offset. According to another embodiment, a flag indicating whether an offset corresponding to the basic angle mode is used is separately transmitted. For example, a flag corresponding to the basic angle mode a is transmitted, and if the value of the flag is 1, the angle mode a+offset1 is indicated, and if the value of the flag is 0, the angle mode a is indicated.

[0095] 12 is a diagram showing an example of referring to a neighboring block for intra prediction of a current block. In FIG. 12, it is assumed that a neighboring block exists adjacent to the left or upper boundary of the current block. Hereinafter, a method of constructing a prediction mode list for a current block with reference to the neighboring block of the current block will be described. The prediction mode list includes an MPM list, a selected mode, and a non-selected mode list, or a partial set thereof, but the present invention is not limited thereto.

[0096] 1) Method of constructing MPM list (first method): According to an embodiment of the present invention, the MPM list for the current block is constructed in the following manner. If there are multiple neighboring blocks adjacent to the left or upper boundary of the current block, the information of the intra prediction mode used in the corresponding blocks is taken into consideration comprehensively. In this case, the neighboring block adjacent to the left or upper boundary of the current block refers to the block adjacent to the left side having a height of the current block's height "Cur_block_height" or the block adjacent to the top side having a length of the current block's width "Cur_block_width".

[0097] For example, as shown in FIG 12, if blocks L0 and L1 are adjacent to the left boundary of the current block and blocks A0, A1, and A2 are adjacent to the upper boundary, the MPM list is constructed by referring to the intra prediction mode used in the corresponding block. In this case, the order of referring to the neighboring blocks adjacent to the current block is configured as follows.

[0098] According to the first embodiment, the MPM list is configured in the order of {L mode of block L0, mode of block L1, ..., mode of block A0, mode of block A1, ..., plane mode, DC mode, mode of block BL, mode of block AR, mode of block AL}. That is, the MPM list is configured by referring to the blocks adjacent to the left boundary and the blocks adjacent to the top boundary of the current block in order. According to the second embodiment, the MPM list is configured in the order of {L mode of block L0, mode of block A0, mode of block L1, mode of block A1, mode of block L_x, mode of block A_x, mode of block L_x+1, mode of block A_x+1, ..., plane mode, DC mode, mode of block BL, mode of block AR, mode of block AL}. That is, the representative block L0 adjacent to the left boundary of the current block and the representative block A0 adjacent to the upper boundary of the current block are first referred to, and the remaining blocks adjacent to the left boundary of the current block and the remaining blocks adjacent to the upper boundary of the current block are alternately referred to in order to construct the MPM list. According to the third embodiment, the MPM list is constructed in the order of {block L0 mode, block A0 mode, planar mode, DC mode, block BL mode, block AR mode, block AL mode, block L1 mode, ..., block A1 mode, ...}. That is, the representative block L0 adjacent to the left boundary of the current block and the representative block A0 adjacent to the upper boundary of the current block are first referred to, and the planar mode and DC mode are added, and then the remaining blocks adjacent to the left boundary of the current block and the remaining blocks adjacent to the upper boundary of the current block are alternately referred to in order to construct the MPM list. According to another embodiment, an average value or a representative value based on an intra prediction mode of a block adjacent to the left or upper boundary of the current block is extracted, and the MPM list is constructed using the extracted average value or representative value. Meanwhile, in the above embodiment, the representative block adjacent to the left / top boundary of the current block is set as a block not at L0 or A0, for example, the blocks closest to the midpoint of the left side and the midpoint of the top side of the current block may be set as the representative block.

[0099] Meanwhile, in FIG. 12, an example is shown in which the number of neighboring blocks adjacent to the left and upper boundaries of the current block is two and three, respectively, but the above-mentioned embodiment is extended and applied even if the number of neighboring blocks increases. Also, the above-mentioned embodiment is described based on the left and upper neighboring blocks of the current block, but it is similarly applied to the neighboring blocks located on the lower left (BL), upper right (AR), and upper left (AL) of the current block. A specific embodiment thereof will be described with reference to FIG. 13. If the MPM list cannot be filled in the above-mentioned method, the MPM list is added by applying a preset offset to the angle mode preselected in the MPM list. That is, an angle mode obtained by adding or subtracting a preset offset from the angle mode preselected in the MPM list is added to the MPM list. In this case, the preset offset is an integer other than 0.

[0100] 2) Method of constructing a selection mode list (second method). The selection mode list is constructed based on the intra prediction modes used in the neighboring blocks of the current block. In addition, the various embodiments of the priority for referring to the neighboring blocks described in the first method are also applied when constructing the selection mode list. If the selection mode list cannot be filled by the above method, a selection mode list is added by applying a preset offset to a preselected angle mode in the selection mode list. That is, an angle mode obtained by adding or subtracting a preset offset from a preselected angle mode in the selection mode list is added to the selection mode list. In this case, the preset offset is an integer other than 0.

[0101] According to another embodiment of the present invention, when the first method is applied, the lower modes not included in the MPM list among the intra prediction modes of the surrounding blocks are preferentially included in the selection mode list. If the selection mode list cannot be filled in this way, a selection mode list is added by applying a preset offset to a preselected angle mode in the selection mode list. According to another embodiment, the selection mode list is constructed by applying a preset offset (i.e., offset1) to the angle modes of the surrounding blocks. For example, the following selection mode list is constructed based on the remaining angle modes excluding the planar mode and DC mode from any one of the first methods. {mode + / -offset1 of block L0, mode + / -offset1 of block L1, ..., mode + / -offset1 of block A0, mode + / -offset1 of block A1, ..., mode + / -offset1 of block BL, mode + / -offset1 of block AR, mode + / -offset1 of block AL}. In this case, the preset offset is determined in various ways. For example, the offset is a positive integer, and is set to be incremented by 1 starting from 1. Alternatively, the offset may be a positive integer, and may be set to start from 1 and increase in multiples of 2. Alternatively, the offset may be increased starting from an integer greater than 1, and the scale of increase may be extended to multiples of 2 or 3, etc. Alternatively, the offset may be set to start from a preset initial value (e.g., 10) and gradually decrease.

[0102] 3) Method of constructing a non-selected mode list (third method). When constructing a non-selected mode list, the intra prediction modes used in the neighboring blocks of the current block are used similarly to the first method. For example, if the non-selected mode list is composed of 45 intra prediction modes and is signaled by truncated binary coding, the top 19 modes are signaled by one less bit than the 20th and subsequent modes. That is, the intra prediction modes of the non-selected mode list are divided into a first set signaled by an index consisting of l-1 bits and a second set signaled by an index consisting of l bits. In this case, the angle modes selected based on the priority of referring to the neighboring blocks according to the first method are included in the first set. If the first set cannot be filled in this way, an angle mode obtained by applying a preset offset to the angle mode preselected in the first set is added to the first set.

[0103] According to another embodiment of the present invention, among the intra prediction modes of the surrounding blocks, lower modes that are not included in the MPM list and / or the selected mode list are preferentially included in the first set. If the first set cannot be filled in this way, an angle mode obtained by applying a preset offset to the angle mode preselected in the first set is added to the first set. According to another embodiment, the first set is constructed based on the angle modes of the surrounding blocks in a manner similar to the second method as follows: {mode + / -offset2 of block L0, mode + / -offset2 of block L1, ..., mode + / -offset2 of block A0, mode + / -offset2 of block A1, ..., mode + / -offset2 of block BL, mode + / -offset2 of block AR, mode + / -offset2 of block AL}. In this case, the preset offset (i.e., offset2) used to construct the first set is set to a value different from the offset used to construct the MPM list and the offset (i.e., offset1) used to construct the selected mode list.

[0104] 13 is a diagram showing another embodiment of referring to neighboring blocks for intra prediction of a current block. The embodiment of FIG. 12 of performing intra prediction of a current block by referring to a plurality of neighboring blocks is extended to neighboring blocks located not only on the left (L) and top (A) of the current block but also on the bottom left (BL), top right (AR), and top left (AL) of the current block.

[0105] The definition of the neighboring block located on the left or upper side of the current block is the same as the embodiment of FIG. 12. In addition, neighboring blocks located on the lower left side (BL), upper right side (AR), and upper left side (AL) of the current block are defined. First, the neighboring block located on the lower left side (BL) of the current block refers to a block adjacent to a surface extended downward from the left side of the current block by a length of "BL_block_height". Also, the neighboring block located on the upper right side (AR) of the current block refers to a block adjacent to a surface extended right from the upper side of the current block by a length of "AR_block_width". Similarly, the neighboring block located on the upper left side (AL) of the current block refers to a block adjacent to a surface extended downward from the upper side of the current block by a length of "AL_block_width". According to one embodiment, the length of "BL_block_height" is set to be the same as the length of "Cur_block_height" or is set to an integer multiple of the length of "Cur_block_height". In addition, the length of 'AR_block_width' and 'AL_block_height' is set to be equal to the length of 'Cur_block_width' or an integer multiple of the length of 'Cur_block_width'. In this case, all available blocks among the blocks at the corresponding position are referenced for intra prediction of the current block. In addition, the size of the referenceable blocks is predefined, and only blocks smaller or larger than the predefined size are referenced for intra prediction of the current block. In addition, if the current block is not a square block, the pattern of the referenced neighboring blocks may differ depending on the size of the current block.

[0106] For example, as shown in FIG. 13, if the peripheral blocks located on the lower left side (BL) of the current block are BL0, BL1, and BL2, the peripheral blocks located on the upper right side (AR) of the current block are AR0 and AR1, and the peripheral blocks located on the upper left side (AL) of the current block are AL0, AL1, and AL2, the prediction mode list is configured in the following order: {Block L0 mode, block L1 mode, ..., block A0 mode, block A1 mode, ..., planar mode, DC mode, block BL0 mode, block BL1 mode, block BL2 mode, ..., block AL0 mode, block AL1 mode, ..., block AR0 mode, block AR1 mode, ...}. According to an embodiment of the present invention, the MPM list is configured based on the configuration order of such prediction mode lists. Also, in the prediction mode list, a selection mode list may be configured using only the angle mode, and if the selection mode list cannot be filled, a selection mode is added to the selection mode list by applying a preset offset to a preselected angle mode. Also, in the prediction mode list, a first set of non-selected mode lists may be constructed using only angular modes, and if the first set cannot be filled, an angular mode obtained by applying a preset offset to an angular mode preselected in the first set is added to the first set. The embodiment of constructing a prediction mode list taking into account surrounding blocks described with reference to FIG. 12 is also applicable to the extended surrounding blocks according to FIG. 13.

[0107] FIG. 14 is a diagram showing an embodiment in which the MPM lists of neighboring blocks are referred to for intra prediction of the current block. When constructing the MPM list for the current block, not only the intra prediction modes of the neighboring blocks but also the MPM lists of the corresponding blocks are referred to. More specifically, for intra prediction of the current block, the intra prediction modes of the neighboring blocks, the intra prediction modes included in the MPM lists of the neighboring blocks, the intra prediction modes of the neighboring blocks of the neighboring blocks, the intra prediction modes included in the MPM lists of the neighboring blocks of the neighboring blocks, etc. are referred to. That is, in the first step (1 stNot limited to the surrounding blocks of the second tier, nd tier) surrounding blocks, 3rd step (3 rd The intra prediction mode of the current block is signaled using intra prediction information of a wider range of neighboring blocks, such as neighboring blocks of the same tier, where the intra prediction information of the block includes at least one of the intra prediction mode of the block and MPM list information.

[0108] Referring to FIG. 14, if a left neighboring block of a current block (i.e., Neighbor block1) is coded in an intra prediction mode, the intra prediction mode included in the MPM list of the corresponding neighboring block is preferentially considered for intra prediction mode signaling of the current block. That is, the following order of modes is referenced to signal the intra prediction mode of the current block: {Block L mode, block A mode, planar mode, DC mode, block BL mode, block AR mode, NB1_MPM0 mode, NB1_MPM1 mode, NB1_MPM2 mode, ..., NB2_MPM0 mode, NB2_MPM1 mode, NB2_MPM2 mode, ...}. Here, NBx_MPMy mode refers to intra prediction information of the x-th neighboring block of the current block. That is, NBx_MPMy mode refers to intra prediction mode information of the x-th neighboring block or y-th intra prediction mode information of the MPM list of the corresponding block. In this case, if the y-th mode is a non-angle mode such as a planar mode or a DC mode, it may not be considered in the current block.

[0109] According to an embodiment of the present invention, intra prediction mode information for neighboring blocks of neighboring blocks is modified and combined in various ways and used for intra prediction for a current block. For example, the embodiment may be modified and extended based on the shape of the current block (i.e., square block, rectangular block) and the shape of the neighboring blocks, and the order pair may be extended and applied to various combinations. An embodiment in which an intra prediction mode included in an MPM list of a neighboring block is used for intra prediction mode signaling of a current block may be combined with the above-mentioned embodiment. That is, when constructing at least one of the MPM list of the current block, the set of higher modes signaled by an index consisting of k-1 bits of non-MPM modes, the selected mode list, and the set of higher modes signaled by an index consisting of l-1 bits of non-selected modes, the modes included in the MPM list of the neighboring blocks are referenced. Also, in each case, if the corresponding list or set cannot be filled, an angle mode obtained by applying a preset offset to an angle mode preselected in the corresponding list or set is added to the corresponding list or set.

[0110] FIG. 15 is a diagram illustrating an embodiment in which the pattern and / or size of a current block and a neighboring block are considered for intra prediction of the current block. When constructing an MPM for the current block, intra prediction information of a neighboring block having a similar pattern and / or size to the current block is preferentially referred to. Here, the intra prediction information includes at least one of an intra prediction mode and MPM list information. Whether the pattern of the current block and the neighboring block is similar is determined based on whether both blocks are square blocks, whether both blocks are vertical blocks, whether both blocks are horizontal blocks, etc. If both blocks are both vertical blocks or both horizontal blocks, the ratio between the width and height of each block is further considered. In addition, in the embodiment of the present invention, the pattern of the block is not limited to the above case, but may be extended to a non-uniform rectangular block, a diagonal line block, etc.

[0111] More specifically, if the current block is a vertical block, the intra prediction information used in the vertical blocks (i.e., NB_l, NB_a) among the neighboring blocks is preferentially referenced when constructing the MPM list of the current block. Also, if the size of the current block is 16x32, the intra prediction information used in the neighboring blocks of the same size (i.e., NB_l) is preferentially referenced when constructing the MPM list of the current block. The embodiment of signaling the intra prediction mode of the current block considering the pattern and / or size of the current block and the neighboring blocks can be combined with the above-mentioned embodiment. That is, when constructing at least one of the MPM list of the current block, the set of higher modes signaled by an index consisting of k-1 bits among the non-MPM modes, the selected mode list, and the set of higher modes signaled by an index consisting of l-1 bits among the non-selected modes, the intra prediction information of the neighboring blocks having a similar pattern and / or size to the current block is preferentially referenced. Also, in each case, if the corresponding list or set cannot be filled, an angle mode obtained by applying a preset offset to an angle mode preselected in the corresponding list or set is added to the corresponding list or set.

[0112] 16 to 18 are diagrams illustrating an extended embodiment of obtaining prediction information of a current block by referring to prediction information of a neighboring block. According to an embodiment of the present invention, blocks referred to for signaling prediction information of a current block are extended to neighboring blocks not only to the current block neighboring neighboring blocks, but also to neighboring blocks not neighboring the current block. With reference to each drawing, an embodiment of obtaining intra prediction information of a current block by referring to intra prediction information of a neighboring block is described. According to an embodiment, an MPM list of a current block is constructed by referring to intra prediction information of a neighboring block. However, the present invention is not limited thereto, and each embodiment is similarly applied to obtaining inter prediction information of a current block by referring to inter prediction information of a neighboring block. Here, the inter prediction information includes a motion vector, a reference picture index, and the like.

[0113] First, FIG. 16 illustrates an embodiment of extended neighboring blocks referenced to obtain prediction information for a current block. As described above, the MPM list for the current block is constructed using intra prediction modes of the neighboring blocks, reflecting the regional similarity of pictures. In this case, the neighboring blocks L(1), A(1), BL(1), AR(1), and AL(1) adjacent to the boundaries of the current block are selected in the first step (1 st The neighboring blocks L(2), A(2), BL(2), AR(2), and AL(2) adjacent to the boundaries of the neighboring blocks in the first step are defined as the neighboring blocks in the second step (2 tier). ndThe neighboring blocks are defined as neighboring blocks of the first step (tier). For example, the bottommost block L(1) adjacent to the left boundary of the current block is the neighboring block of the first step, and blocks L(2), A(2), BL(2), AR(2), and AL(2) adjacent to the left or upper boundary of block L(1) are the neighboring blocks of the second step. In this case, among the blocks adjacent to the neighboring blocks of the first step, blocks that overlap with the current block are excluded from the neighboring blocks of the second step. In other words, block AR(1) on the upper right side of block L(1) overlaps with the current block, so it is not referred to when constructing the MPM list of the current block. Similarly, block BL(2) adjacent to block A(1), block AR(2) adjacent to block BL(1), and block BL(2) adjacent to block AR(1) also overlap with the current block, so they are not referred to when constructing the MPM list.

[0114] Although FIG. 16 shows an embodiment in which the five first-step neighboring blocks located to the left or upper side of the current block are expanded to a maximum of 25 second-step neighboring blocks, the present invention is not limited thereto. That is, in an embodiment of the present invention, the N first-step neighboring blocks located to the left or upper side of the current block are expanded to a maximum of N^2 second-step neighboring blocks. In this case, the MPM list of the current block is constructed by referring to the intra prediction modes of a maximum of N^2+N neighboring blocks within a preset range from the current block. Thus, it is possible to better reflect the regional characteristics of the picture than when the MPM list is constructed by referring only to the intra prediction modes of the N first-step neighboring blocks. In addition, it is expected that the amount of bits required for intra prediction mode coding will be reduced because the probability that the optimal intra prediction mode of the current block exists in the MPM list is increased.

[0115] In order to determine the exact position of the neighboring block of the second step of the current block, the size of the neighboring block of the first step and at least one of the position information of the vertices of the upper left, upper right, lower left, and lower right of the corresponding block are required. If the information is not stored in the encoder and decoder, the coordinates of each neighboring block of the second step are obtained by adding an offset to the reference coordinates of the neighboring block of the first step. For example, if the reference coordinates of the lower right side of the block AL(1) are (x0, y0), the reference positions of blocks L(2), A(2), BL(2), AR(2), and AL(2) are determined to be (x0-offset-1, y0-1), (x0-1, y0-offset-1), (x0-offset-1, y0+1), (x0+1, y0-offset-1), and (x0-offset-1, y0-offset-1), respectively. Here, offset is an integer greater than 0, and the x-axis offset and the y-axis offset are set to the same value or different values. According to another embodiment, offset is determined based on the size of the current block. That is, offset is set to be proportional to the size of the current block. For example, if the width and height of the current block are {64, 32}, the x-axis offset and the y-axis offset are set to {64, 32}, {32, 16}, {16, 8}, {8, 4}, etc., which are obtained by dividing the width and height by an integer. Since the encoder and the decoder use the same offset according to a predefined rule, both the encoder and the decoder refer to the inter prediction mode of the neighboring block of the second step at the same position.

[0116] According to another embodiment of the present invention, if the MPM list of the first step neighboring block L(1), A(1), BL(1), AR(1), or AL(1) of the current block is constructed, the encoder and decoder construct the MPM list of the current block by referring to the intra prediction mode included in the MPM list of the first step neighboring block without searching for the second step neighboring block. When the MPM list of the first step neighboring block is constructed, the MPM list of the first step neighboring block includes the prediction mode of the second step neighboring block in order to refer to the prediction mode of the second step neighboring block of the current block. Therefore, the prediction mode of the second step neighboring block can be referenced by referring to the MPM list of the first step neighboring block without searching for the second step neighboring block and calculating the position. Meanwhile, storing all the MPM list information of the first step neighboring block may burden the memory. Therefore, according to another embodiment of the present invention, the encoder and decoder store and refer to only the top M intra prediction modes included in the MPM list of the neighboring blocks in the first step to construct the MPM list of the current block. For example, if the size of the MPM list is 6 and the intra prediction modes of the top three MPM indexes (i.e., index=0, 1, 2) are referenced, the MPM list of the current block is constructed by referring to the intra prediction modes of the neighboring blocks L(1), A(1), BL(1), AR(1), and AL(1) in the first step and the intra prediction modes indicated by the top three MPM indexes of the MPM list of each block. According to one embodiment, the planar mode and DC mode are excluded from the above-mentioned top M intra prediction modes.

[0117] 17 is a diagram illustrating another embodiment of an extended neighboring block referenced to obtain prediction information of a current block. According to another embodiment of the present invention, a preset search range based on the current block is used to obtain prediction information of the current block.

[0118] Referring to FIG. 17, a rectangular search range is defined to search for the second step neighboring blocks L(2), A(2), BL(2), AR(2), and AL(2) based on the coordinates of the top left, bottom left, and top right vertices of the first step neighboring blocks. At this time, the second step neighboring blocks are searched for while moving a determined step in the x-axis and / or y-axis directions within the search range. For example, to search for the second step neighboring block L(2) for AL(1), which is the first step neighboring block of the current block, the block L(2) is searched for while moving a determined step size in the x-axis direction from the coordinate reference point of the bottom left of block AL(1). At this time, the search is continued until a block having prediction information different from the prediction information of block AL(1) is found within the determined search range. Also, to search for a second step peripheral block A(2) for the first step peripheral block AL(1) of the current block, block A(2) is searched for while moving a determined step size in the y-axis direction from the coordinate reference point on the upper right side of block AL(1).Similarly, to search for the second step peripheral blocks AL(2), AR(2), and BL(2), the second step peripheral blocks are searched for while moving a determined step size in the y-axis and / or y-axis directions from the coordinate reference points on the upper left, upper right, and lower left sides of block AL(1), respectively.

[0119] According to an embodiment of the present invention, the search range may be set to a fixed size such as 16x16, 32x32, 64x64, etc., or may be set according to the size of the current block. That is, the search range is set to be proportional to the width and / or height of the current block. For example, if the size of the current block is 128x128, the search range is set to 128x128, 64x64, 32x32, 16x16, 8x8, etc., which is obtained by dividing the size of the block by an integer. The step size for searching within the search range is set to a value that is greater than or equal to the minimum size of the block and smaller than the search range. For example, if the minimum size of the block is 4x4 in a search range of 64x64, the step size is set to 4, 6, 16, or 32. According to an embodiment of the present invention, the search for prediction information within the search range is performed until the preset prediction mode list is filled up. That is, prediction information searched for in the search range with a first step size is included in the prediction mode list, and if the prediction mode list is not filled, prediction information searched for in the search range with a second step size is added to the prediction mode list. The encoder and decoder perform search while increasing the step size for search until the prediction mode list is filled. Meanwhile, since each search range and step size are natural numbers and are used with the same predefined values ​​in the encoder and decoder, both the encoder and the decoder can refer to the prediction mode of the same second step neighboring block.

[0120] Figure 18 is a diagram showing another embodiment of an extended neighboring block referenced to obtain prediction information of a current block. If the encoder and decoder know the structure of the neighboring blocks of the current block, that is, the coordinates of the upper left side of the block size, they determine the position of the neighboring blocks of the second step relative to the current block. In the sub-blocks shown in Figure 18, the numbers on the upper left side indicate the order of encoding or decoding, and mean that the current block is the 15th to be encoded or decoded.

[0121] In order to determine the position of the neighboring block of the second step of the current block (i.e., the 15th block), at least one of the four reference points of the upper left, upper right, lower left, and lower right of each neighboring block of the first step and the width and height information of the corresponding block are used. For example, the reference positions of the neighboring blocks L(2), A(2), BL(2), AR(2), and AL(2) of the second step with respect to the neighboring block AL(1) of the first step of the current block are calculated as (x0-1, y0+h-1), (x0+w-1, y0-1), (x0-1, y0+h+1), (x0+w+1, y0-1), and (x0-1, y0-1), respectively. In this case, (x0, y0) are the coordinates of the upper left of the 5th block, which is the neighboring block of the first step of the current block, and w and h are the width and height of the block, respectively. For the remaining first-step neighboring blocks L(1), A(1), BL(1), and AR(1), the positions of the second-step neighboring blocks are calculated in the same manner, and the MPM list of the current block is constructed by referring to the intra-prediction modes of the second-step neighboring blocks.

[0122] According to a further embodiment of the present invention, when obtaining prediction information of the current block, the occurrence frequency of prediction modes in the neighboring blocks is taken into consideration. That is, a prediction mode with a high occurrence frequency in the neighboring blocks is referred to for prediction of the current block with a higher priority than a prediction mode with a low occurrence frequency in the neighboring blocks. According to one embodiment, the priority among the prediction modes included in the MPM list of the current block is determined by considering the occurrence frequency of the prediction modes of the neighboring blocks in the first step and the prediction modes of the neighboring blocks in the second step. A specific embodiment thereof will be described with reference to FIG. 19.

[0123] FIG. 19 is a diagram illustrating an embodiment of setting the priority order of intra prediction modes based on the occurrence frequency of intra prediction modes of neighboring blocks. First, the occurrence frequency of prediction modes of neighboring blocks L(1), A(1), BL(1), AR(1), and AL(1) of the first step of a current block and neighboring blocks L(2), A(2), BL(2), AR(2), and AL(2) of the second step is calculated. The occurrence frequency of prediction modes of neighboring blocks of the first step and the occurrence frequency of prediction modes of neighboring blocks of the second step are stored in different lists (i.e., the first list and the second list), and are incremented by one when a prediction mode of a neighboring block of the corresponding step is confirmed. For example, if the intra prediction mode of block L(1) is mode 50, the occurrence frequency of mode 50 of the second list is incremented by one, and the occurrence frequency of mode 50 of the second list is not incremented. After the calculation of the occurrence frequency of the prediction modes of the neighboring blocks of the first step and the neighboring blocks of the second step is completed, the final occurrence frequency of each prediction mode is calculated by summing the weighted values ​​of the occurrence frequency. More specifically, the final occurrence frequency FM of a specific mode i is calculated as i is calculated as in the following formula 1.

[0124]

number

[0125] Here, F.M. i (1) is the frequency of occurrence of mode i in the neighboring blocks in the first step, F i (2) is the frequency of occurrence of mode i in the surrounding blocks in the second step, and W 1 and W 2 is the weighted value.

[0126] For example, referring to FIG. 19, if the occurrence frequency of the intra prediction mode 50 in the first step neighboring blocks and the second step neighboring blocks is 2 and 3, respectively, the final occurrence frequency of the intra prediction mode 50 is w 1 *3+w 2*3. In this case, the weighting value W 1 and W 2 A bit-soft operation is further applied to compensate for the increased scale by the weighting value W 1 and W 2 is set to an integer greater than 0 to avoid real multiplication operations and increase the schedule of weighted sums, but the scale is corrected by bit shift operations.

[0127] According to an embodiment of the present invention, the weight value W 1 and W 2 is determined according to various embodiments. According to one embodiment, since the neighboring blocks of the first step are closer to the current block than the neighboring blocks of the second step, W 1 W 2 It is set to a larger value. For example, W 1 and W 2 may be set to 5 and 3, respectively. According to another embodiment, the weights W 1 and W 2 is variably set according to the corresponding prediction mode. 1 and W 2 is not set equally for all prediction modes in the same list, but is set variably according to the prediction mode, so that occurrence of a particular prediction mode is considered more important. For example, a higher weight is given to {planar mode, DC mode, VER mode, HOR mode, HDIA mode, DIA mode, VDIA mode}, etc., which have a high occurrence probability. Also, a higher weight is given to the basic angle mode compared to the extended angle mode. According to another embodiment, the weight value W 1 and W 2 is variably set according to the pattern of the current block to further increase the priority of a particular angle mode. For example, if the current block is a vertical block, a higher weight is set for the VER mode and angle modes close to the VER mode, and if the current block is a horizontal block, a higher weight is set for the HOR mode and angle modes close to the HOR mode. In another embodiment, the weight value W 1 and W 2is variably set according to the position of the corresponding neighboring block. For example, if the priority order among the neighboring blocks is set in the order of {block L, block A, block BL, block AR, block AL}, a higher weight is assigned according to this order. For example, if the prediction mode of block L(2) and block AL(2) is 34, a higher weight is assigned to block L(2) and added to the occurrence frequency number.

[0128] Weight value W 1 and W 2 If is variably set, when a particular prediction mode occurs in each list, the frequency is W 1 and W 2 According to one embodiment, the weight value W 1 and W 2 is set in advance. In this case, the encoder and decoder both use the same weight value W 1 and W 2 According to another embodiment, the weight value W 1 and W 2 The information regarding the PPS, VPS, or SPS is signaled via a RBSP.

[0129] The MPM list of the current block is configured based on the final occurrence frequency calculated according to the above-mentioned embodiment. An intra prediction mode with a high occurrence frequency in a neighboring block has a high probability of being selected in the current block. Thus, an intra prediction mode with a high final occurrence frequency calculated in a neighboring block is included in the MPM list of the current block. For example, if the size of the MPM list is m, the MPM list includes a planar mode, a DC mode, and the top m-2 angular modes with a high final occurrence frequency. In addition, since a lower index in the MPM list can be represented with fewer bits, a prediction mode with a high final occurrence frequency is matched to a smaller MPM index in the MPM list.

[0130] Meanwhile, if there are multiple angle modes having the same final occurrence frequency value other than 0, the occurrence frequency of the corresponding angle mode in the neighboring blocks of the first step is considered preferentially. For example, if the intra prediction mode 18 and the intra prediction mode 50 have the same final occurrence frequency value of 8, a higher priority is assigned to the intra prediction mode having a higher occurrence frequency in the neighboring blocks of the first step. According to another embodiment, if there are multiple angle modes having the same final occurrence frequency value other than 0, the priority between the corresponding angle modes is determined according to the pattern of the current block. For example, if the current block is a vertical block, a higher priority is assigned to the angle modes of blocks A(1), AR(1), and AL(1) among the neighboring blocks of the first step, or a higher priority is assigned to the angle mode close to the vertical mode.

[0131] According to an embodiment, the MPM indexes of the planar mode and the DC mode in the MPM list are set differently depending on the intra prediction mode of the neighboring block in the first step. For example, if the occurrence frequency of the planar mode and the DC mode among the intra prediction modes of the neighboring block in the first step is equal to or greater than a threshold value, the planar mode and the DC mode are matched to MPM indexes 0 and 1. Also, if the occurrence frequency of the angular mode among the intra prediction modes of the neighboring block in the first step is equal to or greater than a threshold value, the MPM index of the angular mode is set to a value smaller than the MPM indexes of the planar mode and the DC mode.

[0132] In the above embodiment, if the number of angle modes having a non-zero final occurrence frequency is less than m-2, the MPM list is constructed using one or more of {VER mode, HOR mode, HDIA mode, VDIA mode}. In addition, in order to minimize the signaling overhead required for encoding non-MPM modes, prediction modes having a high final occurrence frequency are used. For example, prediction modes having a high final occurrence frequency are included in the selected mode list or matched to a low-value index signaled with a smaller number of bits among non-selected modes. According to another embodiment, the selected mode list is constructed using angle modes obtained by adding or subtracting a preset offset to the angle modes having a high final occurrence frequency included in the MPM list. In addition, angle modes having a non-zero final occurrence frequency not included in the MPM list and angle modes obtained by adding or subtracting a preset offset to the corresponding modes are matched to a low-value index signaled with a smaller number of bits among non-selected modes.

[0133] Hereinafter, an operation of an encoder for encoding an intra prediction mode of a current block based on the occurrence frequency of intra prediction modes of neighboring blocks will be described. First, in order to encode an intra prediction mode for a current block, an encoder checks whether a neighboring block of the current block exists and calculates the occurrence frequency of intra prediction modes of the neighboring blocks. Next, the encoder configures at least one of an MPM list, a selected mode list, or a non-selected mode based on the occurrence frequency of intra prediction modes of the neighboring blocks. In this case, a prediction mode with a high occurrence frequency is configured to have a high priority. Next, the encoder encodes an MPM flag indicating whether the intra prediction mode of the current block exists in the MPM list of the current block. If the intra prediction mode of the current block does not exist in the MPM list of the current block, the encoder encodes a selected mode flag indicating whether the intra prediction mode matches one of the selected modes. On the other hand, if the intra prediction mode of the current block exists in the MPM list of the current block (i.e., if the value of the MPM flag is 1), the encoder encodes an MPM index corresponding to the intra prediction mode of the current block in the MPM list. Also, if the intra prediction mode of the current block is in the selected mode list of the current block (i.e., if the value of the MPM flag is 0 and the value of the selected mode flag is 1), the encoder encodes a selected mode index corresponding to the intra prediction mode of the current block in the selected mode list, otherwise, it encodes a non-selected mode index corresponding to the intra prediction mode of the current block.

[0134] The decoder operates as follows to decode the intra prediction mode of the current block based on the occurrence frequency of the intra prediction mode of the neighboring block. First, in the process of parsing the symbol of the current block, the MPM flag of the current block is parsed, and if the MPM flag is 0, the selected mode flag is parsed. As in the encoding process, the decoder checks whether a neighboring block of the current block exists and calculates the occurrence frequency of the intra prediction mode of the neighboring block. Next, the decoder configures at least one of the MPM list, the selected mode list, and the non-selected mode based on the occurrence frequency of the intra prediction mode of the neighboring block. The method of configuring the MPM list, the selected mode list, and the non-selected mode in the decoder is the same as the method in the encoder described above. If the MPM flag is 1, the decoder decodes the MPM index. If the MPM flag is 0 and the selected mode flag is 1, the decoder decodes the selected mode index. Otherwise, the decoder decodes the non-selected mode index to determine the intra prediction mode of the current block. The decoder performs intra prediction using the determined intra prediction mode to generate a prediction block.

[0135] 20 and 21 are diagrams illustrating an embodiment in which intra prediction modes are classified into a plurality of subsets. As the number of intra prediction modes increases, the probability that the intra prediction mode of the current block is included in the MPM list decreases, and the amount of bits required for encoding the intra prediction mode increases. To solve this, the intra prediction modes are classified into a plurality of subsets, and intra prediction is performed using a prediction mode set according to the surrounding context of the current block.

[0136] First, Fig. 20 is a diagram showing an embodiment of classifying intra prediction modes into a plurality of subsets. According to the embodiment shown in Fig. 20, the N intra prediction modes of the intra prediction mode set are classified into M subsets (S 0 , S 1 , … , S M-1In Figure 20, m i、j denotes the j-th intra prediction mode belonging to the i-th subset. i is K i The prediction mode consists of exclusive intra prediction modes and satisfies Equation 2 below.

[0137]

number

[0138] In this case, the number K of intra prediction modes constituting each intra prediction mode subset is i may be different for each subset.

[0139] For example, if the intra prediction mode set includes a total of 67 intra prediction modes, the intra prediction modes are divided into a horizontal mode set {planar mode, mode 2, mode 3, ..., mode 34} and a vertical mode set {DC mode, mode 35, mode 36, ..., mode 66}. According to another embodiment, the intra prediction modes are divided into a horizontal mode set {horizontal mode, mode 10, mode 11, ..., mode 26}, a vertical mode set {DC mode, mode 42, mode 43, ..., mode 58}, a DIA mode set {mode 27, mode 28, ..., mode 41}, an HDIA mode set {mode 2, mode 3, ..., mode 9}, and a VDIA mode set {mode 59, mode 60, ..., mode 66}. According to another embodiment, the intra prediction modes are divided into a first subset {planar mode, DC mode, basic angle mode} and a second subset {extended angle mode}.

[0140] Next, Fig. 21 is a diagram showing another embodiment of classifying intra prediction modes into a plurality of subsets. According to the embodiment shown in Fig. 21, the N intra prediction modes of the intra prediction mode set are divided into M subsets (S 0 , S 1 , … , S M-1According to one embodiment, the common intra prediction mode is set to the top L intra prediction modes that are statistically most likely to be selected in inter prediction. k denotes the k-th shared intra prediction mode belonging to each subset, and m i、j denotes the j-th exclusive intra prediction mode belonging to the i-th subset. i is L common intra prediction modes and L i The prediction mode consists of exclusive intra prediction modes and satisfies Equation 3 below.

[0141]

number

[0142] In this case, the number of exclusive intra prediction modes included in each intra prediction mode subset is L i may be different for each subset.

[0143] For example, when the intra prediction mode set includes a total of 67 intra prediction modes, the common intra prediction mode is set to one or more of {planar mode, DC mode, HDIA mode, HOR mode, DIA mode, VER mode, VDIA mode}. Using this, the intra prediction modes are divided into a first subset {planar mode, DC mode, basic angle mode} and a second subset {planar mode, DC mode, HDIA mode, HOR mode, DIA mode, VER mode, VDIA mode, extended angle mode}. According to another embodiment, the intra prediction modes are divided into a first subset {planar mode, DC mode, HDIA mode, mode 3, mode 4, ..., mode 33, DIA mode, VER mode, VDIA mode} and a second subset {planar mode, DC mode, HDIA mode, HOR mode, DIA mode, mode 35, mode 36, ..., mode 65, VDIA mode}.

[0144] 22 is a diagram illustrating an embodiment of signaling an intra-prediction mode of a current block using a subset of classified intra-prediction modes. According to an embodiment of the present invention, the intra-prediction mode subset of the current block is determined using the intra-prediction mode subset used in the neighboring blocks of the current block.

[0145] According to the embodiment of Figure 20, if each intra prediction mode subset is an exclusive intra prediction mode, intra prediction mode subset information including the intra prediction modes of the neighboring blocks is checked, and the intra prediction mode subset of the current block is determined using the corresponding information. That is, the intra prediction mode subset most frequently used in the neighboring blocks is assigned to the intra prediction mode subset of the current block. In this case, the embodiments of Figures 16 to 18, which refer to the extended neighboring blocks to obtain prediction information of the current block, are further applied.

[0146] 22, the intra prediction mode subset of the current block is determined by first referring to intra prediction mode subset information of the first step neighboring blocks L(1), A(1), BL(1), AR(1), and AL(1) of the current block, and then referring to intra prediction mode subset information of the second step neighboring blocks L(2), A(2), BL(2), AR(2), and AL(2) of the current block. According to one embodiment, the frequency of occurrence of the intra prediction mode subset of the neighboring blocks in the first step and the frequency of occurrence of the intra prediction mode subset of the neighboring blocks in the second step are weighted by weights w, respectively, based on the frequency of occurrence calculation method described with reference to FIG. 1 and w 2 The final frequency of occurrence of the intra prediction mode subsets is calculated by applying the above formula: In this case, the intra prediction mode subset having the highest frequency of occurrence is assigned as the intra prediction mode subset of the current block.

[0147] On the other hand, if there are multiple intra prediction mode subsets having the same final occurrence frequency value other than 0, similar to the embodiment described with reference to Figure 19, the occurrence frequency in the neighboring blocks in the first step is given priority, or one of the intra prediction mode subsets is selected based on the pattern of the current block.

[0148] Next, according to the embodiment of Figure 21, when each intra prediction mode subset includes a common intra prediction mode, a case occurs in which the intra prediction mode subset cannot be identified only from the intra prediction mode information of the neighboring block due to the common intra prediction mode. That is, if the intra prediction mode of the neighboring block is one of the common intra prediction modes, the intra prediction mode subset of the neighboring block cannot be derived. Therefore, the index of the intra prediction mode subset of the current block should be separately signaled, and the intra prediction mode subset information of the current block should be stored.

[0149] In the above situation, according to an embodiment, the index of the intra prediction mode subset of the current block may not be separately signaled. Since the number of intra prediction mode subsets increases, the number of additional indexes required to represent the index information of the intra prediction mode subset increases, the intra prediction mode subset information of the neighboring blocks having the common intra prediction mode is determined according to a preset rule. For example, if the common intra prediction mode is used in the neighboring blocks, the basic subset is determined as the intra prediction mode subset of the corresponding neighboring blocks. Alternatively, the intra prediction mode subset is determined according to the type of the common intra prediction mode of the corresponding block. For example, if the common intra prediction mode used in the neighboring blocks is a vertical mode, the subset including many angle modes near the vertical mode is determined as the intra prediction mode subset of the corresponding neighboring blocks. Also, if the common intra prediction mode used in the neighboring blocks is a horizontal mode, the subset including many prediction modes near the horizontal mode is determined as the intra prediction mode subset of the corresponding neighboring blocks.

[0150] Once the intra-prediction mode subset of the current block is determined, the MPM list and non-MPM modes of the current block are constructed by taking priority consideration within the intra-prediction mode subset.

[0151] According to an embodiment, the MPM list is configured based on the positions of neighboring blocks of a preset priority and / or the intra prediction modes of a preset priority. Prediction modes of neighboring blocks having the same intra prediction mode subset as the current block are added to the MPM list in the order of the left block, the upper block, the lower left block, the upper right block, and the upper left block. In addition, if the intra prediction mode subset of the current block includes a planar mode and a DC mode, the corresponding intra prediction mode is considered preferentially over the angular mode. However, if the intra prediction mode subset includes a shared intra prediction mode, if the intra prediction mode of a neighboring block having an intra prediction mode subset different from the current block is one of the shared intra prediction modes, the intra prediction mode of the corresponding neighboring block is added to the MPM list of the current block according to the preset priority. For example, if the shared intra prediction mode is {planar mode, DC mode, HDIA mode, HOR mode, DIA mode, VER mode, VDIA mode} and the intra prediction mode subset of the left block is different from that of the current block, if the intra prediction mode of the left block is one of the shared intra prediction modes, the corresponding intra prediction mode is included in the MPM list of the current block.

[0152] According to another embodiment, the MPM list is constructed based on the pattern of the current block and the pattern of the neighboring blocks. If the current block is a vertical block, the intra prediction modes of the blocks having the same intra prediction mode subset as the current block among the upper block, the upper right block, and the upper left block are given high priority, and the vertical mode or the angular mode close to the vertical mode in the current intra prediction mode subset is preferentially added to the MPM list. According to another embodiment, at least one of the MPM list, the selected mode list, and the non-selected mode is constructed based on the occurrence frequency calculation method described with reference to FIG. 19, taking into consideration the frequency of the prediction modes included in the intra prediction mode subset of the current block among the prediction modes of the neighboring blocks of the first step and the prediction modes of the neighboring blocks of the second step.

[0153] In this way, by dividing N prediction modes into M intra prediction mode subsets and determining the intra prediction mode subset of the current block using intra prediction mode subset information of the surrounding blocks, an optimal prediction mode list is constructed in which intra prediction modes unnecessary for the current block are removed. Therefore, the probability that the intra prediction mode of the current block matches the intra prediction mode in the MPM list is increased, and the amount of bits required for intra prediction mode signaling is reduced.

[0154] FIG. 23 is a diagram illustrating a detailed embodiment of signaling the intra prediction mode of a current block using a subset of classified intra prediction modes. In the embodiment of FIG. 23, it is assumed that the intra prediction mode subset is composed of exclusive intra prediction modes. More specifically, 67 intra prediction modes of the intra prediction mode subset are classified into two subsets of exclusive intra prediction modes. The two intra prediction mode subsets each include 35 exclusive intra prediction modes and 32 exclusive intra prediction modes. For example, the first subset includes {planar mode, DC mode, 33 basic angle modes}, and the second subset includes {32 extended angle modes}. Alternatively, the intra prediction modes are divided into a horizontal mode set {planar mode, DC mode, mode 2, mode 3, ..., mode 34} and a vertical mode set {mode 35, mode 36, ..., mode 66}.

[0155] If the intra prediction modes are classified into two subsets, the number of signaled MPM modes, selected modes, and non-selected modes is adjusted. That is, 4 MPM modes, 8 selected modes, and 23 (or 20) non-selected modes are used to signal intra prediction of the current block. Figure 23(a) shows an example of signaling each flag and index for intra prediction of the current block, and Figure 23(b) shows an example of non-selected mode indexes signaled for truncated binary binarization.

[0156] If the intra prediction mode of the current block is in the MPM list, the MPM flag and the MPM index are signaled. In this case, the MPM flag is signaled with 1 bit, and the MPM index is coded by truncated binary binarization and signaled with 1 to 3 bits. The binarized MPM index is encoded through CABAC. Meanwhile, if the intra prediction mode of the current block is not in the MPM list, the MPM flag is set to 0, and the intra prediction mode is encoded using the selected mode and the non-selected mode. If the intra prediction mode matches one of the eight selected modes, the MPM flag, the selected mode flag, and the selected mode index are signaled. In this case, the MPM flag and the selected mode flag are signaled with 1 bit, and the selected mode index is signaled with a fixed 3 bits.

[0157] For the remaining non-selected modes, the MPM flag, the selected mode flag, and the non-selected mode index are signaled. In this case, the non-selected mode index is coded and signaled by truncated binary binarization. If a first subset including 35 intra prediction modes is used for the current block, the number of non-selected modes in the corresponding subset is 23. In order to satisfy 2^4<23<2^5, the indexes of the top 9 modes of the non-selected modes are signaled with 4 bits, and the indexes of the bottom 14 modes are signaled with 5 bits. However, if a second subset including 32 intra prediction modes is used for the current block, the number of non-selected modes in the corresponding subset is 20. In order to satisfy 2^4<20<2^5, the indexes of the top 12 modes of the non-selected modes are signaled with 4 bits, and the indexes of the bottom 8 modes are signaled with 5 bits.

[0158] Figure 24 illustrates an embodiment of dynamically signaling the intra prediction mode of a current block based on prediction information of a neighboring block. More specifically, according to the embodiment of Figure 24, the MPM mode configuration is changed according to various conditions. Figure 24(a) illustrates a method of changing the MPM configuration according to the type of picture to which the current block belongs. Figures 24(b) and 24(c) illustrate a method of variably configuring the MPM mode according to the intra prediction mode used in the neighboring block.

[0159] First, FIG. 24(a) shows a method of changing an MPM configuration according to the type of picture to which a current block belongs according to an embodiment of the present invention. Conventional configurations such as MPM mode, non-MPM mode, and non-selection mode are applied in the same manner regardless of the type of picture to which the corresponding block belongs (i.e., I picture, P picture, or P picture). However, according to an embodiment of the present invention, as shown in FIG. 24(a), an MPM configuration method in P pictures and B pictures in which surrounding blocks can freely perform inter prediction and intra prediction may be applied differently from an MPM configuration method in an I picture in which surrounding blocks only perform intra prediction. For example, the number of MPM modes in P pictures and B pictures is set to be different from the number of MPM modes in an I picture. That is, the number of MPM modes in P pictures and B pictures is set to a value smaller than the number of MPM modes in an I picture.

[0160] Next, FIG. 24(b) shows an embodiment of the present invention that variably configures the MPM mode according to the intra prediction mode used in the peripheral blocks. If the current tile (or slice) is a P tile (or slice) or a B tile (or slice), the decoder searches for the prediction mode used at the position of the peripheral block. At this time, the number of positions confirmed as intra prediction blocks among all the search positions (for example, L, A, BL, AR, and AL) of the peripheral block is designated as m1. Also, the number of different intra prediction modes used for intra prediction at all the search positions of the peripheral block is designated as m2. For example, if all the search positions of the peripheral block are confirmed as intra prediction blocks, m1 has a large value, but if the intra prediction modes used at each position are all the same, m2 is set to 1. According to an embodiment of the present invention, the following variable MPM mode signaling method is applied based on the values of m1 and / or m2. In each embodiment, Th1, Th2, and Th3 represent a first critical value, a second critical value, and a third critical value, respectively. At this time, Th1 < Th2 < Th3 is satisfied.

[0161] 1) If the value of m1 is less than or equal to Th1, the first MPM mode signaling method is applied. If the number of intra prediction blocks at the position of the peripheral block is less than or equal to Th1, the context of the intra prediction mode used at the position of the peripheral block or the mode derived therefrom (for example, applied to an offset preset for the angular mode) may have no relation to the current block. That is, since the peripheral block is likely to be mostly an inter prediction block, the intra prediction of the current block may have a low correlation with the peripheral block. In this case, it is appropriate for the MPM mode to signal m intra prediction modes extracted from a number of contexts with an equal overhead. Therefore, fixed-length coding is applied to the MPM mode.

[0162] 2) If the value of m1 is greater than Th1 but less than or equal to Th2, the second MPM mode signaling method is applied. If the number of intra prediction blocks at the position of the surrounding block is greater than Th1, the context of the intra prediction mode used at the position of the surrounding block or the mode derived therefrom must be differentially considered. That is, since there are surrounding blocks on which intra prediction is performed, the signaling of the intra prediction mode of the current block is configured based on the surrounding intra prediction blocks, but differential signaling considering their positions is required. In this case, it is appropriate for the MPM mode to signal m intra prediction modes extracted in the context of sequentially considering the intra prediction mode used in the surrounding block and the mode derived therefrom with differential overhead. Therefore, the MPM mode is signaled by truncated unary binarization.

[0163] 3) If the value of m1 is greater than Th2 but the value of m2 is less than Th3, the third MPM mode signaling method is applied. Since the number of intra prediction blocks at the position of the neighboring block is greater than Th2 but the diversity of the intra prediction modes used is not large, the context of the intra prediction modes of the neighboring blocks or modes derived therefrom must be considered differentially. In this case, the signaling method of the MPM mode is the same as the second method.

[0164] 4) If the value of m1 is greater than Th2 and the value of m2 is greater than Th3, the fourth MPM mode signaling method is applied. If the number of intra prediction blocks at the position of the neighboring block is greater than Th2, the diversity of the intra prediction modes used is large, so the context of the intra prediction modes of the neighboring blocks or the modes derived therefrom should be considered equally and the maximum value should be signaled through the MPM mode. That is, since there are many neighboring blocks on which intra prediction is performed, but most of the corresponding blocks use different intra prediction modes, the intra prediction of the current block requires non-differential signaling that considers all of the neighboring intra prediction blocks. In this case, it is appropriate for the MPM mode to signal m intra prediction modes extracted in the context considering the intra prediction modes used in the neighboring blocks and the modes derived therefrom with equal overhead. Therefore, fixed length coding is applied to the MPM mode.

[0165] In the method, the number m of modes signaled in the MPM mode is determined based on the derived values ​​of m1 and m2. Also, the number s of selected modes, the number ns of non-selected modes, and their encoding methods are determined based on the determined value of m. According to one embodiment, fixed length coding is applied to the selected mode, and it is appropriate to be responsible for signaling the subsequent s intra prediction modes set based on the number m of MPM modes.

[0166] Figure 24(c) shows another embodiment of the present invention in which the MPM mode is variably configured according to the intra prediction mode used in the surrounding block. As described above in the embodiment of Figure 24(b), the surrounding block indicates the number of different intra prediction modes used for intra prediction at all search positions as m2. According to another embodiment of the present invention, the following variable MPM mode signaling method is applied based on the value of m2.

[0167] 5) If the value of m2 is equal to or less than Th1, the fifth MPM mode signaling method is applied. If the number of intra prediction blocks at the position of the neighboring block is equal to or less than Th1, m is set to a small number by appropriately reflecting the context of the intra prediction mode used at the position of the neighboring block or the mode derived therefrom. If the number of different intra prediction modes of the neighboring blocks is small, even if the number of MPM modes is filled by expanding the number of different intra prediction modes of the neighboring blocks, the derived mode is likely to be different from the prediction mode of the current block. In this case, a small number of m MPM modes extracted from a single or small number of contexts are used, and it is appropriate to signal the MPM modes with equal overhead. Therefore, fixed length coding is applied to the MPM modes.

[0168] 6) If the value of m2 is greater than Th1 but less than or equal to Th2, the 6th MPM mode signaling method is applied. If the number of intra prediction blocks at the position of the neighboring block is greater than a certain number, the context of the intra prediction mode used at the position of the neighboring block or a mode derived therefrom needs to be differentially considered. A specific embodiment of the 6th MPM mode signaling method is the same as the above-mentioned 2nd MPM mode signaling method.

[0169] 7) If the value of m2 is greater than Th2, the seventh MPM mode signaling method is applied. If the number of intra prediction blocks at the position of the neighboring block is greater than Th2, the diversity of the intra prediction modes used is large, so the context of the intra prediction modes of the neighboring blocks or modes derived therefrom should be equally considered, and the maximum value should be signaled via the MPM mode. A specific example of the seventh MPM mode signaling method is the same as the above-mentioned fourth MPM mode signaling method.

[0170] In the method, the number m of modes signaled in the MPM mode is determined based on the derived value of m2. Also, the number s of selected modes, the number ns of non-selected modes, and their encoding methods are determined based on the determined value of m. According to one embodiment, fixed length coding is applied to the selected mode, and it is appropriate to be responsible for signaling the subsequent s intra prediction modes set based on the number m of MPM modes.

[0171] 25 is a diagram illustrating an embodiment in which the number of MPM modes is variably adjusted and the intra prediction mode of a current block is signaled based on the adjusted number of MPM modes. As described in FIG. 24, a small number of MPM modes are used according to the MPM mode signaling method.

[0172] Referring to FIG. 25(a), the number of MPM modes is not fixed and varies based on intra prediction mode information of surrounding blocks. Two modes out of a total of 67 intra prediction modes are set as MPM modes and signaled by fixed length coding. The fixed length coding method gives equal priority to the signaled modes. Next, the number of selection modes s is determined to be 16 or 9, and the selection modes are signaled by fixed length coding. At this time, since a relatively small number of MPM modes are signaled, according to the embodiment of FIG. 25(a), the number of selection modes (i.e., 16) is increased to increase the probability that an intra prediction mode that is not signaled in the MPM mode is signaled as the selection mode. However, if signaling is performed in the selection mode, the signaling overhead is the same as that of the conventional method using a fixed number of MPM modes, so according to the embodiment of FIG. 25(b), the number of selection modes (i.e., 9) can be reduced to reduce the overall overhead.

[0173] However, in an embodiment with a reduced number of selection modes, if non-selection modes are signaled, the signaling overhead increases. In the embodiment of FIG. 25(b) with 9 selection modes, 56 non-selection modes, which is more than the embodiment of FIG. 25(a) with 16 selection modes, should be signaled by truncated binary binarization. In this case, since 2^5<56<2^6, the initial 2^6-56=8 indexes of the non-selection mode are signaled using only 5 bits, and the remaining 48 indexes are signaled using 6 bits. Therefore, it can be seen that the signaling overhead of the non-selection mode of FIG. 25(b) has increased compared to the non-selection mode of FIG. 25(a) in which 15 indexes are signaled using 5 bits and 34 indexes are signaled using 6 bits.

[0174] In the above embodiment, the number m of intra prediction modes signaled in the MPM mode is determined based on the method described above with reference to Figure 24. The number s of selected modes is determined based on the determined value of m. The number s of selected modes is also determined based on the following further conditions.

[0175] First, the number of selection modes is determined based on the value of the intra prediction mode determined by the MPM mode and the context. If the intra prediction mode of the surrounding block is reflected when the MPM mode is determined, the intra prediction mode of the current block is likely to be signaled through the MPM mode or a selection mode derived therefrom. Therefore, an additional intra prediction mode derived from the MPM mode is obtained, and the additional intra prediction mode is configured and signaled with a relatively small number of selection modes. In this way, by limiting the number of selection modes, it is possible to reduce signaling overhead. However, if the intra prediction mode of the surrounding block is not reflected when the MPM mode is determined and the MPM list is configured with a basic angle mode such as a planar mode, a DC mode, a VER mode, or a HOR mode, a relatively large number of selection modes are configured and signaled. Since the MPM list is made up of a context unrelated to the surrounding block, the number of selection modes is maximized to increase the possibility that the intra prediction mode of the current block is included in the selection mode. Meanwhile, the number ns of non-selected modes is determined as a value obtained by subtracting the number m of MPM modes and the number s of selected modes from the total number T of intra prediction modes.

[0176] The above-described embodiments of the present invention may be implemented in a variety of ways, for example, in hardware, firmware, software, or a combination thereof.

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

[0178] In the case of implementation by firmware or software, the method according to the embodiment of the present invention may be implemented in the form of modules, procedures, or functions performing the functions or operations described above. The software code is stored in a memory and implemented by a processor. The memory may be located inside or outside the processor and may exchange data with the processor by various means known in the art.

[0179] The above description of the present invention is for illustrative purposes only, and those skilled in the art will understand that the present invention can be easily modified into other specific forms without changing the technical idea or essential features of the present invention. Therefore, it should be understood that the above-described embodiments are illustrative in all respects and are not limiting. For example, each component described as a single type may be implemented in a distributed form, and each component described as a distributed form may be implemented in a combined form.

[0180] The scope of the present invention is indicated by the claims set forth below rather than by the above detailed description, and all modifications and variations 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. [Explanation of symbols]

[0181] 110 Conversion unit 115 Quantization section 120 Inverse quantization section 125 Reverse conversion unit 150 Prediction Department 152 Intra prediction unit 154 Inter Prediction Unit 154a Motion Estimation Unit 154b Motion compensation section 160 Entropy coding unit 210 Entropy Decoding Unit 220 Inverse quantization section 225 Inverse conversion unit 230 Filtering section 250 Prediction Department 252 Intra prediction unit 254 Inter Prediction Unit

Claims

1. 1. A method for processing a video signal, comprising the steps of: receiving intra prediction mode information of a current block, the intra prediction mode information indicating one of a plurality of intra prediction modes included in an intra prediction mode set, the intra prediction mode set including a plurality of angle modes, the plurality of angle modes including a base angle mode and an extended angle mode, the base angle mode being a mode corresponding to an angle within a first preset angle range; determining whether to use the extended angle mode based on at least one of a shape and a size of the current block; determining, when the extended angle mode is used, based on a sum of an index of a basic angle mode determined using the intra-prediction mode information and a predetermined offset, the sum of the index of the basic angle mode determined using the intra-prediction mode information and the predetermined offset representing the extended angle mode; and decoding the current block based on the determined extension angle mode. The extended angle mode indicates a wide angle direction outside the preset first angle range, and the number of the basic angle modes is 65. method.

2. 1. A video signal processing apparatus including a processor, The processor, receiving intra prediction mode information of a current block, the intra prediction mode information indicating one of a plurality of intra prediction modes constituting an intra prediction mode set, the intra prediction mode set including a plurality of angle modes, the plurality of angle modes including a base angle mode and an extended angle mode, the base angle mode being a mode corresponding to an angle within a first preset angle range; determining whether to use the extended angle mode based on at least one of a shape and a size of the current block; determining, when the extended angle mode is used, based on a sum of an index of a basic angle mode determined using the intra-prediction mode information and a predetermined offset, wherein the sum of the index of the basic angle mode determined using the intra-prediction mode information and the predetermined offset represents the extended angle mode; and decoding the current block based on the determined extension angle mode. The extended angle mode indicates a wide angle direction outside the preset first angle range, and the number of the basic angle modes is 65. Video signal processing device.

3. 1. A video signal encoding device including a processor, The processor, determining intra prediction mode information of a current block, the intra prediction mode information indicating one of a plurality of intra prediction modes constituting an intra prediction mode set, the intra prediction mode set including a plurality of angle modes, the plurality of angle modes including a basic angle mode and an extended angle mode, the basic angle mode being a mode corresponding to an angle within a first preset angle range, a sum of an index of the basic angle mode corresponding to the extended angle mode and a predetermined offset represents the extended angle mode, and whether to use the extended angle mode is determined based on at least one of a shape and a size of the current block; generating a bitstream including the intra-prediction mode information; The extended angle mode indicates a wide angle direction outside the preset first angle range, and the number of the basic angle modes is 65. Video signal encoding device.

4. A method of transmitting a bitstream generated by a video signal encoding device according to claim 3.

Citation Information

Patent Citations

  • Method and apparatus for encoding and decoding video signal according to directional intra-residual prediction

    US20070025439A1

  • Enhanced intra prediction mode signaling

    US20110292994A1

  • Using Multiple Prediction Sets to Encode Extended Unified Directional Intra Mode Numbers for Robustness

    US20120230403A1

  • Intra prediction and intra mode coding

    US20160373769A1

  • Method and apparatus for image intra prediction

    WO2009110753A2