Coding method, decoding method, code stream, coder, decoder and storage medium

By employing predictive fusion technology in video coding, combining different prediction modes to fuse the current block, the problem of poor performance of existing matrix prediction technology is solved, and more efficient encoding and decoding performance is achieved.

WO2025213370A1PCT designated stage Publication Date: 2025-10-16GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/086889
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-04-09
Publication Date
2025-10-16

AI Technical Summary

Technical Problem

Existing matrix-based intra-frame prediction technology fails to fully consider the prediction effect in video coding, resulting in degraded encoding and decoding performance.

Method used

Predictive fusion technology is used at the encoding and decoding ends. By determining the first and second candidate prediction blocks of the current block and fusing them, different prediction modes are used to improve prediction accuracy and compression efficiency.

Benefits of technology

It improves the prediction accuracy and compression efficiency of video encoding and decoding, eliminates noise, and enhances encoding and decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024086889_16102025_PF_FP_ABST
    Figure CN2024086889_16102025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a coding method, a decoding method, a code stream, a coder, a decoder and a storage medium. The decoding method comprises: decoding a code stream, so as to determine a value of a first syntax element; when the first syntax element indicates that a current block uses a first prediction mode, determining a first candidate prediction block of the current block; when the current block uses a prediction fusion technology, predicting the current block according to a second prediction mode, and determining a second candidate prediction block of the current block, the first prediction mode being different from the second prediction mode; and fusing the first candidate prediction block and the second candidate prediction block, so as to determine a prediction block of the current block. In this way, the present application can improve compression efficiency, and can further improve the coding and decoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Coding method, code stream, encoder, decoder and storage medium TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of video coding, and particularly relate to a coding method, a code stream, an encoder, a decoder and a storage medium. BACKGROUND

[0002] In a video coding standard, a matrix-based intra prediction (MIP) technology can be used to predict a current coding unit. Specifically, a weight matrix is multiplied by an input vector to obtain an output vector, and the output vector is further arranged and up-sampled to obtain a prediction block of the current coding unit, where the input vector is determined based on reference samples adjacent to the current coding unit.

[0003] In the related art, the MIP technology selects optimal prediction parameters of the current coding unit at the encoding end based on a rate-distortion cost optimization principle, and then performs matrix prediction on the current coding unit based on the reference samples to obtain a prediction block of the current coding unit. However, the current MIP technology is not comprehensive, which leads to poor prediction effect and reduces the coding performance.

[0004] SUMMARY

[0005] Embodiments of the present application provide a coding method, a code stream, an encoder, a decoder and a storage medium, which can improve compression efficiency and thus improve the coding performance.

[0006] The technical solutions of the embodiments of the present application can be implemented as follows:

[0007] In a first aspect, the embodiments of the present application provide a decoding method applied to a decoder, and the method comprises:

[0008] decoding a code stream to determine a value of a first syntax element;

[0009] when the first syntax element indicates that a first prediction mode is used for a current block, determining a first candidate prediction block of the current block;

[0010] when the current block uses a prediction fusion technology, predicting the current block according to a second prediction mode to determine a second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode;

[0011] fusing the first candidate prediction block and the second candidate prediction block to determine a prediction block of the current block.

[0012] In a second aspect, the embodiments of the present application provide an encoding method applied to an encoder, and the method comprises:

[0013] determine a first candidate prediction block of the current block when the first prediction mode is used for the current block;

[0014] determine a second candidate prediction block of the current block according to a second prediction mode when a prediction combination technique is used for the current block, wherein the first prediction mode is different from the second prediction mode;

[0015] combine the first candidate prediction block and the second candidate prediction block to determine a prediction block of the current block.

[0016] In a third aspect, an embodiment of the present application provides a bitstream, which is generated by bit encoding to-be-encoded information; wherein the to-be-encoded information comprises at least one of the following: a residual block of a current block, a value of a first syntax element, and a value of a second syntax element;

[0017] The first syntax element is used to indicate whether the first prediction mode is used for the current block, and the second syntax element is used to indicate whether the prediction combination technique is used for the current block.

[0018] In a fourth aspect, an embodiment of the present application provides an encoder, which comprises a first determining unit and a first predicting unit, wherein:

[0019] The first determining unit is configured to determine a first candidate prediction block of the current block when the first prediction mode is used for the current block.

[0020] The first predicting unit is configured to determine a second candidate prediction block of the current block according to a second prediction mode when a prediction combination technique is used for the current block, wherein the first prediction mode is different from the second prediction mode; and combine the first candidate prediction block and the second candidate prediction block to determine a prediction block of the current block.

[0021] In a fifth aspect, an embodiment of the present application provides an encoder, which comprises a first memory and a first processor; wherein:

[0022] The first memory is configured to store a computer program capable of running on the first processor.

[0023] The first processor is configured to execute the method in the second aspect when the computer program is running.

[0024] In a sixth aspect, an embodiment of the present application provides a decoder, which comprises a decoding unit, a second determining unit and a second predicting unit, wherein:

[0025] The decoding unit is configured to decode the bitstream to determine a value of a first syntax element.

[0026] The second determining unit is configured to determine a first candidate prediction block of the current block when the first syntax element indicates that the current block uses a first prediction mode.

[0027] The second prediction unit is configured to predict the current block according to a second prediction mode when the current block uses a prediction fusion technology, determine a second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode, and fuse the first candidate prediction block and the second candidate prediction block to determine a prediction block of the current block.

[0028] In a seventh aspect, an embodiment of the present application provides a decoder, which comprises a second memory and a second processor; wherein,

[0029] The second memory is configured to store a computer program capable of running on the second processor.

[0030] The second processor is configured to execute the method in the first aspect when running the computer program.

[0031] In an eighth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method in the first aspect or the method in the second aspect.

[0032] In a ninth aspect, an embodiment of the present application provides a computer program product, which comprises a computer program or instructions, and the computer program or instructions are executed by a processor to implement the method in the first aspect or the method in the second aspect.

[0033] The embodiments of the present application provide a coding method, a code stream, an encoder, a decoder and a storage medium. Whether at an encoding end or a decoding end, when a current block uses a first prediction mode, a first candidate prediction block of the current block is determined; then when the current block uses a prediction fusion technology, the current block is predicted according to a second prediction mode to determine a second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode; and the first candidate prediction block and the second candidate prediction block are fused to determine a prediction block of the current block. In this way, when the current block uses the MIP technology, the first candidate prediction block of the current block is determined, and then the second prediction mode can also be used to determine the second candidate prediction block of the current block. Through the fusion of the first candidate prediction block and the second candidate prediction block, the fusion operation of the MIP prediction block and other prediction modes can be implemented, which not only can improve the prediction accuracy and improve the compression efficiency, but also can realize the effect of eliminating noise and smoothing the prediction block, and further improve the coding performance. BRIEF DESCRIPTION OF DRAWINGS

[0034] FIG. 1 is a flow block diagram of a hybrid coding framework;

[0035] FIG. 2 is a schematic diagram of a prediction process of MIP technology;

[0036] FIG. 3 is a schematic diagram of a template region of a current block;

[0037] FIG. 4 is a schematic diagram of a network architecture of a video coding provided by an embodiment of the present application;

[0038] FIG. 5 is a schematic diagram of a system composition block diagram of an encoder provided by an embodiment of the present application;

[0039] FIG. 6 is a schematic diagram of a system composition block diagram of a decoder provided by an embodiment of the present application;

[0040] FIG. 7 is a schematic diagram of a flow of a decoding method provided by an embodiment of the present application;

[0041] FIG. 8 is a schematic diagram of a flow of a decoding method provided by an embodiment of the present application;

[0042] FIG. 9 is a schematic diagram of a flow of a decoding method provided by an embodiment of the present application;

[0043] FIG. 10 is a schematic diagram of a template region provided by an embodiment of the present application;

[0044] FIG. 11 is a schematic diagram of a flow of a decoding method provided by an embodiment of the present application;

[0045] FIG. 12 is a schematic diagram of a flow of an encoding method provided by an embodiment of the present application;

[0046] FIG. 13 is a schematic diagram of a flow of an encoding method provided by an embodiment of the present application;

[0047] FIG. 14 is a schematic diagram of a composition structure of an encoder provided by an embodiment of the present application;

[0048] FIG. 15 is a schematic diagram of a specific hardware structure of an encoder provided by an embodiment of the present application;

[0049] FIG. 16 is a schematic diagram of a composition structure of a decoder provided by an embodiment of the present application;

[0050] FIG. 17 is a schematic diagram of a specific hardware structure of a decoder provided by an embodiment of the present application;

[0051] FIG. 18 is a schematic diagram of a composition structure of a coding system provided by an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to be able to understand the features and technical contents of the embodiments of the present application more thoroughly, the implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings, which are provided for reference only and are not used to limit the embodiments of the present application.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing particular embodiments only and is not intended to be limiting of the application.

[0054] In the following description, reference is made to the "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0055] It should also be noted that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects, and do not represent the specific order of the objects. It can be understood that "first\second\third" can be interchanged with specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0056] In a video image, a coding block (CB) is generally represented by a first color component, a second color component and a third color component. Among them, the three color components are a luminance component, a blue chroma component and a red chroma component, respectively. Specifically, the luminance component is usually represented by the symbol Y, the blue chroma component is usually represented by the symbol Cb or U, and the red chroma component is usually represented by the symbol Cr or V. In this way, the video image can be represented in YCbCr format or YUV format.

[0057] Before the embodiments of the present application are further described in detail, the terms and terms involved in the embodiments of the present application are explained, which are applicable to the following explanations:

[0058] H.265 / High Efficiency Video Coding (HEVC);

[0059] H.266 / Versatile Video Coding (VVC);

[0060] VVC Test Model (VTM) of the reference software test platform of VVC;

[0061] Enhanced Compression Model (ECM);

[0062] Joint Video Experts Team (JVET);

[0063] coding unit (CU);

[0064] coding tree unit (CTU);

[0065] largest coding unit (LCU);

[0066] prediction unit (PU);

[0067] transform unit (TU);

[0068] discrete cosine transform (DCT);

[0069] discrete sine transform (DST)

[0070] matrix-based intra prediction (MIP);

[0071] extra-interpolation prediction (EIP);

[0072] intra template matching prediction (intraTMP);

[0073] intra block copy (IBC);

[0074] template matching (TM);

[0075] block vector (BV);

[0076] merge;

[0077] sum of absolute difference (SAD);

[0078] sum of absolute transform-based difference (SATD).

[0079] At present, the general video coding standards (such as H.266 / VVC) all adopt a block-based hybrid coding framework. Each image or sub-image or frame in a video is divided into square maximum coding units of the same size (such as 128x128, 64x64, etc.). Each maximum coding unit can be divided into rectangular coding units according to rules. The coding units can also be divided into prediction units, transformation units, etc. Specifically, as shown in FIG. 1, the hybrid coding framework includes modules such as prediction, transformation, quantization, entropy coding, inverse quantization, inverse transformation, in-loop filtering, etc. Among them, the prediction module can include intra prediction and inter prediction, and the inter prediction can include motion estimation and motion compensation. Since there is a strong correlation between adjacent pixels in an image of a video, the intra prediction method is used in video coding technology to eliminate the spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent images in a video, the inter prediction method is used in video coding technology to eliminate the temporal redundancy between adjacent images, thereby improving the coding efficiency.

[0080] The basic process of a video codec is as follows: at the encoding end, a frame of image is divided into blocks, a prediction block of a current block is generated using intra prediction or inter prediction, a residual block is obtained by subtracting the prediction block from the original image block (i.e., original block) of the current block, a quantized coefficient matrix is obtained by transforming and quantizing the residual block, and the quantized coefficient matrix is entropy encoded and output to a bitstream. At the decoding end, a prediction block of a current block is generated using intra prediction or inter prediction, and a quantized coefficient matrix is obtained by parsing the bitstream. The quantized coefficient matrix is dequantized and inverse transformed to obtain a residual block, and the prediction block and the residual block are added to obtain a reconstructed block. The reconstructed blocks form a reconstructed image, and the reconstructed image is loop filtered based on the image or based on the block to obtain a decoded image. The encoding end also needs to perform similar operations as the decoding end to obtain a decoded image. The decoded image can be used as a reference image for subsequent frames for inter prediction. Block division information, prediction, transformation, quantization, entropy encoding, loop filtering, and other mode information or parameter information determined by the encoding end need to be output to the bitstream if necessary. The decoding end determines the same block division information, prediction, transformation, quantization, entropy encoding, loop filtering, and other mode information or parameter information by parsing the bitstream and analyzing the existing information, so as to ensure that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end. The decoded image obtained by the encoding end is usually also called a reconstructed image. When predicting, the current block can be divided into prediction units, and when transforming, the current block can be divided into transform units. The division of the prediction units and the transform units can be different. The above is the basic process of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process can be optimized. The embodiments of the present application are applicable to the basic process of a video codec under the block-based hybrid coding framework, but are not limited to the framework and process.

[0081] In the embodiments of the present application, a current block (CB) can be a current coding unit, a current prediction unit, or a current transform unit, etc. Due to the need for parallel processing, an image can be divided into slices, etc., and the slices in the same image can be processed in parallel, that is, there is no data dependency between them. "Frame" is a commonly used term, which can generally be understood as a frame being an image. In the embodiments of the present application, the frame can be replaced by an image or a slice, etc.

[0082] The international video coding standard organization JVET has established a team to study a coding model beyond H.266 / VVC, and named the model, i.e., platform test software, as ECM. ECM starts to receive updated and more efficient compression algorithms on the basis of VTM, and currently has a coding performance of about 13% beyond VVC. ECM not only expands the size of a coding unit of a specific resolution, but also integrates many modules of improvement technology, and has changed a lot in algorithm compared with VVC.

[0083] The related schemes of several prediction technologies are described in detail below.

[0084] (I) Matrix-based intra prediction technology.

[0085] The traditional intra prediction mode and the wide-angle mode calculate the prediction value in a sample mapping or linear gradient manner, which cannot make effective prediction for irregular textures. In order to adapt to different sample distributions and image textures, H.266 / VVC uses MIP technology. For YUV 4:2:0 sampling format, MIP technology is mainly used on the luminance component; for YUV 4:4:4 sampling format, MIP technology can also be used on the chrominance component.

[0086] MIP technology adopts the method of offline training neural network to obtain a plurality of fixed weight matrices (or called "coefficient matrices"), and then uses the weight matrices to calculate the prediction value. The prediction process of MIP is shown in FIG. 2. In order to predict a block with a width of W and a height of H, MIP needs the H reconstructed samples on the left side of the current block and the W reconstructed samples on the top side of the current block as input. MIP generates the prediction block by the following three steps: (a) reference sample averaging, (b) matrix vector multiplication, and (c) interpolation. Here, the core of MIP technology is considered to be matrix vector multiplication. It can be considered as a process of generating a prediction block using input samples (reference samples) in a matrix multiplication manner. MIP provides a plurality of weight matrices, and the difference of prediction methods is reflected in the difference of weight matrices. The same input sample will get different results using different weight matrices. The processes of reference sample averaging and interpolation are a design of performance and complexity compromise. For a block with a larger size, the reference sample averaging can realize an approximate down-sampling effect, so that the input can be adapted to a smaller matrix, and the interpolation realizes an up-sampling effect.

[0087] That is, in the prediction process of MIP, the reference samples are processed to obtain an input vector, the input vector is multiplied by the weight matrix to obtain an output vector, and the prediction value of the CU to be encoded is obtained through further arrangement and up-sampling.

[0088] Exemplarily, taking the CU as an example, the MIP technology is closely related to the size of the CU. According to the size of the CU, the CU can be divided into three categories, which are identified by the class index classIdx. Table 1 shows the CU size, the number of weight matrices and the size of weight matrices corresponding to classIdx. It can be seen from this that the larger the classIdx is, the larger the CU size is.

[0089] Table 1

[0090] where input vector bdry red is obtained by downsampling the reference samples bdry left and bdry top . When classIdx is equal to 0, 1 and 2, the number of elements of the input vector is 4, 8 and 7 respectively; the number of elements of the output vector is 16, 16 and 64 respectively, and the output vector is upsampled to get the prediction value of each sample.

[0091] The classIdx of MIP technique is determined according to the size of CU, at this time the size of weight matrix is determined, and the number of elements of input vector is also determined. Therefore, it is necessary to first downsample the reference samples to the number of elements of input vector, when classIdx is 0, each of the upper reference row and the left reference column is downsampled to 2 sample points; when classIdx is 1 or 2, each of the upper reference row and the left reference column is downsampled to 4 sample points.

[0092] Taking a CU block with width W and height H as an example, assuming that the CU block belongs to the category of classIdx being 2, then the input vectors all need to be downsampled to 4 sample points. MIP technique adopts the method of taking average to compose the downsampled input vector, that is, taking average every W / 4 sample points, and finally obtaining 4 downsampled upper boundary input vectors bdry RedTop . Similarly, taking average every H / 4 sample points is also done to the left reference column, and 4 downsampled left boundary input vectors bdry RedLeft are obtained.

[0093] MIP technique supports different orders of bdry RedTop and bdry RedLeft splicing as input, that is, if bdry RedTop is in front of bdry RedLeft , then it is normal input; otherwise, if bdry RedLeft is in front of bdry RedTop , then it is transposed input. In addition, it is also necessary to process the input vector, for the case of classIdx being 2, the current element is the value of the next element minus the first element; for the other two cases, the first element is the maximum value of the sample minus the first element, and the remaining elements are the values minus the first element.

[0094] The prediction process of MIP technique is in the form of matrix multiplication in FIG. 2.

[0095] The output of the aforementioned MIP technique has a fixed size of 16 or 64 sample points, and thus the MIP output vector often needs to be up-sampled to the same size as the current coding unit. The up-sampling of the MIP output vector needs to arrange the elements output by the matrix operation in the positions shown in FIG. 2, first perform horizontal up-sampling, and use linear interpolation with the left and right adjacent sample values for each missing sample position; then perform vertical up-sampling, and use linear interpolation with the upper and lower adjacent sample values for each missing sample position. After completing the horizontal and vertical interpolation, the prediction block with the same size as the current coding unit is obtained. It should be noted that if the input vector is not transposed, each element of the output vector is arranged in the grid filling position of FIG. 2 from left to right and row by row; if the input vector is transposed, each element of the output vector is arranged in the grid filling position of FIG. 2 from top to bottom and column by column.

[0096] The MIP technique needs a coding unit level identification bit to indicate whether the current coding unit uses the MIP technique, and if the current coding unit uses the MIP technique, the MIP prediction mode and the MIP transposition identification bit need to be parsed, wherein the MIP prediction mode uses truncated binary coding.

