Video coding method and device, and recording medium on which bitstream is stored

By generating an MPM list, inducing intra prediction modes, and calculating weights based on template region costs, the method enhances video compression efficiency and prediction accuracy for high-resolution videos.

WO2025095613A1PCT designated stage expired Publication Date: 2025-05-08DONG A UNIV RES FOUND FOR IND ACAD COOP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2024/016895
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-15
Filing Date
2024-10-31
Publication Date
2025-05-08

AI Technical Summary

Technical Problem

The increasing demand for high-resolution video requires efficient compression technologies that existing methods struggle to achieve, particularly in intra prediction modes during video coding.

Method used

The proposed solution involves creating a Multi-PMI (MPM) list for the current block, inducing the intra prediction mode based on this list, and generating a prediction block using the intra prediction mode. This includes calculating costs for MPM candidates, storing them in the left and top template regions, and rearranging candidates within the MPM list based on these costs.

Benefits of technology

This approach improves prediction accuracy and compression efficiency by incorporating information from surrounding blocks and calculating weights based on costs in the left and top template regions, ultimately leading to a more accurate final prediction block.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2024016895_08052025_PF_FP_ABST
    Figure KR2024016895_08052025_PF_FP_ABST
Patent Text Reader

Abstract

An image encoding / decoding method and device, according to the present disclosure, can derive an intra prediction mode for a current block by applying a filter to a template of the current block, derive a weight for the intra prediction mode, and generate a final prediction block on the basis of the weight and a prediction block generated on the basis of the intra prediction mode.
Need to check novelty before this filing date? Find Prior Art

Description

Video coding method and device, and recording medium storing bitstream

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

[0002] The market demand for high-resolution video is growing, necessitating technologies capable of efficiently compressing high-resolution images. To address this market need, the ISO / IEC's Moving Picture Expert Group (MPEG) and the ITU-T's Video Coding Expert Group (VCEG) jointly formed the Joint Collaborative Team on Video Coding (JCT-VC). They completed development of the HEVC (High Efficiency Video Coding) video compression standard in January 2013 and have been actively conducting research and development on next-generation compression standards.

[0003] Video compression largely consists of intraprediction, interprediction, transform, quantization, entropy coding, and in-loop filtering. Among these, intraprediction refers to a technique that generates a prediction block for the current block using reconstructed pixels surrounding the current block. The encoder encodes the intraprediction mode used for intraprediction, and the decoder performs intraprediction by reconstructing the encoded intraprediction mode.

[0004] The present disclosure provides a method and device for constructing an MPM list for calculating a correlation of a template area.

[0005] The present disclosure provides a method and device for deriving an intra prediction mode based on TIMD.

[0006] The present disclosure provides a method and device for deriving weights for weighted prediction.

[0007] The video decoding method and device according to the present disclosure can generate an MPM list for a current block, derive an intra prediction mode of the current block based on the MPM list, and generate a prediction block of the current block based on the intra prediction mode.

[0008] In the video decoding method and device according to the present disclosure, the MPM list includes a plurality of MPM candidates, and the plurality of MPM candidates can be derived based on an intra prediction mode of at least one of a block surrounding the current block, a block decoded before the current block, or a block at a specific location.

[0009] In the video decoding method and device according to the present disclosure, a cost can be calculated for each of a plurality of MPM candidates belonging to the MPM list.

[0010] In the video decoding method and device according to the present disclosure, the cost can be stored by dividing it into a first cost in the left template area and a second cost in the upper template area.

[0011] In the video decoding method and device according to the present disclosure, the top N MPM candidates in ascending order of first costs for the MPM candidates and the top N MPM candidates in ascending order of second costs for the MPM candidates can be set as the intra prediction mode of the current block.

[0012] In the video decoding method and device according to the present disclosure, the intra prediction mode of the current block can be derived by considering only one of the first costs or the second costs for the plurality of MPM candidates.

[0013] In the video decoding method and device according to the present disclosure, all or some of the plurality of MPM candidates belonging to the MPM list can be rearranged within the MPM list based on the calculated cost.

[0014] In the video decoding method and device according to the present disclosure, the intra prediction mode may include a first intra prediction mode and a second prediction mode, and the prediction block may be generated through a weighted sum of a first prediction block generated based on the first intra prediction mode and a second prediction block generated based on the second intra prediction mode.

[0015] In the video decoding method and device according to the present disclosure, the weight for the weighted sum can be derived based on a first cost corresponding to the first intra prediction mode and a second cost corresponding to the second intra prediction mode.

[0016] In the video decoding method and device according to the present disclosure, the weight for the weighted sum can be derived based on only one of the first cost corresponding to the first intra prediction mode and the second cost corresponding to the second intra prediction mode.

[0017] In the video decoding method and device according to the present disclosure, a weight applied to the first prediction block can be determined based on a comparison between a first cost and a second cost corresponding to the first intra prediction mode.

[0018] In the video decoding method and device according to the present disclosure, when the first cost corresponding to the first intra prediction mode is greater than the second cost, a greater weight may be applied to a prediction sample belonging to an upper sample line within the first prediction block than to a prediction sample belonging to a lower sample line.

[0019] The video encoding method and device according to the present disclosure can generate an MPM list for a current block, derive an intra prediction mode of the current block based on the MPM list, and generate a prediction block of the current block based on the intra prediction mode.

[0020] A computer-readable recording medium according to the present disclosure can store a bitstream encoded by the image encoding method.

[0021] According to the present disclosure, the accuracy of prediction can be improved by adding information of surrounding blocks and / or previous blocks to the MPM list for calculating the correlation of the template region.

[0022] According to the present disclosure, compression efficiency can be improved by adaptively calculating weights by using costs in the left and upper template areas.

[0023] According to the present disclosure, compression efficiency can be improved by applying weights based on dependencies on the upper and left template regions.

[0024] According to the present disclosure, the accuracy of the final prediction block can be improved by replacing the planar mode or block vector-based prediction block or using it for additional weighting.

[0025] FIG. 1 is a block diagram showing an image encoding device according to the present disclosure.

[0026] FIG. 2 is a block diagram showing an image decoding device according to the present disclosure.

[0027] FIG. 3 illustrates a TIMD-based prediction block generation method performed in an image encoding / decoding device according to the present disclosure.

[0028] FIG. 4 illustrates an area used in the TIMD mode according to the present disclosure.

