Method and device for decoding picture by intra-prediction in picture coding system

By deriving intra prediction modes and selecting appropriate interpolation filters based on block size and angle, the method improves video coding efficiency and reduces data requirements for high-resolution video, addressing the increased costs associated with high-quality video transmission and storage.

JP2025107476AActive Publication Date: 2025-07-17LG ELECTRONICS INC
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The increasing demand for high-resolution and high-quality video data leads to higher transmission and storage costs due to increased bit rates, necessitating improved video coding efficiency and intra prediction methods for selecting and applying interpolation filters in video coding systems.

Method used

A method and apparatus for video decoding that involves deriving an intra prediction mode, determining adjacent samples, selecting an interpolation filter based on block size and prediction angle, and using it to predict target samples accurately, thereby reducing residual data and improving coding efficiency.

Benefits of technology

This approach enhances prediction accuracy and reduces the amount of data required for interpolation filter selection, leading to improved coding efficiency and reduced bit rates for high-resolution video data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025107476000001_ABST
    Figure 2025107476000001_ABST
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 by intra prediction in a video coding system.

Background Art

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

[0003] Accordingly, a highly efficient video compression technology is required to effectively transmit, store, and reproduce high-resolution and high-quality video information.

Summary of the Invention

Problems to be Solved by the Invention

[0004] A technical problem of the present invention is to provide a method and apparatus for increasing video coding efficiency.

[0005] Another technical problem 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 problem of the present invention is to provide a method and apparatus for performing intra prediction based on an interpolation filter for a selected target sample.

Means for Solving the Problems

[0007] According to an embodiment of the present invention, a method for decoding video executed by a decoding device is provided. The method includes: deriving an intra prediction mode of a current block; deriving adjacent samples including left adjacent samples and upper adjacent samples of the current block; deriving a reference sample for predicting a target sample among the adjacent 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 for the target sample; and deriving a predicted sample of the target sample based on the interpolation filter and the reference sample.

[0008] According to another embodiment of the present invention, a decoding device for executing video decoding is provided. The decoding device includes an entropy decoding unit that acquires prediction information for a current block, and a prediction unit that derives an intra prediction mode of the current block, derives adjacent samples including left adjacent samples and upper adjacent samples of the current block, derives a reference sample for predicting a target sample among the adjacent samples based on a position of the target sample of the current block and a prediction angle of the intra prediction mode, determines an interpolation filter for the target sample, and derives a predicted sample of the target 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 executed by an encoding device. The method includes: determining an intra prediction mode for a current block; deriving adjacent samples including left adjacent samples and upper adjacent samples of the current block; deriving a reference sample for predicting a target sample among the adjacent 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 for the target sample; deriving a predicted sample of the target sample based on the interpolation filter and the reference sample; 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 device. The encoding device includes: a prediction unit configured to determine an intra prediction mode for a current block, derive adjacent samples including left adjacent samples and upper adjacent samples of the current block, derive a reference sample for predicting a target sample among the adjacent samples based on a position of the target sample of the current block and a prediction angle of the intra prediction mode, determine an interpolation filter for the target sample, and derive a predicted sample of the target sample based on the interpolation filter and the reference sample; and an entropy encoding unit configured to generate, encode, and output prediction information for the current block.

Effects of the Invention

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

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

Brief Description of Drawings

[0013]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

BEST MODE FOR CARRYING OUT THE INVENTION

[0014] The present invention can be subject to various modifications and can have various embodiments. Specific embodiments will be illustrated in the drawings and described in detail below. 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 idea of the present invention. Singular expressions include plural expressions unless they are clearly used with a different meaning in the context. Terms such as "including" or "having" in this specification are intended to specify the existence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and it should be understood that they do not preclude the existence or addition possibility of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0015] On the other hand, each configuration on the drawings described in the present invention is independently illustrated for the convenience of explaining different characteristic functions in a video encoding device / decoding device, and it does not mean that each configuration is implemented by different hardware or different software. For example, among each configuration, two or more configurations can be combined to form one configuration, and one configuration can be divided into multiple configurations. Embodiments in which each configuration is integrated and / or separated are included in the scope of the present invention as long as they do not depart 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. Hereinafter, the same reference numerals will be used for the same components on the drawings, and duplicate descriptions of the same components will be omitted.

[0017] In this specification, a "picture" generally means a unit indicating one video in a specific time period, and a "slice" is a unit constituting a part of a picture in coding. One picture can be composed of a plurality of slices, and if necessary, pictures and slices can be used in a mixed manner.

[0018] A pixel or pel means the smallest unit that constitutes a picture (or video). Also, the term 'Sample' can be used to indicate the value of a specific pixel. A sample can generally indicate the value of a pixel, or only the pixel value of the luma component, or only the pixel value of the chroma component.

[0019] A unit indicates the basic unit of video processing. A unit can include at least one of a specific region of a picture and information related to the corresponding region. In some cases, the term unit can be used interchangeably with terms such as block or area. In general, an M×N block can indicate a set of samples or transform coefficients consisting of M columns and N rows.

[0020] FIG. 1 is a drawing for explaining the outline of the configuration of a video encoding apparatus to which the present invention can be applied.

[0021] Referring to FIG. 1, the video encoding apparatus 100 can include a picture division unit 105, a prediction unit 110, a residual processing unit 120, an entropy encoding unit 130, an addition unit 140, a filter unit 150, and a memory 160. The residual processing unit 120 can include a subtraction unit 121, a conversion unit 122, a quantization unit 123, a reordering unit 124, an inverse quantization unit 125, and an inverse conversion unit 126.

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

[0023] As an example, the processing unit is called a coding unit (CU). In this case, the coding unit can be recursively divided from the largest coding unit (LCU) by a Quad-tree binary-tree (QTBT) structure. For example, one coding unit can be divided into a plurality of coding units at a deeper depth based on a quad-tree structure and / or a binary-tree structure. In this case, for example, the quad-tree structure can be applied first, and then the binary-tree structure can be applied. Or the binary-tree structure can also be applied first. The coding procedure according to the present invention can be executed based on the final coding unit that is no longer divided. In this case, based on the coding efficiency according to the video characteristics, etc., the largest coding unit can be used as the final coding unit, or if necessary, the coding unit can be recursively divided into coding units at a deeper depth so that the coding unit of the optimal size can be used as the final coding unit. Here, the coding procedure can include procedures such as prediction, transformation, and restoration described later.

[0024] As another example, the processing unit may also include a coding unit (CU), a prediction unit (PU), or a transform unit (TU). The coding unit can be split into coding units with a deeper depth from the largest coding unit (LCU) by a quad-tree structure. In this case, based on coding efficiency according to video characteristics, etc., the largest coding unit can be used as the final coding unit, or if necessary, the coding unit can be recursively split into coding units with an even deeper depth so that the coding unit of the optimal size can be used as the final coding unit. When the 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 means a coding unit that serves as a basis for partitioning or splitting into a prediction unit or a transform unit. The prediction unit is a unit partitioned from the coding unit and is a unit for sample prediction. At this time, the prediction unit can also be divided into sub-blocks. The transform unit can be split from the coding unit by a quad-tree structure and is a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients. Hereinafter, the coding unit is called a coding block (CB), the prediction unit is called a prediction block (PB), and the transform unit is called a transform block (TB). The prediction block or the prediction unit means a specific area in the form of a block within the picture and can include an array of prediction samples.In addition, a transform block or a transform unit means a specific area in block form within a picture and can include an array of transform coefficients or residual samples.

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

[0026] The prediction unit 110 can determine whether intra prediction or inter prediction is applied to the current block. As an example, the prediction unit 110 can determine whether intra prediction or inter prediction is applied to a CU unit.

[0027] In the case of intra prediction, the prediction unit 110 can derive prediction samples for the current block based on reference samples outside the current block within the picture to which the current block belongs (hereinafter referred to as the current picture). At this time, the prediction unit 110 can (i) derive prediction samples based on the average or interpolation of neighboring reference samples of the current block, and (ii) also derive the prediction samples based on reference samples existing in a specific (prediction) direction with respect to the prediction samples among the neighboring reference samples of the current block. The case of (i) is called a non - directional mode or a non - angular mode, and the case of (ii) is called a directional mode or an angular mode. The prediction modes in intra prediction can have, for example, 33 directional prediction modes and at least 2 or more non - directional modes. The non - directional modes can include a DC prediction mode and a Planar mode. The prediction unit 110 can also use the prediction mode applied to neighboring blocks to determine the prediction mode to be applied to the current block.

[0028] In the case of inter prediction, the prediction unit 110 can derive a prediction sample for the current block based on samples specified by motion vectors on the reference picture. The prediction unit 110 can apply any one of the skip mode, merge mode, and MVP (motion vector prediction) mode to derive a prediction sample for the current block. In the case of the skip mode and merge mode, the prediction unit 110 can use the motion information of adjacent blocks as the motion information of the current block. In the case of the skip mode, unlike the merge mode, the difference (residual) between the prediction sample and the original sample is not transmitted. In the case of the MVP mode, the motion vector of the adjacent block can be used as a motion vector predictor to derive the motion vector of the current block.

[0029] In the case of inter prediction, the adjacent blocks can include spatial neighboring blocks existing within the current picture and temporal neighboring blocks existing in the reference picture. The reference picture including the temporal neighboring blocks is also called a collocated picture (colPic). The 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 bit stream.

[0030] When motion information of temporally adjacent blocks is used in skip mode and merge mode, the top picture on the reference picture list can also be used as a reference picture. The reference pictures included in the reference picture list (Picture Order Count) 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 subtraction unit 121 generates a residual sample, which is the difference between the original sample and the predicted sample. When the skip mode is applied, the residual sample is not generated as described above.

[0032] The conversion unit 122 converts the residual samples in units of conversion blocks to generate transform coefficients. The conversion unit 122 can perform the conversion according to the size of the corresponding conversion block and the prediction mode applied to the coding block or prediction block that spatially overlaps with the corresponding conversion block. For example, when intra prediction is applied to the coding block or the prediction block that overlaps with the conversion block, and the conversion block is a 4×4 residual array, the residual samples are converted using the DST (Discrete Sine Transform) conversion kernel, and in other cases, the residual samples can be converted using the DCT (Discrete Cosine Transform) conversion kernel.

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

[0034] The reordering unit 124 reorders the quantized transform coefficients. The reordering unit 124 can reorder the quantized transform coefficients in block form into a one-dimensional vector form through a coefficient scanning method. Here, although the reordering unit 124 has been described with a separate configuration, it may also be a part of the quantization unit 123.

[0035] The entropy encoding unit 130 can perform entropy encoding on the quantized transform coefficients. Entropy encoding can 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 can also encode, together or separately, information necessary for video restoration (such as the values of syntax elements, etc.) in addition to the quantized transform coefficients. The entropy-encoded information can be transmitted or stored in the form of a bitstream in units of NAL (network abstraction layer) units.

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

[0037] The addition unit 140 combines the residual samples and the prediction samples to restore the picture. The residual samples and the prediction samples can be added in block units to generate a restored block. Here, although the addition unit 140 has been described with a separate configuration, it may also be a part of the prediction unit 110. On the other hand, the addition unit 140 is also called a restoration unit or a restored block generation unit.

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

[0039] The memory 160 can store the reconstructed picture (decoded picture) or information necessary for encoding / decoding. Here, the reconstructed picture is the one on which the filtering procedure by the filter unit 150 has been completed. The stored reconstructed picture can be utilized as a reference picture for (inter) prediction of other pictures. For example, the memory 160 can store the (reference) picture used for inter prediction. At this time, the picture used for inter prediction can be specified by a reference picture set or a reference picture list.

[0040] FIG. 2 shows another example explaining the outline of a video encoding apparatus to which the present invention can be applied.