[0097] (ii) Template matching technique.

[0098] The template matching technique is a transmission technique that uses the same operation at the encoding and decoding ends to obtain the same result to save the transmission of some syntax elements. Specifically, the current coding unit can use the template matching technique to deliver some information to the decoding end, but these information do not need to be embodied in the code stream with syntax elements. For example, using the surrounding neighboring reconstructed sample region of the current coding unit as the template region, as shown in the diagonal line filling part of FIG. 3.

[0099] The diagonal line filling part shown in FIG. 3 is the surrounding neighboring region of the current block (i.e., the current CU), which is set as the template region, and the encoding and decoding ends can obtain the reconstructed samples or predicted samples of the region.

[0100] Taking the intra prediction as an example, a line outside the top template region and a column outside the left template region are used as reference samples to predict the template region using an intra prediction mode to obtain the predicted samples of the template region. The SAD cost value of the template region under the prediction mode can be obtained by calculating the absolute difference sum between the reconstructed samples and the predicted samples in the template region. Similarly, the template region is predicted using a line and a column outside the template region as reference samples for all intra prediction modes, and the corresponding SAD cost is calculated. The SAD cost values of all intra prediction modes can be obtained, wherein the prediction mode with the minimum SAD cost value is the intra prediction mode obtained by template matching for the current coding unit. The optimal intra prediction mode uses the neighboring reference samples around the current coding unit to predict the current coding unit to obtain a predicted block.

[0101] The intra prediction mode obtained by template matching can save the code word of transmitting the prediction mode to the decoding end, and the more the prediction modes, the more the code words saved. In the case that the prediction mode represented by the traditional transmission code word method and the template matching method is the same, the technology of saving fewer code words can improve the compression efficiency.

[0102] In addition to using SAD as the calculation method of the cost value, the template region can also use a calculation method such as SATD. SATD is a kind of transform-based absolute error sum, and usually uses Hadamard transform instead of traditional transforms such as DCT2 or DST7. Among them, Hadamard transform has very similar transform characteristics as DCT2, but has smaller calculation amount and is suitable for preliminary cost calculation.

[0103] The area of the template region is usually widthx1 and 1xheight, widthx2 and 2xheight, or widthx4 and 4xheight, and the regions belong to the top and left adjacent regions of the current coding unit, and in some cases, the top-left adjacent region can also be included.

[0104] As can be seen from the above, almost all intra prediction modes in the current ECM reference software allow the use of fusion technology. For example, the traditional intra angular prediction mode can use multiple prediction blocks generated by adjacent angles or different reference lines for weighted fusion, so that the effect of weighted fusion can achieve smoothing of the prediction block and reduce noise. However, the MIP technology does not have a fusion operation, and the encoding end selects the optimal prediction parameters of the current coding unit according to the rate-distortion cost optimization principle, including the MIP mode index and the transposition identification information, and obtains the prediction block of the current coding unit by matrix prediction using the reference samples. The whole prediction process does not have a fusion operation process of multiple prediction blocks, thereby reducing the coding and decoding performance.

[0105] Based on this, the embodiment of the present application provides an encoding method, when the first prediction mode is used for the current block, determining the first candidate prediction block of the current block; when the prediction fusion technology is used for the current block, predicting the current block according to the second prediction mode, determining the second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode; fusing the first candidate prediction block and the second candidate prediction block to determine the prediction block of the current block. The embodiment of the present application also provides a decoding method, decoding the code stream, determining the value of the first syntax element; when the first syntax element indicates that the first prediction mode is used for the current block, determining the first candidate prediction block of the current block; when the prediction fusion technology is used for the current block, predicting the current block according to the second prediction mode, determining the second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode; fusing the first candidate prediction block and the second candidate prediction block to determine the prediction block of the current block.

[0106] In this way, whether at the encoding end or the decoding end, when the MIP technology is used for the current block, the first candidate prediction block of the current block is determined, and then the second prediction mode can also be used to determine the second candidate prediction block of the current block, and by fusing the first candidate prediction block and the second candidate prediction block, the fusion operation of the MIP prediction block and other prediction modes can be realized, which not only can improve the accuracy of prediction and improve the compression efficiency, but also can realize the effect of eliminating noise and smoothing the prediction block, and further improve the coding and decoding performance.

[0107] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0108] FIG. 4 is a schematic diagram of a network architecture of a video coding provided by the embodiment of the present application. As shown in FIG. 4, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. The electronic devices in the implementation can be various types of devices with video coding function, for example, the electronic devices can include a mobile phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital telephone, a video telephone, a television, a sensing device, a server, etc., and the embodiment of the present application is not limited.

[0109] In the embodiment of the present application, a network architecture of a video coding system including a decoding method and an encoding method is provided. The decoder or the encoder in the embodiment of the present application can be the above-mentioned electronic device. That is, the electronic device in the embodiment of the present application has a video coding function, generally including a video / image encoder (referred to as an encoder) and a video / image decoder (referred to as a decoder).

[0110] FIG. 5 is a schematic diagram of a system composition of an encoder according to an embodiment of the present application. As shown in FIG. 5, the encoder 100 can 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 filter unit 108, an encoding unit 109, and a decoded picture buffer unit 110, etc. The filter unit 108 can implement a deblocking filter and a sample adaptive offset (SAO) filter, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input raw video signal, a video coding block can be obtained by the division of a coding tree unit (CTU), and then the residual pixel information obtained after the intra- or inter-frame prediction is transformed by the transform and quantization unit 101 on the video coding block, including transforming the residual information from the pixel domain to the transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-estimation unit 102 and the intra-prediction unit 103 are used for intra-frame prediction of the video coding block; in particular, the intra-estimation unit 102 and the intra-prediction unit 103 are used to determine the intra-prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction encoding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector that can estimate the motion of the video coding block, and then the motion compensation is performed by the motion compensation unit 104 based on the motion vector determined by the motion estimation unit 105; after the intra-prediction mode is determined, the intra-prediction unit 103 is also used to provide the selected intra-prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated determined motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used for the reconstruction of the video coding block, reconstructing the residual block in the pixel domain, which removes the blocking artifact through the filter control analysis unit 107 and the filtering unit 108, and then adds the reconstructed residual block to a predictive block in one of the frames of the decoded image buffer unit 110 to generate a reconstructed video coding block; the encoding unit 109 is used to encode various encoding parameters and quantized transform coefficients, and in the CABAC-based encoding algorithm, the context content can be based on the adjacent coding block, which can be used to encode the information indicating the determined intra-prediction mode, and output the bitstream of the video signal; and the decoded image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video coding blocks are continuously generated, which are all stored in the decoded image buffer unit 110.

[0111] FIG. 6 is a schematic diagram of a structure of a decoder according to an embodiment of the present application. As shown in FIG. 6, the 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 picture buffer unit 206, etc. The decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is processed by the encoder of FIG. 5, a bitstream of the video signal is output. The bitstream is input into the decoder 200, and first passes through the decoding unit 201 to obtain decoded transform coefficients. The inverse transform and inverse quantization unit 202 processes the transform coefficients to generate a residual block in the pixel domain. The intra prediction unit 203 can be used to generate prediction data of a current video decoding block based on a determined intra prediction mode and data from previously decoded blocks of the current frame or picture. The motion compensation unit 204 determines prediction information for the video decoding block by parsing motion vectors and other associated syntax elements, and uses the prediction information to generate a predictive block of the video decoding block being decoded. The decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 and the corresponding predictive block generated by the intra prediction unit 203 or the motion compensation unit 204. The decoded video signal passes through the filtering unit 205 to remove blockiness artifacts and improve video quality. The decoded video block is then stored in the decoded picture buffer unit 206, which stores reference pictures for subsequent intra prediction or motion compensation, and also outputs the video signal, i.e., the original video signal is recovered.

[0112] It should be noted that the method according to the embodiments of the present application is mainly applied to the intra estimation unit 102 and the intra prediction unit 103 as shown in FIG. 5, and the intra prediction unit 203 as shown in FIG. 6. That is, the embodiments of the present application can be applied to an encoder, a decoder, or both, but are not limited here.

[0113] It should be further noted that when the embodiments of the present application are applied to the encoder 100, the "current block" specifically refers to a current block to be encoded (also referred to as an "encoding block") in a video image. When the embodiments of the present application are applied to the decoder 200, the "current block" specifically refers to a current block to be decoded (also referred to as a "decoding block") in a video image.

[0114] In an embodiment of the present application, FIG. 7 is a flowchart of a decoding method according to an embodiment of the present application. As shown in FIG. 7, the method can include:

[0115] S701, decoding the bitstream to determine a value of the first syntax element.

[0116] It should be noted that in the embodiments of the present application, the method is applied to a decoder. Specifically, based on the component structure of the decoder 200 shown in FIG. 6, the decoding method of the embodiments of the present application is mainly applied to a block of intra prediction. Wherein, when the current block uses an intra prediction mode, the prediction block fusion scheme proposed for the MIP technology here can improve the compression efficiency.

[0117] It should be further noted that in the embodiments of the present application, some mode indication information (or mode flag) in the form of syntax elements can be written in the bitstream. In this way, by parsing the values of the syntax elements in the bitstream, the prediction mode used by the current block can be determined. Exemplarily, a first syntax element can be used to indicate whether the first prediction mode is used by the current block, a second syntax element can be used to indicate whether the prediction fusion technology is used by the current block, a third syntax element can be used to indicate whether the matrix-based intra prediction mode is allowed to be used by the current sequence, and a fourth syntax element can be used to indicate the prediction type of the current block. Wherein, the prediction type includes intra prediction or inter prediction.

[0118] In some embodiments, the method can include: decoding the bitstream, determining the value of the third syntax element; when the third syntax element indicates that the matrix-based intra prediction mode is allowed to be used by the current sequence, decoding the bitstream, determining the value of the fourth syntax element; and when the fourth syntax element indicates that the prediction type of the current block is intra prediction, performing the step of decoding the bitstream, determining the value of the first syntax element.

[0119] In the embodiments of the present application, the current sequence can include the current block. Wherein, the third syntax element is a sequence-level syntax element, and the first syntax element, the second syntax element and the fourth syntax element are CU-level syntax elements.

[0120] In some embodiments, if the value of the third syntax element is a first value, it is determined that the third syntax element indicates that the matrix-based intra prediction mode is allowed to be used by the current sequence; and if the value of the third syntax element is a second value, it is determined that the third syntax element indicates that the matrix-based intra prediction mode is not allowed to be used by the current sequence.

[0121] In some embodiments, if the value of the fourth syntax element is a first value, it is determined that the fourth syntax element indicates that the prediction type of the current block is intra prediction; and if the value of the fourth syntax element is a second value, it is determined that the fourth syntax element indicates that the prediction type of the current block is inter prediction.

[0122] In some embodiments, if the value of the first syntax element is a first value, it is determined that the first syntax element indicates that the first prediction mode is used by the current block; and if the value of the first syntax element is a second value, it is determined that the first syntax element indicates that the first prediction mode is not used by the current block.

[0123] In the embodiments of the present application, the first value is different from the second value. The first value can be set as 1, and the second value can be set as 0; or the first value can be set as 0, and the second value can be set as 1; or the first value can be set as true, and the second value can be set as false; or the first value can be set as false, and the second value can be set as true.

[0124] In the embodiments of the present application, the third syntax element can be referred to as a MIP enable flag, which is a sequence level flag, denoted as sps_mip_enable_flag. The first syntax element can be referred to as a MIP use flag, which is a CU level flag.

[0125] Exemplarily, taking true as the first value and false as the second value as an example, the decoding end first decodes the value of the third syntax element to determine whether the MIP mode is allowed to be used in the current sequence; if the value of the third syntax element is true, it indicates that the MIP mode is allowed to be used in the current sequence, then the decoding end continues to decode the value of the fourth syntax element; if the value of the fourth syntax element is true, it indicates that the prediction type of the current block is intra prediction, then the decoding end continues to decode the value of the first syntax element, i.e., the MIP use flag of the current block, to determine whether the first prediction mode is used in the current block, i.e., whether the MIP technology is used in the current block. In other words, the first prediction mode here can be a matrix-based intra prediction mode.

[0126] S702, determining the first candidate prediction block of the current block when the first syntax element indicates that the first prediction mode is used in the current block.

[0127] In the embodiments of the present application, if the value of the first syntax element is true, it indicates that the MIP technology is used in the current block, at this time, the first candidate prediction block of the current block can be determined based on the MIP technology.

[0128] In some embodiments, when the MIP technology is used in the current block, for determining the first candidate prediction block of the current block, after step S701, referring to FIG. 8, the method can comprise:

[0129] S801, decoding the code stream to determine the first prediction parameter of the current block when the first syntax element indicates that the first prediction mode is used in the current block.

[0130] S802, predicting the current block according to the first prediction parameter to determine the first candidate prediction block of the current block.

[0131] In the embodiments of the present application, if the value of the first syntax element is true, the decoding end needs to continue decoding the first prediction parameter of the current block. The first prediction parameter can include first transposition identification information and first weight matrix index information, and the weight matrix index information can also be referred to as "MIP mode index". Then, the first candidate prediction block of the current block can be determined according to the first prediction parameter. Specifically, the prediction samples in the first candidate prediction block of the current block are determined by predicting the samples in the current block according to the first prediction parameter.

[0132] In a specific embodiment, the prediction of the current block according to the first prediction parameter to determine the first candidate prediction block of the current block can include: performing down-sampling processing on the neighboring reference samples of the current block to determine an initial input vector of the current block; determining a first target input vector of the current block according to the first transposition identification information and the initial input vector; determining a first weight matrix of the current block according to the first weight matrix index information, and performing multiplication operation on the first target input vector and the first weight matrix to determine a first output vector of the current block; and determining the first candidate prediction block of the current block according to the first transposition identification information and the first output vector of the current block.

[0133] In a possible implementation, the determination of the first candidate prediction block of the current block according to the first transposition identification information and the first output vector of the current block can include: arranging and placing the first output vector according to the first transposition identification information to determine a first intermediate prediction block of the current block; and determining the first intermediate prediction block as the first candidate prediction block of the current block.

[0134] In another possible implementation, the determination of the first candidate prediction block of the current block according to the first transposition identification information and the first output vector of the current block can include: arranging and placing the first output vector according to the first transposition identification information to determine a first intermediate prediction block of the current block; and performing up-sampling processing on the first intermediate prediction block to determine the first candidate prediction block of the current block.

[0135] Here, the prediction samples in the first intermediate prediction block of the current block can be determined according to the first output vector of the current block, and then the prediction samples in the first candidate prediction block are determined by performing up-sampling processing on the prediction samples in the first intermediate prediction block.

[0136] In the embodiments of the present application, according to the size information of the current block, the class index value of the current block can be determined, which is denoted as classIdx (or sizeId). Then, the number of input vector elements and the number of output vector elements of the current block can be determined according to the classIdx.

[0137] For example, if classIdx is equal to 0, the number of input vector elements is 4 and the number of output vector elements is 16; if classIdx is equal to 1, the number of input vector elements is 8 and the number of output vector elements is 16; if classIdx is equal to 2, the number of input vector elements is 7 and the number of output vector elements is 64.

[0138] In the embodiment of the present application, the neighboring reference samples of the current block are down-sampled to determine an initial input vector of the current block, and the number of elements in the initial input vector is equal to the number of input vector elements. Then, according to the first transposition identification information and the initial input vector, a first target input vector of the current block is determined, which can be obtained by splicing the initial input vector according to the first transposition identification information and processing the spliced input vector. Assuming that the initial input vector of the current block includes a left boundary input vector bdry RedLeft and an upper boundary input vector bdry RedTop , when splicing, if the first transposition identification information indicates normal input, bdry RedTop is in front of bdry RedLeft ; if the first transposition identification information indicates transposed input, bdry RedLeft is in front of bdry RedTop .

[0139] In the embodiment of the present application, after the number of output vector elements of the current block is determined according to the size information of the current block, the first target input vector and the first weight matrix are multiplied to determine a first output vector of the current block, and the number of elements in the first output vector is equal to the number of output vector elements.

[0140] In the embodiment of the present application, according to the first transposition identification information and the first output vector of the current block, a first candidate prediction block of the current block is determined, which can be specifically obtained by arranging and placing the first output vector of the current block according to the first transposition identification information to obtain prediction samples in a first intermediate prediction block of the current block; and then the prediction samples in the first intermediate prediction block are up-sampled to determine the prediction samples in the first candidate prediction block of the current block. Here, the up-sampling can be interpolation processing. For example, according to the first transposition identification information, each element in the first output vector is placed in the corresponding position according to the arrangement order shown in FIG. 2. The interpolation order follows the horizontal linear interpolation first, and then the vertical linear interpolation. The method of horizontal linear interpolation is similar to that of vertical linear interpolation. The missing sample points are obtained by linear interpolation with the help of the left and right adjacent samples, and then the new sample points are obtained by linear interpolation with the help of the upper and lower adjacent samples. After interpolation up-sampling, the first candidate prediction block with the same size as the current block is obtained.

[0141] It should be noted that in the embodiments of the present application, the first candidate prediction block obtained according to the first transposed identification information and the first output vector of the current block can be a prediction block before upsampling, or can also be a prediction block after upsampling. In other words, when the prediction fusion technology is used for the current block, each candidate prediction block can be fused before upsampling, or each candidate prediction block can be fused after upsampling.

[0142] S703, when the prediction fusion technology is used for the current block, the current block is predicted according to the second prediction mode to determine the second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode.

[0143] It should be noted that in the embodiments of the present application, the first prediction mode includes a matrix-based intra prediction mode; and the second prediction mode includes a prediction mode other than the matrix-based intra prediction mode.

[0144] In a specific embodiment, the second prediction mode includes at least one of the following: an angle prediction mode, a diagonal prediction mode, a PLANAR mode, a DC mode, a block copy mode, an intra template matching prediction mode, a super-interpolation prediction mode and a template matching-based prediction mode.

[0145] In a more specific embodiment, taking the template matching-based prediction mode as an example, the current block is predicted according to the second prediction mode to determine the second candidate prediction block of the current block, referring to FIG. 9, the method can include:

[0146] S901, determining a template region of the current block.

[0147] S902, determining a second prediction parameter of the current block based on the template region.

[0148] S903, predicting the current block according to the second prediction parameter to determine the second candidate prediction block of the current block.

[0149] In some embodiments, determining the template region of the current block can include: determining the template region of the current block according to a neighboring region of the current block; wherein the neighboring region of the current block includes at least one of the following: a region directly above the current block, a region directly left of the current block and a region above left of the current block.

[0150] In the embodiments of the present application, the template region of the current block can be a rectangular region aligned with the current block. For example, the diagonal filled region shown in FIG. 3, which can specifically include the region directly above the current block and / or the region directly left of the current block.

