METHOD AND APPARATUS FOR VIDEO DECODING BY INTRA PREDICTION IN VIDEO CODING SYSTEM

The method and apparatus for video decoding using intra prediction improve coding efficiency by accurately generating reference samples at fractional positions, addressing the increased costs of high-resolution video transmission and storage.

JP7807597B2Active Publication Date: 2026-01-27LG ELECTRONICS INC
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2025081404
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2017-05-31
Filing Date
2025-05-14
Publication Date
2026-01-27
Estimated Expiration
2038-01-05

AI Technical Summary

Technical Problem

The increasing demand for high-resolution, high-quality video has led to a surge in video data transmission and storage costs due to the higher bit rate requirements, necessitating a more efficient video coding technique.

Method used

A method and apparatus for video decoding using intra prediction that involves deriving an intra prediction mode, determining neighboring samples, selecting an interpolation filter based on block size, distance, and prediction mode, and generating predicted samples to improve prediction accuracy and reduce residual errors.

Benefits of technology

This approach enhances video coding efficiency by accurately generating reference samples at fractional positions, reducing the amount of information bits required for filter selection, and improving prediction accuracy for current blocks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007807597000005
    Figure 0007807597000005
  • Figure 0007807597000006
    Figure 0007807597000006
  • Figure 0007807597000007
    Figure 0007807597000007
Patent Text Reader

Abstract

To provide a method for video decoding executed by a decoding device.SOLUTION: The method includes the steps of: forming an MPM list for a current block on the basis of the intra-prediction model of an adjacent block to the current block; deriving the intra-prediction mode of the current block on the basis of prediction mode information and the MPM list; deriving the adjacent sample to the current block; and deriving a reference sample for predicting a target sample of the current block in the adjacent sample on the basis of the position of a target sample and the prediction angle of the intra-prediction mode. The intra-prediction mode is a directional intra-prediction mode with a prediction angle of larger than 0. The prediction angle of the intra-prediction mode is determined as the angle formed by the prediction direction of the intra-prediction mode and the closer one of a horizontal prediction direction and a vertical prediction direction.SELECTED DRAWING: Figure 14
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to video coding technology, and more particularly to a method and apparatus for decoding video using intra prediction in a video coding system. [Background technology]

[0002] Recently, the demand for high-resolution, high-quality video such as HD (High Definition) video and UHD (Ultra High Definition) video is increasing in various fields. As the video data becomes higher in resolution and quality, the amount of information or bits to be transmitted increases relatively compared to existing video data. Therefore, when transmitting video data using existing media such as wired or wireless broadband lines or storing video data using existing storage media, the transmission and storage costs increase.

[0003] Therefore, a highly efficient video compression technique is required to effectively transmit, store, and play back high-resolution, high-quality video information. Summary of the Invention [Problem to be solved by the invention]

[0004] SUMMARY OF THE INVENTION A technical object of the present invention is to provide a method and apparatus for improving video coding efficiency.

[0005] Another technical object of the present invention is to provide an intra prediction method and apparatus for selecting an interpolation filter for a target sample in a current block.

[0006] Another technical object of the present invention is to provide a method and apparatus for performing intra prediction based on an interpolation filter for a selected current sample. [Means for solving the problem]

[0007] According to an embodiment of the present invention, there is provided a method for decoding an image, which is performed by a decoding device, comprising the steps of: deriving an intra prediction mode of a current block; deriving neighboring samples including a left neighboring sample and an upper neighboring sample of the current block; deriving reference samples for predicting the current sample from the neighboring samples based on a position of the current block of a current sample and a prediction angle of the intra prediction mode; determining an interpolation filter for the current sample; and deriving a predicted sample of the current sample based on the interpolation filter and the reference sample.

[0008] According to another embodiment of the present invention, there is provided a decoding device for decoding an image, the decoding device including: an entropy decoding unit configured to obtain prediction information for a current block; and a prediction unit configured to derive an intra prediction mode for the current block, derive neighboring samples including a left neighboring sample and an upper neighboring sample of the current block, derive reference samples for predicting the current sample from the neighboring samples based on a position of a current sample of the current block and a prediction angle of the intra prediction mode, determine an interpolation filter for the current sample, and derive a predicted sample for the current sample based on the interpolation filter and the reference sample.

[0009] According to another embodiment of the present invention, there is provided a video encoding method performed by an encoding apparatus, the method including: determining an intra prediction mode for a current block; deriving neighboring samples including a left neighboring sample and an upper neighboring sample of the current block; deriving reference samples for predicting the current sample from the neighboring samples based on a position of the current block and a prediction angle of the intra prediction mode; determining an interpolation filter for the current sample; deriving predicted samples of the current sample based on the interpolation filter and the reference samples; and generating, encoding, and outputting prediction information for the current block.

[0010] According to another embodiment of the present invention, there is provided a video encoding apparatus, including: a prediction unit that determines an intra prediction mode for a current block, derives neighboring samples including a left neighboring sample and an upper neighboring sample of the current block, derives reference samples for predicting the current sample from the neighboring samples based on a position of the current block and a prediction angle of the intra prediction mode, determines an interpolation filter for the current sample, and derives predicted samples of the current sample based on the interpolation filter and the reference samples; and an entropy encoding unit that generates prediction information for the current block, encodes the prediction information, and outputs the encoded information. [Effects of the Invention]

[0011] According to the present invention, prediction for the target sample can be performed based on an interpolation filter selected based on size information of the current block, distance information from the reference sample, and / or prediction mode information, thereby more accurately generating reference samples at fractional sample positions for the target sample to improve the accuracy of prediction for the current block, and reducing residuals for the current block to improve coding efficiency.

[0012] According to the present invention, an interpolation filter for a target sample can be selected based on the various conditions, thereby reducing the amount of information bits required for selecting an interpolation filter, thereby improving the prediction accuracy for the current block and thereby improving the coding efficiency of the current block. [Brief explanation of the drawings]

[0013] [Figure 1] 1 is a diagram illustrating an outline of the configuration of a video encoding device to which the present invention can be applied. [Figure 2] 1 shows another example outlining a video encoding device to which the present invention can be applied. [Figure 3] 1 illustrates a process in which intra prediction is performed in an encoding device. [Figure 4] 1 is a diagram illustrating an outline of the configuration of a video decoding device to which the present invention can be applied. [Figure 5] Another example will be given outlining a video decoding device to which the present invention can be applied. [Figure 6] 1 illustrates a process in which intra prediction is performed in a decoding device. [Figure 7] The left and upper neighboring samples used for intra prediction of the current block are illustrated. [Figure 8] Illustrates intra-directional modes with 65 prediction directions. [Figure 9] When the position of the reference sample located in the prediction direction of the directional intra prediction mode is a fractional sample position, an example is shown in which a predicted sample of the target sample is derived based on integer samples adjacent to the left and right of the reference sample. [Figure 10] An example of selecting an interpolation filter based on the size and intra prediction mode of the current block will be described below. [Figure 11] An example of selecting an interpolation filter based on the distance between the target sample and the reference sample of the current block will be described below. [Figure 12] An example of deriving a reference sample of a target sample of the current block based on the plurality of interpolation filters and deriving a predicted sample of the target sample based on the reference sample will be described below. [Figure 13] 1 shows an overview of a video encoding method by an encoding device according to the present invention; [Figure 14] 1 shows an overview of a video decoding method by a decoding device according to the present invention; DETAILED DESCRIPTION OF THE INVENTION

[0014] The present invention is susceptible to various modifications and may have various embodiments. Specific embodiments will be illustrated in the drawings and described in detail. However, this is not intended to limit the present invention to the specific embodiments. The terms used in this specification are merely used to describe specific embodiments and are not intended to limit the technical spirit of the present invention. The singular expressions include the plural expressions unless the context clearly dictates otherwise. In this specification, the terms "comprise" or "have" are intended to specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, and should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0015] Meanwhile, each component in the drawings described herein is illustrated independently for the convenience of explaining the different characteristic functions of the video encoding / decoding device, and does not mean that each component is embodied as separate hardware or software. For example, two or more components may be combined to form a single component, or a single component may be divided into multiple components. Embodiments in which each component is integrated and / or separated are also within the scope of the present invention as long as they do not deviate from the essence of the present invention.

[0016] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. In the following, the same reference numerals are used to refer to the same components in the drawings, and redundant description of the same components will be omitted.

[0017] In this specification, a picture generally refers to a unit representing one image at a specific time, and a slice is a unit constituting a part of a picture in coding. One picture may be composed of multiple slices, and pictures and slices may be used interchangeably as needed.

[0018] A pixel or pel is the smallest unit that makes up a picture (or image). The term 'sample' can also be used to indicate the value of a specific pixel. A sample can generally indicate the value of a pixel, or it can indicate only the pixel value of the luma component, or only the pixel value of the chroma component.

[0019] A unit refers to a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to that region. The term unit may be used interchangeably with terms such as block or area. In general, an M×N block may refer to a set of samples or transform coefficients consisting of M columns and N rows.

[0020] FIG. 1 is a diagram illustrating the outline of the configuration of a video encoding device to which the present invention can be applied.

[0021] 1, a video encoding apparatus 100 may include a picture partitioning unit 105, a prediction unit 110, a residual processing unit 120, an entropy encoding unit 130, an adder 140, a filter unit 150, and a memory 160. The residual processing unit 120 may include a subtraction unit 121, a transform unit 122, a quantization unit 123, a realignment unit 124, an inverse quantization unit 125, and an inverse transform unit 126.

[0022] The picture division unit 105 can divide an input picture into at least one processing unit.

[0023] For example, the processing unit is called a coding unit (CU). In this case, the coding units may be recursively divided from the largest coding unit (LCU) using a quad-tree binary-tree (QTBT) structure. For example, one coding unit may be divided into multiple coding units of deeper depths based on a quad-tree structure and / or a binary tree structure. In this case, for example, the quad-tree structure may be applied first, followed by the binary tree structure. Alternatively, the binary tree structure may be applied first. A coding procedure according to the present invention may be performed based on a final coding unit that is not further divided. In this case, based on coding efficiency according to image characteristics, the largest coding unit may be used as the final coding unit, or, if necessary, the coding unit may be recursively divided into coding units of lower depths, and a coding unit of an optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later.

[0024] As another example, the processing unit may include a coding unit (CU), a prediction unit (PU), or a transform unit (TU). The coding units may be split into coding units of deeper depths using a quadtree structure, starting from the largest coding unit (LCU). In this case, the largest coding unit may be used as the final coding unit based on coding efficiency according to video characteristics, or the coding unit may be recursively split into coding units of lower depths as needed, and the coding unit with the optimal size may be used as the final coding unit. When a smallest coding unit (SCU) is set, the coding unit cannot be split into coding units smaller than the smallest coding unit. Here, the final coding unit refers to a coding unit that serves as the basis for partitioning or division into prediction units or transform units. A prediction unit is a unit partitioned from a coding unit and is a unit of sample prediction. In this case, the prediction unit may be divided into subblocks. A transform unit can be divided from a coding unit according to a quadtree structure and is a unit that derives transform coefficients and / or a unit that derives a residual signal from the transform coefficients. Hereinafter, a coding unit is referred to as a coding block (CB), a prediction unit is referred to as a prediction block (PB), and a transform unit is referred to as a transform block (TB). A prediction block or a prediction unit refers to a specific region in a block form within a picture and can include an array of prediction samples.Also, a transform block or transform unit refers to a specific region in a picture in block form, and may include an array of transform coefficients or residual samples.

[0025] The prediction unit 110 may perform prediction on a current block to be processed (hereinafter, referred to as a current block) and generate a prediction block including prediction samples for the current block. The prediction unit 110 performs prediction on a coding block, a transform block, or a prediction block.

[0026] The prediction unit 110 may determine whether intra prediction or inter prediction is applied to the current block. For example, the prediction unit 110 may determine whether intra prediction or inter prediction is applied to the current block on a CU basis.

[0027] In intra prediction, the predictor 110 may derive a prediction sample for the current block based on a reference sample outside the current block within a picture to which the current block belongs (hereinafter, the current picture). In this case, the predictor 110 may (i) derive a prediction sample based on an average or interpolation of neighboring reference samples of the current block, or (ii) derive a prediction sample based on a reference sample present in a specific (prediction) direction with respect to the prediction sample among the neighboring reference samples of the current block. (i) is referred to as a non-directional mode or a non-angular mode, and (ii) is referred to as a directional mode or an angular mode. Prediction modes in intra prediction may include, for example, 33 directional prediction modes and at least two or more non-directional modes. Non-directional modes may include a DC prediction mode and a planar mode. The predictor 110 may also determine a prediction mode to be applied to the current block using a prediction mode applied to a neighboring block.

[0028] In the case of inter prediction, the predictor 110 may derive a predicted sample for the current block based on a sample identified by a motion vector on a reference picture. The predictor 110 may derive a predicted sample for the current block by applying any one of a skip mode, a merge mode, and a motion vector prediction (MVP) mode. In the skip mode and the merge mode, the predictor 110 may use motion information of a neighboring block as motion information of the current block. In the skip mode, unlike the merge mode, the difference (residual) between the predicted sample and the original sample is not transmitted. In the MVP mode, the motion vector of the current block may be derived by using the motion vector of the neighboring block as a motion vector predictor.

[0029] In the case of inter-prediction, neighboring blocks can include spatial neighboring blocks in the current picture and temporal neighboring blocks in a reference picture. The reference picture including the temporal neighboring blocks is also called a collocated picture (colPic). Motion information can include a motion vector and a reference picture index. Information such as prediction mode information and motion information can be (entropy) encoded and output in the form of a bitstream.

[0030] When motion information of temporally neighboring blocks is used in skip mode and merge mode, the top picture on the reference picture list can be used as the reference picture. Reference pictures included in the reference picture list can be sorted based on the difference in POC (Picture Order Count) between the current picture and the corresponding reference picture. POC corresponds to the display order of pictures and can be distinguished from the coding order.

[0031] The subtractor 121 generates residual samples, which are the differences between the original samples and the predicted samples, and does not generate residual samples when the skip mode is applied, as described above.

[0032] The transform unit 122 transforms residual samples in units of transform blocks to generate transform coefficients. The transform unit 122 may perform the transform according to the size of the corresponding transform block and a prediction mode applied to a coding block or a prediction block spatially overlapping with the corresponding transform block. For example, if intra prediction is applied to the coding block or the prediction block overlapping with the transform block and the transform block is a 4x4 residual array, the residual samples may be transformed using a Discrete Sine Transform (DST) transform kernel; otherwise, the residual samples may be transformed using a Discrete Cosine Transform (DCT) transform kernel.

[0033] The quantization unit 123 can quantize the transform coefficients to generate quantized transform coefficients.

[0034] The rearrangement unit 124 rearranges the quantized transform coefficients. The rearrangement unit 124 can rearrange the quantized transform coefficients in block form into a one-dimensional vector form through a coefficient scanning method. Here, the rearrangement unit 124 has been described as a separate component, but it may also be a part of the quantization unit 123.

[0035] The entropy encoding unit 130 may perform entropy encoding on the quantized transform coefficients. The entropy encoding may include encoding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoding unit 130 may also encode information required for video reconstruction (e.g., syntax element values, etc.) together with or separately from the quantized transform coefficients. The entropy-encoded information may be transmitted or stored in the form of a bitstream in network abstraction layer (NAL) units.

