Method and device for performing image decoding based on intra-frame prediction in image coding system

By using intra prediction method and interpolation filter in the image encoding system, the problem of high-resolution image transmission and storage costs is solved, and the encoding efficiency and accuracy are improved.

CN114286110BActive Publication Date: 2025-01-07LG ELECTRONICS INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111337843.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2017-05-31
Filing Date
2018-01-05
Publication Date
2025-01-07
Estimated Expiration
2038-01-05

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently process the transmission and storage of high-resolution and high-quality images, resulting in an increase in the amount of information and high transmission and storage costs.

Method used

By adopting an intra prediction method in the image encoding system, an interpolation filter is used to select reference samples based on the position and prediction mode of the target sample, generate prediction samples, reduce residuals, and improve coding efficiency.

Benefits of technology

Improve the accuracy and efficiency of image encoding, reduce the bit amount of interpolated filter selection information, and reduce transmission and storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114286110B_ABST
    Figure CN114286110B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and device for performing image decoding based on intra-frame prediction in an image coding system. The method for performing image decoding by a decoding device according to the present invention comprises the following steps: deriving an intra-frame prediction mode of a current block; deriving neighboring samples including left neighboring samples and upper neighboring samples of the current block; deriving a reference sample for predicting a target sample among neighboring samples based on the position of a target sample of the current block and a prediction angle of an intra-frame prediction mode; determining an interpolation filter of the target sample; and deriving a prediction sample of the target sample based on the interpolation filter and the reference sample.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the patent application filed on October 30, 2019, with an international application date of January 5, 2018, application number 201880028597.7 (PCT / KR2018 / 000226), and the invention name is "Method and device for performing image decoding based on intra-frame prediction in an image coding system". Technical Field

[0002] The present disclosure relates to video coding technology, and more particularly, to a video decoding method and device based on intra-frame prediction in an image coding system. Background Art

[0003] The demand for high-resolution, high-quality images such as HD (high-definition) images and UHD (ultra-high-definition) images is increasing in various fields. Because image data has high resolution and high quality, the amount of information or bit volume to be transmitted increases relative to conventional image data. Therefore, when image data is transmitted using a medium such as a conventional wired / wireless broadband line or when image data is stored using an existing storage medium, its transmission cost and storage cost increase.

[0004] Therefore, there is a need for an efficient image compression technology for effectively transmitting, storing, and reproducing information of high-resolution and high-quality images. Summary of the invention

[0005] Technical issues

[0006] The present disclosure provides a method and apparatus for increasing image coding efficiency.

[0007] The present disclosure also provides an intra-frame prediction method and device for selecting an interpolation filter for a target sample in a current block.

[0008] The present disclosure also provides a method and apparatus for performing intra prediction based on an interpolation filter for a selected target sample.

[0009] Technical Solution

[0010] In one aspect, a video decoding method performed by a decoding device is provided. The method includes: deriving an intra-frame prediction mode of a current block; deriving neighboring samples including left neighboring samples and upper neighboring samples of the current block; deriving a reference sample for predicting a target sample of the current block among the neighboring samples based on a position of the target sample and a prediction angle of the intra-frame prediction mode; determining an interpolation filter for the target sample; and deriving a prediction sample of the target sample based on the interpolation filter and the reference sample.

[0011] On the other hand, a decoding device for performing image decoding is provided. The decoding device includes: an entropy decoder that obtains prediction information for a current block; and a predictor that derives an intra-frame prediction mode of the current block; derives neighboring samples including left neighboring samples and upper neighboring samples of the current block, derives reference samples for prediction of the target sample among the neighboring samples based on the position of the target sample of the current block and the prediction angle of the intra-frame prediction mode, determines an interpolation filter for the target sample, and derives a prediction sample of the target sample based on the interpolation filter and the reference sample.

[0012] On the other hand, a video encoding method performed by an encoding device is provided. The method includes: determining an intra-frame prediction mode of a current block; deriving neighboring samples including left neighboring samples and upper neighboring samples of the current block; deriving reference samples for predicting target samples of the current block among neighboring samples based on the position of the target sample and the prediction angle of the intra-frame prediction mode; determining an interpolation filter for the target sample; deriving prediction samples of the target sample based on the interpolation filter and the reference sample; and generating prediction information of the current block, encoding the generated prediction information, and outputting the encoded prediction information.

[0013] On the other hand, a video encoding device is provided. The encoding device includes: a predictor that determines an intra-frame prediction mode of a current block; derives neighboring samples including left neighboring samples and upper neighboring samples of the current block; based on the position of a target sample of the current block and a prediction angle of the intra-frame prediction mode, derives a reference sample for predicting the target sample among the neighboring samples, determines an interpolation filter for the target sample, and derives a prediction sample of the target sample based on the interpolation filter and the reference sample; and an entropy encoder that generates prediction information for the current block, encodes the generated prediction information, and outputs the encoded prediction information.

[0014] Beneficial Effects

[0015] According to the present disclosure, prediction can be performed on the target sample based on the interpolation filter selected according to the size information of the current block, the information of the distance to the reference sample and / or the prediction mode information, so that the reference sample at the fractional sample position of the target sample can be accurately generated to improve the prediction accuracy of the current block, and the residual of the current block can be reduced to enhance the coding efficiency.

[0016] According to the present disclosure, since an interpolation filter for a target sample can be selected based on the above-mentioned various conditions, the bit amount of information on the selection of the interpolation filter can be reduced, thereby improving the prediction accuracy of the current block and increasing the coding efficiency of the current block. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1is a schematic diagram illustrating a configuration of a video encoding device to which the present disclosure can be applied.

[0018] Figure 2 Another example of a video encoding device to which the present disclosure is applicable is illustrated.

[0019] Figure 3 An example of a process of performing intra prediction in an encoding device is illustrated.

[0020] Figure 4 is a schematic diagram illustrating a configuration of a video decoding device to which the present disclosure can be applied.

[0021] Figure 5 Another example of a video decoding device to which the present disclosure is applicable is illustrated.

[0022] Figure 6 An example of a process of performing intra prediction in a decoding device is illustrated.

[0023] Figure 7 An example of left neighboring samples and upper neighboring samples used for intra prediction of a current block is illustrated.

[0024] Figure 8 An example of intra direction mode for 65 prediction directions is illustrated.

[0025] Fig. 9 An example is illustrated 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, a prediction sample of a target sample is derived based on integer samples adjacent to the left and right of the reference sample.

[0026] Fig.10 An example of selecting an interpolation filter based on the size of a current block and an intra prediction mode is illustrated.

[0027] Fig.11 An example of selecting an interpolation filter based on a distance between a target sample of a current block and a reference sample is illustrated.

[0028] Fig.12 An example is illustrated in which reference samples of a target sample of a current block are derived based on a plurality of interpolation filters, and a prediction sample of the target sample is derived based on the reference samples.

[0029] Fig.13 The video encoding method of the encoding device according to the present disclosure is schematically illustrated.

[0030] Fig.14 The video decoding method of the decoding device according to the present disclosure is schematically illustrated. DETAILED DESCRIPTION

[0031] The present disclosure can be modified in various forms, and specific embodiments thereof will be described and illustrated in the accompanying drawings. However, the embodiments are not intended to limit the present disclosure. The terms used in the following description are only used to describe specific embodiments, but are not intended to limit the present disclosure. Singular expressions include plural expressions as long as it is clearly read in different ways. Terms such as "including" and "having" are intended to indicate the presence of features, numbers, steps, operations, elements, components, or combinations thereof used in the following description, and therefore it should be understood that the presence or possibility of adding one or more different features, numbers, steps, operations, elements, components, or combinations thereof is not excluded.

[0032] At the same time, for the convenience of explaining different specific functions, the elements in the drawings described in the present disclosure are drawn independently, which does not mean that these elements are implemented by independent hardware or independent software. For example, two or more elements in the element can be combined to form a single element, or an element can be divided into multiple elements. Without departing from the concept of the present disclosure, embodiments in which elements are combined and / or divided belong to the present disclosure.

[0033] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. In addition, throughout the accompanying drawings, the same reference numerals are used to indicate the same elements, and the same description of the same elements will be omitted.

[0034] In this specification, generally a picture means a unit representing an image at a specific time, and a slice is a unit constituting a part of a picture. One picture may be composed of a plurality of slices, and the terms of picture and slice may be mixed with each other as needed.

[0035] A pixel or a pixel (pel) may mean the smallest unit constituting a picture (or image). In addition, a "sample" may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a value of a pixel, may represent only a pixel (pixel value) of a luminance component, and may represent only a pixel (pixel value) of a chrominance component.

[0036] A unit indicates a basic unit of image processing. The unit may include at least one of a specific region and information related to the region. Optionally, the unit may be mixed with terms such as block, region, etc. In a typical case, an M×N block may represent a set of samples or transform coefficients arranged in M ​​columns and N rows.

[0037] Figure 1 The structure of a video encoding device to which the present disclosure can be applied is briefly illustrated.

[0038] refer to Figure 1, the video encoding apparatus 100 may include a picture divider 105, a predictor 110, a residual processor 120, an adder 140, a filter 150, and a memory 160. The residual processor 120 may include a subtractor 121, a transformer 122, a quantizer 123, a rearranger 124, a dequantizer 125, and an inverse transformer 126.

[0039] The picture divider 105 may divide the input picture into at least one processing unit.

[0040] In the example, the processing unit may be referred to as a coding unit (CU). In this case, the coding unit may be recursively partitioned from the maximum coding unit (LCU) according to a quadtree binary tree (QTBT) structure. For example, a coding unit may be partitioned into a plurality of coding units of a deeper depth based on a quadtree structure and / or a binary tree structure. In this case, for example, the quadtree structure may be applied first, and the binary tree structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding process according to the present disclosure may be performed based on a final coding unit that is no longer further partitioned. In this case, depending on image characteristics, the maximum coding unit may be used as the final coding unit based on coding efficiency, etc., or the coding unit may be recursively partitioned into coding units of a lower depth as needed, and the coding unit with the best size may be used as the final coding unit. Here, the coding process may include processes such as prediction, transformation, and reconstruction, which will be described later.

[0041] In another example, the processing unit may include a coding unit (CU), a prediction unit (PU), or a transform unit (TU). The coding unit may be partitioned from the maximum coding unit (LCU) into coding units of a deeper depth according to a quadtree structure. In this case, depending on image characteristics, the maximum coding unit may be directly used as a final coding unit based on coding efficiency, etc., or the coding unit may be recursively partitioned into coding units of a deeper depth as needed, and the coding unit with the best size may be used as the final coding unit. When the minimum coding unit (SCU) is set, the coding unit may not be partitioned into coding units smaller than the minimum coding unit. Here, the final coding unit refers to a coding unit partitioned or divided into a prediction unit or a transform unit. A prediction unit is a unit partitioned from a coding unit and may be a unit of sample prediction. Here, a prediction unit may be partitioned into sub-blocks. A transform unit may be partitioned from a coding unit according to a quadtree structure and may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from a transform coefficient. Hereinafter, a coding unit may be referred to as a coding block (CB), a prediction unit may be referred to as a prediction block (PB), and a transform unit may be referred to as a transform block (TB). A prediction block or prediction unit may refer to a specific area in a picture in the form of a block and include an array of prediction samples. In addition, a transform block or transform unit may refer to a specific area in a picture in the form of a block and include an array of transform coefficients or residual samples.

[0042] The predictor 110 may perform prediction on a processing target block (hereinafter, current block), and may generate a prediction block including prediction samples of the current block. The prediction unit performed in the predictor 110 may be a coding block, or may be a transform block, or may be a prediction block.

[0043] The predictor 110 may determine whether to apply intra prediction or inter prediction to the current block. For example, the predictor 110 may determine whether to apply intra prediction or inter prediction in units of CUs.

[0044] In the case of intra-frame prediction, the predictor 110 can derive the prediction sample of the current block based on the reference sample outside the current block in the picture to which the current block belongs (hereinafter, the current picture). In this case, the predictor 110 can derive the prediction sample based on the average value or interpolation of the neighboring reference samples of the current block (case (i)), or can derive the prediction sample based on the reference sample existing in a specific (prediction) direction of the prediction sample among the neighboring reference samples of the current block (case (ii)). Case (i) can be referred to as a non-directional mode or a non-angle mode, and case (ii) can be referred to as a directional mode or an angle mode. In intra-frame prediction, the prediction mode may include, as an example, 33 directional modes and at least two non-directional modes. The non-directional mode may include a DC mode and a plane mode. The predictor 110 may determine the prediction mode to be applied to the current block by using the prediction mode applied to the neighboring block.

[0045] In the case of inter-frame prediction, the predictor 110 can derive the prediction sample of the current block based on the sample specified by the motion vector on the reference picture. The predictor 110 can derive the prediction sample of the current block by applying any one of the skip mode, merge mode and motion vector prediction (MVP) mode. In the case of skip mode and merge mode, the predictor 110 can use the motion information of the neighboring block as the motion information of the current block. In the case of skip mode, unlike merge mode, the difference (residual) between the prediction sample and the original sample is not sent. In the case of MVP mode, the motion vector of the neighboring block is used as a motion vector predictor, and is therefore used as a motion vector predictor of the current block to derive the motion vector of the current block.

[0046] In the case of inter-frame prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the temporal neighboring blocks may also be referred to as a collocated picture (colPic). Motion information may include a motion vector and a reference picture index. Information such as prediction mode information and motion information may be (entropy) encoded and then output as a bitstream.

[0047] When motion information of temporally adjacent blocks is used in skip mode and merge mode, the highest picture in the reference picture list may be used as a reference picture. Reference pictures included in the reference picture list may be aligned based on a picture order count (POC) difference between the current picture and the corresponding reference picture. POC corresponds to a display order and may be distinguished from a coding order.