[0151] In the embodiments of the present application, the template region of the current block can be a rectangular region of the current block which is not aligned. For example, the diagonal filled region shown in FIG. 10, considering the particularity of the MIP technology, the input and output of which are vectors, the template region can also be the top-left neighboring region of the current block, as shown in FIG. 10, instead of the top and left neighboring regions of the current block.

[0152] It should also be noted that, as shown in FIG. 10, the width and height of the template region are the same as the size of the current block. The number of rows and columns of the template region can be 1 row and 1 column, 2 rows and 2 columns, or 4 rows and 4 columns, etc., which are not limited here.

[0153] In some embodiments, determining the second prediction parameter of the current block based on the template region can include: determining a plurality of groups of candidate prediction parameters of the current block; performing cost calculation on the template region using the plurality of groups of candidate prediction parameters to determine cost results corresponding to the plurality of groups of candidate prediction parameters; and determining the second prediction parameter of the current block from the plurality of groups of candidate prediction parameters according to the cost results corresponding to the plurality of groups of candidate prediction parameters. In this way, the samples in the current block are predicted according to the second prediction parameter to determine the prediction samples in the second candidate prediction block of the current block.

[0154] In the embodiments of the present application, the current block allows to try a plurality of groups of candidate prediction parameters in the MIP mode, and each group of candidate prediction parameters can include candidate transposition identification information and candidate weight matrix index information, which are used to predict the template region to determine the prediction samples of the template region corresponding to different candidate prediction parameters, so that the cost results corresponding to different candidate prediction parameters can be calculated.

[0155] In the embodiments of the present application, the first group of candidate prediction parameters is any one of the plurality of groups of candidate prediction parameters. Taking the first group of candidate prediction parameters as an example, for determining the cost result corresponding to the first group of candidate prediction parameters, it can include: predicting the template region according to the first group of candidate prediction parameters to determine the prediction samples of the template region corresponding to the first group of candidate prediction parameters; and performing cost calculation on the prediction samples of the template region and the reconstructed samples of the template region to determine the cost result corresponding to the first group of candidate prediction parameters.

[0156] In some embodiments, the first set of candidate prediction parameters comprises first candidate transposition identification information and first candidate weight matrix index information; and correspondingly, determining the prediction samples of the template region according to the first set of candidate prediction parameters and the neighboring reference samples of the template region can comprise: performing down-sampling processing on the neighboring reference samples of the template region to determine an initial input vector of the template region; determining a target input vector of the template region according to the first candidate transposition identification information and the initial input vector; determining a weight matrix of the template region according to the first candidate weight matrix index information, and performing multiplication operation on the target input vector and the weight matrix to determine an output vector of the template region; and determining the prediction samples of the template region according to the first candidate transposition identification information and the output vector of the template region.

[0157] In a possible implementation, determining the prediction samples of the template region according to the first candidate transposition identification information and the output vector of the template region can comprise: arranging and placing the output vector of the template region according to the first candidate transposition identification information to determine initial prediction samples of the template region; and determining the prediction samples of the template region as the initial prediction samples.

[0158] In another possible implementation, determining the prediction samples of the template region according to the first candidate transposition identification information and the output vector of the template region can comprise: arranging and placing the output vector of the template region according to the first candidate transposition identification information to determine initial prediction samples of the template region; and performing up-sampling processing on the initial prediction samples of the template region to determine the prediction samples of the template region.

[0159] That is, in the embodiments of the present application, for the prediction samples of the template region, the prediction samples before up-sampling can be determined as the prediction samples of the template region, or the prediction samples after up-sampling can also be determined as the prediction samples of the template region.

[0160] In addition, in the embodiments of the present application, after the template region of the current block is determined, the neighboring reference samples outside the template region can be obtained for down-sampling to determine the initial input vector of the template region. Exemplarily, the last row and the left column outside the template region can be used as the neighboring reference samples of the template region for down-sampling to determine the left input vector and the upper input vector of the template region.

[0161] In the embodiment of the present application, the target input vector of the template region is determined according to the first candidate transposition identification information and the initial input vector. The target input vector of the template region can be determined by splicing the initial input vector according to the first candidate transposition identification information and processing the spliced input vector. Assuming that the initial input vector of the template region includes a left input vector and an upper input vector, when splicing, if the first candidate transposition identification information indicates normal input, the upper input vector is in front of the left input vector; if the transposition identification information indicates transposed input, the left input vector is in front of the upper input vector.

[0162] In the embodiment of the present application, the weight matrix of the template region is determined according to the first candidate weight matrix index information, and the multiplication operation is performed on the target input vector and the weight matrix to determine the output vector of the template region. Then, each element in the output vector is placed in the corresponding position according to the arrangement order shown in FIG. 2. If the first candidate transposition identification information indicates transposed input, i.e., transposition is needed, each element in the output vector is placed column by column from top to bottom in order; otherwise, if the first candidate transposition identification information indicates normal input, i.e., transposition is not needed, each element in the output vector is placed row by row from left to right in order.

[0163] In the embodiment of the present application, when the initial prediction sample of the template region is up-sampled, the up-sampling here can be interpolation processing. Specifically, the interpolation order can follow the horizontal linear interpolation first. The missing sample points are linearly interpolated by the left and right adjacent sample points to obtain new sample points, and then the vertical linear interpolation is performed. The method is similar to the horizontal interpolation. The missing sample points are linearly interpolated by the upper and lower adjacent sample points to obtain new sample points. After interpolation up-sampling, the prediction sample of the same size as the current template region is obtained.

[0164] In the embodiment of the present application, after the prediction sample of the template region is determined, the cost result corresponding to the first group of candidate prediction parameters can be obtained by performing cost calculation on the prediction sample of the template region and the reconstructed sample of the template region. The cost calculation here can be determined according to the cost result of rate distortion optimization (RDO), or can be determined according to the cost result of sum of absolute difference (SAD), or can be determined according to the cost result of sum of absolute transformed difference (SATD), but here is not limited in any way.

[0165] In this way, after the cost results corresponding to the first set of candidate prediction parameters are determined, the cost results corresponding to other sets of candidate prediction parameters can be determined in the same way as described above, to obtain the cost results corresponding to the multiple sets of candidate prediction parameters.

[0166] In some embodiments, determining the second prediction parameters of the current block from the cost results corresponding to the multiple sets of candidate prediction parameters can include: determining a first cost result and a second cost result from the cost results corresponding to the multiple sets of candidate prediction parameters; and determining the second prediction parameters of the current block according to the candidate prediction parameters corresponding to the first cost result and the candidate prediction parameters corresponding to the second cost result.

[0167] In the embodiments of the present application, the first cost result represents the minimum cost result among the cost results corresponding to the multiple sets of candidate prediction parameters, and therefore the first cost result can be referred to as the minimum cost result (or "optimal cost result"), represented by SATD best ; and the second cost result represents the minimum cost result among the cost results corresponding to the multiple sets of candidate prediction parameters, except for the first cost result, and therefore the second cost result can be referred to as the second minimum cost result (or "suboptimal cost result"), represented by SATD secondbest .

[0168] That is, in the embodiments of the present application, considering that the candidate prediction parameters that can be selected can be the same as the first prediction parameters described above, the minimum cost result (SATD best ) and the second minimum cost result (SATD secondbest ) each corresponding to the candidate prediction parameters are retained according to the cost results corresponding to the multiple sets of candidate prediction parameters.

[0169] In a specific embodiment, determining the second prediction parameters of the current block according to the candidate prediction parameters corresponding to the first cost result and the candidate prediction parameters corresponding to the second cost result can include: if the candidate prediction parameters corresponding to the first cost result are the same as the first prediction parameters, determining the candidate prediction parameters corresponding to the second cost result as the second prediction parameters of the current block; or, if the candidate prediction parameters corresponding to the first cost result are different from the first prediction parameters, determining the candidate prediction parameters corresponding to the first cost result as the second prediction parameters of the current block.

[0170] That is, if the candidate prediction parameters corresponding to SATD best are different from the first prediction parameters, that is, the first candidate prediction block obtained by predicting the current block according to the first prediction parameters obtained through decoding is different from the second candidate prediction block obtained by predicting the current block according to the candidate prediction parameters corresponding to SATD best , then the candidate prediction parameters corresponding to SATD bestThe corresponding candidate prediction parameter is predicted to obtain a second candidate prediction block. Otherwise, if the SATD best The corresponding candidate prediction parameter is the same as the first prediction parameter, that is, the first candidate prediction block is obtained by predicting the current block according to the decoded first prediction parameter. best The corresponding candidate prediction parameter is the same as the first prediction parameter, that is, the first candidate prediction block is obtained by predicting the current block according to the decoded first prediction parameter. secondbest The corresponding candidate prediction parameter is predicted to obtain a second candidate prediction block.

[0171] In a specific embodiment, the second prediction parameter can include second transposition identification information and second weight matrix index information. Accordingly, predicting the current block according to the second prediction parameter to determine the second candidate prediction block of the current block can include: performing down-sampling processing on the neighboring reference samples of the current block to determine an initial input vector of the current block; determining a second target input vector of the current block according to the second transposition identification information and the initial input vector; determining a second weight matrix of the current block according to the second weight matrix index information, and performing multiplication operation on the second target input vector and the second weight matrix to determine a second output vector of the current block; and determining the second candidate prediction block of the current block according to the second transposition identification information and the second output vector of the current block.

[0172] In a possible implementation, determining the second candidate prediction block of the current block according to the second transposition identification information and the second output vector of the current block can include: arranging and placing the second output vector according to the second transposition identification information to determine a second intermediate prediction block of the current block; and determining the second candidate prediction block of the current block as the second intermediate prediction block.

[0173] In another possible implementation, determining the second candidate prediction block of the current block according to the second transposition identification information and the second output vector of the current block can include: arranging and placing the second output vector according to the second transposition identification information to determine a second intermediate prediction block of the current block; and performing up-sampling processing on the second intermediate prediction block to determine the second candidate prediction block of the current block.

[0174] Here, the prediction samples in the second intermediate prediction block of the current block can be determined according to the second output vector of the current block, and then the prediction samples in the second intermediate prediction block are up-sampled to determine the prediction samples in the second candidate prediction block.

[0175] It should be noted that in the embodiments of the present application, the second candidate prediction block obtained after upsampling has the same size as the current block. In addition, the prediction samples in the second candidate prediction block are determined by predicting the samples in the current block according to the second prediction parameter, and the specific process is the same as that of determining the prediction samples in the first candidate prediction block by predicting the samples in the current block according to the first prediction parameter, which will not be described here in detail.

[0176] It should be further noted that in the embodiments of the present application, the second candidate prediction block obtained according to the second transposition identification information and the second output vector of the current block can be a prediction block before upsampling or a prediction block after upsampling. In other words, when the prediction fusion technology is used for the current block, the candidate prediction blocks can be fused before upsampling or the candidate prediction blocks can be fused after upsampling.

[0177] S704, fusing the first candidate prediction block and the second candidate prediction block to determine the prediction block of the current block.

[0178] In the embodiments of the present application, after obtaining the first candidate prediction block and the second candidate prediction block, fusing the first candidate prediction block and the second candidate prediction block to determine the prediction block of the current block can include: determining a first weight of the first candidate prediction block and a second weight of the second candidate prediction block; and performing weighted operation according to the first weight and the first candidate prediction block and the second weight and the second candidate prediction block to determine the prediction block of the current block. Specifically, in the embodiments of the present application, the prediction samples in the prediction block of the current block can be determined by performing weighted operation according to the first weight and the prediction samples in the first candidate prediction block and the second weight and the prediction samples in the second candidate prediction block.

[0179] In the embodiments of the present application, the prediction block of the current block can be represented by PredfinalIndex, the first candidate prediction block can be represented by Pred MIPIndex , the first weight can be represented by Weight1, the second candidate prediction block can be represented by Pred Temp , and the second weight can be represented by Weight2. The specific calculation formula for fusing the first candidate prediction block and the second candidate prediction block is as follows: PredfinalIndex = Pred MIPIndex × Weight1 + Pred Temp × Weight2 (1)

[0180] In the embodiments of the present application, Weight1 and Weight2 can be preset values. For example, Weight1 can be set to 3 / 4, Weight2 can be set to 1 / 4, etc., which will not be specifically limited here.

[0181] In some embodiments, the method of determining the above-mentioned weight can also be a look-up table (LUT) implementation method. Compared with the above-mentioned formula calculation, the look-up table method can omit the division operation, and is more friendly to the implementation of software and hardware, but can easily have a difference in precision.

[0182] It can be understood that, in the embodiments of the present application, the number of candidate prediction blocks used for fusion is not limited to two, and can be two, three, four, five, six, etc. The number herein is a natural number and is not specifically limited.

[0183] It can also be understood that, in the embodiments of the present application, whether the prediction fusion technology is used for the current block can be determined by a second syntax element in a code stream, or can be determined according to a cost result.

[0184] In a possible implementation, the method can include: decoding a code stream, determining a value of a second syntax element; and determining whether the prediction fusion technology is used for the current block according to the value of the second syntax element.

[0185] In the embodiments of the present application, determining whether the prediction fusion technology is used for the current block according to the value of the second syntax element can include: if the value of the second syntax element is a first value, determining that the prediction fusion technology is used for the current block; and if the value of the second syntax element is a second value, determining that the prediction fusion technology is not used for the current block.

[0186] In the embodiments of the present application, the first value is different from the second value. The first value can be set as 1, and the second value can be set as 0; or the first value can be set as 0, and the second value can be set as 1; or the first value can be set as true, and the second value can be set as false; or the first value can be set as false, and the second value can be set as true.

[0187] That is, in the embodiments of the present application, whether the prediction fusion technology is used for the current block can be identified by using a separate syntax element to indicate whether fusion is used or not. For example, if the value of the second syntax element obtained by decoding is true, it is determined that the prediction fusion technology is used for the current block; and if the value of the second syntax element obtained by decoding is false, it is determined that the prediction fusion technology is not used for the current block.

[0188] In another possible implementation, the method can include: determining a third cost result of a template region corresponding to the case that the prediction fusion technology is used for the current block, and a fourth cost result of the template region corresponding to the case that the prediction fusion technology is not used for the current block; and determining whether the prediction fusion technology is used for the current block according to the third cost result and the fourth cost result.

[0189] In some embodiments, determining whether the current block uses the prediction fusion technique according to the third cost result and the fourth cost result can include: if the third cost result is less than the fourth cost result, determining that the current block uses the prediction fusion technique; and if the third cost result is greater than the fourth cost result, determining that the current block does not use the prediction fusion technique.

[0190] That is, in the embodiments of the present application, the decoding end can determine whether the current block uses the prediction fusion technique by fusing the distortion cost values, such as SATD or SAD, of the prediction block and the non-fusion prediction block in the template region, so as to save the overhead of transmitting the second syntax element (or referred to as "fusion identification bit").

[0191] In some embodiments, when the current block does not use the prediction fusion technique, referring to FIG. 11, the method can further include:

[0192] S1101, when the current block does not use the prediction fusion technique, decoding the code stream to determine a first prediction parameter of the current block.

[0193] S1102, predicting the current block according to the first prediction parameter to determine a first candidate prediction block of the current block.

[0194] S1103, determining a prediction block of the current block according to the first candidate prediction block.

[0195] In the embodiments of the present application, when the current block does not use the prediction fusion technique, the prediction block of the current block can be determined based on the first prediction mode. Specifically, the prediction samples in the first candidate prediction block can be obtained by predicting the samples in the current block according to the first prediction parameter obtained by parsing the code stream, and the prediction samples can be determined as the prediction block of the current block.

[0196] That is, in the embodiments of the present application, if the current block does not use the prediction fusion technique, the first candidate prediction block Pred MIPIndex is determined as the prediction block of the current block based on the first prediction parameter obtained by parsing the code stream. MIPIndex , wherein PredfinalIndex is the prediction block output of the current block under the first prediction parameter obtained by parsing the code stream.

[0197] It can also be understood that, in the embodiments of the present application, after the prediction block of the current block is determined, the method can further include: decoding the code stream to determine the residual block of the current block; and determining the reconstructed block of the current block according to the prediction block of the current block and the residual block of the current block. Specifically, the reconstructed block of the current block can be determined by performing addition operation on the prediction block and the residual block. More specifically, the reconstructed sample of the current block can be determined by performing addition operation on the prediction sample in the prediction block and the residual sample in the residual block.

[0198] It can also be understood that, in the embodiments of the present application, when the current block does not use the MIP technology, the decoding end needs to continue to decode the code stream to determine the other prediction mode used by the current block, and then determine the prediction block of the current block by using the other prediction mode; and finally the reconstructed block of the current block can be determined by performing addition operation on the decoded residual block and the prediction block of the current block.

[0199] It can also be understood that, in the embodiments of the present application, after all the reconstructed blocks in the current image are obtained via loop filtering or other technologies, the final reconstructed image can be obtained, which can be simultaneously output as a video image and used as a subsequent decoding reference.

[0200] It can also be understood that, in the embodiments of the present application, for the second prediction mode, a mode such as the PLANAR mode can be used instead of the fusion candidate (i.e., the second candidate prediction block) derived from the template region.

[0201] For example, if the angle prediction mode is used instead of the fusion candidate derived from the template region, the template region and the MIP prediction block can be derived using the DIMD or TIMD to obtain a traditional intra prediction mode, and then the current block can be predicted according to the traditional intra prediction mode to determine the second candidate prediction block of the current block.

[0202] For example, if the intraTMP or IBC block copy technology is used instead of the fusion candidate derived from the template region, the prediction block obtained by the optimal BV candidate of the intraTMP mode can be used as the second candidate prediction block to be fused with the MIP prediction block; or the prediction block obtained by the Merge candidate of the IBC mode can also be used as the second candidate prediction block to be fused with the MIP prediction block.

[0203] For example, if the EIP decoding end derivation technology is used instead of the fusion candidate derived from the template region, the prediction block obtained by the Merge candidate of the EIP can be used as the second candidate prediction block to be fused with the MIP prediction block.

[0204] The embodiment of the present application provides a decoding method, which comprises the following steps: decoding a code stream, determining the value of a first syntax element; when the first syntax element indicates that a first prediction mode is used for a current block, determining a first candidate prediction block of the current block; when the prediction fusion technology is used for the current block, predicting the current block according to a second prediction mode, determining a second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode; and fusing the first candidate prediction block and the second candidate prediction block to determine a prediction block of the current block. In this way, when the MIP technology is used for the current block, the first candidate prediction block of the current block is determined, and then the second candidate prediction block of the current block can also be determined by using the second prediction mode. Through the fusion of the first candidate prediction block and the second candidate prediction block, the fusion operation of the MIP prediction block and other prediction modes can be realized, the prediction accuracy can be improved, the compression efficiency is improved, the effect of eliminating noise and smoothing the prediction block can be realized, and the coding performance is improved.

