Method for decoding video and method for encoding video

By employing an intra-frame weighted prediction method with non-adjacent reference samples in video signal encoding/decoding, the problem of low intra-frame prediction efficiency in existing technologies is solved, achieving more efficient video signal encoding/decoding results.

CN116828206BActive Publication Date: 2026-03-20KT CORP
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-05-16
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing technologies have low efficiency in intra-frame prediction during the encoding/decoding of high-resolution and high-quality video signals, especially when using non-adjacent reference samples, making it difficult to perform prediction effectively.

Method used

An intra-frame weighted prediction method based on multiple non-adjacent reference samples is adopted. By determining the intra-frame prediction mode of the current block, the prediction sample is generated by the weighted sum of the top and left reference samples, and the weight is determined according to the position of the prediction sample or the distance between the reference sample and the prediction sample.

Benefits of technology

It improves the efficiency of intra-frame prediction, effectively utilizing multiple non-adjacent reference samples for video signal encoding/decoding, thereby enhancing the quality and efficiency of encoding/decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116828206B_ABST
    Figure CN116828206B_ABST
Patent Text Reader

Abstract

A method for decoding video and a method for encoding video are disclosed. The method for decoding video can include constructing a most probable mode (MPM) candidate list for a current block, determining an intra prediction mode of the current block based on the MPM candidate list, obtaining reference samples of the current block, obtaining predicted samples of the current block based on the intra prediction mode and the reference samples, and determining whether to modify at least one predicted sample of the current block based on whether the intra prediction mode of the current block is one of predefined intra prediction modes. In a case where it is determined to modify the at least one predicted sample, a modified predicted sample is generated based on a weighted sum operation of the predicted sample and the reference sample, the weighted sum operation being performed by applying a first weight to the predicted sample and a second weight to the reference sample, and the second weight being set to be the same for all predicted samples included in a same sub-region in the current block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of application No. 201880032562.0 filed in the National Phase on May 16, 2018, entered into the National Phase on November 15, 2019, with the title of "Method and apparatus for video signal processing". TECHNICAL FIELD

[0002] The present application relates to a method and apparatus for processing a video signal. BACKGROUND

[0003] Recently, there has been an increasing demand for high resolution and high quality images, such as high definition (HD) images and ultra high definition (UHD) images, in various application fields. However, high resolution and high quality image data has an increased amount of data compared to conventional image data. Therefore, when image data is transmitted by using a medium such as a conventional wired and wireless broadband network, or when image data is stored by using a conventional storage medium, the cost of transmission and storage increases. To solve these problems that occur as the resolution and quality of image data increase, an efficient image encoding / decoding technique can be utilized.

[0004] Image compression techniques include various techniques, including an inter prediction technique of predicting pixel values included in a current picture from a previous picture or a subsequent picture of the current picture, an intra prediction technique of predicting pixel values included in a current picture by using pixel information in the current picture, an entropy encoding technique of assigning a short code to a value having a high frequency of occurrence and assigning a long code to a value having a low frequency of occurrence, etc. Image data can be efficiently compressed by using such image compression techniques, and can be transmitted or stored.

[0005] Meanwhile, as the demand for high resolution images increases, the demand for stereoscopic image content as a new image service also increases. Video compression techniques for efficiently providing stereoscopic image content having high resolution and ultra high resolution are being discussed. SUMMARY

[0006] TECHNICAL PROBLEM

[0007] An object of the present application is to provide a method and apparatus for efficiently performing intra prediction on a coding / decoding target block when a video signal is coded / decoded.

[0008] An object of the present application is to provide a method and apparatus for performing intra prediction using a plurality of reference samples that are not adjacent to each other when a video signal is coded / decoded.

[0009] The technical objects to be achieved by the present application are not limited to the technical problems mentioned above. And, other technical problems not mentioned will be apparent to those skilled in the art from the following description.

[0010] Technical solutions

[0011] The method and apparatus for decoding a video signal according to the present application can determine an intra prediction mode of a current block, obtain reference samples of the current block, and obtain prediction samples of the current block using at least one of the reference samples. In this case, in the case that intra weighted prediction is applied to the current block, the prediction samples can be obtained based on a plurality of reference samples that are not adjacent to each other.

[0012] The method and apparatus for encoding a video signal according to the present application can determine an intra prediction mode of a current block, obtain reference samples of the current block, and obtain prediction samples of the current block using at least one of the reference samples. In this case, in the case that intra weighted prediction is applied to the current block, the prediction samples can be obtained based on a plurality of reference samples that are not adjacent to each other.

[0013] In the method and apparatus for encoding / decoding a video signal according to the present application, the plurality of reference samples that are not adjacent to each other can include a top reference sample located at a top of the current block and a left reference sample located at a left side of the current block.

[0014] In the method and apparatus for encoding / decoding a video signal according to the present application, the prediction samples can be obtained based on a weighted sum between the top reference sample and the left reference sample.

[0015] In the method and apparatus for encoding / decoding a video signal according to the present application, the weights applied to the top reference sample and the left reference sample can be determined based on a position of the prediction sample or a distance between each reference sample and the prediction sample.

[0016] In the method and apparatus for encoding / decoding a video signal according to the present application, the weights applied to the top reference sample and the left reference sample can be determined based on sub-blocks.

[0017] In the method and apparatus for encoding / decoding a video signal according to the present application, one of the top reference sample and the left reference sample can be designated by applying the intra prediction mode in a forward direction, and the other can be designated by applying the intra prediction mode in a reverse direction.

[0018] In the method and apparatus for encoding / decoding a video signal according to the present application, whether to perform the intra weighted prediction can be determined according to whether the intra prediction mode is a predefined intra prediction mode.

[0019] The above-described features of the present application briefly summarized are merely illustrative aspects of the following detailed description of the present application, but do not limit the scope of the present application.

[0020] Technical Effects

[0021] According to the present application, efficient intra prediction can be performed on a coding / decoding target block.

[0022] According to the present application, there is an advantage of improving the efficiency of intra prediction by performing intra prediction using a plurality of reference samples that are not adjacent to each other.

[0023] Effects obtainable by the present application are not limited to the above-mentioned effects, and other effects not mentioned above will be clearly understood by those skilled in the art from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0024] Figure 1 is a block diagram illustrating an apparatus for encoding a video according to an embodiment of the present application.

[0025] Figure 2 is a block diagram illustrating an apparatus for decoding a video according to an embodiment of the present application.

[0026] Figure 3 is a diagram illustrating an example of hierarchically partitioning a coding block based on a tree structure according to an embodiment of the present application.

[0027] Figure 4 is a diagram illustrating a partition type in which a binary tree-based partition is allowed according to an embodiment of the present application.

[0028] Figure 5 is a diagram illustrating an example in which only a predetermined type of binary tree-based partition is allowed according to an embodiment of the present application.

[0029] Figure 6 is a diagram for explaining an example in which information related to the allowed number of binary tree partitions is encoded / decoded according to an embodiment of the present application to which the present application is applied.

[0030] Figure 7 is a diagram illustrating a partition mode applicable to a coding block according to an embodiment of the present application.

[0031] Figure 8 is a diagram illustrating a type of a predefined intra prediction mode of an apparatus for encoding / decoding a video according to an embodiment of the present application.

[0032] Figure 9 is a diagram illustrating an extended intra prediction mode type according to an embodiment of the present application.

[0033] Figure 10is a flowchart briefly showing an intra prediction method according to an embodiment of the present application.

[0034] Figure 11 is a diagram showing a method of correcting prediction samples of a current block based on difference information of neighboring samples according to an embodiment of the present application.

[0035] Figure 12 and Figure 13 is a diagram showing a one-dimensional reference sample group in which reference samples are rearranged into a line.

[0036] Figure 14 is a flowchart showing a method of performing intra prediction based on sub-blocks.

[0037] Figure 15 is a diagram showing a partition type of sub-blocks according to an intra prediction mode.

[0038] Figure 16 and Figure 17 is a diagram showing an example of performing intra prediction based on sub-blocks.

[0039] Figure 18 is a diagram showing an example of applying the same weight based on a predetermined block.

[0040] Figure 19 is a diagram showing an example of performing intra weighted prediction in stages. DETAILED DESCRIPTION

[0041] Various modifications can be made to the present application, and there are various embodiments of the present application. Examples of the embodiments will now be provided with reference to the accompanying drawings and will be described in detail. However, the present application is not limited thereto, and the exemplary embodiments can be interpreted to include all modifications, equivalents, or alternatives within the technical concept and technical scope of the present application. In the described drawings, like reference numerals refer to like elements.

[0042] The terms "first", "second", and the like used in the specification can be used to describe various components, but the components should not be construed as being limited to the terms. The terms are used only to distinguish one component from another component. For example, a "first" component can be referred to as a "second" component, and a "second" component can also be similarly referred to as a "first" component without departing from the scope of the present application. The term "and / or" includes a combination of a plurality of items or any one of the plurality of items.

[0043] It will be understood that, in this specification, where a element is simply stated to be "connected to" or "coupled to" another element without qualification, the element can be either "directly connected to" or "directly coupled to" the other element or be connected to or coupled to the other element with other elements interposed therebetween. In contrast, it will be understood that where an element is stated to be "directly coupled to" or "directly connected to" another element, no intervening elements are present.

[0044] The terminology used in the present specification is for the purpose of describing particular embodiments only and is not intended to limit the present application. Expressions such as "include", "comprise", "have", "contain", or "determine" are used herein to express the presence of the features, numbers, steps, actions, elements, components, or combinations thereof disclosed in the specification, and are not intended to preclude the presence or possibility of one or more other features, numbers, steps, actions, elements, components, or combinations thereof.

[0045] Hereinafter, preferred embodiments of the present application will be described in detail with reference to the accompanying drawings. In the following description, like constituent elements in the drawings are designated by like reference numerals, and repetitive description of the same elements will be omitted.

[0046] Figure 1 is a block diagram illustrating an apparatus for encoding video according to an embodiment of the present application.

[0047] Referring to Figure 1 The apparatus 100 for encoding video can include a picture partitioning module 110, prediction modules 120, 125, a transform module 130, a quantization module 135, a rearrangement module 160, an entropy encoding module 165, an inverse quantization module 140, an inverse transform module 145, a filter module 150, and a memory 155.

[0048] Figure 1 The illustrated constituent elements are independently illustrated to represent different feature functions from each other in the apparatus for encoding video, but do not mean that each constituent element is constituted by a separate hardware or software constituent unit. In other words, each constituent element includes each of the enumerated constituent elements for convenience. Accordingly, at least two of the constituent elements in each constituent element can be combined to form one constituent element, or one constituent element can be divided into a plurality of constituent elements to perform each function. Embodiments in which each constituent element is combined and embodiments in which one constituent element is divided are also included in the scope of the present application if the essence of the present application is not departed from.

[0049] Furthermore, some constituent elements may not be essential for performing the basic functions of the invention, but are selective elements that only improve its performance. The invention can be implemented by including only the essential constituent elements necessary for realizing the essence of the invention, excluding those used to improve performance. Structures that include only the essential constituent elements, excluding those selectively used to improve performance, are also included within the scope of the invention.

[0050] Image segmentation module 110 can segment an input image into one or more processing units. Here, the processing unit can be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). Image segmentation module 110 can segment an image into a combination of multiple coding units, prediction units, and transform units, and can encode the image by selecting the combination of coding units, prediction units, and transform units according to a predetermined criterion (e.g., a cost function).

[0051] For example, an image can be segmented into multiple coding units. A recursive tree structure, such as a quadtree, can be used to segment the image into coding units. A coding unit rooted at an image or the largest coding unit and divided into other coding units can have child nodes corresponding to the number of coding units it was divided into. Coding units no longer subject to predetermined segmentation restrictions are used as leaf nodes. That is, assuming a coding unit can only be segmented into squares, a coding unit can be segmented into at most four other coding units.

[0052] In the following, in embodiments of the present invention, a coding unit may refer to a unit that performs encoding or a unit that performs decoding.

[0053] A prediction unit can be one of the partitions in a single coding unit that are divided into square or rectangular shapes of the same size, or a prediction unit can be one of the partitions in a single coding unit that are divided into such that one prediction unit in a single coding unit has a different shape and / or size than the other prediction units.

[0054] When a prediction unit is generated to perform intra-frame prediction based on a coding unit and that coding unit is not the smallest coding unit, intra-frame prediction can be performed without dividing the coding unit into multiple prediction units N×N.

[0055] The prediction modules 120, 125 can include an inter-prediction module 120 that performs inter-prediction and an intra-prediction module 125 that performs intra-prediction. It can be determined whether to perform inter-prediction or intra-prediction for a prediction unit, and detailed information according to each prediction method (e.g., an intra-prediction mode, a motion vector, a reference picture, etc.) can be determined. Here, a processing unit for which prediction is performed can be different from a processing unit for which a prediction method and detailed contents are determined. For example, a prediction method, a prediction mode, etc. can be determined based on a prediction unit, and prediction can be performed based on a transform unit. A residual value (a residual block) between a generated prediction block and an original block can be input to the transform module 130. In addition, prediction mode information, motion vector information, etc. used for prediction can be encoded with residual values in the entropy encoding module 165 and can be transmitted to an apparatus for decoding a video. When a specific encoding mode is used, an original block can be transmitted to an apparatus for decoding a video by being encoded as it is without generating a prediction block through the prediction modules 120, 125.