[0048] The subtractor 121 generates a residual sample, which is a difference between the original sample and the predicted sample. If the skip mode is applied, the residual sample may not be generated as described above.

[0049] The transformer 122 transforms the residual samples in units of transform blocks to generate transform coefficients. The transformer 122 may perform the transform based on the size of the corresponding transform block and the prediction mode applied to the coding block or prediction block spatially overlapping with the transform block. For example, if intra prediction is applied to the coding block or prediction block overlapping with the transform block and the transform block is a 4×4 residual array, the residual samples may be transformed using a discrete sine transform (DST) transform kernel, and in other cases a discrete cosine transform (DCT) transform kernel may be used to transform the residual samples.

[0050] The quantizer 123 may quantize the transform coefficient to generate a quantized transform coefficient.

[0051] The rearranger 124 rearranges the quantized transform coefficients. The rearranger 124 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector by a coefficient scanning method. Although the rearranger 124 is described as a separate component, the rearranger 124 may be a part of the quantizer 123.

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

[0053] The dequantizer 125 inversely quantizes the value (transform coefficient) quantized by the quantizer 123 , and the inverse transformer 126 inversely transforms the value inversely quantized by the dequantizer 125 to generate residual samples.

[0054] The adder 140 adds the residual samples to the prediction samples to reconstruct the picture. The residual samples may be added to the prediction samples in units of blocks to generate a reconstructed block. Although the adder 140 is described as a separate component, the adder 140 may be a part of the predictor 110. Meanwhile, the adder 140 may be referred to as a reconstructor or a reconstructed block generator.

[0055] The filter 150 may apply deblocking filtering and / or sample adaptive offset to the reconstructed picture. Artifacts at block boundaries in the reconstructed picture or distortion in quantization may be corrected by deblocking filtering and / or sample adaptive offset. After deblocking filtering is completed, sample adaptive offset may be applied in units of samples. The filter 150 may apply an adaptive loop filter (ALF) to the reconstructed picture. The ALF may be applied to the reconstructed picture to which deblocking filtering and / or sample adaptive offset have been applied.

[0056] The memory 160 may store a reconstructed picture (decoded picture) or information required for encoding / decoding. Here, the reconstructed picture may be a reconstructed picture filtered by the filter 150. The stored reconstructed picture may be used as a reference picture for (inter) prediction of other pictures. For example, the memory 160 may store (reference) pictures for inter prediction. Here, the pictures for inter prediction may be specified according to a reference picture set or a reference picture list.

[0057] Figure 2 Another example of a video encoding device to which the present disclosure can be applied is illustrated.

[0058] refer to Figure 2 , the video encoding apparatus includes an intra predictor, a reference smoother 200, a predictor 210, a post filter 220, a transformer 230, and a quantizer 240. Here, the intra predictor may include the reference smoother 200, the predictor 210, and the post filter 220.

[0059] When intra prediction is applied to the current block, the reference smoother 200 can perform smoothing on the left neighboring samples and the upper neighboring samples used for intra prediction of the current block in the picture to which the current block belongs (hereinafter, referred to as the current picture) based on the size of the current block, the intra prediction mode information, and the sample value. Therefore, visual artifacts of the prediction samples of the current block, which may occur due to the difference between the sample values ​​of the left neighboring samples and the sample values ​​of the upper neighboring samples, can be prevented.

[0060] Predictor 210 can (i) derive prediction samples based on the average or interpolation of the left neighboring samples and the upper neighboring samples of the current block, or (ii) derive prediction samples based on neighboring samples in a specific (prediction) direction of the prediction samples among the left neighboring samples and the upper neighboring samples. Case (i) can be called a non-directional mode or a non-angle mode, and case (ii) can be called a directional mode or an angle mode. In intra-frame prediction, the prediction mode can have 33 directional prediction modes and at least two non-directional modes. The non-directional mode can include a DC prediction mode and a plane mode (plane mode). Predictor 210 can also use the prediction mode applied to the neighboring blocks to determine the prediction mode applied to the current block.

[0061] The post filter 220 may selectively perform post-processing filtering to mitigate discontinuity between the current block and neighboring samples according to the prediction mode of the prediction sample of the current block. Thereafter, the encoding device may derive the difference between the prediction sample and the original sample as a residual sample, and the transformer 230 may transform the residual sample in units of blocks to generate a transform coefficient. In addition, the quantizer 240 may quantize the transform coefficient to generate a quantized transform coefficient.

[0062] Figure 3 An example of a process of performing intra-frame prediction in an encoding device is illustrated. The encoding device may perform intra-frame prediction to generate a prediction sample of the current block (S300). The prediction sample may be referred to as a prediction signal or an intra-frame prediction signal. Specifically, the encoding device may smooth the left neighboring sample and the upper neighboring sample for intra-frame prediction of the current block based on the size, mode information and sample value of the current block (i.e., perform smoothing on them) (S310). Thereafter, as described above, the encoding device may perform prediction according to the intra-frame prediction mode to generate a prediction sample (S320), and perform post-processing filtering to reduce the discontinuity between the current block and the neighboring samples (S330). The encoding device may generate the difference between the prediction sample and the original sample as a residual sample (S340), and transform the residual sample in units of blocks to generate a transform coefficient. In addition, the encoding device may quantize the transform coefficient to generate a quantized transform coefficient (S360) and entropy encode the quantized transform coefficient to perform signaling (S370).

[0063] Figure 4 The structure of a video decoding device to which the present disclosure is applicable is briefly illustrated.

[0064] refer to Figure 4 , the video decoding apparatus 400 may include an entropy decoder 410, a residual processor 420, a predictor 430, an adder 440, a filter 450, and a memory 460. The residual processor 420 may include a rearranger 421, a dequantizer 422, and an inverse transformer 423.

[0065] When a bitstream including video information is input, the video decoding apparatus 400 may reconstruct a video in association with a process of processing the video information in a video encoding apparatus.

[0066] For example, the video decoding device 400 may perform video decoding using a processing unit applied in a video encoding device. Therefore, the processing unit block of video decoding may be, for example, a coding unit, and in another example, may be a coding unit, a prediction unit, or a transform unit. The coding unit may be segmented from the maximum coding unit according to a quadtree structure and / or a binary tree structure.

[0067] In some cases, a prediction unit and a transform unit may be further used, and in this case, a prediction block is a block derived or partitioned from a coding unit and may be a unit of sample prediction. Here, a prediction unit may be divided into sub-blocks. A transform unit may be partitioned from a coding unit according to a quadtree structure and may be a unit for deriving a transform coefficient or a unit for deriving a residual signal from a transform coefficient.

[0068] The entropy decoder 410 can parse the bitstream to output information required for video reconstruction or picture reconstruction. For example, the entropy decoder 410 can decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, CABAC, etc., and can output the values ​​of syntax elements required for video reconstruction and the quantized values ​​of the transform coefficients about the residual.

[0069] More specifically, the CABAC entropy decoding method can receive a bin corresponding to each syntax element in the bitstream, use the decoding target syntax element information and the decoding information of the neighboring and decoding target blocks or the information of the amabol / bin decoded in the previous step to determine the context model, predict the bin generation probability according to the determined context model, and perform arithmetic decoding of the bin to generate a symbol corresponding to each syntax element value. Here, the CABAC entropy decoding method can update the context model using the information of the symbol / bin decoded by the context model for the next symbol / bin after determining the context model.

[0070] Information about prediction among information decoded in the entropy decoder 410 may be provided to the predictor 430 , and a residual value, that is, a quantized transform coefficient, which has been entropy-decoded by the entropy decoder 410 may be input to the rearranger 421 .

[0071] The rearranger 421 may rearrange the quantized transform coefficients into a two-dimensional block form. The rearranger 421 may perform rearrangement corresponding to the coefficient scanning performed by the encoding device. Although the rearranger 421 is described as a separate component, the rearranger 421 may be part of the dequantizer 422.

[0072] The dequantizer 422 may dequantize the quantized transform coefficient based on the (de)quantization parameter to output the transform coefficient. In this case, information for deriving the quantization parameter may be signaled from the encoding device.

[0073] The inverse transformer 423 may inversely transform the transform coefficients to derive residual samples.

[0074] The predictor 430 may perform prediction on the current block, and may generate a prediction block including a prediction sample of the current block. A unit of prediction performed in the predictor 430 may be a coding block, or may be a transform block, or may be a prediction block.

[0075] The predictor 430 may determine whether to apply intra prediction or inter prediction based on the information about the prediction. In this case, the unit for determining which one to use between intra prediction and inter prediction may be different from the unit for generating prediction samples. In addition, the unit for generating prediction samples may also be different in inter prediction and intra prediction. For example, it may be determined which one to apply between inter prediction and intra prediction in units of CU. In addition, for example, in inter prediction, prediction samples may be generated by determining a prediction mode in units of PU, and in intra prediction, prediction samples may be generated in units of TU by determining a prediction mode in units of PU.

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

[0077] In the case of inter-frame prediction, the predictor 430 may derive a prediction sample of the current block based on a sample specified in a reference picture according to a motion vector. The predictor 430 may derive a prediction sample of the current block using one of a skip mode, a merge mode, and an MVP mode. Here, motion information required for inter-frame prediction of the current block provided by the video encoding device, for example, a motion vector and information about a reference picture index, may be acquired or derived based on information about prediction.

[0078] In the skip mode and the merge mode, the motion information of the neighboring blocks may be used as the motion information of the current block. Here, the neighboring blocks may include spatial neighboring blocks and temporal neighboring blocks.

[0079] The predictor 430 may construct a merge candidate list using the motion information of the available neighboring 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 may be signaled by the encoding device. The motion information may include a motion vector and a reference picture. When the motion information of the temporally neighboring blocks is used in the skip mode and the merge mode, the highest picture in the reference picture list may be used as the reference picture.

[0080] In case of skip mode, the difference (residual) between the predicted sample and the original sample is not sent, unlike merge mode.

[0081] In the case of the MVP mode, the motion vector of the current block may be derived using the motion vector of the neighboring block as a motion vector predictor. Here, the neighboring block may include a spatial neighboring block and a temporal neighboring block.

[0082] When the merge mode is applied, for example, the motion vector of the reconstructed spatial neighboring block and / or the motion vector corresponding to the Col block as the temporal neighboring block can be used to generate a merge candidate list. The motion vector of the candidate block selected from the merge candidate list is used as the motion vector of the current block in the merge mode. The above-mentioned information about the prediction may include a merge index indicating a candidate block having the best motion vector selected from the candidate blocks included in the merge candidate list. Here, the predictor 430 can derive the motion vector of the current block using the merge index.

[0083] When the MVP (motion vector prediction) mode is applied as another example, the motion vector of the reconstructed spatial neighboring block and / or the motion vector corresponding to the Col block as the temporal neighboring block may be used to generate a motion vector predictor candidate list. That is, the motion vector of the reconstructed spatial neighboring block and / or the motion vector corresponding to the Col block as the temporal neighboring block may be used as a motion vector candidate. The above-mentioned information about prediction may include a predicted motion vector index indicating the best motion vector selected from the motion vector candidates included in the list. Here, the predictor 430 may select the predicted motion vector of the current block from the motion vector candidates included in the motion vector candidate list using the motion vector index. The predictor of the encoding device may obtain a motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor, encode the MVD and output the encoded MVD in the form of a bitstream. That is, the MVD may be obtained by subtracting the motion vector predictor from the motion vector of the current block. Here, the predictor 430 may obtain the motion vector included in the information about prediction, and derive the motion vector of the current block by adding the motion vector difference to the motion vector predictor. In addition, the predictor may obtain or derive a reference picture index indicating a reference picture from the above-mentioned information about prediction.

[0084] The adder 440 may add the residual sample to the prediction sample to reconstruct the current block or the current picture. The adder 440 may reconstruct the current picture by adding the residual sample to the prediction sample in units of blocks. When the skip mode is applied, the residual is not sent, and thus the prediction sample may become a reconstructed sample. Although the adder 440 is described as a separate component, the adder 440 may be part of the predictor 430. At the same time, the adder 440 may be referred to as a reconstructor or a reconstructed block generator.

[0085] The filter 450 may apply deblocking filtering, sample adaptive offset and / or ALF to the reconstructed picture. Here, sample adaptive offset may be applied in units of samples after deblocking filtering. ALF may be applied after deblocking filtering and / or applying sample adaptive offset.

[0086] The memory 460 may store reconstructed pictures (decoded pictures) or information required for decoding. Here, the reconstructed pictures may be reconstructed pictures filtered by the filter 250. For example, the memory 460 may store pictures for inter-frame prediction. Here, pictures for inter-frame prediction may be specified according to a reference picture set or a reference picture list. The reconstructed pictures may be used as reference pictures for other pictures. The memory 460 may output the reconstructed pictures in an output order.

[0087] Figure 5 Another example of a video decoding device to which the present disclosure is applicable is illustrated.

[0088] refer to Figure 5 , the video encoding device includes an intra-frame predictor, a reference smoother 500, a predictor 810, a post filter 520, an inverse quantizer 530, and an inverse transformer 540. Here, the intra-frame predictor may include the reference smoother 500, the predictor 510, and the post filter 520. The intra-frame predictor may derive a prediction sample of the current block by applying a directional mode or a non-directional mode based on neighboring reference samples of the current block. Here, the intra-frame prediction mode of the neighboring block may be used to determine the prediction mode to be applied to the current block.

[0089] Specifically, when intra prediction is applied to the current block, the reference smoother 500 can perform smoothing on the left neighboring samples and the upper neighboring samples used for intra prediction of the current block in the picture to which the current block belongs (hereinafter, referred to as the current picture) based on the size of the current block, the prediction mode, and the sample value. Therefore, visual artifacts of the prediction samples of the current block, which may occur due to the difference between the sample values ​​of the left neighboring samples and the upper neighboring samples, can be prevented.

