Video encoding / decoding method and apparatus using template of chroma block

The method addresses the computational complexity in video encoding/decoding by determining block vectors and using template costs to optimize chroma block prediction, resulting in improved efficiency and performance in video encoding/decoding processes.

WO2024237557A1PCT designated stage expired Publication Date: 2024-11-21HYUNDAI MOTOR CO LTD +2

Patent Information

Application Number
PCT/KR2024/006236
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-05-08
Filing Date
2024-05-09
Publication Date
2024-11-21

AI Technical Summary

Technical Problem

Current video encoding/decoding technologies face high computational complexity due to template matching-based prediction methods, which increase processing demands and reduce efficiency, especially in chroma block prediction.

Method used

A method and device that determine block vectors for chroma blocks, perform template matching within defined search areas, and generate prediction lists using template costs to improve prediction efficiency by rearranging the prediction list and selecting optimal reference blocks for chroma block prediction.

Benefits of technology

This approach reduces computational complexity and enhances video encoding/decoding efficiency by optimizing chroma block prediction through targeted search areas and cost-based selection of reference blocks, leading to improved video coding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2024006236_21112024_PF_FP_ABST
    Figure KR2024006236_21112024_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a video encoding / decoding method and apparatus. The video decoding method according to the present disclosure includes the steps of: acquiring first information indicating whether to perform prediction of a chroma block on the basis of template matching; determining one or more block vectors for the chroma block by using one or more block vectors for one or more luma blocks when the first information indicates that the prediction of the chroma block is to be performed on the basis of template matching; determining one or more search areas by using the one or more block vectors for the chroma block; calculating one or more variable values by performing template matching between a template of the chroma block and the one or more search areas and determining one or more reference blocks based on one or more variable values; generating a prediction list of the chroma block by using one or more template costs and the one or more reference blocks; arranging the prediction list of the chroma block by using the one or more variable values; and generating a prediction block of the chroma block by using one or more first reference blocks in the prediction list of the chroma block.
Need to check novelty before this filing date? Find Prior Art

Description

Video encoding / decoding method and device using chroma block template

[0001] The present disclosure relates to a video encoding / decoding method and device using a template of a chroma block, and more specifically, to a video encoding / decoding method and device for determining a block vector of a chroma block and performing template matching using a region determined based on the block vector to generate a prediction block of the chroma block.

[0002] The content described below merely provides background information related to the present embodiment and does not constitute prior art.

[0003] Since video data has a large amount of data compared to voice data or still image data, it requires a lot of hardware resources, including memory, to store or transmit it without processing for compression.

[0004] Therefore, when storing or transmitting video data, an encoder is used to compress the video data and store or transmit it, and a decoder receives the compressed video data, decompresses it, and plays it back. Examples of such video compression technologies include H.264 / AVC, HEVC (High Efficiency Video Coding), and VVC (Versatile Video Coding), which improves encoding efficiency by about 30% compared to HEVC.

[0005] In encoding / decoding using template matching-based prediction, a reference block corresponding to a template most similar to the template of the current block is used as a matching block. During template matching-based decoding, the decoder searches for a matching block based on template matching between the templates of the reference blocks and the template of the current block, and determines the prediction block of the current block as the searched matching block. The decoder uses the Sum of Absolute Differences (SAD) or the Sum of Squared Errors (SSE) to estimate the similarity according to template matching. Since template matching is performed using multiple reconstructed reference blocks, template matching-based prediction increases the computational complexity of the image decoding process. To reduce the computational complexity, a search region for searching for a reference block is defined, and template matching is performed. R1, R2, R3, and R4, as illustrated in Fig. 6, correspond to search regions for template searching.

[0006] Template-matching-based prediction techniques have recently been utilized to improve the image quality of video frames. In particular, the efficient use of these template-matching-based prediction techniques should be considered to enhance chroma block video encoding efficiency and improve image quality.

[0007] The present disclosure aims to provide a method and device for generating a prediction list of a chroma block by performing template matching using a region based on a block vector of the chroma block.

[0008] In addition, the present disclosure aims to provide a method and device for generating a prediction block of a chroma block by rearranging a prediction list of chroma blocks using a template cost.

[0009] In addition, the present disclosure aims to provide a method and device for improving video encoding / decoding efficiency.

[0010] In addition, the present disclosure aims to provide a recording medium storing a bitstream generated by the video encoding / decoding method or device of the present disclosure.

[0011] In addition, the present disclosure aims to provide a method and device for transmitting a bitstream generated by the video encoding / decoding method or device of the present disclosure.

[0012] According to the present disclosure, a video decoding method may include the steps of: obtaining first information indicating whether to perform prediction of a chroma block based on template matching; determining one or more block vectors for a chroma block using one or more block vectors for one or more luma blocks when the first information indicates that prediction of the chroma block is to be performed based on template matching; the one or more luma blocks are blocks corresponding to the chroma block; determining one or more search regions using the one or more block vectors for the chroma block; calculating one or more variable values ​​by performing template matching between a template of the chroma block and the one or more search regions, and determining one or more reference blocks based on the one or more variable values; generating a prediction list of the chroma block using the one or more template costs and the one or more reference blocks; sorting the prediction list of the chroma block using the one or more variable values; and generating a prediction block of the chroma block using one or more first reference blocks within the prediction list of the chroma block.

[0013] According to the present disclosure, a video encoding method comprises: a step of determining whether to perform prediction of a chroma block based on template matching; a step of encoding first information indicating whether to perform prediction of the chroma block based on template matching; a step of determining one or more block vectors for a chroma block using one or more block vectors for one or more luma blocks when the first information indicates that prediction of the chroma block is to be performed based on template matching; the one or more luma blocks are blocks corresponding to the chroma block; a step of determining one or more search regions using one or more block vectors for the chroma block; a step of calculating one or more variable values ​​by performing template matching between a template of the chroma block and the one or more search regions, and determining one or more reference blocks based on the one or more variable values; a step of generating a prediction list of the chroma block using the one or more template costs and the one or more reference blocks; a step of arranging the prediction list of the chroma block using the one or more variable values; and a step of arranging the prediction list of the chroma block using one or more first reference blocks in the prediction list of the chroma block. It may include a process of generating a prediction block.

[0014] Additionally, according to the present disclosure, a method for transmitting a bitstream generated by a video encoding method or device according to the present disclosure can be provided.

[0015] In addition, according to the present disclosure, a recording medium storing a bitstream generated by a video encoding method or device according to the present disclosure can be provided.

[0016] In addition, according to the present disclosure, a recording medium storing a bitstream received and decoded by a video decoding device according to the present disclosure and used for restoring an image can be provided.

[0017] According to the present disclosure, a method and device for generating a prediction list of a chroma block by performing template matching using a region based on a block vector of a chroma block can be provided.

[0018] In addition, according to the present disclosure, a method and device for generating a prediction block of a chroma block by rearranging a prediction list of chroma blocks using a template cost can be provided.

[0019] Additionally, according to the present disclosure, a method and device for improving video encoding / decoding efficiency can be provided.

[0020] The effects that can be obtained from the present disclosure are not limited to the effects mentioned above, and other effects that are not mentioned will be clearly understood by a person having ordinary skill in the art to which the present disclosure pertains from the description below.

[0021] FIG. 1 is an exemplary block diagram of an image encoding device capable of implementing the techniques of the present disclosure.

[0022] Figure 2 is a drawing for explaining a method of dividing a block using the QTBTTT structure.

[0023] FIGS. 3A and 3B are diagrams illustrating multiple intra prediction modes, including wide-angle intra prediction modes.

[0024] Figure 4 is an example diagram of the surrounding blocks of the current block.

[0025] FIG. 5 is an exemplary block diagram of an image decoding device capable of implementing the techniques of the present disclosure.

[0026] FIG. 6 is a diagram illustrating a search area for template search according to one embodiment of the present disclosure.

[0027] FIG. 7 is a diagram for explaining a restoration process of a current block performed by an image decoding device according to one embodiment of the present disclosure.

[0028] FIG. 8 is a diagram for explaining a filter for filtering a prediction block according to template matching, according to one embodiment of the present disclosure.

[0029] FIG. 9 is a diagram for explaining the MMLM (Multi-model Linear Model) mode according to one embodiment of the present disclosure.

[0030] FIG. 10 is a diagram for explaining a DIMD (Decoder-side Intra Mode Derivation) chroma mode according to one embodiment of the present disclosure.

[0031] FIG. 11 is a drawing for explaining a reference area used for deriving filter coefficients according to one embodiment of the present disclosure.

[0032] FIG. 12 is a diagram illustrating Sobel filters for gradient calculation according to one embodiment of the present disclosure.

