Image decoding method and apparatus relying on intra prediction in an image compilation system

By generating reference samples from multiple neighboring samples for intra-prediction, the method addresses the high data volume challenge of high-resolution images, improving encoding efficiency and reducing transmission and storage costs.

CN109891892BActive Publication Date: 2025-07-15GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201780066608.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2016-10-11
Filing Date
2017-08-30
Publication Date
2025-07-15
Estimated Expiration
2038-05-29

AI Technical Summary

Technical Problem

High resolution and high-quality images are costly to transmit and store, and efficient image compression technology is required to reduce the amount of information.

Method used

By deriving the adjacent samples on multiple rows and left-neighbor samples of the current block, a reference sample is generated based on these samples, and a prediction sample of the current block is generated using the intra prediction mode.

Benefits of technology

The prediction accuracy of the current block is improved, thereby improving the overall coding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109891892B_ABST
    Figure CN109891892B_ABST
Patent Text Reader

Abstract

The image decoding method performed by a decoding device according to the present invention includes: a step of deriving an intra prediction mode of a current block; a step of deriving upper neighboring samples of multiple lines and left neighboring samples of multiple columns of the current block; a step of deriving one row of upper reference samples based on the upper neighboring samples; a step of deriving one column of left reference samples based on the left neighboring samples; and a step of generating prediction samples for the current block by using at least one of the upper reference samples and the left reference samples according to the intra prediction mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to image coding technology, and more particularly, to an image decoding method and apparatus according to intra prediction in an image coding system. Background Art

[0002] The demand for high-resolution and high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images is increasing in various fields. Since image data has high resolution and high quality, the amount of information or bits to be transmitted increases relative to conventional image data. Therefore, when transmitting image data using a medium such as a conventional wired / wireless broadband line or storing image data using an existing storage medium, the transmission cost and storage cost increase.

[0003] Therefore, an efficient image compression technology for effectively transmitting, storing, and reproducing information of high-resolution and high-quality images is needed. Summary of the Invention

[0004] Technical Objectives

[0005] The present invention provides a method and apparatus for enhancing image coding efficiency.

[0006] The present invention also provides an intra prediction method and apparatus for generating a reference sample based on a plurality of neighboring samples of a current block and performing intra prediction based on the reference sample.

[0007] Technical Solutions

[0008] In one aspect, there is provided a method of decoding an image performed by a decoding device. The method includes deriving an intra prediction mode of a current block; deriving a plurality of upper neighboring samples and a plurality of left neighboring samples of a plurality of rows of the current block; deriving a row of reference samples based on the upper neighboring samples; deriving a column of left reference samples based on the left neighboring samples; and generating a prediction sample of the current block using at least one of the upper reference sample and the left reference sample according to the intra prediction mode.

[0009] In another aspect, there is provided a decoding device for decoding an image. The decoding device includes an entropy decoding unit configured to obtain prediction information about a current block; and a prediction unit configured to derive an intra prediction mode of the current block, derive a plurality of upper neighboring samples and a plurality of left neighboring samples of a plurality of rows of the current block, derive a row of reference samples based on the upper neighboring samples, derive a column of left reference samples based on the left neighboring samples, and generate a prediction sample of the current block using at least one of the upper reference sample and the left reference sample according to the intra prediction mode.

[0010] On the other hand, there is provided a method for encoding a video performed by an encoding device. The method includes determining an intra prediction mode of a current block; deriving multiple rows of upper neighboring samples and multiple columns of left neighboring samples of the current block; deriving one row of reference samples based on the upper neighboring samples; deriving one column of left reference samples based on the left neighboring samples; generating prediction samples of the current block using at least one of the upper reference samples and the left reference samples according to the intra prediction mode; and generating, encoding, and outputting prediction information of the current block.

[0011] On the other hand, there is provided a video encoding device. The encoding device includes: a prediction unit configured to determine an intra prediction mode of a current block, derive multiple rows of upper neighboring samples and multiple columns of left neighboring samples of the current block, extract one row of reference samples based on the upper reference samples, extract one column of left reference samples based on the left reference samples, and generate prediction samples of the current block using at least one of the upper reference samples and the left reference samples according to the intra prediction mode; and an entropy encoding unit configured to generate, encode, and output prediction information of the current block.

[0012] Advantages of the present invention

[0013] According to the present invention, reference samples of a current block can be derived based on multiple neighboring samples, and by performing intra prediction based on the reference samples, the prediction accuracy of the current block can be improved, thereby improving the overall encoding efficiency.

[0014] According to the present invention, reference samples can be derived based on multiple neighboring samples located in the prediction direction of the intra prediction mode of the current block, and by performing intra prediction based on the reference samples, the prediction accuracy of the current block can be improved, thereby improving the overall encoding efficiency.

[0015] According to the present invention, weights of multiple neighboring samples can be derived, reference samples can be derived based on the weights and the neighboring samples, and by performing intra prediction based on the reference samples, the prediction accuracy of the current block can be improved, thereby improving the overall encoding efficiency. Description of the drawings

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

[0017] Figure 2 is a schematic diagram illustrating the configuration of a video decoding device to which the present invention can be applied.

[0018] Figure 3 Illustrates left neighboring samples and upper neighboring samples for intra prediction of a current block.

[0019] Figure 4 Illustrates an example of deriving reference samples based on multiple neighboring samples of a current block.

[0020] Figure 5 The figure shows an example of deriving a reference sample based on multiple neighboring samples of the current block.

[0021] Figure 6 The figure shows an example of generating an upper reference sample of the current block based on upper neighboring samples including additionally generated upper neighboring samples.

[0022] Figure 7 The figure shows an example of deriving neighboring samples located at fractional sample positions.

[0023] Figure 8 The figure shows an example of generating an upper reference sample of the current block based on upper neighboring samples including additionally generated upper neighboring samples.

[0024] Figure 9 The figure shows an example of partitioning intra prediction modes according to a prediction direction.

[0025] Figure 10 The figure shows an example of generating an upper reference sample of the current block based on upper neighboring samples including additionally generated upper neighboring samples.

[0026] Figure 11 Schematically shows a video encoding method by an encoding device according to the present invention.

[0027] Figure 12 Schematically shows a video decoding method by a decoding device according to the present invention. Detailed implementation

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

[0029] On the other hand, in order to facilitate the explanation of different specific functions, the elements in the drawings described in the present invention are drawn independently, which does not mean that these elements are implemented by independent hardware or independent software. For example, two or more elements can be combined to form a single element, or one element can be divided into multiple elements. Embodiments in which elements are combined and / or divided without departing from the concept of the present invention belong to the present invention.

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

[0031] In this specification, generally, a picture means a unit representing an image at a specific time, and a slice is a unit that is a part of a picture. A picture can be composed of multiple slices, and the terms of picture and slice can be mixed with each other as needed.

[0032] A pixel or picture element can mean the smallest unit that composes a picture (or image). In addition, "sample" can be used as a term corresponding to a pixel. A sample can generally represent a pixel or the value of a pixel, can be a pixel (pixel value) representing only a luminance component, and can be a pixel (pixel value) representing only a chrominance component.

[0033] A unit indicates a basic unit of image processing. The unit can include at least one of a specific area and information related to the area. Optionally, the unit can be mixed with terms such as block, region, etc. Typically, an M×N block can represent a set of sampled or transformed coefficients arranged in M columns and N rows.

[0034] Figure 1 Briefly illustrate the structure of a video coding device to which the present invention can be applied.

[0035] Refer to Figure 1 , the video coding device 100 can include a picture splitter 105, a predictor 110, a subtractor 115, a transformer 120, a quantizer 125, a rearranger 130, an entropy encoder 135, a residual processor 140, an adder 150, a filter 155, and a memory 160. The residual processor 140 can include a dequantizer 141 and an inverse transformer 142.

[0036] The picture splitter 105 can separate an input picture into at least one processing unit.

[0037] In an example, the processing unit may be referred to as a compile unit (CU). In this case, compile units may be recursively separated from the largest compile unit (LCU) according to a quadtree binary tree (QTBT) structure. For example, a compile unit may be separated into multiple compile units with 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 compilation process according to the present invention may be performed based on the final compile units that are no longer further separated. In this case, depending on the image characteristics, the largest compile unit may be used as the final compile unit based on compilation efficiency, etc., or the compile unit may be recursively separated into compile units with a lower depth as needed and the compile unit with the optimal size may be used as the final compile unit. Here, the compilation process may include processes such as prediction, transformation, and restoration, which will be described later.

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

