Encoding and decoding method, code stream, encoder, decoder and storage medium

CN120035995APending Publication Date: 2025-05-23GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280100840.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-10-12
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

In existing technologies, fixed weighting coefficients are used for weighted prediction during inter-frame prediction, which cannot adapt to the local features of different sampling points within the current block, resulting in inaccurate chroma prediction and reduced encoding and decoding efficiency.

Method used

By determining the prediction parameters of the current block, the model parameters are determined based on the first color component value and the second color component value in the first prediction block. The model parameters are then used to perform chromaticity prediction, which fully reflects the correlation between luminance and chromaticity, improves the accuracy of inter-frame chromaticity prediction, and saves bitrate.

Benefits of technology

It improves the accuracy of inter-frame chroma prediction and encoding/decoding efficiency, thereby enhancing encoding/decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120035995A_ABST
    Figure CN120035995A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a coding and decoding method, a code stream, a coder, a decoder and a storage medium, and the method comprises the steps: decoding the code stream, and determining a prediction parameter of a current block; determining a first prediction block of the current block according to the prediction parameter; determining model parameters according to the first color component value and the second color component value in the first prediction block; determining a reference sample value of a first color component sampling point of the current block, and determining a predicted value of a second color component sampling point of the current block according to the reference sample value of the first color component sampling point of the current block and the model parameters; and determining a reconstruction value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block. In this way, the accuracy of inter-frame chroma prediction can be improved, the code rate is saved, and the coding and decoding performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method, code stream, encoder, decoder and storage medium Technical Field

[0001] The embodiments of the present application relate to the field of video coding and decoding technology, and in particular to a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium. Background Art

[0002] In the inter-frame prediction process, motion compensation can be divided into unidirectional motion compensation and bidirectional motion compensation according to the slice type. For the current block, the matching block of the current block is determined from the reference image List0 and / or the reference image List1 based on the motion vector information. Then, a weighted prediction is performed based on the determined matching block to obtain the inter-frame prediction block of the current block.

[0003] In related art, a weighted prediction is performed using fixed weight coefficients for matching blocks identified by reference images List0 and / or List1 to determine the inter-frame prediction block for the current block. However, the weight coefficients of this weighted prediction method cannot adapt to the local features of different sampling points within the current block, resulting in inaccurate prediction of the current block and reduced encoding and decoding efficiency.

[0004] Summary of the Invention

[0005] The embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium, which can not only improve the accuracy of inter-frame chroma prediction and save bit rate, but also improve coding and decoding efficiency, thereby improving coding and decoding performance.

[0006] The technical solution of the embodiment of the present application can be implemented as follows:

[0007] In a first aspect, an embodiment of the present application provides a decoding method, comprising:

[0008] Decode the code stream and determine the prediction parameters of the current block;

[0009] Determining a first prediction block of the current block according to the prediction parameters;

[0010] determining model parameters according to the first color component value and the second color component value in the first prediction block;

[0011] Determine a reference sample value of a first color component sampling point of the current block, and determine a predicted value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameters;

[0012] Determine a reconstructed value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block.

[0013] In a second aspect, an embodiment of the present application provides an encoding method, including:

[0014] Determine the prediction parameters of the current block;

[0015] Determining a first prediction block of the current block according to the prediction parameters;

[0016] determining model parameters according to the first color component value and the second color component value in the first prediction block;

[0017] Determine a reference sample value of a first color component sampling point of the current block, and determine a predicted value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameters;

[0018] Determine a prediction difference value of the second color component sampling point of the current block according to the prediction value of the second color component sampling point of the current block.

[0019] In a third aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:

[0020] The predicted difference value of the second color component sampling point of the current block, the prediction parameters of the current block, the number of coefficients of the target filter, the shape of the target filter, the value of the filter shape parameter, the first block category identification information of the current block, and the second block category identification information of the current block.

[0021] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first determining unit and a first predicting unit; wherein,

[0022] A first determining unit configured to determine a prediction parameter of a current block; and determine a first prediction block of the current block according to the prediction parameter;

[0023] The first determining unit is further configured to determine a model parameter according to the first color component value and the second color component value in the first prediction block;

[0024] A first prediction unit is configured to determine a reference sample value of a first color component sampling point of a current block, and determine a predicted value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and a model parameter;

[0025] The first determining unit is further configured to determine a predicted difference value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block.

[0026] In a fifth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor; wherein,

[0027] a first memory for storing a computer program capable of running on the first processor;

[0028] The first processor is configured to execute the method according to the second aspect when running a computer program.

[0029] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a decoding unit, a second determining unit, and a second predicting unit; wherein,

[0030] a decoding unit configured to decode the bitstream and determine prediction parameters for a current block;

[0031] A second determining unit is configured to determine a first prediction block of the current block according to the prediction parameter; and determine a model parameter according to the first color component value and the second color component value in the first prediction block;

[0032] a second prediction unit configured to determine a reference sample value of a first color component sampling point of a current block, and determine a predicted value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and a model parameter;

[0033] The second determining unit is further configured to determine the reconstructed value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block.

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

[0035] a second memory for storing a computer program capable of running on the second processor;

[0036] The second processor is configured to execute the method according to the first aspect when running a computer program.

[0037] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed, implements the method described in the first aspect or the method described in the second aspect.

[0038] Embodiments of the present application provide a coding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. In either the encoding or decoding end, after determining prediction parameters for a current block, a first prediction block for the current block is determined based on the prediction parameters; model parameters are determined based on the first and second color component values ​​in the first prediction block; reference sample values ​​for the first color component sampling points of the current block are then determined, and prediction values ​​for the second color component sampling points of the current block are determined based on the reference sample values ​​for the first color component sampling points of the current block and the model parameters. In this way, the encoding end can determine a prediction difference for the second color component sampling points of the current block based on the prediction values ​​for the second color component sampling points of the current block; and at the decoding end, a reconstructed value for the second color component sampling points of the current block can be determined based on the prediction values ​​for the second color component sampling points of the current block. Specifically, the model parameters are determined based on the first and second color component values ​​in the first prediction block. The model parameters fully reflect the correlation between luminance and chrominance in the prediction block, and this correlation is applied to the existing luminance information of the current block for chrominance prediction. This improves the accuracy of inter-frame chrominance prediction, saves bitrate, and improves encoding and decoding efficiency, thereby enhancing encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] FIG1 is a schematic diagram of a one-way prediction process;

[0040] FIG2 is a schematic diagram of a bidirectional prediction process;

[0041] FIG3 is a schematic diagram of a weighted prediction process;

[0042] FIG4 is a schematic diagram of another weighted prediction process;

[0043] FIG5A is a schematic block diagram of an encoder provided in an embodiment of the present application;

[0044] FIG5B is a schematic block diagram of a decoder according to an embodiment of the present application;

[0045] FIG6 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application;

[0046] FIG7 is a schematic diagram of a flowchart of a decoding method provided in an embodiment of the present application;

[0047] FIG8 is a flowchart of a decoding method provided in an embodiment of the present application;

[0048] FIG9 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;

[0049] FIG10 is a schematic diagram of a CP-CCCM prediction process provided in an embodiment of the present application;

[0050] FIG11 is a schematic diagram of another CP-CCCM prediction process provided in an embodiment of the present application;

[0051] FIG12 is a schematic diagram of the composition of a filter provided in an embodiment of the present application;

[0052] FIG13A is a schematic diagram of the composition of a filter coefficient provided in an embodiment of the present application;

[0053] FIG13B is a schematic diagram of the composition of a predicted chroma pixel provided by an embodiment of the present application;

[0054] FIG14 is a schematic diagram of a CP-CCCM one-way prediction process provided by an embodiment of the present application;

[0055] FIG15 is a schematic diagram of a CP-CCCM bidirectional prediction process provided by an embodiment of the present application;

[0056] FIG16 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;

[0057] FIG17 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;

[0058] FIG18 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;

[0059] FIG19 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;

[0060] FIG20 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0063] In the following description, reference is made to "some embodiments," which describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. It should also be noted that the terms "first, second, and third" in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first, second, and third" may be interchanged in a specific order or sequential order where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0064] In a video image, a first color component, a second color component, and a third color component are generally used to represent a coding block (CB); wherein the three color components are a luminance component, a blue chrominance component, and a red chrominance component, respectively. Specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V; thus, the video image can be represented in either the YCbCr format or the YUV format.

[0065] It can be understood that in the current video image or video encoding and decoding process, the cross-component prediction technology mainly includes the cross-component linear model (CCLM) prediction mode and the multi-directional linear model (MDLM) prediction mode. Regardless of the model factor derived according to the CCLM prediction mode or the model factor derived according to the MDLM prediction mode, the corresponding prediction model can realize the prediction between color components such as the first color component to the second color component, the second color component to the first color component, the first color component to the third color component, the third color component to the first color component, the second color component to the third color component, or the third color component to the second color component.

[0066] Taking the prediction from the first color component to the second color component as an example, assuming that the first color component is the luminance component and the second color component is the chrominance component, in order to reduce the redundancy between the luminance component and the chrominance component, the CCLM prediction mode is used in VVC, that is, the chrominance prediction value is constructed according to the luminance reconstruction value of the same coding block, such as: Pred C (i, j) = α·Rec L (i,j)+β.

[0067] Among them, i, j represent the position coordinates of the pixel to be predicted in the coding block, i represents the horizontal direction, and j represents the vertical direction; Pred C(i, j) represents the chroma prediction value corresponding to the pixel to be predicted at the position coordinate (i, j) in the coding block, Rec L (i, j) represents the reconstructed brightness value of the pixel to be predicted at position (i, j) in the same coding block (after downsampling). In addition, α and β represent model factors, which can be derived from the reference pixels.

[0068] During inter-frame prediction, motion compensation can be categorized as unidirectional or bidirectional, depending on the slice type. The current block then uses the motion vector (MV) information from either the List0 or List1 reference image to determine its matching block, and the prediction block for the current block is determined based on this matching block. The matching block here is also referred to as the "compensation block."

[0069] When performing unidirectional prediction (i.e., List0 prediction or List1 prediction), a matching block is determined from the List0 reference image or the List1 reference image, and the matching block is weighted to obtain the inter-frame prediction block of the current block. The processes of chroma weighted prediction and luma weighted prediction are similar. Taking chroma weighted prediction as an example, as shown in Figure 1, the process may include:

[0070] S101: Obtain a forward motion vector or a backward motion vector of a current block.

[0071] S102: Determine a forward chroma matching block or a backward chroma matching block.

[0072] S103: Perform weighted prediction on the forward chroma matching block or the backward chroma matching block.

[0073] S104: Determine a chroma prediction block for the current block.

[0074] When bidirectional prediction is performed, a List0 matching block is determined from the List0 reference image, and a List1 matching block is determined from the List1 reference image. Then, a weighted prediction is performed on the List0 matching block and the List1 matching block to obtain an inter-frame prediction block of the current block. The processes of chroma weighted prediction and luma weighted prediction are similar. Taking chroma weighted prediction as an example, as shown in Figure 2, the process may include:

[0075] S201: Obtain the forward motion vector of the current block.

[0076] S202: Determine a forward chroma matching block.

[0077] S203: Obtain the backward motion vector of the current block.

[0078] S204: Determine a backward chroma matching block.

[0079] S205: Perform weighted prediction on the forward chroma matching block and the backward chroma matching block.

[0080] S206: Determine the chroma prediction block of the current block.

[0081] It should be noted that the current block can be the current coding unit (Coding Unit, CU), the current transform unit (Transform Unit, TU), the current prediction unit (Prediction Unit, PU), the current coding block (Coding Block, CB), etc., and the embodiments of the present application do not make specific limitations.

[0082] It's also worth noting that in H.266 / VVC, weighted prediction (WP) algorithms primarily include the default WP algorithm, the explicit WP algorithm, and the bi-prediction with CU-level weights (BCW) algorithm. The following sections describe the relevant technologies for each of these weighted prediction algorithms.

[0083] The data processing flow of inter-frame weighted prediction is as follows:

[0084] Weighted prediction input: coordinate information (xCb, yCb) of the current block, width nCbW and height nCbH, prediction blocks predSamplesL0 and predSamplesL1, prediction list usage identifiers predFlagL0 and predFlagL1, reference image indexes refIdxL0 and refIdxL1, BCW weight index bcwIdx, color component index cIdx.

[0085] Weighted prediction output: (nCbW)×(nCbH) prediction block pbSamples.

[0086] For the weighted prediction process, in order to effectively improve the predictive coding effect of the gradual video sequence, the inter-frame weighted prediction method is used in VVC to obtain the final inter-frame prediction value of the current image through a weight and an offset value for the prediction blocks predSamplesL0 and predSamplesL1 after unidirectional or bidirectional motion compensation of the current image, thereby achieving the purpose of correcting the motion compensated prediction pixels in the P image or B image. Among them, VVC stipulates two weighted prediction algorithms: default weighted prediction and explicit weighted prediction. In addition, for the current block of bidirectional prediction, VVC can also use BCW to determine its weighted prediction weight coefficient. For example, BCW presets 5 candidate weight coefficients, and the weight coefficient of BCW is determined according to the value of the weight coefficient index number.

[0087] (1) Considering that the default weighted prediction process and the BCW prediction process have the same data processing steps, the default weighted prediction process and the BCW prediction process can use the same weighted prediction process, as shown in Figure 3, which may include:

[0088] S301: Determine whether predFlagL0=1 and predFlagL1=0?

[0089] S302: Obtain a final inter-frame prediction value based on the first calculation model.

[0090] S303: Is it determined whether predFlagL0=0 and predFlagL1=1?

[0091] S304: Obtain a final inter-frame prediction value based on the second calculation model.

[0092] S305: Determine whether predFlagL0=1 and predFlagL1=1?

[0093] It should be noted that, for S301, if the judgment result is yes, S302 is executed, that is, based on the first calculation model, the final inter-frame prediction value is obtained; if the judgment result is no, S303 is executed, that is, whether predFlagL0 = 0 and predFlagL1 = 1 is further determined. For S303, if the judgment result is yes, S304 is executed, that is, based on the second calculation model, the final inter-frame prediction value is obtained; if the judgment result is no, S305 is executed, that is, whether predFlagL0 = 1 and predFlagL1 = 1 is further determined.

[0094] S306: Is bcwIdx=0 or ciip_flag[xCb][yCb]=1?

[0095] S307: Obtain a final inter-frame prediction value based on the third calculation model.

[0096] S308: Is bcwIdx not 0 and ciip_flag[xCb][yCb]=0?

[0097] S309: Obtain a final inter-frame prediction value based on the first weight w0, the second weight w1 and the fourth calculation model.

[0098] It should also be noted that, for S305, if the judgment result is yes, S306 is executed, that is, whether bcwIdx = 0 or ciip_flag[xCb][yCb] = 1 is further determined. For S306, if the judgment result is yes, S307 is executed, that is, based on the third calculation model, a final inter-frame prediction value is obtained; if the judgment result is no, S308 is executed, that is, whether bcwIdx is not 0 and ciip_flag[xCb][yCb] = 0 is further determined; if the further judgment result is yes, S309 can be executed, that is, based on the first weight w0, the second weight w1, and the fourth calculation model, a final inter-frame prediction value is obtained.

[0099] In the embodiment of the present application, the default weighted prediction process can be divided into three cases according to the usage of the reference list:

[0100] Case ①: Using only the reference list List0, the predicted pixel pbSamples[x][y] can be calculated using the first calculation model, and the first calculation model is as follows:

[0101] pbSamples[x][y]=Clip3(0,(1<<bitDepth)-1,(predSamplesL0[x][y]+offset1)>>shift1) (1)

[0102] Case 2: Using only the reference list List1, the predicted pixel pbSamples[x][y] can be calculated using the second calculation model, and the second calculation model is as follows:

[0103] pbSamples[x][y]=Clip3(0,(1<<bitDepth)-1,(predSamplesL1[x][y]+offset1)>>shift1) (2)

[0104] Case ③: Both reference lists List0 and List1 are used, and the predicted pixel pbSamples[x][y] can be calculated using the third calculation model, and the third calculation model is as follows:

[0105] pbSamples[x][y]=Clip3(0,(1<<bitDepth)-1,(predSamplesL0[x][y]+predSamplesL1[x][y]+offset2)>>shift2) (3)

[0106] Where predSamplesL0[x][y] and predSamplesL1[x][y] represent the predicted values ​​of List0 and List1 of the current block, respectively. x and y represent the horizontal and vertical coordinates of the pixel in the current block, respectively. In addition, shift1, shift2, offset1, and offset2 do not need to be transmitted in the bitstream and only need to be determined based on the bit depth of the input sequence, as shown below:

[0107] shift1=Max(2,14-bitDepth) (4)

[0108] shift2=Max(3,15-bitDepth) (5)

[0109] offset1=1<<(shift1-1) (6)

[0110] offset2=1<<(shift2-1) (7)

[0111] In the embodiment of the present application, for the BCW prediction process, the BCW can be used to determine the weight coefficient of its weighted prediction. BCW presets 5 candidate weight coefficients. The BCW weight coefficient is determined according to the value of the weight coefficient index number. The data processing process is as follows:

[0112] If bcwIdx (ie, the BCW weight coefficient index number) is 0 or ciip_flag is 1, the predicted pixel pbSamples[x][y] can be calculated using the third calculation model, and the third calculation model is shown in the above formula (3).

[0113] If bcwIdx is not 0 and ciip_flag is 0, the second weight (i.e., the backward prediction block weight) w1 is determined to be bcwWLut[bcwIdx], where bcwWLut[k] = {4, 5, 3, 10, -2}; accordingly, the first weight (i.e., the forward prediction block weight) w0 is 8-w1. At this time, the predicted pixel pbSamples[x][y] can be calculated using the fourth calculation model, and the fourth calculation model is as follows:

[0114] pbSamples[x][y]=Clip3(0,(1<<bitDepth)-1,(w0*predSamplesL0[x][y]+w1*predSamplesL1[x][y]+offset3)>>(shift1+3)) (8)

[0115] The value of offset3 is set to 1<<(shift1+2).

[0116] (2) For the explicit weighted prediction process, cfg is closed by default. As shown in Figure 4, the process may include:

[0117] S401: Get some variables w0, w1, o0, o1 through conditions.

[0118] In the embodiment of the present application, it is first determined whether the current block is a luminance component. If the current block is a luminance component, then log2Wd=LumaLog2WeightDenom+shift1; where:

[0119] When predFlagL0=1, w0=LumaWeightL0[refIdxL0], o0=LumaOffsetL0[refIdxL0]<<(bitDepth-8);

[0120] When predFlagL1=1, w1=LumaWeightL1[refIdxL1], o1=LumaOffsetL1[refIdxL1]<<(bitDepth-8).

[0121] If the current block is a chroma component, then log2Wd=ChromaLog2WeightDenom+shift1; where:

[0122] When predFlagL0=1, w0=ChromaWeightL0[refIdxL0][cIdx-1], o0=Chroma OffsetL0[refIdxL0][cIdx-1]<<(bitDepth-8);

[0123] When predFlagL1=1, w1=ChromaWeightL1[refIdxL1][cIdx-1], o1=Chroma OffsetL1[refIdxL1][cIdx-1]<<(bitDepth-8).

[0124] S402: Perform weighted calculation on these variables w0, w1, o0, and o1 to obtain a final inter-frame prediction value.

[0125] In the embodiment of the present application, the step of determining the final inter-frame prediction value may specifically include:

[0126] S403: Determine whether predFlagL0=1 and predFlagL1=0?

[0127] S404: Obtain a final inter-frame prediction value based on the fifth calculation model.

[0128] S405: Determine whether predFlagL0=0 and predFlagL1=1?

[0129] S406: Obtain a final inter-frame prediction value based on the sixth calculation model.

[0130] S407: Determine whether predFlagL0=1 and predFlagL1=1?

[0131] S408: Obtain a final inter-frame prediction value based on the seventh calculation model.

[0132] It should be noted that, for S403, if the judgment result is yes, then S404 is executed, that is, based on the fifth calculation model, the final inter-frame prediction value is obtained; if the judgment result is no, then S405 is executed to further determine whether predFlagL0=0 and predFlagL1=1 is established. For S405, if the judgment result is yes, then S406 is executed, that is, based on the sixth calculation model, the final inter-frame prediction value is obtained; if the judgment result is no, then S407 is executed, and further determination is made whether predFlagL0=1 and predFlagL1=1 is established; at this time, if the further judgment result is yes, then S408 can be executed, that is, based on the seventh calculation model, the final inter-frame prediction value is obtained.

[0133] It should also be noted that for explicit weighted prediction, certain weights and offsets are needed to perform weighted correction on predSamplesL0[x][y] and predSamplesL1[x][y] during motion compensation. Similarly, explicit weighted prediction can also be divided into three cases according to the use of the reference list:

[0134] Case ①: Using only the reference list List0, the predicted pixel pbSamples[x][y] can be calculated using the fifth calculation model, and the fifth calculation model is as follows:

[0135] pbSamples[x][y]=Clip3(0,(1<<bitDepth)-1,((predSamplesL0[x][y]*w0+2 log2Wd-1 )>>log2Wd)+o0) (9)

[0136] Case 2: Using only the reference list List1, the predicted pixel pbSamples[x][y] can be calculated using the sixth calculation model, and the sixth calculation model is as follows:

[0137] pbSamples[x][y]=Clip3(0,(1<<bitDepth)-1,((predSamplesL1[x][y]*w1+2 log2Wd-1 )>>log2Wd)+o1) (10)

