Methods for decoding and encoding video, and recordings readable by computers.

VN10063166BActive Publication Date: 2026-11-23KT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
VN1202307750
Authority / Receiving Office
VN · VN
Patent Type
Patents
Current Assignee / Owner
Priority Date
2016-12-07
Filing Date
2017-12-07
Publication Date
2026-11-23
Estimated Expiration
2037-12-07

AI Technical Summary

Technical Problem

The increasing demand for high-resolution and high-quality video signals, particularly in HD and UHD formats, leads to higher data volumes, resulting in increased transmission and storage costs, necessitating efficient video compression methods.

Method used

A method and device for performing intra prediction on encoding/decoding target blocks using weighted prediction with multiple reference samples and multiple intra prediction modes, allowing for efficient encoding and decoding of video signals by determining optimal prediction modes for subblocks within a current block based on performance results.

Benefits of technology

This approach enables efficient intra prediction during video encoding and decoding, effectively managing high-resolution video data by optimizing prediction samples and modes, thereby reducing data transmission and storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202307750_0
    Figure VN1202307750_0
Patent Text Reader

Abstract

The invention relates to a method for decoding image signals, which may include the following steps: determining the partition type of the current block, determining the forecast information in the current block, and acquiring the forecast block based on the forecast information. The invention also relates to a method for encoding video and a device for storing compressed video data.
Need to check novelty before this filing date? Find Prior Art

Description

Video signal processing method and device

[0001] The present invention relates to a video signal processing method and apparatus.

[0002] Recently, the demand for high-resolution, high-quality video, such as HD (High Definition) and UHD (Ultra High Definition) video, has been increasing across various application fields. As video data becomes higher in resolution and quality, the relative volume of data increases compared to conventional video data; consequently, transmission and storage costs increase when video data is transmitted using existing wired or wireless broadband lines or stored using conventional storage media. To address these issues arising from the increase in video data resolution and quality, high-efficiency video compression technologies can be utilized.

[0003] Various video compression technologies exist, such as inter-frame prediction technology that predicts pixel values ​​in the current picture from previous or subsequent pictures, intra-frame prediction technology that predicts pixel values ​​in the current picture using pixel information within the current picture, and entropy coding technology that assigns short codes to values ​​with high frequency and long codes to values ​​with low frequency; by utilizing these video compression technologies, video data can be effectively compressed for transmission or storage.

[0004] Meanwhile, along with the increasing demand for high-resolution video, the demand for stereoscopic video content as a new video service is also rising. Discussions are underway regarding video compression technologies to effectively provide high-resolution and ultra-high-resolution stereoscopic video content.

[0005] The present invention aims to provide a method and apparatus capable of efficiently performing intra prediction on a block to be encoded / decoded when encoding / decoding a video signal.

[0006] The present invention aims to provide a method and apparatus for performing intra prediction through weighted prediction using multiple reference samples in encoding / decoding a video signal.

[0007] The present invention aims to provide a method and apparatus for performing intra prediction using multiple intra prediction modes in encoding / decoding a video signal.

[0008] The technical problems to be solved by the present invention are not limited to those mentioned above, and other technical problems not mentioned will be clearly understood by those skilled in the art to which the present invention belongs from the description below.

[0009] A video signal decoding method and apparatus according to the present invention determines a first intra prediction mode for a first sub-block and a second intra prediction mode for a second sub-block within a current block, performs a first intra prediction for the first sub-block based on the first intra prediction mode, performs a second intra prediction for the second sub-block based on the second intra prediction mode, and can obtain a prediction sample for the current block according to the results of the first intra prediction and the second intra prediction.

[0010] A video signal encoding method and apparatus according to the present invention determines a first intra prediction mode for a first sub-block and a second intra prediction mode for a second sub-block within a current block, performs a first intra prediction for the first sub-block based on the first intra prediction mode, performs a second intra prediction for the second sub-block based on the second intra prediction mode, and can obtain a prediction sample for the current block according to the results of the first intra prediction and the second intra prediction.

[0011] In the video signal encoding / decoding method and apparatus according to the present invention, the prediction sample of the region corresponding to the first sub-block among the current blocks may be set as the first prediction sample obtained as the result of performing the first intra prediction, and the prediction sample of the region corresponding to the second sub-block may be set as the second prediction sample obtained as the result of performing the second intra prediction.

[0012] In the video signal encoding / decoding method and apparatus according to the present invention, the prediction sample located at the boundary of the first sub-block and the second sub-block within the current block may be obtained based on the weighted sum of the first prediction sample obtained as a result of performing the first intra prediction and the second prediction sample obtained as a result of performing the second intra prediction.

[0013] In the video signal encoding / decoding method and apparatus according to the present invention, the weights applied to the first prediction sample and the second prediction sample may be determined based on the position of the prediction sample or the difference value between the first intra prediction mode and the second intra prediction mode.

[0014] In the video signal encoding / decoding method and apparatus according to the present invention, the second intra prediction mode can be derived from the first intra prediction mode.

[0015] In the video signal encoding / decoding method and apparatus according to the present invention, the second intra prediction mode can be derived by adding a difference value to the value of the first intra prediction mode.

[0016] In the video signal encoding / decoding method and apparatus according to the present invention, the first intra prediction mode is a directional prediction mode, and the second intra prediction mode may be a non-directional prediction mode.

[0017] The features briefly summarized above regarding the present invention are merely exemplary aspects of the detailed description of the present invention that follows and do not limit the scope of the present invention.

[0018] According to the present invention, intra prediction can be efficiently performed on a block to be encoded / decoded.

[0019] According to the present invention, intra prediction can be performed based on weighted prediction using multiple reference samples.

[0020] According to the present invention, intra prediction can be performed using multiple intra prediction modes.

[0021] The effects obtainable from the present invention are not limited to those mentioned above, and other unmentioned effects will be clearly understood by those skilled in the art from the description below.

[0022] FIG. 1 is a block diagram showing an image encoding device according to an embodiment of the present invention.

[0023] FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present invention.

[0024] FIG. 3 illustrates an example of hierarchically dividing coding blocks based on a tree structure as an embodiment to which the present invention is applied.

[0025] FIG. 4 is a diagram showing a partition shape that allows binary tree-based partitioning as an embodiment to which the present invention is applied.

[0026] FIG. 5 is a diagram illustrating an example in which the present invention is applied, wherein only a specific type of binary tree-based partitioning is allowed.

[0027] FIG. 6 is a diagram illustrating an example in which information related to the number of times a binary tree is allowed is encoded / decoded as an embodiment to which the present invention is applied.

[0028] FIG. 7 is a diagram illustrating a partition mode that can be applied to a coding block as an embodiment to which the present invention is applied.

[0029] FIG. 8 illustrates a type of intra-prediction mode pre-defined in an image encoder / decoder as an embodiment to which the present invention is applied.

[0030] FIG. 9 illustrates a type of extended intra-prediction mode as an embodiment to which the present invention is applied.

[0031] FIG. 10 is a flowchart schematically illustrating an intra-prediction method as an embodiment to which the present invention is applied.

[0032] FIG. 11 illustrates a method for correcting a prediction sample of a current block based on difference information of surrounding samples as an embodiment to which the present invention is applied.

[0033] FIGS. 12 and FIGS. 13 illustrate a method for correcting a prediction sample based on a predetermined correction filter as an embodiment to which the present invention is applied.

[0034] FIG. 14 illustrates an example in which the application range of the correction filter is variably determined according to the size of the current block as an embodiment to which the present invention is applied.

[0035] Figures 15 and 16 are diagrams showing a one-dimensional reference sample group in which reference samples are rearranged in a row.

[0036] FIG. 17 is a diagram illustrating the distance between a first reference sample and a predicted target sample.

[0037] FIGS. 18 and FIGS. 19 are drawings illustrating the locations of the first reference sample and the second reference sample.

[0038] FIG. 20 is a diagram showing the locations of the first reference sample and the second reference sample.

[0039] FIG. 21 is a flowchart illustrating a multiple intra prediction method according to an embodiment of the present invention.

[0040] Figure 22 is a diagram showing an example in which multiple intra predictions are performed in sub-block units.

[0041] Figure 23 is a diagram showing an example of acquiring a prediction block in sub-block units.

[0042] Figure 24 is a diagram showing an example in which a weighted operation is applied to a sample located at the boundary of a sub-block.

[0043] The present invention is susceptible to various modifications and may have various embodiments; specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the invention to specific embodiments, and it should be understood that the invention includes all modifications, equivalents, and substitutions that fall within the spirit and scope of the invention. Similar reference numerals have been used for similar components in the description of each drawing.

[0044] Terms such as "first," "second," etc., may be used to describe various components, but said components should not be limited by said terms. These terms are used solely for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be named the second component, and similarly, the second component may be named the first component. The term "and / or" includes a combination of a plurality of related described items or any of a plurality of related described items.

[0045] When it is stated that one component is "connected" or "connected" to another component, it should be understood that while it may be directly connected or connected to that other component, there may also be other components in between. On the other hand, when it is stated that one component is "directly connected" or "directly connected" to another component, it should be understood that there are no other components in between.

[0046] The terms used in this application are used merely to describe specific embodiments and are not intended to limit the invention. The singular expression includes the plural expression unless the context clearly indicates otherwise. In this application, terms such as "comprising" or "having" are intended to specify the presence of the features, numbers, steps, actions, components, parts, or combinations thereof described in the specification, and should be understood as not precluding the existence or addition of one or more other features, numbers, steps, actions, components, parts, or combinations thereof.

[0047] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the attached drawings. Hereinafter, the same reference numerals are used for identical components in the drawings, and redundant descriptions of identical components are omitted.

[0048]

[0049] FIG. 1 is a block diagram showing an image encoding device according to an embodiment of the present invention.

[0050] Referring to FIG. 1, the image encoding device (100) may include a picture splitting unit (110), a prediction unit (120, 125), a conversion unit (130), a quantization unit (135), a reordering unit (160), an entropy encoding unit (165), an inverse quantization unit (140), an inverse conversion unit (145), a filter unit (150), and a memory (155).

[0051] Each component shown in FIG. 1 is depicted independently to represent different characteristic functions of the image encoding device and does not imply that each component consists of separate hardware or a single software unit. That is, each component is listed and included as a separate component for the convenience of explanation, but at least two of the components may be combined to form a single component, or a single component may be divided into multiple components to perform functions, and such integrated and separated embodiments of each component are included within the scope of the present invention as long as they do not deviate from the essence of the present invention.