[0036] The inverse quantization unit 125 inversely quantizes the values ​​(quantized transform coefficients) quantized by the quantization unit 123, and the inverse transform unit 126 inversely transforms the values ​​inversely quantized by the inverse quantization unit 125 to generate residual samples.

[0037] The adder 140 reconstructs a picture by combining residual samples and prediction samples. The residual samples and prediction samples may be added in block units to generate reconstructed blocks. Although the adder 140 has been described as a separate component, it may be part of the prediction unit 110. Meanwhile, the adder 140 may also be referred to as a reconstruction unit or a reconstructed block generation unit.

[0038] The filter unit 150 may apply a deblocking filter and / or a sample adaptive offset to the reconstructed picture. Through the deblocking filtering and / or the sample adaptive offset, artifacts at block boundaries in the reconstructed picture and distortions in the quantization process may be corrected. The sample adaptive offset may be applied on a sample-by-sample basis and may be applied after the deblocking filtering process is completed. The filter unit 150 may also apply an adaptive loop filter (ALF) to the reconstructed picture. The ALF may be applied to the reconstructed picture after the deblocking filtering and / or the sample adaptive offset have been applied.

[0039] The memory 160 may store a reconstructed picture (a decoded picture) or information necessary for encoding / decoding. Here, a reconstructed picture is a reconstructed picture that has undergone a filtering procedure by the filter unit 150. The stored reconstructed picture may be used as a reference picture for (inter) prediction of another picture. For example, the memory 160 may store (reference) pictures used for inter prediction. In this case, the pictures used for inter prediction may be specified by a reference picture set or a reference picture list.

[0040] FIG. 2 shows another example that illustrates a schematic of a video encoding device to which the present invention can be applied.

[0041] 2, the video encoding apparatus may include an intra prediction unit, a reference smoothing unit 200, a prediction unit 210, a post-filter unit 220, a transform unit 230, and a quantization unit 240. Here, the intra prediction unit may include the reference smoothing unit 200, the prediction unit 210, and the post-filter unit 220.

[0042] When intra prediction is applied to the current block, the reference smoothing unit 200 may smooth the left adjacent sample and the upper adjacent sample used for intra prediction of the current block in a picture to which the current block belongs (hereinafter, the current picture) based on the size, intra prediction mode information, and sample values ​​of the current block, thereby preventing visual artifacts from occurring in the predicted samples of the current block due to differences in the sample values ​​of the left adjacent sample and the upper adjacent sample.

[0043] The prediction unit 210 may (i) derive a prediction sample based on an average or interpolation of the left-side neighboring sample and the upper-side neighboring sample of the current block, or (ii) derive the prediction sample based on a neighboring sample that exists in a specific (prediction) direction with respect to the prediction sample, among the left-side neighboring sample and the upper-side neighboring sample. (i) is referred to as a non-directional mode or a non-angular mode, and (ii) is referred to as a directional mode or an angular mode. Prediction modes in intra prediction may include, for example, 33 directional prediction modes and at least two or more non-directional modes. The non-directional modes may include a DC prediction mode and a planar mode. The prediction unit 210 may also determine a prediction mode to be applied to a current block using a prediction mode applied to a neighboring block.

[0044] Depending on the prediction mode from which the prediction samples of the current block are derived, the post-filter unit 220 may selectively perform post-processing filtering to mitigate discontinuities between the current block and neighboring samples. After this, the encoding apparatus may derive differences between the prediction samples and original samples as residual samples, and the transform unit 230 may transform the residual samples on a block-by-block basis to generate transform coefficients. In addition, the quantization unit 240 may quantize the transform coefficients to generate quantized transform coefficients.

[0045] FIG. 3 illustrates a process of intra-prediction performed by an encoding apparatus. The encoding apparatus may perform intra-prediction to generate predicted samples of a current block (S300). The predicted samples are also referred to as predicted signals or intra-predicted signals. Specifically, the encoding apparatus may perform a smoothing process on the left-side and upper-side samples used in the intra-prediction of the current block based on the size, mode information, and sample values ​​of the current block (S310). Then, the encoding apparatus may perform prediction according to the intra-prediction mode as described above to generate the predicted samples (S320) and may perform post-processing filtering to mitigate discontinuities between the current block and the adjacent samples (S330). The encoding apparatus may generate residual samples, which are the differences between the predicted samples and original samples (S340), and may transform the residual samples on a block-by-block basis to generate transform coefficients. The encoding apparatus may also quantize the transform coefficients to generate quantized transform coefficients (S360), and may entropy encode the quantized transform coefficients and signal them (S370).

[0046] FIG. 4 is a diagram illustrating the outline of the configuration of a video decoding device to which the present invention can be applied.

[0047] 4, a video decoding apparatus 400 may include an entropy decoding unit 410, a residual processing unit 420, a prediction unit 430, an addition unit 440, a filter unit 450, and a memory 460. Here, the residual processing unit 420 may include a realignment unit 421, an inverse quantization unit 422, and an inverse transform unit 423.

[0048] When a bitstream containing video information is input, the video decoding device 400 can restore the video in accordance with the process by which the video information was processed in the video encoding device.

[0049] For example, the video decoding apparatus 400 may perform video decoding using a processing unit applied in a video encoding apparatus. Accordingly, a processing unit block for video decoding may be a coding unit, for example, or a coding unit, a prediction unit, or a transform unit, for example. The coding unit may be divided from the largest coding unit into a quad tree structure and / or a binary tree structure.

[0050] A prediction unit and a transform unit may also be used in some cases, in which case a prediction block is a block derived or partitioned from a coding unit and is a unit of sample prediction. In this case, the prediction unit may be divided into sub-blocks. A transform unit may be divided from a coding unit using a quadtree structure and is a unit that derives transform coefficients or a unit that derives a residual signal from the transform coefficients.

[0051] The entropy decoding unit 410 may parse the bitstream and output information necessary for video reconstruction or picture reconstruction. For example, the entropy decoding unit 410 may decode information in the bitstream based on a coding method such as Exponential-Golomb coding, CAVLC, or CABAC, and output values ​​of syntax elements necessary for video reconstruction and quantized values ​​of transform coefficients for residuals.

[0052] More specifically, the CABAC entropy decoding method receives BINs corresponding to each syntax element from a bitstream, determines a context model using information on the syntax element to be decoded and decoding information on adjacent and target blocks to be decoded or information on symbols / BINs decoded in a previous step, predicts the occurrence probability of BINs according to the determined context model, and performs arithmetic decoding of the BINs to generate symbols corresponding to the values ​​of each syntax element. In this case, the CABAC entropy decoding method can update the context model using information on the decoded symbols / BINs for the context model of the next symbol / BIN after determining the context model.

[0053] Among the information decoded by the entropy decoding unit 410, information regarding prediction is provided to the prediction unit 430, and the residual values, i.e., the quantized transform coefficients, on which entropy decoding is performed by the entropy decoding unit 410 can be input to the reordering unit 421.

[0054] The rearrangement unit 421 may rearrange the quantized transform coefficients in a two-dimensional block format. The rearrangement unit 421 may perform the rearrangement in response to coefficient scanning performed by the encoding apparatus. Here, the rearrangement unit 421 has been described as a separate component, but may also be a part of the inverse quantization unit 422.

[0055] The inverse quantization unit 422 may inversely quantize the quantized transform coefficients based on the (inverse) quantization parameter and output the transform coefficients. In this case, information for deriving the quantization parameter may be signaled from the encoding apparatus.

[0056] The inverse transform unit 423 can inverse transform the transform coefficients to derive residual samples.

[0057] The prediction unit 430 may perform prediction on a current block and generate a prediction block including prediction samples for the current block. The prediction unit 430 may perform prediction on a coding block, a transform block, or a prediction block.

[0058] The prediction unit 430 may determine whether to apply intra prediction or inter prediction. In this case, the unit for determining whether to apply intra prediction or inter prediction differs from the unit for generating prediction samples. In addition, the unit for generating prediction samples differs between inter prediction and intra prediction. For example, whether to apply inter prediction or intra prediction may be determined on a CU basis. Furthermore, for example, in inter prediction, a prediction mode may be determined on a PU basis to generate prediction samples, and in intra prediction, a prediction mode may be determined on a PU basis to generate prediction samples on a TU basis.

[0059] In the case of intra prediction, the prediction unit 430 may derive a prediction sample for the current block based on neighboring reference samples in the current picture. The prediction unit 430 may derive a prediction sample for the current block by applying a directional mode or a non-directional mode based on the neighboring reference samples of the current block. In this case, the prediction mode to be applied to the current block may be determined using the intra prediction mode of the neighboring block.

[0060] In the case of inter prediction, the predictor 430 may derive a prediction sample for the current block based on a sample identified on the reference picture by a motion vector on the reference picture. The predictor 430 may derive a prediction sample for the current block by applying any one of a skip mode, a merge mode, and an MVP mode. In this case, motion information required for inter prediction of the current block provided by the video encoding apparatus, such as information on a motion vector, a reference picture index, etc., may be obtained or induced based on the information on the prediction.

[0061] In the skip mode and merge mode, motion information of neighboring blocks can be used as motion information of the current block, where the neighboring blocks can include spatial neighboring blocks and temporal neighboring blocks.

[0062] The predictor 430 may construct a merge candidate list using motion information of available neighboring blocks and use information indicated by a merge index on the merge candidate list as the motion vector of the current block. The merge index may be signaled from the encoding device. The motion information may include a motion vector and a reference picture.

[0063] In skip mode, unlike merge mode, the difference (residual) between the predicted samples and the original samples is not transmitted.

[0064] In the MVP mode, the motion vector of the current block can be derived using the motion vector of a neighboring block as a motion vector predictor, where the neighboring block can include a spatial neighboring block and a temporal neighboring block.

[0065] For example, when a merge mode is applied, a merge candidate list may be generated using the motion vectors of the reconstructed spatially neighboring blocks and / or the motion vector corresponding to the Col block, which is a temporally neighboring block. In the merge mode, the motion vector of a candidate block selected from the merge candidate list is used as the motion vector of the current block. The prediction information may include a merge index indicating a candidate block having an optimal motion vector selected from the candidate blocks included in the merge candidate list. In this case, the prediction unit 430 may derive the motion vector of the current block using the merge index.

[0066] As another example, when a Motion Vector Prediction (MVP) mode is applied, a motion vector predictor candidate list may be generated using the motion vector of a reconstructed spatial neighboring block and / or the motion vector corresponding to a Col block, which is a temporal neighboring block. That is, the motion vector of a reconstructed spatial neighboring block and / or the motion vector corresponding to a Col block, which is a temporal neighboring block, may be used as a motion vector candidate. The prediction information may include a predicted motion vector index indicating an optimal motion vector selected from the motion vector candidates included in the list. In this case, the predictor 430 may select a predicted motion vector for the current block from the motion vector candidates included in the motion vector candidate list using the motion vector index. A predictor of an encoding apparatus may obtain a motion vector differential (MVD) between the motion vector of the current block and a motion vector predictor, encode the MVD, and output it in the form of a bitstream. That is, the MVD is obtained by subtracting the motion vector predictor from the motion vector of the current block. In this case, the predictor 430 may obtain the motion vector differential included in the prediction information and derive the motion vector of the current block by adding the motion vector differential and the motion vector predictor. The prediction unit can also obtain or derive a reference picture index indicating a reference picture from the information related to the prediction.

[0067] The adder 440 may reconstruct a current block or a current picture by adding residual samples and prediction samples. The adder 440 may also reconstruct a current picture by adding residual samples and prediction samples in block units. When a skip mode is applied, the residual is not transmitted, and therefore the prediction samples may become reconstructed samples. Although the adder 440 is described as a separate component, it may also be part of the prediction unit 430. Meanwhile, the adder 440 may also be referred to as a reconstruction unit or a reconstructed block generation unit.

[0068] The filter unit 450 may apply sample adaptive offset of deblocking filtering and / or ALF to the reconstructed picture. In this case, the sample adaptive offset may be applied in sample units or may be applied after deblocking filtering. The ALF may be applied after deblocking filtering and / or sample adaptive offset.

[0069] The memory 460 may store a reconstructed picture (a decoded picture) or information necessary for decoding. Here, a reconstructed picture is a reconstructed picture that has undergone a filtering procedure by the filter unit 450. For example, the memory 460 may store a picture used for inter prediction. In this case, the picture used for inter prediction may be specified by a reference picture set or a reference picture list. The reconstructed picture may be used as a reference picture for another picture. The memory 460 may also output the reconstructed picture in an output order.

[0070] FIG. 5 shows another example illustrating an outline of a video decoding device to which the present invention can be applied.

[0071] 5, the video encoding apparatus may include an intra prediction unit, a reference smoothing unit 500, a prediction unit 510, a post-filter unit 520, an inverse quantization unit 530, and an inverse transform unit 540. Here, the intra prediction unit may include the reference smoothing unit 500, the prediction unit 510, and the post-filter unit 520. The intra prediction unit may derive prediction samples for the current block by applying a directional mode or a non-directional mode based on neighboring reference samples of the current block. In this case, the prediction mode to be applied to the current block may be determined using the intra prediction mode of the neighboring block.

[0072] Specifically, when intra prediction is applied to the current block, the reference smoothing unit 500 may smooth the left adjacent sample and the upper adjacent sample used for intra prediction of the current block in a picture to which the current block belongs (hereinafter, the current picture) based on the size, prediction mode, and sample value of the current block, thereby preventing visual artifacts from occurring in the predicted samples of the current block due to differences in the sample values ​​of the left adjacent sample and the upper adjacent sample.

[0073] The prediction unit 510 may (i) derive a prediction sample based on an average or interpolation of the left-side neighboring sample and the upper-side neighboring sample of the current block, or (ii) derive the prediction sample based on a neighboring sample that exists in a specific (prediction) direction with respect to the prediction sample, among the left-side neighboring sample and the upper-side neighboring sample. (i) is referred to as a non-directional mode or a non-angular mode, and (ii) is referred to as a directional mode or an angular mode. Prediction modes in intra prediction may include, for example, 33 directional prediction modes and at least two or more non-directional modes. The non-directional modes may include a DC prediction mode and a planar mode. The prediction unit 510 may also determine a prediction mode to be applied to a current block using a prediction mode applied to a neighboring block.

[0074] Depending on the prediction mode from which the prediction samples of the current block are derived, the post-filter unit 520 may selectively perform post-processing filtering to mitigate discontinuities between the current block and neighboring samples. Thereafter, the inverse quantization unit 530 may inverse quantize quantized transform coefficients received from the encoding device, and the inverse transform unit 540 may inverse transform the inverse quantized transform coefficients to generate residual samples in block units. A decoding device may reconstruct the current block encoded based on intra prediction using the residual samples and the prediction samples.