[0205] In another embodiment of the present application, Fig. 12 is a flowchart of an encoding method provided by the embodiment of the present application. As shown in Fig. 12, the method can comprise the following steps:

[0206] S1201, when a first prediction mode is used for a current block, determining a first candidate prediction block of the current block.

[0207] It should be noted that in the embodiment of the present application, the method is applied to an encoder. Specifically, based on the composition structure of the encoder 100 shown in Fig. 5, the encoding method of the embodiment of the present application is mainly applied to the block of the intra prediction. When the current block adopts the intra prediction mode, the prediction block fusion scheme proposed for the MIP technology can improve the compression efficiency.

[0208] It should be further noted that in the embodiment of the present application, some mode indication information (or mode flag) in the form of syntax element can be written in the code stream. In this way, by analyzing the value of the syntax element in the code stream, the prediction mode used for the current block can be determined. Exemplarily, the first syntax element can be used to indicate whether the first prediction mode is used for the current block, the second syntax element can be used to indicate whether the prediction fusion technology is used for the current block, the third syntax element can be used to indicate whether the matrix-based intra prediction mode is allowed to be used for the current sequence, and the fourth syntax element can be used to indicate the prediction type of the current block. The prediction type comprises intra prediction or inter prediction.

[0209] In some embodiments, the method can comprise the following steps: determining the value of a third syntax element; wherein the third syntax element is used to indicate whether the matrix-based intra prediction mode is allowed to be used for the current sequence; and encoding the value of the third syntax element, and writing the obtained coded bits into the code stream.

[0210] In some embodiments, when the current sequence allows the use of the matrix-based intra prediction mode, the method can comprise: determining a value of the fourth syntax element; wherein the fourth syntax element is used to indicate the prediction type of the current block; and encoding the value of the fourth syntax element, and writing the obtained coded bits into the bitstream.

[0211] In some embodiments, when the prediction type of the current block is intra prediction, the method can comprise: determining a value of the first syntax element, wherein the first syntax element is used to indicate whether the first prediction mode is used for the current block; and encoding the value of the first syntax element, and writing the obtained coded bits into the bitstream.

[0212] In some embodiments, when the current block uses the first prediction mode, the method can comprise: determining a value of the second syntax element, wherein the second syntax element is used to indicate whether the prediction fusion technology is used for the current block; and encoding the value of the second syntax element, and writing the obtained coded bits into the bitstream.

[0213] In the embodiments of the present application, the current sequence can comprise the current block. The third syntax element is a sequence-level syntax element, and the first syntax element, the second syntax element and the fourth syntax element are CU-level syntax elements.

[0214] In some embodiments, if the current sequence allows the use of the matrix-based intra prediction mode, the value of the third syntax element is determined to be a first value, and the third syntax element indicates; if the current sequence does not allow the use of the matrix-based intra prediction mode, the value of the third syntax element is determined to be a second value.

[0215] In some embodiments, if the prediction type of the current block is intra prediction, the value of the fourth syntax element is determined to be a first value; if the prediction type of the current block is inter prediction, the value of the fourth syntax element is determined to be a second value.

[0216] In some embodiments, if the current block uses the first prediction mode, the value of the first syntax element is determined to be a first value; if the current block does not use the first prediction mode, the value of the first syntax element is determined to be a second value.

[0217] In some embodiments, if the current block uses the prediction fusion technology, the value of the second syntax element is determined to be a first value; if the current block does not use the prediction fusion technology, the value of the second syntax element is determined to be a second value.

[0218] In the embodiments of the present application, the first value is different from the second value. The first value can be set as 1, and the second value can be set as 0; or the first value can be set as 0, and the second value can be set as 1; or the first value can be set as true, and the second value can be set as false; or the first value can be set as false, and the second value can be set as true.

[0219] In the embodiments of the present application, the third syntax element can be referred to as a MIP enable flag, which is a sequence level flag, denoted as sps_mip_enable_flag. The first syntax element can be referred to as a MIP use flag, which is a CU level flag.

[0220] Exemplarily, taking true as the first value and false as the second value as an example, the encoding end first determines whether the current sequence allows the use of the MIP mode, and writes the value of the third syntax element into the code stream; if the value of the third syntax element is true, it indicates that the current sequence allows the use of the MIP mode, then the prediction type of the current block is determined, and the value of the fourth syntax element is written into the code stream; if the value of the fourth syntax element is true, it indicates that the prediction type of the current block is intra prediction, then it is determined whether the current block uses the first prediction mode, i.e., whether the current block uses the MIP technology, and the value of the first syntax element is written into the code stream; if the current block uses the MIP technology, then it is determined whether the current block uses the prediction fusion technology, and the value of the second syntax element is written into the code stream. It should be noted that the first prediction mode here can be a matrix-based intra prediction mode.

[0221] It can be understood that in the embodiments of the present application, if the value of the first syntax element is true, it indicates that the current block uses the MIP technology, at this time the first candidate prediction block of the current block can be determined based on the MIP technology.

[0222] In some embodiments, when the current block uses the MIP technology, for determining the first candidate prediction block of the current block, the method can include: determining a first prediction parameter of the current block; predicting the current block according to the first prediction parameter to determine the first candidate prediction block of the current block.

[0223] In the embodiments of the present application, if the current block uses the MIP technology, then the first candidate prediction block of the current block can be determined according to the first prediction parameter. The first prediction parameter can include first transposition identification information and first weight matrix index information. Specifically, the first candidate prediction block of the current block can be determined by predicting the samples in the current block according to the first prediction parameter to determine the prediction samples in the first candidate prediction block of the current block.

[0224] In some embodiments, determining the first prediction parameter of the current block can include: determining a plurality of groups of candidate prediction parameters of the current block; predicting the current block using the plurality of groups of candidate prediction parameters to determine a plurality of groups of candidate prediction blocks of the current block; fusing the plurality of groups of candidate prediction blocks and the second candidate prediction block respectively to determine a plurality of groups of fused blocks of the current block; performing rate-distortion cost calculation on the plurality of groups of fused blocks of the current block and the original block of the current block respectively to determine first rate-distortion cost values corresponding to the plurality of groups of candidate prediction parameters; determining a minimum cost value from the first rate-distortion cost values corresponding to the plurality of groups of candidate prediction parameters, and determining a candidate prediction parameter corresponding to the minimum cost value as the first prediction parameter of the current block.

[0225] In some embodiments, the method can further include: when the current block uses the first prediction mode, encoding the first prediction parameter of the current block, and writing the obtained encoding bits into a bitstream.

[0226] In the embodiments of the present application, the cost calculation herein can be SAD cost calculation, SATD cost calculation, etc. in addition to rate-distortion cost calculation, but is not limited herein.

[0227] That is, in the embodiments of the present application, taking one group of candidate prediction parameters as an example, a candidate prediction block of the current block is determined by predicting the current block according to the group of candidate prediction parameters; a fused block of the current block is determined by fusing the candidate prediction block and the second candidate prediction block; a first rate-distortion cost value corresponding to the group of candidate prediction parameters is determined by performing rate-distortion cost calculation on the fused block of the current block and the original block of the current block; and the first prediction parameter of the current block, i.e., the optimal prediction parameter of the current block, is determined by taking the candidate prediction parameter corresponding to the minimum cost value among the first rate-distortion cost values corresponding to the plurality of groups of candidate prediction parameters.

[0228] In some embodiments, after the first prediction parameter of the current block is obtained, predicting the current block according to the first prediction parameter to determine a first candidate prediction block of the current block can include: performing downsampling processing on neighboring reference samples of the current block to determine an initial input vector of the current block; determining a first target input vector of the current block according to the first transposition identification information and the initial input vector; determining a first weight matrix of the current block according to the first weight matrix index information, and performing multiplication operation on the first target input vector and the first weight matrix to determine a first output vector of the current block; and determining the first candidate prediction block of the current block according to the first transposition identification information and the first output vector of the current block.

[0229] In a possible implementation, determining the first candidate prediction block of the current block according to the first transposition identification information and the first output vector of the current block can include: arranging and placing the first output vector according to the first transposition identification information, to determine a first intermediate prediction block of the current block; and determining the first intermediate prediction block as the first candidate prediction block of the current block.

[0230] In another possible implementation, determining the first candidate prediction block of the current block according to the first transposition identification information and the first output vector of the current block can include: arranging and placing the first output vector according to the first transposition identification information, to determine a first intermediate prediction block of the current block; and performing up-sampling processing on the first intermediate prediction block, to determine the first candidate prediction block of the current block.

[0231] Here, the prediction samples in the first intermediate prediction block of the current block can be determined according to the first output vector of the current block, and then the prediction samples in the first candidate prediction block are determined by performing up-sampling processing on the prediction samples in the first intermediate prediction block.

[0232] In the embodiment of the present application, according to the size information of the current block, the class index value of the current block can be determined, which is denoted as classIdx (or sizeId). Then, according to the classIdx, the input vector element number and the output vector element number of the current block can be determined.

[0233] For example, if the classIdx is equal to 0, the input vector element number is 4 and the output vector element number is 16; if the classIdx is equal to 1, the input vector element number is 8 and the output vector element number is 16; if the classIdx is equal to 2, the input vector element number is 7 and the output vector element number is 64.

[0234] In the embodiment of the present application, the neighboring reference samples of the current block are down-sampled to determine an initial input vector of the current block, and the number of elements in the initial input vector is equal to the input vector element number. Then, according to the first transposition identification information and the initial input vector, the first target input vector of the current block can be determined by splicing the initial input vector according to the first transposition identification information, and processing the spliced input vector to determine the first target input vector of the current block. Assuming that the initial input vector of the current block includes a left boundary input vector bdry RedLeft and an upper boundary input vector bdry RedTop , when splicing, if the first transposition identification information indicates normal input, bdry RedTop is in front of bdry RedLeft ; if the first transposition identification information indicates transposed input, bdry RedLeft is in front of bdry RedTop .

[0235] In the embodiments of the present application, after determining the number of output vector elements of the current block according to the size information of the current block, the first target input vector and the first weight matrix are multiplied to determine the first output vector of the current block, and the number of elements in the first output vector is equal to the number of output vector elements.

[0236] In the embodiments of the present application, the first candidate prediction block of the current block is determined according to the first transposition identification information and the first output vector of the current block. Specifically, the prediction samples in the first intermediate prediction block of the current block can be obtained by arranging and placing the first output vector according to the first transposition identification information; and then the prediction samples in the first intermediate prediction block are up-sampled to determine the prediction samples in the first candidate prediction block of the current block. Here, the up-sampling can be interpolation processing. For example, according to the first transposition identification bit information, each element in the first output vector is placed in the corresponding position according to the arrangement order shown in FIG. 2. The interpolation order follows the horizontal linear interpolation first, and then the vertical linear interpolation. The method for horizontal linear interpolation is similar to that for vertical linear interpolation. For the missing sample points, new sample points are obtained by linear interpolation with the left and right adjacent samples, and then linear interpolation is performed vertically. After interpolation up-sampling, the first candidate prediction block with the same size as the current block is obtained.

[0237] It should be noted that in the embodiments of the present application, the first candidate prediction block obtained according to the first transposition identification information and the first output vector of the current block can be a prediction block before up-sampling, or can be a prediction block after up-sampling. In other words, when the prediction fusion technology is used for the current block, the candidate prediction blocks can be fused before up-sampling, or the candidate prediction blocks can be fused after up-sampling.

[0238] S1202, when the prediction fusion technology is used for the current block, the second candidate prediction block of the current block is determined according to the second prediction mode, and the first prediction mode is different from the second prediction mode.

[0239] It should be noted that in the embodiments of the present application, the first prediction mode includes a matrix-based intra prediction mode; and the second prediction mode includes other prediction modes other than the matrix-based intra prediction mode.

[0240] In a specific embodiment, the second prediction mode includes at least one of the following: an angle prediction mode, a diagonal prediction mode, a PLANAR mode, a DC mode, a block copy mode, an intra template matching prediction mode, a super-interpolation prediction mode, and a template matching-based prediction mode.

[0241] In a more specific embodiment, taking the template matching based prediction mode as an example of the second prediction mode, the method of predicting the current block according to the second prediction mode to determine the second candidate prediction block of the current block can comprise: determining a template region of the current block; determining a second prediction parameter of the current block based on the template region; and predicting the current block according to the second prediction parameter to determine the second candidate prediction block of the current block.

[0242] In some embodiments, the determination of the template region of the current block can comprise: determining the template region of the current block according to a neighboring region of the current block; wherein the neighboring region of the current block comprises at least one of the following: a region directly above the current block, a region directly left of the current block, and a region above and left of the current block.

[0243] In the embodiments of the present application, the template region of the current block can be a rectangular region aligned with the current block. For example, the diagonal fill region shown in FIG. 3 can specifically comprise the region directly above the current block and / or the region directly left of the current block.

[0244] In the embodiments of the present application, the template region of the current block can be a rectangular region not aligned with the current block. For example, the diagonal fill region shown in FIG. 10, considering the particularity of the MIP technology, the input and output of which are both vectors, the selection of the template region can also be the region above and left of the current block, as shown in FIG. 10, rather than the region directly above the current block and the region directly left of the current block.

[0245] It should also be noted that, as shown in FIG. 10, the width and height of the template region are the same as the size of the current block. The number of rows and columns of the template region can be 1 row and 1 column, 2 rows and 2 columns, or 4 rows and 4 columns, etc., which are not limited here.

[0246] In some embodiments, the determination of the second prediction parameter of the current block based on the template region can comprise: determining a plurality of groups of candidate prediction parameters of the current block; performing cost calculation on the template region using the plurality of groups of candidate prediction parameters to determine cost results corresponding to the plurality of groups of candidate prediction parameters; and determining the second prediction parameter of the current block from the plurality of groups of candidate prediction parameters according to the cost results corresponding to the plurality of groups of candidate prediction parameters. In this way, the samples in the current block are predicted according to the second prediction parameter to determine the prediction samples in the second candidate prediction block of the current block.

[0247] In the embodiments of the present application, the current block is allowed to try a plurality of groups of candidate prediction parameters in the MIP mode, each group of candidate prediction parameters can comprise candidate transposition identification information and candidate weight matrix index information, which are used to predict the template region to determine the prediction samples of the template region corresponding to different candidate prediction parameters, so that the cost results corresponding to different candidate prediction parameters can be calculated.

[0248] In the embodiments of the present application, the first group of candidate prediction parameters is any one of the plurality of groups of candidate prediction parameters. Taking the first group of candidate prediction parameters as an example, for determining the cost result corresponding to the first group of candidate prediction parameters, the following can be included: predicting the template region according to the first group of candidate prediction parameters, and determining the prediction sample of the template region corresponding to the first group of candidate prediction parameters; and performing cost calculation on the prediction sample of the template region and the reconstructed sample of the template region, and determining the cost result corresponding to the first group of candidate prediction parameters.

[0249] In some embodiments, the first group of candidate prediction parameters includes first candidate transposition identification information and first candidate weight matrix index information; accordingly, predicting the template region according to the first group of candidate prediction parameters and the neighboring reference samples of the template region to determine the prediction sample of the template region can include: performing downsampling processing on the neighboring reference samples of the template region to determine an initial input vector of the template region; determining a target input vector of the template region according to the first candidate transposition identification information and the initial input vector; determining a weight matrix of the template region according to the first candidate weight matrix index information, and performing multiplication operation on the target input vector and the weight matrix to determine an output vector of the template region; and determining the prediction sample of the template region according to the first candidate transposition identification information and the output vector of the template region.

[0250] In a possible implementation, determining the prediction sample of the template region according to the first candidate transposition identification information and the output vector of the template region can include: arranging and placing the output vector of the template region according to the first candidate transposition identification information to determine an initial prediction sample of the template region; and determining the initial prediction sample as the prediction sample of the template region.

[0251] In another possible implementation, determining the prediction sample of the template region according to the first candidate transposition identification information and the output vector of the template region can include: arranging and placing the output vector of the template region according to the first candidate transposition identification information to determine an initial prediction sample of the template region; and performing upsampling processing on the initial prediction sample of the template region to determine the prediction sample of the template region.

[0252] That is, in the embodiments of the present application, for the prediction sample of the template region, the prediction sample before upsampling can be determined as the prediction sample of the template region, or the prediction sample after upsampling can also be determined as the prediction sample of the template region.

[0253] In addition, in the embodiments of the present application, after the template region of the current block is determined, the neighboring reference samples outside the template region can be obtained for downsampling to determine the initial input vector of the template region. Exemplarily, the last row and the left column outside the template region can be used as the neighboring reference samples of the template region for downsampling to determine the left input vector and the upper input vector of the template region.

[0254] In the embodiment of the present application, the target input vector of the template region is determined according to the first candidate transposition identification information and the initial input vector. The target input vector of the template region can be determined by splicing the initial input vector according to the first candidate transposition identification information and processing the spliced input vector. Assuming that the initial input vector of the template region includes a left input vector and an upper input vector, when splicing, if the first candidate transposition identification information indicates normal input, the upper input vector is in front of the left input vector; if the transposition identification information indicates transposed input, the left input vector is in front of the upper input vector.

[0255] In the embodiment of the present application, the weight matrix of the template region is determined according to the first candidate weight matrix index information, and the multiplication operation is performed on the target input vector and the weight matrix to determine the output vector of the template region. Then, each element in the output vector is placed in the corresponding position according to the arrangement order shown in FIG. 2. If the first candidate transposition identification information indicates transposed input, i.e., transposition is needed, each element in the output vector is placed column by column from top to bottom in order; otherwise, if the first candidate transposition identification information indicates normal input, i.e., transposition is not needed, each element in the output vector is placed row by row from left to right in order.

[0256] In the embodiment of the present application, when the initial prediction sample of the template region is subjected to up-sampling processing, the up-sampling here can be interpolation processing. Specifically, the interpolation order can follow the horizontal linear interpolation first. The missing sample points are linearly interpolated by means of the left and right adjacent sample points to obtain new sample points, and then the vertical linear interpolation is performed. The method is similar to the horizontal interpolation. The missing sample points are linearly interpolated by means of the upper and lower adjacent sample points to obtain new sample points. After interpolation up-sampling, the prediction sample of the same size as the current template region is obtained.

[0257] In the embodiment of the present application, after the prediction sample of the template region is determined, the cost result corresponding to the first group of candidate prediction parameters can be obtained by performing cost calculation on the prediction sample of the template region and the reconstructed sample of the template region. The cost calculation here can be determined according to the cost result of rate distortion optimization (RDO), or can be determined according to the cost result of sum of absolute difference (SAD), or can be determined according to the cost result of sum of absolute transformed difference (SATD), but here is not limited in any way.

