Video signal processing method and device

By receiving and processing intra prediction mode information, and using video signal processing methods with multiple angle modes, the problem of low encoding and decoding efficiency of video signals in the prior art is solved, and more efficient signaling processing is achieved.

CN119729022APending Publication Date: 2025-03-28SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411926501.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-03-09
Filing Date
2018-10-24
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, it is difficult to effectively improve signaling efficiency in the encoding and decoding of video signals, especially when using prediction information of neighboring blocks.

Method used

By receiving intra prediction mode information, decode the current block, the processor configuration is adopted to process multiple angle modes in the intra prediction mode set, including the basic angle mode and the extended angle mode, which transmits signals based on the basic angle mode.

Benefits of technology

The encoding efficiency of the video signal is improved, and when using prediction information of neighboring blocks, the signaling overhead is reduced and the signaling efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729022A_ABST
    Figure CN119729022A_ABST
Patent Text Reader

Abstract

The invention discloses a video signal processing method and device. More specifically, the present invention provides a video signal processing method and a video signal processing apparatus using the same, the method comprising: 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 comprise a basic angle mode and an extended angle mode; and the extended angle pattern is signaled based on the base angle pattern.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with the application date of October 24, 2018, application number 201880068739.2, and invention name “Video Signal Processing Method and Device”. Technical Field

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

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

[0004] Technical issues

[0005] The object of the present invention is to improve the coding efficiency of video signals.

[0006] In addition, an object of the present invention is to improve signaling efficiency when using prediction information of neighboring blocks to predict a current block.

[0007] Technical Solution

[0008] In order to solve the above problems, the present invention provides the following video signal processing device and video signal processing method.

[0009] First, according to an embodiment of the present invention, a method for processing a video signal includes: receiving intra-frame prediction mode information for a current block, wherein the intra-frame prediction mode information indicates one of multiple intra-frame prediction modes included in an intra-frame prediction mode set, and decoding the current block based on the received intra-frame prediction mode information, wherein the intra-frame prediction mode set includes multiple angle modes, and the multiple angle modes include a basic angle mode and an extended angle mode, wherein the extended angle mode is sent with a signal based on the basic angle mode.

[0010] In addition, according to an embodiment of the present invention, a video signal processing device includes a processor, wherein the processor is configured to receive intra-frame prediction mode information for a current block, wherein the intra-frame prediction mode information indicates one of multiple intra-frame prediction modes included in an intra-frame prediction mode set, and decode the current block based on the received intra-frame prediction mode information, wherein the intra-frame prediction mode set includes multiple angle modes, and the multiple angle modes include a basic angle mode and an extended angle mode, wherein the extended angle mode is sent with a signal based on the basic angle mode.

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

[0012] The extended angle mode is a wide angle mode outside the first angle range.

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

[0014] The extended angle mode is an angle mode between the basic angle modes within the first angle range.

[0015] The intervals between the extended angular modes of the intra prediction mode set are set based on the intervals between the corresponding basic angular modes.

[0016] The angular intervals between the extended angular patterns are set to be the same as the angular intervals between the corresponding basic angular patterns.

[0017] Whether to use the extended angle mode is determined based on at least one of a shape and a size of the current block.

[0018] The number of extended angle modes in the intra prediction mode set is set lower than the number of basic angle modes.

[0019] Beneficial Effects

[0020] According to the embodiments of the present invention, the coding efficiency of video signals can be improved.

[0021] Furthermore, according to an embodiment of the present invention, various extensions may be made to a prediction method for a current block, and signaling overhead due to such extensions may be minimized. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

[0025] Figure 4 An embodiment of a method for signaling partitioning of quadtrees and multi-type trees is shown.

[0026] Figure 5 An embodiment of reference samples used for prediction of a current block in intra prediction mode is shown.

[0027] Figure 6 An embodiment of a prediction mode for intra prediction is shown.

[0028] Figure 7 An embodiment of a method of signaling an intra prediction mode selected by an encoder to a decoder is shown.

[0029] Figure 8 A detailed embodiment of a method of signaling an intra prediction mode is shown.

[0030] Fig. 9 An embodiment of a context condition applied to an intra prediction mode is shown.

[0031] Fig.10 Another embodiment of a context condition applied to an intra prediction mode is shown.

[0032] Fig.11 Another embodiment of a context condition applied to an intra prediction mode is shown.

[0033] Fig.12 An embodiment of referring to neighboring blocks for intra prediction of a current block is shown.

[0034] Fig.13 Another embodiment of referring to neighboring blocks for intra prediction of a current block is shown.

[0035] Fig.14 An embodiment of referring to an MPM list of neighboring blocks for intra prediction of a current block is shown.

[0036] Fig.15 An embodiment is shown in which the shapes and / or sizes of a current block and neighboring blocks are considered for intra prediction of the current block.

[0037] Figures 16 to 18 The diagram shows an extended embodiment of obtaining prediction information of a current block by referring to prediction information of neighboring blocks.

[0038] Fig.19An embodiment is shown in which the priority of the intra prediction mode is set based on the occurrence frequency of the intra prediction mode of the neighboring blocks.

[0039] Fig. 20 and 21 An embodiment is shown in which intra prediction modes are classified into a plurality of subsets.

[0040] Fig. 22 An embodiment is shown in which a subset of classified intra prediction modes is used to signal the intra prediction mode of a current block.

[0041] Fig.23 A detailed embodiment of signaling the intra prediction mode of a current block using a subset of classified intra prediction modes is shown.

[0042] Fig.24 An embodiment is illustrated in which the intra prediction mode of the current block is dynamically signaled based on prediction information of neighboring blocks.

[0043] Fig.25 An embodiment is shown in which the number of MPM modes is variably adjusted and the intra prediction mode of the current block is signaled based thereon. DETAILED DESCRIPTION

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

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

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

[0047] The transform unit 110 obtains the value of the transform coefficient by transforming the residual signal, which is the difference between the input video signal and the prediction signal generated by the prediction unit 150. For example, discrete cosine transform (DCT), discrete sine transform (DST) or wavelet transform can be used. DCT and DST perform transformation by dividing the input image signal into a plurality of blocks. In the transformation, the coding efficiency can vary according to the distribution and characteristics of the values ​​in the transformation area. The quantization unit 115 quantizes the value of the transform coefficient value output from the transform unit 110.

[0048] In order to improve the coding efficiency, instead of the method of coding the image signal as it is, a method is used to predict the picture using the area that has been coded by the prediction unit 150, and obtain the reconstructed image by adding the residual value between the original picture and the predicted picture to the predicted picture. In order to prevent the mismatch between the encoder and the decoder, when the prediction is performed in the encoder, the information that can be used in the decoder should be used. To this end, the encoder performs the process of reconstructing the encoded current block again. The inverse quantization unit 120 inversely quantizes the value of the transform coefficient, and the inverse transform unit 125 reconstructs the residual value using the inversely quantized transform coefficient value. At the same time, the filtering unit 130 performs a filtering operation to improve the quality of the reconstructed picture and improve the coding efficiency. For example, a deblocking filter, a sample adaptive offset (SAO) and an adaptive loop filter may be included. The filtered picture is output or stored in a decoded picture buffer (DPB) 156 to be used as a reference picture.

[0049] The prediction unit 150 includes an intra prediction unit 152 and an inter prediction unit 154. The intra prediction unit 152 performs intra prediction in the current picture, and the inter prediction unit 154 performs inter prediction to predict the current picture by using the reference picture stored in the DPB 156. The intra prediction unit 152 performs intra prediction according to the reconstructed sample in the current picture, and transmits intra coding information to the entropy coding unit 160. The intra coding information may include at least one of an intra prediction mode, a most probable mode (MPM) flag, and an MPM index. The inter prediction unit 154 may include a motion estimation unit 154a and a motion compensation unit 154b. The motion estimation unit 154a refers to a specific area of ​​the reconstructed reference picture to obtain a motion vector value of the current area. The motion estimation unit 154a transmits motion information (reference picture index, motion vector information, etc.) about the reference area to the entropy coding unit 160. The motion compensation unit 154b performs motion compensation using the motion vector value transmitted from the motion estimation unit 154a. The inter prediction unit 154 transmits the inter encoding information including the motion information about the reference region to the entropy coding unit 160 .

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

[0051] The entropy coding unit 160 performs entropy coding on the quantized transform coefficients, intra-frame coding information, and inter-frame coding information to generate a video signal bit stream. In the entropy coding unit 160, a variable length coding (VLC) method, an arithmetic coding method, etc. can be used. The VLC method transforms the input symbols into continuous codewords, and the length of the codeword can be variable. For example, frequently occurring symbols are expressed as short codewords, while less frequently occurring symbols are expressed as long codewords. As a VLC method, a context-based adaptive variable length coding (CAVLC) method can be used. Arithmetic coding transforms continuous data symbols into a single decimal, and arithmetic coding can obtain the optimal number of decimal bits required to represent each symbol. As arithmetic coding, context-based adaptive arithmetic coding (CABAC) can be used.

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

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

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

[0055] The entropy decoding unit 210 entropy decodes the video signal bit stream and extracts the transform coefficient, intra-frame coding information, and inter-frame coding information of each region. The inverse quantization unit 220 inversely quantizes the entropy-decoded transform coefficient, and the inverse transform unit 225 reconstructs the residual value using the inversely quantized transform coefficient. The video signal processing device 200 reconstructs the original pixel value by adding the residual value obtained in the inverse transform unit 225 to the predicted value obtained in the prediction unit 250.

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

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

[0058] 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 may include at least one of an intra prediction mode, a most probable mode (MPM) flag, and an MPM index. The intra prediction unit 252 uses the reconstructed pixels located on the left and / or upper side of the current block as reference pixels to predict the pixel values ​​of the current block. According to an embodiment, the reference pixel may be a pixel adjacent to the left boundary of the current block and / or a pixel adjacent to the upper boundary. According to another embodiment, the reference pixel may be a neighboring pixel within a predetermined distance from the left boundary of the current block and / or a neighboring pixel within a predetermined distance from the upper boundary of the current block among the pixels of the neighboring blocks of the current block. In this case, the neighboring blocks of the current block may include at least one of a left (L) block, an upper (A) block, a lower left (BL) block, an upper right (AR) block, or an upper left (AL) block adjacent to the current block.

[0059] The inter prediction unit 254 generates a prediction block using the reference picture and the inter coding information stored in the DPB 256. The inter coding information may include motion information (reference picture index, motion vector information, etc.) of the current block for the reference block. Inter prediction may include L0 prediction, L1 prediction, and bidirectional prediction. L0 prediction means prediction using one reference picture included in the L0 picture list, and L1 prediction means prediction using one reference picture included in the L1 picture list. To this end, a motion information set (e.g., motion vector and reference picture index) may be required. In the bidirectional prediction method, up to two reference areas may be used, and the two reference areas may exist in the same reference picture or may exist in different pictures. That is, in the bidirectional prediction method, up to two motion information sets (e.g., motion vector and reference picture index) may be used, and the two motion vectors may correspond to the same reference picture index or different reference picture indexes. In this case, the reference picture may be displayed (or output) before and after the current picture in terms of time.

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

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

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

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

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

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

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

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

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

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

[0070] Figure 5 and Figure 6 The intra prediction method according to the embodiment of the present invention is illustrated in more detail.As described above, the intra prediction unit predicts the pixel value of the current block using the reconstructed pixels located on the left and / or upper side of the current block as reference pixels.

[0071] first, Figure 5 1 shows an embodiment of a reference sample used for prediction of a current block in an intra prediction mode. According to an embodiment, the reference pixel may be a pixel adjacent to the left boundary and / or a pixel adjacent to the upper boundary of the current block. Figure 5As shown in , when the size of the current block is W×H and the pixels of a single reference line adjacent to the current block are used for intra prediction, the reference pixels can be configured using a maximum of 2W+2H+1 neighboring pixels located on the left and / or upper side of the current block. At the same time, according to an additional embodiment of the present invention, the pixels of multiple reference lines can be used for intra prediction of the current block. Multiple reference lines can be composed of n lines located within a preset range from the current block. According to an embodiment, when the pixels of multiple reference lines are used for intra prediction, separate index information indicating the lines to be configured as reference pixels can be sent with a signal. If at least some of the neighboring pixels to be used as reference pixels are not reconstructed, the intra prediction unit can obtain the reference pixels by performing a reference sample filling process according to a preset rule. In addition, the intra prediction unit can perform a reference sample filtering process to reduce errors in intra prediction. That is, the reference pixels can be obtained by performing filtering on neighboring pixels and / or pixels obtained by the reference sample filling process. The intra prediction unit uses the reference pixels obtained in this way to predict the pixels of the current block.

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

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