[0029] Figure 5 shows the dependency according to the value of LocDep.

[0030] FIG. 6 illustrates a prediction block generation method based on intra template matching prediction performed in a video encoding / decoding device according to the present disclosure.

[0031] The video decoding method and device according to the present disclosure can generate an MPM list for a current block, derive an intra prediction mode of the current block based on the MPM list, and generate a prediction block of the current block based on the intra prediction mode.

[0032] In the video decoding method and device according to the present disclosure, the MPM list includes a plurality of MPM candidates, and the plurality of MPM candidates can be derived based on an intra prediction mode of at least one of a block surrounding the current block, a block decoded before the current block, or a block at a specific location.

[0033] In the video decoding method and device according to the present disclosure, a cost can be calculated for each of a plurality of MPM candidates belonging to the MPM list.

[0034] In the video decoding method and device according to the present disclosure, the cost can be stored by dividing it into a first cost in the left template area and a second cost in the upper template area.

[0035] In the video decoding method and device according to the present disclosure, the top N MPM candidates in ascending order of first costs for the MPM candidates and the top N MPM candidates in ascending order of second costs for the MPM candidates can be set as the intra prediction mode of the current block.

[0036] In the video decoding method and device according to the present disclosure, the intra prediction mode of the current block can be derived by considering only one of the first costs or the second costs for the plurality of MPM candidates.

[0037] In the video decoding method and device according to the present disclosure, all or some of the plurality of MPM candidates belonging to the MPM list can be rearranged within the MPM list based on the calculated cost.

[0038] In the video decoding method and device according to the present disclosure, the intra prediction mode may include a first intra prediction mode and a second prediction mode, and the prediction block may be generated through a weighted sum of a first prediction block generated based on the first intra prediction mode and a second prediction block generated based on the second intra prediction mode.

[0039] In the video decoding method and device according to the present disclosure, the weight for the weighted sum can be derived based on a first cost corresponding to the first intra prediction mode and a second cost corresponding to the second intra prediction mode.

[0040] In the video decoding method and device according to the present disclosure, the weight for the weighted sum can be derived based on only one of the first cost corresponding to the first intra prediction mode and the second cost corresponding to the second intra prediction mode.

[0041] In the video decoding method and device according to the present disclosure, a weight applied to the first prediction block can be determined based on a comparison between a first cost and a second cost corresponding to the first intra prediction mode.

[0042] In the video decoding method and device according to the present disclosure, when the first cost corresponding to the first intra prediction mode is greater than the second cost, a greater weight may be applied to a prediction sample belonging to an upper sample line within the first prediction block than to a prediction sample belonging to a lower sample line.

[0043] The video encoding method and device according to the present disclosure can generate an MPM list for a current block, derive an intra prediction mode of the current block based on the MPM list, and generate a prediction block of the current block based on the intra prediction mode.

[0044] A computer-readable recording medium according to the present disclosure can store a bitstream encoded by the image encoding method.

[0045] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings attached to this specification so that those skilled in the art can easily implement the present invention. However, the present invention may be implemented in various different forms and is not limited to the embodiments described herein. In addition, in the drawings, parts irrelevant to the description have been omitted to clearly explain the present invention, and similar parts have been designated with similar reference numerals throughout the specification.

[0046] Throughout this specification, when a part is said to be 'connected' to another part, this includes not only cases where they are directly connected, but also cases where they are electrically connected with another element in between.

[0047] Additionally, whenever a part throughout this specification is said to "include" a component, this does not mean that other components are excluded, but rather that other components may be included, unless specifically stated otherwise.

[0048] Additionally, while terms such as "first," "second," etc. may be used to describe various components, these components should not be limited by these terms. These terms are used solely to distinguish one component from another.

[0049] Additionally, in the embodiments of the devices and methods described herein, some components of the devices or some steps of the methods may be omitted. Furthermore, the order of some components of the devices or some steps of the methods may be changed. Furthermore, other components or other steps may be inserted into some components of the devices or some steps of the methods.

[0050] Additionally, some components or some steps of the first embodiment of the present invention may be added to the second embodiment of the present invention, or some components or some steps of the second embodiment may be replaced.

[0051] In addition, the components shown in the embodiments of the present invention are independently depicted to represent different characteristic functions, and this does not mean that each component is composed of separate hardware or a single software component. That is, each component is described by listing each component for convenience of explanation, and at least two components among each component may be combined to form a single component, or a single component may be divided into multiple components to perform a function. Such integrated and separate embodiments of each component are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.

[0052] In this specification, a block can be variously expressed as a unit, an area, a unit, a partition, etc., and a sample can be variously expressed as a pixel, a pel, a pixel, etc.

[0053] Hereinafter, embodiments of the present invention will be described in more detail with reference to the attached drawings. In describing the present invention, duplicate descriptions of identical components will be omitted.

[0054] FIG. 1 is a block diagram showing an image encoding device according to the present disclosure.

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

[0056] The picture segmentation unit (110) can segment the 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). Hereinafter, in the embodiments of the present disclosure, the coding unit may be used to mean a unit that performs encoding or a unit that performs decoding.

[0057] A prediction unit may be divided into at least one square or rectangular shape of the same size within a single coding unit, or may be divided such that one prediction unit among the divided prediction units within a single coding unit has a different shape and / or size from another prediction unit. When a prediction unit that performs intra prediction based on a coding unit is generated and is not the minimum coding unit, intra prediction can be performed without being divided into a plurality of NxN prediction units.

[0058] The prediction unit (120, 125) may include an inter prediction unit (120) that performs inter prediction or inter prediction, and an intra prediction unit (125) that performs intra prediction or intra prediction. It may determine whether to use inter prediction or 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. A residual value (residual block) between the generated prediction block and the original block may be input to the transformation unit (130). In addition, prediction mode information, motion vector information, etc. used for prediction may be encoded together with the residual value by the entropy encoding unit (165) and transmitted to the decoder.

[0059] The inter prediction unit (120) may predict a prediction unit based on information of at least one picture among the previous or subsequent pictures of the current picture, and in some cases, may predict a prediction unit based on information of a portion of an encoded region 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] The reference picture interpolation unit can receive reference picture information from the memory (155) and generate pixel information less than an integer pixel 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 less than an integer pixel in units of 1 / 4 pixels. In the case of a chrominance signal, a DCT-based 4-tap interpolation filter with different filter coefficients can be used to generate pixel information less than an integer pixel in units of 1 / 8 pixels.