[0138] Case 3: Both reference lists List0 and List1 are used, and the predicted pixel pbSamples[x][y] can be calculated using the seventh calculation model, and the seventh calculation model is as follows:

[0139] pbSamples[x][y]=Clip3(0,(1<<bitDepth)-1,(predSamplesL0[x][y]*w0+predSamplesL1[x][y]*w1+((o0+o1+1)<<log2Wd))>>(log2Wd+1)) (11)

[0140] Among them, w0 and w1 represent weights, o0 and o1 represent corresponding offsets; at the decoding end, the values ​​of these four variables can be directly determined by decoding the code stream.

[0141] In the related art, current chroma weighted prediction methods use fixed weight coefficients to perform a weighted fusion of the prediction values ​​in the List0 and List1 prediction blocks to determine the chroma inter-frame prediction value for the current block. Consequently, the weight coefficients of this chroma weighted prediction method cannot adapt to the local features of the chroma components at different sampling points within the current block, resulting in inaccurate predictions of the chroma components of the current block, reducing coding efficiency.

[0142] Based on this, an embodiment of the present application provides a coding and decoding method. After determining the prediction parameters of the current block, the first prediction block of the current block is determined according to the prediction parameters; then the model parameters are determined according to the first color component value and the second color component value in the first prediction block. The model parameters fully reflect the correlation between brightness and chrominance in the prediction block, and this correlation is applied to the existing brightness information of the current block for chrominance prediction, thereby improving the accuracy of inter-frame chrominance prediction, saving bit rate, and at the same time improving coding and decoding efficiency, thereby improving coding and decoding performance.

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

[0144] Referring to FIG5A , which shows a schematic block diagram of an encoder provided in an embodiment of the present application. As shown in FIG5A , the encoder (specifically, a “video encoder”) 50 may include a transform and quantization unit 501, an intra-frame estimation unit 502, an intra-frame prediction unit 503, an inter-frame prediction unit 504, a motion estimation unit 505, an inverse transform and inverse quantization unit 506, a filter control analysis unit 507, a filtering unit 508, an encoding unit 509, and a decoded image cache unit 510, etc., wherein the filtering unit 508 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 509 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input original video signal, a video coding block can be obtained by dividing the coding tree unit (CTU). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation and quantization unit 501, 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-frame estimation unit 502 and the intra-frame prediction unit 503 are used to perform intra-frame prediction on the video coding block; specifically, the intra-frame estimation unit 502 and the intra-frame prediction unit 503 are used to determine the intra-frame prediction mode to be used to encode the video coding block; the inter-frame prediction unit 504 and the motion estimation unit 505 are used to perform inter-frame prediction coding 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 505 is a process of generating a motion vector, which can estimate the motion of the video coding block, and then the inter-frame prediction unit 504 performs motion compensation based on the motion vector determined by the motion estimation unit 505, so that the frame The inter-prediction unit 504 may also be referred to as a motion compensation unit. After determining the intra-prediction mode, the intra-prediction unit 503 is further configured to provide the selected intra-prediction data to the encoding unit 509, and the motion estimation unit 505 also sends the calculated motion vector data to the encoding unit 509. Furthermore, the inverse transform and inverse quantization unit 506 is configured to reconstruct the video coding block by reconstructing a residual block in the pixel domain. This reconstructed residual block is subjected to a filter control analysis unit 507 and a filter unit 508 to remove blocking artifacts. The reconstructed residual block is then added to a prediction block in a frame in the decoded image buffer unit 510 to generate a reconstructed video coding block. The encoding unit 509 is configured to encode various coding parameters and quantized transform coefficients. In a CABAC-based coding algorithm, context content may be based on neighboring coding blocks and may be used to encode information indicating the determined intra-prediction mode, thereby outputting a bitstream of the video signal. The decoded image buffer unit 510 is configured to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 510 .

[0145] 5B , which shows a schematic block diagram of a decoder provided in an embodiment of the present application. As shown in FIG5B , the decoder (specifically, a “video decoder”) 60 includes a decoding unit 601, an inverse transform and inverse quantization unit 602, an intra-frame prediction unit 603, an inter-frame prediction unit 604, a filtering unit 605, and a decoded image buffer unit 606. The decoding unit 601 can implement header information decoding and CABAC decoding, and the filtering unit 605 can implement deblocking filtering and SAO filtering. After the input video signal is coded as shown in FIG5A , a code stream of the video signal is outputted. The code stream is inputted into the decoder 60 and first passes through the decoding unit 601 to obtain decoded transform coefficients. The transform coefficients are processed by the inverse transform and inverse quantization unit 602 to generate a residual block in the pixel domain. The intra-frame prediction unit 603 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from the previously decoded block of the current frame or picture. The inter-frame prediction unit 604 determines prediction information for the video decoding block by parsing motion vectors and other associated syntax elements, and uses This prediction information is used to generate a prediction block for the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 602 with the corresponding prediction block generated by the intra-frame prediction unit 603 or the inter-frame prediction unit 604; the decoded video signal passes through the filtering unit 605 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 606, which stores reference images used for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.

[0146] Furthermore, the embodiment of the present application also provides a network architecture of a codec system including an encoder and a decoder. FIG6 is a schematic diagram of a network architecture of a codec system provided by the embodiment of the present application. As shown in FIG6 , 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. During implementation, the electronic device can be various types of devices with video codec functions. For example, the electronic device can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a server, etc., which is not specifically limited in the embodiment of the present application. Here, the decoder or encoder described in the embodiment of the present application can be the above-mentioned electronic device.

[0147] It should be noted that the method of the embodiment of the present application is mainly applied to the inter-frame prediction unit 504 shown in Figure 5A and the inter-frame prediction unit 604 shown in Figure 5B. In other words, the embodiment of the present application can be applied to both the encoder and the decoder, or even to both the encoder and the decoder simultaneously, but the embodiment of the present application does not specifically limit this.

[0148] It should also be noted that, when applied to the intra-frame inter-frame unit 504 part, the "current block" specifically refers to the coding block currently to be inter-frame predicted; when applied to the inter-frame prediction unit 604 part, the "current block" specifically refers to the decoding block currently to be inter-frame predicted.

[0149] In one embodiment of the present application, referring to FIG7 , a schematic flow chart of a decoding method provided by an embodiment of the present application is shown. As shown in FIG7 , the method may include:

[0150] S701: Decode the code stream and determine the prediction parameters of the current block.

[0151] It should be noted that the decoding method of the embodiment of the present application is applied to a decoder. In addition, the decoding method may specifically refer to an inter-frame prediction method, more specifically, an inter-frame chroma prediction method. In the inter-frame prediction process, a chroma prediction based on a convolutional cross-component model (CP-CCCM) technique is proposed to improve the accuracy of chroma prediction.

[0152] In an embodiment of the present application, a video image can be divided into multiple decoding blocks, each decoding block may include a first color component, a second color component and a third color component, and the current block in an embodiment of the present application refers to a decoding block in the video image that is currently to be inter-frame predicted.

[0153] Here, when the first color component of the current block needs to be predicted, and the first color component is a luminance component, the current block can also be called a luminance block; or, when the second color component of the current block needs to be predicted, and the second color component is a chrominance component, the current block can also be called a chrominance block.

[0154] It should also be noted that in the embodiments of the present application, the prediction parameters of the current block need to be determined first. At the decoding end, these can be obtained directly by decoding the bitstream. In some embodiments, the prediction parameters may include: motion vector, reference image index, and inter-frame prediction identification parameter.

[0155] The reference image index indicates whether the reference image used by the current block is List0 or List1; the inter-frame prediction identification parameter indicates the prediction method used to decode the current block, which may include List0 prediction, List1 prediction, and bidirectional prediction.

[0156] It should be understood that in the embodiment of the present application, List0 represents reference image list 0, which can also be called forward reference image; List1 represents reference image list 1, which can also be called backward reference image.

[0157] For List0 prediction, the flag value for using reference picture list 0 for inter-frame prediction is equal to 1; meanwhile, the flag value for using reference picture list 1 for inter-frame prediction is equal to 0. For example, forward prediction.

[0158] For List1 prediction, the flag value for using reference picture list 0 for inter-frame prediction is equal to 0; at the same time, the flag value for using reference picture list 1 for inter-frame prediction is equal to 1. For example, backward prediction.

[0159] For bidirectional prediction, the flag value for using reference picture list 0 for inter-frame prediction is equal to 1; at the same time, the flag value for using reference picture list 1 for inter-frame prediction is equal to 1. For example, forward prediction and backward prediction.

[0160] In an embodiment of the present application, the inter-frame prediction identification parameter may indicate that the prediction method used for decoding the current block is bidirectional prediction.

[0161] For example, if the current block uses bidirectional prediction, the inter-frame prediction flag parameter may indicate that the prediction method used for decoding the current block is bidirectional prediction. Otherwise, if the current block uses List0 prediction or List1 prediction, the inter-frame prediction flag parameter may indicate that the prediction method used for decoding the current block is unidirectional prediction. The prediction method used by the current block is set according to actual conditions and is not specifically limited in this embodiment of the application.

[0162] Exemplarily, the reference image index can be represented by inter_pred_idc, and the prediction list usage identification information can be represented by predFlagLX. If X=0, that is, predFlagL0=1, then the reference image List0 can be used for unidirectional prediction; if X=1, that is, predFlagL1=1, then the reference image List1 can be used for unidirectional prediction; if predFlagL0=1 and predFlagL1=1, then the reference image List0 and the reference image List1 can be used for bidirectional prediction. In other words, the embodiment of the present application can expand the problem of prediction direction from the related art of determining according to inter_pred_idc to the more practical determination according to predFlagLX. The reason is: in merge (merge), skip (skip) and other modes, whether unidirectional prediction or bidirectional prediction is adopted for the current block is determined according to whether the merge candidate (mergeCand) is unidirectional or bidirectional.

[0163] S702: Determine a first prediction block of the current block according to the prediction parameters.

[0164] In the embodiment of the present application, the first prediction block of the current block, such as the List0 prediction block and the List1 prediction block, can be determined based on the decoded motion vector, reference image index, inter-frame prediction identification parameter, and other information. Therefore, in some embodiments, the method may further include: determining the List0 prediction block and the List1 prediction block of the current block based on the prediction parameters.

[0165] Exemplarily, when the prediction parameters include a motion vector, a first prediction block of the current block may be determined based on the motion vector. Specifically, when the prediction parameters include a first motion vector (e.g., a forward motion vector), a List0 prediction block of the current block may be determined based on the first motion vector; and / or when the prediction parameters include a second motion vector (e.g., a backward motion vector), a List1 prediction block of the current block may be determined based on the second motion vector.

[0166] That is, the List0 prediction block may be determined from the List0 reference image according to the first motion vector, and the List0 prediction block may be determined from the List1 reference image according to the second motion vector.

[0167] In a specific embodiment, the method may further include: the first prediction block is the List0 prediction block of the current block; or, the first prediction block is the List1 prediction block of the current block; or, the first prediction block is the List0 prediction block of the current block and the List1 prediction block of the current block.

[0168] It should be noted that, for unidirectional prediction, the first prediction block may be the List0 prediction block of the current block, ie, the aforementioned forward matching block; or, the first prediction block may be the List1 prediction block of the current block, ie, the aforementioned backward matching block.

[0169] It should also be noted that for bidirectional prediction, the first prediction block can be the List0 prediction block of the current block and the List1 prediction block of the current block. At this time, the prediction value of the bidirectional prediction predBI = w0×predList0+w1×predList1, where w0 and w1 represent weighted values.

[0170] It should be understood that in the embodiments of the present application, the value of the reference image index is associated with the block category identification information of the current block (represented by cpcccmSizeId). In some embodiments, the method may further include: determining the block category identification information of the current block; and determining the value of the reference image index based on the block category identification information of the current block.

[0171] It should also be understood that in the embodiment of the present application, the block category identification information of the current block may be determined by decoding the code stream, or may be determined based on the size parameter of the current block.

[0172] Exemplarily, if the value of cpcccmSizeId is equal to 0, the value of the reference image index is determined to be 1; if the value of cpcccmSizeId is equal to 1, the value of the reference image index is determined to be 0; if the value of cpcccmSizeId is equal to 2, the value of the reference image index is determined to be 2. Alternatively, if the value of cpcccmSizeId is equal to 0, the value of the reference image index is determined to be 0; if the value of cpcccmSizeId is equal to 1, the value of the reference image index is determined to be 0; if the value of cpcccmSizeId is equal to 2, the value of the reference image index is determined to be 0.

[0173] In a specific embodiment, the first prediction block of the current block can also be determined based on the value of the reference image index. Accordingly, the method may further include: if the value of the reference image index is a first value, determining that the first prediction block is the List0 prediction block of the current block; or, if the value of the reference image index is a second value, determining that the first prediction block is the List1 prediction block of the current block; or, if the value of the reference image index is a third value, determining that the first prediction block is both the List0 prediction block of the current block and the List1 prediction block of the current block.

[0174] Exemplarily, the reference image index can be represented by inter_pred_idc. Assuming that the first value, the second value and the third value are set to 0, 1, and 2 respectively, then when the value of inter_pred_idc is 0, the first prediction block can be the List0 prediction block; when the value of inter_pred_idc is 1, the first prediction block can be the List1 prediction block; when the value of inter_pred_idc is 2, the first prediction block is the List0 prediction block and the List1 prediction block.

[0175] S703: Determine model parameters according to the first color component value and the second color component value in the first prediction block.

[0176] In this embodiment of the present application, after determining the first prediction block for the current block, the first color component value and the second color component value in the first prediction block can be obtained. The first color component value and the second color component value are both reconstruction information; model parameters can be calculated based on the first color component value and the second color component value in the first prediction block.

[0177] In an embodiment of the present application, model parameters are determined based on the first color component values ​​and the second color component values ​​in the first prediction block. The model parameters may include coefficients of a target filter. Therefore, in some embodiments, the method may include determining the coefficients of the target filter based on the first color component values ​​and the second color component values ​​in the first prediction block.

[0178] In a specific embodiment, the coefficients of the target filter may be determined by solving an optimization problem. Accordingly, the method may further include: the coefficients of the target filter are coefficients used by the target filter when a first error between the second color component value in the first prediction block and the output value of the first color component value in the first prediction block after being processed by the target filter satisfies a first condition.

[0179] It should be understood that for the first error to satisfy the first condition, in one possible implementation, the first condition is that the first error is minimized. Alternatively, in another possible implementation, the first condition is that the first error is within a first preset threshold range. Alternatively, in yet another possible implementation, the first condition is that the change in the first error is within a second preset threshold range.

[0180] It should also be understood that the first preset threshold range and the second preset threshold range are both measurement criteria preset by the decoding end for determining whether the first error meets the first condition. In addition, the first error here can be a mean square error (MSE), or a sum of squared errors (SSE), or a sum of absolute differences (SAD), or a sum of absolute transformed differences (SATD), or a mean absolute error (MAE), etc., and the embodiments of the present application do not specifically limit this.

[0181] In an embodiment of the present application, the first color component value in the first prediction block may refer to a luminance reconstruction value in the first prediction block, wherein the luminance reconstruction value of pixel i may be represented by refrecY[i]. The second color component value in the first prediction block may refer to a chrominance reconstruction value in the first prediction block, wherein the chrominance reconstruction value of pixel i may be represented by refrecC[i].

[0182] In this way, after obtaining the luminance reconstruction value and the chrominance reconstruction value in the first prediction block, a set of target filter coefficients can be derived by minimizing the MSE between the chrominance reconstruction value and the chrominance value predicted by CP-CCCM, namely:

[0183]

[0184] Where i = 0, 1, 2, ..., predSizeW × predSizeH-1, refpredC[i] represents the chrominance value predicted by CP-CCCM, c n represents the coefficient of the target filter, n represents the coefficient number, and n=0,1,…,nTap-1, where nTap is the number of coefficients of the target filter.

[0185] Furthermore, the coefficients of the target filter are derived by minimizing the MSE. The specific process is as follows:

[0186] First, for c n Find the partial derivative and make it 0, that is:

[0187]

[0188]

[0189] Secondly, according to formula (14), we can get:

[0190]

[0191] In another specific embodiment, determining the coefficient of the target filter according to the first color component value and the second color component value in the first prediction block may include:

[0192] determining an autocorrelation parameter based on a first color component value in the first prediction block;

[0193] determining a cross-correlation parameter based on the first color component value and the second color component value in the first prediction block;

[0194] The coefficients of the target filter are determined according to the autocorrelation parameters and the cross-correlation parameters.

[0195] It should be noted that the autocorrelation parameter is determined according to the first color component value in the first prediction block. The autocorrelation parameter here can be represented by A. The calculation formula of A is as follows:

[0196]

[0197] According to the first color component value and the second color component value in the first prediction block, a cross-correlation parameter is determined. The cross-correlation parameter here can be represented by B. The calculation formula of B is as follows:

[0198]

[0199] It should also be noted that the coefficients of the target filter are determined based on the autocorrelation parameters and the cross-correlation parameters. The coefficients of the target filter here can be expressed as c n Indicates. A, B and c n The relationship between the three is as follows:

[0200]

[0201] By solving equation (18), the coefficients of the target filter can be obtained as follows:

[0202]

[0203] Thus, based on the determined first prediction block (reference block area), Equation (15) is expanded into a matrix form, as shown in Equation (18). By solving the linear equations shown in Equation (18), a set of target filter coefficients can be obtained, which minimizes the MSE between the expected output after filtering, i.e., the chrominance value predicted by the CP-CCCM, and the chrominance reconstruction value of the expected output, i.e., the Wiener filter coefficients. This set of Wiener filter coefficients is the set of target filter coefficients for the current block.

[0204] In the process of solving the linear equations, the autocorrelation parameters of the luminance reconstruction samples refRecY in the first prediction block are first calculated, and then the cross-correlation parameters of the luminance reconstruction samples refRecY and the chrominance reconstruction samples refRecC in the first prediction block are calculated. Then, the autocorrelation parameters are subjected to Cholesky decomposition or LDL decomposition, and finally, each target filter coefficient c is calculated in turn by reverse recursion. n .

[0205] In the embodiment of the present application, for the target filter, it is also necessary to determine the number of coefficients of the target filter and the shape of the target filter, etc. The number of coefficients of the target filter and the shape of the target filter can be preset fixed values ​​or directly determined by the decoded code stream.

[0206] In some embodiments, for the number of coefficients of the target filter, the method may further include: the number of coefficients of the target filter is equal to a first preset constant value.

[0207] In some embodiments, for the number of coefficients of the target filter, the method may further include: decoding the code stream to determine the number of coefficients of the target filter.

[0208] In some embodiments, for the number of coefficients of the target filter, the method may further include: determining first block category identification information of the current block; and determining the number of coefficients of the target filter according to the first block category identification information of the current block.

[0209] It should be noted that the number of coefficients of the target filter can be represented by nTap. For example, the value of nTap can be 4, 5, 6, 7, 8, 9, etc., but is not specifically limited.

[0210] It should also be noted that the number of coefficients of the target filter can also be referred to as the number of target filter taps. Here, the number of coefficients of the target filter can be a preset constant value, or can be determined by decoding the code stream, or can even be determined based on the first block category identification information of the current block.

[0211] For example, if the value of the first block category identification information is 0, the nTap value is determined to be 3; if the value of the first block category identification information is 1, the nTap value is determined to be 5; if the value of the first block category identification information is 2, the nTap value is determined to be 9. Alternatively, if the value of the first block category identification information is 0, the nTap value is determined to be 4; if the value of the first block category identification information is 1, the nTap value is determined to be 7; if the value of the first block category identification information is 2, the nTap value is determined to be 9.

[0212] In some embodiments, regarding the shape of the target filter, the method may further include: the target filter is a one-dimensional or two-dimensional filter of a preset shape.

[0213] In some embodiments, regarding the shape of the target filter, the method may further include: decoding the code stream to determine the shape of the target filter.

[0214] In some embodiments, regarding the shape of the target filter, the method may further include: determining a value of a filter shape parameter, wherein the filter shape parameter indicates the shape of the target filter.

[0215] In some embodiments, regarding the shape of the target filter, the method may further include: determining second identification information of the block category of the current block; and determining values ​​of filter shape parameters according to the second identification information of the block category of the current block.

[0216] It should be noted that the filter shape parameter can be represented by FilterIdx, which is used to indicate the shape of the target filter. For example, the shape of the target filter can be diamond, rectangle, cross, stripe, or even a one-dimensional filter or a two-dimensional filter, but is not specifically limited thereto.

[0217] Exemplarily, if the value of FilterIdx is equal to 0, the shape of the target filter is determined to be a diamond; if the value of FilterIdx is equal to 1, the shape of the target filter is determined to be a cross; if the value of FilterIdx is equal to 2, the shape of the target filter is determined to be a rectangle.

[0218] It should also be noted that the shape of the target filter may be a preset shape, or may be determined by decoding the code stream, or may even be determined according to the second identification information of the block category of the current block.

[0219] For example, if the value of the second block category identification information is equal to 0, the value of FilterIdx is determined to be 2; if the value of the second block category identification information is equal to 1, the value of FilterIdx is determined to be 1; if the value of the second block category identification information is equal to 2, the value of FilterIdx is determined to be 0. Alternatively, if the value of the second block category identification information is equal to 0, the value of FilterIdx is determined to be 1; if the value of the second block category identification information is equal to 1, the value of FilterIdx is determined to be 2; if the value of the second block category identification information is equal to 2, the value of FilterIdx is determined to be 0.