[0074] Meanwhile, the preset angle range may be set differently according to the shape of the current block. For example, when the current block is a rectangular block, a wide angle mode indicating an angle greater than 45 degrees or less than -135 degrees in the clockwise direction may be used in addition. When the current block is a horizontal block, the angle mode may indicate an angle within an angle range (i.e., a second angle range) between (45+offset1) degrees and (-135+offset1) degrees in the clockwise direction. In this case, angle modes 67 to 76 outside the first angle range may be used in addition. In addition, when the current block is a vertical block, the angle mode may indicate an angle within an angle range (i.e., a third angle range) between (45-offset2) degrees and (-135-offset2) degrees in the clockwise direction. In this case, angle modes -10 to -1 outside the first angle range may be used in addition. According to an embodiment of the present invention, the values ​​of offset1 and offset2 may be determined differently according to the ratio between the width and height of the rectangular block. Similarly, offset1 and offset2 may be positive numbers.

[0075] According to yet another embodiment of the present invention, the plurality of angle modes included in the intra prediction mode set may include a basic angle mode and an extended angle mode. In this case, the extended angle mode may be determined based on the basic angle mode.

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

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

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

[0079] According to an embodiment of the present invention, an extended angle mode may be signaled based on a basic angle mode. For example, a wide-angle mode (i.e., an extended angle mode) may replace at least one angle mode (i.e., a basic angle mode) within a first angle range. The basic angle mode to be replaced may be an angle mode corresponding to the opposite side of the wide-angle mode. That is, the basic angle mode to be replaced is an angle mode corresponding to an angle in the opposite direction of the angle indicated by the wide-angle mode or an angle in the opposite direction that differs from a preset offset index. According to an embodiment of the present invention, the preset offset index is 1. The intra-frame prediction mode index corresponding to the replaced basic angle mode may be mapped back to the wide-angle mode to signal the wide-angle mode. For example, a wide-angle mode {-10, -9, ..., -1} may be signaled by an intra-frame prediction mode index {57, 58, ..., 66}, and a wide-angle mode {67, 68, ..., 76} may be signaled by an intra-frame prediction mode index {2, 3, ..., 11}. In this way, because the intra-frame prediction mode index for the basic angle mode is used to signal the extended angle mode, even if the configuration of the angle mode for intra-frame prediction of each block is different, the same set of intra-frame prediction mode indexes can be used for signaling of the intra-frame prediction mode. Therefore, the signaling overhead caused by the change of the intra-frame prediction mode configuration can be minimized.

[0080] Meanwhile, whether to use the extended angle mode may be determined based on at least one of the shape and size of the current block. According to an embodiment, when the size of the current block is greater than a preset size, the extended angle mode may be used for intra prediction of the current block, otherwise, only the basic angle mode may be used for intra prediction of the current block. According to another embodiment, when the current block is a block other than a square, the extended angle mode may be used for intra prediction of the current block, and when the current block is a square block, only the basic angle mode may be used for intra prediction of the current block.

[0081] The intra prediction unit determines the reference pixels and / or interpolated reference pixels to be used for intra prediction of the current block based on the intra prediction mode information of the current block. When the intra prediction mode index indicates a specific angle mode, the reference pixels or interpolated reference pixels corresponding to the specific angle of the current pixel from the current block are used for the prediction of the current pixel. Therefore, different sets of reference pixels and / or interpolated reference pixels can be used for intra prediction according to the intra prediction mode. After performing intra prediction of the current block using the reference pixels and the intra prediction mode information, the decoder reconstructs the pixel value of the current block by adding the residual signal of the current block obtained from the inverse transform unit to the intra prediction value of the current block.

[0082] Figure 7 An embodiment of a method of signaling an intra-prediction mode selected by an encoder to a decoder is shown. When the total number of intra-prediction modes included in an intra-prediction mode set is T (e.g., 67), a method of signaling T modes by simply expressing in binary form is inefficient because the probability of selecting each mode and the context of the corresponding block and neighboring blocks are not taken into account. Therefore, efficient signaling can be performed by managing a list of some modes that are most likely to be used in the current block, respectively, among all the modes.

[0083] According to an embodiment of the present invention, for intra prediction of a current block, a list of at least one prediction mode consisting of some of the entire intra prediction modes may be managed. The first prediction mode list for intra prediction is a most probable mode (MPM) list. The intra prediction modes included in the MPM list are MPM modes, and the intra prediction modes not included in the MPM list may be referred to as non-MPM modes. The encoder signals an MPM flag to distinguish whether the intra prediction mode used in the current block is an MPM mode or a non-MPM mode. The decoder may determine whether the intra prediction mode used in the current block is an MPM mode or a non-MPM mode by the received MPM flag.

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