[0258] In this way, after the cost results corresponding to the first set of candidate prediction parameters are determined, the cost results corresponding to other sets of candidate prediction parameters can be determined in the same way as described above, to obtain the cost results corresponding to the multiple sets of candidate prediction parameters.

[0259] In some embodiments, determining the second prediction parameters of the current block from the cost results corresponding to the multiple sets of candidate prediction parameters can include: determining a first cost result and a second cost result from the cost results corresponding to the multiple sets of candidate prediction parameters; and determining the second prediction parameters of the current block according to the candidate prediction parameters corresponding to the first cost result and the candidate prediction parameters corresponding to the second cost result.

[0260] In the embodiments of the present application, the first cost result represents the minimum cost result among the cost results corresponding to the multiple sets of candidate prediction parameters, and therefore the first cost result can be referred to as the minimum cost result (or "optimal cost result"), represented by SATD best ; and the second cost result represents the minimum cost result among the cost results corresponding to the multiple sets of candidate prediction parameters, except for the first cost result, and therefore the second cost result can be referred to as the second minimum cost result (or "suboptimal cost result"), represented by SATD secondbest .

[0261] That is, in the embodiments of the present application, considering that the candidate prediction parameters that can be selected can be the same as the first prediction parameters described above, the candidate prediction parameters corresponding to the minimum cost result (SATD best ) and the second minimum cost result (SATD secondbest ) are retained according to the cost results corresponding to the multiple sets of candidate prediction parameters.

[0262] In a specific embodiment, determining the second prediction parameters of the current block according to the candidate prediction parameters corresponding to the first cost result and the candidate prediction parameters corresponding to the second cost result can include: if the candidate prediction parameters corresponding to the first cost result are the same as the first prediction parameters, determining the candidate prediction parameters corresponding to the second cost result as the second prediction parameters of the current block; or, if the candidate prediction parameters corresponding to the first cost result are different from the first prediction parameters, determining the candidate prediction parameters corresponding to the first cost result as the second prediction parameters of the current block.

[0263] That is, if the candidate prediction parameters corresponding to SATD best are different from the first prediction parameters, i.e., the first candidate prediction block obtained by predicting the current block according to the first prediction parameters traversed by the encoding end is different from the second candidate prediction block obtained by predicting according to the candidate prediction parameters corresponding to SATD best , then the candidate prediction parameters corresponding to SATD bestThe corresponding candidate prediction parameter is predicted to obtain a second candidate prediction block. Otherwise, if the SATD best The corresponding candidate prediction parameter is the same as the first prediction parameter, that is, the first candidate prediction block obtained by predicting the current block according to the first prediction parameter traversed by the encoding end is the same as the second candidate prediction block obtained by predicting the current block according to the SATD best The corresponding candidate prediction parameter is the same as the first prediction parameter, that is, the first candidate prediction block obtained by predicting the current block according to the first prediction parameter traversed by the encoding end is the same as the second candidate prediction block obtained by predicting the current block according to the SATD secondbest The corresponding candidate prediction parameter is predicted to obtain a second candidate prediction block.

[0264] In a specific embodiment, the second prediction parameter can include second transposition identification information and second weight matrix index information. Accordingly, predicting the current block according to the second prediction parameter to determine the second candidate prediction block of the current block can include: performing down-sampling processing on the neighboring reference samples of the current block to determine an initial input vector of the current block; determining a second target input vector of the current block according to the second transposition identification information and the initial input vector; determining a second weight matrix of the current block according to the second weight matrix index information, and performing multiplication operation on the second target input vector and the second weight matrix to determine a second output vector of the current block; and determining the second candidate prediction block of the current block according to the second transposition identification information and the second output vector of the current block.

[0265] In a possible implementation, determining the second candidate prediction block of the current block according to the second transposition identification information and the second output vector of the current block can include: arranging and placing the second output vector according to the second transposition identification information to determine a second intermediate prediction block of the current block; and determining the second intermediate prediction block as the second candidate prediction block of the current block.

[0266] In another possible implementation, determining the second candidate prediction block of the current block according to the second transposition identification information and the second output vector of the current block can include: arranging and placing the second output vector according to the second transposition identification information to determine a second intermediate prediction block of the current block; and performing up-sampling processing on the second intermediate prediction block to determine the second candidate prediction block of the current block.

[0267] Here, the prediction samples in the second intermediate prediction block of the current block can be determined according to the second output vector of the current block, and then the prediction samples in the second intermediate prediction block are up-sampled to determine the prediction samples in the second candidate prediction block.

[0268] It should be noted that, in the embodiments of the present application, the second candidate prediction block obtained after upsampling has the same size as the current block. In addition, the prediction samples in the second candidate prediction block are determined by predicting the samples in the current block according to the second prediction parameter, and the specific process is the same as that of determining the prediction samples in the first candidate prediction block by predicting the samples in the current block according to the first prediction parameter, which will not be described here in detail.

[0269] It should be further noted that, in the embodiments of the present application, the second candidate prediction block obtained according to the second transposition identification information and the second output vector of the current block can be a prediction block before upsampling or a prediction block after upsampling. In other words, when the prediction fusion technology is used for the current block, the candidate prediction blocks can be fused before upsampling or the candidate prediction blocks can be fused after upsampling.

[0270] S1203, fusing the first candidate prediction block and the second candidate prediction block to determine the prediction block of the current block.

[0271] In the embodiments of the present application, after obtaining the first candidate prediction block and the second candidate prediction block, fusing the first candidate prediction block and the second candidate prediction block to determine the prediction block of the current block can include: determining a first weight of the first candidate prediction block and a second weight of the second candidate prediction block; and performing weighted operation according to the first weight and the first candidate prediction block and the second weight and the second candidate prediction block to determine the prediction block of the current block. Specifically, in the embodiments of the present application, the prediction samples in the prediction block of the current block can be determined by performing weighted operation according to the first weight and the prediction samples in the first candidate prediction block and the second weight and the prediction samples in the second candidate prediction block.

[0272] In the embodiments of the present application, the prediction block of the current block can be represented by PredfinalIndex, the first candidate prediction block can be represented by Pred MIPIndex , the first weight can be represented by Weight1, the second candidate prediction block can be represented by Pred Temp , and the second weight can be represented by Weight2. The specific calculation formula for fusing the first candidate prediction block and the second candidate prediction block is as follows:

[0273] PredfinalIndex = Pred MIPIndex × Weight1 + Pred Temp × Weight2 (2)

[0274] In the embodiments of the present application, Weight1 and Weight2 can be preset values. For example, Weight1 can be set to 3 / 4, Weight2 can be set to 1 / 4, and the like, which are not limited specifically herein.

[0275] In some embodiments, the method of determining the above-mentioned weights can also be a method of look-up table (LUT). Compared with the above-mentioned formula calculation, the method of look-up table can omit the division operation, and is more friendly to the implementation of software and hardware, but can easily have a difference in precision.

[0276] It can be understood that, in the embodiments of the present application, the number of candidate prediction blocks used for fusion herein is not limited to two, and can be two, three, four, five, six, and the like. The number herein is a natural number, and is not limited specifically.

[0277] It can also be understood that, in the embodiments of the present application, whether the prediction fusion technology is used for the current block can be determined by a second syntax element in the code stream, or can be determined according to the cost result.

[0278] In a possible implementation manner, the method can include: determining a first rate-distortion cost value corresponding to the case that the prediction fusion technology is used for the current block, determining a second rate-distortion cost value corresponding to the case that the prediction fusion technology is not used for the current block, and determining a third rate-distortion cost value corresponding to the case that a prediction mode other than the first prediction mode is used for the current block; and determining whether the prediction fusion technology is used for the current block and / or whether the first prediction mode is currently used according to the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value.

[0279] In some embodiments, determining whether the prediction fusion technology is used for the current block and / or whether the first prediction mode is currently used according to the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value can include: if the minimum cost value among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value is the minimum first rate-distortion cost value, determining that the prediction fusion technology is used for the current block and the first prediction mode is currently used; if the minimum cost value among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value is the minimum second rate-distortion cost value, determining that the prediction fusion technology is not used for the current block and the first prediction mode is currently used; and if the minimum cost value among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value is the minimum third rate-distortion cost value, determining that the prediction fusion technology is not used for the current block and the first prediction mode is not currently used.

[0280] In the embodiment of the present application, for determining the first rate-distortion cost value corresponding to the case that the prediction fusion technology is used for the current block, the method can include: determining a plurality of groups of candidate prediction parameters of the current block; predicting the current block by using the plurality of groups of candidate prediction parameters to determine a plurality of groups of candidate prediction blocks of the current block; fusing the plurality of groups of candidate prediction blocks and the second candidate prediction block respectively to determine a plurality of groups of fusion blocks of the current block; and performing rate-distortion cost calculation on the plurality of groups of fusion blocks of the current block and the original block of the current block respectively to determine the first rate-distortion cost value corresponding to the plurality of groups of candidate prediction parameters.

[0281] In the embodiment of the present application, for determining the second rate-distortion cost value corresponding to the case that the prediction fusion technology is not used for the current block, the method can include: determining a plurality of groups of candidate prediction parameters of the current block; predicting the current block by using the plurality of groups of candidate prediction parameters to determine a plurality of groups of candidate prediction blocks of the current block; and performing rate-distortion cost calculation on the plurality of groups of candidate prediction blocks of the current block and the original block of the current block respectively to determine the second rate-distortion cost value corresponding to the plurality of groups of candidate prediction parameters.

[0282] In the embodiment of the present application, for determining the third rate-distortion cost value corresponding to the case that the prediction mode other than the first prediction mode is used for the current block, the method can include: traversing the other prediction modes of the current block at the encoding end to determine the prediction blocks corresponding to the other prediction modes; and performing rate-distortion cost calculation on the prediction blocks corresponding to the other prediction modes and the original block to determine the third rate-distortion cost value corresponding to the other prediction modes.

[0283] That is, in the embodiment of the present application, each group of candidate prediction parameters includes candidate transposition identification information and candidate weight matrix index information. In this way, in the first rate-distortion cost value, the second rate-distortion cost value and the third rate-distortion cost value, if the first rate-distortion cost value is the minimum, it is determined that the prediction fusion technology is used for the current block and the MIP technology is used for the current block; if the second rate-distortion cost value is the minimum, it is determined that the prediction fusion technology is not used for the current block and the MIP technology is used for the current block; and if neither the first rate-distortion cost value nor the second rate-distortion cost value is the minimum, it is determined that the prediction fusion technology is not used for the current block and the MIP technology is not used for the current block.

[0284] In another possible implementation, the method can include: determining a value of the second syntax element; and performing encoding processing on the value of the second syntax element, and writing the obtained coded bits into the code stream.

[0285] In the embodiments of the present application, the determining whether the current block uses the prediction fusion technology according to the value of the second syntax element can include: if the current block uses the prediction fusion technology, determining that the value of the second syntax element is the first value; and if the current block does not use the prediction fusion technology, determining that the value of the second syntax element is the second value. That is, in the embodiments of the present application, whether the current block uses the prediction fusion technology can be indicated by a separate syntax element, which is used to indicate whether to fuse.

[0286] In yet another possible implementation, the method can include: determining a third cost result of a template region corresponding to the current block when the current block uses the prediction fusion technology, and a fourth cost result of the template region corresponding to the current block when the current block does not use the prediction fusion technology; and determining whether the current block uses the prediction fusion technology according to the third cost result and the fourth cost result.

[0287] In some embodiments, the determining whether the current block uses the prediction fusion technology according to the third cost result and the fourth cost result can include: if the third cost result is less than the fourth cost result, determining that the current block uses the prediction fusion technology; and if the third cost result is greater than the fourth cost result, determining that the current block does not use the prediction fusion technology.

[0288] That is, in the embodiments of the present application, the encoding end can determine whether the current block uses the prediction fusion technology by the distortion cost values, such as SATD or SAD, of the template region of the fused prediction block and the non-fused prediction block, so as to save the transmission overhead of the second syntax element (or referred to as "fusion identification bit").

[0289] In some embodiments, the method can further include: when the current block does not use the prediction fusion technology, determining a first candidate prediction block of the current block; and determining a prediction block of the current block according to the first candidate prediction block.

[0290] In the embodiments of the present application, specifically, a first prediction parameter of the current block can be determined, and then the samples in the current block are predicted according to the first prediction parameter to obtain prediction samples in a first candidate prediction block, and the prediction samples can be determined as the prediction block of the current block.

[0291] In the embodiments of the present application, when the current block does not use the prediction fusion technology, the prediction block of the current block can be determined based on the first prediction mode. Specifically, the current block can be predicted according to the first prediction parameter determined according to the principle of minimum cost after the encoding end traverses all MIP modes, and the obtained first candidate prediction block is determined as the prediction block of the current block.

[0292] That is, in the embodiments of the present application, if the current block does not use the prediction fusion technology, the first candidate prediction block Pred MIPIndexPredfinalIndex = Pred MIPIndex . Wherein, PredfinalIndex is the prediction block output of the current block under the first prediction parameter obtained by parsing.

[0293] It can also be understood that in the embodiments of the present application, after the prediction block of the current block is determined, after step S1203, referring to FIG. 13, the method can further include:

[0294] S1301, determining the residual block of the current block according to the prediction block of the current block.

[0295] S1302, encoding the residual block of the current block, and writing the obtained coded bits into the bitstream.

[0296] In the embodiments of the present application, determining the residual block of the current block according to the prediction block of the current block can include: determining the original block of the current block; and determining the residual block of the current block according to the original block of the current block and the prediction block of the current block. Specifically, it can be to perform subtraction operation on the original sample of the current block and the prediction sample of the current block to determine the residual sample of the current block.

[0297] In some embodiments, the embodiments of the present application also provide a bitstream, the bitstream is generated by bit encoding according to to-be-encoded information; wherein, the to-be-encoded information includes at least one of the following: the residual block of the current block, the value of the first syntax element and the value of the second syntax element.

[0298] In the embodiments of the present application, the first syntax element is used to indicate whether the current block uses the first prediction mode, and the second syntax element is used to indicate whether the current block uses the prediction fusion technology.

[0299] It can also be understood that in the embodiments of the present application, when the current block does not use the MIP technology, other prediction modes and related information used by the current block can also be written into the bitstream. In this way, the subsequent decoding end can determine the other prediction modes used by the current block by decoding the bitstream, and then determine the prediction block of the current block by using the other prediction modes; and finally, the reconstructed block of the current block can be determined by performing addition operation on the prediction samples in the prediction block and the residual samples in the residual block. Specifically, it can be to perform addition operation on the prediction samples in the prediction block and the residual samples in the residual block to determine the reconstructed samples of the current block.

[0300] It can also be understood that in the embodiments of the present application, after all the coded blocks in the current image are completely traversed, the bitstream is transmitted to the decoding end after loop filtering, entropy encoding and other technologies.

[0301] It is also understood that, in the embodiments of the present application, for the second prediction mode, a mode such as the PLANAR mode can also be used to replace the fusion candidate (i.e., the second candidate prediction block) derived from the template region.

[0302] For example, if the angle prediction mode is used to replace the fusion candidate derived from the template region, the template region and the MIP prediction block can be derived using the DIMD or TIMD to obtain a conventional intra prediction mode, and then the current block is predicted according to the conventional intra prediction mode to determine the second candidate prediction block of the current block.

[0303] For example, if the intraTMP or IBC block copy technology is used to replace the fusion candidate derived from the template region, the prediction block obtained by the optimal BV candidate of the intraTMP mode can be used as the second candidate prediction block to be fused with the MIP prediction block; or the prediction block obtained by the Merge candidate of the IBC mode can also be used as the second candidate prediction block to be fused with the MIP prediction block.

[0304] For example, if the EIP decoding-end-derived technology is used to replace the fusion candidate derived from the template region, the prediction block obtained by the Merge candidate of the EIP can be used as the second candidate prediction block to be fused with the MIP prediction block.

[0305] The embodiments of the present application provide an encoding method. When a first prediction mode is used for a current block, a first candidate prediction block of the current block is determined. When a prediction fusion technology is used for the current block, the current block is predicted according to a second prediction mode to determine a second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode. The first candidate prediction block and the second candidate prediction block are fused to determine a prediction block of the current block. In this way, when the MIP technology is used for the current block, the first candidate prediction block of the current block is determined, and then the second prediction mode can also be used to determine the second candidate prediction block of the current block. Through the fusion of the first candidate prediction block and the second candidate prediction block, the fusion operation of the MIP prediction block and the prediction block generated by other prediction modes can be realized, which not only can improve the prediction accuracy and improve the compression efficiency, but also can realize the effect of eliminating noise and smoothing the prediction block, and further improve the encoding and decoding performance.

[0306] In another embodiment of the present application, based on the encoding and decoding method of the foregoing embodiment, the main idea of the technical solution is that the MIP technology is allowed to use the prediction fusion technology, that is, the final prediction block of the current coding unit can be obtained by fusing multiple MIP prediction blocks, or the final prediction block of the current coding unit can be obtained by fusing the MIP prediction block and the prediction block generated by other prediction modes.

[0307] In one possible implementation, for the multiple MIP prediction block fusion, specifically, the following steps can be included: using the reference samples outside the template region as the input vector of the matrix-based intra prediction technology to predict the template region, and the template region prediction samples can be obtained, and then the error, such as the SATD cost, between the reconstructed samples and the prediction samples of the template region is calculated. Thus, the SATD cost of all the MIP prediction modes allowed for the current coding unit under different transposition conditions is obtained, wherein the MIP mode index and the transposition identification information corresponding to the minimum SATD cost and the second minimum SATD cost are the MIP mode index and the transposition identification information derived from the MIP mode index and the transposition identification information, which can be used as the candidate of the multiple MIP prediction block fusion.

[0308] In another possible implementation, for the MIP prediction block fusion with different prediction modes, specifically, the following steps can be included: the fusion candidate can be any one of the traditional prediction modes, such as the angle prediction mode, the diagonal prediction mode, the PLANAR mode or the DC mode, etc.; or the prediction block obtained by some special prediction technology, such as the intraTMP in the ECM and the prediction block generated by the block copy technology of the IBC; or the prediction block obtained by some technology with high complexity requirement at the decoding end, such as the prediction block generated by the EIP technology in the ECM. These prediction blocks can all be used as the candidate of the MIP fusion prediction.

[0309] In one specific embodiment, the specific steps at the encoding end are as follows, taking the current coding unit as an example:

[0310] The encoder traverses the prediction mode, and if the current prediction mode type is the intra prediction, the allowed use flag of the present technical solution is obtained, which is the sequence level flag, indicating that the matrix-based intra prediction technology is allowed to be used by the current encoder, which can be in the form of sps_mip_enable_flag.

[0311] Step 1: if the allowed use flag of the MIP is true, step 2 is executed; if the allowed use flag of the MIP or other conditions is not met, the encoding end does not attempt the prediction method of the MIP, i.e., step 2 is directly executed to step 3;

[0312] Step 2: the encoding end attempts the fusion and non-fusion scheme of the MIP:

[0313] Step 2.1: the rate-distortion cost of the fusion scheme is solved.

[0314] The classIdx (also referred to as sizeId) is obtained according to the size of the current coding unit, and the input vector size and the output vector size of the MIP of the current coding unit are determined according to the classIdx.

[0315] The specific process of determining the prediction mode based on the template is as follows:

[0316] The template region of the current coding unit is determined, the neighboring boundary samples outside the template region are obtained and down-sampled to obtain the down-sampled input vector TempBdry red .

[0317] The template region is predicted according to all the MIP prediction modes allowed to be tried by the current coding unit, the input vectors on both sides are spliced according to the MIP transpose identification information, and the input samples are processed. According to the MIP mode index traversed, the weight matrix is obtained, and the input vector TempBdry red is operated as input with the obtained weight matrix to obtain the output vector. Each element in the output vector is placed in the corresponding position according to the arrangement order described in the foregoing, if the transpose identification information indicates that transposition is needed, each element in the output vector is placed in order from top to bottom column by column; otherwise, the transpose identification information indicates that transposition is not needed, and each element in the output vector is placed in order from left to right row by row. In addition, the interpolation order can follow the horizontal linear interpolation first, and the missing sample points are linearly interpolated by means of the left and right neighboring samples to obtain new sample points, and then the vertical linear interpolation is performed, and the method is similar to the horizontal interpolation. The missing sample points are linearly interpolated by means of the upper and lower neighboring samples to obtain new sample points. After interpolation and upsampling, a prediction block with the same size as the current template region is obtained. Here, the interpolation order is not limited.

[0318] The SATD cost of the prediction samples and the reconstructed samples of the template region is calculated to obtain the cost values under each MIP mode index and transpose identification information, and the MIP mode index and the transpose identification information corresponding to the optimal and suboptimal (minimum and sub-minimum) cost values are retained as the optimal prediction parameter and the suboptimal prediction parameter candidates for fusion of the current coding unit.

[0319] The specific process of prediction and fusion of the current coding unit is as follows:

[0320] The current coding unit is predicted according to the MIP mode index and the transpose identification information derived from the template, and the prediction process is the same as described above, and is not described in detail here, to obtain the prediction block Pred Temp .

[0321] All the MIP mode indexes and the transpose identification information allowed to be tried by the current coding unit are traversed, the weight matrix is obtained according to the MIP mode index, and the input vector and the output vector are transposed and spliced according to the transpose identification information. The prediction process is the same as described above, and is not described in detail here, to obtain the prediction block Pred MIPIndex .

[0322] The two prediction blocks are weighted and fused: PredfinalIndex=PredMIPIndex x Weight1 + Pred Temp x Weight2 (3)

[0323] PredfinalIndex is the prediction block output of the current coding unit under the MIP mode index. If the MIP mode index traversed by the encoding end is the same as the optimal prediction parameter candidate derived by the template region and the transposition identification information, Pred Temp is the prediction block obtained by predicting the current coding unit by the suboptimal prediction parameter candidate.

[0324] Residual calculation is performed on the prediction block, and transform and quantization operations are performed on the residual block. The quantized residual obtained after inverse quantization and inverse transform is superimposed on the prediction block, which is the reconstructed block of the current coding unit. The rate-distortion cost value is calculated according to the reconstructed block and the original block, and the rate-distortion cost costFusionIndex under the current MIP prediction mode index is obtained.

[0325] Continue to traverse other MIP mode indexes and transposition identification information to obtain the rate-distortion cost value costFusionIndex under each condition.

[0326] The weighting weights of Weight1 and Weight2 can be pre-set to 3 / 4 and 1 / 4, etc., and are not limited here.

[0327] Step 2.2, solve the rate-distortion cost of the non-fusion scheme.

[0328] Traverse all MIP mode indexes and transposition identification information allowed to be tried by the current coding unit, obtain the weight matrix according to the MIP mode index, and perform transposition splicing on the input vector and the output vector according to the transposition identification information. The prediction process is the same as described above, and is not described in detail here, to obtain the prediction block Pred MIPIndex . PredfinalIndex = Pred MIPIndex (4)

[0329] PredfinalIndex is the prediction block output of the current coding unit under the MIP mode index.

[0330] Residual calculation is performed on the prediction block, and transform and quantization operations are performed on the residual block. The quantized residual obtained after inverse quantization and inverse transform is superimposed on the prediction block, which is the reconstructed block of the current coding unit. The rate-distortion cost value is calculated according to the reconstructed block and the original block, and the rate-distortion cost costOriginalIndex under the current MIP mode index is obtained.

[0331] Continue to traverse other MIP mode indexes and transpose identification information to obtain rate-distortion cost values costOriginalIndex in each case.

[0332] Step 3, the encoding end continues to traverse other prediction modes, and calculates to obtain rate-distortion cost values corresponding to each prediction mode, and selects the prediction mode corresponding to the smallest cost value as the optimal prediction mode of the current coding unit:

[0333] If costFusionIndex is the smallest, the current coding unit uses MIP technology and uses prediction fusion (MipFusion) technology, MIP use identification position true is needed to indicate that the current coding unit uses MIP technology, MipFusion use identification position true is needed to indicate that the current coding unit uses MIP prediction fusion technology, and is written into the code stream together with the current MIP mode index and transpose identification information.

[0334] If costOriginalIndex is the smallest, the current coding unit uses MIP technology and does not use prediction fusion technology, MIP use identification position true is needed to indicate that the current coding unit uses MIP technology, MipFusion use identification position false is needed to indicate that the current coding unit does not use MIP prediction fusion technology, and is written into the code stream together with the current MIP mode index and transpose identification information.

[0335] If neither costFusionIndex nor costOriginalIndex of the current coding unit is the smallest, the current coding unit does not use MIP technology, and MIP coding unit level use identification position false is needed to indicate that the current coding unit does not use MIP technology, and is written into the code stream;

[0336] Step 4, after all coding units are traversed, the code stream is output after loop filtering, entropy coding and other technologies.

[0337] The specific steps at the decoding end are as follows:

[0338] The decoding end parses or obtains the MIP allowed use flag, which is a sequence level flag (sps_mip_enable_flag) indicating that the current decoder allows using MIP technology.

[0339] Step 1, parse the code stream to obtain the prediction type of the current coding unit, if it is intra prediction, parse the MIP use identification bit of the current coding unit. If the MIP use identification bit of the current coding unit is true, it indicates that the current coding unit uses MIP technology, and the MipFusion use identification bit, MIP mode index and transpose identification information of the current coding unit need to be parsed;

[0340] If the MIP usage flag of the current coding unit is false, it means that the current coding unit does not use the MIP technology, and step 3 is executed.

[0341] Step 2, if the MipFusion flag of the current coding unit is true, it means that the current coding unit uses the MIP prediction fusion technology, and step 2.1 is executed; otherwise, it means that the current coding unit does not use the MIP prediction fusion technology, and step 2.2 is executed.

[0342] Step 2.1, the specific process of fusion prediction.

[0343] According to the size of the current coding unit, the classIdx (also called sizeId) is obtained, and the input vector size and the output vector size of the MIP of the current coding unit are determined according to the classIdx.

[0344] The specific process of determining the prediction mode based on the template is as follows:

[0345] The template region of the current coding unit is determined, the adjacent boundary samples outside the template region are obtained for downsampling, and the downsampled input vector TempBdry red is obtained.

[0346] According to all the MIP prediction modes allowed to be tried by the current coding unit, the template region is predicted, the input vectors on both sides are spliced according to the MIP transpose flag information, and the input samples are processed. According to the MIP mode index traversed, the weight matrix is obtained, and the input vector TempBdry red is taken as the input and the obtained weight matrix is operated to obtain the output vector. Each element in the output vector is placed in the corresponding position according to the arrangement order described in the foregoing, if the transpose flag information indicates that transposition is needed, each element in the output vector is placed column by column from top to bottom in order; otherwise, the transpose flag information indicates that transposition is not needed, and each element in the output vector is placed row by row from left to right in order. In addition, the interpolation order can follow the horizontal linear interpolation first, and the missing sample points are linearly interpolated by means of the left and right adjacent samples to obtain new sample points, and then the vertical linear interpolation is performed, and the method is similar to the horizontal interpolation. The missing sample points are linearly interpolated by means of the upper and lower adjacent samples to obtain new sample points. After interpolation upsampling, a prediction block with the same size as the current template region is obtained. Here, the interpolation order is not limited.

[0347] The SATD cost of the prediction samples and the reconstructed samples of the template region is calculated, the cost values under each MIP mode index and transpose flag information are obtained, and the MIP mode index and the transpose flag information corresponding to the optimal and suboptimal (minimum and sub-minimum) cost values are reserved as the optimal and suboptimal candidates for fusion of the current coding unit.

[0348] The specific process of prediction and fusion of the current coding unit is as follows:

[0349] According to the MIP mode index derived from the template and the transposition identification information, the current coding unit is predicted, and the prediction process is the same as described above, and details are not described here, to obtain the prediction block Pred Temp .

[0350] According to the MIP mode index obtained by parsing, the weight matrix is obtained, and the input vector and the output vector are transposed and spliced according to the transposition identification information. The prediction process is the same as described above, and details are not described here, to obtain the prediction block Pred MIPIndex .

[0351] The two prediction blocks are fused, and the specific process is shown in formula (3).

[0352] Wherein, PredfinalIndex is the prediction block output of the current coding unit under the MIP mode index. If the MIP mode index and the transposition identification information traversed by the decoding end are the same as the optimal candidate derived from the template region, then Pred Temp is the prediction block obtained by predicting the current coding unit as a suboptimal candidate.

[0353] Wherein, the weighting weights of Weight1 and Weight2 can be pre-set as 3 / 4 and 1 / 4, etc., and are not limited here.

[0354] Step 4 is executed.

[0355] Step 2.2, the specific process of non-fusion prediction.

[0356] According to the MIP mode index obtained by parsing, the weight matrix is obtained, and the input vector and the output vector are transposed and spliced according to the transposition identification information. The prediction process is the same as described above, and details are not described here, to obtain the prediction block Pred MIPIndex , and the specific process is shown in formula (4).

[0357] PredfinalIndex is the prediction block output of the current coding unit under the MIP mode index.

[0358] Step 4 is executed.

[0359] Step 3, continue to parse the use identification bit or index information of other prediction modes, and obtain the final prediction block of the current coding unit according to the parsed other prediction mode information;

[0360] Step 4, parse the code stream and obtain the residual information, and obtain the residual information according to the inverse quantization and inverse transformation. The final prediction block and the residual information are superimposed to obtain the reconstructed sample block;

[0361] Step 5, after all the reconstructed sample blocks are filtered via loop filtering and other techniques, the final reconstructed image is obtained, which can be used as video output and also as decoding reference.

[0362] It can be understood that in the embodiments of the present application, the aforementioned various alternatives, such as the PLANAR mode, can be used to replace the merge candidate derived from the template region.

[0363] For example, if the angle prediction mode is used to replace the merge candidate derived from the template region, the template region and the MIP prediction block can be derived using the DIMD or TIMD to obtain the conventional intra prediction mode, and then the prediction block obtained according to the conventional intra prediction mode is fused with the MIP prediction block.

[0364] For example, if the intraTMP or IBC block copy technology is used to replace the merge candidate derived from the template region, the prediction block obtained using the optimal BV candidate of the intraTMP mode can be fused with the MIP prediction block, or the prediction block obtained using the Merge candidate of the IBC mode can be fused with the MIP prediction block.

[0365] For example, if the EIP decoding-end-derived technology is used to replace the merge candidate derived from the template region, the prediction block obtained using the Merge candidate of the EIP can be fused with the MIP prediction block.

[0366] That is, in the embodiments of the present application, the MIP prediction fusion technology is proposed, which can be fused with other MIP prediction blocks, can be fused with conventional intra prediction blocks, can be fused with block copy prediction blocks such as intraTMP and IBC, and can even be fused with new technologies such as EIP.

[0367] In addition, in the embodiments of the present application, a MIP fusion flag can be provided to indicate whether the current coding unit needs to fuse the prediction block. Specifically, if the fusion flag (mip_fusion_flag) parsed from the current coding unit is false, it indicates that the current coding unit does not use the prediction fusion technology, and the MIP mode index and the transposition flag information parsed from the current coding unit are used for prediction to obtain the output prediction block. At this time, the derivation of the MIP mode index and the transposition flag information of the template region and the weighted fusion process of multiple prediction blocks are skipped; if the fusion flag is true, it indicates that the current coding unit uses the prediction fusion technology, and the operation process is the same as the specific process of the aforementioned fusion prediction.

[0368] It can also be understood that, in the embodiments of the present application, the weighting weight derivation process of the fusion prediction technology can construct an equation, and the weight coefficients can be solved by using methods such as matrix decomposition LDL and Gaussian decomposition.

[0369] It can also be understood that, in the embodiments of the present application, the number of prediction blocks of the fusion prediction technology can be a natural number, and is not limited to the fusion of two prediction blocks.

[0370] It can also be understood that, in the embodiments of the present application, the fusion operation of the plurality of MIP prediction blocks can be performed before the upsampling of each MIP prediction block, or can be performed after the upsampling of each MIP prediction block.

[0371] It can also be understood that, in the embodiments of the present application, the encoder can determine whether the current coding unit is fused by using the distortion cost values such as SATD or SAD of the fusion prediction block and the non-fusion prediction block in the template region, so as to save the overhead of transmitting the fusion identification bit.

[0372] In the embodiments of the present application, the specific implementation of the foregoing embodiments is described in detail, and according to the technical solutions of the foregoing embodiments, it can be seen that when the MIP technology is used for the current block, the first candidate prediction block of the current block is determined, and then the second prediction mode can be used to determine the second candidate prediction block of the current block. The fusion of the first candidate prediction block and the second candidate prediction block can be performed, so that the fusion operation of the MIP prediction block and other prediction modes can be realized. Not only the prediction accuracy and the compression efficiency can be improved, but also the effects of eliminating noise and smoothing the prediction block can be realized, and thus the coding performance is improved.

[0373] In still another embodiment of the present application, based on the same inventive concept as the foregoing embodiments, FIG. 14 is a schematic structural diagram of an encoder provided by the embodiment of the present application. As shown in FIG. 14, the encoder 140 can include a first determination unit 1401 and a first prediction unit 1402, wherein:

[0374] The first determination unit 1401 is configured to determine a first candidate prediction block of a current block when the current block uses a first prediction mode.

[0375] The first prediction unit 1402 is configured to, when the current block uses a prediction fusion technology, predict the current block according to a second prediction mode to determine a second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode; and fuse the first candidate prediction block and the second candidate prediction block to determine a prediction block of the current block.

[0376] In some embodiments, referring to FIG. 14, the encoder 140 can further include an encoding unit 1403; a first determining unit 1401, which is further configured to determine a value of a first syntax element, wherein the first syntax element is used to indicate whether the current block uses the first prediction mode; and the encoding unit 1403, which is configured to perform encoding processing on the value of the first syntax element and write the obtained encoded bits into the bitstream.

[0377] In some embodiments, the first determining unit 1401 is further configured to determine a value of a second syntax element, wherein the second syntax element is used to indicate whether the current block uses the prediction fusion technology; and the encoding unit 1403 is further configured to perform encoding processing on the value of the second syntax element and write the obtained encoded bits into the bitstream.

[0378] In some embodiments, the first prediction unit 1402 is further configured to determine a first candidate prediction block of the current block when the current block does not use the prediction fusion technology; and determine the prediction block of the current block according to the first candidate prediction block.

[0379] In some embodiments, the first determining unit 1401 is further configured to determine a first rate-distortion cost value corresponding to a case where the current block uses the prediction fusion technology, a second rate-distortion cost value corresponding to a case where the current block does not use the prediction fusion technology, and a third rate-distortion cost value corresponding to a case where the current block uses a prediction mode other than the first prediction mode; and determine whether the current block uses the prediction fusion technology and / or whether the current block uses the first prediction mode according to the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value.

[0380] In some embodiments, the first determining unit 1401 is further configured to determine a plurality of groups of candidate prediction parameters of the current block; predict the current block by using the plurality of groups of candidate prediction parameters to determine a plurality of groups of candidate prediction blocks of the current block; fuse the plurality of groups of candidate prediction blocks and the second candidate prediction block respectively to determine a plurality of groups of fusion blocks of the current block; and perform rate-distortion cost calculation on the plurality of groups of fusion blocks of the current block and the original block of the current block respectively to determine first rate-distortion cost values corresponding to the plurality of groups of candidate prediction parameters.

[0381] In some embodiments, the first determining unit 1401 is further configured to determine a plurality of groups of candidate prediction parameters of the current block; predict the current block by using the plurality of groups of candidate prediction parameters to determine a plurality of groups of candidate prediction blocks of the current block; and perform rate-distortion cost calculation on the plurality of groups of candidate prediction blocks of the current block and the original block of the current block respectively to determine second rate-distortion cost values corresponding to the plurality of groups of candidate prediction parameters.

[0382] In some embodiments, the first determining unit 1401 is further configured to determine that the current block uses the prediction fusion technology and the first prediction mode if the minimum cost value among the first rate-distortion cost value, the second rate-distortion cost value and the third rate-distortion cost value is the minimum first rate-distortion cost value, determine that the current block does not use the prediction fusion technology and the first prediction mode if the minimum cost value among the first rate-distortion cost value, the second rate-distortion cost value and the third rate-distortion cost value is the minimum second rate-distortion cost value, and determine that the current block does not use the prediction fusion technology and does not use the first prediction mode if the minimum cost value among the first rate-distortion cost value, the second rate-distortion cost value and the third rate-distortion cost value is the minimum third rate-distortion cost value.

[0383] In some embodiments, the first determining unit 1401 is further configured to determine the first prediction parameter of the current block, and the first prediction unit 1402 is further configured to predict the current block according to the first prediction parameter to determine the first candidate prediction block of the current block.

