Encoding and decoding methods, bitstreams, encoders, decoders, and storage media

By fusing IntraTMP technologies like multiple candidates and filtering, the method improves prediction accuracy and efficiency in video encoding/decoding, addressing deviations in existing Intra TMP methods.

JP2026513444APending Publication Date: 2026-04-27GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2023-03-30
Publication Date
2026-04-27

Smart Images

  • Figure 2026513444000001_ABST
    Figure 2026513444000001_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an encoding and decoding method, a bitstream, an encoder, a decoder, and a storage medium, which decode the relevant syntactic elements of the current block, decide to predict the current block using an IntraTMP fusion intra-prediction mode based on the relevant syntactic elements, determine the matching block of the current block based on a template matching prediction mode, determine the first predicted block of the current block based on the matching block, determine the second predicted block of the current block based on a non-template matching intra-prediction mode, fuse the first and second predicted blocks to determine the final predicted block of the current block. In this way, encoding and decoding the relevant syntactic elements indicates whether to predict the current block using an IntraTMP fusion intra-prediction mode, thereby improving prediction efficiency. At the same time, the IntraTMP fusion intra-prediction mode combines IntraTMP techniques such as IntraTMP multiple candidate, IntraTMP multiple matching block fusion, and IntraTMP filtering to adapt to more encoding and decoding scenarios and ensure prediction accuracy and encoding and decoding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of video encoding and decoding, and in particular, to encoding and decoding methods, bitstreams, encoders, decoders, and storage media.

Background Art

[0002] The Intra Template Matching Prediction (Intra TMP) technology searches for a matching template with the minimum cost according to a preset cost function within a predefined search range in the current image by means of the template of the encoding block, uses the reconstruction block corresponding to the matching template as the matching block, and uses it as the prediction block of the current encoding block.

[0003] However, in the actual encoding process, in related technologies, usually, the reconstructed pixels of the matching block are directly used as the predicted pixels of the current encoding block. Due to insufficient consideration, there are large deviations in some scenarios, resulting in a decrease in prediction accuracy.

Summary of the Invention

Means for Solving the Problems

[0004] This application provides an encoding and decoding method, a bitstream, an encoder, a decoder, and a storage media, which can improve the prediction accuracy and further improve the encoding and decoding performance.

[0005] The technical solution of this application can be realized as follows.

[0006] In a first aspect, an embodiment of this application provides a decoding method applied to a decoder. The decoding method includes The current block is decoded, wherein the relevant syntactic elements are used to indicate whether to predict the current block using an IntraTMP fused intra-prediction mode based on intra-template matching prediction. Based on the aforementioned related syntactic elements, it is decided to make a prediction for the current block using the IntraTMP fused intra prediction mode, Based on the prediction mode of template matching, the matching block of the current block is determined, and based on the matching block, the first predicted block of the current block is determined. Based on the non-template matching intra-prediction mode, determine the second predicted block of the current block, This includes fusing the first prediction block and the second prediction block to determine the final prediction block of the current block.

[0007] In a second aspect, embodiments of the present application provide an encoding method applicable to an encoder, the encoding method being: Based on the prediction mode of template matching, the matching block of the current block is determined, and based on the matching block, the first predicted block of the current block is determined. Based on the non-template matching intra-prediction mode, determine the second predicted block of the current block, The first prediction block and the second prediction block are merged to determine the final prediction block of the current block, The current block's final predicted block and the original block are used to make an encoding decision, and it is decided whether to use the IntraTMP fused intra-prediction mode to predict the current block. This includes encoding the relevant syntactic elements of the current block and writing the resulting encoded bits to a bitstream, The aforementioned related syntactic elements are used to indicate whether to predict for the current block using the IntraTMP fused intra prediction mode based on intra template matching prediction.

[0008] In a third aspect, an embodiment of the present application provides a bitstream, which is generated by bit encoding based on encoding pending information, and the encoding pending information is The syntax includes at least one of the following: a syntax element indicating whether to allow prediction using the IntraTMP fusion intra-prediction mode for the current block; a syntax element indicating whether to predict using the IntraTMP fusion intra-prediction mode for the current block; a syntax element indicating whether to filter the first matching block; a syntax element for filtering the prediction blocks of the current block; a syntax element indicating the index value of the first matching block in the candidate matching block list; a syntax element indicating the index value of the first candidate matching block group in the candidate matching block list; a syntax element indicating the intra-prediction mode for non-template matching; a syntax element indicating whether to decode the associated syntax elements of the current block; the number of matching blocks in the candidate matching block group; a value N for the number of matching blocks when fusing multiple matching blocks; the length of the first candidate matching block list; and the length of the second candidate matching block list.

[0009] In a fourth aspect, an embodiment of the present application provides an encoder comprising a first prediction unit, a first decision unit, and an encoding unit. The first prediction unit is configured to determine the matching block of the current block based on the prediction mode of template matching, and to determine the first prediction block of the current block based on the matching block. The first prediction unit is configured to determine the second prediction block of the current block based on a non-template matching intra-prediction mode. The first prediction unit is configured to merge the first prediction block and the second prediction block to determine the final prediction block of the current block. The first decision unit is configured to make an encoding decision based on the final predicted block and the original block of the current block, and to decide whether to use the IntraTMP fused intra-prediction mode to predict the current block. The encoding unit is configured to encode the relevant syntactic elements of the current block and write the resulting encoded bits to a bitstream. The aforementioned related syntactic elements are used to indicate whether to predict for the current block using the IntraTMP fused intra prediction mode based on intra template matching prediction.

[0010] In a fifth aspect, an embodiment of the present application provides an encoder comprising a first memory and a first processor, The first memory is used to store computer programs that can be executed by the first processor. The first processor is used to perform the method according to the second embodiment when executing a computer program.

[0011] In a sixth aspect, an embodiment of the present application provides a decoder comprising a decoding unit, a second determination unit, and a second prediction unit. The decoding unit is configured to decode the relevant syntactic elements of the current block, where the relevant syntactic elements are used to indicate whether to predict the current block using an IntraTMP fused intra-prediction mode based on intra-template matching prediction. The second decision unit is configured to decide, based on the associated syntactic elements, to make a prediction for the current block using the IntraTMP fused intra-prediction mode. The second prediction unit is configured to determine the matching block of the current block based on the prediction mode of template matching, and to determine the first prediction block of the current block based on the matching block. The second prediction unit is further configured to determine the second prediction block of the current block based on an intra-prediction mode of non-template matching. The second prediction unit is further configured to merge the first prediction block and the second prediction block to determine the final prediction block of the current block.

[0012] In the seventh aspect, an embodiment of the present application provides a decoder, the encoder including a second memory and a second processor, The second memory is used to store computer programs that can be executed by the second processor. The second processor is used to perform the method according to the first embodiment when executing a computer program.

[0013] In the eighth aspect, an embodiment of the present application provides a computer-readable storage medium in which a computer program is stored, and when the computer program is executed, the method described in the first aspect or the method described in the second aspect is implemented.

[0014] In the embodiments of the present application, an encoding and decoding method, a bitstream, an encoder, a decoder, and a storage medium are provided. The related syntax elements of the current block are decoded, and based on the related syntax elements, it is determined to predict the current block using the IntraTMP fusion intra prediction mode. Based on the prediction mode of template matching, the matching block of the current block is determined. Based on the matching block, the first prediction block of the current block is determined. Based on the non-template matching intra prediction mode, the second prediction block of the current block is determined. The first prediction block and the second prediction block are fused to determine the final prediction block of the current block. In this way, by encoding and decoding the related syntax elements, it is indicated whether to use the IntraTMP fusion intra prediction mode for the current block, and the prediction efficiency is improved. At the same time, the IntraTMP fusion intra prediction mode combines IntraTMP technologies such as IntraTMP multiple candidates, IntraTMP multiple matching block fusion, and IntraTMP filtering, and adapts to more encoding and decoding scenarios, ensuring prediction accuracy and encoding and decoding efficiency.

Brief Description of the Drawings

[0015] [Figure 1] It is a schematic diagram of the prediction process of the Intra TMP technology. [Figure 2] It is a schematic diagram of the matching block of the Intra TMP technology. [Figure 3] It is a schematic diagram of the template type of the Intra TMP technology. [Figure 4A] It is a schematic diagram of the rough search process of template matching in the Intra TMP technology. [Figure 4B] It is a schematic diagram of the detailed search process of template matching in the Intra TMP technology. [Figure 5] It is a schematic diagram of the weighted fusion of the Intra TMP fusion prediction technology. [Figure 6A] It is a schematic diagram of the filter shape. [Figure 6B] This is a schematic diagram of the method for deriving filter coefficients. [Figure 7] This is a schematic diagram of the vertical and horizontal partitioning schemes for coding blocks. [Figure 8A] This is a schematic diagram of the encoder configuration block diagram according to an embodiment of the present invention. [Figure 8B] This is a schematic diagram of the configuration block diagram of the decoder according to the embodiment of the present invention. [Figure 9] This is a schematic diagram of the network architecture of the encoding and decoding system according to the embodiment of the present invention. [Figure 10] This is a schematic flowchart of the decoding method according to the embodiment of the present invention. [Figure 11] This is a schematic flowchart of the method for resorting matching blocks in the embodiment of the present invention. [Figure 12] This is a schematic diagram of the template prediction method for the intra-prediction mode in the embodiment of the present invention. [Figure 13] This is a schematic diagram of the template weighting fusion process in the embodiment of the present invention. [Figure 14] This is a schematic flowchart of the intra-prediction mode resorting method according to the embodiment of the present invention. [Figure 15] This is a schematic flowchart of the method for determining the first candidate matching block group in the embodiment of the present invention. [Figure 16] This is a schematic flowchart of the encoding method according to the embodiment of the present invention. [Figure 17] This is a schematic diagram of the encoder according to the embodiment of the present invention. [Figure 18] This is a schematic diagram of the specific hardware structure of the encoder according to the embodiment of the present invention. [Figure 19] This is a schematic diagram of the decoder according to the embodiment of the present invention. [Figure 20] This is a schematic diagram of the specific hardware structure of the decoder according to the embodiment of the present invention. [Figure 21] This is a schematic diagram of the coding and decoding system according to an embodiment of the present invention. [Modes for carrying out the invention]

[0016] In order to provide a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments will be described in detail below with reference to the drawings. The attached drawings are not intended to limit the embodiments of this application, but are for reference and explanatory purposes only.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as those generally understood by those skilled in the art. The terms used herein are not intended to limit this application, but merely to describe the embodiments thereof.

[0018] Regarding the “Several Embodiments” described below, a subset of all possible embodiments is described, but it is understandable that “Several Embodiments” may be the same subset or different subsets of all possible embodiments, and can be combined with each other as long as they do not contradict each other. Furthermore, it should be noted that the terms “First / Second / Third” used in the embodiments of this application merely distinguish similar objects and do not represent a particular order of objects, and it is understandable that “First / Second / Third” may be replaced with a particular order or sequence if permitted, so that the embodiments of this application described herein may be carried out in an order other than that illustrated or described herein.

[0019] Before describing the embodiments of this application in more detail, we will first explain the nouns and terms relating to the embodiments of this application, which shall be interpreted as follows.

[0020] Coding Block (CB) Block Matching (BM) Coding Unit (CU) Block vector (BV), Sum of Absolute Difference (SAD) Sum of Absolute Transformed Difference (SATD) Mean Squared Error (MSE), Sum of Squared Differences (SSD) Mean Absolute Deviation (MAD) Mean Squared Deviation (MSD), Normalized Correlation Coefficient (NCC) Rate Distortion Optimization (RDO), H.266 / Versatile Video Coding (VVC) VVC Reference Software Test Platform (VTM: VVC Test Model) Intra Template Matching Prediction (Intra TMP) Beyond VVC's reference software test platform (ECM: Enhanced Compression Model) In video images, it can generally be understood that the first, second, and third color components are used to represent encoded blocks. Here, these three color components are the luminance component, the blue difference component, and the red difference component, respectively. Specifically, the luminance component is usually represented by the symbol Y, the blue difference component by the symbol Cb or U, and the red difference component by the symbol Cr or V. In this way, video images can be represented in YCbCr format or in YUV format.

[0021] 1)Intra TMP technology IntraTMP technology is a specialized intra-predictive coding technique, abbreviated as IntraTMP technology, and is a specialized intra-predictive coding tool primarily applied to screen content coding. IntraTMP is mainly implemented through the following process: A portion of the reconstructed pixels adjacent to the current coding block are selected as a template, the most similar template is searched for within the reconstructed region of the given current frame, the reconstructed block corresponding to the most similar template is designated as the matching block, and this is used as the prediction block for the current coding block. Here, typically, the reconstructed region adjacent to the current coding block is selected as the template for the coding block.

[0022] As an example, using the reconstructed region adjacent to the current block as an example, the reconstructed region is represented by a grid-filled area as shown in Figure 1. In the reconstructed region, R1, R2, R3, and R4 are search regions, and a matching block is found by sequentially searching R1 to R4. The adjacent region of the current block is the first template (T), and the adjacent region of the matching block (which may also be called the "reference block") is the second template (i.e., the "reference template" or "matching template," T_BEST). As shown in Figure 2, both the encoder and decoder search within a predefined search range in the current image using the template (T) of the encoded block, and determine the matching template (T_BEST) with the smallest template error value. Then, the reconstructed block (Ref Block) corresponding to the matching template is used as the predicted block for the current encoded block (Cur Block). The similarity between templates is represented by the magnitude of the template error value, and the smaller the template error value, the higher the similarity. In the embodiments of this application, the template error values ​​may be, but are not limited to, the sum of absolute difference values ​​SAD, the sum of absolute difference values ​​SATD, the mean squared error MSE, the sum of squared errors SSD, the mean absolute deviation MAD, the mean squared deviation MSD, the normalized correlation coefficient NCC, etc.

[0023] As an example, using the sum of absolute differences and SAD as an example, the error value of the template in this case is as follows:

[0024]

number

[0025] It should be explained that the Intra TMP technology uses adjacent reconstructed pixels of the current block as templates to search for matching templates within a predefined search area, where adjacent reconstructed pixels may be the upper reference pixels, upper left reference pixels, upper right reference pixels, left reference pixels, and lower left reference pixels of the current block, and so on. Therefore, template types can be classified based on the availability of adjacent reconstructed pixels, and the corresponding template type can be determined.

[0026] Furthermore, it should be explained that template types can be represented using refTemplateType. Figure 3 shows a schematic diagram of template types in Intra TMP technology. As shown in Figure 3, the grid-filled blocks are the current blocks, and the adjacent regions of the current blocks are template T, where six template types are shown.

[0027] For example, these six template types are as follows:

[0028] When the upper-left reference pixel, upper reference pixel, and left reference pixel are all available, the value of refTemplateType is 1, and the template shape is as shown in (a) in Figure 3.

[0029] When only the left reference pixel is available, the value of refTemplateType is 2, and the template shape is as shown in Figure 3(b).

[0030] When only the upper reference pixel is available, the value of refTemplateType is 3, and the template shape is as shown in (c) in Figure 3.

[0031] When only the left-side reference pixel and the upper-left-side reference pixel are available, the value of refTemplateType is 4, and the template shape is as shown in (d) in Figure 3.

[0032] When only the left-side reference pixel and the lower-left-side reference pixel are available, the value of refTemplateType is 5, and the template shape is as shown in (e) in Figure 3.

[0033] When only the upper and upper right reference pixels are available, the value of refTemplateType is 6, and the template shape is as shown in (f) in Figure 3.

[0034] Intra TMP technology, the codec uses the flag intra_tmp_flag to indicate whether the current encoded block is encoded using Intra TMP mode. If so, the decoding side performs the same template matching process to obtain the same predicted block and does not need to additionally encode block vector information from the current encoded block to the matching block. The following provides an example to illustrate Intra TMP technology.

[0035] 2) IntraTMP adaptive technology for camera-captured content The IntraTMP adaptation for camera-captured content technology is based on conventional IntraTMP technology and performs template matching with a step size S (i.e., every S points in the horizontal and vertical directions, S>1) (as shown in Figure 4A). For example, in the search area, instead of searching for matching blocks point by point according to a raster scan, the search area is performed every few points in the horizontal and vertical directions. For example, if the block vector currently being template-matched is (X0, Y0), the next block vector to be template-matched should be (X0+S, Y0), and the vertical coordinate of the block vector to be template-matched in the next row should be Y0+S. After template matching is complete, the optimal matching block is optimized within a certain range (as shown in Figure 4B, performing template matching with a smaller step size S'), and the matching result is optimized. This technology effectively reduces the complexity of the IntraTMP mode while maintaining excellent encoding efficiency. 3) Multiple candidate technologies for IntraTMP The IntraTMP multiple candidate technique obtains N candidate matching blocks in the reference region through a template matching process, in other words, constructs a candidate block list of length N, where the candidate matching blocks in the list may be sorted based on the magnitude of the template error value with the current block. A candidate block in the list is selected as the final predicted block by index. For a coded block using the IntraTMP multiple candidate technique, after decoding the true IntraTMP flag intra_tmp_flag, intra_tmp_idx is subsequently decoded, and the intra_tmp_idx syntactic element may represent the index of the selected candidate block.

[0036] intra_tmp_flag if(intra_tmp_flag) { intra_tmp_idx} As an example, the template matching process for constructing a candidate blocklist is as follows:

[0037] In the first step, the first search is performed with a fixed step size, for example, both the horizontal and vertical step sizes are 4. N optimal matching blocks with a fixed interval (the N blocks prior to the one with the minimum template error value) are obtained.

[0038] In the second step, a second search is performed in the adjacent regions of the N matching blocks obtained in the first step. These adjacent regions may be set as multiple non-overlapping regions based on the step size in the first step. From these regions, M optimal matching blocks (which may include the matching blocks obtained in the first step) are obtained.

[0039] The same construction process is used on both the encoding and decoding sides to obtain a matching candidate blocklist.

[0040] Intra_tmp_idx can use fixed-length or variable-length coding, for example, truncated binary coding.

[0041] One variable-length coding scheme is as follows:

[0042] The smaller the index (the smaller the intra_tmp_idx value), the smaller the template error value of the corresponding candidate block, and the higher the probability of statistical selection. A smaller intra_tmp_idx value also allows for shorter codewords. For example, [Table 1] If the maximum value N of intra_tmp_idx is relatively large, codewords of the same length can be assigned to a relatively large intra_tmp_idx. For example, N is 15. [Table 2] In the table above, x can be obtained as a truncated binary.

[0043] 4) IntraTMP Fusion Prediction Technology (also known as IntraTMP Multiple Matching Block Fusion Technology) Intra-template matching allows us to obtain template error values ​​for reconstructed blocks at different locations and for the current encoded block. These reconstructed blocks can be represented by block vectors pointing from the current encoded block to the reconstructed blocks. In the template matching process, a candidate block vector list is constructed to record block vectors with smaller template error values. Based on conditions such as the spacing between block vectors and the template error value, one or more block vectors are selected from the candidate block vector list, and the reconstructed blocks they point to are designated as matching blocks for the current encoded block. A weight value is determined for each matching block, and weighted fusion is performed on these matching blocks based on the weight values ​​to obtain the final predicted blocks, thereby realizing IntraTMP combinatorial fusion prediction. This process is shown in Figure 5.

[0044] The number of matching blocks to be merged may be a fixed value, or it may be determined based on the relative magnitudes of the template error values ​​of each matching block. For example, for N available matching blocks, a threshold Threshold = minSAD << 1 can be set, where minSAD is the minimum value among the template error values ​​of these matching blocks. Only matching blocks with template error values ​​less than or equal to the threshold will be used in the merging process. This method allows for the determination of matching blocks for merging.

[0045] After determining the matching blocks for fusion, the weights of each matching block can be determined based on methods such as using pre-set fixed values, calculating based on template error values, and template derivation methods.

[0046] 5) IntraTMP filtering Matching blocks (also called reference blocks) obtained through intra-template matching are typically used directly as prediction blocks in the current block. Filtering can be applied to the prediction blocks to improve their prediction effectiveness. Block-level flags can be used to indicate whether the filtering process is applied to the prediction blocks in the current block.

[0047] There are multiple possible filter formats, and one possible filter format is as follows:

[0048] PredC = c0C + c1N + c2S + c3E + c4W + c5B Here, as shown in Figure 6A, C is the pixel to be filtered, N is the pixel above it, S is the pixel below it, W is the pixel to its left, and E is the pixel to its right. B (Bias) is a fixed value, for example, B is the median of the pixel range. c0 to c5 are the filter coefficients.

[0049] One method for determining filter coefficients is to train them using a template of the reference block and a template of the current block. For example, the template region is the reconstructed region of the current block, consisting of the top four rows and the left four columns. For the reference block, an additional row of regions on the top, bottom, left, and right sides of the template region is also needed as a reference. As shown in Figure 6B, if part of the additional region is not encoded, it can be copied from the template region.

[0050] One way to train filter coefficients is to calculate a set of coefficients such that the template error error between the filtered reference block template and the current block template is minimized.

[0051] If the current block uses IntraTMP filtering, it filters the predicted block directly obtained based on the reference block. One method is to filter each pixel from left to right and top to bottom, and use the filtered value as the predicted value.