[0052] Furthermore, some components may not be essential components performing an essential function in the present invention, but merely optional components for enhancing performance. The present invention may be implemented by including only the components essential for realizing the essence of the present invention, excluding components used solely for performance enhancement, and a structure including only the essential components, excluding optional components used solely for performance enhancement, is also included within the scope of the rights of the present invention.

[0053] The picture segmentation unit (110) can divide an input picture into at least one processing unit. At this time, the processing unit may be a Prediction Unit (PU), a Transform Unit (TU), or a Coding Unit (CU). The picture segmentation unit (110) can divide a picture into a combination of multiple coding units, prediction units, and transformation units, and can encode the picture by selecting one combination of coding units, prediction units, and transformation units based on a predetermined criterion (e.g., a cost function).

[0054] For example, a single picture can be divided into multiple coding units. To divide coding units within a picture, a recursive tree structure such as a Quad Tree Structure can be used. A coding unit divided into other coding units, with a single image or the largest coding unit as the root, can have as many child nodes as there are divided coding units. A coding unit that can no longer be divided according to certain limits becomes a leaf node. That is, assuming that only square division is possible for a single coding unit, a single coding unit can be divided into up to four different coding units.

[0055] In the following embodiments of the present invention, the encoding unit may be used to mean a unit that performs encoding, or a unit that performs decoding.

[0056] A prediction unit may be divided into at least one shape, such as a square or rectangle, of the same size within a single encoding unit, or one of the prediction units divided within a single encoding unit may be divided such that any one prediction unit has a different shape and / or size from another prediction unit.

[0057] When generating a prediction unit that performs intra prediction based on a coding unit, if it is not the minimum coding unit, intra prediction can be performed without dividing it into multiple prediction units NxN.

[0058] The prediction unit (120, 125) may include an inter prediction unit (120) that performs inter prediction and an intra prediction unit (125) that performs intra prediction. It may determine whether to use inter prediction or perform intra prediction for a prediction unit, and determine specific information (e.g., intra prediction mode, motion vector, reference picture, etc.) according to each prediction method. At this time, the processing unit in which the prediction is performed and the processing unit in which the prediction method and specific details are determined may be different. For example, the prediction method and prediction mode, etc. may be determined in the prediction unit, and the prediction may be performed in the transformation unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transformation unit (130). In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded together with the residual value in the entropy encoding unit (165) and transmitted to the decoder. When using a specific encoding mode, it is also possible to encode the original block as is and transmit it to the decoding unit without generating a prediction block through the prediction unit (120, 125).

[0059] The inter prediction unit (120) may predict a prediction unit based on information of at least one picture among the previous picture or the subsequent picture of the current picture, and in some cases, may predict a prediction unit based on information of a partially encoded area within the current picture. The inter prediction unit (120) may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

[0060] In the reference picture interpolation unit, reference picture information is received from memory (155), and pixel information of integer pixels or less can be generated from the reference picture. In the case of luminance pixels, a DCT-based 8-tap interpolation filter with different filter coefficients can be used to generate pixel information of integer pixels or less in 1 / 4 pixel units. In the case of chrominance signals, a DCT-based 4-tap interpolation filter with different filter coefficients can be used to generate pixel information of integer pixels or less in 1 / 8 pixel units.

[0061] The motion prediction unit can perform motion prediction based on a reference picture interpolated by the reference picture interpolation unit. Various methods such as FBMA (Full search-based Block Matching Algorithm), TSS (Three Step Search), and NTS (New Three-Step Search Algorithm) can be used to calculate motion vectors. Based on the interpolated pixels, the motion vector can have motion vector values ​​in units of 1 / 2 or 1 / 4 pixels. The motion prediction unit can predict the current prediction unit by using different motion prediction methods. Various motion prediction methods such as the Skip method, Merge method, AMVP (Advanced Motion Vector Prediction) method, and Intra Block Copy method can be used.

[0062] The intra prediction unit (125) can generate a prediction unit based on reference pixel information around the current block, which is pixel information within the current picture. If the surrounding block of the current prediction unit is a block that has performed inter prediction, and the reference pixel is a pixel that has performed inter prediction, the reference pixel included in the block that has performed inter prediction can be replaced with the reference pixel information of the surrounding intra prediction block. That is, if the reference pixel is not available, the unavailable reference pixel information can be replaced with at least one of the available reference pixels.

[0063] In intra-prediction, the prediction mode may include a directional prediction mode that uses reference pixel information according to the prediction direction, and a non-directional mode that does not use directional information when performing the prediction. The mode for predicting luminance information and the mode for predicting chrominance information may be different, and the intra-prediction mode information used to predict luminance information or the predicted luminance signal information may be utilized to predict chrominance information.

[0064] When performing intra prediction, if the size of the prediction unit and the size of the transform unit are the same, intra prediction for the prediction unit can be performed based on the pixels to the left, the pixels at the top left, and the pixels at the top of the prediction unit. However, when performing intra prediction, if the size of the prediction unit and the size of the transform unit are different, intra prediction can be performed using reference pixels based on the transform unit. Additionally, intra prediction using NxN partitioning can be used only for the minimum encoding unit.

[0065] The intra prediction method can generate a prediction block after applying an Adaptive Intra Smoothing (AIS) filter to a reference pixel according to the prediction mode. The type of AIS filter applied to the reference pixel may vary. To perform the intra prediction method, the intra prediction mode of the current prediction unit can be predicted from the intra prediction modes of prediction units existing in the vicinity of the current prediction unit. When predicting the prediction mode of the current prediction unit using mode information predicted from neighboring prediction units, if the intra prediction modes of the current prediction unit and the neighboring prediction units are the same, information indicating that the prediction modes of the current prediction unit and the neighboring prediction units are the same can be transmitted using predetermined flag information; if the prediction modes of the current prediction unit and the neighboring prediction units are different, entropy coding can be performed to encode the prediction mode information of the current block.

[0066] Additionally, a residual block can be generated that includes residual value information, which is the difference between the prediction unit that performed the prediction based on the prediction unit generated in the prediction unit (120, 125) and the original block of the prediction unit. The generated residual block can be input to the conversion unit (130).

[0067] In the transformation unit (130), the residual block containing residual value information of the prediction unit generated through the original block and the prediction unit (120, 125) can be transformed using a transformation method such as DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), or KLT. Whether to apply DCT, DST, or KLT to transform the residual block can be determined based on the intra-prediction mode information of the prediction unit used to generate the residual block.

[0068] The quantization unit (135) can quantize the values ​​converted into the frequency domain in the conversion unit (130). The quantization coefficient may vary depending on the block or the importance of the image. The values ​​produced by the quantization unit (135) may be provided to the inverse quantization unit (140) and the reordering unit (160).

[0069] The reordering unit (160) can perform reordering of coefficient values ​​for quantized residual values.

[0070] The reordering unit (160) can convert two-dimensional block-shaped coefficients into one-dimensional vector forms through a coefficient scanning method. For example, the reordering unit (160) can convert the coefficients from DC to high-frequency range coefficients into one-dimensional vector forms by scanning using a Zig-Zag Scan method. Depending on the size of the conversion unit and the intra-prediction mode, a vertical scan that scans two-dimensional block-shaped coefficients in the column direction or a horizontal scan that scans two-dimensional block-shaped coefficients in the row direction may be used instead of the Zig-Zag Scan. That is, depending on the size of the conversion unit and the intra-prediction mode, it can be determined whether to use a Zig-Zag Scan, a vertical scan, or a horizontal scan.

[0071] The entropy encoding unit (165) can perform entropy encoding based on the values ​​calculated by the reordering unit (160). Entropy encoding can use various encoding methods, such as, for example, Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC).

[0072] The entropy encoding unit (165) can encode various information from the reordering unit (160) and the prediction unit (120, 125), such as residual value coefficient information of the encoding unit, block type information, prediction mode information, division unit information, prediction unit information and transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering information.

[0073] The entropy encoding unit (165) can entropy-encode the coefficient value of the encoding unit input from the rearrangement unit (160).

[0074] In the inverse quantization unit (140) and inverse transformation unit (145), the values ​​quantized in the quantization unit (135) are inverse quantized, and the values ​​transformed in the transformation unit (130) are inverse transformed. The residual value generated in the inverse quantization unit (140) and inverse transformation unit (145) can be combined with the prediction unit predicted through the motion estimation unit, motion compensation unit, and intra prediction unit included in the prediction unit (120, 125) to generate a reconstructed block.

[0075] The filter section (150) may include at least one of a deblocking filter, an offset correction section, and an ALF (Adaptive Loop Filter).

[0076] The deblocking filter can remove block distortion caused by boundaries between blocks in the restored picture. To determine whether to perform deblocking, the decision to apply the deblocking filter to the current block can be made based on the pixels contained in a certain number of columns or rows within the block. When applying the deblocking filter to a block, a Strong Filter or a Weak Filter can be applied depending on the required deblocking filtering strength. Additionally, when applying the deblocking filter, horizontal and vertical filtering can be processed in parallel.

[0077] The offset correction unit can correct the offset from the original image on a pixel-by-pixel basis for the image that has undergone deblocking. To perform offset correction for a specific picture, a method can be used in which pixels included in the image are divided into a certain number of regions, the region to be offset is determined, and the offset is applied to that region, or a method can be used in which the offset is applied by considering the edge information of each pixel.

[0078] Adaptive Loop Filtering (ALF) can be performed based on a comparison between the filtered restored image and the original image. After dividing the pixels included in the image into predetermined groups, a single filter to be applied to each group can be determined, allowing for differential filtering for each group. Information regarding whether to apply ALF can be transmitted per coding unit (CU), and the shape and filter coefficients of the ALF filter to be applied may vary depending on each block. Additionally, an ALF filter of the same form (fixed form) may be applied regardless of the characteristics of the block to be applied.

[0079] The memory (155) can store a restored block or picture produced through the filter unit (150), and the stored restored block or picture can be provided to the prediction unit (120, 125) when performing inter-prediction.

[0080]

[0081] FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present invention.

[0082] Referring to FIG. 2, the image decoder (200) may include an entropy decoder (210), a reordering unit (215), an inverse quantization unit (220), an inverse transformation unit (225), a prediction unit (230, 235), a filter unit (240), and a memory (245).

[0083] When a video bitstream is input to a video encoder, the input bitstream can be decoded using the reverse procedure of the video encoder.