[0075] 6 illustrates a process of performing intra prediction in a decoding device. The decoding device may entropy decode entropy-encoded information received via a bitstream to obtain quantized transform coefficients (S600). The decoding device may then dequantize the quantized transform coefficients to obtain transform coefficients (S610) and inversely transform the transform coefficients to generate residual samples in block units (S620). The decoding device may then perform intra prediction to generate prediction samples of a current block (S630). The prediction samples are also referred to as prediction signals or intra-prediction signals. Specifically, the decoding device may smooth the left and upper neighboring samples used for intra prediction of the current block based on the size, prediction mode, and sample values ​​of the current block (S640). Thereafter, the decoding apparatus may perform prediction according to the intra prediction mode as described above to generate the predicted samples (S650), and may perform post-processing filtering to mitigate discontinuities between the current block and neighboring samples (S660). The decoding apparatus may add the predicted samples and the residual samples to generate reconstructed samples of the current block (S670).

[0076] As described above, when prediction is performed on a current block, the prediction may be performed based on an intra prediction mode. For example, the intra prediction may be performed based on adjacent samples that have already been encoded / decoded at the time of decoding the current block. That is, the predicted samples of the current block may be reconstructed using the left adjacent samples and the upper adjacent samples of the current block that have already been reconstructed. The left adjacent samples and the upper adjacent samples may be shown as shown in FIG. 7 below.

[0077] 7 illustrates the left neighboring samples and the upper neighboring samples used in intra prediction of the current block. When intra prediction is performed on the current block, an intra prediction mode for the current block may be derived, and predicted samples for the current block may be generated using at least one of the left neighboring samples and the upper neighboring samples according to the intra prediction mode. The left neighboring samples and the upper neighboring samples used in intra prediction of the current block may be smoothed based on the size, prediction mode, and sample values ​​of the current block. That is, filtering may be performed to reduce differences in the sample values ​​of the left neighboring samples and the upper neighboring samples based on the size, prediction mode, and sample values ​​of the current block. This may prevent visual artifacts from occurring in the predicted samples of the current block due to differences in the sample values ​​of the left neighboring samples and the upper neighboring samples.

[0078] Here, the intra prediction modes may include two non-directional intra prediction modes and 33 directional intra prediction modes. The non-directional intra prediction modes may include a planar intra prediction mode and a DC intra prediction mode, and the directional intra prediction modes may include intra prediction modes nos. 2 to 34. The planar intra prediction mode is referred to as a planar mode, and the DC intra prediction mode is referred to as a DC mode. In addition, the 10th intra prediction mode indicates a horizontal intra prediction mode or horizontal mode, and the 26th intra prediction mode indicates a vertical intra prediction mode or vertical mode. Based on this, the prediction direction of the angular intra mode can be expressed as an angle. That is, relative angles corresponding to each intra prediction mode can be expressed based on a horizontal reference angle of 0° corresponding to the 10th intra prediction mode, and relative angles corresponding to each intra prediction mode can be expressed based on a vertical reference angle of 0° corresponding to the 26th intra prediction mode.

[0079] In addition, to meet the increasing demand for high-quality video and improve the efficiency of video codecs, the number of directional intra-prediction directions can be increased to 65. That is, the intra-prediction modes can include two non-directional intra-prediction modes and 65 directional intra-prediction modes. The non-directional intra-prediction modes can include a planar intra-prediction mode and a DC intra-prediction mode, and the directional intra-prediction modes can include intra-prediction modes 2 to 66.

[0080] FIG. 8 illustrates the intra-directional modes of 65 prediction directions.

[0081] Referring to FIG. 8, intra prediction modes having horizontal directionality and intra prediction modes having vertical directionality can be distinguished from each other, with the 34th intra prediction mode having a diagonal prediction direction at the top left. H and V in FIG. 8 represent horizontal and vertical directionality, respectively, and the numbers -32 to 32 indicate displacements in 1 / 32 units on the sample grid position. The 2nd to 33rd intra prediction modes have horizontal directionality, and the 34th to 66th intra prediction modes have vertical directionality. The 18th and 50th intra prediction modes represent horizontal and vertical intra prediction modes, respectively, and the prediction direction of the angular intra prediction modes can be expressed as an angle based on this. That is, the relative angles corresponding to each intra prediction mode can be expressed based on a horizontal reference angle of 0° corresponding to the 18th intra prediction mode, and the relative angles corresponding to each intra prediction mode can be expressed based on a vertical reference angle of 0° corresponding to the 50th intra prediction mode.

[0082] When a directional intra prediction mode is applied to the current block, a predicted sample of a target sample on which intra prediction is performed in the current block may be derived based on a reference sample located in a prediction direction of the directional intra prediction mode. That is, the reference sample located in the prediction direction may be copied and derived as the predicted sample. Here, the reference sample may indicate an adjacent sample located in the prediction direction of the directional intra prediction mode from the target sample, among an upper adjacent sample and a left adjacent sample of the current block. Meanwhile, if there is no reference sample in integer sample units from the target sample in the prediction direction of the directional intra prediction mode, i.e., if the position of the reference sample located in the prediction direction of the directional intra prediction mode from the target sample is a fractional sample, a sample value of the reference sample may be derived by interpolating integer samples adjacent to the left and right of the reference sample, and a predicted sample of the target sample may be derived based on the reference sample. For example, the interpolation between integer samples may be performed based on a distance ratio between the reference sample and the integer sample.

[0083] Figure 9 shows an example in which, when the position of a reference sample located in the prediction direction of the directional intra prediction mode is a fractional sample position, a prediction sample of the target sample is derived based on integer samples adjacent to the left and right of the reference sample.

[0084] 9, the position of a fractional sample of a reference sample located in the prediction direction of the directional intra prediction mode with respect to the target sample may be derived as tan θ * (y + 1). The value of tan θ for the angle θ of each directional intra prediction mode for calculating the position of the fractional sample may be pre-defined by scaling to an integer unit to facilitate calculation. The scaled value of tan θ for each directional intra prediction mode may be derived as shown in the following table.

[0085] [Table 1]

[0086] Here, predModeIntra may indicate each of the directional intra prediction modes, and intraPredAngle may indicate a prediction angle of each of the directional intra prediction modes or an approximate value of scaled tan θ of each of the directional intra prediction modes. An approximate value of tan θ according to the predefined intra prediction modes may be derived based on Table 1. Meanwhile, the approximate value of tan θ of each of the scaled directional intra prediction modes may be derived based on Table 1. -1 The value of θ can be derived as in the table below.

[0087] [Table 2]

[0088] Here, predModeIntra may indicate the respective directional intra-prediction modes, and intraPredAngle may indicate the inverse prediction angle of the respective directional intra-prediction modes, or the scaled tangent of the respective directional intra-prediction modes. -1 The approximate value of tan θ can be expressed as follows: -1 An approximation of θ can be derived.

[0089] Meanwhile, a non-directional intra prediction mode may be applied to the current block. The non-directional intra prediction mode may include a planar intra prediction mode and a DC intra prediction mode. The planar intra prediction mode is called a planar mode, and the DC intra prediction mode is called a DC mode. The DC mode may derive a predicted sample of the current block based on an average value of neighboring samples of the current block. Intra prediction performed based on the DC mode may be performed efficiently when the sample values ​​of the current block are similar. On the other hand, when the sample values ​​of the current block are diverse, discontinuity may occur between the predicted block of the current block and neighboring samples when intra prediction is performed based on the DC mode. In such a case, unintended visible contouring may occur even when intra prediction is performed based on a directional intra prediction mode. The planar mode was devised to address this issue. The planar mode indicates a prediction mode in which horizontal linear prediction and vertical linear prediction are performed based on a reference sample for the target sample, and then the derived values ​​are averaged to generate a predicted sample for the target sample.

[0090] Meanwhile, when prediction is performed on a current block based on a directional intra prediction mode, if there is no reference sample in integer sample units in the prediction direction of the directional intra prediction mode of the current block based on a target sample of the current block as described above, i.e., if the position of the reference sample located in the prediction direction of the directional intra prediction mode based on the target sample is a fractional sample position, a sample value of the reference sample may be derived through interpolation between integer samples on the left and right of the reference sample, and a predicted sample of the current sample may be derived based on the derived reference sample. The integer sample may indicate an adjacent sample at a position of an integer sample located adjacent to the position of the reference sample.

[0091] In this case, the interpolation between the integer samples to the left and right of the reference sample can be derived based on one of various interpolation filters. For example, the interpolation can be performed based on an interpolation filter having a low-pass filter effect, or based on a sophisticated interpolation filter. The interpolation filter having a low-pass filter effect can be a linear filter or a Gaussian filter, and the sophisticated interpolation filter can be a spline filter. The spline filter is also called a cubic filter. The interpolation filter is a 4-tap interpolation filter. The 4-tap interpolation filter can be a filter that performs interpolation on four integer samples based on four weighting values. The interpolation between the integer samples performed based on the interpolation filter can be expressed as follows:

[0092]

number

[0093] Here, p[x][y] may indicate a predicted sample of the current sample, f[0], f[1], f[2], and f[3] may indicate filter coefficients of an interpolation filter, ref[n] may indicate the nth neighboring sample, and iIdx may indicate an integer index of a position of a fractional sample located in a prediction direction of an intra prediction mode of the current block based on the current sample. The integer index of the position of the fractional sample may indicate an integer value excluding the remainder of the position of the fractional sample.

[0094] Meanwhile, the filter coefficients of the cubic filter, which is one of the low-pass filters, and the filter coefficients of the Gaussian filter, which is one of the interpolation filters having the low-pass filter effect, can be derived as shown in the following table.

[0095] [Table 3]

[0096] Here, sub-pel position n / 32 may indicate the remaining value of the position of a fractional sample located in the prediction direction of the intra prediction mode of the current block with respect to the target sample. Filter coefficients of a cubic filter or a Gaussian filter may be derived based on the position of the fractional sample of the target sample and Table 3.

[0097] Meanwhile, when prediction of the current block is performed based on a directional intra prediction mode as described above, the distance between a target sample and a reference sample of the current block increases depending on the prediction angle of the directional intra prediction mode, and the greater the distance, the lower the accuracy of the prediction. A method for improving the accuracy of the prediction may be proposed, in which an appropriate interpolation filter is selected according to the distance between the target sample and the reference sample, and prediction is performed based on the reference sample derived by applying the selected interpolation filter. An appropriate interpolation filter according to the distance between the target sample and the reference sample and a method for selecting the appropriate interpolation filter will be described below.

[0098] For example, the interpolation filter may be selected based on the size of the current block or the intra prediction mode of the current block. As described above, the distance between the target sample of the current block and the reference sample may be derived based on the gradient of the prediction angle of the intra prediction mode for the current block. Since the reference sample of the current block is derived based on the left neighboring sample and the upper neighboring sample of the current block, the distance between the target sample and the reference sample increases as the target sample moves toward the lower right of the current block. In addition, as the value of intraPredAngle of the directional intra prediction mode defined in Table 1 increases, the gradient of the prediction angle approaches 45 degrees. As the gradient of the prediction angle approaches 45 degrees, the distance between the target sample and the reference sample increases. Therefore, as the value of intraPredAngle increases, the distance between the target sample and the reference sample increases.

[0099] In addition, the distance between the target sample and the reference sample can be derived based on the size of the current block. That is, the larger the size of the current block, the greater the distance between the target sample and the reference sample. Therefore, it can be said that the size of the current block is closely related to the accuracy of prediction of the target sample.

[0100] As described above, when the value of intraPredAngle is greater than 0 and less than 32, prediction of the target sample may be performed based on a reference sample at a fractional sample position, as shown in Figure 9. In this case, only integer sample values ​​neighboring the fractional sample position exist, and the coding apparatus may predict the reference sample at the fractional sample position based on an interpolation filter, and may copy the value of the reference sample at the predicted fractional sample position as the sample value of the predicted sample of the target sample. Therefore, the accuracy of the interpolation filter may affect the accuracy of the predicted block of the current block.

[0101] Furthermore, when intra prediction is applied to the current block, the information that can be used for the intra prediction is limited to the left adjacent sample and the upper adjacent sample of the current block that have already been restored at the time of the decoding process of the current block, and as the distance between the target sample of the current block and the reference sample increases, the correlation between the target sample and the reference sample derived based on the left adjacent sample and the upper adjacent sample may decrease rapidly.

[0102] Therefore, when the distance between the target sample and the reference sample is large, a method of deriving the reference sample based on an interpolation filter having a low-pass filter effect so that artifacts or noise of the reference sample are not propagated can improve prediction accuracy and coding efficiency. On the other hand, when the distance between the target sample and the reference sample is small, the correlation between the target sample and the reference sample is high, so a method of deriving the reference sample based on accurate interpolation so that the similarity between the predicted sample of the target sample and the reference sample can be maximized is advantageous for improving prediction performance. That is, when the distance between the target sample and the reference sample is small, a method of deriving the reference sample based on an elaborate interpolation filter can improve prediction accuracy and coding efficiency.

[0103] As a result, the reference sample for deriving the target sample of the current block can be selected based only on the size of the current block, can be selected based only on the intra-prediction mode of the current block, or can be selected based on the size of the current block and the intra-prediction mode of the current block.

[0104] Specifically, for example, if the size of the current block is 4x4 and intra prediction is performed on the current block, the 4x4 size current block has a very high correlation with neighboring samples of the current block, and therefore, a reference sample can be derived based on a sophisticated interpolation filter regardless of the intra prediction mode. Alternatively, regardless of the size of the current block, if the value of intraPredAngle derived from the intra prediction mode of the current block is 11 or greater, the distance between the target sample and the reference sample becomes large, and therefore, the reference sample can be derived based on an interpolation filter having a low-pass filter effect. Alternatively, if the size of the current block is smaller than a specific size and the value of intraPredAngle of the intra prediction mode of the current block is smaller than a specific value, a reference sample of the target sample can be derived based on a sophisticated interpolation filter; otherwise, a reference sample of the target sample can be derived based on an interpolation filter having a low-pass filter effect.

[0105] In addition, when a most probable mode (MPM) mode is applied to the current block, the intra prediction mode of the current block is derived based on the intra prediction mode of a neighboring block of the current block, and when the intra prediction mode of the current block is a directional intra prediction mode other than a planar mode or a DC mode, the interpolation filter used for the neighboring block selected via the MPM mode may also be derived as the interpolation filter of the current block. Here, when the MPM mode is applied to the current block, the coding apparatus may determine an MPM list based on the intra prediction mode of a neighboring block to the left or above the current block, and determine the intra prediction mode based on the MPM list.

[0106] Furthermore, when the interpolation filter is selected based on the intra-prediction mode of the current block, the criteria for the intra-prediction mode, i.e., the criteria for determining whether an interpolation filter with a low-pass filter effect or a sophisticated interpolation filter is used, vary depending on the size and shape of the current block.

[0107] On the other hand, if the current block is a square block, the width and height of the block are the same, i.e., the size of the current block is NxN, so the size of the block used as a reference for selecting an interpolation filter can be N for any directional intra prediction mode. On the other hand, if the shape of the current block is non-square, i.e., the size of the current block is MxN, and if the mode selected as the prediction mode of the current block is a directional intra prediction mode and the mode is a vertical directional prediction mode, the size of the block used as a reference for selecting an interpolation filter can be represented by M. Here, the vertical directional prediction mode may indicate intra prediction modes No. 34 to No. 66 when the intra prediction modes include 65 directional intra prediction modes and 2 non-directional intra prediction modes. Similarly, if the size of the current block is MxN, and the mode selected as the prediction mode of the current block is a directional mode and the mode is a horizontal directional prediction mode, the size of the current block used as a reference for selecting an interpolation filter can be represented by N. Here, the horizontal directional prediction mode may indicate intra prediction modes No. 2 to No. 33 when the intra prediction modes include 65 directional intra prediction modes and 2 non-directional intra prediction modes.