[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 derive a motion vector. The motion vector can have a motion vector value in units of 1 / 2 or 1 / 4 pixels based on the interpolated pixel. The motion prediction unit can predict the current prediction unit by using different motion prediction methods. Various methods such as Skip Mode, Merge Mode, AMVP Mode, Intra Block Copy Mode, and Affine Mode can be used as motion prediction methods.

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

[0063] Additionally, a residual block containing 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, can be generated. The generated residual block can be input to the transformation unit (130).

[0064] In the transformation unit (130), the residual block including the 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.

[0065] The quantization unit (135) can quantize values ​​converted to the frequency domain by the transformation unit (130). The quantization coefficients can vary depending on the block or the importance of the image. The values ​​produced by the quantization unit (135) can be provided to the dequantization unit (140) and the reordering unit (160).

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

[0067] The rearrangement unit (160) can change a two-dimensional block-shaped coefficient into a one-dimensional vector form through a coefficient scanning method. For example, the rearrangement unit (160) can change the two-dimensional block-shaped coefficient into a one-dimensional vector form by scanning from the DC coefficient to the coefficient of the high-frequency region using a zig-zag scan method. Depending on the size of the transformation unit and the intra prediction mode, a vertical scan that scans the two-dimensional block-shaped coefficient in the column direction or a horizontal scan that scans the two-dimensional block-shaped coefficient in the row direction may be used instead of the zig-zag scan. That is, depending on the size of the transformation unit and the intra prediction mode, it is possible to determine which scan method among the zig-zag scan, the vertical scan, and the horizontal scan is to be used.

[0068] The entropy encoding unit (165) can perform entropy encoding based on the values ​​produced by the rearrangement 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). In this regard, the entropy encoding unit (165) can encode residual value coefficient information of the encoding unit from the rearrangement unit (160) and the prediction units (120, 125). In addition, according to the present disclosure, it is possible to signal and transmit information indicating that motion information is derived and used on the decoder side and information on a technique used to derive motion information.

[0069] The inverse quantization unit (140) and the inverse transformation unit (145) inversely quantize the values ​​quantized in the quantization unit (135) and inversely transform the values ​​transformed in the transformation unit (130). The residual values ​​generated in the inverse quantization unit (140) and the inverse transformation unit (145) can be combined with the predicted prediction units 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.

[0070] The filter unit (150) may include at least one of a deblocking filter, an offset correction unit, and an ALF (Adaptive Loop Filter). The deblocking filter may remove block distortion caused by boundaries between blocks in a restored picture. The offset correction unit may correct the offset from the original image on a pixel-by-pixel basis for the image on which deblocking has been performed. In order to perform offset correction for a specific picture, a method may be used in which the pixels included in the image are divided into a certain number of regions, the regions to be offset are determined, and the offset is applied to the regions, or the offset is applied by considering edge information of each pixel. The ALF (Adaptive Loop Filtering) may be performed based on a value obtained by comparing the filtered restored image with the original image. After dividing the pixels included in the image into a predetermined group, one filter to be applied to the group is determined, and filtering may be performed differentially for each group.

[0071] 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.

[0072] FIG. 2 is a block diagram showing an image decoding device according to the present disclosure.

[0073] Referring to FIG. 2, the image decoding device (200) may include an entropy decoding unit (210), a rearrangement 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).

[0074] When a video bitstream is input to a video encoding device, the input bitstream can be decoded in the opposite procedure to that of the video encoding device.

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

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

[0077] The reordering unit (215) can perform reordering based on the method by which the bitstream entropy-decoded by the entropy decoding unit (210) is reordered by the encoding unit. The coefficients expressed in the form of a one-dimensional vector can be reordered by restoring them back to coefficients in the form of a two-dimensional block.

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

[0079] The inverse transform unit (225) can perform inverse transform, i.e., inverse DCT, inverse DST, and inverse KLT, on the transforms performed by the transform unit, i.e., DCT, DST, and KLT, 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 transform technique (e.g., DCT, DST, KLT) can be selectively performed according to a plurality of pieces of information, such as a prediction method, the size of the current block, and the prediction direction.

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

[0081] As described above, when performing intra prediction or intra prediction in the same manner as the operation in the image encoder, if the size of the prediction unit and the size of the transformation unit are the same, intra prediction for the prediction unit is performed based on the pixels on the left side of the prediction unit, the pixels on the upper left side, and the pixels on the upper side. However, when performing intra prediction, if the size of the prediction unit and the size of the transformation unit are different, intra prediction can be performed using reference pixels based on the transformation unit. In addition, intra prediction using NxN division only for the minimum coding unit can be used.

[0082] 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 may receive various information such as prediction unit information input from the entropy decoding unit (210), prediction mode information of an intra prediction method, and motion prediction-related information of an inter prediction method, and may distinguish a prediction unit from a current encoding unit and determine whether the prediction unit performs inter prediction or intra prediction. On the other hand, if the encoder (100) does not transmit motion prediction-related information for the inter prediction, but instead transmits information indicating that motion information is to be derived and used on the decoder side and information on a technique used to derive motion information, the prediction unit determination unit determines whether the inter prediction unit (230) performs prediction based on the information transmitted from the encoder (100).

[0083] The inter prediction unit (230) can perform inter prediction on the current prediction unit based on information included in at least one picture among the previous picture or the subsequent picture of the current picture including the current prediction unit, using information required for inter prediction of the current prediction unit provided by the image encoder. In order to perform inter prediction, it can be determined based on the encoding unit whether the motion prediction method of the prediction unit included in the corresponding encoding unit is one of Skip Mode, Merge Mode, AMVP Mode, Intra Block Copy Mode, and Affine Mode.

[0084] 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, intra prediction can be performed based on intra prediction mode information of the prediction unit provided by the image encoder.

[0085] 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 unit that performs filtering on the reference pixels of the current block and can determine whether to apply the filter based on the prediction mode of the current prediction unit and apply it. AIS filtering can be performed on the reference pixels of the current block using the prediction mode and AIS filter information of the prediction unit 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.

[0086] The reference pixel interpolation unit can interpolate the reference pixel to generate a reference pixel of a pixel unit less than an integer value 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. When 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 the DC mode.