[0056] In some cases, the inter-prediction module 120 can predict a prediction unit based on information of at least one of a previous picture or a subsequent picture of a current picture, or can predict a prediction unit based on information of some encoded regions in the current picture. The inter-prediction module 120 can include a reference picture interpolation module, a motion prediction module, and a motion compensation module.

[0057] The reference picture interpolation module can receive reference picture information from the memory 155 and can generate integer-pel or sub-integer-pel pixel information from the reference picture. In the case of a luma pixel, an 8-tap DCT-based interpolation filter having different filter coefficients can be used to generate integer-pel or sub-integer-pel pixel information based on ¼-pel. In the case of a chroma signal, a 4-tap DCT-based interpolation filter having different filter coefficients can be used to generate integer-pel or sub-integer-pel pixel information based on 1 / 8-pel.

[0058] The motion prediction module can perform motion prediction based on a reference picture interpolated by the reference picture interpolation module. Various methods such as a full search-based block matching algorithm (FBMA), a three-step search (TSS), a new three-step search algorithm (NTS), etc. can be used as a method for calculating a motion vector. A motion vector can have a motion vector value based on ½-pel or ¼-pel based on an interpolated pixel. The motion prediction module can predict a current prediction unit by changing a motion prediction method. Various methods such as a skip method, a merge method, an AMVP (advanced motion vector prediction) method, an intra-block copy method, etc. can be used as a motion prediction method.

[0059] The intra prediction module 125 can generate a prediction unit based on reference pixel information adjacent to the current block, which is pixel information in the current picture. In a case where the neighboring block of the current prediction unit is a block subjected to inter prediction and thus the reference pixel is a pixel subjected to inter prediction, the reference pixel information of the neighboring block subjected to intra prediction can be replaced with the reference pixel included in the block subjected to inter prediction. That is, when the reference pixel is unavailable, at least one of the available reference pixels can be used instead of the unavailable reference pixel information.

[0060] The prediction mode in the intra prediction can include a directional prediction mode using reference pixel information according to a prediction direction and a non-directional prediction mode not using direction information when performing prediction. The mode for predicting luma information can be different from the mode for predicting chroma information, and to predict the chroma information, the intra prediction mode information or the predicted luma signal information used for predicting the luma information can be utilized.

[0061] In a case where the size of the prediction unit is the same as the size of the transform unit when performing the intra prediction, the prediction unit can be performed based on the pixels located at the left, the upper left, and the top of the prediction unit. However, in a case where the size of the prediction unit is different from the size of the transform unit when performing the intra prediction, the intra prediction can be performed using the reference pixels based on the transform unit. In addition, the intra prediction using the N x N partitioning can be used only for the smallest coding unit.

[0062] In the intra prediction method, depending on the prediction mode, the prediction block can be generated after applying an AIS (adaptive intra smoothing) filter to the reference pixels. The type of the AIS filter applied to the reference pixels can be different. To perform the intra prediction method, the intra prediction mode of the current prediction unit can be predicted according to the intra prediction mode of the prediction unit adjacent to the current prediction unit. In the prediction of the prediction mode of the current prediction unit by using the mode information predicted according to the adjacent prediction unit, in a case where the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the adjacent prediction unit, information indicating that the prediction mode of the current prediction unit and the prediction mode of the adjacent prediction unit are the same as each other can be transmitted using predetermined flag information. In a case where the prediction mode of the current prediction unit is different from the prediction mode of the adjacent prediction unit, entropy encoding can be performed to encode the prediction mode information of the current block.

[0063] In addition, a residual block including information on residual values, which are differences between the prediction unit subjected to prediction and the original block of the prediction unit, can be generated based on the prediction unit generated by the prediction module 120, 125. The generated residual block can be input to the transform module 130.

[0064] The transform module 130 can transform a residual block including information on residual values between an original block and a prediction unit generated by the prediction modules 120, 125 by using a transform method such as a discrete cosine transform (DCT), a discrete sine transform (DST), and a KLT. Whether to apply the DCT, the DST, or the KLT in order to transform the residual block can be determined based on intra prediction mode information of the prediction unit used to generate the residual block.

[0065] The quantization module 135 can quantize values transformed to a frequency domain by the transform module 130. The quantization coefficients can vary according to the importance of a picture or a block. Values calculated by the quantization module 135 can be provided to the inverse quantization module 140 and the rearrangement module 160.

[0066] The rearrangement module 160 can rearrange coefficients of the quantized residual values.

[0067] The rearrangement module 160 can change coefficients in a two-dimensional block form to coefficients in a one-dimensional vector form by a coefficient scanning method. For example, the rearrangement module 160 can scan from a DC coefficient to a coefficient in a high frequency domain using a zigzag scanning method in order to change the coefficients to a one-dimensional vector form. Depending on the size of a transform unit and an intra prediction mode, vertical direction scanning that scans coefficients in a two-dimensional block form in a column direction or horizontal direction scanning that scans coefficients in a two-dimensional block form in a row direction can be used instead of the zigzag scanning. That is, which scanning method to use among the zigzag scanning, the vertical direction scanning, and the horizontal direction scanning can be determined depending on the size of the transform unit and the intra prediction mode.

[0068] The entropy encoding module 165 can perform entropy encoding based on values calculated by the rearrangement module 160. The entropy encoding can use various encoding methods such as exponential Golomb encoding, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC).

[0069] The entropy encoding module 165 can encode various information from the rearrangement module 160 as well as the prediction modules 120, 125, such as block type information and residual value coefficient information of a coding unit, prediction mode information, partition unit information, prediction unit information, transform unit information, motion vector information, reference frame information, block interpolation information, filtering information, etc.

[0070] The entropy encoding module 165 can entropy-encode coefficients of a coding unit input from the rearrangement module 160.

[0071] The inverse quantization module 140 can inverse quantize values quantized by the quantization module 135, and the inverse transform module 145 can inverse transform values transformed by the transform module 130. Residual values generated by the inverse quantization module 140 and the inverse transform module 145 can be combined with a prediction unit predicted by the motion estimation module, the motion compensation module, and the intra prediction module of the prediction module 120, 125, so that a reconstructed block can be generated.

[0072] The filter module 150 can include at least one of a deblocking filter, an offset correction unit, or an adaptive loop filter (ALF).

[0073] The deblocking filter can remove block distortion caused by a boundary between blocks in a reconstructed picture. In order to determine whether to perform deblocking, pixels included in a certain number of rows or a certain number of columns in a block can be a basis for determining whether to apply a deblocking filter to the current block. In the case where the deblocking filter is applied to a block, a strong filter or a weak filter can be applied depending on the deblocking filter strength required. Furthermore, in applying the deblocking filter, horizontal direction filtering and vertical direction filtering can be processed in parallel.

[0074] The offset correction module can correct an offset from an original picture based on pixels in a picture subjected to deblocking. In order to perform offset correction for a certain picture, a method of applying an offset considering edge information of each pixel or a method of dividing pixels of a picture into a predetermined number of regions, determining regions to be subjected to an offset, and applying the offset to the determined regions can be used.

[0075] The adaptive loop filter (ALF) can be performed based on values obtained by comparing a filtered reconstructed picture with an original picture. Pixels included in a picture can be divided into predetermined groups, a filter to be applied to each of the groups can be determined, and filtering can be performed individually for each group. Information on whether to apply the ALF and a luma signal can be transmitted through a coding unit (CU). The shape of a filter for the ALF and a filter coefficient can vary according to each block. Furthermore, a filter for the ALF of the same shape (fixed shape) can be applied regardless of the characteristics of an application target block.

[0076] The memory 155 can store reconstructed blocks or pictures calculated through the filter module 150. In performing inter prediction, the stored reconstructed blocks or pictures can be provided to the prediction module 120, 125.

[0077] Figure 2 is a block diagram illustrating an apparatus for decoding a video according to an embodiment of the present application.

[0078] Referring to Figure 2The apparatus 200 for decoding video can include an entropy decoding module 210, a rearranging module 215, an inverse quantization module 220, an inverse transform module 225, prediction modules 230, 235, a filter module 240, and a memory 245.

[0079] When a video bitstream is input from the apparatus for encoding video, the input bitstream can be decoded according to inverse processes of the apparatus for encoding video.

[0080] The entropy decoding module 210 can perform entropy decoding according to inverse processes of entropy encoding by the entropy encoding module of the apparatus for encoding video. For example, various methods such as exponential Golomb encoding, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC) can be applied corresponding to the method performed by the apparatus for encoding video.

[0081] The entropy decoding module 210 can decode information about intra prediction and inter prediction performed by the apparatus for encoding video.

[0082] The rearranging module 215 can perform rearranging on the bitstream entropy decoded by the entropy decoding module 210 based on a rearranging method used in the apparatus for encoding video. The rearranging module can reconstruct and rearrange coefficients in one-dimensional vector form into coefficients in two-dimensional block form. The rearranging module 215 can receive information about coefficient scanning performed in the apparatus for encoding video, and can perform rearranging via a method of inverse scanning coefficients based on a scanning order performed in the apparatus for encoding video.

[0083] The inverse quantization module 220 can perform inverse quantization based on a quantization parameter received from the apparatus for encoding video and rearranged coefficients of a block.

[0084] The inverse transform module 225 can perform inverse transform, i.e., inverse DCT, inverse DST, and inverse KLT, which is an inverse process of transform, i.e., DCT, DST, and KLT, performed by the transform module of the apparatus for encoding video. The inverse transform can be performed based on a transform unit determined by the apparatus for encoding video. The inverse transform module 225 of the apparatus for decoding video can selectively perform a transform scheme (e.g., DCT, DST, and KLT) according to various information such as a prediction method, a size of a current block, a prediction direction, etc.

[0085] The prediction modules 230, 235 can generate a prediction block based on information generated with respect to the prediction block received from the entropy decoding module 210 and previously decoded block or picture information received from the memory 245.

[0086] As described above, similar to the operation of the apparatus for encoding video, in performing intra prediction, in a case where the size of the prediction unit is the same as the size of the transform unit, the prediction unit can be performed based on the pixels located at the left, top-left, and top of the prediction unit. In performing intra prediction, in a case where the size of the prediction unit is different from the size of the transform unit, the intra prediction can be performed using the reference pixels based on the transform unit. Further, the intra prediction using NxN partitioning can be used only for the smallest coding unit.

[0087] The prediction modules 230, 235 can include a prediction unit determination module, an inter prediction module, and an intra prediction module. The prediction unit determination module can receive various information such as prediction unit information, prediction mode information of an intra prediction method, information on motion prediction of an inter prediction method, etc. from the entropy decoding module 210, can partition a current coding unit into prediction units, and can determine whether to perform inter prediction or intra prediction on the prediction units. The inter prediction module 230 can perform inter prediction on a current prediction unit based on information of at least one of a previous picture or a subsequent picture of a current picture including the current prediction unit by using information required for inter prediction of the current prediction unit received from the apparatus for encoding video. Alternatively, the inter prediction can be performed based on information of some pre-reconstructed regions in the current picture including the current prediction unit.

[0088] To perform inter prediction, it can be determined for a coding unit which one of a skip mode, a merge mode, an AMVP mode, and an inter block copy mode is used as a motion prediction method of a prediction unit included in the coding unit.

[0089] The intra prediction module 235 can generate a prediction block based on pixel information in a current picture. In a case where the prediction unit is a prediction unit subjected to intra prediction, the intra prediction can be performed based on intra prediction mode information of the prediction unit received from the apparatus for encoding video. The intra prediction module 235 can include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation module, and a DC filter. The AIS filter performs filtering on reference pixels of a current block, and can determine whether to apply the filter according to a prediction mode of the current prediction unit. The AIS filtering can be performed on the reference pixels of the current block by using AIS filter information and the prediction mode of the prediction unit received from the apparatus for encoding video. In a case where the prediction mode of the current block is a mode in which the AIS filtering is not performed, the AIS filter can not be applied.

[0090] In a case where the prediction mode of the prediction unit is a prediction mode in which intra prediction is performed based on pixel values obtained by interpolating reference pixels, the reference pixel interpolation module can interpolate the reference pixels to generate reference pixels that are integer pixels or less than integer pixels. In a case where the prediction mode of the current prediction unit is a prediction mode in which the prediction block is generated without interpolating the reference pixels, the reference pixels can not be interpolated. In a case where the prediction mode of the current block is a DC mode, the DC filter can generate the prediction block by filtering.

[0091] The reconstructed block or picture can be provided to the filter module 240. The filter module 240 can include a deblocking filter, an offset correction module, and an ALF.

[0092] Information about whether to apply a deblocking filter to a corresponding block or picture and information about which one of a strong filter and a weak filter to apply when the deblocking filter is applied can be received from the apparatus for encoding a video. The deblocking filter of the apparatus for decoding a video can receive information about the deblocking filter from the apparatus for encoding a video, and can perform deblocking filtering on a corresponding block.