[0220] It can be understood that in the embodiments of the present application, the second block category identification information may be the same as or different from the first block category identification information. Exemplarily, in a specific embodiment, the first block category identification information and the second block category identification information are the same, that is, one identification information can be used to indicate both the number of coefficients of the target filter and the shape of the target filter.

[0221] It can also be understood that the block category identification information, the first block category identification information, and the second block category identification information described in the embodiments of the present application are all the same, that is, one identification information (denoted as cpcccmSizeId) is used, and the value of cpcccmSizeId can indicate the reference image index inter_pred_idc, the number of coefficients nTap of the target filter, and the shape FilterIdx of the target filter at the same time.

[0222] In the embodiments of the present application, for the value of cpcccmSizeId, it can be: decoding the code stream to determine the value of cpcccmSizeId; or it can also be: determining the value of cpcccmSizeId according to the size parameters of the current block. Among them, the size parameters of the current block may include the width (denoted as nTbW) and the height (denoted as nTbH).

[0223] Exemplarily, if the size parameters of the current block satisfy min(nTbW, nTbH) <= 8, then determine the value of cpcccmSizeId to be 0; if the size parameters of the current block satisfy 8 < min(nTbW, nTbH) <= 32, then determine the value of cpcccmSizeId to be 1; if the size parameters of the current block satisfy min(nTbW, nTbH) > 32, then determine the value of cpcccmSizeId to be 2.

[0224] Exemplarily, if the size parameters of the current block satisfy min(nTbW, nTbH) <= 64, then determine the value of cpcccmSizeId to be 0; if the size parameters of the current block satisfy 64 < min(nTbW, nTbH) <= 256, then determine the value of cpcccmSizeId to be 1; if the size parameters of the current block satisfy min(nTbW, nTbH) > 256, then determine the value of cpcccmSizeId to be 2.

[0225] S704: Determine the reference sample value of the first color component sampling points of the current block, and determine the predicted value of the second color component sampling points of the current block according to the reference sample value of the first color component sampling points of the current block and the model parameters.

[0226] It should be noted that, in the embodiment of the present application, before determining the predicted value of the second color component sampling point of the current block, it is necessary to first determine the reference sample value of the first color component sampling point of the current block.

[0227] In some embodiments, determining the reference sample value of the first color component sampling point of the current block may include: determining the reference sample value of the first color component sampling point of the current block according to the reconstructed value of the first color component sampling point of the current block.

[0228] In a specific embodiment, the method may further include: determining a reconstructed value of a first color component sampling point of the current block according to the first color component value in the first prediction block.

[0229] In an embodiment of the present application, for unidirectional prediction, determining the reconstructed value of the first color component sampling point of the current block based on the first color component value in the first prediction block may include: determining the reconstructed value of the first color component sampling point of the current block based on the first color component value in the List0 prediction block of the current block; or determining the reconstructed value of the first color component sampling point of the current block based on the first color component value in the List1 prediction block of the current block.

[0230] In an embodiment of the present application, for bidirectional prediction, determining the reconstructed value of the first color component sampling point of the current block based on the first color component value in the first prediction block may include: determining the reconstructed value of the first color component sampling point of the current block based on the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block.

[0231] In another specific embodiment, the method may further include: determining, based on a decoded image buffer, a reconstructed value of a first color component sampling point of the current block. That is, at the decoding end, the reconstructed value of the first color component sampling point of the current block may be directly obtained from the decoded image buffer.

[0232] In some embodiments, the method may further include: filtering the reconstructed value of the first color component sampling point of the current block to determine the filtered reconstructed value of the first color component sampling point of the current block; and determining the reference sample value of the first color component sampling point of the current block based on the filtered reconstructed value of the first color component sampling point of the current block.

[0233] It should be understood that in the embodiment of the present application, not only the reconstructed value of the first color component sampling point of the current block can be used as the reference sample value of the first color component sampling point of the current block, but also the filtered reconstructed value of the first color component sampling point of the current block can be used as the reference sample value of the first color component sampling point of the current block, and this is not specifically limited here.

[0234] In some embodiments, determining the reference sample value of the first color component sampling point of the current block may include: determining the predicted value of the first color component sampling point of the current block based on the first color component value in the first prediction block; and determining the reference sample value of the first color component sampling point of the current block based on the predicted value of the first color component sampling point of the current block.

[0235] In an embodiment of the present application, for unidirectional prediction, determining the predicted value of the first color component sampling point of the current block based on the first color component value in the first prediction block may include: determining the predicted value of the first color component sampling point of the current block based on the first color component value in the List0 prediction block of the current block; or determining the predicted value of the first color component sampling point of the current block based on the first color component value in the List1 prediction block of the current block.

[0236] Here, using the List0 prediction block as an example, the predicted value of the first color component sampling point of the current block can be determined based on the first color component value of the List0 prediction block of the current block. The predicted value of the first color component sampling point of the current block is then used as the reference sample value of the first color component sampling point of the current block. The processing of the List1 prediction block is similar and will not be described in detail here.

[0237] In an embodiment of the present application, for bidirectional prediction, determining the predicted value of the first color component sampling point of the current block based on the first color component value in the first prediction block may include: determining the predicted value of the first color component sampling point of the current block based on the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block.

[0238] In a specific embodiment, the method may further include: determining the List0 weighting coefficient of the List0 prediction block of the current block and the List1 weighting coefficient of the List1 prediction block of the current block; determining the weighted sum of the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block based on the List0 weighting coefficient and the List1 weighting coefficient; and determining the predicted value of the first color component sampling point of the current block based on the weighted sum.

[0239] Here, taking the List0 prediction block and the List1 prediction block as an example, specifically, the first color component value in the List0 prediction block and the first color component value in the List1 prediction block can be weighted and calculated according to the List0 weighting coefficient and the List1 weighting coefficient to determine the predicted value of the first color component sampling point of the current block, and then the predicted value of the first color component sampling point of the current block is used as the reference sample value of the first color component sampling point of the current block.

[0240] In some embodiments, the method may further include: filtering the predicted value of the first color component sampling point of the current block to determine the filtered predicted value of the first color component sampling point of the current block; and determining the reference sample value of the first color component sampling point of the current block based on the filtered predicted value of the first color component sampling point of the current block.

[0241] It should be understood that in the embodiment of the present application, not only the predicted value of the first color component sampling point of the current block can be used as the reference sample value of the first color component sampling point of the current block, but also the filtered predicted value of the first color component sampling point of the current block can be used as the reference sample value of the first color component sampling point of the current block, and this is not specifically limited here.

[0242] It should also be understood that in the embodiment of the present application, assuming that the first color component is a luminance component and the second color component is a chrominance component, the filtering processing here can be a low-pass filtering, a downsampling filtering, etc., so that the resolution of the first color component after filtering is the same as the resolution of the second color component.

[0243] Furthermore, after determining the reference sample value of the first color component sampling point of the current block, it can also be used to determine the predicted value of the second color component sampling point of the current block. Therefore, in some embodiments, determining the predicted value of the second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameters may include: determining a first input value of the target filter based on the reference sample value of the first color component sampling point of the current block; determining a first output value of the target filter based on the first input value and the model parameters; and determining the predicted value of the second color component sampling point of the current block based on the first output value.

[0244] It should be noted that in an embodiment of the present application, after determining the reference sample value of the first color component sampling point of the current block, in some embodiments, the method may further include: performing a first filtering process on the reference sample value of the first color component sampling point of the current block to determine the first input value.

[0245] It should be understood that in the embodiment of the present application, the first filtering process may include at least one of the following: low-pass filtering, downsampling filtering. For example, the downsampling filtering may make the resolution of the first color component after filtering the same as the resolution of the second color component.

[0246] It should also be understood that in the embodiment of the present application, the first filtering process sets the first input value to be equal to the reference sample value of the first color component sampling point of the current block.

[0247] Here, for the target filter, the reference sample value of the first color component sampling point of the current block can be directly used as the first input value, or the filtered value of the first color component sampling point of the current block can be used as the first input value. For example, the reconstructed value of the first color component sampling point of the current block can be used as the first input value, or the filtered reconstructed value of the first color component sampling point of the current block can be used as the first input value, or the predicted value of the first color component sampling point of the current block can be used as the first input value, or the filtered predicted value of the first color component sampling point of the current block can be used as the first input value. This embodiment of the present application does not specifically limit this.

[0248] For example, the first input value can be represented by FilterY[k][l], and the model parameter can be represented by c i,j,k,l Indicates that, and c i,j,k,l =c n The first output value is represented by OUT, as shown below:

[0249] OUT=∑ k,l FilterY[k][l]×C i,j,k,l (20)

[0250] After determining the first output value based on the first input value and the model parameters, the first output value can be directly used as the predicted value of the second color component sampling point of the current block. pred [i][j] represents the following:

[0251] C pred [i][j]=∑ k,l FilterY[k][l]×C i,j,k,l (twenty one)

[0252] Here, n=0, 1, ..., nTap-1, i=0, 1, ..., predSizeW-1, j=0, 1, ..., predSizeH-1. In addition, a second prediction block can be determined according to the first output value, and the width of the second prediction block is predSizeW, and the height of the second prediction block is predSizeH.

[0253] It should also be noted that in the embodiments of the present application, after determining the first output value of the target filter based on the first input value and the model parameters, if the first output value (i.e., the second prediction block) contains the predicted values of all the second color component sampling points in the current block, then the first output value can be directly used as the predicted value of the second color component sampling points in the current block. If the first output value (i.e., the second prediction block) contains the predicted values of some of the second color component sampling points in the current block, then the first output value needs to be processed accordingly before being used as the predicted value of the second color component sampling points in the current block.

[0254] In some embodiments, determining the predicted value of the second color component sampling points of the current block based on the first output value may include: performing a second filtering process on the first output value to determine a second output value; and determining the predicted value of the second color component sampling points of the current block based on the second output value.

[0255] It should be understood that in the embodiments of the present application, the second filtering process includes at least one of the following: low-pass filtering, upsampling filtering. Exemplarily, the size parameters of the second prediction block after upsampling filtering are the same as those of the current block.

[0256] It should also be understood that in the embodiments of the present application, the second filtering process sets the second output value equal to the first output value.

[0257] In the embodiments of the present application, in order to limit the obtained second output value within a preset numerical range, the second output value needs to be processed accordingly. In some embodiments, determining the predicted value of the second color component sampling points of the current block based on the second output value may include: performing a first process on the second output value to obtain the predicted value of the second color component sampling points of the current block.

[0258] It should be understood that in the embodiments of the present application, the first process is a clamping (clip) operation that limits the second output value within a preset numerical range.

[0259] Here, the preset numerical range can be between 0 and (1 << BitDepth)-1, where BitDepth is the bit depth required for the chrominance component. If the value of the second output value exceeds the取值范围 of this preset numerical range, then the second output value needs to be corrected accordingly. Exemplarily, the second output value can also be represented by C pred [i][j], and at this time, the correction operation can be performed on C pred [i][j] as follows:

[0260] When the value of C pred [i][j] is less than 0, set it to 0;

[0261] When C predWhen the value of [i][j] is greater than or equal to 0 and less than or equal to (1<<BitDepth)-1, it is equal to C pred [i][j];

[0262] When C pred When the value of [i][j] is greater than (1<<BitDepth)-1, it is set to (1<<BitDepth)-1.

[0263] In this way, after the correction operation on the second output value, it can be ensured that the predicted values of all the second color component sampling points in the current block are between 0 and (1<<BitDepth)-1.

[0264] It should also be noted that in the embodiments of the present application, after determining the first output value according to the target filter, a first offset value (denoted by bias) can also be added to the target filter to determine the predicted value of the second color component sampling point of the current block.

[0265] In some embodiments, based on the first output value, determining the predicted value of the second color component sampling point of the current block may include: performing an addition operation according to the first output value and the first offset value to determine the predicted value of the second color component sampling point of the current block.

[0266] In a specific embodiment, the first offset value is set to be equal to a preset constant value; or, the first offset value is set to be equal to the value of the first input value in the preset mapping relationship.

[0267] Exemplarily, assume that the first color component is the luminance component, the second color component is the chrominance component, and the model parameter can be the tap coefficients corresponding to the target filter, that is, the number of coefficients of the target filter is equal to the number of taps nTap of the target filter. In addition, a first offset value bias can be added to the target filter here. For example, when FilterIdx = 1, nTap = 5, and the target filter is a cross-shaped filter. At this time, the filter coefficients are the tap coefficients c0 to c4 corresponding to the target filter, and the chrominance prediction value calculated at the position (i, j) is:

[0268]

[0269] At this time, a bias term bias can be added, as shown specifically below:

[0270]

[0271] Among them, c n = c i,j,k,l .

[0272] It should be understood that in the embodiment of the present application, bias may include coefficient terms involved in the calculation of filter coefficients, such as bias = c n ×Constant. Wherein, Constant can be a fixed constant, such as Constant = 1 << (BitDepth-1); it can also be a value related to the brightness pixel value of the same position (i, j), such as Constant = f(FilterY[i][j]); it can also be a value related to the brightness pixel value corresponding to a tap in the target filter other than the same brightness position (i, j), such as Constant = f(FilterY[k][l]). Constant = f(FilterY[i][j]) or Constant = f(FilterY[k][l]) can be a linear mapping relationship or a nonlinear mapping relationship; there is no specific limitation on this here.

[0273] It should also be understood that in the embodiment of the present application, bias may not include coefficient terms involved in the calculation of filter coefficients, such as bias = Constant. Wherein, Constant can be a fixed constant, such as Constant = 1 < < (BitDepth-1); it can also be a value related to the brightness pixel value of the same position (i, j), such as Constant = f(FilterY[i][j]); it can also be a value related to the brightness pixel value corresponding to a tap in the target filter other than the brightness position of the same position (i, j), such as Constant = f(FilterY[k][l]). Constant = f(FilterY[i][j]) or Constant = f(FilterY[k][l]) can be a linear mapping relationship or a nonlinear mapping relationship; this is not specifically limited here.

[0274] Further, after determining the predicted value C of the second color component sampling point of the current block pred [i][j]After that, in some embodiments, the method may further include: performing relevant processing on the predicted value of the second color component sampling point of the current block, and using the processed predicted value as the predicted value of the second color component sampling point of the current block.

[0275] In a possible implementation, performing correlation processing on the predicted value of the second color component sampling point of the current block may include: performing filtering enhancement processing on the predicted value of the second color component sampling point of the current block.

[0276] For example, when predSizeW is not equal to the width nTbW of the current block or predSizeH is not equal to the height nTbH of the current block, it is necessary to pred[i][j] Perform upsampling filtering or downsampling filtering operations to obtain the final prediction value.

[0277] For example, in order to improve the chrominance prediction quality in CP-CCCM mode, C pred [i][j] are filtered and enhanced as the final prediction value.

[0278] In another possible implementation, performing correlation processing on the predicted value of the second color component sampling point of the current block may include: determining a compensation value of the second color component sampling point of the current block based on a reference sample value of an adjacent area of ​​the current block; and correcting the predicted value of the second color component sampling point of the current block based on the compensation value.

[0279] For example, to further improve prediction accuracy in the CP-CCCM mode, a position-dependent correction process can be performed on the predicted values. For example, a chroma compensation value is calculated for each second color component sampling point to be predicted using spatially proximal reference pixels. This chroma compensation value is then used to correct the second color component sampling point of the current block. The final predicted value of the second color component sampling point is then determined based on the corrected predicted value.

[0280] In another possible implementation, performing correlation processing on the predicted value of the second color component sampling point of the current block may include: performing prediction processing on the second color component sampling point of the current block according to at least one prediction mode to determine at least one initial predicted value of the second color component sampling point of the current block; and performing weighted fusion processing based on the at least one initial predicted value and the predicted value of the second color component sampling point of the current block.

[0281] For example, in order to further improve the prediction accuracy in the CP-CCCM mode, the chroma prediction value calculated by the original chroma weighted prediction and the chroma prediction value calculated by the CP-CCCM mode can be weightedly fused, and the fusion result can be used as the final prediction value.

[0282] For example, in order to improve the prediction performance of the CP-CCCM mode, a neural network may be used to correct the prediction output of the CP-CCCM mode to obtain a final prediction value.

[0283] S705: Determine a reconstructed value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block.

[0284] It should be noted that, in the embodiment of the present application, after obtaining the predicted value of the second color component sampling point of the current block, the reconstructed value of the second color component sampling point of the current block can also be restored. In some embodiments, determining the reconstructed value of the second color component sampling point of the current block based on the predicted value of the second color component sampling point of the current block may include:

[0285] Decode the code stream and determine the predicted residual value of the second color component sampling point of the current block;

[0286] Determine a reconstructed value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block and the predicted difference value of the second color component sampling point of the current block.

[0287] In a specific embodiment, determining the reconstructed value of the second color component sampling point of the current block based on the predicted value of the second color component sampling point of the current block and the predicted difference value of the second color component sampling point of the current block may include: performing an addition operation on the predicted value of the second color component sampling point of the current block and the predicted difference value of the second color component sampling point of the current block to determine the reconstructed value of the second color component sampling point of the current block.

[0288] For example, taking the chrominance component as an example, after obtaining the chrominance prediction difference value of the current block by decoding the code stream, the chrominance prediction value and the chrominance prediction difference value can be added to obtain the chrominance reconstruction value of the current block.

[0289] In some embodiments, the method may further include: parsing the code stream to determine the prediction mode identification information of the current block; when the prediction mode identification information indicates that the current block uses a convolutional cross-component model for weighted prediction, executing the step of determining the prediction block of the current block according to the motion information.

[0290] In a specific embodiment, the method may further include: if the value of the prediction mode identification information is a fourth value, determining that the current block uses weighted prediction based on a convolutional cross-component model; and / or, if the value of the prediction mode identification information is a fifth value, determining that the current block does not use weighted prediction based on a convolutional cross-component model.

[0291] It should be noted that in the embodiment of the present application, the fourth value and the fifth value are different, and the fourth value and the fifth value can be in parameter form or in digital form. Specifically, the prediction mode identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0292] Exemplarily, for the fourth value and the fifth value, the fourth value may be set to 1 and the fifth value may be set to 0; or, the fourth value may be set to true and the fifth value may be set to false; however, this is not specifically limited here.

[0293] It should also be noted that in the embodiment of the present application, the chroma prediction is performed using the CP-CCCM mode based on the convolution cross-component model. Here, whether the current block uses the CP-CCCM mode for chroma prediction can be determined by certain conditions to determine the final inter-frame chroma prediction value, but it is not limited to the following four methods. For example, these four methods can be as follows:

[0294] Method 1: Determine whether to use the CP-CCCM mode by comparing the difference between the reconstructed brightness of the first prediction block and the brightness of the current block, such as SAD, MSE, SATD, SSE, etc. (or the corresponding information of the brightness residual of the current block) with the threshold T_Distortion1.

[0295] Method 2: On the basis of satisfying the CP-CCCM mode in Method 1, the distortion between the chrominance reconstruction value of the first prediction block and its chrominance prediction value of the CP-CCCM mode, such as SAD or MSE or SATD or SSE, and the threshold T_Distortion2 is used to determine whether the current block uses the chrominance prediction value of the CP-CCCM mode to replace the original inter-frame weighted chrominance prediction value.

[0296] Method three: The calculated target filter coefficient is applied to the filter template of the current block to obtain the CP-CCCM prediction value of the template; then the template of the first prediction block is obtained for weighted prediction to obtain a weighted template prediction value; the weighted template prediction value and the CP-CCCM chrominance prediction value of the template are respectively compared with the reconstructed chrominance calculation distortion of the current block template, such as SAD or MSE or SATD or SSE, to decide whether to use the chrominance prediction value of the CP-CCCM mode of the current block to replace the weighted chrominance prediction value of the current block.

[0297] Method 4: The encoder can transmit a flag to indicate whether to use the chroma prediction value of the CP-CCCM mode of the current block instead of the weighted chroma prediction value of the current block; then, the decoder analyzes the flag to decide whether to use the chroma prediction value of the CP-CCCM mode of the current block instead of the weighted chroma prediction value of the current block.

[0298] This embodiment provides a decoding method, which decodes a bitstream and determines prediction parameters for a current block; determines a first prediction block for the current block based on the prediction parameters; determines model parameters based on the first color component value and the second color component value in the first prediction block; determines a reference sample value for the first color component sampling point of the current block, and determines a prediction value for the second color component sampling point of the current block based on the reference sample value and the model parameters for the first color component sampling point of the current block; and determines a reconstructed value for the second color component sampling point of the current block based on the prediction value for the second color component sampling point of the current block. In this way, the model parameters are determined based on the first color component value and the second color component value in the first prediction block. The model parameters fully reflect the correlation between luminance and chrominance in the prediction block, and this correlation is applied to the existing luminance information of the current block for chrominance prediction, thereby improving the accuracy of inter-frame chrominance prediction, improving encoding and decoding efficiency, and thereby improving encoding and decoding performance.

[0299] In another embodiment of the present application, based on the decoding method described in the aforementioned embodiment, the reference sample value of the first color component sampling point of the current block can be determined based on not only the reconstructed value of the first color component sampling point of the current block or the predicted value of the first color component sampling point of the current block, but also the predicted difference value of the first color component sampling point of the current block. In this case, the model parameters can be adaptively determined based on the residual value of the first color component and the residual value of the second color component in the first prediction block.