[0039] The predictor 110 may perform prediction on the processing target block (hereinafter, the current block) and may generate a prediction block including the prediction samples of the current block. The prediction unit executed in the predictor 110 may be a compile block, or may be a transformation block, or may be a prediction block.

[0040] The predictor 110 may determine whether to apply intra prediction to the current block or inter prediction to the current block. For example, the predictor 110 may determine whether to apply intra prediction or inter prediction on a CU-by-CU basis.

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

[0042] In the case of inter prediction, the predictor 110 may derive prediction samples for the current block based on samples specified by a motion vector on a reference picture. The predictor 110 may derive prediction samples for the current block by applying any one of a skip mode, a merge mode, and a motion vector prediction (MVP) mode. In the case of the skip mode and the merge mode, the predictor 110 may use the motion information of neighboring blocks as the motion information of the current block. In the case of the skip mode, different from the merge mode, the difference (residual) between the prediction samples and the original samples is not transmitted. In the case of the MVP mode, the motion vector of a neighboring block is used as a motion vector predictor, and thus is used as a motion vector predictor for the current block to derive the motion vector of the current block.

[0043] In the case of inter prediction, neighboring blocks may include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in a reference picture. The reference picture including the temporal neighboring blocks may also be referred to as a collocated picture (colPic). The 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 in the form of a bitstream.

[0044] When using the motion information of temporal neighboring blocks in the skip mode and the merge mode, the highest picture in the reference picture list may be used as the reference picture. The reference pictures included in the reference picture list may be aligned based on the picture order count (POC) difference between the current picture and the corresponding reference picture. The POC corresponds to the display order and may be distinguished from the compilation order.

[0045] The subtractor 115 generates a residual sample, which is the 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.

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

[0047] The quantizer 125 may quantize the transform coefficients to generate quantized transform coefficients.

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

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

[0050] The dequantizer 141 dequantizes the values (transform coefficients) quantized by the quantizer 125, and the inverse transformer 142 inverse-transforms the values dequantized by the dequantizer 141 to generate residual samples.

[0051] The adder 150 adds the residual samples to the predicted samples to reconstruct the picture. The residual samples may be added to the predicted samples in units of blocks to generate restored blocks. Although the adder 150 is described as a separate component, the adder 150 may be part of the predictor 110. At the same time, the adder 150 may be referred to as a reconstructor or a restored block generator.

[0052] Filter 155 may apply deblocking filtering and / or sample adaptive offset to the reconstructed picture. Artifacts at block boundaries in the reconstructed picture or distortions in quantization may be corrected by deblocking filtering and / or sample adaptive offset. After deblocking filtering is completed, sample adaptive offset may be applied on a sample-by-sample basis. Filter 155 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.

[0053] Memory 160 may store the reconstructed picture (decoded picture) or information required for encoding / decoding. Here, the reconstructed picture may be the reconstructed picture filtered by Filter 155. The stored reconstructed picture may be used as a reference picture for (inter-frame) prediction of other pictures. For example, Memory 160 may store pictures (references) for inter-frame prediction. Here, the pictures for inter-frame prediction may be specified according to a reference picture set or a reference picture list.

[0054] Figure 2 Briefly illustrate the structure of a video decoding device to which the present invention may be applied.

[0055] Reference Figure 2 , the video decoding device 200 may include an entropy decoder 210, a residual processor 220, a predictor 230, an adder 240, a filter 250, and a memory 260. The residual processor 220 may include a rearranger 221, a dequantizer 222, and an inverse transformer 223.

[0056] When the input is a bitstream including video information, the video decoding device 200 may reconstruct video in association with the process of processing video information in a video encoding device.

[0057] For example, the video decoding device 200 may perform video decoding using the processing units applied in the video encoding device. Thus, the processing unit blocks for video decoding may be, for example, compilation units, and in another example, may be compilation units, prediction units, or transform units. Compilation units may be separated from the largest compilation unit according to a quadtree structure and / or a binary tree structure.

[0058] In some cases, prediction units and transform units may be further used, and in such cases, the prediction blocks are blocks derived or split from the compilation units and may be units for sample prediction. Here, the prediction units may be divided into sub-blocks. The transform units may be separated from the compilation units according to a quadtree structure and may be units for deriving transform coefficients or units for deriving a residual signal from the transform coefficients.

[0059] The entropy decoder 210 can parse the bitstream to output information required for video restoration or picture restoration. For example, the entropy decoder 210 can decode the information in the bitstream based on coding methods such as exponential Golomb coding, CAVLC, CABAC, etc., and can output the values of the syntax elements required for video restoration and the quantization values of the transform coefficients regarding the residuals.