[0093] The offset correction module can perform offset correction on a reconstructed picture based on type and offset value information of offset correction applied to the picture when encoding is performed.

[0094] An ALF can be applied to a coding unit based on information about whether to apply the ALF, ALF coefficient information, etc., received from the apparatus for encoding a video. The ALF information can be provided as information included in a specific parameter set.

[0095] The memory 245 can store a reconstructed picture or block used as a reference picture or block, and can provide the reconstructed picture to the output module.

[0096] As described above, in the embodiments of the present application, a coding unit is used as a term representing a unit for encoding for convenience of explanation, but the coding unit can be used as a unit that performs decoding as well as encoding.

[0097] Further, the current block can represent a target block to be encoded / decoded. Also, depending on an encoding / decoding step, the current block can represent a coding tree block (or coding tree unit), a coding block (or coding unit), a transform block (or transform unit), a prediction block (or prediction unit), etc.

[0098] A picture can be encoded / decoded by being split into a basic block having a square shape or a non-square shape. At this time, the basic block can be referred to as a coding tree unit. The coding tree unit can be defined as a coding unit of the maximum size allowed within a sequence or a slice. Information about whether the coding tree unit is square or non-square or information about the size of the coding tree unit can be signaled through a sequence parameter set, a picture parameter set, or a slice header. The coding tree unit can be split into a partition of a smaller size. At this time, if it is assumed that the depth of a partition generated by dividing the coding tree unit is 1, the depth of a partition generated by dividing the partition having the depth 1 can be defined as 2. That is, a partition generated by dividing a partition having a depth k in the coding tree unit can be defined as having a depth k+1.

[0099] A partition of an arbitrary size generated by dividing the coding tree unit can be defined as a coding unit. The coding unit can be split or partitioned recursively into a basic unit for performing prediction, quantization, transformation, or in-loop filtering, etc. For example, a partition of an arbitrary size generated by dividing the coding tree unit can be defined as a coding unit, or can be defined as a transform unit or a prediction unit, which are basic units for performing prediction, quantization, transformation, in-loop filtering, etc.

[0100] The splitting of the coding tree unit or the coding unit can be performed based on at least one of a vertical line or a horizontal line. Also, the number of the vertical lines or the horizontal lines by which the coding tree unit or the coding unit is split can be at least one or more. For example, the coding tree unit or the coding unit can be split into two partitions using one vertical line or one horizontal line, or can be split into three partitions using two vertical lines or two horizontal lines. Alternatively, the coding tree unit or the coding unit can be split into four partitions having 1 / 2 length and width by using one vertical line and one horizontal line.

[0101] When the coding tree unit or the coding unit is split into a plurality of partitions using at least one vertical line or at least one horizontal line, the partitions can have uniform sizes or different sizes. Alternatively, any one partition can have a size different from the remaining partitions.

[0102] In the embodiments described below, it is assumed that the coding tree unit or the coding unit is split into a quad-tree structure, a ternary tree structure, or a binary tree structure. However, a greater number of vertical lines or a greater number of horizontal lines can also be used to split the coding tree unit or the coding unit.

[0103] Figure 3 FIG. 1 is a diagram illustrating an example of hierarchically splitting a coding block based on a tree structure according to an embodiment of the present application.

[0104] An input video signal is decoded in a predetermined block unit. Such a default unit for decoding the input video signal is a coding block. The coding block can be a unit in which intra / inter prediction, transform, and quantization are performed. Further, a prediction mode (e.g., an intra prediction mode or an inter prediction mode) is determined based on the coding block, and prediction blocks included in the coding block can share the determined prediction mode. The coding block can be a square block or a non-square block having an arbitrary size in a range of 8x8 to 64x64, or can be a square block or a non-square block having a size of 128x128, 256x256, or more.

[0105] In detail, the coding block can be hierarchically split based on at least one of a quad tree, a ternary tree, or a binary tree. Here, the split based on the quad tree can mean that a 2Nx2N coding block is split into four NxN coding blocks, the split based on the ternary tree can mean that one coding block is split into three coding blocks, and the split based on the binary tree can mean that one coding block is split into two coding blocks. Even if the split based on the ternary tree or the split based on the binary tree is performed, a square-shaped coding block can exist in a lower depth. Further, after the split based on the ternary tree or the split based on the binary tree is performed, generation of the square-shaped coding block can be limited on the lower depth.

[0106] The split based on the binary tree can be performed symmetrically or asymmetrically. The coding block split based on the binary tree can be a square block or a non-square block such as a rectangle. For example, a split type in which the split based on the binary tree is allowed can include at least one of a symmetric type of 2NxN (horizontal direction non-square coding unit) or Nx2N (vertical direction non-square coding unit), an asymmetric type of nLx2N, nRx2N, 2Nx nU, or 2Nx nD.

[0107] The split based on the binary tree can be limited to one of a symmetric type split or an asymmetric type split. In this case, constructing a coding tree unit with a square block can correspond to a quad tree CU split, and constructing the coding tree unit with a symmetric non-square block can correspond to a binary tree split. Constructing the coding tree unit with a square block and a symmetric non-square block can correspond to a quad tree and a binary tree CU split.

[0108] The split based on the binary tree can be performed on a coding block in which the split based on the quad tree is not performed. The split based on the quad tree, the split based on the ternary tree, or at least one of the split based on the binary tree can not be performed on the coding block split based on the binary tree.

[0109] Alternatively, the split based on the ternary tree or the split based on the binary tree can be enabled for the coding block split based on the binary tree, but only one of a horizontal split or a vertical split can be allowed in a limited manner.

[0110] For example, for a coding block that is split based on a binary tree, the additional splitting or the additional splitting direction can be limited according to a position, an index, a shape of the coding block that is split based on a binary tree, or an additional splitting type of a neighboring partition, etc. For example, when an index of a coding block that is in an earlier coding order among two coding blocks generated by splitting based on a binary tree is 0 (hereinafter referred to as coding block index 0) and an index of a coding block that is in a later coding order among the two coding blocks generated by splitting based on a binary tree is 1 (hereinafter referred to as coding block index 1), in a case where splitting based on a binary tree is applied to all coding blocks having the coding block index 0 or the coding block index 1, a splitting direction based on a binary tree of the coding block having the coding block index 1 can be determined according to a splitting direction based on a binary tree of the coding block having the coding block index 0. Specifically, when the splitting direction based on a binary tree of the coding block having the coding block index 0 splits the coding block having the coding block index 0 into square partitions, the splitting based on a binary tree of the coding block having the coding block index 1 can be limited to have a different direction from the splitting based on a binary tree of the coding block having the coding block index 1. Thus, it is possible to limit the coding blocks having the coding block index 0 and the coding block index 1 to be split into square partitions. In this case, encoding / decoding of information indicating a binary tree splitting direction of the coding block having the coding block index 1 can be omitted. This is because an effect of splitting all the coding blocks having the coding block index 0 and the coding block index 1 into square partitions is the same as an effect of splitting a higher depth block based on a quad tree, and thus it is not desirable to cause all the coding blocks to be split into square partitions in terms of coding efficiency.

[0111] Splitting based on a ternary tree means splitting a coding block into three partitions in a horizontal direction or a vertical direction. All the three partitions generated due to splitting based on a ternary tree can have different sizes. Alternatively, two of the partitions generated due to splitting based on a ternary tree can have the same size, and the other partition can have a different size. For example, depending on a splitting direction, a width ratio or a height ratio of the partitions generated when a coding block is split can be set to 1:n:1, 1:1:n, n:1:1, or m:n:1. Here, m and n can be 1 or a real number greater than 1, for example, an integer such as 2.

[0112] Splitting based on a ternary tree can be performed on a coding block for which splitting based on a quad tree is no longer performed. For a coding block that is split based on a ternary tree, at least one of splitting based on a quad tree, splitting based on a ternary tree, or splitting based on a binary tree can be set not to be performed.

[0113] Alternatively, it can be made possible to use a triple tree-based partition or a binary tree-based partition for a coding block partitioned based on a triple tree, but it can be restrictively allowed to allow only one of a horizontal partition or a vertical partition.

[0114] For example, for a coding block partitioned based on a triple tree, additional partitioning or an additional partitioning direction can be restricted according to a position, an index, a shape, or an additional partitioning type of a neighboring partition of the coding block partitioned based on a triple tree, etc. For example, one of a horizontal partition or a vertical partition can be limited to a partition having a largest size among coding blocks generated due to triple tree-based partitioning. Specifically, the largest partition among coding blocks generated due to triple tree-based partitioning can be made not to allow binary tree partitioning in the same direction as a triple tree partitioning direction of higher depth partitioning or triple tree partitioning in the same direction as the triple tree partitioning direction of higher depth partitioning. In this case, for the largest partition among coding blocks partitioned based on a triple tree, encoding / decoding of information indicating a binary tree partitioning direction or a triple tree partitioning direction can be omitted.

[0115] Partitioning of a lower depth can be determined according to a partitioning type of a higher depth. For example, when binary tree-based partitioning is allowed in two or more depths, binary tree-based partitioning having the same type as binary tree partitioning of a higher depth can be allowed only in a lower depth. For example, in the case where binary tree-based partitioning is performed in a 2NxN type in a higher depth, binary tree-based partitioning performed in a 2NxN type can be performed in a lower depth. Alternatively, in the case where binary tree-based partitioning is performed in an Nx2N type in a higher depth, Nx2N type binary tree-based partitioning can be allowed in a lower depth.

[0116] In contrast, binary tree-based partitioning having a different type from binary tree partitioning of a higher depth can be allowed only in a lower depth.

[0117] For a sequence, a slice, a coding tree unit, or a coding unit, it can be restricted to use only a special type of binary tree-based partitioning or a special type of triple tree-based partitioning. For example, it can be restricted to allow only 2NxN or Nx2N type binary tree-based partitioning for a coding tree unit. The allowed partitioning type can be pre-defined in an encoder or a decoder, and information about the allowed partitioning type or the disallowed partitioning type can be encoded and signaled through a bitstream.

[0118] Figure 5 FIG. 1 is a diagram illustrating an example in which only a specific type of binary tree-based partitioning is allowed. Figure 5 (a) of FIG. 1 illustrates an example in which only Nx2N type binary tree-based partitioning is allowed, and Figure 5(b) shows an example of allowing only 2NxN type of binary tree based partitioning. In order to implement the adaptive partitioning based on the quad tree or the binary tree, information indicating the quad tree based partitioning, information on the size / depth of the coding block allowing the quad tree based partitioning, information indicating the binary tree based partitioning, information on the size / depth of the coding block allowing the binary tree based partitioning, information on the size / depth of the coding block not allowing the binary tree based partitioning, information on whether to perform the binary tree based partitioning in the vertical direction or the horizontal direction, and the like can be used.

[0119] Further, information on the number of times of allowing the binary tree / triple tree partitioning, information on the depth of allowing the binary tree / triple tree partitioning, or information on the number of the depth of allowing the binary tree / triple tree partitioning can be acquired with respect to the coding tree unit or the specific coding unit. The information can be coded based on the coding tree unit or the coding unit and can be transmitted to the decoder through the bitstream.

[0120] For example, a syntax "max_binary_depth_idx_minus1" indicating the maximum depth of allowing the binary tree partitioning can be coded / decoded through the bitstream. In this case, max_binary_depth_idx_minus1+1 can indicate the maximum depth of allowing the binary tree partitioning.

[0121] Referring to Figure 6 The example shown in Figure 6 , binary tree partitioning has been performed on the coding unit of depth 2 and the coding unit of depth 3. Accordingly, at least one of information indicating the number of times (i.e., 2 times) that the binary tree partitioning has been performed in the coding tree unit, information indicating the maximum depth (i.e., depth 3) of allowing the binary tree partitioning in the coding tree unit, or information indicating the number of the depth (i.e., 2 (depth 2 and depth 3)) that the binary tree partitioning has been performed in the coding tree unit can be coded / decoded through the bitstream.

[0122] As another example, at least one of information on a number of times of allowing binary tree / triple tree splitting, information on a depth of allowing binary tree / triple tree splitting, or information on a number of depths of allowing binary tree / triple tree splitting can be acquired for each sequence or each slice. For example, the information can be encoded based on a sequence, picture, or slice unit and transmitted through a bitstream. In contrast, a depth of allowing binary tree / triple tree splitting or a number of depths of allowing binary tree / triple tree splitting can be defined for each sequence, picture, or slice unit. Accordingly, at least one of a number of binary tree / triple tree splitting in a first slice and a second slice, a maximum depth of allowing binary tree / triple tree splitting in the first slice and the second slice, or a number of depths of performing binary tree / triple tree splitting in the first slice and the second slice can be different from the second slice. For example, in the first slice, only one depth of binary tree splitting can be allowed, and in the second slice, two depths of binary tree splitting can be allowed.