[0085] The MPM list can be configured by considering various contexts in each of the following steps. First, the MPM list can include the intra prediction modes and planar / DC modes used in neighboring blocks of the current block (context M0). If there is a block encoded with an intra prediction mode among the reconstructed neighboring blocks, due to the regional similarity of the picture, the current block may use the same intra prediction mode as the corresponding block. Therefore, the MPM list can be configured to include the intra prediction modes of the neighboring blocks. According to an embodiment, the neighboring blocks of the current block may include at least one of a left (L) block, an above (A) block, a bottom-left (BL) block, an upper-right (AR) block, or an upper-left (AL) block. For example, the neighboring blocks of the current block may include the left (L) block and the above (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 above (A) block is the rightmost block adjacent to the upper boundary of the current block. A detailed embodiment of the neighboring blocks for configuring the MPM list will be described again with reference to Figure 8 The intra prediction modes, planar mode, and DC mode selected from the neighboring blocks of the current block can be added to the MPM list according to a preset order. For example, the MPM list can be configured in the order of {block L mode, block A mode, planar mode, DC mode, block BL mode, block AR mode, block AL mode}.

[0086] Second, when the m MPM modes are not filled by the above method, the MPM list can be filled by applying additional context conditions (e.g., context M1, context M2, etc.). When applying the additional context conditions, the intra prediction modes already included in the MPM list are not re-added.

[0087] Meanwhile, the remaining T - m non-MPM modes among the total T intra prediction modes that are not included in the MPM list can be compiled by truncated binary binarization. When using truncated binary binarization, if it is assumed that 2^(k - 1) < T - m < 2^(k), then k - 1 bits (or bins) can be used to signal the initial 2^(k) - (T - m) indices, and k bits (or bins) can be used to signal the remaining indices. Therefore, additional context conditions (i.e., context N) are also applied to the non-MPM modes to utilize the indices consisting of k - 1 bits to signal the modes that are more likely to be selected in the corresponding block, so that the signaling overhead can be minimized.

[0088] According to another embodiment of the present invention, a second prediction mode list consisting of some non-MPM modes can be managed. More specifically, the non-MPM mode can be further divided into a selected mode and a non-selected mode, and a second prediction mode list consisting of a selected mode (i.e., a selected mode list) can be managed. The intra-frame prediction mode included in the selected mode list can be referred to as a selected mode, and the intra-frame prediction mode not included in the selected mode list can be referred to as a non-selected mode. The encoder sends a selected mode flag with a signal to distinguish whether the intra-frame prediction mode used in the current block is a selected mode or a non-selected mode. The decoder can identify whether the intra-frame prediction mode used in the current block is a selected mode or a non-selected mode by the received selected mode flag.

[0089] As described above, when the non-MPM mode is additionally classified, the selected mode can be coded with a fixed length. In this case, by applying an additional contextual condition (e.g., context S) to the selected mode, the mode with a high probability of being selected in the corresponding block can be prioritized. In this case, s selected modes (in this case, s is a power of 2) can be coded with a fixed length, and the remaining ns non-selected modes can be coded by truncated binary binarization. Any l-1 bits (or bins) or l bits (or bins) can be used to signal ns non-selected modes. In this case, by applying an additional contextual condition (i.e., context NS) to the non-selected mode, an index containing l-1 bits can be used to signal a mode with a relatively high probability of being selected in the corresponding block, so that the signaling overhead can be minimized.

[0090] A detailed embodiment of the context condition will be described later with reference to the accompanying drawings. The context conditions further defined in the following embodiments may be applied individually or repeatedly to various configurations to which the context conditions {M0, M1, M2, N, S, NS} are applied. For example, a context condition for signaling a basic angle mode that takes precedence over an extended angle mode may be additionally used. In addition, a context condition may be used that gives priority to adding an angle mode of a neighboring block derived by adding an arbitrary offset (e.g., -1, +1) to the first context condition (e.g., context M0) of an MPM mode to a prediction mode list. This context condition may be 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.

[0091] According to another embodiment of the present invention, the above-mentioned intra-frame prediction method can be determined based on the number of intra-frame prediction modes and / or intra-frame prediction mode information of the neighboring blocks. For example, whether to distinguish between MPM mode, non-MPM mode, selected mode and non-selected mode, the number of intra-frame prediction modes sent by signal for each mode (ie, m, Tm, s and ns), and the method of encoding each mode (ie, truncated unary binarization, truncated binary binarization, fixed length coding) can be configured differently according to the number of intra-frame prediction modes of the neighboring blocks or their values. In this case, the neighboring block can be a preset block that is referenced to configure the MPM list.

[0092] First, after checking the intra prediction mode of the neighboring blocks of the current block to configure the MPM list, a variable configuration can be applied based on the total number of prediction modes. When the current block is a block of a B frame or a P frame, the method of configuring the MPM list can be changed according to the number of blocks performing intra prediction and / or the number of prediction modes among the neighboring blocks. If further extended, different methods can be used to configure the MPM list between I frames and B / P frames. In I frames, since all neighboring blocks are configured with intra prediction, the following second method or a similar method can be applied without applying the above-mentioned first method.

[0093] Second, a variable configuration can be applied based on the number of different intra-frame prediction modes used in neighboring blocks. For example, the method of configuring the MPM list can be changed according to whether all the intra-frame prediction modes used in the neighboring blocks are the same or different. Alternatively, the method of configuring the MPM list can be changed according to the degree of difference in the intra-frame prediction modes used in the neighboring blocks. The degree to which the intra-frame prediction modes used in the neighboring blocks are different can be determined based on whether the number of intra-frame prediction modes used in the neighboring blocks is greater than or equal to a preset value. In addition, the degree to which the intra-frame prediction modes used in the neighboring blocks are different can be determined based on the difference in mode values ​​of the intra-frame prediction modes used in the neighboring blocks. When the degree to which the intra-frame prediction modes used in the neighboring blocks are different meets the preset criteria, the MPM list can be configured based on the first method. However, when the degree to which the intra-frame prediction modes used in the neighboring blocks do not meet the preset criteria, the MPM list can be configured based on a second method that is different from the first method. At the same time, in addition to the default position, the neighboring blocks of the current block being checked to generate the variable MPM list may also include blocks at other positions. Reference will be made to Figure 8 A specific embodiment thereof is described.

[0094] Figure 8 A detailed embodiment of a method of signaling an intra prediction mode is shown. Figure 8 (a) and 8(b) show embodiments of neighboring blocks that are referenced to configure a prediction mode list. Figure 8(c) shows an embodiment of a method for signaling the above intra prediction mode. Figure 8 (d) shows an embodiment where truncated binary binarization is used to signal non-selected modes.

[0095] first, Figure 8 (a) shows an embodiment of the relative positions of neighboring blocks that are referenced to configure the MPM list. Figure 8 (a), the neighboring blocks are referenced in the order of the left (L) block, the upper (A) block, the lower left (BL) block, the upper right (AR) block, or the upper left (AL) block adjacent to the current block. In this case, the intra prediction mode, the plane mode, and the DC mode selected from the neighboring blocks can be added to the MPM list according to a preset order. However, in an embodiment of the present invention, the neighboring blocks referenced to configure the MPM list are not limited to this. For example, the neighboring blocks of the current block may include a left (L) block and an upper (A) block adjacent to the current block. The left (L) block is the lowermost block adjacent to the left boundary of the current block, and the upper (A) block is the rightmost block adjacent to the upper boundary of the current block.

[0096] Next, Figure 8 (b) shows another embodiment of the relative positions of neighboring blocks referenced to configure the MPM list. The neighboring blocks of the current block may be segmented into a size smaller than the current block, and multiple neighboring blocks may exist at the left boundary or the upper boundary of the current block. In this case, the intra-frame prediction modes of multiple blocks adjacent to the left boundary or the upper boundary of the current block may be referenced to configure the MPM list. Figure 8 In the embodiment of (b), multiple blocks adjacent to the left boundary of the current block are referred to as L0 and L1 from bottom to top, and multiple blocks adjacent to the upper boundary of the current block are referred to as A0 and A1 from right to left.

[0097] According to the first embodiment, the MPM list may be configured in the order of {mode of block L0, mode of block A0, plane mode, DC mode, mode of block BL, mode of block AR, and mode of block AL}. According to the second embodiment, the MPM list may be configured in the order of {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, and mode of block AL}. In this case, the position and number of neighboring blocks of additional reference may be variable. In addition, additional blocks may be referenced in the lower left BL, upper right AR, and upper left AL adjacent to the current block. According to the third embodiment, the MPM list may be configured in the order of {mode of block L0, mode of block A0, plane mode, DC mode, mode of block L1, mode of block A1, mode of block BL, mode of block AR, and mode of block AL}. That is, by selecting the plane mode and DC mode with high selection probability as the order of the MPM list over the mode of block L1 and the mode of block A1, the signaling overhead can be reduced. According to the fourth embodiment, the MPM list can be configured in the order of {mode of block L0, mode of block A0, plane mode, DC mode, mode of block BL, mode of block AR, mode of block AL, mode of block L1, and mode of block A1}. That is, after the MPM list configuration order according to the above-mentioned first embodiment, blocks L1 and A1 can be referred to.

[0098] According to another embodiment of the present invention, the order of configuring the MPM list can be determined based on the shape of the current block. More specifically, when the current block is a non-square block, the reference order of the neighboring blocks can be determined differently depending on whether the current block is a vertical block or a horizontal block. For example, when the current block is a vertical block, the left block can be preferably referenced compared to the upper block, and when the current block is a horizontal block, the upper block can be preferably referenced compared to the left block. According to another embodiment, the order of configuring the MPM list can be determined by comparing the shape of the current block with the shape of the neighboring blocks. For example, when the current block is a vertical block, the intra-frame prediction mode for the vertical block among the preset neighboring blocks can be preferentially included in the MPM list.

[0099] According to another embodiment of the present invention, the order of configuring the MPM list may be determined by considering the association between the shape of the current block and the angle mode used in the neighboring block. For example, if the current block is a vertical block, the angle mode used in the preset neighboring block that is within a preset range from the vertical (VER) mode 50 or between the diagonal (DIA) mode 34 and the vertical diagonal (VDIA) mode 66 may preferably be included in the MPM list. According to yet another embodiment, the intra-frame prediction mode included in the MPM list of the neighboring block may be included in the MPM list of the current block. In this case, when the MPM list of the current block is not filled with intra-frame prediction modes for neighboring blocks, the intra-frame prediction mode included in the MPM list of the neighboring block may be added to the MPM list of the current block.

[0100] Figure 8 (c) shows an embodiment of a method for signaling the above-mentioned intra-frame prediction mode. Among T intra-frame prediction modes, m modes are divided into MPM modes and are signaled with truncated unary binarization. According to an embodiment, T can be 67 and m can be 6. In the truncated unary binarization, because the number of bits (or bins) used increases with the increase of the signaling index, the signaling efficiency can be increased by matching the mode that is more likely to be selected in the corresponding block with the low value index. To this end, the encoder and decoder configure the MPM list with the same context conditions, and the derived mode values ​​can be rearranged and signaled based on the context conditions. For example, CABAC-based encoding can be performed by classifying the selected mode in the order of non-angle mode, vertical mode and plane angle mode such as DC / plane mode. Next, s selected modes determined by any context conditions are signaled by fixed-length bits, and the remaining ns non-selected modes are signaled by truncated binary binarization. According to an embodiment, n can be 16 and ns can be 45.

[0101] Figure 8 (d) shows an embodiment of signaling a non-selected mode using truncated binary binarization. According to the above embodiment, the number ns of non-selected modes is 45. When truncated binary binarization is used, because 2^5<45<2^6, 5 bits (or bins) can be used to signal the initial 2^6-45=19 indexes, and 6 bits (or bins) are used to signal the remaining 26 indexes. Therefore, because the preset context condition is also applied to the non-selected mode, the mode that is more likely to be selected in the corresponding block can be matched with the low-value index signaled by 5 bits (or bins). A specific embodiment of the preset context condition will be described with reference to the following figures.

[0102] Fig. 9The method of applying a preset offset to an angle mode is illustrated as an embodiment of applying a context condition to an intra-frame prediction mode. According to an embodiment of the present invention, a new priority can be assigned to an angle mode obtained by adding a preset offset to an angle mode with a specific priority or subtracting a preset offset from an angle mode with a specific priority. For example, a first priority or a second priority can be assigned to an angle mode that adds or subtracts a preset offset relative to an angle mode with a first priority. According to an embodiment, a mode with a first priority among all intra-frame prediction modes is selected in preference to the remaining modes. In addition, the remaining modes are divided into a mode with a second priority and a mode with a third priority, and the mode with the second priority is selected in preference to the mode with the third priority. Here, the preferentially selected mode can be matched with a low-value index that is signaled using fewer bits.

[0103] More specifically, when intra-prediction mode indexes a, b, and c have a first priority, the first priority or the second priority may be assigned to modes of intra-prediction mode indexes a-offset, a+offset, b-offset, b+offset, c-offset, and c+offset (where offset is a non-zero integer). For example, in the MPM list configuration process, the first priority is assigned to a mode selected from a neighboring block, and the first priority or the second priority may be assigned to an angle mode in which -1 or +1 is added to the angle mode among the modes selected from the neighboring blocks. Because the same or next priority is assigned to a mode in which a preset offset is added to or subtracted from a mode of the highest priority, the highest priority may be assigned to a mode having similarity to the highest priority.

[0104] However, reference Fig. 9 , when the angle mode is limited to a preset angle range, the angle mode obtained by adding an offset to or subtracting an offset from a specific angle mode may not be within the preset angle range. For example, when 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 in which the offset is subtracted from intra-prediction mode 2 or intra-prediction mode 67 in which the offset is added to intra-prediction mode 66 is not within the preset angle range. That is, intra-prediction mode k-offset or k+offset derived from intra-prediction mode k may not be within the preset angle range. Therefore, a method for solving this problem is needed.

[0105] According to an embodiment of the present invention, when an angle pattern obtained by adding an offset to or subtracting an offset from a specific angle pattern is outside a preset angle range, an angle pattern cyclically determined from a set of angle patterns in the corresponding range may be selected. That is, when an angle pattern obtained by adding an offset to or subtracting an offset from a specific angle pattern is outside a preset angle range, an angle pattern located on the opposite side of the specific angle pattern may be selected from the set of angle patterns in the corresponding range. For example, when the set of angle patterns in a preset angle range is configured with modes {a, b, c, d, e, f} in ascending order of intra-prediction mode indexes, mode a may be selected by adding offset 1 to mode f, and mode b may be selected by adding offset 2 to mode f. Similarly, mode f may be selected by subtracting offset 1 from mode a, and mode e may be selected by subtracting offset 2 from mode a. Reference Fig. 9 , when an offset is added to the vertical diagonal mode VDIA, the horizontal diagonal mode HDIA or an angle mode near it can be selected. That is, VDIA+1 can match HDIA, and VDIA+2 can match HDIA+1. In addition, HDIA-1 can match VDIA, and HDIA-2 can match VDIA-1.

[0106] According to another embodiment of the present invention, when an angle pattern obtained by adding an offset to or subtracting an offset from a specific angle pattern is outside a preset angle range, the angle pattern obtained by adding or subtracting an offset can be ignored. When a preset offset is added to or subtracted from a specific angle pattern, an angle pattern similar to the specific angle pattern can be selected. However, when selecting an angle pattern determined cyclically as in the previous embodiment, an angle pattern located opposite to the specific angle pattern is selected so that the similarity between the selected angle patterns can be reduced. Therefore, when the angle pattern to which an offset is added or subtracted is outside a preset angle range, the corresponding angle may not be selected. For example, among the modes a-offset, a+offset, b-offset, b+offset, c-offset, and c+offset in which an offset is added to or subtracted from a selected mode {a, b, c}, when the mode c+offset is outside the preset angle range, the modes a-offset, a+offset, b-offset, b+offset, and c-offset other than c+offset can be selected.

[0107] According to another embodiment of the present invention, when an angle pattern obtained by adding or subtracting a first offset to or from a specific angle pattern is outside a preset angle range, an angle pattern obtained by subtracting a second offset from or adding the second offset to the specific angle pattern may be selected. According to another embodiment of the present invention, when an angle pattern obtained by adding or subtracting a first offset to or from a specific angle pattern is outside a preset angle range, an angle pattern obtained by additionally subtracting the second offset from or additionally adding the second offset to the specific angle pattern may be selected. In this case, the second offset has a different value from the first offset. For example, when pattern a+offset1 is outside the preset angle range, pattern a-offset2 or pattern a+offset1-offset2 may be selected. Reference Fig. 9 , where the angle pattern VDIA+1 in which the first offset 1 is added to the already selected vertical diagonal line pattern VDIA may deviate from the preset angle range. In this case, the angle pattern VDIA-2 in which the second offset 2 is subtracted from the angle pattern VDIA may be selected. When the angle pattern selected by applying the second offset overlaps with the already selected angle pattern, a third offset different from the second offset may be used similarly to the above method.

[0108] According to another embodiment of the present invention, when an angle mode obtained by adding a first offset to a specific angle mode or subtracting the first offset from a specific angle mode is outside a preset angle range, an angle mode obtained by adding a second offset to the specific angle mode or subtracting the second offset from the specific angle mode may be selected. In this case, the absolute value of the second offset may be smaller than the absolute value of the first offset. For example, when mode a+offset1 is outside the preset angle range, mode a+offset2 may be selected. More specifically, when the angle modes that have been selected are VDIA and HDIA, VDIA+offset1 may deviate from the preset angle range. Therefore, when the angle modes that have been selected are VDIA and HDIA, VDIA+offset2 may be selected. In addition, referring to Fig. 9 , the angle mode VDIA-1+2 in which the first offset 2 is added to the already selected angle mode VDIA-1 may deviate from the preset angle range. In this case, the angle mode VDIA-1+1 in which the second offset 1 is added to the angle mode VDIA-1 may be selected. When the angle mode selected by applying the second offset overlaps with the already selected angle mode, a third offset different from the second offset may be used similarly to the above method.

[0109] Fig.10The method of configuring the prediction mode list considering the minimum and maximum values ​​of the angle or index of the angle mode already selected in the prediction mode list is illustrated as another embodiment of the context condition applied to the intra prediction mode. In an embodiment of the present invention, the prediction mode list may include an MPM list and a selected mode list, but the present invention is not limited thereto.

[0110] In intra prediction, the intra prediction mode of the current block may be similar to the intra prediction mode of the neighboring block. For example, the angle mode of the current block may be the same as or similar to any one of the angle modes of the neighboring block. Therefore, when there is a first prediction mode list configured for the current block, the second prediction mode list may be configured considering the elements of the first prediction mode list. According to an embodiment, the second prediction mode list may be configured based on the minimum and / or maximum value of the angle or index (i.e., intra prediction mode index) of the angle mode included in the first prediction mode list. The intra prediction mode of the second prediction mode list may be assigned a higher priority than the intra prediction modes other than the first prediction mode list and the second prediction mode list.

[0111] More specifically, when the minimum and maximum values ​​of the angle or index of the angle mode included in the first prediction mode list are "min" and "max", respectively, the angle mode included in the second prediction mode list may be selected within the range of "min" or more and "max" or less, or within the range of greater than "min" and less than "max". According to an embodiment, an angle mode evenly distributed between the minimum and maximum values ​​determined based on the first prediction mode list (i.e., having a constant index difference or a constant angle difference) may be included in the second prediction mode list. In this way, the angle mode included in the second prediction mode list may have a higher priority than an angle mode not included in the first or second prediction mode list.

[0112] According to another embodiment, the angle mode included in the second prediction mode list may be selected in a range of "min-offset1" or more and "min+offset2" or less or in a range greater than "min-offset1" and less than "min+offset2". Here, offset1 and offset2 are preset offsets and are non-negative integers. In addition, offset1 and offset2 may have the same value or different values. According to one embodiment, when offset1 and offset2 are set to the same value and the range configured based on the offset is as follows: Fig. 9According to another embodiment, offset1 and offset2 may be 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, when the angle modes included in the first prediction mode list are not uniformly distributed, offset1 and offset2 may be set to different values. An angle mode uniformly distributed between "min-offset1" and "min+offset2" determined based on the first prediction mode list (i.e., having a constant index difference or a constant angle difference) may be included in the second prediction mode list. For example, when the number of modes selected in the second prediction mode list is n, configuration m=floor(((max+offset2)-(min-offset1)) / (n+1)) and the second prediction mode list may include an angle mode corresponding to an index or angle "min-offset1+m", "min-offset1+2m", ..., "min-offset1+nm". In this way, the angle mode included in the second prediction mode list may have a higher priority than the angle mode not included in the first or second prediction mode list.

[0113] refer to Fig.10 , the first prediction mode list may be an MPM list. In addition, the minimum value and the maximum value of the index of the angle mode included in the MPM list configured according to a preset rule may be referred to as "MPM_min" and "MPM_max", respectively. In this case, as in the above-described embodiment, the second prediction mode list may be configured based on the MPM list taking into account the similarity between the current block and the neighboring block. For example, the second prediction mode list may be configured based on "MPM_min" and "MPM_max". More specifically, an angle mode uniformly distributed (i.e., having a constant index difference or a constant angle difference) between "MPM_min-offset" and "MPM_min+offset" may be included in the second prediction mode list. Here, the offset may be a non-negative integer.

[0114] When the second prediction mode list is configured based on the first prediction mode list as in the above-mentioned embodiment, intra-frame prediction using the first prediction mode list and the second prediction mode list can be performed. According to an embodiment, the second prediction mode list can be used as a selected mode list. According to another embodiment, the second prediction mode list can indicate an intra-frame prediction mode transmitted by an index signal configured with k-1 bits among non-MPM modes transmitted with k-1 or k bits. In addition, the first prediction mode list and the second prediction mode list can refer to the first set and the second set of the same prediction mode list. That is, in the above Fig.10 In an embodiment of the present invention, the first prediction mode list and the second prediction mode list may be replaced by a first set of prediction mode lists and a second set of prediction mode lists, respectively. Here, the prediction mode list may be an MPM list or a selected mode list.

[0115] Fig.11 A method of configuring a prediction mode list in consideration of a basic angle mode is illustrated as another embodiment of a context condition applied to an intra prediction mode. As described above, a plurality of angle modes configuring an intra prediction mode set may include a basic angle mode and an extended angle mode.

[0116] According to an embodiment of the present invention, the prediction mode list may be configured by first considering the basic angle mode. The angle mode included in the prediction mode list may have a higher priority than the angle mode not included in the list. According to an embodiment, the method of configuring the prediction mode list by first considering the basic angle mode may be applied under the condition that the neighboring blocks use the basic angle mode. In addition, the method of configuring the prediction mode list by first considering the basic angle mode may be applied under the condition that the number of neighboring blocks using the basic angle mode is greater than or equal to a threshold.

[0117] In the intra-prediction mode determination step of the encoder, performing rate-distortion (RD) cost calculations for all optional (defined) angle modes may be a burden in terms of complexity. Therefore, in order to reduce the complexity in the intra-prediction mode determination step, the encoder can select the intra-prediction mode by first performing rate-distortion cost calculations only for preset angle modes, e.g., basic angle modes. Next, the encoder can select the intra-prediction mode by additionally performing rate-distortion cost calculations for neighboring angle modes of the selected basic angle mode.

[0118] Considering the similarity between the current block and the neighboring blocks and the embodiments of the encoder implementation described above, it is very likely that the current block uses the basic angle mode. Therefore, it is possible to configure a prediction mode list with priority based on the basic angle mode. When the number of elements in the prediction mode list to be configured is less than the total number of basic angle modes, the prediction mode list can be configured by selecting some basic angle modes. For example, when the number of basic angle modes is 33 and the number of elements in the prediction mode list to be configured is 16, every other basic angle mode can be selected starting from any one of the entire basic angle modes. That is, in Fig.13In the embodiment of the present invention, angle modes 4, 8, 12, 16, ..., 60 and 64 can be selected. According to an embodiment, a prediction mode list configured with a selected intra-frame prediction mode can be used as a selected mode list. As another embodiment of the present invention, the number of elements of the prediction mode list to be configured can be defined based on the number of basic angle modes. For example, when the number of basic angle modes is 33, the number of elements in the prediction mode list to be configured can be defined as 33 or 32 (=33-1).

[0119] As described above, the extended angle mode may be signaled based on the basic angle mode. The extended angle mode may be 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 configured, the extended angle may be signaled by an offset or an on / off mark with reference to the list. More specifically, when the prediction mode list is configured based on the basic angle mode {a, b, c, d}, the offset {offset1, offset2, offset3, offset4} corresponding to each angle mode may be signaled. The angle mode {a+offset 1, b+offset 2, c+offset 3, d+offset 4} may be indicated based on the offset signaled. According to another embodiment, a mark indicating whether the offset corresponding to the basic angle mode is used may be sent separately. For example, a mark corresponding to the basic angle mode a may be sent, and when the value of the mark is 1, the angle mode a+offset1 is indicated, and when the value of the mark is 0, the angle mode a may be indicated.

[0120] Fig.12 The figure shows an embodiment of referring to neighboring blocks for intra prediction of a current block. Fig.12 In the above description, it is assumed that there are a plurality of neighboring blocks adjacent to the left boundary or the upper boundary of the current block. Hereinafter, a method for configuring a prediction mode list of a current block with reference to the neighboring blocks of the current block is described. The prediction mode list includes an MPM list, a selected mode list, and a non-selected mode list itself or some sets thereof, and the present invention is not limited thereto.

[0121] 1) Method for configuring an MPM list (first method). According to an embodiment of the present invention, the MPM list of the current block may be configured in the following manner. When there are multiple neighboring blocks adjacent to the left or upper boundary of the current block, information on the intra prediction mode used in the block may be comprehensively considered. In this case, the neighboring block adjacent to the left or upper boundary of the current block refers to a block adjacent to the left side having a length of the height "Cur_block_height" of the current block or a block adjacent to the upper side having a length of the width "Cur_block_width" of the current block.