[0052] 6) IntraTMP fusion via template derivation IntraTMP fusion prediction can obtain multiple reference blocks through an intra-template matching process and perform weighted fusion on these reference blocks. Weight values ​​are typically obtained using predefined fixed values ​​or calculated based on the error of each reference block template. The IntraTMP fusion method using template derivation trains weights for fusion prediction based on each reference block template and the current block template, using a method similar to training filter coefficients. For example, a weighted fusion using five reference blocks is performed in the following format:

[0053]

number

[0054] 7) Template-based intra-mode derivation technique Template-Based Intra-Mode Derivation (TIMD) is a technique that uses an L-shaped partially reconstructed pixel adjacent to the current coded block as a template, traverses the MPM list, and calculates the predicted pixels of the template region in different intra-prediction modes. The template error values ​​between the predicted and reconstructed pixels in different intra-prediction modes are obtained and expressed as the Sum of Absolute Transformed Difference (SATD). The optimal intra-prediction mode is selected based on the template error values. On the decoding side, the intra-prediction mode is obtained using the same derivation method, thereby reducing the coded bits of mode information.

[0055] 8) Intra- and Inter-prediction coupling techniques The Combined Inter and Intra Prediction (CIIP) technique combines intra and inter predictions, using a weighted combination of intra-predicted blocks and inter-predicted blocks to obtain the predicted block for the current coded block. In ECM, CIIP is combined with template-based prediction techniques to further improve prediction accuracy by simultaneously assigning different weights to different regions. Specifically, the intra-predicted block pred_intra is obtained in TIMD mode, and the inter-predicted block pred_inter is obtained in template-based Merge mode. Based on the derived intra-predicted mode and the position of the pixel to be predicted, the weight values ​​wIntra and wInter are determined. The final predicted block Pred is calculated as follows:

[0056] Pred=(wIntra×pred_intra+wInter×pred_inter+4)>>3 Here, wIntra and wInter are determined by the intra prediction mode intra_dir derived by TIMD. The ECM has 65 intra angle prediction modes (2 ≤ intra_dir ≤ 66), where if 2 ≤ intra_dir < 34, the current coded block is divided vertically into four equal parts, and if 34 ≤ intra_dir ≤ 66, the current coded block is divided horizontally into four equal parts. The weight values ​​wIntra and wInter for each region are as follows: [Table 3] When divided into four equal parts vertically or horizontally, the index of each region is as shown in Figure 7. In particular, if intra_dir is equal to 0 or 1, it is not divided into sub-regions, and wIntra and wInter are selected from (3,1), (2,2), and (1,3) based on the encoding type (intra or inter) of the two encoding blocks located on the left and above.

[0057] 9) IntraTMP Fusion Intra Prediction The IntraTMP fusion intra-prediction mode obtains one matching block through intra-template matching, and then fuses it with another intra-prediction block to generate a prediction block for the current encoded block. Specifically, the matching block for the current encoded block is obtained as prediction block 1 through intra-template matching, prediction block 2 for the current encoded block is obtained through an intra-prediction mode other than IntraTMP, the weight values ​​of prediction block 1 and prediction block 2 are determined, and these prediction blocks are weighted and fused based on their weight values ​​to obtain the final prediction block, thereby realizing IntraTMP combined fusion prediction. Whether or not to use this fusion prediction mode can be indicated by a block-level flag.

[0058] Here, the intra-prediction mode can be derived by methods such as TIMD, and the weighted fusion process can use weight values ​​related to the intra-angle and pixel position, similar to the fusion process of the CIIP method, thereby further improving prediction accuracy.

[0059] 10) Intrablock Copy Technology Intra Block Copy (IBC) is an intra-prediction technique that obtains predicted pixels based on block matching. Similar to inter-prediction, prediction is achieved by a block vector pointing from the current block to a reference block. The difference is that while the reference block in inter-prediction is from an encoded reconstructed frame, the reference block in IBC is from a reconstructed portion of the current frame. Since the block vector information needs to be transmitted as a bitstream, IBC-AMVP mode and IBC-Merge mode exist, similar to intra-prediction.

[0060] The IBC-AMVP mode obtains a predicted block vector from a constructed list of candidate block vectors, and then uses processes such as hash search and full search to obtain the reference block of the current block and the corresponding final block vector. The final block vector is encoded based on the predicted block vector, improving encoding efficiency.

[0061] The IBC-Merge mode performs predictions using a constructed list of candidate block vectors, selects the optimal block vector from the list as the final block vector using encoding processes such as SATD and RDO, and performs predictions using the reconstructed block pointed to by that vector as the reference block. Encoding efficiency is improved by encoding the index of the block vector in the list, rather than the block vector itself.

[0062] The candidate block vector list may consist of coding information such as block vectors of adjacent coded blocks, past block vectors, and average block vectors.

[0063] However, in actual coding processes, although each of the above IntraTMP technologies has its own advantages, when applied individually, they are not adequately considered, resulting in significant discrepancies in some scenarios and reduced prediction accuracy. In the embodiments of this application, by fusing multiple IntraTMP technologies, IntraTMP can be applied to a wider range of application scenarios, improving intra-prediction accuracy and further enhancing coding and decoding performance.

[0064] Referring to Figure 8A, a schematic block diagram of the encoder configuration according to an embodiment of the present invention is shown. As shown in Figure 8A, the encoder (specifically, a "video encoder") 100 may include a transform and quantization unit 101, an intra-estimation unit 102, an intra-prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image cache unit 110, etc. Here, the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC). For the input original video signal, a video coding block can be obtained by dividing it into a Coding Tree Unit (CTU). Subsequently, the video coding block is transformed by a transformation and quantization unit 101 using residual pixel information obtained after intra or interprediction, which includes converting the residual information from the pixel region to the transformation region, quantizing the resulting transformation coefficients, and further reducing the bitrate. The intraestimation unit 102 and intraprediction unit 103 are used to perform intraprediction on the video coding block; more precisely, the intraestimation unit 102 and intraprediction unit 103 are used to determine the intraprediction mode used to encode the video coding block. The motion compensation unit 104 and motion estimation unit 105 are used to perform interpredictive coding of the received video coding block for one or more blocks in one or more reference frames to provide time prediction information.Motion estimation performed by the motion estimation unit 105 is a process that generates motion vectors, which can estimate the motion of the video coding block. Subsequently, the motion compensation unit 104 performs motion compensation based on the motion vectors determined by the motion estimation unit 105. After determining the intra-prediction mode, the intra-prediction unit 103 is further used to provide the selected intra-prediction data to the coding unit 109, and the motion estimation unit 105 also transmits the calculated and determined motion vector data to the coding unit 109. The inverse transform and inverse quantization unit 106 is for the reconstruction of the video coding block, reconstructing the residual block in the pixel region. The reconstructed residual block is then processed by the filter control analysis unit 107 and the filtering unit 108 to remove block effect artifacts. The reconstructed residual block is then added to the predictability block in the frame of the decoding image cache unit 110 to generate the reconstructed video coding block. The encoding unit 109 is for encoding various encoding parameters and post-quantization conversion coefficients. In a CABAC-based encoding algorithm, the context content may be used to encode information indicating the determined intra-prediction mode based on adjacent encoding blocks and to output a bitstream of the video signal. The decoded image cache unit 110 is used to store reconstructed video encoding blocks for prediction reference. As video image encoding progresses, new reconstructed video encoding blocks are continuously generated, and all of these reconstructed video encoding blocks are stored in the decoded image cache unit 110.

[0065] Referring to Figure 8B, a schematic block diagram of the decoder configuration according to an embodiment of the present invention is shown. As shown in Figure 8B, the decoder (specifically, the "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image cache unit 206. Here, the decoding unit 201 can perform header information decoding and CABAC decoding, and the filtering unit 205 can perform deblocking filtering and SAO filtering. After the input video signal undergoes the encoding process shown in Figure 8A, it outputs a bitstream of the video signal, which is input to the decoder 200. The bitstream first passes through the decoding unit 201 to obtain the decoded conversion coefficients. The inverse transform and inverse quantization unit 202 processes these conversion coefficients to generate residual blocks in the pixel region. The intra-prediction unit 203 may be used to generate prediction data for the current video decoding block based on the determined intra-prediction mode and data from previous decoding blocks from the current frame or picture. The motion compensation unit 204 determines prediction information for the video decoding block by analyzing the motion vector and other relevant syntax elements, and uses this prediction information to generate a predictability block for the video decoding block being decoded. The decoded video block is formed by adding the residual block from the inverse transform and inverse quantization unit 202 to the corresponding predictability block generated by the intra-prediction unit 203 or the motion compensation unit 204. The decoded video signal can be filtered by the filtering unit 205 to remove block effect artifacts and improve the video quality. The decoded video block is then stored in the decoded image cache unit 206, which stores reference images for subsequent intra-prediction or motion compensation and is also used to output the video signal, i.e., to obtain the restored original video signal.

[0066] Furthermore, embodiments of the present application further provide a network architecture for an encoding and decoding system including an encoder and a decoder. Figure 9 shows a schematic diagram of the network architecture of an encoding and decoding system according to embodiments of the present application. As shown in Figure 9, the network architecture includes one or more electronic devices 13-1N and a communication network 01, where the electronic devices 13-1N can perform video interaction via the communication network 01. The electronic devices may be various types of devices with video encoding and decoding capabilities in the implementation process, and may include, but are not specifically limited to, smartphones, tablet computers, personal computers, personal digital assistants, navigators, digital phones, video phones, televisions, sensing devices, servers, etc.

[0067] It should be explained that the method of the embodiment of this application is mainly applied to the intra-prediction unit 103 shown in Figure 8A and the intra-prediction unit 203 shown in Figure 8B. In other words, the embodiment of this application can be applied not only to encoders but also to decoders, and can be applied to both encoders and decoders simultaneously, but the embodiment of this application is not specifically limited.

[0068] Furthermore, when applied to the intra-prediction unit 103, "current block" specifically refers to the coding block on which intra-prediction is currently being performed, and when applied to the intra-prediction unit 203, "current block" specifically refers to the decoding block on which intra-prediction is currently being performed.

[0069] In the embodiments of the present application, a schematic flowchart of the decoding method according to the embodiments of the present application is shown with reference to Figure 10. As shown in Figure 10, the method may include the following steps.

[0070] In step 1001, the relevant syntactic elements of the current block are decoded, where the relevant syntactic elements are used to indicate whether to predict the current block using the IntraTMP fused intra prediction mode based on intra template matching prediction.

[0071] In step 1002, based on the associated syntactic elements, it is decided to use the IntraTMP fused intra prediction mode to make a prediction for the current block.

[0072] It should be explained that the related syntactic elements are used to indicate the prediction mode of the current block, more specifically, to indicate the IntraTMP prediction mode, and more specifically, to indicate whether the prediction mode of the current block is the IntraTMP fused intra-prediction mode.

[0073] In some embodiments, the associated syntactic element includes a first syntactic element and / or a second syntactic element, wherein the first syntactic element is used to indicate whether to allow prediction for the current block using IntraTMP fused intra-prediction mode, and the second syntactic element is used to indicate whether to predict for the current block using IntraTMP fused intra-prediction mode.

[0074] In some embodiments, the associated syntactic element further includes at least one of the following: a syntactic element indicating whether to allow prediction using the IntraTMP prediction mode for the current block; a syntactic element indicating whether to predict using an IntraTMP prediction mode other than the IntraTMP fusion prediction mode for the current block; a syntactic element indicating whether to predict using an IntraTMP multiple matching block fusion prediction mode for the current block; and a syntactic element indicating whether to predict using the IntraTMP multiple candidate prediction mode for the current block. In practical applications, these syntactic elements may be one or more of block-level syntactic elements, slice-level syntactic elements, tile-level syntactic elements, image-level syntactic elements, and sequence-level syntactic elements.

[0075] It should be explained that the IntraTMP prediction mode refers to a prediction mode based on intra-template matching, and the IntraTMP fusion prediction mode can be understood as a fusion prediction mode based on intra-template matching. The IntraTMP fusion prediction mode includes the IntraTMP fusion intra-prediction mode and other IntraTMP fusion prediction modes other than the IntraTMP fusion intra-prediction mode. Illustratively, other IntraTMP fusion prediction modes are prediction modes that participate in fusion using matching blocks obtained based on template matching, such as the IntraTMP multiple matching block fusion prediction mode, the intra- and inter-combination prediction mode, and IntraTMP fusion by template derivation.

[0076] It should be explained that the value of the first syntactic element may be either a first or second numeric value, and each value of the first syntactic element is used to indicate a specific meaning. For example, if the value of the first syntactic element is a first numeric value, it is used to indicate that prediction is permitted for the current block using IntraTMP fused intra-prediction mode. Or, if the value of the first syntactic element is a second numeric value, it is used to indicate that prediction is permitted for the current block using IntraTMP fused intra-prediction mode. For example, the first numeric value may be 1 and the second numeric value may be 0.

[0077] In some examples, the first syntax element includes block-level syntax elements. In some embodiments, the first syntax element further includes at least one of slice-level syntax elements, tile-level syntax elements, image-level syntax elements, and sequence-level syntax elements.

[0078] In some examples, the second syntax element includes block-level syntax elements. In some embodiments, the second syntax element further includes at least one of slice-level syntax elements, tile-level syntax elements, image-level syntax elements, and sequence-level syntax elements.

[0079] In some embodiments, decoding the relevant syntactic elements of the current block includes decoding the first syntactic element and deciding to allow the current block to be predicted using the IntraTMP fusion intra-prediction mode if the value of the first syntactic element is a first value; decoding the second syntactic element and deciding to predict the current block using the IntraTMP fusion intra-prediction mode if the value of the second syntactic element is a first numeric value; and deciding to predict the current block using the IntraTMP multiple matching block fusion prediction mode if the value of the second syntactic element is a second numeric value.

[0080] To explain, the system decides to allow prediction for the current block using the IntraTMP fusion intra prediction mode, then decodes the second syntactic element and, based on the value of the second syntactic element, decides whether to predict for the current block using the IntraTMP fusion intra prediction mode or the IntraTMP multiple matching block fusion prediction mode. The IntraTMP multiple matching block fusion prediction and the IntraTMP fusion intra prediction are considered as two fusion prediction modes, and a block-level flag indicates which fusion prediction mode to use.

[0081] For example, one related syntactic element includes the following:

[0082] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag) { intra_tmp_intra_flag } } Here, intra_tmp_fusion_flag acts as the first syntactic element, and intra_tmp_intra_flag acts as the second syntactic element, with intra_tmp_flag being used to indicate that prediction is permitted for the current block using IntraTMP prediction mode. Decoding the IntraTMP-related syntactic elements, if intra_tmp_flag is true, it indicates that IntraTMP prediction mode will be used for the current block; further decoding intra_tmp_fusion_flag, if intra_tmp_fusion_flag is true, it indicates that prediction is permitted for the current block using IntraTMP fusion intra prediction mode; further decoding intra_tmp_intra_flag, if intra_tmp_intra_flag is true, it indicates that IntraTMP fusion intra prediction mode will be used; and if intra_tmp_intra_flag is false, it indicates that IntraTMP multiple matching block fusion mode will be used.

[0083] In some embodiments, decoding the relevant syntactic elements of the current block includes decoding the first syntactic element and deciding to allow the current block to be predicted using the IntraTMP fused intra-prediction mode if the value of the first syntactic element is a first value; decoding the second syntactic element and deciding to predict the current block using the IntraTMP fused intra-prediction mode if the value of the second syntactic element is a first numeric value; and deciding to predict the current block using the IntraTMP multiple candidate prediction mode if the value of the second syntactic element is a second numeric value.

[0084] To explain, the system decides to allow prediction for the current block using the IntraTMP fusion intra-prediction mode, further decodes the second syntactic element, and based on the value of the second syntactic element, decides whether to predict for the current block using the IntraTMP fusion intra-prediction mode or the IntraTMP multiple candidate prediction mode. The IntraTMP multiple candidate prediction mode can be understood as an IntraTMP prediction mode based on a single matching block. With IntraTMP multiple matching block fusion prediction and IntraTMP fusion intra-prediction as two fusion prediction modes, the IntraTMP multiple candidate prediction mode extends the IntraTMP fusion intra-prediction mode and indicates, by a block-level flag, whether to fuse the selected matching block with the second predicted block obtained by the intra-prediction mode. Furthermore, the selected first matching block can also be indicated by an index value.

[0085] In some embodiments, decoding the relevant syntactic elements of the current block includes determining to predict the current block using the IntraTMP multiple matching block fusion prediction mode if the value of the first syntactic element is a first value, determining to allow the current block to predict using the IntraTMP fusion intra prediction mode if the value of the first syntactic element is a second value, decoding the second syntactic element, determining to predict the current block using the IntraTMP fusion intra prediction mode if the value of the second syntactic element is a first numeric value, and determining to predict the current block using the IntraTMP multiple candidate prediction mode if the value of the second syntactic element is a second numeric value.

[0086] To explain, if the value of the first syntactic element is a first number, it is decided to predict the current block using the IntraTMP multiple matching block fusion prediction mode, that is, it is decided not to allow predicting the current block using the IntraTMP fusion intra prediction mode. The first syntactic element is used to indicate whether to allow predicting the current block using the IntraTMP fusion intra prediction mode, as well as whether to predict the current block using the IntraTMP multiple matching block fusion prediction mode. The IntraTMP multiple matching block fusion prediction mode, the IntraTMP multiple candidate prediction mode, and the IntraTMP fusion intra prediction mode are treated as three fusion prediction modes, and a block-level flag indicates which prediction mode is selected and whether to fuse the selected matching block with the second prediction block obtained by the intra prediction mode.

[0087] For example, one related syntactic element includes the following:

[0088] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag) { intra_tmp_intra_flag } } Here, if intra_tmp_flag is true, it indicates that the IntraTMP prediction mode will be used for the current block. Furthermore, decoding intra_tmp_fusion_flag, if intra_tmp_fusion_flag is true, it indicates that the IntraTMP multiple matching block fusion mode will be used for the current block. If intra_tmp_fusion_flag is false, it indicates that the single matching block prediction mode will be used for the encoded block. This can also indicate that prediction is permitted using the IntraTMP fusion intra prediction mode for the current block. Furthermore, decoding intra_tmp_intra_flag, if intra_tmp_intra_flag is true, it indicates that the IntraTMP fusion intra prediction mode will be used. If intra_tmp_intra_flag is false, it indicates that the single matching block prediction mode will be used, i.e., the IntraTMP multiple candidate prediction mode will be used.

[0089] In some embodiments, the prediction mode described above can be further integrated with IntraTMP filtering techniques. Exemplarily, the related syntactic element further includes a third syntactic element. In some embodiments, this further includes decoding the third syntactic element, where the third syntactic element is used to indicate whether to filter the first matching block or the predicted block of the current block. Exemplarily, if the value of the third syntactic element is a first number, it is decided to filter the first matching block or the predicted block of the current block. If the value of the third syntactic element is a second number, it is decided not to filter the first matching block or not to filter the predicted block of the current block.

[0090] In some embodiments, the second and third syntactic elements are decoded.

[0091] In some embodiments, it is decided to allow prediction for the current block using the IntraTMP fused intra prediction mode and decode the third syntactic element. In some embodiments, it is decided to allow prediction for the current block using the IntraTMP multiple candidate prediction mode and decode the third syntactic element.

[0092] It should be explained that the first matching block is the first matching block determined based on the prediction mode of template matching. Filtering the first matching block or the prediction block of the current block can be predetermined. Alternatively, two syntactic elements can be used to indicate whether to filter the first matching block or the prediction block of the current block, respectively. Alternatively, a syntactic element can be set for only one of them, and predetermined for the other.

[0093] For example, one related syntactic element includes the following:

[0094] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag) { intra_tmp_intra_flag intra_tmp_filter_flag } } Or, intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag) { intra_tmp_intra_flag intra_tmp_filter_flag } } Here, based on the above embodiment, if we decide to allow prediction using the IntraTMP fusion intra-prediction mode for the current block, we decode intra_tmp_filter_flag, where if intra_tmp_filter_flag is true, it means that the selected matching block will be filtered, and if intra_tmp_filter_flag is false, it means that the selected matching block will not be filtered. To elaborate, if intra_tmp_intra_flag is true, it means that the IntraTMP fusion intra-prediction mode will be used and the selected first matching block will be used for fusion intra-prediction, and if intra_tmp_intra_flag is false, it means that the selected matching block will not be fused with the intra-prediction block, and the prediction mode for a single matching block will be used, i.e., the IntraTMP multiple candidate prediction mode will be used.

[0095] In some embodiments, index information indicating which matching block in the candidate matching block list to merge with may be transmitted. The associated syntactic element further includes a fourth syntactic element. The method further includes deciding to allow the current block to be predicted using the IntraTMP fusion intra-prediction mode and decoding the fourth syntactic element, wherein the fourth syntactic element is used to indicate the index value of a first matching block in the candidate matching block list, or the fourth syntactic element is used to indicate the index value of a first candidate matching block group in the candidate matching block list.

[0096] For example, one related syntactic element includes the following:

[0097] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag){ intra_tmp_intra_flag intra_tmp_intra_idx } } Here, if intra_tmp_intra_flag is true, it indicates that the IntraTMP fusion intra-prediction mode will be used, and intra_tmp_intra_idx indicates which matching blocks will be fused with the intra-prediction blocks. If intra_tmp_intra_flag is false, it indicates that the IntraTMP multiple matching block fusion mode will be used, and intra_tmp_intra_idx indicates which candidate matching block group in the candidate matching block list will be subjected to multiple matching block fusion. intra_tmp_intra_idx may also be called intra_tmp_fusion_idx.