[0084] The entropy decoding unit (210) can perform entropy decoding in the opposite procedure to that which the entropy encoding unit of the image encoder performed. For example, various methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) can be applied in correspondence with the method performed in the image encoder.

[0085] The entropy decoding unit (210) can decode information related to intra-prediction and inter-prediction performed in the encoder.

[0086] The reordering unit (215) can perform reordering based on the method of reordering the entropy-decoded bitstream in the encoding unit in the entropy decoding unit (210). It can reorder by restoring the coefficients expressed in the form of a one-dimensional vector back into coefficients in the form of a two-dimensional block. The reordering unit (215) can perform reordering by receiving information related to the coefficient scanning performed in the encoding unit and scanning in reverse based on the scanning order performed in the encoding unit.

[0087] The inverse quantization unit (220) can perform inverse quantization based on the coefficient values ​​of the rearranged block and the quantization parameters provided by the encoder.

[0088] The inverse transform unit (225) can perform inverse transforms, i.e., inverse DCT, inverse DST, and inverse KLT, on the transforms, i.e., DCT, DST, and KLT, performed by the transform unit on the quantization result performed by the image encoder. The inverse transform can be performed based on the transmission unit determined by the image encoder. In the inverse transform unit (225) of the image decoder, a transformation technique (e.g., DCT, DST, KLT) can be selectively performed according to multiple pieces of information such as a prediction method, the size of the current block, and the prediction direction.

[0089] The prediction unit (230, 235) can generate a prediction block based on the prediction block generation information provided by the entropy decoding unit (210) and the previously decoded block or picture information provided by the memory (245).

[0090] As described above, when performing intra prediction identical to the operation in the video encoder, if the size of the prediction unit and the size of the transform unit are the same, intra prediction for the prediction unit is performed based on the pixels to the left, the pixels to the top left, and the pixels to the top of the prediction unit; however, if the size of the prediction unit and the size of the transform unit are different when performing intra prediction, intra prediction can be performed using reference pixels based on the transform unit. Additionally, intra prediction using NxN partitioning only for the minimum encoding unit may also be used.

[0091] The prediction unit (230, 235) may include a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit determination unit receives various information, such as prediction unit information input from the entropy decoding unit (210), prediction mode information of the intra prediction method, and motion prediction related information of the inter prediction method, distinguishes the prediction unit from the current encoding unit, and determines whether the prediction unit performs inter prediction or intra prediction. The inter prediction unit (230) may perform inter prediction for the current prediction unit based on information included in at least one picture, either the previous picture or the subsequent picture, of the current picture containing the current prediction unit, using information required for inter prediction of the current prediction unit provided by the video encoder. Alternatively, it may perform inter prediction based on information of a partially restored area within the current picture containing the current prediction unit.

[0092] To perform inter-prediction, based on the encoding unit, it is possible to determine whether the motion prediction method of the prediction unit included in the corresponding encoding unit is Skip Mode, Merge Mode, AMVP Mode, or Intra-Block Copy Mode.

[0093] The intra prediction unit (235) can generate a prediction block based on pixel information within the current picture. If the prediction unit is a prediction unit that has performed intra prediction, it can perform intra prediction based on the intra prediction mode information of the prediction unit provided by the image encoder. The intra prediction unit (235) may include an Adaptive Intra Smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a part that performs filtering on the reference pixel of the current block, and can determine whether to apply the filter based on the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixel of the current block using the prediction mode of the prediction unit and the AIS filter information provided by the image encoder. If the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.

[0094] The reference pixel interpolation unit can generate a reference pixel of an integer value or less by interpolating the reference pixel when the prediction mode of the prediction unit is a prediction unit that performs intra-prediction based on the pixel value interpolated from the reference pixel. If the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. The DC filter can generate a prediction block through filtering when the prediction mode of the current block is DC mode.

[0095] The restored block or picture may be provided to a filter unit (240). The filter unit (240) may include a deblocking filter, an offset correction unit, and an ALF.

[0096] Information regarding whether a deblocking filter has been applied to the corresponding block or picture can be received from the video encoder, and if a deblocking filter has been applied, information regarding whether a strong filter or a weak filter has been applied. The deblocking filter of the video decoder receives information related to the deblocking filter provided by the video encoder and can perform deblocking filtering on the corresponding block.

[0097] The offset correction unit can perform offset correction on the restored image based on the type of offset correction and offset value information applied to the image during encoding.

[0098] ALF can be applied to the encoding unit based on information on whether to apply ALF, ALF coefficient information, etc., provided by the encoder. This ALF information can be provided included in a specific parameter set.

[0099] The memory (245) can store the restored picture or block so that it can be used as a reference picture or reference block, and can also provide the restored picture to the output unit.

[0100] As described above, in the embodiments of the present invention below, for convenience of explanation, the term "Coding Unit" is used as "encoding unit," but it may be a unit that performs not only encoding but also decoding.

[0101] Additionally, the current block represents a block to be encoded / decoded, and depending on the encoding / decoding stage, it may represent a coding tree block (or coding tree unit), an encoding block (or encoding unit), a conversion block (or conversion unit), or a prediction block (or prediction unit), etc.

[0102]

[0103] A picture can be divided into square or non-square base blocks for encoding / decoding. In this case, the base block may be referred to as a Coding Tree Unit. A Coding Tree Unit may be defined as the largest encoding unit allowed in a sequence or slice. Information regarding whether a Coding Tree Unit is square or non-square, or the size of the Coding Tree Unit, may be signaled through a sequence parameter set, a picture parameter set, or a slice header. A Coding Tree Unit may be divided into smaller partitions. In this case, if the partition created by dividing a Coding Tree Unit is denoted as depth 1, the partition created by dividing a depth 1 partition may be defined as depth 2. That is, the partition created by dividing a depth k partition within a Coding Tree Unit may be defined as having depth k+1.

[0104] A partition of arbitrary size generated as a coding tree unit is divided can be defined as a coding unit. A coding unit may be recursively divided or divided into basic units for performing prediction, quantization, transformation, or in-loop filtering. For example, a partition of arbitrary size generated as a coding unit is divided can be defined as a coding unit, or as a transformation unit or a prediction unit, which is a basic unit for performing prediction, quantization, transformation, or in-loop filtering.

[0105] Partitioning of a coding tree unit or a coding unit may be performed based on at least one of a vertical line or a horizontal line. Additionally, the number of vertical lines or horizontal lines partitioning the coding tree unit or a coding unit may be at least one. For example, a coding tree unit or a coding unit may be divided into two partitions using one vertical line or one horizontal line, or a coding tree unit or a coding unit may be divided into three partitions using two vertical lines or two horizontal lines. Alternatively, a coding tree unit or a coding unit may be divided into four partitions with a length and width of 1 / 2 using one vertical line and one horizontal line.

[0106] When a coding tree unit or a coding unit is divided into multiple partitions using at least one vertical line or at least one horizontal line, the partitions may have a uniform size or different sizes. Alternatively, one partition may have a different size from the remaining partitions.

[0107] In the embodiments described below, it is assumed that the coding tree unit or coding unit is divided into a quad tree or binary tree structure. However, division of the coding tree unit or coding unit using a greater number of vertical lines or a greater number of horizontal lines is also possible.

[0108] FIG. 3 illustrates an example of hierarchically dividing coding blocks based on a tree structure as an embodiment to which the present invention is applied.

[0109] The input video signal is decoded in predetermined block units, and the basic unit for decoding the input video signal in this way is called a coding block. A coding block can be a unit that performs intra / inter prediction, transformation, and quantization. In addition, a prediction mode (e.g., intra-frame prediction mode or inter-frame prediction mode) is determined in units of coding blocks, and prediction blocks included in the coding block can share the determined prediction mode. A coding block may be a square or non-square block of any size within the range of 8x8 to 64x64, or a square or non-square block of 128x128, 256x256, or larger.

[0110] Specifically, coding blocks can be hierarchically partitioned based on at least one of a quad tree and a binary tree. Here, quad tree-based partitioning may mean a method in which a 2Nx2N coding block is partitioned into 4 NxN coding blocks, and binary tree-based partitioning may mean a method in which a single coding block is partitioned into 2 coding blocks. Even if binary tree-based partitioning is performed, square coding blocks may exist at lower depths.

[0111] Binary tree-based partitioning may be performed symmetrically or asymmetrically. Coding blocks partitioned based on a binary tree may be square blocks or non-square blocks such as rectangles. For example, partition types that allow binary tree-based partitioning may include at least one of symmetric 2NxN (horizontal non-square coding units) or Nx2N (vertical non-square coding units), and asymmetric nLx2N, nRx2N, 2NxnU, or 2NxnD, as shown in the example in FIG. 4.

[0112] Binary tree-based partitioning may restrictively allow only one of symmetric or asymmetric partitions. In this case, configuring the coding tree units into square blocks corresponds to quad tree CU partitioning, and configuring the coding tree units into symmetric non-square blocks corresponds to binary tree partitioning. configuring the coding tree units into square blocks and symmetric non-square blocks corresponds to quad and binary tree CU partitioning.

[0113] Binary tree-based splitting can be performed on coding blocks where quad tree-based splitting is no longer performed. Quad tree-based splitting may no longer be performed on coding blocks that have been split based on a binary tree.

[0114] In addition, the partitioning of lower depths may be determined dependently on the partitioning form of upper depths. For example, if binary tree-based partitioning is allowed in two or more depths, only binary tree-based partitioning of the same form as the binary tree partitioning form of upper depths may be allowed in lower depths. For instance, if binary tree-based partitioning of a 2NxN form is performed in upper depths, binary tree-based partitioning of a 2NxN form may also be performed in lower depths. Alternatively, if binary tree-based partitioning of an Nx2N form is performed in upper depths, binary tree-based partitioning of an Nx2N form may also be allowed in lower depths.

[0115] Conversely, at lower depths, it is also possible to allow only binary tree-based partitions that are different from the binary tree partitioning form at higher depths.

[0116] For a sequence, slice, coding tree unit, or coding unit, it may be restricted so that only specific forms of binary tree-based partitioning are used. For example, for a coding tree unit, it may be restricted so that only 2NxN or Nx2N forms of binary tree-based partitioning are allowed. The allowed partition forms may be predefined in the encoder or decoder, or information regarding the allowed or disallowed partition forms may be encoded and signaled through the bitstream.