[0122] For example, Fig.12 As shown in , when blocks L0 and L1 are adjacent at the left boundary of the current block and blocks A0, A1 and A2 are adjacent at the upper boundary, the MPM list can be configured by referring to the intra prediction mode used in the corresponding block. In this case, the order of the adjacent blocks adjacent to the current block can be configured in the following embodiments.

[0123] According to the first embodiment, the MPM list may be configured in the order of {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 may be configured by sequentially referring to blocks adjacent to the left boundary of the current block and blocks adjacent to the upper boundary. According to the second embodiment, the MPM list may be configured in the order of {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, first refer to 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, and then refer to 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 in sequence, thereby configuring the MPM list. According to the third embodiment, the MPM list can be configured in the order of {mode of block L0, mode of block A0, plane mode, DC mode, mode of block BL, mode of block AR, mode of block AL, mode of block L1, ..., mode of block A1, ...}. That is, first refer to 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, add the plane mode and the DC mode, and then, refer to 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 in sequence, thereby configuring the MPM list. According to another embodiment, an average value or representative value based on the intra-frame prediction mode of the block adjacent to the left boundary or the upper boundary of the current block can be extracted, and by using it, the MPM list can be configured. On the other hand, in the above-mentioned embodiment, the representative block adjacent to the left / upper boundary of the current block may be configured as a block located at a position other than L0 and A0. For example, the block closest to the middle point on the left side and the middle point on the upper side of the current block may be configured as a representative block.

[0124] On the other hand, despite Fig.12, the number of neighboring blocks adjacent to the left boundary or the upper boundary of the current block is shown to be 2 and 3 respectively, and the above embodiment can be extended and applied even when the number of neighboring blocks increases. Moreover, although the above embodiment has been described based on the neighboring blocks on the left and upper sides of the current block, this can be similarly applied to the neighboring blocks located at the lower left BL, upper right AR, and upper left AL of the current block. Fig.13 A specific embodiment thereof is described. If the above method does not fill up the MPM list, the MPM mode can be added to the MPM list by applying a preset offset to the selected angle mode. That is, the angle mode obtained by adding a preset offset to or subtracting a preset offset from an angle mode already selected in the MPM list is added to the MPM list. In this case, the preset offset is an integer other than 0.

[0125] 2) Method for configuring a selected mode list (second method). The selected mode list can be configured based on the intra-frame prediction mode used in the neighboring blocks of the current block. In addition, when configuring the selected mode list, various embodiments regarding the priority of the neighboring blocks described in the first method can be applied. When the selected mode list is not filled up by the above method, the selected mode can be added to the selected mode list by applying a preset offset to the already selected angle mode. That is, the angle mode obtained by adding a preset offset to or subtracting a preset offset from the angle mode already selected in the selected mode list is added to the selected mode list. In this case, the preset offset is an integer other than 0.

[0126] According to another embodiment of the present invention, when the first method is applied, the lower-level mode among the intra-frame prediction modes of the neighboring blocks that is not included in the MPM list can be preferentially included in the selected mode list. When the selected mode list is not filled up by this method, the selected mode can be added to the selected mode list by applying the preset offset to the already selected angle mode. According to another embodiment, the selected mode list can be configured by applying the preset offset (i.e., offset1) to the angle mode of the neighboring block. For example, in any one embodiment of the first method, the following selected mode list can be configured based on an angle mode other than the plane mode and the DC mode. {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 can be determined in various ways. For example, the offset is a positive integer and can be configured so that its value starts from 1 and increases by 1. In addition, the offset is a positive integer, and may be configured such that its value starts from 1 and increases by multiples of 2. Furthermore, the offset may be increased starting from an integer whose initial value is greater than 1, and the ratio of the increase may be extended to multiples of 2 or multiples of 3. Furthermore, the offset may be configured to gradually decrease starting from a preset initial value (e.g., 10).

[0127] 3) Method for configuring a non-selected mode list (third method). Even when the non-selected mode list is configured, the intra-frame prediction mode used in the neighboring block of the current block can be used similarly to the above-mentioned first method. For example, when the non-selected mode list is configured with 45 intra-frame prediction modes and is signaled with truncated binary binarization, the 19 modes of higher level can be signaled with one bit less than the mode after the 20th mode. In other words, the intra-frame prediction modes in the non-selected mode list can be divided into a first set signaled by an index configured with l-1 bits and a second set signaled by an index configured with l bits. In this case, the angle mode selected based on the priority for reference to the neighboring block according to the above-mentioned first method can be included in the first set. When the first set is not filled up in this way, the angle mode obtained by applying a preset offset to the angle mode that has been selected in the first set can be added to the first set.

[0128] According to another embodiment of the present invention, a lower-level mode that is not included in the MPM list and / or the selected mode list among the intra-frame prediction modes of the neighboring blocks may preferably be included in the first set. When the first set is not filled up in this way, the angle mode obtained by applying the preset offset to the angle mode that has been selected in the first set may be added to the first set. According to another embodiment, similar to the second method, the first set may be configured as follows based on the angle mode of the neighboring blocks. {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 configure the first set may be set to a value different from the offset used in the MPM list configuration and the offset (i.e., offset1) used in the selected mode list configuration.

[0129] Fig.13 Another embodiment of referring to neighboring blocks for intra prediction of a current block is shown in FIG. Fig.12 The embodiments can be extended and applied to neighboring blocks located at the lower left BL, upper right AR, and upper left AL of the current block, as well as the left L and upper A of the current block.

[0130] The definition of the neighboring block located to the left or above the current block can be the same as Fig.12The same as the embodiment of the present invention. In addition, the neighboring blocks located on the lower left BL, upper right AR, and upper left AL of the current block may be defined. First, the neighboring block located on the lower left BL of the current block may indicate a block adjacent to a surface extending downward from the left side of the current block by a length of "BL_block_height". In addition, the neighboring block located on the upper right AR of the current block may indicate a block adjacent to a surface extending rightward from the upper side of the current block by a length of "AR_block_width". In the same way, the neighboring block located on the upper left AL of the current block may indicate a block adjacent to a surface extending leftward from the upper side of the current block by a length of "AL_block_width". According to an embodiment, the length of "BL_block_height" may be configured to be equal to the length of "Cur_block_height" or an integer multiple of the length of "Cur_block_height". In addition, the lengths of "AR_block_width" and "AL_block_width" may be configured to be equal to the length of "Cur_block_width", or may be set to an integer multiple of the length of "Cur_block_width". In this case, all available blocks among blocks at corresponding positions may be referenced for intra prediction of the current block. Alternatively, the size of blocks available for reference may be predefined, and only blocks having a size smaller or larger than the corresponding size may be referenced for intra prediction of the current block. In addition, when the current block is a block other than a square, the shape of the neighboring blocks may be different according to the size of the current block.

[0131] For example, Fig.13As shown in , when the neighboring blocks located on the lower left side BL of the current block are BL0, BL1 and BL2, the neighboring blocks located on the upper right AR of the current block are AR0 and AR1, and the neighboring blocks located on the upper left AL of the current block are AL0, AL1 and AL2, the prediction mode list can be configured in the following order. {Mode of block L0, mode of block L1, ..., mode of block A0, mode of block A1, ..., plane mode, DC mode, mode of block BL0, mode of block BL1, mode of block BL2, ..., mode of block AL0, mode of block AL1, ..., mode of block AR0, mode of block AR1, ...}. According to an embodiment of the present invention, the MPM list can be configured based on the configuration order of the prediction mode list. In addition, the selected mode list can be configured using only the angle mode in the prediction mode list, and when the selected mode list cannot be filled, the selected mode can be added to the selected mode list by applying a preset offset to the already selected angle mode. In addition, the first set of the non-selected mode list may be configured using only the angle mode in the prediction mode list, and similarly, when the first set is not filled, the angle mode obtained by applying a preset offset to the angle mode already selected in the first set may be added to the first set. Figure 2 The described embodiment of configuring the prediction mode list considering neighboring blocks can be equally applied to Fig.13 The extended neighboring blocks.

[0132] Fig.14 An embodiment of referring to the MPM list of neighboring blocks for intra prediction of the current block is shown. When configuring the MPM list for the current block, the MPM list of the corresponding block and the intra prediction mode of the neighboring block may be referred to in addition. More specifically, the intra prediction mode of the neighboring block used for intra prediction of the current block, the intra prediction mode included in the MPM list of the neighboring block, the intra prediction mode of the neighboring block of the neighboring block, and the intra prediction mode included in the MPM list of the neighboring block may be referred to. That is, this is not limited to the neighboring blocks of the first step (first layer) of the current block, and the intra prediction mode of the current block may be signaled using the intra prediction information of a larger range of neighboring blocks such as the neighboring blocks of the second step (second layer) and the neighboring blocks of the third step (third layer). Here, the intra prediction information of the block includes at least one of the intra prediction mode of the block and the MPM list information.

[0133] refer to Fig.14, when the left neighboring block of the current block (i.e., neighboring block 1) is coded as an intra-frame prediction mode, the intra-frame prediction mode included in the MPM list of the neighboring block may be prioritized for intra-frame prediction mode signaling of the current block. That is, in order to signal the intra-frame prediction mode of the current block, the modes in the following order may be referred to. {Mode of block L, mode of block A, plane mode, DC mode, mode of block BL, mode of block AR, NB1_MPM0 mode, NB1_MPM1 mode, NB1_MPM2 mode, ..., NB2_MPM0 mode, NB2_MPM1 mode, NB2_MPM2 mode, ...}. Here, the NBx_MPMy mode indicates the intra-frame prediction information of the xth neighboring block of the current block. That is, the NBx_MPMy mode may indicate the intra-frame prediction mode information of the xth neighboring block or the yth intra-frame prediction mode information of the MPM list of the corresponding block. In this case, if the yth mode is a non-angle mode such as a plane mode or a DC mode, the mode may not be considered in the current block.

[0134] According to an embodiment of the present invention, various modifications and combinations can be made to the intra-frame prediction mode information of the neighboring blocks for intra-frame prediction of the current block. For example, the embodiment can be modified or extended based on the shape of the current block (i.e., square block, rectangular block) and the shape of the neighboring blocks, and the ordered pairs can be extended and applied in various combinations. The embodiment of using the intra-frame prediction mode included in the MPM list of the neighboring block for intra-frame prediction mode signaling of the current block can be combined with the above-mentioned embodiment. That is, when at least one of the MPM list of the current block, the set of higher-level modes of the non-MPM mode transmitted by the index configured with k-1 bits, the selected mode list, and the non-selected mode transmitted by the index configured with l-1 bits is configured, the mode included in the MPM list of the neighboring block can be referenced. In addition, when the corresponding list or set is not filled in each case, the angle mode obtained by applying a preset offset to the angle mode already included in the corresponding list or set can be added to the corresponding list or set.

[0135] Fig.15An embodiment is shown in which the shape and / or size of the current block and the neighboring blocks are considered for intra-frame prediction of the current block. When configuring the MPM list of the current block, the intra-frame prediction information of the blocks having a shape and / or size similar to the current block among the neighboring blocks can be preferentially referenced. Here, the intra-frame prediction information includes at least one of the intra-frame prediction mode and the MPM list information. Whether the shapes of the current block and the neighboring blocks are similar can be determined based on whether both blocks are square blocks, whether both blocks are vertical blocks, and whether both blocks are horizontal blocks. When both blocks are vertical blocks or horizontal blocks, the ratio between the width and height of each block can be additionally considered. In addition, in an embodiment of the present invention, the shape of the block is not limited to the above case, and can be extended to uneven rectangular blocks, diagonal blocks, etc.

[0136] More specifically, when the current block is a vertical block, when configuring the MPM list of the current block, the intra prediction information used in the vertical block (i.e., NB_1, NB_a) among the neighboring blocks may be preferentially referenced. In addition, when the size of the current block is 16×32, when configuring the MPM list of the current block, the intra prediction information used in the block of the same size (i.e., NB_1) among the neighboring blocks may be preferentially referenced. An embodiment of signaling the intra prediction mode of the current block in consideration of the shape and / or size of the current block and the neighboring blocks may be combined with the above-mentioned embodiment. That is, when at least one of the MPM list of the current block, a set of higher-level modes signaled by an index configured with k-1 bits among the non-MPM modes, a selected mode list, and a set of higher-level modes of the non-selected modes signaled by an index configured with l-1 bits is configured, it may be preferred to refer to the intra prediction information of a block having a shape and / or size similar to the current block among the neighboring blocks. In addition, when the corresponding list or set is not filled in each case, an angle pattern obtained by applying a preset offset to an angle pattern already included in the corresponding list or set may be added to the corresponding list or set.

[0137] Figures 16 to 18 The diagram illustrates an extended embodiment of obtaining prediction information of a current block with reference to prediction information of neighboring blocks. According to an embodiment of the present invention, the block referenced in signaling the prediction information of the current block may be extended to neighboring blocks adjacent to the current block and neighboring blocks not adjacent to the current block. With reference to each of the accompanying drawings, an embodiment of obtaining intra-frame prediction information of a current block by referring to intra-frame prediction information of neighboring blocks will be described. According to an embodiment, the MPM list of the current block may be configured with reference to intra-frame prediction information of neighboring blocks. However, the present invention is not limited thereto, and each embodiment may be similarly applied to the case of obtaining inter-frame prediction information of a current block by referring to inter-frame prediction information of neighboring blocks. Here, the inter-frame prediction information may include a motion vector, a reference picture index, and the like.

[0138] first, Fig.16 An embodiment of an extended neighboring block referenced to obtain prediction information of a current block is shown. As described above, the MPM list of the current block can be configured using the intra-frame prediction mode of the neighboring blocks by reflecting the regional similarity of the picture. In this case, the neighboring blocks L(1), A(1), BL(1), AR(1) and AL(1) adjacent to the boundary of the current block can be defined as the first step (first layer) neighboring blocks, and the neighboring blocks L(2), A(2), BL(2), AR(2) and AL(2) adjacent to the boundary of each first step neighboring block can be defined as the second step (second layer) neighboring blocks. For example, the lowest block L(1) adjacent to the left boundary of the current block is the first step neighboring block, and the blocks L(2), A(2), BL(2), AR(2) and AL(2) adjacent to the left boundary or upper boundary of the block L(1) are the second step neighboring blocks. In this case, among the blocks adjacent to the first step neighboring blocks, the blocks overlapping with the current block are excluded from the second step neighboring blocks. That is, since the upper right block AR(2) of block L(1) overlaps with the current block, this block is not referenced when configuring the MPM list of the current block. Similarly, since the block BL(2) adjacent to block A(1), the block AR(2) adjacent to block BL(1), and the block BL(2) adjacent to block AR(1) also overlap with the current block, they are not referenced when configuring the MPM list.

[0139] exist Fig.16 In the figure, an embodiment in which up to 25 second-step neighboring blocks are extended for 5 first-step neighboring blocks located on the left or upper side of the current block is illustrated, but the present invention is not limited thereto. That is, for N first-step neighboring blocks located on the left or upper side of the current block, the embodiment of the present invention can be extended to a maximum of N^2 second-step neighboring blocks. In this case, the MPM list of the current block can be configured by referring to the intra-frame prediction modes of up to N^2+N neighboring blocks within a preset range from the current block. Therefore, compared with configuring the MPM list by only referring to the intra-frame prediction modes of N first-step neighboring blocks, the regional characteristics of the picture can be more reflected. In addition, the possibility that the optimal intra-frame prediction mode of the current block exists in the MPM list increases, so that a reduction in the amount of bits required for intra-frame prediction mode coding can be expected.

[0140] In order to determine the exact position of the second-step neighboring block of the current block, the size of the first-step neighboring block and the position information of at least one of the upper left, upper right, lower left and lower right vertices of the corresponding block are required. When the above information is not stored in the encoder and the decoder, the coordinates of each second-step neighboring block can be obtained by adding an offset to the reference coordinates of the first-step neighboring block. For example, when the lower right reference coordinates of block AL(1) are (x0, y0), the reference positions of blocks L(2), A(2), BL(2), AR(2) and AL(2) can be determined as (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, the offset is an integer greater than 0, and the offset in the x-axis direction and the offset in the y-axis direction can be set to the same value or different values. According to another embodiment, the offset can be determined based on the size of the current block. That is, the offset can be configured to be proportional to the size of the current block. For example, if the width and height of the current block are {64, 32}, respectively, the offset in the x-axis direction and the offset in the y-axis direction can be set to {64, 32}, {32, 16}, {16, 8}, {8, 4}, etc. obtained by dividing the width and height by integers, respectively. Because the encoder and the decoder use the same offset according to a predetermined rule, both the encoder and the decoder can refer to the intra-frame prediction mode of the second-step neighboring block at the same position.

[0141] 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 configured, the encoder and the decoder can configure 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 the second step neighboring block. Because the MPM list of the first step neighboring block refers to the prediction mode of the second step neighboring block of the current block when configuring the MPM list, the prediction mode of the second step neighboring block can be included in the MPM list of the first step neighboring block. Therefore, by referring to the MPM list of the first step neighboring block, the prediction mode of the second step neighboring block can be referred to without the search and position calculation processing of the second step neighboring block. On the other hand, 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 the decoder can configure the MPM list of the current block by storing and referring to only the higher-level M intra prediction modes included in the MPM list of the first step neighboring block. For example, if the size of the MPM list is 6, and the intra prediction modes of the 3 MPM indexes (i.e., index = 0, 1, 2) at a higher level are referred to, the MPM list of the current block can be configured by referring to the intra prediction modes of the first step neighboring blocks L(1), A(1), BL(1), AR(1), and AL(1) and the intra predictions indicated by the 3 MPM indexes at a higher level of the MPM list of each block. According to an embodiment, the planar mode and the DC mode can be excluded from the M intra prediction modes at the higher level mentioned above.

[0142] Fig.17 Another embodiment of the extended neighboring block referred to to obtain the prediction information of the current block is shown. According to another embodiment of the present invention, the prediction information of the current block may be obtained using a preset search range based on the current block.

[0143] refer to Fig.17, the second-step neighboring blocks L(2), A(2), BL(2), AR(2) and AL(2) may be defined based on the upper left, lower left and upper right vertex coordinates of the first-step neighboring blocks. In this case, the second-step neighboring blocks may be searched while moving a predetermined step length in the x-axis and / or y-axis direction within the search range. For example, in order to search for the second-step neighboring block L(2) of the first-step neighboring block AL(1) for the current block, the block L(2) may be searched while moving a predetermined step length in the x-axis direction from the lower left coordinate reference point of the block AL(1). In this case, the search may be performed until a block having prediction information different from the prediction information of the block AL(1) is found within the predetermined search range. In addition, in order to search for the second-step neighboring block A(2) of the first-step neighboring block AL(1) for the current block, the block A(2) may be searched while moving a predetermined step length in the y-axis direction from the upper right coordinate reference point of the block AL(1). In the same manner, in order to search for the AL(2), AR(2) and BL(2) blocks, i.e., the second-step neighboring blocks, the second-step neighboring blocks can be searched while moving predetermined step sizes in the x-axis and / or y-axis directions respectively from the upper left, upper right, and lower left coordinate reference points of block AL(1).

[0144] According to an embodiment of the present invention, the search range may be set to a fixed size, such as 16X16, 32X32, 64X64, or may be configured according to the size of the current block. That is, the search range may be configured to be proportional to the width and / or height of the current block. For example, when the size of the current block is 128X128, the search range may be set to 128X128, 64X64, 32X32, 16X16, 8X8, etc. by dividing the block size by an integer. The step size for searching within the search range may be set to a value equal to or greater than the minimum size of the block and less than the search range. For example, when the minimum size of the block in the 64X64 search range is 4X4, the step size may be set to 4, 8, 16, or 32. According to an embodiment of the present invention, searching for prediction information in the search range may be performed until all preset prediction mode lists are filled. That is, when the prediction information searched with the first step size within the search range is included in the prediction mode list and the prediction mode list is not filled, the prediction information searched with the second step size within the search range is added to the prediction mode list. The encoder and decoder can perform the search while increasing the search step size until the prediction mode list is filled. At the same time, because each search range and step size are natural numbers and are used with the same predefined value in the encoder and decoder, both the encoder and decoder can refer to the same prediction mode of the second-step neighboring block.

[0145] Fig.18Another embodiment of an extended neighboring block referenced to obtain prediction information of a current block is shown. When the encoder and decoder recognize the structure of the neighboring block of the current block, that is, the size of the block and the coordinates of the upper left corner of the block, the encoder and decoder can determine the position of the second-step neighboring block relative to the current block. Fig.18 In the sub-blocks shown in , the upper left number indicates the encoding or decoding order, and means that the current block is encoded or decoded for the 15th time.

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

[0147] According to another embodiment of the present invention, when obtaining prediction information of the current block, the frequency of occurrence of the prediction mode in the neighboring blocks may be considered. That is, instead of the prediction mode with low frequency of occurrence in the neighboring blocks, the prediction mode with high frequency of occurrence in the neighboring blocks may be referenced with high priority for prediction of the current block. According to the embodiment, taking into account the frequency of occurrence of each of the prediction mode of the first-step neighboring blocks and the prediction mode of the second-step neighboring blocks, the priority between the prediction modes included in the MPM list of the current block may be determined. Fig.19 This specific embodiment is described.

[0148] Fig.19An embodiment of configuring the priority of an intra-frame prediction mode based on the occurrence frequency of the intra-frame prediction mode of a neighboring block is shown. First, the occurrence frequencies of L(1), A(1), BL(1), AR(1) and AL(1), i.e., the first step neighboring blocks, and L(2), A(2), BL(2), AR(2) and AL(2), i.e., the second step neighboring blocks, are calculated for the current block. The occurrence frequency of the prediction mode of the first step neighboring block and the occurrence frequency of the prediction mode of the second step neighboring block are stored in different lists (i.e., the first list and the second list), and are increased by 1 when the prediction mode of the corresponding step neighboring block is confirmed. For example, if the intra-frame prediction mode of block L(1) is mode 50, the occurrence frequency of mode 50 in the first list is increased by 1, and the occurrence frequency of mode 50 in the second list is not increased. When the calculation of the occurrence frequency of the prediction mode of the first step neighboring block and the second step neighboring block is completed, the final occurrence frequency of each prediction mode can be calculated by the weighted sum of the occurrence frequencies. More specifically, the final occurrence frequency FM of a specific mode i can be calculated as in the following equation 1 i .

[0149] [Equation 1]

[0150]

[0151] Here, FM i (1) is the frequency of occurrence of mode i in the first step neighboring blocks, and FM i (2) is the occurrence frequency of pattern i in the neighboring blocks in the second step, and w 1 and w 2 is the weight.

[0152] For example, refer to Fig.19 , when the occurrence frequencies of the first-step neighboring block and the second-step neighboring block for the intra-frame prediction mode 50 are 2 and 3 respectively, the final occurrence frequency of the intra-frame prediction mode 50 can be calculated as w1*3+w2*2. In this case, a displacement operation can be additionally applied to compensate the weight w 1 and w 2 In addition, the weight w 1 and w 2 can be set to an integer greater than 0 to avoid real number multiplication operations, thereby increasing the proportion of the weighted sum, and the proportion can be corrected by a bit shift operation.

[0153] According to an embodiment of the present invention, the weight w may be determined based on various embodiments. 1 and w 2 According to an embodiment, since the first-step neighboring block is closer to the current block than the second-step neighboring block, w 1 Set to be greater than w2 For example, you can 1 and w 2 are set to 5 and 3 respectively. According to another embodiment, the weight w 1 and w 2 can be variably configured according to the corresponding prediction mode. That is, for all prediction modes in the same list, w 1 and w 2 Rather than being configured equally, they are variably configured according to the prediction mode so that the occurrence of a particular prediction mode can be considered more important. For example, a larger weight can be assigned to {planar mode, DC mode, VER mode, HOR mode, HDIA mode, DIA mode, VDIA mode} with a high probability of occurrence. In addition, a larger weight can be assigned to the basic angle mode than to the extended angle mode. According to another embodiment, the weight w 1 and w 2 It can be variably configured according to the shape of the current block to further increase the priority of a specific angle mode. For example, when the current block is a vertical block, a larger weight can be configured for the VER mode and the angle mode close to the VER mode, and when the current block is a horizontal block, a larger weight can be configured for the HOR mode and the angle mode near the HOR mode. According to another embodiment, the weight w can be variably configured according to the position of the corresponding neighboring block. 1 and w 2 For example, when the priorities between adjacent blocks are configured in the order of {block L, block A, block BL, block AR, block AL}, a high weight can be assigned according to this order. For example, when the prediction mode of block L(2) and block AL(2) is 34, a larger weight is multiplied by block L(2) to add to the occurrence frequency.

[0154] When the weight w is variably configured 1 and w 2 When a specific prediction pattern occurs in each list, the frequency increases by w 1 and w 2 According to one embodiment, the weight w 1 and w 2 can be preconfigured. In this case, since both the encoder and decoder use the same weights w 1 and w 2 , so both the encoder and the decoder can perform the same frequency calculation without additional signaling. According to another embodiment, the weight w can be signaled by an RBSP such as PPS, VPS or SPS. 1 and w 2 information.

[0155] The MPM list of the current block can be configured based on the final occurrence frequency calculated according to the above embodiment. The intra-frame prediction mode with a high occurrence frequency in the neighboring block has a high possibility of being selected in the current block. Therefore, the intra-frame prediction mode with a high final occurrence frequency calculated from the neighboring block can be included in the MPM list of the current block. For example, when the size of the MPM list is m, the MPM list can be configured with a plane mode, a DC mode, and a higher-level m-2 angle mode with a high final occurrence frequency. In addition, when the index in the MPM list is lower, it can be expressed with fewer bits, so that the prediction mode with a high final occurrence frequency can match the smaller MPM index in the MPM list.

[0156] On the other hand, when there are multiple angle modes with the same value of final occurrence frequency other than 0, the occurrence frequency of the corresponding angle mode in the first step neighboring block can be considered first. For example, when the final occurrence frequencies of intra-frame prediction mode 18 and intra-frame prediction mode 50 are the same, a higher priority is assigned to the intra-frame prediction mode with a higher occurrence frequency in the first step neighboring block. According to another embodiment, when there are multiple angle modes with the same value whose final occurrence frequency is not 0, the priority among the corresponding angle modes can be determined according to the shape of the current block. For example, when the current block is a vertical block, a higher priority can be assigned to the angle modes of block A(1), block AR(1) and block AL(1) among the first step neighboring blocks, or a higher priority can be assigned to an angle mode close to a vertical mode.

[0157] According to an embodiment, the MPM indexes of the plane mode and the DC mode in the MPM list may be configured differently according to the intra-frame prediction mode of the first step neighboring block. For example, among the intra-frame prediction modes of the first step neighboring block, when the occurrence frequency of the plane mode and the DC mode is greater than or equal to a threshold value, the plane mode and the DC mode may be matched with MPM indexes 0 and 1. In addition, when the occurrence frequency of the angle mode among the intra-frame prediction modes of the first step neighboring block is greater than or equal to a threshold value, the MPM index of the angle mode may be configured with a value smaller than the MPM index of the plane mode and the DC mode.

[0158] In the above embodiment, when the number of angle modes with a final occurrence frequency other than 0 is less than m-2, one or more of {VER mode, HOR mode, HDIA mode, VDIA mode} can be used to configure the MPM list. In addition, in order to minimize the signaling overhead required for encoding non-MPM modes, prediction modes with high final occurrence frequencies can be used. For example, prediction modes with high final occurrence frequencies can be included in the selected mode list, or can be matched with low-value indexes of non-selected modes that are signaled with fewer bits. According to another embodiment, the selected mode list can be configured using angle modes that are obtained by adding a preconfigured offset to or subtracting a preconfigured offset from an angle mode with a high final occurrence frequency included in the MPM list. In addition, angle modes with a final occurrence frequency other than 0 that are not included in the MPM list, and angle modes obtained by adding a preset offset to or subtracting a preset offset from the corresponding mode can be matched with low-value indexes among non-selected modes that are signaled with fewer bits.

[0159] In the following, the operation of the encoder for encoding the intra prediction mode of the current block based on the occurrence frequency of the intra prediction mode of the neighboring blocks is as follows. First, in order to encode the intra prediction mode of the current block, the encoder checks whether the neighboring blocks of the current block exist and calculates the occurrence frequency of the intra prediction mode of the neighboring blocks. Next, the encoder configures at least one of the MPM list, the selected mode list or the non-selected mode based on the occurrence frequency of the intra prediction mode of the neighboring blocks. In this case, the prediction mode with a high occurrence frequency can be configured to have a high priority. Next, the encoder encodes the MPM tag indicating whether the intra prediction mode of the current block exists in the MPM list of the current block. When the intra prediction mode of the current block does not exist in the MPM list of the current block, the selected mode tag indicating whether the intra prediction mode matches any one of the selected modes is encoded. On the other hand, when the intra prediction mode of the current block exists in the MPM list of the current block (for example, when the value of the MPM tag is 1), the encoder encodes the MPM index corresponding to the intra prediction mode of the current block in the MPM list. In addition, when the intra prediction mode of the current block exists in the selected mode list of the current block (that is, when the value of the MPM flag is 0 and the value of the selected mode flag is 1), the encoder encodes the selected mode index corresponding to the intra prediction mode of the current block in the selected mode list. In other cases, the non-selected mode index corresponding to the intra prediction mode of the current block is encoded.

[0160] In addition, the operation of the decoder for decoding the intra-frame prediction mode of the current block based on the frequency of occurrence of the intra-frame prediction mode of the neighboring blocks is as follows. First, in the process of parsing the symbol of the current block, the MPM mark of the current block is parsed, and when the MPM mark is 0, the other selected mode mark is parsed. Like the encoding process, the decoder checks whether the neighboring blocks of the current block exist and calculates the frequency of occurrence of the intra-frame prediction mode of the neighboring blocks. Next, the decoder configures at least one of the MPM list, the selected mode list or the non-selected mode based on the frequency of occurrence of the intra-frame prediction mode of the neighboring blocks. The method for configuring the MPM list, the selected mode list and the non-selected mode in the decoder is the same as the method in the above-mentioned encoder. When the MPM mark is 1, the decoder decodes the MPM index. When the MPM mark is 0 and the selected mode mark is 1, the decoder decodes the selected mode index. In other cases, the decoder decodes the non-selected mode index to determine the intra-frame prediction mode of the current block. The decoder can use the determined intra-frame prediction mode to perform intra-frame prediction and generate a prediction block.

[0161] Fig. 20 and 21 An embodiment of classifying intra prediction modes into multiple subsets is shown. 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 this increases the amount of bits required for encoding the intra prediction mode. To solve this problem, the intra prediction modes can be classified into multiple subsets, and intra prediction can be performed using the prediction mode set according to the surrounding context of the current block.

[0162] first, Fig. 20 The diagram shows an embodiment of dividing the intra prediction mode into a plurality of subsets. Fig. 20 In an embodiment, the N intra prediction modes of the intra prediction mode set may be classified into M subsets (S) configured with exclusive intra prediction modes. 0 , S 1 ,…S M-1 ).exist Fig. 20 Medium, m i,j Indicates the jth intra prediction mode belonging to the i-th subset. Each subset S i Configured with K i exclusive intra prediction modes, and satisfies the following Equation 2.

[0163] [Equation 2]

[0164]

[0165] In this case, the number of intra prediction modes K configured for each intra prediction mode subset is i Can be different for each subset.

[0166] For example, when the intra-prediction mode set includes a total of 67 intra-prediction modes, the intra-prediction modes may be divided into a horizontal mode set {plane 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 may be 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}. In another embodiment, the intra-prediction modes may be divided into a first subset {plane mode, DC mode, basic angle mode} and a second subset {extended angle mode}.

[0167] Next, Fig.21 Another embodiment of dividing the intra prediction mode into multiple subsets is shown. Fig.21 In an embodiment, the N intra-frame prediction modes of the intra-frame prediction mode set are divided into M subsets (S 0 , S 1 ,…S M-1 ), which includes an intra prediction mode overlapping (or shared) with an exclusive intra prediction mode. According to an embodiment, the shared intra prediction mode may be configured with L intra prediction modes having a higher level of probability of being statistically selected in intra prediction. Fig.21 Medium, cm k indicates the kth shared intra prediction mode belonging to each subset, and m i,j Indicates the jth exclusive intra prediction mode belonging to the i-th subset. Each subset S i Configured with L shared intra prediction modes and L i exclusive intra prediction modes, and satisfies the following Equation 3.

[0168] [Equation 3]

[0169]

[0170] In this case, the exclusive intra prediction mode L included in each intra prediction mode subset i The number of can be different for each subset.

[0171] For example, when the intra-frame prediction mode set includes a total of 67 intra-frame prediction modes, the shared intra-frame prediction mode can be configured with one or more of {plane mode, DC mode, HDIA mode, HOR mode, DIA mode, VER mode, VDIA mode}. By utilizing this, the intra-frame prediction mode can be divided into a first subset {plane mode, DC mode, basic angle mode} and a second subset {plane mode, DC mode, HDIA mode, HOR mode, DIA mode, VER mode, VDIA mode, extended angle mode}. According to another embodiment, the intra-frame prediction mode can be divided into a first subset {plane mode, DC mode, HDIA mode, mode 3, mode 4, ..., mode 33, DIA mode, VER mode, VDIA mode} and a second subset {plane mode, DC mode, HDIA mode, HOR mode, DIA mode, mode 35, mode 36, ..., mode 65, VDIA mode}.

[0172] Fig. 22 An embodiment of signaling an intra prediction mode of a current block using a subset of classified intra prediction modes is shown. According to an embodiment of the present invention, an intra prediction mode subset of a current block may be determined using an intra prediction mode subset used in neighboring blocks of the current block.

[0173] When based on Fig. 20 In an embodiment, when each intra prediction mode subset is configured with an exclusive intra prediction mode, intra prediction mode subset information including intra prediction modes of neighboring blocks may be checked, and the intra prediction mode subset of the current block may be determined using the information. That is, the intra prediction mode subset most commonly used in the neighboring blocks may be assigned as the intra prediction mode subset of the current block. In this case, the intra prediction mode subset of the neighboring blocks with reference to the extension is used. Figures 16 to 18 The embodiments may be additionally applied to obtain prediction information for the current block.

[0174] refer to Fig. 22 First, the 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 is referenced, and then the 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 is referenced, so that the intra prediction mode subset of the current block can be determined. According to one embodiment, based on the reference Fig.19 The described occurrence frequency calculation method applies weights w1 and w2 to the intra prediction mode subset frequency of the first step neighboring block and the intra prediction mode subset frequency of the second step neighboring block, respectively, so that the final occurrence frequency of the intra prediction mode subset can be calculated. In this case, the intra prediction mode subset with the maximum occurrence frequency can be assigned as the intra prediction mode subset of the current block.

[0175] On the other hand, when there are a plurality of intra prediction mode subsets having the same value as the final occurrence frequency other than 0, similar to reference Fig.19 The described embodiments may prioritize the frequency of occurrence in neighboring blocks in the first step, or may select a subset of intra prediction modes based on the shape of the current block.

[0176] Next, according to Fig.21 In an embodiment of the present invention, when each intra prediction mode subset includes a shared intra prediction mode, due to the shared intra prediction mode, there is a case where the intra prediction mode subset cannot be identified only by the intra prediction mode information of the neighboring block. That is, when the intra prediction mode of the neighboring block is one of the shared 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 signaled separately, and the intra prediction mode subset information of the current block should be stored.

[0177] In the above case, according to an embodiment, the index of the intra-frame prediction mode subset of the current block may not be sent separately by signaling. As the number of intra-frame prediction mode subsets increases, the number of bits required to express the intra-frame prediction mode subset index information increases, so that the intra-frame prediction mode subset information of the neighboring block with the shared intra-frame prediction mode can be determined according to a preset rule. For example, when the shared intra-frame prediction mode is used for the neighboring block, the basic subset can be determined as a subset of the intra-frame prediction mode of the neighboring block. Alternatively, the intra-frame prediction mode subset can be determined according to the type of the shared intra-frame prediction mode of the corresponding block. For example, when the shared intra-frame prediction mode used in the neighboring block is a vertical mode, a subset including many angle modes near the vertical mode can be determined as the intra-frame prediction mode subset of the neighboring block. In addition, when the shared intra-frame prediction mode used in the neighboring block is a horizontal mode, a subset including many prediction modes near the horizontal mode can be determined as the intra-frame prediction mode subset of the neighboring block.

[0178] When determining the intra prediction mode subset of the current block, the MPM list and non-MPM mode of the current block may be configured taking into account the priorities within the intra prediction mode subset.

[0179] According to an embodiment, the MPM list may be configured based on the neighboring block position of a preset priority and / or the intra-prediction mode of a preset priority. The prediction mode of the neighboring block having the same intra-prediction mode subset as the current block may be 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, when the plane mode and the DC mode are included in the intra-prediction mode subset of the current block, the intra-prediction mode may be considered in preference to the angle mode. However, in the case where a shared intra-prediction mode is included in the intra-prediction mode subset, if the intra-prediction mode of the neighboring block having a different intra-prediction mode subset from the current block is one of the shared intra-prediction modes, the intra-prediction mode of the neighboring block may be added to the MPM list of the current block according to the preset priority. For example, even 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, the intra prediction mode can also be included in the MPM list of the current block when the intra prediction mode of the left block is one of the shared intra prediction modes.

[0180] According to another embodiment, the MPM list may be configured based on the shape of the current block and the shape of the neighboring blocks. When the current block is a vertical block, a high priority is assigned to the intra prediction mode of a block having the same intra prediction mode subset as the current block among the upper block, the upper right block, and the upper left block, and a vertical mode or an angle mode close to a vertical mode in the current intra prediction mode subset may be preferentially added to the MPM list. According to another embodiment, based on the reference Fig.19 The described occurrence frequency calculation method can configure at least one of the MPM list, the selected mode list or the non-selected mode, taking into account the frequency of the prediction mode included in the intra-frame prediction mode subset of the current block among the prediction mode of the first step neighboring block and the prediction mode of the second step neighboring block of the current block.

[0181] As described above, when N prediction modes are divided into M intra prediction mode subsets and the intra prediction mode subset information of the neighboring block is used to determine the intra prediction mode subset of the current block, an optimal prediction mode list in which unnecessary intra prediction modes are removed from the current block can be configured. Therefore, the possibility that the intra prediction mode of the current block matches the intra prediction mode in the MPM list increases, and the amount of bits required for intra prediction mode signaling can be reduced.

[0182] Fig.23 A detailed embodiment of using a subset of classified intra prediction modes to signal the intra prediction mode of the current block is shown. Fig.23In the embodiment of , it is assumed that the intra-frame prediction mode subset is configured with an exclusive intra-frame prediction mode. More specifically, the 67 intra-frame prediction modes in the intra-frame prediction mode set can be classified into two subsets configured with exclusive intra-frame prediction modes. The two intra-frame prediction mode subsets can be configured with 35 intra-frame prediction modes and 32 intra-frame prediction modes, respectively. For example, the first subset can be configured with {plane mode, DC mode, 33 basic angle modes}, and the second subset can be configured with {32 extended angle modes}. Alternatively, the intra-frame prediction mode can be divided into a horizontal mode set {plane mode, DC mode, mode 2, mode 3, ..., mode 34} and a vertical mode set {mode 35, mode 36, ..., mode 66}.

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

[0184] When the intra prediction mode of the current block is in the MPM list, the MPM flag and the MPM index can be signaled. In this case, the MPM flag is signaled with 1 bit, and the MPM index is compiled with truncated binary binarization and signaled with 1 to 3 bits. This binarized MPM index can be encoded by CABAC. At the same time, when the intra prediction mode of the current block does not exist in the MPM list, the MPM flag can be set to 0, and the intra prediction mode can be encoded using the selected mode and the non-selected mode. When the intra prediction mode matches one of the eight selected modes, the MPM flag, the selected mode flag, and the selected mode index will be 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.

[0185] In the case of 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 can be signaled by coding with truncated binary binarization. When the first subset including 35 intra-frame prediction modes is used for the current block, the number of non-selected modes in the subset can be 23. Because 2^4<23<2^5 is satisfied, the indexes of the 9 modes of the higher level of the non-selected mode can be signaled with 4 bits, and the indexes of the 14 modes of the lower level can be signaled with 5 bits. However, when the second subset including 32 intra-frame prediction modes is used for the current block, the number of non-selected modes in the subset can be 20. Because 2^4<20<2^5 is satisfied, the indexes of the 12 modes of the higher level of the non-selected mode can be signaled with 4 bits, and the indexes of the 8 modes of the lower level can be signaled with 5 bits.

[0186] Fig.24 The diagram illustrates an embodiment of dynamically signaling the intra prediction mode of the current block based on the prediction information of the neighboring blocks. Fig.24 In an embodiment, the MPM mode configuration may be changed according to various conditions. Fig.24 (a) shows a method of changing the MPM configuration according to the type of picture to which the current block belongs. Fig.24 (b) and 24(c) show a method of variably configuring the MPM mode according to the intra prediction mode used in the neighboring block.

[0187] first, Fig.24 (a) illustrates a method of changing the MPM configuration according to the type of picture to which the current block belongs according to an embodiment of the present invention. Regardless of the type of picture to which the block belongs (i.e., I picture, P picture, or P picture), existing configurations such as MPM mode, non-MPM mode, selected mode, and non-selected mode are applied identically. However, according to an embodiment of the present invention, Fig.24 As shown in (a), the MPM configuration method in P pictures and B pictures where neighboring blocks can freely perform inter prediction and intra prediction can be applied differently from the MPM configuration method in I pictures where neighboring blocks perform only intra prediction. For example, the number of MPM modes in P pictures and B pictures can be configured differently from the number of MPM modes in I pictures. That is, the number of MPM modes in P pictures and B pictures can be configured to be smaller than the number of MPM modes in I pictures.

[0188] Next, Fig.24(b) shows an embodiment of the present invention in which the MPM mode is variably configured according to the intra prediction mode used in the neighboring block. 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 in the position of the neighboring block. In this case, the number of positions identified as intra prediction blocks in all search positions (e.g., L, A, BL, AR, and AL) of the neighboring block is indicated as m1. In addition, the number of different intra prediction modes used for intra prediction in all search positions of the neighboring block is indicated as m2. For example, if all search positions of the neighboring block are identified as intra prediction blocks, m1 may have a larger value, but if all intra prediction modes used in each position are the same, m2 is set to 1. According to an embodiment of the present invention, the following variable MPM mode signaling method may be applied based on the values ​​of m1 and / or m2. In each embodiment, Th1, Th2, and Th3 represent a first threshold, a second threshold, and a third threshold, respectively. In this case, Th1<Th2<Th3 may be satisfied.

[0189] 1) When the value of m1 is less than or equal to Th1, the first MPM mode signaling method can be applied. When the number of intra-frame prediction blocks at the position of the neighboring block is Th1 or less, there is a possibility that the context of the intra-frame prediction mode used at the position of the neighboring block or the mode derived therefrom (for example, a preset offset is applied to the angle mode) is irrelevant to the current block. That is, because most neighboring blocks are likely to be inter-frame prediction blocks, the intra-frame prediction of the current block may have a low correlation with the neighboring blocks. In this case, it is appropriate for the MPM mode to signal m intra-frame prediction modes extracted through multiple contexts with equal overhead. Therefore, fixed length coding can be applied to the MPM mode.

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

[0191] 3) When the value of m1 is greater than Th2 but the value of m2 is less than Th3, the third MPM mode signaling method can be applied. Because the number of intra-frame prediction blocks at the position of the neighboring blocks is greater than Th2, but the diversity of the intra-frame prediction modes used is not large, it is necessary to differentially consider the context of the intra-frame prediction mode of the neighboring blocks or the mode derived therefrom. In this case, the signaling method of the MPM mode can be the same as the second method.