[0033] FIG. 13 is a diagram for explaining candidate luma blocks in DBV (Direct Block Vector) mode according to one embodiment of the present disclosure.

[0034] FIG. 14 is a diagram for explaining candidate luma blocks in DBV mode according to another embodiment of the present disclosure.

[0035] FIG. 15 is a diagram for explaining prediction of a chroma block in DBV mode according to one embodiment of the present disclosure.

[0036] FIG. 16 is a diagram illustrating a search area for template search of a chroma block according to one embodiment of the present disclosure.

[0037] FIG. 17 is a flowchart illustrating a video decoding process according to one embodiment of the present disclosure.

[0038] FIG. 18 is a flowchart illustrating a video encoding process according to one embodiment of the present disclosure.

[0039] Hereinafter, some embodiments of the present disclosure will be described in detail with reference to exemplary drawings. When designating components in each drawing, it should be noted that, where possible, identical components are given the same reference numerals, even if they appear in different drawings. Furthermore, in describing the present embodiments, detailed descriptions of related known configurations or functions will be omitted if they are deemed to obscure the gist of the present embodiments. In this disclosure, the terms "image" and "video" may be used interchangeably.

[0040] FIG. 1 is an exemplary block diagram of an image encoding device capable of implementing the techniques of the present disclosure. Hereinafter, the image encoding device and its subcomponents will be described with reference to the illustration in FIG. 1.

[0041] The video encoding device may be configured to include a picture segmentation unit (110), a prediction unit (120), a subtractor (130), a transformation unit (140), a quantization unit (145), a reordering unit (150), an entropy encoding unit (155), an inverse quantization unit (160), an inverse transformation unit (165), an adder (170), a loop filter unit (180), and a memory (190).

[0042] Each component of the video encoding device may be implemented in hardware, software, or a combination of hardware and software. Furthermore, the functions of each component may be implemented in software, with a microprocessor executing the software functions corresponding to each component.

[0043] A single image (video) is composed of one or more sequences containing multiple pictures. Each picture is divided into multiple regions, and encoding is performed for each region. For example, a single picture is divided into one or more tiles and / or slices. Here, one or more tiles can be defined as a tile group. Each tile or / slice is divided into one or more Coding Tree Units (CTUs). Each CTU is then divided into one or more Coding Units (CUs) by a tree structure. Information applied to each CU is encoded as the syntax of the CU, and information commonly applied to CUs included in a CTU is encoded as the syntax of the CTU. In addition, information commonly applied to all blocks within a single slice is encoded as the syntax of the slice header, and information applied to all blocks constituting one or more pictures is encoded in the Picture Parameter Set (PPS) or the picture header. Furthermore, information commonly referenced by multiple pictures is encoded in a Sequence Parameter Set (SPS). And, information commonly referenced by one or more SPS is encoded in a Video Parameter Set (VPS). In addition, information commonly applied to one tile or tile group may be encoded as syntax of a tile or tile group header. Syntaxes included in an SPS, PPS, slice header, tile or tile group header may be referred to as high level syntax.

[0044] The picture segmentation unit (110) determines the size of the CTU. Information about the size of the CTU (CTU size) is encoded as the syntax of SPS or PPS and transmitted to the image decoding device.

[0045] The picture segmentation unit (110) divides each picture constituting an image into a plurality of CTUs having a predetermined size, and then recursively divides the CTUs using a tree structure. A leaf node in the tree structure becomes a CU, which is a basic unit of encoding.

[0046] The tree structure may be a QuadTree (QT) in which an upper node (or parent node) is divided into four lower nodes (or child nodes) of the same size, a BinaryTree (BT) in which an upper node is divided into two lower nodes, or a TernaryTree (TT) in which an upper node is divided into three lower nodes in a 1:2:1 ratio, or a structure that mixes two or more of the QT structures, BT structures, and TT structures. For example, a QTBT (QuadTree plus BinaryTree) structure may be used, or a QTBTTT (QuadTree plus BinaryTree TernaryTree) structure may be used. Here, BTTT may be combined and referred to as a MTT (Multiple-Type Tree).

[0047] Figure 2 is a drawing for explaining a method of dividing a block using the QTBTTT structure.

[0048] As illustrated in FIG. 2, a CTU may first be split into a QT structure. The quadtree splitting may be repeated until the size of the splitting block reaches the minimum block size (MinQTSize) of the leaf node allowed in the QT. A first flag (QT_split_flag) indicating whether each node of the QT structure is split into four nodes of the lower layer is encoded by the entropy encoding unit (155) and signaled to the image decoding device. If the leaf node of the QT is not larger than the maximum block size (MaxBTSize) of the root node allowed in the BT, it may be further split into one or more of the BT structure or the TT structure. There may be multiple splitting directions in the BT structure and / or the TT structure. For example, there may be two directions in which the block of the corresponding node is split horizontally and two directions in which the block is split vertically. As illustrated in FIG. 2, when MTT splitting begins, a second flag (mtt_split_flag) indicating whether nodes have been split, and if splitting has occurred, a flag indicating the splitting direction (vertical or horizontal) and / or a flag indicating the splitting type (Binary or Ternary) are encoded by the entropy encoding unit (155) and signaled to the image decoding device.

[0049] Alternatively, before encoding the first flag (QT_split_flag) indicating whether each node is split into four nodes of a lower layer, a CU split flag (split_cu_flag) indicating whether the node is split may be encoded. If the CU split flag (split_cu_flag) value indicates that the node is not split, the block of the corresponding node becomes a leaf node in the split tree structure and becomes a CU (coding unit), which is a basic unit of encoding. If the CU split flag (split_cu_flag) value indicates that the node is split, the video encoding device starts encoding from the first flag in the above-described manner.

[0050] As another example of a tree structure, when QTBT is used, there may be two types: a type that horizontally splits the block of the corresponding node into two blocks of the same size (i.e., symmetric horizontal splitting) and a type that vertically splits it (i.e., symmetric vertical splitting). A split flag (split_flag) indicating whether each node of the BT structure is split into blocks of a lower layer and split type information indicating the type of split are encoded by the entropy encoding unit (155) and transmitted to the image decoding device. Meanwhile, there may additionally be a type that splits the block of the corresponding node into two blocks of an asymmetrical shape. The asymmetric shape may include a shape that splits the block of the corresponding node into two rectangular blocks with a size ratio of 1:3, or a shape that splits the block of the corresponding node in a diagonal direction.

[0051] A CU can have various sizes depending on the QTBT or QTBTTT partitioning from the CTU. Hereinafter, the block corresponding to the CU to be encoded or decoded (i.e., the leaf node of the QTBTTT) is referred to as the "current block." Depending on the QTBTTT partitioning employed, the current block may be rectangular as well as square.

[0052] The prediction unit (120) predicts the current block and generates a prediction block. The prediction unit (120) includes an intra prediction unit (122) and an inter prediction unit (124).

[0053] In general, each current block within a picture can be predictively coded. Prediction of the current block can typically be performed using either intra-prediction (using data from the picture containing the current block) or inter-prediction (using data from a picture coded before the picture containing the current block). Inter-prediction encompasses both unidirectional and bidirectional prediction.

[0054] The intra prediction unit (122) predicts pixels within the current block using pixels (reference pixels) located around the current block within the current picture including the current block. There are multiple intra prediction modes depending on the prediction direction. For example, as shown in Fig. 3a, the multiple intra prediction modes may include two non-directional modes including the Planar mode and the DC mode, and 65 directional modes. The surrounding pixels to be used and the calculation formula are defined differently depending on each prediction mode.

[0055] For efficient directional prediction for a rectangular current block, directional modes (intra prediction modes 67 to 80 and -1 to -14) indicated by dotted arrows in Fig. 3b may be additionally used. These may be referred to as "wide-angle intra-prediction modes." In Fig. 3b, the arrows point to corresponding reference samples used for prediction, and do not indicate the prediction direction. The prediction direction is opposite to the direction indicated by the arrows. Wide-angle intra-prediction modes are modes that perform prediction in the opposite direction of a specific directional mode without additional bit transmission when the current block is rectangular. At this time, among the wide-angle intra-prediction modes, some wide-angle intra-prediction modes available for the current block may be determined based on the ratio of the width and height of the rectangular current block. For example, wide-angle intra prediction modes (intra prediction modes 67 to 80) having an angle less than 45 degrees are available when the current block is a rectangular shape whose height is smaller than its width, and wide-angle intra prediction modes (intra prediction modes -1 to -14) having an angle greater than -135 degrees are available when the current block is a rectangular shape whose width is larger than its height.