[0117] FIG. 5 is a diagram showing an example where only specific forms of binary tree-based partitioning are allowed. FIG. 5(a) shows an example where only Nx2N forms of binary tree-based partitioning are allowed, and FIG. 5(b) shows an example where only 2NxN forms of binary tree-based partitioning are allowed. To implement the quad tree or binary tree-based adaptive partitioning, information indicating quad tree-based partitioning, information regarding the size / depth of coding blocks where quad tree-based partitioning is allowed, information indicating binary tree-based partitioning, information regarding the size / depth of coding blocks where binary tree-based partitioning is allowed, information regarding the size / depth of coding blocks where binary tree-based partitioning is not allowed, or information regarding whether the binary tree-based partitioning is vertical or horizontal may be used.

[0118] In addition, for a coding tree unit or a predetermined coding unit, the number of times binary tree splitting is allowed, the depth at which binary tree splitting is allowed, or the number of depths at which binary tree splitting is allowed can be obtained. The above information can be encoded in units of coding tree units or coding units and transmitted to a decoder via a bitstream.

[0119] For example, the syntax 'max_binary_depth_idx_minus1', which indicates the maximum depth at which binary tree splitting is allowed, can be encoded / decoded through the bitstream. In this case, max_binary_depth_idx_minus1+1 may indicate the maximum depth at which binary tree splitting is allowed.

[0120] Looking at the example illustrated in FIG. 6, it is shown that binary tree splitting is performed for a coding unit of depth 2 and a coding unit of depth 3. Accordingly, at least one of information indicating the number of times binary tree splitting is performed within a coding tree unit (2 times), information indicating the maximum depth (depth 3) at which binary tree splitting is allowed within a coding tree unit, or information indicating the number of depths (2, depth 2 and depth 3) at which binary tree splitting is allowed within a coding tree unit can be encoded / decoded through a bitstream.

[0121] As another example, at least one of the number of times binary tree splitting is allowed, the depth at which binary tree splitting is allowed, or the number of depths at which binary tree splitting is allowed can be obtained per sequence or slice. For example, the information may be encoded in units of sequence, picture, or slice and transmitted via a bitstream. Accordingly, at least one of the number of binary tree splitting, the maximum depth at which binary tree splitting is allowed, or the number of depths at which binary tree splitting is allowed may differ between the first slice and the second slice. For example, in the first slice, binary tree splitting is allowed at only one depth, whereas in the second slice, binary tree splitting may be allowed at two depths.

[0122] As another example, at least one of the number of times binary tree splitting is allowed, the depth at which binary tree splitting is allowed, or the number of depths at which binary tree splitting is allowed may be set differently depending on the Temporal ID of the slice or picture. Here, the Temporal ID is intended to identify each of multiple layers of an image having at least one scalability among view, spatial, temporal, or quality.

[0123] As illustrated in FIG. 3, a first coding block 300 with a split depth of k can be divided into a plurality of second coding blocks based on a quad tree. For example, the second coding blocks 310 to 340 are square blocks with a size half the width and height of the first coding block, and the split depth of the second coding blocks can be increased to k+1.

[0124] A second coding block 310 with a division depth of k+1 can be divided into a plurality of third coding blocks with a division depth of k+2. The division of the second coding block 310 can be performed by selectively using either a quad tree or a binary tree depending on the division method. Here, the division method can be determined based on at least one of information indicating division based on a quad tree or information indicating division based on a binary tree.

[0125] When the second coding block 310 is divided based on a quotate tree, the second coding block 310 is divided into four third coding blocks 310a, each having half the width and height of the second coding block, and the division depth of the third coding blocks 310a can be increased to k+2. On the other hand, when the second coding block 310 is divided based on a binary tree, the second coding block 310 can be divided into two third coding blocks. In this case, each of the two third coding blocks is a non-square block having half the width or height of the second coding block, and the division depth can be increased to k+2. The second coding block can be determined as a horizontal or vertical non-square block depending on the division direction, and the division direction can be determined based on information regarding whether the binary tree-based division is vertical or horizontal.

[0126] Meanwhile, the second coding block 310 may be determined as a terminal coding block that is no longer divided based on a quad tree or a binary tree, and in this case, the coding block may be used as a prediction block or a transformation block.

[0127] The third coding block 310a may be determined as a terminal coding block, similar to the division of the second coding block 310, or may be further divided based on a quad tree or a binary tree.

[0128] Meanwhile, the third coding block 310b, which is divided based on a binary tree, may be further divided into a vertical coding block (310b-2) or a horizontal coding block (310b-3) based on a binary tree, and the division depth of the coding block may be increased to k+3. Alternatively, the third coding block 310b may be determined as a terminal coding block (310b-1) that is no longer divided based on a binary tree, in which case the coding block (310b-1) may be used as a prediction block or a transformation block. However, the above-described division process may be performed restrictively based on at least one of information regarding the size / depth of a coding block that allows quad tree-based division, information regarding the size / depth of a coding block that allows binary tree-based division, or information regarding the size / depth of a coding block that does not allow binary tree-based division.

[0129] The size that a coding block may have may be limited to a predetermined number, or the size of a coding block within a predetermined unit may have a fixed value. For example, the size of a coding block within a sequence or the size of a coding block within a picture may be limited to 256x256, 128x128, or 32x32. Information indicating the size of a coding block within a sequence or picture may be signaled through a sequence header or a picture header.

[0130] As a result of partitioning based on quad trees and binary trees, the coding unit can take the form of a square or a rectangle of arbitrary size.

[0131]

[0132] A coding block is encoded using at least one of a skip mode, intra-frame prediction, inter-frame prediction, or skip method. Once the coding block is determined, a prediction block can be determined through the prediction partitioning of the coding block. The prediction partitioning of the coding block can be performed by a Part_mode that indicates the partitioning form of the coding block. The size or shape of the prediction block can be determined according to the Part_mode of the coding block. For example, the size of the prediction block determined according to the Part_mode can have a value equal to or smaller than the size of the coding block.

[0133] Figure 7 is a diagram illustrating a partition mode that can be applied to a coding block when the coding block is encoded by cross-frame prediction.

[0134] When a coding block is encoded by cross-frame prediction, any one of the eight partition modes may be applied to the coding block, as in the example shown in FIG. 7.

[0135] If a coding block is encoded by in-screen prediction, the coding block may have a partition mode PART_2Nx2N or PART_NxN applied.

[0136] PART_NxN may be applied when the coding block has a minimum size. Here, the minimum size of the coding block may be predefined in the encoder and decoder. Alternatively, information regarding the minimum size of the coding block may be signaled via a bitstream. For example, the minimum size of the coding block may be signaled via a slice header, and accordingly, the minimum size of the coding block may be defined per slice.

[0137] Generally, the size of the prediction block can range from 64x64 to 4x4. However, if the coding block is encoded as an inter-frame prediction, the prediction block may not have a size of 4x4 in order to reduce memory bandwidth when performing motion compensation.

[0138]

[0139] FIG. 8 illustrates a type of intra-prediction mode pre-defined in an image encoder / decoder as an embodiment to which the present invention is applied.

[0140] The video encoder / decoder can perform intra prediction using any one of the predefined intra prediction modes. The predefined intra prediction modes for intra prediction may consist of non-directional prediction modes (e.g., Planar mode, DC mode) and 33 directional prediction modes.

[0141] Alternatively, to increase the accuracy of intra prediction, a greater number of directional prediction modes than 33 may be used. That is, M extended directional prediction modes may be defined by further subdividing the angle of the directional prediction mode (M>33), or a directional prediction mode with a predetermined angle may be derived and used by utilizing at least one of the 33 predefined directional prediction modes.

[0142] A greater number of intra prediction modes than the 35 intra prediction modes shown in FIG. 8 may be used. For example, a greater number of intra prediction modes than 35 may be used by further subdividing the angle of the directional prediction mode or by decoding a directional prediction mode with a predetermined angle using at least one of a predetermined number of directional modes. In this case, using a greater number of intra prediction modes than 35 may be referred to as an extended intra prediction mode.

[0143] FIG. 9 is an example of an extended intra prediction mode, which may consist of two non-directional prediction modes and 65 extended directional prediction modes. The extended intra prediction mode may be used equally for the luminance component and the chrominance component, or a different number of intra prediction modes may be used for each component. For example, 67 extended intra prediction modes may be used for the luminance component and 35 intra prediction modes for the chrominance component.

[0144] Alternatively, intra prediction may be performed using a different number of intra prediction modes depending on the color difference format. For example, in the case of a 4:2:0 format, 67 intra prediction modes may be used for the luminance component and 35 intra prediction modes may be used for the color difference component, and in the case of a 4:4:4 format, 67 intra prediction modes may be used for both the luminance and color difference components.

[0145] Alternatively, intra prediction may be performed using a different number of intra prediction modes depending on the size and / or shape of the block. That is, depending on the size and / or shape of the PU or CU, intra prediction may be performed using 35 intra prediction modes or 67 intra prediction modes. For example, if the size of the CU or PU is smaller than 64x64 or is an asymmetric partition, intra prediction may be performed using 35 intra prediction modes, and if the size of the CU or PU is equal to or greater than 64x64, intra prediction may be performed using 67 intra prediction modes. Intra_2Nx2N, 65 directional intra prediction modes may be allowed, and in Intra_NxN, only 35 directional intra prediction modes may be allowed.

[0146] The size of the block to which the extended intra prediction mode is applied may be set differently for each sequence, picture, or slice. For example, in the first slice, the extended intra prediction mode may be set to be applied to blocks larger than 64x64 (e.g., CU or PU), and in the second slice, the extended intra prediction mode may be set to be applied to blocks larger than 32x32. Information indicating the size of the block to which the extended intra prediction mode is applied may be signaled on a sequence, picture, or slice basis. For example, information indicating the size of the block to which the extended intra prediction mode is applied may be defined as 'log2_extended_intra_mode_size_minus4', which is obtained by taking the logarithm of the block size and subtracting the integer 4. For example, a value of log2_extended_intra_mode_size_minus4 of 0 indicates that the extended intra prediction mode can be applied to blocks with a size of 16x16 or larger, or blocks with a size larger than 16x16, and a value of log2_extended_intra_mode_size_minus4 of 1 indicates that the extended intra prediction mode can be applied to blocks with a size of 32x32 or larger, or blocks with a size larger than 32x32.