[0192] 4) When the value of m1 is greater than Th2 and the value of m2 is also greater than Th3, the fourth MPM mode signaling method can be applied. Because the number of intra-frame prediction blocks at the position of the neighboring blocks is greater than Th2, and therefore, the diversity of the intra-frame prediction modes used is large, it is necessary to equally consider the context of the intra-frame prediction mode of the neighboring blocks or the mode derived therefrom, and signal the value through the MPM mode as much as possible. That is, although there are many neighboring blocks in which intra-frame prediction is performed, because different intra-frame prediction modes are mostly used within the block, the intra-frame prediction of the current block needs to take into account the non-differential signaling of all intra-frame prediction neighboring blocks. In this case, it is appropriate for the MPM mode to signal m intra-frame prediction modes extracted by context with equal overhead, which context considers the intra-frame prediction mode used in the neighboring block and the mode derived therefrom. Therefore, fixed-length encoding can be applied to the MPM mode.

[0193] In the above method, the number m of modes signaled in the MPM mode can be determined based on the derived m1 and m2 values. In addition, the number s of selected modes, the number ns of non-selected modes, and their encoding methods can be determined based on the determined value of m. According to an embodiment, it is appropriate to apply fixed length coding to the selected mode and process the signaling of the subsequent s intra-frame prediction modes configured based on the number m of MPM modes.