[0123] As another example, a number of times of allowing binary tree / triple tree splitting, a depth of allowing binary tree / triple tree splitting, or a number of depths of allowing binary tree / triple tree splitting can be differently set according to a temporal level identifier (TemporalID) of a slice or a picture. Here, the temporal level identifier (TemporalID) is used to identify each of a plurality of layers of a video having scalability in at least one of a view, a space, a time, or a quality.

[0124] As illustrated in FIG. 3, Figure 3 As illustrated in FIG. 3,

[0125] The second coding block 310 of a split depth of k+1 can be split into a plurality of third coding blocks of a split depth of k+2. The splitting of the second coding block 310 can be performed by selectively using one of a quad tree and a binary tree according to a split method. Here, the split method can be determined based on at least one of information indicating a split based on a quad tree or information indicating a split based on a binary tree.

[0126] In a case where the second coding block 310 is split based on the quad-tree, the second coding block 310 can be split into four third coding blocks 310a having half the width and half the height of the second coding block, and the split depth of the third coding blocks 310a can increase to k+2. In contrast, in a case where the second coding block 310 is split based on the binary tree, the second coding block 310 can be split into two third coding blocks. Here, each of the two third coding blocks can be a non-square block having one of half the width and half the height of the second coding block, and the split depth can increase to k+2. The second coding block can be determined as a non-square block in a horizontal direction or a vertical direction according to a split direction, and the split direction can be determined based on information about whether the split based on the binary tree is performed in the vertical direction or in the horizontal direction.

[0127] Meanwhile, the second coding block 310 can be determined as a leaf coding block which is no longer split based on the quad-tree or the binary tree. In this case, the leaf coding block can be used as a prediction block or a transform block.

[0128] As with the split of the second coding block 310, the third coding blocks 310a can be determined as leaf coding blocks, or can be further split based on the quad-tree or the binary tree.

[0129] Meanwhile, the third coding block 310b split based on the binary tree can be further split into a coding block 310b-2 in a vertical direction or a coding block 310b-3 in a horizontal direction based on the binary tree, and the split depth of the related coding blocks can increase to k+3. Alternatively, the third coding block 310b can be determined as a leaf coding block 310b-1 which is no longer split 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 split process can be restrictively performed based on at least one of information about the size / depth of a coding block which allows split based on the quad-tree, information about the size / depth of a coding block which allows split based on the binary tree, or information about the size / depth of a coding block which does not allow split based on the binary tree.

[0130] The number of candidates representing the size of the coding block can be limited to a predetermined number, or the size of the coding block in a predetermined unit can have a fixed value. For example, the size of the coding block in a sequence or a picture can be limited to 256x256, 128x128, or 32x32. Information indicating the size of the coding block in a sequence or a picture can be signaled through a sequence header or a picture header.

[0131] As a result of the split based on the quad-tree and the split based on the binary tree, a coding unit can be represented as a square or a rectangle of an arbitrary size.

[0132] Depending on whether the coding block is generated based on a quad-tree partitioning, a binary-tree partitioning or a ternary-tree partitioning, the application of transform skip can be restricted.

[0133] Here, in a case where the inverse transform is skipped in both the horizontal direction and the vertical direction of the coding block, the inverse transform is not performed in both the horizontal direction and the vertical direction of the coding block. In this case, the inverse quantized residual coefficients can be scaled to a preset value to obtain the residual samples of the coding block.

[0134] Omitting the inverse transform in the horizontal direction means that the inverse transform is performed using DCT, DST, etc. in the vertical direction without performing the inverse transform in the horizontal direction. In this case, scaling can be performed in the horizontal direction.

[0135] Omitting the inverse transform in the vertical direction means that the inverse transform is performed using DCT, DST, etc. in the horizontal direction without performing the inverse transform in the vertical direction. In this case, scaling can be performed in the vertical direction.

[0136] Specifically, depending on the partitioning type of the coding block, it can be determined whether the inverse transform skip technique can be used for the coding block. For example, in a case where the coding block is generated by binary-tree based partitioning, the inverse transform skip technique can be restricted from being used for the coding block. Accordingly, in a case where the coding block is generated by binary-tree based partitioning, the residual samples of the coding block can be obtained by performing the inverse transform on the coding block. Further, in a case where the coding block is generated by binary-tree based partitioning, the encoding / decoding of information (e.g., transform_skip_flag) indicating whether the inverse transform is skipped can be omitted.

[0137] Alternatively, in a case where the coding block is generated by binary-tree based partitioning, the inverse transform skip technique can be restricted to be allowed only in at least one of the horizontal direction or the vertical direction. Here, the direction in which the inverse transform skip technique is restricted can be determined based on information decoded from the bitstream or adaptively determined based on at least one of the size of the coding block, the shape of the coding block or the intra prediction mode of the coding block.

[0138] For example, in a case where the coding block is a non-square block having a width greater than a height, the inverse transform skip technique can be allowed only for the vertical direction, and the use of the inverse transform skip technique in the horizontal direction can be restricted. That is, in a case where the coding block is 2N×N, the inverse transform can be performed in the horizontal direction of the coding block, and the inverse transform can be selectively performed in the vertical direction.

[0139] On the other hand, in a case where the coding block is a non-square block having a height greater than a width, the inverse transform skip technique can be allowed only for the horizontal direction, and use of the inverse transform skip technique in the vertical direction can be limited. That is, in a case where the coding block is Nx2N, inverse transform can be performed in the vertical direction of the coding block, and inverse transform can be selectively performed in the horizontal direction.

[0140] In comparison with the above example, in a case where the coding block is a non-square block having a width greater than a height, the inverse transform skip technique is allowed only for the horizontal direction, and in a case where the coding block is a non-square block having a height greater than a width, the inverse transform skip technique is allowed only for the vertical direction.

[0141] Information on whether to skip inverse transform in the horizontal direction or information indicating whether to skip inverse transform in the vertical direction can be signaled through a bitstream. For example, the information on whether to skip inverse transform in the horizontal direction can be a 1-bit flag “hor_transform_skip_flag”, and the information indicating whether to skip inverse transform in the vertical direction can be a 1-bit flag “ver_transform_skip_flag”. The encoder can encode at least one of “hor_transform_skip_flag” or “ver_transform_skip_flag” according to a shape of the coding block. Further, the decoder can use at least one of “hor_transform_skip_flag” or “ver_transform_skip_flag” to determine whether to skip inverse transform in the horizontal direction or the vertical direction.

[0142] Depending on a partition type of the coding block, it can be set to omit inverse transform in either direction. For example, in a case where the coding block is generated through binary tree-based partitioning, inverse transform in the horizontal direction or the vertical direction can be omitted. That is, if the coding block is generated through binary tree-based partitioning, but information indicating whether to skip inverse transform of the coding block (e.g., transform_skip_flag, hor_transform_skip_flag, ver_transform_skip_flag) is not encoded / decoded, it can be determined whether to skip inverse transform in at least one of the horizontal direction or the vertical direction with respect to the coding block.

[0143] The encoding block is encoded using at least one of a skip mode, an intra prediction, an inter prediction, or a skip method. Once the encoding block is determined, a prediction block can be determined through a prediction partition of the encoding block. The prediction partition of the encoding block can be performed through a partition mode (Part mode) indicating a partition type of the encoding block. A size or shape of the prediction block can be determined according to the partition mode of the encoding block. For example, the size of the prediction block determined according to the partition mode can be equal to or smaller than the size of the encoding block.

[0144] Figure 7 FIG. 1 is a diagram illustrating partition modes applicable to an encoding block in a case where the encoding block is encoded through inter prediction.

[0145] In a case where the encoding block is encoded through inter prediction, one of 8 partition modes can be applied to the encoding block, as in the example shown in FIG. 1. Figure 7

[0146] In a case where the encoding block is encoded through intra prediction, the partition mode PART_2N×2N or the partition mode PART_N×N can be applied to the encoding block.

[0147] In a case where the encoding block has a minimum size, PART_N×N can be applied. Here, the minimum size of the encoding block can be defined in advance in the encoder and the decoder. Alternatively, information about the minimum size of the encoding block can be signaled via a bitstream. For example, the minimum size of the encoding block can be signaled through a slice header so that the minimum size of the encoding block can be defined in each slice.

[0148] Generally, the prediction block can have a size from 64×64 to 4×4. However, in a case where the encoding block is encoded through inter prediction, the prediction block can be limited not to have a 4×4 size so as to reduce a memory bandwidth when performing motion compensation.

[0149] Figure 8 FIG. 2 is a diagram illustrating types of predefined intra prediction modes for an apparatus for encoding / decoding a video according to an embodiment of the present application.

[0150] The apparatus for encoding / decoding a video can perform intra prediction using one of the predefined intra prediction modes. The predefined intra prediction modes for intra prediction can include non-directional prediction modes (e.g., planar mode, DC mode) and 33 directional prediction modes.

[0151] ​Alternatively, to improve the accuracy of intra prediction, a greater number of directional prediction modes than 33 directional prediction modes can be used. That is, M extended directional prediction modes (M>33) can be defined by subdividing the angles of the directional prediction modes, and at least one of the 33 predefined directional prediction modes can be used to derive a directional prediction mode having a predetermined angle.

[0152] In particular, a greater number of intra prediction modes than the 35 intra prediction modes shown in FIG. 1 can be used. At this time, using a greater number of intra prediction modes than the 35 intra prediction modes can be referred to as extended intra prediction modes. Figure 8

[0153] An example of the extended intra prediction modes is shown, and the extended intra prediction modes can include 2 non-directional prediction modes and 65 extended directional prediction modes. The same number of extended intra prediction modes can be used for the luma component and the chroma components, or different numbers of intra prediction modes can be used for each component. For example, 67 extended intra prediction modes can be used for the luma component, and 35 intra prediction modes can be used for the chroma component. Figure 9 Alternatively, depending on the chroma format, different numbers 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 luma component to perform intra prediction, and 35 intra prediction modes can be used for the chroma component. In the case of the 4:4:4 format, 67 intra prediction modes can be used for both the luma component and the chroma components to perform intra prediction.

[0154] Alternatively, depending on the size and / or shape of the block, different numbers 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, in the case of the CU or PU having a size smaller than 64x64 or being asymmetrically partitioned, 35 intra prediction modes can be used to perform intra prediction. In the case of the size of the CU or PU being equal to or greater than 64x64, 67 intra prediction modes can be used to perform intra prediction. For Intra_2N×2N, 65 directional intra prediction modes can be allowed, and for Intra_N×N, only 35 directional intra prediction modes can be allowed.

[0155]

[0156] ​For each sequence, picture or slice, the size of the block to which the extended intra prediction mode is applied can be set differently. For example, it is set that the extended intra prediction mode is applied to a block (e.g., CU or PU) having a size greater than 64x64 in a first slice. On the other hand, it is set that the extended intra prediction mode is applied to a block having a size greater than 32x32 in a second slice. Information indicating the size of the block to which the extended intra prediction mode is applied can be signaled based on the sequence, picture or slice. For example, the information indicating the size of the block to which the extended intra prediction mode is applied can be defined as "log2_extended_intra_mode_size_minus4" obtained by taking the log of the size of the block and then subtracting an integer 4. For example, if the value of log2_extended_intra_mode_size_minus4 is 0, it can be indicated that the extended intra prediction mode can be applied to a block having a size equal to or greater than 16x16. And if the value of log2_extended_intra_mode_size_minus4 is 1, it can be indicated that the extended intra prediction mode can be applied to a block having a size equal to or greater than 32x32.

[0157] As described above, the number of intra prediction modes can be determined considering at least one of the color component, the chroma format or the size or shape of the block. Also, the number of intra prediction mode candidates (e.g., the number of MPMs) for determining the intra prediction mode of the current block to be encoded / decoded can be determined according to at least one of the color component, the color format, or the size or shape of the block. Also, more number of intra prediction modes than Figure 8 the directionality prediction modes shown in FIG. 2 can be used. For example, 129 directionality prediction modes and 2 non-directionality prediction modes can be used by further subdividing Figure 8 the directionality prediction modes shown in FIG. 2. Whether to use more number of intra prediction modes than Figure 8 the intra prediction modes shown in FIG. 2 can be determined considering at least one of the color component, the color format component, the size or shape of the block in the examples as described above.

[0158] According to the directionality of the intra prediction mode, the directionality intra prediction modes can be classified into a plurality of groups. For example, a first group can indicate the intra prediction modes having a smaller value than the intra prediction modes in the horizontal direction as the directionality intra prediction mode toward the lower-left direction. The first group intra prediction mode can be referred to as a bottom horizontal intra prediction mode. For example, the intra prediction modes smaller than 10 among the 35 intra prediction modes or the intra prediction modes having a mode value smaller than 16 among the 67 intra prediction modes can be included in the first group.

[0159] The second group can indicate intra prediction modes having smaller mode values than the intra prediction mode in the upper-left diagonal direction, starting from the intra prediction mode in the horizontal direction. The second group of intra prediction modes can be referred to as top horizontal intra prediction modes. For example, the intra prediction modes having mode values of 10 or more and less than 18 among the 35 intra prediction modes or the intra prediction modes having mode values of 16 or more and less than 34 among the 67 intra prediction modes can be included in the second group.