[0056] The intra prediction unit (122) can determine an intra prediction mode to be used to encode the current block. In some examples, the intra prediction unit (122) can encode the current block using multiple intra prediction modes and select an appropriate intra prediction mode to be used from the tested modes. For example, the intra prediction unit (122) can calculate bit-rate distortion values ​​using rate-distortion analysis for multiple tested intra prediction modes and select an intra prediction mode with the best bit-rate distortion characteristics among the tested modes.

[0057] The intra prediction unit (122) selects one intra prediction mode from among multiple intra prediction modes and predicts the current block using surrounding pixels (reference pixels) and an operation formula determined according to the selected intra prediction mode. Information about the selected intra prediction mode is encoded by the entropy encoding unit (155) and transmitted to the image decoding device.

[0058] The inter prediction unit (124) generates a prediction block for the current block using a motion compensation process. The inter prediction unit (124) searches for a block most similar to the current block within reference pictures that were encoded and decoded before the current picture, and generates a prediction block for the current block using the searched block. Then, a motion vector (MV) corresponding to the displacement between the current block within the current picture and the prediction block within the reference picture is generated. Generally, motion estimation is performed on the luma component, and the motion vector calculated based on the luma component is used for both the luma component and the chroma component. The motion information including information on the reference picture used to predict the current block and information on the motion vector is encoded by the entropy encoding unit (155) and transmitted to the image decoding device.

[0059] The inter prediction unit (124) may perform interpolation on a reference picture or a reference block to improve prediction accuracy. That is, subsamples between two consecutive integer samples are interpolated by applying filter coefficients to a plurality of consecutive integer samples including the two integer samples. When a process of searching for a block most similar to the current block is performed on the interpolated reference picture, the motion vector can be expressed up to a precision in decimal units rather than a precision in integer sample units. The precision or resolution of the motion vector can be set differently for each target region to be encoded, such as a slice, tile, CTU, CU, etc. When such adaptive motion vector resolution (AMVR) is applied, information on the motion vector resolution to be applied to each target region must be signaled for each target region. For example, when the target region is a CU, information on the motion vector resolution applied to each CU is signaled. Information on the motion vector resolution may be information indicating the precision of a differential motion vector, which will be described later.

[0060] Meanwhile, the inter prediction unit (124) can perform inter prediction using bi-prediction. In the case of bi-prediction, two reference pictures and two motion vectors indicating the block position most similar to the current block within each reference picture are used. The inter prediction unit (124) selects a first reference picture and a second reference picture from reference picture list 0 (RefPicList0) and reference picture list 1 (RefPicList1), respectively, and searches for a block similar to the current block within each reference picture to generate a first reference block and a second reference block. Then, the first reference block and the second reference block are averaged or weighted averaged to generate a prediction block for the current block. Then, motion information including information on two reference pictures used to predict the current block and information on two motion vectors is transmitted to the entropy encoding unit (155). Here, reference picture list 0 may be composed of pictures that are before the current picture in display order among the restored pictures, and reference picture list 1 may be composed of pictures that are after the current picture in display order among the restored pictures. However, this is not necessarily limited to this, and restored pictures that are after the current picture in display order may be additionally included in reference picture list 0, and conversely, restored pictures that are before the current picture may be additionally included in reference picture list 1.

[0061] Various methods can be used to minimize the number of bits required to encode motion information.

[0062] For example, if the reference picture and motion vector of the current block are identical to those of a neighboring block, the motion information of the current block can be transmitted to the image decoding device by encoding information that can identify the neighboring block. This method is called 'merge mode'.

[0063] In merge mode, the inter prediction unit (124) selects a predetermined number of merge candidate blocks (hereinafter referred to as 'merge candidates') from the surrounding blocks of the current block.

[0064] As the surrounding blocks for deriving merge candidates, all or part of the left block (A0), the lower left block (A1), the upper block (B0), the upper right block (B1), and the upper left block (B2) adjacent to the current block within the current picture may be used, as illustrated in FIG. 4. In addition, a block located within a reference picture (which may or may not be the same as the reference picture used to predict the current block) other than the current picture in which the current block is located may be used as a merge candidate. For example, a block co-located with the current block within the reference picture or blocks adjacent to the block at the co-located block may be additionally used as a merge candidate. If the number of merge candidates selected by the method described above is less than a preset number, a 0 vector is added to the merge candidates.

[0065] The inter prediction unit (124) uses these surrounding blocks to construct a merge list containing a predetermined number of merge candidates. Among the merge candidates included in the merge list, the merge candidate to be used as motion information of the current block is selected and merge index information for identifying the selected candidate is generated. The generated merge index information is encoded by the entropy encoding unit (155) and transmitted to the video decoding device.

[0066] Merge Skip mode is a special case of merge mode. After quantization, when all transform coefficients for entropy encoding are close to zero, only neighboring block selection information is transmitted without transmitting residual signals. By utilizing merge skip mode, relatively high encoding efficiency can be achieved for low-motion images, still images, and screen content images.

[0067] Hereinafter, merge mode and merge skip mode are collectively referred to as merge / skip mode.

[0068] Another method for encoding motion information is Advanced Motion Vector Prediction (AMVP) mode.

[0069] In AMVP mode, the inter prediction unit (124) derives predicted motion vector candidates for the motion vector of the current block using neighboring blocks of the current block. As neighboring blocks used to derive predicted motion vector candidates, all or some of the left block (A0), the lower left block (A1), the upper block (B0), the upper right block (B1), and the upper left block (B2) adjacent to the current block in the current picture as shown in FIG. 4 may be used. In addition, a block located in a reference picture (which may or may not be the same as the reference picture used to predict the current block) other than the current picture in which the current block is located may be used as the neighboring block used to derive predicted motion vector candidates. For example, a block co-located with the current block in the reference picture or blocks adjacent to the block in the co-located block may be used. If the number of motion vector candidates is less than a preset number by the method described above, a 0 vector is added to the motion vector candidates.

[0070] The inter prediction unit (124) derives predicted motion vector candidates using the motion vectors of these surrounding blocks, and determines a predicted motion vector for the motion vector of the current block using the predicted motion vector candidates. Then, the predicted motion vector is subtracted from the motion vector of the current block to produce a differential motion vector.

[0071] The predicted motion vector can be obtained by applying a predefined function (e.g., median, mean, etc.) to the predicted motion vector candidates. In this case, the image decoding device also knows the predefined function. In addition, since the surrounding blocks used to derive the predicted motion vector candidates are blocks that have already been encoded and decoded, the image decoding device also already knows the motion vectors of the surrounding blocks. Therefore, the image encoding device does not need to encode information to identify the predicted motion vector candidates. Therefore, in this case, information about the differential motion vector and information about the reference picture used to predict the current block are encoded.

[0072] Alternatively, the predicted motion vector can be determined by selecting one of the predicted motion vector candidates. In this case, information for identifying the selected predicted motion vector candidate is additionally encoded, along with information about the differential motion vector and the reference picture used to predict the current block.

[0073] The subtractor (130) subtracts the prediction block generated by the intra prediction unit (122) or inter prediction unit (124) from the current block to generate a residual block.

[0074] The transformation unit (140) transforms residual signals within a residual block having pixel values ​​in a spatial domain into transform coefficients in a frequency domain. The transformation unit (140) may transform the residual signals within the residual block using the entire size of the residual block as a transformation unit, or may divide the residual block into a plurality of sub-blocks and use the sub-blocks as transformation units to perform the transformation. Alternatively, the residual signals may be transformed using only the transformation domain sub-block as a transformation unit by dividing the sub-blocks into two sub-blocks, that is, a transformation domain and a non-transform domain. Here, the transformation domain sub-block may be one of two rectangular blocks having a size ratio of 1:1 with respect to the horizontal axis (or vertical axis). In this case, a flag (cu_sbt_flag) indicating that only a sub-block has been converted, directionality (vertical / horizontal) information (cu_sbt_horizontal_flag), and / or position information (cu_sbt_pos_flag) are encoded by the entropy encoding unit (155) and signaled to the image decoding device. In addition, the size of the conversion area sub-block may have a size ratio of 1:3 with respect to the horizontal axis (or vertical axis), and in this case, a flag (cu_sbt_quad_flag) distinguishing the corresponding division is additionally encoded by the entropy encoding unit (155) and signaled to the image decoding device.

[0075] Meanwhile, the transformation unit (140) can individually perform transformations on the residual block in the horizontal and vertical directions. For the transformation, various types of transformation functions or transformation matrices can be used. For example, a pair of transformation functions for horizontal transformation and vertical transformation can be defined as a Multiple Transform Set (MTS). The transformation unit (140) can select one transformation function pair with the best transformation efficiency among the MTS and transform the residual block in the horizontal and vertical directions, respectively. Information (mts_idx) on the transformation function pair selected among the MTS is encoded by the entropy encoding unit (155) and signaled to the image decoding device.