[0194] Fig.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 neighboring block. Fig.24 As described in the embodiment of (b), the number of different intra prediction modes used for intra prediction in all search positions of neighboring blocks is indicated as m2. According to another embodiment of the present invention, the following variable MPM mode signaling method may be applied based on the value of m2.

[0195] 5) When the value of m2 is less than or equal to Th1, the fifth MPM mode signaling method can be applied. When the number of intra-frame prediction blocks in the position of the neighboring block is less than or equal to Th1, m can be configured with a smaller number by appropriately reflecting the context of the intra-frame prediction mode or the mode derived therefrom. This is also because when the number of different intra-frame prediction modes of the neighboring blocks is small, even if it is expanded to fill the number of MPM modes, the possibility that the derived mode is different from the prediction mode of the current block is very high. In this case, a small number of m MPM modes extracted by a single or several contexts can be used, and it is appropriate to signal the MPM mode with equal overhead. Therefore, fixed length coding can be applied to the MPM mode.

[0196] 6) When the value of m2 is greater than Th1 but less than Th2, the sixth MPM mode signaling method may be applied. When the number of intra-frame prediction blocks in the position of the neighboring block is greater than a predetermined number, the context of the intra-frame prediction mode used in the position of the neighboring block or the mode derived therefrom needs to be differentially considered. The specific embodiment of the sixth MPM mode signaling method is the same as the second MPM mode signaling method described above.

