![]() METHOD AND APPARATUS FOR PROCESSING VIDEO SIGNALS (Machine-translation by Google Translate, not lega
专利摘要:
Method and apparatus to process video signals. A method for processing a video according to the present invention may comprise: generating a plurality of candidates most likely (MPM); determining if there is an MPM candidate identical to an intra-prediction mode of a current block among the plurality of MPM candidates; obtain the intra-prediction mode of the current block, based on a result of the determination; and perform an intra-prediction for the current block, based on the intra-prediction mode of the current block. (Machine-translation by Google Translate, not legally binding) 公开号:ES2711189A2 申请号:ES201930317 申请日:2017-04-04 公开日:2019-04-30 发明作者:Keun Lee Bae;Young Kim Joo 申请人:KT Corp; IPC主号:
专利说明:
[0001] [0002] Method and apparatus to process video signals. [0003] [0004] OBJECT OF THE INVENTION [0005] [0006] The present invention relates to a method and an apparatus for processing video signals. [0007] [0008] BACKGROUND OF THE INVENTION [0009] [0010] Currently, requests for high resolution and high quality images have increased as the definition of high definition (HD) and ultra high definition (UHD) images have increased in various fields of application. However, the higher resolution and image quality data have increasing amounts of data compared to conventional image data. Therefore, when image data is transmitted using a medium such as conventional wireless and wireband broadband networks, or when image data is stored using a conventional storage medium, the cost of transmission and storage increases. To solve these problems that occur with an increase in the resolution and quality of image data, high efficiency image coding / decoding techniques can be used. [0011] [0012] The image compression technology includes various techniques, including: an inter-prediction technique of prediction of a pixel value included in a current instantaneous from an instant before or after the current instantaneous; an intra-prediction technique of predicting a pixel value included in a current instantaneous using pixel information in the current instantaneous; an entropla coding technique for assigning a short code to a value with a high frequency of occurrence and assigning a long code to a value with a low frequency of occurrence; etc. The image data can be effectively compressed using such image compression technology, and can be transmitted or stored. [0013] [0014] Meanwhile, with requests for high resolution images, the requests for stereo image content, which is a new image service, have also increased. A video compression technique is being analyzed to effectively provide stereo image content with high resolution and ultra high resolution. [0015] [0016] It is an object of the present invention to provide a method and an apparatus for efficiently performing intra-prediction for an objective coding / decoding block at encode / decode a video signal. [0017] [0018] An object of the present invention is to provide a method and an apparatus for obtaining an intra-prediction mode of an encoding / decoding target block using a neighboring block adjacent to a target coding / decoding block by encoding / decoding a video signal. . [0019] [0020] An object of the present invention is to provide a method and an apparatus for performing an intra-prediction for a target coding / decoding block based on a plurality of reference lines. [0021] [0022] The technical objects to be achieved by the present invention are not limited to the aforementioned technical problems. And, other technical problems that are not mentioned will be understood clearly by the experts in the matter from the following description. [0023] [0024] DESCRIPTION OF THE INVENTION [0025] [0026] A method and apparatus for decoding a video signal according to the present invention can generate a plurality of Probable Mode (MPM) Candidates, determine whether there is an identical MPM candidate to an intra-prediction mode of a current block. among the plurality of MPM candidates, obtain the intra-prediction mode of the current block, based on a result of the determination, and perform an intra-prediction for the current block, based on the intra-prediction mode of the current block. At this point, the plurality of MPM candidates are generated based on frequencies of occurrence of intra-prediction modes of a plurality of neighboring blocks adjacent to the current block. [0027] [0028] In the method and apparatus for decoding a video signal according to the present invention, the generation of the plurality of MPM candidates can comprise generating a first group of MPM candidates, and generating a second group of MPM candidates. [0029] [0030] In the method and apparatus for decoding a video signal in accordance with the present invention, the second group of MPM candidates can include a MPM candidate having a similar direction to an MPM candidate included in the first group of candidates for MPM. MPM. [0031] [0032] In the method and apparatus for decoding a video signal according to the present invention, the determination of whether there is an MPM candidate identical to an intra-prediction mode of a current block among the plurality of MPM candidates can comprise determining whether the first group of MPM candidates includes an MPM candidate identical to the intra-prediction mode of the current block, and determining whether the second group of MPM candidates includes a candidate from MPM identical to the intra-prediction mode of the current block, when it is determined that the first group of MPM candidates does not include an MPM candidate identical to the intra-prediction mode of the current block. [0033] [0034] In the method and apparatus for decoding a video signal according to the present invention, the plurality of MPM candidates can include an intra-prediction mode having a higher occurrence frequency between intra-prediction modes of a plurality. of neighboring upper blocks adjacent to the current block, and an intra-prediction mode having a higher occurrence frequency between intra-prediction modes of a plurality of neighboring left blocks adjacent to the current block. [0035] [0036] In the method and apparatus for decoding a video signal according to the present invention, the plurality of MPM candidates may include a larger or smaller intra-prediction mode between higher neighboring block intra-prediction modes and modes. of intra-prediction of neighboring blocks. [0037] [0038] In the method and apparatus for decoding a video signal according to the present invention, when it is determined that there is no MPM candidate identical to the intra-prediction mode of the current block among the plurality of MPM candidates, the obtaining of the intra-mode - Current block prediction may comprise decoding a remaining mode, and determining the intra-prediction mode of the current block based on the remaining mode. [0039] [0040] In the method and apparatus for decoding a video signal according to the present invention, the remaining mode can be encoded as a fixed length. [0041] [0042] In the method and apparatus for decoding a video signal according to the present invention, performing the intra-prediction for the current block may comprise selecting a reference line between a plurality of reference lines of the current block, and obtaining a prediction sample for the current block, using the selected reference line. [0043] [0044] In the method and apparatus for decoding a video signal according to the present invention, among the plurality of reference lines, a reference line of order N includes a greater number of reference samples than a reference sample of order ( N-1). [0045] A method and apparatus for encoding a video signal according to the present invention can generate a plurality of Most Probable Mode (MPM) Candidates, determine if there is an MPM candidate identical to an intra-prediction mode of a current block between the plurality of MPM candidates, and coding information indicating whether the MPM candidate is included in the plurality of MPM candidates identical to the intra prediction mode of the current block. At this point, the plurality of MPM candidates are generated based on frequency of occurrence of intra-prediction modes of a plurality of neighboring blocks adjacent to the current block. [0046] [0047] The features briefly summarized above for the present invention are only illustrative aspects of the detailed description of the following invention, but do not limit the scope of the invention. [0048] [0049] Advantageous effects [0050] [0051] According to the present invention, an effective intra-prediction can be performed for a target coding / decoding block. [0052] [0053] According to the present invention, an intra-prediction mode of an encoding / decoding target block can be obtained by using a neighboring block adjacent to a target coding / decoding block. [0054] [0055] According to the present invention, an intra-prediction for a target coding / decoding block can be performed based on a plurality of reference lines. [0056] [0057] The effects obtainable by the present invention are not limited to the aforementioned effects, and other effects not mentioned may be understood clearly by those skilled in the art from the description below. [0058] BRIEF DESCRIPTION OF THE FIGURES [0059] [0060] Figure 1 is a block diagram illustrating a device for encoding a video according to a realization of the present invention. [0061] [0062] Figure 2 is a block diagram illustrating a device for decoding a video according to an embodiment of the present invention. [0063] [0064] Figure 3 is a view illustrating an example of hierarchical partitioning of a codification block based on a tree structure according to an embodiment of the present invention. [0065] [0066] Figure 4 is a view illustrating types of predefined intra prediction modes for a device for encoding / decoding a video according to an embodiment of the present invention. [0067] [0068] Figure 5 is a flow chart briefly illustrating an intra prediction method according to an embodiment of the present invention. [0069] [0070] Figure 6 is a view illustrating a correction method of a prediction sample of a current block based on differential information from neighboring samples according to an embodiment of the present invention. [0071] [0072] Figures 7 and 8 are views illustrating a method of correcting a prediction sample based on a predetermined correction filter according to an embodiment of the present invention. [0073] [0074] Figure 9 is a view illustrating a method of correcting a prediction sample based on displacement in accordance with an embodiment of the present invention. [0075] [0076] Figures 10 to 14 are views illustrating examples of an intra-prediction pattern of a current block according to an embodiment of the present invention. [0077] [0078] Figure 15 is a view illustrating a method of performing prediction using an intra-block copy technique according to an embodiment of the present invention. [0079] Figure 16 shows a range of reference samples for intra prediction according to an embodiment to which the present invention is applied. [0080] [0081] Figures 17 to 19 illustrate an example of filtration in reference samples. [0082] [0083] Figure 20 is a flow chart illustrating a derivation method of an intra-prediction mode of a current block, according to an embodiment of the present invention. [0084] [0085] Figure 21 is a diagram for explaining an example in which an MPM candidate is generated using an intra-prediction mode of a neighboring block adjacent to a current block. [0086] [0087] Figure 22 is a diagram showing an MPM candidate generation example when an intra-prediction mode of an upper neighbor block or a left neighbor block adjacent to a current block is not available. [0088] [0089] Figure 23 is a diagram for explaining an order of obtaining modes of intra-prediction of neighboring blocks. [0090] [0091] Figure 24 shows an example of derivation of an intra-prediction mode of a current block, using 2 groups of MPM candidates. [0092] [0093] Figure 25 shows an example of derivation of an intra-prediction mode of a current block, using 3 groups of MPM candidates. [0094] [0095] Figure 26 exemplifies a plurality of reference sample lines. [0096] [0097] Figure 27 is a flowchart illustrating an intra-prediction embodiment method, using an extended reference line, according to the present invention. [0098] [0099] Figure 28 is a diagram illustrating a plurality of reference lines for a non-square block. [0100] [0101] DESCRIPTION OF A PREFERRED EMBODIMENT OF THE INVENTION [0102] [0103] A variety of modifications can be made to the present invention and there are various Embodiments of the present invention, examples of which will now be provided with reference to the drawings and will be described in detail. However, the present invention is not limited to the same, and exemplary embodiments may be construed as including all modifications, equivalents, or substitutes in a technical concept and a technical scope of the present invention. Similar reference numbers refer to the similar element described in the drawings. [0104] [0105] The terms used in the descriptive memory, 'first', 'second', etc., can be used to describe various components, but the components are not to be construed as being limited to the terms. The terms are used only to differentiate a component from other components. For example, the 'first' component may be named the 'second' component without departing from the scope of the present invention, and the 'second' component may similarly be named the 'first' component. The term 'and / or' includes a combination of a plurality of elements or any one of a plurality of terms. [0106] [0107] It will be understood that when an element is simply referred to as being 'connected to' or 'coupled' to another element without being 'directly connected to' or 'directly coupled to' another element in the present description, it can be 'directly connected' a 'o' directly coupled to another element or being connected to or coupled to another element, which has the other intermediate element between them. In contrast, it should be understood that when an element is called as being "directly coupled" or "directly connected" to another element, there are no intervening elements present. [0108] [0109] The terms used in the present specification are simply used to describe particular embodiments, and are not intended to limit the present invention. An expression used in the singular encompasses the expression of the plural, unless it has a clearly different meaning in the context. In the present specification, it is to be understood that the terms such as "including", "having", etc., are intended to indicate the existence of the characteristics, numbers, stages, actions, elements, parts, or combinations of the same disclosed in the descriptive memory, and is not intended to exclude the possibility that one or more other characteristics, numbers, steps, actions, elements, parts, or combinations of them may exist or be added. [0110] [0111] In the following, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Hereinafter, the same constituent elements in the drawings are indicated by the same reference numbers, and a repeated description of the same will be omitted. the same elements. [0112] [0113] Figure 1 is a block diagram illustrating a device for encoding a video according to a realization of the present invention. [0114] [0115] Referring to Figure 1, the device 100 for encoding a video may include: an instantaneous partitioning module 110, prediction modules 120 and 125, a transform module 130, a quantization module 135, a reorganization module 160, a coding module 165 by entropla, a reverse quantization module 140, a reverse transform module 145, a filter module 150, and a memory 155. [0116] [0117] The constitutional parts shown in Figure 1 are shown independently to represent different feature functions in the device for encoding a video. Therefore, it does not mean that each constitutional part is constituted in a separate hardware or software constitutional unit. In other words, each constitutional part includes each of the constitutional parts listed for convenience. Therefore, at least two constitutional parts of each constitutional part can be combined to form a constitutional part or a constitutional part can be divided into a plurality of constitutional parts to perform each function. The embodiment where each constitutional part is combined with the embodiment where a constitutional part is divided are also included in the scope of the present invention, if it does not depart from the essence of the present invention. [0118] [0119] Also, some of the constituents may not be indispensable constituents that perform essential functions of the present invention but be selective constituents that only improve the performance thereof. The present invention can be implemented by including only the essential constitutional parts to implement the essence of the present invention except the constituents used in improving performance. The structure that includes only the indispensable constituents except the selective constituents used to improve performance only is also included in the scope of the present invention. [0120] [0121] The instantaneous partitioning module 110 can partition an entry snap into one or more processing units. At this point, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The instantaneous partitioning module 110 can partition an instantaneous into combinations of multiple coding units, prediction units, and transform units, and can encode an instantaneous by selecting a combination of units of encoding, prediction units, and transform units with a predetermined criterion (for example, cost function). [0122] [0123] For example, an instantaneous can be partitioned into multiple coding units. A recursive tree structure, such as a quadruple tree structure, can be used to partition an instantaneous into coding units. A coding unit that is partitioned into other coding units with an instantaneous or a larger coding unit such as a root can be partitioned with child nodes corresponding to the number of partitioned coding units. A coding unit that is no longer partitioned into a predetermined limitation serves as a leaf node. That is, when it is assumed that only square partitioning is possible for a coding unit, one coding unit can be partitioned into four other coding units as a maximum. [0124] [0125] Hereinafter, in the embodiment of the present invention, the coding unit can mean a unit that performs coding or a unit that performs decoding. [0126] [0127] A prediction unit can be one of the partitioned partitions in a square or a rectangular shape that has the same size in a single encoding unit, or a prediction unit can be one of the partitioned partitions to have a different shape / size in a single coding unit. [0128] [0129] When a prediction unit subjected to intra prediction is generated based on a coding unit and the coding unit is not the smallest coding unit, intra prediction can be performed without partitioning the coding unit into multiple prediction units NxN. [0130] [0131] The prediction modules 120 and 125 may include an inter prediction module 120 which performs inter prediction and an intra prediction module 125 which performs intra prediction. It can be determined whether to perform inter prediction or intra prediction for the prediction unit, and detailed information (eg, an intra prediction mode, a motion vector, a reference instantaneous, etc.) can be determined according to each prediction method. . At this point, the processing unit subjected to prediction may be different from the processing unit for which the prediction method and detailed content is determined. For example, the prediction method, the prediction mode, etc., can be determined by the prediction unit, and prediction can be made by the transform unit. A residual value (residual block) between the generated prediction block and an original block can be entered into the transform module 130 Also, the prediction mode information, the motion vector information, etc., used for prediction can be encoded with the residual value by the entropla coding module 165 and can be transmitted to a device to decode a video. When using a particular coding mode, it is possible to transmit a video decoding device by encoding the original block as it is without generating the prediction block through the prediction modules 120 and 125. [0132] [0133] The inter-prediction module 120 can predict the prediction unit based on information from at least one of a previous instantaneous or a subsequent instantaneous of the current instantaneous, or it can predict the prediction unit based on information from some encoded regions in the current instantaneous , in some cases. The inter-prediction module 120 may include a reference instantaneous interpolation module, a motion prediction module, and a motion compensation module. [0134] [0135] The reference instantaneous interpolation module may receive reference snapshot information from the memory 155 and may generate pixel information of one pixel whole or less than the entire pixel from the reference snap. In the case of luminance pixels, an interpolation filter based on 8-lead DCT can be used, which has different filter coefficients to generate pixel information of a whole pixel or less than an entire pixel in units of 1/4 pixel . In the case of chrominance signals, an interpolation filter based on 4-lead DCT having a different coefficient for generating pixel information of a whole pixel or less than an integer pixel in units of 1/8 of a pixel can be used. [0136] [0137] The motion prediction module can perform motion prediction based on the reference snapshot interpolated by the reference instantaneous interpolation module. As methods to calculate a motion vector, various methods can be used, such as a full-search-based block adaptation algorithm (FBMA), a three-stage search (TSS), a three-stage search algorithm (NTS), etc. The motion vector can have a motion vector value in units of 1/2 of a pixel or of 1/4 of a pixel based on an interpolation pixel. The motion prediction module can predict a current prediction unit by changing the motion prediction method. As methods of motion prediction, various methods can be used, such as a jump method, a joining method, an AMVP (Advanced Motion Vector Prediction) method, an intra block copy method, etc. [0138] [0139] The intra prediction module 125 can generate a prediction unit based on information of the reference pixel that is neighbor to a current block that is pixel information in the current instantaneous. When the neighbor block of the current prediction unit is a block subjected to inter prediction and therefore a reference pixel is a pixel subjected to inter prediction, the reference pixel included in the block subjected to inter prediction may be replaced by information from reference pixel of a neighboring block subjected to intra prediction. That is, when a reference pixel is not available, at least one reference pixel of available reference pixels can be used instead of information from the unavailable reference pixel. [0140] [0141] Prediction modes in intra prediction can include a directional prediction mode that uses reference pixel information depending on a direction of prediction and a non-directional prediction mode that does not use directional information when predicting. A mode for predicting luminance information may be different from a mode for predicting chrominance information, and for predicting chrominance information, intra prediction information may be used to predict luminance information or expected luminance signal information. [0142] [0143] When performing intra prediction, when the size of the prediction unit is the same as the size of the transform unit, intra prediction can be performed in the prediction unit based on plbles on the left, top left and top of the prediction unit. However, when performing intra prediction, when the size of the prediction unit is different from the size of the transform unit, intra prediction can be performed using a reference pixel based on the transform unit. Also, intra prediction can be used using N x N partitioning for only the smallest coding unit. [0144] [0145] In the intra prediction method, a prediction block can be generated after applying an AIS filter (Intra Adaptive Smoothing) to a reference pixel depending on the prediction modes. The type of the AIS filter applied to the reference pixel may vary. To perform the intra prediction method, an intra prediction mode of the current prediction unit can be predicted from the intra prediction mode of the neighboring prediction unit to the current prediction unit. In the prediction of the prediction mode of the current prediction unit using predicted information from the neighboring prediction unit, when the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the unit of prediction. neighboring prediction, information can be transmitted indicating that the prediction modes of the current prediction unit and the neighboring prediction unit are equal to each other using default flag information. When the prediction mode of the current prediction unit is different from the prediction mode of the neighboring prediction unit, encoding by entropla can be performed to encode information of prediction mode of the current block. [0146] [0147] Also, a residual block may be generated which includes information on a residual value which is a different one between the prediction unit subjected to prediction and the original block of the prediction unit based on prediction units generated by the prediction modules 120 and 125. The residual block generated can be introduced into the transform module 130. [0148] [0149] The transform module 130 can transform the residual block including the information into the residual value between the original block and the prediction unit generated by the prediction modules 120 and 125 using a transform method, such as a discrete cosine transform (DCT). ), discrete sine transform (DST) and KLT. Whether to apply DCT, DST, or KLT to transform the residual block can be determined based on intra prediction mode information of the prediction unit used to generate the residual block. [0150] [0151] The quantization module 135 can quantify values transformed to a frequency domain by the transform module 130. The quantification coefficients may vary depending on the block or importance of an instantaneous one. The values calculated by the quantization module 135 can be provided to the inverse quantization module 140 and the reorganization module 160. [0152] [0153] The reorganization module 160 can rearrange coefficients of quantized residual values. [0154] [0155] Reorganization module 160 can change a coefficient in the form of a two-dimensional block into a coefficient in the form of a one-dimensional vector through a method of coefficient exploration. For example, the reorganization module 160 can scan from a DC coefficient to a coefficient in the high frequency domain a zigzag exploration method to change the coefficients to be in the form of one-dimensional vectors. Depending on the size of the transform unit and the intra prediction mode, vertical direction exploration can be used where the coefficients are explored in the form of two-dimensional blocks in the direction of column or exploration of horizontal direction where the coefficients in block form are explored Two-dimensional in the direction of row instead of zigzag exploration. That is, what exploration method is used between zigzag exploration, Vertical direction scanning and horizontal direction scanning can be determined depending on the size of the transform unit and the intra prediction mode. [0156] [0157] The coding module 165 by entropla can perform entropla coding based on the values calculated by the reorganization module 160. Entrope coding can use various coding methods, for example, exponential Golomb coding, adaptive variable length coding according to context (CAVLC), and adaptive arithmetic binary coding according to context (CABAC). [0158] [0159] Encrypting coding module 165 may encode a variety of information, such as residual value coefficient information and block type information of the encoding unit, prediction mode information, partition unit information, unit information prediction, transform unit information, motion vector information, reference frame information, block interpolation information, filtration information, etc., from the reorganization module 160 and the prediction modules 120 and 125. [0160] [0161] The entrope coding module 165 can encode the coding unit coefficients introduced from the reorganization module 160 by entropla. [0162] [0163] The inverse quantization module 140 can quantize the values quantized by the quantization module 135 in reverse and the inverse transform module 145 can transform the transformed values by the transform module 130 in reverse. The residual value generated by the inverse quantization module 140 and the inverse transform module 145 can be combined with the prediction unit provided by a motion estimation module, a movement compensation module, and the intra prediction module of the modules. 120 and 125 of prediction so that a reconstructed block can be generated. [0164] [0165] The filter module 150 may include at least one of an unlock filter, a displacement correction unit, and an adaptive loop filter (ALF). [0166] [0167] The unblocking filter can eliminate block distortion that occurs due to the boundaries between the blocks in the reconstructed snapshot. To determine whether to perform unblocking, the pixels included in various rows or columns in the block can be a basis for determining whether to apply the unlock filter to the current block. When the unblocking filter is applied to the block, an intense filter or a weak filter can be applied depending on the filtering intensity Unlocking required Also, when applying the unblocking filter, the horizontal direction filtration and vertical direction filtration can be processed in parallel. [0168] [0169] The displacement correction module can correct the displacement with the original instantaneous in units of a pixel in the instantaneous one unlocked. To perform the displacement correction in a particular instantaneous, it is possible to use a displacement application method in consideration of edge information of each pixel or a one-instantaneous pixel partitioning method in the predetermined number of regions, to determine a region to undergo to perform the displacement, and apply the displacement to the determined region. [0170] [0171] Adaptive loop filtering (ALF) can be performed based on the value obtained by comparing the filtered reconstructed snapshot and the original instantaneous snapshot. The pixels included in the snapshot can be divided into predetermined groups, a filter can be determined to be applied to each of the groups, and filtering can be performed individually for each group. The information on whether to apply ALF and a luminance signal can be transmitted by coding units (CU). The filter shape and coefficient of a filter for ALF can vary depending on each block. Also, the filter for ALF in the same form (fixed form) can be applied independently of the characteristics of the target application block. [0172] [0173] The memory 155 can store the reconstructed block or instantaneous calculated through the filter module 150. The stored reconstructed block or instantaneous can be provided to the prediction modules 120 and 125 when performing inter prediction. [0174] [0175] Figure 2 is a block diagram illustrating a device for decoding a video according to an embodiment of the present invention. [0176] [0177] Referring to Figure 2, the device 200 for decoding a video may include: an entrope decoding module 210, a reorganization module 215, a reverse quantization module 220, a reverse transform module 225, modules 230 and 235 of prediction, a filter module 240, and a memory 245. [0178] [0179] When a bit stream of video is input from the device to encode a video, the introduced bit stream can be decoded according to a reverse process of the device for encoding a video. [0180] The entropla decoding module 210 can perform entropla decoding according to an inverse encoding process by the entrope coding module of the device for encoding a video. For example, corresponding to the methods performed by the device to encode a video, various methods can be applied, such as exponential Golomb coding, adaptive variable length coding according to context (CAVLC), and adaptive arithmetic binary coding according to context (CABAC). [0181] [0182] Encrypting decoding module 210 can decode information about intra prediction and inter prediction performed by the device to encode a video. [0183] [0184] The reorganization module 215 may perform reorganization on the entroped decoded bit stream by the entropla decoding module 210 based on the reorganization method used in the device to encode a video. The reorganization module can reconstruct and reorganize the coefficients in the form of one-dimensional vectors to the coefficient in the form of two-dimensional blocks. The reorganization module 215 may receive information related to coefficient scanning performed on the device to encode a video and may perform reorganization by a scanning method in reverse of the coefficients based on the scanning order performed on the device to encode a video . [0185] [0186] The reverse quantization module 220 can perform inverse quantization based on a quantization parameter received from the device to encode a video and the reorganized coefficients of the block. [0187] [0188] The inverse transform module 225 can perform the inverse transform, i.e., inverse DCT, inverse DST, and inverse KLT, which is the inverse process of the transform, ie, DCT, DST, and KLT, performed by the transform module in the result of quantification by the device to encode a video. The inverse transform can be done based on a transfer unit determined by the device to encode a video. The reverse transform module 225 of the device for decoding a video can selectively perform transform schemes (e.g., DCT, DST, and KLT) depending on multiple pieces of information, such as the prediction method, the size of the current block , the direction of prediction, etc. [0189] [0190] The prediction modules 230 and 235 can generate a prediction block based on information about the prediction block generation received from the entrope decoding module 210 and the previously decoded block or instantaneous information. received from memory 245. [0191] [0192] As described above, as the operation of the device to encode a video, when performing intra prediction, when the size of the prediction unit is the same as the size of the transform unit, intra prediction can be performed in the prediction unit based on the pixels located on the left, the top left, and the top of the prediction unit. When performing intra prediction, when the size of the prediction unit is different from the size of the transform unit, intra prediction can be performed using a reference pixel based on the transform unit. Also, intra prediction can be used using N x N partitioning for only the smallest coding unit. [0193] [0194] The prediction modules 230 and 235 may include a prediction unit determination module, an inter prediction module, and an intra prediction module. The prediction unit determination module may receive a variety of information, such as prediction unit information, prediction mode information of an intra prediction method, information on prediction of movement of an inter prediction method, etc., from the entrope decoding module 210, it can divide a current coding unit into prediction units, and can determine whether inter prediction or intra prediction is performed in the prediction unit. Using information required in inter prediction of the current prediction unit received from the device to encode a video, the inter-prediction module 230 can perform inter-prediction in the current prediction unit based on information from at least one of a previous instantaneous or a instant instantaneous of the current instantaneous that includes the current prediction unit. As an alternative, inter prediction can be performed based on information from some regions previously reconstructed in the current instantaneous that includes the current prediction unit. [0195] [0196] To perform inter-prediction, it can be determined for the coding unit which of a hop mode, a join mode, an AMVP mode, and an inter block copy mode is used as the motion prediction method of the unit. prediction included in the coding unit. [0197] [0198] The intra-prediction module 235 can generate a prediction block based on pixel information in the current instantaneous. When the prediction unit is a prediction unit subjected to intra prediction, intra prediction can be performed based on information of the intra prediction mode of the prediction unit received from the device for coding a video. The intra prediction module 235 may include an intra-adaptive smoothing filter (AIS), a reference pixel interpolation module, and a DC filter. The AIS filter performs filtration on the reference pixel of the current block, and whether applying the filter can be determined depending on the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixel of the current block by using the prediction mode of the prediction unit and the AIS filter information received from the device to encode a video. When the prediction mode of the current block is a mode where AIS filtering is not performed, the AIS filter can not be applied. [0199] [0200] When the prediction mode of the prediction unit is a prediction mode in which intra prediction is performed based on the pixel value obtained by interpolating the reference pixel, the reference pixel interpolation module can interpolate the reference pixel to generate the reference pixel of a whole pixel or smaller than a whole pixel. When the prediction mode of the current prediction unit is a prediction mode in which a prediction block is generated without interpolation of the reference pixel, the reference pixel can not be interpolated. The DC filter can generate a prediction block through filtering when the prediction mode of the current block is a CC mode. [0201] [0202] The reconstructed block or instantaneous can be provided to the filter module 240. The filter module 240 may include the unlock filter, the displacement correction module, and the ALF. [0203] [0204] The information on whether or not the unlock filter is applied to the corresponding block or instantaneous and the information about which of an intense filter and a weak filter is applied when the unlock filter is applied can be received from the device to encode a video. The unlock filter of the device for decoding a video can receive information about the unlock filter from the device to encode a video, and can perform unlock filtering in the corresponding block. [0205] [0206] The offset correction module can perform offset correction on the reconstructed snapshot based on the type of offset correction and offset value information applied to an instant when performing encoding. [0207] [0208] The ALF can be applied to the coding unit based on information on whether to apply the ALF, ALF coefficient information, etc., received from the device to encode a video. The ALF information can be provided included in a particular set of parameters. [0209] The memory 245 can store the reconstructed instantaneous or block for use as an instantaneous or reference block, and can provide the reconstructed instantaneous to an output module. [0210] [0211] As described above, in the realization of the present invention, for convenience of explanation, the coding unit is used as a term to represent a unit for coding, but the coding unit can serve as a unit for performing decoding as well as coding. [0212] [0213] Figure 3 is a view illustrating an example of hierarchical partitioning of a coding block based on a tree structure according to an embodiment of the present invention. [0214] [0215] An input video signal is decoded in predetermined block units. A default unit of this type to decode the input video signal is an encoding block. The coding block can be a unit to perform intra / inter prediction, transform and quantification. The coding block can be a square or non-square block having an arbitrary size in a range of 8x8 to 64x64, or it can be a square or non-square block having a size of 128x128, 256x256 or greater. [0216] [0217] Specifically, the coding block can be partitioned hierarchically based on at least one of a quadruple tree and a binary tree. At this point, quadruple tree-based partitioning can mean that a 2Nx2N coding block is partitioned into four NxN coding blocks, and binary tree-based partitioning can mean that one block of coding is partitioned into two blocks of coding. Partitioning based on a binary tree can be done symmetrically or asymmetrically. The partitioned coding block based on the binary tree can be a square block or a non-square block, such as a rectangular shape. Partitioning based on a binary tree can be done in a coding block where quadruple tree-based partitioning is no longer performed. Tree-based quadruple partitioning can no longer be performed on the partitioned coding block based on the binary tree. [0218] [0219] To implement adaptive partitioning based on the quadruple tree or binary tree, you can use information that indicates quadruple tree-based partitioning, information about the size / depth of the coding block that partitioning is allowed based on quadruple tree, information indicating binary tree-based partitioning, information about the size / depth of the codification block that binary-tree-based partitioning is allowed, information about the size / depth of the coding block that partitioning is not allowed based on binary tree, information on whether partitioning based on a binary tree is carried out in a vertical direction or a horizontal direction, etc. [0220] [0221] As shown in Figure 3, the first coding block 300 with the partition depth of k can be partitioned into multiple second blocks of codification based on the quadruple tree. For example, the second coding blocks 310 to 340 can be square blocks that are half the width and half the height of the first coding block, and the partition depth of the second coding block can be increased to k + 1. [0222] [0223] The second block 310 of codification with the partition depth of k + 1 can be partitioned into multiple third coding blocks with the partition depth of k + 2. The partitioning of the second coding block 310 can be done using selectively one of the quadruple tree and the binary tree depending on a partitioning method. At this point, the partitioning method can be determined based on at least one of the information that indicates quadruple tree-based partitioning and the information that indicates binary tree-based partitioning. [0224] [0225] When the second coding block 310 is partitioned based on the quadruple tree, the second coding block 310 may be partitioned into four third coding blocks 310a having half the width and half the height of the second coding block, and the depth The partition of the third block 310a of codification can be increased to k + 2. In contrast, when the second coding block 310 is partitioned based on the binary tree, the second coding block 310 can be partitioned into two third coding blocks. At this point, each of the two third coding blocks can be a non-square block having one half the width and half the height of the second block of coding, and the partition depth can be increased to k + 2. The second block of coding can be determined as a non-square block of a horizontal direction or a vertical direction depending on a partitioning direction, and the direction of partitioning can be determined based on the information on whether binary tree-based partitioning is performed in a direction vertical or a horizontal direction. [0226] Meanwhile, the second coding block 310 can be determined as a sheet coding block that is no longer partitioned based on the quadruple tree or the binary tree. In this case, the sheet coding block can be used as a prediction block or a transform block. [0227] [0228] As the partitioning of the second coding block 310, the third coding block 310a can be determined as a sheet coding block, or it can be further partitioned based on the quadruple tree or the binary tree. [0229] [0230] Meanwhile, the third block 310b of partitioned coding based on the binary tree can be further partitioned into coding blocks 310b-2 of a vertical direction or coding blocks 310b-3 of a horizontal direction based on the binary tree, and depth of The partition of the relevant coding blocks can be increased to k + 3. Alternatively, the third coding block 310b can be determined as a leaf coding block 310b-1 that is no longer partitioned based on the binary tree. In this case, the coding block 310b-1 can be used as a prediction block or a transform block. However, the above partitioning process can be performed in a limited manner based on at least one of the information on the size / depth of the coding block that four-tree-based partitioning is allowed, the information on the size / depth of the coding block that partitioning based on binary tree is allowed, and information about the size / depth of the coding block that partitioning based on binary tree is not allowed. [0231] [0232] Figure 4 is a view illustrating types of predefined intra prediction modes for a device for encoding / decoding a video according to an embodiment of the present invention. [0233] [0234] The device for encoding / decoding a video can perform intra prediction using one of predefined intra prediction modes. Predicted intra prediction modes for intra prediction can include non-directional prediction modes (eg, a planar mode, a CC mode) and 33 directional prediction modes. [0235] [0236] Alternatively, to improve intra prediction accuracy, a greater number of directional prediction modes can be used than the 33 directional prediction modes. That is, M can be defined as extended directional prediction modes by subdividing angles of the modes of directional prediction (M> 33), and a directional prediction mode having a predetermined angle can be derived using at least one of the 33 predefined directional prediction modes. [0237] [0238] Figure 4 shows an example of extended intra prediction modes, and extended intra prediction modes can include two non-directional prediction modes and 65 extended directional prediction modes. The same numbers of the extended intra prediction modes can be used for a luminance component and a chrominance component, or a different number of the intra prediction modes can be used for each component. For example, 67 extended intra prediction modes can be used for the luminance component, and 35 intra-prediction modes can be used for the chrominance component. [0239] [0240] Alternatively, depending on the chrominance format, a different number of intra prediction modes can be used when performing intra prediction. For example, in the case of the 4: 2: 0 format, 67 intra prediction modes can be used for the luminance component to perform intra prediction and 35 intra-prediction modes can be used for the chrominance component. In the case of the 4: 4: 4 format, 67 intra prediction modes can be used for both the luminance component and the chrominance component to perform intra prediction. [0241] [0242] Alternatively, depending on the size and / or shape of the block, a different number of intra prediction modes can be used to perform intra prediction. That is, depending on the size and / or shape of the PU or CU, 35 intra prediction modes or 67 intra prediction modes can be used to perform intra prediction. For example, when the CU or PU has the size smaller than 64x64 or is asymmetrically partitioned, 35 intra prediction modes can be used to perform intra prediction. When the size of the CU or PU is equal to or greater than 64x64, 67 intra prediction modes can be used to perform intra prediction. 65 intra-directional intra-prediction modes can be allowed for intra_2Nx2N, and only 35 intra-directional intra-prediction modes can be allowed for intra_NxN. [0243] [0244] Figure 5 is a flow chart briefly illustrating an intra prediction method according to an embodiment of the present invention. [0245] [0246] Referring to Figure 5, an intra prediction mode of the current block can be determined in step S500. [0247] [0248] Specifically, the intra prediction mode of the current block can be derived based on a list of candidates and an index. At this point, the candidate list contains multiple candidates, and the multiple candidates can be determined based on an intra prediction mode of the neighboring block adjacent to the current block. The neighboring block can include at least one of blocks located at the top, the bottom, the left, the right and the corner of the current block. The Index can specify one of the multiple candidates from the list of candidates. The candidate specified by the Index can be set to the intra prediction mode of the current block. [0249] [0250] An intra prediction mode used for intra prediction in the neighboring block can be established as a candidate. Also, an intra prediction mode that has similar directionality to that of the intra-prediction mode of the neighboring block can be established as a candidate. At this point, the intra prediction mode having similar directionality can be determined by adding or subtracting a predetermined constant value to or from the intra prediction mode of the neighboring block. The predetermined constant value can be an integer number, such as one, two or greater. [0251] [0252] The candidate list can additionally include a default mode. The default mode can include at least one of a planar mode, a CC mode, a vertical mode, and a horizontal mode. The default mode can be added adaptively considering the maximum number of candidates that can be included in the list of candidates of the current block. [0253] [0254] The maximum number of candidates that can be included in the list of candidates can be three, four, five, six or more. The maximum number of candidates that can be included in the candidate list can be a fixed value pre-set in the device to encode / decode a video, or it can be determined in a variable manner based on a characteristic of the current block. The characteristic can mean the location / size / shape of the block, the number / type of the intra prediction modes that the block can use, etc. As an alternative, the information indicating the maximum number of candidates that can be included in the candidate list can be signaled separately, and the maximum number of candidates that can be included in the candidate list can be determined in a variable manner using the information. The information indicating the maximum number of candidates can be signaled in at least one of a sequence level, an instantaneous level, a cut level, and a block level. [0255] [0256] When the extended intra-prediction modes and the predefined intra-prediction modes are used selectively, the intra-prediction modes of the neighboring blocks can be transformed into Indices corresponding to the extended intra-prediction modes, or Indices that correspond to the 35 intra prediction modes, by means of which the candidates can be derived. To transform to an Index, a predefined table can be used, or an escalation operation can be used based on a predetermined value. At this point, the predefined table can define a mapping relationship between different groups of intra-prediction modes (for example, extended intra-prediction modes and 35 intra-prediction modes). [0257] [0258] For example, when the left neighbor block uses the 35 intra prediction modes and the intra prediction mode of the left neighbor block is 10 (a horizontal mode), it can be transformed into an Index of 16 corresponding to a horizontal mode in the modes of intra prediction extended. [0259] [0260] Alternatively, when the upper neighboring blocks use the extended intra prediction modes and the intra prediction mode of the upper neighboring blocks has an Index of 50 (a vertical mode), it can be transformed into an Index of 26 corresponding to a vertical mode in the 35 modes of intra prediction. [0261] [0262] Based on the previously described method of determination of the intra prediction mode, the intra prediction mode can be derived independently for each of the luminance component and the chrominance component, or the intra prediction mode of the chrominance component can be derived depending of the intra prediction mode of the luminance component. [0263] [0264] Specifically, the intra prediction mode of the chrominance component can be determined based on the intra prediction mode of the luminance component as shown in the following Table 1. [0265] [0266] [Table 1] [0267] [0268] [0269] In Table 1, intra_chroma_pred_mode means information signaled to specify the intra prediction mode of the chrominance component, and IntraPredModeY indicates the intra prediction mode of the luminance component. [0270] [0271] Referring to Figure 5, a reference sample for intra prediction of the current block can be derived in step S510. [0272] [0273] Specifically, a reference sample for intra prediction can be derived based on a neighbor sample of the current block. The neighbor sample may be a reconstructed sample of the neighbor block, and the reconstructed sample may be a reconstructed sample before a loop filter or reconstructed sample is applied after the loop filter is applied. [0274] [0275] A neighbor sample reconstructed before the current block can be used as the reference sample, and a neighboring sample filtered based on a predetermined intra filter can be used as the reference sample. The intra-filter may include at least one of the first intra-filter applied to multiple neighboring samples located on the same horizontal line and the second intra-filter applied to multiple neighboring samples located on the same vertical line. Depending on the positions of the neighboring samples, one of the first intra-filter and the second intra-filter can be applied selectively, or both intra-filters can be applied. [0276] [0277] The filtration can be performed adaptively based on at least one of the intra prediction mode of the current block and the size of the transform block for the current block. For example, when the intra prediction mode of the current block is CC mode, vertical mode, or horizontal mode, filtration can not be performed. When the size of the transform block is NxM, filtration can not be performed. At this point, N and M can be the same values or different values, or they can be values of 4, 8, 16 or greater. Alternatively, filtration can be performed adaptively based on the result of a comparison of a predefined threshold and the difference between the intra prediction mode of the current block and the vertical mode (or the horizontal mode). For example, when the difference between the intra prediction mode of the current block and the vertical mode is greater than a threshold, filtration can be performed. The threshold can be defined for each size of the transform block as shown in Table 2. [0278] [0279] [Table 2] [0280] [0281] [0282] The intra-filter can be determined as one of multiple intra-filter candidates predefined in the device to encode / decode a video. For this purpose, an index specifying an intra-filter of the current block among the multiple intra-filter candidates can be signaled. Alternatively, the intra filter can be determined based on at least one of the size / shape of the current block, the size / shape of the transform block, information about the filter intensity, and variations of the neighboring samples. [0283] [0284] Referring to Figure 5, intra prediction can be performed using the intra prediction mode of the current block and the reference sample in step S520. [0285] [0286] That is, the prediction sample of the current block can be obtained using the intra prediction mode determined in step S500 and the reference sample derived in step S510. However, in the case of intra prediction, a limit sample from the neighboring block can be used, and therefore the quality of the prediction instantaneous can be reduced. Therefore, a correction process can be performed on the prediction sample generated through the prediction process described above, and will be described in detail with reference to Figures 6 through 14. However, the correction process is not limited to that applies only to the intra prediction sample, and can be applied to an inter prediction sample or to the reconstructed sample. [0287] [0288] Figure 6 is a view illustrating a method of correcting a prediction sample of a current block based on differential information from neighboring samples according to an embodiment of the present invention. [0289] [0290] The prediction sample of the current block can be corrected based on the differential information of multiple neighboring samples for the current block. The correction can be made in all the prediction samples in the current block, or it can be done in prediction samples in some predetermined regions. Some regions may be one row / column or multiple rows / columns, or they may be preset regions for correction in the device to encode / decode a video, or they may be determined variably based on at least one of the size / shape of the current block and the intra prediction mode. [0291] [0292] The neighboring samples can belong to the neighboring blocks located in the upper part, the left and the upper left corner of the current block. The number of neighboring samples used for correction can be two, three, four or more. The positions of neighboring samples they can be determined in a variable way depending on the position of the prediction sample which is the correction objective in the current block. Alternatively, some of the neighboring samples may have fixed positions independently of the position of the prediction sample that is the correction target, and the remaining neighboring samples may have variable positions depending on the position of the prediction sample that is the target of correction. [0293] [0294] The differential information of the neighboring samples can mean a differential sample between the neighboring samples, or it can mean a value obtained by scaling the differential sample by a predetermined constant value (for example, one, two, three, etc.). At this point, the predetermined constant value can be determined by considering the position of the prediction sample which is the correction target, the position of the column or row that includes the prediction sample that is the correction target, the position of the sample of prediction in the column or row, etc. [0295] [0296] For example, when the intra-prediction mode of the current block is vertical mode, differential samples can be used between the upper left neighbor sample p (-1, -1) and neighboring samples p (-1, y) adjacent to the left end of the block. Current block to obtain the final prediction sample as shown in Equation 1. [0297] [0298] [Equation 1] [0299] [0300] [0301] [0302] [0303] For example, when the intra-prediction mode of the current block is the horizontal mode, differential samples can be used between the upper left neighbor sample p (-1, -1) and neighboring samples p (x, -1) adjacent to the upper limit of the Current block to obtain the final prediction sample as shown in Equation 2. [0304] [0305] [Equation 2] [0306] [0307] [0308] [0309] [0310] For example, when the intra-prediction mode of the current block is vertical mode, differential samples can be used between the upper left neighbor sample p (-1, -1) and samples neighbors p (-1, y) adjacent to the left limit of the current block to obtain the final prediction sample. At this point, the differential sample can be added to the prediction sample, or the differential sample can be scaled by a predetermined constant value, and then added to the prediction sample. The predetermined constant value used when scaling can be determined differentially depending on the column and / or row. For example, the prediction sample can be corrected as shown in Equation 3 and Equation 4. [0311] [0312] [Equation 3] [0313] [0314] [0315] [0316] [0317] [Equation 4] [0318] [0319] [0320] [0321] [0322] For example, when the intra-prediction mode of the current block is the horizontal mode, differential samples can be used between the upper left neighbor sample p (-1, -1) and neighboring samples p (x, -1) adjacent to the upper limit of the Current block to obtain the final prediction sample, as described in the case of vertical mode. For example, the prediction sample can be corrected as shown in Equation 5 and Equation 6. [0323] [0324] [Equation 5] [0325] [0326] [0327] [0328] [0329] [Equation 6] [0330] [0331] [0332] [0333] [0334] Figures 7 and 8 are views illustrating a correction method of a prediction sample based on a predetermined correction filter according to an embodiment of the present invention. [0335] [0336] The prediction sample can be corrected based on the neighbor sample of the sample of prediction that is the correction objective and a default correction filter. At this point, the neighboring sample can be specified by an angular line of the directional prediction mode of the current block, or it can be at least one sample located on the same angular line as the prediction sample that is the correction target. Also, the neighbor sample can be a prediction sample in the current block, or it can be a reconstructed sample in a neighboring block reconstructed before the current block. [0337] [0338] At least one of the number of derivations, intensity, and a filter coefficient of the correction filter can be determined based on at least one of the position of the prediction sample which is the correction objective, if the prediction sample that is the objective of correction is located or not in the limit of the current block, the intra prediction mode of the current block, the angle of the directional prediction mode, the prediction mode (inter or intra mode) of the neighboring block, and the size / shape of the block current. [0339] [0340] Referring to Figure 7, when the directional prediction mode has an index of 2 or 34, at least one predicted / reconstructed sample can be used located in the lower left of the prediction sample which is the correction target and the default correction filter to obtain the final prediction sample. At this point, the predicted / reconstructed sample in the lower left can belong to a previous line of a line that includes the prediction sample that is the objective of correction. The predicted / reconstructed sample in the lower left can belong to the same block as the current sample, or to the neighboring block adjacent to the current block. [0341] [0342] The filtration for the prediction sample can be done only on the line located at the block boundary, or it can be done on multiple lines. The correction filter where at least one of the number of filter derivations and a filter coefficient can be used is different for each of the lines. For example, a filter (1/2, 1/2) can be used for the first left line closest to the block boundary, a filter (12/16, 4/16) can be used for the second line, a filter can be used (14/16, 2/16) for the third line, and a filter (15/16, 1/16) can be used for the fourth line. [0343] [0344] Alternatively, when the directional prediction mode has an index of 3 to 6 or 30 to 33, filtration can be performed on the block limit as shown in Figure 8, and a 3-derivation correction filter can be used to correct the sample of prediction. Filtration can be done using the sample from the lower left of the prediction sample that is the correction target, the sample from the bottom of the sample from the bottom left, and a 3-derivation correction filter that takes as input the prediction sample that is the correction objective. The neighbor sample position used by the correction filter can be determined differentially based on the directional prediction mode. The filter coefficient of the correction filter can be determined differently depending on the directional prediction mode. [0345] [0346] Different correction filters may be applied depending on whether the neighboring block is encoded in the inter mode or the intra mode. When the neighbor block is encoded in the intra mode, a filtration method can be used where more weight is given to the prediction sample, as compared to when the neighboring block is encoded in the inter mode. For example, in the case that the intra prediction mode is 34, when the neighbor block is coded in the inter mode, a filter (1/2, 1/2) can be used, and when the neighboring block is coded in the intra mode, a filter can be used (4/16, 12/16). [0347] [0348] The number of lines to be filtered in the current block may vary depending on the size / shape of the current block (for example, the block of codification or the block of prediction). For example, when the size of the current block is equal to or less than 32x32, filtering can be done in only one line at the block limit; otherwise, filtering can be performed on multiple lines that include the line at the block limit. [0349] [0350] Figures 7 and 8 are based on the case where the intra prediction modes are used in Figure 4, although they can be applied in an equal / similar manner to the case where the extended intra prediction modes are used. [0351] [0352] When performing intra prediction in a current block based on a directional intra prediction mode, a generated prediction sample may not reflect the characteristics of an original snapshot since a range of reference samples that is used is limited (eg, performs intra prediction only using neighboring samples adjacent to the current block). For example, when there is an edge in a current block or when a new object appears around a limit of the current block, a difference between a prediction sample and an original snapshot may be large depending on a position of a prediction sample in the current block. [0353] [0354] In this case, a residual value is relatively large, and therefore the number of bits to be encoded / decoded may increase. Particularly, a residual value in a region relatively far from a limit of the current block may include a large number of components high frequency, which can result in the degradation of the coding / decoding efficiency. [0355] [0356] To solve the above problems, a method of generation or updating a prediction sample in sub-block units can be used. Accordingly, the prediction accuracy in a region relatively far from a block limit can be improved. [0357] [0358] For convenience of explanation, in the following embodiments, a prediction sample generated based on a directional intra-prediction mode is referred to as a first prediction sample. Also, a prediction sample generated based on a non-directional intra-prediction mode or a prediction sample generated by performing inter-prediction can also be included in a category of the first prediction sample. [0359] [0360] A correction method of the prediction sample based on displacement will be described in detail with reference to Figure 9. [0361] [0362] Figure 16 is a view illustrating a method of correcting a prediction sample based on displacement according to an embodiment of the present invention. [0363] [0364] Referring to Figure 9, for a current block, whether updating a first prediction sample using a displacement can be determined in step S900. If updating the first prediction sample using the offset can be determined by a decoded flag from a bit stream. For example, a syntax 'is_sub_block_refinement_flag' indicating whether updating the first prediction sample using the offset can be signaled through a bit stream. When a value of is_sub_block_refinement_flag is 1, the method of updating the first prediction sample using the offset in the current block can be used. When a value of is_sub_block_refinement_flag is 0, the method of updating the first prediction sample using the offset in the current block can not be used. However, step S900 is intended to perform selectively the update of the first prediction sample, and is not an essential configuration for achieving the purpose of the present invention, so that step S900 may be omitted in some cases. [0365] [0366] When it is determined that the method of updating the first prediction sample using the offset is used, an intra prediction pattern of the current block can be determined in step S910. Through the intra prediction pattern, all or some regions of the current block to which the displacement is applied can be determined, a type of block partition current, whether to apply the offset to a sub-block included in the current block, a size / sign of the offset assigned to each sub-block, etc. [0367] [0368] One of multiple predefined patterns in the device for encoding / decoding a video can be used selectively as the pattern of intra prediction of the current block, and for this purpose, an Index that specifies the intra-prediction pattern of the current block can be signaled from a bit stream As another example, the intra-prediction pattern of the current block can be determined based on a partition mode of a prediction unit or a coding unit of the current block, a block size / shape, if the directional intra-prediction mode is used , an angle of the directional intra prediction mode, etc. [0369] [0370] It is determined by default flag information signaled by a bit stream whether or not an index is signaled indicating the intra-prediction pattern of the current block. For example, when the flag information indicates that the index indicating the intra-prediction pattern of the current block is signaled from a bit stream, the intra-prediction pattern of the current block can be determined based on an index decoded from a bitstream. . At this point, the flag information can be signaled in at least one of an instantaneous level, a cut level and a block level. [0371] [0372] When the flag information indicates that the index indicating the intra prediction pattern of the current block is not signaled from a bit stream, the intra prediction pattern of the current block can be determined based on the partition mode of the prediction unit or the coding unit of the current block, etc. For example, the pattern in which the current block is partitioned into sub-blocks may be the same as the pattern in which the block of coding is partitioned into prediction units. [0373] [0374] When the intra prediction pattern of the current block is determined, the offset can be obtained in sub-block units in step S920. The displacement can be signaled in units of a cut, a unit of coding, or a unit of prediction. As another example, the offset can be derived from a neighbor sample of the current block. The offset may include at least one of offset value information and offset sign information. At this point, the displacement value information may be in a range of integer numbers equal to or greater than zero. [0375] [0376] When displacement is determined, a second prediction sample can be obtained for each sub-block in step S930. The second sample of prediction can be obtained applying the displacement to the first prediction sample. For example, the second prediction sample can be obtained by adding or subtracting the offset to or from the first prediction sample. [0377] [0378] Figures 10 to 14 are views illustrating examples of an intra-prediction pattern of a current block according to an embodiment of the present invention. [0379] For example, in the example shown in Figure 10, when the index is '0' or '1', the current block can be partitioned into upper and lower sub-blocks. The offset can not be set to the upper sub-block, and the offset 'f can be set to the lower sub-block. Therefore, the first prediction sample (P (i, j)) can be used as it is in the upper subblock, and the second prediction sample (P (i, j) + fo P (i, j) -f) that is generated by adding or subtracting the offset to or from the first prediction sample can be used in the lower subblock. In the present invention, 'not established' can mean that the offset is not assigned to the block, or the offset having the value of '0' to the block can be assigned. [0380] [0381] When the index is '2' or '3', the current block is partitioned into left and right sub-blocks. The offset can not be set for the left sub-block, and the offset 'f can be set for the right sub-block. Therefore, the first prediction sample (P (i, j)) can be used like this in the left sub-block, and the second prediction sample (P (i, j) + fo P (i, j) - f) that is generated by adding or subtracting the offset to or from the first prediction sample can be used in the right sub-block. [0382] [0383] The range of available intra prediction patterns can be limited based on the intra prediction mode of the current block. For example, when the intra prediction mode of the current block is a vertical direction intra prediction mode or a prediction mode in a direction similar to the vertical direction intra prediction mode (for example, among the 33 directional prediction modes, when the intra prediction mode has an Index of 22 to 30), only the intra prediction pattern that partitions the current block into a horizontal direction (for example, Index 0 or Index 1 in Figure 17) can be applied to the block current. [0384] [0385] As another example, when the intra prediction mode of the current block is an intra-prediction mode of horizontal direction or a prediction mode in a direction similar to the intra-prediction mode of horizontal direction (for example, among the 33 modes of directional prediction , when the intra prediction mode has an Index of 6 to 14), only the intra prediction pattern that partitions the current block into a vertical direction (for example, Index 2 or Index 3 in Figure 17) can be applied to the current block. [0386] In Figure 10, the offset is not set for one of the sub-blocks included in the current block, but is set for the other. Whether to set the offset for the sub-block can be determined based on information signaled for each sub-block. [0387] [0388] Whether to establish the offset for the sub-block can be determined based on a position of the sub-block, an Index to identify the sub-block in the current block, etc. For example, based on a predetermined limit of the current block, the offset can not be established for the sub-block that is adjacent to the predetermined limit, and the offset can be set for the sub-block that is not adjacent to the predetermined limit. [0389] [0390] When it is assumed that the default limit is the upper limit of the current block, under the pattern of intra prediction corresponding to the index '0' or '1', the offset can not be established for the sub-block that is adjacent to the upper limit of the current block, and the offset can be set for the sub-block that is not adjacent to the upper limit of the current block. [0391] [0392] When the default limit is assumed to be the left limit of the current block, under the intra prediction pattern corresponding to the '2' or '3' index, the offset can not be established for the sub-block that is adjacent to the left end of the block. current block, and the offset can be set for the sub-block that is not adjacent to the left limit of the current block. [0393] [0394] In Figure 10, it is assumed that the offset is not established for one of the sub-blocks included in the current block but that the offset is established for the other. As another example, different offset values can be set for the sub-blocks included in the current block. [0395] [0396] An example where different offset is established for each sub-block will be described with reference to Figure 11. [0397] [0398] Referring to Figure 11, when the index is' 0 'or' 1 ', the offset' h 'can be set for the upper sub-block of the current block, and the offset' f can be set for the lower sub-block of the block. current block. Therefore, the second prediction sample (P (i, j) + ho P (i, j) -h) can be generated by adding or subtracting the displacement 'h' to or from the first prediction sample in the upper sub-block , and the second sample of prediction (P (i, j) + fo P (i, j) -f) can be generated by adding or subtracting the displacement 'fao from the first prediction sample. [0399] [0400] Referring to Figure 11, when the index is' 2 'or' 3 ', the offset' h 'can be set for the left sub-block of the current block, and the offset' f can be set for the right sub-block of the block. current block. Therefore, the second prediction sample (P (i, j) + ho P (i, j) -h) can be generated by adding or subtracting the displacement 'h' to or from the first prediction sample that can be in the sub -block left, and the second prediction sample (P (i, j) + fo P (i, j) -f) can be generated by adding or subtracting the displacement 'fao from the first prediction sample in the right sub-block. [0401] [0402] In Figures 10 and 11, the current block is partitioned into two sub-blocks that have the same size, but the number of sub-blocks and / or the size of sub-blocks included in the current block is not limited to the examples shown in Figures 10 and 11. The number of sub-blocks included in the current block may be three or more, and the sub-blocks may have different sizes. [0403] [0404] When multiple intra prediction patterns are available, the available intra prediction patterns can be grouped into multiple categories. In this case, the pattern of intra prediction of the current block can be selected based on a first index to identify a category and a second index that identifies a pattern of intra prediction in the category. [0405] [0406] An example where the pattern of intra prediction of the current block is determined based on the first Index and the second Index will be described with reference to Figure 12. [0407] [0408] In the example shown in Figure 12, 12 intra prediction patterns can be classified into three categories including each of four intra prediction patterns. For example, the intra prediction patterns that correspond to Indices 0 to 3 can be classified as a 0 category, the intra prediction patterns that correspond to Indices 4 to 7 can be classified as a category 1, and the intra prediction patterns that correspond to Indices 8 to 11 can be classified as a category 2. [0409] [0410] The device for decoding a video can decode the first index from a bitstream to specify the category that includes at least one pattern of intra prediction. In the example shown in Figure 12, the first Index can specify one of the categories 0, 1, and 2. [0411] When the category is specified based on the first index, the intra prediction pattern of the current block can be determined based on the second index decoded from a bit stream. When category 1 is specified by the first Index, the second Index can specify one of the four intra prediction patterns (ie, Index 4 to Index 7) of category 1. [0412] [0413] In Figure 12, it shows that the categories include the same numbers of intra prediction patterns. Although there is no need for the categories to include the same numbers of intra prediction patterns. [0414] [0415] The number of intra prediction patterns available or the number of categories can be determined in units of a sequence or a cut. Also, at least one of the number of intra prediction patterns available and the number of categories can be signaled through a sequence heading or a cut heading. [0416] [0417] As another example, the number of intra prediction patterns available and / or the number of categories can be determined based on a size of a prediction unit or a coding unit of the current block. For example, when the size of the current block (for example, the coding unit of the current block) is equal to or greater than 64x64, the intra prediction pattern of the current block can be selected from five intra prediction patterns shown in the Figure 13. In contrast, when the size of the current block (for example, the coding unit of the current block) is less than 64x64, the intra-prediction pattern of the current block can be selected from intra-prediction patterns shown in Figure 10, 11 , or 12. [0418] [0419] In Figures 10 to 13, it is represented that the sub-blocks included in each intra-prediction pattern have a rectangular shape. As another example, the pattern of intra prediction can be used where at least one of the sizes and shapes of the sub-blocks are different from each other. For example, Figure 14 is a view illustrating an example of an intra prediction pattern with different sizes and shapes of sub-blocks. [0420] [0421] The displacement for each sub-block (for example, the displacement h, f, g, oi of each sub-block shown in Figures 10 to 14) can be decoded from a bit stream, or it can be derived from the neighbor sample adjacent to the current block . [0422] [0423] As another example, the displacement of the sub-block can be determined by considering the distance from a sample at a particular position in the current block. For example, him Displacement can be determined in proportion to a value representing the distance between a sample in a predetermined position in the current block and a sample in a predetermined position in the sub-block. [0424] [0425] As another example, the displacement of the sub-block can be determined by adding or subtracting a determined value based on the distance between a sample in a predetermined position in the current block and a sample in a predetermined position in the sub-block a or from a preset value. [0426] [0427] As another example, the offset can be determined based on a proportion of a value representing the size of the current block and a value representing the distance between a sample in a predetermined position in the current block and a sample in a predetermined position in the sub. -block. [0428] At this point, the sample at the predetermined position in the current block may include a sample adjacent to the left limit of the current block, a sample located at the top limit of the current block, a sample adjacent to the upper left corner of the current block, etc. . [0429] [0430] Figure 15 is a view illustrating a method of prediction realization using an intra block copy scheme according to an embodiment of the present invention. [0431] [0432] Intra block copy (IBC) is a method where a current block is predicted / reconstructed using a block (hereinafter referred to as 'a reference block') already rebuilt in the same instant as the current block. If a snapshot contains a large number of letters, such as a Korean alphabet, an alphabet, etc. and a letter that is contained in the current block when the current block is rebuilt is contained in an already decoded block, the intra block copy can improve a coding / decoding performance. [0433] [0434] An intra block copy method can be classified as an intra prediction method or an inter prediction method. When the intra block copy method is classified as the intra prediction method, an intra prediction mode can be defined for the intra block copy method. When the intra block copy method is classified as the inter prediction method, a bitstream can include a flag that indicates whether to apply the intra block copy method to the current block. As an alternative, if the current block uses intra block copy it can be confirmed through a reference instant reference index of the current block. That is to say, when the instant snapshot index of the current block indicates the current snapshot, inter prediction can be performed in the current block using intra block copy. For this purpose, you can add a current reconstructed snapshot to a list of reference snapshots for the current block. The current instantaneous can exist in a fixed position in the list of reference snapshots (for example, a position with the reference instantaneous index of 0 or the last position). As an alternative, the current instantaneous can have a variable position in the list of reference snapshots, and for this purpose, a reference snapshot index indicating a current snapshot position can be signaled separately. [0435] [0436] To specify the reference block of the current block, a position difference between the current block and the reference block can be defined as a movement vector (hereinafter referred to as a block vector). [0437] [0438] The block vector can be derived by a sum of a prediction block vector and a differential block vector. The device for encoding a video can generate a prediction block vector through predictive coding, and can encode the differential block vector which indicates the difference between the block vector and the prediction block vector. In this case, the device for decoding a video can derive the block vector from the current block using the derived prediction block vector using predecoded information and the differential block vector decoded from a bit stream. [0439] [0440] At this point, the prediction block vector can be derived based on the block vector of a neighboring block adjacent to the current block, the block vector in an LCU of the current block, the block vector in a row / column of LCU of the current block, etc. [0441] [0442] The device for encoding a video can encode the block vector without performing predictive coding of the block vector. In this case, the device for decoding a video can obtain the block vector by decoding the block vector information signalized through a bit stream. The correction process can be done in the prediction / reconstructed sample generated through the intra-block copy method. In this case, the correction method described with reference to Figures 6 to 14 can be applied equally / similarly, and therefore the detailed description thereof will be omitted. [0443] [0444] Figure 16 shows a range of reference samples for intra prediction according to an embodiment to which the present invention is applied. [0445] [0446] Referring to Figure 16, intra prediction can be performed using the samples from referenda P (-1, -1), P (-1, y) (0 <= y <= 2N-1) and P (x, -1) (0 <= x <= 2N-1) located in a Limit of a current block. At this time, filtering is performed selectively on reference samples based on at least one of an intra prediction mode (e.g., Index, directionality, angle, etc., of the intra prediction mode) of the current block or a size of a transform block related to the current block. [0447] [0448] At least one of a plurality of intra filter candidates may be selected to perform filtering on reference samples. At this point, the plurality of intra-filter candidates can be differentiated from one another by at least one of a filter intensity, a filter coefficient or a derivation number (eg, a number of filter coefficients, a length of filter). A plurality of intra-filter candidates can be defined in at least one of a sequence, an instantaneous, a cut, or a block level. That is, a sequence, an instantaneous, a cut, or a block in which the current block is included can use the same plurality of intra-filter candidates. [0449] [0450] In the following, for convenience of explanation, it is assumed that a plurality of intra-filter candidates includes a first intra-filter and a second intra-filter. It is assumed that the first intra-filter is a 3-lead filter (1,2,1) and the second intra-filter is a 5-lead filter (2,3,6,3,2). [0451] [0452] When reference samples are filtered by applying a first intra-filter, the filtered reference samples can be derived as shown in Equation 7. [0453] [0454] [Equation 7] [0455] [0456] P (- l, - l) = (P (- 1, 0) 2 P (- 1, - 1) P (0, - 1) 2) »2 [0457] [0458] P (- 1 , yy = (P (- , y ) + 2 P (- 1 y) P (- 1 , y - 1) 2) »2 [0459] [0460] P (x - 1) = (PO 11) + 2 P (x , - 1) + p <> -11) 2) »2 [0461] [0462] When reference samples are filtered by applying the second intra-filter, the filtered reference samples can be derived as shown in the following equation 8. [0463] [0464] [Equation 8] [0465] [0466] P (-1, j ;) = (2P (-1, 3; + 2) + 3P (-1, j ; + 1) + 6 P (-1, j ;) + 3P (-1, 3; - 1) + 2P (-1, j ; - 2) 8) »4 [0467] [0468] P (x 1) = (2 P (x 2, -1) + 3 P (x 1, -1 ) + 6 P (x , ~ 1) + 3 P (x -11 ) + 2 P (x -2 , ~ 1) 8) »4 [0469] [0470] Based on a position of a reference sample, one of a plurality of intra-filter candidates can be determined and used to perform filtering on the reference sample using the determined one. For example, a first intra-filter can be applied to a reference sample in a limit of a current block, and a second intra-filter can be applied to other reference samples. Specifically, as shown in Figure 17, the filtration in reference samples P (-1, -1), P (-1.0), P (-1.1), ..., P (-1, N-1) and P (0, -1), P (1, -1), ... is performed by applying a first intra-filter as shown in Equation 7, and the filtering in the other reference samples is perform by applying a second reference filter as shown in Equation 8. [0471] [0472] It is possible to select one of a plurality of intra-filter candidates based on a type of transform used for a current block, and to perform filtering on reference samples using the selected one. At this point, the type of transform can mean (1) a transform scheme such as DCT, DST or KLT, (2) a transform mode indicator such as a 2D transform, 1D transform or untransformed or (3) the number of transformed such as a first transform and a second transform. In the following, for convenience of description, it is assumed that the type of transform means the transform scheme such as DCT, DST and KLT. [0473] [0474] For example, if a current block is coded using a DCT, filtering can be performed using a first intra-filter, and if a current block is coded using a DST, filtering can be performed using a second intra-filter. Or, if a current block is coded using DCT or DST, filtering can be performed using a first-intra filter, and if the current block is coded using a KLT, filtering can be performed using a second intra-filter. [0475] [0476] Filtering can be performed using a filter selected based on a type of transform of a current block and a position of a reference sample. For example, if a current block is coded using a DCT, filtering can be performed on reference samples P (-1, -1), P (1,0), P (-1,1), ..., P (-1, N-1) and P (0, -1), P (1, -1), ..., P ( N-1, -1) using a first intra-filter, and filtration can be performed on other reference samples using a second-intra filter. If a current block is coded using a DST, filtering can be performed on reference samples P (-1, -1), P (-1.0), P (-1.1), ..., P (-1) , N-1) and P (0, -1), P (1, -1), ..., P (N-1, -1) using a second intra-filter, and filtration can be performed on other samples of reference using a first intrafilter. [0477] [0478] One of a plurality of intra-filter candidates can be selected based on whether a transformation type of a neighboring block that includes a reference sample is the same as a transformation type of a current block, and filtering can be performed using the candidate of selected intrafilter. For example, when a current block and a neighboring block use the same type of transform, filtering is performed using a first intra-filter, and when the transformation types of a current block and a neighboring block are different from each other, it can be used the second intra-filter to perform filtering. [0479] [0480] It is possible to select any one of a plurality of intra filter candidates based on a type of transform from a neighboring block and perform filtering on a reference sample using the selected one. That is, a specific filter can be selected in consideration of a type of transform of a block in which a reference sample is included. For example, as shown in Figure 18, if a block adjacent to the left / lower left of a current block is a block coded using a DCT, and a block adjacent to the top / top right of a current block is a block encoded using a DST, filtering is performed on reference samples adjacent to the left / lower left of a current block by applying a first intra-filter and filtering is carried out on reference samples adjacent to the top / top right of a current block applying a second intra filter. [0481] [0482] In units of a predetermined region, a usable filter can be defined in the corresponding region. In the present document, the unit of the predetermined region can be any one of a sequence, an instantaneous, a section, a group of blocks (for example, a row of units of codification tree) or a block (for example, a codification tree unit) or, another region that shares one or more filters can be defined. A reference sample can be filtered using a filter mapped to a region in which a current block is included. [0483] [0484] For example, as shown in Figure 19, it is possible to perform filtering on reference samples using different filters in CTU units. In this case, the information that indicates whether the same filter is used in a sequence or instantaneous, a filter type used for each CTU, an index specifying a filter used in the corresponding CTU between available intra filter candidates can be signaled by a set of sequence parameters (SPS) or a set of instantaneous parameters (PPS). [0485] [0486] An intra-prediction mode can be used effectively when a current instantaneous has no continuity with a previous instantaneous or when a current instantaneous includes a texture that has directionality. Particularly, when a current instantaneous includes a texture having directionality, an intra-prediction mode of the current block is likely to have the identical or similar direction as an intra-prediction mode of a neighboring block. Accordingly, an intra-prediction mode of a current block can be encoded / decoded based on an intra-prediction mode of a neighboring block. Specifically, an intra-prediction mode of a current block can be encoded / decoded based on a plurality of MPM candidates (Most Probable mode) generated based on an intra-prediction mode of a neighboring block. [0487] [0488] For example, in the coding process, when an intra-prediction mode of a current block is identical to any one of MPM candidates, the intra-prediction mode of the current block can be coded by selecting an MPM candidate identical to the mode of intra-prediction of the current block. At this point, the encoder can encode mdice information (e.g., 'mpm_idx') indicating an MPM candidate identical to an intra-prediction mode of a current block among a plurality of MPM candidates. The index information can be signaled through a bit stream. [0489] [0490] In the decoding process, an intra-prediction mode of the current block can be derived by information indicating whether any one of the MPM candidates is used as an intra-prediction mode of a current block, and by index information (e.g. , 'mpm_idx'). At this point, the information indicating whether any one of MPM candidates is used as the intra-prediction mode of a current block can be a 1-bit flag (for example, 'prev_intra_luma_pred_flag'), although it is not limited to same. [0491] [0492] To derive an intra-prediction mode from a current block, a plurality of MPM candidates can be used. A number of MPM candidates can be a fixed number, and can be a variable number by a sequence, a cut, or a target block to be coded. [0493] [0494] For example, a number of MPM candidates can be determined based on information signalized from a bit stream. A number of MPM candidates can be determined per sequence / cut by a syntax element, 'num_mpm_idx,' signaled per unit of a sequence / cut. [0495] [0496] A number of MPM candidates used to derive an intra-prediction mode from a current block can be a number from 3 to 6, although not limited to them. It is also possible to use more than 6 MPM candidates. [0497] [0498] In the following, assuming that extended intra-prediction modes illustrated in Figure 4 are used, a method for deriving an intra-prediction mode from a current block using MPM candidates will be described in detail. The embodiments described below can be applied not only when a greater number of intra-prediction modes are used than those shown in Figure 4 but also when a smaller number of intra-prediction modes are used than those shown in Figure 4. [0499] [0500] Figure 20 is a flowchart illustrating a method of derivation of an intraprediction mode of a current block, according to an embodiment of the present invention. [0501] [0502] Referring to Figure 20, first, MPM candidates are derived using an intra-prediction mode of a neighboring block adjacent to a current block (S2010). At this point, a neighboring block adjacent to a current block may be blocks that have been decoded more before a current block, and may include an upper neighbor block adjacent to the top of a current block, and a left neighbor block adjacent to a current block. the left of a current block. [0503] [0504] At this point, an upper neighbor block adjacent to an upper side of a current block may include not only a neighbor block attached to an upper limit of a current block but also a neighbor block adjacent to an upper corner of a current block (e.g. , a top left corner of a current block or a top right corner of a current block). Further, when an upper limit of a current block extends over a predetermined length, a block attached to an extended upper limit or a block including coordinates corresponding to an extended upper limit may be inferred as an upper neighbor block of a current block. [0505] [0506] A left neighbor block adjacent to a left side of a current block can include not only a neighboring block attached to a left end of a current block but also a neighbor block adjacent to a left corner of a current block (for example, a top left corner of a current block or a lower left corner of a current block). Further, when a left limit of a current block extends a predetermined length, a block attached to an extended left limit or a block including coordinates corresponding to an extended left limit may be referred to as a left neighbor block of a current block. [0507] [0508] MPM candidates of a current block can be generated by using at least one of an intra-prediction mode having a higher occurrence frequency between intra-prediction modes of neighboring blocks adjacent to a current block, an intra-prediction mode which has a larger value between intra-prediction modes of neighboring blocks adjacent to a current block or an intra-prediction mode having a smaller value between intra-prediction modes of neighboring blocks adjacent to a current block. [0509] [0510] For example, Table 3 shows an example in which MPM candidates are determined based on intra-prediction mode of neighboring blocks. [0511] [0512] [Table 3] [0513] [0514] [0515] [0516] In Table 3, L indicates an intra-prediction mode having a higher occurrence frequency between intra-prediction modes of neighboring left blocks, and A indicates a mode of intraprediction that has a higher occurrence frequency between intra-prediction modes of higher neighboring blocks. Max indicates a larger intra-prediction mode between intra-prediction modes of neighboring left blocks and upper neighboring blocks, and Min indicates a smaller intra-prediction mode of the intra-prediction modes of neighboring neighboring blocks and neighboring blocks superiors In Table 3, it is exemplified that 6 MPM candidates are generated. However, it is also possible to derive an intra-prediction mode from a current block by generating fewer or more MPM candidates. [0517] [0518] In addition, instead of determining L or A based on frequency of occurrence of an intraprediction mode, an intra-prediction mode of a neighboring block in a specific position can be determined as L or A. [0519] [0520] Referring to an example shown in Table 3, MPM candidates can be determined based on whether intra-prediction modes L and A are identical. [0521] [0522] For example, when L and A are identical, and L and A are directional modes (ie, neither Plan nor CC), the MPM candidates of a current block can include at least one of L, an intra-prediction mode that has a direction similar to L, a planar mode and a CC mode. At this point, an intra-prediction mode having a direction similar to an intra-prediction mode L means an intra-prediction mode in which a difference from the intra-prediction mode L is equal to or less than a value threshold. For example, an intra-prediction mode similar to an intra-prediction mode L may include L + 1, L-1, L + 2, or L-2, and so on. In Table 3, it is exemplified that 6 MPM candidates are generated such as L, Planar, L + 1, L-1, L + 2 and CC. [0523] [0524] When L and A are identical, and L and A are non-directional modes (ie, Planar or CC), the MPM candidates of a current block can include at least one of a Planar mode, a CC mode and a directional mode pre-established At this point, a preset directional mode can include Vertical and Horizontal, and can include diagonal directional modes (for example, 2, 34 or 66, etc.). Alternatively, a preset directional mode may have a different direction from the previous examples. In Table 3, it is exemplified that 6 MPM candidates are generated such as Planar, CC, Vertical (View), Horizontal (Hor), 2 and 18. [0525] [0526] When L and A are not identical, each of L and A can be established as a MPM candidate. Furthermore, based on whether L and A are non-directional modes, at least one of Planar, CC, Max, an intra-prediction mode similar to Max, Min or an intra-prediction mode similar to Min can be generated as a candidate of MPM. [0527] For example, when L and A are not identical, and L and A are not Planares modes, but L or A are CC, at least one of L, A, Planar, Max or an intra-prediction mode similar to Max can be generated as a candidate of MPM. In Table 3, it is exemplified that 6 MPM candidates are generated such as L, A, Planar, Max-1, Max + 1 and Max + 2. [0528] [0529] When L and A are not identical, and L and A are neither Planar nor CC, at least one of L, A, non-directional mode, Max, Min, an intra-prediction mode similar to Max or an intra-mode similar prediction to Min can be generated as a MPM candidate. In Table 3, it is exemplified that 6 MPM candidates are generated such as L, A, Planar, CC, Max + 1, and Min-1. [0530] [0531] When L and A are not identical but both of L and A are non-directional modes (ie, one of L and A is Planar and the other is CC, that is, L + A <2), L, A and the mode Directional direction can be generated as a candidate of MPM. In Table 3, it is exemplified that 6 MPM candidates are generated such as L, A, Vertical (View), Horizontal (Hor), 2 and 18. [0532] [0533] When L and A are not identical, one of L and L is a planar mode and the other is a directional mode, at least one of L, A, CC, Max or an intra-prediction mode similar to Max can be generated as a MPM candidate. In Table 3, it is exemplified that 6 MPM candidates are generated such as L, A, CC, Max-1, Max + 1 and Max + 2. [0534] [0535] In the following, referring to examples of Figure 21, examples will be described in detail to generate MPM candidates. [0536] [0537] Figure 21 is a diagram for explaining an example in which an MPM candidate is generated using an intra-prediction mode of a neighboring block adjacent to a current block. [0538] [0539] In Figure 21, it is exemplified that a plurality of left neighbor blocks and a plurality of neighboring upper blocks adjacent to the current block are present. [0540] [0541] Referring to Figure 21, an intra-prediction mode 'L' having a higher occurrence frequency between intra-prediction modes of left neighboring blocks is 10. An intra-prediction mode 'A' having a frequency Higher occurrence between higher neighboring blocks intra-prediction modes is 26. In addition, a larger 'Max' intra-prediction mode for left neighboring blocks and upper neighboring blocks is 26, and a smaller 'Min' intra-predictive mode for Left neighboring blocks and upper neighboring blocks is 0. [0542] Applying the above to the example shown in Table 3, 10, 26, Planar, 25, 27 and 29 can be generated as MPM candidates for a current block. [0543] [0544] A neighbor block used to generate MPM candidates from a current block can be limited to neighboring blocks included in the same unit of code tree as a current block. At this point, a current block is adjacent to a left and top limits of an encoding tree unit, and there may be no neighboring block to the left or to the top of the current block in the encoding tree unit. Alternatively, when a neighbor block adjacent to the left or to the top of a current block can not be a block encoded by intra-prediction mode, an intra-prediction mode of the neighboring block adjacent to the current block can not be used. In this case, MPM candidates can be generated from a current block based on predefined modes. At this point, the predefined modes can include at least one of CC, Planar, Vertical, or Horizontal. [0545] [0546] For example, when there are no neighboring blocks left and adjacent upper blocks adjacent to a current block, it is assumed that L is Planar and A is CC, and MPM candidates of the current block are generated according to rules exemplified in Table 3. [0547] [0548] Intra-prediction modes of one of the upper neighboring blocks and the left neighboring blocks can be used when MPM candidates are generated, although the other may not be available when generating MPM candidates. An unavailable intra-prediction mode can be replaced by an available intra-prediction mode, thus MPM candidates can be generated from a current block. [0549] [0550] Specifically, to generate MPM candidates from a current block, when an intra-prediction mode of a higher neighbor block or an intra-prediction mode of a left neighbor block is not available, MPM candidates of the current block can be generated based on a block closer to a neighboring block of which the intra-prediction mode is not available or an intra-prediction mode of a block more adjacent to a neighboring block of which the intra-prediction mode is not available. [0551] [0552] For example, when an intra-prediction mode of an upper neighbor block of a current block is not available, an intra-prediction mode of a left neighbor block closer (or more adjacent) to the upper neighboring blocks may be used instead of the intra-prediction mode of the upper neighbor block. Furthermore, when an intra-prediction mode of a left neighbor block of a current block is not available, an intra-prediction mode of a block nearest neighbor (or more adjacent) to the left neighbor block can be used in place of the intra-prediction mode of the left neighbor block. [0553] [0554] Figure 22 is a diagram showing an MPM candidate generation example when an intra-prediction mode of an upper neighbor block or a left neighbor block adjacent to a current block is not available. [0555] [0556] When an intra-prediction mode of a neighboring upper block is not available, an intra-prediction mode of a left neighbor block closer to the upper neighboring blocks (ie, a block closer to an upper limit of a current block) ) between left neighbor blocks of a current block can be established as an intra-prediction mode A. [0557] [0558] For example, referring to an example (a) shown in Figure 22, an intra-prediction mode L having a higher occurrence frequency between intra-prediction modes of left-neighbor blocks is 10, and an intra-prediction mode A is that which is a mode of intra-prediction of a left neighbor block closer to a neighboring neighbor block. When A and L are determined, MPM candidates of a current block can be determined according to the examples in Table 3. [0559] [0560] When an intra-prediction mode of a higher neighboring block is not available but there is a plurality of left neighboring blocks adjacent to a current block, a decoder can sequentially obtain intra-prediction modes of the left neighboring blocks. That is, a decoder can obtain intra-prediction modes of left-neighbor blocks in an adjacency order to an upper-neighbor block (or the upper-left neighbor block of a current block). [0561] [0562] For example, in an example (a) shown in Figure 23, a decoder can sequentially obtain, starting from a top left block of a current block, intra-prediction modes of neighboring blocks located below the upper left block, and below , you can obtain intra-prediction modes of neighboring blocks located above the upper left block. Accordingly, in an example (a) shown in Figure 23, an intra-prediction mode of left-neighbor blocks is obtained in an order of A0, A1, A2, A3, A4, B0, B1, between which a mode First available intra-prediction can be used in place of an intra-prediction mode (or intra-prediction mode A) of the upper neighboring blocks. [0563] When an intra-prediction mode of a left neighbor block is not available, an intra-prediction mode of a block closer to the left neighbor block (ie, a block closer to a left limit of a current block) between blocks Upper neighbors of a current block can be established as an intra-prediction mode L. [0564] [0565] For example, referring to an example (b) shown in Figure 22, an intra-prediction mode A having a higher occurrence frequency between intra-prediction modes of higher neighboring blocks is 26, and an intra-prediction mode L is 26 which is a mode of intraprediction of a left neighbor block closer to a left neighbor block. When determining L and A, MPM candidates of a current block can be determined according to the examples in Table 3. [0566] [0567] When an intra-prediction mode of a left neighbor block is not available but there is a plurality of neighboring upper blocks adjacent to a current block, a decoder can sequentially obtain intra-prediction modes of the upper neighboring blocks. That is, a decoder can obtain intra-prediction modes of higher neighboring blocks in an adjacency order to a left neighbor block (or upper left neighbor block of a current block). [0568] [0569] For example, in an example (b) shown in Figure 23, a decoder can sequentially obtain, starting from a top left block of a current block, intra-prediction modes of neighboring blocks located on a right side of the upper left block, and then, you can obtain intra-prediction modes of neighboring blocks located on a left side of the upper left block. Accordingly, in an example (b) shown in Figure 23, an intra-prediction mode of higher neighboring blocks is obtained in an order of A0, A1, A2, A3, A4, B0, B1, among which can be used an intra-prediction mode first available in place of an intra-prediction mode (or intra-prediction mode L) of the left neighbor block). [0570] [0571] For a further example, when an intra-prediction mode of a higher neighboring block is not available, an intra-prediction mode having a higher occurrence frequency between intra-prediction modes of neighboring left blocks may be used instead of an intra-prediction mode of the upper neighbor block. For example, referring to an example (a) shown in Figure 23, it is possible to use an intra-prediction mode having a higher occurrence frequency between intra-prediction modes of blocks A0, A1, A2, A3, A4, B0 and B1 instead of an intra-prediction mode (or intra-prediction mode A) of neighboring blocks superiors [0572] [0573] In addition, when an intra-prediction mode of a left neighbor block is not available, an intra-prediction mode having a higher occurrence frequency between intra-prediction modes of higher neighboring blocks instead of a mode of intra-prediction of the left neighbor block. For example, referring to an example (b) shown in Figure 23, it is possible to use an intra-prediction mode having a higher occurrence frequency between intra-prediction modes of blocks A0, A1, A2, A3, A4, B0 and B1 instead of an intra-prediction mode (or intra-prediction mode L) of the left neighbor block. [0574] [0575] When generating MPM candidates from a current block, it is determined whether there is an MPM candidate identical to an intra-prediction mode of a current block (S2020). At this point, if there is an MPM candidate identical to an intra-prediction mode of a current block, it can be indicated by information (eg, 'prev_intra_pred_flag') signaled through a bit stream. For example, prev_intra_pred_flag that has a value of 1 indicates that there is an MPM candidate identical to an intra-prediction mode of a current block, and prev_intra_pred_flag that has a value of 0 indicates that there is no MPM candidate identical to an intra-mode. -preview of the current block. [0576] [0577] When it is determined that there is an identical MPM candidate to an intra-prediction mode of a current block, information (S2030) specifying the MPM candidate identical to the intra-prediction mode of the current block, and based on the information can be decoded. , an intra-prediction mode of a current block can be determined. [0578] [0579] On the other hand, when it is determined that there is no identical MPM candidate to an intra-prediction mode of a current block, a remaining mode is decoded from a bit stream (S2040), and an intra-prediction mode of a current block can be determined based on the remaining decoded mode. A remaining mode is information that is coded to specify an intra-prediction mode of a current block, except for MPM candidates between intraprediction modes. A decoder can determine an intra-prediction mode of a current block by comparing a remaining mode and MPM candidates. [0580] [0581] When an extended intra-prediction mode is used, as the number of intra-prediction modes increases, a number of bits used to code a remaining mode may also increase. For example, assuming that 67 intra-prediction modes are used and 6 MPM candidates are used, a remaining mode should be long enough to represent 61 intra-prediction modes. For example, when a mode is supposed to be encoded remaining as a fixed length, the remaining mode should have a length of at least 6 bits to represent the 61 intra-prediction modes. [0582] [0583] Accordingly, to minimize the signaling of a remaining mode of prediction and more effectively encode / decode an intra-prediction mode of a current block, an intra-prediction mode of a current block can be derived using a plurality of candidate groups of MPM. [0584] [0585] In the following, a method for deriving an intra-prediction mode from a current block using a plurality of MPM candidate groups will be described in detail. [0586] [0587] Figure 24 shows an example of derivation of an intra-prediction mode of a current block using 2 groups of MPM candidates, Figure 25 shows an example of derivation of an intra-prediction mode of a current block using 3 groups of MPM candidates. [0588] [0589] Referring to Figure 24, a decoder can determine based on a bitstream if an MPM candidate identical to an intra-prediction mode of a current block is included in a first group of MPM candidates (S2410). At this point, if an MPM candidate identical to an intra-prediction mode of a current block is included or not in a first group of MPM candidates it can be indicated by first information (for example, 'prev_intra_pred_flag') signaled through a bit stream [0590] [0591] When it is determined that an MPM candidate identical to an intra-prediction mode of a current block is included in a first group of MPM candidates, information may be decoded (eg, 'mpm_idx') which specifies an MPM candidate identical to an intra-prediction mode of a current block in a first group of MPM candidates (S2420), and an intra-prediction mode of a current block based on the information can be determined. [0592] [0593] On the other hand, when it is determined that an MPM candidate identical to an intra-prediction mode of a current block is not included in a first group of MPM candidates, it can be determined whether an MPM candidate identifies an intra-prediction mode of a current block is included in a second group of MPM candidates (S2430). At this point, if an MPM candidate identical to an intra-prediction mode of a current block is included or not in a second group of MPM candidates it can be indicated by second information (for example, '2nd_prev_intra_pred_flag') signaled through a bit stream [0594] When it is determined that an MPM candidate identical to an intra-prediction mode of a current block is included in a second group of MPM candidates, information (for example, '2nd_mpm_idx') specifying a candidate of the candidate can be decoded (S2440). MPM identical to an intra-prediction mode of a current block in a second group of MPM candidates, and an intra-prediction mode of a current block based on the information can be determined. [0595] [0596] On the other hand, when it is determined that none of a first group of MPM candidates or a second group of MPM candidates includes an MPM candidate identical to an intraprediction mode of a current block, a remaining mode is decoded from a stream of MPM candidates. bits (S2450), and an intra-prediction mode of a current block can be determined based on the remaining decoded mode. [0597] [0598] At this point, a first group of MPM candidates can include an MPM candidate generated based on intra-prediction modes of neighboring blocks of a current block. For example, a first group of MPM candidates can include 6 MPM candidates generated through an example of Table 3. [0599] [0600] A second group of MPM candidates can include a MPM candidate not included in a first group of MPM candidates. For example, in Table 3, when L and A are identical, and L and A are directional modes, a first group of MPM candidates can include MPM candidates corresponding to Planar, CC, Vertical, Horizontal, 2 and 18. Therefore, a second group of MPM candidates can include MPM candidates other than Planar, CC, Vertical, Horizontal, 2, and 18. [0601] [0602] A second group of MPM candidates may include a pre-established intra-prediction mode or an MPM candidate generated based on MPM candidates included in a first group of MPM candidates. For example, a second group of MPM candidates can include an MPM candidate who has a similar address to a MPM candidate directional included in a first group of MPM candidates. [0603] [0604] For a further example, one of a first group of MPM candidates and a second group of MPM candidates are generated based on an intra-prediction mode of a left neighbor block of a current block, and the other is generated based on a intra-prediction mode of a higher neighbor block of a current block. [0605] A number of MPM candidates included in a second group of MPM candidates can be equal to or greater than a number of MPM candidates included in a first group of MPM candidates. For example, a first group of MPM candidates can include a maximum of 6 MPM candidates, while a second group of MPM candidates can include a maximum of 16 MPM candidates. [0606] [0607] When the maximum of 6 MPM candidates are included in a first group of MPM candidates, information (eg, 'mpm_idx') to identify a MPM candidate included in a first group of MPM candidates can be coded as a fixed length of 3 bits. On the other hand, when a maximum of 16 MPM candidates are included in a second group of MPM candidates, information (eg, '2nd_mpm_idx') can be coded to identify an MPM candidate included in a second group of MPM candidates as a fixed length of 4 bits. When 6 MPM candidates are included in a first group of MPM candidates and 16 MPM candidates are included in a second group of MPM candidates, the remaining mode is coded as a fixed 6-bit length to identify 45 intra-prediction modes. [0608] [0609] Referring to Figure 25, a decoder can determine based on a bitstream if an MPM candidate identical to an intra-prediction mode of a current block is included in a first group of MPM candidates (S2510). At this point, if an MPM candidate identical to an intra-prediction mode of a current block is included or not in a first group of MPM candidates it can be indicated by first information (for example, 'prev_intra_pred_flag') signaled through a bit stream [0610] [0611] When it is determined that an MPM candidate identical to an intra-prediction mode of a current block is included in a first group of MPM candidates, information may be decoded (eg, 'mpm_idx') which specifies an MPM candidate identical to an intra-prediction mode of a current block in a first group of MPM candidates (S2520), and an intra-prediction mode of a current block based on the information can be determined. [0612] [0613] On the other hand, when it is determined that an MPM candidate identical to an intra-prediction mode of a current block is not included in a first group of MPM candidates, it can be determined whether an MPM candidate identifies an intra-prediction mode of a current block is included in a second group of MPM candidates (S2530). At this point, if an MPM candidate identical to an intra-prediction mode of a current block is included or not in a second group of MPM candidates, it can be indicated by second information (for example, '2nd_prev_intra_pred_flag') signaled through a bit stream. [0614] [0615] When it is determined that an MPM candidate identical to an intra-prediction mode of a current block is included in a second group of MPM candidates, information (for example, '2nd_mpm_idx') specifying a candidate for the MPM can be decoded (S2540). MPM identical to an intra-prediction mode of a current block in a second group of MPM candidates, and an intra-prediction mode of a current block based on the information can be determined. [0616] [0617] On the other hand, when it is determined that an MPM candidate identical to an intra-prediction mode of a current block is not included in a second group of MPM candidates, it can be determined whether an MPM candidate identifies an intra-prediction mode of a current block is included in a third group of MPM candidates (S2550). At this point, if an MPM candidate identical to an intra-prediction mode of a current block is included or not in a third group of MPM candidates it can be indicated by second information (for example, '3rd_prev_intra_pred_flag') signaled through a bit stream [0618] [0619] When it is determined that an MPM candidate identical to an intra-prediction mode of a current block is included in a third group of MPM candidates, information (for example, '3rd_mpm_idx') specifying a candidate of the candidate can be decoded (S2540). MPM identical to an intra-prediction mode of a current block in a third group of MPM candidates, and an intra-prediction mode of a current block based on the information can be determined. [0620] [0621] On the other hand, when it is determined that none of a first group of MPM candidates, a second group of MPM candidates and a third group of MPM candidates include an MPM candidate identical to an intra-prediction mode of a current block , a remaining mode is decoded from a bitstream (S2570), and an intra-prediction mode of a current block can be determined based on the remaining decoded mode. [0622] [0623] A third group of MPM candidates can include a MPM candidate not included in either a first group of MPM candidates or a second group of MPM candidates. MPM candidates included in a third group of MPM candidates can be generated based on the pre-established intra-prediction mode, MPM candidates included in a first group of MPM candidates or MPM candidates included in a second group of MPM candidates . For example, a third group of MPM candidates can include a MPM candidate who has a similar direction to a directional MPM candidate included in a first group of MPM candidates or a first group of MPM candidates. [0624] [0625] A number of MPM candidates included in a third group of MPM candidates can be equal to or greater than a number of MPM candidates included in a first group of MPM candidates. In addition, a number of MPM candidates included in a third group of MPM candidates may be equal to or greater than a number of MPM candidates included in a second group of MPM candidates. For example, a first group of MPM candidates can include 6 MPM candidates, while a second group of MPM candidates and a third group of MPM candidates can include 16 MPM candidates. [0626] [0627] When a third group of MPM candidates includes 16 MPM candidates, information (eg, '3rd_mpm_idx') can be coded to identify the MPM candidate included in a third group of MPM candidates that can be coded as a fixed 4-bit length . When a first group of MPM candidates includes 6 MPM candidates, and each of a second group of MPM candidates and a third group of MPM candidates includes 16 MPM candidates, a remaining mode can be coded as a fixed length of 5. bits to identify 29 intra-prediction modes. [0628] [0629] Referring to Figures 24 and 25, it is illustrated that an intra-prediction mode of a current block is obtained using 2 and 3 MPM candidate groups, respectively. A number of MPM candidate groups used to derive an intra-prediction mode from a current block is not limited to the examples described. In addition, a number of MPM candidates included in a first to third MPM candidate group is not limited to the examples described. [0630] [0631] Whether or not to use a plurality of groups of MPM candidates can be determined based on information signaled in units of a sequence, an instantaneous, a cut, a unit to be encoded / decoded. At this point, the information may be information indicating a maximum number of MPM candidates or flag information indicating whether to use a plurality of groups of MPM candidates. [0632] [0633] When an intra-prediction mode of a current block is determined, intra-prediction can be performed using a reference sample adjacent to the current block. For example, prediction samples of a current block can be generated by averaging reference samples, or they can be generated by duplicating reference samples in a specific direction considering a directionality of an intra-prediction mode. As described above in an example with reference to Figure 16, P (-1, -1), P (-1, y) (0 <= and <= 2N-1), P (x, -) can be used. 1) (0 <= x <= 2N-1) that are located in a limit of a current block as reference samples. [0634] [0635] When it is determined that a reference sample is not available, a reference sample that is not available can be replaced by a reference sample that is available. At this point, a reference sample can be determined as not available in the case where a position of a reference sample is outside of an instant, a reference sample is present in a different section of a current block, or a reference sample it is included in a block coded by an inter-prediction. At this point, if a reference sample included in a block coded by an inter-prediction is not available or can be determined based on information that indicates whether to use a reference sample included in a block coded by an inter-prediction when it is performed intra-prediction of a current block. At this point, the information can be a 1 bit flag (for example, 'constrained_intra_prediction_flag'), although it is not limited to it. For example, when a value of 'constrained_intra_prediction_flag' is 1, a reference sample included in a block coded by an inter-prediction can be determined to be unavailable. [0636] [0637] In the example shown in Figure 16, when it is determined that a reference sample located further to the left (for example, P (-1, 2N-1)) is not available, the reference sample located further to the left may be replaced by a first available reference sample as it is scanned in a predetermined order. At this point, the order of scanning can be performed sequentially from a reference sample adjacent to the reference sample further to the left. For example, in the example shown in Figure 16, when P (-1, 2N-1) is not available, it can be scanned in an order of P (-1, -2N-2) to P (-1, - 1), P (-1) to P (2N-1, -1). P (-1, 2N-1) can be replaced by a first available reference sample found as a result of the exploration. [0638] [0639] When a left reference sample except for a reference sample located further to the left is not available, the left reference sample can be replaced by a reference sample adjacent to a lower part of the left reference sample. For example, a non-available reference sample P (-1, y) between P (-1, 2N-1) and P (-1, -1) can be replaced by a reference sample P (-1, y + 1 ). [0640] [0641] When a superior reference sample is not available, the superior reference sample it can be replaced by a reference sample adjacent to the left of the upper reference sample. For example, a non-available reference sample P (x, -1) between P (0, -1) and P (2N-1, -1) can be replaced by a reference sample P (x-1, -1) . [0642] [0643] A reference sample established adjacent to a current block may be referred to as a 'reference line' (or 'intra-reference line' or 'reference sample line'). For example, in the example shown in Figure 16, an established 'reference line' reference sample including P (-1, 2N-1) to P (-1, 1), P (0, -1) a P (2N-2, -1). An intra-prediction of a current block can be made based on reference samples included in a reference line. An intra-prediction of a current block can be performed, using reference samples included in a reference line, based on an intra-prediction mode of a current block, for example, when an intra-prediction mode of a current block is a mode of CC, a prediction signal can be generated using a weighted average and prediction of reference samples included in the reference line. For example, when an intra-prediction mode of a current block is a CC mode, the prediction samples of the current block can be obtained according to Equation 9. [0644] [0645] [Equation 9] [0646] [0647] P (x, 0) = (P (x, -1) 3 * dcVal) »2 [0648] [0649] P (0, y) = (P (-1, y) 3 * dcVal) »2 [0650] [0651] In Equation 9, dcVal can be generated based on an average value of samples except for P (-1, -1) between reference samples included in a reference line. [0652] [0653] A planar mode provides efficient prediction efficiency in a smooth area that has no sharp edges, and is effective in improving the discontinuity of block limit or deterioration of image quality of a block limit. When an intra-prediction mode of a current block is a planar mode, a provisional prediction sample of horizontal direction of the current block can be obtained by using a reference sample adjacent to a top right corner of the current block and a reference sample having coordinate and identica to the sample of provisional prediction of horizontal direction, and a sample of provisional prediction of direction The vertical of the current block can be obtained by using a reference sample adjacent to a lower left corner of the current block and a reference sample having an x coordinate identical to the provisional prediction sample of vertical direction. For example, a sample of provisional prediction of horizontal direction and a sample of provisional prediction of vertical direction of a current block can be obtained according to Equation 10. [0654] [0655] [Equation 10] [0656] [0657] [0658] [0659] [0660] A prediction sample of a current block can be generated by adding a provisional prediction sample of horizontal direction and a sample of provisional prediction of vertical direction, and then shifting the result of the sum by a value determined according to a size of a current block . For example, a prediction sample of a current block can be obtained according to Equation 11. [0661] [0662] [Equation 11] [0663] [0664] [0665] [0666] [0667] An intra-prediction of a current block can be performed using a plurality of reference lines. Assuming that a current block has a size WxH, the reference line of order M can include p (-M, -M), reference samples located in an identical row ap (-M, -M) (for example, samples of reference from p (M + 1, -M) ap (W + H + 2 (M-1), -M) or reference samples from p (-M + 1, -M) ap (2W + 2 (M- 1), -M) and reference samples located in an identical column ap (-M, -M) (for example, reference samples from p (-M, -M + 1) ap (-M, W + H + 2 (M-1)) or reference samples from p (-M, -M + 1) ap (-M, 2H + 2 (M-1))). [0668] [0669] For example, Figure 26 exemplifies a plurality of reference sample lines. As in the example shown in Figure 26, when a first reference line adjacent to a limit of a current block is referred to as a 'reference line 0', the order reference line M can be established adjacent to the reference line of order (M-1). [0670] An intra-prediction of a current block can be performed by at least one of a plurality of reference lines. A method of performing intra-prediction using a plurality of reference lines as described above can be referred to as an 'intra-prediction' method using an extended reference sample 'or an' extended intra-prediction method '. [0671] [0672] Whether or not to perform intra prediction using an extended reference line can be determined based on information signaled through a bit stream. At this point, the information may be a 1-bit flag, although it is not limited to the same. The information on whether to perform intra prediction using an extended reference line can be signaled in units of a coding tree unit, a coding unit or a prediction unit, or it can be signaled in units of an instantaneous or a cut. [0673] [0674] Whether or not to perform intra prediction using an extended reference line can be determined based on at least one of a size, shape, depth or intra prediction mode of a current block. [0675] [0676] When it is determined to perform intra prediction using an extended reference line, a decoder can determine a number of reference lines. At this point, a number of reference lines can have a fixed value, and can be determined adaptively according to a size, shape or intra-prediction mode of a current block. For example, when an intra prediction mode of a current block is a non-directional mode, the intra prediction of the current block is performed using a reference line. When an intra prediction mode of a current block is a directional mode, the intra prediction of the current block can be performed using a plurality of reference lines. [0677] [0678] For a further example, a number of reference lines can be determined per information which is signaled in units of a sequence, an instantaneous, a cut or a unit to be decoded. For example, a syntax element 'max_intra_line_idx' indicating a number of reference lines available in a sequence or a cut can be signaled through a sequence header or a cut heading. [0679] [0680] In the following, an intra-prediction method of using an extended reference line will be described in detail. [0681] [0682] Figure 27 is a flow chart illustrating an intra prediction embodiment method using an extended reference line according to the present invention. [0683] [0684] First, a decoder can generate a plurality of reference lines (S2710). The reference samples included in each reference line can be generated based on reconstructed samples included in decoded blocks rather than a current block. When a non-available reference sample is included in a reference line, the unavailable reference sample can be replaced by a value of a reference sample available in the same reference line or a reference sample available in another reference line. [0685] [0686] When an intra prediction mode of a current block is a directional mode, a decoder can generate a reference line that considers a directionality of the intra prediction mode. Considering a directionality of an intra prediction mode, a larger number of reference samples can be included in the reference line of order M than in the order reference line (M-1). That is, a reference line away from a current block may include a larger number of reference samples than a reference line near the current block. [0687] [0688] At this point, a number of reference samples included additionally in the reference line of order M that in the order reference line (M-1) can be determined in a variable manner according to a size of a current block. [0689] [0690] For example, when a current block has a size of 4x4, the reference line of order M can additionally include four (specifically, 2 in horizontal direction and 2 in vertical direction) reference samples that the order reference line (M- one). Furthermore, when a current block has a size of 8x8, the order reference line M can additionally include eight (specifically, 4 in the horizontal direction and 4 in the vertical direction) reference samples that the order reference line (M-1). ). [0691] [0692] Referring to Figure 26, as a size of a current block size is 4x4, it is exemplified that a first reference sample includes a total of 9 reference samples and a second reference sample includes a total of 13 (= 9 + 2x2) reference samples. [0693] [0694] When a current block is not square, a number of reference samples included in a reference line can be determined according to a horizontal and vertical lengths of a current block. [0695] For example, Figure 28 is a diagram that exemplifies a plurality of reference lines for a non-square boundary. When describing by comparing Figures 26 and 28, as a width of a current block is reduced to 1/2, a number of higher reference samples except for a top left reference sample included in a reference line 0 are reduced from 8 to 4. [0696] [0697] That is, considering Figures 26 and 28 together, when it is assumed that a current block has a size WxH, the reference line of order M can include a total of 2 {(W + H) +2 (M-1)} +1 reference samples including W + H + 2 (M-1) higher reference samples (or 2W + 2 (M-1) higher reference samples) (ie reference samples of horizontal direction), W + H + 2 (M-1) left reference samples (or 2H + 2 (M-1) left reference samples) (ie, vertical direction reference samples) and upper left reference sample. [0698] [0699] A decoder can decode, based on a bitstream, index information that specifies one of a plurality of reference lines (S2820). For example, when 4 reference lines are available as in the example shown in Figure 26, the Index information may specify any one of the 4 reference lines. [0700] [0701] A reference line for performing intra prediction for a current block can be specified adaptively based on a size of a current block, a type of a current block, an intra prediction mode of a current block, index information in a neighboring block or a difference between an intra prediction mode of a current block and a predetermined intra prediction mode and the like. [0702] [0703] When any one of a plurality of reference lines is specified, a decoder may perform intra prediction for a current block using the specified reference line (S2730). When an intra-prediction mode of a current block is a directional mode, a prediction sample of the current block can be obtained by a reference sample specified by the directional mode. When an intra-prediction mode of a current block points between reference samples, a prediction sample of the current block can be generated based on a weighted sum (weighted prediction) of a first reference sample and a second reference sample specified by the mode of intra prediction. [0704] [0705] In the example described above, it is exemplified that the index information that specifies one of the plurality of reference lines is decoded after generating a plurality of reference lines. It is also possible to obtain only a specified reference line index information between a plurality of reference lines after decoding the index information that specifies one of the plurality of reference lines. [0706] [0707] In the embodiment described above, it is described that the intra prediction for a current block is performed using any reference line specified by Index information between a plurality of reference lines. It is also possible that the intra prediction for a current block can be performed using two or more reference lines between a plurality of reference lines. Whether or not to use two or more reference lines when performing intra prediction for a current block can be determined based on information signaled from a bitstream, a size of a current block, a type of a current block, an intra prediction mode of a current block, if an intra prediction mode of a current block is a non-directional one or a difference between an intra prediction mode of a current block and a predetermined intra prediction mode and the like. [0708] [0709] The two or more reference lines may be specified by a plurality of index information signaled from a bit stream. For example, when two reference lines are set to be used, either one of the two reference lines can be specified for the first index information, and the other can be specified by the second index information. [0710] [0711] For a further example, it can be established that intra prediction is used for a current block to use two or more spatially contiguous reference lines. In this case, when any one of the two or more reference lines is specified by Index information signaled from a bitstream, the remaining reference line may be specified in consideration of the position with respect to the specified reference line. For example, when it is established that two reference lines are used, and the Index information indicates 'reference line 0,' then intra prediction of a current block can be made based on the reference line 0 and the reference line 1 neighbor to reference line 0. [0712] [0713] When establishing that a plurality of reference lines are used, the intra prediction of a current block can be performed based on an average value, a maximum value, a minimum value or a weighted sum of reference samples included in the plurality of lines of reference. [0714] [0715] For example, assuming that an intra-prediction mode of a current block is a directional mode (ie, an angular mode), a predicted sample of the current block can be generated based on a first reference sample and a second neighbor reference sample. to first reference sample. At this point, a first reference sample may be included in a first reference line between a plurality of reference lines, and a second reference sample may be included in a second reference line between the plurality of reference lines. A first reference line and a second reference line can be located next to each other, although it is not limited to the same. A first reference sample and a second reference sample can be specified according to a directionality of an intra prediction mode of a current block. A prediction sample of a current block can be generated in consideration of a weighted sum of a first reference sample and a second reference sample, or it can be generated based on an average value of a first reference sample and a second reference sample. [0716] [0717] The intra prediction of a current block can be performed by making a first intra prediction based in part on a plurality of reference lines and making a second intra prediction based on the other reference lines. At this point, an intra prediction mode used in a first intra prediction and an intra prediction mode used in a second intra prediction may be the same or different. A prediction sample of a current block can be generated based on a first prediction sample generated by performing a first intra prediction and a second prediction sample performing a second intra prediction. [0718] [0719] The above embodiments have been described mainly in the decoding process, the coding process can be performed in the same order as described or in reverse order. [0720] [0721] Although the above described embodiments have been described based on a series of stages or flowcharts, they do not limit the order of time series of the invention, and may be performed simultaneously or in different orders as necessary. In addition, each of the components (e.g., units, modules, etc.) that constitute the block diagram in the embodiments described above can be implemented by a hardware or software device, and a plurality of components. Or a plurality of components can be combined and implemented by a single hardware or software device. The above described embodiments can be implemented in the form of program instructions that can be executed through various computer components and recorded on a computer readable recording medium. The computer readable recording medium can include one or a combination of program commands, data files, data structures and the like. Examples of computer readable media include magnetic media such as discs hard drives, flexible disks and magnetic tape, optical recording media such as CD-ROM and DVD, magneto-optical media such as optical floppy disks, media, and hardware devices specifically configured to store and execute program instructions such as ROM, RAM , flash memory and the like. The hardware device can be configured to operate as one or more software modules to perform the process according to the present invention and vice versa. [0722] [0723] Industrial applicability [0724] [0725] The present invention can be applied to electronic devices that can encode / decode a video.
权利要求:
Claims (9) [1] 1. A method to decode a video, where the method includes: generate a Most Likely Mode list (MPM) for a current block, where the MPM list comprises 6 MPM candidates; determine if an intra-prediction mode of a current block is identical to one of the MPM candidates; obtain the intra-prediction mode of the current block, based on a result of the determination; apply a filter to reference samples adjacent to the current block; Y perform an intra-prediction for the current block, based on the intra-prediction mode of the current block and the filtered reference samples, wherein the MPM list comprises an MPM candidate obtained based on at least one of a first intra-prediction mode of a higher neighboring block and a second intra-prediction mode of a left neighbor block, and where if the first intra-prediction mode and the second intra-prediction mode are not identical and at least one of the first intra-prediction mode and the second intra-prediction mode is a directional mode, the MPM list comprises an MPM candidate obtained by adding or subtracting a predetermined value to a maximum between the first intra-prediction mode and the second intra-prediction mode. [2] 2. The method according to claim 1, wherein the 6 MPM candidates are constructed with 2 MPM candidates of non-directional modes and 4 MPM candidates of directional modes. [3] 3. The method according to claim 1, wherein if one of the first intra-prediction mode and the second intra-prediction mode is a non-directional mode while the other is a directional mode, the MPM list comprises an MPM candidate obtained by the add or subtract from 1 to the maximum and an MPM candidate obtained by adding or subtracting 2 to the maximum. [4] 4. The method according to claim 1, wherein if the first intra-prediction mode and the second intra-prediction mode are identical and the first intra-prediction mode and the second intra-prediction mode are directionally mode. , the MPM list comprises an MPM candidate obtained by adding or subtracting from 1 to one of the first intra-prediction mode and the second intra-prediction mode and an MPM candidate obtained by the addition or subtraction of 2 to one of the first intra-prediction mode and the second intra-prediction mode. [5] 5. The method according to claim 1, wherein, when it is determined that there is no MPM candidate identical to the intra-prediction mode of the current block among the plurality of MPM candidates, obtaining the intra-prediction mode of the block Current comprises: decoding a remaining mode; Y determine the intra-prediction mode of the current block based on the remaining mode. [6] 6. The method according to claim 5, wherein the remaining mode is coded as a fixed length. [7] 7. A method to generate a list most likely (MPM), comprising the method: coding information on whether there is an MPM candidate identical to an intra-prediction mode of a current block among a plurality of MPM candidates included in the MPM list, the MPM list comprises 6 MPM candidates; apply a filter to reference samples adjacent to the current block; Y perform an intra-prediction for the current block, based on the intra-prediction mode of the current block and the filtered reference samples, wherein the MPM list comprises an MPM candidate obtained based on at least one of a first intra-prediction mode of a higher neighboring block and a second intra-prediction mode of a left neighbor block, and where if the first intra-prediction mode and the second intra-prediction mode are not identical and at least one of the first intra-prediction mode and the second intra-prediction mode is a directional mode, the MPM list comprises an MPM candidate obtained by adding or subtracting a predetermined value to a maximum between the first intra-prediction mode and the second intra-prediction mode. [8] 8. The method according to claim 7, wherein the 6 MPM candidates are constructed with 2 MPM candidates of non-directional modes and 4 MPM candidates of directional modes. [9] 9. The method according to claim 7, wherein if one of the first intra-prediction mode and the second intra-prediction mode is a non-directional mode while the other is a directional mode, the MPM list comprises an MPM candidate obtained by the add or subtract from 1 to the maximum and an MPM candidate obtained by adding or subtracting 2 to the maximum.
类似技术:
公开号 | 公开日 | 专利标题 ES2711189A2|2019-04-30|METHOD AND APPARATUS FOR PROCESSING VIDEO SIGNALS | ES2703607B2|2021-05-13|Method and apparatus for processing video signals ES2710807B1|2020-03-27|METHOD AND APPARATUS FOR PROCESSING VIDEO SIGNALS ES2699723B2|2020-10-16|METHOD AND APPARATUS TO TREAT A VIDEO SIGNAL ES2724570A2|2019-09-12|Method and apparatus for processing video signals | ES2692864B1|2019-10-21|METHOD AND APPARATUS FOR PROCESSING VIDEO SIGNS ES2710234B1|2020-03-09|Procedure and device for processing video signals ES2737874B2|2020-10-16|METHOD AND APPARATUS FOR PROCESSING VIDEO SIGNAL ES2677193B1|2019-06-19|Procedure and device to process video signals ES2711474A2|2019-05-03|Method and device for processing video signal ES2699749B2|2020-07-06|Method and apparatus for processing a video signal ES2711223A2|2019-04-30|Method and device for processing video signal ES2703458A2|2019-03-08|Video signal processing method and device ES2711473A2|2019-05-03|Method and apparatus for processing video signal ES2737845A2|2020-01-16|METHOD AND APPLIANCE FOR PROCESSING VIDEO SIGNAL | ES2711230A2|2019-04-30|Method and apparatus for processing video signal ES2711209A2|2019-04-30|Method and device for processing video signal
同族专利:
公开号 | 公开日 CN113422953A|2021-09-21| ES2688624R1|2018-12-04| CN108886617A|2018-11-23| CN113438478A|2021-09-24| EP3442232A4|2019-12-04| KR20180123674A|2018-11-19| CN108886617B|2021-08-27| ES2711189R1|2020-02-04| CN113438477A|2021-09-24| ES2688624A2|2018-11-05| US11259047B2|2022-02-22| US20190116381A1|2019-04-18| EP3442232A1|2019-02-13| WO2017176030A1|2017-10-12|
引用文献:
公开号 | 申请日 | 公开日 | 申请人 | 专利标题 US8472522B2|2007-02-23|2013-06-25|Nippon Telegraph And Telephone Corporation|Video encoding method and decoding method, apparatuses therefor, programs therefor, and storage media which store the programs| US8902978B2|2010-05-30|2014-12-02|Lg Electronics Inc.|Enhanced intra prediction mode signaling| KR101739987B1|2010-12-28|2017-05-26|에스케이 텔레콤주식회사|Video Encoding/Decoding Method and Apparatus Using Feature Vector of Adjacent Block| US9787982B2|2011-09-12|2017-10-10|Qualcomm Incorporated|Non-square transform units and prediction units in video coding| GB2494468B|2011-09-12|2014-01-15|Canon Kk|Method and device for encoding or decoding information representing prediction modes| KR101974952B1|2011-10-06|2019-05-07|인텔렉추얼디스커버리 주식회사|Methods of coding intra prediction mode using two candidate intra prediction modes and apparatuses using the same| US9154796B2|2011-11-04|2015-10-06|Qualcomm Incorporated|Intra-mode video coding| US9628789B2|2011-11-18|2017-04-18|Qualcomm Incorporated|Reference mode selection in intra mode coding| KR101378434B1|2012-10-19|2014-03-27|한양대학교 산학협력단|Method for fast intra prediction mode decision| KR20140124443A|2013-04-15|2014-10-27|인텔렉추얼디스커버리 주식회사|Method for encoding and decoding video using intra prediction, and apparatus thereof| US10390021B2|2016-03-18|2019-08-20|Mediatek Inc.|Method and apparatus of video coding|CN110583017A|2017-04-28|2019-12-17|韩国电子通信研究院|Image encoding/decoding method and apparatus, and recording medium storing bit stream| US10893267B2|2017-05-16|2021-01-12|Lg Electronics Inc.|Method for processing image on basis of intra-prediction mode and apparatus therefor| WO2018216862A1|2017-05-24|2018-11-29|엘지전자 주식회사|Method and device for decoding image according to intra prediction in image coding system| GB2567861A|2017-10-27|2019-05-01|Sony Corp|Image data encoding and decoding| US11218704B2|2017-11-28|2022-01-04|Electronics And Telecommunications Research Institute|Image encoding/decoding method and device, and recording medium stored with bitstream| KR20190076918A|2017-12-22|2019-07-02|주식회사 윌러스표준기술연구소|A method and an apparatus for processing a video signal| EP3777169A4|2018-03-28|2022-01-05|Fg innovation co ltd|Device and method for coding video data in multiple reference line prediction| US10785479B2|2018-03-30|2020-09-22|Hulu, LLC|Intra prediction mode signaling for video coding| US10728542B2|2018-04-09|2020-07-28|Tencent America LLC|Methods and apparatuses for sub-block motion vector prediction| US20210281830A1|2018-06-21|2021-09-09|Kt Corporation|Method and apparatus for processing video signal| WO2020003282A1|2018-06-29|2020-01-02|Beijing Bytedance Network Technology Co., Ltd.|Managing motion vector predictors for video coding| EP3794824A1|2018-06-29|2021-03-24|Beijing Bytedance Network Technology Co. Ltd.|Conditions for updating luts| JP2021530936A|2018-06-29|2021-11-11|北京字節跳動網絡技術有限公司Beijing Bytedance Network Technology Co., Ltd.|Look-up table updates: FIFO, restricted FIFO| CN110662064A|2018-06-29|2020-01-07|北京字节跳动网络技术有限公司|Checking order of motion candidates in LUT| GB2588528A|2018-06-29|2021-04-28|Beijing Bytedance Network Tech Co Ltd|Selection of coded motion information for LUT updating| TWI735902B|2018-07-02|2021-08-11|大陸商北京字節跳動網絡技術有限公司|Lookup table with intra frame prediction and intra frame predication from non adjacent blocks| KR20210002663A|2018-09-03|2021-01-08|후아웨이 테크놀러지 컴퍼니 리미티드|Method and apparatus for intra prediction| WO2020050704A1|2018-09-07|2020-03-12|김기백|Image encoding/decoding method and device| TW202025760A|2018-09-12|2020-07-01|大陸商北京字節跳動網絡技術有限公司|How many hmvp candidates to be checked| EP3811623A4|2018-10-09|2021-04-28|Huawei Technologies Co., Ltd.|Devices and methods for image and video coding| KR20200041810A|2018-10-12|2020-04-22|주식회사 엑스리스|Method for encodign/decodign video signal and apparatus therefor| US20220038691A1|2018-11-04|2022-02-03|Lg Electronics Inc.|Intra prediction method and apparatus in image coding system| KR20200063092A|2018-11-27|2020-06-04|주식회사 엑스리스|Method for encodign/decodign video signal and apparatus therefor| US20210385435A1|2018-12-17|2021-12-09|Industry Academy Cooperation Foundation Of Sejong University|Video encoding/decoding method and device| WO2020130629A1|2018-12-18|2020-06-25|엘지전자 주식회사|Image coding method based on multiple reference line intra prediction, and device therefor| WO2020130628A1|2018-12-18|2020-06-25|엘지전자 주식회사|Method for coding image on basis of multiple reference line intra prediction and apparatus therefor| WO2020145735A1|2019-01-10|2020-07-16|엘지전자 주식회사|Intra prediction-based image coding method and device using mpm list| EP3905674A1|2019-01-13|2021-11-03|LG Electronics Inc.|Image coding method and device for carrying out mrl-based intra prediction| CN113383554A|2019-01-13|2021-09-10|北京字节跳动网络技术有限公司|Interaction between LUTs and shared Merge lists| EP3917141A1|2019-02-20|2021-12-01|LG Electronics Inc.|Mpm list-based intra prediction method and device| WO2020180133A1|2019-03-06|2020-09-10|엘지전자 주식회사|Video encoding/decoding method and apparatus, and method for transmitting bitstream| WO2020197152A1|2019-03-22|2020-10-01|엘지전자 주식회사|Method and device for decoding image by using intra prediction mode candidate list in image coding system| WO2020197223A1|2019-03-23|2020-10-01|엘지전자 주식회사|Intra prediction-based image coding in image coding system| CA3125109A1|2019-03-23|2020-10-01|Lg Electronics Inc.|Method for coding image on basis of intra prediction using mpm list and apparatus therefor| US11057619B2|2019-03-23|2021-07-06|Lg Electronics Inc.|Image coding method and apparatus based on intra prediction using MPM list| KR20210126774A|2019-03-26|2021-10-20|엘지전자 주식회사|Intra prediction method and apparatus based on MPM list| KR20200119744A|2019-04-10|2020-10-20|한국전자통신연구원|Method and apparatus for signaling signals related prediction mode in intra prediction| WO2020226359A1|2019-05-03|2020-11-12|한국전자통신연구원|Image encoding/decoding method and device, and recording medium storing bitstream| KR20220016833A|2019-06-05|2022-02-10|베이징 바이트댄스 네트워크 테크놀로지 컴퍼니, 리미티드|Context determination for matrix-based intra prediction| WO2020249633A1|2019-06-14|2020-12-17|Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.|Coding of intra-prediction modes| CN110290383B|2019-06-25|2021-07-13|浙江大华技术股份有限公司|Intra-frame prediction mode selection method, encoder and storage device| TWI737364B|2019-06-28|2021-08-21|聯發科技股份有限公司|Method and apparatus of matrix based intra prediction in image and video processing| CN110519591B|2019-08-29|2021-06-01|中南大学|Method for quickly selecting prediction mode based on intra-frame coding in multipurpose coding| US20210160539A1|2019-11-27|2021-05-27|Tencent America LLC|Method and system of video coding|
法律状态:
2019-04-30| BA2A| Patent application published|Ref document number: 2711189 Country of ref document: ES Kind code of ref document: A2 Effective date: 20190430 | 2020-02-04| EC2A| Search report published|Ref document number: 2711189 Country of ref document: ES Kind code of ref document: R1 Effective date: 20200128 |
优先权:
[返回顶部]
申请号 | 申请日 | 专利标题 KR20160042095|2016-04-06| KR20160079635|2016-06-24| 相关专利
Sulfonates, polymers, resist compositions and patterning process
Washing machine
Washing machine
Device for fixture finishing and tension adjusting of membrane
Structure for Equipping Band in a Plane Cathode Ray Tube
Process for preparation of 7 alpha-carboxyl 9, 11-epoxy steroids and intermediates useful therein an
国家/地区
|