[0041] Referring to FIG. 2, the video encoding device may include an intra prediction unit, a reference smoothing unit 200, a prediction unit 210, a post-filter unit 220, a conversion 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 can perform a smoothing process on the left adjacent sample and the upper adjacent sample used for intra prediction of the current block in the picture to which the current block belongs (hereinafter, the current picture) based on the size of the current block, intra prediction mode information, and sample values. Thereby, visual artifacts for the predicted samples of the current block that may be generated by the difference in the sample values of each of the left adjacent sample and the upper adjacent sample can be prevented.

[0043] The prediction unit 210 can derive predicted samples based on (i) the average or interpolation of the left adjacent sample and the upper adjacent sample of the current block, or (ii) the adjacent samples existing in a specific (prediction) direction with respect to the predicted samples among the left adjacent sample and the upper adjacent sample. The case of (i) is called a non-directional mode or a non-angular mode, and the case of (ii) is called a directional mode or an angular mode. The prediction mode in intra prediction can have, for example, 33 directional prediction modes and at least two or more non-directional modes. The non-directional modes can include a DC prediction mode and a planar mode. The prediction unit 210 can also use the prediction mode applied to the adjacent block to determine the prediction mode to be applied to the current block.

[0044] Selectively according to the prediction mode from which the prediction sample of the current block is derived, the post-filter unit 220 can perform post-processing filtering to mitigate the discontinuity between the current block and adjacent samples. After that, the encoding device can derive the difference between the prediction sample and the original sample as a residual sample, and the conversion unit 230 can convert the residual sample in block units to generate transform coefficients. Also, the quantization unit 240 can quantize the transform coefficients to generate quantized transform coefficients.

[0045] Figure 3 illustrates the process in which intra prediction is performed by the encoding device. The encoding device can perform intra prediction to generate a prediction sample for the current block (S300). The prediction sample is also referred to as a prediction signal or an intra prediction signal. Specifically, the encoding device can perform a smoothing process on the left and upper adjacent samples used for the intra prediction of the current block based on the size, mode information, and sample values of the current block (S310). After that, the encoding device can perform prediction according to the intra prediction mode as described above to generate the prediction sample (S320), and can perform post-processing filtering to mitigate the discontinuity between the current block and adjacent samples (S330). The encoding device can generate a residual sample, which is the difference between the prediction sample and the original sample (S340), and can convert the residual sample in block units to generate transform coefficients. Also, the encoding device can quantize the transform coefficients to generate quantized transform coefficients (S360), and can perform entropy encoding on the quantized transform coefficients for signaling (S370).

[0046] FIG. 4 is a drawing for explaining an outline of a configuration of a video decoding apparatus to which the present invention can be applied.

[0047] Referring to FIG. 4, the video decoding apparatus 400 can 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 can include a reordering unit 421, an inverse quantization unit 422, and an inverse transform unit 423.

[0048] When a bitstream including video information is input, the video decoding apparatus 400 can restore the video corresponding to the process in which the video information is processed by the video encoding apparatus.

[0049] For example, the video decoding apparatus 400 can execute video decoding using the processing units applied in the video encoding apparatus. Therefore, the processing unit block for video decoding is, as an example, a coding unit, and as another example, a coding unit, a prediction unit, or a transform unit. The coding unit can be divided from the maximum coding unit by a quad tree structure and / or a binary tree structure.

[0050] The prediction unit and the transform unit can be further used as the case may be. In this case, the prediction block is a block derived from or partitioned from the coding unit and is a unit for sample prediction. At this time, the prediction unit can also be divided into sub-blocks. The transform unit can be divided from the coding unit by a quad tree structure and is a unit for deriving transform coefficients or a unit for deriving a residual signal from the transform coefficients.

[0051] The entropy decoding unit 410 can parse the bitstream and output information necessary for video restoration or picture restoration. For example, the entropy decoding unit 410 can decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the value of the syntax element necessary for video restoration and the quantized value of the transform coefficient for the residual.

[0052] More specifically, the CABAC entropy decoding method receives the BIN corresponding to each syntax element in the bitstream, determines the context model using the information of the syntax element to be decoded adjacent to the decoding target syntax element information and the decoding information of the decoding target block or the symbol / BIN information decoded in the previous step, predicts the occurrence probability of the BIN based on the determined context model, and executes arithmetic decoding of the BIN to generate a symbol corresponding to the value of each syntax element. At this time, the CABAC entropy decoding method can update the context model using the symbol / BIN information decoded 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, the information related to prediction is provided to the prediction unit 430, and the value of the residual for which entropy decoding is performed by the entropy decoding unit 410, that is, the quantized transform coefficient, can be input to the reordering unit 421.

[0054] The reordering unit 421 can reorder the quantized transform coefficients in a two-dimensional block form. The reordering unit 421 can perform reordering corresponding to the coefficient scanning executed by the encoding device. Here, although the reordering unit 421 has been described with a separate configuration, it may be a part of the inverse quantization unit 422.

[0055] The inverse quantization unit 422 can inverse-quantize the quantized transform coefficients based on the (inverse) quantization parameters and output the transform coefficients. At this time, the information for deriving the quantization parameters can be signaled from the encoding device.

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

[0057] The prediction unit 430 can perform a prediction on the current block and generate a prediction block including prediction samples for the current block. The unit of prediction executed by the prediction unit 430 is a coding block, or a transform block, or a prediction block.

[0058] The prediction unit 430 can determine whether to apply intra prediction or inter prediction. At this time, the unit for determining whether to apply either intra prediction or inter prediction is different from the unit for generating prediction samples. Additionally, in inter prediction and intra prediction, the units for generating prediction samples are also different. For example, whether to apply either inter prediction or intra prediction can be determined in the CU unit. Also, for example, in inter prediction, the prediction mode can be determined in the PU unit to generate prediction samples, and in intra prediction, the prediction mode can be determined in the PU unit and prediction samples can be generated in the TU unit.

[0059] In the case of intra prediction, the prediction unit 430 can derive prediction samples for the current block based on adjacent reference samples within the current picture. The prediction unit 430 can apply a directional mode or a non-directional mode based on the adjacent reference samples of the current block to derive prediction samples for the current block. At this time, the prediction mode to be applied to the current block can also be determined using the intra prediction mode of the adjacent block.

[0060] In the case of inter prediction, the prediction unit 430 can derive a prediction sample for the current block based on samples specified on the reference picture by motion vectors on the reference picture. The prediction unit 430 can derive a prediction sample for the current block by applying any one of a skip mode, a merge mode, and an MVP mode. At this time, motion information required for inter prediction of the current block provided by the video encoding device, for example, information regarding a motion vector, a reference picture index, etc., can be obtained or derived based on the information regarding the prediction.

[0061] In the case of the skip mode and the merge mode, the motion information of adjacent blocks can be used as the motion information of the current block. At this time, the adjacent blocks can include spatially adjacent blocks and temporally adjacent blocks.

[0062] The prediction unit 430 can configure a merge candidate list with the motion information of available adjacent blocks, and use the information indicated by the merge index on the merge candidate list as the motion vector of the current block. The merge index can be signaled from the encoding device. The motion information can include a motion vector and a reference picture.

[0063] In the case of the skip mode, different from the merge mode, the difference (residual) between the prediction sample and the original sample is not transmitted.

[0064] In the case of the MVP mode, the motion vector of the current block can be derived by using the motion vectors of adjacent blocks as motion vector predictors. At this time, the adjacent blocks can include spatially adjacent blocks and temporally adjacent blocks.

[0065] As an example, when the merge mode is applied, a merge candidate list can be generated by using the motion vectors of the restored spatially adjacent blocks and / or the motion vectors corresponding to the Col blocks which are temporally adjacent blocks. In the merge mode, the motion vector of the candidate block selected from the merge candidate list is used as the motion vector of the current block. The information related to the prediction can include a merge index indicating a candidate block having an optimal motion vector selected from among the candidate blocks included in the merge candidate list. At this time, the prediction unit 430 can derive the motion vector of the current block by using the merge index.

[0066] As another example, when the MVP (Motion Vector Prediction) mode is applied, a motion vector prediction candidate list can be generated by using the motion vectors of restored spatially adjacent blocks and / or the motion vectors corresponding to Col blocks which are temporally adjacent blocks. That is, the motion vectors of restored spatially adjacent blocks and / or the motion vectors corresponding to Col blocks which are temporally adjacent blocks can be used as motion vector candidates. The information related to the prediction can include a predicted motion vector index indicating an optimal motion vector selected from among the motion vector candidates included in the list. At this time, the prediction unit 430 can use the motion vector index to select a predicted motion vector of the current block from among the motion vector candidates included in the motion vector candidate list. The prediction unit of the encoding device can obtain a motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor, and encode this and output it in the form of a bitstream. That is, the MVD is obtained as the value obtained by subtracting the motion vector predictor from the motion vector of the current block. At this time, the prediction unit 430 can obtain the motion vector difference included in the information related to the prediction, and derive the motion vector of the current block through the addition of the motion vector difference and the motion vector predictor. Also, the prediction unit can obtain or derive a reference picture index indicating a reference picture, etc. from the information related to the prediction.

[0067] The addition unit 440 can add the residual sample and the prediction sample to restore the current block or the current picture. The addition unit 440 can also add the residual sample and the prediction sample in block units to restore the current picture. When the skip mode is applied, since no residual is transmitted, the prediction sample can become the restored sample. Here, the addition unit 440 has been described with a separate configuration, but it may also be a part of the prediction unit 430. On the other hand, the addition unit 440 is also called a restoration unit or a restored block generation unit.

[0068] The filter unit 450 can apply a sample adaptive offset of deblocking filtering, and / or an ALF, etc. to the restored picture. At this time, the sample adaptive offset can be applied in units of samples, and can also be applied after deblocking filtering. The ALF can also be applied after deblocking filtering and / or sample adaptive offset.

[0069] The memory 460 can store the restored picture (decoded picture) or information necessary for decoding. Here, the restored picture is the restored picture for which the filtering procedure has been completed by the filter unit 450. For example, the memory 460 can store the picture used for inter prediction. At this time, the picture used for inter prediction can also be specified by a reference picture set or a reference picture list. The restored picture can be used as a reference picture for other pictures. Also, the memory 460 can output the restored pictures in the output order.

[0070] FIG. 5 shows another example for explaining the outline of a video decoding apparatus to which the present invention can be applied.

[0071] Referring to FIG. 5, the video encoding apparatus can 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 can include the reference smoothing unit 500, the prediction unit 510, and the post-filter unit 520. The intra prediction unit can derive prediction samples for the current block by applying a directional mode or a non-directional mode based on adjacent reference samples of the current block. At this time, the prediction mode to be applied to the current block can also be determined using the intra prediction mode of adjacent blocks.

[0072] Specifically, when intra prediction is applied to the current block, the reference smoothing unit 500 can perform a smoothing process on the left adjacent sample and the upper adjacent sample used for the intra prediction of the current block within the 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, visual artifacts for the predicted samples of the current block that may be generated due to the difference in the sample values of each of the left adjacent sample and the upper adjacent sample can be prevented.

[0073] The prediction unit 510 can derive a predicted sample based on (i) the average or interpolation of the left adjacent sample and the upper adjacent sample of the current block, or (ii) the adjacent samples existing in a specific (prediction) direction with respect to the predicted sample among the left adjacent sample and the upper adjacent sample. In the case of (i), it is called a non-directional mode or a non-angle mode, and in the case of (ii), it is called a directional mode or an angular mode. The prediction mode in intra prediction can have, for example, 33 directional prediction modes and at least two or more non-directional modes. The non-directional modes can include a DC prediction mode and a Planar mode. The prediction unit 510 can also use the prediction mode applied to the adjacent block to determine the prediction mode to be applied to the current block.

[0074] Selectively according to the prediction mode in which the prediction sample of the current block is derived, the post-filtering unit 520 can perform post-processing filtering to mitigate the discontinuity between the current block and the adjacent samples. Thereafter, the inverse quantization unit 530 can inverse-quantize the quantized transform coefficients received from the encoding device, and the inverse transform unit 540 can inverse-transform the inverse-quantized transform coefficients to generate residual samples in block units. The decoding device can restore the current block encoded based on intra prediction based on the residual samples and the prediction samples.