[0197] 7) When the value of m2 is greater than Th2, the seventh MPM mode signaling method can be applied. Because the number of intra-frame prediction blocks at the position of the neighboring blocks is greater than Th2 and therefore, the diversity of the intra-frame prediction modes used is large, it is necessary to equally consider the context of the intra-frame prediction mode of the neighboring blocks or the mode derived therefrom and signal the value through the MPM mode as much as possible. The specific embodiment of the seventh MPM mode signaling method is the same as the fourth MPM mode signaling method described above.

[0198] In the above method, the number m of modes signaled in the MPM mode can be determined based on the derived m1 value. In addition, the number s of selected modes, the number ns of non-selected modes, and their encoding methods can be determined based on the determined value of m. According to an embodiment, it is appropriate to apply fixed-length encoding to the selected mode and process the signaling of the subsequent s intra-frame prediction modes configured based on the number m of MPM modes.

[0199] Fig.25 An embodiment of variably adjusting the number of MPM modes and signaling the intra prediction mode of the current block based on this is shown. Fig.24 As described, according to the MPM mode signaling method, a small number of MPM modes can be used.

[0200] refer to Fig.25(a), the number of MPM modes is not fixed, but can vary based on the intra prediction mode information of neighboring blocks. Among the total 67 intra prediction modes, two modes can be set as MPM modes and signaled by fixed length coding. The fixed length coding scheme assigns the same priority among the signaling modes. Next, the number s of selected modes can be determined to be 16 or 9, and the selected modes can be signaled by fixed length coding. In this case, since a relatively small number of MPM modes are signaled, the number of selected modes can be set according to the fixed length coding. Fig.25 In the embodiment of (a), the number of selected modes can be increased (i.e., 16) to increase the possibility of signaling the intra prediction mode that is not sent in the MPM mode in the selected mode. However, when signaling is performed in the selected mode, the signaling overhead is the same as the signaling overhead of the method using the existing fixed number of MPM modes, so that according to Fig.25 The embodiment of (b) can reduce the total overhead by reducing the number of selected modes (ie, 9).