[0076] The quantization unit (145) quantizes the transform coefficients output from the transform unit (140) using quantization parameters and outputs the quantized transform coefficients to the entropy encoding unit (155). The quantization unit (145) may directly quantize a related residual block without transformation for a certain block or frame. The quantization unit (145) may also apply different quantization coefficients (scaling values) according to the positions of the transform coefficients within the transform block. The quantization matrix applied to the quantized transform coefficients arranged in two dimensions may be encoded and signaled to an image decoding device.

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

[0078] The reordering unit (150) can change a two-dimensional coefficient array into a one-dimensional coefficient sequence by using coefficient scanning. For example, the reordering unit (150) can output a one-dimensional coefficient sequence by scanning from the DC coefficient to the coefficients of the high-frequency region by using a zig-zag scan or a diagonal scan. Depending on the size of the transformation unit and the intra prediction mode, a vertical scan that scans the two-dimensional coefficient array in the column direction or a horizontal scan that scans the 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 transformation unit and the intra prediction mode, the scanning method to be used may be determined among the zig-zag scan, the diagonal scan, the vertical scan, and the horizontal scan.

[0079] The entropy encoding unit (155) generates a bitstream by encoding a sequence of one-dimensional quantized transform coefficients output from the rearrangement unit (150) using various encoding methods such as CABAC (Context-based Adaptive Binary Arithmetic Code) and Exponential Golomb.

[0080] In addition, the entropy encoding unit (155) encodes information related to block division, such as CTU size, CU division flag, QT division flag, MTT division type, and MTT division direction, so that the image decoding device can divide the block in the same manner as the image encoding device. In addition, the entropy encoding unit (155) encodes information about a prediction type indicating whether the current block is encoded by intra prediction or inter prediction, and encodes intra prediction information (i.e., information about an intra prediction mode) or inter prediction information (information about an encoding mode of motion information (merge mode or AMVP mode), a merge index in the case of a merge mode, and a reference picture index and a differential motion vector in the case of an AMVP mode) according to the prediction type. In addition, the entropy encoding unit (155) encodes information related to quantization, that is, information about a quantization parameter and information about a quantization matrix.

[0081] The inverse quantization unit (160) inversely quantizes the quantized transform coefficients output from the quantization unit (145) to generate transform coefficients. The inverse transform unit (165) transforms the transform coefficients output from the inverse quantization unit (160) from the frequency domain to the spatial domain to restore the residual block.

[0082] An adder (170) adds the restored residual block and the predicted block generated by the prediction unit (120) to restore the current block. The pixels within the restored current block are used as reference pixels when intra-predicting the next block.

[0083] The loop filter unit (180) performs filtering on restored pixels to reduce blocking artifacts, ringing artifacts, blurring artifacts, etc. that occur due to block-based prediction and transformation / quantization. The loop filter unit (180) may include all or part of a deblocking filter (182), a sample adaptive offset (SAO) filter (184), and an adaptive loop filter (ALF, 186) as an in-loop filter.

[0084] The deblocking filter (182) filters the boundaries between restored blocks to remove blocking artifacts caused by block-based encoding / decoding, and the SAO filter (184) and the ALF (186) perform additional filtering on the deblocking-filtered image. The SAO filter (184) and the ALF (186) are filters used to compensate for the differences between restored pixels and original pixels caused by lossy coding. The SAO filter (184) improves not only subjective image quality but also encoding efficiency by applying an offset in units of CTUs. In contrast, the ALF (186) performs block-based filtering, and compensates for distortion by applying different filters by distinguishing the edges and degrees of variation of the corresponding block. Information on filter coefficients to be used in the ALF can be encoded and signaled to an image decoding device.

[0085] The restored blocks filtered through the deblocking filter (182), SAO filter (184), and ALF (186) are stored in the memory (190). When all blocks within a picture are restored, the restored picture can be used as a reference picture for inter-predicting blocks within a picture to be encoded later.

[0086] The video encoding device can store the bitstream of encoded video data on a non-transitory storage medium or transmit it to the video decoding device using a communication network.

[0087] FIG. 5 is an exemplary block diagram of an image decoding device capable of implementing the techniques of the present disclosure. Hereinafter, the image decoding device and its subcomponents will be described with reference to FIG. 5.

[0088] The video decoding device may be configured to include an entropy decoding unit (510), a rearrangement unit (515), an inverse quantization unit (520), an inverse transformation unit (530), a prediction unit (540), an adder (550), a loop filter unit (560), and a memory (570).

[0089] Similar to the video encoding device of FIG. 1, each component of the video decoding device may be implemented in hardware, software, or a combination of hardware and software. Furthermore, the functions of each component may be implemented in software, with a microprocessor executing the software functions corresponding to each component.

[0090] The entropy decoding unit (510) decodes the bitstream generated by the image encoding device to extract information related to block division, thereby determining the current block to be decoded, and extracts prediction information, information on residual signals, etc. required to restore the current block.

[0091] The entropy decoding unit (510) extracts information about the CTU size from the Sequence Parameter Set (SPS) or the Picture Parameter Set (PPS), determines the size of the CTU, and divides the picture into CTUs of the determined size. Then, the CTU is determined as the top layer of the tree structure, i.e., the root node, and the CTU is divided using the tree structure by extracting division information about the CTU.

[0092] For example, when splitting a CTU using the QTBTTT structure, first, the first flag (QT_split_flag) related to the splitting of QT is extracted, and each node is split into four nodes of the lower layer. Then, for the nodes corresponding to the leaf nodes of QT, the second flag (mtt_split_flag) related to the splitting of MTT and the split direction (vertical / horizontal) and / or split type (binary / ternary) information are extracted, and the corresponding leaf nodes are split into the MTT structure. Accordingly, each node below the leaf nodes of QT are split recursively into the BT or TT structure.

[0093] As another example, when splitting a CTU using the QTBTTT structure, the CU split flag (split_cu_flag) indicating whether the CU is split is first extracted, and if the block is split, the first flag (QT_split_flag) may be extracted. During the splitting process, each node may undergo zero or more repeated QT splits followed by zero or more repeated MTT splits. For example, a CTU may undergo an MTT split right away, or conversely, may undergo only multiple QT splits.

[0094] As another example, when splitting a CTU using the QTBT structure, the first flag (QT_split_flag) related to the splitting of QT is extracted, and each node is split into four nodes of the lower layer. Furthermore, for nodes corresponding to leaf nodes of QT, a split flag (split_flag) indicating whether to further split into BTs and splitting direction information are extracted.

[0095] Meanwhile, when the entropy decoding unit (510) determines the current block to be decoded by using the division of the tree structure, it extracts information on the prediction type indicating whether the current block is intra-predicted or inter-predicted. If the prediction type information indicates intra-prediction, the entropy decoding unit (510) extracts syntax elements for intra-prediction information (intra-prediction mode) of the current block. If the prediction type information indicates inter-prediction, the entropy decoding unit (510) extracts syntax elements for inter-prediction information, i.e., information indicating a motion vector and a reference picture referenced by the motion vector.

[0096] Additionally, the entropy decoding unit (510) extracts information about the quantized transform coefficients of the current block as information related to quantization and information about residual signals.

[0097] The rearrangement unit (515) can change the sequence of one-dimensional quantized transform coefficients entropy-decoded in the entropy decoding unit (510) back into a two-dimensional coefficient array (i.e., block) in the reverse order of the coefficient scanning performed by the image encoding device.

[0098] The inverse quantization unit (520) inversely quantizes the quantized transform coefficients and inversely quantizes the quantized transform coefficients using the quantization parameters. The inverse quantization unit (520) may also apply different quantization coefficients (scaling values) to the quantized transform coefficients arranged in two dimensions. The inverse quantization unit (520) may perform inverse quantization by applying a matrix of quantized coefficients (scaling values) from an image encoding device to a two-dimensional array of quantized transform coefficients.

[0099] The inverse transform unit (530) inversely transforms the inverse quantized transform coefficients from the frequency domain to the spatial domain to restore residual signals, thereby generating a residual block for the current block.

[0100] In addition, when the inverse transform unit (530) inversely transforms only a portion of a transform block (sub-block), it extracts a flag (cu_sbt_flag) indicating that only a sub-block of the transform block has been transformed, directionality (vertical / horizontal) information (cu_sbt_horizontal_flag) of the sub-block, and / or position information (cu_sbt_pos_flag) of the sub-block, and inversely transforms the transform coefficients of the corresponding sub-block from the frequency domain to the spatial domain to restore residual signals, and fills “0” values ​​with residual signals for areas that have not been inversely transformed, thereby generating a final residual block for the current block.