[0075] FIG. 6 illustrates the process in which intra prediction is performed in the decoding device. The decoding device can entropy-decode the entropy-encoded information received via the bitstream to obtain the quantized transform coefficients (S600). Thereafter, the decoding device can inverse-quantize the quantized transform coefficients to obtain the transform coefficients (S610), and can inverse-transform the transform coefficients to generate residual samples in block units (S620). Thereafter, the decoding device can perform intra prediction to generate prediction samples of the current block (S630). The prediction samples are also referred to as prediction signals or intra prediction signals. Specifically, the decoding device can perform a smoothing process on the left adjacent samples and the upper adjacent samples used for the intra prediction of the current block based on the size, prediction mode, and sample values of the current block (S640). Thereafter, the decoding device can perform prediction according to the intra prediction mode as described above to generate the prediction samples (S650), and can perform post-processing filtering to mitigate the discontinuity between the current block and the adjacent samples (S660). The decoding device can add the prediction samples and the residual samples to generate restored samples of the current block (S670).

[0076] When prediction is currently being performed on a block as described above, the prediction can be performed based on an intra prediction mode. For example, the intra prediction can be performed based on adjacent samples on which encoding / decoding has already been performed at the time of decoding the current block. That is, the predicted samples of the current block can be restored using the left adjacent sample and the upper adjacent sample of the current block that have already been restored. The left adjacent sample and the upper adjacent sample can be shown as in FIG. 7 below.

[0077] FIG. 7 illustrates the left adjacent sample and the upper adjacent sample used for intra prediction of the current block. When intra prediction is performed on the current block, an intra prediction mode for the current block can be derived, and prediction samples for the current block can be generated using at least one of the left adjacent sample and the upper adjacent sample according to the intra prediction mode. The left adjacent sample and the upper adjacent sample used for intra prediction of the current block can be smoothed based on the size, prediction mode, and sample values of the current block. That is, filtering can be performed to reduce the difference in the sample values of each of the left adjacent sample and the upper adjacent sample based on the size, prediction mode, and sample values of the current block. Thereby, visual artifacts for the predicted samples of the current block that may be generated due to the difference in the sample values of each of the left adjacent sample and the upper adjacent sample can be prevented.

[0078] Here, the intra prediction mode can include two non-directional intra prediction modes and 33 directional intra prediction modes. The non-directional intra prediction modes can include the planar intra prediction mode and the DC intra prediction mode, and the directional intra prediction modes can include the 2nd to 34th intra prediction modes. The planar intra prediction mode is called the planar mode, and the DC intra prediction mode is called the DC mode. Also, the 10th intra prediction mode indicates the horizontal intra prediction mode or the horizontal mode, and the 26th intra prediction mode indicates the vertical intra prediction mode or the vertical mode. Based on this, the prediction direction of the angular intra mode can be expressed in terms of an angle. That is, the relative angle corresponding to each intra prediction mode can be expressed with reference to the horizontal reference angle of 0° corresponding to the 10th intra prediction mode, and the relative angle corresponding to each intra prediction mode can be expressed with reference to the vertical reference angle of 0° corresponding to the 26th intra prediction mode.

[0079] Also, the demand for high-quality videos is increasing. To improve the efficiency of the video codec due to this, the number of directional intra prediction directions can be increased to 65. That is, the intra prediction mode can include two non-directional intra prediction modes and 65 directional intra prediction modes. The non-directional intra prediction modes can include the planar intra prediction mode and the DC intra prediction mode, and the directional intra prediction modes can include the 2nd to 66th intra prediction modes.

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

[0081] Referring to FIG. 8, it is possible to distinguish an intra prediction mode having horizontal directionality centered on the 34th intra prediction mode having a diagonal prediction direction in the upper left, and an intra prediction mode having vertical directionality. H and V in FIG. 8 respectively mean horizontal directionality and vertical directionality, and the numbers from -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 intra prediction mode and the 50th intra prediction mode respectively indicate a horizontal intra prediction mode and a vertical intra prediction mode, and based on this, the prediction direction of the angular intra prediction mode can be expressed in terms of an angle. That is, the relative angle corresponding to each intra prediction mode can be expressed based on the horizontal reference angle of 0° corresponding to the 18th intra prediction mode, and the relative angle corresponding to each intra prediction mode can be expressed based on the vertical reference angle of 0° corresponding to the 50th intra prediction mode.

[0082] When the directional intra prediction mode is applied to the current block, the predicted sample of the target sample can be derived based on a reference sample located in the prediction direction of the directional intra prediction mode with respect to the target sample for which intra prediction is to be performed within the current block. That is, the reference sample located in the prediction direction can be copied and derived as the predicted sample. Here, the reference sample can indicate an adjacent sample located in the prediction direction of the directional intra prediction mode with respect to the target sample among the upper adjacent sample and the left adjacent sample of the current block. On the other hand, when there is no reference sample at integer sample units in the prediction direction of the directional intra prediction mode with respect to the target sample, that is, when the position of the reference sample located in the prediction direction of the directional intra prediction mode with respect to the target sample is the position of a fractional sample, the sample value of the reference sample can be derived through interpolation between the integer samples adjacent to the left and right of the reference sample, and the predicted sample of the target sample can be derived based on the reference sample. For example, the interpolation between the integer samples can be performed based on the ratio of the distances between the reference sample and the integer samples.

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

[0084] Referring to FIG. 9, the position of the fractional sample of the reference sample located in the prediction direction of the directional intra prediction mode with respect to the target sample can 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 can be defined by being scaled to integer units in advance in order to make the operation execution easier. The scaled value of tanθ for each directional intra prediction mode can be derived as follows in the table below.

[0085] [Table 1]

[0086] Here, predModeIntra can indicate each of the directional intra prediction modes, intraPredAngle can indicate the prediction angle of each of the directional intra prediction modes, or can indicate an approximate value of the scaled tanθ of each of the directional intra prediction modes. An approximate value of tanθ according to the intra prediction mode defined in advance based on Table 1 can be derived. On the other hand, the value of tan -1 θ for each scaled directional intra prediction mode can be derived as follows in the table below.

[0087] [Table 2]

[0088] Here, predModeIntra can indicate each of the directional intra prediction modes, intraPredAngle can indicate the inverse prediction angle of each of the directional intra prediction modes, or can indicate an approximate value of the scaled tan -1 θ of each of the directional intra prediction modes. An approximate value of tan -1 θ according to the intra prediction mode defined in advance based on the said Table 2 can be derived.

[0089] On the other hand, a non-directional intra prediction mode can also be applied to the current block. The non-directional intra prediction mode can include a planar intra prediction mode and a DC intra prediction mode. The planar intra prediction mode is called the planar mode, and the DC intra prediction mode is called the DC mode. The predicted sample of the current block can be derived based on the average value of the adjacent samples of the current block in the DC mode. The intra prediction executed based on the DC mode can be efficiently executed when the values of the samples of the current block are similar. On the contrary, when the intra prediction is executed based on the DC mode when the values of the samples of the current block are diverse, discontinuity can occur between the predicted block of the current block and the adjacent samples. Similarly, unintended visible contouring can also occur when the intra prediction is executed based on the directional intra prediction mode. The planar mode was devised to complement such problems. The planar mode indicates a prediction mode in which horizontal linear prediction and vertical linear prediction are executed based on reference samples for the target samples, and then the derived values are averaged to generate a predicted sample of the target samples.

[0090] On the one hand, when prediction is performed based on the directional intra prediction mode for the current block, if there is no reference sample at the integer sample unit in the prediction direction of the directional intra prediction mode of the current block with respect to the target sample of the current block as described above, that is, if the position of the reference sample located in the prediction direction of the directional intra prediction mode with respect to the target sample is at the position of a fractional sample, the sample value of the reference sample can be derived through interpolation between the left and right integer samples of the reference sample, and the predicted sample of the target sample can be derived based on the derived reference sample. The integer sample can indicate an adjacent sample at the position of an integer sample adjacent to the position of the reference sample.

[0091] In this case, the interpolation between the left and right integer samples 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 with a low-pass filter effect, or the interpolation can also be performed based on a sophisticated interpolation filter. The interpolation filter with a low-pass filter effect can indicate a linear filter or a Gaussian filter, etc., and the sophisticated interpolation filter can indicate 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 indicate a filter in which interpolation for four integer samples is performed based on four weighting values. The interpolation between the integer samples performed based on the interpolation filter can be shown as in the following mathematical formula.

[0092]

Equation

[0093] Here, p[x][y] can indicate the predicted sample of the target sample, f[0], f[1], f[2], and f[3] can indicate the filter coefficients of the interpolation filter, ref[n] can indicate the nth adjacent sample, and iIdx can indicate the integer index of the position of the fractional sample located in the prediction direction of the intra prediction mode of the current block with respect to the target sample. The integer index of the position of the fractional sample can indicate the integer value excluding the remainder of the position of the fractional sample.

[0094] On the other hand, the filter coefficients of one cubic filter among the low-pass filters and the filter coefficients of one Gaussian filter among the interpolation filters having a low-pass filter effect can be derived as shown in the following table.

[0095]

Table 3

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

[0097] On the one hand, when prediction for the current block is performed based on the directional intra prediction mode as described above, the distance between the target sample and the reference sample of the current block increases according to the prediction angle of the directional intra prediction mode, and the accuracy of the prediction can decrease as the distance increases. A method can be proposed to improve the prediction accuracy by selecting an appropriate interpolation filter according to the distance between the target sample and the reference sample and performing prediction based on the reference sample derived by applying the selected interpolation filter. The appropriate interpolation filter according to the distance between the target sample and the reference sample and the method of selecting the appropriate interpolation filter are as described below.

[0098] As an example, the interpolation filter can 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 and the reference sample of the current block can be derived according to the inclination 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 adjacent sample and the upper adjacent sample of the current block, the distance between the target sample and the reference sample increases as the position of the target sample goes to the lower right corner of the current block. Also, as the value of intraPredAngle of the directional intra prediction mode defined in Table 1 increases, the inclination of the prediction angle approaches 45 degrees. As the inclination of the prediction angle approaches 45 degrees, the distance between the target sample and the reference sample increases, and thus, as the value of intraPredAngle increases, the distance between the target sample and the reference sample increases.

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

[0100] As described above, when the value of the intraPredAngle is greater than 0 and less than 32, as shown in FIG. 9, the prediction of the target sample can be performed based on the reference samples at the positions of the fractional samples. In this case, only the integer sample values adjacent to the positions of the fractional samples exist, and the coding device can predict the reference samples at the positions of the fractional samples based on an interpolation filter, and can copy the values of the predicted reference samples at the positions of the fractional samples as the sample values of the predicted samples of the target sample. Therefore, the accuracy of the predicted block of the current block can be affected by the accuracy of the interpolation filter.

[0101] Also, 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 samples and the upper adjacent samples of the current block that have already been restored at the time of the decoding process of the current block. As the distance between the target sample and the reference sample of the current block increases, the correlation degree between the target sample and the reference sample derived based on the left adjacent sample and the upper adjacent sample can be rapidly decreased.

[0102] Therefore, when the distance between the target sample and the reference sample is far, a method of deriving the reference sample based on an interpolation filter with a low-pass filter effect so that artifacts or noise of the reference sample are not propagated can improve the prediction accuracy and coding efficiency. On the contrary, when the distance between the target sample and the reference sample is close, since the correlation degree between the target sample and the reference sample is high, 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 maximally maintained is advantageous for improving the prediction performance. That is, when the distance between the target sample and the reference sample is close, a method of deriving the reference sample based on a sophisticated interpolation filter can improve the prediction accuracy and coding efficiency.

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