[0201] However, in embodiments where the number of selected patterns is reduced, signaling overhead may increase when signaling non-selected patterns. Fig.25 In the embodiment of (b), 56 non-selected modes should be signaled by truncated binary binarization, which is greater than the one with 16 selected modes. Fig.25 In this case, because 2^5<56<2^6, only 5 bits may be used to signal the initial 2^6-56=8 indices of the non-selected mode, and 6 bits may be used to signal the remaining 48 indices. Thus, compared to using 5 bits to signal 15 indices and 6 bits to signal 34 indices, Fig.25 Compared with the non-selected mode (a), it can be seen Fig.25 The signaling overhead of the non-selected mode in (a) is increased.

[0202] In the above embodiments, based on the reference Fig.24 The method described above determines the number m of intra prediction modes signaled in MPM mode. In addition, the number s of selected modes may be determined based on the determined value of m. In addition, the number s of selected modes may be determined based on the following additional conditions.

[0203] First, the number of selected modes can be determined based on the value and context of the intra prediction mode determined as the MPM mode. If the intra prediction mode of the neighboring block is reflected when determining the MPM mode, it is very likely that the intra prediction mode of the current block is signaled by the MPM mode or a selected mode derived therefrom. Therefore, additional intra prediction modes derived from the MPM mode can be obtained, and additional intra prediction modes can be configured and signaled by configuring a relatively small number of selected modes. In this way, the signaling overhead can be reduced by limiting the number of selected modes. However, when determining the MPM mode, a relatively large number of selected modes can be configured and signaled without reflecting the intra prediction mode of the neighboring block and the MPM list is configured with basic angle modes such as plane mode, DC mode, VER mode, and HOR mode. Because the MPM list is configured with a context independent of the neighboring block, the number of selected modes can be increased as much as possible to increase the possibility of including the intra prediction mode of the current block in the selected mode. At the same time, the number of non-selected modes ns is determined by subtracting the number of MPM modes m and the number of selected modes s from the total number of intra prediction modes T.

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

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

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

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

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

Claims

1. A method for processing a video signal, comprising: Receiving intra prediction mode information for a current block, wherein the intra prediction mode information indicates one of a plurality of intra prediction modes included in an intra prediction mode set, wherein the intra prediction mode set includes a plurality of angle modes, and the plurality of angle modes include a basic angle mode and an extended angle mode, wherein the basic angle mode is a mode corresponding to an angle within a preset first 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; When the extended angle mode is used, determining the extended angle mode 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 using the determined extended angle mode, The extended angle mode indicates a mode corresponding to a wide-angle direction outside a preset first angle range. The preset first angle range is an angle range between 45 degrees and -135 degrees in a clockwise direction based on the 12 o'clock direction. The wide-angle direction refers to a direction with an angle greater than 45 degrees or less than -135 degrees in the clockwise direction. Among them, the number of basic angle modes is 65.

2. A video signal processing device, comprising a processor, in, The processor is configured to: Receiving intra prediction mode information for a current block, wherein the intra prediction mode information indicates one of a plurality of intra prediction modes configuring an intra prediction mode set, wherein the intra prediction mode set includes a plurality of angle modes, and the plurality of angle modes include a basic angle mode and an extended angle mode, wherein the basic angle mode is a mode corresponding to an angle within a preset first 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; When the extended angle mode is used, determining the extended angle mode based on a sum of an index of a basic angle mode determined using the intra-frame prediction mode information and a predetermined offset, wherein the sum of an index of the basic angle mode determined using the intra-frame prediction mode information and the predetermined offset represents the extended angle mode; and decoding the current block using the determined extended angle mode, The extended angle mode indicates a mode corresponding to a wide-angle direction outside a preset first angle range. The preset first angle range is an angle range between 45 degrees and -135 degrees in a clockwise direction based on the 12 o'clock direction. The wide-angle direction refers to a direction with an angle greater than 45 degrees or less than -135 degrees in the clockwise direction. Among them, the number of basic angle modes is 65.

3. A video signal encoding device, comprising a processor, in, The processor is configured to: determining intra prediction mode information for a current block, wherein the intra prediction mode information indicates one of a plurality of intra prediction modes configuring an intra prediction mode set, wherein the intra prediction mode set includes a plurality of angle modes, and the plurality of angle modes include a basic angle mode and an extended angle mode, wherein a sum of an index of a basic angle mode corresponding to the extended angle mode and a predetermined offset represents the extended angle mode, and determining whether to use the extended angle mode based on at least one of a shape and a size of the current block; and generating a bit stream including the intra prediction mode information, The extended angle mode indicates a mode corresponding to a wide-angle direction outside a preset first angle range. The preset first angle range is an angle range between 45 degrees and -135 degrees in a clockwise direction based on the 12 o'clock direction. The wide-angle direction refers to a direction with an angle greater than 45 degrees or less than -135 degrees in the clockwise direction. Among them, the number of basic angle modes is 65.

4. A non-transitory computer-readable medium storing a bit stream, the bit stream being decoded by a decoding method, wherein: The decoding method comprises: Receiving intra prediction mode information for a current block, wherein the intra prediction mode information indicates one of a plurality of intra prediction modes configuring an intra prediction mode set, wherein the intra prediction mode set includes a plurality of angle modes, and the plurality of angle modes include a basic angle mode and an extended angle mode, wherein the basic angle mode is a mode corresponding to an angle within a preset first 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; When the extended angle mode is used, determining the extended angle mode based on a sum of an index of a basic angle mode determined using the intra-frame prediction mode information and a predetermined offset, wherein the sum of an index of the basic angle mode determined using the intra-frame prediction mode information and the predetermined offset represents the extended angle mode; and decoding the current block using the determined extended angle mode, The extended angle mode indicates a mode corresponding to a wide-angle direction outside a preset first angle range. The preset first angle range is an angle range between 45 degrees and -135 degrees in a clockwise direction based on the 12 o'clock direction. The wide-angle direction refers to a direction with an angle greater than 45 degrees or less than -135 degrees in the clockwise direction. Among them, the number of basic angle modes is 65.