[0147] As described above, the number of intra prediction modes can be determined by considering at least one of the chrominance component, the chrominance format, and the size or shape of the block. Not limited to the examples described, the intra prediction mode candidates (e.g., the number of MPMs) used to determine the intra prediction mode of the block to be encoded / decoded may also be determined according to at least one of the chrominance component, the chrominance format, and the size or shape of the block. Referring to the drawings described below, we will examine a method for determining the intra prediction mode of the block to be encoded / decoded and a method for performing intra prediction using the determined intra prediction mode.

[0148]

[0149] FIG. 10 is a flowchart schematically illustrating an intra-prediction method as an embodiment to which the present invention is applied.

[0150] Referring to FIG. 10, the intra prediction mode of the current block can be determined (S1000).

[0151] Specifically, the intra prediction mode of the current block can be derived based on a candidate list and an index. Here, the candidate list includes multiple candidates, and the multiple candidates can be determined based on the intra prediction mode of a neighboring block adjacent to the current block. The neighboring blocks may include at least one of the blocks located at the top, bottom, left, right, or corner of the current block. The index can specify any one of the multiple candidates belonging to the candidate list. The candidate specified by the index can be set as the intra prediction mode of the current block.

[0152] An intra prediction mode used by a neighboring block for intra prediction may be set as a candidate. Additionally, an intra prediction mode with a directionality similar to that of the neighboring block may be set as a candidate. Here, an intra prediction mode with a similar directionality may be determined by adding or subtracting a predetermined constant value from the intra prediction mode of the neighboring block. The predetermined constant value may be an integer of 1, 2, or more.

[0153] The above candidate list may further include default modes. The default mode may include at least one of planner mode, DC mode, vertical mode, and horizontal mode. The default mode may be adaptively added by considering the maximum number of candidates that can be included in the candidate list of the current block.

[0154] The maximum number of candidates that can be included in the candidate list may be 3, 4, 5, 6, or more. The maximum number of candidates that can be included in the candidate list may be a fixed value pre-set in the video encoder / decoder, or it may be determined variably based on the attributes of the current block. The attributes may refer to the location / size / shape of the block, the number / type of intra-prediction modes available to the block, chrominance attributes, chrominance format, etc. Alternatively, information indicating the maximum number of candidates that can be included in the candidate list may be signaled separately, and the maximum number of candidates that can be included in the candidate list may be determined variably using this information. The information indicating the maximum number of candidates may be signaled at least one of the sequence level, picture level, slice level, or block level.

[0155] When the extended intra prediction mode and the predefined 35 intra prediction modes are optionally used, the intra prediction mode of the surrounding block can be converted into an index corresponding to the extended intra prediction mode or into an index corresponding to the 35 intra prediction modes to derive a candidate. A predefined table may be used for the conversion of the index, or a scaling operation based on a predetermined value may be used. Here, the predefined table may define a mapping relationship between different intra prediction mode groups (e.g., the extended intra prediction mode and the 35 intra prediction modes).

[0156] For example, if the left peripheral block uses 35 intra prediction modes and the left peripheral block's intra prediction mode is 10 (horizontal mode), this can be converted to an index 16 corresponding to the horizontal mode in the extended intra prediction mode.

[0157] Alternatively, if the upper surrounding block uses an extended intra prediction mode and the intra prediction mode index of the upper surrounding block is 50 (vertical mode), this can be converted to an index of 26 corresponding to the vertical mode in 35 intra prediction modes.

[0158] Based on the intra prediction mode determination method described above, an intra prediction mode may be derived independently of each other for the luminance component and the chrominance component, respectively, and the chrominance component may be derived as a dependency on the intra prediction mode of the luminance component.

[0159] Specifically, the intra-prediction mode of the color difference component can be determined based on the intra-prediction mode of the luminance component as shown in Table 1 below.

[0160] Intra_chroma_pred_mode[xCb][yCb]IntraPredModeY[xCb][yCb]026101X(0<=X<=34)0340000126342626262101034101031113414026101X

[0161] In Table 1, intra_chroma_pred_mode refers to information signaled to specify the intra-prediction mode of the chroma difference component, and IntraPredModeY represents the intra-prediction mode of the luminance component.

[0162] Referring to FIG. 10, a reference sample for intra-prediction of the current block can be derived (S1010).

[0163] Specifically, reference samples for intra-prediction can be derived based on surrounding samples of the current block. The surrounding samples may refer to the reconstructed samples of the surrounding blocks described above, which may be reconstructed samples before the in-loop filter is applied or reconstructed samples after the in-loop filter is applied.

[0164] A surrounding sample restored prior to the current block may be used as a reference sample, or a surrounding sample filtered based on a predetermined intra filter may be used as a reference sample. Filtering surrounding samples using an intra filter may be referred to as reference sample smoothing. The intra filter may include at least one of a first intra filter applied to a plurality of surrounding samples located on the same horizontal line or a second intra filter applied to a plurality of surrounding samples located on the same vertical line. Depending on the location of the surrounding samples, either the first intra filter or the second intra filter may be selectively applied, or both intra filters may be applied redundantly. In this case, the filter coefficients of at least one of the first intra filter or the second intra filter may be (1, 2, 1), but are not limited thereto.

[0165] The filtering described above may be performed adaptively based on at least one of the intra-prediction mode of the current block or the size of the transformation block related to the current block. For example, if the intra-prediction mode of the current block is DC mode, vertical mode, or horizontal mode, filtering may not be performed. If the size of the transformation block is NxM, filtering may not be performed. Here, N and M may be the same or different values, and may be any one of 4, 8, 16, or greater. For example, if the size of the transformation block is 4x4, filtering may not be performed. Alternatively, filtering may be performed selectively based on the result of a comparison between the difference between the intra-prediction mode of the current block and the vertical mode (or horizontal mode) and a pre-defined threshold. For example, filtering may be performed only when the difference between the intra-prediction mode of the current block and the vertical mode is greater than the threshold. The threshold may be defined for each size of the transformation block as shown in Table 2.

[0166] 8x8 transform16x16 transform32x32 transformThreshold710

[0167] The above intra-filter may be determined as any one of a plurality of pre-defined intra-filter candidates in the image encoder / decoder. To this end, a separate index specifying the intra-filter of the current block among the plurality of intra-filter candidates may be signaled. Alternatively, the intra-filter may be determined based on at least one of the size / shape of the current block, the size / shape of the transform block, information regarding filter strength, or the variation of surrounding samples.

[0168] Referring to FIG. 10, intra prediction can be performed using the intra prediction mode of the current block and a reference sample (S1020).

[0169] That is, a prediction sample of the current block can be obtained using the intra prediction mode determined in S1000 and the reference sample derived in S1010. However, in the case of intra prediction, since boundary samples of surrounding blocks are used, a problem may occur where the quality of the prediction image is degraded. Therefore, a correction process for the prediction sample generated through the prediction process described above may be further included, and this will be examined in detail below with reference to FIGS. 11 to 13. However, the correction process described below is not limited to being applied only to the intra prediction sample, and it is of course possible to apply it to the inter prediction sample or the reconstructed sample as well.

[0170]

[0171] FIG. 11 illustrates a method for correcting a prediction sample of a current block based on difference information of surrounding samples as an embodiment to which the present invention is applied.

[0172] Predicted samples of the current block can be corrected based on differential information of multiple surrounding samples for the current block. The correction may be performed on all predicted samples belonging to the current block, or only on predicted samples belonging to a predetermined partial region. The partial region may be a single row / column or multiple rows / columns, and may be a pre-configured region for correction in the image encoder / decoder. For example, correction may be performed on a single row / column located at the boundary of the current block or on multiple rows / columns from the boundary of the current block. Alternatively, the partial region may be variably determined based on at least one of the size / shape of the current block or an intra-prediction mode.

[0173] Neighboring samples may belong to at least one of the neighboring blocks located at the top, left, or top-left corners of the current block. The number of neighboring samples used for correction may be 2, 3, 4, or more. The positions of the neighboring samples may be variably determined based on the position of the prediction sample to be corrected within the current block. Alternatively, some of the neighboring samples may have fixed positions regardless of the position of the prediction sample to be corrected, while the remainder may have variable positions based on the position of the prediction sample to be corrected.

[0174] The difference information of surrounding samples may refer to a difference sample between surrounding samples, or it may refer to a value obtained by scaling the difference sample by a predetermined constant value (e.g., 1, 2, 3, etc.). Here, the predetermined constant value may be determined by considering the position of the prediction sample to be corrected, the position of the column or row to which the prediction sample to be corrected belongs, the position of the prediction sample within the column or row, etc.

[0175] For example, if the intra prediction mode of the current block is vertical mode, the final prediction sample can be obtained using the difference sample between the neighboring sample p(-1,y) adjacent to the left boundary of the current block and the upper-left neighboring sample p(-1,-1) as shown in the following Equation 1.

[0176]

[0177] For example, if the intra prediction mode of the current block is horizontal mode, the final prediction sample can be obtained using the difference sample between the neighboring sample p(x,-1) adjacent to the top boundary of the current block and the top-left neighboring sample p(-1,-1) as shown in the following Equation 2.

[0178]

[0179] For example, if the intra prediction mode of the current block is vertical mode, the final prediction sample can be obtained using a difference sample between the neighboring sample p(-1,y) adjacent to the left boundary of the current block and the top-left neighboring sample p(-1,-1). At this time, the difference sample may be added to the prediction sample, or the difference sample may be scaled by a predetermined constant value and then added to the prediction sample. The predetermined constant value used for scaling may be determined differently depending on the column and / or row. For example, the prediction sample can be corrected as shown in the following Equations 3 and 4.

[0180]

[0181]

[0182] For example, if the intra prediction mode of the current block is horizontal mode, the final prediction sample can be obtained using the difference sample between the neighboring sample p(x,-1) adjacent to the top boundary of the current block and the top-left neighboring sample p(-1,-1), as described above in vertical mode. For example, the prediction sample can be corrected as shown in the following Equations 5 and 6.

[0183]

[0184]

[0185]

[0186] FIGS. 12 and FIGS. 13 illustrate a method for correcting a prediction sample based on a predetermined correction filter as an embodiment to which the present invention is applied.

[0187] A prediction sample can be corrected based on surrounding samples of the prediction sample to be corrected and a predetermined correction filter. In this case, the surrounding samples may be identified by the angular line of the directional prediction mode of the current block, and may be one or more samples located on the same angular line as the prediction sample to be corrected. Additionally, the surrounding samples may be prediction samples belonging to the current block, or restored samples belonging to surrounding blocks restored prior to the current block.

