IMAGE DECODING METHOD AND APPARATUS BASED ON INTRAPREDICTION IN THE IMAGE CODING SYSTEM

MX433895BActive Publication Date: 2026-05-19GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD

Patent Information

Authority / Receiving Office
MX · MX
Patent Type
Patents
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2019-04-10
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

The increasing demand for high-resolution and high-quality images has led to a need for more efficient image compression techniques to reduce transmission and storage costs, as conventional methods struggle with the high bit rates associated with these images.

Method used

An image decoding method and device that utilizes intra-prediction based on deriving reference samples from a plurality of neighboring samples, improving prediction accuracy and overall coding efficiency by generating prediction samples using these reference samples.

Benefits of technology

The method enhances prediction accuracy and coding efficiency by deriving reference samples from multiple neighboring samples, thereby reducing the bit rate and improving the efficiency of image transmission and storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure MX433895B0
    Figure MX433895B0
Patent Text Reader

Abstract

An image decoding method implemented by a decoding apparatus according to the present invention comprises: a step of deriving an intraprediction mode for a current block; a step of deriving upper neighbor samples from a plurality of rows for the current block, and left neighbor samples from a plurality of columns; a step of deriving a row of upper reference samples based on the upper neighbor samples; a step of deriving a column of left reference samples based on the left neighbor samples; and a step of generating a prediction sample for the current block using at least one of the upper reference samples and the left reference samples according to the intraprediction mode.
Need to check novelty before this filing date? Find Prior Art

Description

IMAGE DECODING METHOD AND APPARATUS BASED ON INTRAPREDICTION IN THE IMAGE CODING SYSTEM Background of the invention Field of invention [1] The present invention relates to image coding technology and, more particularly, to an image decoding method and device in accordance with intraprediction in an image coding system. Related technique [2] The demand for high-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images has increased in various fields. Because image data has high resolution and high quality, the amount of information or bits that must be transmitted increases compared to legacy image data. Therefore, when image data is transmitted using a medium such as a conventional wired / wireless broadband line or stored using an existing storage medium, the transmission and storage costs increase. [3] Therefore, there is a need for a highly efficient image compression technique to Qoznnn / eznz / E / YiAi effectively transmit, store and reproduce high-resolution, high-quality images. Summary of the invention [4] The present invention provides a method and a device for improving the efficiency of image coding. [5] The present invention further provides an intraprediction method and device for generating a reference sample based on a plurality of neighboring samples of an actual block and performing case on the reference sample. [6] In one aspect, a method for decoding an image produced by a decoding device is provided. The method includes deriving an intraprediction mode of a current block; deriving a plurality of rows of upper neighbor samples and a plurality of columns of left neighbor samples of the current block; deriving a row of upper reference samples based on the upper neighbor samples; deriving a column of left reference samples based on the left neighbor samples; and generating a prediction sample of the current block using at least one of the upper reference samples and the left reference samples according to the mode of Qoznnn / eznz / E / YiAi intraprediction. [7] In another aspect, a decoding device is provided for decoding an image. The decoding device includes an entropy decoding unit for obtaining prediction information on a current block; and a prediction unit capable of deriving an intraprediction mode of the current block, deriving a plurality of rows of upper neighbor samples and a plurality of columns of left neighbor samples of the current block, deriving a row of upper reference samples based on the upper neighbor samples, deriving a column of left reference samples based on the left neighbor samples, and generating a prediction sample of the current block using at least one of the upper reference samples and the left reference samples according to the intraprediction mode. [8] In another aspect, a video encoding method performed by an encoding device is provided. The method includes determining an intraprediction mode of a current block; deriving a plurality of rows of upper neighbor samples and a plurality of columns of left neighbor samples of the current block; deriving a row of upper reference samples based on the upper neighbor samples; deriving a Qoznnn / eznz / E / YiAi left reference sample column based on left neighboring samples; generate a prediction sample of the current block using at least one of the top reference samples and the left reference samples according to the intraprediction mode; and generate, encode, and generate prediction information of the current block. [9] In another aspect, a video coding device is provided. The coding device includes a prediction unit for determining an intraprediction mode of a current block, deriving a plurality of rows of upper neighbor samples and a plurality of columns of left neighbor samples of the current block, extracting a row of upper reference samples based on the upper neighbor samples, extracting a column of left reference samples based on the left reference samples, and generating a prediction sample of the current block using at least one of the upper reference samples and the left reference samples according to the intraprediction mode; and an entropy coding unit for generating, encoding, and outputting prediction information of the current block. Qoznnn / eznz / E / YiAi Advantageous effects

[10] In accordance with the present invention, a reference sample of an actual block can be derived based on a plurality of neighboring samples, and by performing intraprediction based on the reference sample, the prediction accuracy of the actual block can be improved, thus improving overall efficiency.

[11] In accordance with the present invention, a reference sample can be derived based on a plurality of neighboring samples located in a prediction direction of an intraprediction mode of a current block, and by performing intraprediction based on the reference sample, the prediction accuracy of the current block can be improved, thereby improving the overall coding efficiency.

[12] In accordance with the present invention, the weights of a plurality of neighboring samples can be derived, a reference sample can be derived based on the weights and neighboring samples, and by means of intraprediction based on the reference sample, the accuracy of the prediction of the current block can be improved, thereby improving the overall coding efficiency. Brief description of the drawings

[13] Figure 1 is a schematic diagram illustrating Qoznnn / eznz / E / YiAi a configuration of a video encoding device to which the present invention is applicable.

[14] Figure 2 is a schematic diagram illustrating a configuration of a video decoding device to which the present invention is applicable.

[15] Figure 3 illustrates left neighbor samples and upper neighbor samples used for intraprediction of a current block.

[16] Figures 4(a) and 4(b) illustrate an example of deriving a reference sample based on a plurality of neighboring teachers in a current block.

[17] Figure 5 illustrates an example of deriving a reference sample based on a plurality of neighboring samples of a current block.

[18] Figures 6(a) and 6(b) illustrate an example of generating upper reference samples of the current block with oase in upper neighbor samples that include additionally generated upper neighbor samples.

[19] Figure 7 illustrates an example of deriving the neighboring sample located in a fractional sample position.

[20] Figures 8(a) and 8(b) illustrate an example of generating upper reference samples of the current block with oase in upper neighbor samples that include additionally generated 25 upper neighbor samples. Qoznnn / eznz / E / YiAi

[21] Figure 9 illustrates an example of the division of intraprediction modes according to a prediction direction.

[22] Figures 10(a) and 10(b) illustrate an example of generating upper reference samples of the current block with oase in upper neighbor samples that include additionally generated upper neighbor samples 1 me 111 e .

[23] Figure 11 schematically illustrates a method of video encoding by a 10 encoding device in accordance with the present invention.

[24] Figure 12 schematically illustrates a method of video decoding using a decoding device in accordance with the present invention. Qoznnn / eznz / E / YiAi Description of illustrative modalities

[25] The present invention may be modified in various ways, and its specific embodiments will be described and illustrated in the drawings. However, the embodiments are not intended to limit the invention. The terms used in the following description are used simply to describe specific embodiments, but are not intended to limit the invention. An expression of a singular number includes an expression of the plural number, provided that it clearly reads differently. Terms such as "include" and "have" are intended to indicate that the features, numbers, steps, operations, elements, components, or combinations thereof used in the following description exist and, therefore, it should be understood that the possibility of existence or addition is not excluded from one or more features, numbers, steps, operations, elements, components, or combinations thereof.

[26] On the other hand, the elements in the drawings described in the invention are drawn independently for the purpose of convenience in explaining different specific functions, and do not mean that the elements are incorporated by independent hardware or independent software. For example, two or more elements may be combined to form a single element, or an element may be divided into multiple elements. The ways in which the elements are combined and / or divided belong to the invention without departing from the concept of the invention.

[27] Hereafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. In addition, similar reference numbers are used to indicate similar elements in all the drawings, and the same descriptions of similar elements will be omitted.

[28] In the present specification, generally a Qoznnn / eznz / E / YiAi An image means a unit that represents a picture at a specific moment; a portion is a unit that constitutes a part of the image. An image may be composed of plural parts, and the terms an image and a portion may be mixed together as the occasion requires.

[29] A pixel or a pei can mean a minimal unit that constitutes an image (or picture). In addition, a sample can be used as a term corresponding to a pixel. The sample can generally represent a pixel or a pixel value, it can represent only a pixel (a pixel value) of a luminance component, and it can represent only a pixel (a pixel value) of a chroma component.

[30] A unit indicates a basic image processing unit. The unit may include at least one of a specific area and area-related information. Optionally, the unit may be combined with terms such as a block, an area, or similar. In a typical case, an M x N block may represent a set of samples or 20 transformation coefficients arranged in M ​​columns and N rows.

[31] Figure 1 briefly illustrates a structure of a video encoding device to which the present invention is applicable.

[32] Referring to Figure 1, a device Qoznnn / eznz / E / YiAi video encoding 100 may include an image 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 may include a dequantizer 141, a reverse transformer 142.

[33] The image splitter 105 can split an input image into at least one processing unit.