[0098] For example, one related syntactic element includes the following:

[0099] intra_tmp_flag If(intra_tmp_flag){ intra_tmp_fusion_flag If(!intra_tmp_fusion_flag){ intra_tmp_intra_flag intra_tmp_intra_idx } } Here, if intra_tmp_intra_flag is true, it indicates that the IntraTMP fused intra-prediction mode will be used, and intra_tmp_intra_idx indicates which matching block will be fused with the intra-prediction block. If intra_tmp_intra_flag is false, it indicates that the IntraTMP multiple candidate prediction mode will be used, and intra_tmp_intra_idx indicates which matching block will be predicted for.

[0100] In some embodiments, the first and fourth syntax elements are decoded, where the fourth syntax element is used to indicate the index value of the first matching block in the candidate matching block list, or the fourth syntax element is used to indicate the index value of the first candidate matching block group in the candidate matching block list. In some embodiments, the first matching block corresponding to the current block is saved, specifically the BV of the first matching block. In some embodiments, the index value of the first candidate matching block group corresponding to the current block is saved. In some embodiments, the preset matching blocks in the first candidate matching block group corresponding to the current block are saved as reference information for other decoded blocks.

[0101] In some embodiments, if the value of the first syntactic element is a first value, it is decided to predict the current block using the IntraTMP multiple matching block fusion prediction mode and to determine the index value of the first candidate matching block group based on the fourth syntactic element. If the value of the first syntactic element is a second value, it is decided to allow prediction of the current block using the IntraTMP fusion intra prediction mode and to decode the second syntactic element. If the value of the second syntactic element is a first numeric value, it is decided to predict the current block using the IntraTMP fusion intra prediction mode. In some embodiments, the index value of the first matching block is determined based on the fourth syntactic element. If the value of the second syntactic element is a second numeric value, it is decided to predict the current block using the IntraTMP multiple candidate prediction mode. In some embodiments, the index value of the first matching block is determined based on the fourth syntactic element.

[0102] For example, one related syntactic element includes the following:

[0103] intra_tmp_flag If(intra_tmp_flag){ intra_tmp_fusion_flag intra_tmp_flu_idx If(!intra_tmp_fusion_flag){ intra_tmp_intra_flag } } If intra_tmp_flag is true, it indicates that the IntraTMP prediction mode will be used for the current block, and intra_tmp_fusion_flag is then decoded. If intra_tmp_fusion_flag is true, it indicates that the IntraTMP multiple matching block fusion mode will be used for the current block, and intra_tmp_fusion_idx indicates which candidate matching block group in the candidate matching block list will be subjected to multiple matching block fusion. By transmitting the index value of the group, the optimal candidate matching block group can be quickly identified, improving prediction accuracy and efficiency. If intra_tmp_fusion_flag is false, it indicates that the single matching block prediction mode will be used for the encoded block, and it may also indicate that the IntraTMP fusion intra-prediction mode will be used for the current block, and intra_tmp_intra_flag is then decoded, and if intra_tmp_intra_flag is true, it indicates that the IntraTMP fusion intra-prediction mode will be used, and intra_tmp_fusion_idx indicates which matching block will be fused with the intra-prediction block. If intra_tmp_intra_flag is false, it means that the single matching block prediction mode is used, i.e., the IntraTMP multiple candidate prediction mode is used, and intra_tmp_intra_idx indicates which matching block to predict for. For example, if intra_tmp_idx is equal to i, the (i+1)th matching block in the candidate matching block list is the selected matching block, with i starting from 0 and index values ​​starting from 1. Or, if intra_tmp_idx is equal to i, the i-th matching block in the candidate matching block list is the selected matching block, with i starting from 0 and index values ​​starting from 0.

[0104] In some embodiments, the above prediction mode can be further integrated with IntraTMP filtering techniques. Exemplarily, one related syntactic element includes the following:

[0105] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag) { intra_tmp_intra_flag intra_tmp_filter_flag intra_tmp_idx } } The IntraTMP-related syntactic elements are decoded, and if intra_tmp_flag is true, it indicates that the encoded block will be encoded in IntraTMP mode, and further, intra_tmp_fusion_flag is decoded. If intra_tmp_fusion_flag is true, it is decided to use IntraTMP fusion intra-prediction mode, and further, intra_tmp_intra_flag, intra_tmp_filter_flag, and intra_tmp_idx (the order can be reversed) are decoded. Here, intra_tmp_idx represents the index of the selected matching block in the candidate matching block list. If intra_tmp_filter_flag is true, it indicates that the selected matching block will be filtered. If intra_tmp_filter_flag is false, it indicates that the selected matching block will not be filtered. If intra_tmp_intra_flag is true, it indicates that the selected matching block will be used to fuse with the intra-prediction block. If intra_tmp_intra_flag is false, it indicates that the selected matching block will not be merged with the intra prediction block.

[0106] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag) { intra_tmp_intra_flag intra_tmp_filter_flag intra_tmp_idx } } The IntraTMP-related syntactic elements are decoded, and if intra_tmp_flag is true, it indicates that the coded block will be coded in IntraTMP mode, and then intra_tmp_fusion_flag is decoded. If intra_tmp_fusion_flag is true, it indicates that the coded block will be predicted using a multiple matching block fusion method. If intra_tmp_fusion_flag is false, it indicates that the coded block will be predicted using a single matching block prediction method, which can also be understood as deciding to allow prediction using the IntraTMP fusion intra-prediction mode for the current block. Furthermore, intra_tmp_intra_flag, intra_tmp_filter_flag, and intra_tmp_idx (the order can be reversed) are decoded. Here, intra_tmp_idx represents the index of the selected matching block in the candidate matching block list. If intra_tmp_filter_flag is true, it indicates that the selected matching block will be filtered. If intra_tmp_filter_flag is false, it indicates that the selected matching block will not be filtered. If intra_tmp_intra_flag is true, it indicates that the selected matching block will be merged with the intra-prediction block. If intra_tmp_intra_flag is false, it indicates that the selected matching block will not be merged with the intra-prediction block.

[0107] In some embodiments, intra_tmp_intra_idx and intra_tmp_fusion_idx can also be decoded in different ways based on intra_tmp_intra_flag. Exemplarily, the relevant syntactic elements further include a fourth syntactic element and a fifth syntactic element. The method further includes deciding to predict the current block using the IntraTMP fusion intra prediction mode and decoding the fourth syntactic element and determining the index value of the first matching block in the candidate matching block list based on the fourth syntactic element, or deciding to predict the current block using the IntraTMP multiple matching block fusion prediction mode and decoding the fifth syntactic element and determining the index value of the first candidate matching block group in the candidate matching block list based on the fifth syntactic element. The index ranges of the index values ​​indicated by the fifth syntactic element and the fourth syntactic element may be the same or different.

[0108] For example, one related syntactic element includes the following:

[0109] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag){ intra_tmp_intra_flag intra_tmp_filter_flag if(intra_tmp_intra_flag) intra_tmp_intra_idx else intra_tmp_flu_idx } } or intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag) { intra_tmp_intra_flag intra_tmp_filter_flag if(intra_tmp_intra_flag) intra_tmp_intra_idx } else intra_tmp_flu_idx } Here, based on the above embodiment, if it is decided to use the IntraTMP fusion intra prediction mode to predict the current block, the intra_tmp_intra_idx (fourth syntactic element) is decoded, and intra_tmp_intra_idx represents the index value of the selected matching block in the candidate matching block list. If it is decided to use the IntraTMP multiple matching block fusion prediction mode, the intra_tmp_fusion_idx (fifth syntactic element) is decoded, and intra_tmp_fusion_idx represents the index value of the selected first candidate matching block group in the candidate matching block list. The ranges of the values ​​for intra_tmp_intra_idx and intra_tmp_fusion_idx may be the same or different.

[0110] In some embodiments, intra_tmp_intra_idx and intra_tmp_idx can also be decoded in different ways based on intra_tmp_intra_flag. Related syntactic elements further include a fourth syntactic element and a sixth syntactic element. The method further includes deciding to predict the current block using the IntraTMP fused intra prediction mode and decoding the fourth syntactic element and determining the index value of the first matching block in the candidate matching block list based on the fourth syntactic element, or deciding to predict the current block using the IntraTMP multiple candidate prediction mode and decoding the sixth syntactic element and determining the index value of the first matching block in the candidate matching block list based on the sixth syntactic element. The index ranges of the index values ​​indicated by the sixth syntactic element and the fourth syntactic element may be the same or different.

[0111] For example, one related syntactic element includes the following:

[0112] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag){ intra_tmp_intra_flag intra_tmp_filter_flag If(intra_tmp_intra_flag) intra_tmp_intra_idx else intra_tmp_idx } } Here, based on the above embodiment, if it is decided to predict the current block using the IntraTMP fused intra prediction mode, the fourth syntactic element is decoded, and intra_tmp_intra_idx represents the index value of the selected matching block in the candidate matching block list. If it is decided to use the IntraTMP multiple candidate prediction mode, the sixth syntactic element is decoded, and intra_tmp_idx represents the index value of the selected matching block in the candidate matching block list. The ranges of values ​​for intra_tmp_intra_idx and intra_tmp_idx may be the same or different. Exemplarily, the maximum value of the range of values ​​for intra_tmp_intra_idx is smaller than the maximum value of the range of values ​​for intra_tmp_idx, the range of values ​​for intra_tmp_intra_idx is 0 to 3, and the range of values ​​for intra_tmp_idx is 0 to 15.

[0113] In some embodiments, it is not necessary to use IntraTMP fused intra-prediction and IntraTMP filtering simultaneously. Exemplary, deciding to predict the current block using the IntraTMP fused intra-prediction mode includes deciding not to filter the first matching block or the predicted block of the current block based on the value of the third syntactic element, decoding the second syntactic element, and deciding to predict the current block using the IntraTMP fused intra-prediction mode if the value of the second syntactic element is a first numeric value.

[0114] Furthermore, the method further comprises decoding a fourth syntactic element, which is used to indicate the index value of the first matching block in the candidate matching block list.

[0115] For example, one related syntactic element includes the following:

[0116] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag){ intra_tmp_filter_flag If(!intra_tmp_filter_flag) intra_tmp_intra_flag intra_tmp_idx } } Here, based on the above embodiment, if it is decided to allow prediction using the IntraTMP fused intra prediction mode for the current block, intra_tmp_filter_flag (third syntactic element) is decoded. If intra_tmp_filter_flag is false, it means not filtering a single matching block. In this case, intra_tmp_intra_flag (second syntactic element) is decoded, and then intra_tmp_idx (fourth syntactic element) is decoded to determine the selected matching block. If intra_tmp_filter_flag is true, it means filtering a single matching block. In this case, intra_tmp_idx is decoded to determine the selected matching block. In some embodiments, if intra_tmp_filter_flag is true, it can further indicate that prediction will be made using the IntraTMP multiple candidate prediction mode. That is, based on the value of intra_tmp_filter_flag, it is decided whether to decode intra_tmp_intra_flag.

[0117] In some embodiments, it is not necessary to use IntraTMP fused intra prediction and IntraTMP filtering simultaneously. The method further includes deciding to predict the current block using the IntraTMP multiple candidate prediction mode and decoding a third syntactic element, where the third syntactic element is used to indicate whether to filter the first matching block.

[0118] Furthermore, the method further comprises decoding a fourth syntactic element, which is used to indicate the index value of the first matching block in the candidate matching block list.

[0119] For example, one related syntactic element includes the following:

[0120] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag) { intra_tmp_intra_flag If(!intra_tmp_intra_flag) intra_tmp_filter_flag intra_tmp_idx } } Here, based on the above embodiment, if it is decided to allow prediction using the IntraTMP fused intra-prediction mode for the current block, intra_tmp_intra_flag (second syntactic element) is decoded. If intra_tmp_intra_flag is false, it indicates that prediction will be made using the IntraTMP multiple candidate prediction mode. In this case, intra_tmp_filter_flag (third syntactic element) is decoded to determine whether to filter a single matching block. Furthermore, intra_tmp_idx (fourth syntactic element) is decoded to determine the selected matching block. If intra_tmp_intra_flag is true, it indicates that prediction will be made using the IntraTMP fused intra-prediction mode. In this case, intra_tmp_filter_flag is decoded based on the value of intra_tmp_intra_flag.

[0121] In some embodiments, multiple intra-prediction modes can be configured, and one particular intra-prediction mode can be indicated by transmitting syntactic elements. The associated syntactic elements further include a seventh syntactic element. The method further includes deciding to predict the current block using the IntraTMP fused intra-prediction mode and decoding the seventh syntactic element, where the seventh syntactic element is used to indicate the non-template matching intra-prediction mode to use for the current block.

[0122] For example, one related syntactic element includes the following:

[0123] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag){ intra_tmp_intra_flag If(intra_tmp_intra_flag) intra_tmp_intra_mode_idx } } or intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag){ intra_tmp_intra_flag intra_tmp_filter_flag If(intra_tmp_intra_flag){ intra_tmp_intra_idx intra_tmp_intra_mode_idx } else intra_tmp_idx } } In the IntraTMP fused intra-prediction mode, multiple intra-prediction modes can be set, including predefined intra-prediction modes, intra-prediction modes from matching blocks, and intra-prediction modes derived based on methods such as TIMD and DIMD. An intra-prediction mode is selected by transmitting an index. Based on the above embodiment, if it is decided to predict the current block using the IntraTMP fused intra-prediction mode, i.e., if intra_tmp_intra_flag is true, the seventh syntactic element (intra_tmp_intra_mode_idx) is decoded, and based on intra_tmp_intra_mode_idx, the intra-prediction mode for determining the second prediction block is determined.

[0124] In some embodiments, the relevant syntactic element includes a first syntactic element (intra_tmp_fusion_flag), and the method further includes: determining to allow the use of the IntraTMP fusion intra-prediction mode for the current block if the value of the first syntactic element is a first value; predicting in the template region of the current block using the IntraTMP fusion intra-prediction mode to determine a first predict template for the current block; determining a first template error value based on the first predict template and the template of the current block; predicting in the template region of the current block using the first IntraTMP prediction mode to determine a second predict template for the current block; determining a second template error value based on the second predict template and the template of the current block; determining to predict using the IntraTMP fusion intra-prediction mode for the current block if the minimum template error value is the first template error value; and determining to predict using the first IntraTMP prediction mode for the current block if the minimum template error value is the second template error value. Here, the first IntraTMP prediction mode includes the IntraTMP multiple matching block fusion prediction mode and / or the IntraTMP multiple candidate prediction mode.

[0125] In other words, if intra_tmp_fusion_flag is true, decoding of intra_tmp_intra_flag is unnecessary. The prediction mode to use is selected based on the template error value of the multiple matching block fusion prediction in the template region, at least one of the template error values ​​of the multiple candidate prediction in the template region, and the template error value of the fusion intra prediction in the template region.

[0126] In some embodiments, the method further includes decoding an eighth syntax element, where the eighth syntax element is used to indicate whether to decode some or all of the associated syntax elements of the current block. In some embodiments, the eighth syntax element includes at least one of sequence-level syntax elements, image-level syntax elements, tile-level syntax elements, slice-level syntax elements, or block-level syntax elements.

[0127] It should be noted that some or all of the related syntax elements can be limited by one or more syntax elements at the block level, slice level, tile level, image level, or sequence level. In other words, a corresponding 8th syntax element can be set for each syntax element of the related syntax elements, or a corresponding 8th syntax element can be set for two or more syntax elements of the related syntax elements, or a corresponding 6th syntax element can be set for all of the syntax elements of the related syntax elements. For example, if the related syntax element is a block-level syntax element, the 6th syntax element may be an image-level syntax element and / or a sequence-level syntax element.

[0128] In step 1003, the matching block of the current block is determined based on the prediction mode of template matching, and the first predicted block of the current block is determined based on the matching block.

[0129] The process involves performing template matching and constructing a list of candidate matching blocks. Within a predefined search range, possible matching blocks are searched based on a predefined search method, and a template error value corresponding to the matching block is calculated based on the template of the matching block and the template of the current block. A list of candidate matching blocks is constructed based on each matching block and its corresponding template error value. The list of candidate matching blocks can be sorted in ascending order based on the magnitude of the template error value.

[0130] As an example, the template matching process for constructing a candidate blocklist is as follows:

[0131] In the first step, the first search is performed with a fixed step size, for example, both the horizontal and vertical step sizes are 4. N optimal matching blocks with a fixed interval (the N blocks prior to the one with the minimum template error value) are obtained.

[0132] In the second step, a second search is performed in the adjacent regions of the N matching blocks obtained in the first step, and these adjacent regions may be set as multiple non-overlapping regions based on the step size in the first step. From these regions, M optimal matching blocks (which may include the matching blocks obtained in the first step) are obtained. The same construction process is used on the encoding and decoding sides to obtain a list of matching candidate blocks.

[0133] In some embodiments, determining the matching block of the current block based on the prediction mode of template matching includes constructing a first candidate matching block list for the current block based on template matching, determining a first candidate matching block group from the first candidate matching block list, and determining at least one matching block to merge from the first candidate matching block group. Correspondingly, obtaining the first predicted block of the current block based on the matching block includes merging at least one matching block in the first candidate matching block group to determine the first predicted block of the current block. That is, the IntraTMP fusion intra-prediction method combines IntraTMP multiple matching block fusion prediction schemes to determine at least one matching block of the current block, performs fusion of matching blocks, and obtains the first predicted block of the current block. In some embodiments, the first predicted block can also be obtained by filtering the fused matching blocks.

[0134] In some embodiments, determining the matching block of the current block based on the prediction mode of the template matching includes constructing a second candidate matching block list for the current block based on the template matching, and determining the first matching block from the second candidate matching block list. That is, the second candidate matching block list can be understood as a list constructed by an IntraTMP multiple candidate prediction scheme for determining a single list of matching blocks. In the IntraTMP fused intra-prediction method, the IntraTMP multiple candidate prediction schemes are combined to determine the first matching block of the current block, and a first predicted block of the current block is obtained based on the first matching block.

[0135] Correspondingly, obtaining a first predicted block of the current block based on the matching block includes filtering the first matching block and obtaining the first predicted block when deciding to make the first matching block the first predicted block or to filter the first matching block. The IntraTMP fused intra prediction method further improves prediction accuracy by combining it with an IntraTMP filtering method.

[0136] In some embodiments, determining a first matching block from the second candidate matching block list includes determining the matching block with the smallest template error from the second candidate matching block list as the first matching block, or determining the index value of the first matching block, and determining the first matching block from the second candidate matching block list based on the index value of the first matching block. In other words, the IntraTMP fused intra-prediction mode is extended by the IntraTMP multiple candidate prediction mode, a first prediction block is obtained using the selected matching block, and it is fused with the second prediction block obtained in the intra-prediction mode. By combining the IntraTMP multiple candidate prediction mode and the IntraTMP fused intra-prediction mode, prediction accuracy can be improved.

[0137] It should be explained that the length of the second candidate matching blocklist is not equal to the length of the first candidate matching blocklist. In some embodiments, the fact that the length of the second candidate matching blocklist is equal to the length of the first candidate matching blocklist can also be understood as the first candidate matching blocklist and the second candidate matching blocklist being the same candidate matching blocklist.

[0138] In some embodiments, determining a first matching block from the second candidate matching block list further includes resorting the first N matching blocks in the second candidate matching block list and determining the index values ​​of the first N matching blocks based on the resorted positions of the first N matching blocks.

[0139] Determining the first matching block from the second candidate matching block list based on the index value of the first matching block includes determining the first matching block from the second candidate matching block list based on the index value of the first matching block and the index values ​​of the first N matching blocks, where N is less than or equal to the number of matching blocks in the second candidate matching block list.

[0140] Figure 11 is a schematic flowchart of the method for resorting matching blocks in an embodiment of the present invention. As shown in Figure 11, resorting the first N matching blocks in the second candidate matching block list includes the following steps.

[0141] In step 1101, the first predicted template for the current block is determined based on the template of the i-th matching block.

[0142] In some embodiments, the template of the i-th matching block is used as the first prediction template for the current block, or the matching block templates are filtered to obtain the filtered prediction template.

[0143] In step 1102, the second predicted template for the current block is determined based on the non-template matching intra-prediction mode used for the current block.

[0144] Figure 12 is a schematic diagram of a template prediction method for an intra-prediction mode in an embodiment of the present invention. As shown in Figure 12, based on the template type of the current block, the referable pixels of the adjacent region of the template of the current block are determined, and intra-prediction other than IntraTMP is realized in the template region using these reference pixels. This intra-prediction method may be a pre-set intra-prediction mode such as Planar mode, or an intra-prediction mode derived using the template region based on a method such as TIMD.

[0145] In step 1103, the first prediction template and the second prediction template are merged to determine the final prediction template for the current block.

[0146] Figure 13 is a schematic diagram of the template weighted fusion process in an embodiment of the present invention. When the upper left reference pixel, upper reference pixel, and left reference pixel of the current block are all available, the shape of the template of the current block is as shown in Figure 13. The first prediction template of the matching block and the second prediction template of the intra prediction are fused to obtain the final prediction template of the current block. Furthermore, by comparing this prediction template with the template of the current block, the template error value of a particular prediction method can be obtained.