[0160] The third group can indicate intra prediction modes having smaller mode values than the intra prediction modes in the vertical direction, starting from the intra prediction mode in the upper-left diagonal direction. The third group of intra prediction modes can be referred to as left vertical intra prediction modes. For example, the intra prediction modes having mode values of 18 or more and less than 26 among the 35 intra prediction modes or the intra prediction modes having mode values of 34 or more and less than 50 among the 67 intra prediction modes can be included in the third group.

[0161] The fourth group can indicate intra prediction modes having mode values that are the same as or greater than the mode values of the intra prediction modes in the vertical direction. For example, the intra prediction modes having mode values of 26 or more among the 35 intra prediction modes or the intra prediction modes having mode values of 50 or more among the 67 intra prediction modes can be included in the fourth group.

[0162] The directional intra prediction modes can also be classified into more than four groups or less than four groups, and the range of the intra prediction modes included in each of the four groups can also be set to a range different from the description.

[0163] Referring to the accompanying drawings to be described later, a method of determining an intra prediction mode of a current block to be encoded / decoded and a method of performing intra prediction using the determined intra prediction mode will be described. Figure 1 Referring to the accompanying drawings to be described later, a method of determining an intra prediction mode of a current block to be encoded / decoded and a method of performing intra prediction using the determined intra prediction mode will be described.

[0164] Figure 10 is a flowchart briefly showing an intra prediction method according to an embodiment of the present application.

[0165] Referring to the accompanying drawings to be described later, a method of determining an intra prediction mode of a current block to be encoded / decoded and a method of performing intra prediction using the determined intra prediction mode will be described. Figure 10 At step S1000, the intra prediction mode of the current block can be determined.

[0166] In particular, an intra prediction mode of the current block can be derived based on a candidate list and an index. Here, the candidate list contains a plurality of candidates, and the plurality of candidates can be determined based on intra prediction modes of neighboring blocks adjacent to the current block. The neighboring blocks can include at least one of a block located at a top of the current block, a block located at a bottom of the current block, a block located at a left side of the current block, a block located at a right side of the current block, or a block located at a corner of the current block. The index can designate one of the plurality of candidates in the candidate list. The candidate designated by the index can be set as the intra prediction mode of the current block.

[0167] An intra prediction mode used for intra prediction of the neighboring blocks can be set as a candidate. For example, the candidate can be derived based on intra prediction modes of a left block, a top block, a lower-left neighboring block, an upper-right neighboring block, and an upper-left neighboring block of the current block. If the neighboring blocks are encoded by inter prediction, an intra prediction mode of a collocated block of the neighboring blocks can be used to derive the candidate of the current block.

[0168] Further, an intra prediction mode having a directionality similar to a directionality of an intra prediction mode of the neighboring blocks can be set as a candidate. Here, the intra prediction mode having the similar directionality can be determined by adding or subtracting a predetermined constant value to or from the intra prediction mode of the neighboring blocks. The predetermined constant value can be an integer, for example, 1, 2, or more, and can be adaptively determined according to a number of available intra prediction modes. For example, in a case where the number of available intra prediction modes is 35, the predetermined constant value can be set to 1, in a case where the number of available intra prediction modes is 67, the predetermined constant value can be set to 2. Further, in a case where the number of available intra prediction modes is 131, the predetermined constant value can be set to 4.

[0169] The candidate list can further include a default mode. The default mode can include at least one of a planar mode, a DC mode, a vertical mode, a horizontal mode, a right-up diagonal mode, or a left-up diagonal mode. The default mode can be adaptively added considering a maximum number of candidates included in the candidate list of the current block.

[0170] The maximum number of candidates that can be included in the candidate list can be three, four, five, six, seven, or more. The maximum number of candidates that can be included in the candidate list can be a fixed value preset in an apparatus for encoding / decoding a video, or can be variably determined based on characteristics of the current block. The characteristics can be a position / size / shape of the block, a number / type of intra prediction modes that can be used by the block, a color type, a color format, etc. Alternatively, information indicating the maximum number of candidates that can be included in the candidate list can be separately signaled, and the information can be used to variably determine the maximum number of candidates that can be included in the candidate list. The information indicating the maximum number of candidates can be signaled in at least one of a sequence level, a picture level, a slice level, or a block level.

[0171] The candidates included in the candidate list can be ordered in a predefined order. For example, the candidates can be arranged in the candidate list in the order of a left-side block, a top block, a lower-left block, an upper-right block, and an upper-left block. Alternatively, the order of the candidates can be variably determined according to a size or a shape of the current block. For example, in the case where the current block is a non-square block having a height greater than a width, an intra prediction mode of the top block can be arranged with a higher priority than an intra prediction mode of the left-side block.

[0172] When the extended intra prediction modes and the 35 predefined intra prediction modes are selectively used, the intra prediction modes of the neighboring blocks can be converted into an index corresponding to the extended intra prediction modes, or into an index corresponding to the 35 intra prediction modes, so that the candidates can be obtained. For the conversion into the index, a predefined table can be used, or a scaling operation based on a predetermined value can be used. Here, the predefined table can define a mapping relationship between different intra prediction mode groups (e.g., the extended intra prediction modes and the 35 intra prediction modes).

[0173] For example, in the case where the left-side neighboring block uses the 35 intra prediction modes and the intra prediction mode of the left-side neighboring block is 10 (horizontal mode), it can be converted into an index 16 corresponding to the horizontal mode among the extended intra prediction modes.

[0174] Alternatively, in the case where the top neighboring block uses the extended intra prediction modes and the intra prediction mode of the top neighboring block has an index 50 (vertical mode), it can be converted into an index 26 corresponding to the vertical mode among the 35 intra prediction modes.

[0175] Based on the above-described method of determining the intra prediction mode, the intra prediction mode can be independently obtained for each of the luminance component and the chrominance component, or the intra prediction mode of the chrominance component can be obtained according to the intra prediction mode of the luminance component.

[0176] Specifically, the intra prediction mode of the chroma component can be determined based on the intra prediction mode of the luma component, as shown in Table 1 below.

[0177] [Table 1]

[0178]

[0179] In Table 1, Intra_chroma_pred_mode refers to information signaled to specify the intra prediction mode of the chroma component, and IntraPredModeY indicates the intra prediction mode of the luma component.

[0180] Referring to Figure 10 The reference samples for the intra prediction of the current block can be obtained at step S1010.

[0181] Specifically, the reference samples for the intra prediction can be obtained based on neighboring samples of the current block. The neighboring samples can be reconstructed samples of a neighboring block, and the reconstructed samples can be reconstructed samples before an in-loop filter is applied or reconstructed samples after the in-loop filter is applied.

[0182] The neighboring samples reconstructed before the current block can be used as the reference samples, and the neighboring samples filtered based on a predetermined intra filter can be used as the reference samples. The filtering of the neighboring samples using the intra filter can also be referred to as reference sample smoothing. The intra filter can include at least one of a first intra filter applied to a plurality of neighboring samples located on the same horizontal line or a second intra filter applied to a plurality of 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 selectively applied or both of the intra filters can be applied. At this time, at least one filter coefficient of the first intra filter or the second intra filter can be (1, 2, 1), but is not limited thereto.

[0183] The filtering can be adaptively performed based on at least one of the intra prediction mode of the current block or the size of the transform block of the current block. For example, in the case where the intra prediction mode of the current block is a DC mode, a vertical mode, or a horizontal mode, the filtering can not be performed. In the case where the size of the transform block is N x M, the filtering can not be performed. Here, N and M can be the same value or different values, or can be values of 4, 8, 16, or more. For example, if the size of the transform block is 4 x 4, the filtering can not be performed. Alternatively, the filtering can be selectively performed based on a predefined threshold and a comparison result between the intra prediction mode of the current block and the vertical mode (or the horizontal mode). For example, in the case where the difference between the intra prediction mode of the current block and the vertical mode is greater than the threshold, the filtering can be performed. As shown in Table 2, the threshold can be defined for each size of the transform block.

[0184] [Table 2]

[0185] 8x8 transform 16x16 transform 32x32 transform Threshold 7 1 0

[0186] The intra filter can be determined as one of a plurality of intra filter candidates predefined in an apparatus for encoding / decoding a video. To this end, a separate index specifying the intra filter of the current block among the plurality of intra filter candidates can be signaled. Alternatively, the intra filter can be determined based on at least one of a size / shape of the current block, a size / shape of a transform block, information on a filter strength, or a variation of surrounding samples.

[0187] The intra prediction on the current encoding block can be performed by using a plurality of reference sample lines. For example, the intra prediction on the current encoding block can be performed by using two or more reference sample lines.

[0188] Whether to perform the intra prediction using the plurality of reference sample lines can be determined based on a size / shape of the current block, an intra prediction mode, or the like. For example, in a case where the intra prediction mode of the current block is a non-directional intra prediction mode or a specific directional intra prediction mode, the intra prediction using the plurality of reference sample lines can be restricted. Here, the specific direction can include a vertical direction, a horizontal direction, or a diagonal direction.

[0189] Referring Figure 10 At step S1020, the intra prediction can be performed using the intra prediction mode of the current block and the reference samples.

[0190] That is, the prediction samples of the current block can be obtained using the intra prediction mode determined at step S1000 and the reference samples obtained at step S1010. In a case where the intra prediction is performed using the plurality of reference sample lines, the prediction samples can be obtained based on a weighted sum of the reference samples belonging to different reference sample lines. For example, the prediction samples can be obtained based on a weighted sum of first reference samples belonging to a first reference sample line and second reference samples belonging to a second reference sample line. In this case, the weights applied to the first reference samples and the second reference samples can have the same value or can have different values depending on a distance from a prediction target sample. For example, among the first reference samples and the second reference samples, a reference sample closer to the prediction target sample can be given a higher weight.

[0191] However, in the case of the intra prediction, the boundary samples of the neighboring blocks can be used, and thus the quality of the predicted picture can be degraded. Accordingly, a correction process can be performed on the prediction samples generated through the prediction process described above, and the predicted picture will be described with reference to Figure 11The correction process is described in detail. However, the correction process is not limited to being applied only to intra-predicted samples, but can also be applied to inter-predicted samples or reconstructed samples.

[0192] Figure 11 FIG. 1 is a diagram illustrating a method of correcting a prediction sample of a current block based on difference information of neighboring samples according to an embodiment of the present application.

[0193] A prediction sample of a current block can be corrected based on difference information of a plurality of neighboring samples of the current block. The correction can be performed on all prediction samples in the current block, or can be performed on prediction samples in a predetermined partial region. The partial region can be one row / column or a plurality of rows / columns, and the partial regions can be preset regions for correction in an apparatus for encoding / decoding a video. For example, the correction can be performed on one row / column located at a boundary of the current block, or can be performed on a plurality of rows / columns from the boundary of the current block. Alternatively, the partial region can be variably determined based on at least one of a size / shape of the current block or an intra-prediction mode.

[0194] The neighboring samples can belong to neighboring blocks located at the top, left, and upper left of the current block. The number of neighboring samples for correction can be 2, 3, 4, or more. The positions of the neighboring samples can be variably determined according to the positions of the prediction samples that are the targets of correction in the current block. Alternatively, some of the neighboring samples can have fixed positions regardless of the positions of the prediction samples that are the targets of correction, and the remaining neighboring samples can have variable positions depending on the positions of the prediction samples that are the targets of correction.

[0195] The difference information of the neighboring samples can refer to a difference sample between the neighboring samples, or can refer to a value obtained by scaling the difference sample by a predetermined constant value (e.g., 1, 2, 3, etc.). Here, the predetermined constant value can be determined in consideration of the positions of the prediction samples that are the targets of correction, the positions of the columns or rows including the prediction samples that are the targets of correction, the positions of the prediction samples within the columns or rows, etc.

[0196] For example, in the case where the intra-prediction mode of the current block is a vertical mode, a final prediction sample can be obtained using a difference sample between a neighboring sample p(-1, y) adjacent to the left boundary of the current block and an upper left neighboring sample p(-1, -1), as shown in Equation 1.

[0197] [Equation 1]

[0198] P'(0, y) = P(0, y) + ((p(-1, y) - p(-1, -1)) » 1, for y = 0...N-1

[0199] For example, if the intra-frame prediction mode of the current block is horizontal mode, the final prediction sample can be obtained by using the difference sample between the neighboring sample p(x, -1) near the top boundary of the current block and the top-left neighboring sample p(-1, -1), as shown in Equation 2.

[0200] [Equation 2]