[0108] Alternatively, when the current block is a non-square block of M×N size and the prediction mode of the current block is a vertical directional prediction mode, an interpolation filter for the current block may be selected based on N. Similarly, when the current block is a non-square block of M×N size and the prediction mode of the current block is a horizontal directional prediction mode, an interpolation filter for the current block may be selected based on M. However, in a specific example described below, when a vertical directional prediction mode is applied to the current block having a size of M×N, the size of the current block that is used as a reference for selecting an interpolation filter may be represented by M. Similarly, when a horizontal directional prediction mode is applied to the current block having a size of M×N, the size of the current block that is used as a reference for selecting an interpolation filter may be represented by N. Specifically, for example, if the block size value is less than or equal to 8, a fine interpolation filter can be selected, and reference samples of the block can be derived based on the fine interpolation filter. In this case, if the size value of the current block is 8x4 and the intra prediction mode of the current block is one of the intra prediction modes having vertical directionality, the fine interpolation filter can be selected as the interpolation filter for the current block, and reference samples of the current block can be derived based on the fine interpolation filter.

[0109] Also, if the value of intraPredAngle of the intra prediction mode of the current block is less than or equal to 11, a fine interpolation filter may be selected and reference samples may be derived based on the fine interpolation filter. Also, if the value of intraPredAngle of the intra prediction mode of the current block is greater than 11, an interpolation filter with a low-pass filter effect may be selected and reference samples may be derived based on the interpolation filter with the low-pass filter effect.

[0110] Also, when the size value of the current block is 16 or more, a fine interpolation filter may be selected and reference samples may be derived based on the fine interpolation filter if the value of intraPredAngle of the intra prediction mode of the current block is less than or equal to 5. Also, when the value of intraPredAngle of the intra prediction mode of the current block is greater than 5, an interpolation filter with a low-pass filter effect may be selected and reference samples may be derived based on the interpolation filter with the low-pass filter effect.

[0111] 10 shows an example of selecting an interpolation filter based on the size and intra prediction mode of the current block. An encoding / decoding apparatus may derive an intra prediction mode for the current block and determine whether the intra prediction mode is a directional intra prediction mode (S1000). The directional intra prediction mode may also be represented by angular prediction. If the intra prediction mode is a non-directional intra prediction mode, the encoding / decoding apparatus may perform intra prediction of the current block based on the intra prediction mode.

[0112] If the intra prediction mode is a directional intra prediction mode, the encoding / decoding apparatus may determine whether the size of the current block is smaller than a first threshold (S1010). When the current block is a non-square block of M×N size and the mode selected as the intra prediction mode of the current block is an intra prediction mode having vertical directionality, i.e., when the intra prediction modes include 65 directional intra prediction modes and 2 non-directional intra prediction modes, and the intra prediction mode of the current block is one of the 34th to 66th intra prediction modes, a criterion for selecting an interpolation filter may be represented by the width of the current block, i.e., M. Similarly, when the current block is a non-square block of M×N size and the mode selected as the intra prediction mode of the current block is an intra prediction mode having horizontal directionality, i.e., when the intra prediction modes include 65 directional intra prediction modes and 2 non-directional intra prediction modes and the intra prediction mode of the current block is one of intra prediction modes 2 to 33, the criterion for selecting an interpolation filter may be expressed as the height of the current block, i.e., N. Alternatively, when only square blocks are considered and the size of the current block is N×N, the value of the size of the current block may be expressed as N. The first threshold may be set to 4, 8, 16, 32, or the like.

[0113] If the size of the current block is not smaller than a first threshold, i.e., if the size of the current block is greater than or equal to the first threshold, the encoding / decoding apparatus may select a Gaussian filter as an interpolation filter for the current block and derive a reference sample for a target sample in the current block based on the Gaussian filter (S1020). Here, the Gaussian filter may be one of interpolation filters having a low-pass filter effect, and the reference sample for the target sample may also be derived based on an interpolation filter having a low-pass filter effect other than the Gaussian filter. For example, if the size of the current block is greater than or equal to the first threshold, the encoding / decoding apparatus may select a linear filter as the interpolation filter for the current block and derive a reference sample for a target sample in the current block based on the linear filter. Here, the reference sample may indicate an adjacent sample located in a prediction direction of a directional intra-prediction mode of the current block based on the target sample.

[0114] If the size of the current block is not smaller than the first threshold, it may be determined whether the intraPredAngle of the directional intra prediction mode of the current block is smaller than a second threshold (S1030). The intraPredAngle may indicate a prediction angle of the directional intra prediction mode. For example, the second threshold may be set to 11.

[0115] If the intraPredAngle of the directional intra prediction mode of the current block is not less than the second threshold, the encoding apparatus / decoding apparatus may select a Gaussian filter as an interpolation filter for the current block and derive a reference sample for a target sample in the current block based on the Gaussian filter (S1020). Here, the Gaussian filter is one of the interpolation filters having a low-pass filter effect as described above, and the reference sample for the target sample may also be derived based on an interpolation filter having a low-pass filter effect other than the Gaussian filter.

[0116] If the intraPredAngle of the directional intra prediction mode of the current block is smaller than the second threshold, the encoding / decoding apparatus may select a cubic filter as an interpolation filter for the current block and derive a reference sample for the current sample in the current block based on the cubic filter (S1040). Here, the cubic filter is one of the sophisticated interpolation filters as described above, and the reference sample for the current sample may also be derived based on a sophisticated interpolation filter other than the cubic filter. The cubic filter is also called a spline filter.

[0117] The encoding / decoding apparatus may generate a predicted sample of the target sample based on the derived reference sample of the target sample (S1050). The encoding / decoding apparatus may generate the predicted sample by copying the reference sample. It can be said that the reference sample is copied and used as the predicted sample, and the predicted sample is generated based on the interpolation filter.

[0118] Meanwhile, in addition to the above-mentioned example, a method of selecting an interpolation filter may be proposed in which the current block is divided into arbitrary regions and an interpolation filter is selected for each region.

[0119] For example, if the size of the current block is equal to or larger than a certain size, the current block may be divided into a plurality of regions, and an interpolation filter for each region may be selected taking into account the distance between each region and adjacent samples of the current block. The size of the regions into which the current block is divided may be a fixed value pre-agreed (i.e., pre-set) between the encoding apparatus and the decoding apparatus, or may be derived based on the size of the current block, the intra prediction mode, etc. For example, if the intra prediction mode of the current block is a vertically oriented intra prediction mode and the mode number of the intra prediction mode is greater than 34, the size of the regions into which the current block is divided may be derived as 4x4. That is, if the intra prediction mode of the current block is one of the intra prediction modes 35 to 66, the size of the regions into which the current block is divided may be derived as 4x4. If the current block is a 16x16 block, the current block is divided into 16 4x4 regions, and the fine interpolation filter described above may be selected as the interpolation filter for regions 0 to 7 in raster scan order, and the interpolation filter having the low-pass filter effect described above may be selected as the interpolation filter for the other regions. Here, the numbers of the 16 4x4 regions according to the raster scan order may be derived in order from top row to bottom row, and from left to right within each row. That is, among the 16 4x4 size regions of the current block, the regions included in the first row from the top can be represented as region 0, region 1, region 2, and region 3 from left to right, the regions included in the second row can be represented as region 4, region 5, region 6, and region 7 from left to right, the regions included in the third row can be represented as region 8, region 9, region 10, and region 11 from left to right, and the regions included in the fourth row can be represented as region 12, region 13, region 14, and region 15 from left to right.Alternatively, information indicating the size of regions into which the current block is divided and an interpolation filter for each of the regions may be signaled, in which case the decoding device can divide the current block into a plurality of regions and select an interpolation filter for each region based on the information.

[0120] Alternatively, the interpolation filter may be selected based on a distance between a target sample of the current block and a reference sample. That is, the interpolation filter may be selected based on whether the distance between the target sample and the reference sample is equal to or greater than a certain threshold. Here, the reference sample may indicate an adjacent sample located in a prediction direction of an intra prediction mode of the current block based on the target sample.

[0121] Specifically, for example, when the size of the current block is N×N, if the distance between a target sample of the current block and a reference sample is N / 2 or more, the reference sample may be derived based on an interpolation filter having a low-pass filter effect, and otherwise, the reference sample may be derived based on a sophisticated interpolation filter. The specific threshold for selecting the interpolation filter may be derived based on the size of the current block as described above, or may be derived based on the intra prediction mode of the current block, whether the current block is a square / non-square block, etc. Alternatively, information on the specific threshold may be transmitted from an encoding device, and the decoding device may derive the specific threshold for the current block based on the received information on the specific threshold.

[0122] 11 shows an example of selecting an interpolation filter based on the distance between a target sample of the current block and a reference sample. The encoding / decoding apparatus may derive an intra prediction mode for the current block and determine whether the intra prediction mode is a directional intra prediction mode (S1100). The directional intra prediction mode may also be represented by angular prediction. If the intra prediction mode is a non-directional intra prediction mode, the encoding / decoding apparatus may perform intra prediction of the current block based on the intra prediction mode.

[0123] If the intra prediction mode is a directional intra prediction mode, the encoding / decoding apparatus may determine whether a distance between a target sample of the current block and a reference sample is less than a threshold (S1110). The reference sample may indicate an adjacent sample located in the prediction direction of the intra prediction mode of the current block relative to the target sample. As described above, the threshold may be derived based on the size of the current block, the intra prediction mode of the current block, whether the current block is a square or non-square block, etc. Information regarding the threshold may be signaled, and the threshold for the current block may be derived based on the signaled information regarding the threshold.

[0124] If the distance between the target sample and the reference sample of the current block is not less than the threshold, i.e., if the distance between the target sample and the reference sample is greater than or equal to the threshold, the encoding / decoding device may select a Gaussian filter as the interpolation filter for the current block and derive a reference sample for the target sample in the current block based on the Gaussian filter (S1120). Here, the Gaussian filter is one of interpolation filters having a low-pass filter effect, and the reference sample for the target sample may also be derived based on an interpolation filter having a low-pass filter effect other than the Gaussian filter. For example, if the size of the current block is greater than or equal to the threshold, the encoding / decoding device may select a linear filter as the interpolation filter for the current block and derive a reference sample for the target sample in the current block based on the linear filter.

[0125] If the distance between the target sample of the current block and the reference sample is smaller than the threshold, the encoding / decoding apparatus may select a cubic filter as an interpolation filter for the current block and derive the reference sample based on the cubic filter (S1130). Here, the cubic filter is one of the sophisticated interpolation filters as described above, and the reference sample of the target sample may also be derived based on a sophisticated interpolation filter other than the cubic filter. The cubic filter is also called a spline filter.

[0126] The encoding / decoding device may generate a predicted sample of the target sample based on the derived reference sample of the target sample (S1140). The encoding / decoding device may generate the predicted sample by copying the reference sample. It can be said that the reference sample is copied and used as the predicted sample, and the predicted sample is generated based on the interpolation filter.

[0127] Also, as described above, one of the interpolation filters may be selected to derive a reference sample for the target sample, but multiple interpolation filters may also be used to derive the reference sample.

[0128] For example, if the position of the reference sample of the target sample of the current block is a fractional sample position, i.e., if the reference sample of the target sample is a fractional sample, the first reference sample may be generated based on a first interpolation filter, which is a fine interpolation filter; the second reference sample may be generated based on a second interpolation filter, which is an interpolation filter having the above-mentioned low-pass filter effect; and the third reference sample may be generated based on a third interpolation filter, which is an interpolation filter different from the first and second interpolation filters. When the first, second, and third reference samples are generated, a predicted sample of the target sample may be generated based on the first, second, and third reference samples. For example, the average of the first and second reference samples may be derived as the predicted sample of the target sample, the average of the first and third reference samples may be derived as the predicted sample of the target sample, or the average of the second and third reference samples may be derived as the predicted sample of the target sample. Alternatively, an average of the first reference sample, the second reference sample, and the third reference sample may be derived as the predicted sample of the target sample.

[0129] Alternatively, the predicted sample of the target sample may be derived from a weighted average of the first reference sample and the second reference sample, i.e., a weighted sum of the first reference sample and the second reference sample. Alternatively, the predicted sample of the target sample may be derived from a weighted sum of the first reference sample and the third reference sample, or from a weighted sum of the second reference sample and the third reference sample, or from a weighted sum of the first reference sample, the second reference sample, and the third reference sample. The predicted sample of the target sample may be generated based on combinations of the first reference sample, the second reference sample, and / or the third reference sample other than those described above.

[0130] Specifically, for example, a predicted sample of the target sample may be generated as follows. When a directional intra prediction mode in which intra prediction is performed based on a reference sample at a fractional sample position is performed on the current block, a first reference sample of the target sample may be derived by interpolating neighboring samples at integer sample positions using a cubic filter, a second reference sample of the target sample may be derived by interpolating neighboring samples at integer sample positions using a Gaussian filter, and a predicted sample of the target sample may be generated based on the first and second reference samples. Here, the directional intra prediction mode in which intra prediction is performed based on the reference sample at the fractional sample position may indicate one of directional intra prediction modes excluding intra prediction modes No. 2, No. 18, No. 34, No. 50, and No. 66. In addition, the neighboring sample at the integer sample position may indicate a neighboring sample of the current block that is neighboring a fractional sample position located in a prediction direction of the directional intra prediction mode of the current block based on the target sample, among neighboring samples of the current block.

[0131] Alternatively, as another example, a method may be proposed in which the accuracy of intra prediction is higher as the distance between the target sample and the reference sample is shorter, and a first weighting value for a first reference sample generated based on a first interpolation filter, which is a sophisticated interpolation filter, and a second weighting value for a second reference sample generated based on a second interpolation filter, which is an interpolation filter having a low-pass filter effect, are derived based on the distance between the target sample and the reference sample, and a predicted sample of the target sample is generated by performing a weighted sum of the first and second reference samples based on the first and second weighting values. For example, the first weighting value may be derived to be inversely proportional to the distance between the target sample and the reference sample, and the second weighting value may be derived by subtracting the first weighting value from 1. Alternatively, the first weighting value and the second weighting value used in this case may be derived by up-scaling to an integer unit to avoid decimal point operations. Accordingly, the closer the distance between the target sample and the reference sample, the larger the first weighted value that can be derived, and the farther the distance between the target sample and the reference sample, the smaller the first weighted value that can be derived. The distance between the target sample and the reference sample can be calculated based on a prediction angle of an intra prediction mode of the current block and a position of the target sample. Alternatively, a table for the size and intra prediction mode of the block can be pre-stored, and the distance between the target sample and the reference sample can be derived by referring to the table. Meanwhile, the method of deriving the reference sample of the target sample based on a plurality of interpolation filters disclosed in the above-mentioned embodiment can be selectively applied based on specific conditions. For example, whether to derive the reference sample of the target sample based on a plurality of interpolation filters can be determined based on the size of the current block, the intra prediction mode of the current block, or the variance of neighboring sample values ​​of the current block.Alternatively, a flag indicating whether to derive the reference sample for the target sample based on the plurality of interpolation filters may be transmitted from the encoding device, and whether to derive the reference sample for the target sample based on the plurality of interpolation filters may be determined based on the flag.