[0188] At least one of the number of taps, strength, or filter coefficient of the correction filter can be determined based on at least one of the location of the prediction sample to be corrected, whether the prediction sample to be corrected is located at the boundary of the current block, the angle of the intra prediction mode of the current block, the directional prediction mode, the prediction mode of the surrounding block (inter or intra mode), or the size / shape of the current block.

[0189] Referring to FIG. 12, in the case where the index is 2 or 34 during the directional prediction mode, a final prediction sample can be obtained using at least one prediction / restore sample located at the bottom left of the prediction sample to be corrected and a predetermined correction filter as shown in FIG. 12. Here, the prediction / restore sample at the bottom left may belong to the line preceding the line to which the prediction sample to be corrected belongs, and it may belong to the same block as the current sample, or it may belong to a neighboring block adjacent to the current block.

[0190] Filtering of the predicted samples may be performed only on the lines located at the block boundaries or on multiple lines. A correction filter may be used for each line in which at least one of the filter tap number or filter coefficient is different. For example, a (1 / 2, 1 / 2) filter may be used for the first left line closest to the block boundary, a (12 / 16, 4 / 16) filter may be used for the second line, a (14 / 16, 2 / 16) filter may be used for the third line, and a (15 / 16, 1 / 16) filter may be used for the fourth line.

[0191] Alternatively, in the directional prediction mode, if the index is between 3 and 6 or between 30 and 33, filtering can be performed at the block boundary as shown in FIG. 13, and the prediction sample can be corrected using a 3-tap correction filter. Filtering can be performed using a 3-tap correction filter that takes as input the bottom-left sample of the prediction sample to be corrected, the bottom sample of the bottom-left sample, and the prediction sample to be corrected. The positions of the surrounding samples used in the correction filter may be determined differently based on the directional prediction mode. The filter coefficients of the correction filter may also be determined differently depending on the directional prediction mode.

[0192] Different correction filters may be applied depending on whether the surrounding block is in inter mode or intra mode. When the surrounding block is encoded in intra mode, a filtering method that gives more weight to the prediction samples than when encoded in inter mode may be used. For example, when the intra prediction mode is 34, a (1 / 2, 1 / 2) filter may be used when the surrounding block is encoded in inter mode, and a (4 / 16, 12 / 16) filter may be used when the surrounding block is encoded in intra mode.

[0193] The number of lines filtered within the current block may vary depending on the size / shape of the current block (e.g., coding block, prediction block). The number of lines filtered may vary depending on whether the size of the current block is larger than a predefined size, or whether the size of the current block is square or non-square. For example, as shown in the example illustrated in FIG. 14, if the size of the current block is less than or equal to 32x32, filtering may be performed on only one line at the block boundary, and otherwise, filtering may be performed on multiple lines including one line at the block boundary.

[0194] FIGS. 12 to 14 are described based on the case using the 35 intra prediction modes mentioned in FIG. 7, but can be applied in the same or similar way even when using extended intra prediction modes.

[0195]

[0196] When the intra-prediction mode of the current block is a directional prediction mode, the intra-prediction of the current block can be performed based on the directionality of the directional prediction mode. For example, Table 3 shows the intra-directional parameters (intraPredAng) for Mode 2 to Mode 34, which are directional intra-prediction modes illustrated in FIG. 8.

[0197] predModeIntra12345678910111213141516intraPredAng-32262117139520-2-5-9-13-17-21predMo deIntra18192021222324252627282930313233intraPredAng-32-26-21-17-13-9-5-2025913172126

[0198] In Table 3, 33 directional intra-prediction modes were described as examples, but it is possible to define a larger or smaller number of directional intra-prediction modes.

[0199] Based on a lookup table that defines the mapping relationship between the directional intra prediction mode and the intra direction parameter, the intra direction parameter for the current block can be determined. Alternatively, the intra direction parameter for the current block can be determined based on information signaled through a bitstream.

[0200] Intra prediction of the current block may be performed using at least one of left reference samples or top reference samples, depending on the directionality of the directional intra prediction mode. Here, top reference samples refer to reference samples having y-axis coordinates smaller than the prediction target sample (x, 0) included in the top row of the current block (e.g., (-1, -1) to (2W-1, -1)), and left reference samples refer to reference samples having x-axis coordinates smaller than the prediction target sample (0, y) included in the leftmost column of the current block (e.g., (-1, -1) to (-1, 2H-1)).

[0201] Depending on the directionality of the intra prediction mode, the reference samples of the current block may be arranged in a one-dimensional manner. Specifically, when both the top reference sample and the left reference sample must be used for intra prediction of the current block, the reference samples for each prediction target sample can be selected by assuming that they are arranged in a line along a vertical or horizontal direction.

[0202] For example, when the intra-direction parameter is negative (e.g., for the intra-prediction modes corresponding to Mode 11 to Mode 25 in Table 3), the top reference samples and left reference samples can be rearranged along the horizontal or vertical direction to form a one-dimensional reference sample group (P_ref_1D).

[0203] Figures 15 and 16 are diagrams showing a one-dimensional reference sample group in which reference samples are rearranged in a row.

[0204] Whether to rearrange the reference samples in a vertical direction or a horizontal direction can be determined by the directionality of the intra prediction mode. For example, when the intra prediction mode index is between 11 and 18, as in the example shown in FIG. 15, the top reference samples of the current block can be rotated counterclockwise to create a one-dimensional reference sample group in which the left reference samples and the top reference samples are arranged vertically.

[0205] On the other hand, when the intra prediction mode index is between 19 and 25, as in the example shown in FIG. 16, the left reference samples of the current block can be rotated clockwise to create a one-dimensional reference sample group in which the left reference samples and the top reference samples are arranged horizontally.

[0206] If the intra-direction parameter of the current block is non-negative, intra prediction for the current block can be performed using only left reference samples or top reference samples. Accordingly, for intra prediction modes where the intra-direction parameter is non-negative, a one-dimensional reference sample group can be generated using only left reference samples or top reference samples.

[0207] Based on intra-directional parameters, a reference sample determination index iIdx can be derived to specify at least one reference sample used to predict a target sample. Additionally, a weight-related parameter i used to determine the weight applied to each reference sample based on intra-directional parameters can be derived. fact It is possible to derive [the following]. For example, the following mathematical formulas 7 and 8 represent examples of deriving reference sample decision index and weight-related parameters.

[0208]

[0209]

[0210] Based on a reference sample determination index, at least one reference sample can be specified for each target sample to be predicted. For example, based on the reference sample determination index, the location of a reference sample within a one-dimensional reference sample group for predicting a target sample within the current block can be specified. Based on the reference sample at the specified location, a prediction image (i.e., a prediction sample) for the target sample to be predicted can be generated.

[0211]

[0212] When considering the intra-prediction mode of the current block, if it is determined that the sample to be predicted cannot be predicted using only a single reference sample, the prediction of the sample to be predicted can be performed using multiple reference samples. Specifically, depending on the intra-prediction mode of the current block, the prediction of the sample to be predicted can be performed by interpolating the reference sample at a predetermined location and neighboring reference samples adjacent to the reference sample at the predetermined location.

[0213] For example, if a virtual angular line based on the angle or slope of the intra-prediction mode does not pass through an integer pel (i.e., a reference sample at an integer position) within a one-dimensional reference sample group, a reference sample located on the angular line and reference samples adjacent to the left / right or above / below of said reference sample can be interpolated to generate a prediction image for the sample to be predicted. For example, Equation 8 below illustrates an example of generating a prediction sample P(x, y) for the sample to be predicted by interpolating two or more reference samples.

[0214]

[0215] The coefficients of the interpolation filter are the weight-related parameter i factIt can be determined based on. For example, the coefficients of an interpolation filter can be determined based on the distance between fractional pels and integer pels (i.e., integer positions of each reference sample) located on an angular line.

[0216] When considering the intra prediction mode of the current block, if the target sample can be predicted using only one reference sample, a prediction image for the target sample can be generated based on the reference sample specified by the intra prediction mode of the current block.

[0217] For example, if a virtual angular line based on the angle or slope of the intra prediction mode passes through an integer pel (i.e., a reference sample at an integer position) within a one-dimensional reference sample group, the reference sample at the integer pel position can be copied, or a prediction image for the prediction target sample can be generated by considering the position between the reference sample at the integer pel position and the prediction target sample. For example, Equation 9 below illustrates an example of generating a prediction image P(x, y) for a prediction target sample by copying a reference sample P_ref_1D(x+iIdx+1) within a one-dimensional reference sample group specified by the intra prediction mode of the current block.

[0218]

[0219]

[0220] For convenience of explanation, in the embodiments described below, a reference sample specified by the intra prediction mode of the current block or a one-dimensional reference sample specified by the intra prediction mode of the current block is referred to as a first reference sample. For example, reference samples used to acquire a horizontal prediction image or a vertical prediction image of a prediction target sample in planner mode may be referred to as first reference samples, and a reference sample of a prediction target sample specified according to the directionality of the intra prediction mode in directional intra prediction mode may be referred to as a first prediction reference sample. Furthermore, a prediction sample generated by predicting a prediction target sample based on the first reference sample is referred to as a first prediction image (or first prediction sample), and an intra prediction using the first reference sample is referred to as a first intra prediction.

[0221] According to the present invention, in order to increase the efficiency of intra prediction, a second prediction image (or second prediction sample) for a prediction target sample can be obtained by using a second reference sample at a predetermined location. Specifically, a second prediction sample for a prediction target sample can be generated by weighted prediction of a first prediction image generated as a result of performing a first intra prediction and a second reference sample at a predetermined location.

[0222] At this time, whether to generate a second prediction sample may be determined based on the size and shape of the current block, the intra prediction mode (e.g., whether it is a directional intra prediction mode), the directionality of the intra prediction mode, the distance between the prediction target sample and the first reference sample, etc. Here, the distance between the first reference sample and the prediction target sample may be calculated based on the distance between the x-axis between the first reference sample and the prediction target sample and the distance between the y-axis between the first reference sample and the prediction target sample.

[0223] FIG. 17 is a diagram illustrating the distance between a first reference sample and a predicted sample. In FIG. 17, the distance between the first reference sample and the predicted sample is exemplified as being calculated by adding the absolute values ​​of the x-coordinate difference between the first reference sample and the predicted sample and the y-coordinate difference between the first reference sample and the predicted sample.