[0147] The first and second prediction templates are weighted and merged. For example, if the first prediction template is pred_tmp and the second prediction template is pred_intra, and the weights are wTmp and wIntra, the final prediction template Pred will be as follows:

[0148] Pred=(wTmp×pred_tmp+wIntra×pred_intra+offset)>>shift In step 1104, the template error value corresponding to the i-th matching block is determined based on the final prediction template of the current block and the template of the current block.

[0149] In step 1105, the first N matching blocks are resorted based on the template error values ​​corresponding to the first N matching blocks.

[0150] The template error values ​​SADi of the N matching blocks are rearranged in ascending order.

[0151] In some embodiments, when determining the intra-prediction mode for non-template matching to be used for the current block, template prediction is performed using the first N matching blocks in the template region, thereby calculating the predicted template corresponding to different matching blocks, calculating a template error value based on the predicted template and the template of the current block, re-sorting based on the template error value, selecting the best matching block, or selecting a smaller matching block index value and performing encoding.

[0152] In some embodiments, when deciding to filter a first matching block based on intra_tmp_filter_flag, the method further includes determining a filter coefficient for the matching block based on the template of the first matching block and the template of the current block, and filtering the first matching block based on the filter coefficient for the matching block to obtain the first predicted block. If intra_tmp_filter_flag is true, the filter coefficient is derived based on the selected matching block template and the template of the current block, and the filtering format may be as follows:

[0153] predC=c0C+c1N+c2S+c3E+c4W+c5B Here, in the filter shape shown in Figure 6A, predC is the pixel value of the current block template, C is the pixel value to be filtered within the matching block template, N is the pixel above it, S is the pixel below it, W is the pixel to its left, and E is the pixel to its right. B(Bias) is a fixed value, for example, B is the median of the pixel range. c0~c5 are filter coefficients. The matching block is filtered using the filter coefficients c0~c5 derived from the template to obtain the first prediction block. If intra_tmp_filter_flag is false, the selected matching block is used directly as the first prediction block.

[0154] In step 1004, the second predicted block of the current block is determined based on the non-template matching intra-prediction mode.

[0155] In some embodiments, the intra-prediction mode for non-template matching corresponding to the current block may be a specific intra-prediction mode predetermined by the encoding and decoding sides. For example, the intra-prediction mode for non-template matching may include one of a predefined intra-prediction mode, an intra-prediction mode for the matching block, an intra-prediction mode derived by TIMD, or an intra-prediction mode derived based on DIMD.

[0156] In some embodiments, the method further includes deciding to predict the current block using the IntraTMP fused intra-prediction mode, decoding the seventh syntactic element, and determining the intra-prediction mode for non-template matching corresponding to the current block.

[0157] In some embodiments, the non-template matching intra-prediction mode includes at least two candidate intra-prediction modes. The method further includes: resorting the at least two candidate intra-prediction modes to obtain a list of candidate intra-prediction modes and an index value for each candidate intra-prediction mode; determining the index value for a first intra-prediction mode to be used for the current frame; determining the first intra-prediction mode from the list of candidate intra-prediction modes based on the index value of the first intra-prediction mode; and setting the first intra-prediction mode as the non-template matching intra-prediction mode to be used for the current block.

[0158] In some embodiments, the optimal intra-prediction mode that minimizes the template error value is determined as the first intra-prediction mode. In some other embodiments, the seventh syntactic element is decoded to determine the intra-prediction mode for non-template matching used in the current block.

[0159] Figure 14 is a schematic flowchart of the method for resorting intra-prediction modes according to an embodiment of the present invention. As shown in Figure 14, resorting the at least two candidate intra-prediction modes includes the following steps.

[0160] In step 1401, the matching block template of the current block is set as the first predicted template of the current block.

[0161] In step 1402, the second prediction template for the current block is determined based on the i-th candidate intra prediction mode.

[0162] In step 1403, the first prediction template and the second prediction template are merged to determine the final prediction template for the current block.

[0163] In step 1404, the template error value corresponding to the i-th candidate intra prediction mode is determined based on the final prediction template of the current block and the template of the current block.

[0164] In step 1405, at least two candidate intra-prediction modes are re-sorted based on the template error values ​​corresponding to at least two candidate intra-prediction modes.

[0165] In some embodiments, when determining the matching block to be used for the current block, template prediction is performed using multiple intra-prediction modes in the template region, thereby calculating prediction templates corresponding to different intra-prediction modes, calculating template error values ​​based on the prediction templates and the current block template, re-sorting based on the template error values, selecting the best matching block, or selecting an index value for a smaller intra-prediction mode to perform encoding.

[0166] In step 1005, the first prediction block and the second prediction block are merged to determine the final prediction block for the current block.

[0167] It should be explained that the fusion weight values ​​of the first and second prediction blocks may be predefined fixed values, or they may be flexibly selected based on the characteristics of the current block.

[0168] In some embodiments, merging the first prediction block and the second prediction block to determine the final prediction block of the current block includes merging the first prediction block and the second prediction block to determine the final prediction block of the current block based on a preset first weight value and a second weight value.

[0169] In some embodiments, merging the first prediction block and the second prediction block to determine the final prediction block of the current block includes dividing the current block into four sub-regions based on an intra-prediction mode derived by TIMD, determining a first weight value and a second weight value for each of the four sub-regions of the current block, merging the first prediction block and the second prediction block based on the first and second weight values ​​for the four sub-regions of the current block to determine the final prediction block of the current block, or determining a first weight value and a second weight value for the current block based on an intra-prediction mode derived by TIMD, and merging the first prediction block and the second prediction block based on the first and second weight values ​​for the current block to determine the final prediction block of the current block.

[0170] Exemplary, the weight values ​​for prediction block 1 and prediction block 2 are determined based on the intra prediction mode derived by TIMD and the position of the target pixel. For example, the current coded block is divided based on the intra prediction mode intra_dir derived by TIMD, and different weight values ​​are set for prediction block 1 and prediction block 2 within different regions. For example, ECM has 65 intra-angle prediction modes (2 ≤ intra_dir ≤ 66), and if 2 ≤ intra_dir < 34, the current coded block is divided vertically into 4 equal parts, and if 34 ≤ intra_dir ≤ 66, the current coded block is divided horizontally into 4 equal parts. In the case of vertical or horizontal division into 4 equal parts, the index of each region is as shown in Figure 7. The weight values ​​wTMP for prediction block 1 and wIntra for prediction block 2 in each region are as follows. [Table 4] If intra_dir is equal to 0 or 1, the subregion is not partitioned, and (wIntra,wTMP) is equal to (1,3). (wIntra,wTMP) may also be equal to (3,1) or (2,2).

[0171] Prediction block 1 and prediction block 2 are weighted and merged. For example, if prediction block 1 is pred_tmp and prediction block 2 is pred_intra, and the weight values ​​are wTmp and wIntra, the final prediction block Pred will be as follows:

[0172] Pred=(wTmp×pred_tmp+wIntra×pred_intra+offset)>>shift Here, offset=1<<(shift-1), shift=log2(wIntra+wTMP) In some embodiments, when deciding to filter the predicted blocks of the current block based on intra_tmp_filter_flag, the method further includes determining filter coefficients for the predicted blocks based on the predicted template and the template of the current block, and filtering the predicted blocks of the current block based on the filter coefficients to obtain the final predicted blocks of the current block. If intra_tmp_filter_flag is true, filter coefficients are derived based on the selected predicted template and the template of the current block, and the filtering format may be as follows:

[0173] PredC = c0C + c1N + c2S + c3E + c4W + c5B Here, in the filter shape shown in Figure 6A, predC is the pixel value of the current block template, C is the pixel value to be filtered in the prediction template, N is the pixel above it, S is the pixel below it, W is the pixel to its left, and E is the pixel to its right. B(Bias) is a fixed value, for example, B is the median of the pixel range. c0~c5 are filter coefficients. Using the filter coefficients c0~c5 derived from the template, the fused prediction block is filtered to obtain the final prediction block of the current block. If intra_tmp_filter_flag is false, the fused prediction block is used directly as the final prediction block.

[0174] Furthermore, the process of making a prediction using the IntraTMP multiple matching block fusion prediction mode will be described with examples. In some embodiments, when deciding to make a prediction for the current block using the IntraTMP multiple matching block fusion prediction mode based on relevant syntactic elements, the process further includes: constructing a first candidate matching block list for the current block based on template matching; determining a first candidate matching block group from the first candidate matching block list; and fusing at least one matching block in the first candidate matching block group to determine the predicted block for the current block.

[0175] In some embodiments, determining a first candidate matching block group from the first candidate matching block list involves constituting the first N matching blocks in the first candidate matching block list into the first candidate matching block group, where N is an integer greater than 0, for example, N is 3.

[0176] Figure 15 is a schematic flowchart of the method for determining the first candidate matching block group in an embodiment of the present application. As shown in Figure 15, in some other embodiments, determining the first candidate matching block group from the first candidate matching block list includes the following steps.

[0177] In step 1501, the first candidate matching block list is grouped to determine at least two candidate matching block groups, and the index value of each candidate matching block group is determined.

[0178] Exemplary, the first candidate matching block list is grouped based on at least one grouping rule. Each grouping rule specifically defines the number of groups, the number of matching blocks in each candidate matching block group, the distance between matching blocks in each candidate matching block group, and so on. In the embodiments of the present application, the first candidate matching block list can be grouped based on one or more grouping rules to determine at least two candidate matching block groups, each of which contains at least one matching block.

[0179] In some embodiments, grouping the first candidate matching block list includes grouping the first candidate matching block list based on at least one grouping rule. Each grouping rule specifically defines the number of groups, the number of matching blocks in each candidate matching block group, the distance between matching blocks in each candidate matching block group, and so on.

[0180] In some embodiments, at least one grouping rule includes a first grouping rule, which includes setting a first preset number of matching blocks from the first candidate matching block list into a candidate matching block group, where the first preset number is an integer greater than 0, and where the first preset number is the number of matching blocks in each candidate matching block group.

[0181] The maximum length of the candidate matching block list constructed by the template matching process is N, for example, N is equal to 45. In the fusion prediction, a maximum of M matching blocks can be used for fusion, for example, M is equal to 3. The first preset number is set to 3, and based on the first grouping rule, every M matching blocks in the candidate matching block list can be set into one group, resulting in a total of N / M = 15 groups. If the total length N of the candidate matching block list is not divisible by the maximum number of fusions M, the number of matching blocks in the last group should be less than M, and the remaining matching blocks in the candidate matching block list can be added to that group. In other words, the first grouping rule further includes, if the number of matching blocks in the last candidate matching block group is less than the first preset number, taking the preset matching blocks from the first candidate matching block list and adding them to the last candidate matching block group so that the number of matching blocks in the last candidate matching block group is equal to the first preset number.

[0182] The at least one grouping rule includes a second grouping rule, the second grouping rule includes setting matching blocks in a second preset number from the first matching blocks in the first candidate matching block list into a candidate matching block group, where the second preset number is an integer greater than 0, and the first preset number and the second preset number are not equal.

[0183] The maximum length of the candidate matching block list constructed by the template matching process is N, for example, N is equal to 15. In the fusion prediction, a maximum of M matching blocks can be used for fusion, for example, M is equal to 5. The second preset number is set to 5, and based on the first grouping rule, every M matching blocks in the candidate matching block list can be set into one group, resulting in a total of N / M = 3 groups. Correspondingly, the second grouping rule further includes, if the number of matching blocks in the last candidate matching block group is less than the second preset number, taking a preset matching block from the first candidate matching block list and adding it to the last candidate matching block group so that the number of matching blocks in the last candidate matching block group is equal to the second preset number.

[0184] In some embodiments, the at least one grouping rule includes a first grouping rule and a second grouping rule. Exemplarily, the maximum length of the candidate matching block list constructed by the template matching process is N, for example, N is equal to 15. The first preset number is set to 3 and the second preset number is set to 5. Based on the first grouping rule, a maximum of N / M = 5 groups is obtained, and based on the second grouping rule, a maximum of N / M = 3 groups is obtained. The candidate matching block list is grouped based on the first and second grouping rules, resulting in a total of 8 groups.

[0185] In some embodiments, each grouping rule further includes the number of corresponding groups. For example, if the number of groups corresponding to the first grouping rule is 2 and the number of groups corresponding to the second grouping rule is 2, then the candidate matching block list is grouped based on the first and second grouping rules to obtain a total of 4 groups. For example, the candidate blocks in the candidate matching block list are BVn, where n is an integer from 1 to N, or an integer from 0 to N-1. In some embodiments, i may be the index value of the candidate matching block. Based on the first grouping rule, two candidate matching block groups {BV0,BV1,BV2} and {BV3,BV4,BV5} are obtained, and based on the second grouping rule, two candidate matching block groups {BV0,BV1,BV3,BV2,BV4} and {BV5,BV6,BV7,BV8,BV9} are obtained.

[0186] In some embodiments, the at least one grouping rule includes a third grouping rule, the third grouping rule comprising forming a candidate matching block group with the first M1 matching blocks in the first candidate matching block list and every M2 matching blocks from the M1+1th matching block onwards. In some embodiments, the third grouping rule further includes the number of corresponding groups.

[0187] In some embodiments, the third grouping rule further includes that the values ​​of M2 are equal within different matching block groups, or that the third grouping rule further includes that the values ​​of M2 are not exactly equal within different matching block groups.

[0188] Exemplarily, BVn (i > N) is combined with the previous M1 in the candidate matching block list. For example, when M1 = 2 and M2 = 1, possible combinations are {BV0, BV1, BV2}, {BV0, BV1, BV3}, {BV0, BV1, BV4}, etc. When M1 = 2, possible combinations are {BV0, BV1, BV2, BV3}, {BV0, BV1, BV4}, {BV0, BV1, BV5}, etc. BVn - BV(n + M2) (n > N) is combined with the first N in the candidate matching block list. For example, when M1 = 1 and M2 = 2, possible combinations are {BV0, BV1, BV2}, {BV0, BV3, BV4}, {BV0, BV5, BV6}, etc.

[0189] In some embodiments, the at least one grouping rule includes a first matching rule and a third grouping rule. The at least one grouping rule includes a first matching rule, a second grouping rule, and a third grouping rule. Exemplarily, each grouping rule further includes the number of corresponding groups.

[0190] In some embodiments, the at least one grouping rule includes a fourth grouping rule. The fourth grouping rule includes constructing the previous i matching blocks in the first candidate matching block list as the i-th candidate matching block group, where i is an integer greater than 0. Exemplarily, the first 1 matching block is constructed as the first candidate matching block group, the first 2 matching blocks are constructed as the second candidate matching block group, the first 3 matching blocks are constructed as the third candidate matching block group, the first 4 matching blocks are constructed as the fourth candidate matching block group, and so on. The maximum length of the candidate matching block list is N, the maximum value of i is N, and the number of groups can be limited by limiting the maximum value of i.

[0191] In some embodiments, the fifth grouping rule comprises constructing the first two matching blocks in the first candidate matching block list as the i-th candidate matching block group, and the fifth grouping rule comprises constructing the first (2i + a) matching blocks in the first candidate matching block list as the i-th candidate matching block group, where a is a positive integer. i In some embodiments, the grouping can also be performed based on the distance between the matching blocks. Exemplarily, the grouping rule further comprises that the distance between any two matching blocks in the candidate matching block group is greater than a first distance threshold, or the grouping rule further comprises that the distance between any two matching blocks in the candidate matching block group is less than a second distance threshold. By restricting the distance between the matching blocks, the distribution of the matching blocks in the candidate matching block group can be restricted. It should be noted that when two or more grouping rules are set, each grouping rule is restricted or partially restricted.

[0192] In some embodiments, grouping the first candidate matching block list comprises grouping the first candidate matching block list based on at least one grouping rule to obtain at least one candidate matching block group, setting a fusion mode of at least one IntraTMP fusion prediction mode corresponding to each candidate matching block group, and obtaining at least two candidate matching block groups.

[0193] In some embodiments, grouping the first candidate matching block list comprises grouping the first candidate matching block list based on at least one grouping rule to obtain at least one candidate matching block group, setting a fusion mode of at least one IntraTMP fusion prediction mode corresponding to each candidate matching block group, and obtaining at least two candidate matching block groups.

[0194] It should be explained that after grouping the first candidate matching block list based on any of the grouping embodiments described above, one or more fusion modes may be set for the candidate matching block group. It can be understood that one candidate matching block group and one fusion mode may be combined to form a new candidate matching block group, and two fusion modes may be set for one candidate matching block group to form two new candidate matching block groups.

[0195] Illustratively, based on the first and second grouping rules described above, two candidate matching block groups ({BV0,BV1,BV2,BV3,BV4} and {BV0,BV1}) are obtained. Two fusion modes are set for each candidate group, resulting in four candidate matching block groups ({BV0,BV1,BV2,BV3,BV4,bFilter=1}, {BV0,BV1,BV2,BV3,BV4,bFilter=0}, {BV0,BV1,bFilter=1}, and {BV0,BV1,bFilter=0}). bFilter=1 represents the first fusion mode, and bFilter=0 represents the second fusion mode.

[0196] Exemplary examples include intra-template matching fusion modes derived based on templates and intra-template matching fusion modes based on template error values.

[0197] The first fusion mode is an intra-template matching fusion mode derived based on a template, and the second fusion mode is an intra-template matching fusion mode based on template error values. Exemplary, one grouping result includes {BV0,BV1,BV2,BV3,BV4,bFilter=1}, {BV0,BV1,BV2,BV3,BV4,bFilter=0}, {BV0,BV1,bFilter=1}, {BV0,BV1,bFilter=0}, and so on.

[0198] In some embodiments, the encoding and decoding sides pre-determine one grouping rule or a combination of one grouping rules.

[0199] In some embodiments, the method further includes decoding the bitstream and determining the at least one grouping rule. Exemplarily, a syntactic element is decoded to represent one grouping rule or a combination of one grouping rule, the combination of grouping rules includes at least two predefined grouping rules.

[0200] In some embodiments, if the encoding and decoding sides have predetermined one or more grouping rules, the method includes decoding the bitstream and determining variable parameters in the grouping rules. Exemplarily, if the encoding and decoding sides have predetermined a first grouping rule, the method includes decoding the bitstream and determining a first predetermined number. The method further includes decoding the bitstream and determining the number of groups.

[0201] In other words, one or more grouping rules can be set. For example, one grouping rule is to merge using a maximum of M1 matching blocks, for example, M1 is equal to 3. Each M1 matching block in the candidate matching block list is set as one group. Another grouping rule is to merge using a maximum of M2 matching blocks, for example, M2 is equal to 2. Each M2 matching block in the candidate matching block list is set as one group. These two grouping rules can be used individually or in combination to obtain groups of matching blocks.

[0202] In some embodiments, determining the index value of each candidate matching block group includes determining a first index value for each candidate matching block group based on the grouping position of each candidate matching block group, and setting the first index value for each candidate matching block group as the index value for each candidate matching block group. A method for selecting a matching block group can be understood as indicating which group to use by its index value.

[0203] In some embodiments, determining the index value of each candidate matching block group includes: resorting the at least two candidate matching block groups based on the template error value corresponding to each candidate matching block group; determining a second index value for each candidate matching block group based on the resorted position of each candidate matching block group; and setting the second index value for each candidate matching block group as the index value for each candidate matching block group. These matching block groups can be understood as resorting them and then determining a matching block group based on its index value.

[0204] In some embodiments, resorting the at least two candidate matching block groups includes determining N fusion matching blocks to fuse from each candidate matching block group, where N is an integer greater than 0; determining the fusion weight values ​​of the N fusion matching blocks; fusion the templates of the N fusion matching blocks based on the fusion weight values ​​of the N fusion matching blocks to determine a predicted template corresponding to each candidate matching block group; determining a template error value corresponding to each candidate matching block group based on the predicted template corresponding to each candidate matching block group and the template of the current block; and resorting based on the template error value corresponding to each candidate matching block group.

[0205] In step 1502, the index value of the first candidate matching block group corresponding to the current block is determined.

[0206] For example, the first candidate matching block group may be a specific candidate matching block group from at least two candidate matching block groups; that is, the index value of the first candidate matching block group may be a pre-set index value. For example, the index value of the first candidate matching block group is the smallest index value. The index values ​​of the candidate matching block groups are arranged in ascending order, and the smaller the index value, the smaller the template error value of the matching block. After grouping, the candidate matching block group corresponding to the smallest index value is directly obtained as the first candidate matching block group.

[0207] Alternatively, the encoding side performs fusion prediction using at least two candidate matching block groups, selects the optimal candidate matching block group by an encoding decision process such as SATD or RDO, and encodes the index value of the optimal candidate matching block group or the index value corresponding to the reference block. Based on the index value, the first candidate matching block group is determined, and the matching blocks within the first candidate matching block group are used to perform IntraTMP multiple matching block fusion prediction to determine the final predicted block or first predicted block of the current block.

[0208] In some embodiments, intra_tmp_intra_idx or intra_tmp_fusion_idx is decoded to determine the index value of the first candidate matching block group.

[0209] In step 1503, the first candidate matching block group is determined from the at least two candidate matching block groups based on the index value of the first candidate matching block group.

[0210] Furthermore, IntraTMP multiple matching block fusion prediction is performed using the matching blocks within the first candidate matching block group to determine the final predicted block or the first predicted block for the current block.