[0132] 12 illustrates an example of deriving a reference sample for a target sample of the current block based on the plurality of interpolation filters and deriving a predicted sample for the target sample based on the reference sample. The encoding / decoding apparatus may derive an intra prediction mode for the current block and determine whether the intra prediction mode is a directional intra prediction mode (S1200). The directional intra prediction mode may be represented by angular prediction.

[0133] If the intra prediction mode is a non-directional intra prediction mode, the encoding / decoding apparatus may perform intra prediction of the current block based on the non-directional intra prediction mode (S1210).

[0134] If the intra prediction mode is a directional intra prediction mode, the encoding / decoding apparatus may derive a first reference sample of the target sample by interpolating neighboring samples at integer sample positions using a cubic filter (S1220). Here, the neighboring samples at integer sample positions may indicate neighboring samples of the current block that are neighboring at fractional sample positions located in the prediction direction of the directional intra prediction mode of the current block with respect to the target sample among neighboring samples of the current block. The encoding / decoding apparatus may perform intra prediction of the target sample based on the first reference sample (S1230). The encoding / decoding apparatus may generate a first temporary prediction sample by copying the first reference sample.

[0135] If the intra prediction mode is a directional intra prediction mode, the encoding / decoding device may derive a second reference sample of the target sample by interpolating neighboring samples at integer sample positions using a Gaussian filter (S1240). The encoding / decoding device may perform intra prediction of the target sample based on the second reference sample (S1240). The encoding / decoding device may generate the second provisional predicted sample by copying the second reference sample.

[0136] The encoding / decoding apparatus may derive a predicted sample of the target sample by performing a weighted sum of the first and second interim predicted samples (S1250). The predicted sample may be derived as the sum of the first interim predicted sample multiplied by a first weighting value α of the first interim predicted sample and the second interim predicted sample multiplied by a second weighting value 1-α of the second interim predicted sample. As described above, the first weighting value may be derived inversely proportional to the distance between the target sample and a reference sample, and the second weighting value may be derived by subtracting the first weighting value from 1. Alternatively, the first and second weighting values ​​used here may be upscaled to integer units to avoid decimal point calculations. The distance between the target sample and the reference sample may be calculated based on a prediction angle of an intra prediction mode of the current block and the position of the target sample. Alternatively, a table for the block size and intra prediction mode may be stored in advance, and the distance between the target sample and the reference sample may be derived by referring to the table.

[0137] Figure 13 shows an outline of a video encoding method by an encoding device according to the present invention. The method disclosed in Figure 13 can be performed by the encoding device disclosed in Figure 1. Specifically, for example, steps S1300 to S1340 in Figure 13 can be performed by a prediction unit of the encoding device, and step S1350 can be performed by an entropy encoding unit of the encoding device.

[0138] The encoding apparatus determines an intra prediction mode for a current block (S1300). The encoding apparatus may derive an intra prediction mode having an optimal RD cost as the intra prediction mode for the current block by performing various intra prediction modes. The intra prediction mode may be one of two non-directional prediction modes and 33 directional prediction modes. As described above, the two non-directional prediction modes may include an intra DC mode and an intra planar mode. Alternatively, the intra prediction mode may be one of two non-directional intra prediction modes and 65 directional intra prediction modes. As described above, the two non-directional prediction modes may include an intra DC mode and an intra planar mode. Furthermore, the 65 directional intra prediction modes may include a vertical directional intra prediction mode and a horizontal directional intra prediction mode. The vertical direction intra prediction modes may include intra prediction modes 34 to 66, and the horizontal direction intra prediction modes may include intra prediction modes 2 to 33.

[0139] The encoding apparatus derives neighboring samples including a left neighboring sample and an upper neighboring sample of the current block (S1310). The encoding apparatus may derive neighboring samples of the current block. The neighboring samples may include the left neighboring sample and the upper neighboring sample. The neighboring samples may also include an upper-left neighboring sample. The left neighboring sample, the upper-left neighboring sample, and the upper neighboring sample may be derived from neighboring blocks that have already been reconstructed at the time of decoding the current block. 2N upper neighboring samples, upper-left neighboring samples, and 2N left neighboring samples of the current block may be derived. Here, if the size of the current block is NxN and the x component and y component of the top-left sample of the current block are 0 and 0, respectively, the left adjacent sample is p[-1][0] to p[-1][2N-1], the top-left adjacent sample is p[-1][-1], and the top adjacent sample is p[0][-1] to p[2N-1][-1].

[0140] Alternatively, if the size of the current block is M×N and the x component of the top-left sample of the current block is 0 and the y component of the top-left sample of the current block is 0, the M+N upper neighboring samples, the upper left neighboring sample, and the M+N left neighboring samples of the current block can be derived. If the size of the current block is non-square, M×N, and the x component of the top-left sample of the current block is 0 and the y component of the top-left sample of the current block is 0, the left neighboring sample is p[-1][0] to p[-1][M+N-1], the upper left neighboring sample is p[-1][-1], and the upper neighboring sample is p[0][-1] to p[M+N-1][-1].

[0141] The encoding apparatus derives a reference sample for predicting the target sample from among the neighboring samples based on the position of the target sample of the current block and the prediction angle of the intra prediction mode (S1320). The encoding apparatus may derive the position of the reference sample for the target sample based on the position of the target sample of the current block and the prediction angle of the intra prediction mode. If the position of the reference sample is a fractional sample position, the encoding apparatus may derive, as the reference sample for the target sample, a neighboring sample located adjacent to the position derived based on the position of the target sample of the current block and the prediction angle of the intra prediction mode. That is, the encoding apparatus may derive multiple neighboring samples as the reference sample for the target sample based on the position of the target sample of the current block and the prediction angle of the intra prediction mode. For example, four neighboring samples may be derived as the reference sample for the target sample. Here, the target sample may represent a sample within the current block on which intra prediction is performed. The prediction angle of the intra prediction mode may be derived based on Table 1 above, and intraPredAngle is a variable indicating the prediction angle derived from the intra prediction mode.

[0142] The encoding apparatus determines an interpolation filter for the target sample (S1330). The encoding apparatus may determine the interpolation filter for the target sample based on the size of the current block and / or the intra-prediction mode of the current block. For example, the interpolation filter may be determined when the reference sample is located at a fractional sample position, i.e., when multiple reference samples are derived.

[0143] As an example, the interpolation filter for the target sample may be determined based on the size of the current block. For example, if the size of the current block is 4x4, a refined interpolation filter may be determined as the interpolation filter for the target sample. Specifically, if the size of the current block is 4x4, a cubic filter may be determined as the interpolation filter for the target sample. The cubic filter is one of refined interpolation filters, and is also called a spline filter.

[0144] Furthermore, if the current block is a square block, since the width and height are the same, i.e., the current block is an NxN square block, the reference size (i.e., reference value) for selecting an interpolation filter can be N for any directional intra prediction mode of any prediction direction. On the other hand, if the current block is a non-square block, i.e., an MxN non-square block, when the intra prediction mode of the current block is an intra prediction mode having a vertical direction, the size of the block used as a reference for selecting an interpolation filter (i.e., reference value) can be M. Similarly, when the current block is an MxN non-square block and the intra prediction mode of the current block is an intra prediction mode having a horizontal direction, the size of the current block used as a reference for selecting an interpolation filter (i.e., reference value) can be N. Alternatively, when the current block is a non-square block of M×N size and the intra prediction mode of the current block is an intra prediction mode having a vertical directionality, the interpolation filter of the current block may be selected based on N. Similarly, when the current block is a non-square block of M×N size and the intra prediction mode of the current block is an intra prediction mode having a horizontal directionality, the interpolation filter of the current block may be selected based on M. However, in a specific example described below, when an intra prediction mode having a vertical directionality is applied to the current block having a size of M×N, the size of the current block used as a basis for selecting an interpolation filter may be represented by M. Similarly, when an intra prediction mode having a horizontal directionality is applied to the current block, the size of the current block may be represented by N. Here, when the intra prediction modes include 65 directional intra prediction modes and 2 non-directional intra prediction modes, the intra prediction modes having vertical directionality may indicate intra prediction modes numbered 34 to 66, and the intra prediction modes having horizontal directionality may indicate intra prediction modes numbered 2 to 33.

[0145] For example, it may be determined whether the size of the current block, which is determined according to the shape of the current block and the direction of the intra prediction mode, is smaller than a specific value. If the size of the current block is smaller than the specific value, a fine interpolation filter may be determined as the interpolation filter for the target sample. If the size of the current block is not smaller than the specific value, an interpolation filter with a low-pass filter effect may be determined as the interpolation filter for the target sample. Specifically, if the size of the current block is smaller than the specific value, a cubic filter may be determined as the interpolation filter for the target sample. If the size of the current block is not smaller than the specific value, a Gaussian filter may be determined as the interpolation filter for the target sample. Alternatively, if the size of the current block is not smaller than the specific value, a linear filter may be determined as the interpolation filter for the target sample. The interpolation filter with a low-pass filter effect may include the Gaussian filter and a linear filter. Here, the specific value may be set to 4, 8, 16, 32, etc.

[0146] Specifically, if the width and height of the current block are the same (i.e., if the current block is a square block), it can be determined whether the width of the current block is smaller than a specific value, and if the width of the current block is smaller than the specific value, the interpolation filter for the target sample can be derived as a cubic filter, and if the width of the current block is not smaller than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0147] In addition, if the width and height of the current block are different (i.e., the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode having vertical directionality, it can be determined whether the width of the current block is smaller than a specific value, and if the width of the current block is smaller than the specific value, the interpolation filter for the target sample can be derived as a cubic filter, and if the width of the current block is not smaller than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0148] In addition, if the width and height of the current block are different (i.e., the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, it can be determined whether the height of the current block is smaller than a specific value, and if the height of the current block is smaller than the specific value, the interpolation filter for the target sample can be derived as a cubic filter, and if the height of the current block is not smaller than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0149] In addition, if the width and height of the current block are different (i.e., the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode having vertical directionality, it can be determined whether the height of the current block is smaller than a specific value, and if the height of the current block is smaller than the specific value, the interpolation filter for the target sample can be derived as a cubic filter, and if the height of the current block is not smaller than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0150] In addition, if the width and height of the current block are different (i.e., the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, it can be determined whether the width of the current block is smaller than a specific value, and if the width of the current block is smaller than the specific value, the interpolation filter for the target sample can be derived as a cubic filter, and if the width of the current block is not smaller than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0151] As another example, the interpolation filter for the current sample may be determined based on the intra prediction mode of the current block.

[0152] For example, it may be determined whether the prediction angle of the intra prediction mode of the current block is smaller than a specific value. If the prediction angle of the intra prediction mode is smaller than the specific value, a fine interpolation filter may be determined as the interpolation filter for the target sample. If the prediction angle of the intra prediction mode is not smaller than the specific value, an interpolation filter with a low-pass filter effect may be determined as the interpolation filter for the target sample. Specifically, if the prediction angle of the intra prediction mode is smaller than the specific value, a cubic filter may be determined as the interpolation filter for the target sample. If the prediction angle of the intra prediction mode is not smaller than the specific value, a Gaussian filter may be determined as the interpolation filter for the target sample. Alternatively, if the prediction angle of the intra prediction mode is not smaller than the specific value, a linear filter may be determined as the interpolation filter for the target sample. The interpolation filter with a low-pass filter effect may include the Gaussian filter and a linear filter. Here, the specific value may be set to 4, 8, 16, or 32, etc. The prediction angle of the intra prediction mode may be derived based on Table 1, and intraPredAngle may indicate the prediction angle of the intra prediction mode. Also, as an example, the specific value may be set to 11.

[0153] As another example, the interpolation filter for the target sample may be determined based on the size of the current block and the intra prediction mode. If the current block is a square block, the width and height are the same, i.e., the current block is a square block of NxN size. Therefore, the reference size (i.e., reference value) for selecting an interpolation filter may be N for any directional intra prediction mode of any prediction direction. On the other hand, if the current block is a non-square block, i.e., a non-square block of MxN size, when the intra prediction mode of the current block is an intra prediction mode having a vertical direction, the size of the block (i.e., reference value) for selecting an interpolation filter may be M. Similarly, when the current block is a non-square block of MxN size and the intra prediction mode of the current block is an intra prediction mode having a horizontal direction, the size of the current block (i.e., reference value) for selecting an interpolation filter may be N. Alternatively, when the current block is a non-square block of M×N size and the intra prediction mode of the current block is an intra prediction mode having a vertical directionality, the interpolation filter of the current block may be selected based on N. Similarly, when the current block is a non-square block of M×N size and the intra prediction mode of the current block is an intra prediction mode having a horizontal directionality, the interpolation filter of the current block may be selected based on M. However, in a specific example described below, when an intra prediction mode having a vertical directionality is applied to the current block having a size of M×N, the size of the current block used as a basis for selecting an interpolation filter may be represented by M. Similarly, when an intra prediction mode having a horizontal directionality is applied to the current block, the size of the current block may be represented by N.Here, when the intra prediction modes include 65 directional intra prediction modes and 2 non-directional intra prediction modes, the intra prediction modes having vertical directionality may indicate intra prediction modes numbered 34 to 66, and the intra prediction modes having horizontal directionality may indicate intra prediction modes numbered 2 to 33.

[0154] For example, the encoding apparatus may determine whether the size of the current block is smaller than a first specific value, and if the size of the current block is not smaller than the first specific value, may determine an interpolation filter with a low-pass filter effect as the interpolation filter for the target sample. Specifically, if the size of the current block is not smaller than the first specific value, the encoding apparatus may determine a Gaussian filter as the interpolation filter. Alternatively, if the size of the current block is not smaller than the first specific value, the encoding apparatus may determine a linear filter as the interpolation filter.

[0155] Specifically, if the width and height of the current block are the same, the encoding device can determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is not smaller than the first specific value, it can determine a Gaussian filter or a linear filter as the interpolation filter for the target sample.

[0156] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having a vertical directionality, the encoding device can determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is not smaller than the first specific value, can determine a Gaussian filter or a linear filter as the interpolation filter for the target sample.

[0157] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the encoding device can determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is not smaller than the first specific value, can determine a Gaussian filter or a linear filter as the interpolation filter for the target sample.

[0158] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having a vertical directionality, the encoding device can determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is not smaller than the first specific value, can determine a Gaussian filter or a linear filter as the interpolation filter for the target sample.

[0159] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the encoding device can determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is not smaller than the first specific value, can determine a Gaussian filter or a linear filter as the interpolation filter for the target sample.

[0160] If the size of the current block is smaller than the first specific value, the encoding apparatus may determine whether a prediction angle of an intra prediction mode of the current block is smaller than a second specific value, and if the prediction angle of the intra prediction mode is smaller than the second specific value, may determine a refined interpolation filter as an interpolation filter for the target sample. Specifically, if the size of the current block is smaller than the first specific value, the encoding apparatus may determine a cubic filter as the interpolation filter.