[0090] The predictor 510 can derive the prediction sample based on the average or interpolation of the left neighboring samples and the upper neighboring samples of the current block (case (i)), or can derive the prediction sample based on the neighboring samples in the specific (prediction) direction of the prediction sample among the left neighboring samples and the upper neighboring samples (case (ii)). Case (i) can be called a non-directional mode or a non-angle mode, and case (ii) can be called a directional mode or an angle mode. In intra-frame prediction, the prediction mode may include, for example, 33 directional prediction modes and at least two non-directional modes. The non-directional mode may include a DC prediction mode and a plane mode. The predictor 510 may use the prediction mode applied to the neighboring blocks to determine the prediction mode to be applied to the current block.

[0091] The post filter 520 may selectively perform post-processing filtering to mitigate discontinuity between the current block and neighboring samples according to the prediction mode from which the prediction sample of the current block is derived. Thereafter, the inverse quantizer 530 may inversely quantize the quantized transform coefficients received from the encoding device, and the inverse transformer 540 may inversely transform the inversely quantized transform coefficients to generate residual samples in units of blocks. The decoding device may restore the current block encoded based on intra-frame prediction based on the residual samples and the prediction samples.

[0092] Figure 6 An example of a process of performing intra prediction in a decoding device is illustrated. The decoding device entropy decodes the entropy encoding information received through the bitstream to obtain quantized transform coefficients (S600). Next, the decoding device may inversely quantize the quantized transform coefficients to obtain transform coefficients (S610), and inversely transform the transform coefficients to generate residual samples in units of blocks (S620). Next, the decoding device may perform intra prediction to generate prediction samples of the current block (S630). The prediction samples may be referred to as prediction signals or intra prediction signals. Specifically, the decoding device may perform smoothing on the left neighboring samples and the upper neighboring samples for intra prediction of the current block based on the size, prediction mode, and sample value of the current block (S640). Thereafter, the decoding device may perform prediction according to the intra prediction mode to generate prediction samples as described above (S650), and perform post-processing filtering to reduce the discontinuity between the current block and the neighboring samples (S660). The decoding device may add the prediction samples and the residual samples to generate the reconstructed samples of the current block (S670).

[0093] When prediction is performed on the current block as described above, the prediction may be performed based on an intra prediction mode. For example, intra prediction may be performed based on neighboring samples that have been encoded / decoded at the decoding time of the current block. That is, the prediction samples of the current block may be reconstructed using the left neighboring samples and the upper neighboring samples of the current block. The left neighboring samples and the upper neighboring samples may be as follows: Figure 1 As shown in .

[0094] Figure 7An example of a left neighboring sample and an upper neighboring sample for intra prediction of a current block is illustrated. When intra prediction is performed on a current block, an intra prediction mode for the current block may be derived, and at least one of the left neighboring sample and the upper neighboring sample may be used to generate a prediction sample related to the current block according to the intra prediction mode. The left neighboring sample and the upper neighboring sample for intra prediction of the current block may be subjected to smoothing based on the size, prediction mode, and sample value of the current block. That is, filtering may be performed based on the size, prediction mode, and sample value of the current block to reduce the difference between the sample values ​​of the left neighboring sample and the upper neighboring sample. Therefore, visual artifacts of the prediction sample of the current block, which may occur due to the difference between the sample values ​​of the left neighboring sample and the upper neighboring sample, may be prevented.

[0095] Here, the intra prediction mode may include two non-directional intra prediction modes and 33 directional intra prediction modes. The non-directional intra prediction mode may include a plane intra prediction mode and a DC intra prediction mode, and the directional intra prediction mode may include intra prediction modes #2 to #34. The plane intra prediction mode may be referred to as a plane mode, and the DC intra prediction mode may be referred to as a DC mode. Intra prediction mode #10 may indicate a horizontal intra prediction mode or a horizontal mode, and intra prediction mode #26 may indicate a vertical intra prediction mode or a vertical mode, based on which the prediction direction of the directional intra prediction mode may be expressed by an angle. In other words, the relative angle corresponding to each intra prediction mode may be expressed with reference to the horizontal reference angle 0° corresponding to intra prediction mode #10, and the relative angle corresponding to each intra prediction mode may be expressed with reference to the vertical reference angle 0° corresponding to intra prediction mode #26.

[0096] In addition, the demand for high-quality video is increasing, and in order to improve the efficiency of the video codec, the number of directional intra prediction directions may be increased to 65. That is, the intra prediction mode may include two non-directional intra prediction modes and 65 directional intra prediction modes. The non-directional intra prediction mode may include a plane intra prediction mode and a DC intra prediction mode, and the directional intra prediction mode may include intra prediction modes #2 to #66.

[0097] Figure 8 The intra direction modes of 65 prediction directions are shown.

[0098] refer to Figure 8 , the intra prediction mode having a horizontal directionality and the intra prediction mode having a vertical directionality can be classified based on the intra prediction mode #34 having an upper left diagonal prediction direction. Figure 8H and V in represent horizontal directivity and vertical directivity, respectively, and numbers from -32 to 32 represent displacements of 1 / 32 units at sample grid positions. Intra-prediction modes #2 to #33 have horizontal directivity, and intra-prediction modes #34 to #66 have vertical directivity. Intra-prediction mode #18 and intra-prediction mode #50 represent horizontal intra-prediction mode and vertical intra-prediction mode, respectively, based on which the prediction direction of the angular intra-prediction mode can be expressed by an angle. In other words, the relative angle corresponding to each intra-prediction mode can be expressed based on the horizontal reference angle 0° corresponding to intra-prediction mode #18, and the relative angles corresponding to the respective intra-prediction modes can be expressed based on the vertical reference angle 0° corresponding to intra-prediction mode #50.

[0099] In the case where a directional intra prediction mode is applied to a current block, relative to a target sample in the current block for performing intra prediction, a prediction sample of the target sample can be derived based on a reference sample located in the prediction direction of the directional intra prediction mode. That is, the reference sample located in the prediction direction can be copied and derived as a prediction sample. Here, relative to the target sample among the upper neighboring samples and the left neighboring samples of the current block, the reference sample can represent a neighboring sample located in the prediction direction of the directional intra prediction mode. At the same time, when there is no reference sample in units of integer samples in the prediction direction of the directional intra prediction mode based on the target sample, that is, when the position of the reference sample located in the prediction direction of the directional intra prediction mode based on the target sample is a fractional sample position, the sample value of the reference sample can be derived by interpolation between integer samples adjacent to the left and right of the reference sample, and the prediction sample of the target sample can be derived based on the reference sample. For example, interpolation between integer samples can be performed based on the distance ratio between the reference sample and the integer sample.

[0100] Fig. 9 is a diagram illustrating an example of deriving a prediction sample of a target sample based on integer samples adjacent to the left and right of the reference sample when the position of the reference sample located in the prediction direction of the directional intra prediction mode is a fractional sample position.

[0101] refer to Fig. 9 , the fractional sample position of the reference sample located in the prediction direction of the directional intra prediction mode based on the target sample can be derived as tanθ*(y+1). The tanθ value for each angle θ of each directional intra prediction mode used to calculate the fractional sample position can be pre-scaled and defined in integer units to facilitate the calculation. As shown in the following table, the tanθ values ​​for each scaled directional intra prediction mode can be derived.

[0102] [Table 1]

[0103] predModeIntra 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 intraPredAngle - 32 29 26 23 21 19 17 15 13 11 9 7 5 3 2 1 predModeIntra 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 intraPredAngle 0 1 2 3 5 7 9 11 13 15 17 19 21 23 26 29 32 predModeIntra 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 intraPredAngle 29 26 23 21 19 17 15 13 11 9 7 5 3 2 1 0 1 predModeIntra 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 intraPredAngle 2 3 5 7 9 11 13 15 17 19 21 23 26 29 32

[0104] Here, predModeIntra- can represent each directional intra prediction mode, and intraPredAngle can represent the prediction angle of each directional intra prediction mode or the scaled tanθ approximation of each directional intra prediction mode. The tanθ approximation according to the predefined intra prediction mode can be derived based on Table 1. At the same time, the tanθ of each scaled directional intra prediction mode can be derived as shown in the following table -1 θ value.

[0105] [Table 2]

[0106] predModeIntra 19 20 21 22 23 24 25 26 invAngle -8192 -4095 -2731 -1638 -1170 -910 -745 -630 predModeIntra 27 28 29 30 31 32 33 34 invAngle -546 -482 -431 -390 -356 -315 -282 -256 predModeIntra 35 36 37 38 39 40 41 42 invAngle -282 -315 -356 -390 -431 -482 -546 -630 predModeIntra 43 44 45 46 47 48 49 invAngle -745 -910 -1170 -1638 -2731 -4096 -8192

[0107] Here, predModeIntra can represent each directional intra prediction mode, and intraPredAngle can represent the inverse prediction angle of each directional intra prediction mode or the scaled tan of each directional intra prediction mode. -1 θ approximation. Tan according to the predetermined intra prediction mode based on Table 2 can be derived -1 Approximate value of θ.

[0108] At the same time, a non-directional intra prediction mode can be applied to the current block. The non-directional intra prediction mode may include a plane intra prediction mode and a DC intra prediction mode. The plane intra prediction mode may be referred to as a plane mode, and the DC intra prediction mode may be referred to as a DC mode. In the DC mode, a prediction sample of the current block may be derived based on the average value of neighboring samples of the current block. When the values ​​of the samples of the current block are similar, intra prediction based on the DC mode may be effectively performed. At the same time, when intra prediction is performed based on the DC mode when the values ​​of the samples of the current block change, discontinuity may occur between the prediction block of the current block and the neighboring samples. In similar cases, even when intra prediction is performed based on a directional intra prediction mode, an unintended visible contour may occur. The plane mode has been designed to overcome this problem. The plane mode indicates a prediction mode in which horizontal linear prediction and vertical linear prediction are performed based on a reference sample about a target sample, and then the derived values ​​are averaged to generate a prediction sample of the target sample.

[0109] When prediction is performed on the current block based on the directional intra prediction mode, if there is no reference sample in units of integer samples in the prediction direction of the directional intra prediction mode of the current block relative to the target sample of the current block as described above, that is, when the position of the reference sample located in the prediction direction of the directional intra prediction mode relative to the target sample is a fractional sample position, the reference sample can be derived by interpolation of left and right integer samples of the reference sample, and the prediction sample of the target sample can be derived based on the derived reference sample. The integer sample may indicate a neighboring sample of an integer sample position located near the reference sample.

[0110] In this case, the interpolation between the integer samples on the left and right sides of the reference sample can be derived based on one of various interpolation filters. For example, interpolation can be performed based on an interpolation filter with a low-pass filter effect, or interpolation can be performed based on a complex interpolation filter. The interpolation filter with a low-pass filter effect can represent a linear filter or a Gaussian filter, and the complex interpolation filter can represent a spline filter. The spline filter can also be called a cubic filter. The interpolation filter can be a 4-tap interpolation filter. The 4-tap interpolation filter can represent a filter that performs interpolation on four integer samples based on four weights. The interpolation between integer samples performed based on the interpolation filter can be represented by the following equation.

[0111] [Equation 1]

[0112] p[x][y]=(f[0]*ref[x+ildx]+f[1]*ref[x+iIdx+1]+f[2]*ref[x+iIdx+2]+f[3]*ref[x+iIdx+3]+128)>>8Here, p[x][y] can represent the predicted sample of the target sample, f[0], f[1], f[2]

[0113] and f[3] may represent filter coefficients of an interpolation filter, ref[n] may represent an nth neighboring sample, and iIdx may represent an integer index of a fractional sample position in a prediction direction of an intra prediction mode of a current block relative to a target sample. The integer index of the fractional sample position may represent an integer value excluding a remainder of the fractional sample position.

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

[0115] [Table 3]

[0116]

[0117] Here, the sub-pixel position n / 32 may represent a residual value of a fractional sample position in the prediction direction of the intra prediction mode of the current block relative to the target sample. Based on the fractional sample position of the target sample and Table 3 above, the filter coefficients of the cubic filter or the filter coefficients of the Gaussian filter may be derived.

[0118] When prediction is performed on the current block based on the directional intra prediction mode as described above, the distance between the target sample and the reference sample of the current block may increase according to the prediction angle of the directional intra prediction mode, and as the distance increases, the accuracy of the prediction may decrease. A method for selecting a suitable 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 to improve the prediction accuracy may be proposed. The method of selecting a suitable interpolation filter according to the distance between the target sample and the reference sample may be as follows.

[0119] For example, an interpolation filter may be selected based on the size of the current block or the intra prediction mode of the current block. As described above, the distance between the target sample and the reference sample of the current block may be derived based on the slope of the prediction angle of the intra prediction mode of the current block. Because the reference sample of the current block is derived based on the left neighboring sample and the upper neighboring sample of the current block, the distance between the target sample and the reference sample may be greater as the position of the target sample is closer to the lower right end of the current block. In addition, as the intraPredAngle value of the directional intra prediction mode defined in Table 1 increases, the slope of the prediction angle may approach 45°. As the slope of the prediction angle approaches 45°, the distance between the target sample and the reference sample may increase, and therefore, as the intraPredAngle value increases, the distance between the target sample and the reference sample may increase.

[0120] In addition, the distance between the target sample and the reference sample can be derived based on the size of the current block. That is, as the size of the current block increases, the distance between the target sample and the reference sample may increase. Therefore, the size of the current block is considered to be closely related to the prediction accuracy of the target sample.