[34] In one example, the processing unit may be referred to as a coding unit (CU). In this case, the coding unit may be recursively divided from the larger coding unit (LCU) according to a quad-tree plus binary tree (QTBT) structure. For example, a coding unit may be dizzidied into a plurality of coding units of a deeper depth based on a quad-tree structure and / or a binary tree structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present invention may be carried out based on a final coding unit that is not further divided. In this case, the larger coding unit is Qoznnn / eznz / E / YiAi can use the final coding unit based on coding efficiency, or similar, depending on the image characteristics, or the coding unit can be recursively divided into 5 coding units of a lower depth as needed, and a coding unit that has an optimal size can be used as the final coding unit. Here, the coding procedure can include a procedure such as prediction, transformation, and restoration, which will be described later.

[35] In another example, the processing unit may include a coding unit prediction unit (CU) or a transformation unit (TU). The coding unit can be divided from the largest coding unit (LCU) into coding units of a deeper depth according to the quad-tree structure. In this case, the largest coding unit can be used directly as the final coding unit based on coding efficiency, 20 or similar, depending on the image characteristics, or the coding unit can be recursively divided into coding units of a greater depth, as needed, and a coding unit of optimal size can be used as a final coding unit. When the smallest encoding unit is established In Qoznnn / eznz / E / YiAi (SCU), the encoding unit cannot be divided into smaller encoding units than the smallest encoding unit. Here, the final encoding unit refers to an encoding unit that is partitioned or divided into a prediction unit or a transformation unit. The prediction unit is a unit that is partitioned from an encoding unit and can be a sample prediction unit. Here, the prediction unit can be divided into sub-ologues. The transformation unit can be divided from the encoding unit according to the quad-tree structure and can be a unit for obtaining a transformation coefficient and / or a unit for obtaining a residual signal of the transformation coefficient.From now on, the coding unit may be referred to as the coding block (CB), the prediction unit as the prediction block (PB), and the transformation unit as the transformation block (TB). The prediction block or prediction unit may refer to a specific block-shaped area in an image and include an array of prediction samples. Similarly, the transformation block or transformation unit may refer to a specific block-shaped area in an image and include the transformation coefficient or an array of residual samples. Qoznnn / eznz / E / YiAi

[36] Predictor 110 can make a prediction on a target processing block (hereafter referred to as a current block), and can generate a predicted block that includes prediction samples for the current block. A prediction unit made on predictor 110 can be an encoding block, or it can be a transformation block, or it can be a prediction block.

[37] Predictor 110 can determine whether intraprediction or interprediction applies to the current block 10. For example, predictor 110 can determine whether intraprediction or interprediction applies in CU units.

[38] In the case of intraprediction, predictor 110 can derive a prediction sample for the current block 15 with a base on a reference sample outside the current block in an image to which the current block belongs (hereafter, a current image). In this case, predictor 110 can derive the prediction sample based on an average or interpolation of neighboring reference samples 20 of the current block (case (i)), or it can derive the prediction sample based on an existing reference sample in a specific direction (prediction) with respect to a prediction sample among the neighboring reference samples of the current block (case (11)). Case (i) can be called nondirectional mode 25 or non-angular mode, and case (ii) can Qoznnn / eznz / E / YiAi can be called directional mode or angular mode. In intraprediction, prediction modes can include, for example, 33 directional modes and at least two non-directional modes. Non-directional modes can include DC mode and planar mode. Predictor 110 can determine the prediction mode to apply to the current block using the prediction mode applied to the neighboring block.

[39] In the case of interprediction, predictor 110 can derive the prediction sample for the current block based on a sample specified by a motion vector in a reference image. Predictor 110 can derive the prediction sample for the current block by applying any of a jump mode, a blend mode, and a motion vector prediction (MVP) mode. In the case of jump mode and blend mode, predictor 110 can use motion information from the neighboring block as motion information for the current block. In the case of jump mode, unlike blend mode, no (residual) difference is transmitted between the prediction sample and the original sample.In the case of MVP mode, a neighboring block's movement vector is used as a movement vector predictor and is therefore used as a movement vector predictor of the current block to derive a movement vector of the current block. Qoznnn / eznz / E / YiAi