[0161] Specifically, when the width and height of the current block are the same, if the width of the current block is smaller than the first specific value, the encoding device can determine whether the prediction angle of the intra prediction mode of the current block is smaller than the second specific value, and if the prediction angle of the intra prediction mode is smaller than the second specific value, the encoding device can determine a cubic filter as the interpolation filter.

[0162] Furthermore, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having a vertical direction, the encoding apparatus may determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is smaller than the first specific value, the encoding apparatus may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is smaller than the second specific value, the encoding apparatus may determine a cubic filter as the interpolation filter.

[0163] In addition, if the width and height of a current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the encoding apparatus may determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is smaller than the first specific value, the encoding apparatus may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is smaller than the second specific value, the encoding apparatus may determine a cubic filter as the interpolation filter.

[0164] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having a vertical direction, the encoding apparatus may determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is smaller than the first specific value, the encoding apparatus may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is smaller than the second specific value, the encoding apparatus may determine a cubic filter as the interpolation filter.

[0165] Furthermore, if the width and height of a current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the encoding apparatus may determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is smaller than the first specific value, the encoding apparatus may determine whether a prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is smaller than the second specific value, the encoding apparatus may determine a cubic filter as the interpolation filter.

[0166] Furthermore, if the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding device may determine an interpolation filter having a low-pass filter effect as the interpolation filter for the current sample. Specifically, if the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding device may determine a Gaussian filter as the interpolation filter. Alternatively, if the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding device may determine a linear filter as the interpolation filter.

[0167] Specifically, when the width and height of the current block are the same, if the width of the current block is smaller than the first specific value, the encoding device can determine whether the prediction angle of the intra prediction mode of the current block is smaller than the second specific value, and if the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding device can determine a Gaussian filter or a linear filter as the interpolation filter.

[0168] Furthermore, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having a vertical direction, the encoding apparatus may determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is smaller than the first specific value, the encoding apparatus may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding apparatus may determine the interpolation filter to be a Gaussian filter or a linear filter.

[0169] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the encoding apparatus may determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is smaller than the first specific value, the encoding apparatus may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding apparatus may determine the interpolation filter to be a Gaussian filter or a linear filter.

[0170] Furthermore, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having a vertical direction, the encoding apparatus may determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is smaller than the first specific value, the encoding apparatus may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding apparatus may determine the interpolation filter to be a Gaussian filter or a linear filter.

[0171] Furthermore, if the width and height of a current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the encoding apparatus may determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is smaller than the first specific value, the encoding apparatus may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding apparatus may determine the interpolation filter to be a Gaussian filter or a linear filter.

[0172] As another example, the current block may be divided into a plurality of regions, and an interpolation filter for each region may be determined based on the distance between each region and an adjacent sample of the current block. In this case, the interpolation filter for the target sample may be derived as the interpolation filter for the region including the target sample. Also, if the size of the current block is equal to or greater than a certain size, the current block may be divided into a plurality of regions. Specifically, an interpolation filter for a region of the regions whose distance to an adjacent sample of the current block is closer than a certain value may be determined to be a fine interpolation filter, and an interpolation filter for a region of the regions whose distance to an adjacent sample of the current block is farther than a certain value may be determined to be an interpolation filter having a low-pass filter effect.

[0173] Meanwhile, the sizes of the regions into which the current block is divided may be preset. Alternatively, the sizes of the regions may be derived based on the size of the current block, the intra prediction mode, etc. For example, if the intra prediction mode of the current block is one of the 35th to 66th intra prediction modes, the size of the regions into which the current block is divided may be derived as a 4x4 size. In this case, if the size of the current block is 16x16, the current block is divided into 16 4x4 regions, and the interpolation filters for regions 0 to 7 in raster scan order among the regions may be determined to be fine interpolation filters, and the interpolation filters for the other regions may be determined to be interpolation filters having a low-pass filter effect. For example, the interpolation filters for regions 0 to 7 in the raster scan order may be determined to be cubic filters, and the interpolation filters for the other regions may be determined to be Gaussian filters or linear filters. Here, the numbers of the 16 4x4 region sizes according to the raster scan order may be derived in order from top row to bottom row, and from left to right within each row. That is, among the 16 4x4 size regions of the current block, the regions included in the first row from the top may be represented as region 0, region 1, region 2, and region 3 from left to right, the regions included in the second row may be represented as region 4, region 5, region 6, and region 7 from left to right, the regions included in the third row may be represented as region 8, region 9, region 10, and region 11 from left to right, and the regions included in the fourth row may be represented as region 12, region 13, region 14, and region 15 from left to right. Meanwhile, information indicating the sizes of the regions into which the current block is divided and the interpolation filters for each of the regions may be generated.

[0174] As another example, the interpolation filter for the target sample may be determined based on the distance between the target sample and the reference sample. Here, the distance between the target sample and the reference sample may be derived based on the position of the target sample and the prediction angle of the intra prediction mode of the current block. For example, it may be calculated based on a trigonometric function value (e.g., tan θ) according to the position of the target sample and the prediction angle of the intra prediction mode. Alternatively, it may be derived based on a predefined table for the block size and the intra prediction mode. Alternatively, the distance between the target sample and the reference sample may represent a vertical distance or a horizontal distance. That is, the distance between the target sample and the reference sample may be derived based on the vertical distance or the horizontal distance. For example, if the distance between the target sample and the reference sample represents a vertical distance, the distance may be derived based on the y component of the target sample. Alternatively, if the distance between the target sample and the reference sample represents a horizontal distance, the distance may be derived based on the x component of the target sample.

[0175] For example, the encoding apparatus may derive a distance between the target sample and the reference sample and determine whether the distance is less than a specific value. If the distance is less than a specific value, the encoding apparatus may determine a sophisticated interpolation filter as the interpolation filter for the target sample. If the distance is not less than a specific value, the encoding apparatus may determine an interpolation filter with a low-pass filter effect as the interpolation filter for the target sample. Specifically, if the distance is less than a specific value, the encoding apparatus may determine a cubic filter as the interpolation filter for the target sample. If the distance is not less than a specific value, the encoding apparatus may determine a Gaussian filter or a linear filter as the interpolation filter for the target sample. The specific value may be derived based on the size of the current block. Alternatively, the specific value may be derived based on the intra prediction mode of the current block, whether the current block is a square or non-square block, etc. For example, if the size of the current block is N×N, the specific value may be derived as N / 2. Also, information about the specific value can be generated and transmitted after being entropy encoded.

[0176] As another example, a plurality of interpolation filters may be determined as the interpolation filter for the target sample. For example, the interpolation filter for the target sample may include one of the fine interpolation filters and one of the interpolation filters with a low-pass filter effect. Alternatively, the interpolation filter for the target sample may include one of the fine interpolation filters and two of the interpolation filters with a low-pass filter effect. Alternatively, the interpolation filter for the target sample may include two of the fine interpolation filters and one of the interpolation filters with a low-pass filter effect. Specifically, the interpolation filter for the target sample may include a cubic filter and a Gaussian filter.

[0177] The encoding apparatus derives a predicted sample of the current sample based on the interpolation filter and the reference sample (S1340). The encoding apparatus may derive filter coefficients of the interpolation filter based on the position of the current sample and the prediction angle of the intra prediction mode, and may derive the predicted sample of the current sample based on the filter coefficients and the reference sample. For example, four neighboring samples of the current block may be derived as the reference samples, and four filter coefficients of the interpolation filter may be derived. The encoding apparatus may derive the predicted sample by interpolating the reference sample based on the filter coefficients. The predicted sample may be derived based on Equation 1 above.

[0178] Furthermore, when multiple interpolation filters are determined as the interpolation filter for the current sample, the encoding apparatus may derive (temporary) predicted samples based on each interpolation filter, and may derive a predicted sample for the current sample based on the derived (temporary) predicted samples. For example, the predicted sample for the current sample may be derived by averaging the (temporary) predicted samples or by weighting the (temporary) predicted samples. Meanwhile, whether multiple interpolation filters are determined as the interpolation filter for the current sample may be determined based on the size of the current block, the intra prediction mode of the current block, or the variance of neighboring sample values ​​of the current block. Also, a flag indicating whether multiple interpolation filters are determined as the interpolation filter for the current sample may be generated.

[0179] For example, the interpolation filter for the target sample may include a cubic filter and a Gaussian filter. In this case, the encoding apparatus may derive filter coefficients of the cubic filter based on the position of the target sample and a prediction angle of the intra prediction mode, and may derive filter coefficients of the Gaussian filter based on the position of the target sample and a prediction angle of the intra prediction mode. The encoding apparatus may derive a first predicted sample for the target sample based on the filter coefficients of the cubic filter and the reference sample, derive a second predicted sample for the target sample based on the filter coefficients of the Gaussian filter and the reference sample, and derive the predicted sample of the target sample based on the first predicted sample and the second predicted sample. The predicted sample of the target sample may be derived by averaging the first predicted sample and the second predicted sample. Alternatively, the predicted sample of the target sample may be derived by a weighted sum of the first predicted sample and the second predicted sample. In this case, the weight for the first predicted sample may be inversely proportional to the distance between the target sample and the reference sample, and the weight for the second predicted sample may be derived by subtracting the weight for the first predicted sample from 1. Alternatively, the first weight and the second weight used here may be derived by being up-scaled to an integer unit to avoid decimal point operations.

[0180] Also, for example, the interpolation filter for the target sample may include a cubic filter and a linear filter. In this case, the encoding apparatus may derive filter coefficients of the cubic filter based on the position of the reference sample and may derive filter coefficients of the linear filter based on the position of the reference sample. The encoding apparatus may derive a first predicted sample for the target sample based on the filter coefficients of the cubic filter and the reference sample, derive a second predicted sample for the target sample based on the filter coefficients of the linear filter and the reference sample, and derive the predicted sample of the target sample based on the first predicted sample and the second predicted sample. The predicted sample of the target sample may be derived by averaging the first predicted sample and the second predicted sample. Alternatively, the predicted sample of the target sample may be derived by a weighted sum of the first predicted sample and the second predicted sample. In this case, the weight for the first predicted sample may be inversely proportional to the distance between the target sample and the reference sample, and the weight for the second predicted sample may be derived by subtracting the weight for the first predicted sample from 1. Alternatively, the first weight and the second weight used here may be derived by being up-scaled to an integer unit to avoid decimal point operations.

[0181] As another example, when a most probable mode (MPM) mode is applied to the current block and the intra prediction mode of the current block is derived based on the intra prediction mode of a neighboring block of the current block, and the intra prediction mode of the current block is a directional intra prediction mode other than a planar mode or a DC mode, an interpolation filter for the target sample may be determined based on the neighboring block selected via the MPM mode. That is, the interpolation filter used for the neighboring block may be derived as the interpolation filter for the target sample. Here, when the MPM mode is applied to the current block, the encoding apparatus may determine an MPM list based on the intra prediction mode of a neighboring block to the left or above the current block, and determine the intra prediction mode based on the MPM list.

[0182] The encoding apparatus generates, encodes, and outputs prediction information for the current block (S1350). The encoding apparatus may encode the prediction information for the current block and output it in the form of a bitstream. The prediction information may include information about the intra prediction mode of the current block. The encoding apparatus may generate, encode, and output information about the intra prediction mode indicating the intra prediction mode in the form of a bitstream. The information about the intra prediction mode may include information directly indicating the intra prediction mode for the current block, or may include information indicating one candidate from an intra prediction mode candidate list derived based on the intra prediction mode of a block to the left or above the current block. The intra prediction mode candidate list may indicate the MPM list.

[0183] Furthermore, if the current block is divided into a plurality of regions, the prediction information may include information indicating the size of the regions into which the current block is divided and an interpolation filter for each region. Furthermore, if the interpolation filter for the target sample is selected based on the size of the current block, the intra-prediction mode of the current block, or the distance between the target sample and the reference sample, the prediction information may include information on the specific value used to select the interpolation filter for the target sample. If the interpolation filter is selected based on the size of the current block and the intra-prediction mode of the current block, the prediction information may include information on a first specific value and information on a second specific value. Furthermore, the prediction information may include a flag indicating whether multiple interpolation filters are determined as the interpolation filters for the target sample. If the flag indicates that multiple interpolation filters are determined as the interpolation filters for the target sample, a predicted sample for the target sample may be derived based on the multiple interpolation filters. If the flag indicates that multiple interpolation filters are not determined as the interpolation filters for the target sample, a predicted sample for the target sample may not be derived based on the multiple interpolation filters. For example, if the value of the flag is 1, the flag may indicate that multiple interpolation filters are determined as the interpolation filter for the target sample, and if the value of the flag is 0, the flag may indicate that multiple interpolation filters are not determined as the interpolation filter for the target sample. The prediction information may be signaled via a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), or a slice segment header, or may be signaled on a block-by-block basis.

[0184] Figure 14 shows an outline of a video decoding method by a decoding device according to the present invention. The method disclosed in Figure 14 can be performed by the decoding device disclosed in Figure 4. Specifically, for example, steps S1400 to S1440 in Figure 14 can be performed by a prediction unit of the decoding device.

[0185] A decoding apparatus derives an intra-prediction mode for a current block (S1400). The decoding apparatus may obtain prediction information for the current block via a bitstream. The prediction information may include information directly indicating the intra-prediction mode for the current block, or may include information indicating one of an intra-prediction mode candidate list derived based on the intra-prediction mode of a block to the left or above the current block. The intra-prediction mode candidate list is also referred to as an MPM candidate list. The decoding apparatus may derive the intra-prediction mode for the current block based on the obtained prediction information. The intra-prediction mode is one of two non-directional prediction modes and 33 directional prediction modes. As described above, the two non-directional prediction modes may include an intra-DC mode and an intra-planar mode. Alternatively, the intra-prediction mode may be one of two non-directional intra-prediction modes and 65 directional intra-prediction modes. As described above, the two non-directional prediction modes may include an intra-DC mode and an intra-planar mode. The 65 directional intra prediction modes may include a vertical directional intra prediction mode and a horizontal directional intra prediction mode. The vertical directional intra prediction modes may include intra prediction modes 34 to 66, and the horizontal directional intra prediction modes may include intra prediction modes 2 to 33.

[0186] The decoding apparatus derives neighboring samples including a left neighboring sample and an upper neighboring sample of the current block (S1410). The decoding apparatus may derive neighboring samples of the current block. The neighboring samples may include the left neighboring sample and the upper neighboring sample. The neighboring samples may also include an upper-left neighboring sample. The left neighboring sample, the upper-left neighboring sample, and the upper neighboring sample may be derived from neighboring blocks that have already been reconstructed at the time of decoding the current block. 2N upper neighboring samples, upper-left neighboring samples, and 2N left neighboring samples of the current block may be derived. Here, if the size of the current block is NxN and the x component and y component of the top-left sample of the current block are 0 and 0, respectively, the left adjacent sample is p[-1][0] to p[-1][2N-1], the top-left adjacent sample is p[-1][-1], and the top adjacent sample is p[0][-1] to p[2N-1][-1].

[0187] Alternatively, if the size of the current block is M×N and the x component of the top-left sample of the current block is 0 and the y component of the top-left sample of the current block is 0, the M+N upper neighboring samples, the upper left neighboring sample, and the M+N left neighboring samples of the current block can be derived. If the size of the current block is non-square, M×N, and the x component of the top-left sample of the current block is 0 and the y component of the top-left sample of the current block is 0, the left neighboring sample is p[-1][0] to p[-1][M+N-1], the upper left neighboring sample is p[-1][-1], and the upper neighboring sample is p[0][-1] to p[M+N-1][-1].