[0087] 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.

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

[0089] The offset correction unit can perform offset correction on the restored image based on the type of offset correction applied to the image during encoding and information on the offset value. ALF can be applied to the encoding unit based on information on whether ALF is applied and ALF coefficient information provided from the encoder. This ALF information can be provided by being included in a specific parameter set.

[0090] The memory (245) can store a 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 an output unit.

[0091] FIG. 3 illustrates a TIMD-based prediction block generation method performed in an image encoding / decoding device according to the present disclosure.

[0092] The template-based intra mode derivation (TIMD) mode according to the present disclosure may be a method for deriving an intra prediction mode based on a template region of a current block. The template may be an area adjacent to the current block and may be an area that has been encoded / decoded before the current block. Specifically, a plurality of intra prediction modes may be applied to a template region having a size of WxN or NxH, and a cost (e.g., SAD, SATD) for each intra prediction mode may be calculated. One or more intra prediction modes may be derived based on the calculated cost. Prediction block(s) may be generated based on the derived one or more intra prediction modes, and a final prediction block of the current block may be generated based on the prediction block(s). The final prediction block may be generated through a weighted sum of two or more prediction blocks corresponding to two or more intra prediction modes. Here, W and H represent the width and height of the current block, respectively, and N may be an integer greater than or equal to 1, 2, 3, or 4. The operation of the TIMD described above can be performed identically in the encoder and decoder.

[0093] FIG. 4 illustrates an area used in the TIMD mode according to the present disclosure. Referring to FIG. 4, an intra prediction mode (e.g., MPM) may be applied to a template area located on the left and / or top of a current block (CU) to generate prediction samples (or prediction blocks) of the template area. A cost between the prediction samples of the template area and the pre-reconstructed samples may be calculated.

[0094] It is possible to determine whether the surrounding area of ​​the current block is available as a template area for the TIMD mode. For example, it is possible to determine whether the top surrounding area and / or the left surrounding area of ​​the current block are available as template areas. For example, if the top and left surrounding areas do not exceed the picture boundary, the top and left surrounding areas are determined to be available, and the top and left surrounding areas can be set as template areas. If the top surrounding area exceeds the picture boundary and the left surrounding area does not exceed the picture boundary, only the left surrounding area is determined to be available, and the left surrounding area can be set as the template area. If the left surrounding area exceeds the picture boundary and the top surrounding area does not exceed the picture boundary, only the top surrounding area is determined to be available, and the top surrounding area can be set as the template area. If the left and top surrounding areas of the current block exceed the picture boundary, the left and top surrounding areas can be determined to be unavailable. In this case, a prediction block of the current block can be generated based on the planner mode.

[0095] The template area may include at least one of a top template area or a left template area. The top template area may have a size of WxN, and the left template area may have a size of NxH. If the width of the current block is less than or equal to a predetermined threshold size, the left template area may have a size of MxH. Alternatively, if the height of the current block is less than or equal to a predetermined threshold size, the top template area may have a size of WxM. Here, M may be an integer less than N, and the predetermined threshold size may be 4, 8, or 16.

[0096] For example, if the current block is a 4x16 block (i.e., the width of the current block is less than 8), the top template area may have a size of 4x4 and the left template area may have a size of 2x16. Alternatively, if the current block is a 16x4 block (i.e., the height of the current block is less than 8), the top template area may have a size of 16x2 and the left template area may have a size of 4x4.

[0097] Referring to FIG. 3, an MPM list (most probable mode list) for the current block can be generated (S300).

[0098] The MPM list according to the present disclosure may include multiple MPM candidates. The multiple MPM candidates may be defined as a group of intra prediction mode candidates for TIMD.

[0099] For example, the MPM list may be generated based on the intra prediction modes of neighboring blocks adjacent to the current block. Here, the neighboring blocks may include at least one of a left neighboring block, an upper neighboring block, a lower left neighboring block, an upper right neighboring block, or an upper left neighboring block.

[0100] If the above MPM list does not include DC mode, horizontal mode, or vertical mode, the mode may be added to the MPM list. The intra prediction mode of a block previously / decoded before the current block (hereinafter referred to as the "previous block") may be added to the MPM list. Alternatively, the intra prediction mode of a block at a specific location may be added to the MPM list.

[0101] A redundancy check may be performed during the process of adding at least one intra prediction mode from a neighboring block, a previous block, or a block at a specific location to the MPM list. Through the redundancy check, a mode identical to an intra prediction mode already included in the MPM list may not be added. The MPM list may include at least 22, 23, 24, or 25 intra prediction modes.

[0102] Referring to FIG. 3, the intra prediction mode of the current block can be derived based on the MPM list (S310).

[0103] A cost can be calculated for each of multiple MPM candidates in the MPM list. The N MPM candidate(s) with the lowest cost can be set as the intra prediction mode of the current block. Here, the cost can represent the correlation between the template region predicted based on the corresponding MPM candidate and the previously restored template region. N can be 1 or 2. However, the present invention is not limited thereto, and N can be an integer greater than or equal to 3.

[0104] The above cost can be defined as the Sum of Absolute Difference (SAD). For example, SAD can be calculated as shown in the following mathematical expression 1.

[0105]

[0106] Alternatively, the above cost can be defined as the Sum of Absolute Transform Difference (SATD). For example, SATD can be calculated as shown in the following mathematical expression 2.

[0107]

[0108] Alternatively, the above costs can be calculated for the left template area and the upper template area, respectively. For convenience of explanation, the cost calculated in the left template area will be referred to as the first cost, and the cost calculated in the upper template area will be referred to as the second cost. In this case, the cost for each MPM candidate can be calculated based on the first cost and the second cost.

[0109] For example, as in the following mathematical expression 3, the first cost (SATD) in the left template area Left ) and the second cost (SATD) in the upper template area Above ) can be calculated based on the sum of the costs.

[0110]

[0111] Or, as in the following mathematical expression 4, the first cost (SATD) in the left template area Left ) and the second cost (SATD) in the upper template area Above ) can be calculated based on the product of the two.

[0112]

[0113] A cost can be calculated for each of the multiple MPM candidates in the MPM list. The cost for each of the MPM candidates can be stored separately as a first cost in the left template region and a second cost in the upper template region. In this case, the first or second cost can be scaled and stored based on the ratio of the number of samples between the left and upper template regions.