[0104] Specifically, for example, when the size of the current block is 4×4 and intra prediction is performed on the current block, the 4×4 current block has a very high correlation with adjacent samples of the current block. Therefore, reference samples can be derived based on a sophisticated interpolation filter regardless of the intra prediction mode. Or, when the value of intraPredAngle derived from the intra prediction mode of the current block is 11 or more regardless of the size of the current block, the distance between the target sample and the reference sample is increased. Therefore, the reference sample can be derived based on an interpolation filter having a low-pass filter effect. Or, when 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, the reference sample of the target sample can be derived based on a sophisticated interpolation filter, and in other cases, the reference sample of the target sample can be derived based on an interpolation filter having a low-pass filter effect.

[0105] Also, when the MPM (most probable mode) 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 the adjacent block of the current block, when the intra prediction mode of the current block is a directional intra prediction mode other than the Planar mode or the DC mode, the interpolation filter used for the adjacent block selected via the MPM mode can also be derived as the interpolation filter of the current block. Here, when the MPM mode is applied to the current block, the coding device can determine an MPM list based on the intra prediction mode for the left or upper adjacent block of the current block, and determine the intra prediction mode based on the MPM list.

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

[0107] On the other hand, when the current block is a square block, since the width and height of the block are the same, that is, since the size of the current block is N×N, the block size used as a criterion for selecting an interpolation filter can be N for any directional intra prediction mode. On the other hand, when the shape of the current block is non-square, that is, when the size of the current block is M×N, the mode selected as the prediction mode of the current block is a directional intra prediction mode, and when the mode is a vertical directional prediction mode, the block size used as a criterion for selecting an interpolation filter can be represented by M. Here, the vertical directional prediction mode can indicate the 34th to 66th intra prediction modes when the intra prediction mode includes 65 directional intra prediction modes and 2 non-directional intra prediction modes. Similarly, when the size of the current block is M×N, 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 criterion for selecting an interpolation filter can be represented by N. Here, the horizontal directional prediction mode can indicate the 2nd to 33rd intra prediction modes when the intra prediction mode includes 65 directional intra prediction modes and 2 non-directional intra prediction modes.

[0108] Alternatively, if the current block is a non-square block of size M×N and the prediction mode of the current block is a vertical directional prediction mode, the interpolation filter for the current block can be selected based on N. Similarly, if the current block is a non-square block of size M×N and the prediction mode of the current block is a horizontal directional prediction mode, the interpolation filter for the current block can also be selected based on M. However, in the specific examples described hereinafter, when a vertical directional prediction mode is applied to the current block having a size of M×N, the size of the current block serving as a reference for selecting the interpolation filter can 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 serving as a reference for selecting the interpolation filter can be represented by N. Specifically, for example, when the value of the size of the block is less than or equal to 8, a refined interpolation filter can be selected, and the reference samples of the block can be derived based on the refined interpolation filter. In this case, if the value of the size of the current block is 8×4 and the intra prediction mode of the current block is one of the intra prediction modes having a vertical direction, the refined interpolation filter can be selected as the interpolation filter for the current block, and the reference samples of the current block can be derived based on the refined interpolation filter.

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

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

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

[0112] When the intra prediction mode is a directional intra prediction mode, the encoding device / decoding device can 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 size M×N, and the mode selected as the intra prediction mode of the current block has a vertical direction, that is, when the intra prediction mode includes 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 intra prediction modes from 34th to 66th, the criterion for selecting the interpolation filter can be the width of the current block, that is, represented by M. Similarly, when the current block is a non-square block of size M×N, and the mode selected as the intra prediction mode of the current block has a horizontal direction, that is, when the intra prediction mode includes 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 intra prediction modes from 2nd to 33rd, the criterion for selecting the interpolation filter can be the height of the current block, that is, represented by N. Or, 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 can be represented by N. The first threshold can be set to 4, 8, 16, 32, etc.

[0113] If the size of the current block is not smaller than a first threshold, that is, if the size of the current block is greater than or equal to the first threshold, the encoding device / decoding device can select a Gaussian filter as the interpolation filter for the current block, and can derive a reference sample of 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, and a reference sample of the target sample can 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 device / decoding device can select the interpolation filter of the current block as a linear filter, and can derive a reference sample of the target sample in the current block based on the linear filter. Here, the reference sample can indicate an adjacent sample located in the prediction direction of the directional intra prediction mode of the current block with respect to the target sample.

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

[0115] When the intraPredAngle of the directional intra prediction mode of the current block is not less than the second threshold, the encoding device / decoding device can select a Gaussian filter as the interpolation filter for the current block, and can derive a reference sample of 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 a reference sample of the target sample can also be derived based on an interpolation filter having a low-pass filter effect other than the Gaussian filter.

[0116] When the intraPredAngle of the directional intra prediction mode of the current block is less than the second threshold, the encoding device / decoding device can select a cubic filter as the interpolation filter for the current block, and can derive a reference sample of a target 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 a reference sample of the target sample can also be derived based on a sophisticated interpolation filter other than the cubic filter. Also, the cubic filter is also called a spline filter.

[0117] The encoding device / decoding device can generate a predicted sample of the target sample based on the derived reference sample of the target sample (S1050). The encoding device / decoding device can 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] On the other hand, a method can be proposed in which, in addition to the above-described examples, the current block is divided into arbitrary regions by a method of selecting an interpolation filter, and an interpolation filter for each region is selected.

[0119] For example, when the size of the current block is greater than or equal to a specific size, the current block can be divided into a plurality of regions, and an interpolation filter for each region can be selected in consideration of the distance between each region and the adjacent samples of the current block. The size of the region into which the current block is divided is a fixed value that has been previously agreed (i.e., already set) between the encoding device and the decoding device, or can also be derived based on the size of the current block, the intra prediction mode, etc. For example, when the intra prediction mode of the current block is an intra prediction mode having a vertical directionality and the mode number of the intra prediction mode is greater than 34, the size of the region into which the current block is divided can be derived as 4×4. That is, when the intra prediction mode of the current block is one of the intra prediction modes from 35 to 66, the size of the region into which the current block is divided can be derived as 4×4. When the current block is a 16×16 size block, the current block is divided into 16 4×4 size regions, and for the regions from 0 to 7 in the raster scan order among these regions, the aforementioned sophisticated interpolation filter can be selected as the interpolation filter, and for the other regions, the interpolation filter having the aforementioned low-pass filter effect can be selected as the interpolation filter. Here, the numbers of the 16 4×4 size regions according to the raster scan order can be derived in order from the upper row to the lower row, and in each row, in order from left to right. That is, among the 16 4×4 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 in order from left to right, the regions included in the second row can be represented as region 4, region 5, region 6, and region 7 in order from left to right, the regions included in the third row can be represented as region 8, region 9, region 10, and region 11 in order 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 in order from left to right.On the other hand, information indicating the size of the area into which the current block is divided and the interpolation filter for each of the areas can also be signaled. In this case, the decoding device can divide the current block into a plurality of areas based on the information, and can select an interpolation filter for each area.

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

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

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

[0123] When the intra prediction mode is a directional intra prediction mode, the encoding device / decoding device can determine whether the distance between the target sample and the reference sample of the current block is smaller than a threshold (S1110). The reference sample can indicate an adjacent sample located in the prediction direction of the intra prediction mode of the current block with respect to the target sample. Further, the threshold can be derived based on the size of the current block, the intra prediction mode of the current block, or the availability of a square / non-square block as described above. Also, information regarding the threshold can be signaled, and the threshold of the current block can also be derived based on the signaled information regarding the threshold.

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

[0125] When the distance between the target sample and the reference sample of the current block is less than the threshold value, the encoding device / decoding device can select a cubic filter as the interpolation filter for the current block, and the reference sample can be derived 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 can also be derived based on a sophisticated interpolation filter other than the cubic filter. Also, the cubic filter is also called a spline filter.

[0126] The encoding device / decoding device can generate a predicted sample of the target sample based on the reference sample of the derived target sample (S1140). The encoding device / decoding device can 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 interpolation filter among the interpolation filters can be selected to derive the reference sample of the target sample, but a plurality of interpolation filters can also be used to derive the reference sample.

[0128] For example, when the position of the reference sample of the target sample in the current block is at the position of a fractional sample, that is, when the reference sample of the target sample is a fractional sample, a first reference sample can be generated based on a first interpolation filter which is a sophisticated interpolation filter, a second reference sample can be generated based on a second interpolation filter which is an interpolation filter having the low-pass filter effect described above, and a third reference sample can be generated based on a third interpolation filter which is an interpolation filter different from the first interpolation filter and the second interpolation filter. When the first reference sample, the second reference sample, and the third reference sample are generated, a predicted sample of the target sample can be generated based on the first reference sample, the second reference sample, and the third reference sample. For example, the average of the first reference sample and the second reference sample can be derived as the predicted sample of the target sample, the average of the first reference sample and the third reference sample can also be derived as the predicted sample of the target sample, or the average of the second reference sample and the third reference sample can also be derived as the predicted sample of the target sample. Or, the average of the first reference sample, the second reference sample, and the third reference sample can also be derived as the predicted sample of the target sample.

[0129] Alternatively, a predicted sample of the target sample can be derived through 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, a predicted sample of the target sample can also be derived through a weighted sum of the first reference sample and the third reference sample, a predicted sample of the target sample can also be derived through a weighted sum of the second reference sample and the third reference sample, or a predicted sample of the target sample can also be derived through a weighted sum of the first reference sample, the second reference sample, and the third reference sample. A predicted sample of the target sample can be generated based on the combinations of the first reference sample, the second reference sample, and / or the third reference sample in the examples described above and examples other than those described above.

[0130] Specifically, for example, the predicted sample of the target sample can 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 in the current block is executed, adjacent samples at an integer sample position are interpolated based on a cubic filter to derive a first reference sample of the target sample, adjacent samples at the integer sample position are interpolated based on a Gaussian filter to derive a second reference sample of the target sample, and a predicted sample of the target sample can be generated based on the first reference sample and the second reference sample. Here, the directional intra prediction mode in which intra prediction is performed based on a reference sample at a fractional sample position can indicate one of the directional intra prediction modes excluding the 2nd, 18th, 34th, 50th, and 66th intra prediction modes. Also, the adjacent samples at the integer sample position can indicate adjacent samples adjacent to the position of the fractional sample located in the prediction direction of the directional intra prediction mode of the current block with respect to the target sample among the adjacent samples of the current block.

[0131] Alternatively, as another example, the closer the distance between the target sample and the reference sample, the higher the accuracy of the intra prediction. A first weight value for a first reference sample generated based on a first interpolation filter, which is a sophisticated interpolation filter based on the distance between the target sample and the reference sample, and a second weight 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. A method can be proposed to generate a predicted sample of the target sample by weighted-summing the first reference sample and the second reference sample based on the first weight value and the second weight value. For example, the first weight value can be derived to be inversely proportional to the distance between the target sample and the reference sample, and the second weight value can be derived as a value obtained by subtracting the first weight value from 1. Alternatively, the first weight value and the second weight value used at this time can also be derived by being up-scaled to integer units in order to avoid decimal point operations. Thereby, the closer the distance between the target sample and the reference sample, the larger the first weight value can be derived, and the farther the distance between the target sample and the reference sample, the smaller the first weight value can be derived. The distance between the target sample and the reference sample can be calculated based on the prediction angle of the intra prediction mode of the current block and the position of the target sample. Alternatively, a table for the block size and the intra prediction mode can be stored in advance, and the distance between the target sample and the reference sample can be derived by referring to the table. On the other hand, the method of deriving the reference sample of the target sample based on the plurality of interpolation filters disclosed in the above-described embodiments can be selectively applied based on specific conditions. For example, whether to derive the reference sample of the target sample based on the plurality of interpolation filters can be derived based on the size of the current block, the intra prediction mode of the current block, or the variance of the adjacent sample values of the current block, etc.Alternatively, a flag indicating whether to derive the reference sample of the target sample from the encoding device based on the plurality of interpolation filters can be transmitted, and based on the flag, it can be determined whether to derive the reference sample of the target sample based on the plurality of interpolation filters.