[0224] For example, the distance between the prediction target sample and the first reference sample can be compared with a threshold, and based on the comparison result, it can be determined whether to generate a second prediction image. The threshold may be determined dependently on the width and height of the prediction block, the intra-prediction mode (e.g., whether it is a directional intra-prediction mode), or the slope of the intra-prediction mode.

[0225] A first reference sample used in the first intra prediction can be set as a second reference sample. For example, if multiple reference samples are used in the first intra prediction, any one of the multiple reference samples can be set as a second reference sample.

[0226] Alternatively, a reference sample at a different location from the first reference sample may be set as the second reference sample. In this case, the first reference sample and the second reference sample may be adjacent to the same boundary of the current block, or they may each be adjacent to different boundaries of the current block. For example, both the first reference sample and the second reference sample may be the top reference sample of the current block or both may be the left reference sample of the current block, or one of the first reference sample and the second reference sample may be the top reference sample while the other is the left reference sample.

[0227] FIGS. 18 and FIGS. 19 are drawings illustrating the locations of the first reference sample and the second reference sample.

[0228] FIG. 18 shows an example where the first reference sample and the second reference sample are adjacent to the same boundary of the current block, and FIG. 19 shows an example where the first reference sample and the second reference sample are adjacent to different boundaries of the current block, respectively.

[0229] Specifically, in FIG. 18, the first reference sample and the second reference sample are both shown as the top reference sample of the current block, and in FIG. 19, the first reference sample of the current block is shown as the top reference sample, while the second reference sample is shown as the left reference sample of the current block.

[0230] The second reference sample may include the reference sample closest to the prediction target sample. Here, the reference sample closest to the prediction target sample may include at least one of a reference sample lying on the same horizontal line as the prediction target sample or a reference sample lying on the same vertical line.

[0231] Furthermore, a reference sample adjacent to the first reference sample may also be determined as the second reference sample.

[0232] As another example, the second reference sample can be determined based on the directionality of the intra-prediction mode of the current block. As an example, the second reference sample can be specified by a virtual angular line according to the slope of the intra-prediction mode of the current block. For instance, when the angular line is extended to both sides, a reference sample located on one side of the angular line can be set as the first reference sample, and a reference sample located on the other side of the angular line can be set as the second reference sample.

[0233] FIG. 20 is a diagram showing the locations of the first reference sample and the second reference sample. Assuming that the intra-prediction mode of the current block is the lower left diagonal direction (e.g., Mode 2 shown in FIG. 8) or the upper right diagonal direction (e.g., Mode 34 shown in FIG. 8), when a virtual angle line by the intra-prediction mode is extended in both directions from the sample to be predicted, the reference samples located at the positions through which the angle line passes can be set as the first reference sample and the second reference sample. For example, if the intra-prediction mode of the current block is the upper right diagonal direction, for the sample to be predicted at position (2, 2), the reference sample located at position r(x+y+2, -1) can be determined as the first reference sample, and the reference sample located at position r(-1, x+y+2) can be determined as the second reference sample. On the other hand, when the intra prediction mode of the current block is in the lower left diagonal direction, for a prediction target sample at position (2, 2), a reference sample placed at position r(-1, x+y+2) can be determined as the first reference sample, and a reference sample placed at position r(x+y+2, -1) can be determined as the second reference sample.

[0234] Alternatively, a reference sample at a predefined location may be set as a second reference sample. For example, a reference sample adjacent to the top-left corner of the current block, a reference sample adjacent to the top-right corner, or a reference sample adjacent to the bottom-left corner may be set as the second reference sample.

[0235] Multiple reference samples may be selected as second reference samples. For example, multiple reference samples that meet the criteria described above may be selected as second reference samples for second intra prediction.

[0236] The second prediction image can be generated through a weighted sum of the first prediction image and the second reference sample. As an example, the following Equation 10 illustrates an example of generating a second prediction image P'(x, y) for a prediction target sample (x, y) through a weighted sum of a second reference sample P_ref_2nd at a predetermined location and the first prediction image P(x, y).

[0237]

[0238] Since the first predicted image is generated by copying the first reference sample or by interpolating multiple first reference samples, the second predicted image may be understood as being generated through the weighted sum of the first reference sample P_ref_1st and the second reference sample P_ref_2nd.

[0239] The weights assigned to each of the first prediction image and the second reference sample may be determined based on at least one of the current block size, shape, intra-prediction mode, location of the prediction target sample, location of the first reference sample, or location of the second reference sample. For example, the weights assigned to each of the first prediction image and the second reference image may be determined based on the distance between the prediction target sample and the first reference sample or the distance between the prediction target sample and the second reference sample.

[0240] For example, let f1 be the distance between the target sample and the first reference sample, and f2 be the distance between the target sample and the reference sample. The weighted prediction parameter w can be set as f2 / f1, f1 / f2, f2 / (f1+f2), or f1 / (f1+f2).

[0241] The final predicted image of the sample to be predicted may be determined as either the first predicted image or the second predicted image. In this case, whether to determine the first predicted image as the final predicted image or the second predicted image as the final predicted image may be determined based on the size and shape of the current block, the intra-prediction mode, the location of the sample to be predicted, etc. For example, the final predicted image of the samples to be predicted included in the first region within the current block may be determined as the first predicted image, whereas the final predicted image of the samples to be predicted included in the second region, which is different from the first region, may be determined as the second predicted image.

[0242]

[0243] By using multiple intra prediction modes, intra prediction for the current block can be performed.

[0244] For example, different intra-prediction modes or different directional intra-prediction modes may be applied to each prediction target sample within the current block. To determine the intra-prediction mode of each prediction target sample, information representing the difference value of the intra-prediction mode with respect to the previous prediction target sample may be signaled via a bitstream.

[0245] For example, the current block may be divided into multiple regions, and different intra prediction modes may be applied to each divided region. Here, the multiple regions may be divided into a predetermined number of sample units or into blocks of a predetermined size / shape. For instance, the current block may be divided into multiple sub-blocks of a predetermined shape / size. Alternatively, the multiple regions may be divided into predetermined row / column units within the current block. For instance, a region including the two boundary rows / columns of the current block may be set as the first region, and the remaining region may be set as the second region, so that different intra prediction modes are applied to the first region and the second region.

[0246] As another example, a method of multiple prediction of the current block using multiple intra prediction modes may be used. For instance, a first prediction block may be generated using a first intra prediction mode for the current block, a second prediction block may be generated using a second intra prediction mode for the current block, and then a final prediction block for the current block may be generated using the first prediction block and the second prediction block. In this case, the final prediction block of the current block may be generated based on the weighted sum, average, maximum value, or minimum value of the first prediction block and the second prediction block. When the final prediction block is generated by applying a predetermined weighted filter to the first prediction block and the second prediction block, the filter coefficients applied to the first prediction block and the second prediction block may be predefined in the encoder and decoder. For example, the filter coefficients of the weighted filter applied to the first prediction block and the second prediction block may be {1 / 2, 1 / 2}. Alternatively, the filter coefficients may be determined variably based on filter-related encoding parameters. Alternatively, filter coefficients to be applied to the first prediction block and the second prediction block may be determined based on the difference value between the first intra prediction mode and the second intra prediction mode or their directionality.

[0247] Hereinafter, an intra prediction technique using multiple intra prediction modes will be referred to as a multiple intra prediction technique. Additionally, for the convenience of explanation, it will be assumed that the number of intra prediction modes used under the multiple intra prediction technique is two, and each of the two intra prediction modes will be referred to as the first intra prediction mode and the second intra prediction mode.

[0248] FIG. 21 is a flowchart illustrating a multi-intra prediction method according to an embodiment of the present invention. Not all processes illustrated in FIG. 21 are essential, and the present invention may be performed with some of these processes omitted. Additionally, FIG. 21 will be described in a series of sequences, but the present invention may be performed in a different order than the illustrated sequence.

[0249] Referring to FIG. 21, first, it can be determined whether to apply a multi-intra prediction technique to the current block (S2110). Whether to use a multi-intra prediction technique for the current block may be determined by the size or shape of the current block, etc. Alternatively, it may be determined whether to use a multi-intra prediction technique for the current block according to the first intra prediction mode of the current block. For example, if the first intra prediction mode is a directional prediction mode, a multi-intra prediction technique may be used in which a non-directional prediction mode (e.g., DC or Planar) is set as the second intra prediction mode. Furthermore, if the first intra prediction mode is a non-directional mode, the use of a multi-intra prediction technique may be restricted, or a multi-intra prediction technique may be used in which both the first intra prediction mode and the second intra prediction mode are non-directional prediction modes.

[0250] As another example, information indicating whether to use multiple intra prediction techniques can be signaled via a bitstream. Here, the information may be a 1-bit flag.

[0251] If it is decided to apply a multiple intra prediction technique, multiple intra prediction modes can be derived for the current block (S2120). The first intra prediction mode and the second intra prediction mode used in the multiple intra prediction technique may each have different angles or different directions. For example, the first intra prediction mode and the second intra prediction mode may be directional intra prediction modes having different directions. Alternatively, at least one of the first intra prediction mode and the second intra prediction mode may be a non-directional intra prediction mode and the other may be a directional prediction mode. If the first intra prediction mode is a non-directional mode, the second intra prediction mode may also be restricted to have a non-directional mode. As the first intra prediction mode and the second intra prediction mode are different, the range of reference samples used for the first intra prediction based on the first intra prediction mode and the range of reference samples used for the second intra prediction based on the second intra prediction mode may be different.

[0252] At least one of the first intra prediction mode and the second intra prediction mode may be determined by information signaled through a bitstream or derived based on the intra prediction mode of a neighboring block adjacent to the current block. Information representing the difference value between the first intra prediction mode and the second intra prediction mode may also be signaled through a bitstream. For example, if the first intra prediction mode is derived based on the intra prediction mode of a neighboring block and / or information signaled through a bitstream (e.g., MPM flag, MPM index, residual mode information, etc.), the second intra prediction mode can be determined based on information representing the difference value between the first intra prediction mode and the second intra prediction mode.

[0253] Alternatively, a second intra prediction mode may be derived based on the first intra prediction mode. For example, the second intra prediction mode may be derived by adding or subtracting a predetermined constant value (e.g., an integer such as 1, 2, 3, etc.) to the value of the first intra prediction mode, or by adding or subtracting a predetermined value (e.g., 180 degrees) to the angle of the first intra prediction mode.