[0101] In addition, when MTS is applied, the inverse transform unit (530) determines a transform function or a transform matrix to be applied in the horizontal and vertical directions using MTS information (mts_idx) signaled from the image encoding device, and performs inverse transform on the transform coefficients within the transform block in the horizontal and vertical directions using the determined transform function.

[0102] The prediction unit (540) may include an intra prediction unit (542) and an inter prediction unit (544). The intra prediction unit (542) is activated when the prediction type of the current block is intra prediction, and the inter prediction unit (544) is activated when the prediction type of the current block is inter prediction.

[0103] The intra prediction unit (542) determines the intra prediction mode of the current block among a plurality of intra prediction modes from the syntax elements for the intra prediction mode extracted from the entropy decoding unit (510), and predicts the current block using reference pixels around the current block according to the intra prediction mode.

[0104] The inter prediction unit (544) uses the syntax elements for the inter prediction mode extracted from the entropy decoding unit (510) to determine the motion vector of the current block and the reference picture referenced by the motion vector, and predicts the current block using the motion vector and the reference picture.

[0105] An adder (550) adds the residual block output from the inverse transform unit (530) and the predicted block output from the inter prediction unit (544) or the intra prediction unit (542) to restore the current block. The pixels within the restored current block are used as reference pixels when intra-predicting a block to be decoded later.

[0106] The loop filter unit (560) may include a deblocking filter (562), an SAO filter (564), and an ALF (566) as in-loop filters. The deblocking filter (562) deblocks the boundaries between restored blocks to remove blocking artifacts caused by block-by-block decoding. The SAO filter (564) and the ALF (566) perform additional filtering on restored blocks after deblocking filtering to compensate for differences between restored pixels and original pixels caused by lossy coding. The filter coefficients of the ALF are determined using information about filter coefficients decoded from the non-stream.

[0107] The restored blocks filtered through the deblocking filter (562), SAO filter (564), and ALF (566) are stored in the memory (570). When all blocks within a picture are restored, the restored picture is used as a reference picture for inter-predicting blocks within a picture to be encoded later.

[0108] The following embodiments may be performed by various components within an image encoding device. They may also be performed by various components within an image decoding device.

[0109] The video encoding device can generate signaling information related to the present embodiment in terms of rate distortion optimization in encoding the current block. The video encoding device can encode signaling information using an entropy encoding unit (155) and then transmit it to an video decoding device. The video decoding device can decode signaling information related to decoding the current block from a bitstream using an entropy decoding unit (510).

[0110] In the following description, the term "target block" may be used interchangeably with the current block or coding unit (CU). Alternatively, the term "target block" may also refer to a portion of a coding unit.

[0111] Also, a value of a flag being true indicates that the flag is set to 1. Also, a value of a flag being false indicates that the flag is set to 0.

[0112] I. Template Matching-Based Prediction

[0113] In encoding / decoding using template matching-based prediction, a reference block corresponding to a template most similar to the template of a current block is used as a matching block. In template matching-based decoding, an image decoding device searches for a matching block based on template matching between the templates of reference blocks and the template of the current block, and determines the prediction block of the current block as the searched matching block. In other words, the matching block represents a (selected) reference block according to template matching. Hereinafter, the template of the reference block is used interchangeably with the reference template, and the template of the current block is used interchangeably with the current template.

[0114] Video decoding devices use measures such as Sum of Absolute Differences (SAD) and Sum Squared Errors (SSE) to estimate similarity based on template matching. Since template matching is performed using multiple reconstructed reference blocks, template matching-based prediction increases the computational complexity of the video decoding process. To reduce the computational complexity, a search area for searching for reference blocks is defined, and template matching is performed. As illustrated in Fig. 6, R1, R2, R3, and R4 correspond to the search areas for template searching. In the example of Fig. 6, (x, y) represents the location of the upper left sample of the current block.

[0115] Hereinafter, the mode that predicts the current block based on template matching is referred to as the template matching-based prediction mode. Furthermore, the method of intra-predicting the current block using the template matching-based prediction mode is referred to as template matching-based intra-prediction or intra-template matching prediction (intraTMP). Hereinafter, the terms template matching-based intra-prediction and template matching-based prediction are used interchangeably. Template matching and intra-template matching are used interchangeably.

[0116] Hereinafter, a method for predicting and restoring a current block using a template matching-based prediction mode is described using the city of FIG. 7.

[0117] FIG. 7 is a flowchart illustrating restoration of a current block performed by an image decoding device according to one embodiment of the present disclosure.

[0118] A video decoding device obtains the size of a current block (S700). Before obtaining the size of the current block, the video decoding device can obtain information indicating whether the method of generating a prediction block of a chroma block by performing template matching of the present disclosure is applied. The information indicating whether the method of generating a prediction block of a chroma block by performing template matching of the present disclosure is applied may be information in the form of a flag. The video encoding device can signal the information indicating whether the method of generating a prediction block of a chroma block by performing template matching of the present disclosure is applied at a sequence level, a picture level, a slice level, a tile level, or the like. The video encoding device can signal the information indicating whether the method of generating a prediction block of a chroma block by performing template matching of the present disclosure is applied at a CTU level, a CU level, or the like.

[0119] The video decoding device determines whether the size of the current block satisfies the range conditions (S702). The video decoding device determines whether the size of the current block satisfies the range conditions (e.g., the minimum block size condition and / or the maximum block size condition) for decoding based on template matching-based prediction. Depending on whether the range conditions are satisfied, the restoration process is divided into a restoration process using template matching and a restoration process not using template matching.

[0120] If the range condition is satisfied (S702-YES), the video decoding device decodes the template matching flag (S704). The template matching flag indicates whether intra-template matching is used for the current block.

[0121] The video decoding device checks the template matching flag (S706).

[0122] If the template matching flag is true (S706-YES), the video decoding device generates a prediction block of the current block based on template matching (S708).

[0123] If the range condition is not satisfied (S702-NO) or the template matching flag is false (S706-NO), the video decoding device generates a prediction block of the current block using a prediction mode other than template matching (S720). For example, intra prediction mode or inter prediction may be used instead of template matching.

[0124] Afterwards, the video decoding device can decode the residual block and then add the residual block and the prediction block to generate a restoration block of the current block.

[0125] Meanwhile, filtering can be applied to intra-template matching prediction. The filter is applied to the matching block, and ultimately, the filtered matching block is used as the prediction block of the current block. For example, the filter is a 6-tap linear filter, which is a cross filter including 5 luma taps and 1 bias term. The input to the spatial 5-tap component of the filter consists of the center (C) sample, the upper / north (N) sample, the lower / south (S) sample, the left / west (W) sample, and the right / east (E) sample of the matching block at the location corresponding to the sample of the current block, as shown in the example of Fig. 8. Hereinafter, the 6-tap filter is also referred to as a 5-tap filter without considering the bias term.

[0126] The output of the filter is calculated as in mathematical expression 1.

[0127]

[0128] In mathematical expression 1, B represents a bias term.

[0129] The filter coefficients (c0 to c5) shown in Equation 1 are derived for each block using a regression model that minimizes the Mean Square Error (MSE) between the filter output and the samples in the template of the current block. Minimizing the MSE involves calculating the autocorrelation matrix between the reference template and the current template, performing LDL decomposition of the autocorrelation matrix, and calculating the filter coefficients based on back-substitution.

[0130] Meanwhile, a filter flag indicating whether a filter is used is transmitted from the video encoding device to the video decoding device at the CU level. Furthermore, the use of a linear filter is considered a submode of intra-template matching prediction. That is, if the template matching flag indicating whether intra-template matching prediction is used is true, the filter flag is signaled.

[0131] The output of the filter for a chroma block, prdChromaVal, can be expressed as follows: predChromaVal = c0C + c1N + c2S + c3E + c4W + c5P + c6B where C is the center sample of the matching block, N is the top sample of the matching block, S is the bottom sample of the matching block, W is the left sample of the matching block, and E is the right sample of the matching block. P is a nonlinear term, and B is an offset. P is expressed as a power of C and can be scaled by the bit depth.

[0132] In another embodiment, the output of the filter for the chroma block, prdChromaVal, can be expressed as follows: predChromaVal = c0C + c1N + c2S + c3E + c4W + c5P(C) + c6P(N) + c7P(S) + c8P(W) + c9P(E)+ c 10B Here, C is the center sample of the matching block, N is the top sample of the matching block, S is the bottom sample of the matching block, W is the left sample of the matching block, and E is the right sample of the matching block. P is the square term of each sample, and B is the offset. The prediction block for the chroma block can be generated by downsampling the luma sample.

[0133] II. Chroma prediction mode of ECM (Enhanced Compression Model)