[0132] FIG. 12 shows 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. The encoding device / decoding device can derive an intra prediction mode for the current block and can determine whether the intra prediction mode is a directional intra prediction mode (S1200). The directional intra prediction mode can also be represented by angular prediction.

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

[0134] When the intra prediction mode is a directional intra prediction mode, the encoding device / decoding device can interpolate adjacent samples at the positions of integer samples based on a cubic filter to derive a first reference sample of the target sample (S1220). Here, the adjacent samples at the positions of the integer samples can indicate adjacent samples adjacent to the position of the fractional sample located in the prediction direction of the directional intra prediction mode of the current block with respect to the target sample among the adjacent samples of the current block. The encoding device / decoding device can perform intra prediction of the target sample based on the first reference sample (S1230). The encoding device / decoding device can copy the first reference sample to generate a first temporary prediction sample.

[0135] When the intra prediction mode is a directional intra prediction mode, the encoding device / decoding device can derive a second reference sample of the target sample by interpolating adjacent samples at the positions of integer samples based on a Gaussian filter (S1240). The encoding device / decoding device can perform intra prediction of the target sample based on the second reference sample (S1240). The encoding device / decoding device can copy the second reference sample to generate the second temporary prediction sample.

[0136] The encoding device / decoding device can derive a prediction sample of the target sample by weighted-summing the first temporary prediction sample and the second temporary prediction sample (S1250). The prediction sample can be derived as the sum of a value obtained by multiplying the first temporary prediction sample by a first weighting value α of the first temporary prediction sample and a value obtained by multiplying the second temporary prediction sample by a second weighting value 1-α of the second temporary prediction sample. The first weighting value can be derived to be inversely proportional to the distance between the target sample and the reference sample as described above, and the second weighting value can be derived as a value obtained by subtracting the first weighting value from 1. Alternatively, the first weighting value and the second weighting value used at this time can also be derived by being up-scaled to integer units in order to avoid decimal point operations. The distance between the target sample and the reference sample can be calculated based on the prediction angle of the intra prediction mode of the current block and the position of the target sample. Alternatively, a table for the block size and the intra prediction mode can be stored in advance, and the distance between the target sample and the reference sample can be derived by referring to the table.

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

[0138] The encoding apparatus determines an intra prediction mode for a current block (S1300). The encoding apparatus can derive, as the intra prediction mode for the current block, an intra prediction mode having an optimal RD cost by executing various intra prediction modes. 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 can include an intra DC mode and an intra planar mode. Alternatively, the intra prediction mode is one of two non-directional intra prediction modes and 65 directional intra prediction modes. As described above, the two non-directional prediction modes can include an intra DC mode and an intra planar mode. Further, the 65 directional intra prediction modes can include a vertical directional intra prediction mode and a horizontal directional intra prediction mode. The vertical directional intra prediction mode can include an intra prediction mode from the 34th intra prediction mode to the 66th intra prediction mode, and the horizontal directional intra prediction mode can include an intra prediction mode from the 2nd intra prediction mode to the 33rd intra prediction mode.

[0139] The encoding device derives adjacent samples including the left adjacent sample and the upper adjacent sample of the current block (S1310). The encoding device can derive the adjacent samples of the current block. The adjacent samples can include the left adjacent sample and the upper adjacent sample. Further, the adjacent samples can include the upper left adjacent sample. The left adjacent sample, the upper left adjacent sample, and the upper adjacent sample can be derived from adjacent blocks that have already been restored at the time of decoding the current block. 2N upper adjacent samples, upper left adjacent samples, and 2N left adjacent samples of the current block can be derived. Here, when the size of the current block is N×N and the x component of the top-left sample of the current block is 0 and the y component is 0, the left adjacent samples are p[-1][0] to p[-1][2N-1], the upper left adjacent sample is p[-1][-1], and the upper adjacent samples are p[0][-1] to p[2N-1][-1].

[0140] Or, when 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 is 0, M+N upper adjacent samples, upper left adjacent samples, and M+N left adjacent samples of the current block can be derived. When the size of the current block is a non-square shape of M×N and the x component of the top-left sample of the current block is 0 and the y component is 0, the left adjacent samples are p[-1][0] to p[-1][M+N-1], the upper left adjacent sample is p[-1][-1], and the upper adjacent samples are p[0][-1] to p[M+N-1][-1].

[0141] The encoding device derives a reference sample for prediction of the target sample from among the adjacent 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 device can 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. When the position of the reference sample is the position of a fractional sample, adjacent samples positioned 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 can be derived as the reference sample for the target sample. That is, a plurality of adjacent samples can be derived 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 adjacent samples can be derived as the reference sample for the target sample. Here, the target sample can indicate a sample within the current block for which intra prediction is performed. The prediction angle of the intra prediction mode can be derived based on Table 1 described above, and intraPredAngle is a variable indicating the prediction angle derived from the intra prediction mode.

[0142] The encoding device determines an interpolation filter for the target sample (S1330). The encoding device can 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. Also, for example, the interpolation filter can be determined when the position of the reference sample is the position of a fractional sample, that is, when a plurality of reference samples are derived.

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

[0144] In addition, when the current block is a square block, the width and height are the same. That is, since the current block is a square block of size N×N, the size (i.e., the reference value) serving as a reference for selecting an interpolation filter can be N for any directional intra prediction mode in any prediction direction. On the other hand, when the current block is a non-square block, that is, when the current block is a non-square block of size M×N, when the intra prediction mode of the current block is an intra prediction mode having a vertical directionality, the size of the block (i.e., the reference value) serving as a reference for selecting an interpolation filter can be M. Similarly, when the current block is a non-square block of size M×N and the intra prediction mode of the current block is an intra prediction mode having a horizontal directionality, the size of the current block (i.e., the reference value) serving as a reference for selecting an interpolation filter can be N. Or, conversely, when the current block is a non-square block of size M×N 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 can be selected based on N. Similarly, when the current block is a non-square block of size M×N 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 can also be selected based on M. However, in the specific examples described later, 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 serving as a reference for selecting an interpolation filter can 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 can be represented by N. Here, when the intra prediction mode includes 65 directional intra prediction modes and 2 non-directional intra prediction modes, the intra prediction mode having a vertical directionality can indicate the 34th to 66th intra prediction modes, and the intra prediction mode having a horizontal directionality can indicate the 2nd to 33rd intra prediction modes.

[0145] For example, it can be determined whether the size of the current block represented by the form of the current block and the directionality of the intra prediction mode is smaller than a specific value. When the size of the current block is smaller than the specific value, a sophisticated interpolation filter can be determined as the interpolation filter for the target sample. When the size of the current block is not smaller than the specific value, an interpolation filter with a low-pass filter effect can be determined as the interpolation filter for the target sample. Specifically, when the size of the current block is smaller than the specific value, the cubic filter can be determined as the interpolation filter for the target sample. When the size of the current block is not smaller than the specific value, a Gaussian filter can be determined as the interpolation filter for the target sample. Or when the size of the current block is not smaller than the specific value, a linear filter can be determined as the interpolation filter for the target sample. The interpolation filter with a low-pass filter effect can include the Gaussian filter and the linear filter. Here, the specific value can be set to 4, 8, 16, 32, etc.

[0146] Specifically, when the width and height of the current block are the same (i.e., when the current block is a square block), it can be determined whether the width of the current block is smaller than a specific value. When the width of the current block is smaller than the specific value, the interpolation filter for the target sample is derived as a cubic filter. When 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] Also, when 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 a vertical directionality, it can be determined whether the width of the current block is smaller than a specific value. When the width of the current block is smaller than the specific value, the interpolation filter for the target sample is derived as a cubic filter. When 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] Also, when 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 a horizontal directionality, it can be determined whether the height of the current block is smaller than a specific value. When the height of the current block is smaller than the specific value, the interpolation filter for the target sample is derived as a cubic filter. When 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] Also, when 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 a vertical directionality, it can be determined whether the height of the current block is smaller than a specific value. When the height of the current block is smaller than the specific value, the interpolation filter for the target sample is derived as a cubic filter. When 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] Also, when 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 a horizontal directionality, it can be determined whether the width of the current block is smaller than a specific value. When the width of the current block is smaller than the specific value, the interpolation filter for the target sample is derived as a cubic filter. When 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 target sample can be determined based on the intra prediction mode of the current block.

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

[0153] As another example, the interpolation filter for the target sample can be determined based on the size of the current block and the intra prediction mode. When the current block is a square block, since the width and height are the same, that is, when the current block is a square block of N×N size, the reference size (i.e., the reference value) for selecting the interpolation filter can be N for any directional intra prediction mode in any prediction direction. On the other hand, when the current block is a non-square block, that is, when the current block is a non-square block of M×N size, when the intra prediction mode of the current block is an intra prediction mode with a vertical directionality, the size of the block (i.e., the reference value) serving as a reference for selecting the interpolation filter can be M. 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 with a horizontal directionality, the size of the current block (i.e., the reference value) serving as a reference for selecting the interpolation filter can be N. Or, conversely, 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 with a vertical directionality, the interpolation filter of the current block can 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 with a horizontal directionality, the interpolation filter of the current block can also be selected based on M. However, in the specific examples described later, when an intra prediction mode with a vertical directionality is applied to the current block having a size of M×N, the size of the current block serving as a reference for selecting the interpolation filter can be represented by M. Similarly, when an intra prediction mode with a horizontal directionality is applied to the current block, the size of the current block can be represented by N.Here, when the intra prediction mode includes 65 directional intra prediction modes and 2 non-directional intra prediction modes, the intra prediction mode having the vertical directionality can indicate the 34th to 66th intra prediction modes, and the intra prediction mode having the horizontal directionality can indicate the 2nd to 33rd intra prediction modes.

[0154] For example, the encoding device can determine whether the size of the current block is smaller than a first specific value. When the size of the current block is not smaller than the first specific value, an interpolation filter with a low-pass filter effect can be determined as the interpolation filter for the target sample. Specifically, when the size of the current block is not smaller than the first specific value, the encoding device can determine a Gaussian filter as the interpolation filter. Alternatively, when the size of the current block is not smaller than the first specific value, the encoding device can determine a linear filter as the interpolation filter.

[0155] Specifically, when 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. When the width of the current block is not smaller than the first specific value, a Gaussian filter or a linear filter can be determined as the interpolation filter for the target sample.

[0156] Also, when 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. When the width of the current block is not smaller than the first specific value, a Gaussian filter or a linear filter can be determined as the interpolation filter for the target sample.

[0157] Also, when 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 horizontal directionality, the encoding apparatus can determine whether the height of the current block is smaller than a first specific value. When the height of the current block is not smaller than the first specific value, a Gaussian filter or a linear filter can be determined as the interpolation filter for the target sample.

[0158] Also, when 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 apparatus can determine whether the height of the current block is smaller than a first specific value. When the height of the current block is not smaller than the first specific value, a Gaussian filter or a linear filter can be determined as the interpolation filter for the target sample.

[0159] Also, when 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 horizontal directionality, the encoding apparatus can determine whether the width of the current block is smaller than a first specific value. When the width of the current block is not smaller than the first specific value, a Gaussian filter or a linear filter can be determined as the interpolation filter for the target sample.

[0160] When the size 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. When the prediction angle of the intra prediction mode is smaller than the second specific value, a fine interpolation filter can be determined as the interpolation filter for the target sample. Specifically, when the size of the current block is smaller than the first specific value, the encoding device can determine a cubic filter as the interpolation filter.

[0161] Specifically, when the width and height of the current block are the same and 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. When 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] Also, when 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 with a vertical directionality, the encoding device can determine whether the width of the current block is smaller than the first specific value. When 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. When 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.