[0121] As mentioned above, if the value of intraPredAngle is greater than 0 and less than 32, the target sample can be predicted based on the reference sample at the fractional sample position, such as Fig. 9 In this case, since there are only integer sample values ​​near the fractional sample position, the coding device can predict the reference sample of the fractional sample position based on the interpolation filter and the value of the reference sample of the predicted fractional sample position can be copied as the sample value of the predicted sample of the target sample. Therefore, the accuracy of the predicted block of the current block can be determined according to the accuracy of the interpolation filter.

[0122] When intra prediction is applied to the current block, information available for intra prediction may be limited to the left neighboring samples and the upper neighboring samples of the current block that have been reconstructed when decoding the current block, and as the distance between the target sample and the reference sample of the current block increases, the correlation between the target sample and the reference sample derived based on the left neighboring samples and the upper neighboring samples may be greatly reduced.

[0123] Therefore, when the distance between the target sample and the reference sample is too long, a method for deriving the reference sample based on an interpolation filter with a low-pass filter effect so that the artifact or noise of the reference sample does not propagate can be used to enhance the accuracy prediction and coding efficiency. On the contrary, when the distance between the target sample and the reference sample is close to each other, the correlation between the target sample and the reference sample is high, and therefore, a method for deriving the reference sample based on accurate interpolation so that the similarity between the prediction samples of the target sample and the reference sample is maintained at the maximum possible degree can be advantageously used. That is, when the distance between the target sample and the reference sample is close to each other, the method for deriving the reference sample based on a complex interpolation filter can improve the prediction accuracy and coding efficiency.

[0124] Thus, the current block may be selected based only on the size of the current block for deriving reference samples for target samples of the current block, may be selected based only on the intra prediction mode of the current block, or may be selected based on both the size of the current block and the intra prediction mode.

[0125] For example, when the size of the current block is 4×4 and intra prediction is performed on the current block, the correlation between the current block having the size of 4×4 and the neighboring samples of the current block may be very high, and therefore, regardless of the intra prediction mode, the reference sample may be derived based on a complex interpolation filter. Alternatively, if the intraPredAngle value 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 may increase, and therefore, the reference sample may be derived based on an interpolation filter having an interpolation filter effect. Alternatively, when the size of the current block is less than a specific size and the intraPredAngle value of the intra prediction mode of the current block is less than a specific value, the reference sample of the target sample may be derived based on a complex interpolation filter, and in other cases, the reference sample of the target sample may be derived based on an interpolation filter having a low-pass filter effect.

[0126] In addition, when the most probable mode (MPM) mode is applied to the current block to derive the intra prediction mode of the current block based on the neighboring blocks of the current block and the prediction mode of the current block is a directional intra prediction mode, rather than a planar mode or a DC mode, the interpolation filter used in the neighboring block selected by the MPM mode may be derived as the interpolation filter of the current block. Here, in the case where the MPM mode is applied to the current block, the coding device may determine the MPM list based on the intra prediction mode of the left or upper neighboring block with respect to the current block, and determine the intra prediction mode based on the MPM list.

[0127] In addition, when selecting an interpolation filter based on an intra prediction mode of a current block, a reference of the intra prediction mode, that is, a reference for determining whether an interpolation filter having a low pass filter is used or a complex interpolation filter is used may vary according to the size or form of the current block.

[0128] If the current block is a square block, the width and height of the block are equal, that is, the size of the current block is N×N, and therefore, the size of the reference block when selecting the interpolation filter may be N for the directional intra prediction mode of any direction. Meanwhile, in the case where the current block has a non-square shape, that is, in the case where the current block size is M×N, if the mode selected as the prediction mode of the current block is a directional intra prediction mode and the mode is a vertical directivity prediction mode, the size of the reference block used to select the interpolation filter may be represented by M. Here, when the intra prediction mode includes 65 directional intra prediction modes and 2 non-directional intra prediction modes, the vertical directivity prediction mode may indicate intra prediction modes #34 to #66. Similarly, when the size of the current block is M×N, the mode selected as the prediction mode of the current block is a directional mode, and the mode is a horizontal directivity prediction mode, the size of the current block used as a reference for selecting the interpolation filter may be N. Here, when the intra prediction mode includes 65 directional intra prediction modes and two non-directional intra prediction modes, the horizontal directional prediction mode may represent intra prediction modes #2 to #33.

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

[0130] In addition, if the intraPredAngle value of the intra prediction mode of the current block is less than or equal to 11, a complex interpolation filter is selected, and the reference sample can be derived based on the complex interpolation filter. If the intraPredAngle value of the intra prediction mode of the current block is greater than 11, an interpolation filter with a low-pass filter effect is selected, and the reference sample can be derived based on the interpolation filter with the low-pass filter effect.

[0131] In the case where the value of the current block size is equal to or greater than 16, if the intraPredAngle value of the intra prediction mode of the current block is less than or equal to 5, a complex interpolation filter is selected, and the reference sample can be derived based on the complex interpolation filter. If the intraPredAngle value of the intra prediction value of the current block is greater than 5, an interpolation filter having a low-pass filter effect is selected, and the reference sample can be derived based on the interpolation filter having the low-pass filter effect.

[0132] Fig.10 The diagram shows an example of selecting an interpolation filter based on the size of the current block and the intra prediction mode. The encoding device / decoding device can derive the intra prediction mode of the current block and can determine whether the intra prediction mode is a directional intra prediction mode (S1000). The directional intra prediction mode can be called an angular prediction. If the intra prediction mode is a non-directional intra prediction mode, the encoding / decoding device can perform intra prediction on the current block based on the intra prediction mode.

[0133] When the intra prediction mode is a directional intra prediction mode, the encoding device / decoding device may determine whether the size of the current block is less than a first threshold value (S1010). When the current block is a non-square block having an M×N size and the mode selected as the intra prediction mode of the current block includes an intra prediction mode having a vertical directivity, that is, when the intra prediction mode includes 65 directional intra prediction modes and 2 non-directional intra prediction modes, if the intra prediction mode of the current block is one of intra prediction modes #34 to #66, the reference for selecting the interpolation filter may be represented by the width of the current block, that is, M. Similarly, in the case where the current block is a non-square block having an M×N size and the mode selected as the intra prediction mode of the current block is an intra prediction mode having a horizontal directivity, that is, when the intra prediction mode includes 65 directional intra prediction modes and two non-directional intra prediction modes, if the intra prediction mode of the current block is one of intra prediction modes #2 to #33, the reference for selecting the interpolation filter may be represented by the height of the current block, that is, N. Alternatively, when only blocks having a square shape are considered and the size of the current block is N×N, the value of the size of the current block may be represented by N. The first threshold may be set to 4, 8, 16, 32, or the like.

[0134] If the size of the current block is not less than the 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 of the current block, and derive a reference sample of the 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 the reference sample of the target sample can 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 derive a reference sample of the target sample in the current block based on the linear filter. Here, the reference sample can be based on the target sample indicating a neighboring sample located in the prediction direction of the directional intra-frame prediction mode of the current block.

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

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

[0137] If the intraPredAngle of the directional intra prediction mode of the current block is less than the second threshold, the encoding device / decoding device may select a cubic filter as the interpolation filter of the current block, and derive a reference sample of the target sample of the current block based on the cubic filter (S1040). Here, the cubic filter may be one of the complex interpolation filters described above, and the reference sample of the target sample may be derived based on a complex interpolation filter other than the cubic filter. In addition, the cubic filter may be called a spline filter.

[0138] The encoding device / decoding device may generate a prediction sample of the target sample based on the reference sample of the derived target sample (S1050). The encoding device / decoding device may generate the prediction sample by copying the reference sample. The reference sample may be copied and used as the prediction sample, and therefore, it may be indicated that the prediction sample is generated based on the interpolation filter.

[0139] Meanwhile, in addition to the above-described example, a method of dividing the current block into arbitrary regions and selecting an interpolation filter for each region may be proposed as a method of selecting an interpolation filter.

[0140] For example, if 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 the interpolation filter of each region can be selected in consideration of the distance between each region and the neighboring samples of the current block. The size of the divided region of the current block can be a fixed value predetermined (i.e., pre-set) between the encoding device and the decoding device, or can be derived based on the size of the current block, the intra prediction mode, and the like. For example, in the case where the intra prediction mode of the current block is an intra prediction mode with vertical directivity and the mode number of the intra prediction mode is greater than #34, the size of the divided region of the current block can be derived as 4×4. In other words, in the case where the intra prediction mode of the current block is one of the intra prediction modes #35 to #66, the size of the divided region of the current block can be derived as 4×4. In the case where the current block is a block with a size of 16×16, the current block can be divided into regions with a size of 4×4, the above-mentioned complex interpolation filter can be selected as the interpolation filter of the regions from #0 to #7 in the raster scanning order, and the interpolation filter with a low-pass filtering effect can be selected as the interpolation filter of other regions. Here, the number of 16 regions with a size of 4×4 according to the raster scan order can be sequentially derived from the upper row to the next row, and sequentially derived from left to right in each row. That is, the regions included in the first row among the 16 regions with a size of 4×4 of the current block 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. At the same time, the size of the divided region of the current block and the information indicating the interpolation filter used for each region can be sent by a signal. In this case, the decoding device can divide the current block into a plurality of regions based on the information and select the interpolation filter for each region.

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

[0142] For example, in the case where the size of the current block is N×N, if the distance between the target sample of the current block and the reference sample 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 complex 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 be derived based on the intra-frame prediction mode of the current block, whether the current block is a square block / non-square block, etc. Alternatively, information about the specific threshold can be sent from the encoding device, and the decoding device can derive the specific threshold of the current block based on the information about the received specific threshold.

[0143] Fig.11 The diagram 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 may derive the intra prediction mode of the current block and determine whether the intra prediction mode is a directional intra prediction mode (S1100). The directional intra prediction mode may be referred to as an angular prediction. If the intra prediction mode is a non-directional intra prediction mode, the encoding / decoding device may perform intra prediction on the current block based on the intra prediction mode.

[0144] If the intra prediction mode is a directional intra prediction mode, the encoding device / decoding device may determine whether the distance between the target sample of the current block and the reference sample is less than a threshold value (S1110). The reference sample may represent a neighboring sample located in the prediction direction of the intra prediction mode of the current block based on the target sample. In addition, as described above, the threshold value may be derived based on the size of the current block, the intra prediction mode of the current block, whether the block is a square / non-square block, etc. In addition, information about the threshold value may be sent with a signal, and the threshold value of the current block may be derived based on the information about the threshold value sent with the signal.

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

[0146] If the distance between the target sample of the current block and the reference sample is less than the threshold, the encoding device / decoding device may select a cubic filter as the interpolation filter of the current block and derive the reference sample based on the cubic filter (S1130). Here, the cubic filter may be one of the complex interpolation filters described above, and the reference sample of the target sample may be derived based on a complex interpolation filter other than the cubic filter. In addition, the cubic filter may be called a spline filter.

[0147] The encoding device / decoding device may generate a prediction sample of the target sample based on the reference sample of the derived target sample (S1140). The encoding device / decoding device may generate the prediction sample by copying the reference sample. The reference sample may be copied and used as the prediction sample, and therefore, it may be indicated that the prediction sample is generated based on the interpolation filter.

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

[0149] For example, when the reference sample position of the target sample of the current block is a fractional sample position, that is, when the reference sample of the target sample is a fractional sample, the first reference sample can be generated based on the first interpolation filter as a complex interpolation filter, the second reference sample can be generated based on the second interpolation filter as an interpolation filter having the above-mentioned low-pass filter effect, and the third reference sample can be generated based on the third interpolation filter as an interpolation filter different from the first interpolation filter and the second interpolation filter. When generating the first reference sample, the second reference sample, and the third reference sample, the prediction 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 value of the first reference sample and the second reference sample can be derived as the prediction sample of the target sample, the average value of the first reference sample and the third reference sample can be derived as the prediction sample of the target sample, the average value of the second reference sample and the third reference sample can be derived as the prediction sample of the target sample, or the average value of the first reference sample, the second reference sample, and the third reference sample can be derived as the prediction sample of the target sample.

[0150] Alternatively, the prediction sample of the target sample may be derived by a weighted average of the first reference sample and the second reference sample, that is, a weighted sum of the first reference sample and the second reference sample. Alternatively, the prediction sample of the target sample may be derived by a weighted sum of the first reference sample and the third reference sample, by a weighted sum of the second reference sample and the third reference sample, or by a weighted sum of the first reference sample, the second reference sample, and the third reference sample. Alternatively, the prediction sample of the target sample may be derived by a weighted sum of the first reference sample, the second reference sample, and the third reference sample. The prediction sample of the target sample may be generated based on the above examples and combinations of the first reference sample, the second reference sample, and / or the third reference sample other than the above examples.

[0151] Specifically, for example, the prediction sample of the target sample can be generated as follows. If a directional intra prediction mode in which intra prediction is performed based on a reference sample at a fractional sample position is performed on the current block, the neighboring samples at the integer sample position can be interpolated based on a cubic filter so that a first reference sample can be derived, the neighboring samples at the integer sample position can be interpolated based on a Gaussian filter so that a second reference sample of the target sample can be derived, and the prediction 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 represent one of the directional intra prediction modes other than intra prediction modes #2, #18, #34, #50, and #66. In addition, based on the target sample among the neighboring samples of the current block, the neighboring samples at the integer sample position can represent neighboring samples near the fractional sample position in the prediction direction of the directional intra prediction mode of the current block.