[0134] In the ECM corresponding to Beyond VVC, the Multi-model LM (MMLM) mode, which is an extension of the Cross-component Linear Model (CCLM) included in the existing VVC, is added. The MMLM mode derives a linear model by applying the Least Mean Square (LMS) method to luma samples and improves accuracy by adjusting the slope of the linear model. As shown in the example of Fig. 9, the slope is adjusted using a linear function that maps luma values ​​to chroma values ​​based on a center point determined according to the average luma value of the reference sample. At this time, the linear function of the MMLM mode is derived from the linear function of the CCLM mode as in Equation 2.

[0135]

[0136] In mathematical expression 2, a and b are parameters representing the linear model of the CCLM mode illustrated in Fig. 9, and a' and b' are parameters representing the linear function of the MMLM mode. y r represents the reference luma sample value corresponding to the center point.

[0137] DIMD (Decoder-side Intra Mode Derivation) chroma determines the intra prediction mode of the current chroma block. As shown in the example of Fig. 10, the DIMD chroma mode is used based on the surrounding luma samples and chroma samples decoded in the surrounding rows and columns. The horizontal gradient and the vertical gradient are calculated for the luma samples, Cb, and Cr samples decoded at the same position in the current chroma block to derive a histogram of gradients. The prediction mode with the largest histogram value is used for intra prediction of the current chroma block. If the intra prediction mode derived according to the DIMD chroma mode is the same as the intra prediction mode according to the DM mode, the intra prediction mode with the second largest histogram value is used for intra prediction of the current chroma block. A CU level flag may be signaled to indicate whether the DIMD chroma mode is applied.

[0138] In ECM, two chroma prediction blocks can be fused together to generate final prediction signals as in Equation 3.

[0139]

[0140] In Equation 3, one of the two chroma prediction blocks is generated according to the Derived Mode (DM), the DIMD chroma mode, and one of the four basic modes (non-LM modes). The other prediction block may be generated according to the cross-component linear prediction mode. For example, pred0(i,j) may be predicted according to the non-LM (Linear Model) mode, and pred1(i,j) may be predicted according to the MMLM_LT mode. The four basic modes represent DC, Planar, horizontal mode (No. 18), and vertical mode (No. 50). The MMLM_LT mode represents the MMLM mode that uses the left and top samples to derive the linear model.

[0141] In Equation 3, the weights w0 and w1 are determined according to the intra prediction mode of the adjacent chroma block, and the shift is set to 2. If both the upper and left adjacent blocks are encoded in the LM mode, {w0, w1} = {1, 3}. If neither the upper and left adjacent blocks are encoded in the LM mode, {w0, w1} = {3, 1}. In other cases, {w0, w1} = {2, 2}.

[0142] As another example, final prediction signals can be generated as in Equation 4.

[0143]

[0144] In Equation 4, pred0(i,j) is predicted according to non-LM mode, and rec' L (i,j) represents the downsampled luma sample at the same location.

[0145] The Convolutional Cross-Component Model (CCCM) mode, similar to the CCLM mode, predicts chroma samples from reconstructed luma samples. When chroma subsampling is used, the CCCM mode compensates for the resolution difference between luma and chroma samples by downsampling the luma samples to align their positions. The CCCM mode computes the model using the top, left, or top and left reference samples.

[0146] A convolutional 7-tap filter in CCCM mode consists of a 5-tap cross-shaped spatial component, a nonlinear term, and a bias term. The 5-tap component of the filter can be expressed as an example in Fig. 8. That is, the 5-tap component of the filter consists of the center (C) luma sample, the bottom / south (S), the left / west (W), the right / east (E), and the top / north (N) samples.

[0147] The nonlinear term P is expressed as a power of the central luma sample C as in Equation 5 and is scaled by the bit depth.

[0148]

[0149] For an image with a depth of 10 bits, the nonlinear term P is expressed as in mathematical equation 6.

[0150]

[0151] The bias term B represents the scalar offset between the input and output, and is the intermediate chroma value (512 for images with 10-bit depth). The output of the convolution filter is the filter coefficient c. i It is calculated by convolution between the input values ​​and clipped to the range of valid chroma samples. The convolution filter ultimately calculates the predicted value as in Equation 7.

[0152]

[0153] Filter coefficient c i is calculated to minimize the Mean Square Error (MSE) between the predicted chroma sample and the reconstructed chroma sample in the reference region. In the example of Fig. 11, the six lines located at the top and left of the prediction unit (PU) represent the reference region of the chroma sample. The reference region extends to a size equal to the width and height of the PU toward the lower left and upper right of the PU boundary, respectively. The hashed region around the reference region and the prediction unit is used when deriving a cross-shaped spatial filter, and the unusable region can be used using padding.

[0154] MSE minimization is calculated using the autocorrelation matrix for luma samples and the cross-correlation vector between the luma input and chroma output. The autocorrelation matrix is ​​LDL decomposed, and the final filter coefficients are calculated using back-substitution. MSE minimization roughly follows the process of calculating ALF filter coefficients in ECM, but LDL decomposition is used instead of Cholesky decomposition to avoid square root operations.

[0155] The Gradient Linear Model (GLM) is used to predict chroma samples from luma sample gradients in the YUV 4:2:0 color format. GLM modes use two or three variables. When two variables are used, GLM derives a linear model using the luma sample gradient. At this time, the parameter derivation method of CCLM and the linear transformation of the predicted samples remain unchanged. In a GLM using two variables, the chroma sample C is expressed as in Equation 8.

[0156]

[0157] In mathematical expression 8, α and β represent parameters of the linear model derived according to the CCLM mode, and G represents the gradient.

[0158] The GLM mode using three variables predicts chroma samples based on luma sample gradients and downsampled luma values. The model parameters of the three-variable GLM are derived using the LDL decomposition-based MSE minimization method used in CCCM, using the rows and columns of six adjacent samples. In the three-variable GLM, the chroma sample C is expressed as in Equation 9.

[0159]

[0160] In Equation 9, G and L represent the luma sample gradient and the downsampled luma value, and α0, α1, and β represent the parameters of the GLM model.

[0161] In terms of signaling, if the CCLM mode is currently enabled for the CU, a flag indicating whether GLM is enabled for both the Cb and Cr components is signaled. If GLM is enabled, another flag indicating one of the two GLM modes is signaled. In addition, a filter index indicating one of the four Sobel filters for gradient computation is also signaled, as illustrated in FIG. 12 . In the example of FIG. 12 , the circle in the center of each filter indicates the location of the chroma sample corresponding to the six luma samples.

[0162] DBV (Direct Block Vector) mode is used for chroma blocks in a dual tree slice. When dual tree is enabled, a flag is displayed indicating whether the chroma block is encoded using IBC (Intra Block Copy) mode. When DBV mode is enabled, the positions of chroma and candidate luma blocks are as shown in the example of Fig. 13. In the example of Fig. 13, the candidate luma blocks are located at the center, upper left, upper right, lower left, and lower right in the corresponding luma region of the chroma block. When one of the five candidate luma blocks corresponding to the chroma block encoded in DBV mode is encoded in IBC mode or intraTMP mode, the block vector bvC (block vector Chroma) of the chroma block is derived using the block vector bvL (block vector Luma) of the corresponding block. The block vector of the luma block is scaled and used as the block vector of the chroma block. In another embodiment, the block vector of the luma block can be used as the block vector of the chroma block without being scaled. Template matching is used for scaling of block vectors, and when the luma block is encoded with RR-IBC (Reconstruction Reordered IBC), horizontal or vertical BV (Block Vector) adjustment is performed for bvL in the same manner as RR-IBC.

[0163] In another embodiment, in the example of FIG. 14, 12 candidate luma blocks are added to the candidate luma blocks of FIG. 13 in the corresponding luma region of the chroma block. Accordingly, the positions of the total 17 candidate luma blocks can be (0, 0), (W / 2, 0), (W-1, 0), (W / 4, H / 4), (W / 2, H / 4), (3xW / 4, H / 4), (0, H / 2), (W / 4, H / 2), (W / 2, H / 2), (3xW / 4, H / 2), (W-1, H / 2), (W / 4, 3xH / 4), (W / 2, 3xH / 4), (3xW / 4, 3xH / 4), (0, H-1), (W / 2, H-1), (W-1, H-1).

[0164] As shown in the example in Fig. 15, the DBV mode uses the current chroma block (xCb, yCb) and the position of bvC to determine the corresponding offset position (xCb+bvC[0], yCb+bvC[1]) and predicts the chroma block.

[0165] Chromablock template cost