[0300] In some embodiments, the method may further include: determining a predicted difference value of a first color component sampling point of a current block; determining a reference sample value of the first color component sampling point of the current block based on the predicted difference value of the first color component sampling point of the current block; and determining a first color component residual value and a second color component residual value in the first prediction block; and determining a model parameter based on the first color component residual value and the second color component residual value in the first prediction block.

[0301] Accordingly, in some embodiments, determining the predicted value of the second color component sampling point of the current block based on the reference sample value and model parameters of the first color component sampling point of the current block may include: determining the initial predicted difference value of the second color component sampling point of the current block based on the predicted difference value and model parameters of the first color component sampling point of the current block; determining the initial predicted value of the second color component sampling point of the current block based on the first prediction block; and determining the predicted value of the second color component sampling point of the current block based on the initial predicted difference value and the initial predicted value of the second color component sampling point of the current block.

[0302] Specifically, taking the case where the first color component is the luminance component and the second color component is the chrominance component as an example, a model parameter is determined based on the luminance residual value and the chrominance residual value in the first prediction block. The model parameter can reflect the corresponding relationship between the luminance residual and the chrominance residual. Then, after determining the luminance prediction difference value of the current block, the initial chrominance prediction difference value of the current block can be determined based on the model parameter and the luminance prediction difference value of the current block. Then, inter-frame prediction processing is performed based on the first prediction block to determine the initial chrominance prediction value of the current block. The initial chrominance prediction value of the current block and the initial chrominance prediction difference value of the current block are added to obtain the final chrominance prediction value of the current block.

[0303] It should be understood that in the embodiment of the present application, for the first color component residual value and the second color component residual value in the first prediction block, an additional decoding cache unit (Buffer) is required here to cache the luminance residual value and the chrominance residual value in the first prediction block.

[0304] It should also be understood that in the embodiments of the present application, when determining the model parameters, not only the first color component value and the second color component value in the first prediction block can be used, but also the first color component residual value and the second color component residual value in the first prediction block can be used, and the filtered first color component residual value and the filtered second color component residual value in the first prediction block can be used, and even the first color component residual value and the second color component value in the first prediction block can be used, etc., and no specific limitation is made here.

[0305] In a specific embodiment, refer to FIG8 , which shows a flowchart diagram of a decoding method provided by an embodiment of the present application. As shown in FIG8 , the flowchart may include a model parameter generation unit 801, a target filter 802, and a post-processing unit 803. For the model parameter generation unit 801, the input is input information, and the output is a model parameter; for the target filter 802, the model parameter is the filtering parameter of the target filter 802, the input is the model input value, and the output is the model output value; if the post-processing unit 803 does not exist, then the model output value is the chrominance prediction value; if the post-processing unit 803 exists, then the model output value needs to be processed to obtain the chrominance prediction value.

[0306] It should be noted that, in the embodiment of the present application, the first prediction block is the matching block in the reference frame, which can be represented by pic(xCb-mvX,yCb-mvY,t-refIdxLX); the current block is the block to be decoded in the current frame, which can be represented by pic(xCb,yCb,t); wherein mvX represents the motion vector of the x-axis, mvY represents the motion vector of the y-axis, and refIdxLX represents the time domain information between the current frame and the reference frame.

[0307] It should also be noted that, in an embodiment of the present application, for the cross-component prediction of the current block, the reconstructed pixel information of the first prediction block is not directly used as the chrominance prediction value of the current block, but the reconstructed pixel information of the first prediction block is used as auxiliary information for chrominance prediction to determine the chrominance prediction value of the current block.

[0308] As for the input information, the input information may be the luminance reconstruction information and the chrominance reconstruction information in the first prediction block, or the filtered luminance reconstruction information and / or the filtered chrominance reconstruction information in the first prediction block. In addition, the input information may also be the luminance reconstruction residual information and the chrominance reconstruction residual information in the first prediction block, or the filtered luminance reconstruction residual information and / or the filtered chrominance reconstruction residual information in the first prediction block. In addition, the input information may also be the luminance reconstruction residual information and the chrominance reconstruction information in the first prediction block, or the filtered luminance reconstruction residual information and / or the filtered chrominance reconstruction information in the first prediction block; this embodiment of the present application does not specifically limit this. It should also be noted that an additional decoding buffer unit (Buffer) is required for caching both the luminance reconstruction residual information and the chrominance reconstruction residual information in the first prediction block.

[0309] The model input value is the reference sample value of the first color component sampling point of the current block in the aforementioned embodiment. The model input value can be the luminance component value in the first prediction block or the filtered luminance component value in the first prediction block. In this case, if the post-processing unit 803 is not present, the model output value is the chrominance prediction value of the current block. If the post-processing unit 803 is present, the model output value is the initial chrominance prediction value of the current block. The initial chrominance prediction value is then subjected to relevant processing (e.g., a clip operation) to obtain the chrominance prediction value of the current block.

[0310] In addition, the model input value can also be the brightness reconstruction value in the current block or the filtered brightness reconstruction value in the current block. At this time, when the post-processing unit 803 does not exist, the model output value is the chroma prediction value of the current block; when the post-processing unit 803 exists, the model output value is the initial chroma prediction value of the current block; then the initial chroma prediction value is subjected to relevant processing (such as clip operation) to obtain the chroma prediction value of the current block.

[0311] In addition, the model input value may also be the brightness prediction difference value in the current block or the brightness prediction difference value after filtering in the current block. At this time, when the post-processing unit 803 does not exist, the model output value is the chroma prediction value of the current block; when the post-processing unit 803 exists, the model output value is the initial chroma prediction value of the current block; then the initial chroma prediction value is processed (such as clip operation) to obtain the chroma prediction value of the current block; or when the post-processing unit 803 exists, the model output value may also be the initial chroma prediction difference value pred of the current block. ResidualChroma(xCb,yCb); then the chroma prediction value of the current block is determined according to the initial chroma prediction value + the initial chroma prediction difference value determined by the first prediction block. The chroma reconstruction value at this time can be obtained according to the initial chroma prediction value + the initial chroma prediction difference value + the chroma prediction difference value of the decoded code stream determined by the first prediction block; or when the post-processing unit 803 is present, the model output value can also be the initial chroma prediction difference value predResidualChroma(xCb,yCb) of the current block; then the chroma prediction value of the current block is determined according to the initial chroma prediction value + the filtered initial chroma prediction difference value. The chroma reconstruction value at this time can be obtained according to the initial chroma prediction value + the filtered initial chroma prediction difference value + the chroma prediction difference value of the decoded code stream.

[0312] It should also be noted that the chroma prediction method of the embodiment of the present application is generally not applicable to unidirectional prediction (including forward prediction or backward prediction). For unidirectional prediction, the reconstructed chroma information of the first prediction block can be directly used for chroma prediction.

[0313] This embodiment provides a decoding method. Through the specific implementation of the above embodiment, it can be seen that the model parameters are determined based on the first color component value and the second color component value in the first prediction block. The model parameters fully reflect the correlation between brightness and chrominance in the prediction block, and this correlation is applied to the existing brightness information of the current block for chrominance prediction, thereby improving the accuracy of inter-frame chrominance prediction, improving encoding and decoding efficiency, and thus improving encoding and decoding performance.

[0314] In another embodiment of the present application, see Figure 9, which shows a schematic flow chart of an encoding method provided by an embodiment of the present application. As shown in Figure 9, the method may include:

[0315] S901: Determine prediction parameters of the current block.

[0316] It should be noted that the encoding method of the embodiment of the present application is applied to an encoder. In addition, the encoding method can specifically refer to an inter-frame prediction method, more specifically, an inter-frame chrominance prediction method. In the inter-frame prediction process, a CP-CCCM-based technique is proposed to improve the accuracy of chrominance prediction.

[0317] In an embodiment of the present application, a video image can be divided into multiple coding blocks, each coding block may include a first color component, a second color component and a third color component, and the current block in the embodiment of the present application refers to the coding block in the video image that is currently to be inter-frame predicted.

[0318] It should also be noted that, in the embodiments of the present application, the prediction parameters of the current block need to be determined first. In some embodiments, the prediction parameters may include: a motion vector, a reference image index, and an inter-frame prediction identification parameter.

[0319] The reference image index indicates whether the reference image used by the current block is List0 or List1; the inter-frame prediction identification parameter indicates the prediction method used to decode the current block, which may include List0 prediction, List1 prediction, and bidirectional prediction.

[0320] It should be understood that in the embodiment of the present application, List0 represents reference image list 0, which can also be called forward reference image; List1 represents reference image list 1, which can also be called backward reference image.

[0321] It should also be understood that in the embodiment of the present application, the inter-frame prediction identification parameter indicates that the prediction method used to encode the current block is bidirectional prediction.

[0322] For example, if the current block uses bidirectional prediction, the inter-frame prediction flag parameter may indicate that the prediction method used to encode the current block is bidirectional prediction. Otherwise, if the current block uses List0 prediction or List1 prediction, the inter-frame prediction flag parameter may indicate that the prediction method used to encode the current block is unidirectional prediction. The prediction method used by the current block is set according to actual conditions and is not specifically limited in this embodiment of the application.

[0323] For example, the reference image index can be represented by inter_pred_idc, and the prediction list usage identification information can be represented by predFlagLX. If X = 0, that is, predFlagL0 = 1, then reference image List0 can be used for unidirectional prediction; if X = 1, that is, predFlagL1 = 1, then reference image List1 can be used for unidirectional prediction; if predFlagL0 = 1 and predFlagL1 = 1, then reference image List0 and reference image List1 can be used for bidirectional prediction.

[0324] In some embodiments, the method may further include: encoding the prediction parameters, and writing the obtained encoded bits into a bitstream.

[0325] It should be understood that in the embodiments of the present application, the encoder can encode the prediction parameters and write them into the bitstream, which is then transmitted to the decoder. In this way, the decoder can obtain the prediction parameters, such as motion vectors, reference image indices, and inter-frame prediction flag parameters, by decoding the bitstream.

[0326] S902: Determine a first prediction block of the current block according to the prediction parameters.

[0327] In the embodiment of the present application, the first prediction block of the current block, such as the List0 prediction block or the List1 prediction block, can be determined based on the obtained motion vector, reference image index, inter-frame prediction identification parameter, and other information. Therefore, in some embodiments, the method may further include: determining the List0 prediction block and the List1 prediction block of the current block based on the prediction parameters.

[0328] In a specific embodiment, the method may further include: the first prediction block is the List0 prediction block of the current block; or, the first prediction block is the List1 prediction block of the current block; or, the first prediction block is the List0 prediction block of the current block and the List1 prediction block of the current block.

[0329] It should be noted that, for unidirectional prediction, the first prediction block may be the List0 prediction block of the current block, ie, the aforementioned forward matching block; or, the first prediction block may be the List1 prediction block of the current block, ie, the aforementioned backward matching block.

[0330] It should also be noted that for bidirectional prediction, the first prediction block can be the List0 prediction block of the current block and the List1 prediction block of the current block. At this time, the prediction value of the bidirectional prediction predBI = w0×predList0+w1×predList1, where w0 and w1 represent weighted values.

[0331] In one possible implementation, when the prediction parameters include a motion vector, a first prediction block of the current block may be determined based on the motion vector. Specifically, when the prediction parameters include a first motion vector (e.g., a forward motion vector), the List0 prediction block of the current block may be determined based on the first motion vector; and / or when the prediction parameters include a second motion vector (e.g., a backward motion vector), the List1 prediction block of the current block may be determined based on the second motion vector.

[0332] In another possible implementation, when the prediction parameter includes a reference image index, the first prediction block of the current block may also be determined based on the value of the reference image index. If the value of the reference image index is a first value, the first prediction block is determined to be the List0 prediction block of the current block; or, if the value of the reference image index is a second value, the first prediction block is determined to be the List1 prediction block of the current block; or, if the value of the reference image index is a third value, the first prediction block is determined to be both the List0 prediction block of the current block and the List1 prediction block of the current block.

[0333] Exemplarily, the reference image index can be represented by inter_pred_idc. Assuming that the first value, the second value and the third value are set to 0, 1, and 2 respectively, then when the value of inter_pred_idc is 0, the first prediction block can be the List0 prediction block; when the value of inter_pred_idc is 1, the first prediction block can be the List1 prediction block; when the value of inter_pred_idc is 2, the first prediction block is the List0 prediction block and the List1 prediction block.

[0334] Furthermore, in embodiments of the present application, the value of the reference image index may be determined based on the block category identification information of the current block, and the block category identification information of the current block is associated with the size parameter of the current block. In some embodiments, the method may further include: determining the block category identification information of the current block based on the size parameter of the current block; encoding the block category identification information of the current block, and writing the resulting encoded bits into the bitstream.

[0335] In this way, the encoder can encode the block category identification information of the current block and write it into the bitstream, which is then transmitted to the decoder. In this way, the decoder can obtain the block category identification information of the current block by decoding the bitstream, and then determine the value of inter_pred_idc based on the block category identification information of the current block, and then determine the first predicted block.

[0336] S903: Determine model parameters according to the first color component value and the second color component value in the first prediction block.

[0337] In this embodiment of the present application, after determining the first prediction block for the current block, the first color component value and the second color component value in the first prediction block can be obtained. The first color component value and the second color component value are both reconstruction information; model parameters can be calculated based on the first color component value and the second color component value in the first prediction block.

[0338] In an embodiment of the present application, model parameters are determined based on the first color component values ​​and the second color component values ​​in the first prediction block. The model parameters may include coefficients of a target filter. Therefore, in some embodiments, the method may include determining the coefficients of the target filter based on the first color component values ​​and the second color component values ​​in the first prediction block.

[0339] In a specific embodiment, the coefficients of the target filter may be determined by solving an optimization problem. Accordingly, the method may further include: the coefficients of the target filter are coefficients used by the target filter when a first error between the second color component value in the first prediction block and the output value of the first color component value in the first prediction block after being processed by the target filter satisfies a first condition.

[0340] It should be understood that for the first error to satisfy the first condition, in one possible implementation, the first condition is that the first error is minimized. Alternatively, in another possible implementation, the first condition is that the first error is within a first preset threshold range. Alternatively, in yet another possible implementation, the first condition is that the change in the first error is within a second preset threshold range.

[0341] In another specific embodiment, determining the coefficients of the target filter based on the first color component value and the second color component value in the first prediction block may include: determining the autocorrelation parameter based on the first color component value in the first prediction block; determining the cross-correlation parameter based on the first color component value and the second color component value in the first prediction block; and determining the coefficients of the target filter based on the autocorrelation parameter and the cross-correlation parameter.

[0342] In this way, according to the determined first prediction block (reference block area), a set of target filter coefficients can be obtained by solving the linear equation group shown in the above formula (18), so that the MSE between the expected output after filtering, that is, the chrominance value predicted by CP-CCCM and the expected output chrominance reconstruction value is minimized, that is, the Wiener filter coefficients. This set of Wiener filter coefficients is a set of target filter coefficients for the current block.

[0343] In the process of solving the linear equations, the autocorrelation parameters of the luminance reconstruction samples refRecY in the first prediction block are first calculated, and then the cross-correlation parameters of the luminance reconstruction samples refRecY and the chrominance reconstruction samples refRecC in the first prediction block are calculated. Then, the autocorrelation parameters are subjected to Cholesky decomposition or LDL decomposition, and finally, each target filter coefficient c is calculated in turn by reverse recursion. n .

[0344] In the embodiment of the present application, for the target filter, it is also necessary to determine the number of coefficients of the target filter and the shape of the target filter, etc. The number of coefficients of the target filter and the shape of the target filter can be preset fixed values, or have an associated relationship with the size parameter of the current block.

[0345] In some embodiments, for the number of coefficients of the target filter, the method may further include: determining the number of coefficients of the target filter.

[0346] In an embodiment of the present application, the number of coefficients of the target filter may be equal to a first preset constant value.

[0347] In some embodiments, the method may further include: determining first block category identification information of the current block; and determining the number of coefficients of the target filter according to the first block category identification information of the current block.

[0348] In some embodiments, the method may further include encoding the number of coefficients of the target filter and writing the resulting coded bits into the bitstream. Alternatively, in some embodiments, the method may further include encoding first block category identification information of the current block and writing the resulting coded bits into the bitstream.

[0349] It should be noted that the number of coefficients of the target filter can be represented by nTap. For example, the value of nTap can be 4, 5, 6, 7, 8, 9, etc., but is not specifically limited.

[0350] It should also be noted that the number of coefficients of the target filter may also be referred to as the number of target filter taps. Here, the number of coefficients of the target filter may be a preset constant value or may be determined based on the first block category identification information of the current block, without specific limitation.

[0351] In some embodiments, for the shape of the target filter, the method may further include: determining the shape of the target filter.

[0352] In the embodiment of the present application, the target filter may be a one-dimensional or two-dimensional filter of a preset shape.

[0353] In some embodiments, the method may further include: determining a value of a filter shape parameter, wherein the filter shape parameter indicates a shape of the target filter.

[0354] In some embodiments, the method may further include: determining second identification information of the block category of the current block; and determining a value of a filter shape parameter according to the second identification information of the block category of the current block.

[0355] In some embodiments, the method further includes: encoding the shape of the target filter and writing the resulting coded bits into the bitstream. Alternatively, in some embodiments, the method further includes: encoding the values ​​of the filter shape parameters and writing the resulting coded bits into the bitstream. Alternatively, in some embodiments, the method further includes: encoding the second block category identification information of the current block and writing the resulting coded bits into the bitstream.

[0356] It should be noted that the filter shape parameter can be represented by FilterIdx, which is used to indicate the shape of the target filter. For example, the shape of the target filter can be diamond, rectangle, cross, stripe, or even a one-dimensional filter or a two-dimensional filter, but is not specifically limited thereto.

[0357] Exemplarily, if the value of FilterIdx is equal to 0, the shape of the target filter is determined to be a diamond; if the value of FilterIdx is equal to 1, the shape of the target filter is determined to be a cross; if the value of FilterIdx is equal to 2, the shape of the target filter is determined to be a rectangle.

[0358] It should also be noted that the shape of the target filter may be a preset shape, or may be determined according to the second identification information of the block category of the current block, and this is not specifically limited.

[0359] It is understood that in the embodiment of the present application, the second block category identification information may be the same as or different from the first block category identification information. For example, in a specific embodiment, the first block category identification information and the second block category identification information are the same, that is, a single identification information can be used to indicate both the number of coefficients of the target filter and the shape of the target filter.

[0360] It can also be understood that the block category identification information, the block category first identification information, and the block category second identification information described in the embodiments of the present application are all the same, that is, one identification information (represented by cpcccmSizeId) is used, and the value of cpcccmSizeId can simultaneously indicate the reference image index inter_pred_idc, the number of coefficients nTap of the target filter, and the shape FilterIdx of the target filter.

[0361] In an embodiment of the present application, the value of cpcccmSizeId can be determined as follows: according to the size parameters of the current block, the size parameters of the current block may include width (expressed by nTbW) and height (expressed by nTbH).

[0362] Exemplarily, if the size parameter of the current block satisfies min(nTbW, nTbH) <= 8, then determine that the value of cpcccmSizeId is 0; if the size parameter of the current block satisfies 8 < min(nTbW, nTbH) <= 32, then determine that the value of cpcccmSizeId is 1; if the size parameter of the current block satisfies min(nTbW, nTbH) > 32, then determine that the value of cpcccmSizeId is 2.

[0363] Exemplarily, if the size parameter of the current block satisfies min(nTbW, nTbH) <= 64, then determine that the value of cpcccmSizeId is 0; if the size parameter of the current block satisfies 64 < min(nTbW, nTbH) <= 256, then determine that the value of cpcccmSizeId is 1; if the size parameter of the current block satisfies min(nTbW, nTbH) > 256, then determine that the value of cpcccmSizeId is 2.

[0364] In some embodiments, in order to accelerate the processing speed at the decoding end, the method may further include: encoding the value of cpcccmSizeId and writing the obtained encoded bits into the code stream. In this way, after the code stream is transmitted from the encoding end to the decoding end, the subsequent decoding end can directly determine the value of cpcccmSizeId by decoding the code stream, and then determine the number of coefficients of the target filter and the shape of the target filter, etc., so as to construct the target filter.

[0365] S904: Determine the reference sample value of the first color component sampling points of the current block, and determine the predicted value of the second color component sampling points of the current block according to the reference sample value of the first color component sampling points of the current block and the model parameters.

[0366] It should be noted that in the embodiments of the present application, before determining the predicted value of the second color component sampling points of the current block, it is necessary to first determine the reference sample value of the first color component sampling points of the current block.

[0367] In some embodiments, determining the reference sample value of the first color component sampling points of the current block may include: determining the reference sample value of the first color component sampling points of the current block according to the reconstructed value of the first color component sampling points of the current block.

[0368] In a specific embodiment, the method may further include: determining the reconstructed value of the first color component sampling points of the current block according to the first color component value in the first prediction block.

[0369] In an embodiment of the present application, for unidirectional prediction, determining the reconstructed value of the first color component sampling point of the current block based on the first color component value in the first prediction block may include: determining the reconstructed value of the first color component sampling point of the current block based on the first color component value in the List0 prediction block of the current block; or determining the reconstructed value of the first color component sampling point of the current block based on the first color component value in the List1 prediction block of the current block.