[0152] In another example, as the distance between the target sample and the reference sample decreases, the prediction accuracy of the intra prediction is higher, and therefore, a method can be proposed, which is based on the distance between the target sample and the reference sample, derives a first weight of a first reference sample generated based on a first interpolation filter as a complex interpolation filter and a second weight of a second reference sample generated based on a second interpolation filter as an interpolation filter with a low-pass filtering effect, and weighted sums the first reference sample and the second reference sample based on the first weight and the second weight to generate a prediction sample of the target sample. For example, the first weight can be derived as inversely proportional to the distance between the target sample and the reference sample, and the second weight can be derived as a value obtained by subtracting the first weight from 1. Alternatively, in order to avoid decimal point calculations, the first weight and the second weight used here can be enlarged in integer units. Therefore, as the distance between the target sample and the reference sample increases, the first weight can be derived as a larger value, and as the distance between the target sample and the reference sample increases, the first weight can be derived as a smaller value. 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 about the size of the block and the intra-frame prediction mode can be stored, and the distance between the target sample and the reference sample can be derived with reference to the table. At the same time, the method for deriving the reference sample of the target sample based on multiple interpolation filters disclosed in the above embodiment can be selectively applied. For example, whether to derive the reference sample of the target sample based on multiple interpolation filters can be derived based on the size of the current block, the intra-frame prediction mode of the current block, the variance of the values ​​of the neighboring samples of the current block, etc. Alternatively, an indication of whether to derive the reference sample of the target sample based on multiple interpolation filters from the encoding device can be sent, and whether to derive the reference sample of the target sample based on multiple interpolation filters can be determined based on the flag.

[0153] Fig.12 The diagram illustrates an example of deriving a reference sample of a target sample of a current block based on a plurality of interpolation filters and deriving a predicted sample of the target sample based on the reference sample. The encoding device / decoding device may derive an intra prediction mode of the current block and determine whether the intra prediction mode is a directional intra prediction mode (S1200). The directional intra prediction mode may be referred to as an angular prediction.

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

[0155] When the intra prediction mode is a directional intra prediction mode, the encoding device / decoding device may interpolate neighboring samples at integer sampling positions based on a cubic filter to derive a first reference sample of the target sample (S1220). Here, the neighboring samples of the integer sampling position may represent neighboring samples of the current block that are located near the fractional sampling position in the prediction direction of the directional intra prediction mode of the current block relative to the target sample. The encoding device / decoding device may perform intra prediction of the target sample based on the first reference sample (S1230). The encoding device / decoding device may generate a first temporary prediction sample by copying the first reference sample.

[0156] When the intra prediction mode is a directional intra prediction mode, the encoding device / decoding device interpolates the neighboring samples of the integer sampling position based on a Gaussian filter to derive a second reference sample of the target sample (S1240). The encoding device / decoding device may perform intra prediction of the target sample based on the second reference sample (S1250). The encoding device / decoding device may generate a second temporary prediction sample by copying the second reference sample.

[0157] The encoding device / decoding device may perform weighted summation on the first temporary prediction sample and the second temporary prediction sample to derive a prediction sample of the target sample (S1250). The prediction sample may be derived as the sum of a value obtained by multiplying the first weight α of the first temporary prediction sample by the first temporary prediction sample and a value obtained by multiplying 1-α of the second temporary prediction sample by the second temporary prediction sample. As described above, the first weight may be derived so that it is inversely proportional to the distance between the target sample and the reference sample as described above, and the second weight may be derived as a value obtained by subtracting the first weight from 1. Alternatively, in order to avoid decimal point calculations, the first weight and the second weight used herein may be amplified and derived in integer units. The distance between the target sample and the reference sample may be calculated based on the prediction angle of the intra-frame prediction mode of the current block and the position of the target sample. Alternatively, a table regarding the size of the block and the intra-frame prediction mode may be pre-stored, and the distance between the target sample and the reference sample may be derived with reference to the table.

[0158] Fig.13 The video encoding method of the encoding device according to the present disclosure is schematically illustrated. Fig.13 The method disclosed in can be Figure 1 Specifically, for example, Fig.13 Steps S1300 to S1340 may be performed by a predictor of the encoding device and S1350 may be performed by an entropy encoder of the encoding device.

[0159] The encoding device determines the intra prediction mode of the current block (S1300). The encoding device can perform various intra prediction modes to derive the intra prediction mode with the best RD cost as the intra prediction mode of the current block. The intra prediction mode can be one of two non-directional prediction modes and 33 directional prediction modes. As described above, the two non-directional prediction modes may include a DC intra mode and a plane intra mode. Optionally, the intra prediction mode may be one of two non-directional intra prediction modes and 65 directional intra prediction modes. As described above, the two non-directional prediction modes may include a DC intra mode and a plane intra mode. In addition, 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 intra prediction mode #34 to intra prediction mode #66, and the horizontal directional intra prediction mode may include intra prediction mode #2 to intra prediction mode #33.

[0160] The encoding device derives neighboring samples including the left neighboring samples and the upper neighboring samples of the current block (S1310). The encoding device can derive neighboring samples of the current block. The neighboring samples may include left neighboring samples and upper neighboring samples. In addition, the neighboring samples may include upper left samples. The left neighboring samples, the upper left neighboring samples, and the upper neighboring samples may be derived from the neighboring blocks that have been reconstructed when decoding the current block. The 2N upper neighboring samples, the upper left neighboring samples, and the 2N left neighboring samples of the current block may be derived. If the size of the current block is N×N and the x component of the upper left sample of the current block is 0 and its y component is 0, the left neighboring sample may be p[-1][0] to p[-1][2N-1], the upper left neighboring sample may be p[-1][-1], and the upper neighboring sample may be p[0][-1] to p[2N-1][-1].

[0161] Alternatively, when the size of the current block is M×N and the x component of the upper left sample of the current block is 0 and the y component thereof is 0, M+N upper neighboring samples, upper left neighboring samples, and MN left neighboring samples of the current block may be derived. If the size of the current block has a non-square form of M×N and the x component of the upper left corner sample of the current block is 0 and the y component thereof is 0, the left neighboring sample may be p[-1][0] to p[-1][M+N-1], the upper left neighboring sample may be p[-1][-1], and the upper neighboring sample may be p[0][-1] to p[M+N-1][-1].

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

[0163] The encoding device determines an interpolation filter for the target sample (S1330). The encoding device may determine the interpolation filter for the target sample based on the size of the current block and / or the intra prediction mode of the current block. Moreover, for example, when the position of the reference sample is a fractional sample position, that is, for example, when multiple reference samples are derived, the interpolation filter may be determined.

[0164] For example, the interpolation filter for the target sample may be determined based on the size of the current block. For example, if the size of the current block is 4×4, a complex interpolation filter may be determined as the interpolation filter of the target sample. Specifically, when the size of the current block is 4×4, a cubic filter may be determined as the interpolation filter of the target sample. The cubic filter is one of the complex interpolation filters, and the cubic filter may be called a spline filter.

[0165] If the current block is a square block, the width and the height are equal to each other. That is, because the current block is a square block with an N×N size, for the directional intra prediction mode of any prediction direction, the reference size (i.e., reference value) when selecting the interpolation filter may be N. Meanwhile, if the current block is a non-square block, that is, if the current block is a non-square block with an M×N size, when the intra prediction mode of the current block is an intra prediction mode with vertical directivity, the size of the reference block for selecting the interpolation filter (i.e., reference value) may be M. Similarly, if the current block is a non-square block with an M×N size and the intra prediction mode of the current block is an intra prediction mode with horizontal directivity, the size of the current block as a reference for selecting the interpolation filter (i.e., reference value) may be N. Alternatively, on the contrary, if the current block has an M×N size and the intra prediction mode of the current block is an intra prediction mode with vertical directivity, the interpolation filter of the current block can be selected based on N, and similarly, if the current block is a non-square block with an M×N size and the intra prediction mode of the current block is an intra prediction mode with horizontal directivity, the interpolation filter of the current block can be selected based on M. However, in a specific example described later, when a prediction mode with vertical directivity is applied to a current block with an M×N size, the size of the current block as a reference for selecting an interpolation filter can be represented by M, and similarly, if an intra prediction mode with horizontal directivity 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 two non-directional intra prediction modes, the intra prediction mode with vertical directivity can represent intra prediction modes #34 to #66, and the intra prediction mode with horizontal directivity can represent intra prediction modes #2 to #33.

[0166] For example, it can be determined whether the size of the current block indicated by the shape of the current block and the directionality of the intra-frame prediction mode is less than a specific value. If the size of the current block is less than a specific value, a complex interpolation filter can be determined as the interpolation filter of the target sample, and if the size of the current block is not less than a specific value, an interpolation filter with a low-pass filter effect can be determined as the interpolation filter of the target sample. Specifically, when the size of the current block is less than a specific value, a cubic filter can be determined as the interpolation filter of the target sample. If the size of the current block is not less than a specific value, a Gaussian filter can be determined as the interpolation filter of the target sample. Alternatively, when the size of the current block is not less than a specific value, a linear filter can be determined as the interpolation filter of the target sample. The interpolation filter with a low-pass filter effect can include a Gaussian filter and a linear filter. Here, the specific value can be set to 4, 8, 16, 32, etc.

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