[0211] Furthermore, an example will be given to further explain the method of fusing matching blocks in the embodiments of the present application. Determining the predicted block of the current block by fusing at least one matching block within the first candidate matching block group includes determining N fused matching blocks for fusion from the first candidate matching block group, where N is an integer greater than 0, determining the fusion weight values of the N fused matching blocks, and fusing the N fused matching blocks based on the fusion weight values of the N fused matching blocks to determine the predicted block of the current block.

[0212] In some embodiments, determining N fused matching blocks for fusion includes using the first N matching blocks at the head of the current candidate matching block group as the N fused matching blocks. Here, N is less than or equal to the number of matching blocks in the current candidate matching block group. That is, when the number of fusions N is less than the number of matching blocks M, only N matching blocks can be used to derive the fusion weight values and perform the weighted calculation. When the number of fusions N is equal to the number of matching blocks M, all matching blocks can be used to derive the fusion weight values and perform the weighted calculation. For example, when the number of fusion blocks N = 3, BV0, BV1, and BV2 are always fused.

[0213] In some embodiments, the method further includes encoding the value N of the number of fused matching blocks. Exemplarily, the related syntax element further includes a syntax element intra_tmp_fusion_num for indicating the value N of the number of fused matching blocks.

[0214] In some embodiments, determining the fusion weights of the N fusion matching blocks may involve determining the fusion weights of the N fusion matching blocks based on the fusion mode of the IntraTMP fusion prediction mode corresponding to the current candidate matching block group, where the fusion mode is the fusion mode of intra-template matching derived based on a template, or the fusion mode of intra-template matching based on a template error value.

[0215] In some embodiments, the fusion mode is an intra-template matching fusion mode derived based on a template, and determining the fusion weights of the N fusion matching blocks includes determining the fusion weights of the N fusion matching blocks and the fusion weights of the bias parameters based on the templates of the N fusion matching blocks, the templates of the current blocks, and the bias parameters.

[0216] Determining the predicted block of the current block by fusing the N fusion matching blocks based on the fusing weight values ​​of the N fusion matching blocks includes fusing the N fusion matching blocks and the bias parameter based on the fusing weight values ​​of the N fusion matching blocks and the bias parameter to determine the predicted block of the current block.

[0217] Exemplary, an IntraTMP fusion method derived based on a template is obtained by training weight values ​​for fusion prediction based on each matching block template and the current block template, using a method similar to filter coefficient training. For example, a candidate matching block group or set of candidate matching blocks contains three matching blocks represented as {BV(3i), BV1(3i+1), BV2(3i+2)}, and the fusion form is as follows:

[0218] pred=w0×BV 3×i +w1×BV3×i +w2×BV 3×i+2 +w3×Bias The template of matching blocks BV(3i), BV1(3i+1), and BV2(3i+2) is taken as input, and the template of the current block is taken as output pred. Bias is a fixed value, for example, the median of the pixel range, and a set of weight values ​​w0~w3 is derived. When fusing matching blocks, the predicted block of the current block is obtained using the same fusing method and the reconstructed values ​​and weight values ​​w0~w3 of matching blocks BV(3i), BV1(3i+1), and BV2(3i+2). Alternatively, when fusing templates of matching blocks, the predicted template is obtained using the same fusing method and the reconstructed values ​​and weight values ​​w0~w3 of matching block templates BV(3i), BV1(3i+1), and BV2(3i+2).

[0219] In some embodiments, the fusion mode is an intra-template matching fusion mode based on template error values, and determining the fusion weight values ​​of the N fusion matching blocks includes: determining the template error values ​​of the N fusion matching blocks based on the templates of the N fusion matching blocks and the template of the current block; determining the cumulative sum of the template error values ​​of the N fusion matching blocks based on the template error values ​​of the N fusion matching blocks; and determining the fusion weight values ​​of the N fusion matching blocks based on the template error values ​​of the N fusion matching blocks and the cumulative sum of the template error values.

[0220] For example, the template error values ​​between the templates of N matching blocks and the template of the current block are the sum of the absolute differences of SAD1 to SADn, respectively, and the calculation method for one weight is as follows:

[0221] SADi=(SADi==0)?1:SADi

number

[0222]

number

[0223] In some embodiments, determining the N fusion matching blocks to perform the fusion involves dividing the matching blocks in the current candidate matching block group into at least two candidate matching block sets, each of which contains the N fusion matching blocks to perform the fusion, and the number of fusion matching blocks in different candidate matching block sets is not exactly the same; determining the fusion weight values ​​of the N fusion matching blocks in each candidate matching block set; fusion the templates of the N fusion matching blocks based on the fusion weight values ​​of the N fusion matching blocks in each candidate matching block set to determine a predicted template corresponding to each candidate matching block set; determining a template error value corresponding to each candidate matching block set based on the predicted template corresponding to each candidate matching block set and the template of the current block; determining the optimal candidate matching block set with the smallest template error value based on the template error value corresponding to each candidate matching block set; and setting the matching blocks in the optimal candidate matching block set to the N fusion matching blocks.

[0224] It should be explained that when predicting the matching block of the current block, the current candidate matching block group is the first candidate matching block group. When resorting at least two candidate matching block groups and performing template prediction using at least two candidate matching block groups, the current candidate matching block group is the currently selected candidate matching block group.

[0225] Exemplary, the current candidate matching block group contains three matching blocks {BV(3i), BV1(3i+1), BV2(3i+2)}, and the candidate matching block sets that can be attempted for template prediction are {BV(3i)}, {BV(3i), BV1(3i+1)}, {BV(3i), BV1(3i+1), BV2(3i+2)}, and for each set, weight values ​​are derived for a particular fusion mode. The optimal candidate matching block set is determined, and fusion is performed using the matching blocks within the optimal candidate matching block set to determine the final predicted block or first predicted block of the current block.

[0226] In some embodiments, merging at least one matching block in the first candidate matching block group includes determining a template error value for each matching block in the first candidate matching block group, determining a template error threshold based on the template error value and threshold coefficient of the i-th matching block in the first candidate matching block group, wherein the i-th matching block is the matching block with the smallest template error value in the current candidate matching block group, and if the template error value of the i+J-th matching block is greater than the number of matching blocks in the template error threshold, making the i-th matching block in the first candidate matching block group the i+J-th fused matching block, and merging using all the matching blocks in the updated first candidate matching block group.

[0227] For example, based on the template error value of each matching block in the current candidate matching block group, some of them can be selected and merged. For example, the candidate matching block group contains three matching blocks {BV0, BV1, BV2}, and a threshold is set based on the template error value SAD0 corresponding to BV0. threshold=a×SAD0 If SADi ≤ threshold and i > 0, The corresponding BVi is used for fusion prediction, thereby determining the number of fusions. Here, SAD0 corresponds to the minimum template error value of the matching blocks in the candidate matching block group, and a can be any preset value such as 1.2, 1.5, or 2. If all SADi values ​​are below the threshold, the fusion format is as follows:

[0228] pred=w0×BV0+w1×BV1+w2×BV0+w3×Bias If there are matching blocks where the template error value is greater than the threshold, for example, if SAD2 > threshold, then BV0 can be used instead of BV2 to derive the fusion coefficients and perform the weighting calculation. That is, with templates BV0, BV1, and BV0 as inputs and the template of the current block as output, coefficients w0 to w3 are derived, and the fusion format is as follows:

[0229] Pred=w0×BV0+w1×BV1+w2×BV0+w3×Bias If the number of fusions N is less than the maximum number of fusions M, the coefficients can be derived and weighted calculations performed using only the N matching blocks. For example, when N=2, the fusion forms are as follows:

[0230] Pred = w0 × BV0 + w1 × BV1 + w2 × Bias Furthermore, the process of performing a prediction using the IntraTMP multiple candidate prediction mode will be explained as an example. When deciding to perform a prediction for the current block using the IntraTMP multiple candidate prediction mode, the method includes: constructing a second candidate matching block list for the current block based on template matching; determining a first matching block from the second candidate matching block list; and determining a prediction block for the current block based on the first matching block.

[0231] In some embodiments, determining a first matching block from the second candidate matching block list includes determining the index value of the first matching block and determining the first matching block from the second candidate matching block list based on the index value of the first matching block.

[0232] Correspondingly, determining the predicted block of the current block based on the first matching block includes filtering the matching block and obtaining the predicted block when deciding to make the first matching block a predicted block or to filter the first matching block.

[0233] In some embodiments, determining a first matching block from the second candidate matching block list includes determining the matching block with the smallest template error from the second candidate matching block list as the first matching block, or determining the index value of the first matching block, and determining the first matching block from the second candidate matching block list based on the index value of the first matching block.

[0234] In some embodiments, determining a first matching block from the second candidate matching block list further includes: resorting the first N matching blocks in the second candidate matching block list; determining the index values ​​of the first N matching blocks based on their resorted positions; and determining the first matching block based on its index value. For a method of resorting matching blocks, see Figure 11 and the corresponding description.

[0235] The above technical solution improves prediction efficiency by allowing the decoding side to decode relevant syntactic elements and decide whether to use the IntraTMP fusion intra-prediction mode for the current block. At the same time, the IntraTMP fusion intra-prediction mode combines IntraTMP techniques such as IntraTMP multiple candidate, IntraTMP multiple matching block fusion, and IntraTMP filtering to adapt to a wider range of coding and decoding scenarios, ensuring prediction accuracy and coding and decoding efficiency.

[0236] In yet another embodiment of the present application, an encoding method is further provided. Referring to Figure 16, a schematic flowchart of the encoding method according to an embodiment of the present application is shown. As shown in Figure 16, the method further includes the following steps.

[0237] In step 1601, the matching block of the current block is determined based on the prediction mode of template matching, and the first predicted block of the current block is determined based on the matching block.

[0238] The process involves performing template matching and constructing a candidate matching block list. Within a predefined search range, possible matching blocks are searched based on a predefined search method, and a template error value corresponding to the matching block is calculated based on the template of the matching block and the template of the current block. A candidate matching block list is constructed based on each matching block and its corresponding template error value. The candidate matching block list can be sorted in ascending order based on the magnitude of the template error value.

[0239] In some embodiments, determining the matching block of the current block based on the prediction mode of template matching includes constructing a first candidate matching block list for the current block based on template matching, determining a first candidate matching block group from the first candidate matching block list, and determining at least one matching block to merge from the first candidate matching block group. Correspondingly, obtaining the first predicted block of the current block based on the matching block includes merging at least one matching block in the first candidate matching block group to determine the first predicted block of the current block. That is, the IntraTMP fusion intra-prediction method combines IntraTMP multiple matching block fusion prediction schemes to determine at least one matching block of the current block, performs matching block fusion, and obtains the first predicted block of the current block.

[0240] In some embodiments, determining a first candidate matching block group from the first candidate matching block list includes grouping the first candidate matching block list to determine at least two candidate matching block groups and determining the index value of each candidate matching block group, determining the index value of the first candidate matching block group corresponding to the current block, and determining the first candidate matching block group from the at least two candidate matching block groups based on the index value of the first candidate matching block group.

[0241] In some embodiments, determining the index value of each candidate matching block group involves determining a first index value for each candidate matching block group based on the grouping position of each candidate matching block group, and setting the first index value of each candidate matching block group as the index value of each candidate matching block group. Alternatively, the method includes: resorting the at least two candidate matching block groups based on the template error value corresponding to each candidate matching block group; determining the second index value of each candidate matching block group based on the resorted position of each candidate matching block group; and setting the second index value of each candidate matching block group as the index value of each candidate matching block group.

[0242] In some embodiments, merging at least one matching block in the first candidate matching block group includes determining a template error value for each matching block in the first candidate matching block group, determining a template error threshold based on the template error value and threshold coefficient of the i-th matching block in the first candidate matching block group, wherein the i-th matching block is the matching block with the smallest template error value in the current candidate matching block group, and if the template error value of the i+j-th matching block is greater than the number of matching blocks in the template error threshold, making the i-th matching block in the first candidate matching block group the i+j-th fused matching block, and merging using all the matching blocks in the updated first candidate matching block group.

[0243] In some embodiments, determining the matching block of the current block based on the prediction mode of the template matching includes constructing a second candidate matching block list for the current block based on the template matching, and determining the first matching block from the second candidate matching block list. In other words, the IntraTMP fused intra prediction method combines IntraTMP multiple candidate prediction methods to determine the first matching block of the current block, and obtains the first predicted block of the current block based on the first matching block. In some embodiments, obtaining the first predicted block of the current block based on the first matching block includes making the first matching block the first predicted block, or filtering the first matching block to obtain the first predicted block.

[0244] In some embodiments, determining the first matching block from the second candidate matching block list involves determining the first N matching blocks from the second candidate matching block list, where N is an integer greater than 0.

[0245] In some embodiments, determining a first matching block from the second candidate matching block list further includes: resorting the first N matching blocks in the second candidate matching block list; determining the index values ​​of the first N matching blocks based on their resorted positions; and determining the first matching block based on the index values ​​of the first N matching blocks.

[0246] In some embodiments, resorting the first N matching blocks in the second candidate matching block list includes: determining a first prediction template for the current block based on the template of the i-th matching block; determining a second prediction template for the current block based on the intra-prediction mode of the non-template matching used for the current block; merging the first and second prediction templates to determine a final prediction template for the current block; determining a template error value corresponding to the i-th matching block based on the final prediction template for the current block and the template of the current block; and resorting the first N matching blocks based on the template error values ​​corresponding to the first N matching blocks.

[0247] In step 1602, the second predicted block of the current block is determined based on the non-template matching intra-prediction mode.

[0248] In some embodiments, the non-template matching intra-prediction mode includes at least two candidate intra-prediction modes, and the method further includes: resorting the at least two candidate intra-prediction modes to obtain a list of candidate intra-prediction modes and an index value for each candidate intra-prediction mode; determining the index value for a first intra-prediction mode to be used for the current frame; determining the first intra-prediction mode from the list of candidate intra-prediction modes based on the index value of the first intra-prediction mode; and setting the first intra-prediction mode as the non-template matching intra-prediction mode to be used for the current block.

[0249] In some embodiments, resorting the at least two candidate intra-prediction modes includes: setting the template of the matching block of the current block as the first prediction template of the current block; determining a second prediction template of the current block based on the i-th candidate intra-prediction mode; merging the first and second prediction templates to determine the final prediction template of the current block; determining a template error value corresponding to the i-th candidate intra-prediction mode based on the final prediction template of the current block and the template of the current block; and resorting the at least two candidate intra-prediction modes based on the template error values ​​corresponding to the at least two candidate intra-prediction modes.

[0250] In some embodiments, the optimal intra-prediction mode that minimizes the template error value is determined as the first intra-prediction mode.

[0251] In step 1603, the first prediction block and the second prediction block are merged to determine the final prediction block for the current block.

[0252] In some embodiments, merging the first prediction block and the second prediction block to determine the final prediction block of the current block includes merging the first prediction block and the second prediction block to determine the final prediction block of the current block based on a preset first weight value and a second weight value.

[0253] In some embodiments, merging the first prediction block and the second prediction block to determine the final prediction block of the current block includes dividing the current block into four sub-regions based on an intra-prediction mode derived by TIMD, determining a first weight value and a second weight value for each of the four sub-regions of the current block, merging the first prediction block and the second prediction block based on the first and second weight values ​​for the four sub-regions of the current block to determine the final prediction block of the current block, or determining a first weight value and a second weight value for the current block based on an intra-prediction mode derived by TIMD, and merging the first prediction block and the second prediction block based on the first and second weight values ​​for the current block to determine the final prediction block of the current block.

[0254] In some embodiments, when deciding to predict a current block using the IntraTMP multiple matching block fusion prediction mode, the process further includes: constructing a first candidate matching block list for the current block based on template matching; determining a first candidate matching block group from the first candidate matching block list; and fusing at least one matching block within the first candidate matching block group to determine a predicted block for the current block.

[0255] In some embodiments, determining a first candidate matching block group from the first candidate matching block list involves constituting the first N matching blocks in the first candidate matching block list into the first candidate matching block group, where N is an integer greater than 0, for example, N is 3.

[0256] In some embodiments, when deciding to predict the current block using the IntraTMP multiple candidate prediction mode, the method includes: constructing a second candidate matching block list for the current block based on template matching; determining a first matching block from the second candidate matching block list; and determining a predicted block for the current block based on the first matching block.

[0257] In some embodiments, determining the predicted block of the current block based on the first matching block includes setting the first matching block as the predicted block of the current block, and filtering the matching blocks to obtain the predicted block of the current block.

[0258] In step 1604, an encoding decision is made based on the final predicted block and the original block of the current block, and it is decided whether to use the IntraTMP fused intra-prediction mode to predict the current block.

[0259] The encoding and decoding sides use the same process to obtain predicted blocks for each prediction mode. Exemplarily, a candidate matching block list is constructed, ordered from smallest template error value, and an IntraTMP multiple matching block fusion prediction is performed to obtain predicted blocks. A matching block is selected from the candidate block list, and a filter coefficient is derived based on the template of that matching block and the template of the current block to obtain predicted blocks that are filtered or unfiltered based on a single matching block. Using these filtered or unfiltered predicted blocks, an IntraTMP fusion intra-prediction is performed to determine the final predicted blocks for the current block. In some embodiments, the encoding side selects the optimal prediction mode by comparing the distortion between the predicted blocks and the original block in multiple prediction modes, such as SAD, MSE, SATD, and SSE; determines the values ​​of the relevant syntactic elements based on the optimal prediction mode; encodes the relevant syntactic elements; writes the encoded bits to a bitstream, and completes the encoding process for the current block.

[0260] In step 1605, the relevant syntactic elements of the current block are encoded, and the resulting encoded bits are written to the bitstream.

[0261] Here, the aforementioned related syntactic element is used to indicate whether to predict for the current block using the IntraTMP fused intra prediction mode based on intra template matching prediction.

[0262] It should be explained that the related syntactic elements are used to indicate the prediction mode of the current block, more specifically, to indicate the IntraTMP prediction mode, and more specifically, to indicate whether the prediction mode of the current block is the IntraTMP fused intra-prediction mode.

[0263] In some embodiments, the associated syntactic element includes a first syntactic element and / or a second syntactic element, wherein the first syntactic element is used to indicate whether to allow prediction for the current block using IntraTMP fused intra-prediction mode, and the second syntactic element is used to indicate whether to predict for the current block using IntraTMP fused intra-prediction mode.

[0264] In some embodiments, the associated syntactic element further includes at least one of the following: a syntactic element indicating whether to allow prediction for the current block using an IntraTMP prediction mode; a syntactic element indicating whether to predict for the current block using an IntraTMP prediction mode other than the IntraTMP fusion prediction mode; a syntactic element indicating whether to predict for the current block using an IntraTMP multiple matching block fusion prediction mode; or a syntactic element indicating whether to predict for the current block using an IntraTMP multiple candidate prediction mode. In practical applications, these syntactic elements may be one or more of block-level syntactic elements, slice-level syntactic elements, tile-level syntactic elements, image-level syntactic elements, and sequence-level syntactic elements.

[0265] It should be explained that the IntraTMP prediction mode refers to a prediction mode based on intra-template matching, and the IntraTMP fusion prediction mode can be understood as a fusion prediction mode based on intra-template matching. The IntraTMP fusion prediction mode includes the IntraTMP fusion intra-prediction mode and other IntraTMP fusion prediction modes other than the IntraTMP fusion intra-prediction mode. Illustratively, other IntraTMP fusion prediction modes include any of the prediction modes that participate in fusion using matching blocks obtained based on template matching, such as the IntraTMP multiple matching block fusion prediction mode, the intra- and inter-combination prediction mode, and IntraTMP fusion by template derivation.

[0266] It should be explained that the value of the first syntactic element may be either a first or second numerical value, and each value of the first syntactic element is used to indicate a specific meaning. For example, if the value of the first syntactic element is a first numerical value, it is used to indicate a syntactic element that allows prediction using the IntraTMP fused intra-prediction mode for the current block. Alternatively, if the value of the first syntactic element is a second numerical value, it is used to indicate a syntactic element that allows prediction using the IntraTMP fused intra-prediction mode for the current block. For example, the first numerical value may be 1, and the second numerical value may be 0.

[0267] In some examples, the first syntax element includes block-level syntax elements. In some embodiments, the first syntax element further includes at least one of slice-level syntax elements, tile-level syntax elements, image-level syntax elements, and sequence-level syntax elements.

[0268] In some examples, the second syntax element includes block-level syntax elements. In some embodiments, the second syntax element further includes at least one of slice-level syntax elements, tile-level syntax elements, image-level syntax elements, and sequence-level syntax elements.

[0269] In some embodiments, encoding the relevant syntactic elements of the current block includes encoding the first syntactic element and deciding to allow the current block to be predicted using the IntraTMP fusion intra-prediction mode if the value of the first syntactic element is a first value; encoding the second syntactic element and deciding to allow the current block to be predicted using the IntraTMP fusion intra-prediction mode if the value of the second syntactic element is a first numeric value; and deciding to allow the current block to be predicted using the IntraTMP multiple matching block fusion prediction mode if the value of the second syntactic element is a second numeric value.