[0370] Here, for the reconstructed value of the first color component sampling point of the current block, taking the List0 prediction block as an example, specifically, the predicted value of the first color component sampling point of the current block can be determined based on the first color component value in the List0 prediction block of the current block; then, the predicted difference value of the first color component sampling point of the current block can be determined based on the original value and the predicted value of the first color component sampling point of the current block; the predicted difference value of the first color component sampling point of the current block is quantized and dequantized to determine the reconstructed difference value of the first color component sampling point of the current block; and the reconstructed value of the first color component sampling point of the current block is determined based on the reconstructed difference and the predicted value of the first color component sampling point of the current block.

[0371] In an embodiment of the present application, for bidirectional prediction, determining the reconstructed value of the first color component sampling point of the current block based on the first color component value in the first prediction block may include: determining the reconstructed value of the first color component sampling point of the current block based on the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block.

[0372] Here, for the reconstructed value of the first color component sampling point of the current block, taking the List0 prediction block and the List1 prediction block as an example, specifically, the first color component value in the List0 prediction block and the first color component value in the List1 prediction block can be weighted and calculated according to the List0 weighting coefficient and the List1 weighting coefficient to determine the predicted value of the first color component sampling point of the current block; then, based on the original value and the predicted value of the first color component sampling point of the current block, the predicted difference value of the first color component sampling point of the current block is determined; the predicted difference value of the first color component sampling point of the current block is quantized and dequantized to determine the reconstructed difference value of the first color component sampling point of the current block; and based on the reconstructed difference and the predicted value of the first color component sampling point of the current block, the reconstructed value of the first color component sampling point of the current block is determined.

[0373] Thus, in this embodiment of the present application, after determining the reconstructed value of the first color component sampling point of the current block, it is also necessary to store it in the decoded image buffer. In this way, at the decoding end, the reconstructed value of the first color component sampling point of the current block can be directly obtained from the decoded image buffer.

[0374] In some embodiments, the method may further include: filtering the reconstructed value of the first color component sampling point of the current block to determine the filtered reconstructed value of the first color component sampling point of the current block; and determining the reference sample value of the first color component sampling point of the current block based on the filtered reconstructed value of the first color component sampling point of the current block.

[0375] It should be understood that in the embodiment of the present application, not only the reconstructed value of the first color component sampling point of the current block can be used as the reference sample value of the first color component sampling point of the current block, but also the filtered reconstructed value of the first color component sampling point of the current block can be used as the reference sample value of the first color component sampling point of the current block, and this is not specifically limited here.

[0376] In some embodiments, determining the reference sample value of the first color component sampling point of the current block may include: determining the predicted value of the first color component sampling point of the current block based on the first color component value in the first prediction block; and determining the reference sample value of the first color component sampling point of the current block based on the predicted value of the first color component sampling point of the current block.

[0377] In an embodiment of the present application, for unidirectional prediction, determining the predicted value of the first color component sampling point of the current block based on the first color component value in the first prediction block may include: determining the predicted value of the first color component sampling point of the current block based on the first color component value in the List0 prediction block of the current block; or determining the predicted value of the first color component sampling point of the current block based on the first color component value in the List1 prediction block of the current block.

[0378] In an embodiment of the present application, for bidirectional prediction, determining the predicted value of the first color component sampling point of the current block based on the first color component value in the first prediction block may include: determining the predicted value of the first color component sampling point of the current block based on the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block.

[0379] In a specific embodiment, the method may further include: determining the List0 weighting coefficient of the List0 prediction block of the current block and the List1 weighting coefficient of the List1 prediction block of the current block; determining the weighted sum of the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block based on the List0 weighting coefficient and the List1 weighting coefficient; and determining the predicted value of the first color component sampling point of the current block based on the weighted sum.

[0380] Here, taking the List0 prediction block and the List1 prediction block as an example, specifically, the first color component value in the List0 prediction block and the first color component value in the List1 prediction block can be weighted and calculated according to the List0 weighting coefficient and the List1 weighting coefficient to determine the predicted value of the first color component sampling point of the current block, and then the predicted value of the first color component sampling point of the current block is used as the reference sample value of the first color component sampling point of the current block.

[0381] In some embodiments, the method may further include: filtering the predicted value of the first color component sampling point of the current block to determine the filtered predicted value of the first color component sampling point of the current block; and determining the reference sample value of the first color component sampling point of the current block based on the filtered predicted value of the first color component sampling point of the current block.

[0382] It should be understood that in the embodiment of the present application, not only the predicted value of the first color component sampling point of the current block can be used as the reference sample value of the first color component sampling point of the current block, but also the filtered predicted value of the first color component sampling point of the current block can be used as the reference sample value of the first color component sampling point of the current block, and this is not specifically limited here.

[0383] It should also be understood that in the embodiment of the present application, assuming that the first color component is a luminance component and the second color component is a chrominance component, the filtering processing here can be a low-pass filtering, a downsampling filtering, etc., so that the resolution of the first color component after filtering is the same as the resolution of the second color component.

[0384] Furthermore, after determining the reference sample value of the first color component sampling point of the current block, it can also be used to determine the predicted value of the second color component sampling point of the current block. Therefore, in some embodiments, determining the predicted value of the second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameters may include: determining a first input value of the target filter based on the reference sample value of the first color component sampling point of the current block; determining a first output value of the target filter based on the first input value and the model parameters; and determining the predicted value of the second color component sampling point of the current block based on the first output value.

[0385] It should be noted that in an embodiment of the present application, after determining the reference sample value of the first color component sampling point of the current block, in some embodiments, the method may further include: performing a first filtering process on the reference sample value of the first color component sampling point of the current block to determine the first input value.

[0386] It should be understood that in the embodiment of the present application, the first filtering process may include at least one of the following: low-pass filtering, downsampling filtering.

[0387] It should also be understood that in the embodiment of the present application, the first filtering process sets the first input value to be equal to the reference sample value of the first color component sampling point of the current block.

[0388] Here, for the target filter, the reference sample value of the first color component sampling point of the current block can be directly used as the first input value, or the filtered value of the first color component sampling point of the current block can be used as the first input value. For example, the reconstructed value of the first color component sampling point of the current block can be used as the first input value, or the filtered reconstructed value of the first color component sampling point of the current block can be used as the first input value, or the predicted value of the first color component sampling point of the current block can be used as the first input value, or the filtered predicted value of the first color component sampling point of the current block can be used as the first input value. This embodiment of the present application does not specifically limit this.

[0389] It should also be noted that, in the embodiment of the present application, after determining the first output value of the target filter based on the first input value and the model parameters, if the first output value includes the predicted values ​​of all the second color component sampling points in the current block, then the first output value can be directly used as the predicted values ​​of the second color component sampling points in the current block. If the first output value includes the predicted values ​​of some of the second color component sampling points in the current block, then the first output value needs to be subjected to correlation processing before being used as the predicted values ​​of the second color component sampling points in the current block.

[0390] In some embodiments, determining the predicted value of the second color component sampling point of the current block based on the first output value may include: performing a second filtering process on the first output value to determine the second output value; and determining the predicted value of the second color component sampling point of the current block based on the second output value.

[0391] It should be understood that in the embodiment of the present application, the second filtering process includes at least one of the following: low-pass filtering and up-sampling filtering.

[0392] It should also be understood that in the embodiment of the present application, the second filtering process sets the second output value to be equal to the first output value.

[0393] In the embodiments of the present application, in order to limit the obtained second output value within a preset numerical range, relevant processing needs to be performed on the second output value. In some embodiments, based on the second output value, determining the predicted value of the second color component sampling points of the current block may include: performing a first processing on the second output value to obtain the predicted value of the second color component sampling points of the current block.

[0394] It should be understood that in the embodiments of the present application, the first processing is a clamping (clip) operation that limits the second output value within a preset numerical range.

[0395] Here, the preset numerical range can be: between 0 and (1 << BitDepth) - 1, where BitDepth is the bit depth required for the chrominance component. If the second output value exceeds the value range of this preset numerical range, then corresponding correction operations need to be performed on the second output value. Exemplarily, the second output value can also be represented by C pred [i][j], and at this time, correction operations can be performed on C pred [i][j] to ensure that the predicted values of all second color component sampling points in the current block are between 0 and (1 << BitDepth) - 1.

[0396] It should also be noted that in the embodiments of the present application, after determining the first output value according to the target filter, a first offset value (denoted by bias) can also be added to the target filter to determine the predicted value of the second color component sampling points of the current block.

[0397] In some embodiments, based on the first output value, determining the predicted value of the second color component sampling points of the current block may include: performing an addition operation according to the first output value and the first offset value to determine the predicted value of the second color component sampling points of the current block.

[0398] In a specific embodiment, the first offset value is set to be equal to a preset constant value; or, the first offset value is set to be equal to the value of the first input value in a preset mapping relationship.

[0399] Exemplarily, assume that the first color component is the luminance component, the second color component is the chrominance component, and the model parameter can be the tap coefficients corresponding to the target filter, that is, the number of coefficients of the target filter is equal to the number of taps nTap of the target filter. In addition, a first offset value bias can be added to the target filter here. For example, when FilterIdx = 1, nTap = 5, and the target filter is a cross-shaped filter. At this time, the filter coefficients are the tap coefficients c0 to c4 corresponding to the target filter, and the chrominance prediction value calculated at the (i, j) position is as shown in the foregoing formula (22), and at this time, a bias term bias can be added, specifically as shown in the foregoing formula (23).

[0400] It should be understood that in the embodiment of the present application, bias may include coefficient terms involved in the calculation of filter coefficients, such as bias = c n ×Constant. Wherein, Constant can be a fixed constant, such as Constant = 1 << (BitDepth-1); it can also be a value related to the brightness pixel value of the same position (i, j), such as Constant = f(FilterY[i][j]); it can also be a value related to the brightness pixel value corresponding to a tap in the target filter other than the same brightness position (i, j), such as Constant = f(FilterY[k][l]). Constant = f(FilterY[i][j]) or Constant = f(FilterY[k][l]) can be a linear mapping relationship or a nonlinear mapping relationship; there is no specific limitation on this here.

[0401] It should also be understood that in the embodiment of the present application, bias may not include coefficient terms involved in the calculation of filter coefficients, such as bias = Constant. Wherein, Constant can be a fixed constant, such as Constant = 1 < < (BitDepth-1); it can also be a value related to the brightness pixel value of the same position (i, j), such as Constant = f(FilterY[i][j]); it can also be a value related to the brightness pixel value corresponding to a tap in the target filter other than the brightness position of the same position (i, j), such as Constant = f(FilterY[k][l]). Constant = f(FilterY[i][j]) or Constant = f(FilterY[k][l]) can be a linear mapping relationship or a nonlinear mapping relationship; this is not specifically limited here.

[0402] Further, after determining the predicted value C of the second color component sampling point of the current block pred [i][j]After that, in some embodiments, the method may further include: performing relevant processing on the predicted value of the second color component sampling point of the current block, and using the processed predicted value as the predicted value of the second color component sampling point of the current block.

[0403] In a possible implementation, performing correlation processing on the predicted value of the second color component sampling point of the current block may include: performing filtering enhancement processing on the predicted value of the second color component sampling point of the current block.

[0404] In another possible implementation, performing correlation processing on the predicted value of the second color component sampling point of the current block may include: determining a compensation value of the second color component sampling point of the current block based on a reference sample value of an adjacent area of ​​the current block; and correcting the predicted value of the second color component sampling point of the current block based on the compensation value.

[0405] In another possible implementation, performing correlation processing on the predicted value of the second color component sampling point of the current block may include: performing prediction processing on the second color component sampling point of the current block according to at least one prediction mode to determine at least one initial predicted value of the second color component sampling point of the current block; and performing weighted fusion processing based on the at least one initial predicted value and the predicted value of the second color component sampling point of the current block.

[0406] In addition, in order to improve the prediction performance of the CP-CCCM mode, the predicted value of the second color component sampling point of the current block is processed, and a neural network can be used to correct the predicted output of the CP-CCCM mode to obtain the final predicted value.

[0407] It is also understood that in this embodiment of the present application, in addition to determining the reference sample value of the first color component sampling point of the current block based on the reconstructed value of the first color component sampling point of the current block or the predicted value of the first color component sampling point of the current block, the reference sample value can also be determined based on the predicted difference value of the first color component sampling point of the current block. In this case, the model parameters can be adaptively determined based on the residual value of the first color component and the residual value of the second color component in the first prediction block.

[0408] In some embodiments, the method may further include: determining a prediction difference value of a first color component sampling point of the current block; determining a reference sample value of the first color component sampling point of the current block based on the prediction difference value of the first color component sampling point of the current block; and determining a first color component residual value and a second color component residual value in the first prediction block; and determining a model parameter based on the first color component residual value and the second color component residual value in the first prediction block;

[0409] Accordingly, in some embodiments, determining the predicted value of the second color component sampling point of the current block based on the reference sample value and model parameters of the first color component sampling point of the current block may include: determining the initial predicted difference value of the second color component sampling point of the current block based on the predicted difference value and model parameters of the first color component sampling point of the current block; determining the initial predicted value of the second color component sampling point of the current block based on the first prediction block; and determining the predicted value of the second color component sampling point of the current block based on the initial predicted difference value and the initial predicted value of the second color component sampling point of the current block.

[0410] It should be understood that in the embodiment of the present application, for the first color component residual value and the second color component residual value in the first prediction block, an additional decoding cache unit (Buffer) is required to cache the luminance residual value and the chrominance residual value in the first prediction block.

[0411] It should also be understood that in the embodiments of the present application, when determining the model parameters, not only the first color component value and the second color component value in the first prediction block can be used, but also the first color component residual value and the second color component residual value in the first prediction block can be used, and the filtered first color component residual value and the filtered second color component residual value in the first prediction block can be used, and even the first color component residual value and the second color component value in the first prediction block can be used, etc., and no specific limitation is made here.

[0412] S905: Determine a prediction difference value of the second color component sampling point of the current block according to the prediction value of the second color component sampling point of the current block.

[0413] It should be noted that, in embodiments of the present application, after obtaining the predicted value of the second color component sampling point of the current block, a predicted difference value of the second color component sampling point of the current block may also be calculated. In some embodiments, determining the predicted difference value of the second color component sampling point of the current block based on the predicted value of the second color component sampling point of the current block may include: determining an initial value of the second color component sampling point of the current block; and determining the predicted difference value of the second color component sampling point of the current block based on the initial value of the second color component sampling point of the current block and the predicted value of the second color component sampling point of the current block.

[0414] In a specific embodiment, determining the predicted difference value of the second color component sampling point of the current block based on the initial value of the second color component sampling point of the current block and the predicted value of the second color component sampling point of the current block may include: performing a subtraction operation on the initial value of the second color component sampling point of the current block and the predicted value of the second color component sampling point of the current block to determine the predicted difference value of the second color component sampling point of the current block.

[0415] Furthermore, in some embodiments, the method may further include: encoding the predicted difference value of the second color component sampling point of the current block, and writing the obtained coded bits into the bitstream.

[0416] In this way, the encoder can encode the predicted difference value of the second color component sampling point of the current block and write it into the bitstream, which is then transmitted to the decoder. In this way, the decoder can obtain the predicted difference value of the second color component sampling point of the current block by decoding the bitstream, and then restore the reconstructed value of the second color component sampling point of the current block.

[0417] In some embodiments, the method may further include: determining prediction mode identification information of the current block; when the prediction mode identification information indicates that the current block uses a convolutional cross-component model for weighted prediction, executing the step of determining a prediction block of the current block according to motion information.

[0418] In a specific embodiment, the method may further include:

[0419] If the current block uses a convolutional cross-component model to perform weighted prediction, determining that the value of the prediction mode identification information is a fourth value;

[0420] If it is determined that the current block does not use weighted prediction based on the convolution cross-component model, the value of the prediction mode identification information is the fifth value.

[0421] It should be noted that in the embodiment of the present application, the fourth value and the fifth value are different, and the fourth value and the fifth value can be in parameter form or in digital form. Specifically, the prediction mode identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.

[0422] Exemplarily, for the fourth value and the fifth value, the fourth value may be set to 1 and the fifth value may be set to 0; or, the fourth value may be set to true and the fifth value may be set to false; however, this is not specifically limited here.

[0423] It should also be noted that in the embodiment of the present application, the final inter-frame chroma prediction value can be determined by judging whether the current block uses the CP-CCCM mode for chroma prediction based on certain conditions, but is not limited to the following four methods. For example, the four methods can be as follows:

[0424] Method 1: Determine whether to use the CP-CCCM mode by comparing the difference between the reconstructed brightness of the first prediction block and the brightness of the current block, such as SAD, MSE, SATD, SSE, etc. (or the corresponding information of the brightness residual of the current block) with the threshold T_Distortion1.

[0425] Method 2: On the basis of satisfying the CP-CCCM mode in Method 1, the distortion between the chrominance reconstruction value of the first prediction block and its chrominance prediction value of the CP-CCCM mode, such as SAD or MSE or SATD or SSE, and the threshold T_Distortion2 is used to determine whether the current block uses the chrominance prediction value of the CP-CCCM mode to replace the original inter-frame weighted chrominance prediction value.

[0426] Method three: The calculated target filter coefficient is applied to the filter template of the current block to obtain the CP-CCCM prediction value of the template; then the template of the first prediction block is obtained for weighted prediction to obtain a weighted template prediction value; the weighted template prediction value and the CP-CCCM chrominance prediction value of the template are respectively compared with the reconstructed chrominance calculation distortion of the current block template, such as SAD or MSE or SATD or SSE, to decide whether to use the chrominance prediction value of the CP-CCCM mode of the current block to replace the weighted chrominance prediction value of the current block.

[0427] Method 4: The encoder can transmit a flag to indicate whether to use the chroma prediction value of the CP-CCCM mode of the current block to replace the weighted chroma prediction value of the current block; so that the decoder can subsequently decide whether to use the chroma prediction value of the CP-CCCM mode of the current block to replace the weighted chroma prediction value of the current block by parsing the flag.

[0428] This embodiment provides an encoding method, which determines prediction parameters for a current block; determines a first prediction block for the current block based on the prediction parameters; determines model parameters based on the first color component value and the second color component value in the first prediction block; determines a reference sample value for the first color component sampling point of the current block, and determines a prediction value for the second color component sampling point of the current block based on the reference sample value and the model parameters for the first color component sampling point of the current block; and determines a prediction difference value for the second color component sampling point of the current block based on the prediction value for the second color component sampling point of the current block. In this way, the model parameters are determined based on the first color component value and the second color component value in the first prediction block. The model parameters fully reflect the correlation between luminance and chrominance in the prediction block, and this correlation is applied to the existing luminance information of the current block for chrominance prediction, thereby improving the accuracy of inter-frame chrominance prediction, improving encoding and decoding efficiency, and thereby improving encoding and decoding performance.

[0429] In another embodiment of the present application, the embodiment of the present application further provides a code stream, which is generated by bit encoding based on the information to be encoded; wherein the information to be encoded may include at least one of the following:

[0430] The predicted difference value of the second color component sampling point of the current block, the prediction parameters of the current block, the number of coefficients of the target filter, the shape of the target filter, the value of the filter shape parameter, the first block category identification information of the current block, and the second block category identification information of the current block.

[0431] In an embodiment of the present application, after the predicted difference value of the second color component sampling point of the current block is transmitted from the encoding end to the decoding end, the decoding end obtains the predicted difference value of the second color component sampling point through decoding, and then obtains the prediction parameter of the current block through decoding, and can determine the predicted value of the second color component sampling point; based on the predicted value of the second color component sampling point and the predicted difference value of the second color component sampling point, the reconstructed value of the second color component sampling point of the current block can be restored.

[0432] In another embodiment of the present application, based on the encoding and decoding methods described in the aforementioned embodiments, during the inter-frame prediction process, the matching block information of the current block is the encoded reconstruction information, and the weighted prediction information of the current block is also known, including whether the reference image list is valid, the reference image index, and the color component index. This embodiment of the present application proposes a CP-CCCM technology that utilizes the matching block information and the weighted prediction information.

[0433] In the embodiment of the present application, the input of CP-CCCM: the position of the chroma sampling point of the current block in the image (xTbCmp, yTbCmp), the width of the current block nTbW and the height of the current block nTbH. The output of CP-CCCM: the chroma prediction value predSamples[x][y] of the current block, x=0,1,…,nTbW-1, y=0,1,…,nTbH-1. Among them, the prediction process of CP-CCCM technology may include the steps of determining the core parameters of the CP-CCCM mode, obtaining input information, chroma prediction based on the convolution cross-component model, and post-processing. After the above steps, the chroma prediction value of the current block can be obtained.

[0434] In a specific embodiment, referring to FIG10 , a schematic diagram of a CP-CCCM prediction process provided by an embodiment of the present application is shown. As shown in FIG10 , the process may include:

[0435] S1001: Determine core parameters of the CP-CCCM mode.

[0436] It should be noted that, for S1001, the core parameters involved in the CP-CCCM mode are determined, that is, the core parameters of the CP-CCCM mode can be obtained or inferred through configuration or in some way, such as obtaining the core parameters of the CP-CCCM mode from the bitstream at the decoding end.