[0168] In addition, when the width and height of the current block are different (ie, when the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, it can be determined whether the width of the current block is less than a specific value. When the width of the current block is less than the specific value, the interpolation filter of the target sample can be derived as a cubic filter, and when the width of the current block is not less than the specific value, the interpolation filter of the target sample can be derived as a Gaussian filter.

[0169] In addition, when the width and height of the current block are different (ie, when the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, it can be determined whether the height of the current block is less than a specific value. When the height of the current block is less than the specific value, the interpolation filter of the target sample can be derived as a cubic filter, and when the height of the current block is not less than the specific value, the interpolation filter of the target block can be derived as a Gaussian filter.

[0170] In addition, when the width and height of the current block are different (ie, when the current block is a non-square block) and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, it can be determined whether the height of the current block is less than a specific value. When the height of the current block is less than the specific value, the interpolation filter of the target sample can be derived as a cubic filter, and when the height of the current block is not less than the specific value, the interpolation filter of the target sample can be derived as a Gaussian filter.

[0171] In addition, when the width and height of the current block are different (that is, when the current block is a non-square block and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directivity, it can be determined whether the width of the current block is less than a specific value. When the width of the current block is less than the specific value, the interpolation filter of the target sample can be derived as a cubic filter, and when the width of the current block is not less than the specific value, the interpolation filter of the target sample can be derived as a Gaussian filter.

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

[0173] For example, it can be determined whether the prediction angle of the intra prediction mode of the current block is less than a specific value. If the prediction angle of the intra prediction mode is less than a specific value, a complex interpolation filter can be determined as the interpolation filter of the target sample, and if the prediction angle of the intra prediction mode is not less than a specific value, an interpolation filter with a low-pass filtering effect can be determined as the interpolation filter of the target sample. Specifically, when the prediction angle of the intra prediction mode is less than a specific value, a cubic filter can be determined as the interpolation filter of the target sample, and when the prediction angle of the intra prediction mode is not less than a specific value, a cubic filter can be determined as the interpolation filter of the target sample. Alternatively, when the prediction angle of the intra prediction mode is not less than a 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 a Gaussian filter and a 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 the above Table 1, and intraPredAngle can indicate the prediction angle of the intra prediction mode. In addition, for example, the specific value may be set to 11.

[0174] In 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. If the current block is a square block, the width and height are equal to each other. That is, because the current block is a square block with an N×N size, for the directional intra prediction mode of any prediction direction, the reference size (i.e., reference value) when selecting the interpolation filter can be N. At the same time, if the current block is a non-square block, that is, if the current block is a non-square block with an M×N size, when the intra prediction mode of the current block is an intra prediction mode with vertical directivity, the size of the reference block for selecting the interpolation filter (i.e., reference value) can be M. Similarly, if the current block is a non-square block with an M×N size and the intra prediction mode of the current block is an intra prediction mode with horizontal directivity, the size of the current block as a reference for selecting the interpolation filter (i.e., reference value) can be N. Alternatively, on the contrary, if the current block is a non-square block with an M×N size and the intra-prediction mode of the current block is an intra-prediction mode with vertical directivity, the interpolation filter of the current block can be selected based on N, and similarly, if the current block is a non-square block with an M×N size and the intra-prediction mode of the current block is an intra-prediction mode with horizontal directivity, the interpolation filter of the current block can be selected based on M. However, in a specific example described later, when an intra-prediction mode with vertical directivity is applied to a current block with an M×N size, the size of the current block as a reference for selecting an interpolation filter can be represented by M, and similarly, if an intra-prediction mode with horizontal directivity 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 two non-directional intra-prediction modes, the intra-prediction mode with vertical directivity can represent intra-prediction modes #34 to #66, and the intra-prediction mode with horizontal directivity can represent intra-prediction modes #2 to #33.

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

[0176] Specifically, when the width and height of the current block are equal to each other, the encoding device may determine whether the width of the current block is less than a first specific value. When the width of the current block is not less than the first specific value, the encoding device may determine a Gaussian filter or a linear filter as an interpolation filter for the target sample.

[0177] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode having vertical directivity, the encoding device may determine whether the width of the current block is less than a first specific value. When the width of the current block is not less than the first specific value, the encoding device may determine a Gaussian filter or a linear filter as an interpolation filter for the target sample.

[0178] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, the encoding device may determine whether the height of the current block is less than a first specific value. When the height of the current block is not less than the first specific value, the encoding device may determine a Gaussian filter or a linear filter as an interpolation filter for the target sample.

[0179] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, the encoding device may determine whether the height of the current block is less than a first specific value. When the height of the current block is not less than the first specific value, the encoding device may determine a Gaussian filter or a linear filter as an interpolation filter for the target sample.

[0180] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directivity, the encoding device may determine whether the width of the current block is less than a first specific value. When the width of the current block is not less than the first specific value, the encoding device may determine a Gaussian filter or a linear filter as an interpolation filter for the target sample.

[0181] If the size of the current block is less than the first specific value, the encoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than the second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the encoding device may determine a complex interpolation filter as the interpolation filter of the target sample. Specifically, when the size of the current block is less than the first specific value, the encoding device may determine a cubic filter as the interpolation filter.

[0182] Specifically, when the width and height of the current block are equal and the width of the current block is less than a first specific value, the encoding device can determine whether the prediction angle of the current intra-frame prediction mode is less than a second specific value, and when the prediction angle of the intra-frame prediction mode is less than the second specific value, the encoding device can determine the cubic filter as the interpolation filter.

[0183] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, the encoding device may determine whether the width of the current block is less than a first specific value. If the width of the current block is less than the first specific value, the encoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the encoding device may determine a cubic filter as the interpolation filter.

[0184] If the width and height of the current block are different from each other, and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, the encoding device may determine whether the height of the current block is less than a first specific value. If the height of the current block is less than the first specific value, the encoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the encoding device may determine a cubic filter as the interpolation filter.

[0185] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, the encoding device may determine whether the height of the current block is less than a first specific value. If the height of the current block is less than the first specific value, the encoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the encoding device may determine a cubic filter as the interpolation filter.

[0186] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, the encoding device may determine whether the width of the current block is less than a first specific value. If the width of the current block is less than the first specific value, the encoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the encoding device may determine a cubic filter as the interpolation filter.

[0187] If the prediction angle of the intra-frame prediction mode is not less than the second specific value, the encoding device may determine an interpolation filter having a low-pass filter effect as the interpolation filter of the target sample. Specifically, if the prediction angle of the intra-frame prediction mode is not less than the second specific value, the encoding device may determine a Gaussian filter as the interpolation filter. Alternatively, if the prediction angle of the intra-frame prediction mode is not less than the second specific value, the encoding device may determine a linear filter as the interpolation filter.

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

[0189] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, the encoding device may determine whether the width of the current block is less than a first specific value. If the width of the current block is less than the first specific value, the encoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is not less than the second specific value, the encoding device may determine a Gaussian filter or a linear filter as the interpolation filter.

[0190] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, the encoding device may determine whether the height of the current block is less than a first specific value. If the height of the current block is less than the first specific value, the encoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is not less than the second specific value, the encoding device may determine a Gaussian filter or a linear filter as the interpolation filter.

[0191] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, the encoding device may determine whether the height of the current block is less than a first specific value. If the height of the current block is less than the first specific value, the encoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is not less than the second specific value, the encoding device may determine a Gaussian filter or a linear filter as the interpolation filter.

[0192] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, the encoding device may determine whether the width of the current block is less than a first specific value. If the width of the current block is less than the first specific value, the encoding device may determine whether the prediction angle of the intra prediction mode of the current block is not less than a second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the encoding device may determine a Gaussian filter or a linear filter as the interpolation filter.

[0193] In another example, the current block may be divided into a plurality of regions, and the interpolation filter of each region may be determined based on the distance between each region and the neighboring samples of the current block. In this case, the interpolation filter for the target sample may be derived as the interpolation filter of the region including the target sample. In addition, if the size of the current block is greater than or equal to a specific size, the current block may be divided into a plurality of regions. Specifically, the interpolation filter of the region that is closer to the neighboring samples of the current block than a specific value among the regions may be determined as a complex interpolation filter, and the interpolation filter of the region that is farther away from the neighboring samples of the current block than the specific value among the regions may be determined as an interpolation filter having a low-pass filter effect.

[0194] At the same time, the sizes of multiple regions divided from the current block can be preset. Alternatively, the sizes of multiple regions can be derived based on the size of the current block, the intra prediction mode, etc. For example, in the case where the intra prediction mode of the current block is one of the intra prediction modes #35 to #66, the size of the divided region of the current block can be derived as a 4×4 size. Here, if the current block is a block with a size of 16×16, the current block can be divided into regions with a size of 4×4, a complex interpolation filter can be determined as an interpolation filter for regions from #0 to #7 in a raster scan order, and an interpolation filter with a low-pass filtering effect can be determined as an interpolation filter for other regions. For example, the interpolation filter for the region from #0 to #7 in a raster scan order among the regions can be determined as a cubic filter, and the interpolation filter for other regions can be determined as a Gaussian filter or a linear filter. Here, the number of 16 regions with a size of 4×4 according to the raster scan order can be derived sequentially from the previous row to the next row, and sequentially from left to right in each row. That is, the regions included in the first row among the 16 regions having a size of 4×4 of the current block may be represented in order from left to right as region #0, region #1, region #2, and region #3, the regions included in the second row may be represented in order from left to right as region #4, region #5, region #6, and region #7, the regions included in the third row may be represented in order from left to right as region #8, region #9, region #10, and region #11, and the regions included in the fourth row may be represented in order from left to right as region #12, region #13, region #14, and region #15. At the same time, the size of the divided regions of the current block and information indicating an interpolation filter for each region may be generated.

[0195] In another example, the interpolation filter of the target sample can be determined based on the distance between the target sample and the reference sample. 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, the distance 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. Alternatively, the distance can be derived based on a predefined table for the size of the block and the intra prediction mode. Alternatively, the distance between the target sample and the reference sample can 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 the distance between the target sample and the reference sample can be derived based on the horizontal distance. For example, if 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. In addition, if 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.

[0196] For example, the encoding device may derive the distance between the target sample and the reference sample and determine whether the distance is less than a specific value. If the distance is less than a specific value, the encoding device may determine a complex interpolation filter as the interpolation filter of the target sample, and if the distance is not less than a specific value, the encoding device may determine an interpolation filter having a low-pass filter effect as the interpolation filter of the target sample. Specifically, if the distance is less than a specific value, the encoding device may determine a cubic filter as the interpolation filter of the target sample, and if the distance is not less than a specific value, the encoding device may determine a Gaussian filter or a linear filter as the interpolation filter of the target sample. The specific value may be derived based on the size of the current block. Alternatively, the specific value may be derived based on the intra-frame prediction mode of the current block, whether the current block is a square / non-square block, etc. For example, when the size of the current block is N×N, the specific value may be derived as N / 2. In addition, information about the specific value may be generated, entropy encoded, and transmitted.

[0197] In another example, multiple interpolation filters can be determined as the interpolation filters of the target sample. For example, the interpolation filter for the target sample can include one of the complex interpolation filters and one of the interpolation filters with a low-pass filter effect. Alternatively, the interpolation filter for the target sample can include one of the complex interpolation filters and two interpolation filters with a low-pass filter effect. Alternatively, the interpolation filter for the target sample can include two complex interpolation filters and one interpolation filter with a low-pass filter effect. Specifically, the interpolation filter for the target sample can include a cubic filter and a Gaussian filter.

[0198] 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 the filter coefficient of the interpolation filter based on the position of the target sample and the prediction angle of the intra-frame prediction mode, and can derive the predicted sample of the target sample based on the filter coefficient and the reference sample. For example, four neighboring samples among the neighboring samples of the current block can be derived as reference samples, 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 equation 1.

[0199] In addition, when multiple interpolation filters are determined as interpolation filters for target samples, the encoding device can derive (time) prediction samples based on each interpolation filter, and can derive prediction samples of target samples based on the derived (time) prediction samples. For example, the prediction samples of the target samples can be derived by averaging the (time) prediction samples, or can be derived by weighted summing the (time) prediction samples. At the same time, whether multiple interpolation filters are determined as interpolation filters for target samples can be derived based on the size of the current block, the intra-frame prediction mode of the current block, the variance of the neighboring sample values ​​of the current block, etc. In addition, a flag indicating whether multiple interpolation filters are determined as interpolation filters for target samples can be generated.

[0200] For example, the interpolation filter for the target sample may include a cubic filter and a Gaussian filter. In this case, the encoding device may derive the filter coefficient of the cubic filter based on the position of the target sample and the prediction angle of the intra-frame prediction mode, and may derive the filter coefficient of the Gaussian filter based on the position of the target sample and the prediction angle of the intra-frame prediction mode. The encoding device may derive the first prediction sample of the target sample based on the filter coefficient of the cubic filter and the reference sample, derive the second prediction sample of the target sample based on the filter coefficient of the Gaussian filter and the reference sample, and 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 by averaging the first prediction sample and the second prediction sample. Alternatively, the prediction sample of the target sample can be derived by weighted summing the first prediction sample and the second prediction sample. In this case, the weight of the first prediction sample may be inversely proportional to the distance between the target sample and the reference sample, and the weight of the second prediction sample may be derived as a value obtained by subtracting the weight of the first prediction sample from 1. Alternatively, the first weight and the second weight used here may be amplified and derived in integer units to avoid decimal point calculations.

[0201] In addition, for example, the interpolation filter for the target sample may include a cubic filter and a linear filter. In this case, the encoding device may derive the filter coefficient of the cubic filter based on the position of the reference sample, and may derive the filter coefficient of the linear filter based on the position of the reference sample. The encoding device may derive the first prediction sample of the target sample based on the filter coefficient of the cubic filter and the reference sample, may derive the second prediction sample of the target sample based on the filter coefficient of the linear filter and the reference sample, and 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 by averaging the first prediction sample and the second prediction sample. Alternatively, the prediction sample of the target sample can be derived by weighted summing the first prediction sample and the second prediction sample. In this case, the weight of the first prediction sample may be inversely proportional to the distance between the target sample and the reference sample, and the weight of the second prediction sample may be derived as a value obtained by subtracting the weight of the first prediction sample from 1. Alternatively, the first weight and the second weight used here may be amplified and derived in integer units to avoid decimal point calculations.

[0202] In another example, if the MPM (Most Probable Mode) mode is applied to the current block to derive the intra prediction mode of the current block based on the intra prediction mode of the neighboring blocks of the current block and the intra prediction mode of the current block is a directional intra prediction mode, rather than a plane mode or a DC mode, the interpolation filter for the target sample can be determined based on the neighboring block selected by the neighboring MPM mode. That is, the interpolation filter used in the neighboring block can be derived as the interpolation filter of the target sample. If the MPM mode is applied to the current block, the encoding device can determine the MPM list based on the intra prediction mode of the left or upper neighboring block for the current block, and can determine the intra prediction mode based on the MPM list.

[0203] The encoding device generates prediction information for the current block, encodes the prediction information, and outputs the encoded prediction information (S1350). The encoding device may encode the prediction information of the current block and output the encoded information in the form of a bitstream. The prediction information may include information about the intra-frame prediction mode of the current block. The encoding device may generate information about the intra-frame prediction mode indicating the intra-frame prediction mode, encode the intra-frame prediction mode information, and output the information in the form of a bitstream. The intra-frame prediction mode information may include information directly indicating the intra-frame prediction mode of the current block, or may include information indicating any one of the candidates in the intra-frame prediction mode candidate list derived based on the intra-frame prediction mode of the left or upper block of the current block. The intra-frame prediction mode candidate list may indicate an MPM list.

[0204] In addition, when the current block is divided into a plurality of regions, the prediction information may include information indicating the size of the divided regions of the current block and the interpolation filter of each region. In addition, when the interpolation filter for the target sample is selected based on the size of the current block, the intra-frame prediction mode of the current block, or the distance between the target sample and the reference sample, the prediction information may include information about a specific value of the interpolation filter for selecting the target sample. When the interpolation filter is selected based on the size of the current block and the intra-frame prediction mode of the current block, the prediction information may include information about a first specific value and information about a second specific value. In addition, the prediction information may include a flag indicating whether multiple interpolation filters are determined as interpolation filters for the target sample. When the flag indicates that multiple interpolation filters are determined as interpolation filters for the target sample, the prediction sample of the target sample can be derived based on the multiple interpolation filters, and when the flag indicates that multiple interpolation filters are not determined as interpolation filters for the target sample, the prediction sample for the target sample cannot be derived based on the multiple interpolation filters. For example, when the value of the flag is 1, the flag may indicate that the plurality of interpolation filters are determined as interpolation filters for the target sample, and when the value of the flag is 0, the flag may indicate that the plurality of interpolation filters are not determined as interpolation filters for the target sample. The prediction information may be signaled through a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), or a slice segment header, or may be signaled on a block basis.

[0205] Fig.14 The video decoding method of the decoding device according to the present disclosure is schematically illustrated. Fig.14 The method disclosed in can be Figure 4 Specifically, for example, Fig.14 Steps S1400 to S1440 may be performed by a predictor of a decoding device.

[0206] The decoding device derives the intra prediction mode of the current block (S1400). The decoding device may obtain prediction information about the current block through a bitstream. The prediction information may include information directly indicating the intra prediction mode of the current block, or may include information indicating any candidate in 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 may be referred to as an MPM candidate list. The decoding device may derive the intra prediction mode of the current block based on the obtained prediction information. The intra prediction mode may be one of two non-directional prediction modes and 33 directional prediction modes. As described above, the two non-directional prediction modes may include a DC intra mode and a plane intra mode. Alternatively, the intra prediction mode may be one of two non-directional intra prediction modes and 65 directional intra prediction modes. As described above, the two non-directional prediction modes may include a DC intra mode and a plane intra mode. In addition, the 65 directional intra prediction modes may include a vertical directional intra prediction mode and a horizontal directional intra prediction mode. The vertically-oriented intra prediction modes may include intra prediction mode #34 to intra prediction mode #66, and the horizontally-oriented intra prediction modes may include intra prediction mode #2 to intra prediction mode #33.

[0207] The decoding device derives neighboring samples including the left neighboring samples and the upper neighboring samples of the current block (S1410). The decoding device can derive the neighboring samples of the current block. The neighboring samples may include the left neighboring samples and the upper neighboring samples. In addition, the neighboring samples may include the upper left samples. The left neighboring samples, the upper left neighboring samples, and the upper neighboring samples may be derived from the neighboring blocks that have been reconstructed when decoding the current block. The 2N upper neighboring samples, the upper left neighboring samples, and the 2N left neighboring samples of the current block may be derived. If the size of the current block is N×N and the x component of the upper left sample of the current block is 0 and its y component is 0, the left neighboring sample may be p[-1][0] to p[-1][2N-1], the upper left neighboring sample may be p[-1][-1], and the upper neighboring sample may be p[0][-1] to p[2N-1][-1].

[0208] Alternatively, when the size of the current block is M×N and the x component of the upper left sample of the current block is 0 and the y component thereof is 0, M+N upper neighboring samples, upper left neighboring samples, and MN neighboring samples of the current block may be derived. If the size of the current block has a non-square form of M×N and the x component of the upper left sample of the current block is 0 and the y component thereof is 0, the left neighboring sample may be p[-1][0] to p[-1][M+N-1], the upper left neighboring sample may be p[-1][-1], and the upper neighboring sample may be p[0][-1] to p[M+N-1][-1].

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

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

[0211] For example, the interpolation filter for the target sample may be determined based on the size of the current block. For example, if the size of the current block is 4×4, a complex interpolation filter may be determined as the interpolation filter of the target sample. Specifically, when the size of the current block is 4×4, a cubic filter may be determined as the interpolation filter of the target sample. The cubic filter is one of the complex interpolation filters, and the cubic filter may be referred to as a spline filter.

[0212] In addition, if the current block is a square block, the width and the height are equal to each other. That is, because the current block is a square block with an N×N size, for the directional intra-prediction mode of any prediction direction, the reference size (i.e., the reference value) when selecting the interpolation filter can be N. At the same time, if the current block is a non-square block, that is, if the current block is a non-square block with an M×N size, when the intra-prediction mode of the current block is an intra-prediction mode with vertical directivity, the size of the reference block for selecting the interpolation filter (i.e., the reference value) may be M. Similarly, if the current block is a non-square block with an M×N size and the intra-prediction mode of the current block is an intra-prediction mode with horizontal directivity, the size of the current block as a reference for selecting the interpolation filter (i.e., the reference value) may be N. Alternatively, on the contrary, if the current block is a non-square block with an M×N size and the intra-prediction mode of the current block is an intra-prediction mode with vertical directivity, the interpolation filter of the current block can be selected based on N, and similarly, if the current block is a non-square block with an M×N size and the intra-prediction mode of the current block is an intra-prediction mode with horizontal directivity, the interpolation filter of the current block can be selected based on M. However, in a specific example described later, when an intra-prediction mode with vertical directivity is applied to a current block with an M×N size, the size of the current block as a reference for selecting an interpolation filter can be represented by M, and similarly, if an intra-prediction mode with horizontal directivity 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 two non-directional intra-prediction modes, the intra-prediction mode with vertical directivity can represent intra-prediction modes #34 to #66, and the intra-prediction mode with horizontal directivity can represent intra-prediction modes #2 to #33.

[0213] In addition, for example, it can be determined whether the size of the current block indicated by the shape of the current block and the directionality of the intra-frame prediction mode is less than a specific value. If the size of the current block is less than a specific value, a complex interpolation filter can be determined as the interpolation filter of the target sample, and if the size of the current block is not less than a specific value, an interpolation filter with a low-pass filter effect can be determined as the interpolation filter of the target sample. Specifically, when the size of the current block is less than a specific value, a cubic filter can be determined as the interpolation filter of the target sample. If the size of the current block is not less than a specific value, a Gaussian filter can be determined as the interpolation filter of the target sample. Alternatively, when the size of the current block is not less than a specific value, a linear filter can be determined as the interpolation filter of the target sample. The interpolation filter with a low-pass filter effect may include a Gaussian filter and a linear filter. Here, the specific value can be set to 4, 8, 16, 32, etc. In addition, the prediction information of the current block may include information about a specific value. In this case, the specific value can be derived based on the information about the specific value.

[0214] Specifically, when the width and height of the current block are equal in size (i.e., when the current block is a square block), it can be determined whether the width of the current block is less than a specific value, and when the width of the current block is less than the specific value, the interpolation filter of the target sample can be derived as a cubic filter of the target sample, and when the width of the current block is not less than the specific value, the interpolation filter for the target sample can be derived as a Gaussian filter.

[0215] In addition, when the width and height of the current block are different (ie, when the current block is a non-square block), and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, it can be determined whether the width of the current block is less than a specific value. When the width of the current block is less than the specific value, the interpolation filter of the target sample can be derived as a cubic filter, and when the width of the current block is not less than the specific value, the interpolation filter of the target sample can be derived as a Gaussian filter.

[0216] In addition, when the width and height of the current block are different (ie, when the current block is a non-square block), and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, it can be determined whether the height of the current block is less than a specific value. When the height of the current block is less than the specific value, the interpolation filter of the target sample can be derived as a cubic filter, and when the height of the current block is not less than the specific value, the interpolation filter of the target sample can be derived as a Gaussian filter.

[0217] In addition, when the width and height of the current block are different (ie, when the current block is a non-square block), and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, it can be determined whether the height of the current block is less than a specific value. When the height of the current block is less than the specific value, the interpolation filter of the target sample can be derived as a cubic filter, and when the height of the current block is not less than the specific value, the interpolation filter of the target sample can be derived as a Gaussian filter.

[0218] In addition, when the width and height of the current block are different (that is, when the current block is a non-square block), and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, it can be determined whether the width of the current block is less than a specific value. When the width of the current block is less than the specific value, the interpolation filter of the target sample can be derived as a cubic filter, and when the width of the current block is not less than the specific value, the interpolation filter of the target sample can be derived as a Gaussian filter.

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

[0220] For example, it can be determined whether the prediction angle of the intra prediction mode of the current block is less than a specific value. If the prediction angle of the intra prediction mode is less than a specific value, a complex interpolation filter can be determined as the interpolation filter of the target sample, and if the prediction angle of the intra prediction mode is not less than a specific value, an interpolation filter with a low-pass filtering effect can be determined as the interpolation filter of the target sample. Specifically, when the prediction angle of the intra prediction mode is less than a specific value, a cubic filter can be determined as the interpolation filter of the target sample, and when the prediction angle of the intra prediction mode is not less than a specific value, a Gaussian filter can be determined as the interpolation filter of the target sample. Alternatively, when the prediction angle of the intra prediction mode is not less than a 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 may include a Gaussian filter and a 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 the above Table 1, and intraPredAngle can indicate the prediction angle of the intra prediction mode. In addition, for example, the specific value may be set to 11. In addition, the prediction information for the current block may include information about the specific value. In this case, the specific value may be derived based on the information about the specific value.

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

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

[0223] Specifically, when the width and height of the current block are equal to each other, the decoding device can determine whether the width of the current block is less than the first specific value. When the width of the current block is not less than the first specific value, the decoding device can determine a Gaussian filter or a linear filter as the interpolation filter of the target sample.

[0224] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode having vertical directivity, the decoding device may determine whether the width of the current block is less than a first specific value. When the width of the current block is not less than the first specific value, the decoding device may determine a Gaussian filter or a linear filter as an interpolation filter for the target sample.

[0225] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, the decoding device may determine whether the height of the current block is less than a first specific value. When the height of the current block is not less than the first specific value, the decoding device may determine a Gaussian filter or a linear filter as an interpolation filter for the target sample.

[0226] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, the decoding device may determine whether the height of the current block is less than a first specific value. When the height of the current block is not less than the first specific value, the decoding device may determine a Gaussian filter or a linear filter as an interpolation filter for the target sample.

[0227] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directivity, the decoding device may determine whether the width of the current block is less than a first specific value. When the width of the current block is not less than the first specific value, the decoding device may determine a Gaussian filter or a linear filter as an interpolation filter for the target sample.

[0228] If the size of the current block is less than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than the second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the decoding device may determine a complex interpolation filter as the interpolation filter of the target sample. Specifically, when the prediction angle of the intra prediction mode is less than the second specific value, the decoding device may determine a cubic filter as the interpolation filter.

[0229] Specifically, when the width and height of the current block are equal and the width of the current block is less than a first specific value, the decoding device can determine whether the prediction angle of the intra-frame prediction mode of the current block is less than a second specific value, and when the prediction angle of the intra-frame prediction mode is less than the second specific value, the decoding device can determine the cubic filter as the interpolation filter.

[0230] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode having vertical directivity, the decoding device may determine whether the width of the current block is less than a first specific value. If the width of the current block is less than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the decoding device may determine a cubic filter as the interpolation filter.

[0231] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, the decoding device may determine whether the height of the current block is less than a first specific value. If the height of the current block is less than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the decoding device may determine a cubic filter as the interpolation filter.

[0232] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, the decoding device may determine whether the height of the current block is less than a first specific value. If the height of the current block is less than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the decoding device may determine a cubic filter as the interpolation filter.

[0233] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, the decoding device may determine whether the width of the current block is less than a first specific value. If the width of the current block is less than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the decoding device may determine a cubic filter as the interpolation filter.

[0234] If the prediction angle of the intra-frame prediction mode is not less than the second specific value, the decoding device may determine an interpolation filter having a low-pass filter effect as the interpolation filter of the target sample. Specifically, if the prediction angle of the intra-frame prediction mode is not less than the second specific value, the decoding device may determine a Gaussian filter as the interpolation filter. Alternatively, if the prediction angle of the intra-frame prediction mode is not less than the second specific value, the decoding device may determine a linear filter as the interpolation filter.

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

[0236] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, the decoding device may determine whether the width of the current block is less than a first specific value. If the width of the current block is less than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is not less than the second specific value, the decoding device may determine a Gaussian filter or a linear filter as the interpolation filter.

[0237] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, the decoding device may determine whether the height of the current block is less than a first specific value. If the height of the current block is less than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is not less than the second specific value, the decoding device may determine a Gaussian filter or a linear filter as the interpolation filter.

[0238] If the width and height of the current block are different from each other, and the intra prediction mode of the current block is a directional intra prediction mode with vertical directivity, the decoding device may determine whether the height of the current block is less than a first specific value. If the height of the current block is less than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is less than a second specific value. If the prediction angle of the intra prediction mode is not less than the second specific value, the decoding device may determine a Gaussian filter or a linear filter as the interpolation filter.

[0239] If the width and height of the current block are different from each other and the intra prediction mode of the current block is a directional intra prediction mode with horizontal directivity, the decoding device may determine whether the width of the current block is less than a first specific value. If the width of the current block is less than the first specific value, the decoding device may determine whether the prediction angle of the intra prediction mode of the current block is not less than a second specific value. If the prediction angle of the intra prediction mode is less than the second specific value, the decoding device may determine a Gaussian filter or a linear filter as the interpolation filter.

[0240] Meanwhile, the prediction information for the current block may include information about the first specific value and information about the second specific value. In this case, the first specific value may be derived based on the information about the first specific value, and the second specific value may be derived based on the information about the second specific value. Alternatively, the first specific value and the second specific value may be derived based on a preset value.

[0241] In another example, the current block may be divided into a plurality of regions, and the interpolation filter of each region may be determined based on the distance between each region and the neighboring samples of the current block. In this case, the interpolation filter for the target sample may be derived as the interpolation filter of the region including the target sample. In addition, if the size of the current block is greater than or equal to a specific size, the current block may be divided into a plurality of regions. Specifically, the interpolation filter of the region that is closer to the neighboring samples of the current block than the current value in the region may be determined as a complex interpolation filter and the interpolation filter of the region that is farther away from the neighboring samples of the current block than the specific value in these regions may be determined as an interpolation filter having a low-pass filter effect.

[0242] At the same time, the sizes of multiple regions divided from the current block can be preset. Alternatively, the sizes of multiple regions can be derived based on the size of the current block, the intra prediction mode, etc. For example, in the case where the intra prediction mode of the current block is one of the intra prediction modes #35 to #66, the size of the divided region of the current block can be derived as a 4×4 size. Here, if the current block is a block with a size of 16×16, the current block can be divided into regions with a size of 4x4, a complex interpolation filter can be determined as an interpolation filter for regions from #0 to #7 in a raster scan order, and an interpolation filter with a low-pass filtering effect can be determined as an interpolation filter for other regions. For example, the interpolation filter for regions from #0 to #7 in a raster scan order in a region can be determined as a cubic filter, and the interpolation filter for other regions can be determined as a Gaussian filter or a linear filter. Here, the number of 16 regions with a size of 4×4 according to the raster scan order can be derived sequentially from the previous row to the next row, and sequentially from left to right in each row. That is, the regions included in the first row among the 16 regions of the current block having a size of 4×4 may be represented in order from left to right as region #0, region #1, region #2, and region #3, the regions included in the second row may be represented in order from left to right as region #4, region #5, region #6, and region #7, the regions included in the third row may be represented in order from left to right as region #8, region #9, region #10, and region #11, and the regions included in the fourth row may be represented in order from left to right as region #12, region #13, region #14, and region #15. At the same time, prediction information for the current block may be received, and the prediction information may include information indicating the size of each divided region of the current block and information indicating an interpolation filter for each region. In this case, the size of the divided region of the current block and the interpolation filter for each region may be derived based on the information indicating the size of the divided region of the current block and the information indicating the interpolation filter for each region.

[0243] In another example, the interpolation filter of the target sample can be determined based on the distance between the target sample and the reference sample. 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, the distance can be calculated based on the position of the target sample and the trigonometric function value (e.g., tanθ) of the prediction angle according to the intra prediction mode. Alternatively, the distance can be derived based on a predefined table for the size of the block and the intra prediction mode. Alternatively, the distance between the target sample and the reference sample can indicate a vertical distance or a horizontal distance. If 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. In addition, if 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.

[0244] For example, the decoding device may derive the distance between the target sample and the reference sample, and determine whether the distance is less than a specific value. If the distance is less than a specific value, the decoding device may determine a complex interpolation filter as the interpolation filter of the target sample, and if the distance is not less than a specific value, the decoding device may determine an interpolation filter having a low-pass filter effect as the interpolation filter of the target sample. Specifically, if the distance is less than a specific value, the decoding device may determine a cubic filter as the interpolation filter of the target sample, and if the distance is not less than a specific value, the decoding device may determine a Gaussian filter or a linear filter as the interpolation filter of the target sample. The specific value may be derived based on the size of the current block. Alternatively, the specific value may be derived based on the intra-frame prediction mode of the current block, whether the current block is a square / non-square block, etc. For example, when the size of the current block is N×N, the specific value may be derived as N / 2. In addition, prediction information for the current block may be received, and the prediction information may include information about the specific value. In this case, the specific value may be derived based on information about the specific value.

[0245] In another example, multiple interpolation filters may be determined as interpolation filters for target samples. For example, the interpolation filter for the target sample may include one of the complex interpolation filters and one of the interpolation filters with a low-pass filter effect. Alternatively, the interpolation filter for the target sample may include one of the complex interpolation filters and two interpolation filters with a low-pass filter effect. Alternatively, the interpolation filter for the target sample may include two complex interpolation filters and one interpolation filter with a low-pass filter effect. Specifically, the interpolation filter for the target sample may include a cubic filter and a Gaussian filter. At the same time, prediction information for the current block may be received, and the prediction information may include a flag indicating whether multiple interpolation filters are determined as interpolation filters for the target sample. Whether to determine multiple interpolation filters may be determined based on the flag. For example, when the flag indicates that multiple interpolation filters are determined as interpolation filters for the target sample, prediction samples for the target sample may be derived based on multiple interpolation filters, and when the flag indicates that multiple interpolation filters are not determined as interpolation filters for the target sample, prediction samples for the target sample may not be derived based on multiple interpolation filters. For example, when the value of the flag is 1, the flag may indicate that the plurality of interpolation filters are determined as interpolation filters of the target sample, and when the value of the flag is 0, the flag may indicate that the plurality of interpolation filters are not determined as interpolation filters of the target sample.

[0246] 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 the filter coefficient of the interpolation filter based on the position of the target sample and the prediction angle of the intra-frame prediction mode, and can derive the predicted sample of the target sample based on the filter coefficient and the reference sample. For example, four neighboring samples among the neighboring samples of the current block can be derived as reference samples, and four filter coefficients of the interpolation filter can be derived. The decoding 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 equation 1.

[0247] In addition, when multiple interpolation filters are determined as interpolation filters for target samples, the decoding device can derive (time) prediction samples based on each interpolation filter, and can derive prediction samples of the target samples based on the derived (time) prediction samples. For example, the prediction samples of the target samples can be derived by averaging the (time) prediction samples, or can be derived by weighted summing the (time) prediction samples. Whether multiple interpolation filters are determined as interpolation filters for target samples can be derived based on the size of the current block, the intra-frame prediction mode of the current block, the variance of the neighboring sample values ​​of the current block, etc. In addition, a flag indicating whether multiple interpolation filters are determined as interpolation filters for target samples can be received, and whether multiple interpolation filters are determined as interpolation filters for target samples can be determined based on the flag.

[0248] For example, the interpolation filter for the target sample may include a cubic filter and a Gaussian filter. In this case, the decoding device may derive the filter coefficient of the cubic filter based on the position of the target sample and the prediction angle of the intra-frame prediction mode, and may derive the filter coefficient of the Gaussian filter based on the position of the target sample and the prediction angle of the intra-frame prediction mode. The decoding device may derive the first prediction sample of the target sample based on the filter coefficient of the cubic filter and the reference sample, may derive the second prediction sample of the target sample based on the filter coefficient of the Gaussian filter and the reference sample, and 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 by averaging the first prediction sample and the second prediction sample. Alternatively, the prediction sample of the target sample can be derived by weighted summing the first prediction sample and the second prediction sample. In this case, the weight of the first prediction sample may be inversely proportional to the distance between the target sample and the reference sample, and the weight of the second prediction sample may be derived as a value obtained by subtracting the weight of the first prediction sample from 1. Alternatively, the first weight and the second weight used here may be amplified and derived in integer units to avoid decimal point calculations.

[0249] In addition, for example, the interpolation filter for the target sample may include a cubic filter and a linear filter. In this case, the decoding device may derive the filter coefficient of the cubic filter based on the position of the reference sample, and may derive the filter coefficient of the linear filter based on the position of the reference sample. The decoding device may derive the first predicted sample of the target sample based on the filter coefficient of the cubic filter and the reference sample, may derive the second predicted sample of the target sample based on the filter coefficient of the linear filter and the reference sample, and derive the predicted sample of the target sample based on the first predicted sample and the second predicted sample. The predicted sample of the target sample can be derived by averaging the first predicted sample and the second predicted sample. Alternatively, the predicted sample of the target sample can be derived by weighted summing the first predicted sample and the second predicted sample. In this case, the weight of the first predicted sample may be inversely proportional to the distance between the target sample and the reference sample, and the weight of the second predicted sample may be derived as a value obtained by subtracting the weight of the first predicted sample from 1. Alternatively, the first weight and the second weight used here may be amplified and derived in integer units to avoid decimal point calculations.

[0250] In another example, if the MPM (Most Probable Mode) mode is applied to the current block to derive the intra prediction mode of the current block based on the intra prediction mode of the neighboring blocks of the current block and the intra prediction mode of the current block is a directional intra prediction mode, rather than a plane mode or a DC mode, the interpolation filter for the target sample can be determined based on the neighboring block selected by the neighboring MPM mode. That is, the interpolation filter used in the neighboring block can be derived as the interpolation filter of the target sample. If the MPM mode is applied to the current block, the decoding device can determine the MPM list based on the intra prediction mode of the left or upper neighboring block for the current block, and can determine the intra prediction mode based on the MPM list.

[0251] Although not shown in the drawings, the decoding device may use the prediction samples as reconstructed samples according to the prediction mode, or add the residual samples to the prediction samples to generate reconstructed samples. When there are residual samples of the target block, the decoding device may receive information about the residual of the target block, and the information about the residual may be included in the information about the reconstructed samples. The information about the residual may include transform coefficients related to the residual samples. The decoding device may derive the residual samples (or residual sample arrays) of the target block based on the residual information. The decoding device may generate reconstructed samples based on the prediction samples and the residual samples, and may derive a reconstructed block or a reconstructed picture based on the reconstructed samples. Thereafter, in order to enhance the subjective / objective image quality as needed, as described above, the decoding device may apply a loop filtering process such as a deblocking filter and / or an SAO process to the reconstructed picture.

[0252] In addition, the decoding device may receive prediction information for the current block through a bitstream and may entropy decode it. The prediction information may include information about the intra-frame prediction mode of the current block. The decoding device may obtain information about the intra-frame prediction mode indicating the intra-frame prediction mode. The intra-frame prediction mode information may include information directly indicating the intra-frame prediction mode of the current block, or may include information indicating any one of the candidates in the intra-frame prediction mode candidate list derived based on the intra-frame prediction mode of the left or upper block of the current block. The intra-frame prediction mode candidate list may indicate an MPM list.

[0253] In addition, when the current block is divided into a plurality of regions, the prediction information may include information indicating the size of the divided regions of the current block and the interpolation filter of each region. In addition, when the interpolation filter for the target sample is selected based on the size of the current block, the intra-frame prediction mode of the current block, or the distance between the target sample and the reference sample, the prediction information may include information about a specific value of the interpolation filter for selecting the target sample. When the interpolation filter is selected based on the size of the current block and the intra-frame prediction mode of the current block, the prediction information may include information about a first specific value and information about a second specific value. In addition, the prediction information may include a flag indicating whether multiple interpolation filters are determined as interpolation filters for the target sample. When the flag indicates that multiple interpolation filters are determined as interpolation filters for the target sample, the prediction sample of the target sample can be derived based on the multiple interpolation filters, and when the flag indicates that multiple interpolation filters are not determined as interpolation filters for the target sample, the prediction sample of the target sample cannot be derived based on the multiple interpolation filters. For example, when the value of the flag is 1, the flag may indicate that the plurality of interpolation filters are determined as interpolation filters for the target sample, and when the value of the flag is 0, the flag may indicate that the plurality of interpolation filters are not determined as interpolation filters for the target sample. The prediction information may be signaled through a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), or a slice segment header, or may be signaled on a block basis.

[0254] According to the above-mentioned present disclosure, prediction can be performed on the target sample based on the interpolation filter derived according to the size of the current block, the distance between the target sample and the reference sample and / or the prediction mode (prediction angle), thereby accurately generating a reference sample of a fractional sample position of the target sample to enhance the prediction accuracy of the current block, and reducing the residual of the current block to enhance the coding efficiency.

[0255] In addition, according to the present disclosure, since the interpolation filter for the target sample can be selected based on the above-mentioned various conditions, the bit amount of information related to the selection of the interpolation filter can be reduced, so that the prediction accuracy of the current block can be enhanced, and the coding efficiency of the current block can be improved.

[0256] In the above-described embodiments, methods are described based on a flow chart with a series of steps or blocks. The present disclosure is not limited to the order of the above steps or blocks. As described above, some steps or blocks may occur simultaneously or in a different order than other steps or blocks. In addition, it will be appreciated by those skilled in the art that the steps shown in the above flow chart are not exclusive and may include other steps, or one or more steps in the flow chart may be deleted without affecting the scope of the present disclosure.

[0257] The above method according to the present disclosure may be implemented in software. The encoding device and / or decoding device according to the present disclosure may be included in a device that performs image processing, such as a television, a computer, a smart phone, a set-top box, or a display device.

[0258] When the embodiments of the present disclosure are implemented in software, the above methods can be implemented by modules (processes, functions, etc.) that perform the above functions. Such modules can be stored in a memory and executed by a processor. The memory can be inside or outside the processor, and various well-known means can be used to couple the memory to the processor. The processor may include an application-specific integrated circuit (ASIC), other chipsets, logic circuits, and / or data processing devices. The memory may 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. A video decoding method performed by a decoding device, the method comprising: Obtain prediction information and residual information of the current block from the bitstream; deriving an intra prediction mode of the current block based on the prediction information; Exporting neighboring samples including left neighboring samples and upper neighboring samples of the current block; Based on the position of the target sample and the prediction angle of the intra prediction mode, deriving a reference sample among the neighboring samples for predicting the target sample of the current block; determining an interpolation filter for the target sample based on the intra prediction mode and the size of the current block; as well as deriving a prediction 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; as well as Generate a reconstructed picture based on the predicted samples and the residual samples, Wherein, determining the interpolation filter for the target sample based on the intra prediction mode and the size of the current block comprises: determining whether the size of the current block is smaller than a first specific value; and Based on the fact that the size of the current block is 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 fact that the size of the current block is not less 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 Wherein, 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-frame prediction mode is larger than the second specific value, the interpolation filter used for the target sample is derived as the Gaussian filter.

2. The video decoding method according to claim 1, wherein Deriving the predicted sample of the target sample based on the interpolation filter and the reference sample comprises: deriving filter coefficients of the interpolation filter based on the position of the target sample and the prediction angle; as well as The predicted sample of the target sample is derived based on the filter coefficients and the reference sample.

3. The video decoding method according to claim 1, wherein Based on the width and height of the current block being equal, the size of the current block is equal to the width of the current block.

4. The video decoding method according to claim 1, wherein Based on the fact that 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 directivity, the size of the current block is equal to the width of the current block.

5. The video decoding method according to claim 1, wherein Based on the fact that the width and height of the current block are different and the intra prediction mode of the current block is a directional intra prediction mode having horizontal directivity, the size of the current block is equal to the height of the current block.

6. A video encoding method performed by an encoding device, the method comprising: Determining an intra prediction mode for a current block; Exporting neighboring samples including left neighboring samples and upper neighboring samples of the current block; Based on the position of the target sample and the prediction angle of the intra prediction mode, deriving a reference sample among the neighboring samples for predicting the target sample of the current block; Determining an interpolation filter for the target sample based on the intra prediction mode and the size of the current block; deriving a prediction 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 predicted sample; as well as encoding video information including prediction information and residual information of the current block, Wherein, determining the interpolation filter for the target sample based on the intra prediction mode and the size of the current block comprises: determining whether the size of the current block is smaller than a first specific value; and Based on the fact that the size of the current block is 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 fact that the size of the current block is not less 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 Wherein, 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-frame prediction mode is larger than the second specific value, the interpolation filter used for the target sample is derived as the Gaussian filter.

7. A method for transmitting image data, the method comprising: Obtaining a bitstream of the image, wherein the bitstream is generated based on determining an intra-frame prediction mode of a current block, deriving neighboring samples including left neighboring samples and upper neighboring samples of the current block, deriving reference samples for predicting the target samples of the current block among the neighboring samples based on the position of the target sample and the prediction angle of the intra-frame prediction mode, determining an interpolation filter for the target sample based on the intra-frame prediction mode and the size of the current block, deriving prediction samples of the target sample based on the interpolation filter and the reference samples, deriving residual samples of the target sample based on the prediction samples, and encoding video information including prediction information and residual information of the current block; as well as sending said data comprising said bit stream, Wherein, determining the interpolation filter for the target sample based on the intra prediction mode and the size of the current block comprises: determining whether the size of the current block is smaller than a first specific value; and Based on the fact that the size of the current block is 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 fact that the size of the current block is not less 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 Wherein, 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-frame prediction mode is larger than the second specific value, the interpolation filter used for the target sample is derived as the Gaussian filter.

Citation Information

Patent Citations

  • Method and apparatus for encoding video, and method and apparatus for decoding video

    AU2015202118A1

  • Pixel adaptive intra smoothing

    US20120140821A1