[0163] Also, when 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 horizontal directionality, the encoding apparatus can determine whether the height of the current block is smaller than a first specific value. When the height of the current block is smaller than the first specific value, the encoding apparatus can determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. When the prediction angle of the intra prediction mode is smaller than the second specific value, the encoding apparatus can determine a cubic filter as the interpolation filter.

[0164] Also, when 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 apparatus can determine whether the height of the current block is smaller than a first specific value. When the height of the current block is smaller than the first specific value, the encoding apparatus can determine whether the prediction angle of the intra prediction mode of the current block is smaller than a second specific value. When the prediction angle of the intra prediction mode is smaller than the second specific value, the encoding apparatus can determine a cubic filter as the interpolation filter.

[0165] Also, when 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 horizontal directionality, the encoding device can determine whether the width of the current block is smaller than a first specific value. When 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 a second specific value. When 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.

[0166] Also, when the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding device can determine an interpolation filter having a low-pass filter effect as the interpolation filter for the target sample. Specifically, when the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding device can determine a gaussian filter as the interpolation filter. Or, when the prediction angle of the intra prediction mode is not smaller than the second specific value, the encoding device can determine a linear filter as the interpolation filter.

[0167] Specifically, when the width and height of the current block are the same and 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 a second specific value. When 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] Also, when 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. When 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 a second specific value. When 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.

[0169] Also, when 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 horizontal directionality, the encoding device can determine whether the height of the current block is smaller than a first specific value. When the height 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 a second specific value. When 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.

[0170] Also, when 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. When the height 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 a second specific value. When 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.

[0171] Also, when 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 horizontal directionality, the encoding device can determine whether the width of the current block is smaller than a first specific value. When 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 a second specific value. When 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.

[0172] As another example, the current block can be divided into a plurality of regions, and an interpolation filter for each region can be determined based on the distance between each region and the adjacent samples of the current block. In this case, the interpolation filter for the target sample can be derived as the interpolation filter for the region in which the target sample is included. Further, when the size of the current block is equal to or greater than a specific size, the current block is divided into a plurality of regions. Specifically, among the regions, the interpolation filter for a region whose distance from the adjacent samples of the current block is closer than a specific value can be determined as a sophisticated interpolation filter, and among the regions, the interpolation filter for a region whose distance from the adjacent samples of the current block is farther than a specific value can be determined as an interpolation filter having a low-pass filter effect.

[0173] On the one hand, the sizes of the plurality of regions into which the current block can be divided can be preset. Alternatively, the sizes of the plurality of regions can also be derived based on the size of the current block, the intra prediction mode, etc. For example, when the intra prediction mode of the current block is one of the intra prediction modes from 35 to 66, the size of the region into which the current block is divided can be derived as a 4×4 size. In this case, when the size of the current block is 16×16, the current block is divided into 16 regions of 4×4 size. Among these regions, for the regions from 0 to 7 in the raster scan order, the interpolation filter can be determined as a sophisticated interpolation filter, and for the other regions, the interpolation filter can be determined as an interpolation filter with a low-pass filter effect. For example, for the regions from 0 to 7 in the raster scan order among the regions, the interpolation filter can be determined as a cubic filter, and for the other regions, the interpolation filter can be determined as a gaussian filter or a linear filter. Here, the numbers of the 16 regions of 4×4 size according to the raster scan order can be derived row by row from top to bottom and in each row from left to right in order. That is, among the 16 regions of 4×4 size 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 in order from left to right, the regions included in the second row can be represented as region 4, region 5, region 6, and region 7 in order from left to right, the regions included in the third row can be represented as region 8, region 9, region 10, and region 11 in order 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 in order from left to right. On the other hand, information indicating the size of the region into which the current block is divided and the interpolation filter for each region can be generated.

[0174] As another example, the interpolation filter for the target sample can 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 can 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 can be calculated based on the position of the target sample and the trigonometric function value (e.g., tanθ) according to the prediction angle of the intra prediction mode. Or, it can be derived based on a predefined table for the block size and the intra prediction mode. Or, the distance between the target sample and the reference sample can also indicate a vertical distance or a horizontal distance. That is, the distance between the target sample and the reference sample can be derived based on the vertical distance or can be derived based on the horizontal distance. For example, when the distance between the target sample and the reference sample indicates a vertical distance, the distance can be derived based on the y component of the target sample. Also, when the distance between the target sample and the reference sample indicates a horizontal distance, the distance can be derived based on the x component of the target sample.

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

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

[0177] The encoding device derives a predicted sample of the target sample based on the interpolation filter and the reference sample (S1340). The encoding device can derive a filter coefficient of the interpolation filter based on the position of the target sample and the prediction angle of the intra prediction mode, and can derive the predicted sample of the target sample based on the filter coefficient and the reference sample. For example, among the adjacent samples of the current block, four adjacent samples can be derived as the reference sample, and four filter coefficients of the interpolation filter can be derived. The encoding device can interpolate the reference sample based on the filter coefficient to derive the predicted sample. The predicted sample can be derived based on the above-described Equation 1.

[0178] Also, when a plurality of interpolation filters are determined as the interpolation filter for the target sample, the encoding device can derive (temporary) prediction samples based on each interpolation filter, and can derive the prediction sample of the target sample based on the derived (temporary) prediction samples. For example, the prediction sample of the target sample can be derived through the average of the (temporary) prediction samples, or can be derived through the weighted sum of the (temporary) prediction samples. On the other hand, whether a plurality of interpolation filters are determined as the interpolation filter for the target sample can be derived based on the size of the current block, the intra prediction mode of the current block, or the variance of the adjacent sample values of the current block, etc. Also, a flag indicating whether a plurality of interpolation filters are determined as the interpolation filter for the target sample can be generated.

[0179] For example, the interpolation filter for the target sample can include a cubic filter and a Gaussian filter. In this case, the encoding device can derive the filter coefficients of the cubic filter based on the position of the target sample and the prediction angle of the intra prediction mode, and can derive the filter coefficients of the Gaussian filter based on the position of the target sample and the prediction angle of the intra prediction mode. The encoding device can derive a first prediction sample for the target sample based on the filter coefficients of the cubic filter and the reference sample, can derive a second prediction sample for the target sample based on the filter coefficients of the Gaussian filter and the reference sample, and can derive the prediction sample of the target sample based on the first prediction sample and the second prediction sample. The prediction sample of the target sample can be derived through the average of the first prediction sample and the second prediction sample. Or, the prediction sample of the target sample can be derived through the weighted sum of the first prediction sample and the second prediction sample. In this case, the weighting value for the first prediction sample may be inversely proportional to the distance between the target sample and the reference sample, and the weighting value for the second prediction sample can be derived as a value obtained by subtracting the weighting value for the first prediction sample from 1. Or, the first weighting value and the second weighting value used at this time can also be derived by being up-scaled to integer units in order to avoid decimal point operations.

[0180] Also, for example, the interpolation filter for the target sample can include a cubic filter and a linear filter. In this case, the encoding device can derive the filter coefficients of the cubic filter based on the position of the reference sample, and can derive the filter coefficients of the linear filter based on the position of the reference sample. The encoding device can derive a first predicted sample for the target sample based on the filter coefficients of the cubic filter and the reference sample, can derive a second predicted sample for the target sample based on the filter coefficients of the linear filter and the reference sample, and can 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 can be derived through the average of the first predicted sample and the second predicted sample. Or, the predicted sample of the target sample can be derived through the weighted sum of the first predicted sample and the second predicted sample. In this case, the weighting value for the first predicted sample may be inversely proportional to the distance between the target sample and the reference sample, and the weighting value for the second predicted sample can be derived as a value obtained by subtracting the weighting value for the first predicted sample from 1. Or, the first weighting value and the second weighting value used at this time can also be derived by being up-scaled to integer units in order to avoid decimal point operations.

[0181] As another example, when the MPM (most probable mode) 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 the adjacent block of the current block, if the intra prediction mode of the current block is a directional intra prediction mode other than the Planar mode or the DC mode, the interpolation filter for the target sample can be determined based on the adjacent block selected via the adjacent MPM mode. That is, the interpolation filter used for the adjacent block can be derived as the interpolation filter for the target sample. Here, when the MPM mode is applied to the current block, the encoding device can determine an MPM list based on the intra prediction mode for the left or upper adjacent block of the current block, and determine the intra prediction mode based on the MPM list.

[0182] The encoding device generates prediction information for the current block, encodes it, and outputs it (S1350). The encoding device can encode the prediction information for the current block and output it in the form of a bitstream. The prediction information can include information regarding the intra prediction mode of the current block. The encoding device can generate information regarding the intra prediction mode indicating the intra prediction mode, encode it, and output it in the form of a bitstream. The information regarding the intra prediction mode can also include information directly indicating the intra prediction mode for the current block, or can include information indicating any one candidate from the intra prediction mode candidate list derived based on the intra prediction mode of the left or upper block of the current block. The intra prediction mode candidate list can indicate the MPM list.

[0183] Also, when the current block is divided into a plurality of regions, the prediction information may include information indicating the sizes of the regions into which the current block is divided and the interpolation filters for the respective regions. Further, when 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 regarding the specific value used for the selection of the interpolation filter for the target sample. When 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 regarding a first specific value and information regarding a second specific value. Also, the prediction information may include a flag indicating whether a plurality of interpolation filters are determined as the interpolation filter for the target sample. When the flag indicates that a plurality of interpolation filters are determined as the interpolation filter for the target sample, a predicted sample for the target sample can be derived based on the plurality of interpolation filters, and when the flag indicates that a plurality of interpolation filters are not determined as the interpolation filter for the target sample, a predicted sample for the target sample is not derived based on the plurality of interpolation filters. For example, when the value of the flag is 1, the flag can indicate that a plurality of interpolation filters are determined as the interpolation filter for the target sample, and when the value of the flag is 0, the flag can indicate that a plurality of interpolation filters are not determined as the interpolation filter for the target sample. The prediction information can be signaled via a VPS (video parameter set), an SPS (sequence parameter set), a PPS (picture parameter set), or a slice segment header, or can also be signaled on a block-by-block basis.

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

[0185] The decoding apparatus derives an intra prediction mode for the current block (S1400). The decoding apparatus can 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 any one of the candidates in an intra prediction mode candidate list derived based on the intra prediction mode of the left or upper block of the current block. The intra prediction mode candidate list is also referred to as an MPM candidate list. The decoding apparatus can 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. Or, the intra prediction mode is 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. Also, 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 mode may include the 34th to 66th intra prediction modes, and the horizontal directional intra prediction mode may include the 2nd to 33rd intra prediction modes.

[0186] The decoding device derives adjacent samples including the left adjacent sample and the upper adjacent sample of the current block (S1410). The decoding device can derive the adjacent samples of the current block. The adjacent samples can include the left adjacent sample and the upper adjacent sample. Also, the adjacent samples can include the upper left adjacent sample. The left adjacent sample, the upper left adjacent sample, and the upper adjacent sample can be derived from adjacent blocks that have already been restored at the time of decoding the current block. 2N upper adjacent samples, upper left adjacent samples, and 2N left adjacent samples of the current block can be derived. Here, when the size of the current block is N×N and the x component of the top-left sample of the current block is 0 and the y component is 0, the left adjacent samples are p[-1][0] to p[-1][2N-1], the upper left adjacent sample is p[-1][-1], and the upper adjacent samples are p[0][-1] to p[2N-1][-1].

[0187] Or, when 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 is 0, M+N upper adjacent samples, upper left adjacent samples, and M+N left adjacent samples of the current block can be derived. When the size of the current block is a non-square shape of M×N and the x component of the top-left sample of the current block is 0 and the y component is 0, the left adjacent samples are p[-1][0] to p[-1][M+N-1], the upper left adjacent sample is p[-1][-1], and the upper adjacent samples are p[0][-1] to p[M+N-1][-1].