[0437] Here, the determination of the core parameters includes, but is not limited to, the reference image (inter_pred_idc) used in the CP-CCCM mode, the number of convolution filter taps (nTap) based on the convolution cross-component model, the convolution filter shape (FilterIdx) based on the convolution cross-component model, and the number of chroma prediction pixel outputs (predCpcccm) based on the convolution cross-component model (arranged as predSizeW×predSizeH). The number of chroma prediction pixel outputs (predCpcccm) based on the convolution cross-component model can be related to the size parameter of the current block (for example, predSizeW is equal to nTbW, predSizeH is equal to nTbH, or predSizeW is equal to nTbW / 4, predSizeH is equal to nTbH / 4). FilterIdx represents the filter shape. For example, when the filter shape is diamond, FilterIdx is 0; when the filter shape is cross, FilterIdx is 1; when the filter shape is rectangular, FilterIdx is 2, etc. In addition, inter_pred_idc can be used to indicate whether the current block uses the reference image in List0, the reference image in List1, or bidirectional prediction, where when inter_pred_idc is 0, the reference image in List0 is used; when inter_pred_idc is 1, the reference image in List1 is used; when inter_pred_idc is 2, the reference images in List0 and List1 are used; when inter_pred_idc does not exist, the reference image in List0 is used.

[0438] The determination of the core parameters of CP-CCCM is affected by the block size, block content, or the number of pixels in the block under certain conditions. For example:

[0439] During the encoding process, if the block sizes used in the CP-CCCM mode differ significantly, or the block contents differ significantly, or the number of pixels within a block differs significantly, the current block can be classified based on its block size, block content, or number of pixels within the block, and core parameters can be determined based on different categories. That is, the reference image (inter_pred_idc), the number of convolution filter taps (nTap), the convolution filter shape (FilterIdx), or the number of chroma prediction outputs (predCpcccm) based on the convolution cross-component model (arranged as predSizeW×predSizeH) used by the CP-CCCM can be determined based on the classification category. It should be noted that predSizeW and predSizeH can also be the same or different.

[0440] To better illustrate the core parameters of the CP-CCCM mode, two simple categories are used as examples:

[0441] Classification Example 1: The CP-CCCM mode can classify the current block according to the width and height of the current block, and use cpcccmSizeId to represent the type of the current block. For different types of blocks, the reference image (inter_pred_idc), or the number of convolution filter taps (nTap), or the convolution filter shape (FilterIdx), or the number of chrominance prediction outputs (predCpcccm) based on the convolutional cross-component model (arranged as predSizeW×predSizeH) used by the CP-CCCM mode can be determined according to the type of the current block. Here, an example of being divided into 3 categories is used for illustration:

[0442] The current block is divided into 3 categories according to the width and height of the current block. The reference image (inter_pred_idc), the number of convolution filter taps (nTap), the convolution filter shape (FilterIdx), and the number of chrominance prediction outputs (predCpcccm) based on the convolutional cross-component model used for different categories can be set to be the same or different. nTbW is the width of the current block, nTbH is the height of the current block, and the definition of the type cpcccmSizeId of the current block is as follows:

[0443] ● For the current block where min(nTbW,nTbH) <= 8, cpcccmSizeId = 0. The reference image (inter_pred_idc) it uses is List1, the number of convolution filter taps (nTap) is 3, the convolution filter shape (FilterIdx) is 2, and there are nTbH×nTbW chrominance prediction values for the chrominance prediction output based on the convolutional cross-component model;

[0444] ● For the current block where 8 < min(nTbW,nTbH) <= 32, cpcccmSizeId = 1. The reference image (inter_pred_idc) it uses is List0, the number of convolution filter taps (nTap) is 5, the convolution filter shape (FilterIdx) is 1, and there are nTbH×nTbW chrominance prediction values for the chrominance prediction output based on the convolutional cross-component model;

[0445] ● For the current block where min(nTbW,nTbH) > 32, cpcccmSizeId = 2. The reference images (inter_pred_idc) it uses are List0 and List1, the number of convolution filter taps (nTap) is 9, the convolution filter shape (FilterIdx) is 0, and there are nTbH×nTbW chrominance prediction values for the chrominance prediction output based on the convolutional cross-component model;

[0446] The quantitative relationship of the above core parameters is shown in Table 1 in tabular form.

[0447] Table 1

[0448] cpcccmSizeIdinter_pred_idcnTapFilterIdxpredSizeHpredSizeW0132nTbHnTbW1051nTbHnTbW2290nTbHnTbW

[0449] Classification Example 2: The CP-CCCM mode can also classify the current block according to the number of pixels in the current block, and use cpcccmSizeId to indicate the type of the current block. For different types of blocks, the reference image (inter_pred_idc), the number of convolution filter taps (nTap), the convolution filter shape (FilterIdx), or the number of chrominance prediction outputs (predCpcccm) based on the convolution cross-component model (arranged as predSizeW×predSizeH) used by the CP-CCCM mode can be determined according to the type of the current block. Here is an example divided into three categories as an example for explanation:

[0450] The current block is divided into three categories based on the number of pixels in the current block. The reference image (inter_pred_idc), the number of convolution filter taps (nTap), the convolution filter shape (FilterIdx), and the number of chrominance prediction outputs based on the convolution cross-component model (predCpcccm) used by different categories can be set to the same or different. nTbW is the width of the current block, nTbH is the height of the current block, and the definition of the current block type cpcccmSizeId is as follows:

[0451] ● When the current block size is (nTbW×nTbH)<=64, cpcccmSizeId=0. The reference image (inter_pred_idc) used is List0, the number of convolution filter taps (nTap) is 4, the convolution filter shape (FilterIdx) is 2, and the chroma prediction based on the convolution cross-component model outputs nTbH×nTbW chroma prediction values;

[0452] When 64 < (nTbW × nTbH) < = 256 for the current block, cpcccmSizeId = 1. The reference image (inter_pred_idc) used is List0, the number of convolution filter taps (nTap) is 7, the convolution filter shape (FilterIdx) is 1, and the chroma prediction based on the convolution cross-component model outputs nTbH / 2 × nTbW / 2 chroma prediction values;

[0453] When (nTbW × nTbH) > 256 for the current block, cpcccmSizeId = 2. The reference image (inter_pred_idc) used is List0, the number of convolution filter taps (nTap) is 9, the convolution filter shape (FilterIdx) is 0, and the chroma prediction based on the convolution cross-component model outputs nTbH / 4 × nTbW / 4 chroma prediction values;

[0454] The quantitative relationship of the above core parameters is expressed in tabular form, as shown in Table 2.

[0455] Table 2

[0456] cpcccmSizeIdinter_pred_idcnTapFilterIdxpredSizeHpredSizeW0042nTbHnTbW1071nTbH / 2nTbW / 22090nTbH / 4nTbW / 4

[0457] S1002: Determine input information according to the core parameters, where the input information includes matching block information of the current block and brightness prediction information of the current block.

[0458] It should be noted that for S1002, when predicting the current block, the MV information of the current block is known, and a matching block can be found in the corresponding reference image using the MV information of the current block and the core parameter inter_pred_idc. When inter_pred_idc is 2, the matching block obtained in the List0 reference image includes the reconstructed luminance block refRecY0 and the reconstructed chrominance block refRecC0; the matching block obtained in the List1 reference image includes the reconstructed luminance block refRecY1 and the reconstructed chrominance block refRecC1; when inter_pred_idc is 0, the matching block obtained in the List0 reference image includes only the reconstructed luminance block refRecY0 and the reconstructed chrominance block refRecC0; when inter_pred_idc is 1, the matching block obtained in the List1 reference image includes only the reconstructed luminance block refRecY1 and the reconstructed chrominance block refRecC1. At the same time, the weighted prediction information of the current block (i.e., brightness prediction information) is also known. The reconstructed brightness blocks refRecY0 and / or refRecY1 of the matching block can be weighted predicted using the weight information to obtain the predicted brightness block currPredY of the current block as the existing brightness information of the current block.

[0459] In addition, refRecY0 or refRecC0 or refRecY1 or refRecC1 or currPredY can be pre-processed under certain conditions and used as the chrominance prediction input based on the convolution cross-component model.

[0460] Exemplarily, in order to improve the quality of the input information, refRecY0 or refRecC0 or refRecY1 or refRecC0 or currPredY may be subjected to different filtering enhancement operations;

[0461] For example, when the resolutions of the chrominance component and the luminance component are inconsistent, upsampling filtering / downsampling filtering and other operations may be performed on refRecY0 or refRecC0 or refRecY1 or refRecC0 or curPredY to facilitate subsequent chrominance prediction calculations.

[0462] In an embodiment of the present application, the determined input information may include: matching block information determined according to inter_pred_idc, such as the reconstructed luminance block refRecY0, the reconstructed chrominance block refRecC0, and / or the reconstructed luminance block refRecY1, the reconstructed chrominance block refRecC1 (if refRecY0, refRecC0, refRecY1 and refRecC1 need to be pre-processed, they are after the pre-processing operation); luminance prediction information currPredY of the current block obtained according to the weight information and the reconstructed luminance block refRecY0 and / or refRecY1 of the matching block (if refRecY0 and refRecY1 need to be pre-processed, they are after the pre-processing operation).

[0463] S1003: Perform chroma prediction calculation based on a convolution cross-component model according to the determined input information to determine a chroma prediction value of the current block.

[0464] It should be noted that, for S1003, the chromaticity prediction value C within the size specified by the core parameter pred [i][j] is determined, where i = 0, 1, ..., predSizeW - 1 and j = 0, 1, ..., predSizeH - 1. predSizeH and predSizeW are core parameters determined by the size of the chroma prediction block and can be the same as or different from the height nTbH or width nTbW of the current block. Under certain conditions, the following calculations can also be performed on only a portion of the pixels to be predicted within the current block.

[0465] It should also be noted that S1003 may include the following operations: after determining the convolution filter tap coefficients, performing weighted prediction based on the tap coefficients to obtain a chrominance prediction value based on the convolution cross-component model. The process of determining the convolution filter tap coefficients primarily includes determining the reconstructed luminance information and reconstructed chrominance information of the matching block used to calculate the filter coefficients, and calculating the filter coefficients using the reconstructed luminance information and reconstructed chrominance information of the matching block.

[0466] In some embodiments, as shown in FIG11 , S1003 may include:

[0467] S1101: Determine reference information for calculating filter coefficients.

[0468] It should be noted that the filter coefficients here are the coefficients of the target filter in the aforementioned embodiment, and can also be referred to as the number of filter taps. Based on the core parameters (number of filter taps nTap and filter shape FilterIdx) determined by the CP-CCCM mode, a filter can be determined. For example, when nTap is 5 and filter shape FilterIdx is 1, a filter is generated. This filter is shown in FIG12 .

[0469] Here, after obtaining the number of filter taps and shape information based on the core parameters, the filter coefficients are calculated using refRecY0 and refRecC0 or refRecY1 and refRecC1. A set of filter coefficients is calculated for each current block. When inter_pred_idc is 0, only refRecY0 and refRecC0 are used to calculate the filter coefficients; when inter_pred_idc is 1, only refRecY1 and refRecC1 are used to calculate the filter coefficients; when inter_pred_idc is 2, the filter coefficients can be calculated based on refRecY0 and refRecC0, or based on refRecY1 and refRecC1. Exemplarily, the distortion measurement criteria such as SAD, SATD, MSE between refRecY0 or refRecY1 and currPredY can be compared, and then a decision can be made as to whether to use refRecY0 and refRecC0 to calculate the filter coefficients or to use refRecY1 and refRecC1 to calculate the filter coefficients, wherein the smaller the distortion, the more likely it is to be used to calculate the filter coefficients; alternatively, the weight information of the forward matching block and the backward matching block, such as the BCW weight information, can be compared for judgment, and the larger the weight, the more likely it is to be used to calculate the filter coefficients; alternatively, the distortion such as SAD, SATD, MSE between the adjacent templates of the forward matching block and the adjacent templates of the backward matching block and the current block template can be compared for judgment, and the larger the distortion, the less likely it is to be used to calculate the filter coefficients; this embodiment of the present application does not limit this.

[0470] In this way, reference information for calculating filter coefficients can be determined, specifically the luminance reconstruction information refRecY and the chrominance reconstruction information refRecC of the matching block.

[0471] S1102: Calculate filter coefficients based on reference information.

[0472] It should also be noted that after obtaining the reference information used to calculate the filter coefficients, the reference information here may include reference luminance information and reference chrominance information. The reference information may be reconstruction information or may be derived based on the reconstruction information. Taking the reference information as reconstruction information as an example, after obtaining the reference information (including luminance reconstruction information refRecY and chrominance reconstruction information refRecC), a set of filter coefficients can be derived by minimizing the MSE between the chrominance reconstruction value and the chrominance value predicted by the CP-CCCM, as shown in the aforementioned formula (12).

[0473] Here, the specific process of minimizing the MSE to derive the filter coefficients is shown in the aforementioned equations (13) to (19), which will not be described in detail here. Specifically, by solving the linear equation group shown in equation (18), a set of filter coefficients can be obtained, which minimizes the MSE between the expected output after filtering, that is, the chrominance value predicted by CP-CCCM and the expected output reconstructed chrominance value, that is, the Wiener filter coefficients. This set of Wiener filter coefficients is a set of filter coefficients for the current block. In addition, in the process of solving the linear equation group, the autocorrelation matrix of the luminance reconstruction information refRecY is first calculated, and then the cross-correlation vector of the luminance reconstruction information refRecY and the chrominance reconstruction information refRecC is calculated. Then, the autocorrelation matrix is ​​subjected to Cholesky decomposition or LDL decomposition, and finally, each filter coefficient c is calculated in sequence by reverse recursion. n .

[0474] S1103: Calculate the chrominance prediction value of the current block according to the filter coefficient.

[0475] It should also be noted that for the current block, a set of filter coefficients can be obtained by the above method. The filter coefficients are c0, c1, c2...c nTap-1 , the set of filter coefficients can be fixed-point or not. Then, based on the filter shape and filter coefficients, the luminance sample corresponding to the current chrominance sampling point to be predicted is convolved, for example, with a luminance reference value at the same position. The luminance reference value can be the luminance sample value at the same position of the chrominance sampling point, or it can be the value of the luminance sample value after filtering. The specific calculation process of the chrominance prediction value is as follows:

[0476] Assuming the filter shape is rectangular, that is, FilterIdx is 2, and the number of filter taps nTap is 6, the filter (or "filter template") is shown in Figure 13A, where c0 to c5 are the filter coefficients in the filter. Among them, the filter coefficient c1 corresponds to the current chrominance pixel to be predicted C pred [i][j] corresponds to the same brightness point Y colocated [i][j], this co-located luminance point can be the current predicted luminance curpredY[i][j] obtained by weighting the corresponding points of the matching block; the remaining points are luminance points adjacent to the current spatial position (note that the adjacent luminance points here can be obtained by upsampling filtering, downsampling filtering, etc., just like the co-located luminance points). In this way, according to the filter template of Figure 13A, the final predicted chrominance pixel C pred [i][j] are shown as black dots in Figure 13B.

[0477] In a specific embodiment, the calculation process of the chrominance prediction value is as follows:

[0478] For the current luminance pixel position (i, j) of the chrominance to be predicted, its luminance pixel position in the filter template is (k, l), and the corresponding luminance pixel is FilterY[k][l]. Then for the pixel (k, l) in the filter template at the (i, j) pixel position, its filter coefficient is defined as c i,j,k,l ,Right now:

[0479] c i,j,k,l =c n (twenty four)

[0480] Where n=0,1,...,nTap-1,i=0,...,predSizeW-1,j=0,...,predSizeH-1。It should be noted that when k=i,l=j, it is the current co-located luminance pixel, that is, colocatedY[i][j]=FilterY[k][l];

[0481] When k=i=0,...,predSizeW-1, l=j=0,...,predSizeH-1, FilterY[k][l]=currpredY[k][l].

[0482] Thus, for i=0,...,predSizeW-1, j=0,...,predSizeH-1:

[0483] C pred [i][j]=∑ k,l FilterY[k][l]×C i,j,k,l (25)

[0484] In one possible implementation, when inter_pred_idc is 0 or 1, unidirectional prediction in CP-CCCM mode is performed. The unidirectional prediction process is shown in FIG14 , and the process may include:

[0485] S1401: Obtain a forward motion vector or a backward motion vector of a current block.

[0486] S1402: Determine a forward or backward luminance matching block and determine a forward or backward chrominance matching block.

[0487] S1403: Determine filter coefficients.

[0488] S1404: Determine the luma prediction block of the current block.

[0489] S1405: Determine the chrominance prediction value of the current block by performing CP-CCCM prediction.

[0490] In another possible implementation, when inter_pred_idc is 2, bidirectional prediction in the CP-CCCM mode is performed. The unidirectional prediction process is shown in FIG. 15, and the process may include:

[0491] S1501: Obtain the forward motion vector of the current block.

[0492] S1502: Determine the forward luminance matching block and determine the forward chrominance matching block.

[0493] S1503: Obtain the backward motion vector of the current block.

[0494] S1504: Determine the backward luminance matching block and determine the backward chrominance matching block.

[0495] S1505: Determine the filter coefficient.

[0496] S1506: Determine the luminance prediction block of the current block.

[0497] S1507: Determine the chrominance prediction value of the current block by performing CP-CCCM prediction.

[0498] S1104: Perform a correction operation on the chrominance prediction value of the current block.

[0499] It should also be noted that in the embodiments of the present application, the chrominance prediction value needs to be limited within a preset numerical range. If it exceeds this preset numerical range, a corresponding correction operation should be performed. For example:

[0500] The clamping operation can be performed on the chrominance prediction value of C pred [i][j] as follows:

[0501] ● When the value of C pred [i][j] is less than 0, set it to 0;

[0502] ● When the value of C pred [i][j] is greater than (1 << BitDepth)-1, set it to (1 << BitDepth)-1. <0​​​​​​​​​[i][j]) (26)

[0506] in,

[0507]

[0508] S1004: Perform a post-processing operation on the chroma prediction value of the current block to determine a target chroma prediction value of the current block.

[0509] It should also be noted that the chrominance prediction output predCpcccm based on the convolutional cross-component model needs to be post-processed under certain conditions as the final target chrominance prediction value predSamples, otherwise the final target chrominance prediction value predSamples is predCpcccm.

[0510] For example, when predSizeW in the CP-CCCM core parameter is not equal to the width nTbW of the current block or predSizeH is not equal to the height nTbH of the current block, it is necessary to perform an up- or down-sampling operation on predCpcccm to obtain the final target chroma prediction value predSamples.

[0511] For example, in order to improve the chrominance prediction quality of CP-CCCM, filtering enhancement may be performed on predCpcccm to obtain the final target chrominance prediction value predSamples.

[0512] For example, in order to further improve the accuracy of the CP-CCCM prediction value, the chroma prediction value calculated by the original chroma weighted prediction and the chroma prediction value predCpcccm calculated by the CP-CCCM can be weightedly fused, and the fusion result can be used as the final target chroma prediction value predSamples.

[0513] For example, in order to improve the prediction performance of CP-CCCM, a neural network may be used to correct the prediction output predCpcccm of CP-CCCM.

[0514] It can also be understood that in an embodiment of the present application, the input information obtained includes the reconstructed luminance and reconstructed chrominance of the List0 matching block or the List1 matching block used to calculate the filter coefficient and the existing luminance information of the current block, wherein the existing luminance information of the current block is the weighted luminance value currPredY of the forward matching block and / or the backward matching block.

[0515] In this embodiment of the present application, the weighted luminance value can be replaced with the existing luminance reconstruction value currecY of the current block, that is, the luminance pixels are first reconstructed and stored, and the stored luminance reconstruction information of the current block is used for chrominance prediction of the current block. Alternatively, the embodiment of the present application can use the reconstructed luminance refRecTemplateY and reconstructed chrominance refRecTemplateC of the adjacent template of the List0 matching block or the List1 matching block as input information to calculate the filter coefficients.

[0516] It can also be understood that in the embodiment of the present application, the filter coefficients finally calculated are the tap coefficients corresponding to the filter template, that is, the number of filter coefficients is equal to the number of filter template taps nTap. In addition, several bias terms can be added to the filter. For example, in the embodiment of the present application, when FilterIdx=1, nTap=5 is a cross filter, the filter coefficients are the tap coefficients c0 to c4 corresponding to the filter template, and the chroma prediction value obtained by calculating the (i, j) position is shown in formula (22). If the bias term bias can be added, then it is shown in formula (23).

[0517] Among them, bias can include coefficient terms involved in the calculation of filter coefficients, such as bias = c n ×Constant. Wherein, Constant can be a fixed constant, such as Constant = 1 << (BitDepth-1); it can also be a value related to the brightness pixel value of the same position (i, j), such as Constant = f(FilterY[i][j]); it can also be a value related to the brightness pixel value corresponding to a tap in the filter template other than the same brightness position (i, j), such as Constant = f(FilterY[k][l]). Constant = f(FilterY[i][j]) or Constant = f(FilterY[k][l]) can be a linear mapping relationship or a nonlinear mapping relationship; there is no specific limitation on this here.

[0518] In addition, bias may not include coefficient terms involved in the calculation of filter coefficients, such as bias = Constant. Wherein, Constant can be a fixed constant, such as Constant = 1 < < (BitDepth-1); it can also be a value related to the brightness pixel value of the same position (i, j), such as Constant = f(FilterY[i][j]); it can also be a value related to the brightness pixel value corresponding to a tap in the filter template other than the same brightness position (i, j), such as Constant = f(FilterY[k][l]). Constant = f(FilterY[i][j]) or Constant = f(FilterY[k][l]) can be a linear mapping relationship or a nonlinear mapping relationship; this is not specifically limited here.