[0188] The decoding apparatus derives a reference sample for predicting the target sample from the neighboring samples based on the position of the target sample of the current block and the prediction angle of the intra prediction mode (S1420). The decoding apparatus may derive the position of the reference sample for the target sample based on the position of the target sample of the current block and the prediction angle of the intra prediction mode. If the position of the reference sample is a fractional sample position, the decoding apparatus may derive, as the reference sample for the target sample, a neighboring sample located adjacent to the position derived based on the position of the target sample of the current block and the prediction angle of the intra prediction mode. That is, the decoding apparatus may derive multiple neighboring samples as the reference sample for the target sample based on the position of the target sample of the current block and the prediction angle of the intra prediction mode. For example, four neighboring samples may be derived as the reference sample for the target sample. Here, the target sample may represent a sample within the current block on which intra prediction is performed. The prediction angle of the intra prediction mode may be derived based on Table 1 above, and intraPredAngle is a variable indicating the prediction angle derived from the intra prediction mode.

[0189] The decoding apparatus determines an interpolation filter for the target sample (S1430). The decoding apparatus may determine the interpolation filter for the target sample based on the size of the current block and / or the intra-prediction mode of the current block. For example, the interpolation filter may be determined when the position of the reference sample is a fractional sample position.

[0190] As an example, the interpolation filter for the target sample may be determined based on the size of the current block. For example, if the size of the current block is 4x4, a refined interpolation filter may be determined as the interpolation filter for the target sample. Specifically, if the size of the current block is 4x4, a cubic filter may be determined as the interpolation filter for the target sample. The cubic filter is one of refined interpolation filters, and is also called a spline filter.

[0191] If the current block is a square block, the width and height are the same, i.e., the current block is an NxN square block, so the reference size (i.e., reference value) for selecting an interpolation filter can be N for any directional intra prediction mode of any prediction direction. On the other hand, if the current block is a non-square block, i.e., when the current block is an MxN non-square block, and the intra prediction mode of the current block is an intra prediction mode having a vertical direction, the size of the block (i.e., reference value) for selecting an interpolation filter can be M. Similarly, if the current block is an MxN non-square block and the intra prediction mode of the current block is an intra prediction mode having a horizontal direction, the size of the current block (i.e., reference value) for selecting an interpolation filter can be N. Alternatively, when the current block is a non-square block of M×N size and the intra prediction mode of the current block is an intra prediction mode having a vertical directionality, the interpolation filter of the current block may be selected based on N. Similarly, when the current block is a non-square block of M×N size and the intra prediction mode of the current block is an intra prediction mode having a horizontal directionality, the interpolation filter of the current block may be selected based on M. However, in a specific example described below, when an intra prediction mode having a vertical directionality is applied to the current block having a size of M×N, the size of the current block used as a basis for selecting an interpolation filter may be represented by M. Similarly, when an intra prediction mode having a horizontal directionality is applied to the current block, the size of the current block may be represented by N. Here, when the intra prediction modes include 65 directional intra prediction modes and 2 non-directional intra prediction modes, the intra prediction modes having vertical directionality may indicate intra prediction modes numbered 34 to 66, and the intra prediction modes having horizontal directionality may indicate intra prediction modes numbered 2 to 33.

[0192] For example, it may be determined whether the size of the current block is smaller than a specific value. If the size of the current block is smaller than the specific value, a fine interpolation filter may be determined as the interpolation filter for the target sample. If the size of the current block is not smaller than the specific value, an interpolation filter with a low-pass filter effect may be determined as the interpolation filter for the target sample. Specifically, if the size of the current block is smaller than the specific value, a cubic filter may be determined as the interpolation filter for the target sample. If the size of the current block is not smaller than the specific value, a Gaussian filter may be determined as the interpolation filter for the target sample. Alternatively, if the size of the current block is not smaller than the specific value, a linear filter may be determined as the interpolation filter for the target sample. The interpolation filter with a low-pass filter effect may include the Gaussian filter and a linear filter. Here, the specific value may be set to 4, 8, 16, 32, etc. Furthermore, the prediction information for the current block may include information regarding the specific value. In this case, the specific value can be derived based on information for the specific value.

[0193] Specifically, if the current block has the same width and height (i.e., if the current block is a square block), it can be determined whether the width of the current block is smaller than a specific value, and if the width of the current block is smaller than the specific value, the interpolation filter for the target sample can be derived as a cubic filter, and if the width of the current block is not smaller than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0194] In addition, if the width and height of the current block are different (i.e., the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode having vertical directionality, it can be determined whether the width of the current block is smaller than a specific value, and if the width of the current block is smaller than the specific value, the interpolation filter for the target sample can be derived as a cubic filter, and if the width of the current block is not smaller than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0195] In addition, if the width and height of the current block are different (i.e., the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, it can be determined whether the height of the current block is smaller than a specific value, and if the height of the current block is smaller than the specific value, the interpolation filter for the target sample can be derived as a cubic filter, and if the height of the current block is not smaller than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0196] In addition, if the width and height of the current block are different (i.e., the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode having vertical directionality, it can be determined whether the height of the current block is smaller than a specific value, and if the height of the current block is smaller than the specific value, the interpolation filter for the target sample can be derived as a cubic filter, and if the height of the current block is not smaller than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0197] In addition, if the width and height of the current block are different (i.e., the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, it can be determined whether the width of the current block is smaller than a specific value, and if the width of the current block is smaller than the specific value, the interpolation filter for the target sample can be derived as a cubic filter, and if the width of the current block is not smaller than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0198] As another example, the interpolation filter for the current sample may be determined based on the intra prediction mode of the current block.

[0199] For example, it may be determined whether the prediction angle of the intra prediction mode of the current block is smaller than a specific value. If the prediction angle of the intra prediction mode is smaller than the specific value, a fine interpolation filter may be determined as the interpolation filter for the target sample. If the prediction angle of the intra prediction mode is not smaller than the specific value, an interpolation filter with a low-pass filter effect may be determined as the interpolation filter for the target sample. Specifically, if the prediction angle of the intra prediction mode is smaller than the specific value, a cubic filter may be determined as the interpolation filter for the target sample. If the prediction angle of the intra prediction mode is not smaller than the specific value, a Gaussian filter may be determined as the interpolation filter for the target sample. Alternatively, if the prediction angle of the intra prediction mode is not smaller than the specific value, a linear filter may be determined as the interpolation filter for the target sample. The interpolation filter with a low-pass filter effect may include the Gaussian filter and a linear filter. Here, the specific value may be set to 4, 8, 16, or 32, etc. The prediction angle of the intra prediction mode may be derived based on Table 1, and intraPredAngle may indicate the prediction angle of the intra prediction mode. As an example, the specific value may be set to 11. Furthermore, the prediction information for the current block may include information on the specific value. In this case, the specific value may be derived based on the information on the specific value.

[0200] As another example, the interpolation filter for the target sample may be determined based on the size of the current block and the intra prediction mode.

[0201] For example, the decoding device may determine whether the size of the current block is smaller than a first specific value, and if the size of the current block is not smaller than the first specific value, may determine an interpolation filter having a low-pass filter effect as the interpolation filter for the target sample. Specifically, if the size of the current block is not smaller than the first specific value, the decoding device may determine a Gaussian filter as the interpolation filter. Alternatively, if the size of the current block is not smaller than the first specific value, the decoding device may determine a linear filter as the interpolation filter.

[0202] Specifically, if the width and height of the current block are the same, the decoding device can determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is not smaller than the first specific value, it can determine a Gaussian filter or a linear filter as the interpolation filter for the target sample.

[0203] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having vertical directionality, the decoding device can determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is not smaller than the first specific value, can determine a Gaussian filter or a linear filter as the interpolation filter for the target sample.

[0204] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the decoding device can determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is not smaller than the first specific value, can determine a Gaussian filter or a linear filter as the interpolation filter for the target sample.

[0205] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having vertical directionality, the decoding device can determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is not smaller than the first specific value, can determine a Gaussian filter or a linear filter as the interpolation filter for the target sample.

[0206] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the decoding device can determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is not smaller than the first specific value, can determine a Gaussian filter or a linear filter as the interpolation filter for the target sample.

[0207] If the size of the current block is smaller than the first specific value, the decoding device may determine whether a prediction angle of an intra prediction mode of the current block is smaller than a second specific value, and if the prediction angle of the intra prediction mode is smaller than the second specific value, the decoding device may determine a fine interpolation filter as the interpolation filter for the target sample. Specifically, if the prediction angle of the intra prediction mode is smaller than the second specific value, the decoding device may determine a cubic filter as the interpolation filter.

[0208] Specifically, when the width and height of the current block are the same, if the width of the current block is smaller than the first specific value, the decoding device can determine whether the prediction angle of the intra prediction mode of the current block is smaller than the second specific value, and if the prediction angle of the intra prediction mode is smaller than the second specific value, the decoding device can determine a cubic filter as the interpolation filter.

[0209] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having vertical directionality, the decoding device may determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is smaller than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is smaller than the second specific value, the decoding device may determine a cubic filter as the interpolation filter.

[0210] In addition, if the width and height of a current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the decoding device may determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is smaller than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is smaller than the second specific value, the decoding device may determine a cubic filter as the interpolation filter.

[0211] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having vertical directionality, the decoding device may determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is smaller than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is smaller than the second specific value, the decoding device may determine a cubic filter as the interpolation filter.

[0212] In addition, if the width and height of a current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the decoding device may determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is smaller than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is smaller than the second specific value, the decoding device may determine a cubic filter as the interpolation filter.

[0213] Furthermore, if the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding device may determine an interpolation filter having a low-pass filter effect as the interpolation filter for the current sample. Specifically, if the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding device may determine a Gaussian filter as the interpolation filter. Alternatively, if the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding device may determine a linear filter as the interpolation filter.

[0214] Specifically, when the width and height of the current block are the same, if the width of the current block is smaller than the first specific value, the decoding device can determine whether the prediction angle of the intra prediction mode of the current block is smaller than the second specific value, and if the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding device can determine a Gaussian filter or a linear filter as the interpolation filter.

[0215] Furthermore, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having vertical directionality, the decoding device may determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is smaller than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding device may determine a Gaussian filter or a linear filter as the interpolation filter.

[0216] In addition, if the width and height of a current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the decoding apparatus may determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is smaller than the first specific value, the decoding apparatus may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding apparatus may determine a Gaussian filter or a linear filter as the interpolation filter.

[0217] In addition, if the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having vertical directionality, the decoding device may determine whether the height of the current block is smaller than a first specific value, and if the height of the current block is smaller than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding device may determine a Gaussian filter or a linear filter as the interpolation filter.

[0218] In addition, if the width and height of a current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directionality, the decoding apparatus may determine whether the width of the current block is smaller than a first specific value, and if the width of the current block is smaller than the first specific value, the decoding apparatus may determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. If the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding apparatus may determine a Gaussian filter or a linear filter as the interpolation filter.

[0219] Meanwhile, the prediction information for the current block may include information on the first specific value and information on the second specific value. In this case, the first specific value may be derived based on the information on the first specific value, and the second specific value may be derived based on the information on the second specific value. Alternatively, the first specific value and the second specific value may be derived based on previously set values.

[0220] As another example, the current block may be divided into a plurality of regions, and an interpolation filter for each region may be determined based on the distance between each region and an adjacent sample of the current block. In this case, the interpolation filter for the target sample may be derived as the interpolation filter for the region including the target sample. Also, if the size of the current block is equal to or greater than a certain size, the current block may be divided into a plurality of regions. Specifically, an interpolation filter for a region of the regions whose distance to an adjacent sample of the current block is closer than a certain value may be determined to be a fine interpolation filter, and an interpolation filter for a region of the regions whose distance to an adjacent sample of the current block is farther than a certain value may be determined to be an interpolation filter having a low-pass filter effect.

[0221] Meanwhile, the sizes of the regions into which the current block is divided may be preset. Alternatively, the sizes of the regions may be derived based on the size of the current block, the intra prediction mode, etc. For example, if the intra prediction mode of the current block is one of the 35th to 66th intra prediction modes, the size of the regions into which the current block is divided may be derived as a 4x4 size. In this case, if the size of the current block is 16x16, the current block is divided into 16 4x4 regions, and an interpolation filter for regions 0 to 7 in raster scan order among the regions may be determined to be a fine interpolation filter, and an interpolation filter for the other regions may be determined to be an interpolation filter having a low-pass filter effect. For example, an interpolation filter for regions 0 to 7 in raster scan order among the regions may be determined to be a cubic filter, and an interpolation filter for the other regions may be determined to be a Gaussian filter or a linear filter. Here, the numbers of the 16 4x4 size regions according to the raster scan order may be derived in order from top row to bottom row, and from left to right within each row. That is, of the 16 4x4 size regions of the current block, the regions included in the first row from the top may be represented as region 0, region 1, region 2, and region 3 from left to right, the regions included in the second row may be represented as region 4, region 5, region 6, and region 7 from left to right, the regions included in the third row may be represented as region 8, region 9, region 10, and region 11 from left to right, and the regions included in the fourth row may be represented as region 12, region 13, region 14, and region 15 from left to right.Meanwhile, prediction information for the current block may be received, and the prediction information may include information indicating the size of regions into which the current block is divided and information indicating an interpolation filter for each region. In this case, the size of the regions into which the current block is divided and the interpolation filter for each region may be derived based on the information indicating the size of the regions into which the current block is divided and the information indicating the interpolation filter for each region.

[0222] As another example, the interpolation filter for the target sample may be determined based on the distance between the target sample and the reference sample. Here, the distance between the target sample and the reference sample may be derived based on the position of the target sample and the prediction angle of the intra prediction mode of the current block. For example, it may be calculated based on a trigonometric function value (e.g., tan θ) according to the position of the target sample and the prediction angle of the intra prediction mode. Alternatively, it may be derived based on a predefined table for the block size and the intra prediction mode. Alternatively, the distance between the target sample and the reference sample may represent a vertical distance or a horizontal distance. If the distance between the target sample and the reference sample represents a vertical distance, the distance may be derived based on the y component of the target sample. Alternatively, if the distance between the target sample and the reference sample represents a horizontal distance, the distance may be derived based on the x component of the target sample.

[0223] For example, a decoding apparatus may derive a distance between the target sample and the reference sample and determine whether the distance is less than a specific value. If the distance is less than a specific value, the decoding apparatus may determine a sophisticated interpolation filter as the interpolation filter for the target sample. If the distance is not less than a specific value, the decoding apparatus may determine an interpolation filter with a low-pass filter effect as the interpolation filter for the target sample. Specifically, if the distance is less than a specific value, the decoding apparatus may determine a cubic filter as the interpolation filter for the target sample. If the distance is not less than a specific value, the decoding apparatus may determine a Gaussian filter or a linear filter as the interpolation filter for the target sample. The specific value may be derived based on the size of the current block. Alternatively, the specific value may be derived based on the intra prediction mode of the current block, whether the current block is a square or non-square block, etc. For example, if the size of the current block is N×N, the specific value may be derived as N / 2. Furthermore, prediction information for the current block may be received, and the prediction information may include information on the specific value, in which case the specific value may be derived based on the information on the specific value.