[0254] Alternatively, the second intra-prediction mode may be set to a default mode predefined in the encoder or decoder. For example, the default mode may be a non-directional mode such as DC or Planar, or a mode having a specific directionality such as Horizontal or Vertical.

[0255] When multiple prediction modes for the current block are determined, intra prediction for the current block can be performed using the multiple prediction modes (S2130). As previously explained, intra prediction for the current block can be performed by applying different intra prediction modes per sample unit, applying different intra prediction modes per region unit, or performing multiple intra prediction modes sequentially. Among these, we will examine in detail an example in which multiple intra predictions are performed by applying different intra prediction modes to a predetermined region, particularly at the sub-block level.

[0256] Figure 22 is a diagram showing an example in which multiple intra predictions are performed in sub-block units.

[0257] After dividing the current block into multiple sub-blocks, different intra-prediction modes can be applied to each sub-block. As shown in the example illustrated in FIG. 22, the sub-blocks may have the same size / shape. Unlike the illustrated example, it is also possible to divide the current block into multiple sub-blocks having different sizes / shapes.

[0258] In addition, the sub-blocks can be square or non-square blocks. Furthermore, it is also possible to divide the current block so that the sub-blocks have a triangular shape or a polygonal shape with five or more sides.

[0259] You may also define a subblock as an area containing at least one row and / or at least one column. For example, you may define a subblock containing the first column, the last column, and the first row within the block, or define a subblock containing the last row and the last column within the block.

[0260] In the example illustrated in FIG. 22, the left sub-block (sub-block P0) is shown to have a horizontal prediction mode applied, and the right sub-block (sub-block P1) is shown to have a vertical prediction mode applied. As shown in the illustrated example, prediction samples can be generated by using different intra-prediction modes on a sub-block basis.

[0261] In addition, the range of reference samples used to perform intra-prediction for each sub-block may differ. For example, sub-block P0 may be intra-predicted using a left reference sample adjacent to the left of the current block, and sub-block P1 may be intra-predicted using a top reference sample adjacent to the top of the current block.

[0262] Depending on the intra prediction mode of each sub-block, the range of reference samples used may partially overlap. Accordingly, a reference sample at a specific location may be used for both the first intra prediction mode and the second intra prediction.

[0263] When different intra-prediction modes are used at the sub-block level, there is a risk of blocking artifacts occurring at the boundaries between sub-blocks. Accordingly, artifacts can be reduced by applying a boundary filter to samples adjacent to the sub-block boundaries. For example, samples adjacent to a sub-block boundary can be replaced with a weighted sum of the samples adjacent to the sub-block boundary and neighbor samples included in other sub-blocks. Whether to apply the boundary filter can be determined based on the size / shape of the current block or sub-block, or the difference value between the first intra-prediction mode and the second intra-prediction mode.

[0264] Figure 23 is a diagram showing an example of acquiring a prediction block in sub-block units.

[0265] Different one-dimensional reference samples can be generated for each of the multiple intra prediction modes applied to the current block. By utilizing the intra prediction modes and the corresponding one-dimensional reference samples, multiple intra predictions can be performed on the current block, and multiple intra prediction samples can be generated accordingly. Each intra prediction sample generated as a result of performing multiple intra predictions can be referred to as an intra prediction preliminary sample.

[0266] Prediction samples for sub-blocks can be generated based on at least one of a plurality of intra-prediction preliminary samples.

[0267] For example, if the current block is divided into two sub-blocks, two intra predictions can be performed on the current block to generate two intra prediction preliminary samples. In the example illustrated in FIG. 23, it is shown that an intra prediction preliminary block 0 is generated by applying the intra prediction mode of Mode 21 to the current block, and an intra prediction preliminary block 1 is generated by applying the intra prediction mode of Mode 23 to the current block.

[0268] At this time, intra prediction preliminary block 0 can be used as the prediction block of the first sub-block within the current block, and intra prediction preliminary block 1 can be used as the prediction block of the second sub-block within the current block. Specifically, an intra prediction preliminary sample corresponding to the position / size of the sub-block can be set as the prediction sample of the sub-block.

[0269] [Insight]

[0270] As described above, by combining intra prediction preliminary block 0 and intra prediction preliminary block 1, a prediction sample of the current block can be generated.

[0271] Alternatively, an intra prediction mode of each sub-block may be obtained based on a weighted sum of multiple intra prediction preliminary samples. For example, the prediction samples of the first sub-block and the second sub-block may be obtained based on the weighted sum of intra prediction preliminary block 0 and intra prediction preliminary block 1. In this case, the weights applied to intra prediction preliminary block 0 and intra prediction preliminary block 1 may differ for each sub-block. For example, for the first sub-block, a larger weight may be assigned to intra prediction preliminary block 0, and for the second sub-block, a larger weight may be assigned to intra prediction preliminary block 1.

[0272] Weighted operations of intra-predicted preliminary samples may be applied only to samples located at the boundary of a sub-block. For example, FIG. 24 is a diagram showing an example in which weighted operations are applied to samples located at the boundary of a sub-block.

[0273] As in the example illustrated in FIG. 24, intra prediction preliminary block 0 is used as a prediction block of the first sub-block and intra prediction preliminary block 1 is used as a prediction block of the second sub-block, and for samples adjacent to the boundary of the first sub-block and the second sub-block, prediction samples can be generated based on the weighted sum between intra prediction preliminary block 0 and intra prediction preliminary block 1.

[0274] Mathematical Equation 11 shows an example in which a prediction sample is generated based on the weighted sum between intra-prediction preliminary block 0 and intra-prediction preliminary block 1.

[0275]

[0276] In the above mathematical formula 11, P0 represents an intra-prediction preliminary sample included in intra-prediction preliminary block 0, and P1 represents an intra-prediction preliminary sample included in intra-prediction preliminary block 1. Additionally, in the above mathematical formula 11, the weight w may be a real number between 0 and 1. The weight w may be determined by information signaled through a bitstream, or may be variably derived according to intra-prediction related encoding parameters, the location of the P0 / P1 prediction preliminary sample, the distance between the prediction preliminary samples, the angle of the intra-prediction mode, the amount of change of reference samples, etc.

[0277]

[0278] The above-described embodiments are described based on a series of steps or flowcharts, but this does not limit the chronological order of the invention and may be performed simultaneously or in a different order as necessary. Additionally, each component constituting the block diagram in the above-described embodiments (e.g., units, modules, etc.) may be implemented as a hardware device or software, or a plurality of components may be combined to be implemented as a single hardware device or software. The above-described embodiments may be implemented in the form of program instructions that can be executed through various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium may include program instructions, data files, data structures, etc., either individually or in combination. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical recording media such as CD-ROMs and DVDs; magneto-optical media such as floptical disks; and hardware devices specifically configured to store and execute program instructions, such as ROM, RAM, and flash memory. The above hardware device may be configured to operate as one or more software modules to perform processing according to the present invention, and vice versa.

[0279] The present invention can be applied to an electronic device capable of encoding / decoding images.

Claims

1. A step of determining a first intra prediction mode for a first sub-block in a current block and a second intra prediction mode for a second sub-block; A step of performing a first intra prediction on the first sub-block based on the first intra prediction mode; A step of performing a second intra prediction on the second sub-block based on the second intra prediction mode; and An image decoding method, comprising a step of obtaining a prediction sample for the current block according to the results of performing the first intra prediction and the second intra prediction.

2. In paragraph 1, An image decoding method, characterized in that the prediction sample of the area corresponding to the first sub-block among the current block is set to the first prediction sample obtained as a result of performing the first intra prediction, and the prediction sample of the area corresponding to the second sub-block is set to the second prediction sample obtained as a result of performing the second intra prediction.

3. In paragraph 1, An image decoding method, characterized in that the prediction samples located at the boundary between the first sub-block and the second sub-block within the current block are obtained based on a weighted sum of the first prediction sample obtained as a result of performing the first intra prediction and the second prediction sample obtained as a result of performing the second intra prediction.

4. In paragraph 3, A method for decoding an image, characterized in that the weights applied to the first prediction sample and the second prediction sample are determined based on the positions of the prediction samples or the differential values ​​between the first intra prediction mode and the second intra prediction mode.

5. In paragraph 1, A method for decoding an image, characterized in that the second intra prediction mode is derived from the first intra prediction mode.

6. In paragraph 5, A video decoding method, characterized in that the second intra prediction mode is derived by adding a differential value to the value of the first intra prediction mode.

7. In paragraph 5, A video decoding method, characterized in that the first intra prediction mode is a directional prediction mode and the second intra prediction mode is a non-directional prediction mode.

8. A step of determining a first intra prediction mode for a first sub-block in a current block and a second intra prediction mode for a second sub-block; A step of performing a first intra prediction on the first sub-block based on the first intra prediction mode; A step of performing a second intra prediction on the second sub-block based on the second intra prediction mode; and An image encoding method, comprising a step of obtaining a prediction sample for the current block according to the results of performing the first intra prediction and the second intra prediction.

9. In paragraph 8, A video encoding method, characterized in that the prediction sample of the area corresponding to the first sub-block among the current block is set to the first prediction sample obtained as a result of performing the first intra prediction, and the prediction sample of the area corresponding to the second sub-block is set to the second prediction sample obtained as a result of performing the second intra prediction.

10. In paragraph 8, A video encoding method, characterized in that the prediction samples located at the boundary between the first sub-block and the second sub-block within the current block are obtained based on a weighted sum of the first prediction sample obtained as a result of performing the first intra prediction and the second prediction sample obtained as a result of performing the second intra prediction.

11. In clause 10, A video encoding method, characterized in that the weights applied to the first prediction sample and the second prediction sample are determined based on the positions of the prediction samples or the differential values ​​between the first intra prediction mode and the second intra prediction mode.

12. In paragraph 8, A video encoding method, characterized in that the second intra prediction mode is derived from the first intra prediction mode.

13. In paragraph 12, A video encoding method, characterized in that the second intra prediction mode is derived by adding a differential value to the value of the first intra prediction mode.

14. In paragraph 12, A video encoding method, characterized in that the first intra prediction mode is a directional prediction mode and the second intra prediction mode is a non-directional prediction mode.

15. An image decoding device, comprising an intra prediction unit that determines a first intra prediction mode for a first sub-block in a current block and a second intra prediction mode for a second sub-block, performs first intra prediction on the first sub-block based on the first intra prediction mode, performs second intra prediction on the second sub-block based on the second intra prediction mode, and obtains a prediction sample for the current block based on results of performing the first intra prediction and the second intra prediction.