[0519] The above embodiments illustrate the specific implementation of the aforementioned embodiments in detail. It can be seen that this embodiment proposes a new inter-frame chroma prediction technique, CP-CCCM, which utilizes the matching block information of the current block to obtain filter coefficients that are applied to the existing luminance information of the current block for chroma prediction. On the one hand, CP-CCCM fully utilizes the luminance and chrominance information of the matching block of the current block to calculate filter coefficients. These filter coefficients fully reflect the correlation between the luminance and chrominance of the matching block. On the other hand, CP-CCCM fully utilizes the existing luminance information of the current block to apply filter coefficients that reflect the correlation between luminance and chrominance to the existing luminance information of the current block for chroma prediction. Thus, the filter coefficients are determined based on the reconstructed luminance and reconstructed chrominance information of the matching block. The filter coefficients are calculated by minimizing the MSE between the predicted chrominance (actual chrominance output = filter coefficient × reconstructed luminance) and the reconstructed chrominance (expected output) in the matching block. Furthermore, the filter coefficients fully reflect the correlation between the reconstructed luminance and chrominance of the matching block. This correlation is applied to the existing luminance information of the current block for chroma prediction, thereby improving the accuracy of inter-frame chrominance prediction, thereby improving codec efficiency and, therefore, codec performance.

[0520] In another embodiment of the present application, based on the same inventive concept as the above embodiment, see FIG16 , which shows a schematic diagram of the structure of an encoder 160 provided in an embodiment of the present application. As shown in FIG16 , the encoder 160 may include: a first determination unit 1601 and a first prediction unit 1602; wherein,

[0521] The first determining unit 1601 is configured to determine a prediction parameter of a current block; and determine a first prediction block of the current block according to the prediction parameter;

[0522] The first determining unit 1601 is further configured to determine a model parameter according to the first color component value and the second color component value in the first prediction block;

[0523] The first prediction unit 1602 is configured to determine a reference sample value of a first color component sampling point of the current block, and determine a predicted value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameters;

[0524] The first determining unit 1601 is further configured to determine a prediction difference value of the second color component sampling point of the current block according to the prediction value of the second color component sampling point of the current block.

[0525] In some embodiments, the first determination unit 1601 is further configured to determine an initial value of the second color component sampling point of the current block; and determine a predicted difference value of the second color component sampling point of the current block based on the initial value of the second color component sampling point of the current block and the predicted value of the second color component sampling point of the current block.

[0526] In some embodiments, referring to FIG. 16 , the encoder 160 may further include an encoding unit 1603 configured to encode the predicted difference value of the second color component sampling point of the current block and write the obtained encoded bits into the bitstream.

[0527] In some embodiments, the encoding unit 1603 is further configured to encode the prediction parameters and write the obtained encoded bits into the bitstream.

[0528] In some embodiments, the prediction parameters include: motion vector, reference image index, and inter-frame prediction identification parameter, wherein the inter-frame prediction identification parameter indicates the prediction method used to encode the current block, and the prediction methods include list0 prediction, list1 prediction, and bidirectional prediction.

[0529] In some embodiments, the inter-frame prediction flag parameter indicates that the prediction method used to encode the current block is bidirectional prediction.

[0530] In some embodiments, the first determining unit 1601 is further configured to determine a List0 prediction block of the current block and a List1 prediction block of the current block according to the prediction parameters.

[0531] In some embodiments, the first determination unit 1601 is further configured such that the first prediction block is the List0 prediction block of the current block; or, the first prediction block is the List1 prediction block of the current block; or, the first prediction block is the List0 prediction block of the current block and the List1 prediction block of the current block.

[0532] In some embodiments, the first determining unit 1601 is further configured so that the model parameters include coefficients of the target filter.

[0533] In some embodiments, the first determining unit 1601 is further configured to determine coefficients of a target filter according to the first color component value and the second color component value in the first prediction block.

[0534] In some embodiments, the first determination unit 1601 is further configured so that the coefficient of the target filter is the coefficient used by the target filter when the first error between the second color component value in the first prediction block and the output value of the first color component value in the first prediction block after being processed by the target filter meets the first condition.

[0535] In some embodiments, the first determining unit 1601 is further configured such that the first condition is that the first error is minimized.

[0536] In some embodiments, the first determining unit 1601 is further configured such that the first condition is that the first error is within a first preset threshold range.

[0537] In some embodiments, the first determining unit 1601 is further configured such that the first condition is that the variation of the first error is within a second preset threshold range.

[0538] In some embodiments, the first determination unit 1601 is further configured to determine an autocorrelation parameter based on the first color component value in the first prediction block; and determine a cross-correlation parameter based on the first color component value and the second color component value in the first prediction block; and determine the coefficient of the target filter based on the autocorrelation parameter and the cross-correlation parameter.

[0539] In some embodiments, the first determining unit 1601 is further configured to determine the number of coefficients of the target filter.

[0540] In some embodiments, the encoding unit 1603 is further configured to encode the number of coefficients of the target filter and write the obtained coded bits into the bitstream.

[0541] In some embodiments, the first determining unit 1601 is further configured to set the number of coefficients of the target filter to be equal to a first preset constant value.

[0542] In some embodiments, the first determining unit 1601 is further configured to determine first block category identification information of the current block; and determine the number of coefficients of the target filter according to the first block category identification information of the current block.

[0543] In some embodiments, the encoding unit 1603 is further configured to encode the first block category identification information of the current block, and write the obtained encoding bits into the bitstream.

[0544] In some embodiments, the first determining unit 1601 is further configured such that the target filter is a one-dimensional or two-dimensional filter of a preset shape.

[0545] In some embodiments, the first determining unit 1601 is further configured to determine a shape of a target filter.

[0546] In some embodiments, the encoding unit 1603 is further configured to encode the shape of the target filter and write the obtained encoded bits into the bitstream.

[0547] In some embodiments, the first determining unit 1601 is further configured to determine a value of a filter shape parameter, wherein the filter shape parameter indicates a shape of a target filter.

[0548] In some embodiments, the first determining unit 1601 is further configured to determine second identification information of the block category of the current block; and determine the value of the filter shape parameter according to the second identification information of the block category of the current block.

[0549] In some embodiments, the encoding unit 1603 is further configured to encode the values ​​of the filter shape parameters and write the obtained encoded bits into the bitstream.

[0550] In some embodiments, the encoding unit 1603 is further configured to encode the second block category identification information of the current block, and write the obtained encoding bits into the bitstream.

[0551] In some embodiments, the first determining unit 1601 is further configured to determine a reference sample value of the first color component sampling point of the current block according to the reconstructed value of the first color component sampling point of the current block.

[0552] In some embodiments, the first determining unit 1601 is further configured to determine a reconstructed value of a first color component sampling point of the current block according to the first color component value in the first prediction block.

[0553] In some embodiments, the first determination unit 1601 is further configured to determine the reconstructed value of the first color component sampling point of the current block based on the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block.

[0554] In some embodiments, the first determination unit 1601 is further configured to determine the predicted value of the first color component sampling point of the current block based on the first color component value in the first prediction block; and determine the reference sample value of the first color component sampling point of the current block based on the predicted value of the first color component sampling point of the current block.

[0555] In some embodiments, the first determination unit 1601 is further configured to determine the predicted value of the first color component sampling point of the current block according to the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block.

[0556] In some embodiments, the first determination unit 1601 is further configured to determine the List0 weighting coefficient of the List0 prediction block of the current block and the List1 weighting coefficient of the List1 prediction block of the current block; and determine the weighted sum of the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block based on the List0 weighting coefficient and the List1 weighting coefficient; and determine the predicted value of the first color component sampling point of the current block based on the weighted sum.

[0557] In some embodiments, the first determining unit 1601 is further configured to determine a first input value of the target filter based on a reference sample value of a first color component sampling point of the current block;

[0558] The first prediction unit 1602 is further configured to determine a first output value of the target filter based on the first input value and the model parameter; and determine a predicted value of a second color component sampling point of the current block based on the first output value.

[0559] In some embodiments, referring to FIG. 16 , the encoder 160 may further include a first filtering unit 1604 configured to perform a first filtering process on the reference sample value of the first color component sampling point of the current block to determine a first input value.

[0560] In some embodiments, the first filtering unit 1604 is further configured so that the first filtering process includes at least one of the following: low-pass filtering and down-sampling filtering.

[0561] In some embodiments, the first filtering unit 1604 is further configured to set the first input value to be equal to the reference sample value of the first color component sampling point of the current block in the first filtering process.

[0562] In some embodiments, the first filtering unit 1604 is further configured to perform a second filtering process on the first output value to determine a second output value; and determine a predicted value of a second color component sampling point of the current block based on the second output value.

[0563] In some embodiments, the first filtering unit 1604 is further configured so that the second filtering process includes at least one of the following: low-pass filtering and up-sampling filtering.

[0564] In some embodiments, the first filtering unit 1604 is further configured to set the second output value to be equal to the first output value in the second filtering process.

[0565] In some embodiments, the first determining unit 1601 is further configured so that the first output value includes predicted values ​​of some second color component sampling points in the current block.

[0566] In some embodiments, the first prediction unit 1602 is further configured to perform a first process on the second output value to obtain a predicted value of a second color component sampling point of the current block.

[0567] In some embodiments, the first prediction unit 1602 is further configured so that the first processing is a clamping operation that limits the second output value to a preset value range.

[0568] In some embodiments, the first prediction unit 1602 is further configured to perform an addition operation according to the first output value and the first offset value to determine a prediction value of the second color component sampling point of the current block.

[0569] In some embodiments, the first determining unit 1601 is further configured to set the first offset value to be equal to a preset constant value; or, set the first offset value to be equal to a value of the first input value in a preset mapping relationship.

[0570] In some embodiments, the first determination unit 1601 is further configured to determine a predicted difference value of the first color component sampling point of the current block; and determine a reference sample value of the first color component sampling point of the current block based on the predicted difference value of the first color component sampling point of the current block.

[0571] In some embodiments, the first determining unit 1601 is further configured to determine a first color component residual value and a second color component residual value in the first prediction block; and determine a model parameter according to the first color component residual value and the second color component residual value in the first prediction block;

[0572] The first prediction unit 1602 is further configured to determine an initial prediction difference value of a second color component sampling point of the current block based on the prediction difference value of the first color component sampling point of the current block and the model parameters; and determine an initial prediction value of the second color component sampling point of the current block based on the first prediction block; and determine a prediction value of the second color component sampling point of the current block based on the initial prediction difference value and the initial prediction value of the second color component sampling point of the current block.

[0573] It is understandable that in the embodiments of the present application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.

[0574] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0575] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 160. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method described in any one of the aforementioned embodiments.

[0576] Based on the composition of the encoder 160 and the computer-readable storage medium, refer to Figure 17, which shows a specific hardware structure diagram of the encoder 160 provided in an embodiment of the present application. As shown in Figure 17, the encoder 160 may include: a first communication interface 1701, a first memory 1702 and a first processor 1703; each component is coupled together through a first bus system 1704. It can be understood that the first bus system 1704 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 1704 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 1704 in Figure 17. Among them,

[0577] The first communication interface 1701 is used to receive and send signals when sending and receiving information with other external network elements;

[0578] A first memory 1702 is used to store computer programs that can be run on the first processor 1703;

[0579] The first processor 1703 is configured to, when running the computer program, execute:

[0580] Determine prediction parameters of the current block; determine a first prediction block of the current block based on the prediction parameters; determine model parameters based on the first color component value and the second color component value in the first prediction block; determine a reference sample value of a first color component sampling point of the current block, and determine a prediction value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameters; determine a prediction difference value of the second color component sampling point of the current block based on the prediction value of the second color component sampling point of the current block.

[0581] It is understood that the first memory 1702 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 1702 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0582] The first processor 1703 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 1703. The above-mentioned first processor 1703 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 1702 , and the first processor 1703 reads the information in the first memory 1702 and completes the steps of the above method in combination with its hardware.

[0583] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0584] Optionally, as another embodiment, the first processor 1703 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0585] This embodiment provides an encoder, in which model parameters are determined based on the first color component value and the second color component value in the first prediction block. The model parameters fully reflect the correlation between brightness and chrominance in the prediction block, and this correlation is applied to the existing brightness information of the current block to perform chrominance prediction, thereby improving the accuracy of inter-frame chrominance prediction, saving bit rate, and improving encoding and decoding efficiency, thereby improving encoding and decoding performance.

[0586] In another embodiment of the present application, based on the same inventive concept as the above embodiment, refer to FIG18 , which shows a schematic diagram of the structure of a decoder 180 provided by the embodiment of the present application. As shown in FIG18 , the decoder 180 may include: a decoding unit 1801, a second determination unit 1802, and a second prediction unit 1803; wherein,

[0587] The decoding unit 1801 is configured to decode the code stream and determine the prediction parameters of the current block;

[0588] The second determining unit 1802 is configured to determine a first prediction block of the current block according to the prediction parameters; and determine a model parameter according to the first color component value and the second color component value in the first prediction block;

[0589] The second prediction unit 1803 is configured to determine a reference sample value of a first color component sampling point of the current block, and determine a predicted value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameters;

[0590] The second determining unit 1802 is further configured to determine the reconstructed value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block.

[0591] In some embodiments, the prediction parameters include: motion vector, reference image index, and inter-frame prediction identification parameter, wherein the inter-frame prediction identification parameter indicates the prediction method used to decode the current block, and the prediction methods include List0 prediction, List1 prediction, and bidirectional prediction.

[0592] In some embodiments, the inter-frame prediction identification parameter indicates that the prediction method used for decoding the current block is bidirectional prediction.

[0593] In some embodiments, the second determining unit 1802 is further configured to determine a List0 prediction block of the current block and a List1 prediction block of the current block according to the prediction parameters.

[0594] In some embodiments, the second determining unit 1802 is further configured such that the first prediction block is the List0 prediction block of the current block; or, the first prediction block is the List1 prediction block of the current block; or, the first prediction block is the List0 prediction block of the current block and the List1 prediction block of the current block.

[0595] In some embodiments, the second determining unit 1802 is further configured so that the model parameters include coefficients of the target filter.

[0596] In some embodiments, the second determining unit 1802 is further configured to determine coefficients of the target filter according to the first color component value and the second color component value in the first prediction block.

[0597] In some embodiments, the second determination unit 1802 is further configured so that the coefficient of the target filter is the coefficient used by the target filter when the first error between the second color component value in the first prediction block and the output value of the first color component value in the first prediction block after being processed by the target filter meets the first condition.

[0598] In some embodiments, the second determining unit 1802 is further configured such that the first condition is that the first error is minimized.

[0599] In some embodiments, the second determining unit 1802 is further configured such that the first condition is that the first error is within a first preset threshold range.

[0600] In some embodiments, the second determining unit 1802 is further configured such that the first condition is that the variation of the first error is within a second preset threshold range.

[0601] In some embodiments, the second determination unit 1802 is further configured to determine an autocorrelation parameter based on the first color component value in the first prediction block; and determine a cross-correlation parameter based on the first color component value and the second color component value in the first prediction block; and determine the coefficient of the target filter based on the autocorrelation parameter and the cross-correlation parameter.

[0602] In some embodiments, the second determining unit 1802 is further configured to set the number of coefficients of the target filter to be equal to a first preset constant value.

[0603] In some embodiments, the decoding unit 1801 is further configured to decode the code stream and determine the number of coefficients of the target filter.

[0604] In some embodiments, the second determining unit 1802 is further configured to determine first identification information of the block category of the current block; and determine the number of coefficients of the target filter according to the first identification information of the block category of the current block.

[0605] In some embodiments, the second determining unit 1802 is further configured to configure the target filter to be a one-dimensional or two-dimensional filter of a preset shape.

[0606] In some embodiments, the decoding unit 1801 is further configured to decode the code stream and determine the shape of the target filter.

[0607] In some embodiments, the second determining unit 1802 is further configured to determine a value of a filter shape parameter, wherein the filter shape parameter indicates a shape of a target filter.

[0608] In some embodiments, the second determining unit 1802 is further configured to determine second identification information of the block category of the current block; and determine the value of the filter shape parameter according to the second identification information of the block category of the current block.

[0609] In some embodiments, the second determining unit 1802 is further configured to determine a reference sample value of the first color component sampling point of the current block according to the reconstructed value of the first color component sampling point of the current block.

[0610] In some embodiments, the second determining unit 1802 is further configured to determine a reconstructed value of a first color component sampling point of the current block according to the first color component value in the first prediction block.

[0611] In some embodiments, the second determining unit 1802 is further configured to determine the reconstructed value of the first color component sampling point of the current block according to the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block.

[0612] In some embodiments, the second determination unit 1802 is further configured to determine the predicted value of the first color component sampling point of the current block based on the first color component value in the first prediction block; and determine the reference sample value of the first color component sampling point of the current block based on the predicted value of the first color component sampling point of the current block.

[0613] In some embodiments, the second determining unit 1802 is further configured to determine the predicted value of the first color component sampling point of the current block according to the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block.

[0614] In some embodiments, the second determination unit 1802 is further configured to determine the List0 weighting coefficient of the List0 prediction block of the current block and the List1 weighting coefficient of the List1 prediction block of the current block; and determine the weighted sum of the first color component value in the List0 prediction block of the current block and the first color component value in the List1 prediction block of the current block based on the List0 weighting coefficient and the List1 weighting coefficient; and determine the predicted value of the first color component sampling point of the current block based on the weighted sum.

[0615] In some embodiments, the second determining unit 1802 is further configured to determine a first input value of the target filter based on a reference sample value of a first color component sampling point of the current block;

[0616] The second prediction unit 1803 is further configured to determine a first output value of the target filter based on the first input value and the model parameter; and determine a predicted value of a second color component sampling point of the current block based on the first output value.

[0617] In some embodiments, referring to FIG. 18 , the decoder 180 may further include a second filtering unit 1804 configured to perform a first filtering process on the reference sample value of the first color component sampling point of the current block to determine a first input value.

[0618] In some embodiments, the second filtering unit 1804 is further configured so that the first filtering process includes at least one of the following: low-pass filtering and down-sampling filtering.

[0619] In some embodiments, the second filtering unit 1804 is further configured to set the first input value to be equal to the reference sample value of the first color component sampling point of the current block for the first filtering process.

[0620] In some embodiments, the second filtering unit 1804 is further configured to perform a second filtering process on the first output value to determine a second output value; and determine a predicted value of a second color component sampling point of the current block based on the second output value.

[0621] In some embodiments, the second filtering unit 1804 is further configured so that the second filtering process includes at least one of the following: low-pass filtering and up-sampling filtering.

[0622] In some embodiments, the second filtering unit 1804 is further configured to set the second output value to be equal to the first output value for the second filtering process.

[0623] In some embodiments, the second determining unit 1802 is further configured so that the first output value includes predicted values ​​of some second color component sampling points in the current block.

[0624] In some embodiments, the second prediction unit 1803 is further configured to perform a first process on the second output value to obtain a predicted value of a second color component sampling point of the current block.

[0625] In some embodiments, the second prediction unit 1803 is further configured so that the first processing is a clamping operation that limits the second output value to a preset value range.

[0626] In some embodiments, the second prediction unit 1803 is further configured to perform an addition operation according to the first output value and the first offset value to determine a prediction value of the second color component sampling point of the current block.

[0627] In some embodiments, the second determining unit 1802 is further configured to set the first offset value to be equal to a preset constant value; or, set the first offset value to be equal to a value of the first input value in a preset mapping relationship.

[0628] In some embodiments, the second determination unit 1802 is further configured to determine a predicted difference value of the first color component sampling point of the current block; and determine a reference sample value of the first color component sampling point of the current block based on the predicted difference value of the first color component sampling point of the current block.

[0629] In some embodiments, the second determining unit 1802 is further configured to determine a first color component residual value and a second color component residual value in the first prediction block; and determine a model parameter according to the first color component residual value and the second color component residual value in the first prediction block;

[0630] The second prediction unit 1803 is further configured to determine the initial prediction difference value of the second color component sampling point of the current block based on the prediction difference value of the first color component sampling point of the current block and the model parameters; and determine the initial prediction value of the second color component sampling point of the current block based on the first prediction block; and determine the prediction value of the second color component sampling point of the current block based on the initial prediction difference value and the initial prediction value of the second color component sampling point of the current block.

[0631] In some embodiments, the decoding unit 1801 is further configured to decode the code stream to determine a predicted difference value of a second color component sampling point of the current block;

[0632] The second determining unit 1802 is further configured to determine the reconstructed value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block and the predicted difference value of the second color component sampling point of the current block.

[0633] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.

[0634] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium for use in decoder 180. The computer-readable storage medium stores a computer program that, when executed by a second processor, implements any of the methods described in the aforementioned embodiments.

[0635] Based on the composition of the decoder 180 and the computer-readable storage medium, refer to Figure 19, which shows a specific hardware structure diagram of the decoder 180 provided in an embodiment of the present application. As shown in Figure 19, the decoder 180 may include: a second communication interface 1901, a second memory 1902 and a second processor 1903; each component is coupled together through a second bus system 1904. It can be understood that the second bus system 1904 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 1904 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the second bus system 1904 in Figure 19. Among them,

[0636] The second communication interface 1901 is used for sending and receiving signals when sending and receiving information with other external network elements;

[0637] The second memory 1902 is used to store computer programs that can be run on the second processor 1903;

[0638] The second processor 1903 is configured to, when running the computer program, execute:

[0639] Decoding a code stream, determining prediction parameters of a current block; determining a first prediction block of the current block based on the prediction parameters; determining model parameters based on the first color component value and the second color component value in the first prediction block; determining a reference sample value of a first color component sampling point of the current block, and determining a prediction value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameters; and determining a reconstructed value of the second color component sampling point of the current block based on the prediction value of the second color component sampling point of the current block.