[0114] At this time, the top N MPM candidate(s) in ascending order of the first costs for the MPM candidates and the top N MPM candidate(s) in ascending order of the second costs for the MPM candidates can be set as the intra prediction mode(s) of the current block (hereinafter, referred to as 'Method 1').

[0115] Alternatively, only the first costs of multiple MPM candidates may be considered, while the second costs may not be considered. In this case, the top N MPM candidates in ascending order of the first costs of the multiple MPM candidates may be set as the intra prediction mode(s) of the current block (hereinafter referred to as "Method 2").

[0116] Alternatively, only the second costs for multiple MPM candidates may be considered, while the first costs may not be considered. In this case, the top N MPM candidates in ascending order of the second costs for the multiple MPM candidates may be set as the intra prediction mode(s) for the current block (hereinafter referred to as "Method 3").

[0117] Only one of the above-described methods 1 to 3 may be defined in the encoder and decoder. Alternatively, both methods 1 to 3 may be defined in the encoder and decoder, in which case at least one of the methods 1 to 3 may be selectively applied.

[0118] For example, according to method 1, a first intra prediction mode having a smallest first cost and a second intra prediction mode having a smallest second cost can be derived, respectively. If the first cost corresponding to the first intra prediction mode is greater than the second cost corresponding to the second intra prediction mode by at least T times, the intra prediction modes of the current block can be derived through method 3. Conversely, if the second cost corresponding to the second intra prediction mode is greater than the first cost corresponding to the first intra prediction mode by at least T times, the intra prediction modes of the current block can be derived through method 2.

[0119] Alternatively, according to method 1, a first intra prediction mode having a smallest first cost and a second intra prediction mode having a smallest second cost may be derived, respectively. In this case, if the first intra prediction mode and the second intra prediction mode are the same mode, method 2 or 3 may be applied based on a smaller value between the first cost corresponding to the first intra prediction mode and the second cost corresponding to the second intra prediction mode. That is, if the first cost corresponding to the first intra prediction mode is smaller than the second cost corresponding to the second intra prediction mode, the intra prediction modes of the current block may be derived through method 2. Conversely, if the first cost corresponding to the first intra prediction mode is larger than the second cost corresponding to the second intra prediction mode, the intra prediction modes of the current block may be derived through method 3.

[0120] However, there may be cases where the left or top template region is not available. In such cases, since the first or second cost is not calculated, the intra prediction modes of the current block can be derived only based on the first or second cost calculated for the available left or top template region. That is, when only the left template region is available, the intra prediction modes of the current block can be derived through Method 2. Conversely, when only the top template region is available, the intra prediction modes of the current block can be derived through Method 3.

[0121] All or some of the MPM candidates included in the above MPM list may be rearranged within the MPM list based on the aforementioned costs. The above-mentioned some may be the top K MPM candidates in ascending order of cost. Here, K may be an integer of 1, 2, 3, or a higher number.

[0122] For example, if the aforementioned surrounding blocks and / or previous blocks are encoded in TIMD mode, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list can be rearranged at the top of the MPM list. That is, MPM indices from 0 to (K-1) can be assigned to each of the K MPM candidates.

[0123] Alternatively, if the surrounding blocks and / or the previous block are encoded in TIMD mode, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list may be rearranged lower within the MPM list.

[0124] Alternatively, if the surrounding blocks and / or the previous block are encoded in TIMD mode, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list may be rearranged at a predetermined position in the MPM list.

[0125] Alternatively, if the surrounding blocks and / or the previous block are encoded in TIMD mode, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list may be added to a list other than the MPM list.

[0126] For example, if the aforementioned surrounding blocks and / or previous blocks are encoded in the decoder-side intra mode derivation (DIMD) mode, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list can be rearranged at the top within the MPM list.

[0127] Alternatively, if the surrounding blocks and / or the previous block are encoded in DIMD mode, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list may be rearranged lower within the MPM list.

[0128] Alternatively, if the surrounding blocks and / or the previous block are encoded in DIMD mode, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list may be rearranged at a predetermined position in the MPM list.

[0129] Alternatively, if the surrounding blocks and / or the previous block are encoded in DIMD mode, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list may be added to a list other than the MPM list.

[0130] For example, if the aforementioned surrounding blocks and / or previous blocks are encoded based on TMRL (template-based multiple reference line), the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list can be rearranged at the top within the MPM list.

[0131] Alternatively, if the surrounding blocks and / or previous blocks are encoded based on TMRL, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list can be rearranged lower within the MPM list.

[0132] Alternatively, if the surrounding blocks and / or previous blocks are encoded based on TMRL, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list may be rearranged at a predetermined position within the MPM list.

[0133] Alternatively, if the surrounding blocks and / or previous blocks are encoded based on TMRL, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list may be added to a list other than the MPM list.

[0134] For example, if the surrounding blocks and / or previous blocks are encoded in any mode with an intra prediction mode, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list can be rearranged at a predetermined position in the MPM list.

[0135] Alternatively, if the surrounding blocks and / or previous blocks are encoded in any mode with an intra prediction mode, the top K MPM candidates in ascending order of cost among the MPM candidates included in the MPM list may be added to a list other than the MPM list.

[0136] If a list other than the MPM list (hereinafter referred to as an "additional list") is generated, costs can be calculated for each MPM candidate within the additional list. The N MPM candidate(s) with the lowest cost can be set as the intra prediction mode for the current block. The cost calculation method is the same as described above.

[0137] One or more intra prediction modes of the current block may be derived from each of the MPM list and the additional list.

[0138] Referring to FIG. 3, a final prediction block of the current block can be generated based on the derived intra prediction mode (S320).

[0139] For example, if one intra prediction mode is derived for the current block, a prediction block of the current block can be generated based on the intra prediction mode, and the generated prediction block can be set as the final prediction block of the current block.

[0140] Alternatively, if two or more intra prediction modes are derived for the current block, a prediction block for the current block can be generated based on each intra prediction mode, and a final prediction block can be generated based on a weighted sum of the generated prediction blocks. Below, we will examine a method for deriving weights for the weighted sum.

[0141] Example 1

[0142] The weights for the above weighted sum can be derived based on the costs corresponding to each intra prediction mode. For example, the weights can be derived as shown in the following mathematical expression (5).

[0143]