[0166] To determine the mode to be used in CCP (Cross-Component Prediction), the template cost of the chroma block is calculated. The template cost can be calculated by applying the CCP candidates to the template of the chroma block and using the SAD between the predicted sample and the reconstructed sample. For CCCM mode, CCCM-L(Left) mode, and CCCM-T(Top) mode, the two template costs are calculated using adjacent samples of six lines or two lines, respectively, as parameter derivation samples. For MM (Multi Model)-CCCM mode, MM-CCCM-L(Left) mode, and MM-CCCM-T(Top) mode, the two template costs are calculated by determining the average value as a threshold to separate the two models using adjacent luma samples or luma samples combined with the current chroma block. For chroma fusion mode, the two template costs are calculated by fusion of each mode with MM (Multi Model)-CCLM mode or MM-CCCM mode. The mode with the lowest template cost is determined as the final mode of the current block in CCP.

[0167] FIG. 16 is a diagram illustrating a search area for template search of a chroma block according to one embodiment of the present disclosure.

[0168] Referring to FIG. 16, when DM (Direct Mode) is applied to the current block and IBC (Intra Block Copy) mode or intra template matching prediction mode is applied to the luma block of the current block, the video decoding device determines the block vector of the chroma block using the block vector of the luma block. When DBV mode is applied to the chroma block and among the C luma blocks corresponding to the chroma block, there is a block to which the IBC mode or intra template matching prediction mode is applied, the video decoding device determines the block vector of the chroma block using the block vector of the luma block.

[0169] If the current slice is an I slice and has a dual tree block partitioning structure, the video decoding device determines a block vector of a chroma block using a block vector of a luma block. If the current slice is an I slice and has a single tree block partitioning structure, the video decoding device determines a block vector of a chroma block using a block vector of a luma block. If the current slice has a dual tree block partitioning structure regardless of a slice type, the video decoding device determines a block vector of a chroma block using a block vector of a luma block. If the current slice has a single tree block partitioning structure regardless of a slice type, the video decoding device determines a block vector of a chroma block using a block vector of a luma block.

[0170] The offset position is determined using the block vector of the determined chroma block. The video decoding device determines a search region using the offset position as a reference point. Here, the search region is a region where template matching with the chroma block template is performed. The search region may be a fixed region or a region proportional to the size of the current block. For example, if the search region is a fixed region, the size of the search region may be equal to the size of the Coding Tree Unit (CTU). If the search region is proportional to the size of the current block, the size of the search region may be M times the size of the current block. Here, M may be any positive integer.

[0171] The video decoding device calculates the template cost by performing template matching between the chroma block template and the search region. The video decoding device determines the location of the block with the minimum template cost as the location of the reference block and generates a prediction block of the chroma block using this reference block. Here, the block with the minimum template cost is the block corresponding to the template most similar to the chroma block template within the search region.

[0172] A method for generating a prediction block of a chroma block using a prediction list of chroma blocks.

[0173] When the DBV mode is applied to a chroma block and C block vectors exist in C luma blocks corresponding to the chroma block, a video decoding device can determine block vectors of the C chroma blocks using the block vectors of the C luma blocks. Here, C can be any positive integer. For example, C can be 5 or 17. The video decoding device determines C offset positions using the block vectors of the C chroma blocks. The video decoding device performs template matching between the C templates based on the C offset positions and the templates of the chroma blocks to calculate the template costs. The video decoding device generates a prediction list of the chroma blocks using reference blocks corresponding to the C templates and their respective template costs.

[0174] A video decoding device determines C search regions using C offset positions determined using block vectors of C chroma blocks. Here, the C search regions are regions where template matching with the templates of the chroma blocks is performed. The C search regions may be fixed regions or regions proportional to the size of the current block. For example, if the C search regions are fixed regions, the size of the C search regions may be equal to the size of the CTU. If the C search regions are proportional to the size of the current block, the size of the C search regions may be M times the size of the current block. Here, M may be any positive integer. The video decoding device performs template matching between the templates of the chroma blocks and the C search regions to calculate template costs. The video decoding device generates a prediction list of the chroma blocks using a plurality of reference blocks and their respective template costs determined based on the template matching between the templates of the chroma blocks and the C search regions.

[0175] A video decoding device can sort a prediction list of chroma blocks using each calculated template cost. The prediction list of chroma blocks can be sorted in descending order of template cost. The video decoding device can generate a prediction block of the chroma block using a reference block with the minimum template cost within the prediction list of the chroma block. The video encoding device can signal an index for the reference block with the minimum template cost within the prediction list of the chroma block.

[0176] The video decoding device can linearly combine K x components and L y components among the (x, y) components of the block vectors of C chroma blocks. Here, K and L can be positive integers greater than or equal to 1. For example, when K and L are 1, the video decoding device can determine the corresponding x components and y components as the (x, y) components of the block vector of the chroma block.

[0177] A method for generating a prediction block of a chroma block using multiple reference blocks within a prediction list of the chroma block.

[0178] When multiple reference blocks are used in the prediction list of a chroma block, a video decoding device can generate a prediction block of the chroma block by weighting the multiple reference blocks. In this case, the video encoding device can signal indices for the multiple reference blocks used in the prediction list of the chroma block. The video decoding device can weight-stack the multiple reference blocks using predefined weights. For example, when three reference blocks are used and the three weights are w0, w1, and w2, respectively, the prediction block of the chroma block can be expressed as in Equation 10.

[0179]

[0180] Here, Cb is a prediction block of a chroma block, and Cb0, Cb1, and Cb2 are three reference blocks used in the prediction list of the chroma block. The sum of w0, w1, and w2 is 1, and w0, w1, and w2 are all greater than 0. w0, w1, and w2 can be predefined or variable values.

[0181] A method for signaling information related to the prediction of chroma blocks.

[0182] A video encoding device signals information indicating whether a method of generating a prediction block of a chroma block by performing template matching is applied. The information indicating whether a method of generating a prediction block of a chroma block by performing template matching is applied can be signaled at a level such as a sequence, a picture, a subpicture, a slice, a tile, etc. The information indicating whether a method of generating a prediction block of a chroma block by performing template matching is applied can be signaled at a block unit level such as a CTU, a CU, etc. The video encoding device signals indices for reference blocks used in a prediction list of a chroma block. When multiple reference blocks are used in the prediction list of a chroma block, the video encoding device signals indices for weights used to weight-synthesize the multiple reference blocks.

[0183] FIG. 17 is a flowchart illustrating a video decoding process according to one embodiment of the present disclosure.

[0184] Referring to FIG. 17, a video decoding device obtains first information indicating whether to perform prediction of a chroma block based on template matching. If the first information indicates that prediction of a chroma block is to be performed based on template matching, the video decoding device determines one or more block vectors for a chroma block using one or more block vectors for one or more luma blocks (S1710). The one or more luma blocks are blocks corresponding to chroma blocks. The process of determining one or more block vectors for a chroma block may include a process of determining one or more block vectors for a chroma block by scaling one or more block vectors for one or more luma blocks when an IBC (Intra Block Copy) mode or template matching-based intra prediction is applied to one or more luma blocks.

[0185] A video decoding device determines one or more search regions using one or more block vectors for a chroma block (S1720). The size of the search region may be a predefined size or may be proportional to the size of the current block. The video decoding device performs template matching between a template of a chroma block and one or more search regions to calculate one or more variable values, and determines one or more reference blocks based on the one or more variable values ​​(S1730). The video decoding device generates a prediction list of a chroma block using one or more template costs and one or more reference blocks (S1740). The video decoding device sorts the prediction list of the chroma block using one or more variable values ​​(S1750). The process of sorting the prediction list of the chroma block may include a process of sorting the prediction list of the chroma block in order of decreasing one or more variable values.

[0186] The video decoding device generates a prediction block of a chroma block using one or more first reference blocks in the prediction list of the chroma block (S1760). The process of generating the prediction block of the chroma block may include a process of generating the prediction block of the chroma block using a first reference block for a minimum value among one or more variable values ​​in the prediction list of the chroma block. The process of generating the prediction block of the chroma block may include a process of generating the prediction block of the chroma block by weighting and averaging the multiple first reference blocks when multiple first reference blocks are used among one or more reference blocks in the prediction list of the chroma block.

[0187] FIG. 18 is a flowchart illustrating a video encoding process according to one embodiment of the present disclosure.

[0188] Referring to FIG. 18, a video encoding device determines whether to perform prediction of a chroma block based on template matching. The video encoding device encodes first information indicating whether to perform prediction of a chroma block based on template matching. If the first information indicates that prediction of a chroma block is to be performed based on template matching, the video encoding device determines one or more block vectors for the chroma block using one or more block vectors for one or more luma blocks (S1810). The one or more luma blocks are blocks corresponding to chroma blocks. The process of determining one or more block vectors for the chroma block may include a process of determining one or more block vectors for the chroma block by scaling one or more block vectors for one or more luma blocks when IBC mode or template matching-based intra prediction is applied to one or more luma blocks.