[0270] To explain, the system decides to allow prediction for the current block using the IntraTMP fusion intra prediction mode, further encodes a second syntactic element, and based on the value of the second syntactic element, decides whether to predict for the current block using the IntraTMP fusion intra prediction mode or the IntraTMP multiple matching block fusion prediction mode. The IntraTMP multiple matching block fusion prediction and IntraTMP fusion intra prediction are treated as two fusion prediction modes, and a block-level flag indicates which fusion prediction mode to use.

[0271] For example, one related syntactic element includes the following:

[0272] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag) { intra_tmp_intra_flag } } Here, intra_tmp_fusion_flag serves as the first syntactic element, intra_tmp_intra_flag serves as the second syntactic element, and intra_tmp_flag is used to indicate that prediction is permitted for the current block using IntraTMP prediction mode. Encode the IntraTMP related syntactic elements, and if intra_tmp_flag is true, it indicates that IntraTMP prediction mode will be used for the current block. Further encode intra_tmp_fusion_flag, and if intra_tmp_fusion_flag is true, it indicates that prediction is permitted for the current block using IntraTMP fusion intra prediction mode. Further encode intra_tmp_intra_flag, and if intra_tmp_intra_flag is true, it indicates that IntraTMP fusion intra prediction mode will be used. If intra_tmp_intra_flag is false, it indicates that IntraTMP multiple matching block fusion mode will be used.

[0273] In some embodiments, encoding the relevant syntactic elements of the current block includes encoding the first syntactic element and deciding to allow the current block to be predicted using the IntraTMP fused intra-prediction mode if the value of the first syntactic element is a first value; encoding the second syntactic element and deciding to predict the current block using the IntraTMP fused intra-prediction mode if the value of the second syntactic element is a first numeric value; and deciding to predict the current block using the IntraTMP multiple candidate prediction mode if the value of the second syntactic element is a second numeric value.

[0274] To explain, the system decides to allow prediction for the current block using the IntraTMP fused intra-prediction mode, further encodes a second syntactic element, and based on the value of the second syntactic element, decides whether to predict for the current block using the IntraTMP fused intra-prediction mode or the IntraTMP multiple candidate prediction mode. The IntraTMP multiple candidate prediction mode can be understood as an IntraTMP prediction mode based on a single matching block. With IntraTMP multiple matching block fused prediction and IntraTMP fused intra-prediction as two fused prediction modes, the IntraTMP multiple candidate prediction mode extends the IntraTMP fused intra-prediction mode and, by a block-level flag, indicates whether to fuse the selected matching block with the second predicted block obtained by the intra-prediction mode. Furthermore, the selected first matching block can also be indicated by an index value.

[0275] In some embodiments, encoding the relevant syntactic elements of the current block includes determining to predict the current block using the IntraTMP multiple matching block fusion prediction mode if the value of the first syntactic element is a first value, determining to allow predicting the current block using the IntraTMP fusion intra prediction mode if the value of the first syntactic element is a second value, encoding the second syntactic element, using the second syntactic element to indicate that predicting the current block using the IntraTMP fusion intra prediction mode if the value of the second syntactic element is a first numeric value, and using the second syntactic element to indicate that predicting the current block using the IntraTMP multiple candidate prediction mode if the value of the second syntactic element is a second numeric value.

[0276] To explain, if the value of the first syntactic element is a first number, it is decided to predict the current block using the IntraTMP multiple matching block fusion prediction mode, that is, it is decided not to allow predicting the current block using the IntraTMP fusion intra prediction mode. The first syntactic element is used to indicate whether to allow predicting the current block using the IntraTMP fusion intra prediction mode, as well as whether to predict the current block using the IntraTMP multiple matching block fusion prediction mode. The IntraTMP multiple matching block fusion prediction mode, the IntraTMP multiple candidate prediction mode, and the IntraTMP fusion intra prediction mode are treated as three fusion prediction modes, and a block-level flag indicates which prediction mode is selected and whether to fuse the selected matching block with the second prediction block obtained by the intra prediction mode.

[0277] For example, one related syntactic element is: intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag) { intra_tmp_intra_flag } } Here, if intra_tmp_flag is true, it indicates that the IntraTMP prediction mode will be used for the current block. Furthermore, if intra_tmp_fusion_flag is encoded, and intra_tmp_fusion_flag is true, it indicates that the IntraTMP multiple matching block fusion mode will be used for the current block. If intra_tmp_fusion_flag is false, it indicates that the single matching block prediction mode will be used for the encoded block. It can also indicate that prediction is permitted using the IntraTMP fusion intra prediction mode for the current block. Furthermore, if intra_tmp_intra_flag is encoded, and intra_tmp_intra_flag is true, it indicates that the IntraTMP fusion intra prediction mode will be used. If intra_tmp_intra_flag is false, it indicates that the single matching block prediction mode will be used, i.e., the IntraTMP multiple candidate prediction mode will be used.

[0278] In some embodiments, the prediction mode described above can also be combined with IntraTMP filtering techniques. Exemplarily, the related syntactic element further includes a third syntactic element. In some embodiments, this further includes encoding the third syntactic element, where the third syntactic element is used to indicate whether to filter the first matching block or the predicted block of the current block. Exemplarily, if the value of the third syntactic element is a first number, it is decided to filter the first matching block or the predicted block of the current block. If the value of the third syntactic element is a second number, it is decided not to filter the first matching block or not to filter the predicted block of the current block.

[0279] In some embodiments, the second and third syntactic elements are encoded.

[0280] In some embodiments, it is decided to allow prediction for the current block using the IntraTMP fused intra prediction mode and encode the third syntactic element. In some embodiments, it is decided to allow prediction for the current block using the IntraTMP multiple candidate prediction mode and encode the third syntactic element.

[0281] It should be explained that the first matching block is the first matching block determined based on the prediction mode of template matching. Filtering the first matching block or the prediction block of the current block can be predetermined. Alternatively, two syntactic elements can be used to indicate whether to filter the first matching block or the prediction block of the current block, respectively. Alternatively, a syntactic element can be set for only one of them, and predetermined for the other.

[0282] For example, one related syntactic element includes the following:

[0283] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag) { intra_tmp_intra_flag intra_tmp_filter_flag } } Or, intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag) { intra_tmp_intra_flag intra_tmp_filter_flag } } Here, based on the above embodiment, if we decide to allow prediction using the IntraTMP fused intra-prediction mode for the current block, we encode intra_tmp_filter_flag, where if intra_tmp_filter_flag is true, it means that the selected matching block will be filtered, and if intra_tmp_filter_flag is false, it means that the selected matching block will not be filtered. To elaborate, if intra_tmp_intra_flag is true, it means that the IntraTMP fused intra-prediction mode will be used and the selected first matching block will be used for fused intra-prediction, and if intra_tmp_intra_flag is false, it means that the selected matching block will not be fused with the intra-prediction block, and the prediction mode for a single matching block will be used, i.e., the IntraTMP multiple candidate prediction mode will be used.

[0284] In some embodiments, index information indicating which matching block in the candidate matching block list to merge with may be transmitted. The method further includes deciding to allow prediction for the current block using the IntraTMP fusion intra prediction mode and encoding a fourth syntactic element, the fourth syntactic element used to indicate the index value of a first matching block in the candidate matching block list, or the fourth syntactic element used to indicate the index value of a first candidate matching block group in the candidate matching block list.

[0285] For example, one related syntactic element includes the following:

[0286] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag){ intra_tmp_intra_flag intra_tmp_intra_idx } } Here, if intra_tmp_intra_flag is true, it indicates that the IntraTMP fusion intra-prediction mode will be used, and intra_tmp_intra_idx indicates which matching blocks will be fused with the intra-prediction blocks. If intra_tmp_intra_flag is false, it indicates that the IntraTMP multiple matching block fusion mode will be used, and intra_tmp_intra_idx indicates which candidate matching block group in the candidate matching block list will be subjected to multiple matching block fusion. intra_tmp_intra_idx may also be called intra_tmp_fusion_idx.

[0287] For example, one related syntactic element includes the following:

[0288] intra_tmp_flag If(intra_tmp_flag){ intra_tmp_fusion_flag If(!intra_tmp_fusion_flag){ intra_tmp_intra_flag intra_tmp_intra_idx } } Here, if intra_tmp_intra_flag is true, it indicates that the IntraTMP fused intra-prediction mode will be used, and intra_tmp_intra_idx indicates which matching block will be fused with the intra-prediction block. If intra_tmp_intra_flag is false, it indicates that the IntraTMP multiple candidate prediction mode will be used, and intra_tmp_intra_idx indicates which matching block will be predicted for.

[0289] In some embodiments, the first and fourth syntax elements are encoded, wherein the fourth syntax element is used to indicate the index value of a first matching block in the candidate matching block list, or the fourth syntax element is used to indicate the index value of a first candidate matching block group in the candidate matching block list.

[0290] In some embodiments, if the value of the first syntactic element is a first value, it is decided to predict the current block using the IntraTMP multiple matching block fusion prediction mode and to determine the index value of the first candidate matching block group based on the fourth syntactic element. If the value of the first syntactic element is a second value, it is decided to allow prediction of the current block using the IntraTMP fusion intra prediction mode and to encode the second syntactic element. If the value of the second syntactic element is a first numeric value, it is decided to predict the current block using the IntraTMP fusion intra prediction mode. In some embodiments, the index value of the first matching block is determined based on the fourth syntactic element. If the value of the second syntactic element is a second numeric value, it is decided to predict the current block using the IntraTMP multiple candidate prediction mode. In some embodiments, the index value of the first matching block is determined based on the fourth syntactic element.

[0291] For example, one related syntactic element includes the following:

[0292] intra_tmp_flag If(intra_tmp_flag){ intra_tmp_fusion_flag intra_tmp_flu_idx If(!intra_tmp_fusion_flag){ intra_tmp_intra_flag } } If intra_tmp_flag is true, it indicates that the IntraTMP prediction mode will be used for the current block, and then intra_tmp_fusion_flag is encoded. If intra_tmp_fusion_flag is true, it indicates that the IntraTMP multiple matching block fusion mode will be used for the current block, and intra_tmp_fusion_idx indicates which candidate matching block group in the candidate matching block list will be subjected to multiple matching block fusion. If intra_tmp_fusion_flag is false, it indicates that the single matching block prediction mode will be used for the encoded block, and it can also indicate that the IntraTMP fusion intra-prediction mode will be used for the current block. intra_tmp_intra_flag is further encoded, and if intra_tmp_intra_flag is true, it indicates that the IntraTMP fusion intra-prediction mode will be used, and intra_tmp_fusion_idx indicates which matching block will be fused with the intra-prediction block. If intra_tmp_intra_flag is false, it means that the single matching block prediction mode is used, i.e., the IntraTMP multiple candidate prediction mode is used, and intra_tmp_intra_idx indicates which matching block to predict for. For example, if intra_tmp_idx is equal to i, the (i+1)th matching block in the candidate matching block list is the selected matching block, with i starting from 0 and index values ​​starting from 1. Or, if intra_tmp_idx is equal to i, the i-th matching block in the candidate matching block list is the selected matching block, with i starting from 0 and index values ​​starting from 0.

[0293] In some embodiments, the above prediction mode can be further integrated with IntraTMP filtering techniques. Exemplarily, one related syntactic element includes the following:

[0294] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag) { intra_tmp_intra_flag intra_tmp_filter_flag intra_tmp_idx } } Encode the IntraTMP-related syntactic elements, and if intra_tmp_flag is true, it indicates that the encoded block will be encoded in IntraTMP mode, and further encode intra_tmp_fusion_flag. If intra_tmp_fusion_flag is true, it is decided to use IntraTMP fusion intra-prediction mode, and further encode intra_tmp_intra_flag, intra_tmp_filter_flag, and intra_tmp_idx (the order can be reversed). Here, intra_tmp_idx represents the index of the selected matching block in the candidate matching block list. If intra_tmp_filter_flag is true, it indicates that the selected matching block will be filtered. If intra_tmp_filter_flag is false, it indicates that the selected matching block will not be filtered. If intra_tmp_intra_flag is true, it indicates that the selected matching block will be used to fuse with the intra-prediction block. If intra_tmp_intra_flag is false, it indicates that the selected matching block will not be merged with the intra prediction block.

[0295] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag) { intra_tmp_intra_flag intra_tmp_filter_flag intra_tmp_idx } } Encode the IntraTMP-related syntactic elements, and if intra_tmp_flag is true, it indicates that the encoded block will be encoded in IntraTMP mode, and further encode intra_tmp_fusion_flag. If intra_tmp_fusion_flag is true, it indicates that the encoded block will be predicted using a multiple matching block fusion method. If intra_tmp_fusion_flag is false, it indicates that the single matching block prediction method will be used for the encoded block, which can also be understood as deciding to allow prediction using the IntraTMP fusion intra-prediction mode for the current block. Further encode intra_tmp_intra_flag, intra_tmp_filter_flag, and intra_tmp_idx (the order can be reversed). Here, intra_tmp_idx represents the index of the selected matching block in the candidate matching block list. If intra_tmp_filter_flag is true, it indicates that the selected matching block will be filtered. If intra_tmp_filter_flag is false, it indicates that the selected matching block will not be filtered. If intra_tmp_intra_flag is true, it indicates that the selected matching block will be merged with the intra-prediction block. If intra_tmp_intra_flag is false, it indicates that the selected matching block will not be merged with the intra-prediction block.

[0296] In some embodiments, intra_tmp_intra_idx and intra_tmp_fusion_idx can also be encoded in different ways based on intra_tmp_intra_flag. Exemplarily, the method further includes deciding to predict the current block using the IntraTMP fusion intra prediction mode and encoding a fourth syntactic element and determining the index value of a first matching block in the candidate matching block list based on the fourth syntactic element, or deciding to predict the current block using the IntraTMP multiple matching block fusion prediction mode and encoding a fifth syntactic element and determining the index value of a first candidate matching block group in the candidate matching block list based on the fifth syntactic element.

[0297] For example, one related syntactic element includes the following:

[0298] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag){ intra_tmp_intra_flag intra_tmp_filter_flag if(intra_tmp_intra_flag) intra_tmp_intra_idx else intra_tmp_flu_idx } } or intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag) { intra_tmp_intra_flag intra_tmp_filter_flag if(intra_tmp_intra_flag) intra_tmp_intra_idx } else intra_tmp_flu_idx } Here, based on the above embodiment, if it is decided to use the IntraTMP fusion intra prediction mode to predict the current block, the fourth syntactic element is encoded as intra_tmp_intra_idx, where intra_tmp_intra_idx represents the index value of the selected matching block in the candidate matching block list. If it is decided to use the IntraTMP multiple matching block fusion prediction mode, the fifth syntactic element is encoded as intra_tmp_fusion_idx, where intra_tmp_fusion_idx represents the index value of the selected first candidate matching block group in the candidate matching block list. The ranges of the values ​​for intra_tmp_intra_idx and intra_tmp_fusion_idx may be the same or different.

[0299] In some embodiments, intra_tmp_intra_idx and intra_tmp_idx can also be encoded in different ways based on intra_tmp_intra_flag. The method further includes deciding to predict the current block using the IntraTMP fused intra prediction mode and encoding a fourth syntactic element and determining the index value of the first matching block in the candidate matching block list based on the fourth syntactic element, or deciding to predict the current block using the IntraTMP multiple candidate prediction mode and encoding a sixth syntactic element and determining the index value of the first matching block in the candidate matching block list based on the sixth syntactic element.

[0300] For example, one related syntactic element includes the following:

[0301] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag){ intra_tmp_intra_flag intra_tmp_filter_flag If(intra_tmp_intra_flag) intra_tmp_intra_idx else intra_tmp_idx } } Here, based on the above embodiment, if it is decided to predict the current block using the IntraTMP fused intra prediction mode, the fourth syntactic element is encoded as intra_tmp_intra_idx, where intra_tmp_intra_idx represents the index value of the selected matching block in the candidate matching block list. If it is decided to use the IntraTMP multiple candidate prediction mode, the sixth syntactic element is encoded as intra_tmp_idx, where intra_tmp_idx represents the index value of the selected matching block in the candidate matching block list. The ranges of values ​​for intra_tmp_intra_idx and intra_tmp_idx may be the same or different. Exemplarily, the maximum value in the range of values ​​for intra_tmp_intra_idx is smaller than the maximum value in the range of values ​​for intra_tmp_idx, the range of values ​​for intra_tmp_intra_idx is 0 to 3, and the range of values ​​for intra_tmp_idx is 0 to 15.

[0302] In some embodiments, it is not necessary to use IntraTMP fused intra-prediction and IntraTMP filtering simultaneously. Exemplary, deciding to predict the current block using the IntraTMP fused intra-prediction mode includes deciding not to filter the first matching block or not to filter the predicted block of the current block, and encoding the second syntactic element, where the value of the second syntactic element is a first numeric value, is used to indicate that the current block will be predicted using the IntraTMP fused intra-prediction mode.

[0303] Furthermore, the method further comprises encoding a fourth syntactic element, which is used to indicate the index value of the first matching block in the candidate matching block list.

[0304] For example, one related syntactic element includes the following:

[0305] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag){ intra_tmp_filter_flag If(!intra_tmp_filter_flag) intra_tmp_intra_flag intra_tmp_idx } } Here, based on the above embodiment, if it is decided to allow prediction using the IntraTMP fused intra prediction mode for the current block, the intra_tmp_filter_flag (third syntactic element) is encoded, and if intra_tmp_filter_flag is false, it means that no single matching block will be filtered, so the intra_tmp_intra_flag (second syntactic element) is encoded, and further, the intra_tmp_idx (fourth syntactic element) is encoded to determine the selected matching block. If intra_tmp_filter_flag is true, it means that a single matching block will be filtered, so the intra_tmp_idx is encoded to determine the selected matching block. In some embodiments, if intra_tmp_filter_flag is true, it can further indicate that prediction will be made using the IntraTMP multiple candidate prediction mode. In other words, whether or not to encode intra_tmp_intra_flag is determined based on the value of intra_tmp_filter_flag.

[0306] In some embodiments, it is not necessary to use IntraTMP fused intra prediction and IntraTMP filtering simultaneously. The method further includes deciding to predict the current block using the IntraTMP multiple candidate prediction mode and encoding a third syntactic element, which is used to indicate whether to filter the first matching block.

[0307] Furthermore, the method further comprises encoding a fourth syntactic element, which is used to indicate the index value of the first matching block in the candidate matching block list.

[0308] For example, one related syntactic element includes the following:

[0309] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag) { intra_tmp_intra_flag If(!intra_tmp_intra_flag) intra_tmp_filter_flag intra_tmp_idx } } Here, based on the above embodiment, if it is decided to allow prediction using the IntraTMP fused intra-prediction mode for the current block, intra_tmp_intra_flag (second syntactic element) is encoded, and if intra_tmp_intra_flag is false, it indicates that prediction will be made using the IntraTMP multiple candidate prediction mode, intra_tmp_filter_flag (third syntactic element) is encoded to determine whether to filter a single matching block, and further, intra_tmp_idx (fourth syntactic element) is encoded to determine the selected matching block. If intra_tmp_intra_flag is true, it indicates that prediction will be made using the IntraTMP fused intra-prediction mode, and intra_tmp_idx (fourth syntactic element) is further encoded to determine the selected matching block. In other words, whether to encode intra_tmp_filter_flag is determined based on the value of intra_tmp_intra_flag.

[0310] In some embodiments, multiple intra-prediction modes can be configured and a particular intra-prediction mode can be indicated by transmitting a syntactic element. The method further includes deciding to predict the current block using the IntraTMP fused intra-prediction mode and encoding a seventh syntactic element, where the seventh syntactic element is used to indicate the non-template matching intra-prediction mode to use for the current block.

[0311] For example, one related syntactic element includes the following:

[0312] intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(intra_tmp_fusion_flag){ intra_tmp_intra_flag If(intra_tmp_intra_flag) intra_tmp_intra_mode_idx } } or intra_tmp_flag If(intra_tmp_flag) { intra_tmp_fusion_flag If(!intra_tmp_fusion_flag){ intra_tmp_intra_flag intra_tmp_filter_flag If(intra_tmp_intra_flag){ intra_tmp_intra_idx intra_tmp_intra_mode_idx } else intra_tmp_idx } } In the IntraTMP fused intra-prediction mode, multiple intra-prediction modes can be configured, including predefined intra-prediction modes, intra-prediction modes from matching blocks, and intra-prediction modes derived based on methods such as TIMD and DIMD. A particular intra-prediction mode is selected by transmitting an index. Based on the above embodiment, if it is decided to predict the current block using the IntraTMP fused intra-prediction mode, i.e., if intra_tmp_intra_flag is true, the seventh syntax element (intra_tmp_intra_mode_idx) is encoded, and based on intra_tmp_intra_mode_idx, the intra-prediction mode for determining the second prediction block is determined.

[0313] In some embodiments, the relevant syntactic element includes a first syntactic element (intra_tmp_fusion_flag), and the method further includes: determining to allow the use of the IntraTMP fusion intra-prediction mode for the current block if the value of the first syntactic element is a first value; predicting in the template region of the current block using the IntraTMP fusion intra-prediction mode to determine a first predict template for the current block; determining a first template error value based on the first predict template and the template of the current block; predicting in the template region of the current block using the first IntraTMP prediction mode to determine a second predict template for the current block; determining a second template error value based on the second predict template and the template of the current block; determining to predict using the IntraTMP fusion intra-prediction mode for the current block if the minimum template error value is the first template error value; and determining to predict using the first IntraTMP prediction mode for the current block if the minimum template error value is the second template error value. Here, the first IntraTMP prediction mode includes the IntraTMP multiple matching block fusion prediction mode and / or the IntraTMP multiple candidate prediction mode.