[0201] P′(x, 0) = p(x, 0) + ((p(x, -1) - p(-1, -1)) >> 1, for x = 0...N-1

[0202] For example, if the intra-frame prediction mode of the current block is vertical, the final prediction sample can be obtained using the difference sample between the neighboring sample p(-1, y) near the left boundary of the current block and the top-left neighboring sample p(-1, -1), as shown in Equation 2. Here, the difference sample can be added to the prediction sample, or the difference sample can be scaled by a predetermined constant value and then added to the prediction sample. The predetermined constant value used for scaling can be determined differently depending on the column and / or row. For example, the prediction sample can be corrected as shown in Equations 3 and 4.

[0203] [Equation 3]

[0204] P′(0,y)=P(0,y)+((p(-1,y)-p(-1,-1))>>1, for y=0...N-1

[0205] [Equation 4]

[0206] P'(1,y)=P(1,y)+((p(-1,y)-p(-1,-1))>>2, for y=0...N-1

[0207] For example, if the intra-frame prediction mode for the current block is horizontal, the final predicted sample can be obtained using the difference between the neighboring sample p(x, -1) near the left boundary of the current block and the top-left neighboring sample p(-1, -1), as described above in horizontal mode. For example, the predicted sample can be corrected as shown in Equations 5 and 6 below.

[0208] [Equation 5]

[0209] P′(x, 0) = p(x, 0) + ((p(x, -1) - p(-1, -1)) >> 1, for x = 0...N-1

[0210] [Equation 6]

[0211] P′(x, 1)=p(x, 1)+((p(x, -1)-p(-1, -1))>>2,for x=0...N-1

[0212] When the intra prediction mode of the current block is a directional prediction mode, the intra prediction of the current block can be performed based on the directionality of the directional prediction mode. For example, Table 3 shows the intra direction parameter intraPredAng from mode 2 to mode 34, which are the directional intra prediction modes from mode 2 to mode 34. Figure 8 The illustrated directional intra prediction modes.

[0213] [Table 3]

[0214]

[0215] In Table 3, 33 directional intra prediction modes are described by way of example, but more or less directional intra prediction modes can be defined.

[0216] The intra direction parameter of the current block can be determined based on a lookup table defining a mapping relationship between the directional intra prediction mode and the intra direction parameter. Alternatively, the intra direction parameter of the current block can be determined based on information signaled through a bitstream.

[0217] Depending on the directionality of the directional intra prediction mode, at least one of the left reference samples or the top reference samples can be used to perform the intra prediction of the current block. Here, the top reference samples can be reference samples whose y-axis coordinates are less than the prediction target sample (x, 0) included in the top row in the current block (e.g., (-1, -1) to (2W-1, -1)), and the left reference samples can be reference samples whose x-axis coordinates are less than the prediction target sample (0, y) included in the leftmost column in the current block (e.g., (-1, -1) to (-1, 2H-1)).

[0218] Depending on the directionality of the intra prediction mode, the reference samples of the current block can be arranged in one dimension. Specifically, in the case where both the top reference samples and the left reference samples should be used for the intra prediction of the current block, it is assumed that both the top reference samples and the left reference samples are arranged in a line along a vertical direction or a horizontal direction, and the reference samples of each prediction target sample can be selected.

[0219] For example, in the case where the intra direction parameter is negative (e.g., the intra prediction modes corresponding to mode 11 to mode 25 in Table 3), the top reference samples and the left reference samples can be rearranged along the horizontal direction or the vertical direction to form a one-dimensional reference sample group P_ref_1D.

[0220] Figure 12 and Figure 13 are diagrams showing one-dimensional reference sample groups in which the reference samples are rearranged into a line.

[0221] The re-arrangement of the reference samples in the vertical direction or in the horizontal direction can be determined according to the directionality of the intra prediction mode. For example, if the intra prediction mode index is between 11 to 18, as shown in the example of Figure 12 the top reference samples of the current block can be rotated counterclockwise to generate a one-dimensional reference sample set in which the left-side reference samples and the top reference samples are arranged in the vertical direction.

[0222] On the other hand, if the intra prediction mode index is between 19 to 25, as shown in the example of Figure 13 the left-side reference samples of the current block can be rotated clockwise to generate a one-dimensional reference sample set in which the left-side reference samples and the top reference samples are arranged in the horizontal direction.

[0223] If the intra direction parameter of the current block is not negative, the intra prediction of the current block can be performed using only the left-side reference samples or the top reference samples. Therefore, for the intra prediction mode with the intra direction parameter not being negative, the one-dimensional reference sample set can be generated using only the left-side reference samples or the top reference samples.

[0224] Based on the intra direction parameter, a reference sample determination index iIdx for specifying at least one reference sample used to predict a target sample can be obtained. In addition, a weight related parameter ifact for determining a weight applied to each reference sample based on the intra direction parameter can be obtained. For example, Equation 7 and Equation 8 show an example of obtaining the reference sample determination index and the weight related parameter.

[0225] [Equation 7]

[0226] iIdx = (y + 1) * (P ang / 32)

[0227] ifact = [(y + 1) * P ang ]31

[0228] As shown in Equation 7, iIdx and ifact are determined variably according to the slope of the directional intra prediction mode. In this case, the reference sample specified by iIdx can correspond to an integer pixel.

[0229] Based on the reference sample determination index, at least one reference sample can be specified for each prediction sample. For example, the position of the reference sample in the one-dimensional reference sample set used to predict the prediction target sample in the current block can be specified based on the reference sample determination index. Based on the reference sample at the specified position, a prediction image (i.e., a prediction sample) of the prediction target sample can be generated.

[0230] Considering the intra prediction mode of the current block, if the prediction target sample can be predicted using only one reference sample, a prediction image of the prediction target sample can be generated based on the reference sample specified by the intra prediction mode of the current block.

[0231] For example, in a case where an imaginary angular line according to an angle or a slope of the intra prediction mode crosses an integer pixel (i.e., a reference sample at an integer position) in the one-dimensional reference sample group, a prediction image of the prediction target sample can be generated by copying the reference sample at the integer pixel position or considering a position between the reference sample at the integer pixel position and the prediction target sample. For example, Equation 8 below shows an example of generating a prediction image P(x, y) of the prediction target sample by copying a reference sample P_ref_1D(x+iIdx+1) in the one-dimensional reference sample group specified by the intra prediction mode of the current block.

[0232] [Equation 8]

[0233] P(x, y) = P_ref_1D(x+iIdx+1)

[0234] Considering the intra prediction mode of the current block, when it is determined that the prediction target sample is not predicted using only one reference sample, the prediction target sample can be predicted using a plurality of reference samples. Specifically, according to the intra prediction mode of the current block, the prediction target sample can be predicted by performing linear interpolation or tap filter-based interpolation on a reference sample at a predetermined position and a neighboring reference sample adjacent to the reference sample at the predetermined position. The number of taps of the interpolation filter can be a natural number of two or more. Specifically, depending on the number of reference samples to be interpolated, the number of taps of the tap filter can be an integer of 2, 3, 4, 5, 6, or more.

[0235] For example, in a case where an imaginary angular line according to an angle or a slope of the intra prediction mode does not cross an integer pixel (i.e., a reference sample at an integer position) in the one-dimensional reference sample group, a prediction image of the prediction target sample can be generated by interpolating a reference sample and a left / right or above / below reference sample of the neighboring reference sample placed on a corresponding angular line. For example, Equation 9 below shows an example of generating a prediction sample P(x, y) for the prediction target sample by interpolating two or more reference samples.

[0236] [Equation 9]

[0237] P(x, y) = (32-i fact ) / 32*P_ref_1D(x+iIdx+1)+i fact / 32*P_ref_1D(x+iIdx+2)

[0238] The coefficients of the interpolation filter can be determined based on the weight-related parameters i fact As an example, the coefficients of the interpolation filter can be determined based on a distance between an integer pixel (i.e., an integer position of each reference sample) located on a corner line and a fractional pixel.

[0239] The following Equation 10 shows a case where the number of taps of the tap filter is 4.

[0240] [Equation 10]

[0241] P(x, y) = f(0) * P_ref_1D(x + iIdx - 1) + f(1) * P_ref_1D(x + iIdx) + f(2) * P_ref_1D(x + iIdx + 1) + f(3) * P_ref_1D(x + iIdx + 2)

[0242] In the case of using the multi-tap filter, a sample at a position not corresponding to a left reference sample or a top reference sample can be replaced with a closest reference sample at the position. For example, in Equation 9, in the case where a sample at the P_ref_1D(x + iIdx - 1) position does not correspond to a top reference sample, the sample can be replaced with a reference sample at the P_ref_1D(x + idx) position. Alternatively, in the case where a sample at the P_ref_1D(x + iIdx + 2) position does not correspond to a top reference sample, the sample can be replaced with a reference sample at the P_ref_1D(x + iIdx + 1) position.

[0243] The multi-tap filter can be applied to a plurality of reference samples arranged in a line along a horizontal direction or a vertical direction. Alternatively, the multi-tap filter can be applied to a predetermined polygon, for example, a rectangle. The shape to which the multi-tap filter is applied can be variably determined according to a size, a shape, or an intra prediction mode of a current block.

[0244] As shown in Equations 8 to 10, generating a prediction sample by using directionally interpolated reference samples of intra prediction can be referred to as an intra prediction sample interpolation technique.

[0245] In using the intra prediction sample interpolation technique, a large number of taps of the tap filter does not necessarily guarantee an improvement in prediction accuracy. For example, in the case of a current block of a size of an asymmetrically coded unit, e.g., 2x16 or a small size block, e.g., 4x4, in which one of height or width is significantly greater than the other, a tap filter using 4 or more taps can cause an over-smoothing of a predicted picture. Accordingly, the type of tap filter can be adaptively determined according to the size, shape or intra prediction mode of the current block. Here, the type of tap filter can be classified by at least one of the number of taps, filter coefficients, filter strength (strong / weak) or filter direction. The number of filter taps or filter coefficients can be variably determined according to the filter strength. Further, according to the type of tap filter, the application direction of the tap filter, e.g., horizontal interpolation, vertical interpolation or horizontal and vertical interpolation, can be determined. The application direction of the tap filter can be variably set based on a line (row or column) or sample in the current block.

[0246] Specifically, the type of tap filter to be used can be determined based on the width or height of the current block. For example, in the case where at least one of the width or height of the current block is less than a predetermined value, the intra prediction sample interpolation technique can be performed by using a 2-tap filter instead of a 4-tap filter. On the other hand, in the case where both the width and height of the current block are greater than or equal to the predetermined value, the intra prediction sample interpolation technique can be performed using a 4-tap filter. Here, the predetermined value can represent a value such as 4, 8 or 16.

[0247] Alternatively, the type of tap filter to be used can be determined according to whether the width and height of the current block are the same. For example, in the case where the width and height of the current block are different values, the intra prediction sample interpolation technique can be performed using a 2-tap filter instead of a 4-tap filter. On the other hand, in the case where the width and height of the current block have the same value, the intra prediction sample interpolation technique can be performed using a 4-tap filter.

[0248] Alternatively, the type of tap filter to be used can be determined according to the ratio of the width and height of the current block. For example, in the case where the ratio of the width (w) to the height (h) of the current block, i.e., w / h or h / w, is less than a predetermined threshold, the intra prediction sample interpolation technique can be performed using a 2-tap filter instead of a 4-tap filter. On the other hand, in the case where the ratio of the width and height of the current block is greater than or equal to the predetermined threshold, the intra prediction sample interpolation technique can be performed using a 4-tap filter.

[0249] Alternatively, the type of the tap filter can be determined according to an intra prediction mode, shape, or size of the current block. For example, in a case where the current block is a coding unit of a 2x16 type and the intra prediction mode of the current block is an intra prediction mode belonging to a horizontal range, the intra prediction sample interpolation technique can be performed using a tap filter having a number of taps n. On the other hand, in a case where the current block is a coding unit of a 2x16 type and the intra prediction mode of the current block is an intra prediction mode belonging to a vertical direction range, the intra prediction sample interpolation technique can be performed using a tap filter having a number of taps m.

[0250] On the other hand, in a case where the current block is a coding unit of a 16x2 type and the intra prediction mode of the current block is an intra prediction mode belonging to a horizontal direction range, the intra prediction sample interpolation technique can be performed using a tap filter having a number of taps n. On the other hand, in a case where the current block is a coding unit of a 16x2 type and the intra prediction mode of the current block is an intra prediction mode belonging to a vertical direction range, the intra prediction sample interpolation technique can be performed using a tap filter having a number of taps m.

[0251] Here, the horizontal range can indicate a predetermined range including intra prediction modes in a horizontal direction, and the vertical range can indicate a predetermined range including intra prediction modes in a vertical direction. For example, based on 35 intra prediction modes, the horizontal direction range can indicate intra prediction modes between mode 11 and mode 18, and the vertical direction range can indicate intra prediction modes between mode 19 and mode 27.

[0252] Further, n and m are constants greater than 0, and n and m can have different values. Alternatively, n and m can be set to have the same value, but at least one of filter coefficients or filter strengths of the n tap filter and the m tap filter can be differently set.

[0253] One block can be divided into a plurality of sub-blocks, and intra prediction can be performed in units of sub-blocks. In this case, sub-blocks belonging to one block can have the same intra prediction mode. However, the range of reference samples referred to by each sub-block can be different. That is, in a case where the current block is a coding unit of a 2Nx2N type, the range of reference samples referred to by each sub-block can be different. Figure 10 In the example shown, the reference sample obtaining step S1010 and the intra prediction performing step S1020 can be performed in units of sub-blocks.

[0254] The block including a plurality of sub-blocks can be a coding block, a prediction block, or a transform block. Alternatively, the block including a plurality of sub-blocks can be a predetermined region sharing the same intra prediction mode and the same MPM candidate list.

[0255] The size and shape of the block (or region) including a plurality of sub-blocks can have an NxM shape which is predefined in the encoder and the decoder. Here, N and M can be the same or different as natural numbers.

[0256] Alternatively, information for specifying the size and shape of the block (or region) including a plurality of sub-blocks can be signaled through a bitstream. The size and shape of the block (or region) including a plurality of sub-blocks can be variably determined based on the signaled information.

[0257] For convenience of description, the intra-prediction target block (or region) including a plurality of sub-blocks will be referred to as a current block. The method of performing intra-prediction in units of sub-blocks will be described in detail below.

[0258] Figure 14 is a flowchart illustrating a method of performing intra-prediction based on sub-blocks.

[0259] Referring to Figure 14 , first, a partition type of a current block can be determined S1410.

[0260] The partition type of the current block can be determined based on at least one of the size, shape, or intra-prediction mode of the current block. For example, in the case where the intra-prediction mode of the current block is a vertical direction or similar to the vertical direction, the partition type of the current block can have a form in which sub-blocks are arranged up and down. On the other hand, in the case where the intra-prediction mode of the current block is a horizontal direction or similar to the horizontal direction, the partition type of the current block can have a form in which sub-blocks are arranged left and right. Here, the intra-prediction mode similar to a certain direction can be an intra-prediction mode whose angle is within a predetermined angle with respect to the certain direction or an intra-prediction mode whose mode value difference from the intra-prediction mode of the certain direction is within a predetermined value.

[0261] Figure 15 is a diagram illustrating the partition type of a sub-block according to an intra-prediction mode.

[0262] As Figure 15 illustrated in an example, in the case where the current block has an intra-prediction mode in a right-up direction, the current block can be partitioned into sub-blocks having a longer width than height (NxM shape, where N>M). On the other hand, in the case where the current block has an intra-prediction mode in a left-up direction, the current block can be partitioned into sub-blocks having a longer height than width (NxM shape, where N<M).

[0263] As another example, a partition type of the coding block can be determined depending on whether an intra prediction mode of the current block has a specific direction. For example, in a case where the current block has an intra prediction mode in a right-up direction, the partition type of the current block can be determined as sub-blocks arranged in an up-down arrangement. On the other hand, in a case where the current block has an intra prediction mode other than the intra prediction mode in the right-up direction, the partition type of the current block can be determined as sub-blocks arranged in a left-right arrangement.

[0264] Alternatively, information indicating the partition type of the current block can be signaled through a bitstream. In this case, the information indicating the partition type can include at least one of an index for specifying the partition type, information indicating a size and shape of the sub-blocks, or information indicating a partition direction of the current block.

[0265] The sub-blocks can be square or non-square. Alternatively, the sub-blocks can also be generated by partitioning the current block based on rows or columns or by partitioning the current block based on multiple rows or multiple columns.

[0266] In generating the plurality of sub-blocks by partitioning the current block, intra prediction can be performed based on the sub-blocks S1420. In this case, the intra prediction can be sequentially performed according to positions of the sub-blocks.

[0267] Figure 16 and Figure 17 are diagrams illustrating examples of performing intra prediction based on sub-blocks.

[0268] To perform intra prediction based on sub-blocks, one block can be partitioned into a plurality of sub-blocks. Although it is illustrated in the examples shown in Figure 16 and Figure 17 that a coding block is partitioned into two sub-blocks, the coding block can also be partitioned into a larger number of sub-blocks.

[0269] The plurality of sub-blocks can have the same intra prediction mode. For example, both an intra prediction mode of a first sub-block and an intra prediction mode of a second sub-block can be an intra prediction mode in a right-up direction.

[0270] Intra prediction of a first sub-block of the plurality of sub-blocks that is adjacent to a top boundary or a left boundary of the current block can be performed using reference samples adjacent to the coding block. As an example, the intra prediction of the first sub-block can be performed using at least one of a top reference sample or a left reference sample adjacent to the coding block according to the intra prediction mode.

[0271] After performing the intra prediction of the first sub-block, the intra prediction of a second sub-block neighboring the first sub-block can be performed by setting samples included in the first sub-block as reference samples. For example, samples located at a bottom boundary of the first sub-block neighboring the second sub-block can be set as reference samples for the intra prediction of the second sub-block. In this case, the samples of the first sub-block can be prediction samples, residual samples, or reconstructed samples reconstructed by using the prediction samples and the residual samples of the first sub-block.

[0272] As an example, in Figure 17 In the example shown, it is shown that neighboring samples neighboring a top of the second sub-block are set as reference samples of the second sub-block (indicated as "second reference samples" in Figure 17

[0273] Alternatively, the intra prediction of the second sub-block can include a first intra prediction using reference samples neighboring the current block and a second intra prediction using reference samples in the first sub-block. For example, a prediction sample in the second sub-block can be derived from a weighted sum between a first prediction sample generated based on the first intra prediction and a second prediction sample generated based on the second intra prediction. In this case, the weights applied to the first and second prediction samples can have the same value or can be differently set according to a distance from a target sample of prediction.

[0274] The residual samples of the current block for which the intra prediction is performed can be obtained by inverse quantization and inverse transformation. In this case, in a case where a plurality of transformations are applied to the current block, a unit to which the transformation is applied can be variably determined according to a transformation order. For example, a first transformation can be performed based on a coding block, and a second transformation can be performed based on a sub-block. In this case, the reference samples of the second sub-block can be configured by using samples to which the second transformation is applied in the first sub-block, i.e., residual samples. For example, the reference samples of the second sub-block can be derived as a sum of the residual samples and prediction samples in the first sub-block.

[0275] Depending on the intra prediction mode, a case in which a sample of a position that is not predicted or reconstructed should be used as a reference sample can occur. For example, in Figure 17 In the example shown, a sample neighboring a top-right corner of the second sub-block and a sample located right of the sample are likely to be samples that are not yet predicted or reconstructed. In this case, the sample that is not predicted or reconstructed can be replaced with an interpolation of samples located at a right boundary of the first sub-block or a predetermined number of samples included in the first sub-block.

[0276] When a first sub-prediction block is generated by intra predicting the first sub-block and a second sub-prediction block is generated by intra predicting the second sub-block, a prediction block of the current block can be generated by merging the first sub-prediction block and the second sub-prediction block.​

[0277] Whether to perform the intra prediction of the current block based on the sub-block can be adaptively determined according to a size, shape, or intra prediction mode of the current block. For example, whether to perform the intra prediction of the current block based on the sub-block can be determined according to whether the intra prediction mode of the current block is a directional mode in a specific direction.

[0278] Alternatively, information indicating whether to perform the intra prediction of the current block based on the sub-block can be encoded and signaled through a bitstream. The information can be signaled based on a block or can be signaled based on a slice or a picture.

[0279] In the embodiments described above, it is assumed that one intra prediction mode is applied to the current block. However, the intra prediction of the current block can be performed by using a plurality of intra prediction modes. Here, the plurality of intra prediction modes can be represented by a combination of a non-directional intra prediction mode and at least one directional intra prediction mode, a combination of a plurality of directional intra prediction modes, or a combination of a plurality of non-directional intra prediction modes.

[0280] For example, a different intra prediction mode or a different directional intra prediction mode can be applied to each prediction target sample in the current block. In order to determine the intra prediction mode of each prediction target sample, information indicating a difference value from the intra prediction mode of a previous prediction target sample can be signaled through a bitstream.

[0281] For example, the current block can be divided into a plurality of regions, and different intra prediction modes can be applied to the divided regions. Here, the plurality of regions can represent a predetermined number of sample units and a block unit of a predetermined size / shape. For example, the current block can be divided into a plurality of sub-blocks having a predetermined shape / size. Alternatively, the plurality of regions can be generated by dividing the current block into predetermined row / column units. For example, a region including rows / columns on a boundary of both sides of the current block is set as a first region, and other regions are set as second regions, so that different intra prediction modes can be applied to the first and second regions. The plurality of regions can be variably determined according to a size of the current prediction block, a number of samples, etc., or regardless of these elements, can have a fixed number which is predefined in the encoder and the decoder.

[0282] Using a plurality of reference samples, the intra prediction of the current block can be performed. Specifically, a prediction sample can be generated based on a weighted sum operation between the plurality of reference samples, and this can be referred to as intra weighted prediction.

[0283] Intra weighting prediction can be performed using multiple reference samples or multiple groups of reference samples that are not adjacent to each other. For example, intra weighting prediction can be performed based on a weighted sum of a top reference sample and a left reference sample, or can be performed based on a weighted sum of n top reference samples that are spatially adjacent and m left reference samples that are spatially adjacent. n and m can have the same value or can have different values.

[0284] The positions of the top reference sample and the left reference sample for intra weighting prediction can be specified by the directionality of the intra prediction mode. For example, one of the top reference sample and the left reference sample can be selected by applying the intra prediction mode of the current block in a forward direction, and the other can be selected by applying the intra prediction mode of the current block in a reverse direction. For example, in the case of the intra prediction mode of the current block being in a right-up diagonal direction, intra weighting prediction can be performed using the top reference sample located in the right-up diagonal direction of the prediction target sample and the left reference sample located in the left-down diagonal direction of the prediction target sample.

[0285] The reference sample for intra weighting prediction can be adaptively selected depending on the position of the prediction target sample. For example, at least one of the top reference sample having the same x-axis coordinate as the prediction target sample or the left reference sample having the same y-axis coordinate as the prediction target sample can be used for intra weighting prediction.

[0286] Intra weighting prediction can be performed using a reference sample having a fixed position. For example, at least one of a reference sample adjacent to the left corner of the current block, a reference sample adjacent to the right-up corner of the current block, or a reference sample adjacent to the left-down corner of the current block can be used for intra weighting prediction.

[0287] The weight applied to the top reference sample and the left reference sample can be determined based on the position of the prediction target sample or the distance between the prediction target sample and each reference sample. Equation 11 is an example of intra weighting prediction, and shows a method of obtaining a prediction sample p(x, y) of a prediction target sample at position (x, y).

[0288] [Equation 11]

[0289]

[0290] In Equation 11, P_ref(x+y+2, -1) denotes a top reference sample of the current block, and P_ref(-1, x+y+2) denotes a left reference sample of the current block. In Equation 11, the positions of the top reference sample and the left reference sample can be determined according to the intra prediction mode or the direction of the intra prediction mode of the current block. As shown in Equation 11, the weights applied to the top reference sample and the left reference sample can be determined based on the position of the prediction target sample or the distance to the prediction target sample.

[0291] Equation 12 shows a method of obtaining a prediction sample p(x, y) of a prediction target sample at position (x, y) as another example of the intra weighted prediction.

[0292] [Equation 12]

[0293] P(x, y) = HorW x P_ref(x+y+2, -1) + VerW x P_ref(-1, x+y+2) + (x+y+1) / 2 > > S[x+y]

[0294] In Equation 12, the positions of the top reference sample and the left reference sample can be determined according to the intra prediction mode or the direction of the intra prediction mode of the current block. Equation 11 uses a division operator having high implementation complexity, whereas Equation 12 uses a shift operation. In Equation 12, the variable S[n] can be defined as follows.

[0295]

[0296] Further, the weights HorW and VerW applied to the top reference sample and the left reference sample can be determined according to Equation 13 as follows.

[0297] [Equation 13]

[0298] HorW = (1 << S[x+y]) - VerW, if x < y

[0299] HorW = (y+1)*S[x+y+2], if x >= y

[0300] VerW = (x+1)*S[x+y+2], if x < y

[0301] VerW = (1 << S[x+y]) - HorW, if x >= y

[0302] As shown in Equation 13, the weights applied to the top reference sample and the left reference sample can be determined based on the position of the prediction target sample or the distance between the prediction target sample and each reference sample.

[0303] As another example, instead of setting the weights applied to the top reference sample and the left reference sample differently for each prediction target sample, the weights applied to the top reference sample and the left reference sample can be determined in units of a predetermined block. That is, the intra weighted prediction of the prediction samples included in a predetermined block unit can be performed by applying the same weight to the top reference sample and applying the same weight to the left reference sample.

[0304] Figure 18 FIG. 4 is a diagram illustrating an example of applying the same weight based on a predetermined block.

[0305] In Figure 18 In the illustrated example, the same weight is applied based on a 4x4 sub-block. When the same weight is applied based on a sub-block, the prediction sample at position (x, y) can be obtained as in Equation 14 below.

[0306] [Equation 14]

[0307] P(x, y) = (x' + 1) x P_ref(x + y + 2, -1) + (y' + 1) x P_ref(-1, x + y + 2) + (x + y + 2) / 2 > > (x' + y' + 1)

[0308] The variables x' and y' in Equation 14 can be obtained according to the size of the sub-block to which the same weight is applied as shown in Equation 15.

[0309] [Equation 15]

[0310] x' = floor(y / sub_width), y' = floor(y / sub_height)

[0311] In Equation 15, the floor(x) function is a function that represents the largest integer less than or equal to x. Sub_width and sub_height represent the width and height of the sub-block to which the same weight is applied, respectively.

[0312] The predetermined block unit can be a block unit in which intra prediction is performed, such as a coding block, a prediction block, or a transform block, or can be a sub-block having a size smaller than the block unit in which intra prediction is performed. The size and shape of the sub-block can be predefined in the encoder and the decoder, or information indicating the size and shape of the sub-block can be signaled through a bitstream.

[0313] Whether to perform intra-weighted prediction can be variably determined based on the size, shape, or intra-prediction mode of the current block. For example, whether to perform intra-weighted prediction can be determined based on whether the intra-prediction mode of the current block is planar, DC, horizontal, vertical, or diagonal. A diagonal mode can indicate an intra-prediction mode with a specific orientation (e.g., corresponding to intra-prediction modes of 2, 34, or 66), or it can indicate any intra-prediction mode with similar orientations within a specific range. Specifically, if the intra-prediction mode of the current block is horizontal or vertical, intra-weighted prediction may not be used. Alternatively, whether to perform intra-weighted prediction can be determined based on whether the intra-prediction mode belongs to a predefined group of intra-prediction modes.

[0314] Alternatively, intra-weighted prediction can replace any directional intra-prediction mode. For example, if the upper-right diagonal intra-prediction mode is selected, intra-weighted prediction can be used. Figure 9 Taking the 67 intra-prediction modes shown as an example, the upper right diagonal prediction mode with intra-prediction mode 66 can be used as an intra-weighted prediction mode.

[0315] Alternatively, information indicating whether to perform intra-weighted prediction can be sent via a bitstream using a signal. This information can only be sent via signal if the intra-prediction mode of the current block has a predefined direction. For example, if the upper-right diagonal intra-prediction mode is selected, whether to perform intra-weighted prediction can be determined based on the information sent via a signal through the bitstream. The information can be a 1-bit flag, but is not limited to this. Figure 9 Taking the 67 intra-prediction modes shown as an example, when the intra-prediction mode of the current block is 66, the flag indicating whether to perform intra-weighted prediction can be decoded.

[0316] Intra-weighted prediction can be performed by performing intra-prediction to obtain prediction samples and then performing a weighted sum operation between the obtained prediction samples and an additional reference sample. That is, intra-weighted prediction can be performed by additionally applying reference samples to the intra-prediction and processing the intra-prediction results.

[0317] Figure 19 This is a diagram illustrating an example of performing intra-frame weighted prediction in stages.

[0318] As such Figure 19 The example shown first allows for intra-block prediction of the current block. For instance, if the intra-block prediction mode is the upper-right diagonal direction, the predicted samples in the current block can be generated based on reference samples located in the upper-right direction of the predicted target samples.

[0319] When the prediction sample is obtained by intra prediction, the final prediction sample can be obtained by a weighted sum operation of the prediction sample and the reference samples neighboring the current block. As an example, as shown in the example shown in Figure 19 the final prediction sample can be obtained by a weighted sum operation between the prediction sample p(x, y) obtained by intra prediction and the top reference sample p(x+y+2, -1) neighboring the top of the current block.

[0320] In Figure 19 the example shown in FIG. 6, in the case where the intra prediction mode of the current block is the right-up diagonal direction, the intra weighted prediction is performed using the top reference samples. That is, in the case where the intra prediction is performed using the top reference samples according to the intra prediction mode of the current block, the intra weighted prediction can be performed using at least one of the top reference samples, as shown in the example shown in Figure 19 Although not shown, in the case where the intra prediction is performed using the left reference samples according to the intra prediction mode of the current block, the intra weighted prediction can be performed using at least one of the left reference samples.

[0321] In contrast, in the case where the intra prediction is performed using the top reference samples according to the intra prediction mode of the current block, the intra weighted prediction can be performed using at least one of the left reference samples. Also, in the case where the intra prediction is performed using the left reference samples according to the intra prediction mode of the current block, the intra weighted prediction can be performed using at least one of the top reference samples.

[0322] Alternatively, the intra weighted prediction can be performed to apply both the top reference samples and the left reference samples to the prediction sample obtained according to the intra prediction mode of the current block.

[0323] In the case where the intra prediction mode of the current block has the right-up diagonal direction, the intra weighted prediction can also be performed by using the left reference samples.

[0324] As in the examples described above, the intra weighted prediction can be selectively performed according to the size, shape, or intra prediction mode of the current block.

[0325] For example, the intra weighted prediction can be selectively performed depending on whether the intra prediction mode of the current block is a planar mode, a vertical direction, a horizontal direction, or a diagonal direction. For example, in the case that the intra prediction mode of the current block has a top horizontal direction or a left vertical direction, the intra weighted prediction is not performed, and in the case that the intra prediction mode of the current block has a bottom horizontal direction or a right vertical direction, the intra weighted prediction can be performed. In the case that the intra prediction mode of the current block has a bottom horizontal direction, the intra weighted prediction is performed by Equation 16 below, and in the case that the intra prediction mode of the current block has a right vertical direction, the intra weighted prediction can be performed by Equation 17.

[0326] [Equation 16]

[0327]

[0328] [Equation 17]

[0329]

[0330] Although the above-described embodiments are described based on a series of steps or flowcharts, this does not limit the time sequence of the present application, and can be performed simultaneously or in a different order as needed. Also, in the above-described embodiments, each component (e.g., unit, module, etc.) constituting the block diagram can be implemented as a hardware device or software, and a plurality of components can be combined to be implemented as one hardware device or software. The above-described embodiments can be implemented in the form of program instructions executable by various computer components and recordable in a computer-readable recording medium. The computer-readable recording medium can include individual program instructions, data files, data structures, etc., or include combinations thereof. Examples of the computer-readable recording medium include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs, DVDs, and magneto-optical media such as floptical disks, and hardware devices specially configured to store and execute program instructions, such as ROMs, RAMs, flash memories, etc. The hardware device can be configured to operate as one or more software modules to perform the processes according to the present application, and vice versa.

[0331] For example, the present disclosure can further include the following technical solutions.

[0332] Technical Solution 1. A method for decoding a video, the method comprising:

[0333] determining an intra prediction mode of a current block;

[0334] obtaining reference samples of the current block; and

[0335] obtaining prediction samples of the current block using at least one of the reference samples,

[0336] wherein the prediction samples are obtained based on a plurality of reference samples that are not adjacent to each other in case that the intra weighted prediction is applied to the current block.

[0337] Technical solution 2. The method for decoding video according to technical solution 1,

[0338] wherein the plurality of reference samples that are not adjacent to each other include a top reference sample located at a top of the current block and a left reference sample located at a left side of the current block.

[0339] Technical solution 3. The method for decoding video according to technical solution 2,

[0340] wherein the prediction samples are obtained based on a weighted sum between the top reference sample and the left reference sample.

[0341] Technical solution 4. The method for decoding video according to technical solution 3,

[0342] wherein the weights applied to the top reference sample and the left reference sample are determined based on a position of the prediction sample or a distance between each reference sample and the prediction sample.

[0343] Technical solution 5. The method for decoding video according to technical solution 3,

[0344] wherein the weights applied to the top reference sample and the left reference sample are determined based on sub-blocks.

[0345] Technical solution 6. The method for decoding video according to technical solution 2,

[0346] wherein one of the top reference sample and the left reference sample is specified by applying the intra prediction mode in a forward direction and the other is specified by applying the intra prediction mode in a reverse direction.

[0347] Technical solution 7. The method for decoding video according to technical solution 1,

[0348] wherein whether to perform the intra weighted prediction is determined according to whether the intra prediction mode is a predefined intra prediction mode.

[0349] Technical solution 8. A method for encoding video, the method comprising:

[0350] determining an intra prediction mode of a current block;

[0351] obtaining reference samples of the current block; and

[0352] using at least one of the reference samples to obtain a prediction sample of the current block,

[0353] wherein the prediction sample is obtained based on a plurality of reference samples that are not adjacent to each other in case that the intra weighted prediction is applied to the current block.

[0354] Technical solution 9. The method for encoding video according to technical solution 8,

[0355] wherein the plurality of reference samples that are not adjacent to each other comprise a top reference sample located at a top of the current block and a left reference sample located at a left side of the current block.

[0356] Technical solution 10. The method for encoding video according to technical solution 9,

[0357] wherein the prediction sample is obtained based on a weighted sum between the top reference sample and the left reference sample.

[0358] Technical solution 11. The method for encoding video according to technical solution 10,

[0359] wherein the weight applied to the top reference sample and the left reference sample is determined based on a position of the prediction sample or a distance between each reference sample and the prediction sample.

[0360] Technical solution 12. The method for encoding video according to technical solution 10,

[0361] wherein the weight applied to the top reference sample and the left reference sample is determined based on a sub-block.

[0362] Technical solution 13. The method for encoding video according to technical solution 9,

[0363] wherein one of the top reference sample and the left reference sample is specified by applying the intra prediction mode in a forward direction and the other is specified by applying the intra prediction mode in a reverse direction.

[0364] Technical solution 14. An apparatus for decoding video, the apparatus comprising:

[0365] an intra prediction module configured to determine an intra prediction mode of a current block,

[0366] obtain reference samples of the current block, and

[0367] using at least one of the reference samples to obtain a prediction sample of the current block,

[0368] wherein the prediction samples are obtained based on a plurality of reference samples that are not adjacent to each other in case of applying intra weighted prediction on the current block.

[0369] Technical solution 15. An apparatus for encoding video, the apparatus comprising:

[0370] an intra prediction module configured to determine an intra prediction mode for a current block,

[0371] obtain reference samples for the current block, and

[0372] obtain prediction samples for the current block using at least one of the reference samples,

[0373] wherein the prediction samples are obtained based on a plurality of reference samples that are not adjacent to each other in case of applying intra weighted prediction on the current block.

[0374] Industrial applicability

[0375] The present application can be applied to an electronic device capable of encoding / decoding an image.

Claims

1. A method for decoding video, the method comprising: Construct a list of most probable pattern (MPM) candidates for the current block; The intra-prediction mode of the current block is determined based on the MPM candidate list; Obtain a reference sample of the current block; The prediction sample for the current block is obtained based on the intra-frame prediction mode and the reference sample. as well as Determine whether to modify at least one of the predicted samples in the current block. Specifically, the decision to modify at least one of the predicted samples is based on whether the intra-prediction mode of the current block is one of the predefined intra-prediction modes. Wherein, if it is determined that at least one of the predicted samples needs to be modified, a modified predicted sample is generated based on a weighted sum of the predicted sample and a reference sample. This weighted sum is performed by applying a first weight to the predicted sample and a second weight to the reference sample. The second weight is set to be the same for all predicted samples in the same sub-region included in the current block.

2. The method for decoding video according to claim 1, wherein, The predicted samples are generated by applying an interpolation filter to the reference samples, and The interpolation filter is selected from multiple filter candidates based on the size of the current block.

3. The method for decoding video according to claim 1, wherein, If the intra-prediction mode of the current block has a direction toward the upper right, the reference sample is selected from the reference samples located in the lower left direction relative to the predicted sample.

4. The method for decoding video according to claim 1, wherein, The sub-region is composed of at least one column or at least one row in the current block.

5. A method for encoding video, the method comprising: Construct a list of most probable pattern (MPM) candidates for the current block; Obtain a reference sample of the current block; The prediction sample for the current block is obtained based on the intra-frame prediction mode and the reference sample. Information about the intra-prediction mode of the current block is encoded based on the MPM candidate list; as well as Determine whether to modify at least one of the predicted samples in the current block. Specifically, the decision to modify at least one of the predicted samples is based on whether the intra-prediction mode of the current block is one of the predefined intra-prediction modes. Wherein, if it is determined that at least one of the predicted samples needs to be modified, a modified predicted sample is generated based on a weighted sum of the predicted sample and a reference sample. This weighted sum is performed by applying a first weight to the predicted sample and a second weight to the reference sample. The second weight is set to be the same for all predicted samples in the same sub-region included in the current block.

6. A method for transmitting compressed video data, the method comprising: Generate the compressed video data associated with the image signal; as well as Send the compressed video data, The compressed video data is generated through an encoding method, which includes: Construct a list of most probable pattern (MPM) candidates for the current block; Obtain a reference sample of the current block; The prediction sample for the current block is obtained based on the intra-frame prediction mode and the reference sample. Information about the intra-prediction mode of the current block is encoded based on the MPM candidate list; and Determine whether to modify at least one of the predicted samples in the current block. Specifically, the decision to modify at least one of the predicted samples is based on whether the intra-prediction mode of the current block is one of the predefined intra-prediction modes. Wherein, if it is determined that at least one of the predicted samples needs to be modified, a modified predicted sample is generated based on a weighted sum of the predicted sample and a reference sample. This weighted sum is performed by applying a first weight to the predicted sample and a second weight to the reference sample. The second weight is set to be the same for all predicted samples in the same sub-region included in the current block.

Citation Information

Patent Citations

  • Method and device for processing video signal

    CA2997097A1

  • Method for processing image on basis of intra prediction mode and apparatus therefor

    WO2016153146A1