[0189] A video encoding device determines one or more search regions using one or more block vectors for a chroma block (S1820). The size of the search region may be a predefined size or may be proportional to the size of a current block. The video encoding device performs template matching between a template of a chroma block and one or more search regions to calculate one or more variable values, and determines one or more reference blocks based on the one or more variable values ​​(S1830). The video encoding device generates a prediction list of a chroma block using one or more template costs and one or more reference blocks (S1840). The video encoding device sorts the prediction list of the chroma block using one or more variable values ​​(S1850). The process of sorting the prediction list of the chroma block may include a process of sorting the prediction list of the chroma block in order of one or more variable values ​​being smaller.

[0190] A video encoding device generates a prediction block of a chroma block using one or more first reference blocks in a prediction list of a chroma block (S1860). The process of generating the prediction block of the chroma block may include a process of generating the prediction block of the chroma block using a first reference block for a minimum value among one or more variable values ​​in the prediction list of the chroma block. The process of generating the prediction block of the chroma block may include a process of generating the prediction block of the chroma block by performing a weighted average of the multiple first reference blocks when multiple first reference blocks are used among one or more reference blocks in the prediction list of the chroma block.

[0191] Although the flowchart / timing diagram of this specification describes each process as being executed sequentially, this is merely an illustrative description of the technical idea of ​​one embodiment of the present disclosure. In other words, a person of ordinary skill in the art to which one embodiment of the present disclosure belongs may modify and apply various modifications and variations by changing the order described in the flowchart / timing diagram without departing from the essential characteristics of one embodiment of the present disclosure, or by executing one or more of the processes in parallel. Therefore, the flowchart / timing diagram is not limited to a chronological order.

[0192] It should be understood that the exemplary embodiments described above can be implemented in many different ways. The functions or methods described in one or more examples can be implemented in hardware, software, firmware, or any combination thereof. It should be understood that the functional components described herein are labeled as "units" to further emphasize their implementation independence.

[0193] Meanwhile, the various functions or methods described in this embodiment may also be implemented as instructions stored on a non-transitory storage medium that can be read and executed by one or more processors. Non-transitory storage media include, for example, all types of storage devices that store data in a form readable by a computer system. For example, non-transitory storage media include storage media such as erasable programmable read-only memory (EPROM), flash drives, optical drives, magnetic hard drives, and solid-state drives (SSDs).

[0194] The above description is merely an example of the technical idea of ​​the present embodiment, and those skilled in the art will appreciate that various modifications and variations can be made without departing from the essential characteristics of the present embodiment. Therefore, the present embodiments are not intended to limit the technical idea of ​​the present embodiment, but rather to explain it, and the scope of the technical idea of ​​the present embodiment is not limited by these embodiments. The scope of protection of the present embodiment should be interpreted by the claims below, and all technical ideas within a scope equivalent thereto should be interpreted as being included in the scope of rights of the present embodiment.

[0195]

[0196] CROSS-REFERENCE TO RELATED APPLICATION

[0197] This patent application claims priority to Korean patent application No. 10-2023-0063894, filed in Korea on May 17, 2023, and Korean patent application No. 10-2024-0060588, filed in Korea on May 8, 2024, the entire contents of which are incorporated herein by reference.

Claims

1. A process of obtaining first information indicating whether to perform prediction of a chroma block based on template matching; A process of determining at least one block vector for the chroma block using at least one block vector for at least one luma block, when the first information indicates that prediction of the chroma block is performed based on template matching, wherein the at least one luma block is a block corresponding to the chroma block; A process of determining one or more search areas using one or more block vectors for the above chroma blocks; A process of calculating one or more variable values ​​by performing template matching between the template of the chroma block and the one or more search regions, and determining one or more reference blocks based on the one or more variable values; A process of generating a prediction list of the chroma block using the one or more template costs and the one or more reference blocks; A process of sorting a prediction list of the chroma block using one or more of the above variable values; and A video decoding method, comprising a process of generating a prediction block of the chroma block by using one or more first reference blocks in a prediction list of the chroma block.

2. In paragraph 1, The process of determining one or more block vectors for the above chroma block is: A video decoding method, comprising a process of determining one or more block vectors for the chroma block by scaling one or more block vectors for the one or more luma blocks when an IBC (Intra Block Copy) mode or template matching-based intra prediction is applied to the one or more luma blocks.

3. In paragraph 1, A video decoding method, wherein the size of the above search area is a predefined size or proportional to the size of the current block.

4. In paragraph 1, The process of sorting the prediction list of the above chroma blocks is as follows: A video decoding method, comprising a process of sorting a prediction list of the chroma blocks in order of decreasing values ​​of the one or more variables.

5. In paragraph 1, The process of generating a prediction block of the above chroma block is as follows: A video decoding method, comprising the step of generating a prediction block of the chroma block by using a first reference block for a minimum value of one or more variable values ​​in the prediction list of the chroma block.

6. In paragraph 1, The process of generating a prediction block of the above chroma block is as follows: A video decoding method, comprising: a process of generating a prediction block of the chroma block by performing a weighted average of the plurality of first reference blocks when using a plurality of first reference blocks among the one or more reference blocks in the prediction list of the chroma block.

7. A process for determining whether to perform prediction of chroma blocks based on template matching; A process of encoding first information indicating whether to perform prediction of the chroma block based on template matching; A process of determining at least one block vector for the chroma block using at least one block vector for at least one luma block, when the first information indicates that prediction of the chroma block is performed based on template matching, wherein the at least one luma block is a block corresponding to the chroma block; A process of determining one or more search areas using one or more block vectors for the above chroma blocks; A process of calculating one or more variable values ​​by performing template matching between the template of the chroma block and the one or more search regions, and determining one or more reference blocks based on the one or more variable values; A process of generating a prediction list of the chroma block using the one or more template costs and the one or more reference blocks; A process of sorting a prediction list of the chroma block using one or more of the above variable values; and A video encoding method, comprising a process of generating a prediction block of the chroma block by using one or more first reference blocks in a prediction list of the chroma block.

8. In paragraph 7, The process of determining one or more block vectors for the above chroma block is: A video encoding method, comprising: a process of determining one or more block vectors for the chroma blocks by scaling one or more block vectors for the one or more luma blocks when IBC mode or template matching-based intra prediction is applied to the one or more luma blocks.

9. In paragraph 7, A video encoding method, wherein the size of the above search area is a predefined size or proportional to the size of the current block.

10. In paragraph 7, The process of sorting the prediction list of the above chroma blocks is as follows: A video encoding method, comprising a process of sorting a prediction list of the chroma blocks in order of decreasing values ​​of the one or more variables.

11. In paragraph 7, The process of generating a prediction block of the above chroma block is as follows: A video encoding method, comprising the step of generating a prediction block of the chroma block by using a first reference block for a minimum value of one or more variable values ​​in the prediction list of the chroma block.

12. In paragraph 7, The process of generating a prediction block of the above chroma block is as follows: A video encoding method, comprising: when a plurality of first reference blocks among the one or more reference blocks are used in the prediction list of the chroma block, a process of generating a prediction block of the chroma block by performing a weighted average of the plurality of first reference blocks.

13. A method for transmitting a bitstream related to video data, said method comprising: A process of generating a bitstream by encoding the above video data; and Including a process of transmitting the above bitstream to a video decoding device, The process of generating the above bitstream is: A process of determining whether to perform prediction of a chroma block based on template matching; A process of encoding first information indicating whether to perform prediction of the chroma block based on template matching; A process of determining at least one block vector for the chroma block using at least one block vector for at least one luma block, when the first information indicates that prediction of the chroma block is performed based on template matching, wherein the at least one luma block is a block corresponding to the chroma block; A process of determining one or more search areas using one or more block vectors for the above chroma blocks; A process of calculating one or more variable values ​​by performing template matching between the template of the chroma block and the one or more search regions, and determining one or more reference blocks based on the one or more variable values; A process of generating a prediction list of the chroma block using the one or more template costs and the one or more reference blocks; A process of sorting a prediction list of the chroma block using one or more of the above variable values; and A method comprising the step of generating a prediction block of the chroma block by using one or more first reference blocks in the prediction list of the chroma block.

Citation Information

Patent Citations

  • Display panel

    KR1020210057647A

  • Ceramic coated heating element for electronic cigarette

    KR1020220098841A

  • Chroma prediction for video encoding and decoding based on template matching

    WO2023036639A1

  • Method, device, and medium for video processing

    WO2023051532A1

  • Method, apparatus, and medium for video processing

    WO2023051652A1

Cited By

  • Methods and apparatus of block template for unified intra merge candidate list for inter and IBC prediction

    WO2026201126A1