[0188] The decoding device derives a reference sample for predicting the target sample from among the adjacent 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 device can 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. When the position of the reference sample is the position of a fractional sample, adjacent samples positioned 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 can be derived as the reference sample for the target sample. That is, a plurality of adjacent samples can be derived 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 adjacent samples can be derived as the reference sample for the target sample. Here, the target sample can indicate a sample within the current block for which intra prediction is performed. The prediction angle of the intra prediction mode can be derived based on Table 1 described above, and intraPredAngle is a variable indicating the prediction angle derived from the intra prediction mode.

[0189] The decoding device determines an interpolation filter for the target sample (S1430). The decoding device can 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. Also, for example, the interpolation filter can be determined when the position of the reference sample is the position of a fractional sample.

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

[0191] When the current block is a square block, since the width and height are the same, that is, since the current block is a square block of size N×N, the size (i.e., the reference value) serving as a reference for selecting an interpolation filter can be N for any directional intra prediction mode in any prediction direction. On the other hand, when the current block is a non-square block, that is, when the current block is a non-square block of size M×N, when the intra prediction mode of the current block is an intra prediction mode having a vertical directionality, the size of the block (i.e., the reference value) serving as a reference for selecting an interpolation filter can be M. Similarly, when the current block is a non-square block of size M×N and the intra prediction mode of the current block is an intra prediction mode having a horizontal directionality, the size of the current block (i.e., the reference value) serving as a reference for selecting an interpolation filter can be N. Or, in contrast, when the current block is a non-square block of size M×N 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 can be selected based on N. Similarly, when the current block is a non-square block of size M×N 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 can also be selected based on M. However, in the specific examples described hereinafter, 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 serving as a reference for selecting an interpolation filter can 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 can be represented by N. Here, when the intra prediction mode includes 65 directional intra prediction modes and 2 non-directional intra prediction modes, the intra prediction mode having a vertical directionality can indicate the 34th to 66th intra prediction modes, and the intra prediction mode having a horizontal directionality can indicate the 2nd to 33rd intra prediction modes.

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

[0193] Specifically, when the width and height of the current block are the same (i.e., when the current block is a square block), it can be determined whether the width of the current block is smaller than a specific value. When the width of the current block is smaller than the specific value, the interpolation filter for the target sample is derived as a cubic filter. When 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] Also, when 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 a vertical directionality, it can be determined whether the width of the current block is smaller than a specific value. When the width of the current block is smaller than the specific value, the interpolation filter for the target sample is derived as a cubic filter. When 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] Also, when 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 a horizontal directionality, it can be determined whether the height of the current block is smaller than a specific value. When the height of the current block is smaller than the specific value, the interpolation filter for the target sample is derived as a cubic filter. When 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] Also, when 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 a vertical directionality, it can be determined whether the height of the current block is smaller than a specific value. When the height of the current block is smaller than the specific value, the interpolation filter for the target sample is derived as a cubic filter. When 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] Also, when 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 a horizontal directionality, it can be determined whether the width of the current block is smaller than a specific value. When the width of the current block is smaller than the specific value, the interpolation filter for the target sample is derived as a cubic filter. When 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 target sample can be determined based on the intra prediction mode of the current block.

[0199] For example, it can be determined whether the prediction angle of the intra prediction mode of the current block is smaller than a specific value. When the prediction angle of the intra prediction mode is smaller than the specific value, a sophisticated interpolation filter can be determined as the interpolation filter for the target sample. When the prediction angle of the intra prediction mode is not smaller than the specific value, an interpolation filter with a low-pass filter effect can be determined as the interpolation filter for the target sample. Specifically, when the prediction angle of the intra prediction mode is smaller than the specific value, a cubic filter can be determined as the interpolation filter for the target sample. When the prediction angle of the intra prediction mode is not smaller than the specific value, a gaussian filter can be determined as the interpolation filter for the target sample. Or, when the prediction angle of the intra prediction mode is not smaller than the specific value, a linear filter can be determined as the interpolation filter for the target sample. The interpolation filter with a low-pass filter effect can include the gaussian filter and the linear filter. Here, the specific value can be set to 4, 8, 16, 32, etc. The prediction angle of the intra prediction mode can be derived based on Table 1 described above, and intraPredAngle can indicate the prediction angle of the intra prediction mode. Also, as an example, the specific value can be set to 11. Further, the prediction information for the current block can include information for the specific value. In this case, the specific value can be derived based on the information for the specific value.

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

[0201] For example, the decoding device can determine whether the size of the current block is smaller than a first specific value. If the size of the current block is not smaller than the first specific value, an interpolation filter with a low-pass filter effect can be determined 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 can determine a Gaussian filter as the interpolation filter. Or, if the size of the current block is not smaller than the first specific value, the decoding device can determine a linear filter as the interpolation filter.

[0202] Specifically, when 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. If the width of the current block is not smaller than the first specific value, a Gaussian filter or a linear filter can be determined as the interpolation filter for the target sample.

[0203] Also, when 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 decoding device can determine whether the width of the current block is smaller than a first specific value. If the width of the current block is not smaller than the first specific value, a Gaussian filter or a linear filter can be determined as the interpolation filter for the target sample.

[0204] Also, when 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 horizontal directionality, the decoding device can determine whether the height of the current block is smaller than a first specific value. If the height of the current block is not smaller than the first specific value, a Gaussian filter or a linear filter can be determined as the interpolation filter for the target sample.

[0205] Also, when 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 decoding device can determine whether the height of the current block is smaller than a first specific value. If the height of the current block is not smaller than the first specific value, a Gaussian filter or a linear filter can be determined as the interpolation filter for the target sample.

[0206] Also, when 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 horizontal directionality, the decoding device can determine whether the width of the current block is smaller than a first specific value. If the width of the current block is not smaller than the first specific value, a Gaussian filter or a linear filter can be determined as the interpolation filter for the target sample.

[0207] When the size 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 a second specific value. If the prediction angle of the intra prediction mode is smaller than the second specific value, a sophisticated interpolation filter can be determined as the interpolation filter for the target sample. Specifically, when 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.

[0208] Specifically, when the width and height of the current block are the same and 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 a second specific value. When 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] Also, when 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 decoding device can determine whether the width of the current block is smaller than a first specific value. When 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 a second specific value. When 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.

[0210] Also, when 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 horizontal directionality, the decoding device can determine whether the height of the current block is smaller than a first specific value. When the height 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 a second specific value. When 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.

[0211] Also, when 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 decoding device can determine whether the height of the current block is smaller than a first specific value. When the height 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 a second specific value. When 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.

[0212] Also, when 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 horizontal directionality, the decoding device can determine whether the width of the current block is smaller than a first specific value. When 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 a second specific value. When 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.

[0213] Also, when the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding device can determine an interpolation filter having a low-pass filter effect as the interpolation filter for the target sample. Specifically, when the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding device can determine a gaussian filter as the interpolation filter. Or, when the prediction angle of the intra prediction mode is not smaller than the second specific value, the decoding device can determine a linear filter as the interpolation filter.

[0214] Specifically, when the width and height of the current block are the same and 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 a second specific value. When 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] Also, when 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 decoding device can determine whether the width of the current block is smaller than a first specific value. When 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 a second specific value. When 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.

[0216] Also, when 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 horizontal directionality, the decoding device can determine whether the height of the current block is smaller than a first specific value. When the height 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 a second specific value. When 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.

[0217] Also, when 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 decoding device can determine whether the height of the current block is smaller than a first specific value. When the height 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 a second specific value. When 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.

[0218] Also, when 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 horizontal directionality, the decoding device can determine whether the width of the current block is smaller than a first specific value. When 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 a second specific value. When 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.

[0219] On the other hand, the prediction information for the current block can include information for the first specific value and information for the second specific value. In this case, the first specific value can be derived based on the information for the first specific value, and the second specific value can be derived based on the information for the second specific value. Alternatively, the first specific value and the second specific value can also be derived based on preset values.

[0220] As another example, the current block can be divided into a plurality of regions, and the interpolation filter for each region can be determined based on the distance between each region and the adjacent samples of the current block. In this case, the interpolation filter for the target sample can be derived as the interpolation filter for the region in which the target sample is included. Also, when the size of the current block is equal to or larger than a specific size, the current block is divided into a plurality of regions. Specifically, among the regions, the interpolation filter for the region whose distance from the adjacent samples of the current block is closer than a specific value can be determined as a sophisticated interpolation filter, and among the regions, the interpolation filter for the region whose distance from the adjacent samples of the current block is farther than the specific value can be determined as an interpolation filter having a low-pass filter effect.

[0221] On the one hand, the sizes of the plurality of regions into which the current block can be divided can be preset. Alternatively, the sizes of the plurality of regions can also be derived based on the size of the current block, the intra prediction mode, etc. For example, when the intra prediction mode of the current block is one of the intra prediction modes from 35 to 66, the size of the region into which the current block is divided can be derived as a 4×4 size. In this case, when the size of the current block is 16×16, the current block is divided into 16 regions of 4×4 size. Among these regions, for the regions from 0 to 7 in the raster scan order, the interpolation filter can be determined as a sophisticated interpolation filter, and for the other regions, the interpolation filter can be determined as an interpolation filter with a low-pass filter effect. For example, for the regions from 0 to 7 in the raster scan order among the regions, the interpolation filter can be determined as a cubic filter, and for the other regions, the interpolation filter can be determined as a gaussian filter or a linear filter. Here, the numbers of the 16 regions of 4×4 size according to the raster scan order can be derived in order from the upper row to the lower row, and in each row, in order from left to right. That is, among the 16 regions of 4×4 size 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 in order from left to right, the regions included in the second row can be represented as region 4, region 5, region 6, and region 7 in order from left to right, the regions included in the third row can be represented as region 8, region 9, region 10, and region 11 in order 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 in order from left to right.On the one hand, prediction information for a current block can be received, and the prediction information can include information indicating the size of the region into which the current block is divided and information indicating the interpolation filter for each region. In this case, the size of the region into which the current block is divided and the interpolation filter for each region can be derived based on the information indicating the size of the region 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 can 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 can 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 can be calculated based on the trigonometric function value (e.g., tanθ) according to the position of the target sample and the prediction angle of the intra prediction mode. Or, it can be derived based on a predefined table for the block size and the intra prediction mode. Or, the distance between the target sample and the reference sample can also indicate a vertical distance or a horizontal distance. When the distance between the target sample and the reference sample indicates a vertical distance, the distance can be derived based on the y component of the target sample. Also, when the distance between the target sample and the reference sample indicates a horizontal distance, the distance can be derived based on the x component of the target sample.

[0223] For example, the decoding device can derive the distance between the target sample and the reference sample, and can determine whether the distance is smaller than a specific value. When the distance is smaller than the specific value, the decoding device can determine a sophisticated interpolation filter as the interpolation filter for the target sample. When the distance is not smaller than the specific value, the decoding device can determine an interpolation filter with a low-pass filter effect as the interpolation filter for the target sample. Specifically, when the distance is smaller than the specific value, the decoding device can determine a cubic filter as the interpolation filter for the target sample. When the distance is not smaller than the specific value, the decoding device can determine a gaussian filter or a linear filter as the interpolation filter for the target sample. The specific value can be derived based on the size of the current block. Alternatively, the specific value can also be derived based on the intra prediction mode of the current block, or the availability of a square / non-square block, etc. For example, when the size of the current block is N×N, the specific value can be derived as N / 2. Also, prediction information for the current block can be received, and the prediction information can include information about the specific value. In this case, the specific value can be derived based on the information about the specific value.