[0640] Optionally, as another embodiment, the second processor 1903 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0641] It can be understood that the hardware functions of the second memory 1902 are similar to those of the first memory 1702, and the hardware functions of the second processor 1903 are similar to those of the first processor 1703; they will not be described in detail here.

[0642] This embodiment provides a decoder, in which model parameters are determined based on the first color component value and the second color component value in the first prediction block. The model parameters fully reflect the correlation between brightness and chrominance in the prediction block, and this correlation is applied to the existing brightness information of the current block to perform chrominance prediction, thereby improving the accuracy of inter-frame chrominance prediction, saving bit rate, and improving encoding and decoding efficiency, thereby improving encoding and decoding performance.

[0643] In yet another embodiment of the present application, referring to FIG20 , a schematic diagram of the structure of a coding and decoding system provided by an embodiment of the present application is shown. As shown in FIG20 , the coding and decoding system 200 may include an encoder 2001 and a decoder 2002 .

[0644] In the embodiment of the present application, the encoder 2001 may be the encoder described in any one of the aforementioned embodiments, and the decoder 2002 may be the decoder described in any one of the aforementioned embodiments.

[0645] It should be noted that, in this application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0646] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0647] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0648] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

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

[0650] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims. Industrial Applicability

[0651] In an embodiment of the present application, after determining the prediction parameters for a current block, both the encoder and decoder determine a first prediction block for the current block based on the prediction parameters. Model parameters are determined based on the first and second color component values ​​in the first prediction block. Reference sample values ​​for the first color component sampling points of the current block are then determined, and predicted values ​​for the second color component sampling points of the current block are determined based on the reference sample values ​​and the model parameters. In this way, the encoder can determine predicted differences for the second color component sampling points of the current block based on the predicted values ​​for the second color component sampling points of the current block. This allows the decoder to determine reconstructed values ​​for the second color component sampling points of the current block based on the predicted values ​​for the second color component sampling points of the current block. In other words, the model parameters are determined based on the first and second color component values ​​in the first prediction block. These model parameters fully reflect the correlation between luminance and chrominance in the prediction block, and this correlation is applied to the existing luminance information of the current block for chrominance prediction. This improves the accuracy of inter-frame chrominance prediction, saves bitrate, and increases encoding and decoding efficiency, thereby enhancing encoding and decoding performance.

Claims

1. A decoding method, comprising: Decode the code stream and determine the prediction parameters of the current block; Determining a first prediction block of the current block according to the prediction parameters; determining model parameters according to the first color component value and the second color component value in the first prediction block; Determine a reference sample value of a first color component sampling point of the current block, and determine a predicted value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameter; Determine a reconstructed value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block.

2. The method according to claim 1, wherein The prediction parameters include: A motion vector, a reference image index, and an inter-frame prediction identification parameter, wherein the inter-frame prediction identification parameter indicates a prediction method used for decoding the current block, and the prediction methods include List0 prediction, List1 prediction, and bidirectional prediction.

3. The method according to claim 2, wherein: The method further comprises: The inter-frame prediction identification parameter indicates that the prediction method used for decoding the current block is bidirectional prediction.

4. The method according to claim 2, wherein: The method further comprises: According to the prediction parameters, a List0 prediction block of the current block and a List1 prediction block of the current block are determined.

5. The method according to claim 4, wherein The method further comprises: The first prediction block is a List0 prediction block of the current block; or The first prediction block is a List1 prediction block of the current block; or The first prediction blocks are a List0 prediction block of the current block and a List1 prediction block of the current block.

6. The method according to claim 5, wherein: The determining of the model parameters according to the first color component value and the second color component value in the first prediction block includes: The model parameters include coefficients of the target filter.

7. The method according to claim 6, wherein: The method further comprises: The coefficients of the target filter are determined according to the first color component value and the second color component value in the first prediction block.

8. The method according to claim 6, wherein: The method further comprises: The coefficients of the target filter are coefficients used by the target filter when a first error between an output value of the second color component value in the first prediction block and a first color component value in the first prediction block processed by the target filter meets a first condition.

9. The method according to claim 8, wherein The method further comprises: The first condition is that the first error is minimum.

10. The method according to claim 8, wherein The method further comprises: The first condition is that the first error is within a first preset threshold range.

11. The method according to claim 8, wherein The method further comprises: The first condition is that the change in the first error is within a second preset threshold range.

12. The method according to claim 7, wherein: The determining the coefficient of the target filter according to the first color component value and the second color component value in the first prediction block includes: determining an autocorrelation parameter according to a first color component value in the first prediction block; determining a cross-correlation parameter based on a first color component value and a second color component value in the first prediction block; The coefficients of the target filter are determined according to the autocorrelation parameter and the cross-correlation parameter.

13. The method according to claim 6, wherein: The method further comprises: The number of coefficients of the target filter is equal to a first preset constant value.

14. The method according to claim 6, wherein The method further comprises: The code stream is decoded to determine the number of coefficients of the target filter.

15. The method according to claim 14, wherein The method further comprises: Determining first block category identification information of the current block; The number of coefficients of the target filter is determined according to the first block category identification information of the current block.

16. The method according to claim 6, wherein The method further comprises: The target filter is a one-dimensional or two-dimensional filter with a preset shape.

17. The method according to claim 6, wherein The method further comprises: The code stream is decoded to determine the shape of the target filter.

18. The method according to claim 17, wherein The method further comprises: A value of a filter shape parameter is determined, wherein the filter shape parameter indicates a shape of the target filter.

19. The method according to claim 18, wherein The method further comprises: Determining second block category identification information of the current block; The value of the filter shape parameter is determined according to the second block category identification information of the current block.

20. The method according to claim 1, wherein The determining of the reference sample value of the first color component sampling point of the current block includes: Determine a reference sample value of the first color component sampling point of the current block according to the reconstructed value of the first color component sampling point of the current block.

21. The method according to claim 20, wherein The method further comprises: Determine a reconstructed value of a first color component sampling point of the current block according to a first color component value in the first prediction block.

22. The method according to claim 21, wherein The determining, according to the first color component value in the first prediction block, a reconstructed value of the first color component sampling point of the current block includes: Determine a reconstructed value of a first color component sampling point of the current block according to a first color component value in a List0 prediction block of the current block and a first color component value in a List1 prediction block of the current block.

23. The method according to claim 1, wherein The determining of the reference sample value of the first color component sampling point of the current block includes: Determining a predicted value of a first color component sampling point of the current block according to a first color component value in the first prediction block; Determine a reference sample value of the first color component sampling point of the current block according to the predicted value of the first color component sampling point of the current block.

24. The method according to claim 23, wherein The determining, according to the first color component value in the first prediction block, the predicted value of the first color component sampling point of the current block includes: Determine a predicted value of a first color component sampling point of the current block according to a first color component value in a List0 prediction block of the current block and a first color component value in a List1 prediction block of the current block.

25. The method according to claim 24, wherein The method further comprises: Determine a List0 weighting coefficient of a List0 prediction block of the current block and a List1 weighting coefficient of a List1 prediction block of the current block; Determine, according to the List0 weighting coefficient and the List1 weighting coefficient, a weighted sum of a first color component value in a List0 prediction block of the current block and a first color component value in a List1 prediction block of the current block; Determine a predicted value of a first color component sampling point of the current block according to the weighted sum.

26. The method according to claim 6, wherein The determining, based on the reference sample value of the first color component sampling point of the current block and the model parameter, a predicted value of the second color component sampling point of the current block includes: Determining a first input value of the target filter based on a reference sample value of a first color component sampling point of the current block; determining a first output value of the target filter based on the first input value and the model parameter; Based on the first output value, a predicted value of a second color component sampling point of the current block is determined.

27. The method according to claim 26, wherein The determining, according to the reference sample value of the first color component sampling point of the current block, the first input value of the target filter comprises: A first filtering process is performed on the reference sample value of the first color component sampling point of the current block to determine the first input value.

28. The method according to claim 27, wherein The method further comprises: The first filtering process includes at least one of the following: low-pass filtering and down-sampling filtering.

29. The method according to claim 27, wherein The method further comprises: The first filtering process sets the first input value to be equal to a reference sample value of a first color component sampling point of the current block.

30. The method of claim 26, wherein: The step of determining a predicted value of a second color component sampling point of the current block based on the first output value further includes: performing a second filtering process on the first output value to determine a second output value; Based on the second output value, a prediction value of a second color component sampling point of the current block is determined.

31. The method according to claim 30, wherein The method further comprises: The second filtering process includes at least one of the following: low-pass filtering and up-sampling filtering.

32. The method according to claim 30, wherein The method further comprises: The second filtering process sets the second output value equal to the first output value.

33. The method according to claim 30, wherein The method further comprises: The first output value includes the predicted values ​​of some second color component sampling points in the current block.

34. The method of claim 30, wherein: The determining, based on the second output value, a predicted value of the second color component sampling point of the current block, includes: A first process is performed on the second output value to obtain a predicted value of a second color component sampling point of the current block.

35. The method according to claim 34, wherein The method further comprises: The first processing is a clamping operation that limits the second output value to a preset value range.

36. The method of claim 26, wherein: The step of determining a predicted value of a second color component sampling point of the current block based on the first output value further includes: An addition operation is performed according to the first output value and the first offset value to determine a predicted value of the second color component sampling point of the current block.

37. The method according to claim 36, wherein The method further comprises: Setting the first offset value to be equal to a preset constant value; or, The first offset value is set to be equal to the value of the first input value in the preset mapping relationship.

38. The method of claim 1, wherein The method further comprises: Determining a predicted difference value of a first color component sampling point of the current block; Determine a reference sample value of the first color component sampling point of the current block according to the predicted difference value of the first color component sampling point of the current block.

39. The method according to claim 38, wherein The method further comprises: determining a first color component residual value and a second color component residual value in the first prediction block; determining a model parameter according to the first color component residual value and the second color component residual value in the first prediction block; Accordingly, determining the predicted value of the second color component sampling point of the current block according to the reference sample value of the first color component sampling point of the current block and the model parameter includes: determining an initial prediction difference value of a second color component sampling point of the current block according to the prediction difference value of the first color component sampling point of the current block and the model parameter; Determining, according to the first prediction block, an initial prediction value of a second color component sampling point of the current block; Determine a prediction value of the second color component sampling point of the current block according to the initial prediction difference value and the initial prediction value of the second color component sampling point of the current block.

40. The method according to any one of claims 1 to 39, wherein The determining, according to the predicted value of the second color component sampling point of the current block, a reconstructed value of the second color component sampling point of the current block includes: Decoding the bitstream to determine a predicted residual value of a second color component sampling point of the current block; Determine a reconstructed value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block and the predicted difference value of the second color component sampling point of the current block.

41. A coding method comprising: Determine the prediction parameters of the current block; Determining a first prediction block of the current block according to the prediction parameters; determining model parameters according to the first color component value and the second color component value in the first prediction block; Determine a reference sample value of a first color component sampling point of the current block, and determine a predicted value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameter; Determine a prediction difference value of the second color component sampling point of the current block according to the prediction value of the second color component sampling point of the current block.

42. The method according to claim 41, wherein The determining, according to the predicted value of the second color component sampling point of the current block, the predicted difference value of the second color component sampling point of the current block includes: Determining an initial value of a second color component sampling point of the current block; Determine a predicted difference value of the second color component sampling point of the current block according to the initial value of the second color component sampling point of the current block and the predicted value of the second color component sampling point of the current block.

43. The method according to claim 41 or 42, wherein The method further comprises: The predicted difference value of the second color component sampling point of the current block is encoded, and the obtained encoding bits are written into a bitstream.

44. The method of claim 41, wherein The method further comprises: The prediction parameters are encoded, and the obtained encoded bits are written into a bitstream.

45. The method of claim 41, wherein The prediction parameters include: Motion vector, reference image index, inter-frame prediction identification parameter, wherein the inter-frame prediction identification parameter indicates the prediction method used to encode the current block, and the prediction method includes list0 prediction, list1 prediction, and bidirectional prediction.

46. ​​The method of claim 45, wherein The method further comprises: The inter-frame prediction identification parameter indicates that the prediction method used to encode the current block is bidirectional prediction.

47. The method of claim 45, wherein The method further comprises: According to the prediction parameters, a List0 prediction block of the current block and a List1 prediction block of the current block are determined.

48. The method of claim 47, wherein The method further comprises: The first prediction block is a List0 prediction block of the current block; or The first prediction block is a List1 prediction block of the current block; or The first prediction blocks are a List0 prediction block of the current block and a List1 prediction block of the current block.

49. The method according to claim 48, wherein The determining of the model parameters according to the first color component value and the second color component value in the first prediction block includes: The model parameters include coefficients of the target filter.

50. The method of claim 49, wherein The method further comprises: The coefficients of the target filter are determined according to the first color component value and the second color component value in the first prediction block.

51. The method of claim 49, wherein The method further comprises: The coefficients of the target filter are coefficients used by the target filter when a first error between an output value of the second color component value in the first prediction block and a first color component value in the first prediction block processed by the target filter meets a first condition.

52. The method of claim 51, wherein The method further comprises: The first condition is that the first error is minimum.

53. The method of claim 51, wherein The method further comprises: The first condition is that the first error is within a first preset threshold range.

54. The method of claim 51, wherein The method further comprises: The first condition is that the change in the first error is within a second preset threshold range.

55. The method of claim 50, wherein: The determining the coefficient of the target filter according to the first color component value and the second color component value in the first prediction block includes: determining an autocorrelation parameter according to a first color component value in the first prediction block; determining a cross-correlation parameter based on a first color component value and a second color component value in the first prediction block; The coefficients of the target filter are determined according to the autocorrelation parameter and the cross-correlation parameter.

56. The method of claim 49, wherein The method further comprises: The number of coefficients of the target filter is determined.

57. The method of claim 56, wherein The method further comprises: The number of coefficients of the target filter is encoded, and the obtained encoded bits are written into a bitstream.

58. The method of claim 56, wherein Determining the number of coefficients of the target filter includes: The number of coefficients of the target filter is equal to a first preset constant value.

59. The method of claim 56, wherein Determining the number of coefficients of the target filter includes: Determining first block category identification information of the current block; The number of coefficients of the target filter is determined according to the first block category identification information of the current block.

60. The method of claim 59, wherein The method further comprises: The first block category identification information of the current block is encoded, and the obtained encoding bits are written into a bitstream.

61. The method of claim 49, wherein: The method further comprises: The target filter is a one-dimensional or two-dimensional filter with a preset shape.

62. The method of claim 49, wherein The method further comprises: The shape of the target filter is determined.

63. The method of claim 62, wherein: The method further comprises: The shape of the target filter is encoded, and the obtained encoded bits are written into a bitstream.

64. The method of claim 62, wherein Determining the shape of the target filter includes: A value of a filter shape parameter is determined, wherein the filter shape parameter indicates a shape of the target filter.

65. The method of claim 64, wherein The method further comprises: Determining second block category identification information of the current block; The value of the filter shape parameter is determined according to the second block category identification information of the current block.

66. The method of claim 64, wherein The method further comprises: The values ​​of the filter shape parameters are encoded, and the obtained encoded bits are written into a bit stream.

67. The method of claim 65, wherein The method further comprises: The second block category identification information of the current block is encoded, and the obtained encoding bits are written into a bitstream.

68. The method of claim 41, wherein The determining of the reference sample value of the first color component sampling point of the current block includes: Determine a reference sample value of the first color component sampling point of the current block according to the reconstructed value of the first color component sampling point of the current block.

69. The method of claim 68, wherein The method further comprises: Determine a reconstructed value of a first color component sampling point of the current block according to a first color component value in the first prediction block.

70. The method of claim 69, wherein The determining, according to the first color component value in the first prediction block, a reconstructed value of the first color component sampling point of the current block includes: Determine a reconstructed value of a first color component sampling point of the current block according to a first color component value in a List0 prediction block of the current block and a first color component value in a List1 prediction block of the current block.

71. The method of claim 41, wherein The determining of the reference sample value of the first color component sampling point of the current block includes: Determining a predicted value of a first color component sampling point of the current block according to a first color component value in the first prediction block; Determine a reference sample value of the first color component sampling point of the current block according to the predicted value of the first color component sampling point of the current block.

72. The method of claim 71, wherein The determining, according to the first color component value in the first prediction block, the predicted value of the first color component sampling point of the current block includes: Determine a predicted value of a first color component sampling point of the current block according to a first color component value in a List0 prediction block of the current block and a first color component value in a List1 prediction block of the current block.

73. The method of claim 72, wherein: The method further comprises: Determine a List0 weighting coefficient of a List0 prediction block of the current block and a List1 weighting coefficient of a List1 prediction block of the current block; Determine, according to the List0 weighting coefficient and the List1 weighting coefficient, a weighted sum of a first color component value in a List0 prediction block of the current block and a first color component value in a List1 prediction block of the current block; Determine a predicted value of a first color component sampling point of the current block according to the weighted sum.

74. The method of claim 49, wherein The determining, based on the reference sample value of the first color component sampling point of the current block and the model parameter, a predicted value of the second color component sampling point of the current block includes: Determining a first input value of the target filter based on a reference sample value of a first color component sampling point of the current block; determining a first output value of the target filter based on the first input value and the model parameter; Based on the first output value, a predicted value of a second color component sampling point of the current block is determined.

75. The method of claim 74, wherein The determining, according to the reference sample value of the first color component sampling point of the current block, the first input value of the target filter comprises: A first filtering process is performed on the reference sample value of the first color component sampling point of the current block to determine the first input value.

76. The method of claim 75, wherein The method further comprises: The first filtering process includes at least one of the following: low-pass filtering and down-sampling filtering.

77. The method of claim 75, wherein The method further comprises: The first filtering process sets the first input value to be equal to a reference sample value of a first color component sampling point of the current block.

78. The method of claim 74, wherein The step of determining a predicted value of a second color component sampling point of the current block based on the first output value further includes: performing a second filtering process on the first output value to determine a second output value; Based on the second output value, a prediction value of a second color component sampling point of the current block is determined.

79. The method of claim 78, wherein The method further comprises: The second filtering process includes at least one of the following: low-pass filtering and up-sampling filtering.

80. The method of claim 78, wherein The method further comprises: The second filtering process sets the second output value equal to the first output value.

81. The method of claim 78, wherein The method further comprises: The first output value includes the predicted values ​​of some second color component sampling points in the current block.

82. The method of claim 78, wherein The determining, based on the second output value, a predicted value of the second color component sampling point of the current block, includes: A first process is performed on the second output value to obtain a predicted value of a second color component sampling point of the current block.

83. The method of claim 82, wherein The method further comprises: The first processing is a clamping operation that limits the second output value to a preset value range.

84. The method of claim 74, wherein The step of determining a predicted value of a second color component sampling point of the current block based on the first output value further includes: An addition operation is performed according to the first output value and the first offset value to determine a predicted value of the second color component sampling point of the current block.

85. The method of claim 84, wherein The method further comprises: Setting the first offset value to be equal to a preset constant value; or, The first offset value is set to be equal to the value of the first input value in the preset mapping relationship.

86. The method according to any one of claims 41 to 85, wherein The method further comprises: Determining a predicted difference value of a first color component sampling point of the current block; Determine a reference sample value of the first color component sampling point of the current block according to the predicted difference value of the first color component sampling point of the current block.

87. The method of claim 86, wherein The method further comprises: determining a first color component residual value and a second color component residual value in the first prediction block; determining a model parameter according to the first color component residual value and the second color component residual value in the first prediction block; Accordingly, determining the predicted value of the second color component sampling point of the current block according to the reference sample value of the first color component sampling point of the current block and the model parameter includes: determining an initial prediction difference value of a second color component sampling point of the current block according to the prediction difference value of the first color component sampling point of the current block and the model parameter; Determining, according to the first prediction block, an initial prediction value of a second color component sampling point of the current block; Determine a prediction value of the second color component sampling point of the current block according to the initial prediction difference value and the initial prediction value of the second color component sampling point of the current block.

88. A code stream, wherein The code stream is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: The predicted difference value of the second color component sampling point of the current block, the prediction parameters of the current block, the number of coefficients of the target filter, the shape of the target filter, the value of the filter shape parameter, the first block category identification information of the current block, and the second block category identification information of the current block.

89. An encoder comprising a first determining unit and a first predicting unit; wherein, The first determining unit is configured to determine a prediction parameter of a current block; and determine a first prediction block of the current block according to the prediction parameter; The first determining unit is further configured to determine a model parameter according to the first color component value and the second color component value in the first prediction block; The first prediction unit is configured to determine a reference sample value of a first color component sampling point of the current block, and determine a predicted value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameter; The first determining unit is further configured to determine a predicted difference value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block.

90. 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 41 to 87 when running the computer program.

91. 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 the prediction parameters of the current block; The second determining unit is configured to determine a first prediction block of the current block according to the prediction parameter; and determining model parameters based on the first color component value and the second color component value in the first prediction block; The second prediction unit is configured to determine a reference sample value of a first color component sampling point of the current block, and determine a predicted value of a second color component sampling point of the current block based on the reference sample value of the first color component sampling point of the current block and the model parameter; The second determining unit is further configured to determine a reconstructed value of the second color component sampling point of the current block according to the predicted value of the second color component sampling point of the current block.

92. 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 40 when running the computer program.

93. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 40 is implemented, or the method according to any one of claims 41 to 87 is implemented.