[0384] In some embodiments, the first determining unit 1401 is further configured to determine a plurality of groups of candidate prediction parameters of the current block, the first prediction unit 1402 is further configured to predict the current block by using the plurality of groups of candidate prediction parameters to determine a plurality of groups of candidate prediction blocks of the current block, and fuse the plurality of groups of candidate prediction blocks and the second candidate prediction block respectively to determine a plurality of groups of fusion blocks of the current block, the first determining unit 1401 is further configured to perform rate-distortion cost calculation on the plurality of groups of fusion blocks of the current block and the original block of the current block respectively to determine first rate-distortion cost values corresponding to the plurality of groups of candidate prediction parameters, and determine the minimum cost value from the first rate-distortion cost values corresponding to the plurality of groups of candidate prediction parameters, and determine the candidate prediction parameter corresponding to the minimum cost value as the first prediction parameter of the current block.

[0385] In some embodiments, the encoding unit 1403 is further configured to, when the current block uses the first prediction mode, perform encoding processing on the first prediction parameter of the current block, and write the obtained encoding bits into the bitstream.

[0386] In some embodiments, the first prediction parameter includes first transposition identification information and first weight matrix index information, the first prediction unit 1402 is further configured to perform down-sampling processing on the neighboring reference samples of the current block to determine an initial input vector of the current block, determine a first target input vector of the current block according to the first transposition identification information and the initial input vector, determine a first weight matrix of the current block according to the first weight matrix index information, and perform multiplication operation on the first target input vector and the first weight matrix to determine a first output vector of the current block, and determine the first candidate prediction block of the current block according to the first transposition identification information and the first output vector of the current block.

[0387] In some embodiments, the first prediction mode comprises a matrix-based intra prediction mode; and the second prediction mode comprises at least one of: an angular prediction mode, a diagonal prediction mode, a PLANAR mode, a DC mode, a block copy mode, an intra template matching prediction mode, an over-interpolation prediction mode, and a template matching based prediction mode.

[0388] In some embodiments, when the second prediction mode is the template matching based prediction mode, the first prediction unit 1402 is further configured to determine a template region of the current block; determine a second prediction parameter of the current block based on the template region; and determine a second candidate prediction block of the current block according to the prediction of the current block based on the second prediction parameter.

[0389] In some embodiments, the first determination unit 1401 is further configured to determine a plurality of groups of candidate prediction parameters of the current block; determine prediction samples of a template region corresponding to the plurality of groups of candidate prediction parameters, and determine cost results corresponding to the plurality of groups of candidate prediction parameters according to the prediction samples of the template region corresponding to the plurality of groups of candidate prediction parameters and reconstructed samples of the template region; and determine the second prediction parameter of the current block from the plurality of groups of candidate prediction parameters according to the cost results corresponding to the plurality of groups of candidate prediction parameters.

[0390] In some embodiments, the first determination unit 1401 is further configured to determine prediction samples of a template region corresponding to the first group of candidate prediction parameters according to the prediction of the template region corresponding to the first group of candidate prediction parameters based on neighboring reference samples of the template region; and determine a cost result corresponding to the first group of candidate prediction parameters according to the cost calculation of the prediction samples of the template region and the reconstructed samples of the template region; wherein the first group of candidate prediction parameters is any one of the plurality of groups of candidate prediction parameters.

[0391] In some embodiments, the first determination unit 1401 is further configured to determine a first cost result and a second cost result from the cost results corresponding to the plurality of groups of candidate prediction parameters; and determine the second prediction parameter of the current block according to a candidate prediction parameter corresponding to the first cost result and a candidate prediction parameter corresponding to the second cost result; wherein the first cost result represents a minimum cost result in the cost results corresponding to the plurality of groups of candidate prediction parameters, and the second cost result represents a minimum cost result in the cost results corresponding to the plurality of groups of candidate prediction parameters except the first cost result.

[0392] In some embodiments, the first determination unit 1401 is further configured to, if the candidate prediction parameter corresponding to the first cost result is the same as the first prediction parameter, determine the candidate prediction parameter corresponding to the second cost result as the second prediction parameter of the current block; or, if the candidate prediction parameter corresponding to the first cost result is different from the first prediction parameter, determine the candidate prediction parameter corresponding to the first cost result as the second prediction parameter of the current block.

[0393] In some embodiments, the first prediction unit 1402 is further configured to determine a first weight of the first candidate prediction block and a second weight of the second candidate prediction block; and perform a weighted operation according to the first weight and the first candidate prediction block and the second weight and the second candidate prediction block to determine the prediction block of the current block.

[0394] In some embodiments, the first determination unit 1401 is further configured to determine an original block of the current block; and determine a residual block of the current block according to the original block of the current block and the prediction block of the current block; and the encoding unit 1403 is further configured to perform an encoding process on the residual block of the current block and write the obtained encoding bits into the bitstream.

[0395] It can be understood that, in the embodiments of the present application, the "unit" can be a part of circuit, a part of processor, a part of program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the components in the embodiments can be integrated in a processing unit, or can be physically present individually, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.

[0396] In still another embodiment of the present application, FIG. 15 is a specific hardware structure diagram of an encoder provided by the embodiments of the present application. As shown in FIG. 15, the encoder 140 can include a first communication interface 1501, a first memory 1502 and a first processor 1503; and the components are coupled together through a first bus system 1504. It can be understood that the first bus system 1504 is used to realize the connection communication between the components. The first bus system 1504 includes a data bus, a power supply bus, a control bus and a state signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the first bus system 1504 in FIG. 15. Among them,

[0397] The first communication interface 1501 is used for receiving and sending signals in the process of transceiving information with other external network elements;

[0398] The first memory 1502 is used for storing computer programs capable of running on the first processor 1503;

[0399] The first processor 1503 is used for executing the following when running the computer programs:

[0400] when the current block uses a first prediction mode, determining a first candidate prediction block of the current block; when the current block uses a prediction fusion technology, predicting the current block according to a second prediction mode to determine a second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode; and fusing the first candidate prediction block and the second candidate prediction block to determine the prediction block of the current block.

[0401] It is to be appreciated that the first memory 1502 in embodiments of the application can be volatile or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example and not limitation, nonvolatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which acts as external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous dynamic RAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The first memory 1502 of the system and method described herein are intended to include, without being limited to, these and any other suitable types of memory.

[0402] The first processor 1503 can be an integrated circuit chip that has the processing capability of signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware or the instruction in the form of software in the first processor 1503. The first processor 1503 described above can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block disclosed in the embodiment of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiment of the present application can be directly embodied as a hardware code processor to execute, or be executed by a combination of hardware and software modules in the code processor. The software module can be located in a random memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the first memory 1502, and the first processor 1503 reads the information in the first memory 1502 and combines the hardware to complete the steps of the above method.

[0403] It can be understood that the embodiments described in the present application can be realized by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be realized in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general processors, controllers, microcontrollers, microprocessors, other electronic units for executing functions described in the present application or a combination thereof. For software implementation, the technology described in the present application can be realized by modules (such as processes, functions, etc.) for executing functions described in the present application. The software code can be stored in the memory and executed by the processor. The memory can be implemented in the processor or outside the processor.

[0404] Optionally, as another embodiment, the first processor 1503 is further configured to execute the method of any one of the preceding embodiments when running the computer program.

[0405] The embodiment provides an encoder, when a MIP technology is used for a current block, a first candidate prediction block of the current block is determined, and then a second prediction mode can be used to determine a second candidate prediction block of the current block, and by fusing the first candidate prediction block and the second candidate prediction block, a fusion operation of a MIP prediction block and other prediction modes can be realized, not only the prediction accuracy can be improved, and the compression efficiency is improved, but also the effects of eliminating noise and smoothing the prediction block can be realized, and then the coding performance is improved.

[0406] In still another embodiment of the present application, based on the same inventive concept of the preceding embodiments, Fig. 16 is a schematic diagram of the composition structure of a decoder provided by the embodiment of the present application. As shown in Fig. 16, the decoder 160 can include a decoding unit 1601, a second determining unit 1602 and a second prediction unit 1603, wherein:

[0407] The decoding unit 1601 is configured to decode a code stream and determine a value of a first syntax element.

[0408] The second determining unit 1602 is configured to determine a first candidate prediction block of the current block when the first syntax element indicates that the current block uses a first prediction mode.

[0409] The second prediction unit 1603 is configured to predict the current block according to a second prediction mode to determine a second candidate prediction block of the current block when the current block uses a prediction fusion technology, wherein the first prediction mode is different from the second prediction mode; and fuse the first candidate prediction block and the second candidate prediction block to determine a prediction block of the current block.

[0410] In some embodiments, the decoding unit 1601 is further configured to decode the code stream and determine a first prediction parameter of the current block; and the second prediction unit 1603 is further configured to predict the current block according to the first prediction parameter to determine the first candidate prediction block of the current block.

[0411] In some embodiments, the first prediction parameter comprises first transposition identification information and first weight matrix index information; the second prediction unit 1603 is further configured to perform down-sampling processing on the neighboring reference samples of the current block to determine an initial input vector of the current block; determine a first target input vector of the current block according to the first transposition identification information and the initial input vector; determine a first weight matrix of the current block according to the first weight matrix index information, and perform multiplication operation on the first target input vector and the first weight matrix to determine a first output vector of the current block; and determine a first candidate prediction block of the current block according to the first transposition identification information and the first output vector of the current block.

[0412] In some embodiments, the second prediction unit 1603 is further configured to arrange and place the first output vector according to the first transposition identification information to determine a first intermediate prediction block of the current block; and determine the first intermediate prediction block as the first candidate prediction block of the current block.

[0413] In some embodiments, the second prediction unit 1603 is further configured to arrange and place the first output vector according to the first transposition identification information to determine a first intermediate prediction block of the current block; and perform up-sampling processing on the first intermediate prediction block to determine the first candidate prediction block of the current block.

[0414] In some embodiments, the first prediction mode comprises a matrix-based intra prediction mode; and the second prediction mode comprises at least one of an angular prediction mode, a diagonal prediction mode, a PLANAR mode, a DC mode, a block copy mode, an intra template matching prediction mode, an over-interpolation prediction mode, and a template matching based prediction mode.

[0415] In some embodiments, when the second prediction mode is the template matching based prediction mode, the second prediction unit 1603 is further configured to determine a template region of the current block; determine a second prediction parameter of the current block based on the template region; and predict the current block according to the second prediction parameter to determine a second candidate prediction block of the current block.

[0416] In some embodiments, the second determination unit 1602 is further configured to determine a plurality of groups of candidate prediction parameters of the current block; determine prediction samples of template regions corresponding to the plurality of groups of candidate prediction parameters, and determine cost results corresponding to the plurality of groups of candidate prediction parameters according to the prediction samples of the template regions and reconstructed samples of the template regions; and determine the second prediction parameter of the current block from the plurality of groups of candidate prediction parameters according to the cost results corresponding to the plurality of groups of candidate prediction parameters.

[0417] In some embodiments, the second determining unit 1602 is further configured to determine a prediction sample of the template region according to the first set of candidate prediction parameters and neighboring reference samples of the template region, and perform cost calculation on the prediction sample of the template region and the reconstructed sample of the template region to determine a cost result corresponding to the first set of candidate prediction parameters, wherein the first set of candidate prediction parameters is any one of the multiple sets of candidate prediction parameters.

[0418] In some embodiments, the first set of candidate prediction parameters comprises first candidate transposition identification information and first candidate weight matrix index information, and the second prediction unit 1603 is further configured to perform down-sampling processing on the neighboring reference samples of the template region to determine an initial input vector of the template region, determine a target input vector of the template region according to the first candidate transposition identification information and the initial input vector, determine a weight matrix of the template region according to the first candidate weight matrix index information, and perform multiplication operation on the target input vector and the weight matrix to determine an output vector of the template region, and determine the prediction sample of the template region according to the first candidate transposition identification information and the output vector of the template region.

[0419] In some embodiments, the second determining unit 1602 is further configured to determine a first cost result and a second cost result from the cost results corresponding to the multiple sets of candidate prediction parameters, and determine the second prediction parameter of the current block according to the candidate prediction parameter corresponding to the first cost result and the candidate prediction parameter corresponding to the second cost result, wherein the first cost result represents the minimum cost result among the cost results corresponding to the multiple sets of candidate prediction parameters, and the second cost result represents the minimum cost result among the cost results corresponding to the multiple sets of candidate prediction parameters except the first cost result.

[0420] In some embodiments, the second determining unit 1602 is further configured to determine the candidate prediction parameter corresponding to the second cost result as the second prediction parameter of the current block if the candidate prediction parameter corresponding to the first cost result is the same as the first prediction parameter, or determine the candidate prediction parameter corresponding to the first cost result as the second prediction parameter of the current block if the candidate prediction parameter corresponding to the first cost result is different from the first prediction parameter.

[0421] In some embodiments, the second prediction unit 1603 is further configured to determine a first weight of the first candidate prediction block and a second weight of the second candidate prediction block, and perform weighted operation according to the first weight and the first candidate prediction block and the second weight and the second candidate prediction block to determine the prediction block of the current block.

[0422] In some embodiments, the decoding unit 1601 is further configured to decode the bitstream to determine a first prediction parameter of the current block when the current block does not use the prediction fusion technique; the second prediction unit 1603 is further configured to predict the current block according to the first prediction parameter to determine a first candidate prediction block of the current block; and determine the prediction block of the current block according to the first candidate prediction block.

[0423] In some embodiments, the decoding unit 1601 is further configured to decode the bitstream to determine a value of the second syntax element; and the second determining unit 1602 is further configured to determine whether the current block uses the prediction fusion technique according to the value of the second syntax element.

[0424] In some embodiments, the second determining unit 1602 is further configured to determine that the current block uses the prediction fusion technique if the value of the second syntax element is a first value, and determine that the current block does not use the prediction fusion technique if the value of the second syntax element is a second value.

[0425] In some embodiments, the second determining unit 1602 is further configured to determine a third cost result of the template region corresponding to the case that the current block uses the prediction fusion technique, and a fourth cost result of the template region corresponding to the case that the current block does not use the prediction fusion technique; and determine whether the current block uses the prediction fusion technique according to the third cost result and the fourth cost result.

[0426] In some embodiments, the second determining unit 1602 is further configured to determine that the current block uses the prediction fusion technique if the third cost result is less than the fourth cost result, and determine that the current block does not use the prediction fusion technique if the third cost result is greater than the fourth cost result.

[0427] In some embodiments, the decoding unit 1601 is further configured to decode the bitstream to determine a residual block of the current block; and the second determining unit 1602 is further configured to determine a reconstructed block of the current block according to the prediction block of the current block and the residual block of the current block.

[0428] It can be understood that, in this embodiment, the "unit" can be a part of circuit, a part of processor, a part of program or software, etc., and of course can be a module, and can also be non-modular. Moreover, the components in this embodiment can be integrated in a processing unit, or can be physically present individually, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.

[0429] In still another embodiment of the present application, Fig. 17 is a specific hardware structure schematic diagram of a decoder provided by the embodiment of the present application. As shown in Fig. 17, the decoder 160 can include a second communication interface 1701, a second memory 1702 and a second processor 1703; each component is coupled together through a second bus system 1704. It can be understood that the second bus system 1704 is used to realize the connection communication between the components. The second bus system 1704 includes not only a data bus, but also a power bus, a control bus and a state signal bus. However, in order to clearly illustrate, all kinds of buses are marked as the second bus system 1704 in Fig. 17. Among them,

[0430] The second communication interface 1701 is used for receiving and sending signals in the process of transceiving information with other external network elements;

[0431] The second memory 1702 is used for storing a computer program capable of running on the second processor 1703;

[0432] The second processor 1703 is used for executing the following when running the computer program:

[0433] decoding the code stream, determining the value of the first syntax element; determining the first candidate prediction block of the current block when the first syntax element indicates that the current block uses the first prediction mode; predicting the current block according to the second prediction mode to determine the second candidate prediction block of the current block when the current block uses the prediction fusion technology, wherein the first prediction mode is different from the second prediction mode; fusing the first candidate prediction block and the second candidate prediction block to determine the prediction block of the current block.

[0434] Optionally, as another embodiment, the second processor 1703 is further configured to execute the method in any one of the preceding embodiments when running the computer program.

[0435] It can be understood that the hardware function of the second memory 1702 is similar to that of the first memory 1502, and the hardware function of the second processor 1703 is similar to that of the first processor 1503; here is not described in detail.

[0436] The embodiment provides a decoder, when the current block uses the MIP technology, the first candidate prediction block of the current block is determined, and then the second prediction mode can be used to determine the second candidate prediction block of the current block. Through the fusion of the first candidate prediction block and the second candidate prediction block, the fusion operation of the MIP prediction block and other prediction modes can be realized, not only the prediction accuracy can be improved, the compression efficiency is improved; but also the effect of eliminating noise and smoothing the prediction block can be realized, and then the coding and decoding performance is improved.

[0437] In still another embodiment of the present application, FIG. 18 is a schematic diagram of a composition structure of a coding system provided by an embodiment of the present application. As shown in FIG. 18, the coding system 180 can include an encoder 1801 and a decoder 1802.

[0438] In an embodiment of the present application, the encoder 1801 can be the encoder of any of the preceding embodiments, and the decoder 1802 can be the decoder of any of the preceding embodiments.

[0439] In some embodiments, an embodiment of the present application further provides a computer readable storage medium, having stored thereon a computer program. The computer program is executed by a processor (for example, the first processor or the second processor) to implement the method according to any of the preceding embodiments.

[0440] In some embodiments, an embodiment of the present application further provides a computer program product, including a computer program or instructions. The computer program or instructions are executed by a processor (for example, the first processor or the second processor) to implement the method according to any of the preceding embodiments.

[0441] In some embodiments, an embodiment of the present application further provides a computer program, which is executed by a processor (for example, the first processor or the second processor) to implement the method according to any of the preceding embodiments.

[0442] Those skilled in the art can clearly understand that the units and algorithm steps of the examples described in combination with the embodiments disclosed in the present application can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0443] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the preceding method embodiments, which will not be described here.

[0444] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiments described above are merely illustrative, for example, the division of the units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.

[0445] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e., can be located in one place or can be distributed to a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0446] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.

[0447] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part of the prior art or the part of the technical solutions can be embodied in the form of software product, and the computer software product stored in a storage medium includes a plurality of instructions for making a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and various program code storage media.

[0448] It should be noted that in the present application, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitation, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.

[0449] The above-mentioned sequence numbers of the embodiments of the present application are only for description, and do not represent advantages or disadvantages of the embodiments.

[0450] The methods disclosed in the several method embodiments provided by the present application can be combined arbitrarily without conflict, to obtain new method embodiments.

[0451] The features disclosed in the several product embodiments provided by the present application can be combined arbitrarily without conflict, to obtain new product embodiments.

[0452] The features disclosed in the several method or device embodiments provided by the present application can be combined arbitrarily without conflict, to obtain new method embodiments or device embodiments.

[0453] The above-mentioned is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims. Industrial applicability