[0314] In other words, if intra_tmp_fusion_flag is true, encoding of intra_tmp_intra_flag is unnecessary. The prediction mode to use is selected based on the template error value of the multiple matching block fusion prediction in the template region, at least one of the template error values ​​of the multiple candidate prediction in the template region, and the template error value of the fusion intra prediction in the template region.

[0315] In some embodiments, the method further includes encoding an eighth syntax element, where the eighth syntax element is used to indicate whether to encode some or all of the associated syntax elements of the current block. In some embodiments, the eighth syntax element includes at least one of sequence-level syntax elements, image-level syntax elements, tile-level syntax elements, slice-level syntax elements, or block-level syntax elements.

[0316] It should be noted that some or all of the related syntax elements can be limited by one or more syntax elements at the block level, slice level, tile level, image level, or sequence level. In other words, a corresponding 8th syntax element can be set for each syntax element of the related syntax elements, or a corresponding 8th syntax element can be set for two or more syntax elements of the related syntax elements, or a corresponding 6th syntax element can be set for all of the syntax elements of the related syntax elements. For example, if the related syntax element is a block-level syntax element, the 6th syntax element may be an image-level syntax element and / or a sequence-level syntax element.

[0317] The above technical solution allows the encoding side to decide whether to use the IntraTMP fused intra-prediction mode to predict the current block and encode the relevant syntactic elements, thereby improving the prediction efficiency of the decoding side. At the same time, the IntraTMP fused intra-prediction mode combines IntraTMP techniques such as IntraTMP multiple candidate, IntraTMP multiple matching block fusion, and IntraTMP filtering to adapt to a wider range of encoding and decoding scenarios, ensuring prediction accuracy and encoding and decoding efficiency.

[0318] Furthermore, embodiments of the present invention further provide a bitstream, which is generated by bit encoding based on encoding-waiting information, wherein the encoding-waiting information includes at least one of the following: a syntax element indicating whether to allow prediction using the IntraTMP fusion intra-prediction mode for the current block; a syntax element indicating whether to predict using the IntraTMP fusion intra-prediction mode for the current block; a syntax element indicating whether to filter a first matching block; a syntax element filtering the prediction blocks of the current block; a syntax element indicating the index value of the first matching block in the candidate matching block list; a syntax element indicating the index value of the first candidate matching block group in the candidate matching block list; a syntax element indicating the intra-prediction mode for non-template matching; a syntax element indicating whether to decode the relevant syntax elements of the current block; the number of matching blocks in the candidate matching block group; a value N for the number of matching blocks when fusing multiple matching blocks; the length of the first candidate matching block list; and the length of the second candidate matching block list.

[0319] In yet another embodiment of the present application, based on the same inventive concept as the previously described embodiment, with reference to Figure 17, a schematic structural diagram of an encoder according to an embodiment of the present application is shown. As shown in Figure 17, the encoder 170 may include a first prediction unit 1701, a first decision unit 1702, and an encoding unit 1703.

[0320] The first prediction unit 1701 is configured to determine the matching block of the current block based on the prediction mode of template matching, and to determine the first prediction block of the current block based on the matching block.

[0321] The first prediction unit 1701 is configured to determine the second prediction block of the current block based on a non-template matching intra-prediction mode.

[0322] The first prediction unit 1701 is configured to merge the first prediction block and the second prediction block to determine the final prediction block of the current block.

[0323] The first decision unit 1702 is configured to make an encoding decision based on the final predicted block and the original block of the current block, and to decide whether to use the IntraTMP fused intra-prediction mode to predict the current block.

[0324] The encoding unit 1703 is configured to encode the relevant syntactic elements of the current block and write the resulting encoded bits to the bitstream.

[0325] Here, the aforementioned related syntactic element is used to indicate whether to predict for the current block using the IntraTMP fused intra prediction mode based on intra template matching prediction.

[0326] Each functional unit of the encoder may be understood to further perform the encoding method described in any of the embodiments described above.

[0327] It is understandable that in the embodiments of this application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, and may be a module or non-modular. Furthermore, each component in this embodiment may be integrated into a single processing unit, individual units may exist physically independently, or two or more units may be integrated into a single unit. The integrated unit may be implemented in hardware form or in the form of a software function module.

[0328] The integrated unit may be implemented in the form of a software function module and, if not sold or used as an independent product, may be stored on a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment may be essentially or partially contribute to the prior art, or all or part of the technical solution may be embodied in the form of a software product, which is stored on a storage medium and includes several instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) or processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as U disks, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0329] Accordingly, the embodiments of the present application provide a computer-readable storage medium applicable to an encoder 170, the computer-readable storage medium storing a computer program, and when the computer program is executed by a first processor, the encoding method described in any one of the embodiments described above is realized.

[0330] Referring to Figure 18, based on the configuration of the encoder 170 and the computer-readable storage medium, a schematic diagram of the specific hardware structure of the encoder 170 according to an embodiment of the present application is shown. As shown in Figure 18, the encoder 170 may include a first communication interface 1801, a first memory 1802, and a first processor 1803, each component being coupled together via a first bus system 1804. It can be understood that the first bus system 1804 is used to realize connection communication between these components. In addition to the data bus, the first bus system 1804 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity in the explanation, in Figure 18, the various buses are labeled as the first bus system 1804. Here, The first communication interface 1801 is used to send and receive signals during the process of sending and receiving information with other external network elements. The first memory 1802 is used to store computer programs that can be executed on the first processor 1703. When the first processor 1803 executes the computer program, Based on the prediction mode of template matching, the matching block of the current block is determined, and based on the matching block, the first predicted block of the current block is determined. Based on the non-template matching intra prediction mode, the second predicted block of the current block is determined, The first prediction block and the second prediction block are merged to determine the final prediction block of the current block, The current block's final predicted block and the original block are used to make an encoding decision, and it is decided whether to use the IntraTMP fused intra-prediction mode to predict the current block. Currently, it is used to encode the relevant syntactic elements of a block and write the resulting encoded bits to a bitstream.

[0331] Here, the aforementioned related syntactic element is used to indicate whether to predict for the current block using the IntraTMP fused intra prediction mode based on intra template matching prediction.

[0332] It can be understood that the first memory 1802 in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Here, the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM) that functions as an external cache. By a non-restrictive, illustrative description, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct Rambus random access memory (DRRAM). The first memory 1802 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0333] The first processor 1803 may be an integrated circuit chip with signal processing capabilities. In the realization process, each step of the above method may be completed by instructions in the form of hardware integrated logic circuits or software within the first processor 1803. The first processor 1803 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. Each method, step, and logic block diagram disclosed in the embodiments of this application can be realized or executed. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of this application may be directly embodied so as to be executed and completed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, or registers. The storage medium is located in the first memory 1802, and the first processor 1803 reads the information in the first memory 1802 and, in combination with its hardware, completes the steps of the above method.

[0334] Understandably, these embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. If implemented in hardware, the processing unit may be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or a combination thereof. If implemented in software, the technology described herein can be implemented by modules (e.g., processes, functions, etc.) that perform the functions described herein. The software code may be stored in memory and executed by a processor. The memory may be implemented internally or externally to the processor.

[0335] As an option, in another embodiment, the first processor 1803 is further configured to perform the encoding method described in any one of the above embodiments when executing the computer program.

[0336] This embodiment provides an encoder that constructs and groups candidate matching block lists, transmits index values ​​to indicate a first candidate matching block group, and performs fusion prediction using the first candidate matching block group. This improves prediction accuracy and saves code rate, while simultaneously improving encoding and decoding efficiency and further enhancing encoding and decoding performance. Furthermore, by limiting the range of index values ​​of the candidate matching block group, the encoded codewords of the index values ​​are saved, and encoding efficiency is improved. For example, the index values ​​are controlled to a relatively small index range by resorting the candidate matching block group.

[0337] In yet another embodiment of the present application, based on the same inventive concept as the above-described embodiment, a schematic structural diagram of a decoder 190 according to an embodiment of the present application is shown with reference to Figure 19. As shown in Figure 19, the decoder 190 may include a decoding unit 1901, a second determination unit 1902, and a second prediction unit 1903.

[0338] The decoding unit 1901 is configured to decode the relevant syntactic elements of the current block, which are used to indicate whether to predict the current block using an IntraTMP fused intra-prediction mode based on intra-template matching prediction.

[0339] The second decision unit 1902 is configured to decide, based on the associated syntactic elements, to make a prediction for the current block using the IntraTMP fused intra prediction mode.

[0340] The second prediction unit 1903 is configured to determine the matching block of the current block based on the prediction mode of template matching, and to determine the first prediction block of the current block based on the matching block.

[0341] The second prediction unit 1903 is further configured to determine a second prediction block of the current block based on an intra-prediction mode of non-template matching.

[0342] The second prediction unit 1903 is further configured to merge the first prediction block and the second prediction block to determine the final prediction block of the current block.

[0343] Each functional unit of the decoder may be understood to further perform the decoding method described in any of the embodiments described above.

[0344] It is understandable that in the embodiments of this application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, and may be a module or non-modular. Furthermore, each component in this embodiment may be integrated into a single processing unit, individual units may exist physically independently, or two or more units may be integrated into a single unit. The integrated unit may be implemented in hardware form or in the form of a software function module.

[0345] The integrated unit may be implemented in the form of a software function module and, if not sold or used as an independent product, may be stored on a single computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium applicable to the decoder 190, which stores a computer program, and when the computer program is executed by a second processor, it implements the decoding method described in any one of the embodiments described above.

[0346] Referring to Figure 20, based on the above-described configuration of the decoder 190 and the computer-readable storage medium, a schematic diagram of the specific hardware structure of the decoder 190 according to an embodiment of the present application is shown. As shown in Figure 20, the decoder 190 may include a second communication interface 2001, a second memory 2002, and a second processor 2003, each component being coupled together via a second bus system 2004. It can be understood that the second bus system 2004 is used to provide connection communication between these components. In addition to the data bus, the second bus system 2004 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are shown in Figure 20 of the second bus system 2004.

[0347] The second communication interface 2001 is used to send and receive signals during the process of sending and receiving information with other external network elements. The second memory 2002 is used to store computer programs that can be executed on the second processor 2003. The second processor 2003, when executing the computer program, Based on template matching, construct a list of the first candidate matching blocks for the current block, The above-mentioned first candidate matching block list is grouped to determine at least two candidate matching block groups, and the index value of each candidate matching block group is determined. The index value of the first candidate matching block group corresponding to the current block is determined, Based on the index value of the first candidate matching block group, the first candidate matching block group is determined from the at least two candidate matching block groups, This is used to merge at least one matching block within the aforementioned first candidate matching block group and determine the predicted block of the current block.

[0348] As an option, in another embodiment, the second processor 2003 is further configured to execute the decoding method described in any one of the above embodiments when executing the computer program.

[0349] It is understandable that the hardware functions of the second memory 2002 and the first memory 1802 are the same, and the hardware functions of the second processor 2003 and the first processor 1803 are also the same, and these will not be described in detail here.

[0350] This embodiment further provides a decoder that constructs and groups candidate matching block lists, transmits index values ​​to indicate a first candidate matching block group, and performs fusion prediction using the first candidate matching block group, thereby improving prediction accuracy and saving code rate, while simultaneously improving encoding and decoding efficiency and further enhancing encoding and decoding performance. Furthermore, by limiting the range of index values ​​of the candidate matching block group, the encoded codewords of the index values ​​are saved and encoding efficiency is improved. For example, the index values ​​are controlled to a relatively small index range by resorting the candidate matching block group.

[0351] In yet another embodiment of the present application, with reference to Figure 21, a schematic structural diagram of an encoding and decoding system according to an embodiment of the present application is shown. As shown in Figure 21, the encoding and decoding system 210 may include an encoder 2101 and a decoder 2102.

[0352] In the embodiments of the present application, the encoder 2101 may be the encoder described in any of the embodiments described above. The decoder 2102 may be the encoder described in any of the embodiments described above.

[0353] This specification should be made clear that the terms “includes,” “equipped with,” or any variation thereof are intended to cover non-exclusive inclusion, thereby including not only those elements but also other elements not explicitly listed, or elements specific to such process, method, article, or apparatus. Unless otherwise specified, an element limited by the phrase “includes one…” does not preclude the existence of other identical elements in a process, method, article, or apparatus that includes that element.

[0354] The serial numbers of the embodiments described above are for illustrative purposes only and do not indicate any superiority or inferiority among the embodiments.

[0355] The methods disclosed in some of the method embodiments provided in this application can be arbitrarily combined, provided they do not conflict, to obtain new method embodiments.

[0356] The features disclosed in some of the product embodiments provided in this application can be arbitrarily combined, provided they do not contradict each other, to obtain new product embodiments.

[0357] The features disclosed in some of the method or apparatus embodiments provided in this application can be arbitrarily combined, provided they do not conflict, to obtain new method or apparatus embodiments.

[0358] The above descriptions are merely specific embodiments of the present application, and the scope of protection of this application is not limited thereto. Any modification or substitution that any person skilled in the art could easily conceive within the technical scope disclosed herein should be included within the scope of protection of this application. Accordingly, the scope of protection of this application should be subject to the scope of protection of the claims. [Industrial applicability]

[0359] Embodiments of the present application provide an encoding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. Based on related syntactic elements, it is decided to predict the current block using the IntraTMP fused intra-prediction mode; based on the template matching prediction mode, the matching block of the current block is determined; based on the matching block, the first predicted block of the current block is determined; based on the non-template matching intra-prediction mode, the second predicted block of the current block is determined; the first and second predicted blocks are fused to determine the final predicted block of the current block. In this way, encoding and decoding related syntactic elements indicates whether to predict the current block using the IntraTMP fused intra-prediction mode, improving prediction efficiency. At the same time, the IntraTMP fused intra-prediction mode combines IntraTMP techniques such as IntraTMP multiple candidate, IntraTMP multiple matching block fusion, and IntraTMP filtering to adapt to more encoding and decoding scenarios and ensure prediction accuracy and encoding and decoding efficiency.

Claims

1. A decoding method applicable to a decoder, The current block is decoded, wherein the relevant syntactic elements are used to indicate whether to predict the current block using an IntraTMP fused intra prediction mode based on intra template matching prediction. Based on the aforementioned related syntactic elements, it is decided to make a prediction for the current block using the IntraTMP fused intra prediction mode, Based on the prediction mode of template matching, the matching block of the current block is determined, and based on the matching block, the first predicted block of the current block is determined. Based on the non-template matching intra-prediction mode, the second predicted block of the current block is determined, A decoding method comprising fusing the first prediction block and the second prediction block to determine the final prediction block of the current block.

2. The aforementioned related syntactic element includes a first syntactic element and / or a second syntactic element, The first syntactic element is used to indicate whether to allow prediction using the IntraTMP fused intra-prediction mode for the current block. The second syntactic element is used to indicate whether to use the IntraTMP fused intra prediction mode for the current block. The decoding method according to claim 1.

3. Decoding the relevant syntactic elements of the current block is: Decoding the first syntactic element, If the value of the first syntactic element is the first value, it is decided to allow prediction using the IntraTMP fused intra prediction mode for the current block, and to decode the second syntactic element, If the value of the second syntactic element is the first numerical value, it is decided to make a prediction for the current block using the IntraTMP fused intra prediction mode, If the value of the second syntactic element is a second numerical value, the current block is to be predicted using the IntraTMP multiple matching block fusion prediction mode, and the process includes: The decoding method according to claim 2.

4. Decoding the relevant syntactic elements of the current block is: If the value of the first syntactic element is the first value, it is decided to make a prediction for the current block using the IntraTMP multiple matching block fusion prediction mode, If the value of the first syntactic element is the second value, it is decided to allow prediction using the IntraTMP fused intra prediction mode for the current block, and to decode the second syntactic element, If the value of the second syntactic element is the first numerical value, it is decided to make a prediction for the current block using the IntraTMP fused intra prediction mode, If the value of the second syntactic element is a second numeric value, the decision is made to use the IntraTMP multiple candidate prediction mode to make a prediction for the current block, The decoding method according to claim 2.

5. The aforementioned related syntactic element further includes a third syntactic element, and the decoding method is The process further includes decoding a third syntactic element, the third syntactic element being used to indicate whether to filter a first matching block or a predicted block of the current block. The decoding method according to claim 3 or 4.

6. Deciding to make a prediction for the current block using the IntraTMP fusion intra prediction mode means Based on the value of the third syntactic element, it is decided whether to not filter the first matching block or not to filter the predicted block of the current block, and the second syntactic element is decoded. If the value of the second syntactic element is a first numeric value, the current block is to decide to make a prediction using the IntraTMP fused intra prediction mode, The decoding method according to claim 5.

7. The aforementioned decryption method is The current block is determined to be predicted using the IntraTMP multiple candidate prediction mode, further comprising decoding a third syntactic element, the third syntactic element being used to indicate whether to filter the first matching block. The decoding method according to claim 4.

8. When deciding to filter the first matching block, the decoding method Based on the template of the first matching block and the template of the current block, the filter coefficients of the matching block are determined, The method further includes filtering the first matching block based on the filter coefficient of the matching block to obtain the first prediction block, Or, When deciding to filter the predicted blocks of the current block, the decoding method Based on the prediction template of the current block and the template of the current block, the filter coefficients of the prediction block are determined, The process further includes filtering the predicted blocks of the current block based on the filter coefficient of the predicted block to obtain the final predicted block of the current block. The decoding method according to any one of claims 5 to 7.

9. The aforementioned related syntactic element further includes a fourth syntactic element, and the decoding method is Further including decoding the fourth syntactic element, The fourth syntactic element is used to indicate the index value of the first matching block in the candidate matching block list, or the fourth syntactic element is used to indicate the index value of the first candidate matching block group in the candidate matching block list. The decoding method according to any one of claims 2 to 8.

10. The decoding method further, Currently, it is decided to predict the block using the IntraTMP fused intra prediction mode, and to decode the fourth syntactic element. This includes determining the index value of the first matching block in the candidate matching block list based on the fourth syntactic element, Or, It is decided to make a prediction for the current block using the IntraTMP multiple matching block fusion prediction mode, and to decode the fifth syntactic element. This includes determining the index value of the first candidate matching block group in the candidate matching block list based on the fifth syntactic element, The decoding method according to any one of claims 2 to 8.

11. The decoding method further, Currently, it is decided to predict the block using the IntraTMP fused intra prediction mode, and to decode the fourth syntactic element. This includes determining the index value of the first matching block in the candidate matching block list based on the fourth syntactic element, Or, Currently, we decide to use the IntraTMP multiple candidate prediction mode to predict the block, and decode the sixth syntactic element. This includes determining the index value of the first matching block in the candidate matching block list based on the sixth syntactic element, The decoding method according to any one of claims 2 to 8.

12. The decoding method further, The current block is to be predicted using the IntraTMP fused intra prediction mode, and the seventh syntactic element is to be decoded. The seventh syntactic element is used to indicate the intra-predictive mode of non-template matching to be used for the current block. The decoding method according to any one of claims 2 to 11.

13. The aforementioned non-template matching intra-prediction mode includes one of the following: a predefined intra-prediction mode, an intra-prediction mode for a matching block, an intra-prediction mode derived by TIMD, an intra-prediction mode derived based on DIMD, and a Planar mode. The decoding method according to claim 12.

14. The associated syntactic element includes a first syntactic element, and if the value of the first syntactic element is a first value, the decoding method decides to allow the use of the IntraTMP fused intra-prediction mode for the current block, and further, Using the aforementioned IntraTMP fusion intra prediction mode, prediction is made in the template region of the current block to determine the first predicted template of the current block, Based on the first prediction template and the current block template, the first template error value is determined, Using the first IntraTMP prediction mode, a prediction is made in the template region of the current block to determine the second prediction template of the current block. Based on the second prediction template and the current block template, the second template error value is determined, If the minimum template error value is the first template error value, it is decided to make a prediction for the current block using the IntraTMP fusion intra prediction mode, If the minimum template error value is the second template error value, it is decided to make a prediction for the current block using the first IntraTMP prediction mode, The first IntraTMP prediction mode includes the IntraTMP multiple matching block fusion prediction mode and / or the IntraTMP multiple candidate prediction mode. The decoding method according to claim 2.

15. The decoding method further, The process includes decoding an eighth syntactic element, the eighth syntactic element being used to indicate whether to decode some or all of the associated syntactic elements of the current block. The decoding method according to any one of claims 2 to 14.

16. The eighth syntax element includes at least one of sequence-level syntax elements, image-level syntax elements, tile-level syntax elements, slice-level syntax elements, or block-level syntax elements. The decoding method according to claim 15.

17. When deciding to make a prediction for the current block using the IntraTMP multiple matching block fusion prediction mode, the decoding method further: Based on template matching, construct a list of the first candidate matching blocks for the current block, To determine the first candidate matching block group from the aforementioned first candidate matching block list, The process includes merging at least one matching block within the first candidate matching block group to determine the predicted block of the current block, The decoding method according to any one of claims 2 to 16.