[0144] In mathematical expression 5, costMode1 may represent the smallest cost among the costs corresponding to the pre-derived intra prediction modes, and costMode2 may represent another cost among the costs corresponding to the pre-derived intra prediction modes. weight1 may refer to a weight applied to a prediction block generated based on Mode1. Here, Mode1 may refer to an intra prediction mode with the smallest cost. weight2 may refer to a weight applied to a prediction block generated based on Mode2. Here, Mode2 may refer to an intra prediction mode with the second smallest cost. Here, the cost corresponding to each intra prediction mode may be derived based on the first cost and the second cost described above. However, the present invention is not limited thereto, and in some cases, it may be interpreted to refer to either the first cost or the second cost corresponding to each intra prediction mode.

[0145] Alternatively, in Equation 5, costMode1 may represent a first cost corresponding to Mode1, and costMode2 may represent a second cost corresponding to Mode2. Weight1 may refer to a weight applied to a prediction block generated based on Mode1, and weight2 may refer to a weight applied to a prediction block generated based on Mode2. Here, Mode1 may refer to an intra prediction mode having a smallest first cost among the first costs for MPM candidates. Mode2 may refer to an intra prediction mode having a smallest second cost among the second costs for MPM candidates.

[0146] Example 2

[0147] The weights for the above weighted sum can be derived based on the first or second cost corresponding to each intra prediction mode. For example, the weights can be derived as in the following mathematical expression (6).

[0148]

[0149] In Equation 6, SATD Left can represent the cost calculated in the left template area based on M1. SATD Above can represent the cost calculated in the upper template region based on M2. Here, M1 may be the mode with the smallest first cost among the derived intra prediction modes. M2 may be the mode with the smallest second cost among the derived intra prediction modes. wTIMD M1 may refer to the weight applied to the prediction block generated based on M1. wTIMD M2 may refer to the weight applied to the prediction block generated based on M2.

[0150] Or, in Equation 6, SATD Leftcan represent the cost calculated in the left template area based on M2. SATD Above can represent the cost calculated in the upper template region based on M1. Here, M2 may be the mode with the smallest first cost among the derived intra prediction modes. M1 may be the mode with the smallest second cost among the derived intra prediction modes. wTIMD M1 may refer to the weight applied to the prediction block generated based on M1. wTIMD M2 may refer to the weight applied to the prediction block generated based on M2.

[0151] Example 3

[0152] The intra prediction modes derived for the current block may include a first intra prediction mode having the smallest first cost and a second intra prediction mode having the smallest second cost. A weight may be derived based on only one of the first cost corresponding to the first intra prediction mode and the second cost corresponding to the second intra prediction mode. In this case, the weight may be derived as in the following mathematical expression 7. That is, a prediction block may be generated based only on the intra prediction mode corresponding to the selected cost, and the generated prediction block may be set as the final prediction block of the current block.

[0153]

[0154] For example, if one of the first cost corresponding to the first intra prediction mode and the second cost corresponding to the second intra prediction mode is greater than the other by at least T times, the weights can be derived based only on the smaller value of the first and second costs.

[0155] Alternatively, if the first intra prediction mode and the second intra prediction mode are the same mode, the weight can be derived based only on the smaller value between the first cost corresponding to the first intra prediction mode and the second cost corresponding to the second intra prediction mode.

[0156] Alternatively, there may be cases where the left or top template area is not available. In such cases, the first or second cost is not calculated, so the weights may be derived based solely on the first or second cost calculated for the available left or top template area.

[0157] Example 4

[0158] At least one of the first cost or the second cost corresponding to the derived intra prediction mode(s) may be scaled based on a predetermined scaling factor. The scaling factor may be determined based on a ratio of the number of samples between the left template region and the upper template region. If the number of samples in the left template region and the number of samples in the upper template region are equal, the scaling may be omitted.

[0159] By comparing the first and second costs, we can determine the dependency on the top and left template regions. According to the present disclosure, the dependency may refer to whether the dependency lies on the top or left template region. The dependency may refer to whether the dependency lies on the top and left template regions.

[0160] For example, as in mathematical expression 8, it can be determined that there is a dependency on the template area corresponding to the smaller value between the first cost and the second cost.

[0161]

[0162] In Equation 8, LocDep may be a variable indicating dependency. If the value of LocDep is 1, this may indicate a dependency on the top template region, and if the value of LocDep is 2, this may indicate a dependency on the left template region. If the value of LocDep is 0, this may indicate no dependency on both the top and left template regions. Alternatively, if the value of LocDep is 0, this may indicate a dependency on both the top and left template regions.

[0163] Figure 5 illustrates dependencies according to the value of LocDep. In Figure 5, a darker shade may indicate a greater weight being applied. Specifically, when the value of LocDep is 1, a greater weight may be applied to a prediction sample belonging to the upper sample line within the current block (or prediction block) than to a prediction sample belonging to the lower sample line. When the value of LocDep is 2, a greater weight may be applied to a prediction sample belonging to the left sample line within the current block (or prediction block) than to a prediction sample belonging to the right sample line. When the value of LocDep is 0, the same weight may be applied to all prediction samples belonging to the current block (or prediction block).

[0164] Alternatively, if the smaller value of the first cost and the second cost is N times smaller than the larger value, as in mathematical expression 9, it may be determined that there is a dependency on the template area corresponding to the smaller value.

[0165]

[0166] Alternatively, if the smaller value of the first cost and the second cost is N times smaller than the sum of the first cost and the second cost, as in mathematical expression 10, it may be determined that there is a dependency on the template area corresponding to the smaller value.

[0167]

[0168] Alternatively, if the smaller value between the first cost and the second cost, as in mathematical expression 11, is N times smaller than the product of the first cost and the second cost, it may be determined that there is a dependency on the template area corresponding to the smaller value.

[0169]

[0170] Considering the aforementioned dependencies, weights applied to prediction blocks can be determined. Here, the weights can be determined on a sample-by-sample basis or on a per-sample basis for one or more sample lines. For example, weights can be determined based on dependencies, as shown in the following mathematical expression (12).

[0171]

[0172] In Equation 12, x and y can represent blocks, sample lines, or sample positions to which weights are applied. H and W can represent the height and width of the current block (or predicted block), respectively. △i can be a variable that makes the sum of the weights according to dependency zero. Below, we will examine the method for deriving the variable (△i).

