Template matching prediction method utilizing intra mode information
The adaptive filtering of reference blocks using intra-mode information in intraTMP addresses the inefficiencies of existing video coding technologies, enhancing both coding efficiency and video quality by dynamically selecting filter types based on intra-mode information.
Patent Information
- Application Number
- PCT/KR2024/001221
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-24
- Filing Date
- 2024-01-25
- Publication Date
- 2024-10-17
AI Technical Summary
Current video coding technologies face increased computational complexity and inefficiency due to the growing size, resolution, and frame rate of video data, particularly in template matching-based prediction methods, which require significant hardware resources and do not effectively utilize intra-mode information for filtering.
A video coding method and device that adaptively filters reference blocks using intra-mode information in intra Template Matching Prediction (intraTMP), where the filter type is determined based on intra-mode information of the current block, reducing computational complexity and improving coding efficiency.
This approach enhances video coding efficiency and subjective quality by dynamically selecting filter types based on intra-mode information, optimizing the filtering process for improved prediction accuracy and reduced computational load.
Smart Images

Figure KR2024001221_17102024_PF_FP_ABST
Abstract
Description
Template matching prediction method using intra-mode information
[0001] The present disclosure relates to a video coding method and device using a template matching prediction method based on intra mode information.
[0002] The content described below merely provides background information related to the present invention 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] However, as the size, resolution, and frame rate of images are gradually increasing, and the amount of data that needs to be encoded is also increasing, a new compression technology that has better encoding efficiency and better image quality improvement than existing compression technologies is required.
[0006] 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. As illustrated in Fig. 6, R1, R2, R3, and R4 correspond to search regions for template searching.
[0007] Meanwhile, filtering can be applied to intra-template matching prediction (intraTMP). The filter is applied to a reference block, and the filtered reference block is used as the prediction block of the current block. For example, the filter is a 6-tap linear filter, including 5 luma taps and 1 bias term. The filter coefficients are derived for each block using a regression model that minimizes the mean square error (MSE) between samples of the reference template and the current template. A template matching filter flag indicating whether to use a linear filter is transmitted from the encoder to the decoder at the CU level. Furthermore, the use of a linear filter is considered a sub-mode of intra-template matching prediction. That is, if the template matching flag indicating whether to use intra-template matching prediction is true, the template matching filter flag is signaled. Meanwhile, to improve video encoding efficiency and enhance video quality, a method of utilizing intra-mode information in the aforementioned filtering process needs to be considered.
[0008] The present disclosure aims to provide a video coding method and device for adaptively filtering a reference block according to template matching by utilizing intra mode information in intra Template Matching Prediction (intraTMP).
[0009] According to an embodiment of the present disclosure, a method for restoring a current block, performed by an image decoding device, is provided, comprising: searching for a matching block based on template matching between templates of reference blocks in a search area and a template of the current block, and determining a prediction block of the current block with the searched matching block; decoding a template matching filter flag from a bitstream, wherein the template matching filter flag indicates whether filtering is to be applied to a prediction block according to the template matching; and checking the template matching filter flag, and when the template matching filter flag is true, determining a form of a filter using intra mode information of the current block; and applying the filtering to the prediction block using the filter.
[0010] According to another embodiment of the present disclosure, a method for encoding a current block, performed by a video encoding device, is provided, characterized in that the method comprises: generating a first prediction block of the current block using a prediction mode that does not use template matching; searching for a matching block based on template matching between templates of reference blocks within a search area and a template of the current block, and determining a second prediction block of the current block as the searched matching block; determining a shape of a filter using intra mode information of the current block; and applying the filtering to the second prediction block using the filter to generate a filtered second prediction block.
[0011] According to another embodiment of the present disclosure, a computer-readable recording medium storing a bitstream generated by an image encoding method is provided, characterized in that the image encoding method comprises: generating a first prediction block of a current block using a prediction mode that does not use template matching; searching for a matching block based on template matching between templates of reference blocks within a search area and a template of the current block, and determining a second prediction block of the current block as the searched matching block; determining a shape of a filter using intra mode information of the current block; and applying the filter to the second prediction block using the filter to generate a filtered second prediction block.
[0012] As described above, according to the present embodiment, in intra template matching prediction, a video coding method and device are provided that adaptively filters a reference block according to template matching by utilizing intra mode information, thereby making it possible to improve objective video encoding efficiency and subjective video quality.
[0013] FIG. 1 is an exemplary block diagram of an image encoding device capable of implementing the techniques of the present disclosure.
[0014] Figure 2 is a drawing for explaining a method of dividing a block using the QTBTTT (QuadTree plus BinaryTree TernaryTree) structure.
[0015] FIGS. 3A and 3B are diagrams illustrating multiple intra prediction modes, including wide-angle intra prediction modes.
[0016] Figure 4 is an example diagram of the surrounding blocks of the current block.
[0017] FIG. 5 is an exemplary block diagram of an image decoding device capable of implementing the techniques of the present disclosure.
[0018] FIG. 6 is an exemplary diagram showing a search area for template search according to one embodiment of the present disclosure.
[0019] 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.
[0020] FIG. 8 is an exemplary diagram showing a filter for filtering a prediction block according to template matching, according to one embodiment of the present disclosure.
[0021] FIG. 9 is an exemplary diagram showing a filter for filtering a prediction block according to template matching, according to another embodiment of the present disclosure.
[0022] Figures 10a and 10b are exemplary diagrams showing sub-block division in ISP (Intra Sub-partitions).
[0023] FIG. 11 is an exemplary diagram showing reference samples according to template matching and MRL (Multiple Reference Line) reference samples according to one embodiment of the present disclosure.
[0024] FIG. 12 is an exemplary diagram showing a gradient filter according to one embodiment of the present disclosure.
[0025] FIG. 13 is a flowchart showing encoding of a current block performed by an image encoding device according to one embodiment of the present disclosure.
[0026] FIG. 14 is a flowchart showing restoration of a current block performed by an image decoding device according to one embodiment of the present disclosure.
[0027] Hereinafter, embodiments of the present invention 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 structures or functions will be omitted if they are deemed to obscure the gist of the present embodiments.
[0028] 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.
[0029] 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).
[0030] 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.
[0031] 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.
[0032] 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.
[0033] 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.
[0034] 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).
[0035] Figure 2 is a drawing for explaining a method of dividing a block using the QTBTTT structure.
[0036] 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.
[0037] 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.
[0038] 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.
[0039] 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.
[0040] 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).
[0041] 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.
[0042] 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.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] Various methods can be used to minimize the number of bits required to encode motion information.
[0050] 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'.
[0051] 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.
[0052] 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.
[0053] 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.
[0054] 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.
[0055] Hereinafter, merge mode and merge skip mode are collectively referred to as merge / skip mode.
[0056] Another method for encoding motion information is Advanced Motion Vector Prediction (AMVP) mode.
[0057] 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.
[0058] 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.
[0059] 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.
[0060] 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.
[0061] 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.
[0062] 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.
[0063] 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.
[0064] 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.
[0065] The rearrangement unit (150) can perform rearrangement of coefficient values for quantized residual values.
[0066] 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.
[0067] 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.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] 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.
[0072] 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.
[0073] 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.
[0074] 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.
[0075] 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.
[0076] 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).
[0077] 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.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] 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.
[0082] 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.
[0083] 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.
[0084] 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.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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.
[0096]
[0097] The present embodiment relates to encoding and decoding of images (videos) as described above. More specifically, in intra-template matching prediction (intraTMP), a video coding method and device are provided that adaptively filters reference blocks according to template matching by utilizing intra-mode information.
[0098] The following embodiments may be performed by an intra prediction unit (122) within a video encoding apparatus. In addition, the following embodiments may be performed by an intra prediction unit (542) within a video decoding apparatus.
[0099] 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 the signaling information using the entropy encoding unit (155) and then transmit it to the video decoding device. The video decoding device can decode the signaling information related to the decoding of the current block from the bitstream using the entropy decoding unit (510).
[0100] 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.
[0101] 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.
[0102] I. Template Matching-Based Prediction
[0103] 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, 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. The image decoding device uses measures such as Sum of Absolute Differences (SAD) and Sum 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 area 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 areas for template searching. In the example of FIG. 6, (x, y) represents the position of the upper-left sample of the current block.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] The video decoding device obtains the size of the current block (S700).
[0108] 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.
[0109] If the range condition is satisfied (Yes in S702), 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.
[0110] The video decoding device checks the template matching flag (S706).
[0111] If the template matching flag is true (Yes in S706), the video decoding device generates a prediction block of the current block based on template matching (S708).
[0112] If the range condition is not satisfied (No in S702) or the template matching flag is false (No in S706), 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.
[0113] 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.
[0114] Meanwhile, filtering can be applied to intra-template matching prediction. The filter is applied to a reference block, and the filtered reference block is used as a 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 reference block at positions corresponding to the samples 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.
[0115] The output of the filter is calculated as in mathematical expression 1.
[0116]
[0117] In mathematical expression 1, B represents a bias term.
[0118] The filter coefficients shown in Equation 1 are derived for each block using a regression model that minimizes the Mean Square Error (MSE) between samples within the template of the reference block and samples within the template of the current block. MSE minimization involves calculating the autocorrelation matrix between the reference template and the current template, LDL decomposition of the autocorrelation matrix, and calculating the filter coefficients based on back-substitution.
[0119] Meanwhile, the template matching filter flag, which indicates whether to use the filter, 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, which indicates whether to use intra-template matching prediction, is true, the template matching filter flag is signaled.
[0120] The following embodiments are described with a focus on an image decoding device, but can be implemented identically or similarly in an image encoding device.
[0121] II. Embodiments according to the present disclosure
[0122] As mentioned above, conventional filtering in template matching-based prediction uses fixed-form filters. Therefore, adaptive filtering cannot be applied block-by-block. Below, we describe adaptive filtering based on various intra prediction modes in template matching-based prediction.
[0123] In the conventional filtering described above, a linear filter with five luma taps is used. In the present disclosure, various filter shapes, such as horizontal, vertical, and diagonal, are additionally used, as illustrated in FIG. 9. The image decoding device can adaptively select the number of filter taps based on intra-mode information. For example, the image decoding device uses a filter with fewer or more taps, such as three or seven taps, in addition to five taps.
[0124] When selecting a filter type for filtering a prediction block according to template matching, the video decoding device uses the same method as the method for obtaining reference samples of a directional intra prediction mode. In VVC, intra prediction modes are classified into three groups (e.g., groups A, B, and C), and reference samples of the directional intra prediction mode are configured by using a [1,2,1] smoothing filter, a Gaussian interpolation filter, and a cubic interpolation filter for each group. Group A is a horizontal prediction mode and a vertical prediction mode, group B includes diagonal modes that are multiples of 45 degrees, and group C includes other directional modes. As an example, for a prediction mode included in group A, the video decoding device selects a horizontal or vertical filter type as illustrated in FIG. 9 to filter a prediction block according to template matching. For a prediction mode included in group B, the video decoding device uses a diagonal filter as illustrated in FIG. 9. For the prediction mode included in group C, the image decoding device uses a conventional cruciform 5-tap filter as illustrated in FIG. 8. Alternatively, the image decoding device may not perform filtering for blocks having the prediction mode included in group C.
[0125] Meanwhile, classifying intra prediction modes into three groups is merely an example. That is, the intra prediction modes can be classified into N groups based on their characteristics, and a filter type for filtering predicted blocks based on template matching can be specified for each group. Here, N can be any positive integer, and is not limited to a specific value in the present disclosure.
[0126] The video decoding device determines a filter form for filtering a prediction block based on template matching, based on a prediction mode group that includes the intra prediction mode of the current block among N (where N is a positive integer) prediction mode groups. For the application of the present disclosure, the video encoding device may signal the intra prediction mode of the current block to the video decoding device.
[0127] Additionally, the video decoding device derives a group of directional intra prediction modes and determines a filter shape according to one of the following methods for a prediction block based on template matching.
[0128] As an example, the video decoding device utilizes the group classification of intra prediction modes in the VVC described above for the prediction block according to template matching. That is, the video decoding device determines the filter shape according to the prediction mode group including the intra prediction mode of the prediction block. For example, the video decoding device utilizes the intra prediction mode of the block including the prediction block. Alternatively, the video decoding device may utilize the intra prediction mode of the large block that overlaps the prediction block and has the largest area.
[0129] As another example, the video decoding device utilizes the intra prediction mode of a block including the 4×4 block at the upper left of the prediction block according to template matching. That is, the video decoding device derives a group of directional intra prediction modes based on the intra prediction mode of the aforementioned block and determines the filter shape.
[0130] As another example, the video decoding device utilizes the intra prediction mode of a block including the central 4×4 block of the prediction block according to template matching. That is, the video decoding device derives a group of directional intra prediction modes based on the intra prediction mode of the aforementioned block and determines the filter shape.
[0131] In general, intra prediction uses the Most Probable Mode (MPM) based on the fact that the current block and surrounding blocks are often similar to each other. In VVC, six MPMs are supported, and in ECM (Enhanced Compression Model), six MPMs are used as primary MPMs and 16 MPMs are used as secondary MPMs. In an embodiment according to the present disclosure, a video decoding device selects a filter for filtering a prediction block according to template matching based on two or more intra prediction modes from the above-described MPM list, and combines output values according to application of the selected filters. As an example, two directional intra prediction modes having the smallest index and the second smallest index in the MPM / primary MPM / secondary MPM may be used. For example, when the two directions are horizontal and vertical, respectively, the video decoding device selects horizontal and vertical filter types, and performs filtering of a prediction block according to template matching using the two filter types. Finally, the video decoding device generates the final predicted block by weighting the values of the output blocks using preset weights. When generating the weighted sum using variable weights instead of preset weights, the variable weights are signaled from the video encoding device to the video decoding device.
[0132] As another example, one directional intra prediction mode with the smallest index can be selected from among MPM / primary MPM / secondary MPM. As described above, the video decoding device determines which group among groups A, B, and C the selected prediction mode belongs to, and selects a filter shape based on the determined group.
[0133] As another example, when using two or more filter types, the video encoding device signals the indexes of the filters to the video decoding device. Alternatively, the video encoding device signals the indexes indicating two prediction modes within the MPM list as described above to the video decoding device. The video decoding device determines which group among groups A, B, and C the signaled prediction mode belongs to, as described above, and selects the filter type according to the determined group.
[0134] The ISP (Intra Sub-partitions) technology divides a block into two or four sub-partitions in the vertical or horizontal direction depending on the block size, and performs prediction by applying the same intra prediction mode to each sub-partition. As in the example of Fig. 10a, when the block size is 4x8 or 8x4, the block is divided into two sub-blocks. Additionally, when the block size is larger than 4x8 or 8x4, the block is divided into four sub-blocks. At this time, depending on whether the division direction is horizontal or vertical, the image decoding device selects a filter type for filtering the prediction block according to template matching. For example, in the case of horizontal division in the examples of Figs. 10a and 10b, the image decoding device selects a horizontal filter type to filter the prediction block according to template matching. For application of the present disclosure, the image encoding device may signal information related to the ISP to the image decoding device.
[0135] MRL (Multiple Reference Line) technology is a technology that uses a larger number of reference lines (e.g., 1 line, 3 lines, 5 lines, 7 lines, 12 lines) when performing intra prediction. In the existing method, when calculating filter coefficients, samples from both the template of the current block and the template of the reference block are used. In the present embodiment, the video decoding device selects samples within the template according to the reference lines in the MRL prediction, and then calculates the filter coefficients using the selected samples. The video encoding device separately signals the index of the selected reference line to transmit the reference line used for calculating the filter coefficients. The video decoding device decodes the index of the reference line, and then calculates the filter coefficients using the reference line indicated by the index. In the example of Fig. 11, the samples used to calculate the filter coefficients according to the existing method are indicated by dotted boxes. In this embodiment, the image decoding device can calculate coefficients of a filter for filtering a prediction block by using reference lines within a dotted box or by using samples of some / all reference lines used by MRL regardless of the dotted box.
[0136] In the present embodiment, the image decoding device uses a gradient filter such as a Sobel filter to confirm the gradient characteristic of the current block, and performs filtering of the prediction block according to template matching based on the confirmed gradient characteristic. By calculating the gradient value G(i, j) at the position (i, j) of the sample of the template of the current block, the image decoding device calculates the sum of the gradients. The image decoding device confirms the gradient characteristic of the current block based on the sum of the gradients according to the horizontal gradient value or the vertical gradient value, i.e., the total amount of change. The image decoding device selects the form of a filter for filtering the prediction block according to template matching based on the confirmed gradient characteristic of the current block.
[0137] The image decoding device has a horizontal gradient value G h The sum of and the vertical gradient value G v After calculating the sum, the filter shape that includes the component with the larger change amount is selected. As an example, In this case, the vertical filter shape illustrated in Fig. 9 may be selected. The example in Fig. 12 shows an example of a gradient filter.
[0138] Hereinafter, a method of adaptively applying a filter to template matching by utilizing intra-mode information is described using the cities of FIGS. 13 and 14.
[0139] FIG. 13 is a flowchart showing encoding of a current block performed by an image encoding device according to one embodiment of the present disclosure.
[0140] The video encoding device generates a first prediction block of the current block using a prediction mode that does not utilize template matching (S1300). For example, an intra prediction mode or an inter prediction mode other than template matching may be used.
[0141] The video encoding device obtains the size of the current block and determines whether the size of the current block satisfies a range condition (e.g., a minimum block size condition and / or a maximum block size condition) for encoding the current block according to template matching-based prediction. If the range condition is satisfied, the video encoding device performs template matching-based prediction.
[0142] The video encoding device generates a second prediction block of the current block based on template matching (S1302).
[0143] An image encoding device predicts a current block using template matching according to a preset order (e.g., z-scan order). The image encoding device searches for a matching block based on template matching between templates of reference blocks within a search region and the template of the current block, and determines a second prediction block of the current block using the searched matching block.
[0144] The image encoding device determines the shape of the filter using the intra mode information of the current block (S1304).
[0145] Meanwhile, when two or more filter types are used for filtering prediction blocks according to template matching, the image encoding device additionally determines the indices of the filters used. The image encoding device encodes the indices of the filters.
[0146] The image encoding device calculates coefficients of the filter (S1306).
[0147] The video encoding device derives filter coefficients using a regression model that minimizes the MSE between samples in the template of the matching block and samples in the template of the current block.
[0148] The video encoding device applies filtering to the second prediction block based on the filter to generate a filtered second prediction block (S1308).
[0149] In addition, when two filters are determined, the image encoding device performs filtering of the second prediction block using the two filters, thereby generating two filtered second prediction blocks. Thereafter, the image encoding device weights the values of the output second prediction blocks using preset weights, thereby generating a final filtered second prediction block.
[0150] The video encoding device determines a template matching flag based on the first prediction block, the second prediction block, and the filtered second prediction block (S1310). Here, the template matching flag indicates whether template matching is used for the current block.
[0151] In terms of rate distortion optimization, the video encoding device determines a template matching flag. For example, if the first prediction block is optimal, the template matching flag is set to false. Conversely, if the second prediction block or the filtered second prediction block is optimal, the template matching flag is set to true.
[0152] The video encoding device encodes a template matching flag (S1312).
[0153] The video encoding device checks the template matching flag (S1314).
[0154] If the template matching flag is true (Yes in S1314), the video encoding device performs the following steps.
[0155] The video encoding device determines a template matching filter flag based on the second prediction block and the filtered second prediction block (S1316). Here, the template matching filter flag indicates whether filtering is applied to the prediction block according to template matching.
[0156] In terms of rate distortion optimization, the video encoding device determines the template matching filter flag. For example, if the second prediction block is optimal, the template matching filter flag is determined to be false. Conversely, if the filtered second prediction block is optimal, the template matching filter flag is determined to be true.
[0157] The video encoding device encodes a template matching filter flag (S1318).
[0158] If the template matching flag is false (No in S1318), the image encoding device encodes information related to the first prediction block (S1330).
[0159] Thereafter, the video encoding device generates a residual block by subtracting the predicted block according to the template matching flag and the template matching filter flag from the current block. The video encoding device applies transformation / quantization to the residual block to generate quantized transform coefficients, and then encodes the quantized transform coefficients.
[0160] FIG. 14 is a flowchart showing restoration of a current block performed by an image decoding device according to one embodiment of the present disclosure.
[0161] The video decoding device obtains the size of the current block and checks whether the size of the current block satisfies a range condition (e.g., a minimum block size condition and / or a maximum block size condition) for encoding the size of the current block according to template matching-based prediction.
[0162] If the range condition is satisfied, the image decoding device decodes the template matching flag (S1400). The template matching flag indicates whether to use intra-template matching for the current block.
[0163] The video decoding device checks the template matching flag (S1402).
[0164] If the template matching flag is true (Yes in S1402), the video decoding device performs the following steps.
[0165] The video decoding device generates a prediction block of the current block based on template matching (S1404).
[0166] The video decoding device predicts the current block using template matching according to a preset order (e.g., z-scan order) based on the current block encoded in a template matching-based prediction mode. The video decoding device searches for a matching block based on template matching between the templates of reference blocks within the search region and the template of the current block, and determines the predicted block of the current block as the searched matching block.
[0167] The video decoding device decodes the template matching filter flag (S1406). Here, the template matching filter flag indicates whether filtering is applied to a prediction block based on template matching.
[0168] The video decoding device checks the template matching filter flag (S1408).
[0169] If the template matching filter flag is true (Yes in S1408), the video decoding device performs the following steps.
[0170] The image decoding device determines the shape of the filter using the intra mode information of the current block (S1410).
[0171] Meanwhile, when two or more filter types are used for filtering prediction blocks according to template matching, the image decoding device additionally decodes the indexes of the filters used.
[0172] The image decoding device calculates the coefficients of the filter (S1412).
[0173] The video decoding device derives filter coefficients using a regression model that minimizes the MSE between template samples of the matching block and samples in the template of the current block.
[0174] The video decoding device applies filtering to the prediction block using the determined filter (S1414). The video decoding device applies filtering to the prediction block according to template matching to generate a filtered prediction block.
[0175] Additionally, when two filters are determined, the image decoding device performs filtering of the prediction block using the two filters, thereby generating two filtered prediction blocks. Thereafter, the image decoding device weights the values of the output prediction blocks using preset weights, thereby generating a final prediction block.
[0176] If the template matching filter flag is false (No in S1408), the video decoding device does not perform filtering of the prediction block according to template matching.
[0177] If the range condition is not satisfied or the template matching flag is false (No in S1402), the video decoding device generates a prediction block of the current block using a prediction mode other than template matching (S1430). For example, intra prediction mode or inter prediction may be used instead of template matching.
[0178] Thereafter, the image decoding device decodes the quantized transform coefficients and then applies inverse quantization / inverse transformation to the quantized transform coefficients to generate a residual block. The image decoding device can generate a restoration block of the current block by adding the residual block and a prediction block according to the template matching flag and template matching filter flag.
[0179] 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.
[0180] 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.
[0181] 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).
[0182] 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.
[0183] (Explanation of symbols)
[0184] 122: Intra prediction unit
[0185] 155: Entropy decryption unit
[0186] 510: Entropy decryption unit
[0187] 542: Intra prediction unit
[0188]
[0189] CROSS-REFERENCE TO RELATED APPLICATION
[0190] This patent application claims priority to Korean patent application No. 10-2023-0047296, filed in Korea on April 11, 2023, and Korean patent application No. 10-2024-0011013, filed in Korea on January 24, 2024, the entire contents of which are incorporated herein by reference.
Claims
1. A method for restoring a current block performed by a video decoding device, A step of searching for a matching block based on template matching between templates of reference blocks in a search area and a template of the current block, and determining a prediction block of the current block with the searched matching block; A step of decoding a template matching filter flag from a bitstream, wherein the template matching filter flag indicates whether filtering is applied to a prediction block according to the template matching; and Steps to check template matching filter flags Including, If the above template matching filter flag is true, A step of determining the shape of a filter using the intra mode information of the current block; and A step of applying the filtering to the prediction block using the filter. A method, characterized by including:
2. In paragraph 1, A step of decoding a template matching flag, wherein the template matching flag indicates whether to use the template matching for the current block; and Step for checking the above template matching flag Including, A method characterized in that a step of determining a prediction block of the current block is performed when the above template matching flag is true.
3. In paragraph 1, The form of the above filter is, A method characterized in that it is a cross filter, a horizontal filter, a vertical filter, or a diagonal filter.
4. In paragraph 1, The step of determining the shape of the above filter is: A method characterized in that the shape of the filter is determined according to a group including the intra prediction mode of the current block among N (where N is a positive integer) prediction mode groups.
5. In paragraph 4, The step of determining the shape of the above filter is: A method characterized in that when the above prediction mode group includes a horizontal prediction mode and a vertical prediction mode, the form of the filter is determined as a horizontal filter or a vertical filter.
6. In paragraph 4, The step of determining the shape of the above filter is: A method characterized in that when the above prediction mode group includes a diagonal prediction mode, the form of the filter is determined as a diagonal filter.
7. In paragraph 4, The step of determining the shape of the above filter is: A method characterized in that the shape of the filter is determined as a cross filter when the above prediction mode group includes directional modes excluding a horizontal prediction mode, a vertical prediction mode, and a diagonal prediction mode.
8. In paragraph 4, The step of determining the shape of the above filter is: A step of checking the intra prediction mode of a block including a block of a preset size existing at the upper left of the above prediction block; and A step of determining the form of the filter according to the prediction mode group including the above prediction mode. A method, characterized by including:
9. In paragraph 4, The step of determining the shape of the above filter is: A step of checking the intra prediction mode of a block including a block of a preset size existing in the center of the above prediction block; and A step of determining the form of the filter according to the prediction mode group including the above prediction mode. A method, characterized by including:
10. In paragraph 4, The step of determining the shape of the above filter is: A step of generating an MPM list of the current block; A step of selecting a directional prediction mode having the smallest index among the above MPM list; and A step of determining the form of the filter according to a prediction mode group including the above directional prediction mode. A method, characterized by including:
11. In paragraph 4, The step of determining the shape of the above filter is: A step of generating an MPM list of the current block; A step of selecting two directional prediction modes having the smallest index and the second smallest index among the above MPM list; and A step of determining the form of the filter according to the prediction mode group including each directional prediction mode. A method, characterized by including:
12. In paragraph 11, A step of applying filters corresponding to the above two directional prediction modes to the prediction block to generate two filtered prediction blocks; and A step of generating a final prediction block by weighting the above two filtered prediction blocks. A method, characterized in that it further comprises:
13. In paragraph 1, A method characterized by further comprising a step of calculating coefficients of the filter using a regression model that minimizes the MSE (Mean Square Error) between samples in the template of the matching block and samples in the template of the current block.
14. In paragraph 13, The step of calculating the coefficients of the above filter is: A step of decoding indices of reference lines from the bitstream, wherein the indices indicate reference lines used to calculate coefficients of the filter; and A method characterized in that the coefficients of the filter are calculated by using samples within the reference lines indicated by the indices within the template of the matching block and the template of the current block.
15. In paragraph 1, The step of determining the shape of the above filter is: A step of checking the gradient characteristics of the current block using a gradient filter; and A step of determining the shape of the filter according to the above gradient characteristics. A method, characterized by including:
16. A method for encoding a current block performed by a video encoding device, A step of generating a first prediction block of the current block using a prediction mode that does not utilize template matching; A step of searching for a matching block based on template matching between templates of reference blocks in a search area and a template of the current block, and determining a second prediction block of the current block as the searched matching block; A step of determining the shape of a filter using the intra mode information of the current block; and A step of applying the filtering to the second prediction block using the filter to generate a filtered second prediction block. A method, characterized by including:
17. In paragraph 16, A step of determining a template matching flag based on the first prediction block, the second prediction block, and the filtered second prediction block, wherein the template matching flag indicates whether to use the template matching for the current block; a step of encoding the above template matching flag; and Step for checking the above template matching flag A method characterized by further comprising:
18. In paragraph 17, If the above template matching flag is true, A step of determining a template matching filter flag based on the second prediction block and the filtered second prediction block, wherein the template matching filter flag indicates whether to apply filtering to the prediction block according to the template matching; and Step of encoding the above template matching filter flag A method, characterized in that it further comprises:
19. A computer-readable recording medium storing a bitstream generated by an image encoding method, wherein the image encoding method comprises: A step of generating a first prediction block of a current block using a prediction mode that does not utilize template matching; A step of searching for a matching block based on template matching between templates of reference blocks in a search area and a template of the current block, and determining a second prediction block of the current block as the searched matching block; A step of determining the shape of a filter using the intra mode information of the current block; and A step of applying the filtering to the second prediction block using the filter to generate a filtered second prediction block. A recording medium, characterized by including:
Citation Information
Patent Citations
Methods and apparatus for adaptive template matching prediction for video encoding and decoding
KR101839629B1
Electrospining Gun
KR1020200095803A
Apparatus for improving roasting coffee bean
KR1020230001709A
Automatic gene analysis apparatus and its operation method
KR102276191B1