[0224] As another example, a plurality of interpolation filters can be determined as the interpolation filter for the target sample. For example, the interpolation filter for the target sample can include one of the sophisticated interpolation filters and one of the interpolation filters having a low-pass filter effect. Or, the interpolation filter for the target sample can include one of the sophisticated interpolation filters and two of the interpolation filters having a low-pass filter effect. Or, the interpolation filter for the target sample can include two of the sophisticated interpolation filters and one of the interpolation filters having a low-pass filter effect. Specifically, the interpolation filter for the target sample can include a cubic filter and a Gaussian filter. On the other hand, prediction information for the current block can be received, and the prediction information can include a flag indicating whether a plurality of interpolation filters are determined as the interpolation filter for the target sample. It can be determined whether a plurality of interpolation filters are determined based on the flag. For example, when the flag indicates that a plurality of interpolation filters are determined as the interpolation filter for the target sample, a predicted sample of the target sample can be derived based on the plurality of interpolation filters, and when the flag indicates that a plurality of interpolation filters are not determined as the interpolation filter for the target sample, a predicted sample of the target sample is not derived based on the plurality of interpolation filters. For example, when the value of the flag is 1, the flag can indicate that a plurality of interpolation filters are determined as the interpolation filter for the target sample, and when the value of the flag is 0, the flag can indicate that a plurality of interpolation filters are not determined as the interpolation filter for the target sample.

[0225] The decoding device derives a predicted sample of the target sample based on the interpolation filter and the reference sample (S1440). The decoding device can derive filter coefficients of the interpolation filter based on the position of the target sample and the prediction angle of the intra prediction mode, and can derive the predicted sample of the target sample based on the filter coefficients and the reference sample. For example, among the adjacent samples of the current block, four adjacent samples can be derived as the reference samples, and four filter coefficients of the interpolation filter can be derived. The decoding device can interpolate the reference samples based on the filter coefficients to derive the predicted sample. The predicted sample can be derived based on the above-described Equation 1.

[0226] Also, when a plurality of interpolation filters are determined as the interpolation filter for the target sample, the decoding device can derive (temporary) predicted samples based on the respective interpolation filters, and can derive the predicted sample of the target sample based on the derived (temporary) predicted samples. For example, the predicted sample of the target sample can be derived through the average of the (temporary) predicted samples, or can be derived through the weighted sum of the (temporary) predicted samples. On the other hand, whether a plurality of interpolation filters are determined as the interpolation filter for the target sample can be derived based on the size of the current block, the intra prediction mode of the current block, or the variance of the adjacent sample values of the current block, etc. Also, a flag indicating whether a plurality of interpolation filters are determined as the interpolation filter for the target sample can be received, and it can be determined whether a plurality of interpolation filters are determined as the interpolation filter for the target sample 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 device can derive the filter coefficients of the cubic filter based on the position of the target sample and the prediction angle of the intra prediction mode, and can derive the filter coefficients of the Gaussian filter based on the position of the target sample and the prediction angle of the intra prediction mode. The decoding device can derive a first predicted sample for the target sample based on the filter coefficients of the cubic filter and the reference sample, can derive a second predicted sample for the target sample based on the filter coefficients of the Gaussian filter and the reference sample, and can 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 can be derived through the average of the first predicted sample and the second predicted sample. Or, the predicted sample of the target sample can be derived through the weighted sum of the first predicted sample and the second predicted sample. In this case, the weighting value for the first predicted sample may be inversely proportional to the distance between the target sample and the reference sample, and the weighting value for the second predicted sample can be derived as a value obtained by subtracting the weighting value for the first predicted sample from 1. Or, the first weighting value and the second weighting value used at this time can also be derived by being up-scaled to an integer unit in order to avoid decimal point operations.

[0228] Also, for example, the interpolation filter for the target sample can include a cubic filter and a linear filter. In this case, the decoding device can derive the filter coefficients of the cubic filter based on the position of the reference sample, and can derive the filter coefficients of the linear filter based on the position of the reference sample. The decoding device can derive a first predicted sample for the target sample based on the filter coefficients of the cubic filter and the reference sample, and can derive a second predicted sample for the target sample based on the filter coefficients of the linear filter and the reference sample, and can 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 can be derived through the average of the first predicted sample and the second predicted sample. Or, the predicted sample of the target sample can be derived through the weighted sum of the first predicted sample and the second predicted sample. In this case, the weighting value for the first predicted sample may be inversely proportional to the distance between the target sample and the reference sample, and the weighting value for the second predicted sample can be derived as a value obtained by subtracting the weighting value for the first predicted sample from 1. Or, the first weighting value and the second weighting value used at this time can also be derived by being up-scaled to integer units in order to avoid decimal point operations.

[0229] As another example, when the MPM (most probable mode) 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 an adjacent block of the current block, and when the intra prediction mode of the current block is a directional intra prediction mode other than the Planar mode or the DC mode, the interpolation filter for the target sample can be determined based on the adjacent block selected via the adjacent MPM mode. That is, the interpolation filter used for the adjacent block can be derived as the interpolation filter for the target sample. Here, when the MPM mode is applied to the current block, the decoding device can determine an MPM list based on the intra prediction mode for the left or upper adjacent block of the current block, and determine the intra prediction mode based on the MPM list.

[0230] On the other hand, although not shown in the drawings, the decoding device can also use the predicted sample as a restored sample according to the prediction mode, or can also generate a restored sample by adding a residual sample to the predicted sample. When there is a residual sample for the target block, the decoding device can receive information regarding the residual for the target block, and the information regarding the residual can be included in the information for the restored sample. The information regarding the residual can include a transform coefficient regarding the residual sample. The decoding device can derive the residual sample (or, residual sample array) for the target block based on the residual information. The decoding device can generate a restored sample based on the predicted sample and the residual sample, and can derive a restored block or a restored picture based on the restored sample. Thereafter, as described above, the decoding device can apply an in-loop filtering procedure such as deblocking filtering and / or SAO procedure to the restored picture in order to improve subjective / objective image quality as necessary.

[0231] Also, the decoding device can receive prediction information for the current block via a bit stream and perform entropy decoding. The prediction information can include information regarding the intra prediction mode of the current block. The decoding device can obtain information regarding the intra prediction mode indicating the intra prediction mode. The information regarding the intra prediction mode can also include information directly indicating the intra prediction mode for the current block, or can include information indicating any one candidate among the intra prediction mode candidate lists derived based on the intra prediction modes of the left or upper block of the current block. The intra prediction mode candidate list can indicate the MPM list.

[0232] Also, when the current block is divided into a plurality of regions, the prediction information may include information indicating the sizes of the regions into which the current block is divided and the interpolation filters for the respective regions. Further, when 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 for the selection of the interpolation filter for the target sample. When 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. Further, the prediction information may include a flag indicating whether a plurality of interpolation filters are determined as the interpolation filter for the target sample. When the flag indicates that a plurality of interpolation filters are determined as the interpolation filter for the target sample, the predicted sample of the target sample can be derived based on the plurality of interpolation filters, and when the flag indicates that a plurality of interpolation filters are not determined as the interpolation filter for the target sample, the predicted sample of the target sample is not derived based on the plurality of interpolation filters. For example, when the value of the flag is 1, the flag can indicate that a plurality of interpolation filters are determined as the interpolation filter for the target sample, and when the value of the flag is 0, the flag can indicate that a plurality of interpolation filters are not determined as the interpolation filter for the target sample. The prediction information can be signaled via a VPS (video parameter set), SPS (sequence parameter set), PPS (picture parameter set), or slice segment header, or can also 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 the size of the current block, the distance between the target sample and the reference sample, and / or the interpolation filter derived based on the prediction mode (prediction angle), thereby more accurately generating a reference sample for the position of the fractional sample for the target sample and improving the accuracy of the prediction for the current block, reducing the residual for the current block, and improving the coding efficiency.

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

[0235] In the foregoing embodiments, the method is described based on a flowchart in a series of steps or blocks, but the present invention is not limited to the order of the steps, and a certain step can occur in a different order or simultaneously with steps different from those described above. Also, those skilled in the art can understand that the steps shown in the flowchart are not exclusive, other steps are included, and one or more steps of the flowchart can be deleted without affecting the scope of the present invention.

[0236] The method according to the present invention described above can be embodied 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, a display device, etc.

[0237] In the present invention, when an embodiment is implemented by software, the above-described method can be implemented by modules (processes, functions, etc.) that perform the above-described functions. The modules can be stored in a memory and executed by a processor. The memory can be inside or outside the processor and can be connected to the processor by various well-known means. The processor can include an ASIC (application-specific integrated circuit), other chip sets, logic circuits, and / or data processing devices. The memory can include a ROM (read-only memory), a RAM (random access memory), a flash memory, a memory card, a storage medium, and / or other storage devices.

Claims

1. In a video decoding method executed by a decoding apparatus, obtaining residual information for a current block from a bitstream; deriving an intra prediction mode of the current block; deriving adjacent samples including left adjacent samples and upper adjacent samples of the current block; deriving, from among the adjacent samples, a reference sample for prediction of a target sample of the current block based on a position of the target sample and a prediction angle of the intra prediction mode; determining an interpolation filter for the target sample based on the intra prediction mode and a size of the current block; deriving a predicted sample of the target sample based on the interpolation filter and the reference sample; deriving a residual sample of the target sample based on the residual information; generating a restored picture based on the predicted sample and the residual sample; performing deblocking filtering on the restored picture, wherein the step of determining the interpolation filter for the target sample based on the intra prediction mode and the size of the current block includes determining whether the size of the current block is smaller than a first specific value; and based on the size of the current block being smaller than the first specific value, determining whether the prediction angle of the intra prediction mode is smaller than a second specific value, wherein based on the size of the current block not being smaller than the first specific value, the interpolation filter for the target sample is derived as a Gaussian filter; wherein 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 for the target sample is derived as a cubic filter; and 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 larger than the second specific value, the interpolation filter for the target sample is derived as the Gaussian filter, a video decoding method.

2. In a video encoding method executed by an encoding device, determining an intra prediction mode of a current block; deriving adjacent samples including left adjacent samples and upper adjacent samples of the current block; deriving, from among the adjacent samples, reference samples for prediction of a target sample of the current block based on a position of the target sample and a prediction angle of the intra prediction mode; determining an interpolation filter for the target sample based on the intra prediction mode and a size of the current block; deriving a predicted sample of the target sample based on the interpolation filter and the reference samples; deriving a residual sample of the target sample based on the predicted sample; generating a restored picture based on the predicted sample and the residual sample; performing deblocking filtering on the restored picture; encoding video information including residual information for the current block, the step of determining the interpolation filter for the target sample based on the intra prediction mode and the size of the current block includes: determining whether the size of the current block is smaller than a first specific value; 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; based on the size of the current block not being smaller than the first specific value, the interpolation filter for the target sample is derived as a Gaussian 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 for the target sample is derived 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 larger than the second specific value, the interpolation filter for the target sample is derived as the Gaussian filter, a video encoding method. **Claim 3** A method for transmitting data for video, A step of obtaining the bitstream of the video, where the bitstream is A step of determining the intra prediction mode of the current block A step of deriving adjacent samples including the left adjacent sample and the upper adjacent sample of the current block A step of deriving, from among the adjacent samples, reference samples for predicting the target sample of the current block based on the position of the target sample and the prediction angle of the intra prediction mode A step of determining an interpolation filter for the target sample based on the intra prediction mode and the size of the current block A step of deriving a predicted sample of the target sample based on the interpolation filter and the reference samples A step of deriving a residual sample of the target sample based on the predicted sample A step of generating a restored picture based on the predicted sample and the residual sample A step of performing deblocking filtering on the restored picture A step of encoding video information including residual information for the current block A step generated based on A step of transmitting the data including the bitstream The step of determining the interpolation filter for the target sample based on the intra prediction mode and the size of the current block A step of determining whether the size of the current block is smaller than a first specific value A step of determining whether the prediction angle of the intra prediction mode is smaller than a second specific value based on the fact that the size of the current block is smaller than the first specific value Based on the fact that the size of the current block is not smaller than the first specific value, the interpolation filter for the target sample is derived as a Gaussian filter Based on the fact that the size of the current block is smaller than the first specific value and the prediction angle of the intra prediction mode is smaller than the second specific value, the interpolation filter for the target sample is derived as a cubic filter A transmission method in which, 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 larger than the second specific value, the interpolation filter for the target sample is derived as the Gaussian filter.

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