[40] In the case of interprediction, the neighbor block may include a spatial neighbor block existing in the current image and a temporal neighbor block existing in the reference image. The reference image that includes the temporal neighbor block may also be called a colocalized (colf'ic) image. Motion information may include the motion vector and a reference image index. Information, such as prediction mode information and motion information, may be encoded (entropy) and then output as a bitstream.

[41] When movement information from a temporary neighbor block is used in jump mode and merge mode, a higher-ranking image in a reference image list can be used as the reference image. Reference images included in the reference image list can be aligned based on a picture order count (POC) difference between a current image and a corresponding reference image. A POC corresponds to a display order and can be distinguished from an encoding order.

[42] The subtractor 115 generates a residual sample which is the difference between an original sample and a prediction sample. If the skip mode is applied, the residual sample 25 may not be generated as described above. Qoznnn / eznz / E / YiAi

[43] Transformer 120 transforms residual samples into units of a transformation block to generate a transformation coefficient. Transformer 120 can perform a transformation based on the size of a corresponding transformation block and a prediction mode applied to an encoding block or prediction block that overlaps with the transformation block. For example, the residual samples can be transformed using the discrete sinusoidal transform (DST) kernel if intraprediction is applied to the encoding block or prediction block that overlaps with the transformation block, and the transformation block is a 4x4 residual matrix; and it is transformed using the discrete cosine transform (DCT) kernel in other cases.

[44] The quantifier 125 can quantize the transformation coefficients to generate quantified transformation coefficients.

[45] Reorganizer 130 reorganizes quantized transformation coefficients. Reorganizer 130 can reorganize quantized transformation coefficients in block form into a one-dimensional vector through a coefficient exploration method. Although reorganizer 130 is described as a separate component, reorganizer 130 can be a part of quantizer 125. Qoznnn / eznz / E / YiAi

[46] The entropy encoder 135 can perform entropy coding on quantized transformation coefficients. The entropy coding can include an encoding method, for example, an exponential Golomb, a context-adaptive variable-length encoding (CAVLC), a context-adaptive biliary arithmetic (CABAC) encoding, or similar methods. The entropy encoder 135 can perform the encoding jointly or separately on the information (for example, a syntax element value or similar) required for video restoration in addition to the quantized transformation coefficients. The entropy-encoded information can be transmitted or stored in a network abstraction layer (NAL) unit as a bitstream.

[47] The dequantizer 141 dequantizes values ​​(transformation coefficients) quantified by the quantizer 125 and the inverse transformer 142 inversely transforms the values ​​dequantized by the dequantizer 141 to generate a residual sample.

[48] ​​Adder 150 adds a residual sample to a prediction sample to reconstruct an image. The residual sample can be added to the prediction sample in one-block units to generate a restored block. Although adder 150 is described as a separate component 25, adder 150 can be part of predictor 110. Qoznnn / eznz / E / YiAi Meanwhile, the adder 150 can be called a reconstructor or a restored block generator.

[49] Filter 155 can apply an unlocking filter and / or adaptive sample offset to the restored image. Blogue boundary artifacts in the restored image or quantization distortion can be corrected using unlock filtering and / or adaptive sample offset. Adaptive sample offset can be applied in one-sample units after unlock filtering is complete. Filter 155 can apply an adaptive loop filter (ALE) to the restored image. ALE can be applied to the restored image that has already undergone unlock filtering and / or adaptive offset.

[50] Memory 160 can store a restored image (decoded image) or information necessary for encoding / decoding. Here, the restored image can be the image filtered by filter 155. The stored restored image can be used as a reference image for (inter)prediction of other images. For example, memory 160 can store (reference) images used for interprediction. In this case, the images used for interprediction can be designated according to a set of reference images or a list of 25 reference images. Qoznnn / eznz / E / YiAi

[51] Figure 2 briefly illustrates a structure of a video decoding device to which the present invention is applicable.

[52] Referring to Figure 2, a video decoding device 200 may include an entropy decoder 210, a waste processor 220, a predictor 230, a summing adder 240, a filter 250, and a memory 260. The waste processor 220 may include a reorganizer 221, a dequantizer 222, and an inverse transformer 223.

[53] When a bitstream that includes video information is input, the video decoding device 200 can reconstruct a video in association with a process by which the video information is processed in the video encoding device.

[54] For example, the video decoding device 200 can perform video decoding using a processing unit applied in the video encoding device. Therefore, the video decoding processing unit block can be, for example, an encoding unit, and in another example, an encoding unit, a prediction unit, or a transformation unit. The encoding unit can be divided from the larger encoding unit according to the quad-tree structure and / or the binary tree structure.

[55] A prediction unit and a transformation unit may be used additionally in some cases, and in this case, the prediction block is a block derived or partitioned from the encoding unit and may be a sample prediction unit. Here, the prediction unit may be divided into sub-blocks. The transformation unit may be divided from the encoding unit according to the quad-tree structure and may be a unit that derives a transformation coefficient or a unit that derives a residual signal from the transformation coefficient.

[56] The entropy decoder 210 can analyze the bit stream to generate the information required for the Qoznnn / eznz / E / YiAi video restoration or image restoration. For example, the entropy decoder 210 can decode information in the bitstream based on an encoding method such as exponential Golomb encoding, CAVLC, CABAC, etc., and can output a value of a syntax element required for video restoration and a quantized value of a transformation coefficient with respect to a residual.

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

[58] The prediction information between the information decoded in the entropy decoder 210 15 can be provided to the predictor 250 and the residual values, i.e., the quantized transformation coefficients, in which the entropy decoder has performed the entropy decoding, can be entered into the reorganizer 221.

[59] Reorganizer 221 can rearrange the quantized transformation coefficients into a two-dimensional block form. Reorganizer 221 can perform a rearrangement corresponding to the coefficient scan performed by the encoding device. Although the reorganizer 221 is described as a component Qoznnn / eznz / E / YiAi separated, the reorganizer 221 can be a part of the dequantizer 222.

[60] The dequantizer 222 can dequantize the quantized transformation coefficients based on a (de)quantization parameter to output a transformation coefficient. In this case, the information to derive a quantization parameter can be signaled from the encoding device.

[61] The inverse transformer 223 can inversely transform the transformation coefficients to obtain residual samples.

[62] Predictor 230 can make the prediction on a current block, and can generate a predicted block that includes prediction samples for the current block. A prediction unit made in predictor 230 can be an encoding block, a transformation block, or a prediction block.

[63] Predictor 230 can determine whether intraprediction or interprediction applies based on information about a prediction. In this case, the unit for determining which to use—intraprediction or interprediction—may differ from the unit for generating a prediction sample. Furthermore, the unit for generating the prediction sample may also differ between interprediction and intraprediction. For example, which Qoznnn / eznz / E / YiAi will be applied between interprediction and intraprediction and can be determined in CU units. Furthermore, for example, in interprediction, the prediction sample can be generated by determining the prediction mode in PU units, and in intraprediction, the prediction sample can be generated in TU units by determining the prediction mode in PU units.

[64] In the case of intraprediction, predictor 230 can derive a prediction sample for a current block 10 based on a neighboring reference sample in a current image. Predictor 230 can derive the prediction sample for the current block by applying either a directional mode or a non-directional mode based on the neighboring reference sample of the current block. In this case, a prediction mode to be applied to the current block can be determined using an intraprediction mode of a neighboring block.

[65] In the case of interprediction, predictor 230 can derive a prediction sample for a current block 20 based on a specified sample in a reference image according to a motion vector. Predictor 230 can derive the prediction sample for the current block using one of the jump modes, the combination mode, and the MVP mode. Here, the motion information required for block interprediction Qoznnn / eznz / E / YiAi actual provided by the video encoding device, for example, a motion vector and information about a reference image index can be acquired or derived based on the prediction information.

[66] In jump mode and merge mode, the movement information of a neighboring block can be used as movement information for the current block. Here, the neighboring block can include a spatial neighbor block and a temporal neighbor block.

[67] The predictor 230 can construct a list of merge candidates using the movement information of available neighboring blocks and use the information indicated by a merge index in the merge candidate list as a movement vector of the current block. The merge index can be signaled by the encoding device. The movement information can include a movement vector and a reference image. When movement information of a temporary neighboring block is used in jump mode and merge mode, a higher image in a reference image list can be used as the reference image.

[68] In the case of the jump mode, no (residual) difference is transmitted between a prediction sample and an original sample, which is distinct from the combination mode.

[69] In the case of MVP mode, the movement vector The Qoznnn / eznz / E / YiAi of the current block can be derived using a movement vector from a neighboring block as a movement vector predictor. Here, the neighboring block can include a spatial neighbor block and a temporal neighbor block.

[70] When merge mode is applied, for example, a merge candidate list can be generated using a movement vector from a restored spatial neighbor block and / or a movement vector corresponding to a Col block that is a temporal neighbor block. A movement vector from a candidate block selected from the merge candidate list is used as the movement vector of the current block in merge mode. The aforementioned prediction information may include a merge index indicating a candidate block with the best selected movement vector from the candidate blocks included in the merge candidate list. Here, predictor 230 can derive the movement vector of the current block using the merge index.

[71] When applying MVP (Motion Vector Prediction) mode as another example, a list of motion vector predictor candidates can be generated using a motion vector from a restored spatial neighbor block and / or a motion vector corresponding to a Col block that is a temporal neighbor block. That is, the vector of Qoznnn / eznz / E / YiAi, the movement of the restored spatially adjacent block and / or the movement vector corresponding to block Col, which is the temporally neighboring block, can be used as candidate movement vectors. The aforementioned information on The prediction can include a prediction motion vector index that indicates the best selected motion vector from the motion vector candidates included in the list. Here, predictor 230 can select a prediction motion vector from the current block from the motion vector candidates included in the motion vector candidate list using the motion vector index. The encoding device predictor can obtain a motion vector difference (MVD) between the current block's motion vector and a motion vector predictor, encode the MVD, and output the encoded MVD as a bitstream. That is, the MVD can be obtained by subtracting the motion vector predictor from the current block's motion vector.Here, predictor 230 can acquire a motion vector included in the prediction information and derive the motion vector of the current block by adding the motion vector difference to the motion vector predictor. Additionally, the predictor can obtain or derive a reference image index that indicates a reference image from the aforementioned prediction information.

[72] Adder 240 can add a residual sample to a prediction sample to reconstruct a current block or current image. Adder 240 can reconstruct the current image by adding the residual sample to the prediction sample in units of one block. When jump mode is applied, no residual is transmitted, and therefore the prediction sample can become a restored sample. Although Adder 240 is described as a separate component, Adder 240 can be part of Predictor 230. Meanwhile, Adder 240 can be called a reconstructor or a restored block generator.

[73] Filter 250 can apply unlock filtering, adaptive sample offset, and / or ALF to the restored image. Here, adaptive sample offset can be applied in one-sample units after unlock filtering. ALF can be applied after unlock filtering and / or adaptive sample offset.

[74] Memory 260 can store a restored image (decoded image) or information necessary for decoding. Here, the restored image can be the image filtered by filter 250. For example, memory 260 can store images used for the Qoznnn / eznz / E / YiAi interprediction. Here, the images used for interprediction can be designated according to a set of reference images or a list of reference images. A restored image can be used as a reference image for other images. Memory 260 can output restored images in an output order.

[75] As described above, when performing intraprediction of the current block, intraprediction can be based on neighboring samples that have already been encoded / decoded at a decoding point in time of the current block. That is, a prediction sample of the current block can be restored using left-neighbor samples and upper-neighbor samples of the already restored current block. The left-neighbor samples and upper-neighbor samples can be represented as shown in Figure 3.

[76] Figure 3 illustrates the left neighbor samples and upper neighbor samples used for intraprediction of the current block. When intraprediction is performed on the current block, an intraprediction mode of the current block can be derived, and a prediction sample of the current block can be generated using at least one of the left neighbor samples and upper neighbor samples according to the intraprediction mode. Here, the modes of intraprediction can include, for example Qoznnn / eznz / E / YiAi example, two non-directional intraprediction modes and 33 directional intraprediction modes. Here, the 0th and 1st intraprediction modes are the non-directional intraprediction modes; the 0th intraprediction mode indicates an intra-plane mode, and the 1st intraprediction mode indicates an intra-DC mode. The remaining 2nd through 34th intraprediction modes are the directional intraprediction modes, and each has prediction directions. The directional intraprediction mode can be referred to as an intra-angular mode. A prediction sample value of a current sample from a current block can be derived based on the intraprediction mode of the current block.

[77] For example, when the current block's intraprediction mode is one of the directional intramodes, a value from a neighboring sample located in a prediction direction of the current block's intraprediction mode Qoznnn / eznz / E / YiAi can be derived as a prediction sample value of the current sample based on the current sample in the current block. When a neighboring sample of an integer sample unit is not positioned in a prediction direction based on the current sample, a sample of a fractional sample unit is obtained in a corresponding prediction direction position based on the interpolation of neighboring samples of an integer sample unit located in the vicinity of the corresponding prediction direction; a sample value of our fractional unit can be derived as a prediction sample value of the current sample.

[78] As described above, when a prediction sample of the current block is generated using at least one of the left neighbor samples and the neighbor-upper samples, as the distance between the prediction sample and the neighbor sample increases, the accuracy of the prediction may decrease. Furthermore, because a prediction sample is generated with reference to only one row or column of neighbor samples, when noise information is included in the samples adjacent to the current block, the accuracy of the prediction of the current block is greatly degraded, and therefore the overall efficiency of the encoding may be compromised.Therefore, the present invention suggests a method for generating reference samples based on a plurality of left-neighbor samples and upper-neighbor samples, i.e., a plurality of columns of left-neighbor samples and a plurality of rows of upper-neighbor samples, and performing intraprediction based on the generated reference samples to improve the prediction accuracy of the intraprediction and enhance coding efficiency. In the following embodiments, a method is described for generating a left-neighbor (or upper-neighbor) reference sample based on four left-neighbor (or upper-neighbor) samples, but a random number n (N > 1) of left-neighbor (or upper-neighbor) samples can be used, and thus the left-neighbor (or upper-neighbor) reference sample can be generated.

[79] Figure 4 illustrates an example of deriving a reference sample based on a plurality of neighboring samples of a current block. Referring to Figure 4, when the current block size is NxN, 2N upper reference samples can be generated based on the upper neighbor samples in an area of ​​size 2Nx4, and 2N left reference samples can be generated based on left neighbor samples in an area of ​​size 4x2N. Specifically, an upper reference sample located in a specific column can be generated based on four upper neighbor samples located in the specific column among the upper neighbor samples, and a left reference sample located in a specific row can be generated based on four left neighbor samples located in the specific row among the left neighbor samples.For example, an average value of sample values ​​from four upper neighboring samples located at. Qoznnn / eznz / E / YiAi An x-th column among upper neighboring samples can be derived as a sample value from the upper reference samples of the x-th column. Furthermore, an average value of sample values ​​from four left neighboring samples located in a y-th column among left neighboring samples can be derived as a sample value from the y-th row of left reference samples.

[80] As described above, the same weight {1 / 4, 1 / 4, 1 / 4, 1 / 4} can be assigned to the neighboring samples used to generate a reference sample. In other words, a weight of neighboring samples for generating the reference sample can be equal to 1 / 4, but the accuracy of the prediction can be reduced in proportion to the distance between the neighboring sample and the current block to be encoded. Therefore, when the four upper neighbor samples are represented as a first row of upper neighbor samples, a second row of upper neighbor samples, a third row of upper neighbor samples, and a fourth row of upper neighbor samples in an ascending direction from the bottom, a weight for the first row of upper neighbor samples can be assigned as 1 / 2, a weight for the second row of upper neighbor samples can be assigned as 1 / 4, and a weight for the third row of upper neighbor samples and the fourth row can be assigned as 1 / 4. The weight of the upper neighbor sample Qoznnn / eznz / E / YiAi can be assigned as 1 / 8. Thus, samples where the distance to the current block is small between upper neighbor samples can be used extensively to generate the upper reference sample 5. Furthermore, when the four left neighbor samples are represented as a first column of the left neighbor sample, a second column of the left neighbor sample, a third column of the left neighbor sample, and a fourth column of the left neighbor sample in a right-to-left direction, a weight of the first column of the left neighbor sample can be assigned as 1 / 2, a weight of the second column of the left neighbor sample can be assigned as 1 / 4, and a weight of the third column of the left neighbor sample and the fourth column of the left neighbor sample can be assigned as 1 / 8.

[81] Furthermore, in another example, a weight for the first row of the upper neighbor sample and the second row of the upper neighbor sample can be assigned as 2 / 5, and a weight for the third row of the upper neighbor sample and the fourth row of the upper neighbor sample can be assigned as 1 / 10. Furthermore, a weight for the first column of the left neighbor sample can be assigned as 1 / 2, a weight for the second column of the left neighbor sample can be assigned as 1 / 4, and a weight for the third column of the sample Qoznnn / eznz / E / YiAi \zecina de la izquierda y la cuarta columna de la muestra vecina de la izquierda se puede al as 1 / 8.

[82] Furthermore, a method for assigning a weight to each neighboring sample can include several methods other than the example mentioned above. For example, a weight for each neighboring sample can be assigned according to the distance between each neighboring sample and the current block, a weight for each neighboring sample can be assigned according to the size of the current block, and a weight for each neighboring sample can be assigned according to a quantification parameter (QP) of the current block. Additionally, a weight for each neighboring sample can be assigned based on various criteria. The upper reference sample can be derived based on the upper neighboring samples and a weight assigned to each of the upper neighboring samples. Similarly, the left reference sample can be derived based on the left neighboring samples and a weight assigned to each of the left neighboring samples.Furthermore, the upper reference sample or the left reference sample can be derived based on the following equation.

[83] [Equation 1] Dz= wl+D + w2 + C + w3+B tvl^A

[84] where D' can represent the upper reference sample (or reference sample of the Qoznnn / eznz / E / YiAi left), wl can represent a weight of the first row of the upper neighbor sample (or the first column of the left neighbor sample), w2 can represent a weight of the second row of the upper neighbor sample (or the second column of the left neighbor sample), w3 can represent a weight of the third row of the upper neighbor sample (or the third column of the left neighbor sample), and w4 can represent a weight of the fourth row of the upper neighbor sample (or the fourth column of the left neighbor sample).In addition, D can represent the first row of the upper neighbor sample (or the first column of the left neighbor sample), C can represent the second row of the upper neighbor sample (or the second column of the left neighbor sample), B can represent the third row of the upper neighbor sample (or the third column of the left neighbor sample), and A can represent the fourth row of the upper neighbor sample (or the fourth column of the left neighbor sample).

[85] As described above, the reference samples of the current block can be derived on the basis of the number 2N of neighboring samples from a plurality of columns or rows, but the reference samples can be derived on the basis of more than 2N neighboring samples from a plurality of columns or rows according to Qoznnn / eznz / E / YiAi a prediction address of the current block.

[86] Figure 5 illustrates an example of deriving a reference sample based on a plurality of neighboring samples of a current block. Referring to Figure 5, an intraprediction mode of the current block can be derived, and a prediction direction can be derived according to the intraprediction mode. The reference samples of the current block can be generated based on the adjacent samples located in the prediction direction. In this case, as shown in Figure 5, the prediction direction of the current block can be directed from the upper right side to the lower left side, and the upper neighbor samples located in an additional area shown in Figure 5 may be required for the prediction of the current block. In other words, the number L of upper neighbor samples and the number 2N of upper neighbor samples located in the first row may be required for the prediction of the current block.Furthermore, the number M of upper neighbor samples and the number 2N of upper neighbor samples located in the fourth row may be required for the prediction of the current block. Therefore, neighbor samples located in the additional area 510 can be generated, and the reference samples of the current block can be generated based on the neighbor samples located in a prediction direction of the current block 25 among neighbor samples including area 510. The additional samples located in the additional area 510 can be generated by padding a sample value from a rightmost upper neighbor sample among the upper neighbor samples of each row. That is, a sample value from the 5 samples located in the additional area 510 can be derived to be equal to a sample value from the right upper neighbor sample among the upper neighbor samples of each row.Although the diagram does not show an example of generating samples located in an additional area of ​​the left-hand neighboring samples, similarly to an example of generating samples located in additional area 510, samples located in an additional area of ​​the left-hand neighboring samples can be generated. Specifically, samples located in the additional area of ​​the left-hand neighboring samples can be generated by filling a sample value from a lower left-hand neighboring sample between left-hand neighboring samples in each column.

[87] When upper neighbor samples are derived that include upper neighbor samples from the additional area 510, upper reference samples of the current block can be generated based on the upper neighbor samples. One way in which the upper reference samples are generated is shown in the following figure.

[88] Figure 6 illustrates an example of generating samples Qoznnn / eznz / E / YiAi upper reference samples of the current block based on upper neighbor samples that include additionally generated upper neighbor samples. Figure 6(bi) illustrates a position of a newly generated upper reference sample. In this case, at a position of upper reference sample 610, the upper neighbor samples at positions corresponding to a prediction direction of the current block can be used to generate upper reference sample 610. For example, as shown in Figure 6(a), at the position of upper reference sample 610, an upper neighbor sample A, an upper neighbor sample B, an upper neighbor sample C, and an upper neighbor sample D, which are the upper neighbor samples at positions corresponding to the prediction direction of the current block, can be used to generate upper reference sample 610.When all positions of upper neighbor sample A, upper neighbor sample B, upper neighbor sample C, and upper neighbor sample D are integer sample positions, i.e., when all of upper neighbor sample A, upper neighbor sample B, upper neighbor sample C, and upper neighbor sample D are integer samples and upper reference sample 610 can be generated based on the upper neighbor sample values. A, the upper neighbor sample B, the upper neighbor sample Qoznnn / eznz / E / YiAi C, and the upper neighbor sample D. Similarly, left neighbor samples located in a prediction direction of the current block can be derived based on a position of the left reference sample, and a left reference sample can be derived based on the left neighbor samples.

[89] When there is a position other than the integer sample position among the upper neighbor sample positions A, upper neighbor sample B, upper neighbor sample C, and upper neighbor sample D, i.e., when there is a fractional sample of upper neighbor sample A, upper neighbor sample B, upper neighbor sample C, and upper neighbor sample D, the fractional sample can be derived as shown in the following figure.

[90] Figure 7 illustrates an example of deriving the neighboring sample located in a fractional sample position. Referring to Figure 7, a sample value of a neighboring sample X, which is a fractional sample, can be generated by linear interpolation of sample values ​​from the integer samples DI 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 the fractional sample, the The fractional sample Qoznnn / eznz / E / YiAi can be derived based on upper neighbor samples from an integer sample position adjacent to the fractional sample. The fractional sample can be derived based on the following equation 5.

[91] [Equation 2] X = (Dl+dl + D2+d2 + (di + d2) / 2) / (di + d2)

[92] where X can represent the sample fraction, DI can represent a sample of integers adjacent to the left of the sample fraction, D2 can represent a sample of integers adjacent to the right of the sample fraction, di can represent a distance between D2 and X and d2 can represent a distance between DI and X.

[93] A value for each of the upper neighbor samples to generate the upper reference sample can be derived using the method described above. When the upper neighbor samples are derived from the whole number sample position or the fractional 20th sample position, the upper reference sample can be generated based on the upper neighbor samples. The upper reference sample can be generated by assigning the same weight to each upper reference sample as described above. Alternatively, a weight for each upper reference sample can be assigned considering Qoznnn / eznz / E / YiAi is the distance between the current block and each upper reference sample, and the upper reference sample can be generated based on each upper reference sample and its weight. Alternatively, a weight for each upper reference sample can be assigned based on various criteria, such as a Qp or the size of the current block, and the upper reference sample can be generated based on each upper reference sample and its weight. Furthermore, the upper reference sample can be generated by substituting the upper neighbor samples and a weight assigned to each upper neighbor sample into Equation 1. Additionally, when a fractional sample exists in the left-neighbor samples, the fractional sample can be derived similarly to the description above, and the left-neighbor reference sample can be derived based on the fractional sample.

[94] When a reference sample is generated based on neighboring samples located in a prediction direction of the current block, the same weight {1 / 4, 1 / 4, 1 / 4, 1 / 4} can be assigned to the neighboring samples used to generate the reference sample, or a weight for each neighboring sample can be assigned according to a distance between each neighboring sample and the current block, as described above. Alternatively, a weight for each neighboring sample can be assigned according to a size of the current block or a quantization parameter (QP) of the current block. In addition, a weight can be assigned to each neighboring sample based on various criteria. The upper reference sample can be derived based on the upper neighboring samples and the weight assigned to each of the upper neighboring samples. Furthermore, the left-hand reference sample can be derived with ba.se in the neighboring samples on the left and the weight assigned to each of the neighboring samples on the left.

[95] As described above, when reference samples are derived based on the number 2N of neighbor samples from a plurality of columns or rows and neighbor samples included in the additional area according to a prediction direction of the current block, the samples located in the additional area can be generated through the filling as described above, but when the neighbor samples located in the additional area have already been restored, the restored neighbor samples from the additional area can be used, and when the neighbor samples 20 located in the additional area are not restored, the neighbor samples can be generated through the filling described above.

[96] Figure 8 illustrates an example of generating upper reference samples of the current block based on 25 upper neighbor samples including neighboring samples Qoznnn / eznz / E / YiAi additionally generated upper samples. As described above, an intraprediction mode of the current ologue can be derived, and reference samples of the current ologue can be generated based on neighboring samples located in the prediction direction. In this case, as shown in Figure 8(a), a prediction direction of the current ologue can be directed from the upper right side to the lower left side, and the upper neighboring samples located in an additional area 810 shown in Figure 8(a) may be necessary for the prediction of the current blog. When the upper neighbor samples included in the additional area 810 have already been restored, the restored upper neighbor samples can be used to generate the upper reference samples. As shown in the Figure 8(b) shows that when upper neighbor samples located in an additional area 820 are not restored, samples located in the additional area 820 can be generated by filling a sample value from a right upper neighbor sample among upper neighbor samples in each row. That is, a sample value from samples located in the additional area 820 can be derived to be equal to a sample value from the right upper neighbor sample among the upper neighbor samples in each row. Although an additional area of ​​left neighbor samples is not shown in the drawing, similar to a method of deriving upper neighbor samples included in the additional area 810, left neighbor samples included in an additional area of ​​left neighbor samples can be derived.

[97] The methods for generating the reference sample described above can be selected based on the prediction direction of a current block. That is, the reference samples of the current block can be generated through other methods according to the intraprediction modes.

[98] Figure 9 illustrates an example of the division of intraprediction modes according to a prediction direction. Referring to Figure 9, intraprediction modes can be divided into four areas according to a prediction direction. As shown in Figure 9, intraprediction modes can be included in an area Area A, area B, area C, or area D, according to a prediction direction. Specifically, for example, the 20th to 9th intraprediction modes can be included in area A, the 10th to 17th intraprediction modes can be included in area B, the 18th to 26th intraprediction modes can be included in area C, and the 27th to 34th intraprediction modes can be included in area D. A method for obtaining reference samples from the current block can be determined based on the intraprediction mode applied to the current block.

[99] For example, when an intraprediction mode included in area D is applied to the current block, the reference samples of the current block can be derived to 5 through the method shown in Figure 8. In other words, 2N upper neighbor samples can be generated from the plurality of rows of the current block and upper neighbor samples from an additional area, and at a position of an upper reference sample of the current block 10 between the 2N upper neighbor samples from the plurality of rows and upper neighbor samples from the additional area, an upper reference sample of the block The current Qoznnn / eznz / E / YiAi can be generated based on neighboring samples located in a prediction direction. When the upper neighbor samples of the additional area have already been restored, the restored upper neighbor samples can be used to generate the reference samples for the current blogue, and when the upper neighbor samples of the additional area are not restored, the upper neighbor samples can be generated by padding a sample value from a rightmost upper neighbor sample among the 2N upper neighbor samples in each row.

[100] As another example, when an intraprediction mode included in area C is applied to the current block, reference samples of the current block can be generated, as shown in Figure 10.

[101] Figure 10 illustrates an example of generating upper reference samples of the current block based on upper neighbor samples that include additionally generated upper neighbor samples. When an upper reference sample D' shown in Figure 10(b) is generated, D' can be generated cc-n based on the upper neighbor samples A, B, C, and D at positions corresponding to a prediction direction of the current block at a position of D' shown in Figure 10(a). When all the positions of the upper neighbor samples A, B, C, and D are integer sample positions, i.e., when all of A, B, C, and D are integer samples, D' can be generated based on sample values ​​of A, B, C, and D.When there is a fractional sample position between the upper neighbor sample positions A, B, C, and D, the sample values ​​of the integer samples adjacent to the left and right of the fractional sample can be generated by linear interpolation, and D' can be generated based on the resulting fractional sample, as described above. Furthermore, at an H' position shown in Figure 10(a), H' can be generated based on the upper neighbor samples E, F, G, and H at positions corresponding to a prediction direction of the current block. When all the upper neighbor sample positions E, F, G, and H are integer sample positions, H' can be generated based on sample values ​​from E, E, G, and H.When there is a sample of the fractional sample position between the neighboring upper sample positions E, F, G, and H, i.e., when there is a fractional sample between E, F, G, and H, the 10 sample values ​​of the integer samples adjacent to the left and right of the fractional sample can be generated by linear interpolation, and H' can be generated from the generated fractional sample, as described above.

[102] When an intraprediction mode included in area B is applied to the current block, and when an intraprediction mode included in area C is applied to the current block, reference samples of the current block can be generated using the same method as deriving reference samples from the current block. Furthermore, when an intraprediction mode included in area A is applied to the current block, and when an intraprediction mode included in area D is applied to the current block, reference samples of the current block can be generated using the same method as deriving reference samples from the current block. Qoznnn / eznz / E / YiAi

[103] Figure 11 schematically illustrates a method of video encoding by an encoding device according to the present invention. The method described in Figure 11 can be implemented using the encoding device described in Figure 1. Specifically, for example, S1100 to S1140 of Figure 11 can be implemented using a prediction unit of the encoding device, and S1150 can be implemented using an entropy encoding unit of the encoding device.

[104] The encoding device determines an intraprediction mode for a current block (S1100). The encoding device can perform several intraprediction modes to obtain an intraprediction mode with an optimal RD cost for the current block. The intraprediction 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 an intra-DC mode and an intra-plane mode.

[105] The encoding device derives a plurality of upper neighbor sample rows and a plurality of left neighbor sample columns from the current block (S1110). The encoding device can derive a plurality of upper neighbor sample rows from the current block. For example, the device of Qoznnn / eznz / E / YiAi encoding can derive 4 rows of upper neighbor samples from the current block. Furthermore, for example, when the current block size is NxN, the encoding device can derive 2N upper neighbor samples in each row of the plurality of rows. 2N of upper neighbor samples of each row can be called first upper neighbor samples.

[106] An upper reference sample can be derived using specific upper neighbor samples derived from a position of the upper reference sample and a prediction direction of the current block's intraprediction mode, as described below. In this case, upper neighbor samples other than the first upper neighbor samples can be used to derive the upper reference sample according to a prediction direction of the current block.

[107] For example, when the current block size is N x N, the number of upper neighbor samples of the nth row among the plurality of rows of upper neighbor samples may be more than 2N. As another example, when the nth row is a first row, the number of upper neighbor samples of the nth row is 2N, and the number of upper neighbor samples of the (n+l)th row may be greater than 2N. Furthermore, the number of upper neighbor samples of the nth row among a plurality of rows Qoznnn / eznz / E / YiAi of upper neighbor samples of the current block may be less than that of the upper neighbor samples of the (n+1)th row. Specifically, the number of upper neighbor samples of the (n+1)th row may be more than 2N, and the upper neighbor samples after the 2Nth upper neighbor sample among the upper neighbor samples of the (n+1)th row can be derived by filling the 2Nth upper neighbor sample among the upper neighbor samples of the (n+1)th row. Alternatively, before the prediction sample for the current block is generated, when the reconstructed samples corresponding to the upper neighbor samples after the 2Nth upper neighbor sample among the upper neighbor samples of the (n+1)th row are generated, the reconstructed samples can be derived as our upper neighbors after the 2Nth upper neighbor sample.

[108] As another example, when the current block size is NxN, the encoding device can derive a second upper neighbor sample for each row based on the prediction direction of the current block. Here, the second upper neighbor sample can represent upper neighbor samples other than the first upper neighbor sample for each row. The number of second upper neighbor samples for each row can be determined based on the prediction direction. The second upper neighbor sample The second upper neighbor sample for each row can be obtained by filling in a rightmost second upper neighbor sample between the first upper neighbor samples of each row. Alternatively, before a prediction sample for the current block is generated, when a reconstructed sample of the second upper neighbor sample is generated, the reconstructed sample can be derived as the second upper neighbor sample. And before the prediction sample for the current block is generated, when a reconstructed sample of the second upper neighbor sample is not generated, the second upper neighbor sample for each row can be derived by filling in the rightmost second upper neighbor sample between the first upper neighbor samples of each row.

[109] Furthermore, in another example, the encoding device can derix a plurality of columns of left-neighbor samples from the current block. For example, the encoding device can derive four columns of left-neighbor samples from the current block. Moreover, for example, when the current block size is N x N, the encoding device can derive 2^N left-neighbor samples in each column of the plurality of columns. The 2^N left-neighbor samples in each column can be referred to as the first left-neighbor samples. Qoznnn / eznz / E / YiAi

[110] A left reference sample can be derived based on specific left neighbor samples derived from a left reference sample position and a prediction direction of the current block's intraprediction mode, as described below. In this case, left neighbor samples other than the first left neighbor samples can be used to derive the left reference sample according to a prediction direction of the current block.

[111] For example, when the current block size is N x N, the number of the nth left-neighbor sample column among the plurality of left-neighbor sample columns may be greater than 2N. In another example, when the nth column is a first column, the number of the nth left-neighbor sample column is 2N, and the number of the (n11)th left-neighbor sample column may be greater than 2N. Furthermore, the number of the nth left-neighbor sample column among a plurality of left-neighbor sample columns in the current block may be less than that of the (n+1)th left-neighbor sample column. Specifically, the number of the (n+1)th left-neighbor sample column may be greater than 2N, and the left-neighbor samples after Qoznnn / eznz / E / YiAi The 2Nth left neighbor sample among the (n+1)th column of left neighbor samples can be obtained by filling the 2Nth left neighbor sample among the (n+1)th column of left neighbor samples. Alternatively, before the current block's prediction sample is generated, when the reconstructed samples corresponding to the left neighbor samples are generated after the 2Nth left neighbor sample among the (nll)th column of samples Qoznnn / eznz / E / YiAi left neighbors, the reconstructed samples can be derived as left neighbor samples after the 2N-th left neighbor sample.

[112] As another example, when the current block size is NxN, the encoding device can derive a second left neighbor sample for each column based on the prediction direction of the current block. Here, the second left neighbor sample can represent a different left neighbor sample than the first left neighbor sample for each row. The number of second left neighbor samples for each column can be determined based on the prediction direction. The second left neighbor sample for each column can be derived by filling in a second left neighbor sample located on the lower side among the first 25 left neighbor samples for each column. Alternatively, before generating a prediction sample of the current block, when a reconstructed sample of the second left neighbor sample is generated, the reconstructed sample can be derived as the second left neighbor sample 5, and before generating a prediction sample of the current block, when a reconstructed sample of the second left neighbor sample is not generated, the second left neighbor sample of each column can be derived by filling a second left neighbor sample of the 10th located on the lower side between the first left neighbor samples of each column.

[113] The encoding device derives a row of upper reference samples based on the upper neighbor samples (S1120). The encoding device 15 can derive a row of upper reference samples based on the plurality of rows of upper neighbor samples.

[114] For example, a superior reference sample located in the xth column among the 20 superior reference samples can be derived based on superior neighboring samples located in the xth column among the superior neighboring samples. In this case, an average value of sample values ​​from the superior neighboring samples located in the xth column can be derived as a 25th sample value from the superior reference sample located in the Qoznnn / eznz / E / YiAi x-th column. Furthermore, the weights of the upper neighbor samples located in the x-th column can be derived, and the upper reference samples located in the x-th column can be derived based on the weights of the upper neighbor samples located in the x-th column. When the weights of the upper neighbor samples located in the x-th column are derived, the upper reference sample can be derived based on Equation 1.

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

[116] Furthermore, in another example, weights can be derived based on a quantization parameter (QP) or the current block size. Additionally, weights can be derived based on several criteria.

[117] As another example, a first upper reference sample among the upper reference samples can be derived based on specific upper neighbor samples derived based on a position of the first upper reference sample and a prediction direction of the current block. Specifically, specific upper neighbor samples located in a prediction direction of the current block can be derived based on the position of the upper reference sample, and the first upper reference sample can be derived based on the specific upper neighbor samples. In this case, an average value of sample values ​​from the specific upper neighbor samples can be derived as a sample value of the first upper reference sample.Furthermore, the weights of the specific upper neighbor samples can be derived, and the first upper reference sample can be derived based on the weights and the specific upper neighbor samples. When the weights of the specific upper neighbor samples are derived, the first upper reference sample can be derived with oase in the. Qoznnn / eznz / E / YiAi Equation 1.

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

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

[120] When specific upper neighbor samples derived on the basis of a prediction direction of the current block 20 include an upper neighbor sample, which is a fractional sample, a sample value of the upper neighbor sample, which is the fractional sample, can be derived through linear interpolation between the sample values ​​of the left-adjacent integer samples and Qoznnn / eznz / E / YiAi right of the upper neighbor sample, which is the fractional sample. For example, a sample value of the upper neighbor sample, which is the fractional sample, can be derived based on Equation 2.

[121] A method for deriving upper reference samples can be determined based on an intraprediction mode of the current block. For example, when the intraprediction mode of the current block has a prediction angle greater than that of a vertical mode, i.e., when the intraprediction mode of the current block is one of the 27° to 34° intraprediction modes, the corresponding upper reference sample can be derived based on specific upper neighbor samples located in a prediction direction of the current block, based on the position of the corresponding upper reference sample. Here, the vertical mode may correspond to a 26° intraprediction mode.Furthermore, when the current block's intraprediction mode is a mode that has a prediction angle less than or equal to that of the vertical mode, i.e., when the current block's intraprediction mode is one of the 18° to 26° intraprediction modes, the corresponding upper reference sample of the upper reference samples can be derived based on upper neighbor samples located in the same column as the current block. Qoznnn / eznz / E / YiAi corresponding upper reference sample.

[122] The encoding device derives a left reference sample row based on the left neighboring samples (S1130). The encoding device can derive a left reference sample column based on the plurality of left neighboring sample columns.

[123] For example, a left-hand reference sample located in the y-th row among the left-hand reference samples can be derived based on left-hand neighboring samples located in the y-th row among the left-hand neighboring samples. In this case, an average value of sample values ​​from the left-hand neighboring samples located in the y-th row can be derived as a sample value from the left-hand reference sample located in the y-th row. Furthermore, the weights of the left-hand neighboring samples located in the y-th row can be derived, and the left-hand reference sample located in the y-th row can be derived based on the weights of the left-hand neighboring samples located in the y-th row. When the weights of the left-hand neighboring samples located in the y-th row are derived, the left-hand reference sample can be derived based on Equation 1.

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

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

[126] As another example, a first left reference sample of the left reference samples can be derived based on specific left neighbor samples derived from a position of the first left reference sample and a prediction direction of the current block. Specifically, specific left neighbor samples located in a prediction direction of the current block can be derived based on a position of the left reference sample, and the left reference sample can Qoznnn / eznz / E / YiAi can be derived based on specific left-neighbor samples. In this case, an average value of 10 sample values ​​from specific left-neighbor samples can be derived as a sample value from the first left-hand reference sample. Furthermore, the weights of specific left-neighbor samples can be derived, and the first left-hand reference sample can be derived based on the weights and specific left-neighbor samples. When the weights of specific left-neighbor samples are derived, the first left-hand reference sample can be derived based on Equation 1.

[127] For example, weights can be derived based on the distance between specific left-hand neighbor samples and the first left-hand reference sample. That is, a corresponding specific left-hand neighbor weight among specific left-hand neighbor samples can be derived based on a distance between the corresponding specific left-hand neighbor sample and the first left-hand reference sample, and, for example, a corresponding specific left-hand neighbor weight can be inversely proportional to the distance between the corresponding specific left-hand neighbor sample and the first left-hand reference sample.

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

[129] When specific left-neighbor samples derived from a current block prediction direction include a left-neighbor sample that is a fractional sample, a sample value of the left-neighbor sample that is the fractional sample can be derived through linear interpolation between sample values ​​of the integer samples adjacent to the left and right of the left-neighbor sample that is the fractional sample. For example, a sample value of the left-neighbor sample that is the fractional sample can be derived based on Equation 2.

[130] A method for determining 25 left-hand reference samples can be derived based on an intraprediction mode of the current block. For example, when an intraprediction mode of the current block has a prediction angle greater than that of a horizontal mode—that is, when an intraprediction mode of the current block is one of the 2nd to 9th intraprediction modes—a corresponding left-hand reference sample can be derived based on specific left-hand neighboring samples located in a prediction direction of the current block, based on the position of the corresponding left-hand reference sample. Here, the horizontal mode can correspond to a tenth intraprediction mode.Furthermore, when an intraprediction mode of the current block is a mode that has a prediction angle less than or equal to that of a horizontal mode, i.e., when an intraprediction mode of the current block is one of the 10th to 17th intraprediction modes, a corresponding left reference sample of the left reference samples can be derived based on left neighboring samples located in the same row as the corresponding left reference sample.

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

[132] The encoding device generates, encodes, and outputs current block prediction information (S1150). The encoding device can encode information in an intraprediction mode of the current block and output the encoded information as a bitstream. The encoding device can generate information in the intraprediction mode that represents the intraprediction mode and encode the generated information to output the encoded information as a bitstream. The intraprediction mode information can include information that directly indicates an intraprediction mode of the current block or can include information that indicates any candidate in a candidate intraprediction mode list derived from an intraprediction mode of a left-hand or top-hand block of the current block.

[133] Figure 12 schematically illustrates a method of video decoding using a device of Qoznnn / eznz / E / YiAi decoding in accordance with the present invention. A method described in Figure 12 can be implemented using the decoding device described in Figure 2. Specifically, for example, S1200 to S1240 of Figure 12 can be implemented using a prediction unit of the decoding device.

[134] The decoding device derives an intraprediction mode from a current block (S1200). The decoding device can obtain prediction information about the current block through the bitstream. The prediction information can include information that directly indicates an intraprediction mode of the current block or information that indicates any candidate in a list of intraprediction mode candidates derived based on an intraprediction mode of a left or top block of the current block. The decoding device can derive an intraprediction mode of the current block based on the obtained prediction information. The intraprediction mode can be one of two non-directional prediction modes and one of two directional prediction modes. As described above, the two non-directional prediction modes can include an intra-DC mode and an intra-piano mode.

[135] The decoding device derives a plurality of rows of upper neighbor samples and a Qoznnn / eznz / E / YiAi plurality of columns of left neighbor samples of the current block (S1210). The decoding device can derive a plurality of rows of upper neighbor samples of the current block. For example, the decoding device can derive four rows of upper neighbor samples of the current block. Furthermore, for example, when a current block size is NxN, the decoding device can derive 2N upper neighbor samples in each row of the plurality of rows. The 2N upper neighbor samples in each row can be referred to as the first upper neighbor samples.

[136] An upper reference sample can be derived using oase on specific upper neighbor samples derived using oase at a position of the upper reference sample 15 and a prediction direction of the current block's intraprediction mode, as described below. In this case, upper neighbor samples other than the first upper neighbor samples can be used to derive the upper reference sample according to a prediction direction of the current block 20.

[137] For example, when a current block size is NxN, the number of upper neighbor samples of the nth row among the plurality of upper neighbor sample rows may be more than 2N. As another example, when the nth row is a first row, the number of upper neighbor samples of the πth row is 2N, and the number of upper neighbor samples of the (n+l)th row may be greater than 2N. Furthermore, the number of upper neighbor samples of the nth row among a plurality of upper neighbor sample rows of the current block may be less than that of the upper neighbor samples of the (nll)th row.Specifically, the number of upper neighbor samples in the (n+l)th row can be greater than 2N, and the upper neighbor samples after a 2Nth upper neighbor sample among the upper neighbor samples in the (nll)th row can be obtained by filling in the 2Nth upper neighbor sample among the upper neighbor samples in the (nfl)th row. Alternatively, before a prediction sample of the current block is generated, when the reconstructed samples corresponding to the upper neighbor samples after the 2Nth upper neighbor sample among the upper neighbor samples in the (n+l)th row are generated, the reconstructed samples can be derived as upper neighbor samples after the 2Nth upper neighbor sample.

[138] As another example, when the current block size is NxN, the decoding device can derive a second upper neighbor sample for each row based on a prediction direction of the current block. Here, the 25th second upper neighbor sample can represent a sample Qoznnn / eznz / E / YiAi \necina superior of each row different from the first upper neighbor sample. The number of second upper neighbor samples for each row can be determined based on the prediction direction. The second upper neighbor sample 5 of each row can be obtained by filling in a first upper neighbor sample located on the far right between the first upper neighbor samples of each row. Alternatively, before a prediction sample of the current block is generated, when a reconstructed sample 10 of the second upper neighbor sample is generated, the reconstructed sample can be derived as the second upper neighbor sample, and before a prediction sample of the current block is generated, when a reconstructed sample of the second upper neighbor sample is not generated, the second upper neighbor sample 15 of each row can be derived by filling a first upper neighbor sample located on the rightmost side between the first upper neighbor samples of each row.

[139] Furthermore, in another example, the decoding device can derive a plurality of columns of left-neighbor samples from the current block. For example, the decoding device can derive four columns of left-neighbor samples from the current block. Moreover, for example, when the current block size is NxN, the decoding device can derive 2N left-neighbor samples in each column of the plurality of columns. The 2N left-neighbor samples in each column can be referred to as the first left-neighbor samples.

[140] A left reference sample can be derived based on specific left neighbor samples derived from a position of the left reference sample and a prediction direction of the current block's intraprediction mode, as described later. In this case, left neighbor samples other than the first samples can be used. Qoznnn / eznz / E / YiAi left neighbors to derive the left reference sample according to a current block prediction direction.

[141] For example, when a current block size is In NxN, the number of left neighbor samples of the nth column among the plurality of left neighbor sample columns can be greater than 2N. In another example, when the nth column is a first column, the number of left neighbor samples of the nth column is 2N, and the number of left neighbor samples of the (n+1)th column can be greater than 2U. Furthermore, the number of left neighbor samples of the nth column among the plurality of left neighbor sample columns of the current block can be less than the number of left neighbor samples of the (n+1)th column.Specifically, the number of left neighbor samples of the (n+1)th column can be more than 2N, and the left neighbor samples after a 2Nth left neighbor sample among the left neighbor samples of the (n+1)th column can be derived by filling the 2Nth left neighbor sample among the left neighbor samples of the (n+1)th column. Alternatively, before the current block prediction sample is generated, when the reconstructed samples corresponding to the left neighbor samples are generated after the 2Nth neighbor sample is generated among the left neighbor samples of the (n+1)th column, the reconstructed samples can be derived from 15 left neighbor samples after the 2Nth left neighbor sample.

[142] As another example, when a current block size is NxN, the decoding device can derive Qoznnn / eznz / E / YiAi A second left neighbor sample for each column is derived based on the prediction direction of the current block. The number of second left neighbor samples for each column can be determined based on the prediction direction. The second left neighbor sample for each column can be derived by filling in a first left neighbor sample located on the lower side between the first left neighbor samples for each column.Alternatively, before a prediction sample of the current block is generated, when a reconstructed sample of the second left neighbor sample is generated, the reconstructed sample can be derived from the second left neighbor sample, and before the prediction sample of the current block is generated, when a reconstructed sample of the second left neighbor sample is not generated, the second left neighbor sample of each column can be derived by filling a first left neighbor sample located on the lower side among the first left neighbor samples of each column.

[143] The decoding device derives a row of upper reference samples based on the 15 upper neighbor samples (S1220). The decoding device can derive a row of upper reference samples based on the plurality of rows of upper neighbor samples.

[144] For example, a reference upper sample 20 located in the xth column among the reference upper samples can be derived based on neighboring upper samples located in the xth column among the neighboring upper samples. In this case, an average of the sample values ​​of the 25 neighboring upper samples located in the xth column can be derived as a sample value of the reference upper sample located in the xth column. Furthermore, the weights of the neighboring upper samples located in the xth column can be derived, and the reference upper samples located in the xth column can be derived based on the weights of the neighboring upper samples located in the xth column. When the weights of the neighboring upper samples located in the xth column are derived, the reference upper sample can be derived based on Equation 1.

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

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

[147] As another example, a first upper reference sample among the upper reference samples can be derived based on specific upper neighbor samples derived from a position of the first upper reference sample and a prediction direction of the current block. Specifically, specific upper neighbor samples located in a prediction direction of the current block can be derived based on a position of the upper reference sample, and the upper reference sample can be derived based on the specific upper neighbor samples. In this case, an average value of sample values ​​from the specific upper neighbor samples can be derived as a sample value of the first upper reference sample.Furthermore, the weights of the specific upper neighbor samples can be derived, and the first upper reference sample can be derived based on the weights and the specific upper neighbor samples. When the weights of the 25 specific upper neighbor samples are derived, the first sample... Qoznnn / eznz / E / YiAi of higher reference can be derived based on Equation 1.

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

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

[150] When the specific upper neighbor samples 20 derived based on a prediction direction of the current block include an upper neighbor sample, which is a fractional sample, a sample value of the upper neighbor samples, which is the fractional sample, are the fractional samples can be derived through linear interpolation between the sample values ​​of the Qoznnn / eznz / E / YiAi samples of integers adjacent to the left and right of the upper neighbor sample, which is the fractional sample. For example, a sample value of the upper neighbor sample, which is the fractional sample, can be derived based on Equation 2.

[151] A method can be determined for deriving upper reference samples based on an intraprediction mode of the current block. For example, when an intraprediction mode of the current block is a mode that has a prediction angle greater than that of a vertical mode, i.e., when an intraprediction mode of the current block is one of the 27° to 34° intraprediction modes, a corresponding upper reference sample of the upper reference samples can be derived based on specific upper neighbor samples located in a prediction direction of the current block based on a position of the corresponding upper reference sample. Here, the vertical mode may correspond to a 26° intraprediction mode.When a current block intraprediction mode is a mode that has a prediction angle less than or equal to that of a vertical mode, i.e., when a current block intraprediction mode is one of the 18° to 26° intraprediction modes, the corresponding upper reference sample from the 25 upper reference samples can be derived based on. Qoznnn / eznz / E / YiAi upper neighboring samples located in the same column as the corresponding upper reference sample.

[152] The decoding device derives a left reference sample row based on the left neighboring samples (S1230). The decoding device can derive a left reference sample row based on the plurality of left neighboring sample columns.

[153] For example, a left-hand reference sample located in the y-th row among the left-hand reference samples can be derived based on left-hand neighboring samples located in the y-th row among the left-hand neighboring samples. In this case, an average value of sample values ​​from the left-hand neighboring samples located in the y-th row can be derived as a sample value from the left-hand reference sample located in the y-th row. Furthermore, the weights of the left-hand neighboring samples located in the y-th row can be derived, and the left-hand reference sample located in the y-th row can be derived based on the weights of the left-hand neighboring samples located in the y-th row. When the weights of the left-hand neighboring samples located in the y-th row are derived, the left-hand reference sample can be derived based on Equation 1. Qoznnn / eznz / E / YiAi

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

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

[156] As another example, a first sample of 25 references on the left among the reference samples The left-hand sample can be derived based on specific left-hand neighbor samples derived from the position of the first left-hand reference sample and the current block's prediction direction. Specifically, the five specific left-hand neighbor samples located in a prediction direction of the current block can be derived based on the position of the left-hand reference sample, and the left-hand reference sample can be derived based on the specific left-hand samples. In this case, an average value of the sample values ​​of the specific left-hand neighbor samples can be derived as a sample value of the first left-hand reference sample. Furthermore, the weights of the specific left-hand neighbor samples can be derived, and the first left-hand reference sample can be derived based on the weights of the specific left-hand neighbor samples.When the weights of the specific left-hand neighboring samples are derived, the first left-hand reference sample can be derived based on Equation 1.

[157] For example, weights can be derived based on the distance between specific left-neighbor samples and the first left-hand reference sample. That is, a weight of the corresponding specific left-neighbor sample between the samples Qoznnn / eznz / E / YiAi 9 specific left neighbors can be derived based on a distance between the corresponding specific left neighbor sample and the first left reference sample, and for example, a corresponding specific left neighbor sample weight can be inversely proportional to the distance between the corresponding specific left neighbor sample and the first left reference sample.

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

[159] When specific left neighbor samples derived from a current block prediction direction include a left neighbor sample that is a fractional sample, a sample value of the left neighbor sample that is the fractional sample can be derived through linear interpolation between sample values ​​of the integer samples adjacent to the left and right of the left neighbor sample that is the fractional sample. For example, a sample value of the left neighbor sample that is the fractional sample can be derived based on Equation 2.

[160] A method for deriving left-hand reference samples can be determined based on an intraprediction mode of the current block. For example, when an intraprediction mode of the current block is a mode that has a prediction angle greater than that of a horizontal mode 5, i.e., when an intraprediction mode of the current block is one of the 20 to 9 intraprediction modes, a corresponding left-hand reference sample from the left-hand reference samples can be derived based on specific left-hand neighboring samples 10 located in a prediction direction of the current block based on a position of the corresponding left-hand reference sample. Here, the horizontal mode can correspond to a tenth intraprediction mode.Furthermore, when a current block intraprediction mode is a 15 mode that has a prediction angle less than or equal to that of a horizontal mode, i.e., when a current block intraprediction mode is one of the 10° to 17° intraprediction modes, a corresponding left reference sample of the 20 left reference samples can be derived based on left neighboring samples located in the same row as the corresponding left reference sample.

[161] The decoding device generates a prediction sample of the current blog using at least one of the top 25 reference samples and the samples of Qoznnn / eznz / E / YiAi left reference according to intraprediction mode (S1240). The decoding device can generate the prediction sample based on an upper reference sample or a left reference sample located in a prediction direction of the intraprediction mode based on a prediction sample position-

[162] Although not shown in the drawing, the decoding device can immediately use the prediction sample as a reconstructed sample according to a prediction mode, or it can add a residual sample to the prediction sample to generate a reconstructed sample. When there is a residual sample from the target block, the decoding device can receive information about the residual sample from the target block, and the information about the residual sample can be included in the step information. The information about the residual sample can include a transformation coefficient related to the residual sample. The decoding device can derive the residual sample (or the residual sample matrix) from the target block based on the residual information.The decoding device can generate a reconstructed sample based on the prediction sample and the residual sample, and can derive a reconstructed block or a reconstructed image based on the reconstructed sample. Qoznnn / eznz / E / YiAi Subsequently, it is described that the decoding device can apply unlock filtering and / or a loop filtering procedure, such as an SAO procedure, to the reconstructed image to improve the subjective / objective image quality, as needed.

[163] In accordance with the present invention, a reference sample of a current block can be derived based on a plurality of neighboring samples, and by performing intraprediction based on the reference sample, the prediction accuracy of the current block can be improved, thereby improving the overall coding efficiency.

[164] Furthermore, in accordance with the present invention, a reference sample can be derived based on a plurality of neighboring samples located in a direction of 15 prediction of an intraprediction mode of a current block, and by performing an intraprediction based on the reference sample, the accuracy of the prediction of the current block can be improved, thereby improving the overall coding efficiency.

[165] Furthermore, in accordance with the present invention, the 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 intraprediction based on the reference sample, the accuracy of the prediction of the current block can be Qoznnn / eznz / E / YiAi improve, thus improving global coding efficiency.

[166] In the modality described above, the methods are described based on the flowchart, which has a series of steps or blocks. The present description is not limited to the order of the steps or blocks above. Some steps or blocks may occur simultaneously or in a different order from other steps or blocks as described above. Furthermore, those skilled in the art will understand that the steps shown in the flowchart above are not exclusive, that additional steps may be included, or that one or more steps in the flowchart may be removed without affecting the scope of the present description.

[167] The method according to the present invention described above can be implemented in software. The 15 encoding device and / or the decoding device according to the present invention can be included in a device that performs image processing, for example, for a television, a computer, a smartphone, a set-top box, or a 20 display device.

[168] When the modalities of the present invention are implemented in software, the method described above can be implemented by means of modules (processes, functions, etc.) that perform the functions described above. These modules can be stored in memory and Qoznnn / eznz / E / YiAi executed by a processor. Memory can be internal or external to the processor, and memory can be coupled to the processor using various well-known means. The processor may comprise an application-specific integrated circuit (ASIC), other chipsets, a logic circuit, and / or a data processing device. Memory may include ROM (read-only memory), RAM (random access memory), flash memory, a memory card, a storage medium, and / or another storage device.

Claims

1. A video decoding method performed by a decoding device, the method comprising: deriving an intraprediction mode of a current block from prediction mode information; deriving neighbor samples including upper neighbor samples and left neighbor samples of the current block; and generating prediction samples of the current block based on the intraprediction mode and the neighbor samples of the current block, wherein the upper neighbor samples include upper neighbor samples of an nth row located in an upward direction away from an upper row of the current block, wherein the left neighbor samples include left neighbor samples of an nth column located in a leftward direction away from a leftmost column of the current block, wherein n is a positive integer greater than 1,wherein a number of the upper neighbor samples of the nth row is greater than 2N based on a current block size that is N x N, where N is a positive integer, wherein sample values ​​of 25 additional upper neighbor samples located to the right of a 2N-th upper neighbor sample Qoznnn / eznz / E / YiAi among the upper neighbor samples of the nth row are derived to be equal to a sample value of the 2N-th upper neighbor sample without determining whether the additional upper neighbor samples are placed in 5 unavailable sample positions, and wherein coordinates of the 2N-th upper neighbor sample are (2N-1, -n) based on the coordinates of an upper-left sample in the current block being (0, 0).

2. A video coding method performed by a coding device, the method comprising: determining an intraprediction mode of a current block; deriving neighbor samples including upper neighbor samples and left neighbor samples of the current block; generating prediction samples of the current block based on the intraprediction mode and the neighbor samples of the current block; and encoding prediction mode information of the current block, wherein the upper neighbor samples include upper neighbor samples of an nth row located in an upward direction away from an upper row of the current block, wherein the left neighbor samples include left neighbor samples of an nth column located in a leftward direction away from a leftmost column of the current block, wherein n is a positive integer greater than 1,wherein a number of the upper neighbor samples of the nth row is greater than 2N based on a current block size that is N × N, where N is a positive integer, wherein the sample values ​​of additional upper neighbor samples located to the right of a 2Nth upper neighbor sample among the nth row upper neighbor samples are derived to be equal to a sample value of the 2Nth upper neighbor sample without determining whether the additional upper neighbor samples are placed in unavailable sample positions, and wherein the coordinates of the 2Nth upper neighbor sample are (2N-1, -n) based on coordinates of an upper-left sample in the current block that is (0, 0).

3. A non-transient, computer-readable digital storage medium that stores encoded information generated by steps of: 20 determining an intraprediction mode of a current block; deriving neighbor samples that include upper neighbor samples and left neighbor samples of the current block; generating prediction samples of the current block based on 25 the intraprediction mode and the neighbor samples of the current block Qoznnn / eznz / E / YiAi; and encoding the prediction mode information of the current block to generate a bitstream, wherein the upper neighbor samples include 5 upper neighbor samples of an nth row located in an upward direction away from an upper row of the current block, wherein the left neighbor samples include left neighbor samples of an nth column 10 located in a leftward direction away from a leftmost column of the current block,where n is a positive integer greater than 1, where a number of the upper neighbor samples of the nth row is greater than 2N based on an actual block size of N × N, where N is a positive integer, where the sample values ​​of additional upper neighbor samples located to the right of a 2Nth upper neighbor sample among the upper neighbor samples of the nth row are derived to be equal to a master value of the 2Nth upper neighbor sample without determining whether the additional upper neighbor samples are placed in unavailable sample positions, and where the coordinates of the 2Nth upper neighbor sample are (2N-1, -n) based on the coordinates of a left upper neighbor sample in the current block being (0, 0).