[0173] The above variable can be derived based on the difference in cost between the left template area and the upper template area, as in mathematical expression 13.

[0174]

[0175] Alternatively, the above variable can be derived based on the sum of the costs between the left template area and the upper template area, as in Equation 14.

[0176]

[0177] Alternatively, the above variable can be derived based on the difference in scaled cost between the left template area and the upper template area, as in Equation 15.

[0178]

[0179] Alternatively, the above variable can be derived based on the sum of the scaled costs between the left template area and the upper template area, as in Equation 16.

[0180]

[0181] Alternatively, the variable may be set to a predetermined constant, wherein the predetermined constant may be a value that is identically predefined for the encoder and decoder.

[0182] Assume that an intra prediction mode is derived for the current block. In this case, a prediction block of the current block can be generated based on the intra prediction mode. A weight according to Example 4 can be derived for the intra prediction mode, and the weight can be applied to the prediction block to generate a weighted prediction block. The weighted prediction block can be set as the final prediction block of the current block.

[0183] Alternatively, assume that two intra prediction modes are derived for the current block. In this case, a first prediction block of the current block can be generated based on the first intra prediction mode. A weight according to Embodiment 4 can be derived for the first intra prediction mode, and the weight can be applied to the first prediction block to generate a first weighted prediction block. Similarly, a second prediction block of the current block can be generated based on the second intra prediction mode. A weight according to Embodiment 4 can be derived for the second intra prediction mode, and the weight can be applied to the second prediction block to generate a second weighted prediction block. A final prediction block of the current block can be generated through a weighted sum of the first weighted prediction block and the second weighted prediction block.

[0184] The final prediction block may also be generated based on the weight according to any one of the above-described embodiments 1 to 3 (hereinafter referred to as the first weight) and the weight according to embodiment 4 (hereinafter referred to as the second weight).

[0185] For example, the final prediction block can be generated based on the sum of the first weight and the second weight, as in Equation 17.

[0186]

[0187] In Equation 17, Pred can represent the final prediction sample. Pred M1 can represent a prediction sample generated based on the first intra prediction mode (M1), and Pred M2 can represent a prediction sample generated based on the second intra prediction mode (M2). wTIMD M1 Wow wTIMD M2 may represent a first weight derived based on any one of embodiments 1 to 3. wLocDepTimd m1 and wLocDepTimd m2 can represent the second weight derived based on Example 4.

[0188] Alternatively, the final prediction block can be generated based on the weighted sum of the first and second weights as in Equation 18. In Equation 18, the sum of α1 and β1 can be an integer greater than or equal to 1, and the sum of α2 and β2 can be an integer greater than or equal to 1.

[0189]

[0190] The final prediction block may be corrected based on a prediction block generated based on a predetermined intra prediction mode. That is, a corrected prediction block may be generated based on a weighted sum of the final prediction block and the prediction block generated based on the predetermined intra prediction mode. The predetermined intra prediction mode may be a mode predefined identically for the encoder and decoder. For example, the predetermined intra prediction mode may be a planar mode or a DC mode.

[0191] Alternatively, any one of the intra prediction modes derived for the current block may be replaced with the given intra prediction mode. For example, assume that a first intra prediction mode and a second intra prediction mode may be derived for the current block, and that the second intra prediction mode is replaced with a planar mode. The final prediction block of the current block may be generated through a weighted sum between the first prediction block generated based on the first intra prediction mode and the second prediction block generated based on the planar mode.

[0192] The mode replaced by the above-mentioned intra prediction mode may be the mode with the highest cost among the derived intra prediction modes. Alternatively, if the derived intra prediction modes are the same, any one of the derived intra prediction modes may be replaced by the given intra prediction mode.

[0193] Alternatively, if any of the intra prediction modes derived for the current block is a planar mode, a prediction block generated based on a block vector may be used instead of a prediction block generated based on the planar mode. The block vector may be derived based on a block vector of a neighboring block adjacent to the current block. Alternatively, the block vector may be derived based on a block vector of a block searched within a region (or a predetermined search range) that has been sub-encoded before the current block. A reference block specified by the block vector may belong to the same picture as the current block, and the reference block may be set as a prediction block.

[0194] Whether to replace a planar mode-based prediction block with a block vector-based prediction block can be determined based on flag or index information signaled through the bitstream. Alternatively, a cost (cost1) between a template region of a current block and a template region of a reference block specified by a block vector can be calculated. A cost (cost2) can be calculated for the template region of the current block based on the planar mode. If cost1 is smaller than cost2, the planar mode-based prediction block can be replaced with the block vector-based prediction block. Alternatively, if the pre-derived intra prediction mode for the current block corresponds to the planar mode, the planar mode-based prediction block can always be replaced with the block vector-based prediction block.

[0195] FIG. 6 illustrates a prediction block generation method based on intra template matching prediction (intra TMP) performed in a video encoding / decoding device according to the present disclosure.

[0196] A block vector list can be generated for the current block (S600).

[0197] A block vector list may include multiple block vectors. Each of the multiple block vectors may indicate reference blocks for predicting the current block. The reference blocks may belong to the same picture as the current block and may belong to a pre-decoded / decoded region within the picture. A region that matches or is most similar to the template region of the current block may be searched for, and a block that uses the region as the template region may be determined as a reference block. A block vector indicating the determined reference block may be added to the block vector list.

[0198] The above search can be performed within a pre-defined search range within the above-decoded / encoded region. The cost of the current block with respect to the template region can be calculated by traversing within the pre-defined search range. The pre-defined search range can include at least one of the current coding tree unit (CTU) to which the current block belongs or a neighboring CTU adjacent to the current CTU. Here, the neighboring CTU can include at least one of the upper-left neighboring CTU, the upper neighboring CTU, or the left neighboring CTU. A block vector list can be generated based on the block vector(s) corresponding to the top N cost(s) in ascending order of the calculated costs.

[0199] The above cost can be calculated based on SAD (sum of absolute difference), SATD (sum of absolute transformed difference), SAC (subscriber acquisition cost), or MSE (mean squared error).

[0200] A prediction block of the current block can be generated based on the block vector list (S610).

[0201] For example, multiple block vectors in a block vector list can be grouped into one or more sets. Each set can consist of one or more block vectors. Here, we assume that the block vector list consists of three sets. In this case, three prediction blocks can be generated based on the three sets. The prediction block of the current block can be generated through a weighted sum of the three prediction blocks.