[0224] As another example, multiple interpolation filters may be determined as the interpolation filter for the target sample. For example, the interpolation filter for the target sample may include one of the fine interpolation filters and one of the interpolation filters with a low-pass filter effect. Alternatively, the interpolation filter for the target sample may include one of the fine interpolation filters and two of the interpolation filters with a low-pass filter effect. Alternatively, the interpolation filter for the target sample may include two of the fine interpolation filters and one of the interpolation filters with a low-pass filter effect. Specifically, the interpolation filter for the target sample may include a cubic filter and a Gaussian filter. Meanwhile, prediction information for the current block may be received, and the prediction information may include a flag indicating whether multiple interpolation filters are determined as the interpolation filter for the target sample. Whether multiple interpolation filters are determined may be determined based on the flag. For example, if the flag indicates that multiple interpolation filters are determined as the interpolation filters for the target sample, a predicted sample for the target sample may be derived based on the multiple interpolation filters, and if the flag indicates that multiple interpolation filters are not determined as the interpolation filters for the target sample, a predicted sample for the target sample is not derived based on the multiple interpolation filters. For example, if the value of the flag is 1, the flag may indicate that multiple interpolation filters are determined as the interpolation filters for the target sample, and if the value of the flag is 0, the flag may indicate that multiple interpolation filters are not determined as the interpolation filters for the target sample.

[0225] The decoding apparatus derives a predicted sample of the current sample based on the interpolation filter and the reference sample (S1440). The decoding apparatus may derive filter coefficients of the interpolation filter based on the position of the current sample and the prediction angle of the intra prediction mode, and may derive the predicted sample of the current sample based on the filter coefficients and the reference sample. For example, four neighboring samples of the current block may be derived as the reference samples, and four filter coefficients of the interpolation filter may be derived. The decoding apparatus may derive the predicted sample by interpolating the reference sample based on the filter coefficients. The predicted sample may be derived based on Equation 1 above.

[0226] Furthermore, when multiple interpolation filters are determined as the interpolation filter for the target sample, the decoding apparatus may derive (temporary) predicted samples based on the respective interpolation filters, and may derive a predicted sample for the target sample based on the derived (temporary) predicted samples. For example, the predicted sample for the target sample may be derived by averaging the (temporary) predicted samples or by weighting the (temporary) predicted samples. Meanwhile, whether multiple interpolation filters are determined as the interpolation filter for the target sample may be determined based on the size of the current block, the intra prediction mode of the current block, or the variance of neighboring sample values ​​of the current block. Also, a flag indicating whether multiple interpolation filters are determined as the interpolation filter for the target sample may be received, and whether multiple interpolation filters are determined as the interpolation filter for the target sample may be determined based on the flag.

[0227] For example, the interpolation filter for the target sample may include a cubic filter and a Gaussian filter. In this case, the decoding apparatus may derive filter coefficients of the cubic filter based on the position of the target sample and a prediction angle of the intra prediction mode, and may derive filter coefficients of the Gaussian filter based on the position of the target sample and a prediction angle of the intra prediction mode. The decoding apparatus may derive a first predicted sample for the target sample based on the filter coefficients of the cubic filter and the reference sample, derive a second predicted sample for the target sample based on the filter coefficients of the Gaussian filter and the reference sample, and derive the predicted sample of the target sample based on the first predicted sample and the second predicted sample. The predicted sample of the target sample may be derived by averaging the first predicted sample and the second predicted sample. Alternatively, the predicted sample of the target sample may be derived by a weighted sum of the first predicted sample and the second predicted sample. In this case, the weight for the first predicted sample may be inversely proportional to the distance between the target sample and the reference sample, and the weight for the second predicted sample may be derived by subtracting the weight for the first predicted sample from 1. Alternatively, the first weight and the second weight used here may be derived by being up-scaled to an integer unit to avoid decimal point operations.

[0228] Also, for example, the interpolation filter for the target sample may include a cubic filter and a linear filter. In this case, the decoding device may derive filter coefficients of the cubic filter based on the position of the reference sample and may derive filter coefficients of the linear filter based on the position of the reference sample. The decoding device may derive a first predicted sample for the target sample based on the filter coefficients of the cubic filter and the reference sample, derive a second predicted sample for the target sample based on the filter coefficients of the linear filter and the reference sample, and derive the predicted sample of the target sample based on the first predicted sample and the second predicted sample. The predicted sample of the target sample may be derived by averaging the first predicted sample and the second predicted sample. Alternatively, the predicted sample of the target sample may be derived by a weighted sum of the first predicted sample and the second predicted sample. In this case, the weight for the first predicted sample may be inversely proportional to the distance between the target sample and the reference sample, and the weight for the second predicted sample may be derived by subtracting the weight for the first predicted sample from 1. Alternatively, the first weight and the second weight used here may be derived by being up-scaled to an integer unit to avoid decimal point operations.

[0229] As another example, when a most probable mode (MPM) mode is applied to the current block and the intra prediction mode of the current block is derived based on the intra prediction mode of a neighboring block of the current block, and the intra prediction mode of the current block is a directional intra prediction mode other than a planar mode or a DC mode, an interpolation filter for the target sample may be determined based on the neighboring block selected via the MPM mode. That is, the interpolation filter used for the neighboring block may be derived as the interpolation filter for the target sample. Here, when the MPM mode is applied to the current block, the decoding apparatus may determine an MPM list based on the intra prediction mode of a neighboring block to the left or above the current block, and determine the intra prediction mode based on the MPM list.

[0230] Meanwhile, although not shown in the drawing, the decoding apparatus may use the prediction samples as reconstructed samples according to a prediction mode, or may generate reconstructed samples by adding residual samples to the prediction samples. If residual samples for the current block exist, the decoding apparatus may receive information about the residual for the current block, and the information about the residual may be included in information about the reconstructed samples. The information about the residual may include transform coefficients related to the residual samples. The decoding apparatus may derive the residual samples (or residual sample array) for the current block based on the residual information. The decoding apparatus may generate reconstructed samples based on the prediction samples and the residual samples, and may derive a reconstructed block or a reconstructed picture based on the reconstructed samples. As described above, the decoding apparatus may apply an in-loop filtering procedure, such as deblocking filtering and / or an SAO procedure, to the reconstructed picture to improve subjective / objective image quality, if necessary.

[0231] Furthermore, the decoding apparatus may receive prediction information for the current block via a bitstream and perform entropy decoding. The prediction information may include information about the intra prediction mode of the current block. The decoding apparatus may obtain information about the intra prediction mode indicating the intra prediction mode. The information about the intra prediction mode may include information directly indicating the intra prediction mode for the current block, or may include information indicating one candidate from an intra prediction mode candidate list derived based on the intra prediction mode of a block to the left or above the current block. The intra prediction mode candidate list may indicate the MPM list.

[0232] Furthermore, if the current block is divided into a plurality of regions, the prediction information may include information indicating the size of the regions into which the current block is divided and an interpolation filter for each region. Furthermore, if the interpolation filter for the target sample is selected based on the size of the current block, the intra-prediction mode of the current block, or the distance between the target sample and the reference sample, the prediction information may include information on the specific value used to select the interpolation filter for the target sample. If the interpolation filter is selected based on the size of the current block and the intra-prediction mode of the current block, the prediction information may include information on a first specific value and information on a second specific value. Furthermore, the prediction information may include a flag indicating whether multiple interpolation filters are determined as the interpolation filters for the target sample. If the flag indicates that multiple interpolation filters are determined as the interpolation filters for the target sample, the predicted sample for the target sample may be derived based on multiple interpolation filters. If the flag indicates that multiple interpolation filters are not determined as the interpolation filters for the target sample, the predicted sample for the target sample may not be derived based on the multiple interpolation filters. For example, if the value of the flag is 1, the flag may indicate that multiple interpolation filters are determined as the interpolation filter for the target sample, and if the value of the flag is 0, the flag may indicate that multiple interpolation filters are not determined as the interpolation filter for the target sample. The prediction information may be signaled via a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), or a slice segment header, or may be signaled on a block-by-block basis.

[0233] According to the present invention described above, prediction for the target sample can be performed based on an interpolation filter derived according to the size of the current block, the distance between the target sample and the reference sample, and / or a prediction mode (prediction angle), thereby more accurately generating reference samples at fractional sample positions for the target sample to improve prediction accuracy for the current block and reducing residuals for the current block to improve coding efficiency.

[0234] In addition, according to the present invention, an interpolation filter for a target sample can be selected based on the various conditions, thereby reducing the amount of information bits required for selecting an interpolation filter, thereby improving the prediction accuracy for the current block and thereby improving the coding efficiency of the current block.

[0235] In the above-described embodiments, the method is described based on a flowchart as a series of steps or blocks, but the present invention is not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps than those described. Furthermore, those skilled in the art will understand that the steps shown in the flowcharts are not exclusive, and other steps may be included, and one or more steps in the flowcharts may be deleted without affecting the scope of the present invention.

[0236] The above-described method according to the present invention can be implemented in software form, and the encoding device and / or decoding device according to the present invention can be included in a device that performs video processing, such as a TV, a computer, a smartphone, a set-top box, or a display device.

[0237] In the present invention, when an embodiment is implemented in software, the above-described methods may be implemented as modules (processes, functions, etc.) that perform the above-described functions. The modules may be stored in memory and executed by a processor. The memory may be internal or external to the processor and may be coupled to the processor in various well-known ways. The processor may include an application-specific integrated circuit (ASIC), other chipsets, logic circuits, and / or data processing devices. The memory may include read-only memory (ROM), random access memory (RAM), flash memory, memory cards, storage media, and / or other storage devices.

Claims

1. A video decoding method performed by a decoding device, comprising: obtaining prediction mode information for a current block from a bitstream; deriving an intra prediction mode of an upper neighboring block of the current block and an intra prediction mode of a left neighboring block of the current block; constructing a Most Probable Mode (MPM) list for the current block based on the intra prediction mode of the upper neighboring block and the intra prediction mode of the left neighboring block; Deriving an MPM candidate indicated by the prediction mode information from among the MPM candidates in the MPM list as the intra prediction mode of the current block; deriving neighboring samples including a left neighboring sample and an upper neighboring sample of the current block; deriving a reference sample for predicting the target sample from the neighboring samples based on a position of the target sample of the current block and a prediction angle of the intra prediction mode; determining an interpolation filter to be applied to the reference samples based on the intra prediction mode and the size of the current block; deriving a predicted sample of the target sample based on the interpolation filter and the reference sample; generating a reconstructed picture based on the predicted samples; determining the interpolation filter to be applied to the reference sample based on the intra prediction mode and the size of the current block, determining whether the intra-prediction mode of the current block is a directional intra-prediction mode; determining whether the size of the current block is smaller than a first specific value based on the intra prediction mode of the current block being the directional intra prediction mode; determining whether the prediction angle of the intra prediction mode is smaller than a second specific value based on the size of the current block being smaller than the first specific value; deriving the interpolation filter as a Gaussian filter based on the size of the current block not being smaller than the first particular value; deriving the interpolation filter as a cubic filter based on the size of the current block being smaller than the first specific value and the prediction angle of the intra prediction mode being smaller than the second specific value; the interpolation filter is derived as the Gaussian filter based on the size of the current block being smaller than the first particular value and the prediction angle of the intra prediction mode not being smaller than the second particular value.

2. A video encoding method performed by an encoding device, comprising: deriving an intra prediction mode of an upper neighboring block of a current block and an intra prediction mode of a left neighboring block of the current block; constructing a Most Probable Mode (MPM) list for the current block based on the intra prediction mode of the upper neighboring block and the intra prediction mode of the left neighboring block; deriving an MPM candidate selected from the MPM candidates in the MPM list as the intra prediction mode of the current block; deriving neighboring samples including a left neighboring sample and an upper neighboring sample of the current block; deriving a reference sample for predicting the target sample from the neighboring samples based on a position of the target sample of the current block and a prediction angle of the intra prediction mode; determining an interpolation filter to be applied to the reference samples based on the intra prediction mode and the size of the current block; deriving a predicted sample of the target sample based on the interpolation filter and the reference sample; encoding video information including prediction mode information indicating the selected MPM candidate; determining the interpolation filter to be applied to the reference sample based on the intra prediction mode and the size of the current block, determining whether the intra-prediction mode of the current block is a directional intra-prediction mode; determining whether the size of the current block is smaller than a first specific value based on the intra prediction mode of the current block being the directional intra prediction mode; determining whether the prediction angle of the intra prediction mode is smaller than a second specific value based on the size of the current block being smaller than the first specific value; deriving the interpolation filter as a Gaussian filter based on the size of the current block not being smaller than the first particular value; deriving the interpolation filter as a cubic filter based on the size of the current block being smaller than the first specific value and the prediction angle of the intra prediction mode being smaller than the second specific value; the interpolation filter is derived as the Gaussian filter based on the size of the current block being smaller than the first particular value and the prediction angle of the intra prediction mode not being smaller than the second particular value.

3. A method for transmitting data relating to video information, comprising: obtaining a bitstream of the video information including prediction mode information indicating a selected Most Probable Mode (MPM) candidate in an MPM list for a current block, the prediction mode information including: deriving an intra prediction mode of an upper neighboring block of a current block and an intra prediction mode of a left neighboring block of the current block; constructing the MPM list for the current block based on the intra prediction mode of the upper neighboring block and the intra prediction mode of the left neighboring block; deriving the selected MPM candidate from among the MPM candidates in the MPM list as the intra prediction mode of the current block; deriving neighboring samples including a left neighboring sample and an upper neighboring sample of the current block; deriving a reference sample for predicting the target sample from the neighboring samples based on a position of the target sample of the current block and a prediction angle of the intra prediction mode; determining an interpolation filter to be applied to the reference samples based on the intra prediction mode and the size of the current block; deriving a predicted sample of the target sample based on the interpolation filter and the reference sample; generating prediction mode information indicating the selected MPM candidate; transmitting the data including the bitstream of the video information including the prediction mode information; determining the interpolation filter to be applied to the reference sample based on the intra prediction mode and the size of the current block, determining whether the intra-prediction mode of the current block is a directional intra-prediction mode; determining whether the size of the current block is smaller than a first specific value based on the intra prediction mode of the current block being the directional intra prediction mode; determining whether the prediction angle of the intra prediction mode is smaller than a second specific value based on the size of the current block being smaller than the first specific value; deriving the interpolation filter as a Gaussian filter based on the size of the current block not being smaller than the first particular value; deriving the interpolation filter as a cubic filter based on the size of the current block being smaller than the first specific value and the prediction angle of the intra prediction mode being smaller than the second specific value; the interpolation filter is derived as the Gaussian filter based on the size of the current block being smaller than the first particular value and the prediction angle of the intra prediction mode not being smaller than the second particular value.

Citation Information

Patent Citations

  • Pixel adaptive intra smoothing

    US20120140821A1

  • Modification of transform coefficients for non-square transform units in video coding

    US20170150183A1

  • Intra prediction and intra mode coding

    WO2016205718A1

  • Method and apparatus of adaptive filtering of samples for video coding

    WO2017086823A1