[0454] In the embodiments of the present application, at the encoding end or the decoding end, when the first prediction mode is used for the current block, the first candidate prediction block of the current block is determined; then when the prediction fusion technology is used for the current block, the second candidate prediction block of the current block is determined according to the second prediction mode, wherein the first prediction mode is different from the second prediction mode; the first candidate prediction block and the second candidate prediction block are fused to determine the prediction block of the current block. In this way, when the MIP technology is used for the current block, the first candidate prediction block of the current block is determined, and then the second candidate prediction block of the current block can also be determined by using the second prediction mode, and the first candidate prediction block and the second candidate prediction block are fused, so that the fusion operation of the MIP prediction block and other prediction modes can be realized, which not only can improve the accuracy of prediction and improve the compression efficiency, but also can realize the effect of eliminating noise and smoothing the prediction block, and further improve the coding performance.

Claims

1. A decoding method, applied to a decoder, comprising: Decoding the code stream and determining the value of the first syntax element; When the first syntax element indicates that the current block uses a first prediction mode, determining a first candidate prediction block for the current block; When the current block uses a prediction fusion technology, predicting the current block according to a second prediction mode to determine a second candidate prediction block for the current block, wherein the first prediction mode is different from the second prediction mode; The first candidate prediction block and the second candidate prediction block are merged to determine a prediction block of the current block.

2. The method according to claim 1, wherein The determining of the first candidate prediction block of the current block includes: Decoding a bitstream to determine a first prediction parameter of the current block; The current block is predicted according to the first prediction parameter to determine a first candidate prediction block for the current block.

3. The method according to claim 2, wherein: The first prediction parameter includes first transposition identification information and first weight matrix index information; Predicting the current block according to the first prediction parameter to determine a first candidate prediction block for the current block includes: Downsampling adjacent reference samples of the current block to determine an initial input vector of the current block; Determining a first target input vector of the current block according to the first transposition identification information and the initial input vector; Determining a first weight matrix of the current block according to the first weight matrix index information, and performing a multiplication operation on the first target input vector and the first weight matrix to determine a first output vector of the current block; A first candidate prediction block of the current block is determined according to the first transposition identification information and the first output vector of the current block.

4. The method according to claim 3, wherein: The determining, according to the first transposition identification information and the first output vector of the current block, a first candidate prediction block of the current block includes: Arrange and place the first output vectors according to the first transposition identification information to determine a first intermediate prediction block of the current block; The first intermediate prediction block is determined as a first candidate prediction block for the current block.

5. The method according to claim 3, wherein The determining, according to the first transposition identification information and the first output vector of the current block, a first candidate prediction block of the current block includes: Arrange and place the first output vectors according to the first transposition identification information to determine a first intermediate prediction block of the current block; Upsampling is performed on the first intermediate prediction block to determine a first candidate prediction block for the current block.

6. The method according to claim 2, wherein: The first prediction mode includes a matrix-based intra prediction mode; The second prediction mode includes at least one of the following: angular prediction mode, diagonal prediction mode, PLANAR mode, DC mode, block copy mode, intra template matching prediction mode, super interpolation prediction mode and template matching based prediction mode.

7. The method according to claim 6, wherein: When the second prediction mode is a prediction mode based on template matching, predicting the current block according to the second prediction mode to determine a second candidate prediction block for the current block includes: Determining a template area of ​​the current block; determining a second prediction parameter of the current block based on the template area; The current block is predicted according to the second prediction parameter to determine a second candidate prediction block for the current block.

8. The method according to claim 7, wherein: The determining the second prediction parameter of the current block based on the template area includes: determining a plurality of sets of candidate prediction parameters for the current block; Determining prediction samples of the template region corresponding to the multiple sets of candidate prediction parameters, and determining cost results corresponding to the multiple sets of candidate prediction parameters based on the prediction samples of the template region corresponding to the multiple sets of candidate prediction parameters and the reconstructed samples of the template region; Determine a second prediction parameter of the current block from the multiple sets of candidate prediction parameters according to cost results corresponding to the multiple sets of candidate prediction parameters.

9. The method according to claim 8, wherein Determining the cost results corresponding to the multiple groups of candidate prediction parameters includes: Predicting the template region according to a first set of candidate prediction parameters, and determining prediction samples of the template region corresponding to the first set of candidate prediction parameters; Performing cost calculation on the predicted samples of the template area and the reconstructed samples of the template area to determine cost results corresponding to the first set of candidate prediction parameters; The first group of candidate prediction parameters is any one of the multiple groups of candidate prediction parameters.

10. The method according to claim 9, wherein: The first set of candidate prediction parameters includes first candidate transposition identification information and first candidate weight matrix index information; The predicting the template region according to the first set of candidate prediction parameters and determining prediction samples of the template region corresponding to the first set of candidate prediction parameters includes: Downsampling adjacent reference samples of the template region to determine an initial input vector of the template region; determining a target input vector for the template region according to the first candidate transposition identification information and the initial input vector; Determining a weight matrix for the template region according to the first candidate weight matrix index information, and performing a multiplication operation on the target input vector and the weight matrix to determine an output vector for the template region; Determine a prediction sample of the template region according to the first candidate transposition identification information and the output vector of the template region.

11. The method according to claim 8, wherein The determining, according to the cost results corresponding to the multiple sets of candidate prediction parameters, the second prediction parameter of the current block from the multiple sets of candidate prediction parameters includes: Determining a first cost result and a second cost result from the cost results corresponding to the multiple groups of candidate prediction parameters; Determining a second prediction parameter of the current block according to the candidate prediction parameter corresponding to the first cost result and the candidate prediction parameter corresponding to the second cost result; Among them, the first cost result represents the minimum cost result among the cost results corresponding to the multiple groups of candidate prediction parameters, and the second cost result represents the minimum cost result among the cost results corresponding to the multiple groups of candidate prediction parameters except the first cost result.

12. The method according to claim 11, wherein The determining the second prediction parameter of the current block according to the candidate prediction parameter corresponding to the first cost result and the candidate prediction parameter corresponding to the second cost result includes: If the candidate prediction parameter corresponding to the first cost result is the same as the first prediction parameter, determining the candidate prediction parameter corresponding to the second cost result as the second prediction parameter of the current block; If the candidate prediction parameter corresponding to the first cost result is different from the first prediction parameter, the candidate prediction parameter corresponding to the first cost result is determined as the second prediction parameter of the current block.

13. The method according to any one of claims 1 to 12, wherein The fusing the first candidate prediction block and the second candidate prediction block to determine the prediction block of the current block includes: determining a first weight of the first candidate prediction block and a second weight of the second candidate prediction block; A weighted operation is performed according to the first weight and the first candidate prediction block, and the second weight and the second candidate prediction block to determine a prediction block for the current block.

14. The method according to claim 1, wherein The method further comprises: When the current block does not use the prediction fusion technology, decoding the bitstream to determine the first prediction parameter of the current block; Predicting the current block according to the first prediction parameter to determine a first candidate prediction block for the current block; A prediction block for the current block is determined according to the first candidate prediction block.

15. The method according to claim 1, wherein The method further comprises: Decoding the code stream and determining a value of the second syntax element; Whether the current block uses a prediction fusion technology is determined according to the value of the second syntax element.

16. The method according to claim 15, wherein The determining, according to the value of the second syntax element, whether the current block uses the prediction fusion technology includes: If the value of the second syntax element is the first value, determining that the current block uses the prediction fusion technology; If the value of the second syntax element is the second value, it is determined that the current block does not use the prediction fusion technology.

17. The method according to claim 1, wherein The method further comprises: Determine a third cost result of the template region corresponding to the current block when the prediction fusion technology is used and a fourth cost result of the template region corresponding to the current block when the prediction fusion technology is not used; It is determined whether the current block uses a prediction fusion technology according to the third cost result and the fourth cost result.

18. The method according to claim 17, wherein The determining, according to the third cost result and the fourth cost result, whether the current block uses the prediction fusion technology includes: If the third cost result is less than the fourth cost result, determining that the current block uses the prediction fusion technology; If the third cost result is greater than the fourth cost result, it is determined that the current block does not use the prediction fusion technology.

19. The method according to any one of claims 1 to 18, wherein The method further comprises: Decoding a bitstream to determine a residual block of the current block; A reconstructed block of the current block is determined according to the prediction block of the current block and the residual block of the current block.

20. A coding method, applied to an encoder, comprising: When the current block uses a first prediction mode, determining a first candidate prediction block of the current block; When the current block uses a prediction fusion technology, predicting the current block according to a second prediction mode to determine a second candidate prediction block for the current block, wherein the first prediction mode is different from the second prediction mode; The first candidate prediction block and the second candidate prediction block are merged to determine a prediction block of the current block.

21. The method according to claim 20, wherein The method further comprises: Determining a value of a first syntax element, wherein the first syntax element is used to indicate whether the current block uses a first prediction mode; The value of the first syntax element is coded, and the obtained coded bits are written into a bitstream.

22. The method according to claim 20, wherein The method further comprises: Determining a value of a second syntax element, wherein the second syntax element is used to indicate whether the current block uses a prediction fusion technology; Perform encoding processing on the value of the second syntax element, and write the obtained encoding bits into a bitstream.

23. The method according to claim 20, wherein The method further comprises: When the current block does not use the prediction fusion technology, determining a first candidate prediction block of the current block; A prediction block for the current block is determined according to the first candidate prediction block.

24. The method according to claim 20, wherein The method further comprises: determining a first rate-distortion cost value corresponding to when the current block uses a prediction fusion technique, determining a second rate-distortion cost value corresponding to when the current block does not use the prediction fusion technique, and determining a third rate-distortion cost value corresponding to when the current block uses a prediction mode other than the first prediction mode; It is determined whether the current block uses a prediction fusion technology and / or whether the current block uses a first prediction mode according to the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value.

25. The method according to claim 24, wherein The determining of a first rate-distortion cost value corresponding to the current block when the prediction fusion technology is used includes: determining a plurality of sets of candidate prediction parameters for the current block; Predicting the current block using the multiple sets of candidate prediction parameters to determine multiple sets of candidate prediction blocks for the current block; Fusing the multiple groups of candidate prediction blocks and the second candidate prediction blocks respectively to determine multiple groups of fused blocks of the current block; Rate-distortion cost calculations are performed on the multiple groups of fused blocks of the current block and the original blocks of the current block respectively to determine first rate-distortion cost values ​​corresponding to the multiple groups of candidate prediction parameters.

26. The method according to claim 24, wherein The determining a second rate-distortion cost value corresponding to the current block when the prediction fusion technology is not used includes: determining a plurality of sets of candidate prediction parameters for the current block; Predicting the current block using the multiple sets of candidate prediction parameters to determine multiple sets of candidate prediction blocks for the current block; Rate-distortion cost calculations are performed on the multiple groups of candidate prediction blocks of the current block and the original block of the current block respectively to determine second rate-distortion cost values ​​corresponding to the multiple groups of candidate prediction parameters.

27. The method according to claim 24, wherein The determining, according to the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value, whether the current block uses the prediction fusion technology and / or whether the current block uses the first prediction mode includes: If a minimum cost value among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value is the minimum first rate-distortion cost value, determining that the current block uses a prediction fusion technology and the current block uses a first prediction mode; If the minimum cost value among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value is the minimum second rate-distortion cost value, determining that the current block does not use the prediction fusion technology and uses the first prediction mode for the current block; If the minimum cost value among the first rate-distortion cost value, the second rate-distortion cost value, and the third rate-distortion cost value is the minimum third rate-distortion cost value, it is determined that the current block does not use the prediction fusion technology and the current block does not use the first prediction mode.

28. The method according to claim 20 or 23, wherein The determining of the first candidate prediction block of the current block includes: determining a first prediction parameter of the current block; The current block is predicted according to the first prediction parameter to determine a first candidate prediction block for the current block.

29. The method according to claim 28, wherein The determining the first prediction parameter of the current block includes: determining a plurality of sets of candidate prediction parameters for the current block; Predicting the current block using the multiple sets of candidate prediction parameters to determine multiple sets of candidate prediction blocks for the current block; Fusing the multiple groups of candidate prediction blocks and the second candidate prediction blocks respectively to determine multiple groups of fused blocks of the current block; Performing rate-distortion cost calculations on the multiple groups of fused blocks of the current block and the original blocks of the current block respectively, and determining first rate-distortion cost values ​​corresponding to the multiple groups of candidate prediction parameters; A minimum cost value is determined from the first rate-distortion cost values ​​corresponding to the multiple groups of candidate prediction parameters, and the candidate prediction parameter corresponding to the minimum cost value is determined as the first prediction parameter of the current block.

30. The method of claim 28, wherein The method further comprises: When the current block uses the first prediction mode, encoding is performed on the first prediction parameter of the current block, and the obtained encoding bits are written into the bitstream.

31. The method of claim 28, wherein The first prediction parameter includes first transposition identification information and first weight matrix index information; Predicting the current block according to the first prediction parameter to determine a first candidate prediction block for the current block includes: Downsampling adjacent reference samples of the current block to determine an initial input vector of the current block; Determining a first target input vector of the current block according to the first transposition identification information and the initial input vector; Determining a first weight matrix of the current block according to the first weight matrix index information, and performing a multiplication operation on the first target input vector and the first weight matrix to determine a first output vector of the current block; A first candidate prediction block of the current block is determined according to the first transposition identification information and the first output vector of the current block.

32. The method of claim 28, wherein: The first prediction mode includes a matrix-based intra prediction mode; The second prediction mode includes at least one of the following: angular prediction mode, diagonal prediction mode, PLANAR mode, DC mode, block copy mode, intra template matching prediction mode, super interpolation prediction mode and template matching based prediction mode.

33. The method according to claim 32, wherein When the second prediction mode is a prediction mode based on template matching, predicting the current block according to the second prediction mode to determine a second candidate prediction block for the current block includes: determining a template area of ​​the current block; determining a second prediction parameter of the current block based on the template area; The current block is predicted according to the second prediction parameter to determine a second candidate prediction block for the current block.

34. The method according to claim 33, wherein The determining the second prediction parameter of the current block based on the template area includes: determining a plurality of sets of candidate prediction parameters for the current block; Determining prediction samples of the template region corresponding to the multiple sets of candidate prediction parameters, and determining cost results corresponding to the multiple sets of candidate prediction parameters based on the prediction samples of the template region corresponding to the multiple sets of candidate prediction parameters and the reconstructed samples of the template region; Determine a second prediction parameter of the current block from the multiple sets of candidate prediction parameters according to cost results corresponding to the multiple sets of candidate prediction parameters.

35. The method according to claim 34, wherein Determining the cost results corresponding to the multiple groups of candidate prediction parameters includes: Predicting the template region according to a first set of candidate prediction parameters, and determining prediction samples of the template region corresponding to the first set of candidate prediction parameters; Performing cost calculation on the predicted samples of the template area and the reconstructed samples of the template area to determine cost results corresponding to the first set of candidate prediction parameters; The first group of candidate prediction parameters is any one of the multiple groups of candidate prediction parameters.

36. The method of claim 34, wherein: The determining, according to the cost results corresponding to the multiple sets of candidate prediction parameters, the second prediction parameter of the current block from the multiple sets of candidate prediction parameters includes: Determining a first cost result and a second cost result from the cost results corresponding to the multiple groups of candidate prediction parameters; Determining a second prediction parameter of the current block according to the candidate prediction parameter corresponding to the first cost result and the candidate prediction parameter corresponding to the second cost result; Among them, the first cost result represents the minimum cost result among the cost results corresponding to the multiple groups of candidate prediction parameters, and the second cost result represents the minimum cost result among the cost results corresponding to the multiple groups of candidate prediction parameters except the first cost result.

37. The method according to claim 36, wherein The determining the second prediction parameter of the current block according to the candidate prediction parameter corresponding to the first cost result and the candidate prediction parameter corresponding to the second cost result includes: If the candidate prediction parameter corresponding to the first cost result is the same as the first prediction parameter, determining the candidate prediction parameter corresponding to the second cost result as the second prediction parameter of the current block; If the candidate prediction parameter corresponding to the first cost result is different from the first prediction parameter, the candidate prediction parameter corresponding to the first cost result is determined as the second prediction parameter of the current block.

38. The method according to any one of claims 20 to 37, wherein The fusing the first candidate prediction block and the second candidate prediction block to determine the prediction block of the current block includes: determining a first weight of the first candidate prediction block and a second weight of the second candidate prediction block; A weighted operation is performed according to the first weight and the first candidate prediction block, and the second weight and the second candidate prediction block to determine a prediction block for the current block.

39. The method according to any one of claims 20 to 37, wherein The method further comprises: Determining an original block of the current block; Determine a residual block of the current block according to the original block of the current block and the predicted block of the current block; The residual block of the current block is coded, and the obtained coded bits are written into a bitstream.

40. A code stream, wherein The code stream is generated by bit encoding according to information to be encoded; wherein the information to be encoded includes at least one of the following: a residual block of a current block, a value of a first syntax element, and a value of a second syntax element; The first syntax element is used to indicate whether the current block uses a first prediction mode, and the second syntax element is used to indicate whether the current block uses a prediction fusion technology.

41. An encoder comprising a first determining unit and a first predicting unit, wherein: The first determining unit is configured to determine a first candidate prediction block for the current block when the current block uses a first prediction mode; The first prediction unit is configured to, when the current block uses a prediction fusion technology, predict the current block according to a second prediction mode to determine a second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode; and fuse the first candidate prediction block and the second candidate prediction block to determine a prediction block of the current block.

42. An encoder comprising a first memory and a first processor, wherein: The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 20 to 39 when running the computer program.

43. A decoder comprising a decoding unit, a second determining unit, and a second predicting unit, wherein: The decoding unit is configured to decode the code stream and determine a value of the first syntax element; The second determining unit is configured to determine a first candidate prediction block for the current block when the first syntax element indicates that the current block uses a first prediction mode; The second prediction unit is configured to, when the current block uses a prediction fusion technology, predict the current block according to a second prediction mode to determine a second candidate prediction block of the current block, wherein the first prediction mode is different from the second prediction mode; and fuse the first candidate prediction block and the second candidate prediction block to determine a prediction block of the current block.

44. A decoder comprising a second memory and a second processor, wherein: The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 19 when running the computer program.

45. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 19 or the method according to any one of claims 20 to 39 is implemented.

Citation Information

Patent Citations

  • Method and apparatus for intra predictive coding of video data

    CN114128294A

  • Matrix combination for matrix-weighted intra prediction in video coding

    US20210092405A1

  • Decoding method, encoding method, decoder, encoder, and encoding and decoding system

    WO2023141970A1

  • Decoding method, coding method, decoder and encoder

    WO2023193253A1