[0202] Alternatively, a prediction block of the current block may be generated based on at least one block vector in the block vector list. Specifically, a reference block may be determined based on any one block vector in the block vector list, and a prediction block of the current block may be generated based on the reference block. Alternatively, reference blocks may be determined based on two or more block vectors in the block vector list, and a prediction block of the current block may be generated through a weighted sum of the reference blocks.

[0203] Alternatively, a prediction block of the current block may be generated based on at least one block vector in the block vector list and a planar mode. Specifically, as described above, reference block(s) may be determined based on one or more block vectors in the block vector list, and a first prediction block of the current block may be generated based on the reference block(s). In addition, a second prediction block of the current block may be generated based on the planar mode. The prediction block of the current block may be generated through a weighted sum of the first prediction block and the second prediction block.

[0204] For this purpose, a planar mode may be added to the block vector list, or at least one block vector belonging to the block vector list may be replaced with the planar mode.

[0205] For example, the template area of ​​the current block can be predicted based on a planar mode, and the cost between the predicted template area and the restored template area can be calculated. The planar mode can be applied based on at least one sample line adjacent to the template area of ​​the current block.

[0206] A planar mode may be added to the block vector list based on the cost according to the above planar mode. Alternatively, at least one block vector belonging to the block vector list may be replaced with the planar mode based on the cost according to the above planar mode.

[0207] A plurality of block vectors in a block vector list can be grouped into one or more sets. A planar mode can be added to a set containing block vectors having a cost smaller than the cost according to the planar mode. Alternatively, a planar mode can be added to a set containing block vectors having a cost larger than the cost according to the planar mode. Alternatively, within each set, a block vector having a cost smaller than the cost according to the planar mode can be replaced with the planar mode. Alternatively, within each set, a block vector having a cost larger than the cost according to the planar mode can be replaced with the planar mode.

[0208] Whether to add / replace the aforementioned planar modes can be explicitly or implicitly conveyed to the decoder. Whether to add / replace the aforementioned planar modes can be explicitly encoded or implicitly determined in the encoder.

[0209] For example, whether to add (or replace) a planar mode can be determined based on a flag signaled via the bitstream. Alternatively, the planar mode can be adaptively added to the block vector list based on the cost. At least one block vector in the block vector list can be adaptively replaced with the planar mode based on the cost of the planar mode.

[0210] The method of generating the final prediction block described above can be performed identically in the encoder and decoder.

[0211] The various embodiments of the present disclosure are not intended to list all possible combinations but rather to illustrate representative aspects of the present disclosure, and the matters described in the various embodiments may be applied independently or in combinations of two or more.

[0212] Additionally, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. In the case of hardware implementation, the embodiments may be implemented by one or more ASICs (Application Specific Integrated Circuits), DSPs (Digital Signal Processors), DSPDs (Digital Signal Processing Devices), PLDs (Programmable Logic Devices), FPGAs (Field Programmable Gate Arrays), general processors, controllers, microcontrollers, microprocessors, etc.

[0213] The scope of the present disclosure includes software or machine-executable instructions (e.g., operating systems, applications, firmware, programs, etc.) that cause operations according to the methods of various embodiments to be executed on a device or a computer, and a non-transitory computer-readable medium having such software or instructions stored thereon and executable on the device or computer.

Claims

1. Step to create an MPM list for the current block; A step of deriving an intra prediction mode of the current block based on the above MPM list; and A method for decoding an image, comprising the step of generating a prediction block of the current block based on the intra prediction mode.

2. In paragraph 1, A video decoding method, wherein the MPM list includes a plurality of MPM candidates, and the plurality of MPM candidates are derived based on an intra prediction mode of at least one of a block surrounding the current block, a block decoded before the current block, or a block at a specific location.

3. In paragraph 1, A cost is calculated for each of the multiple MPM candidates in the above MPM list, A method for decoding an image, wherein the above cost is stored separately as a first cost in the left template area and a second cost in the upper template area.

4. In paragraph 3, A video decoding method, wherein the top N MPM candidates in ascending order of first costs for the above MPM candidates and the top N MPM candidates in ascending order of second costs for the above MPM candidates are set as the intra prediction mode of the current block.

5. In paragraph 3, A video decoding method, wherein the intra prediction mode of the current block is derived by considering only one of the first costs or the second costs for the plurality of MPM candidates.

6. In paragraph 3, A video decoding method, wherein all or some of the plurality of MPM candidates belonging to the above MPM list are rearranged within the above MPM list based on the calculated cost.

7. In paragraph 3, The above intra prediction mode includes a first intra prediction mode and a second prediction mode, A method for decoding an image, wherein the above prediction block is generated through a weighted sum of a first prediction block generated based on the first intra prediction mode and a second prediction block generated based on the second intra prediction mode.

8. In paragraph 7, A video decoding method, wherein the weights for the above weighted sum are derived based on a first cost corresponding to the first intra prediction mode and a second cost corresponding to the second intra prediction mode.

9. In paragraph 7, A video decoding method, wherein the weights for the above weighted sum are derived based on only one of the first cost corresponding to the first intra prediction mode and the second cost corresponding to the second intra prediction mode.

10. In paragraph 7, A video decoding method, wherein a weight applied to the first prediction block is determined based on a comparison between a first cost and a second cost corresponding to the first intra prediction mode.

11. In paragraph 10, A video decoding method, wherein, if the first cost corresponding to the first intra prediction mode is greater than the second cost, a greater weight is applied to a prediction sample belonging to an upper sample line within the first prediction block than to a prediction sample belonging to a lower sample line.

12. Step to create an MPM list for the current block; A step of deriving an intra prediction mode of the current block based on the above MPM list; and A video encoding method, comprising the step of generating a prediction block of the current block based on the intra prediction mode.

13. A computer-readable recording medium storing a bitstream generated by the image encoding method according to Article 12.

Citation Information

Patent Citations

  • Semiconductor devices including substrate structure

    KR1020250042997A

  • Mold Processing Machine and Injection Molding Method for Manufacturing Dental Equipment

    KR1020250062020A

  • Method and apparatus for encoding / decoding image, recording medium for stroing bitstream

    KR102595069B1

  • Device and method for decoding video data

    US20230217019A1

  • Intra prediction modes signaling

    WO2023081322A1