[0060] More specifically, the CABAC entropy decoding method can receive the binary (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 binary generation probability according to the determined context model, and perform arithmetic decoding of the binary 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.

[0061] The information regarding prediction in the information decoded by the entropy decoder 210 can be provided to the predictor 250, and the residual values that have undergone entropy decoding by the entropy decoder 210, that is, the quantized transform coefficients, can be input to the rearranger 221.

[0062] The rearranger 221 can rearrange the quantized transform coefficients into a two-dimensional block form. The rearranger 221 can perform rearrangement corresponding to the coefficient scan performed by the encoding device. Although the rearranger 221 is described as a separate component, the rearranger 221 can be a part of the dequantizer 222.

[0063] The dequantizer 222 can dequantize the quantized transform coefficients based on the (de)quantization parameter to output the transform coefficients. In this case, the information for deriving the quantization parameter can be signaled from the encoding device.

[0064] The inverse transformer 223 can perform inverse transformation on the transform coefficients to derive the residual samples.

[0065] The predictor 230 can perform prediction on the current block and can generate a prediction block including the prediction samples of the current block. The unit of prediction performed in the predictor 230 can be a coding block, or can be a transform block or can be a prediction block.

[0066] The predictor 230 may determine whether to apply intra prediction or inter prediction based on 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. Additionally, the unit for generating prediction samples may also be different in inter prediction and intra prediction. For example, it may be determined on a CU-by-CU basis which one to apply between inter prediction and intra prediction. Further, for example, in inter prediction, prediction samples may be generated by determining a prediction mode on a PU-by-PU basis, and in intra prediction, prediction samples may be generated on a TU-by-TU basis by determining a prediction mode on a PU-by-PU basis.

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

[0068] In the case of inter prediction, the predictor 230 may derive prediction samples for the current block based on samples specified in the reference picture according to the motion vector. The predictor 230 may use one of the skip mode, the merge mode, and the MVP mode to derive prediction samples for the current block. Here, for the motion information required for the inter prediction of the current block provided by the video coding device, such as the motion vector and the information about the reference picture index, may be obtained or derived based on the information about the prediction.

[0069] In the skip mode and the merge mode, the motion information of 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.

[0070] The predictor 230 may use the motion information of available neighboring blocks to construct a merge candidate list, 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 coding device. The motion information may include the motion vector and the reference picture. When using the motion information of temporal neighboring blocks in the skip mode and the merge mode, the highest picture in the reference picture list may be used as the reference picture.

[0071] In the case of the skip mode, the difference (residual) between the prediction samples and the original samples is not sent, different from the merge mode.

[0072] In the case of the MVP mode, the motion vectors of neighboring blocks may be used as motion vector predictors to derive the motion vector of the current block. Here, the neighboring blocks may include spatial neighboring blocks and temporal neighboring blocks.

[0073] When the merge mode is applied, for example, the motion vectors of the recovered spatially neighboring blocks and / or the motion vectors corresponding to the Col blocks as temporally neighboring blocks 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 information regarding prediction may include a merge index that indicates the candidate block having the best motion vector selected from the candidate blocks included in the merge candidate list. Here, the predictor 230 may derive the motion vector of the current block using the merge index.

[0074] As another example, when the MVP (Motion Vector Prediction) mode is applied, the motion vectors of the recovered spatially neighboring blocks and / or the motion vectors corresponding to the Col blocks as temporally neighboring blocks can be used to generate a motion vector predictor candidate list. That is, the motion vectors of the recovered spatially neighboring blocks and / or the motion vectors corresponding to the Col blocks as temporally neighboring blocks can be used as motion vector candidates. The above information regarding prediction may include a predicted motion vector index that indicates the best motion vector selected from the motion vector candidates included in the list. Here, the predictor 230 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 the 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 can be obtained by subtracting the motion vector predictor from the motion vector of the current block. Here, the predictor 230 may acquire the motion vector included in the information regarding prediction and derive the motion vector of the current block by adding the motion vector difference to the motion vector predictor. Additionally, the predictor may obtain or derive a reference picture index indicating a reference picture from the above information regarding prediction.

[0075] The adder 240 may add residual samples to the predicted samples to reconstruct the current block or the current picture. The adder 240 may reconstruct the current picture by adding the residual samples to the predicted samples in units of blocks. When the skip mode is applied, no residual is sent, and thus the predicted samples may become recovered samples. Although the adder 240 is described as a separate component, the adder 240 may be part of the predictor 230. Meanwhile, the adder 240 may be referred to as a reconstructor or a recovered block generator.

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

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

[0078] As described above, when performing intra prediction of the current block, the intra prediction may be performed based on the neighboring samples that have been encoded / decoded at the decoding time point of the current block. That is, the left neighboring sample and the upper neighboring sample of the current block that have been reconstructed may be used to reconstruct the predicted sample of the current block. The left neighboring sample and the upper neighboring sample may be represented as shown in Figure 3 the figure.

[0079] Figure 3 The figure illustrates the left neighboring sample and the upper neighboring sample for intra prediction of the current block. When performing intra prediction in the current block, the intra prediction mode of 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 the predicted sample of the current block according to the intra prediction mode. Here, the intra prediction mode may include, for example, two non - directional intra prediction modes and 33 directional intra prediction modes. Here, the 0th and 1st intra prediction modes are non - directional intra prediction modes, the 0th intra prediction mode indicates the intra - planar mode, and the 1st intra prediction mode indicates the intra - DC mode. The remaining 2nd to 34th intra prediction modes are directional intra prediction modes, and each mode has a prediction direction. The directional intra prediction mode may be referred to as the intra - angular mode. The predicted sample value of the current sample of the current block may be derived based on the intra prediction mode of the current block.

[0080] For example, when the intra prediction mode of the current block is one of the directional intra modes, the value of the neighboring sample located in the prediction direction of the intra prediction mode of the current block may be derived based on the current sample in the current block as the predicted sample value of the current sample. When the neighboring sample of the integer sample unit is not located in the prediction direction based on the current sample, the sample value of the fractional sample unit may be derived as the predicted sample value of the current sample by interpolating based on the neighboring samples of the integer sample unit located near the corresponding prediction direction to derive the sample of the fractional sample unit at the position of the corresponding prediction direction.

[0081] As described above, when generating a prediction sample of a current block using at least one of a left neighboring sample and an upper neighboring sample, the prediction accuracy may decrease as the distance between the prediction sample and the neighboring sample increases. In addition, since the prediction sample is generated by referring to only one row or one column of the neighboring samples, when noise information is included in the samples adjacent to the current block, the prediction accuracy of the current block deteriorates significantly, and thus the overall coding efficiency may be deteriorated. Therefore, the present invention proposes a method for generating a reference sample based on a plurality of left neighboring samples and upper neighboring samples, that is, multiple columns of left neighboring samples and multiple rows of upper neighboring samples, and performing intra prediction based on the generated reference sample, so as to improve the prediction accuracy of intra prediction and improve the coding efficiency. In the following embodiments, a method for generating one left reference sample (or upper reference sample) based on four left neighboring samples (or upper neighboring samples) is described, but randomly n (n>1) left neighboring samples (or upper neighboring samples) can be used, and thus a left reference sample (or upper reference sample) can be generated.

[0082] Figure 4 FIG. illustrates an example of deriving a reference sample based on a plurality of neighboring samples of a current block. Refer to Figure 4 , when the size of the current block is N×N, 2N upper reference samples can be generated based on the upper neighboring samples in a 2N×4-sized region, and 2N left reference samples can be generated based on the left neighboring samples in a 4×2N-sized region. Specifically, one upper reference sample located in a specific column can be generated based on four upper neighboring samples located in a specific column of the upper neighboring samples, and one left reference sample located in a specific row can be generated based on four left neighboring samples located in a specific row of the left neighboring samples. For example, the average value of the sample values of the four upper neighboring samples located in the x-th column of the upper neighboring samples can be derived as the sample value of the upper reference sample in the x-th column. In addition, the average value of the sample values of the four left neighboring samples located in the y-th column of the left neighboring samples can be derived as the sample value of the left reference sample in the y-th row.

[0083] As described above, the same weights {1 / 4, 1 / 4, 1 / 4, 1 / 4} can be assigned to neighboring samples for generating reference samples. However, in other words, the weights of neighboring samples for generating reference samples can be the same as 1 / 4, but the prediction accuracy can be decreased proportionally to the distance between the neighboring samples and the current block to be encoded. Therefore, when the four upper neighboring samples are represented as the first row upper neighboring sample, the second row upper neighboring sample, the third row upper neighboring sample, and the fourth row upper neighboring sample in the upward direction from the lower side, the weight of the first row upper neighboring sample can be assigned as 1 / 2, the weight of the second row upper neighboring sample can be assigned as 1 / 4, and the weights of the third row upper neighboring sample and the fourth row upper neighboring sample can be assigned as 1 / 8. Thus, samples with a small distance from the current block among the upper neighboring samples can be more used for generating the upper reference sample. In addition, when the four left neighboring samples are represented as the first column left neighboring sample, the second column left neighboring sample, the third column left neighboring sample, and the fourth column left neighboring sample in the direction from right to left, the weight of the first column left neighboring sample can be assigned as 1 / 2, the weight of the second column left neighboring sample can be assigned as 1 / 4, and the weights of the third column left neighboring sample and the fourth column left neighboring sample can be assigned as 1 / 8.

[0084] In addition, in another example, the weights of the first row upper neighboring sample and the second row upper neighboring sample can be assigned as 2 / 5, and the weights of the third row upper neighboring sample and the fourth row upper neighboring sample can be assigned as 1 / 10. In addition, the weight of the first column left neighboring sample can be assigned as 1 / 2, the weight of the second column left neighboring sample can be assigned as 1 / 4, and the weights of the third column left neighboring sample and the fourth column left neighboring sample are assigned as 1 / 8.

[0085] In addition, the method of assigning weights to each neighboring sample can include various methods other than the above examples. For example, the weights of each neighboring sample can be assigned according to the distance between each neighboring sample and the current block, the weights of each neighboring sample can be assigned according to the size of the current block, and the weights of each neighboring sample can be assigned according to the quantization parameter (QP) of the current block. In addition, the weights of each neighboring sample can be assigned based on various criteria. The upper reference sample can be derived based on the upper neighboring samples and the weights assigned to each upper neighboring sample. In addition, the left reference sample can be derived based on the left neighboring samples and the weights assigned to each left neighboring sample. In addition, the upper reference sample or the left reference sample can be derived based on the following equation.

[0086] [Equation 1]

[0087] D' = w1 * D + w2 * C + w3 * B + w4 * A

[0088] Among them, D' can represent the upper reference sample (or the left reference sample), w1 can represent the weight of the neighboring sample on the first row (or the left neighboring sample in the first column), w2 can represent the weight of the neighboring sample on the second row (or the left neighboring sample in the second column), w3 can represent the weight of the neighboring sample on the third row (or the left neighboring sample in the third column), and w4 can represent the weight of the neighboring sample on the fourth row (or the left neighboring sample in the fourth column). In addition, D can represent the neighboring sample on the first row (or the left neighboring sample in the first column), C can represent the neighboring sample on the second row (or the left neighboring sample in the second column), B can represent the neighboring sample on the third row (or the left neighboring sample in the third column), and A can represent the neighboring sample on the fourth row (or the left neighboring sample on the left side of the fourth column).

[0089] As described above, the reference sample of the current block can be derived based on 2N neighboring samples of multiple columns or rows, but the reference sample can be derived based on the neighboring samples of 2N neighboring samples of more than multiple rows or columns according to the prediction direction of the current block.

[0090] Figure 5 An example of deriving a reference sample based on multiple neighboring samples of the current block is illustrated. Refer to Figure 5 , the intra prediction mode of the current block can be derived, and the prediction direction according to the intra prediction mode can be derived. The reference sample of the current block can be generated based on the neighboring samples located in the prediction direction. In this case, as Figure 5 shown, the prediction direction of the current block can point from the upper right side to the lower left side, and the upper neighboring samples located in the additional region 510 shown in Figure 5 may be required to predict the current block. In other words, L upper neighboring samples and 2N upper neighboring samples located in the first row may be required to predict the current block. In addition, M upper neighboring samples and 2N upper neighboring samples located in the fourth row may be required to predict the current block. Therefore, the neighboring samples located in the additional region 510 can be generated, and the reference sample of the current block can be generated based on the neighboring samples located in the prediction direction of the current block among the neighboring samples including the additional region 510. The samples located in the additional region 510 can be generated by filling the sample value of the rightmost upper neighboring sample in each row of the upper neighboring samples. That is to say, the sample value of the samples located in the additional region 510 can be derived to be equal to the sample value of the rightmost upper neighboring sample in each row of the upper neighboring samples. Although an example of generating the samples located in the additional region of the left neighboring samples is not shown in the drawings, similar to the example of generating the samples located in the additional region 510, the samples located in the additional region of the left neighboring samples can be generated. Specifically, the samples located in the additional region of the left neighboring samples can be generated by filling the sample value of the lowest left neighboring sample in each column of the left neighboring samples.

[0091] When exporting upper neighboring samples of the upper neighboring samples including the additional region 510, an upper reference sample of the current block may be generated based on the upper neighboring samples. Embodiments of generating the upper reference sample may be illustrated in the following figures.

[0092] Figure 6 An example of generating an upper reference sample of the current block based on upper neighboring samples including additionally generated upper neighboring samples is illustrated. Figure 6 (b) illustrates the position of the newly generated upper reference sample. In this case, at the position of the upper reference sample 610, upper neighboring samples at positions corresponding to the prediction direction of the current block may be used to generate the upper reference sample 610. For example, as Figure 6 shown in (a), at the position of the upper reference sample 610, upper neighboring samples A, upper neighboring sample B, upper neighboring sample C, and upper neighboring sample D, which are upper neighboring samples at positions corresponding to the prediction direction of the current block, may be used to generate the upper reference sample 610. When all positions of the upper neighboring samples A, upper neighboring sample B, upper neighboring sample C, and upper neighboring sample D are integer sample positions, that is, when all upper neighboring samples A, upper neighboring sample B, upper neighboring sample C, and upper neighboring sample D are integer samples, the upper reference sample 610 may be generated based on the sample values of the upper neighboring samples A, upper neighboring sample B, upper neighboring sample C, and upper neighboring sample D. Similarly, left neighboring samples positioned in the prediction direction of the current block may be derived based on the position of the left reference sample, and a left reference sample may be generated based on the left neighboring samples.

[0093] When there are positions other than integer sample positions among the positions of the upper neighboring samples A, upper neighboring sample B, upper neighboring sample C, and upper neighboring sample D, that is, when there are fractional samples among the upper neighboring samples A, upper neighboring sample B, upper neighboring sample C, and upper neighboring sample D, fractional samples may be derived, as shown in the following figures.

[0094] Figure 7 An example of deriving neighboring samples positioned at fractional sample positions is illustrated. Referring to Figure 7 , the sample value of the neighboring sample X as a fractional sample may be generated by linearly interpolating the sample values of the integer samples D1 and D2 adjacent to the left and right of the neighboring sample. That is, when the upper neighboring sample A, upper neighboring sample B, upper neighboring sample C, or upper neighboring sample D is a fractional sample, a fractional sample may be derived based on the upper neighboring samples at integer sample positions adjacent to the fractional sample. A fractional sample may be derived based on the following equation.

[0095] [Equation 2]

[0096] X = (D1 * d1 + D2 * d2 + (d1 + d2) / 2) / (d1 + d2)

[0097] Where X may represent a fractional sample, D1 may represent an integer sample adjacent to the left of the fractional sample, D2 may represent an integer sample adjacent to the right of the fractional sample, d1 may represent the distance between D2 and X, and d2 may represent the distance between D1 and X.

[0098] The values of each upper neighboring sample for generating an upper reference sample can be derived by the above method. When deriving an upper neighboring sample at an integer sample position or a fractional sample position, an upper reference sample can be generated based on the upper neighboring sample. An upper reference sample can be generated by assigning the same weight to each upper reference sample as described above. Alternatively, the weight of each upper reference sample can be assigned considering the distance between the current block and each upper reference sample, and an upper reference sample can be generated based on each upper reference sample and the weight. Alternatively, the weight of each upper reference sample can be assigned based on various criteria such as the QP or size of the current block, and an upper reference sample can be generated based on each upper reference sample and the weight. In addition, an upper reference sample can be generated by replacing the upper neighboring sample and the weight assigned to each upper neighboring sample in Equation 1. In addition, when there is a fractional sample among the left neighboring samples, a fractional sample can be derived similar to the above description, and a left reference sample can be derived based on the fractional sample.

[0099] When generating a reference sample based on neighboring samples located in the prediction direction of the current block, the same weights {1 / 4, 1 / 4, 1 / 4, 1 / 4} can be assigned to the neighboring samples used to generate the reference sample, or the weight of each neighboring sample can be assigned according to the distance between each neighboring sample and the current block as described above. Alternatively, the weight of each neighboring sample can be assigned according to the size of the current block or the quantization parameter (QP) of the current block. In addition, the weight of each neighboring sample can be assigned based on various criteria. An upper reference sample can be derived based on the upper neighboring sample and the weight assigned to each upper neighboring sample. In addition, a left reference sample can be derived based on the left neighboring sample and the weight assigned to each left neighboring sample.

[0100] As described above, when deriving a reference sample based on 2N neighboring samples of multiple columns or rows and neighboring samples included in an additional region according to the prediction direction of the current block, samples located in the additional region can be generated by padding as described above, but when neighboring samples located in the additional region have been restored, the restored neighboring samples of the additional region can be used, and when neighboring samples located in the additional region are not restored, neighboring samples can be generated by the above padding.

[0101] Figure 8The figure shows an example of generating an upper reference sample of a current block based on upper neighboring samples including additionally generated upper neighboring samples. As described above, an intra prediction mode of the current block can be derived, and a reference sample of the current block can be generated based on neighboring samples located in the prediction direction. In this case, as shown in Figure 8 (a), the prediction direction of the current block can point from the upper right side to the lower left side, and upper neighboring samples located in an additional region 810 as shown in Figure 8 (a) may be required for predicting the current block. When the upper neighboring samples included in the additional region 810 have been restored, the restored upper neighboring samples can be used to generate the upper reference sample. As shown in Figure 8 (b), when the upper neighboring samples located in the additional region 820 have not been restored, samples located in the additional region 820 can be generated by filling the sample value of the rightmost upper neighboring sample in each row. That is, the sample value of the samples located in the additional region 820 can be derived to be equal to the sample value of the rightmost upper neighboring sample in each row of the upper neighboring samples. Although an additional region of left neighboring samples is not shown in the drawings, similar to the method of deriving the upper neighboring samples included in the additional region 810, left neighboring samples included in the additional region of left neighboring samples can be derived.

[0102] Embodiments of generating the above reference sample can be selected based on the prediction direction of the current block. That is, a reference sample of the current block can be generated by other methods according to the intra prediction mode.

[0103] Figure 9 The figure shows an example of dividing the intra prediction mode according to the prediction direction. Referring to Figure 9 , the intra prediction mode can be divided into four regions according to the prediction direction. As shown in Figure 9 , the intra prediction mode can be included in region A, region B, region C, or region D according to the prediction direction. Specifically, for example, the 2nd to 9th intra prediction modes can be included in region A, the 10th to 17th intra prediction modes can be included in region B, the 18th to 26th intra prediction modes can be included in region C, and the 27th to 34th intra prediction modes can be included in region D. A method of deriving a reference sample of the current block based on the intra prediction mode applied to the current block can be determined.

[0104] For example, when the intra prediction mode included in region D is applied to the current block, it can be through Figure 8The method shown in derives reference samples for the current block. In other words, 2N upper neighboring samples of multiple lines of the current block and upper neighboring samples of the additional region can be generated, and at the position of the upper reference sample of the current block among the 2N upper neighboring samples of multiple lines and the upper neighboring samples of the additional region, the upper reference sample of the current block can be generated based on the neighboring samples positioned in the prediction direction. When the upper neighboring samples of the additional region have been restored, the restored upper neighboring samples can be used to generate the reference samples of the current block, and when the upper neighboring samples of the additional region have not been restored, the upper neighboring samples can be generated by filling the sample values of the rightmost upper neighboring sample in the 2N upper neighboring samples of each line.

[0105] As another example, when the intra prediction mode included in region C is applied to the current block, reference samples for the current block can be generated as Figure 10 shown.

[0106] Figure 10 The figure shows an example of generating the upper reference sample of the current block based on the upper neighboring samples including additionally generated upper neighboring samples. When Figure 10 the upper reference sample D' shown in (b) is generated, D' can be generated based on the upper neighboring samples A, B, C, and D at the position corresponding to the prediction direction of the current block at the position of D' shown in Figure 10 (a). When all the positions of the upper neighboring samples A, B, C, and D are integer sample positions, that is, when A, B, C, and D are all integer samples, D' can be generated based on the sample values of A, B, C, and D. When there are samples with fractional sample positions among the positions of the upper neighboring samples A, B, C, and D, that is, when there are fractional samples among A, B, C, and D, the sample values of the integer samples adjacent to the left and right of the fractional samples can be generated by linear interpolation, and D' can be generated based on the generated fractional samples, as described above. In addition, at the position of H' shown in Figure 10 (a), H' can be generated based on the upper neighboring samples E, F, G, and H at the position corresponding to the prediction direction of the current block. When all the positions of the upper neighboring samples E, F, G, and H are integer sample positions, that is, when E, F, G, and H are all integer samples, H' can be generated based on the sample values of E, F, G, and H. When there are samples with fractional sample positions among the positions of the upper neighboring samples E, F, G, and H, that is, when there are fractional samples among E, F, G, and H, the sample values of the integer samples adjacent to the left and right of the fractional samples can be generated by linear interpolation, and H' can be generated based on the generated fractional samples as described above.

[0107] When the intra prediction mode included in region B is applied to the current block and when the intra prediction mode included in region C is applied to the current block, the reference samples of the current block can be generated by the same method as the method for deriving the reference samples of the current block. In addition, when the intra prediction mode included in region A is applied to the current block and when the intra prediction mode included in region D is applied to the current block, the reference samples of the current block can be generated by the same method as the method for deriving the reference samples of the current block.

[0108] Figure 11 Schematically illustrate a video encoding method by an encoding device according to the present invention. Figure 11 The method disclosed in can be performed by Figure 1 the encoding device shown in. Specifically, for example, Figure 11 S1100 to S1140 of can be performed by the prediction unit of the encoding device, and S1150 can be performed by the entropy encoding unit of the encoding device.

[0109] The encoding device determines the intra prediction mode of the current block (S1100). 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 can include the intra DC mode and the intra plane mode.

[0110] The encoding device derives the multi-row up-neighboring samples and the multi-column left-neighboring samples of the current block (S1110). The encoding device can derive the multi-row up-neighboring samples of the current block. For example, the encoding device can derive 4 row up-neighboring samples of the current block. In addition, for example, when the size of the current block is N×N, the encoding device can derive 2N up-neighboring samples in each row of the multi-rows. The 2N up-neighboring samples in each row can be referred to as the first up-neighboring samples.

[0111] The up-reference samples can be derived based on specific up-neighboring samples derived based on the position of the up-reference samples and the prediction direction of the intra prediction mode of the current block, as will be described later. In this case, the up-neighboring samples other than the first up-neighboring samples can be used to derive the up-reference samples according to the prediction direction of the current block.

[0112] For example, when the size of the current block is N×N, the number of upper neighboring samples of the n-th row among the neighboring samples on multiple rows can be greater than 2N. As another example, when the n-th row is the first row, the number of upper neighboring samples of the n-th row is 2N, and the number of upper neighboring samples of the (n + 1)-th row can be greater than 2N. In addition, the number of upper neighboring samples of the n-th row among the neighboring samples on multiple rows of the current block can be less than the number of upper neighboring samples of the (n + 1)-th row. Specifically, the number of upper neighboring samples of the (n + 1)-th row can be greater than 2N, and the upper neighboring samples after the 2N-th upper neighboring sample among the upper neighboring samples of the (n + 1)-th row can be derived by padding the 2N-th upper neighboring sample among the upper neighboring samples of the (n + 1)-th row. Alternatively, before generating the prediction samples of the current block, when generating the reconstruction samples corresponding to the upper neighboring samples after the 2N-th upper neighboring sample among the upper neighboring samples of the (n + 1)-th row, the reconstruction samples can be described as the upper neighboring samples after the 2N-th upper neighboring sample.

[0113] As another example, when the size of the current block is N×N, the encoding device can derive the second upper neighboring samples of each row based on the prediction direction of the current block. Here, the second upper neighboring samples can represent the upper neighboring samples other than the first upper neighboring samples of each row. The number of second upper neighboring samples of each row can be determined based on the prediction direction. The second upper neighboring samples of each row can be derived by padding the second upper neighboring sample located at the rightmost position among the first upper neighboring samples of each row. Alternatively, before generating the prediction samples of the current block, when generating the reconstruction samples of the second upper neighboring samples, the reconstruction samples can be derived as the second upper neighboring samples, and before generating the prediction samples of the current block, when the reconstruction samples of the second upper neighboring samples are not generated, the second upper neighboring samples of each row can be derived by padding the second upper neighboring sample located at the rightmost position among the first upper neighboring samples of each row.

[0114] In addition, in another example, the encoding device can derive the left neighboring samples of multiple columns of the current block. For example, the encoding device can derive the left neighboring samples of four columns of the current block. In addition, for example, when the size of the current block is N×N, the encoding device can derive 2N left neighboring samples in each of the multiple columns. The 2N left neighboring samples in each column can be referred to as the first left neighboring samples.

[0115] The left reference samples can be derived based on specific left neighboring samples derived based on the position of the left reference samples and the prediction direction of the intra prediction mode of the current block, as described later. In this case, the left neighboring samples other than the first left neighboring samples can be used to derive the left reference samples according to the prediction direction of the current block.

[0116] For example, when the size of the current block is NxN, the number of left neighboring samples in the n-th column among the multi-column left neighboring samples can be greater than 2N. In another example, when the n-th column is the first column, the number of left neighboring samples in the n-th column is 2N, and the number of left neighboring samples in the (n + 1)-th column can be more than 2N. In addition, the number of left neighboring samples in the n-th column among the multi-column left neighboring samples of the current block can be less than the number of left neighboring samples in the (n + 1)-th column. Specifically, the number of left neighboring samples in the (n + 1)-th column can be greater than 2N, and the left neighboring samples after the 2N-th left neighboring sample in the (n + 1)-th column of left neighboring samples can be derived by padding the 2N-th left neighboring sample in the (n + 1)-th column of left neighboring samples. Alternatively, before generating the prediction samples of the current block, when generating the reconstruction samples corresponding to the left neighboring samples after the 2N-th left neighboring sample in the (n + 1)-th column of left neighboring samples, the reconstruction samples can be derived as the left neighboring samples after the 2N-th left neighboring sample.

[0117] As another example, when the size of the current block is N×N, the encoding device can derive the second left neighboring samples of each column based on the prediction direction of the current block. Here, the second left neighboring samples can represent the left neighboring samples other than the first left neighboring samples of each row. The number of second left neighboring samples of each column can be determined based on the prediction direction. The second left neighboring samples of each column can be derived by padding the second left neighboring sample located at the lowermost side among the first left neighboring samples of each column. Alternatively, before generating the prediction samples of the current block, when generating the reconstruction samples of the second left neighboring samples, the reconstruction samples can be derived as the second left neighboring samples, and before generating the prediction samples of the current block, when the reconstruction samples of the second left neighboring samples are not generated, the second left neighboring samples of each column can be derived by padding the second left neighboring sample located at the lowermost side among the first left neighboring samples of each column.

[0118] The encoding device derives a row of upper reference samples based on upper neighboring samples (S1120). The encoding device can derive a row of upper reference samples based on multiple rows of upper neighboring samples.

[0119] For example, the upper reference sample located in the x-th column of the upper reference samples can be derived based on the upper neighboring samples located in the x-th column of the upper neighboring samples. In this case, the average value of the sample values of the upper neighboring samples located in the x-th column can be derived as the sample value of the upper reference sample located in the x-th column. In addition, the weight of the upper neighboring samples located in the x-th column can be derived, and the upper reference sample located in the x-th column can be derived based on the weight and the upper neighboring samples located in the x-th column. When deriving the weight of the upper neighboring samples located in the x-th column, the upper reference sample can be derived based on Equation 1.

[0120] For example, weights can be derived based on the distance between an upper neighboring sample and an upper reference sample located in the x-th column. That is, based on the distance between a corresponding upper neighboring sample and the upper reference sample, the weight of the corresponding upper neighboring sample among the upper neighboring samples located in the x-th column can be derived. For example, the weight of a corresponding upper neighboring sample can be inversely proportional to the distance between the corresponding upper neighboring sample and the upper reference sample. Specifically, when four rows of upper neighboring samples are derived, the weights of the upper neighboring samples can be derived in the order from bottom to top as 1 / 2, 1 / 4, 1 / 8, and 1 / 8. Alternatively, the weights of the upper neighboring samples can be derived in the order from bottom to top as 2 / 5, 2 / 5, 1 / 10, and 1 / 10.

[0121] In addition, in another example, weights can be derived based on the quantization parameter (QP) or size of the current block. Additionally, weights can be derived based on various criteria.

[0122] As another example, the first upper reference sample among the upper reference samples can be derived based on a specific upper neighboring sample derived based on the position of the first upper reference sample and the prediction direction of the current block. Specifically, a specific upper neighboring sample located in the prediction direction of the current block can be derived based on the position of the upper reference sample, and the upper reference sample can be derived based on the specific upper neighboring sample. In this case, the average value of the sample values of the specific upper neighboring samples can be derived as the sample value of the first upper reference sample. Additionally, the weights of the specific upper neighboring samples can be derived, and the first upper reference sample can be derived based on these weights and the specific upper neighboring samples. When deriving the weights of the specific upper neighboring samples, the first upper reference sample can be derived based on Equation 1.

[0123] For example, weights can be derived based on the distance between a specific upper neighboring sample and the first upper reference sample. That is, based on the distance between a corresponding specific upper neighboring sample and the first upper reference sample, the weight of the corresponding specific upper neighboring sample among the specific upper neighboring samples can be derived. For example, the weight of a corresponding specific upper neighboring sample can be inversely proportional to the distance between the corresponding specific upper neighboring sample and the first upper reference sample.

[0124] In addition, in another example, weights can be derived based on the quantization parameter (QP) or size of the current block. Additionally, weights can be derived based on various criteria.

[0125] When the specific upper neighboring sample derived based on the prediction direction of the current block includes an upper neighboring sample as a fractional sample, the sample value of the upper neighboring sample as a fractional sample can be derived by linear interpolation between the sample values of the integer samples adjacent to the left and right of the upper neighboring sample as a fractional sample. For example, the sample value of the upper neighboring sample as a fractional sample can be derived based on Equation 2.

[0126] A method for deriving an upper reference sample based on an intra prediction mode of a current block can be determined. For example, when the intra prediction mode of the current block is a mode having a prediction angle greater than the vertical mode, that is, when the intra prediction mode of the current block is one of the 27th to 34th intra prediction modes, the corresponding upper reference sample of the upper reference sample can be derived based on the position of the corresponding upper reference sample and based on a specific upper neighboring sample located in the prediction direction of the current block. Here, the vertical mode may correspond to the 26th intra prediction mode. In addition, when the intra prediction mode of the current block is a mode having a prediction angle less than or equal to the vertical mode, that is, when the intra prediction mode of the current block is one of the 18th to 26th intra prediction modes, the corresponding upper reference sample of the upper reference sample can be derived based on an upper neighboring sample located in the same column as the column of the corresponding upper reference sample.

[0127] The encoding device derives a row of left reference samples based on left neighboring samples (S1130). The encoding device can derive a column of left reference samples based on multiple columns of left neighboring samples.

[0128] For example, the left reference sample located in the y-th row of the left reference samples can be derived based on the left neighboring sample located in the y-th row of the left neighboring samples. In this case, the average value of the sample values of the left neighboring samples located in the y-th row can be derived as the sample value of the left reference sample located in the y-th row. In addition, the weight of the left neighboring samples located in the y-th row can be derived, and the left reference sample located in the y-th row can be derived based on the weight and the left neighboring samples located in the y-th row. When deriving the weight of the left neighboring samples located in the y-th row, the left reference sample can be derived based on Equation 1.

[0129] For example, the weight can be derived based on the distance between the left neighboring sample and the left reference sample located in the y-th row. That is, the weight of the corresponding left neighboring sample in the left neighboring samples located in the y-th row can be derived based on the distance between the corresponding left neighboring sample and the left reference sample, and for example, the weight of the corresponding left neighboring sample can be inversely proportional to the distance between the corresponding left neighboring sample and the left reference sample. Specifically, when deriving four columns of left neighboring samples, the weights of the left neighboring samples can be derived as 1 / 2, 1 / 4, 1 / 8, and 1 / 8 in the order from right to left. Alternatively, the weights of the left neighboring samples can be derived as 2 / 5, 2 / 5, 1 / 10, and 1 / 10 in the order from right to left.

[0130] In addition, in another example, the weight can be derived based on the quantization parameter (QP) or size of the current block. In addition, the weight can be derived based on various criteria.

[0131] As another example, a first left reference sample of the left reference samples can be derived based on a specific left neighboring sample derived based on the position of the first left reference sample and the prediction direction of the current block. Specifically, a specific left neighboring sample located in the prediction direction of the current block can be derived based on the position of the left reference sample, and the left reference sample can be derived based on the specific left neighboring sample. In this case, the average value of the sample values of the specific left neighboring samples can be derived as the sample value of the first left reference sample. In addition, weights of the specific left neighboring samples can be derived, and the first left reference sample can be derived based on the weights and the specific left neighboring samples. When deriving the weights of the specific left neighboring samples, the first left reference sample can be derived based on Equation 1.

[0132] For example, the weights can be derived based on the distance between the specific left neighboring sample and the first left reference sample. That is, the weights of the corresponding specific left neighboring samples in the specific left neighboring samples can be derived based on the distance between the corresponding specific left neighboring sample and the first left reference sample, and for example, the weight of the corresponding specific left neighboring sample can be inversely proportional to the distance between the corresponding specific left neighboring sample and the first left reference sample.

[0133] In addition, in another example, the weights can be derived based on the quantization parameter (QP) or size of the current block. In addition, the weights can be derived based on various criteria.

[0134] When the specific left neighboring sample derived based on the prediction direction of the current block includes a left neighboring sample as a fractional sample, the sample value of the left neighboring sample as a fractional sample can be derived by linear interpolation between the sample values of the integer samples adjacent to the left and right of the left neighboring sample as a fractional sample. For example, the sample value of the left neighboring sample as a fractional sample can be derived based on Equation 2.

[0135] A method for deriving the left reference sample based on the intra-frame prediction mode of the current block can be determined. For example, when the intra-frame prediction mode of the current block is a mode with a prediction angle greater than the horizontal mode, that is, when the intra-frame prediction mode of the current block is one of the 2nd to 9th intra-frame prediction modes, the corresponding left reference sample of the left reference sample can be derived based on the position of the corresponding left reference sample, based on a specific left neighboring sample located in the prediction direction of the current block. Here, the horizontal mode can correspond to the 10th intra-frame prediction mode. In addition, when the intra-frame prediction mode of the current block is a prediction angle mode with a prediction angle less than or equal to the horizontal mode, that is, when the intra-frame prediction mode of the current block is one of the 10th to 17th intra-frame prediction modes, the corresponding left reference sample of the left reference sample can be derived based on the left neighboring samples located in the same row as the row of the corresponding left reference sample.

[0136] The encoding device generates prediction samples for a current block (S1140) using at least one of an upper reference sample and a left reference sample according to an intra prediction mode. The encoding device may generate prediction samples based on an upper reference sample or a left reference sample positioned in a prediction direction of the intra prediction mode based on the position of the prediction samples.

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

[0138] Figure 12 Schematically illustrates a video decoding method by a decoding device according to the present invention. Figure 12 The method disclosed in Figure 12 can be performed by a decoding device disclosed in Figure 12 Specifically, for example, S1200 to S1240 of

[0139] The decoding device derives the intra prediction mode of the current block (S1200). 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 information indicating any one candidate in a list of intra prediction mode candidates derived based on the intra prediction mode of the left block or the upper block of the current block. 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 an intra DC mode and an intra plane mode.

[0140] The decoding device derives multiple rows of upper neighboring samples and multiple columns of left neighboring samples of the current block (S1210). The decoding device may derive multiple rows of upper neighboring samples of the current block. For example, the decoding device may derive four rows of upper neighboring samples of the current block. In addition, for example, when the size of the current block is NxN, the decoding device may derive 2N upper neighboring samples in each row of the multiple rows. The 2N upper neighboring samples in each row may be referred to as first upper neighboring samples.

[0141] The upper reference sample can be derived based on a specific upper neighboring sample that is derived based on the position of the upper reference sample of the current block and the prediction direction of the intra prediction mode of the current block, as described later. In this case, upper neighboring samples other than the first upper neighboring sample can be used to derive the upper reference sample according to the prediction direction of the current block.

[0142] For example, when the size of the current block is NxN, the number of upper neighboring samples in the n-th row among multiple rows of upper neighboring samples can be greater than 2N. As another example, when the n-th row is the first row, the number of upper neighboring samples in the n-th row is 2N, and the number of upper neighboring samples in the (n + 1)-th row can be greater than 2N. In addition, the number of upper neighboring samples in the n-th row among multiple rows of upper neighboring samples of the current block can be less than the number of upper neighboring samples in the (n + 1)-th row. Specifically, the number of upper neighboring samples in the (n + 1)-th row can be greater than 2N, and the upper neighboring samples after the 2N-th upper neighboring sample in the upper neighboring samples of the (n + 1)-th row can be derived by padding the 2N-th upper neighboring sample in the upper neighboring samples of the (n + 1)-th row. Alternatively, before generating the prediction sample of the current block, when generating the reconstructed sample corresponding to the upper neighboring sample after the 2N-th upper neighboring sample in the upper neighboring samples of the (n + 1)-th row, the reconstructed sample can be derived as the upper neighboring sample after the 2N-th upper neighboring sample.

[0143] As another example, when the size of the current block is NxN, the decoding device can derive the second upper neighboring sample of each row based on the prediction direction of the current block. Here, the second upper neighboring sample can represent the upper neighboring samples of each row other than the first upper neighboring sample. The number of second upper neighboring samples of each row can be determined based on the prediction direction. The second upper neighboring sample of each row can be derived by padding the first upper neighboring sample located at the rightmost side among the first upper neighboring samples of each row. Alternatively, before generating the prediction sample of the current block, when generating the reconstructed sample of the second upper neighboring sample, the reconstructed sample can be derived as the second upper neighboring sample, and before generating the prediction sample of the current block, when the reconstructed sample of the second upper neighboring sample is not generated, the second upper neighboring sample of each row can be derived by padding the first upper neighboring sample located at the rightmost side among the first upper neighboring samples of each row.

[0144] In addition, in another example, the decoding device can derive multiple columns of left neighboring samples of the current block. For example, the decoding device can derive four columns of left neighboring samples of the current block. In addition, for example, when the size of the current block is NxN, the decoding device can derive 2N left neighboring samples in each of multiple columns. The 2N left neighboring samples in each column can be referred to as the first left neighboring samples.

[0145] The left reference sample can be derived based on a specific left neighboring sample derived based on the position of the left reference sample of the current block and the prediction direction of the intra prediction mode of the current block, as described later. In this case, left neighboring samples other than the first left neighboring sample can be used to derive the left reference sample according to the prediction direction of the current block.

[0146] For example, when the size of the current block is NxN, the number of left neighboring samples in the n-th column of the multi-column left neighboring samples can be greater than 2N. In another example, when the n-th column is the first column, the number of left neighboring samples in the n-th column is 2N, and the number of left neighboring samples in the (n + 1)-th column can be greater than 2N. In addition, the number of left neighboring samples in the n-th column of the multi-column left neighboring samples of the current block can be less than the number of left neighboring samples in the (n + 1)-th column. Specifically, the number of left neighboring samples in the (n + 1)-th column can be greater than 2N, and the left neighboring samples after the 2N-th left neighboring sample in the left neighboring samples of the (n + 1)-th column can be derived by padding the 2N-th left neighboring sample in the left neighboring samples of the (n + 1)-th column. Alternatively, before generating the prediction sample of the current block, when generating the reconstructed sample corresponding to the left neighboring sample after the 2N-th left neighboring sample in the left neighboring samples of the (n + 1)-th column, the reconstructed sample can be derived to the left neighboring sample after the 2N-th left neighboring sample.

[0147] As another example, when the size of the current block is NxN, the decoding device can derive the second left neighboring sample of each column based on the prediction direction of the current block. The number of the second left neighboring samples of each column can be determined based on the prediction direction. The second left neighboring sample of each column can be derived by padding the first left neighboring sample located at the lowermost side in the first left neighboring sample of each column. Alternatively, before generating the prediction sample of the current block, when generating the reconstructed sample of the second left neighboring sample, the reconstructed sample can be derived to the second left neighboring sample, and before generating the prediction sample of the current block, when the reconstructed sample of the second left neighboring sample is not generated, the second left neighboring sample of each column can be derived by padding the first left neighboring sample located at the lowermost side in the first left neighboring sample of each column.

[0148] The decoding device derives one row of upper reference samples based on the upper neighboring samples (S1220). The decoding device can derive one row of upper reference samples based on multiple rows of upper neighboring samples.

[0149] For example, the upper reference sample located in the x-th column in the upper reference sample can be derived based on the upper neighboring samples located in the x-th column in the upper neighboring samples. In this case, the average value of the sample values of the upper neighboring samples located in the x-th column can be derived as the sample value of the upper reference sample located in the x-th column. In addition, the weights of the upper neighboring samples located in the x-th column can be derived, and the upper reference sample located in the x-th column can be derived based on the weights and the upper neighboring samples located in the x-th column. When deriving the weights of the upper neighboring samples located in the x-th column, the upper reference sample can be derived based on Equation 1.

[0150] For example, the weights can be derived based on the distance between the upper neighboring samples located in the x-th column and the upper reference sample. That is, the weights of the corresponding upper neighboring samples in the upper neighboring samples located in the x-th column can be derived based on the distance between the corresponding upper neighboring samples and the upper reference sample, and for example, the weights of the corresponding upper neighboring samples can be inversely proportional to the distance between the corresponding upper neighboring samples and the upper reference sample. Specifically, when deriving four rows of upper neighboring samples, the weights of the upper neighboring samples can be derived as 1 / 2, 1 / 4, 1 / 8, and 1 / 8 in the order from bottom to top. Alternatively, the weights of the upper neighboring samples can be derived as 2 / 5, 2 / 5, 1 / 10, and 1 / 10 in the order from bottom to top.

[0151] In addition, in another example, the weights can be derived based on the quantization parameter (QP) or size of the current block. In addition, the weights can be derived based on various criteria.

[0152] As another example, the first upper reference sample in the upper reference sample can be derived based on a specific upper neighboring sample derived based on the position of the first upper reference sample of the current block and the prediction direction of the current block. Specifically, a specific upper neighboring sample located in the prediction direction of the current block can be derived based on the position of the upper reference sample, and the upper reference sample can be derived based on the specific upper neighboring sample. In this case, the average value of the sample values of the specific upper neighboring sample can be derived as the sample value of the first upper reference sample. In addition, the weights of the specific upper neighboring sample can be derived, and the first upper reference sample can be derived based on the weights and the specific upper neighboring sample. When deriving the weights of the specific upper neighboring sample, the first upper reference sample can be derived based on Equation 1.

[0153] For example, the weights can be derived based on the distance between the specific upper neighboring sample and the first upper reference sample. That is, the weights of the corresponding specific upper neighboring samples in the specific upper neighboring sample can be derived based on the distance between the corresponding specific upper neighboring samples and the first upper reference sample, and for example, the weights of the corresponding specific upper neighboring samples can be inversely proportional to the distance between the corresponding specific upper neighboring samples and the first upper reference sample.

[0154] In addition, in another example, weights can be derived based on the quantization parameter (QP) or size of the current block. Additionally, weights can be derived based on various criteria.

[0155] When a specific upper neighboring sample derived based on the prediction direction of the current block includes an upper neighboring sample as a fractional sample, the sample value of the upper neighboring sample as a fractional sample can be derived by linear interpolation between the sample values of the integer samples adjacent to the left and right of the upper neighboring sample as a fractional sample. For example, the sample value of the upper neighboring sample as a fractional sample can be derived based on Equation 2.

[0156] A method for deriving upper reference samples based on the intra prediction mode of the current block can be determined. For example, when the intra prediction mode of the current block is a mode with a prediction angle greater than the vertical mode, that is, when the intra prediction mode of the current block is one of the 27th to 34th intra prediction modes, the corresponding upper reference samples of the upper reference samples can be derived based on the positions of the corresponding upper reference samples based on specific upper neighboring samples located in the prediction direction of the current block. Here, the vertical mode can correspond to the 26th intra prediction mode. When the intra prediction mode of the current block is a mode with a prediction angle less than or equal to the vertical mode, that is, when the intra prediction mode of the current block is one of the 18th to 26th intra prediction modes, the corresponding upper reference samples of the upper reference samples can be derived based on the upper neighboring samples located in the same column as the column of the corresponding upper reference sample.

[0157] The decoding device derives a row of left reference samples based on left neighboring samples (S1230). The decoding device can derive a row of left reference samples based on multiple columns of left neighboring samples.

[0158] For example, the left reference sample located in the y-th row in the left reference samples can be derived based on the left neighboring samples located in the y-th row. In this case, the average value of the sample values of the left neighboring samples located in the y-th row can be derived as the sample value of the left reference sample located in the y-th row. Additionally, the weights of the left neighboring samples located in the y-th row can be derived, and the left reference sample located in the y-th row can be derived based on the weights and the left neighboring samples located in the y-th row. When deriving the weights of the left neighboring samples located in the y-th row, the left reference samples can be derived based on Equation 1.

[0159] For example, weights can be derived based on the distance between a left neighboring sample located in the y-th row and a left reference sample. That is, the weights of the corresponding left neighboring samples among the left neighboring samples located in the y-th row can be derived based on the distance between the corresponding left neighboring samples and the left reference sample, and for example, the weights of the corresponding neighboring samples can be inversely proportional to the distance between the corresponding left neighboring samples and the left reference sample. Specifically, when four columns of left neighboring samples are derived, the weights of the left neighboring samples can be derived in the order from right to left as 1 / 2, 1 / , 1 / 8, and 1 / 8. Alternatively, the weights of the left neighboring samples can be derived in the order from right to left as 2 / 5, 2 / 5, 1 / 10, and 1 / 10.

[0160] In addition, in another example, weights can be derived based on the quantization parameter (QP) or size of the current block. Additionally, weights can be derived based on various criteria.

[0161] As another example, the first left reference sample among the left reference samples can be derived based on a specific left neighboring sample derived based on the position of the first left reference sample of the current block and the prediction direction of the current block. Specifically, a specific left neighboring sample located in the prediction direction of the current block can be derived based on the position of the left reference sample, and the left reference sample can be derived based on the specific left neighboring sample. In this case, the average value of the sample values of the specific left neighboring sample can be derived as the sample value of the first left reference sample. Additionally, the weights of the specific left neighboring sample can be derived, and the first left reference sample can be derived based on the weights and the specific left neighboring sample. When deriving the weights of the specific left neighboring sample, the first left reference sample can be derived based on Equation 1.

[0162] For example, weights can be derived based on the distance between a specific left neighboring sample and the first left reference sample. That is, the weights of the corresponding specific left neighboring samples among the specific left neighboring samples can be derived based on the distance between the corresponding specific left neighboring samples and the first left reference sample, and for example, the weights of the corresponding specific left neighboring samples can be inversely proportional to the distance between the corresponding specific left neighboring samples and the first left reference sample.

[0163] In addition, in another example, weights can be derived based on the quantization parameter (QP) or size of the current block. Additionally, weights can be derived based on various criteria.

[0164] When the specific left neighboring sample derived based on the prediction direction of the current block includes a left neighboring sample that is a fractional sample, the sample value of the left neighboring sample that is a fractional sample can be derived by linear interpolation between the sample values of the integer samples adjacent to the left and right sides of the left neighboring sample that is a fractional sample. For example, the sample value of the left neighboring sample that is a fractional sample can be derived based on Equation 2.

[0165] A method for deriving a left reference sample based on an intra prediction mode of a current block can be determined. For example, when the intra prediction mode of the current block is a mode having a prediction angle greater than the horizontal mode, i.e., when the intra prediction mode of the current block is one of the 2nd to 9th intra prediction modes, a corresponding left reference sample of the left reference sample can be derived based on a specific left neighboring sample located in the prediction direction of the current block based on the position of the corresponding left reference sample. Here, the horizontal mode may correspond to the 10th intra prediction mode. In addition, when the intra prediction mode of the current block is a mode having a prediction angle less than or equal to the horizontal mode, i.e., when the intra prediction mode of the current block is one of the 10th to 17th intra prediction modes, a corresponding left reference sample of the left reference sample can be derived based on a left neighboring sample located in the same row as the row of the corresponding left reference sample.

[0166] The decoding device generates prediction samples for the current block using at least one of an upper reference sample and a left reference sample according to the intra prediction mode (S1240). The decoding device can generate prediction samples based on the position of the prediction samples based on an upper reference sample or a left reference sample located in the prediction direction of the intra prediction mode.

[0167] Although not shown in the drawings, the decoding device can immediately use the prediction samples as reconstructed samples according to the prediction mode, or can add residual samples to the prediction samples to generate reconstructed samples. When there are residual samples of a target block, the decoding device can receive information about the residual samples of the target block, and the information about the residual samples can be included in the information about the pacing. The information about the residual samples can include transform coefficients related to the residual samples. The decoding device can derive the residual samples (or a residual sample array) of the target block based on the residual information. The decoding device can generate reconstructed samples based on the prediction samples and the residual samples, and can derive a reconstructed block or a reconstructed picture based on the reconstructed samples. Thereafter, it is described that the decoding device can apply deblocking filtering and / or a loop filtering process such as the SAO process to the reconstructed picture as needed to improve the subjective / objective picture quality.

[0168] According to the present invention, it is possible to derive a reference sample of a current block based on a plurality of neighboring samples, and by performing intra prediction based on the reference sample, the prediction accuracy of the current block can be improved, thereby improving the overall coding efficiency.

[0169] In addition, according to the present invention, a reference sample can be derived based on a plurality of neighboring samples located in the prediction direction of the intra prediction mode of the current block, and by performing intra prediction based on the reference sample, the prediction accuracy of the current block can be improved, thereby improving the overall coding efficiency.

[0170] In addition, according to the present invention, weights of a plurality of neighboring samples can be derived, a reference sample can be derived based on the weights and the neighboring samples, and by performing intra prediction based on the reference sample, the prediction accuracy of the current block can be improved, thereby improving the overall coding efficiency.

[0171] In the above embodiments, these methods are described based on a flowchart having 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 with or in a different order from other steps or blocks. In addition, those skilled in the art will understand that the steps shown in the above flowchart are not exclusive, may include other steps, or one or more steps in the flowchart may be deleted without affecting the scope of the present disclosure.

[0172] The method according to the present invention described above can be implemented by software. The encoding device and / or decoding device according to the present invention may be included in a device that performs image processing, for example, for a TV, a computer, a smart phone, a set-top box, or a display device.

[0173] When implementing the embodiments of the present invention by software, the above methods can be implemented by modules (processing, functions, etc.) that execute the above functions. These modules can be stored in a memory and executed by a processor. The memory may be internal or external to the processor, and the memory may be coupled to the processor using various well-known means. The processor may include an application specific integrated circuit (ASIC), other chip sets, 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 method for decoding video performed by a decoding device, the method comprising: Deriving an intra prediction mode of a current block; Deriving multiple rows of upper neighboring samples and multiple columns of left neighboring samples of the current block; Deriving a row of upper reference samples based on the upper neighboring samples; Deriving a column of left reference samples based on the left neighboring samples; And Generating prediction samples of the current block based on the intra prediction mode, the upper reference samples, and the left reference samples, wherein an upper reference sample located in the x-th column among the upper reference samples is derived based on an upper neighboring sample located in the x-th column among the upper neighboring samples; wherein weights of the upper neighboring samples located in the x-th column are derived, and wherein the upper reference sample located in the x-th column is derived based on the weights and the upper neighboring samples located in the x-th column, wherein the weights are derived according to the quantization parameter of the current block.

2. A method for encoding video performed by an encoding device, the method comprising: Determining an intra prediction mode of a current block; Deriving multiple rows of upper neighboring samples and multiple columns of left neighboring samples of the current block; Deriving a row of upper reference samples based on the upper neighboring samples; Deriving a column of left reference samples based on the left neighboring samples; Generating prediction samples of the current block based on the intra prediction mode, the upper reference samples, and the left reference samples; And Encoding prediction information of the current block, wherein an upper reference sample located in the x-th column among the upper reference samples is derived based on an upper neighboring sample located in the x-th column among the upper neighboring samples; wherein weights of the upper neighboring samples located in the x-th column are derived, and wherein the upper reference sample located in the x-th column is derived based on the weights and the upper neighboring samples located in the x-th column, wherein the weights are derived according to the quantization parameter of the current block.

3. A non-transitory computer-readable storage medium storing a bitstream generated by the method for encoding video according to claim 2.

4. A method for transmitting data for video, the method comprising: Obtaining a bitstream for the video, wherein the bitstream is generated based on determining an intra prediction mode of a current block, deriving multiple rows of upper neighboring samples and multiple columns of left neighboring samples of the current block, deriving a row of upper reference samples based on the upper neighboring samples; deriving a column of left reference samples based on the left neighboring samples; generating prediction samples of the current block based on the intra prediction mode, the upper reference samples, and the left reference samples, and encoding prediction information of the current block; and Sending data including the bitstream, wherein an upper reference sample located in the x-th column among the upper reference samples is derived based on an upper neighboring sample located in the x-th column among the upper neighboring samples; wherein weights of the upper neighboring samples located in the x-th column are derived, and wherein the upper reference sample located in the x-th column is derived based on the weights and the upper neighboring samples located in the x-th column, Among them, the weight is derived according to the quantization parameter of the current block.