18. Based on the prediction mode of the template matching, determining the matching block of the current block is: Based on template matching, construct a list of the first candidate matching blocks for the current block, To determine the first candidate matching block group from the aforementioned first candidate matching block list, This includes determining at least one matching block to merge from the first candidate matching block group, Based on the matching block, obtaining the first predicted block of the current block is: The process includes merging at least one matching block within the first candidate matching block group to determine the first predicted block, The decoding method according to claim 1.

19. Determining the first candidate matching block group from the aforementioned first candidate matching block list is: The above-mentioned first candidate matching block list is grouped to determine at least two candidate matching block groups, and the index value of each candidate matching block group is determined. The index value of the first candidate matching block group corresponding to the current block is determined, The process includes determining the first candidate matching block group from the at least two candidate matching block groups based on the index value of the first candidate matching block group, The decoding method according to claim 17 or 18.

20. Determining the index value of each candidate matching block group is: Based on the grouping position of each candidate matching block group, the first index value of each candidate matching block group is determined, This includes setting the first index value of each candidate matching block group as the index value of each candidate matching block group, Or, Resorting at least two candidate matching block groups based on the template error value corresponding to each candidate matching block group, Based on the re-sort position of each candidate matching block group, the second index value of each candidate matching block group is determined, This includes setting the second index value of each candidate matching block group as the index value of each candidate matching block group, The decoding method according to claim 19.

21. Merging at least one matching block within the aforementioned first candidate matching block group is: Determine the template error value for each matching block in the first candidate matching block group, The method involves determining a template error threshold based on the template error value and threshold coefficient of the i-th matching block within the first candidate matching block group, wherein the i-th matching block is the matching block with the smallest template error value within the current candidate matching block group. If the template error value of the i+j-th matching block is greater than the number of matching blocks in the template error threshold, the i-th matching block in the first candidate matching block group is set to the i+j-th fused matching block. This includes merging using all matching blocks in the updated first candidate matching block group, The decoding method according to claim 17 or 18.

22. When deciding to make a prediction for the current block using the IntraTMP multiple candidate prediction mode, the decoding method Based on template matching, construct a list of second-choice matching blocks for the current block, The first matching block is determined from the second candidate matching block list, The process includes determining the predicted block of the current block based on the first matching block, The decoding method according to claim 4.

23. Based on the prediction mode of the template matching, determining the matching block of the current block is: Based on template matching, construct a list of second-choice matching blocks for the current block, This includes determining a first matching block from the second candidate matching block list, The decoding method according to claim 1.

24. Determining the first matching block from the aforementioned second candidate matching block list is: Determining the index value of the first matching block, This includes determining the first matching block from the second candidate matching block list based on the index value of the first matching block, The decoding method according to claim 22 or 23.

25. Determining the first matching block from the aforementioned second candidate matching block list is: The first N matching blocks in the second candidate matching block list are to be resorted, This further includes determining the index values ​​of the first N matching blocks based on the resort positions of the first N matching blocks, Determining the first matching block from the second candidate matching block list based on the index value of the first matching block is: The process includes determining the first matching block from the second candidate matching block list based on the index value of the first matching block and the index values ​​of the first N matching blocks. The decoding method according to claim 24.

26. Resorting the first N matching blocks in the second candidate matching block list is: Based on the template of the i-th matching block, determine the first predicted template for the current block, Based on the intra-prediction mode of non-template matching currently used for the block, the second predictive template for the current block is determined, The first prediction template and the second prediction template are merged to determine the final prediction template for the current block, Based on the final prediction template of the current block and the template of the current block, the template error value corresponding to the i-th matching block is determined. This includes resorting the first N matching blocks based on the template error values ​​corresponding to the first N matching blocks, The decoding method according to claim 25.

27. The non-template matching intra-prediction mode includes at least two candidate intra-prediction modes, and the decoding method further includes Resort at least two candidate intra-prediction modes to obtain a list of candidate intra-prediction modes and an index value for each candidate intra-prediction mode, Determine the index value of the first intra-prediction mode used for the current frame, Based on the index value of the first intra prediction mode, the first intra prediction mode is determined from the list of candidate intra prediction modes, This includes making the first intra prediction mode the non-template matching intra prediction mode currently used for the block, The decoding method according to claim 1.

28. Resorting the at least two candidate intra-prediction modes means The template of the current block's matching block will be used as the first prediction template for the current block, Based on the i-th candidate intra prediction mode, the second prediction template for the current block is determined, The first prediction template and the second prediction template are merged to determine the final prediction template for the current block, Based on the final prediction template of the current block and the template of the current block, the template error value corresponding to the i-th candidate intra prediction mode is determined, This includes resorting at least two candidate intra-prediction modes based on template error values ​​corresponding to at least two candidate intra-prediction modes, The decoding method according to claim 27.

29. The optimal intra-prediction mode that minimizes the template error value is determined as the first intra-prediction mode. The decoding method according to claim 28.

30. Merging the first prediction block and the second prediction block to determine the final prediction block of the current block is: This includes merging the first prediction block and the second prediction block based on a preset first weight value and a second weight value to determine the final prediction block of the current block. The decoding method according to claim 1.

31. Merging the first prediction block and the second prediction block to determine the final prediction block of the current block is: Based on the intra-prediction mode derived by TIMD, the current block is divided into four sub-regions, Currently, we are determining the first and second weight values ​​for the four sub-regions of the block, This includes merging the first and second predicted blocks based on the first and second weight values ​​of the four sub-regions of the current block to determine the final predicted block of the current block, Alternatively, the first and second weight values ​​of the current block are determined based on the intra-prediction mode derived by TIMD. This includes merging the first and second predicted blocks based on the first and second weight values ​​of the current block to determine the final predicted block of the current block, The decoding method according to claim 1.

32. An encoding method applied to an encoder, Based on the prediction mode of template matching, the matching block of the current block is determined, and based on the matching block, the first predicted block of the current block is determined. Based on the non-template matching intra-prediction mode, the second predicted block of the current block is determined, The first prediction block and the second prediction block are merged to determine the final prediction block of the current block, Based on the final predicted block and the original block of the current block, an encoding decision is made, and it is decided whether to use the IntraTMP fused intra-prediction mode to predict the current block. This includes encoding the relevant syntactic elements of the current block and writing the resulting encoded bits to a bitstream, The aforementioned related syntactic element is an encoding method used to indicate whether to predict for the current block using an IntraTMP fused intra prediction mode based on intra template matching prediction.

33. The aforementioned related syntactic element includes a first syntactic element and / or a second syntactic element, The first syntactic element is used to indicate whether to allow prediction using the IntraTMP fused intra-prediction mode for the current block. The second syntactic element is used to indicate whether to use the IntraTMP fused intra prediction mode for the current block. The encoding method according to claim 32.

34. Encoding the relevant syntactic elements of the current block is: Encoding the first syntactic element, If the value of the first syntactic element is the first value, it is decided to allow prediction using the IntraTMP fused intra prediction mode for the current block, and to encode the second syntactic element, If the value of the second syntactic element is the first numerical value, it is decided to make a prediction for the current block using the IntraTMP fused intra prediction mode, If the value of the second syntactic element is a second numerical value, the current block is to be predicted using the IntraTMP multiple matching block fusion prediction mode, and the process includes: The encoding method according to claim 33.

35. Encoding the relevant syntactic elements of the current block is: If the value of the first syntactic element is the first value, it is decided to make a prediction for the current block using the IntraTMP multiple matching block fusion prediction mode, If the value of the first syntactic element is the second value, it is decided to allow prediction for the current block using the IntraTMP fused intra prediction mode, and to encode the second syntactic element, If the value of the second syntactic element is the first numerical value, it is decided to make a prediction for the current block using the IntraTMP fused intra prediction mode, If the value of the second syntactic element is a second numeric value, the decision is made to use the IntraTMP multiple candidate prediction mode to make a prediction for the current block, The encoding method according to claim 33.

36. The aforementioned related syntactic element further includes a third syntactic element, and the encoding method is Further comprising encoding a third syntactic element, the third syntactic element being used to indicate whether to filter a first matching block or to filter a predicted block of the current block, The encoding method according to claim 34 or 35.

37. Deciding to make a prediction for the current block using the IntraTMP fusion intra prediction mode means Based on the value of the third syntactic element, it is decided whether to not filter the first matching block or not to filter the predicted block of the current block, and the second syntactic element is encoded. If the value of the second syntactic element is a first numeric value, the current block is to decide to make a prediction using the IntraTMP fused intra prediction mode, The encoding method according to claim 36.

38. The aforementioned encoding method is The current block is determined to be predicted using the IntraTMP multiple candidate prediction mode, further comprising encoding a third syntactic element, the third syntactic element being used to indicate whether to filter the first matching block. The encoding method according to claim 35.

39. When deciding to filter the first matching block, the encoding method Based on the template of the first matching block and the template of the current block, the filter coefficients of the matching block are determined, The method further includes filtering the first matching block based on the filter coefficient of the matching block to obtain the first prediction block, Or, When deciding to filter the predicted blocks of the current block, the encoding method, Based on the prediction template of the current block and the template of the current block, the filter coefficients of the prediction block are determined, The process further includes filtering the predicted blocks of the current block based on the filter coefficient of the predicted block to obtain the final predicted block of the current block. The encoding method according to any one of claims 36 to 38.

40. The aforementioned related syntactic element further includes a fourth syntactic element, and the encoding method is Further including encoding the fourth syntactic element, The fourth syntactic element is used to indicate the index value of the first matching block in the candidate matching block list, or the fourth syntactic element is used to indicate the index value of the first candidate matching block group in the candidate matching block list. The encoding method according to any one of claims 33 to 39.

41. The aforementioned encoding method further, It is now decided to make a prediction for the current block using the IntraTMP fused intra prediction mode, and to encode the fourth syntactic element, This includes determining the index value of the first matching block in the candidate matching block list based on the fourth syntactic element, Or, It is decided to make a prediction for the current block using the IntraTMP multiple matching block fusion prediction mode, and to encode the fifth syntactic element, This includes determining the index value of the first candidate matching block group in the candidate matching block list based on the fifth syntactic element, The encoding method according to any one of claims 33 to 39.

42. The aforementioned encoding method further, It is now decided to make a prediction for the current block using the IntraTMP fused intra prediction mode, and to encode the fourth syntactic element, This includes determining the index value of the first matching block in the candidate matching block list based on the fourth syntactic element, Or, Currently, we decide to use the IntraTMP multiple candidate prediction mode to predict the block and encode the sixth syntactic element. This includes determining the index value of the first matching block in the candidate matching block list based on the sixth syntactic element, The encoding method according to any one of claims 33 to 39.

43. The aforementioned encoding method further, The current block is to be predicted using the IntraTMP fused intra prediction mode, and this includes encoding the seventh syntactic element. The seventh syntactic element is used to indicate an intra-predictive mode for non-template matching. The encoding method according to any one of claims 33 to 42.

44. The aforementioned non-template matching intra-prediction mode includes one of the following: a predefined intra-prediction mode, an intra-prediction mode of a matching block, an intra-prediction mode derived by TIMD, and an intra-prediction mode derived based on DIMD. The encoding method according to claim 43.

45. The associated syntactic element includes a first syntactic element, and if the value of the first syntactic element is a first value, it is determined to allow the use of the IntraTMP fused intra-prediction mode for the current block, and the encoding method further, Using the aforementioned IntraTMP fusion intra prediction mode, prediction is made in the template region of the current block to determine the first predicted template of the current block, Based on the first prediction template and the current block template, the first template error value is determined, Using the first IntraTMP prediction mode, a prediction is made in the template region of the current block to determine the second prediction template of the current block. Based on the second prediction template and the current block template, the second template error value is determined, If the minimum template error value is the first template error value, it is decided to make a prediction for the current block using the IntraTMP fusion intra prediction mode, If the minimum template error value is the second template error value, it is decided to make a prediction for the current block using the first IntraTMP prediction mode, The first IntraTMP prediction mode includes the IntraTMP multiple matching block fusion prediction mode and / or the IntraTMP multiple candidate prediction mode. The encoding method according to claim 33.

46. The aforementioned encoding method further, This includes encoding an eighth syntactic element, the eighth syntactic element being used to indicate whether to decode some or all of the associated syntactic elements of the current block. The encoding method according to any one of claims 33 to 45.

47. The eighth syntax element includes at least one of sequence-level syntax elements, image-level syntax elements, tile-level syntax elements, slice-level syntax elements, or block-level syntax elements. The encoding method according to claim 46.

48. When deciding to make a prediction for the current block using the IntraTMP multiple matching block fusion prediction mode, the encoding method is Based on template matching, construct a list of the first candidate matching blocks for the current block, To determine the first candidate matching block group from the aforementioned first candidate matching block list, The process includes merging at least one matching block within the first candidate matching block group to determine the predicted block of the current block, The encoding method according to any one of claims 33 to 47.

49. Based on the prediction mode of the template matching, determining the matching block of the current block is: Based on template matching, construct a list of the first candidate matching blocks for the current block, To determine the first candidate matching block group from the aforementioned first candidate matching block list, This includes determining at least one matching block to merge from the first candidate matching block group, Based on the matching block, obtaining the first predicted block of the current block is: The process includes merging at least one matching block within the first candidate matching block group to determine the first predicted block, The encoding method according to claim 32.

50. Determining the first candidate matching block group from the aforementioned first candidate matching block list is: The above-mentioned first candidate matching block list is grouped to determine at least two candidate matching block groups, and the index value of each candidate matching block group is determined. The index value of the first candidate matching block group corresponding to the current block is determined, The process includes determining the first candidate matching block group from the at least two candidate matching block groups based on the index value of the first candidate matching block group, The encoding method according to claim 48 or 49.

51. Determining the index value of each candidate matching block group is: Based on the grouping position of each candidate matching block group, the first index value of each candidate matching block group is determined, This includes setting the first index value of each candidate matching block group as the index value of each candidate matching block group, Or, Resorting at least two candidate matching block groups based on the template error value corresponding to each candidate matching block group, Based on the re-sort position of each candidate matching block group, the second index value of each candidate matching block group is determined, This includes setting the second index value of each candidate matching block group as the index value of each candidate matching block group, The encoding method according to claim 50.

52. Merging at least one matching block within the aforementioned first candidate matching block group is: Determine the template error value for each matching block in the first candidate matching block group, The method involves determining a template error threshold based on the template error value and threshold coefficient of the i-th matching block within the first candidate matching block group, wherein the i-th matching block is the matching block with the smallest template error value within the current candidate matching block group. If the template error value of the i+j-th matching block is greater than the number of matching blocks in the template error threshold, the i-th matching block in the first candidate matching block group is set to the i+j-th fused matching block. This includes merging using all matching blocks in the updated first candidate matching block group, The encoding method according to claim 48 or 49.

53. When deciding to make a prediction for the current block using the IntraTMP multiple candidate prediction mode, the encoding method is Based on template matching, construct a list of second-choice matching blocks for the current block, The first matching block is determined from the second candidate matching block list, Based on the aforementioned first matching block, the predicted block of the current block is determined, This includes making an encoding decision based on the predicted block and the original block of the current block, and deciding whether to make a prediction for the current block using the IntraTMP multiple candidate prediction mode, The encoding method according to claim 35.

54. Based on the prediction mode of the template matching, determining the matching block of the current block is: Based on template matching, construct a list of second-choice matching blocks for the current block, This includes determining a first matching block from the second candidate matching block list, The encoding method according to claim 32.

55. Determining the first matching block from the aforementioned second candidate matching block list is: This includes determining the first N matching blocks from the second candidate matching block list, where N is an integer greater than 0. The encoding method according to claim 53 or 54.

56. Determining the first matching block from the aforementioned second candidate matching block list is: The first N matching blocks in the second candidate matching block list are to be resorted, Based on the resort position of the first N matching blocks, the index values ​​of the first N matching blocks are determined, The process further includes determining a first matching block from the second candidate matching block list based on the index values ​​of the first N matching blocks, The encoding method according to claim 55.

57. Resorting the first N matching blocks in the second candidate matching block list is: Based on the template of the i-th matching block, determine the first predicted template for the current block, Based on the intra-prediction mode of non-template matching currently used for the block, the second predictive template for the current block is determined, The first prediction template and the second prediction template are merged to determine the final prediction template for the current block, Based on the final prediction template of the current block and the template of the current block, the template error value corresponding to the i-th matching block is determined. This includes resorting the first N matching blocks based on the template error values ​​corresponding to the first N matching blocks, The encoding method according to claim 56.

58. The non-template matching intra-prediction mode includes at least two candidate intra-prediction modes, and the encoding method further includes Resort at least two candidate intra-prediction modes to obtain a list of candidate intra-prediction modes and an index value for each candidate intra-prediction mode, Determine the index value of the first intra-prediction mode used for the current frame, Based on the index value of the first intra prediction mode, the first intra prediction mode is determined from the list of candidate intra prediction modes, This includes making the first intra prediction mode the non-template matching intra prediction mode currently used for the block, The encoding method according to claim 32.

59. Resorting the at least two candidate intra-prediction modes means The template of the current block's matching block will be used as the first prediction template for the current block, Based on the i-th candidate intra prediction mode, the second prediction template for the current block is determined, The first prediction template and the second prediction template are merged to determine the final prediction template for the current block, Based on the final prediction template of the current block and the template of the current block, the template error value corresponding to the i-th candidate intra prediction mode is determined, This includes resorting at least two candidate intra-prediction modes based on template error values ​​corresponding to at least two candidate intra-prediction modes, The encoding method according to claim 58.

60. The optimal intra-prediction mode that minimizes the template error value is determined as the first intra-prediction mode. The encoding method according to claim 59.

61. Merging the first prediction block and the second prediction block to determine the final prediction block of the current block is: This includes merging the first prediction block and the second prediction block based on a preset first weight value and a second weight value to determine the final prediction block of the current block. The encoding method according to claim 32.

62. Merging the first prediction block and the second prediction block to determine the final prediction block of the current block is: Based on the intra-prediction mode derived by TIMD, the current block is divided into four sub-regions, Currently, we are determining the first and second weight values ​​for the four sub-regions of the block, This includes merging the first and second predicted blocks based on the first and second weight values ​​of the four sub-regions of the current block to determine the final predicted block of the current block, Or, Based on the intra-prediction mode derived by TIMD, the first and second weight values ​​of the current block are determined, This includes merging the first and second predicted blocks based on the first and second weight values ​​of the current block to determine the final predicted block of the current block, The encoding method according to claim 32.

63. A bitstream, the bitstream is generated by bit encoding based on encoding-waiting information, the encoding-waiting information comprising at least one of the following: a syntax element indicating whether to allow prediction for the current block using the IntraTMP fusion intra-prediction mode; a syntax element indicating whether to predict for the current block using the IntraTMP fusion intra-prediction mode; a syntax element indicating whether to filter a first matching block; a syntax element filtering the prediction blocks of the current block; a syntax element indicating the index value of a first matching block in a candidate matching block list; a syntax element indicating the index value of a first candidate matching block group in a candidate matching block list; a syntax element indicating an intra-prediction mode for non-template matching; a syntax element indicating whether to decode the relevant syntax elements of the current block; the number of matching blocks in a candidate matching block group; a value N for the number of matching blocks when fusing multiple matching blocks; the length of a first candidate matching block list; and the length of a second candidate matching block list.

64. An encoder comprising a first prediction unit, a first decision unit, and an encoding unit, The first prediction unit is configured to determine the matching block of the current block based on the prediction mode of template matching, and to determine the first prediction block of the current block based on the matching block. The first prediction unit is configured to determine the second prediction block of the current block based on a non-template matching intra-prediction mode. The first prediction unit is configured to merge the first prediction block and the second prediction block to determine the final prediction block of the current block. The first decision unit is configured to make an encoding decision based on the final predicted block and the original block of the current block, and to decide whether to make a prediction for the current block using the IntraTMP fused intra-prediction mode. The encoding unit is configured to encode the relevant syntactic elements of the current block and write the resulting encoded bits to a bitstream. The aforementioned related syntactic element is used to indicate whether to predict for the current block using the IntraTMP fused intra prediction mode based on intra template matching prediction, which is an encoder.

65. An encoder comprising a first memory and a first processor, The first memory is used to store a computer program that can be executed by the first processor. The first processor is an encoder used to perform the method according to any one of claims 32 to 62 when executing the computer program.

66. A decoder comprising a decoding unit, a second decision unit, and a second prediction unit, The decoding unit is configured to decode the relevant syntactic elements of the current block, and the relevant syntactic elements are used to indicate whether to predict the current block using the IntraTMP fused intra prediction mode based on intra template matching prediction. The second decision unit is configured to decide, based on the associated syntactic elements, to make a prediction for the current block using the IntraTMP fused intra prediction mode. The second prediction unit is configured to determine the matching block of the current block based on the prediction mode of template matching, and to determine the first prediction block of the current block based on the matching block. The second prediction unit is further configured to determine the second prediction block of the current block based on an intra-prediction mode of non-template matching. The second prediction unit is further configured to fuse the first prediction block and the second prediction block to determine the final prediction block of the current block, wherein the decoder is configured to do so.

67. A decoder comprising a second memory and a second processor, The second memory is used to store computer programs that can be executed by the second processor. The second processor is a decoder used to perform the method according to any one of claims 1 to 31 when executing the computer program.

68. A computer-readable storage medium storing a computer program that, when executed, implements the method described in any one of claims 1 to 31, or the method described in any one of claims 32 to 62.